http://stackoverflow.com/comment/47288583
type: Comment
has text: @Trufa, what is the distinction? This `<panel>` directive is just a very thin wrapper around the `ng-include` directive. If you just want to hide the details of the template URL, then I can understand that, but then I would place the actual URLs in a configurable service and use that.
comment on: http://stackoverflow.com/a/29561148
type: AnswerComment
score: 0

http://stackoverflow.com/q/29576218
type: Question
score: 0
has body: I need to validate if the entered value of intervalDuration is less than testDuration, but after couple of hours of searching I still was not found any solution which works for me. I’m using the jQuery validation library. Please help me. var $val = jQuery.noConflict(); $val(document).ready(function() { $val("#uniformDistribution").validate({ highlight: function(element) { $val(element).closest('.form-group').removeClass('has-success').addClass('has-error'); }, unhighlight: function(element) { $val(element).closest('.form-group').removeClass('has-error').addClass('has-success'); }, errorElement: 'span', errorClass: 'help-inline', rules: { testDuration: { required: true, digits: true, min: 1, }, intervalDuration: { required: true, number: true, max: "#testDuration", }, }, }); }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;input type="text" class="form-control" name="testDuration" id="testDuration" placeholder="Test duration" required&gt; &lt;input type="text" class="form-control" name="intervalDuration" id="intervalDuration" placeholder="Interval duration" required&gt;
linked to: http://stackoverflow.com/q/5036618
tagged with: validation
tagged with: max
answer count: 0
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
has comment: http://stackoverflow.com/comment/47300969
has comment: http://stackoverflow.com/comment/47301221
linked to: http://stackoverflow.com/q/1260984
has comment: http://stackoverflow.com/comment/47301117
has comment: http://stackoverflow.com/comment/47300983
has title: jQuery Validation max value at runtime

http://stackoverflow.com/comment/47495939
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29677082
type: Comment
has text: I added the input, sorry for being unclear.

http://stackoverflow.com/comment/85739524
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29625322
has text: You can use this: ^([0-2]{1}[0-9]{1}|(30|31))\/(0[0-9]{1}|(10|11|12))\/[0-9]{4}$

http://stackoverflow.com/a/29627256
score: 1
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/29627150
has body: No it isn't. You can either put another table inside the second cell or have some javascript to hide/display the other cells.
downvote count: 0

http://stackoverflow.com/comment/47221147
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29533242
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/74805/discussion-between-rish-and-arkar-aung).
type: Comment

http://stackoverflow.com/a/29681053
upvote count: 1
type: Answer
has body: Here's an another one may be overkill though: Click Me! https://jsfiddle.net/9dk4sgkk/
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29680531

http://stackoverflow.com/comment/47435501
has text: how you call `showPanel`?
comment on: http://stackoverflow.com/q/29647644
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47493986
comment on: http://stackoverflow.com/a/29676615
score: 0
type: Comment
has text: the alert return the name of the clicked city, i included the php page in the model, and the model just opens and closes after 1 sec.
type: AnswerComment

http://stackoverflow.com/comment/47258802
type: QuestionComment
score: 0
has text: @User nope..dont want to touch the submit button
comment on: http://stackoverflow.com/q/29553905
type: Comment

http://stackoverflow.com/q/29605637
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29605847
has answer: http://stackoverflow.com/a/29605665
type: Question
has title: Change div background after certain amounts of clicks
tagged with: addclass
tagged with: javascript
tagged with: jquery
tagged with: click
has answer: http://stackoverflow.com/a/29605704
has comment: http://stackoverflow.com/comment/47358720
score: 0
answer count: 3
has body: I have a script that shows the amount of clicks on a button and I want to change the background image of another div after a certain amount of clicks, in this case 5. At the moment the click amount works fine but the other part wont react to it. The second code works if I manually type 5 as the starting value for #click. This is what I have so far: $('#button').click(function () { $('#clicks').html(function (i, val) { return val * 1 + 1 }); }); if ($('#clicks').html() == 5) { $("#first").addClass('red'); } 0 first click #first { width: 100px; height:100px; } .red { background:red; }
accepted answer: http://stackoverflow.com/a/29605665
possible better answer: http://stackoverflow.com/a/29605704
tagged with: css

http://stackoverflow.com/q/29637558
score: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47417555
tagged with: javascript
tagged with: jquery
answer count: 1
has body: In my HTML-page I'm loading a JS-file (main.js) with some functions. HTML: Navigation main.js: $( document ).ready(function() { start() }); function start() { $.getScript( 'first.js' ).done(function () { console.log("loaded"); }); } function anything() { console.log("done"); } Now I'm using $.getScript to load another JS-file (first.js). But this file need to use some functions of the first one. first.js: $('#click_me').on('click', function() { anything(); }); In this example clicking on the #click_me should result in printing "done" in the console.
has comment: http://stackoverflow.com/comment/47417484
favorite count: 0
has comment: http://stackoverflow.com/comment/47417500
has answer: http://stackoverflow.com/a/29637724
upvote count: 2
type: UnansweredQuestion
has title: Using function of an already loaded script

http://stackoverflow.com/comment/47317232
type: QuestionComment
comment on: http://stackoverflow.com/q/29584408
has text: The table is actually pulled from another, outdated site, and I'm trying to get the data into an analyzable form. Believe me, I wish I could change it
score: 0
type: Comment

http://stackoverflow.com/a/30108045
accepted answer of: http://stackoverflow.com/q/29626783
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/48327840
has body: What appears to be going on here, is the map itself is rendering before you can complete your styling. Upon initial observation, I guessed throttling on mobile devices could be to blame. You mentioned you can't observe this in the fiddle, but injecting $timeout and crafting the following, you can simulate a delay- showing the original map => delay => styled map. Why this would happen? Unsure, could be a few factors. $scope.map = new google.maps.Map(document.getElementById('map'), mapOptions); $timeout(function() { $scope.map.mapTypes.set('map_style', styledMap); $scope.map.setMapTypeId('map_style'); }, 1000); View Delayed example - JSFiddle Link However, going through the docs and observing this a bit closer, it appears you could be initializing your map a better way. Playing around with this, I've set the map style immediately when defining $scope.map, which should alleviate any processing delays occurring before your custom styling. It appears, you were crafting a map, then newing up a re-styled one- not taking the opportunity to style the original immediately. Why not do so up front? You can replace previous logic with the following var mapOptions = { zoom: 4, styles: MAP_STYLE, // &lt;---- set style here! center: new google.maps.LatLng(40.0000, -98.0000), mapTypeControlOptions: { mapTypeIds: [google.maps.MapTypeId.ROADMAP, 'map_style'] } } $scope.map = new google.maps.Map(document.getElementById('map')); $scope.map.setOptions(mapOptions); // -- var styledMap = new google.maps.StyledMapType(MAP_STYLE, {name: "Styled Map"}); // -- $scope.map = new google.maps.Map(document.getElementById('map'), mapOptions); Even with the included $timeout delay such as in the first example, creating our map this way will always get the correct style the first time. Working JSFiddle Link
type: Answer
has comment: http://stackoverflow.com/comment/48327760
has comment: http://stackoverflow.com/comment/48327218
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29626783

http://stackoverflow.com/q/29619325
has comment: http://stackoverflow.com/comment/47383465
score: -1
has title: Using API more efficiently
answer count: 1
downvote count: 1
tagged with: web-development-server
has comment: http://stackoverflow.com/comment/47383696
has body: I am trying to load my playlist onto my website from Spotify by using their API and requesting data by lines of AJAX code but that data would be loaded every single time if I refresh the page, which lower the speed and UX. Is there any solution of the problem? P.S: a more complex problem: I was going to request the data once after period of time and modify the code of the HTML files stored on the server by a server-side Python application I wrote if any changes of the playlist occurred (example: I added/removed songs to or from my playlist via Spotify), for the purpose of not only freeing the browser from requesting datas but also getting the chances to sort that data by the date when publishing, rating or the artists for a better client-side layout. So my questions are: Is it secure to let the server-side applications to modify the HTML files (which means really saving the changes to the server-side HTML files) automatically because it is a very long process I don't want to either leaving those annoying works to the client-side which bothers the users or updating my website manually which bothers me. Are those things even possible?
has answer: http://stackoverflow.com/a/29619548
tagged with: javascript
has comment: http://stackoverflow.com/comment/47383820
type: AnsweredQuestion
tagged with: api
upvote count: 0
has comment: http://stackoverflow.com/comment/47383790
has comment: http://stackoverflow.com/comment/47383769
favorite count: 0
accepted answer: http://stackoverflow.com/a/29619548
has comment: http://stackoverflow.com/comment/47383590
type: Question
tagged with: python

http://stackoverflow.com/comment/47376589
score: 0
has text: @Pointy Yeah I realize that now. Ideally I would capture each of them. Any ideas on how I could accomplish that? Thanks.
comment on: http://stackoverflow.com/q/29615476
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47292653
type: QuestionComment
comment on: http://stackoverflow.com/q/29570748
has text: Where did you get the MarkerClusterer and which version are you using? This error looks strange: 'Uncaught TypeError: undefined is not a function markerclusterer.js?ver=4.1.1:649'
score: 0
type: Comment

http://stackoverflow.com/q/29671319
favorite count: 0
has answer: http://stackoverflow.com/a/29671509
linked to: http://stackoverflow.com/q/359494
has title: Jquery each loop not exiting by return 0
answer count: 5
score: -3
has answer: http://stackoverflow.com/a/29671368
has comment: http://stackoverflow.com/comment/47480751
has answer: http://stackoverflow.com/a/29671685
has comment: http://stackoverflow.com/comment/47480831
tagged with: return
has comment: http://stackoverflow.com/comment/47483385
downvote count: 3
has comment: http://stackoverflow.com/comment/47480907
has answer: http://stackoverflow.com/a/29672917
possible better answer: http://stackoverflow.com/a/29671509
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47481938
has comment: http://stackoverflow.com/comment/47482085
has comment: http://stackoverflow.com/comment/47480785
tagged with: javascript
has body: While exiting from each loop- return 0 is not working. However, changing it to return false works perfectly. Fiddle here The regular JavaScript loops (while,for) exits fine by return 0. Doesn't it breaks the uniformity!
type: Question
has answer: http://stackoverflow.com/a/29671563
upvote count: 0
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29671368
has comment: http://stackoverflow.com/comment/47481038
has comment: http://stackoverflow.com/comment/47480953

http://stackoverflow.com/q/29576515
has title: prototype function in event context. How do I find the object instance of this?
tagged with: prototype
duplicate of: http://stackoverflow.com/q/20279484
has comment: http://stackoverflow.com/comment/47301448
score: 0
has comment: http://stackoverflow.com/comment/47301876
tagged with: this
tagged with: constructor
type: UnansweredQuestion
answer count: 0
linked to: http://stackoverflow.com/q/20279484
type: Question
has body: I am trying to create sliders and I am trying to accomplish this without jQuery (a personal challenge). I have a constructor function with multiple instances. function Slider(container){ // some code } slider = new Slider(); slider2 = new Slider(); I have created prototype function which is attached to the event 'onmousedown'. Slider.prototype.mouseDown = function(){ // 'this' now refers to the element, not the object instance. } When mouseDown is activated i want to attach a prototype function to the event 'onmousemove'. Preferably something like this. Slider.prototype.mouseDown = function(){ this.onmousemove = this.mouseMove; } Any suggestions as to how I can access the object instance in a situation where the context has changed?
tagged with: javascript

http://stackoverflow.com/a/56799956
score: 0
has body: bind(this) can fix this issue, and nowadays we can use another 2 ways to achieve this if you don't like using bind . 1) As the traditional way, we can use bind(this) in the constructor, so that when we use the function as JSX callback, the context of this is the class itself. class App1 extends React.Component { constructor(props) { super(props); // If we comment out the following line, // we will get run time error said `this` is undefined. this.changeColor = this.changeColor.bind(this); } changeColor(e) { e.currentTarget.style.backgroundColor = "#00FF00"; console.log(this.props); } render() { return ( button ); } } 2) If we define the function as an attribute/field of the class with arrow function, we don't need to use bind(this) any more. class App2 extends React.Component { changeColor = e => { e.currentTarget.style.backgroundColor = "#00FF00"; console.log(this.props); }; render() { return ( button 1 ); } } 3) If we use arrow function as JSX callback, we don't need to use bind(this) either. And further more, we can pass in the parameters. Looks good, isn't it? but its drawback is the performance concern, for details please refer ReactJS doco. class App3 extends React.Component { changeColor(e, colorHex) { e.currentTarget.style.backgroundColor = colorHex; console.log(this.props); } render() { return ( this.changeColor(e, "#ff0000")}> button 1 ); } } And I have created a Codepen to demo these code snippets, hope it helps.
type: Answer
answers question: http://stackoverflow.com/q/29577977

http://stackoverflow.com/comment/47435801
type: Comment
type: QuestionComment
has text: you can simply use it by `jsonObject["2"]` I couldn't understand, what's the issue are you facing?
comment on: http://stackoverflow.com/q/29647458
score: 1

javascript
tags question: http://stackoverflow.com/q/29558959
tags question: http://stackoverflow.com/q/29621077
tags question: http://stackoverflow.com/q/29647685
tags question: http://stackoverflow.com/q/29604229
tags question: http://stackoverflow.com/q/29566238
tags question: http://stackoverflow.com/q/29635996
tags question: http://stackoverflow.com/q/29687655
tags question: http://stackoverflow.com/q/29533103
tags question: http://stackoverflow.com/q/29596147
tags question: http://stackoverflow.com/q/29542572
tags question: http://stackoverflow.com/q/29564037
tags question: http://stackoverflow.com/q/29678988
tags question: http://stackoverflow.com/q/29549836
tags question: http://stackoverflow.com/q/29583338
tags question: http://stackoverflow.com/q/29630674
tags question: http://stackoverflow.com/q/29638193
tags question: http://stackoverflow.com/q/29640432
tags question: http://stackoverflow.com/q/29622748
tags question: http://stackoverflow.com/q/29643113
tags question: http://stackoverflow.com/q/29622475
tags question: http://stackoverflow.com/q/29577410
tags question: http://stackoverflow.com/q/29628013
tags question: http://stackoverflow.com/q/29623093
tags question: http://stackoverflow.com/q/29630685
tags question: http://stackoverflow.com/q/29572088
tags question: http://stackoverflow.com/q/29664073
tags question: http://stackoverflow.com/q/29603158
tags question: http://stackoverflow.com/q/29635361
tags question: http://stackoverflow.com/q/29666795
tags question: http://stackoverflow.com/q/29588487
tags question: http://stackoverflow.com/q/29551073
tags question: http://stackoverflow.com/q/29661612
tags question: http://stackoverflow.com/q/29594778
tags question: http://stackoverflow.com/q/29579053
tags question: http://stackoverflow.com/q/29625284
tags question: http://stackoverflow.com/q/29643069
tags question: http://stackoverflow.com/q/29638940
tags question: http://stackoverflow.com/q/29643510
tags question: http://stackoverflow.com/q/29595679
tags question: http://stackoverflow.com/q/29647207
tags question: http://stackoverflow.com/q/29582779
tags question: http://stackoverflow.com/q/29563712
tags question: http://stackoverflow.com/q/29559373
tags question: http://stackoverflow.com/q/29559369
tags question: http://stackoverflow.com/q/29535735
tags question: http://stackoverflow.com/q/29609526
tags question: http://stackoverflow.com/q/29530521
tags question: http://stackoverflow.com/q/29639679
tags question: http://stackoverflow.com/q/29583253
tags question: http://stackoverflow.com/q/29680213
tags question: http://stackoverflow.com/q/29623077
tags question: http://stackoverflow.com/q/29552317
tags question: http://stackoverflow.com/q/29671067
tags question: http://stackoverflow.com/q/29625182
tags question: http://stackoverflow.com/q/29654535
tags question: http://stackoverflow.com/q/29639943
tags question: http://stackoverflow.com/q/29654946
tags question: http://stackoverflow.com/q/29535200
tags question: http://stackoverflow.com/q/29594308
tags question: http://stackoverflow.com/q/29532147
tags question: http://stackoverflow.com/q/29655345
tags question: http://stackoverflow.com/q/29569639
tags question: http://stackoverflow.com/q/29585883
tags question: http://stackoverflow.com/q/29622576
tags question: http://stackoverflow.com/q/29531418
tags question: http://stackoverflow.com/q/29654656
tags question: http://stackoverflow.com/q/29563973
tags question: http://stackoverflow.com/q/29561299
tags question: http://stackoverflow.com/q/29651123
tags question: http://stackoverflow.com/q/29570730
tags question: http://stackoverflow.com/q/29678497
tags question: http://stackoverflow.com/q/29551137
tags question: http://stackoverflow.com/q/29566162
tags question: http://stackoverflow.com/q/29645870
tags question: http://stackoverflow.com/q/29559111
tags question: http://stackoverflow.com/q/29673860
tags question: http://stackoverflow.com/q/29641274
tags question: http://stackoverflow.com/q/29661029
tags question: http://stackoverflow.com/q/29583678
tags question: http://stackoverflow.com/q/29603681

http://stackoverflow.com/a/29640715
has comment: http://stackoverflow.com/comment/72924164
type: Answer
score: 8
has comment: http://stackoverflow.com/comment/47423166
has comment: http://stackoverflow.com/comment/121155796
downvote count: 1
upvote count: 9
has comment: http://stackoverflow.com/comment/47423286
answers question: http://stackoverflow.com/q/29640254
has comment: http://stackoverflow.com/comment/56962699
has body: This is like asking if I like basketball or football better. Both have their positives. If you have 10 developers look at your for loop, 9 out of 10 will know what you are doing right away. Maybe half will have to look up what the map() method is, but then they'll also know what's going on. So in this respect, a for loop is easier for others to read. On the flip side, map() will save you two or three lines of code. As far as performance goes, you'll find map() is built internally with something akin to a for loop. You might see a few milliseconds of difference when it comes to performance speeds if you run them through large iterations; but they'll never be recognizable to an end user.

http://stackoverflow.com/a/29685002
has comment: http://stackoverflow.com/comment/47525999
has body: You can append a div to the node using foriegnObject. In that div pass your values to an inline jquery sparkline chart (line, pie, etc). Set the transparency of the div so that it doesn't block the diagram. Add your values to the original sankey data array(ie source,target,value,numsms,numid) and then call them in the append with d.numsms). //sparkline plugin and setup... http://omnipotent.net/jquery.sparkline/#s-docs //something like the following, look at the fiddle for more info node.append("foreignObject") .attr("width", sankey.nodeWidth()*2) .attr("height", function(d) { return d.dy/2 }) .attr("transform", function(d) { return "translate(" + (d.x+20) + "," + (d.y+10) + ")"; }) .append("xhtml:body") .style("font", "14px 'Helvetica Neue'") .html(" Inline Sparkline: 1,4,4,7,5,9,10 "); After adding the div to each node call the plugin to activate the inline charts. $('.inlinesparkline').sparkline(); Have a look at my fiddle. It's not a sankey but it does show you how to implement foriegnObject. d3.js diagram with inline charts! Hope this helps.
score: 1
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29673901
upvote count: 1

http://stackoverflow.com/q/29661514
upvote count: 3
has answer: http://stackoverflow.com/a/29723645
favorite count: 0
accepted answer: http://stackoverflow.com/a/29723645
has body: below code is my setup for this question, it works well var map; var markers = []; var contentString = ' This is the Title! '; function initialize() { var losAngeles = new google.maps.LatLng(34.0500, -118.2500); var mapOptions = { zoom: 10, center: losAngeles, disableDefaultUI: true, mapTypeControlOptions: google.maps.MapTypeId.SATELLITE }; map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); } function addMarker(location) { var markerOptions = { position: location, map: map } var marker = new google.maps.Marker(markerOptions); markers.push(marker); } function setAllMap(map) { for (var i = 0; i < markers.length;i++) { markers[i].setMap(map); } } function clearMarkers() { setAllMap(null); } function showMarkers() { setAllMap(map); } function deleteMarkers() { clearMarkers(); markers = []; } function addInfoWindow() { infowindow = new google.maps.InfoWindow({ content: contentString }); } google.maps.event.addDomListener(window, 'load', initialize); $(document).ready(function() { $('#thurs').on('click', function() { deleteMarkers(); // Loads the markers addMarker(new google.maps.LatLng(34.0500, -118.2500)); markers[0].infowindow = new google.maps.InfoWindow({ content: contentString }); console.log(markers[0].infowindow); google.maps.event.addListener(markers[0], 'click', function() { this.infowindow.open(map,this); }); setAllMap(map); }); }) Now my problem is to add multiple markers and a corresponding infowindow to each. My code for that (the jQuery) looks like this: for(var i=0;i<locations.length;i++) { if(locations[i].start.slice(0, 10) == "2015-04-10") { addMarker(new google.maps.LatLng(parseFloat(locations[i].lat), parseFloat(locations[i].lng))); } } console.log(markers); for(var i=0;i<markers.length;i++) { markers[i].infowindow = new google.maps.InfoWindow({ content: contentString }); } for(var i=0;markers.length;i++) { console.log(markers[i].infowindow); google.maps.event.addListener(markers[i], 'click', function() { markers[i].infowindo…
downvote count: 4
has comment: http://stackoverflow.com/comment/47464270
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47463323
type: Question
has title: How to dynamically add infowindows to markers on a google map?
tagged with: google-maps
answer count: 1
has comment: http://stackoverflow.com/comment/47464190
tagged with: javascript
score: -1
tagged with: google-maps-api-3

http://stackoverflow.com/q/29616202
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/29616382
tagged with: javascript
score: -1
tagged with: ajax
upvote count: 0
answer count: 1
favorite count: 0
has title: Need to send data to server via javascript in json format
has comment: http://stackoverflow.com/comment/47377743
has body: I am having trouble posting my data from a form to the server but must be in json format and using ajax. How do I do this while using javascript & cannot use Jquery. Here my questions... Also Thanks in Advance! How do I convert it and send it to the server with handling HTTP 200 success and using ajax? On return of a JSON object with the status encoded like so: {"status":"---"}, where "---" is either "success" or "error". If the response status is success, a thank you message should be displayed. If the response status is error, the page should display a general warning such as 'request could not be completed'. HTML Contact Me Name: Please enter first & last name Email: Please enter email address Phone: Phone number must only contain numbers Status: Client Partner Vendor Send me your newsletter Sales Support Message: Please describe what your request is Send Reset Javascript > //This will get the data of the fields > document.getElementById('send').onclick=function(evt) { > > var errors = false; //Gets all the inputs from contact form var > myNodeList = document.querySelectorAll('input, textarea, select'); > > //Declar the vars //var i, val; // empty Array > > //Start of loop for (i = 0; i < myNodeList.length; i++) { > // Get element > val = myNodeList[i]; > > //Get pattern attribute of regEx > regEx = new RegExp(val.getAttribute("pattern")); > > //Get Error message > err = document.getElementById(val.id+"-error") > > //By default, set the class to error, which hides the error message > err.className="error"; > > //Test value "val" again the regEx > if(!regEx.test(val.value)){ > //input fails and does not pass regEx test, set .display class > err.className+=" display"; > > errors = true; > } } evt.preventDefault(); if(errors ===false){ > document.getElementById("contactus").submit(); } };
tagged with: php
has answer: http://stackoverflow.com/a/29616382

http://stackoverflow.com/comment/47383521
type: AnswerComment
has text: @Umar : But If search.js file is under vendor folder then I think it's required
comment on: http://stackoverflow.com/a/29619526
type: Comment
score: 0

django-models
tag name: django-models
tags question: http://stackoverflow.com/q/29594585
type: Tag

http://stackoverflow.com/comment/47398635
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29623225
has text: @Frogmouth... To be more precise, im working on a computer builder, you pick Motherboard(category1) and script shows you what GPU(category2), CPU(category3) etc. are compatible with that Motherboard. Am i going the right way?

http://stackoverflow.com/q/29668792
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/29668832
has body: Quick and silly question perhaps, but how do I pass a label's text into a javascript confirm or alert function? Here is what I've done but it's not good: &lt;asp:Label ID="lblGVDeleteMessage" runat="server" Text="Show me!" style="display:none;" &gt;&lt;/asp:Label&gt; &lt;asp:ImageButton ID="btnDelete" runat="server" AlternateText="Delete" CommandName="Delete" Height="15px" ImageUrl="~/Images/document_delete.png" OnClientClick="return confirm('#&lt;%=lblGVDeleteMessage.ClientID%&gt;')" Width="15px" /&gt; Thanks!
tagged with: asp.net
has title: JavaScript alert with label's text
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47476039
type: Question
has answer: http://stackoverflow.com/a/29668826
tagged with: javascript
has answer: http://stackoverflow.com/a/29700753

http://stackoverflow.com/a/29577052
type: Answer
has body: If you want to set or change the contents of an element, you can use the innerHTML property. So in your case, document.getElementById("MAIN").innerHTML = "Whatever you want"; For the record, names in your example technically isn't an array, but a NodeList. See https://developer.mozilla.org/en/docs/Web/API/NodeList#Why_is_NodeList_not_an_Array.3F.
has comment: http://stackoverflow.com/comment/47302550
score: 0
answers question: http://stackoverflow.com/q/29576936
has comment: http://stackoverflow.com/comment/47302627

http://stackoverflow.com/q/29614966
type: Question
tagged with: internet-explorer
has comment: http://stackoverflow.com/comment/47386849
has comment: http://stackoverflow.com/comment/47422015
has title: $http.success callback not being called on IE11
upvote count: 2
tagged with: javascript
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47420917
has comment: http://stackoverflow.com/comment/47378951
favorite count: 0
score: 2
answer count: 0
downvote count: 0
has body: I have an AngularJS application that loads some data using $http service, then based on the revised data it updates corresponding html elements and updates the UI. Here is the code: app.controller("RankingCtrl", function ($scope, PostModel, DeserializePosts, $http, $cookies){ var mainContainer = $('#mainContainer'); $scope.error = null; function loadTop(){ $http({ type: 'GET', url: '/ranking', headers: { 'X-Requested-With': 'XMLHTTPRequest', } }).success(function(topPosts){ var mostLikedPosts = DeserializePosts(topPosts.mostLiked); var mostViewedPosts = DeserializePosts(topPosts.mostViewed); var mostCommentedPosts = DeserializePosts(topPosts.mostCommented); $scope.topLiked = mostLikedPosts; $scope.topViewed = mostViewedPosts; $scope.topCommented = mostCommentedPosts; }).error(function(error){ errorHandler(error.statusCode, error); }).finally(function () { $('#mainContainerSpinner').hide(); mainContainer.fadeIn(); }); } loadTop(); }); My problem is, apparently the .success function is not being called, since the .finally function does get executed but the UI is not updates with any of the downloaded elements. If I ctrl-R the IE browser window, then the function works properly and the UI shows the expected elements. This issue does not happen on Chrome or FireFox. Interestingly, when I open the F12 dev tools from IE to debug this JS code, the issue does not happen. Looks more like a bug on IE11 but I was wondering if anyone else has seen this behavior and if there are workarounds to try. Currently, my users need to refresh the page when they visit it, as only a page refresh updated the UI as expected on this AngularJS controller. UPDATE: the UI is not getting updated because the .success function has a forEach instruction that is throwing an exception. This is happening because the browser is sending the $http request without the 'X-Requested-With' header that is specified in the code above, so the response it receives is html instead of json. Forcing a browser refres…
type: UnansweredQuestion

http://stackoverflow.com/comment/47452833
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29652773
has text: At this point, I would say that to make sure the JSON / AJAX call are working, you should put alerts in at each point in the javascript to see where it is failing. So put one inside of document.ready, one right above e.preventDefault() to see if it gets past there. This is debugging of the script. In addition, I would recommend using chrome's developer tools or mozilla's firebug to see if there are any javascript errors popping up, and resolve those errors. Outside of writing the whole thing myself, I'm not sure there's much more help I can give from my side.

http://stackoverflow.com/q/29665491
tagged with: jquery
favorite count: 0
has body: i am using highcharts in one of my project. Highcharts JQuery version is being used and below is the reference: http://code.highcharts.com/highcharts.js Code used to draw chart is as below: $(function () { var chart = new Highcharts.Chart({ chart: { renderTo: 'container', type:'pie' }, xAxis: { categories: ['Jan', 'Feb', 'Mar', 'Apr'] }, plotOptions: { series: { dataLabels: { enabled: true, formatter: function() { return Math.floor(this.percentage*100)/100 + ' %'; }, distance: 20, connectorWidth : 0, color: 'rgb(0, 127, 209)' } } }, series: [{ data: [29.9, 71.5, 106.4, 129.2,29.9, 71.5, 106.4, 129.2,29.9, 71.5, 106.4, 129.2] }] }); }); The problem here i am facing that Slice labels are running here and there. I want all labels exact in center of each slice. JS Fiddle link for demo is PIE Chart JSFiddle
has answer: http://stackoverflow.com/a/29671790
score: 2
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29671790
upvote count: 2
has comment: http://stackoverflow.com/comment/47480404
has comment: http://stackoverflow.com/comment/47480760
has answer: http://stackoverflow.com/a/29672389
type: Question
tagged with: charts
tagged with: javascript
has title: set Pie chart labels exact in center of Slices of PIE highcharts
answer count: 2
tagged with: highcharts
downvote count: 0
accepted answer: http://stackoverflow.com/a/29672389

http://stackoverflow.com/a/29608428
has comment: http://stackoverflow.com/comment/47416546
has comment: http://stackoverflow.com/comment/47527375
score: 0
type: Answer
has body: Elsewhere here is right: if you return false your button won't submit. Therefore: either your button is not returning false, or something else is submitting the form. To check 1, put a return false at the very beginning of the onclick statement. Then you can go moving the return until you have tested the whole onclick. You can also add an [alert][1] to ensure the code has reached your return line. Do not use console.log for this purpose, because it doesn't stop the flow. After this, to find out 2, you can open the console on Google Chrome and review the most likely assigned elements. Focus on the form and check at the right (on the console) the section Event Listeners. Do the same with your button. Note: do not use event.preventDefault() until you are sure what (and why) is submitting the form. Doing so is not only bad practice, but you'll run into troubles in the future for sure.
answers question: http://stackoverflow.com/q/29608139

http://stackoverflow.com/comment/47513442
score: 0
comment on: http://stackoverflow.com/q/29688098
type: Comment
has text: Not sure if its related to your issue but just note that [diff](http://momentjs.com/docs/#/displaying/difference/) returns a rounded down number since Moment.js 2.0.0. If you want a float, pass it `true` as a third parameter.
type: QuestionComment

http://stackoverflow.com/a/29557201
downvote count: 0
has body: Try the following: window.getComputedStyle(document.querySelector(".myblock")).getPropertyValue("background-color");
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/29556872

http://stackoverflow.com/q/29652810
has title: Unable to generate Report when using jasmine-reporters in protractor
answer count: 3
has answer: http://stackoverflow.com/a/30760821
downvote count: 0
tagged with: jasmine
favorite count: 0
has answer: http://stackoverflow.com/a/29652946
has body: i Used the following code in config var jasmineReporters = require('jasmine-reporters'); onPrepare: function() { browser.driver.manage().window().maximize(); browser.params.envi='DEVINT'; //For output reports jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter('./test', true, true)); }, When i ran the tests it ran successfully, but im not seeing any reports generated. Any Suggestions?
type: AnsweredQuestion
upvote count: 3
accepted answer: http://stackoverflow.com/a/29652946
type: Question
score: 3
tagged with: protractor
has answer: http://stackoverflow.com/a/37829099
tagged with: javascript
possible better answer: http://stackoverflow.com/a/30760821

scope
tags question: http://stackoverflow.com/q/29687802
tags question: http://stackoverflow.com/q/29605055
tags question: http://stackoverflow.com/q/29613743
tags question: http://stackoverflow.com/q/29651123
tags question: http://stackoverflow.com/q/29631297
tags question: http://stackoverflow.com/q/29677612
tag name: scope
tags question: http://stackoverflow.com/q/29572033
tags question: http://stackoverflow.com/q/29655795
type: Tag
tags question: http://stackoverflow.com/q/29612538
tags question: http://stackoverflow.com/q/29540471

http://stackoverflow.com/q/29618802
tagged with: infinite-loop
accepted answer: http://stackoverflow.com/a/29630282
has comment: http://stackoverflow.com/comment/47402037
tagged with: javascript
has comment: http://stackoverflow.com/comment/47389245
score: 0
has title: Javascript getting into infinite loop
answer count: 1
has answer: http://stackoverflow.com/a/29630282
tagged with: php
has comment: http://stackoverflow.com/comment/47440470
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47382564
type: Question
has comment: http://stackoverflow.com/comment/47382419
has body: When i unchecked the input checkboxes the share.php javascript goes into an infinite loop opening new windows. with all 3 checked no problem occur. in some point it is going wrong but i cant find where. Im not sure why it is happening Build a fully customizable Personal Website in seconds - for free. share.php <?php if(isset($_POST['summary'])){ $linkedIn = ""; $faceBook = ""; $twitter = ""; if($_POST['LinkedIn'] == "yes"){ $linkedIn = "http://www.linkedin.com/"; } if($_POST['FaceBook'] == "yes"){ $faceBook = "http://www.facebook.com/"; } if($_POST['Twitter'] == "yes"){ $twitter = "http://www.twitter.com/"; } } ?> <?php echo htmlspecialchars($linkedIn); ?> <?php echo htmlspecialchars($faceBook); ?> <?php echo htmlspecialchars($twitter); ?>

http://stackoverflow.com/q/29562835
favorite count: 0
has comment: http://stackoverflow.com/comment/47275778
has body: Imagine, I have an underlying model layout like this (using Play Framework, unrelated): case class Resume( id: Option[String], surname: String, firstName: String, experience: List[Experience], education: List[Education] ) case class Experience( employer: String, responsibilities: String, position: String, projectDetails: String, projectValue: String ) case class Education( study: String, institution: String ) The resume model is the one the users need to fill in. How would I go about designing the HTML form for it? I need some JS to add a new Experience and Education block on demand if the visitor of my website wants to add an extra Experience or Education block. I want to know, how I can best put this into HTML? Is it better to use html form name arrays or shall I group everything into DIV's and then using Javascript build a JSON object and submit that to the server? I'd do it something like this (using the HTML name arrays): experience[0][employer] experience[0][responsibilities] experience[0][position] experience[0][projectDetails] experience[0][projectDetails] ... and then when the user presses on tab or something, add: experience[1][employer] experience[1][responsibilities] experience[1][position] experience[1][projectDetails] experience[1][projectDetails] Or is there a better way to tackle this?
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/66469143
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/66469143
tagged with: javascript
has answer: http://stackoverflow.com/a/29563102
accepted answer: http://stackoverflow.com/a/29563102
answer count: 2
has title: Multilevel HTML Form
tagged with: playframework
downvote count: 0
tagged with: jquery

http://stackoverflow.com/q/29635613
upvote count: 1
type: Question
has body: I'm not sure why my ajax success isn't being triggered/called. My controller is called and the code is executed fine. I'm not returning anything, so my method is a void! Do I need to return something (ActionResult/JSonResult/etc) to get the success to trigger? Here is my controller code. public void DeleteEvent(string eventId) { diaryEventService.DeleteDiaryEvent(eventId); } Here is my ajax call. $.ajax({ url: '/ManageSpaces/DeleteEvent', dataType: 'json', data: { eventId: eventId, }, success: function() { //var obj = JSON.parse(doc); var myCalendar = $('#fullcalendar'); myCalendar.fullCalendar(); myCalendar.fullCalendar('removeEvents', eventId); $("#eventDetails").collapse('toggle'); } });
has comment: http://stackoverflow.com/comment/47413506
tagged with: asp.net-mvc
tagged with: javascript
tagged with: jquery
answer count: 1
downvote count: 0
has title: JQuery Ajax Success not being triggered
score: 1
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/29635757
has comment: http://stackoverflow.com/comment/47413552
accepted answer: http://stackoverflow.com/a/29635757
type: AnsweredQuestion

http://stackoverflow.com/a/29645459
type: Answer
has comment: http://stackoverflow.com/comment/47466815
answers question: http://stackoverflow.com/q/29644957
score: 0
has body: You can use 'fileuploadadded' event of the Jquery fileupload and add the image resizing code in it. Try something like: $(selector).bind('fileuploadadded', function (e, data) { // add your image resize code here }

http://stackoverflow.com/comment/47240597
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29544235
score: 0
has text: Help with what? Need to be more specific what your problem is. Also not entirely clear what you are trying to do

http://stackoverflow.com/q/29598540
score: 13
downvote count: 1
type: AnsweredQuestion
upvote count: 14
accepted answer: http://stackoverflow.com/a/29598550
has body: I can get background image by doing $('#item').css('background-image'). but the result is url('www.example.com/something/123.png') How can get get only the 123 value? I can't use string position because the value of the img name doesn't' necessary is 3 characters.
linked to: http://stackoverflow.com/q/96428
type: Question
duplicate of: http://stackoverflow.com/q/96428
answer count: 1
tagged with: javascript
tagged with: jquery
has title: get value after last slash (/)
has comment: http://stackoverflow.com/comment/47344096
has answer: http://stackoverflow.com/a/29598550
favorite count: 0
has comment: http://stackoverflow.com/comment/47344049

http://stackoverflow.com/q/29539135
has comment: http://stackoverflow.com/comment/47509542
has comment: http://stackoverflow.com/comment/47330154
has comment: http://stackoverflow.com/comment/47559754
linked to: http://stackoverflow.com/q/3422262
has answer: http://stackoverflow.com/a/29675644
tagged with: javascript
has comment: http://stackoverflow.com/comment/47330743
has answer: http://stackoverflow.com/a/29717789
has comment: http://stackoverflow.com/comment/47537211
has comment: http://stackoverflow.com/comment/47510059
has title: Capture screenshot of browser content (website)
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29717789
has comment: http://stackoverflow.com/comment/47588433
downvote count: 0
has comment: http://stackoverflow.com/comment/47532142
score: 23
favorite count: 0
has comment: http://stackoverflow.com/comment/47524870
has answer: http://stackoverflow.com/a/29726088
has body: My aim is to have an image of a website (Yes, as simple as that). I know that there are tools like html2canvas. However I don't want the client browser to render the screenshot. One reason is that I use a chrome extension with a webview which essentially behaves liken an iFrame. For security reasons rendering a screenshot for a website containing an iFrame does not work. I also know they're working on the capability to natively support capturing website screenshots but I want a cross browser solution and not be dependent on the possibility of the browser. All this happens on a server so it should be executable via command line. What I'm doing now is: Open browser via command line Switch focus to browser window via command line Make screenshot (screencapture on mac, scrot on Linux) via command line Doing it at this basic level has the disadvantage of the image containing status bars, browser plugin stuff etc. In fact I only want to have the actual website content without all this application-specific stuff around. The worst solution would be to hard code the 0|0 position of the content relative to the window for every browser. This is shitty (for obvious reasons). Another solution I've come up with is: tell the browser (I can talk to a plugin via socket) to add something like a QR-Code at x:0;y:0;, send the screenshot to the image processing server. After that remove the QR-Code and send the screenshot again. Then I know every point relative to 0|0 but it is also not that elegant. The best thing would be a command line tool that somehow lets me determine what part of an application I want to capture an image of. An example is this plugin for Firefox or this server-side tool or all these tools providing screenshots of websites with different browsers and OS like this. I wonder how they get rid of browser-specific GUI elements. Addition: I don't know if I made this clear enough, but I want a screenshot of a content of a specific browser but without the browser-specific…
linked to: http://stackoverflow.com/q/16998503
has answer: http://stackoverflow.com/a/29607985
type: Question
tagged with: webpage-screenshot
upvote count: 23
has answer: http://stackoverflow.com/a/37294963
has comment: http://stackoverflow.com/comment/47593473
has comment: http://stackoverflow.com/comment/47589608
has answer: http://stackoverflow.com/a/29686143
tagged with: screenshot
tagged with: image-processing
tagged with: google-chrome
answer count: 7
possible better answer: http://stackoverflow.com/a/29686143
has answer: http://stackoverflow.com/a/29616120

http://stackoverflow.com/q/29590444
downvote count: 1
has answer: http://stackoverflow.com/a/29590478
type: AnsweredQuestion
tagged with: javascript
score: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/29590478
has body: I'm trying to create a map with different meshes. The problem I'm struggling with is that meshes are disappearing when the center of the mesh is out of camera view. Here's a GIF of the problem: https://gfycat.com/CornyBrilliantChuckwalla I'm using THREE.WebGLRenderer 71. Is there anyway to fix this?
type: Question
has comment: http://stackoverflow.com/comment/47327981
has title: ThreeJS mesh becomes invisible when its center is out of camera view
upvote count: 2
tagged with: three.js
answer count: 1

http://stackoverflow.com/q/29576247
tagged with: javascript
tagged with: express
score: 0
answer count: 1
has title: Internationlisation plain Express.js
has answer: http://stackoverflow.com/a/29577336
accepted answer: http://stackoverflow.com/a/29577336
has body: Assume I have the following code: HTML &lt;ul id="navMenu"&gt; &lt;li&gt;{{inter.home}}&lt;/li&gt; &lt;li&gt;{{inter.aboutUs}}&lt;/li&gt; &lt;/ul&gt; express router.get('/:lang/news', function (req, res) { var language = req.params.lang; var interObjects = { ru: russianInterObj, en: englishInterObj }; (interObjects[language]) ? res.render('view.hjs', {inter: interObjects[language], ...}) : res.sendStatus(404); }); Would this approach for internationlisation be good? Thank you
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47301054
has comment: http://stackoverflow.com/comment/47301170
type: Question

http://stackoverflow.com/comment/47265235
has text: You asked how to color inputs with invalid emails and the jsfiddle shows that, it's not much different from your code. Whenever any email input is changed, the `keyup()` event fires for that input and calls `validateEmail()`. That function then checks whether the email looks valid. If it isn't, it adds a css class `invalid`. If it is valid, it removes the css class `invalid`. CSS then colors all inputs with the class `invalid` in red and all that don't have that class in green. I also added `label` elements as error messages that pop up whenever an email is invalid.
type: AnswerComment
comment on: http://stackoverflow.com/a/29541152
score: 0
type: Comment

http://stackoverflow.com/a/29648679
accepted answer of: http://stackoverflow.com/q/29647192
answers question: http://stackoverflow.com/q/29647192
type: AcceptedAnswer
has body: You can use jQuery .offset().top to get element offset from top of document, add it's height and check if it's still smaller than $(window).height().
score: 0
type: Answer

http://stackoverflow.com/a/29629146
has comment: http://stackoverflow.com/comment/47401077
has comment: http://stackoverflow.com/comment/47401059
score: -1
has comment: http://stackoverflow.com/comment/47401278
answers question: http://stackoverflow.com/q/29629030
downvote count: 1
has comment: http://stackoverflow.com/comment/47401470
has comment: http://stackoverflow.com/comment/47401143
has comment: http://stackoverflow.com/comment/47401596
type: Answer
upvote count: 0
has body: The operator is the if, the operand (on which the operator operates) is in this case document .getElementByid('header') + for example is a binary operator, it has two operands, for example in a+b they would be a and b. Unary means, that you only have one operand. EDIT: As Barmar pointed out, if does not produce a result and therfore I would not call it an operator. My bad, didn't think it through

http://stackoverflow.com/q/29542942
tagged with: ajax
has answer: http://stackoverflow.com/a/29543121
has comment: http://stackoverflow.com/comment/47237507
linked to: http://stackoverflow.com/q/29291952
has comment: http://stackoverflow.com/comment/47238948
answer count: 1
accepted answer: http://stackoverflow.com/a/29543121
has comment: http://stackoverflow.com/comment/47238215
favorite count: 0
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47237591
downvote count: 2
has body: Although the ajax call is sending the correct values and they are being written to the database I'm not getting a response back. I have cut the code down to the minimum to try and locate the error but I still can't get a response... $(document).ready(function () { $('#change_username').click(function(){ $.ajax({ dataType: "json", type: "POST", url: "ajax/change_password_ajax.php", data: $('#change_password_form').serialize(), success:function(response){ smeg = (response.message), alert(smeg) } }); }); }); change_password_ajax.php $new_password = $_POST['new_password1']; $new_password = md5($new_password); $sql = "UPDATE user SET password = '$new_password' WHERE userID = '$id'"; $result = mysqli_query($mysqli,$sql) or die(mysqli_error($mysqli)); if($result){ $message = 'yes'; } $output_array = array( 'message' =&gt; $message, 'bob' =&gt; 'yellow' ); echo json_encode($output_array); If I use Firebug the post to change_password_ajax.php is highlighted in red and there are no response or html tabs but it doesn't give an indication why.
type: Question
has comment: http://stackoverflow.com/comment/47238328
upvote count: 0
score: -2
has title: JQuery Ajax call not sending a response back
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/47322344
type: AnswerComment
score: 0
type: Comment
has text: Thanks for the time taken to answer. Your solution, however, does not answer the question.
comment on: http://stackoverflow.com/a/29575047

http://stackoverflow.com/q/29587534
favorite count: 0
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29587607
downvote count: 0
tagged with: onclick
has body: I am trying to add a second onclick function to my element but so far without success, tried with different separators, same quotations and such but it does not work yet. This is the code : Course Can anyone point out what I am doing wrong ? Much appreciated
score: 1
type: Question
tagged with: javascript
has title: Multiple onclicks on the same div
possible better answer: http://stackoverflow.com/a/29587607
answer count: 2
has answer: http://stackoverflow.com/a/29587566
upvote count: 1
accepted answer: http://stackoverflow.com/a/29587566

http://stackoverflow.com/comment/47291953
comment on: http://stackoverflow.com/q/29571232
type: Comment
type: QuestionComment
has text: In jQuery, `#` targets an ID, so a single element. `.` targets a class, so multiple elements. Make sure all the elements you want to apply a popover to have the same class (like `.bookovers` for example.)
score: 0

http://stackoverflow.com/comment/47438177
has text: then try to re-write your question in a more 'understanding' way.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29596981
score: 0

http://stackoverflow.com/comment/47468085
type: Comment
comment on: http://stackoverflow.com/q/29664153
has text: What is your goal when you say "refactor"?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/47217753
type: Comment
type: QuestionComment
has text: `data[i["name"]] = i;`
comment on: http://stackoverflow.com/q/29532210
score: 0

http://stackoverflow.com/a/29536437
has body: From my perspective classes and top-level namespaces should start with an upper-case character and variables or functions (which are not constructors of classes) with lower-case. So in your example NamespaceBar.myFooNamespace and as pointed out in the comments I'd tag it as namespace, not as class.
upvote count: 0
answers question: http://stackoverflow.com/q/29533414
score: -1
downvote count: 1
has comment: http://stackoverflow.com/comment/47236276
type: Answer

http://stackoverflow.com/comment/47373553
type: QuestionComment
has text: What is `distance = events[k][selectedDistance];` supposed to do? Why would you use `selectedDistance` as a property name?
comment on: http://stackoverflow.com/q/29613976
score: 0
type: Comment

http://stackoverflow.com/q/29568430
tagged with: javascript
has answer: http://stackoverflow.com/a/29569429
has comment: http://stackoverflow.com/comment/47287482
tagged with: rest
answer count: 1
has title: RESTful Laravel API login from application in other domain
favorite count: 0
has body: How to config Laravel 5.0 to login from other domain? Explain, we have a Laravel RESTful API, and some users creates Angular.js apps and host on your own domains. When try to login through these apps, login returns true, but on next request lose the session. I think that can be related to CORS, but I set the correct headers. My Headers: Hearders setted on apache virtualhost: Header always set Access-Control-Allow-Origin "*" Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, PUT, PATCH, DELETE" Header always add Access-Control-Allow-Headers "accept, origin, x-requested-with, content-type, x-application-token, x-csrf-token, x-password-reset-token" Header always add Access-Control-Expose-Headers "x-csrf-token"
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/29569429
has comment: http://stackoverflow.com/comment/47286545
tagged with: php
tagged with: laravel
score: 2
type: AnsweredQuestion
upvote count: 3
downvote count: 1
type: Question

http://stackoverflow.com/q/29633200
favorite count: 0
accepted answer: http://stackoverflow.com/a/29635944
tagged with: http://stackoverflow.com/tag/html
score: 1
upvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29635944
tagged with: fabricjs
type: Question
has title: Pixel perfect scaling of images while zooming the canvas with fabric.js
answer count: 1
downvote count: 0
tagged with: javascript
has body: My software is a kind of pixel art paint program with brushes, fabric.js was heavily modified in order to have pixel rounded translation (the position is always an integer) for the fabric.js objects, however resizing images and making their pixels fit the canvas in a 1:1 ratio is still an issue. Right now, the fabric.js zoomToPoint function is used to be able to zoom on the canvas with the mouse wheel, when images aren't scaled, their pixels fit with the canvas but when i scale any objects down (or up), pixels does not fit anymore with the canvas so the pixels of the object are actually smaller or bigger than the canvas pixel. Screenshots of the problem with a zoom level of 8 : Original image dimensions (no problems, each pixels fit the canvas pixels) Resized image, pixels of the image does not fit the canvas pixels anymore How can the pixels of the images fit the canvas pixels in a 1:1 ratio when scaling them?

http://stackoverflow.com/q/29669410
score: 0
tagged with: http://stackoverflow.com/tag/json
tagged with: apigee
tagged with: jsonpath
type: Question
has answer: http://stackoverflow.com/a/29671695
tagged with: arrays
tagged with: javascript
answer count: 1
accepted answer: http://stackoverflow.com/a/29671695
has body: We have a json input from which we have to decode each element in the input and replace it back before going to the backend. we have used a Extract Variables policy to extract the elements, and in a Javascript policy we decode the elements by using a for loop. Now we have to replace the extracted elements with the decoded values. We tried to use jsonPath and replace the elements but getting a error called Execution of JavaScript-1 failed with error: Javascript runtime error: "ReferenceError: "jsonPath" is not defined. (JavaScript_1_js#5). at line 5 The code we used for jsonpath is var input = new String(context.getVariable("request.content")); context.setVariable("input",input); var path = jsonPath(input, "$..soldto").toJSONString(); context.setVariable("path",path); Can we not use jsonPath in Apigee Javascript policy?
type: AnsweredQuestion
has title: jsonPath not working in apigee javascript policy

http://stackoverflow.com/q/29687952
tagged with: node.js
answer count: 0
has comment: http://stackoverflow.com/comment/47513008
tagged with: google-chrome
has title: Unable to expand objects in Chrome debugger
type: Question
has comment: http://stackoverflow.com/comment/47513046
tagged with: debugging
tagged with: javascript
score: 4
upvote count: 4
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/47513175
type: UnansweredQuestion
has body: I have a very simple object: var myObject = { one: 1, two: 2, }; debugger; When the Chrome Javascript debugger is stopped at the debugger statement, I am unable to inspect the innards of myObject. Clicking the disclosure triangle next to 'myObject' does nothing at all. I can, however, type "myObject" in to the console and click the disclosure there. But then I can only open variables nested one level deep. I have the same problem whether stopped within JS in a web page, or served from node-inspector as part of the node.js (0.12.2) package. Chrome v41.0.2272.118 (64-bit) What am I missing?
has comment: http://stackoverflow.com/comment/47513035

http://stackoverflow.com/q/29582175
tagged with: regex
has answer: http://stackoverflow.com/a/29582513
has body: I am not sure how to do this, but I am trying to get the expressions from each if/elseif line. I am able to somewhat extract them using these two lines: var ifreg = /\{if\s+?(.+?)\}([\s\S]+?)\{else/ig.exec(block); var elseifreg = /\{elseif\s+?(.+?)\}([\s\S]+?)\{else/ig.exec(block); but the results are not pretty looking (second exp): [ '{elseif 2 == 2}\n Two is equal to two\n {else', '2 == 2', '\n Two is equal to two\n ', index: 52, input: '{if 1 == 2}\n One is equal to two\n {elseif 2 == 2}\n Two is equal to two\n {elseif 4 != 5}\n Four does not equal five\n {else}\n Something went wrong...\n {/if}' ] Here is the teplate I am searching: {if 1 == 2} {foreach $row in $items} I am here {/foreach} {elseif $item == 2} {$item} is equal to two {elseif 4 != 5} Four does not equal five {else} Something went wrong... {/if} What I would like to accomplish, is to get all the results using one expression, and get the results to look something like this (doesn't have to be exactly the same but close): [ ['1 == 2', '{foreach $row in $items} I am here {/foreach}'], ['$item == 2', '{$item} is equal to two'], ['4 != 5', 'Four does not equal five'], ['Something went wrong...'] ] What can I do to accomplish this?
score: 0
upvote count: 1
downvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29582589
has title: Regexp extract items as multidimensional array
accepted answer: http://stackoverflow.com/a/29582513
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/29582589
tagged with: javascript
favorite count: 0

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

http://stackoverflow.com/q/29605980
upvote count: 2
has answer: http://stackoverflow.com/a/32156424
has answer: http://stackoverflow.com/a/29606087
has comment: http://stackoverflow.com/comment/47357792
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/49824809
has title: appending child div to each div with for loop
answer count: 3
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47357538
tagged with: http://stackoverflow.com/tag/html
score: 2
has body: I want to append child div to each given parent divs. The child div supposed to be decorated by calling decorateDiv(). For example, after the appendChildren is executed, following divs should take the following form (assuming decorateDiv does nothing) function appendChildren() { var allDivs = document.getElementsByTagName("div"); for (var i = 0; i &lt; allDivs.length; i++) { var newDiv = document.createElement("div"); decorateDiv(newDiv); allDivs[i].appendChild(newDiv); } } // Mock of decorateDiv function for testing purposes function decorateDiv(div) {} what am i doing wrong?
downvote count: 0
type: Question

http://stackoverflow.com/comment/47409124
comment on: http://stackoverflow.com/q/29633293
has text: Is your question, that in ASP.NET MVC you are not recieving anything in the text parameter?
score: 0
type: QuestionComment
type: Comment

runtime
tags question: http://stackoverflow.com/q/29533288
type: Tag
tag name: runtime
tags question: http://stackoverflow.com/q/29575191

http://stackoverflow.com/comment/47445241
comment on: http://stackoverflow.com/a/29651442
type: AnswerComment
type: Comment
has text: Note that Fine Uploader also provides [totalProgress and progress events](http://docs.fineuploader.com/branch/master/api/events.html).
score: 1

http://stackoverflow.com/q/29644366
tagged with: typeahead.js
has title: Replacing Typeahead enabled input field value with jQuery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47462729
has comment: http://stackoverflow.com/comment/47429572
tagged with: bootstrap-typeahead
has answer: http://stackoverflow.com/a/41769413
has answer: http://stackoverflow.com/a/29644572
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has body: I am trying to replace Typeahead enabled input field value using jQuery. But after replacing the value when I click on the input field then it changed the value to original selected value. If I select "US - DC" then using jQuery it display "US". If I click on the input field then it replace the value "US" with the value "US - DC"! I am using following code- $("#country-id").bind("change", function(e){ var country = $(this).val(); var t = $(this); $.ajax({ url: './state', type: 'post', data: 'id='+country, cache: false, dataType:'json', success: function(data) { var countryVal = country.split("-",1); console.log(countryVal); t.val(countryVal); } }) }); Thanks in advance.
score: 0

http://stackoverflow.com/comment/47286528
type: QuestionComment
has text: Can you link to a jsFiddle demo exhibiting the problem?
comment on: http://stackoverflow.com/q/29568565
score: 0
type: Comment

http://stackoverflow.com/q/29643069
has comment: http://stackoverflow.com/comment/47427976
type: Question
has comment: http://stackoverflow.com/comment/47428059
score: 1
tagged with: cors
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47428113
favorite count: 0
has title: jQuery ajax request for PUT fails, but it is working with Postman
has comment: http://stackoverflow.com/comment/47429569
has comment: http://stackoverflow.com/comment/47428856
has comment: http://stackoverflow.com/comment/47428542
has comment: http://stackoverflow.com/comment/47427764
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47427435
upvote count: 1
has comment: http://stackoverflow.com/comment/47428361
has comment: http://stackoverflow.com/comment/50473908
has body: I am trying to make an ajax request like below: function updateLastSeen() { var url = 'http://my.url.com/conversation/' + $('#conversationId').val() + '/seen/' + $('#senderId').val(); $.ajax({ type: 'PUT', url: url, contentType: "application/json", success: function(result) { alert('Logged out')}, error: function(result) { alert('error') } }); } The request in the preflight looks like this: Request headers OPTIONS http://my.url.com/conversation/3/seen/3 HTTP/1.1 Host: m.url.com User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Origin: null Access-Control-Request-Method: PUT Connection: keep-alive And this is the response HTTP/1.1 200 OK Date: Wed, 15 Apr 2015 06:16:54 GMT Server: Apache Access-Control-Allow-Origin: * Access-Control-Allow-Methods: * Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept Keep-Alive: timeout=5, max=98 Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: application/json So according to me it should work. However I get an error that Method PUT is not allowed by Access-Control-Allow-Methods. I also tried via Postman to see if there is a problem with the backend (which is totally obscure to me) but via Postman it works! So what am I doing wrong? The request headers with postman: PUT /conversation/4/seen/3 HTTP/1.1 Host: my.url.com Connection: keep-alive Content-Length: 0 Pragma: no-cache Cache-Control: no-cache Origin: chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36 Content-Type: text/plain;charset=UTF-8 Accept: */* Accept-Encoding: gzip, deflate, sdch Accept-Language: en-US,en;q=0.8,nl;q=0.6 Cookie: _ga=GA1.2.1794721550.1428851890
has comment: http://stackoverflow.com/comment/47428212

http://stackoverflow.com/comment/47309529
type: Comment
comment on: http://stackoverflow.com/a/29579468
has text: `filter(Boolean)` would be more straighforward.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47343594
type: Comment
has text: So the solution is: th, td { white-space: nowrap; overflow: hidden; };
type: QuestionComment
comment on: http://stackoverflow.com/q/29561335
score: 0

http://stackoverflow.com/a/29612191
has body: May be requirejs will be suitable for you. http://requirejs.org/docs/jquery.html#intro Here is example of usage of requirejs. require.config({ baseUrl: 'js/lib', paths: { // the left side is the module ID, // the right side is the path to // the jQuery file, relative to baseUrl. // Also, the path should NOT include // the '.js' file extension. This example // is using jQuery 1.9.0 located at // js/lib/jquery-1.9.0.js, relative to // the HTML page. jquery: 'jquery-1.9.0' } }); You have easily describe all files that need be loaded. Also can have callback when every files is loaded.
score: 1
has comment: http://stackoverflow.com/comment/47370080
upvote count: 1
answers question: http://stackoverflow.com/q/29612125
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/47369854

http://stackoverflow.com/q/29684758
has title: Javascript fails occasionally (10%ish of the time)
score: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/47508201
type: Question
has comment: http://stackoverflow.com/comment/47506796
has comment: http://stackoverflow.com/comment/47535765
tagged with: .net
tagged with: javascript
has comment: http://stackoverflow.com/comment/47507024
has body: I'm having a small issue with my javascript code. I'm trying to use fullCalendar, and 90% of the time it works flawlessly. However, around 10% of the time, it seems to fail to load the fullCalendar function, and I'm not sure why. I call 3 external scripts above the div that the calendar gets placed into: &lt;script src="../../../../assets/lib/moment.min.js"&gt;&lt;/script&gt; &lt;script src="../../../../assets/lib/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="../../../../assets/js/fullcalendar.js"&gt;&lt;/script&gt; &lt;div id="calendar"&gt;&lt;/div&gt; The following is my javascript: //variables to pull the serialized data from c# through to javascript. var dateStart = '&lt;%=dateStartListToJS%&gt;'; var dateEnd = '&lt;%=dateEndListToJS%&gt;'; var titles = '&lt;%=titlesListToJS%&gt;'; var links = '&lt;%=linksListToJS%&gt;'; //use JSON to parse into arrays. var dateStartArray = JSON.parse(dateStart); var dateEndArray = JSON.parse(dateEnd); var titlesArray = JSON.parse(titles); var linksArray = JSON.parse(links); //initiate variable to handle our calendar events. var JSONEvents = []; //for testing... //alert(dateStartArray + dateEndArray + titlesArray + linksArray); //show the calendar and hide the buttons to switch between the calendar and list. $("#calendar").show(); $(".viewAsList").hide(); $(".viewAsCalendar").hide(); //while we still have more calendar events to add, run this loop to add courses to the calendar. //calendar currently only displays the start date of the course. for (var i = 0; i &lt; dateStartArray.length ; i++) { JSONEvents.push( { "title": titlesArray[i], "url": linksArray[i], "start": dateStartArray[i], "end": dateEndArray[i], "allDay": true, //"backgroundColor" : "#FFF" }); } //function: createCalendar. creates the calendar function createCalendar() { //using fullcalendar $('#calendar').fullCalendar({ //setting up the header of the calendar. header: { center: '', right: 'prev,next', left: 'title' //right: 'month' }, eventColor: '#FCFCFC', …
has comment: http://stackoverflow.com/comment/47507753
has comment: http://stackoverflow.com/comment/47507979
favorite count: 0
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47507660
answer count: 0

http://stackoverflow.com/q/29577610
has answer: http://stackoverflow.com/a/29577666
has comment: http://stackoverflow.com/comment/47305776
type: Question
has title: Disable form element when checkbox is checked
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47306791
accepted answer: http://stackoverflow.com/a/29577680
has answer: http://stackoverflow.com/a/29577667
score: 0
answer count: 3
tagged with: ruby-on-rails-4
has comment: http://stackoverflow.com/comment/47303631
possible better answer: http://stackoverflow.com/a/29577666
has comment: http://stackoverflow.com/comment/47303820
has body: In my rails application I have this two field in my form and I tried to disable the end_date field when the check box is checked so for this I have the jQuery code below &lt;div class="form-profile end-date"&gt; &lt;%= f.label :experience_end, class: "profile_label" %&gt;&lt;br/&gt; &lt;%= f.date_select :experience_end, {start_year: 1945, discard_day: true, order: [ :day, :month, :year ]}, :html=&gt; {class: 'date-select'} %&gt; &lt;/div&gt; &lt;div class="form-checkbox"&gt; &lt;%= f.check_box :experience_current,class: 'is_current', id: "checkbox_id" %&gt; I currently work here &lt;/div&gt; The jQuery code $(document).ready(function(){ $("input[class='is_current']").click(function() { if($('#checkbox_id').prop("checked")) { $('.end-date select').prop( 'disabled', true ); $('.end-date select').css( "background-color", "#D9D8DD" ); } else { $('.end-date select').prop( 'disabled', false ); $('.end-date select').css( "background-color", "white" ); } }); }); This work just fine except when I'm submitting the form and try to access it again to edit it, in this case I found that the checkbox is checked but the form is not disabled, So I'm wondering on How can I resolve this isuue
has answer: http://stackoverflow.com/a/29577680
tagged with: ruby-on-rails
type: AnsweredQuestion

http://stackoverflow.com/q/29658108
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/47561245
has comment: http://stackoverflow.com/comment/47459212
has comment: http://stackoverflow.com/comment/47461955
has body: I have a multi-line graph that updates when a user clicks a button. On some of the updates, the data is completely different, so it just exits those lines and adds new lines, which is all working. I am trying to add a transition to exit/remove so that the removal is cleaner. No matter what I do, I can't get the transition on the exit/remove to work. I have tried delaying the transition and setting it to start when the update transition is done. Here is the code with transitions that is in the update function: //bind data series = svg.selectAll(".series") .data(seriesData, function (d) { return d.name; }); //draw new lines newlines = series.enter().append("g").attr("class","series"); newlines.append("path") .attr("d", function (d) {return line(d.values); }) .on("mouseover", function(d){ div.transition("tooltipIn") .duration(200) .style("opacity", .9)}) .on("mouseout", function(d){ div.transition("tooltipOut") .duration(500) .style("opacity", 0); }); //change the line series.select("path") .transition("pathTrans") .duration(6000) .attr("d", function (d) { return line(d.values); }) series.exit() .transition('exitTrans') .duration(7000) .attr("opacity", 0) .each('start.exit', function (d) {console.log(d.name + ' start') }) .each('end.exit', function (d) { console.log(d.name + ' end') }) .remove(); svg.select(".y.axis") .transition("yaxisTrans") .duration(2000) .call(yAxis); svg.select(".x.axis") .transition("xaxisTrans") .duration(2000) .call(xAxis); //change grid lines svg.select(".grid") .transition("gridTrans") .duration(2000) .call(makeYGrid() .tickSize(-width, 0, 0) .tickFormat("") ) series.select("transition") .each("interrupt", function(d){console.log("interrupted");}); Can someone explain how to get the exit transition to actually work?
score: 1
has comment: http://stackoverflow.com/comment/47550242
has comment: http://stackoverflow.com/comment/47461914
type: Question
downvote count: 0
tagged with: javascript
has title: d3 transition not working on exit/remove
has comment: http://stackoverflow.com/comment/47684231
has comment: http://stackoverflow.com/comment/47469657
has comment: http://stackoverflow.com/comment/47459835
has comment: http://stackoverflow.com/comment/47461427
has comment: http://stackoverflow.com/comment/47463548
has comment: http://stackoverflow.com/comment/47550654
has comment: http://stackoverflow.com/comment/47461970
favorite count: 0
has comment: http://stackoverflow.com/comment/47552535
has comment: http://stackoverflow.com/comment/47457203
has comment: http://stackoverflow.com/comment/47459797
answer count: 0
tagged with: d3.js

http://stackoverflow.com/a/29581278
has body: You can give your inputs an id with your counter and then address them like this: document.getElementById("input1").focus();
type: Answer
answers question: http://stackoverflow.com/q/29581178
score: 0

http://stackoverflow.com/a/29655177
downvote count: 0
answers question: http://stackoverflow.com/q/29655008
type: Answer
score: 8
upvote count: 8
accepted answer of: http://stackoverflow.com/q/29655008
has body: If you wish to capture the "click" from any element: jQuery(document).click(function(e) { if (jQuery(e.target).is('a') &amp;&amp; jQuery(e.target).has('img')) { // code goes here } }); Whether you choose to prevent the "default behavior" is another question.
type: AcceptedAnswer

http://stackoverflow.com/comment/47320972
score: 1
comment on: http://stackoverflow.com/q/29586568
type: QuestionComment
has text: Its hard to know if this is a serious question :) On the assumption that it is, Mark Zucchini is correct and foo is used as a sample name for any function/ class etc. If its not a serious question, well it actually makes things easier because you only have to look in one place for any problems- `foo()` or perhaps `bar()` but in my experience it always `foo`!
type: Comment

http://stackoverflow.com/q/29555627
score: 1
has comment: http://stackoverflow.com/comment/47262201
has comment: http://stackoverflow.com/comment/47261998
linked to: http://stackoverflow.com/q/320797
possible better answer: http://stackoverflow.com/a/29556373
has answer: http://stackoverflow.com/a/29556373
type: Question
upvote count: 2
has body: Lets assume we have the following setup (bellow), I want the table to have 5 cells, which it will, but i want the 5 cells to have a dynamic color range which goes from green to red (1 = green, 3 = yellow, 5 = red, ect) The only technologies I am allowed to work with is : CSS3 / HTML5 / Angular - I am allowed to work with any angular lib In excel its trivial doing this, but since im fairly new to angular, i'm admittedly a bit lost. ~ Script var arrayWith5Values = [1,2,3,4,5] ~ {{numericValue}}} It's basicly the angular version of this question : Coloring HTML table cells from "Low to High Color Shades" depending on Cell Value in Python HTML Email and this Color Cell Based on Value in Cell I have been searching StackOverflow for the majority of last night and could not find an answer. Here is an example (screenshot from excel)
linked to: http://stackoverflow.com/q/3080421
has answer: http://stackoverflow.com/a/29556561
accepted answer: http://stackoverflow.com/a/29556561
has comment: http://stackoverflow.com/comment/47262362
tagged with: javascript
has comment: http://stackoverflow.com/comment/47262069
has answer: http://stackoverflow.com/a/55240881
has comment: http://stackoverflow.com/comment/47262088
favorite count: 0
has comment: http://stackoverflow.com/comment/47262167
linked to: http://stackoverflow.com/q/17242144
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47262027
downvote count: 1
tagged with: css
linked to: http://stackoverflow.com/q/28060644
has title: Color range - table values in angular
tagged with: angularjs
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47262118

http://stackoverflow.com/a/31039381
score: 4
has comment: http://stackoverflow.com/comment/50135671
has comment: http://stackoverflow.com/comment/50140715
downvote count: 0
answers question: http://stackoverflow.com/q/29658636
type: Answer
has comment: http://stackoverflow.com/comment/50102715
upvote count: 4
has comment: http://stackoverflow.com/comment/50135759
has body: This works for me: javascript: location.href = 'https://www.reddit.com/submit?url=' + location.href

http://stackoverflow.com/a/29540581
answers question: http://stackoverflow.com/q/29540471
has body: Define someval outside the scope of the functions: var someval; // &lt;- outside of the scope of any one function another()(); //=&gt; logs "somevalue" callingfn(); //=&gt; logs " someval is not defined" function a(fn){ someval = "some-value"; // &lt;-remove "var" to access the variable outside the scope return fn(); } function callingfn(){ return a.call(this, function(){ console.log(someval) }) } function another(){ var sv = "somevalue"; return function(){ console.log(sv); } }
score: 1
upvote count: 1
downvote count: 0
type: Answer

http://stackoverflow.com/comment/47401754
score: 0
comment on: http://stackoverflow.com/q/29628949
type: Comment
type: QuestionComment
has text: Is there a live site we can see this happening on? This kind of thing can't be reproduced with jsfiddle.

http://stackoverflow.com/comment/47363752
type: Comment
type: QuestionComment
has text: Across all browsers, or just chrome? If you change the name, then what? Any anti-virus/etc extensions installed?
comment on: http://stackoverflow.com/q/29608640
score: 0

http://stackoverflow.com/q/29568412
has body: I have read that it is an anti-pattern to set state from props, but what about setting child properties from state? Is this code okay, or is there a better practice. Let's say we have an APP component that holds and changes it's state. Is it good practice to pass that state down to child display components as props? var APP = React.createClass({ getInitialState() { return { items: [1,2,3], title: 'Simple Sample' }; }, render() { return &lt;div&gt; &lt;Display title={this.state.title} /&gt; &lt;List items={this.state.items} /&gt; &lt;/div&gt; } }); What about something like this: var APP = React.createClass({ getInitialState() { return { items: [1,2,3], title: 'Simple Sample' }; }, render() { return &lt;div&gt; &lt;DisplayList {...this.state} /&gt; &lt;/div&gt; } });
has title: React... setting child Properties from State
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29568617
type: Question
tagged with: ecmascript-6
tagged with: reactjs
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/29568617
score: 0

http://stackoverflow.com/q/29606123
has title: "load" event for dynamically added image
duplicate of: http://stackoverflow.com/q/27332423
has comment: http://stackoverflow.com/comment/47358119
tagged with: web
favorite count: 0
has comment: http://stackoverflow.com/comment/47358036
type: Question
upvote count: 1
has comment: http://stackoverflow.com/comment/47358131
has comment: http://stackoverflow.com/comment/47357912
tagged with: image
has body: I'm using a 3rd party ad provider on my web page. The ad provider injects an image to a div I configured with a certain id. I'd like to attach a load or ready event to that image. Note: I can't tell when the image is added to the DOM. I tried using jquery: $('body').on("load", "img", function (event) { console.log(event); }); And this: $("img").on("load", function (event) { console.log(event); if (event.target == document.querySelector("#myDivId img")) { console.log(event.target); } }); But it didn't work.
has comment: http://stackoverflow.com/comment/47358753
has comment: http://stackoverflow.com/comment/47358672
answer count: 0
downvote count: 0
linked to: http://stackoverflow.com/q/27332423
has comment: http://stackoverflow.com/comment/47358144
tagged with: javascript
type: UnansweredQuestion
score: 1
tagged with: jquery

http://stackoverflow.com/comment/47470133
type: QuestionComment
type: Comment
has text: Its a variable assigned to scope, for example $scope.activeUserName = "maddhur";
score: 0
comment on: http://stackoverflow.com/q/29665514

http://stackoverflow.com/tag/html
tags question: http://stackoverflow.com/q/29582053
tags question: http://stackoverflow.com/q/29540405
tags question: http://stackoverflow.com/q/29585639
tags question: http://stackoverflow.com/q/29539219
tags question: http://stackoverflow.com/q/29659544
tags question: http://stackoverflow.com/q/29559143
tags question: http://stackoverflow.com/q/29584045
tags question: http://stackoverflow.com/q/29610762
tags question: http://stackoverflow.com/q/29541165
tags question: http://stackoverflow.com/q/29554059
tags question: http://stackoverflow.com/q/29638844
tags question: http://stackoverflow.com/q/29536312
tags question: http://stackoverflow.com/q/29545502
tags question: http://stackoverflow.com/q/29650291
tags question: http://stackoverflow.com/q/29551808
tags question: http://stackoverflow.com/q/29578187
tags question: http://stackoverflow.com/q/29552703
tags question: http://stackoverflow.com/q/29629164
tags question: http://stackoverflow.com/q/29620530
tags question: http://stackoverflow.com/q/29658975
tags question: http://stackoverflow.com/q/29648063
tags question: http://stackoverflow.com/q/29605072
tags question: http://stackoverflow.com/q/29547758
tags question: http://stackoverflow.com/q/29653318
tags question: http://stackoverflow.com/q/29569555
tags question: http://stackoverflow.com/q/29591717
tags question: http://stackoverflow.com/q/29638093
tags question: http://stackoverflow.com/q/29571589
tags question: http://stackoverflow.com/q/29538595
tags question: http://stackoverflow.com/q/29613369
tags question: http://stackoverflow.com/q/29646366
tags question: http://stackoverflow.com/q/29593464
tags question: http://stackoverflow.com/q/29684538
tags question: http://stackoverflow.com/q/29576434
tags question: http://stackoverflow.com/q/29643361
tags question: http://stackoverflow.com/q/29637953
tags question: http://stackoverflow.com/q/29677316
tags question: http://stackoverflow.com/q/29650907
tags question: http://stackoverflow.com/q/29620603
tags question: http://stackoverflow.com/q/29558483
tags question: http://stackoverflow.com/q/29680806
tags question: http://stackoverflow.com/q/29546348
tags question: http://stackoverflow.com/q/29630059
tags question: http://stackoverflow.com/q/29540506
tags question: http://stackoverflow.com/q/29628814
tags question: http://stackoverflow.com/q/29541705
tags question: http://stackoverflow.com/q/29637847
tags question: http://stackoverflow.com/q/29588402
tags question: http://stackoverflow.com/q/29624448
tags question: http://stackoverflow.com/q/29543989
tags question: http://stackoverflow.com/q/29636623
tags question: http://stackoverflow.com/q/29665421
tags question: http://stackoverflow.com/q/29564113
tags question: http://stackoverflow.com/q/29542292
tags question: http://stackoverflow.com/q/29599954
tags question: http://stackoverflow.com/q/29668879
tags question: http://stackoverflow.com/q/29675217
tags question: http://stackoverflow.com/q/29602421
tags question: http://stackoverflow.com/q/29668450
tags question: http://stackoverflow.com/q/29643368
tags question: http://stackoverflow.com/q/29632316
tags question: http://stackoverflow.com/q/29576931
tags question: http://stackoverflow.com/q/29563359
tags question: http://stackoverflow.com/q/29639942
tags question: http://stackoverflow.com/q/29573754
tags question: http://stackoverflow.com/q/29668733
tags question: http://stackoverflow.com/q/29595816
tags question: http://stackoverflow.com/q/29605266
tags question: http://stackoverflow.com/q/29624724
tags question: http://stackoverflow.com/q/29655080
tags question: http://stackoverflow.com/q/29646572
tags question: http://stackoverflow.com/q/29590015
tags question: http://stackoverflow.com/q/29605016
tags question: http://stackoverflow.com/q/29623619
tags question: http://stackoverflow.com/q/29624949
tags question: http://stackoverflow.com/q/29548155
tags question: http://stackoverflow.com/q/29653812
tags question: http://stackoverflow.com/q/29626975
tags question: http://stackoverflow.com/q/29627903
tags question: http://stackoverflow.com/q/29663461

http://stackoverflow.com/a/29533424
has body: In your html you create the table like this &lt;table&gt; &lt;tr ng-repeat="msg in messages"&gt; &lt;td&gt;{{msg}}&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; Then in your controller, you push your message in $scope.messages $scope.violation = function(argArray){ var violationLog = argArray; if(violationLog!= null &amp;&amp; violationLog!='undefined') { var violationArray = new Array(); violationArray = violationLog.split("&lt;br/&gt;"); for (var i = 1; i &lt; violationArray.length; i=i+2) { $scope.messages.push(violationArray[i]); } } }
score: 0
has comment: http://stackoverflow.com/comment/47223134
type: Answer
answers question: http://stackoverflow.com/q/29532612

http://stackoverflow.com/comment/47291751
type: Comment
type: QuestionComment
has text: What is the error you get when it's in `.then`?
comment on: http://stackoverflow.com/q/29571149
score: 2

http://stackoverflow.com/q/29676865
type: AnsweredQuestion
has title: jQuery onClick function didn't work after change of id
score: 1
downvote count: 1
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/29676946
tagged with: javascript
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/47491391
has body: I'm creating follow button using AJAX in Laravel. When I click follow, it will turn into unfollow with the change of id. I tried to click unfollow button again, it didn't execute unfollow on click function but remain the previous follow on click function. HTML Follow AJAX $('#followAnchor').on("click", function(e){ var followId = document.getElementById('followAnchor'); $.ajax({ url: "{{ URL::route('follow-post') }}", type: 'POST', data: JSON.stringify(arr), contentType: 'application/json; charset=utf-8', dataType: 'json', }).done(function(response) { if(response.errors) { } else if (response.success){ followId.innerHTML = "" + "Unfollow"; document.getElementById('followAnchor').id = 'unfollowAnchor'; } }); } $('#unfollowAnchor').on("click", function(e){ var unfollowId = document.getElementById('unfollowAnchor'); $.ajax({ url: "{{ URL::route('unfollow-post') }}", type: 'POST', data: JSON.stringify(arr), contentType: 'application/json; charset=utf-8', dataType: 'json', }).done(function(response) { if(response.errors) { } else if (response.success){ unfollowId.innerHTML = "" + "Follow"; document.getElementById('unfollowAnchor').id = 'followAnchor'; } }); });
has answer: http://stackoverflow.com/a/29676980
favorite count: 0
accepted answer: http://stackoverflow.com/a/29676946
upvote count: 2
possible better answer: http://stackoverflow.com/a/29676980
tagged with: php

http://stackoverflow.com/comment/47299823
type: Comment
type: QuestionComment
has text: Please post the code. You seem to violate the terms of SO.
comment on: http://stackoverflow.com/q/29575676
score: 0

http://stackoverflow.com/comment/47459804
type: AnswerComment
score: 0
has text: @Vim, a long time ago when I worked with jqgrid, post the code to see how u do it currently...
type: Comment
comment on: http://stackoverflow.com/a/29659917

http://stackoverflow.com/comment/47396089
has text: @Gayathri, A user only ever registers once. Why would you confuse the user by showing then a pointless form that should not be filled in? Why would you degrade your application by rendering a useless form and posting back useless values? Use 2 different forms.
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29626073
type: QuestionComment

http://stackoverflow.com/a/29554673
has comment: http://stackoverflow.com/comment/61925650
has comment: http://stackoverflow.com/comment/47285049
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: First observation: you need not introduce the loc path in the location structure. Further, you need not even define a separate schema for your location field in the Lead schema. Try this: var Lead = new Schema({ // Other fields ... location: { type: { type: 'String', default: 'Point' // and optionally skip including `type: String` everywhere }, coordinates: { type: [Number] } }, // More fields ... }); LeadAddressSchema.index({ location: '2dsphere' }); Another problem I faced was that the 2dsphere index gets messed up, when figuring and testing out solutions. So try dropping the index, or even better the collection after you make structural changes to the schema. &gt; db.lead.drop(); // on the mongo console`
accepted answer of: http://stackoverflow.com/q/29551630
upvote count: 3
has comment: http://stackoverflow.com/comment/51194568
has comment: http://stackoverflow.com/comment/47284993
score: 3
answers question: http://stackoverflow.com/q/29551630

http://stackoverflow.com/comment/47396074
comment on: http://stackoverflow.com/q/29603903
has text: Cool .. so the problem is solved :p
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/103859599
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29548846
has text: For `Springboot` application, adding `@CrossOrigin` in the rest controller worked for me.
type: AnswerComment

http://stackoverflow.com/a/29615721
has comment: http://stackoverflow.com/comment/47377016
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47377113
has comment: http://stackoverflow.com/comment/47377097
has body: This is happening because you're using the same ID more than one. IDs should be unique. Instead of using id="blr", try using class="blr". I updated the fiddle: http://jsfiddle.net/0rznu4ks/1/
upvote count: 1
answers question: http://stackoverflow.com/q/29615650
type: Answer

http://stackoverflow.com/q/29685894
has answer: http://stackoverflow.com/a/33247931
tagged with: firefox
answer count: 1
has title: Import a content script in a firefox extension without sdk
tagged with: javascript
score: 0
type: UnansweredQuestion
has body: I'm trying to develop a restartless firefox extension without the sdk, and I would like to be able to manipulate the DOM of the page, but either the document, content.document or unsafeWindow.document are returning undefined. My bootstrap.js code: Components.utils.import("resource://gre/modules/Services.jsm"); function startup(data,reason) { Components.utils.import("chrome://myextension/content/plugin-min.js"); } function shutdown(data,reason) { Components.utils.unload("chrome://myextension/content/plugin-min.js"); } function install(data,reason) { } function uninstall(data,reason) { } and my plugin-min.js code: document.addEventListener('keydown',activate); // document undefined content.document.addEventListener('keydown',activate); // content undefined unsafeWindow.document.addEventListener('keydown',activate); // unsafeWindow undefined And Mozilla published solution only for SDK users, and google searches I've done brought only these SDKs solutions. :/ But in my case, Does anyone know what I'm missing? Thank you very much.
type: Question
tagged with: add-on

http://stackoverflow.com/comment/47221907
score: 0
type: AnswerComment
type: Comment
has text: displaying "2015-04-03T18:30:00.000Z", "2015-04-04T18:30:00.000Z", as sat sunday but actual its friday saturday
comment on: http://stackoverflow.com/a/29533631

http://stackoverflow.com/comment/47324093
type: Comment
type: QuestionComment
has text: Add it as <WebSocket enabled="false" />. Then try again. If you don't know where to add look Herr an example https://github.com/auth0/sharelock/blob/master/web.config
comment on: http://stackoverflow.com/q/29583583
score: 0

http://stackoverflow.com/q/29614318
tagged with: jquery
has body: I have created a liferay portlet using mvc (jsp ) and i'm using JQuery for datatable. I have succeeded to bring a list and display it on a table using Jquery. Now, I'm trying to make it editable to use CRUD functions. The problem that i'm using java not php and i couldn't assign a servlet function (doget).i didn't understand it well (how to use it) and they set the url of this class to jquery. If i'm not wrong this would be configured in web.xml (servlet mapping). So i wonder how to properly configured and use it? Also, i don't know jquery but it seems that the buttons needs to be manually included. is there any method to include them directly? (with jquery looks and pop up). Servlet comes in 2.4 version i had troubles changing it to 3.0 using eclipse. Best Regards
has title: Portlet jsp + jquery datatable +servlet implementation
tagged with: servlets
accepted answer: http://stackoverflow.com/a/29627145
score: 0
linked to: http://stackoverflow.com/q/17592144
answer count: 1
type: AnsweredQuestion
tagged with: java
type: Question
has answer: http://stackoverflow.com/a/29627145
tagged with: jsp
tagged with: javascript

http://stackoverflow.com/q/29548155
has body: function firstAnimation() { $('.etc(1)').fadeIn(); } function secondAnimation() { $('.etc(1)').fadeOut(); $('.etc(2)').fadeIn(); } function thirdAnimation() { $('.etc(2)').fadeOut(); $('.etc(3)').fadeIn(); } function fourthAnimation() { $('.etc(3)').fadeOut(); $('.etc(4)').fadeIn(); } $(window).scroll(function() { if ($(this).scrollTop() &gt; 150) { firstAnimation(); } if ($(this).scrollTop() &gt; 300) { secondAnimation(); } if ($(this).scrollTop() &gt; 450) { thirdAnimation(); } if ($(this).scrollTop() &gt; 600) { fourthAnimation(); } }); Guys, i'm using scrollTop() to animate a piece of my site, and i was wondering if i can reverse the animation if o scroll to the bottom, and not to the top. I was searching but there isn't a scrollBottom in jquery.
has answer: http://stackoverflow.com/a/29549397
accepted answer: http://stackoverflow.com/a/29549397
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47247980
possible better answer: http://stackoverflow.com/a/29548737
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29548737
linked to: http://stackoverflow.com/q/4326845
has answer: http://stackoverflow.com/a/29548978
has title: How reverse animations made with scrollTop();
tagged with: css
type: AnsweredQuestion
type: Question

http://stackoverflow.com/q/29594411
tagged with: php
downvote count: 1
possible better answer: http://stackoverflow.com/a/29594550
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47335789
has answer: http://stackoverflow.com/a/29594550
has body: script php <? $str = "ABCD"; echo "ENCODING: " . mb_detect_encoding($str) . "\n"; ?> im not good at english sorry. $str = "ABCD" i want to send string from php to javascript var myvar = <?= json_encode($str); ?>; i use json_encode but when i alert no massage display in alert-box(box happen but no massage there maybe null value) alert(myvar); i dont know what happen please help me PS.alert for test string i want to use that string in javascript code
accepted answer: http://stackoverflow.com/a/29594512
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/47335887
has comment: http://stackoverflow.com/comment/47335759
type: Question
has comment: http://stackoverflow.com/comment/47342642
answer count: 2
tagged with: arrays
tagged with: javascript
tagged with: string
score: 0
has answer: http://stackoverflow.com/a/29594512
has comment: http://stackoverflow.com/comment/47335716
favorite count: 0
has comment: http://stackoverflow.com/comment/47335738
has title: json_encode string php to javascript but when use it in javascript got null
upvote count: 1

http://stackoverflow.com/a/29684030
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29683835
has comment: http://stackoverflow.com/comment/47505026
has comment: http://stackoverflow.com/comment/47572822
upvote count: 1
type: AcceptedAnswer
has body: The Angular way to do this would be to use ng-show or ng-if to show or hide the .add-user element. {{ __ "Update" }} ... for animations, research ngAnimate, i haven't worked with it much so I can't provide a sample.
type: Answer
has comment: http://stackoverflow.com/comment/47508418
accepted answer of: http://stackoverflow.com/q/29683835

http://stackoverflow.com/comment/47413306
type: QuestionComment
comment on: http://stackoverflow.com/q/29635361
score: 0
has text: @MohammedBaashar that's because you're setting it to the `textContent` property. Try `innerHTML`
type: Comment

http://stackoverflow.com/comment/47362541
type: QuestionComment
has text: this is use full for you http://stackoverflow.com/questions/14452751/grunt-multi-tasks-throwing-eisdir-error-when-building`
type: Comment
comment on: http://stackoverflow.com/q/29608291
score: 0

http://stackoverflow.com/comment/47505991
comment on: http://stackoverflow.com/a/29684444
score: 0
type: Comment
has text: This works very well but, I need my crafting buttons to be float: left; so that my page doesn't center them vertically. Basically, I have 3 divs that use crafting buttons on one page, I need to have them align left. If I can't figure something else out, I will definitely use your method as it works very easily for what it does.
type: AnswerComment

http://stackoverflow.com/comment/47623557
type: Comment
comment on: http://stackoverflow.com/a/29682530
has text: Yep, tried that already; your example works with just jQuery, but jQuery SVG doesn't seem to want to work with it :(
type: AnswerComment
score: 0

http://stackoverflow.com/a/29559589
type: Answer
score: 1
upvote count: 1
has body: One possible explanation of the 3 count is that the scripts added via document.write are executed synchronously. So: Script engine executes the script block that contains document.write Script engine adds the first script to DOM. Script engine does not add the second script to DOM -- it must wait for the first script to download and execute. After all, it is possible for the first script to do a document.write("&lt;!--"); Script engine returns the count 3 Script engine downloads the first script and executes it. Script engine adds the second script to the DOM, downloads it and executes it. Keep in mind that JavaScript is single threaded. This prevents the execution of script tags generated by document.write until the script that generates script tags is finished.
answers question: http://stackoverflow.com/q/29557911
downvote count: 0

http://stackoverflow.com/q/29553369
accepted answer: http://stackoverflow.com/a/29553487
type: Question
has body: I want to delete any JSON element by using their key. For example, This is my JSON data: { "CreateprivateNetwork": { "description": "Creatinganetwork.", "input": { "body": { "network": { "name": "$.networkname", "admin_state_up": "sdfdsf" } } }, "action": "neutron.create_network", "publish": {} } } I want to delete the element "name" from this JSON PATH TO DELETE : "CreateprivateNetwork.input.body.network.name". Please help me to solve this problem. Note: This path may change Dynamically. So I have to delete any elements from dynamic JSON.
tagged with: http://stackoverflow.com/tag/json
has title: Delete a element in multi nested JSON using javascript or jQuery
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29553487
favorite count: 0
score: 2
type: AnsweredQuestion
upvote count: 2

http://stackoverflow.com/comment/47260056
type: Comment
type: QuestionComment
has text: window.mobilecheck() == 1 ?. Execute your function, in current way any `if` will be true, as function exists
comment on: http://stackoverflow.com/q/29554669
score: 3

http://stackoverflow.com/comment/47410285
has text: you can look for "smoking guns" associated with each browser you're looking for. not every single version of all browsers has one of those, but each version of IE will for sure. work your way backwards on caniuse to find globals supported by certain IE version, ex btoa, XMLHttpRequest, FileReader(), etc.
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29633942
type: Comment

http://stackoverflow.com/a/58086583
answers question: http://stackoverflow.com/q/29549836
type: Answer
upvote count: 0
score: -1
has body: It can be calculated by using the recursion var numberSum = (n, a = n) =&gt; n ? numberSum(n = n - 1 , a = a + n) : a
downvote count: 1

http://stackoverflow.com/a/34623302
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29659605
has body: Try to do something like this: &lt;video id="Video_ID" class="video-js vjs-default-skin vjs-big-play-centered" controls preload="metadata" &gt; &lt;source type="video/youtube" src="http://www.youtube.com/watch?v=xjS6SftYQaQ"&gt; &lt;/video&gt; And for your Script: videojs("Video_ID", { nativeControlsForTouch: false, //This for mobile device touch plugins: { //.... Your plugins ads:{}, //perhaps you will need this for ads init vast:{ url: "http://bs.serving-sys.com/BurstingPipe/adServer.bs?cn=is&amp;c=23&amp;pl=VAST&amp;pli=13569296&amp;PluID=0&amp;pos=1886&amp;ord=%%CACHEBUSTER%%&amp;cim=1" } }, techOrder: ["Html5","youtube"] },function(){ //... Player (this) is initialized and ready. });

http://stackoverflow.com/q/29648313
tagged with: javascript
tagged with: jquery
tagged with: quicksand
answer count: 1
downvote count: 0
favorite count: 0
has body: I'm using quicksand but I'd like to add a hover effect inside the element that is filtered by Quicksand jquery. (function ($) { var $itemsHolder = $('ul.proyectosthumb'); var $itemsClone = $itemsHolder.clone(); var $filterClass = ""; $('ul.filter li').click(function(e) { e.preventDefault(); $filterClass = $(this).attr('data-value'); if ($filterClass == 'all') { var $filters = $itemsClone.find('li'); } else { var $filters = $itemsClone.find('li[data-type='+ $filterClass +']'); } $itemsHolder.quicksand($filters); }); }(jQuery)); Function for hover effect: $('.thumbnail').hover( function(){ $(this).find('.caption-hover').fadeIn(250); //.fadeIn(250) }, function(){ $(this).find('.caption-hover').fadeOut(250); //.fadeOut(205) } ); Any Idea to add this function inside Quicksand?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47439444
has title: Add function inside Quicksand jquery
tagged with: css
score: 2
upvote count: 2
linked to: http://stackoverflow.com/q/14950321
type: Question
linked to: http://stackoverflow.com/q/29078769
has answer: http://stackoverflow.com/a/29648475

http://stackoverflow.com/comment/47434655
type: Comment
has text: @Touffy no need to say the word "duh", we're here to learn not to be rude.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29646949

http://stackoverflow.com/comment/47289377
has text: don't necessarily need an ng-repeat for this, though it is weird that the question mentions trying to use it but doesn't show it.
comment on: http://stackoverflow.com/q/29569916
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29584705
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47318307
has comment: http://stackoverflow.com/comment/47317745
has comment: http://stackoverflow.com/comment/47317840
answers question: http://stackoverflow.com/q/29584688
accepted answer of: http://stackoverflow.com/q/29584688
has body: The command to close fancybox is $.fancybox.close() If the progress bar is in an IFrame within the fancybox, you'll need to use parent.$.fancybox.close() Replacing your comment in the success method with the appropriate command should work.
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47318190

http://stackoverflow.com/q/29673879
favorite count: 0
type: UnansweredQuestion
tagged with: three.js
has body: I'm working with the GPU picking example in Three js. Can someone explain how we retrieve the object from the picking texture. I don't understand how the code works. //create buffer for reading single pixel var pixelBuffer = new Uint8Array( 4 ); //read the pixel under the mouse from the texture renderer.readRenderTargetPixels(pickingTexture, mouse.x, pickingTexture.height - mouse.y, 1, 1, pixelBuffer); //interpret the pixel as an ID var id = ( pixelBuffer[0] &lt;&lt; 16 ) | ( pixelBuffer[1] &lt;&lt; 8 ) | ( pixelBuffer[2] ); var data = pickingData[ id ]; I understand that we're getting the pixel value from the texture, but unclear as to how we then reference the object using the ID
answer count: 0
upvote count: 1
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/52781726
has title: GPU Picking in Three JS
downvote count: 0
score: 1

http://stackoverflow.com/a/29638589
has comment: http://stackoverflow.com/comment/47420205
has comment: http://stackoverflow.com/comment/47419865
has body: For loops and if statements are contained within curly braces - that's the syntax. So if you embed an if inside a for, each block must be inside its respective block. if(something){ return; } for(i=0; i&lt;10; i++){// open curly for the for if(i == 4){//curly for the if console.log('i is 4!'); }//end curly for the if }//end curly for the for
score: 0
answers question: http://stackoverflow.com/q/29638481
has comment: http://stackoverflow.com/comment/47420165
type: Answer
has comment: http://stackoverflow.com/comment/47419343
has comment: http://stackoverflow.com/comment/47419496
upvote count: 1
downvote count: 1

http://stackoverflow.com/q/29680354
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47498028
has answer: http://stackoverflow.com/a/29680398
accepted answer: http://stackoverflow.com/a/29680398
possible better answer: http://stackoverflow.com/a/29680441
type: AnsweredQuestion
has title: Select button from div inside dynamic table
has body: I need to add a click event handler for a button inside a div that is inside a table. How do I reach it using jQuery. Here is my div: Here is how I populate it: function onSuccess(response) { p = response; //p is global for debugging! resultsArray = response.results; str = ' '; str += ' Album '; str += ' Track Name '; str += ' Save '; for (i = 0; i < resultsArray.length; i++) { str += ' ' + '<img src=\'' + resultsArray[i].artworkUrl100 +'\' height=\'100\' width=\'100\'' + ' '; str += ' ' + resultsArray[i].trackName.substring(0,30) + ' '; str += ' '; } str += ' '; $('#fromServer').html(str); } Here is how it looks: Now I want to add a click event handler for the save button, how do I do that? Here is my attempt but it doesn't work. $('#fromServer').find("#mytable").find("#save").bind('click', saveButtonEventHandler); //Event Handlers function saveButtonEventHandler(evt) { alert("Button pressed!"); }
type: Question
score: 3
tagged with: javascript
has answer: http://stackoverflow.com/a/29680441
upvote count: 3
answer count: 2
downvote count: 0

http://stackoverflow.com/q/29663462
tagged with: javascript
has answer: http://stackoverflow.com/a/29663730
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47466814
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47466722
accepted answer: http://stackoverflow.com/a/29663730
has title: I am not able to clear my interval set with onmousedown with onmouseup
type: Question
has comment: http://stackoverflow.com/comment/47466307
score: 0
has comment: http://stackoverflow.com/comment/47466413
answer count: 1
has body: I am currently trying to make my webpage more userfriendly for mobile and tabs, and I'm having this issue: I want a button to increase a textbox value while the button is being pressed (onmousedown). So I created my button like this: Now, when I press the button, it starts calling the increaseFont function, but it doesn't stop when I release the button or move the mouse out of the span. If I type this into my browser console (inter="setInter.." and clearInterval(inter);) it works as intended. I fear this has something to do with what scope "inter" belongs to when using the html events, but I cannot seem to find a solution to this. I've tried creating a global variable named inter in the top of my JS (doesn't work).

http://stackoverflow.com/q/29545011
tagged with: arrays
has answer: http://stackoverflow.com/a/29545281
tagged with: javascript
score: 0
answer count: 3
has title: JavaScript error with splitting string into array
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29545286
tagged with: string
has answer: http://stackoverflow.com/a/29551301
has comment: http://stackoverflow.com/comment/47241711
has comment: http://stackoverflow.com/comment/47243171
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47243201
has comment: http://stackoverflow.com/comment/47243126
has comment: http://stackoverflow.com/comment/47243092
has body: I am running into an issue with splitting a string into an array. To help myself troubleshoot the problem, I included two alert() functions, but only one gets called. Therefore, I know that there is an issue splitting a string into an array (for a basic username/password check). Here is my JS code: function check() { var user = document.loginform.usr.value; var pass = document.loginform.psw.value; var valid = false; var txt = new XMLHttpRequest(); var alltext = ""; var allLines = []; var usrn = []; var pswd = []; txt.open("GET", "/c.txt", true); alltext = txt.responseText; allLines = alltext.split(/\r\n|\n/); usrn = allLines[0].split(','); alert("usrn split"); pswd = allLines[1].split(','); alert("pswd split"); for (var i=0; i <usrn.length; i++) { if ((user == usrn[i]) && (pass == pswd[i])) { valid = true; break; } } if(valid) { window.location = "test.html"; return false; }else{ var div = document.getElementById("login"); div.innerHTML = 'Invalid Username/Password! ' + div.innerHTML; } } The file that contains the login credentials (c.txt) is as follows: User1,User2 pass,password When User1 enters his/her name into the form, the password should be "pass". However, the script gets stopped at "pswd = allLines[1].split(',');". Am I misunderstanding the lines array? Any help is appreciated - thanks!
tagged with: file
type: Question

http://stackoverflow.com/comment/47376792
comment on: http://stackoverflow.com/a/29615569
type: AnswerComment
has text: What exactly was the solution? Was jQuery not included?
score: 0
type: Comment

http://stackoverflow.com/comment/47474746
has text: http://jsfiddle.net/vm47p2sk/1/
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29667099
score: 1

http://stackoverflow.com/q/29540506
has body: I am facing a weird behavior from bootstrap. I am using img-responsive class for a image in my page using bootstrap. my image is fine in Google Chrome it re sizes properly but in FF and IE it is re sizing properly in desktop and I PAD view but when i go lower screen size like phones and i phones it doesn't re-sizes it stays the original size. It works fine for Google chrome for every screen resolutions but in IE and FF it doesn't shrink in any single columns sizes. it retains the original size of the image which is very big. Attached are the images from the web inspector for each browser. Firefox IE GoogleChrome Any help
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29565002
has comment: http://stackoverflow.com/comment/47234921
tagged with: twitter-bootstrap
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29541713
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/47279586
type: Question
has title: Bootstrap image responsive not working in IE and Firefox but works fine in Google Chrome
tagged with: javascript
tagged with: sharepoint

http://stackoverflow.com/q/29565505
tagged with: angularjs
type: UnansweredQuestion
score: 3
answer count: 0
upvote count: 3
has body: myApp.run(['$http', '$rootScope', function($http, $rootScope ) { console.log($rootScope); $rootScope.on('$locationChangeStart', function(event, next, current) {}); }]); Here in console I am getting output as scope object but on next line I am getting error as Uncaught TypeError: undefined is not a function....
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47281501
has comment: http://stackoverflow.com/comment/47280736
has comment: http://stackoverflow.com/comment/47280649
downvote count: 0
has title: angularjs $rootScope.on() TypeError: undefined is not a function
favorite count: 0

jquery
tags question: http://stackoverflow.com/q/29596737
tags question: http://stackoverflow.com/q/29657887
tags question: http://stackoverflow.com/q/29590730
tags question: http://stackoverflow.com/q/29559115
tags question: http://stackoverflow.com/q/29600009
tags question: http://stackoverflow.com/q/29609032
tags question: http://stackoverflow.com/q/29557033
tags question: http://stackoverflow.com/q/29591445
tags question: http://stackoverflow.com/q/29604844
tags question: http://stackoverflow.com/q/29544473
tags question: http://stackoverflow.com/q/29672188
tags question: http://stackoverflow.com/q/29607869
tags question: http://stackoverflow.com/q/29579277
tags question: http://stackoverflow.com/q/29687356
tags question: http://stackoverflow.com/q/29682493
tags question: http://stackoverflow.com/q/29588242
tags question: http://stackoverflow.com/q/29654122
tags question: http://stackoverflow.com/q/29660578
tags question: http://stackoverflow.com/q/29593137
tags question: http://stackoverflow.com/q/29544159
tags question: http://stackoverflow.com/q/29663408
tags question: http://stackoverflow.com/q/29675132
tags question: http://stackoverflow.com/q/29657853
tags question: http://stackoverflow.com/q/29559013
tags question: http://stackoverflow.com/q/29683951
tags question: http://stackoverflow.com/q/29650549
tags question: http://stackoverflow.com/q/29567858
tags question: http://stackoverflow.com/q/29555648
tags question: http://stackoverflow.com/q/29605637
tags question: http://stackoverflow.com/q/29552060
tags question: http://stackoverflow.com/q/29674704
tags question: http://stackoverflow.com/q/29569316
tags question: http://stackoverflow.com/q/29636988
tags question: http://stackoverflow.com/q/29615709
tags question: http://stackoverflow.com/q/29568783
tags question: http://stackoverflow.com/q/29657174
tags question: http://stackoverflow.com/q/29587391
tags question: http://stackoverflow.com/q/29670043
tags question: http://stackoverflow.com/q/29571350
tags question: http://stackoverflow.com/q/29585591
tags question: http://stackoverflow.com/q/29662117
tags question: http://stackoverflow.com/q/29589455
tags question: http://stackoverflow.com/q/29551883
tags question: http://stackoverflow.com/q/29549864
tags question: http://stackoverflow.com/q/29541819
tags question: http://stackoverflow.com/q/29688189
tags question: http://stackoverflow.com/q/29648424
tags question: http://stackoverflow.com/q/29630174
tags question: http://stackoverflow.com/q/29603033
tags question: http://stackoverflow.com/q/29556457
tags question: http://stackoverflow.com/q/29543059
tags question: http://stackoverflow.com/q/29639560
tags question: http://stackoverflow.com/q/29676842
tags question: http://stackoverflow.com/q/29584822
tags question: http://stackoverflow.com/q/29587038
tags question: http://stackoverflow.com/q/29653063
tags question: http://stackoverflow.com/q/29647336
tags question: http://stackoverflow.com/q/29633712
tags question: http://stackoverflow.com/q/29680027
tags question: http://stackoverflow.com/q/29594236
tags question: http://stackoverflow.com/q/29671319
tags question: http://stackoverflow.com/q/29588875
tags question: http://stackoverflow.com/q/29531758
tags question: http://stackoverflow.com/q/29539448
tags question: http://stackoverflow.com/q/29661072
tags question: http://stackoverflow.com/q/29637558
tags question: http://stackoverflow.com/q/29548560
tags question: http://stackoverflow.com/q/29594906
tags question: http://stackoverflow.com/q/29533820
tags question: http://stackoverflow.com/q/29605152
tags question: http://stackoverflow.com/q/29640355
tags question: http://stackoverflow.com/q/29644310
tags question: http://stackoverflow.com/q/29649989
tags question: http://stackoverflow.com/q/29584563
tags question: http://stackoverflow.com/q/29679874
tags question: http://stackoverflow.com/q/29644259
tags question: http://stackoverflow.com/q/29678550
tags question: http://stackoverflow.com/q/29612870
tags question: http://stackoverflow.com/q/29628701
tags question: http://stackoverflow.com/q/29638832

http://stackoverflow.com/q/29686831
has comment: http://stackoverflow.com/comment/47511224
has comment: http://stackoverflow.com/comment/47511978
has comment: http://stackoverflow.com/comment/47511296
answer count: 0
has comment: http://stackoverflow.com/comment/47510778
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47512014
has comment: http://stackoverflow.com/comment/47511729
tagged with: webview
has comment: http://stackoverflow.com/comment/47510945
tagged with: alert
has comment: http://stackoverflow.com/comment/47511778
type: Question
has comment: http://stackoverflow.com/comment/47510840
has body: I can't see JS alerts in the web view on my app. After i've used setWebChromeClient method it works on devices without the new web view engine. But i can't see my JS alerts on lollipop devices with the new web view engine.
tagged with: javascript
has comment: http://stackoverflow.com/comment/47511748
has comment: http://stackoverflow.com/comment/47511847
score: 0
has title: android show JS alerts in web view! (JS alerts not showing in lollipop devices due to the new webView engine)
tagged with: android

css
tags question: http://stackoverflow.com/q/29589369
tags question: http://stackoverflow.com/q/29681835
tags question: http://stackoverflow.com/q/29547632
tags question: http://stackoverflow.com/q/29555599
tags question: http://stackoverflow.com/q/29599917
tags question: http://stackoverflow.com/q/29537985
tags question: http://stackoverflow.com/q/29594613
tags question: http://stackoverflow.com/q/29669565
tags question: http://stackoverflow.com/q/29632352
tags question: http://stackoverflow.com/q/29578587
tags question: http://stackoverflow.com/q/29561335
tags question: http://stackoverflow.com/q/29634611
tags question: http://stackoverflow.com/q/29547033
tags question: http://stackoverflow.com/q/29560607
tags question: http://stackoverflow.com/q/29627031
tags question: http://stackoverflow.com/q/29632651
tags question: http://stackoverflow.com/q/29670264
tags question: http://stackoverflow.com/q/29636642
tags question: http://stackoverflow.com/q/29565815
tags question: http://stackoverflow.com/q/29633243
tags question: http://stackoverflow.com/q/29579140
tags question: http://stackoverflow.com/q/29601953
tags question: http://stackoverflow.com/q/29540612
tags question: http://stackoverflow.com/q/29670254
tags question: http://stackoverflow.com/q/29592916
tags question: http://stackoverflow.com/q/29534983
tags question: http://stackoverflow.com/q/29552904
tags question: http://stackoverflow.com/q/29673262
tags question: http://stackoverflow.com/q/29659685
tags question: http://stackoverflow.com/q/29684858
tags question: http://stackoverflow.com/q/29664182
tags question: http://stackoverflow.com/q/29585021
tags question: http://stackoverflow.com/q/29587106
tags question: http://stackoverflow.com/q/29549511
tags question: http://stackoverflow.com/q/29554361
tags question: http://stackoverflow.com/q/29582003
tags question: http://stackoverflow.com/q/29688187
tags question: http://stackoverflow.com/q/29617530
tags question: http://stackoverflow.com/q/29629771
tags question: http://stackoverflow.com/q/29539704
tags question: http://stackoverflow.com/q/29581802
tags question: http://stackoverflow.com/q/29578224
tags question: http://stackoverflow.com/q/29637219
tags question: http://stackoverflow.com/q/29669063
tags question: http://stackoverflow.com/q/29642071
tags question: http://stackoverflow.com/q/29581060
tags question: http://stackoverflow.com/q/29580780
tags question: http://stackoverflow.com/q/29652522
tags question: http://stackoverflow.com/q/29554980
tags question: http://stackoverflow.com/q/29681038
tags question: http://stackoverflow.com/q/29587639
tags question: http://stackoverflow.com/q/29678828
tags question: http://stackoverflow.com/q/29576359
tags question: http://stackoverflow.com/q/29679363
tags question: http://stackoverflow.com/q/29608071
tags question: http://stackoverflow.com/q/29582053
tags question: http://stackoverflow.com/q/29540405
tags question: http://stackoverflow.com/q/29539219
tags question: http://stackoverflow.com/q/29682574
tags question: http://stackoverflow.com/q/29615607
tags question: http://stackoverflow.com/q/29610762
tags question: http://stackoverflow.com/q/29571580
tags question: http://stackoverflow.com/q/29554059
tags question: http://stackoverflow.com/q/29638844
tags question: http://stackoverflow.com/q/29536312
tags question: http://stackoverflow.com/q/29620530
tags question: http://stackoverflow.com/q/29633441
tags question: http://stackoverflow.com/q/29605072
tags question: http://stackoverflow.com/q/29641449
tags question: http://stackoverflow.com/q/29547758
tags question: http://stackoverflow.com/q/29653318
tags question: http://stackoverflow.com/q/29539630
tags question: http://stackoverflow.com/q/29613369
tags question: http://stackoverflow.com/q/29611843
tags question: http://stackoverflow.com/q/29632021
tags question: http://stackoverflow.com/q/29576649
tags question: http://stackoverflow.com/q/29671786
tags question: http://stackoverflow.com/q/29629815
tags question: http://stackoverflow.com/q/29540506
tags question: http://stackoverflow.com/q/29670776

http://stackoverflow.com/a/72407608
type: Answer
answers question: http://stackoverflow.com/q/29615889
score: 0
has comment: http://stackoverflow.com/comment/136531556
has body: const sequelize = new Sequelize(database, user, password, { host, port, dialect: "postgres", logging: false, sync: true, //create the table if it not exists });

http://stackoverflow.com/a/29669294
score: 7
accepted answer of: http://stackoverflow.com/q/29669263
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47477713
has body: Use .val() set the value of text area instead of using .text() $("#tarea").val(atob(data.xmlString)); Since you are using jQuery, you can use jQuery methods to set the text contents and value like $.getJSON(uri + '/' + id).done(function (data) { $("#tarea").val(atob(data.xmlString)); $("#currentTicket").text("Current Ticket: " + data.TicketID); $("#menu1").text(data.TicketID); $("#input").val(data.TicketID); })
answers question: http://stackoverflow.com/q/29669263
upvote count: 7
type: Answer
downvote count: 0

http://stackoverflow.com/q/29642831
has comment: http://stackoverflow.com/comment/47426948
linked to: http://stackoverflow.com/q/9703700
answer count: 1
tagged with: google-plus
tagged with: javascript
has title: Google Sign-In and logging in users
score: 0
tagged with: google-authentication
has answer: http://stackoverflow.com/a/29657763
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/47444592
tagged with: google-signin
has body: I have an app and I want to let people login using google sign-in. I need to check in the server what are the permissions of the current logged in user. (I have a table with email/role) I read the documentation here: https://developers.google.com/identity/sign-in/web/sign-in from what I understand, when a user logs in using google, I get a callback and I can use the email and make calls to my server with it. But what I don't understand is how can I make sure a malicious user won't see the javascript code and make a request to my server using any email he wants? In other words, if the entire sign-in is in javascript, how can validate the identity in the server?

http://stackoverflow.com/q/29643842
has answer: http://stackoverflow.com/a/29644872
has comment: http://stackoverflow.com/comment/47428849
has answer: http://stackoverflow.com/a/68479161
has body: I want to make my heading text in my webpage like a gold I don' want a color like this #ffd700 I want the same look and feel like any graphics designer can make gold effect in Photoshop. Here I am attaching an example how I want.
has answer: http://stackoverflow.com/a/29644064
has comment: http://stackoverflow.com/comment/47429950
has title: How to make gold effect text using CSS3
upvote count: 8
has comment: http://stackoverflow.com/comment/47428722
type: Question
has comment: http://stackoverflow.com/comment/47429761
has comment: http://stackoverflow.com/comment/47428689
score: 5
has comment: http://stackoverflow.com/comment/47430107
has answer: http://stackoverflow.com/a/29646385
tagged with: javascript
answer count: 6
has answer: http://stackoverflow.com/a/29645156
has comment: http://stackoverflow.com/comment/47432047
downvote count: 3
has answer: http://stackoverflow.com/a/29645224
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0
has comment: http://stackoverflow.com/comment/47429589
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47430369

http://stackoverflow.com/comment/47458166
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29658966
has text: I think you have to more specific and provide a concrete example. Does the value *literally* contain the leading and trailing quotes? Or are those maybe just the delimiters of the HTML attribute? Keep in mind that the values of input elements are always strings. The leading and trailing `"` of a string literal or HTML attribute value are *not* part of the string value. You can't replace what doesn't exist (and even then you would still have a string). So, I think you are approaching the issue in the wrong way and you should provide a complete picture of the original issue instead.
score: 0

http://stackoverflow.com/comment/47780151
has text: btw, the first block of code is in the Create plugin.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29826793
score: 0

http://stackoverflow.com/q/29565170
has comment: http://stackoverflow.com/comment/47280162
has answer: http://stackoverflow.com/a/29565416
tagged with: php
has comment: http://stackoverflow.com/comment/47280275
has comment: http://stackoverflow.com/comment/47280705
linked to: http://stackoverflow.com/q/15461786
has answer: http://stackoverflow.com/a/29566241
type: Question
has body: I have protfolio.html file and i have a table #gallery with categories in it. I want to update content of the #gallery, depending on chosen category using ajax. To achieve this I have php file which scans specific folder with the images relevant to category and returns html, however I don't know how to pass the location string to php script. So far, i have this: index.html file: view all webdesign Script function getImages(location) { $.ajax({ type: "GET", url: 'loadImages.php', data: location, success: function(data) { $('#gallery').html(data); } }); } php file: # To prevent browser error output # Path to image folder $imageFolder = $_POST["location"]; # Show only these file types from the image folder $imageTypes = '{*.jpg,*.JPG,*.jpeg,*.JPEG,*.png,*.PNG,*.gif,*.GIF}'; # Set to true if you prefer sorting images by name # If set to false, images will be sorted by date $sortByImageName = false; # Set to false if you want the oldest images to appear first # This is only used if images are sorted by date (see above) $newestImagesFirst = true; # The rest of the code is technical # Add images to array $images = glob($imageFolder . $imageTypes, GLOB_BRACE); # Sort images if ($sortByImageName) { $sortedImages = $images; natsort($sortedImages); } else { # Sort the images based on its 'last modified' time stamp $sortedImages = array(); $count = count($images); for ($i = 0; $i < $count; $i++) { $sortedImages[date('YmdHis', filemtime($images[$i])) . $i] = $images[$i]; } # Sort images in array if ($newestImagesFirst) { krsort($sortedImages); } else { ksort($sortedImages); } } $count = count($images); for($i=1;$i<=$count; $i++) { $ } # Generate the HTML output writeHtml(' '); $count=1; foreach ($sortedImages as $image) { # Get the name of the image, stripped from image folder path and file type extension # Get the 'last modified' time stamp, make it human readable # Begin adding if ($count==1 || $count%3==0) { writeHtml(' '); } writeHtml(' '); writeHtml(' '); writeHtml(' '); if…
has comment: http://stackoverflow.com/comment/47279999
tagged with: javascript
tagged with: jquery
has title: how to pass parameter to php from html file using ajax?
has comment: http://stackoverflow.com/comment/47280107
tagged with: ajax
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47280185
has answer: http://stackoverflow.com/a/29566627
type: UnansweredQuestion

http://stackoverflow.com/comment/100256642
type: Comment
comment on: http://stackoverflow.com/a/30045041
has text: Despite this question is old it still shows up. I was experimenting with your code. Being obsessed with that saved audio is exactly what it was before, I compared the copy made with this code with the original file, by buffers channel data. I've found that, for negative values, it differs by 1 int16. The problem lies here: `sample = (0.5 + sample < 0 ? sample * 32768 : sample * 32767)|0;`. I replaced this line with `sample *= 32768` and now it seems to produce nice ideal copy. Also I've removed clamping (previous line), because channel data is already in [-1...1] range.
score: 1
type: AnswerComment

http://stackoverflow.com/a/29589050
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/29589017
score: 1
has comment: http://stackoverflow.com/comment/47325350
has body: Without sufficient details or a link then the really simple lazy solution is: body { overflow:hidden } Just scan through the document tree in developer tools on your browser and check sizes and margins.
downvote count: 0

http://stackoverflow.com/q/29669443
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/47479700
upvote count: 3
tagged with: angular-material
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47479849
has comment: http://stackoverflow.com/comment/47477313
has answer: http://stackoverflow.com/a/29680845
answer count: 2
has comment: http://stackoverflow.com/comment/47477392
downvote count: 0
has title: Angular Material Design: $mdMedia('gt-md') not working in html
has answer: http://stackoverflow.com/a/29671422
favorite count: 0
has body: I've been coding a project in AngularJS to start learning the framework, currently I'm using the angular-material library and I'm trying to implement a sidenav similar to their demo here: https://material.angularjs.org/#/demo/material.components.sidenav Unfortunately the $mdMedia('gt-md') call within the html below is always returning false (I'm opening it on a laptop screen so it should be true) but if I log the return from $mdMedia('gt-md') in the relevant angular controller it returns true. &lt;md-sidenav class="md-sidenav-left md-whiteframe-z2" md-component-id="left" md-is-locked-open="$mdMedia('gt-md')"&gt; Can anyone shed any light on why I'm seeing this behaviour? I've been struggling with it for a number of days now.
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/29671422
accepted answer: http://stackoverflow.com/a/29680845

http://stackoverflow.com/comment/47333696
comment on: http://stackoverflow.com/q/29577235
has text: Try [StrongLoop](http://strongloop.com/), you can map types to tables and generate a REST client to be used with the REST API generated by the mappings. Dont know if this is what you are looking for but doesnt hurt putting it out there as a comment? :)
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29592023
has comment: http://stackoverflow.com/comment/47331286
score: 0
answers question: http://stackoverflow.com/q/29591717
type: Answer
has body: I guess the problem may be with line var actual = $('.slides2').find("[data-id='"+slideIndex+"']").find('img'); You want active image for single instance of the slider, right? But $('.slides2') returns all elements with class slides2 (there are two in example markup, one for each slider instance). You want exactly one element, for current slider, so start with getting it. var actual = $('#slider' + j).find('.slides2').find('[data-id="' + slideIndex + '"]').find('img'); You can even join CSS selectors and make the code shorter and more effective var actual = $('#slider' + j + ' .slides2 [data-id="' + slideIndex + '"] img'); PS. As far as I know polish language, it's "powierzchnia", not "powieszchnia" :D

http://stackoverflow.com/a/29616866
has comment: http://stackoverflow.com/comment/47440065
has body: If you want your highlighting code to run after an AJAX call has returned (when there are new HTML fragments), then try something along these lines: $.ajax({ ... success : function(data) { ... $('.chat').each(function(){ var hashtag = $(this).text() .replace(/#dog/g, "#DOG") .replace(/#cat/g, "#CAT"); $(this).html(hashtag); }); }, ... }); In your case, call your highlighting code after you have populated all your chat fragments: ... function (response) { chats = jQuery.parseJSON( response ); if ( chats !== null ) { for ( i = 0; i < chats.length; i++ ) { if ( jQuery('div.chat-container div.chat-message-'+chats[i].id).length ) continue; jQuery('div.chat-container').html( jQuery('div.chat-container').html() + chatroom_strip_slashes(chats[i].html) ); last_update_id = chats[i].id; jQuery('div.chat-container').animate({ scrollTop: jQuery('div.chat-container')[0].scrollHeight - jQuery('div.chat-container').height() }, 100); } // Call highlighting code here } } ... PS You can save time by caching the selector jQuery('div.chat-container') as a variable so that jQuery doesn't have to search your HTML each time.
has comment: http://stackoverflow.com/comment/47430314
has comment: http://stackoverflow.com/comment/47435337
has comment: http://stackoverflow.com/comment/47380352
has comment: http://stackoverflow.com/comment/47379969
accepted answer of: http://stackoverflow.com/q/29616790
upvote count: 1
has comment: http://stackoverflow.com/comment/47439303
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29616790
has comment: http://stackoverflow.com/comment/47382084
has comment: http://stackoverflow.com/comment/47380436
type: Answer
has comment: http://stackoverflow.com/comment/47447405
has comment: http://stackoverflow.com/comment/47446436
downvote count: 0
score: 1

http://stackoverflow.com/comment/47820145
score: 0
type: AnswerComment
has text: If you mean the snippet of js code it is right after the calls in the head (from line 26). The css is just after the button `div` (line 415). Were there else?
type: Comment
comment on: http://stackoverflow.com/a/29589423

http://stackoverflow.com/a/29578254
has comment: http://stackoverflow.com/comment/47304840
type: Answer
has comment: http://stackoverflow.com/comment/47304995
has body: Try putting the following, simply add the class full-width to the body tag in order to hide the left panel and make the right full width. .full-width #left { display: none; } .full-width #right { width: 100%; } #left { width: 25%; position: fixed; left: 0; top: 0; bottom: 0; background: red; } #right { width: 75%; position: relative; left: 25%; }
has comment: http://stackoverflow.com/comment/47304897
answers question: http://stackoverflow.com/q/29578198
score: 0
has comment: http://stackoverflow.com/comment/47305069

http://stackoverflow.com/comment/47222495
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29534537
has text: @Jai I had already tried that before I posted this question. Sorry I should have specified that in the question.

.when
tags question: http://stackoverflow.com/q/29612870
tag name: .when
type: Tag

http://stackoverflow.com/a/29624354
has comment: http://stackoverflow.com/comment/47392552
score: 0
answers question: http://stackoverflow.com/q/29624104
type: Answer
has body: Why do you want to compact the saas files you can directly use @import in your saas files and your single will be ready and then use compress. Just create something like main.scss and import all the saas files inside it and then compress this fle instead. Edited: grunt.initConfig({ sass: { dist: { files: { 'main.css': 'main.scss', 'main1.css': 'main1.scss' } } } });

http://stackoverflow.com/q/29622610
has title: Does $http sort the params object?
tagged with: http
tagged with: unit-testing
type: Question
has comment: http://stackoverflow.com/comment/47389306
downvote count: 0
tagged with: javascript
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/29622799
tagged with: rest
accepted answer: http://stackoverflow.com/a/29622799
tagged with: angularjs
upvote count: 2
score: 2
type: AnsweredQuestion
has body: I writing some unit tests for my angularjs app. For the tests I'm mocking the $http request with the internal $httpBackend. During the test I use the $httpBackend.expectGET, because I want the exact behavior of my app request. For example I have an Params-Object: parameters = { name : 'Monkey', crazy : false, desc : 'Nobody', }; The Http-Get request in my app is: return $http.get(this.uri + '/' + id, {params : parameters}); At my unit-test I expect this: $httpBackend.expectGET(instance.uri + '/' + returnValues.id + '?' + query).respond(200, object); "query" is only the elements of the object concat with '=' and '&amp;'. So I expect the URL: www.example.com/api/v1/object/1?name=Monkey&amp;crazy=false&amp;desc=Nobody But I get this one: www.example.com/api/v1/object/1?crazy=false&amp;desc=Nobody&amp;name=Monkey Does $http make a sort on basis of the keys in the object for the "params"?

http://stackoverflow.com/comment/47645526
type: Comment
has text: The point is that it will catch the edge case because the current table I'm working with had issues where the sort broke halfway down, and if I could get selenium to just execute the script I wrote, I don't see how its anymore complex then your method while still catching the edge cases for what might be a few extra seconds of test run time.
comment on: http://stackoverflow.com/a/29747802
score: 0
type: AnswerComment

http://stackoverflow.com/q/29658550
has answer: http://stackoverflow.com/a/29677052
tagged with: mobile
downvote count: 0
has title: Make Slicknav menu close when outside click on IOS devices
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29659200
answer count: 3
has comment: http://stackoverflow.com/comment/47456780
tagged with: menu
accepted answer: http://stackoverflow.com/a/29677052
tagged with: focusout
favorite count: 0
possible better answer: http://stackoverflow.com/a/35204254
upvote count: 2
has answer: http://stackoverflow.com/a/35204254
score: 2
type: AnsweredQuestion
has body: I'm using the Slicknav mobile menu script: http://slicknav.com/ And it's working great except I can't figure out how to get it to close when one clicks outside of the menu on ios devices. It closes fine when clicking outside when I test it on desktop and Android, but on my Ipad it's not working. Here's the current code. Any insight? Thank you! Home Link1 Link2
type: Question

http://stackoverflow.com/a/29681968
type: Answer
downvote count: 0
has body: As item.PrdId is a variable, you need to use concatenate it properly. contect = contect + '&lt;div class="item"&gt;&lt;a class="item link" onclick="PrdOnClick(\'' + item.PrdId + '\')"&gt;&lt;/div&gt;';
score: 5
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29681879
upvote count: 5
accepted answer of: http://stackoverflow.com/q/29681879

http://stackoverflow.com/comment/47282496
type: QuestionComment
has text: Errors on the console? Are the other scripts loaded before you script (aka is `$` defined, when you call it)?
score: 0
comment on: http://stackoverflow.com/q/29566338
type: Comment

http://stackoverflow.com/q/29576601
answer count: 1
tagged with: javascript
has title: [Meteor call]: Loses prototype information
score: 0
has comment: http://stackoverflow.com/comment/47305061
accepted answer: http://stackoverflow.com/a/29579178
tagged with: meteor
has body: My Object uses the javascript Object Prototypes. I defined the following: Game = function(id, userId, tiles){ this._userId = userId; this._tiles = tiles; }; Game.prototype = { get userId() { return this._userId; }, get tiles() { return this._tiles; } } I then create on the server a game through a meteor call and use the return value: Meteor.methods({ 'fetchGame': function(userId){ var future = new Future(); var url = "http://..."; Meteor.http.get(url, function(err, res){ if (err){ future.return({status: "error", error: err}); } else { var game = new Game(userId, res.data); future.return({status: "success", data: game}); } }); return future.wait(); } }); The strange thing is, I can call inside the method the prototype functions: console.log(game.userId) console.log(game.tiles) But not when the object gets returned: Meteor.call('fetchGame', userId, function(error, result) { var game = result.data; console.log(game.userId) console.log(game.tiles) }); game.userId and game.tiles both return undefined, although the object gets correctly returned (is has values of _userId and _tiles). It is as if the prototype functions have been lost during the return from the future. What exactly might be the reason for this?
has answer: http://stackoverflow.com/a/29579178
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/47312081
score: 0
type: Comment
has text: D3 determines the labels to be shown automatically. Try calling `.nice()` on your scale after setting the domain.
type: QuestionComment
comment on: http://stackoverflow.com/q/29581794

http://stackoverflow.com/q/29663300
tagged with: node.js
score: 2
type: AnsweredQuestion
has body: I have got an array of the form: ['32 68', '56 78', '77 99'] I want to o/p another array which will contain the sum of each element in the index using JavaScript (NodeJS). Something like, ['100', '134', '176'] I tried to use .split("") but the double integer number again gets separated as separate digits. Is there any other way to solve this? Please not that, the i/p can be single digit number or double digit.
possible better answer: http://stackoverflow.com/a/29663357
has title: Need to fetch the numbers from an array
accepted answer: http://stackoverflow.com/a/29663487
type: Question
tagged with: arrays
tagged with: javascript
answer count: 3
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/29663602
has answer: http://stackoverflow.com/a/29663487
upvote count: 2
has comment: http://stackoverflow.com/comment/47466044
has answer: http://stackoverflow.com/a/29663357

http://stackoverflow.com/q/29578593
upvote count: 0
score: -5
has comment: http://stackoverflow.com/comment/47305547
type: Question
has body: how to add rows in table in html using jquery through popup. In Popup we have text fields,checkbox and radio button and add button. when I will click on add button then row add in table.
tagged with: javascript
has title: add & delete row in table usin jquery
has comment: http://stackoverflow.com/comment/47306018
answer count: 1
has comment: http://stackoverflow.com/comment/47305720
tagged with: jquery
has comment: http://stackoverflow.com/comment/47305669
favorite count: 0
has answer: http://stackoverflow.com/a/29579109
downvote count: 5
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47305954
has comment: http://stackoverflow.com/comment/47305490

http://stackoverflow.com/comment/47221838
comment on: http://stackoverflow.com/a/29533681
type: Comment
has text: nextCat is a string in the JSON file it is `"category": "motors"`. This is not necessary to include, that was just one of my previous workings to attempt to have this functioning.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47336309
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29592586
type: Comment
has text: T thnx for the answer, with .on show.bs.modal the instance of colopicker is initialised every time the form pops but still getting the same error. The colorpicker initialise anyway everytime since the ready document func runs evrytime form pops. I think has to do with colorpicker creates dynamic div ids for the pallete colors and there is some reference to them but the second time the form pops there other div ids..i tried $("#id).colorpicker(destory); and destroy all html after close the modal but still getting the error

http://stackoverflow.com/comment/47239840
type: QuestionComment
has text: No since I'm using Ionic I set the controller in the ui-router file
score: 0
comment on: http://stackoverflow.com/q/29543986
type: Comment

http://stackoverflow.com/comment/47412966
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29635282
has text: Most times I've seen recommendations to not use the parameter is that some people may get confused about the fact that you are not changing the original value of the parameter, but only the copy that gets into the function scope. I tend to use the parameter in this way in my own code though.

http://stackoverflow.com/comment/91384750
score: 7
type: AnswerComment
comment on: http://stackoverflow.com/a/29562404
type: Comment
has text: or you can just do: `process.env.NOBLE_HCI_DEVICE_ID = 1`

http://stackoverflow.com/comment/47371598
comment on: http://stackoverflow.com/q/29591145
has text: There is an error, stack trace and a solution if given. Does resolve this error will benefit the community?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47296829
type: QuestionComment
score: 0
has text: query_posts(array( 'post_type' => 'musing', ) ); has a comma that it shouldn't have I think.
comment on: http://stackoverflow.com/q/29573894
type: Comment

http://stackoverflow.com/comment/47326342
has text: Could you please copy-paste your actual code as it is? Don't type it out by hand. It's impossible to know what you have in the real code and what are typos. You're missing an equal sign in `action""` as well.
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29589371

http://stackoverflow.com/a/29635978
has comment: http://stackoverflow.com/comment/47415167
has body: this code will do that trick var arrayA = [1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2,3,4]; var arrayB = []; for (var x = 0; x &lt; arrayA.length; x += 4) { arrayB.push(arrayA.slice(x, x + 4).join('')); } console.log(arrayB); Update Millie has raised a fair point. if you need numbers in the result array, use following statement in for loop arrayB.push(parseInt(arrayA.slice(x, x + 4).join('')));
has comment: http://stackoverflow.com/comment/47414767
downvote count: 0
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/29635803
score: 1
accepted answer of: http://stackoverflow.com/q/29635803
has comment: http://stackoverflow.com/comment/47414586
has comment: http://stackoverflow.com/comment/47414197
type: AcceptedAnswer

http://stackoverflow.com/comment/47477670
has text: [[ChromeDriver: chrome on XP (0a79463410aff2f466706295f32d4ec5)] -> id: data]
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29668369

http://stackoverflow.com/q/29542451
has title: Escaping special characters for text inputs in a for-loop
type: Question
linked to: http://stackoverflow.com/q/1219860
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47236592
accepted answer: http://stackoverflow.com/a/29542561
tagged with: http://stackoverflow.com/tag/html
tagged with: input
score: 0
tagged with: loops
has body: I have an array of hashes each comprised of string based key/value pairs. Strangely though I noticed that when the loop complete and if there's an apostrophe within the string, any characters after the apostrophe are omitted (including the apostrophe). For instance if I had a name value Randy's Donuts it would show only as Randy in the input. Is there way I can dynamically escape these apostrophes (let alone any other special characters that I don't know about) within the the loop? $(function() { var brands = [{name: "Randy's Donuts"}, {name: "Joe's American Bar & Grill"}, {name: "Macy's"}]; for (var i = 0; i < brands.length; i++) { var brandName = " "; var $tr = " " + brandName + " "; $("table").append($tr); } });
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29542561

http://stackoverflow.com/q/29619950
tagged with: servlets
has answer: http://stackoverflow.com/a/29619990
accepted answer: http://stackoverflow.com/a/29619990
answer count: 2
has comment: http://stackoverflow.com/comment/47384164
tagged with: javascript
has title: How to create a button that deletes all field when reset button is clicked. The following code performs action instead of resetting the fields
favorite count: 0
downvote count: 1
upvote count: 0
has body: User Name: Email: New Password: Confirm Password: Address: Gender: Male Female Reset <--firstjsp is a servelt file. on clicking reset the program moves to the servlet program instead of displaying the same page-->
type: Question
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29620139
score: -1
has answer: http://stackoverflow.com/a/29620139
has comment: http://stackoverflow.com/comment/47384129

http://stackoverflow.com/q/29634961
type: UnansweredQuestion
score: 0
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47415090
has answer: http://stackoverflow.com/a/29636077
answer count: 3
has comment: http://stackoverflow.com/comment/47413714
has title: Image maps with curves
has body: I need to create many image maps with custom edges, especially curved ones. The only options I could find were polygons with straight edges. While it's possible to simulate curves with zillions of points, the user will be given the option to zoom the images and perfect curves are crucial. Isn't there a way of using, say, bezier curves on these image maps? If at all possible, I don't want to use SVG objects since it seems to be unnecessarily complex (although, obviously, I might be wrong).
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/29636141
has answer: http://stackoverflow.com/a/29636151

http://stackoverflow.com/comment/47333491
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29539438
has text: Do you get your pdf as url ?
type: Comment

http://stackoverflow.com/a/54051524
type: Answer
answers question: http://stackoverflow.com/q/29586422
upvote count: 2
score: 2
has body: I suggest child.position.copy(object.position); instead of what is suggested in WestLangley's answer: child.position.setFromMatrixPosition( object.matrixWorld ); I ran into issues with the latter being inaccurate, causing jitter in position of the child. Note that this only answers the first part of your question, namely how to follow the parent's position keeping the child's rotation unchanged. It might be worth clarifying the second part of your question as it isn't entirely clear to me.
downvote count: 0

http://stackoverflow.com/comment/47456665
comment on: http://stackoverflow.com/q/29657813
score: 1
type: Comment
has text: You should simplify your example code to the actual problem
type: QuestionComment

http://stackoverflow.com/a/29553326
upvote count: 1
score: 1
downvote count: 0
has body: JQuery hasn't been linked to you HTML. Add it to the head somewhere before your link to your script.js so the rest of your Javascript can use the JQuery library as well. Should be:
answers question: http://stackoverflow.com/q/29553224
type: Answer

http://stackoverflow.com/q/29618685
tagged with: express
score: 0
answer count: 1
type: UnansweredQuestion
tagged with: node.js
has answer: http://stackoverflow.com/a/29619550
has body: I use ExpressJS for an app framework, along with connect-memcached for managing Express sessions. app.use( express.session({ secret: "blah blah", store: new MemcachedStore({ ... }) })); It works great. Except... I have a particular route that a number of scripts use to check that status of the app: app.get( "/checkstatus", function( req, res ){ ... }); Because these are scripts that are doing the checking, everytime they check a new session gets created. I would prefer to avoid this. So my question is, for this particular route, how can I prevent the session from being automatically created when a request is made to it?
has title: How to avoid creating a session on a particular Express route?
type: Question
tagged with: javascript

http://stackoverflow.com/a/51882383
type: Answer
answers question: http://stackoverflow.com/q/29556943
downvote count: 0
score: 1
has body: Edit: This fork has since been added to the main repository. In case anyone is looking at this in 2018, I think this is a better solution than the workarounds in the other answers. I added an option to bootstrap-combobox that lets you turn off the behavior that you're talking about. See my fork. Here's how you might use this option to get the desired behavior: $('.combobox').combobox({clearIfNoMatch: false}) Here are the relevant bits of code that I changed. Original blur function: , blur: function (e) { var that = this; this.focused = false; var val = this.$element.val(); if (!this.selected &amp;&amp; val !== '' ) { this.$element.val(''); this.$source.val('').trigger('change'); this.$target.val('').trigger('change'); } if (!this.mousedover &amp;&amp; this.shown) {setTimeout(function () { that.hide(); }, 200);} } My change: , blur: function (e) { var that = this; this.focused = false; var val = this.$element.val(); if (!this.selected &amp;&amp; val !== '' ) { if(that.clearIfNoMatch) this.$element.val(''); this.$source.val('').trigger('change'); this.$target.val('').trigger('change'); } if (!this.mousedover &amp;&amp; this.shown) {setTimeout(function () { that.hide(); }, 200);} } Added this to the constructor at line 41: ... this.clearIfNoMatch = this.options.clearIfNoMatch; ... Added this to the defaults at line 463: ... , clearIfNoMatch: true ... A grand total of 3 lines. Much shorter than the workarounds ;-)
upvote count: 1

http://stackoverflow.com/comment/47485964
type: AnswerComment
comment on: http://stackoverflow.com/a/29672947
type: Comment
has text: Oh yeah? What's the result of `"foo" - "bar"`?
score: 0

http://stackoverflow.com/a/29643617
type: Answer
has comment: http://stackoverflow.com/comment/47440658
has comment: http://stackoverflow.com/comment/47429219
has comment: http://stackoverflow.com/comment/47438213
has body: You are getting this error due to CORS you are making a cross domain call with $http.get, you need to change it to $http.jsonp and also provide a valid twitter api callback function randomString(length, chars) { var result = ''; for (var i = length; i &gt; 0; --i) result += chars[Math.round(Math.random() * (chars.length - 1))]; return result; } var app=angular.module('store',[]);app.controller('indexController', function($scope, $http) { var unixtime=Math.round((new Date()).getTime() / 1000.0), nonce=randomString(32,'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'); var httpMethod = 'GET', url = 'https://api.twitter.com/1.1/statuses/home_timeline.json', parameters = { oauth_consumer_key : 'AD6SEy1m3XkggNTuYw5SUl4dv', oauth_nonce : nonce, oauth_signature_method : 'HMAC-SHA1', oauth_timestamp : unixtime, oauth_token : '3131481153-I9k4ZvdnePO42lOH0EJQNQcAHoyim6XrFFzFk90', oauth_version : '1.0', screen_name:'twitterapi', callback: 'twitterCallback' }, consumerSecret = 'xxxxxxx', tokenSecret = 'xxxxxxx', signature = oauthSignature.generate(httpMethod, url, parameters, consumerSecret, tokenSecret, { encodeSignature: true}); $http.jsonp(url, { headers: { 'Authorization': 'OAuth oauth_consumer_key="AD6SEy1m3XkggNTuYw5SUl4dv",' + 'oauth_signature_method="HMAC-SHA1",' + 'oauth_timestamp='+unixtime + 'oauth_nonce='+nonce + 'oauth_version="1.0",' + 'oauth_token="3131481153-I9k4ZvdnePO42lOH0EJQNQcAHoyim6XrFFzFk90",'+ 'oauth_signature='+signature }, params:{screen_name:'twitterapi'}}).success(function (data) { $scope.tweets = data; }); });
answers question: http://stackoverflow.com/q/29643327
score: 0

http://stackoverflow.com/a/29597359
has body: You can call current_output[0] to give your desired_output: current_output = 'I', 'T', 'U', 'M', 'A', 'R', 'B', 'R', 'D', 'I', 'U', 'T', 'E', 'L', 'N' ; desired_output = current_output[0]; //[ 'I', 'T', 'U', 'M', 'A', 'R', 'B', 'R', 'D', 'I', 'U', 'T', 'E', 'L', 'N' ] document.write(desired_output)
type: Answer
answers question: http://stackoverflow.com/q/29597298
score: 0
has comment: http://stackoverflow.com/comment/47341428

http://stackoverflow.com/comment/47428793
comment on: http://stackoverflow.com/q/29643928
score: 0
type: Comment
type: QuestionComment
has text: Is this an issue only on safari or on other browsers too?

http://stackoverflow.com/comment/47396847
has text: I now see from your edit that you are using 2 forms. Apart from the fact that it needs to be `public ActionResult Login([Bind(Prefix="LoginModel")]LoginModel model)` then you have no problem.
comment on: http://stackoverflow.com/q/29626073
score: 1
type: QuestionComment
type: Comment

http://stackoverflow.com/a/29633811
answers question: http://stackoverflow.com/q/29633725
downvote count: 1
score: 1
has body: Make your current index a variable, initted to 0, and increment it. You can increment either by making a function on your controller that increments it, or just directly in a ng-click / ng-swipe. {{data[idx].title}} {{data[idx].sub_title}}
has comment: http://stackoverflow.com/comment/47413107
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29633725
type: Answer
upvote count: 2

http://stackoverflow.com/a/31416340
upvote count: 4
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/29645535
answers question: http://stackoverflow.com/q/29645535
downvote count: 1
score: 3
has body: Previous answer didn't show exactly how to nest routers. Here is a real-world example, splitted in several controller files. First, we define some API routes into a controllers/api/foo.js file: var router = require('koa-router')(); router.get('/', function* () { // Return a list of foos }); router.get('/:id', function* () { // Return a specific foo }); module.exports = router; Then, on your application router, you can embed it like the following, in a file controllers/index.js: var router = require('koa-router')(); // Create a new route router.get('/', function* () { this.body = 'Home page'; }); // Nest previous API route router.get('/api/foo', require('./api/foo').routes()); module.exports = router; Finally, just use the router into your application index.js: var koa = require('koa'); var app = koa(); app.use(require('./controllers').routes()); app.listen(process.env.PORT || 3000);

http://stackoverflow.com/comment/47447405
has text: The solution is ridiculously simple. Change .text() to .html() on one line. I wrote an answer.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29616866

http://stackoverflow.com/a/29641431
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29641088
type: AcceptedAnswer
downvote count: 0
has body: It is not possible to stop an element from loading into the DOM, since any script running client-side would be a part of the DOM itself. You won't be able to access any of the elements in the DOM if it hasn't loaded yet. This sounds like something that should happen server side where you could pass data though a template, like EJS for Node.js. Also keep in mind that even though you can't stop things from being loaded, you can stop them from rendering. Not saying that this is at all good practice, but you could use: document.getElementById("id").style.display="none"
answers question: http://stackoverflow.com/q/29641088

http://stackoverflow.com/q/29572122
has comment: http://stackoverflow.com/comment/47293703
answer count: 3
tagged with: google-chrome-extension
has body: I'm trying to do something seemingly simple but it's turning out more difficult than I thought. I have on a page 4 span elements (that I have no control over) all with the same class ID (BOfSxb) and I need to edit only two of them - the second and the 4th element. So I'm not sure how to select only those two and before I do that, I need to know the contents of the 2nd or the 4th span element (2 and 4 have identical content). I figured out how to get the contents but I'm getting both combined so if the content is 2,304,400 I'm getting back 2,304,4002,304,400 here's how I was able to get the content so far: var spanContent = $("span.BOfSxb:contains(2,304,400)").text() console.log(spanContent); //returns 2,304,4002,304,400 ( I need 2,304,400) The other problem with the above is :contains has a number I won't know ahead of time. After I get the content off the second or 4th span, I need to compare it and see what range it falls under and do something else with it. Something like: if ($(".BOfSxb:contains("+ spanContent + ")").text() &gt;= 0 &amp;&amp; $(".BOfSxb:contains("+ spanContent + ")").text() &lt;= 1000) { $("span.BOfSxb:contains("+ spanContent + ")").replaceWith(finalDiv); } else if ($(".BOfSxb:contains("+ spanContent + ")").text() &gt;= 1001 &amp;&amp; $(".BOfSxb:contains("+ spanContent + ")").text() &lt;= 1000000) { $("span.BOfSxb:contains("+ spanContent + ")").replaceWith(finalDiv2); } else { //something else } EDIT: I should add this is actually a Chrome extension that will be doing the editing of the span elements on a page I have no control over. Thank you for any help!
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has answer: http://stackoverflow.com/a/29572216
favorite count: 0
has comment: http://stackoverflow.com/comment/47293679
accepted answer: http://stackoverflow.com/a/29572236
has answer: http://stackoverflow.com/a/29572197
has comment: http://stackoverflow.com/comment/47293702
possible better answer: http://stackoverflow.com/a/29572216
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29572236
has title: Select and get contents of a span with same class as other elements on page
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/29547515
type: Answer
upvote count: 0
has comment: http://stackoverflow.com/comment/47256874
has comment: http://stackoverflow.com/comment/47250540
answers question: http://stackoverflow.com/q/29547268
score: -1
downvote count: 1
has body: So you want to call buttonPress() method which is in child controller from parent controller,in your case it is from containerCtrl to Ctrl1. You can only call the methods of parent controller from child controller. Why you want to to call it from parent controller.Why not directly define it Parent and then call it from parent or from any child controllers. One way of doing it is you can use emit and broadcast. Check out this link to know more about emit and broadcast Working with $scope.$emit and $scope.$on

http://stackoverflow.com/a/29608720
accepted answer of: http://stackoverflow.com/q/29608666
type: Answer
answers question: http://stackoverflow.com/q/29608666
score: 2
has body: add it to the beginning of your selector: $('tr[role="row"] &gt; th[id*="headingData_"]').each(function () { fieldNames += $(this).data("dbname") + '~'; console.log(fieldNames); });
downvote count: 0
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/comment/47346629
type: QuestionComment
has text: Not sure how - maybe you can show me a quick example? @anpsmn
comment on: http://stackoverflow.com/q/29600154
score: 0
type: Comment

http://stackoverflow.com/comment/47262448
score: 0
has text: @ Nim i am not getting answer option. you can vote up
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29555648

http://stackoverflow.com/q/29566192
has title: Is it possible to execute javascript code after the browser has been closed?
tagged with: synchronization
type: UnansweredQuestion
type: Question
has body: I'm developing a JavaScript offline capable mobile web app and the data synchronization mechanism has to be executed in background. The idea is that data is synchronized with server every hour even if the app is not active and the browser has been already closed. Is this possible in JavaScript - something like a cronjob which is executed even if the browser is closed? I found this specification but I think that is just a specification and has not been implemented yet: https://github.com/slightlyoff/BackgroundSync/blob/master/explainer.md
tagged with: background-process
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/29566268
answer count: 1

http://stackoverflow.com/a/29604104
accepted answer of: http://stackoverflow.com/q/29603227
downvote count: 0
score: 1
has body: There are set of options to track the progress of the AJAX call in $(form).ajaxSubmit(). $(document).ready(function() { $('#upload').submit(function(e) { if($('#userImage').val()) { e.preventDefault(); $('#loader-icon').show(); $(this).ajaxSubmit({ target: '#targetLayer', beforeSubmit: function() { $("#progress-bar").width('0%'); }, uploadProgress: function (event, position, total, percentComplete){ $("#progress-bar").width(percentComplete + '%'); $("#progress-bar").html('&lt;div id="progress-bar-status"&gt;' + percentComplete +' %&lt;/div&gt;') }, success:function (){ $('#loader-icon').hide(); }, resetForm: true }); return false; } }); });
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29603227
type: Answer

http://stackoverflow.com/q/29604859
has answer: http://stackoverflow.com/a/29605972
tagged with: javascript
has comment: http://stackoverflow.com/comment/47355656
tagged with: caching
has body: I've had quite a few goes at Googling an answer to this, but have been unable to find one that satisfies the question. I'm using C# with web forms. I have many opportunities to cache pages such as Privacy, Terms etc, since they hardly ever change. However, I'm unsure on the effect of javascript when combined with output caching. I understand about fragment caching, donut caching et al, but with Ajax, jQuery and now Polymer, this client side stuff isn't going anywhere. So can output caching be used in tandem with client side technologies or has the facility to use output caching now disappeared forever?
score: 0
answer count: 2
tagged with: asp.net
type: UnansweredQuestion
tagged with: outputcache
has answer: http://stackoverflow.com/a/29605161
has title: Output caching - is it still viable?
type: Question
tagged with: c#

http://stackoverflow.com/comment/47493592
type: Comment
has text: this worked on IE Chrome and FF but, it only allowed me to type one letter then then it fired the ajax. is there a way to change that ??
comment on: http://stackoverflow.com/a/29677989
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47345781
comment on: http://stackoverflow.com/a/29560347
type: Comment
has text: I think this is because I forgot `break;` statements at the end of cases. Sorry about that.
type: AnswerComment
score: 0

http://stackoverflow.com/a/29574457
upvote count: 2
score: 2
type: AcceptedAnswer
has body: You can override the stores _normalizeTypeKey then alter the camelCase behaviour to become what you want (e.g. dasherized or just fix this one case). You can also override the serialisers typeForRoot when going the other way - this lets you tell ember what the model key is (e.g. tellMeAStory) for a particular key in your data (e.g. tell_me_a_story). It appears there is work underway to make everything work like the container does (which is dasherized)
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29543803
type: Answer
answers question: http://stackoverflow.com/q/29543803

keystonejs
tags question: http://stackoverflow.com/q/29614107
tag name: keystonejs
type: Tag

http://stackoverflow.com/a/29596274
has comment: http://stackoverflow.com/comment/47339520
has comment: http://stackoverflow.com/comment/47347862
has comment: http://stackoverflow.com/comment/47346554
has comment: http://stackoverflow.com/comment/47349307
score: 0
has comment: http://stackoverflow.com/comment/47346356
has comment: http://stackoverflow.com/comment/47346027
has comment: http://stackoverflow.com/comment/47339717
type: Answer
has comment: http://stackoverflow.com/comment/47339877
has comment: http://stackoverflow.com/comment/47341215
has comment: http://stackoverflow.com/comment/47349573
has body: Gonna try to answer you : First: If you have a special action for your ajax call you only need: def custom_action end This will render the custom_action.js.erb if called with ajax, for example a form with remote: true. If you call one of your CRUD-actions and need to be able to respond to multiple formats: def show @book = Book.find(params[:id]) respond_to do |format| format.html # will render show.html.erb format.js # will render show.js.erb end end If you put a link in your view: link_to('Remote Ajax Call', book_path(@book), remote: true) This link will call the method show and render as :js. It will look for app/views/books/show.js.erb which may look something like: &lt;% if @book.present? %&gt; $('#book-title').html("&lt;%=@book.title%&gt;"); &lt;%end%&gt; And in your view, close to the link above, this will then change the text inside a html-tag with I'd book-title. &lt;div id="book-title"&gt; &lt;/div&gt; Second: I do not understand what you mean by ...need to return something... Can you add an example? Hope that this can help you a bit. Edit: This is my try to understand what you want to do: In your view: &lt;%= hidden_field_tag :bookmarked_against_req_id, value: @data2 %&gt; &lt;% if @requests != nil %&gt; &lt;% @requests.each.with_index do |request,index| %&gt; &lt;% if request.present? %&gt; &lt;%= link_to 'Bookmark it', bookmark_request_path(request), remote: true %&gt; &lt;%= request.title %&gt; &lt;%= request.is_service%&gt; &lt;%= request.description%&gt; &lt;% if @tag[index].present? %&gt; &lt;% @tag[index].each do |cat| %&gt; &lt;%= cat.title %&gt; &lt;%end%&gt; &lt;%end%&gt; &lt;%= request.created_at %&gt; &lt;%end%&gt; &lt;%end%&gt; &lt;%end%&gt; In your controller: def bookmark_request() request_bookmarked = Request.getRequest(params[:id]) # the params[:id] should be set in the request. bookmarked_agains_Request = Request.getRequest(params[:bookmarked_against_req_id) # This is defined in your hidden_field_tag When your action bookmark_requestis do…
answers question: http://stackoverflow.com/q/29596136
has comment: http://stackoverflow.com/comment/47339899
has comment: http://stackoverflow.com/comment/47349698

http://stackoverflow.com/comment/47490397
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29676265
score: 1
has text: More explanation would be good but +1 for posting the first answer that actually works.

http://stackoverflow.com/a/29585000
has comment: http://stackoverflow.com/comment/47318333
downvote count: 0
type: Answer
score: 2
upvote count: 2
has body: You an hide the body with the visibility: hidden; &lt;body style="visibility:hidden;" onload="TransferAmountDisplayToggle(@Model.EntityEventTypeId)"&gt; Then at the bottom of the TransferAmountDisplayToggle() JavaScript function, add: $('body').css('visibility', 'visible'); Modifying display instead of visibility is an option, but I prefer to use visibility because sometimes there's JavaScript code that needs to check the width/height of elements and using display: none; can mess that up.
answers question: http://stackoverflow.com/q/29584980

http://stackoverflow.com/comment/47512932
score: 0
comment on: http://stackoverflow.com/a/29660418
type: Comment
type: AnswerComment
has text: Yea, that was what I was talking about.

http://stackoverflow.com/comment/47494111
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29671090
has text: Sounds like you are using the same session id for all users, which means if 2 people are using the site at the same time, they will share the same session and the data in it. This is a really bad security floor for an e-commerce site

http://stackoverflow.com/comment/47239224
has text: Thanks. Currently learning JS and totally overlooked that. The `.call()` advice is pretty neat, too.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29543621
type: AnswerComment

http://stackoverflow.com/comment/47405206
type: QuestionComment
comment on: http://stackoverflow.com/q/29631251
has text: What disables/enables it?
score: 1
type: Comment

http://stackoverflow.com/comment/47481949
has text: @briosheje: It can be done with `indexOf` as well, if you want to create an unnecessary array and make an unnecessary method call. You don't need a ternary if you do that.
type: Comment
comment on: http://stackoverflow.com/a/29671725
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47502401
has text: @CindyTurlington, if you use external and not the default AJAX loading, you lose the transitions: http://demos.jquerymobile.com/1.4.5/navigation-linking-pages/
comment on: http://stackoverflow.com/a/29676215
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29635167
has comment: http://stackoverflow.com/comment/47413310
has comment: http://stackoverflow.com/comment/47413435
type: Answer
has comment: http://stackoverflow.com/comment/47413545
has comment: http://stackoverflow.com/comment/47413599
answers question: http://stackoverflow.com/q/29634475
has body: Try this code @Html.CheckBox("Norm", false, new { @class = "checkbox",@onclick="clickNorm()" }) &lt;script type="text/javascript"&gt; function clickNorm(){ $.ajax({ url:'@Url.Action("LoadSelectedCoreList")' dataType:'json', success:function(res){ if(res &amp;&amp; res.length&gt;0){ $('#selectedCore).empty(); $.each(res,function(index,item){ $('#selectedCore').append(new Option(item.Abb,item.sheetID)); }); } } }); &lt;/script&gt; In Coltroller public ActionResult LoadSelectedCoreList() { var selectedCoreList=.. return Json(selectedCoreList, JsonRequestBehavior.AllowGet); }
has comment: http://stackoverflow.com/comment/47413341
has comment: http://stackoverflow.com/comment/47412724
score: 0

http://stackoverflow.com/comment/47355707
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29604447
has text: You're looking for the Page Visibility API http://stackoverflow.com/questions/1060008/is-there-a-way-to-detect-if-a-browser-window-is-not-currently-active

http://stackoverflow.com/comment/47222077
comment on: http://stackoverflow.com/q/29534537
score: 0
type: Comment
type: QuestionComment
has text: I guess you are approaching correctly while developing for IE8, because i got to know that angular is not supporting IE8. https://docs.angularjs.org/guide/ie

http://stackoverflow.com/comment/47414596
type: Comment
comment on: http://stackoverflow.com/q/29635014
type: QuestionComment
score: 1
has text: re: SQL injection, I'd suspect that PowerSchool handles those issues when it preprocesses the tlist_sql blocks. I doubt "; DROP TABLE ..." is a value of ~(curstudid) that would be accepted, but I have no actual knowledge of PS. OK, I think I finally understand what you actually want to do here, and I'm going to write up an answer.

http://stackoverflow.com/comment/47515181
type: Comment
comment on: http://stackoverflow.com/q/29665414
type: QuestionComment
has text: @AndrewClark In the flummox's doc source code, you don't seem to use it much though. Seems the flux object is mostly exposed via the `performRouteHandlerStaticMethod` call. Why is that??
score: 0

http://stackoverflow.com/comment/47288360
has text: @teamo Ah, do what I said in the previous commend. Then in your function, make it `function createElements(request) {`
comment on: http://stackoverflow.com/q/29569122
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29549160
tagged with: php
tagged with: css
type: AnsweredQuestion
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29549682
accepted answer: http://stackoverflow.com/a/29549682
has comment: http://stackoverflow.com/comment/47250330
score: 0
has body: I have a type of word cloud that I developed. Its really just a simple database search result that applies random CSS styling (size, color, vertical layout, etc) to keywords to make it look pretty inside a div or single cell table. These keywords get retrieved via a PHP/mySQL function. I would like to be able to output that DIV/table cell's (whichever would work better) contents along with the CSS styling to an image file. I've seen posts suggesting HTML2Canvas but haven't had any luck getting the search results with the CSS to show up in the image and not even sure if its possible in this case. Any ideas to point me in the right direction? Thanks,
has comment: http://stackoverflow.com/comment/47249922
answer count: 1
tagged with: http://stackoverflow.com/tag/html
has title: Output div contents and styling to image

http://stackoverflow.com/q/29572578
has body: I'm supposed to create a function named reversePlusOne. This function should: Take one argument, an array of at least two numbers. This function should return: the array reversed with a 1 added at the front. when i used push(1) works but when i use unshift it doesn't. Can someone explain return a.push(1), a.reverse(); return a.reverse(), a.unshift(1);
type: Question
has answer: http://stackoverflow.com/a/29572598
tagged with: push
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/29572688
score: 0
has answer: http://stackoverflow.com/a/29572625
has title: I dont understand the differences between using push vs using unshift in my code
has answer: http://stackoverflow.com/a/29572766
has answer: http://stackoverflow.com/a/29572704
answer count: 5
type: UnansweredQuestion

http://stackoverflow.com/comment/47482009
score: 0
type: Comment
type: QuestionComment
has text: In other questions just for one page .in my case in header file i use jquery then in other page where primefaces tags are used .
comment on: http://stackoverflow.com/q/29669347

http://stackoverflow.com/comment/47332826
comment on: http://stackoverflow.com/q/29592575
has text: Not sure if that is what I'm looking for (sorry, I'm quite new to programming, learning it all as I go along). I've just edited the original post to explain what exactly I'm trying to achieve, if that helps. Thanks for your help
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47331940
type: QuestionComment
comment on: http://stackoverflow.com/q/29591522
type: Comment
score: 0
has text: JSONP is a response type. If you don't control the servers, then it doesn't matter. If you do, there's plenty of information on how JSONP calls and responses work.

http://stackoverflow.com/q/29552211
tagged with: javascript
score: 0
has body: I'm working on a live chat site for an event. There will be an audience watching a group of presenters in a live forum After the live forum, each of the presenters will go into "Breakout rooms" Some of the audience will want to go to breakout room 1, others into breakout room 2, etc I'm trying to figure out how to let the people watching the forum choose which breakout session they want to watch in advance (ie, during the forum), then have the page automatically switch to the "breakout room" selected by the user once the leader of the breakout leaves the forum and room enters the breakout room. Any suggestions?
type: UnansweredQuestion
tagged with: wordpress
has comment: http://stackoverflow.com/comment/47255870
tagged with: php
type: Question
has title: Navigate to another variable page on specific event
has answer: http://stackoverflow.com/a/29552254
answer count: 1

http://stackoverflow.com/comment/47241141
score: 0
type: QuestionComment
has text: when i define a module it work, but i was want understand how he will work like this
type: Comment
comment on: http://stackoverflow.com/q/29544779

http://stackoverflow.com/comment/47410010
type: Comment
has text: I slightly modified it with `//IF FILE SIZE WAS TOO BIG AND WARNING THROWN, BUT NEW CORRECT FILE SIZE LOADED, CLEAR WARNING else{ if(isValidSize = true){ $(".file-warning").hide(); } } }else{ alert("Please upgrade your browser, because your current browser lacks some new features we need!"); }`
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29633418

http://stackoverflow.com/comment/47352828
type: Comment
has text: I am not getting it..please help me
type: AnswerComment
comment on: http://stackoverflow.com/a/29601338
score: 0

http://stackoverflow.com/q/29653394
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
has title: Javascript Typing animation that only affects a #div and allows HTML
has comment: http://stackoverflow.com/comment/47446852
favorite count: 0
has body: So I've been thinking of using a plugin and, thanks to the nature of the site I use it on, I don't really have access to the tag. And the site doesn't really seem to allow certain javascript. The only real javascript I've seen work is this: var text = "Lorem Ipsum. Enter text here. Blabla blee blah blah. This is just stuff, but I have entire paragraphs to put here."; var counter = 0; var speed = 150; function type(){ lastText = document.getElementById("console").innerHTML; lastText+=text.charAt(counter); counter++; document.getElementById("console").innerHTML = lastText; } setInterval(function(){type()},speed); HOWEVER, there is one gigantic flaw here. It would seem that could does not HTML coding such as &lt;span&gt;, &lt;br /&gt; or &lt;p&gt;, which I use extensively as well as the ' character. My question is this: how do I make it so as to allow HTML? Perhaps even more ideal would be to have it do the same effect, but have the text in the BODY element where it belongs and not in &lt;script&gt;, but this isn't within the scope of my question currently, and I'd rather have the bolded question answered first, or if the script refuses to work on the site I'm coding at.
tagged with: http://stackoverflow.com/tag/html
answer count: 0
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/47446764
has comment: http://stackoverflow.com/comment/47446834
has comment: http://stackoverflow.com/comment/47446760
type: Question
has comment: http://stackoverflow.com/comment/47447111

http://stackoverflow.com/q/29581577
tagged with: onload
has title: External Javascript Alert function
has answer: http://stackoverflow.com/a/29581662
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47311615
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/47311543
has answer: http://stackoverflow.com/a/29581701
tagged with: function
has body: I am new to writing in HTML, JavaScript, and CSS. My question is, what is the method to creating an onLoad function to an external JavaScript file? I am attempting this using Notepad++. The external JavaScript file is known as "demo.js" within my "js" folder.
type: UnansweredQuestion

http://stackoverflow.com/a/29577472
has body: You can have javascript in jsp but that will always execute on client side. So if you want to save some stuff on trigger of some event inside browser you can do that by making ajax call or form submission. Ajax is preferred way because its faster and better experience for user But if you have intention of execution of javascript on server side thats not possible
upvote count: 1
downvote count: 0
type: Answer
score: 1
answers question: http://stackoverflow.com/q/29577278

http://stackoverflow.com/q/29625335
has answer: http://stackoverflow.com/a/54840749
has comment: http://stackoverflow.com/comment/47394057
has comment: http://stackoverflow.com/comment/47394556
has comment: http://stackoverflow.com/comment/47393886
answer count: 3
has comment: http://stackoverflow.com/comment/47402785
upvote count: 0
has comment: http://stackoverflow.com/comment/47393863
tagged with: jquery
has comment: http://stackoverflow.com/comment/47394009
favorite count: 0
tagged with: ajax
has body: I have got a variable in javascript called 'signature' var signature; //(Data is here) document.write(signature) In HTML, I have the following: &lt;div id="siggen"&gt; &lt;textarea id="content" cols="80" rows="10"&gt;&lt;/textarea&gt; What i want is when i click generate button the variable signature appers in text area. Can anyone help?
has title: How to output a variable in Javascript to a textarea in HTML?
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29625525
tagged with: css
score: -5
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/8854288
type: Question
has answer: http://stackoverflow.com/a/29625572
downvote count: 5
tagged with: javascript

http://stackoverflow.com/comment/47289161
has text: Hey, I just realised I've responded to your question on CSS-tricks as well. In any case, JavaScript would your friend here. Please add some code, I read there is a pseudo element interfering somehow.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29557078
score: 0

http://stackoverflow.com/q/29665484
tagged with: asp.net
favorite count: 0
upvote count: 2
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47959390
has answer: http://stackoverflow.com/a/55102558
type: Question
tagged with: asp.net-mvc
has body: I am using sammy.js for single page application in asp.net mvc. Everything is fine, but I am facing one problem which is that I can not reload the page. For example When I am in the dashboard my URL is http://localhost:1834/#/Home/Index?lblbreadcum=Dashboard layout.cshtml &lt;script&gt; $(function () { var routing = new Routing('@Url.Content("~/")', '#page', 'welcome'); routing.init(); }); &lt;/script&gt; routing.js var Routing = function (appRoot, contentSelector, defaultRoute) { function getUrlFromHash(hash) { var url = hash.replace('#/', ''); if (url === appRoot) url = defaultRoute; return url; } return { init: function () { Sammy(contentSelector, function () { this.get(/\#\/(.*)/, function (context) { var url = getUrlFromHash(context.path); context.load(url).swap(); }); }).run('#/'); } }; } I want to reload the page by clicking the dashboard menu/link. But click event not firing because link is not changing. But if I want to go another page then it is fine. Please help me out. Thanks.
tagged with: javascript
tagged with: jquery
has title: Reload the page using sammy.js
tagged with: sammy.js
has comment: http://stackoverflow.com/comment/47956180
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/29920454
possible better answer: http://stackoverflow.com/a/55102558
accepted answer: http://stackoverflow.com/a/29920454

http://stackoverflow.com/q/29686319
has answer: http://stackoverflow.com/a/29686388
has answer: http://stackoverflow.com/a/29686384
has body: I just signed up in codewars and I'm trying the first kata. This is the question: Write a function to multiply a number (x) by a given number (y) a certain number of times (n). The results are to be returned in an array. eg. multiplyBy(2, 4, 6); The output is: [8, 32, 128, 512, 2048, 8192] I believe my code is write, when I do console.log I get the array that the exercise is asking for, but it won't let me proceed. I'd appreciate some help, thanks! var array = []; function multiplyBy(x, y, n) { while (x&lt;2049){ var z = x*y*n; var x = z; array.push(z) } } multiplyBy(2,2,2); console.log(array); return array;
answer count: 4
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29686384
type: Question
has answer: http://stackoverflow.com/a/29686378
tagged with: arrays
tagged with: javascript
has title: How to populate an array with integers from a loop in javascript
score: 0
possible better answer: http://stackoverflow.com/a/29686378
has answer: http://stackoverflow.com/a/29686629

http://stackoverflow.com/a/29585722
type: Answer
has comment: http://stackoverflow.com/comment/47319530
upvote count: 1
score: 1
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29585646
type: AcceptedAnswer
has body: Consider making the projectTaskModal declaration a function: var projectTaskModal = function() { return { // Turn ON/OFF Console and Alert Debug Messages projectDebugConsole: true, //true; projectDebugAlert: false, //true; // Cache some values for use across the Application cache: { taskId: $('#Task-id'), projectId: $('#Task-project-id'), // snip for brevity }, init: function() { projectTaskModal.events.init(); projectTaskModal.events.editInPlaceFieldSaveEvents(); projectTaskModal.mockAjax.init(); projectTaskModal.debug.log('ProjectTaskModal Init() Function Ran'); }, }; }; Then later: $(function() { projectTaskModal = projectTaskModal(); projectTaskModal.init(); }); This ensures the selector caches will be pointing to elements that depend on the DOM being ready. This line: projectTaskModal = projectTaskModal(); replaces the function with the object returned by projectTaskModal(), which is the same as before otherwise.
answers question: http://stackoverflow.com/q/29585646

http://stackoverflow.com/a/29601861
has comment: http://stackoverflow.com/comment/47350012
upvote count: 2
answers question: http://stackoverflow.com/q/29601836
has body: 1) Try changing &lt;script language="text/javascript"&gt; to &lt;script type="text/javascript"&gt; If you would like to use the deprecated language attribute you could do: &lt;script language="Javascript"&gt; Additionally, as others have already pointed out that to get a float from a string you can use parseFloat and pass the string as a parameter. Using (float) is often used in Java to convert from a numeric type such as double or int to float. 2) Try changing var txt1 = (float) document.getElementById('text1').value; var txt2 = (float) document.getElementById('text2').value; to var txt1 = parseFloat(document.getElementById('text1').value; var txt2 = parseFloat(document.getElementById('text2').value;
downvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/47350400
score: 1

http://stackoverflow.com/comment/47478960
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29666515
has text: @charlietfl so how do I make it match only say, 300?
score: 0

http://stackoverflow.com/a/29669821
has body: First of all, this line: React.addons.TestUtils.Simulate.submit(Instance, form.getDOMNode()); Should be: React.addons.TestUtils.Simulate.submit(form.getDOMNode()); But that doesn't solve the problem, because of the way your component is structured. You're already giving the current _handleSubmit function to React to call, and React will invoke that function. It won't call Instance._handleSubmit(), which is the one you've replaced. If you change your component to something like: var that = this; ... &lt;form onSubmit={function() { that._handleSubmit()}}&gt; It works because you explicitly call the method on the instance. But I would advice you to not assert that the method was called, but instead assert that whatever side effect it should perform was actually performed. Like mutating state, calling an external service, etc.
downvote count: 0
answers question: http://stackoverflow.com/q/29663075
has comment: http://stackoverflow.com/comment/47490508
score: 1
type: Answer
upvote count: 1

recursion
type: Tag
tags question: http://stackoverflow.com/q/29532094
tag name: recursion
tags question: http://stackoverflow.com/q/29592872
tags question: http://stackoverflow.com/q/29652586
tags question: http://stackoverflow.com/q/29658039
tags question: http://stackoverflow.com/q/29623847
tags question: http://stackoverflow.com/q/29653592
tags question: http://stackoverflow.com/q/29588816
tags question: http://stackoverflow.com/q/29629301
tags question: http://stackoverflow.com/q/29561669
tags question: http://stackoverflow.com/q/29533514
tags question: http://stackoverflow.com/q/29650834
tags question: http://stackoverflow.com/q/29655795

http://stackoverflow.com/q/29614917
has comment: http://stackoverflow.com/comment/47376405
has comment: http://stackoverflow.com/comment/47375878
type: Question
has body: Let's say I have a file at /Users/me/app/src/scripts/foo.js. I set up a gulp tasks that writes this file to /Users/me/app/dist/scripts/foo.js: gulp.src('src/scripts/foo.js', base: 'src') .pipe(...) .pipe(gulp.dest('dist')) I'm writing a simple plugin and need to know scripts/foo.js. I was expecting file.relative to be this partial path, but instead it provides foo.js. I don't see a way to get scripts/foo.js from any combination of file.path, file.cwd, file.base, etc. How can I get the part of the path I need?
answer count: 1
downvote count: 0
has title: Getting relative source/destination in Gulp task
tagged with: gulp
has comment: http://stackoverflow.com/comment/47375606
favorite count: 0
has answer: http://stackoverflow.com/a/29615354
upvote count: 6
type: UnansweredQuestion
score: 6
has comment: http://stackoverflow.com/comment/47376383
tagged with: javascript

http://stackoverflow.com/a/29643175
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29643154
score: 1
accepted answer of: http://stackoverflow.com/q/29643154
type: Answer
upvote count: 1
has body: because you are using .text(), since you want to render the html content use .html() $(this).html(newstring); Since you have id selector, there is no need to use .each() function searchKeyword() { var keyword = document.searchform.searchbox.value; $("#paragraph").html(function (i, html) { return $(this).text().replace(keyword, '&lt;span style="background-color: #faf701;"&gt;' + keyword + '&lt;/span&gt;'); }) } Use a regex to replace multiple matches function searchKeyword() { var keyword = document.searchform.searchbox.value; var regex = new RegExp(RegExp.escape(keyword), 'g') $("#paragraph").html(function (i, html) { return $(this).text().replace(regex, '&lt;span style="background-color: #faf701;"&gt;' + keyword + '&lt;/span&gt;'); }) } if (!RegExp.escape) { RegExp.escape = function (value) { return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&amp;") }; }
has comment: http://stackoverflow.com/comment/47427493

http://stackoverflow.com/a/29582369
answers question: http://stackoverflow.com/q/29582003
has body: There is no width when display: none. One trick would be to set position: relative; margin-left: -9999px;. It will not show on the page but preserve the width. Or, use visibility: hidden. The only downside is it will not rip it out of the layout but leave a blank spot.
upvote count: 6
downvote count: 0
type: Answer
score: 6

arrays
tags question: http://stackoverflow.com/q/29568486
tags question: http://stackoverflow.com/q/29587040
tags question: http://stackoverflow.com/q/29597298
tags question: http://stackoverflow.com/q/29590001
tags question: http://stackoverflow.com/q/29612856
tags question: http://stackoverflow.com/q/29555198
tags question: http://stackoverflow.com/q/29535696
tags question: http://stackoverflow.com/q/29574916
tags question: http://stackoverflow.com/q/29686319
tags question: http://stackoverflow.com/q/29633725
tags question: http://stackoverflow.com/q/29557118
tags question: http://stackoverflow.com/q/29553378
tags question: http://stackoverflow.com/q/29639159
type: Tag
tags question: http://stackoverflow.com/q/29572578
tags question: http://stackoverflow.com/q/29592849
tags question: http://stackoverflow.com/q/29681188
tags question: http://stackoverflow.com/q/29664603
tags question: http://stackoverflow.com/q/29618806
tags question: http://stackoverflow.com/q/29556906
tags question: http://stackoverflow.com/q/29584791
tags question: http://stackoverflow.com/q/29661564
tags question: http://stackoverflow.com/q/29656267
tags question: http://stackoverflow.com/q/29531811
tags question: http://stackoverflow.com/q/29586822
tags question: http://stackoverflow.com/q/29579651
tags question: http://stackoverflow.com/q/29570744
tags question: http://stackoverflow.com/q/29540806
tags question: http://stackoverflow.com/q/29672151
tags question: http://stackoverflow.com/q/29535147
tags question: http://stackoverflow.com/q/29652947
tags question: http://stackoverflow.com/q/29660836
tags question: http://stackoverflow.com/q/29534538
tags question: http://stackoverflow.com/q/29670944
tags question: http://stackoverflow.com/q/29635803
tags question: http://stackoverflow.com/q/29535391
tags question: http://stackoverflow.com/q/29635371
tags question: http://stackoverflow.com/q/29663847
tags question: http://stackoverflow.com/q/29638016
tags question: http://stackoverflow.com/q/29639622
tags question: http://stackoverflow.com/q/29631652
tags question: http://stackoverflow.com/q/29579289
tags question: http://stackoverflow.com/q/29657512
tags question: http://stackoverflow.com/q/29686542
tags question: http://stackoverflow.com/q/29613976
tags question: http://stackoverflow.com/q/29533325
tags question: http://stackoverflow.com/q/29532210
tags question: http://stackoverflow.com/q/29566545
tags question: http://stackoverflow.com/q/29558519
tags question: http://stackoverflow.com/q/29531676
tags question: http://stackoverflow.com/q/29649705
tags question: http://stackoverflow.com/q/29676635
tags question: http://stackoverflow.com/q/29672200
tags question: http://stackoverflow.com/q/29563668
tags question: http://stackoverflow.com/q/29639716
tags question: http://stackoverflow.com/q/29632120
tags question: http://stackoverflow.com/q/29579220
tags question: http://stackoverflow.com/q/29572088
tags question: http://stackoverflow.com/q/29663578
tags question: http://stackoverflow.com/q/29630600
tags question: http://stackoverflow.com/q/29672847
tags question: http://stackoverflow.com/q/29601731
tags question: http://stackoverflow.com/q/29614136
tags question: http://stackoverflow.com/q/29554854
tags question: http://stackoverflow.com/q/29617435
tags question: http://stackoverflow.com/q/29545011
tags question: http://stackoverflow.com/q/29682113
tags question: http://stackoverflow.com/q/29571475
tags question: http://stackoverflow.com/q/29638527
tags question: http://stackoverflow.com/q/29645588
tags question: http://stackoverflow.com/q/29597391
tags question: http://stackoverflow.com/q/29533269
tags question: http://stackoverflow.com/q/29661559
tags question: http://stackoverflow.com/q/29647860
tags question: http://stackoverflow.com/q/29651346
tags question: http://stackoverflow.com/q/29646113
tags question: http://stackoverflow.com/q/29684866
tags question: http://stackoverflow.com/q/29579987
tags question: http://stackoverflow.com/q/29540000
tags question: http://stackoverflow.com/q/29579439

http://stackoverflow.com/comment/47495644
has text: I tried with `'inline-block'` and `'block'` but it doesn't work.
score: 0
comment on: http://stackoverflow.com/q/29678785
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47260024
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29554100
has text: There is also one issue that after first cycle get complete, first div never comes into loop to fadeIn. so I updated http://jsfiddle.net/qewwmnge/2/
score: 0

http://stackoverflow.com/a/29612174
downvote count: 0
answers question: http://stackoverflow.com/q/29610515
type: Answer
has body: It looks like you're using multiple apps but only for the purpose of displaying multiple independent views on your page? If that's the case, you might want to take a look at ui-router which gives you multiple and named views to resolve this issue.
score: 3
upvote count: 3

http://stackoverflow.com/comment/47387535
type: QuestionComment
comment on: http://stackoverflow.com/q/29621501
type: Comment
has text: I don't think so since i need to use keycodes elements (the games uses the keyboard). From now we are applying margins to the css #batman with js.
score: 0

http://stackoverflow.com/comment/47462729
has text: please create a demo on http://jsfiddle.net
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29644366
type: QuestionComment

http://stackoverflow.com/comment/106915716
type: Comment
score: 0
type: AnswerComment
has text: The above will work, but it is actually not necessary to use the `attr` data-binding since knockout provides a `disable` and an `enable` data-binding as shown in @Wahwahwah's answer.
comment on: http://stackoverflow.com/a/29562198

http://stackoverflow.com/q/29569784
accepted answer: http://stackoverflow.com/a/29569883
score: 0
answer count: 3
has title: Create Chart.js pie chart data from PHP
possible better answer: http://stackoverflow.com/a/43934285
has answer: http://stackoverflow.com/a/51891291
has answer: http://stackoverflow.com/a/43934285
tagged with: php
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29569883
tagged with: chart.js
has body: I am working with chart.js and I am trying to get data from PHP but I'm having an issue. I have the following code: $dataArray = $this-&gt;getBlankSupportArray("New"); $dataArray = $this-&gt;getBlankSupportArray("In Progress"); $dataArray = $this-&gt;getBlankSupportArray("Neutralised Parked"); $dataArray = $this-&gt;getBlankSupportArray("Neutralised Pending Shout"); $dataArray = $this-&gt;getBlankSupportArray("Neutralised Pending Shout"); $dataArray = $this-&gt;getBlankSupportArray("Ready To Close"); The getBlankSupportArray loos like the following: private function getBlankSupportArray($issueStatus) { $array[$issueStatus]["value"] = 0; $array[$issueStatus]["color"] = "#ffffff"; $array[$issueStatus]["highlight"] = "#ffffff"; $array[$issueStatus]["label"] = $issueStatus; return $array; } Below is the data I am looping round from a mysql result and adding to the array while ($myrow = $result-&gt;fetch_array()) { $issueStatus = $myrow["IssueStatus"]; $supportOverview[$issueStatus]["value"] = $myrow["COUNT(*)"]; $supportOverview[$issueStatus]["color"] = "#F7464A"; $supportOverview[$issueStatus]["highlight"] = "#FF5A5E"; $supportOverview[$issueStatus]["label"] = $issueStatus; } I am then json_encoding this array. I think the json_encoding is returning the data in a format not suitable chart.js to process. The documentation for chart.js says that the data object should be in the following format var data = [ { value: 300, color:"#F7464A", highlight: "#FF5A5E", label: "Red" }, { value: 50, color: "#46BFBD", highlight: "#5AD3D1", label: "Green" }, { value: 100, color: "#FDB45C", highlight: "#FFC870", label: "Yellow" } ] So my question is, how do I get PHP to generate an object that can be sent back to javascript and decoded to be passed into chart.js. Thans for any help you can provide.
type: Question
tagged with: javascript

http://stackoverflow.com/comment/47509444
comment on: http://stackoverflow.com/a/29685625
has text: Put a `return false;` at the bottom of the submit function
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/29624319
tagged with: javascript
has comment: http://stackoverflow.com/comment/47392433
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47394297
has body: I'm confusing and a bit frustrated, I don't know what's wrong but on my website when I play for the first time a video it's shown at my suggested quality "hd720", however when I click my API next video button, the quality of the video drop down to "default". I already asked for some help here, but on this new question I wanna simply know what are possible reasons for that. How can I check what's wrong if from console I have no errors?
has comment: http://stackoverflow.com/comment/47392264
type: Question
has title: What's the possible reason for YouTube dropdown quality to "default" using the JavaScript API?
tagged with: youtube
tagged with: youtube-javascript-api
score: 0
has comment: http://stackoverflow.com/comment/47392334
linked to: http://stackoverflow.com/q/29605721
has comment: http://stackoverflow.com/comment/47392186
answer count: 0

http://stackoverflow.com/q/29603804
has comment: http://stackoverflow.com/comment/47353590
favorite count: 0
has body: so I've been using protractor as my e2e test angularjs component, and I've been facing this issue.. so I've got an html markup like this grid A grid B let's say if one of the input typed image above was clicked, there will be an information modal coming up to display the information. so I want to create a scenario on protractor to simulate those.. the scenario would be it("should've display grid information datas", function() { element(by.css(".item:eq(0) > .item-actions > input[title='info']")).click(); browser.waitForAngular(); }); logical explanation for the above code is the protractor would select the first '.item' element then click the 'input[title="info"]' inside it right ? but instead I got this error InvalidSelectorError: The given selector .item:eq(0) > .item-actions > input[title='info'] is either invalid or does not result in a WebElement. The following error occurred: InvalidSelectorError: An invalid or illegal selector was specified therefore I've been stuck since I'm new to using protractor.. is there anybody that could help me solve this issue ?
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47353586
has comment: http://stackoverflow.com/comment/47353536
has comment: http://stackoverflow.com/comment/47354077
type: AnsweredQuestion
has title: an invalid or illegal selector was specified error on protractor angularjs
has comment: http://stackoverflow.com/comment/47353303
has answer: http://stackoverflow.com/a/29614895
has comment: http://stackoverflow.com/comment/47353278
type: Question
tagged with: protractor
tagged with: javascript
score: 4
has comment: http://stackoverflow.com/comment/47353453
upvote count: 4
has comment: http://stackoverflow.com/comment/47354124
has comment: http://stackoverflow.com/comment/47353830
tagged with: css-selectors
accepted answer: http://stackoverflow.com/a/29614895
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47353253

http://stackoverflow.com/a/31472643
type: Answer
has body: 1- in Core of jstree Must Add( "animation": 0) "core": { "initially_open": ["phtml_1"], "rtl": true, "animation": 0 }, 2- Select Node : var str1 ='mynodeid'; $("#demo1").jstree('select_node', "#" + str1 ); 3- in bind Select_node Function : .bind("select_node.jstree", function (event, data) { data.inst._fix_scroll(data.rslt.obj); }
answers question: http://stackoverflow.com/q/29563712
score: 0

http://stackoverflow.com/comment/47225409
has text: Please include the exact problem in your question. What do you mean it doesnt work? Any error in the console?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29536289

http://stackoverflow.com/q/29667665
type: AnsweredQuestion
upvote count: 1
has body: I'm using this url for facebook graph api to get page views, and get the following in return: { "data": [], "paging": { "previous": "https://graph.facebook.com/v2.3/1570694813193723/insights/page_views/lifetime?debug=all&amp;pretty=0&amp;suppress_http_code=1&amp;since=1428476277&amp;until=1428735477", "next": "https://graph.facebook.com/v2.3/1570694813193723/insights/page_views/lifetime?debug=all&amp;pretty=0&amp;suppress_http_code=1&amp;since=1428994677&amp;until=1429253877" } } in some queries date time error that must be unix or date time format. I can share you my access token. I urgently need number of page views and also tell me since and until format
downvote count: 1
has title: facebook number of page views using facebook graph api
type: Question
possible better answer: http://stackoverflow.com/a/29668601
accepted answer: http://stackoverflow.com/a/29691805
has answer: http://stackoverflow.com/a/29668601
tagged with: javascript
tagged with: facebook-like
score: 0
answer count: 2
tagged with: facebook-javascript-sdk
tagged with: facebook-graph-api
favorite count: 0
tagged with: facebook
has answer: http://stackoverflow.com/a/29691805

http://stackoverflow.com/a/29637825
answers question: http://stackoverflow.com/q/29623585
upvote count: 0
has comment: http://stackoverflow.com/comment/73017565
has comment: http://stackoverflow.com/comment/77725609
score: -1
has comment: http://stackoverflow.com/comment/77718523
has body: Add this CSS code before &lt;/head&gt;: &lt;style&gt; #idSearchScope option{ width: 200px !important; } &lt;/style&gt; This is because you want to control the width of the options.
downvote count: 1
type: Answer

http://stackoverflow.com/comment/47307685
has text: They didn't say faster, they said better. It's not clear what that means. Sorting is almost never the fastest way to do anything.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29579585

http://stackoverflow.com/q/29623887
has answer: http://stackoverflow.com/a/29624057
score: 0
has comment: http://stackoverflow.com/comment/47392144
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47391514
has answer: http://stackoverflow.com/a/29623976
has body: My website is trackschoolbus.com. You can see a login form at the top right. What I have set up is when a wrong input is given it redirects to home page with a parameter as ?er=1 i.e. http://www.trackschoolbus.com/?er=1. I need to display a error message when the error url comes so I have written and the html is wrong input my login form is still it shows display none.
has comment: http://stackoverflow.com/comment/47391436
has comment: http://stackoverflow.com/comment/47391435
tagged with: php
accepted answer: http://stackoverflow.com/a/29623976
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47391401
tagged with: forms
has comment: http://stackoverflow.com/comment/47392920
type: Question
has comment: http://stackoverflow.com/comment/47391916
has title: display a div based on url parameter
linked to: http://stackoverflow.com/q/901115
has comment: http://stackoverflow.com/comment/47397032
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47391666
possible better answer: http://stackoverflow.com/a/29623984
has comment: http://stackoverflow.com/comment/47391850
has comment: http://stackoverflow.com/comment/47394866
has answer: http://stackoverflow.com/a/29623984

http://stackoverflow.com/comment/47287321
has text: Is one of the closing div's inside the PHP for loop instead of outside?
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29568874

http://stackoverflow.com/comment/47344131
type: AnswerComment
has text: How my first option will count `Éléonore` as two words? Explain me what's wrong with these two alternate answers i provided. I don't know what exactly op means by word, so i added both options.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29598644

http://stackoverflow.com/a/29553946
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/29550257
answers question: http://stackoverflow.com/q/29550257
has body: Add two another series with type: line to connect bar. See example: JSFiddle, may be that help you. function createChart() { $("#chart").kendoChart({ title: { text: "Hybrid car mileage report" }, legend: { position: "top" }, transitions: true, series: [{ type: "line", missingValues: "interpolate", markers: { visible: false }, data: [10, 20, 30, 40, 50], stack: true, tooltip: { visible: true }, name: "on battery", color: "orange", visibleInLegend: false }, { type: "column", data: [10, 20, 30, 40, 50], stack: true, name: "on battery", color: "#003c72" }, { type: "line", missingValues: "interpolate", markers: { visible: false }, data: [5, 15, 25, 35, 45], stack: true, tooltip: { visible: true }, name: "on gas", color: "green", visibleInLegend: false }, { type: "column", data: [5, 15, 25, 35, 45], stack: true, name: "on gas", color: "#0399d4" }], valueAxes: [{ title: { text: "miles" }, min: 0, max: 100 }], categoryAxis: { categories: ["Mon", "Tue", "Wed", "Thu", "Fri"], axisCrossingValues: [0, 0, 10, 10] }, tooltip: { visible: true, format: "{0}%", template: "#= series.name #: #= value #" } }); } $(document).ready(createChart); $(document).bind("kendo:skinChange", createChart); { font-size: 12px; font-family: Arial, Helvetica, sans-serif; }
has comment: http://stackoverflow.com/comment/47277827
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/48424180
downvote count: 0
type: Answer

http://stackoverflow.com/comment/47387972
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29621501
has text: can you post that code on jsfiddle editing suitably ? I would love to make it work and play with it. I am certain using css would be sufficient in this case or a little bit of js :D
score: 0

odata
tag name: odata
type: Tag
tags question: http://stackoverflow.com/q/29589242

http://stackoverflow.com/q/29532905
has comment: http://stackoverflow.com/comment/47218964
tagged with: javascript
has title: Data insertion in msacces from javascript
score: 0
has comment: http://stackoverflow.com/comment/47219277
tagged with: ms-access
type: UnansweredQuestion
answer count: 0
has comment: http://stackoverflow.com/comment/47219436
has comment: http://stackoverflow.com/comment/47219097
has body: I just wanna ask what is wrong or missing in my code, i cannot insert data in my database. I also searched in this site and used the code there but its not inserting data. Thank you in advance! var adVarWChar = 202; var adParamInput = 1; var fnamer = document.getElementById('firstn'); var lnamer = document.getElementById('lastn').value; var usernr = document.getElementById('uname').value; var passwr = document.getElementById('pword').value; var con = new ActiveXObject("ADODB.Connection"); var constring = "Microsoft.ACE.OLEDB.12.0;Data Source = Z:\JS\javascriptdb.accdb"; var cmd = new ActiveObject("ADODB.Command"); cmd.ActiveConnection = con; con.Open(); cmd.CommandText = "Insert into register(firstn,lastn,usern,passw)Values(?,?,?,?)"; cmd.Parameters.Append(cmd.CreateParameter("?",advarWChar,adParamInput,50,fnamer)); cmd.Parameters.Append(cmd.CreateParameter("?",advarWChar,adParamInput,50,lnamer)); cmd.Parameters.Append(cmd.CreateParameter("?",advarWChar,adParamInput,50,usernr)); cmd.Parameters.Append(cmd.CreateParameter("?",advarWChar,adParamInput,50,passwr)); cmd.Execute(); con.Close();
type: Question

http://stackoverflow.com/comment/47484220
has text: How are you disabling the complete application on client side/server side?
comment on: http://stackoverflow.com/q/29673121
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29567186
upvote count: 1
tagged with: css
type: AnsweredQuestion
score: 1
has title: Edit Hide Settings in Bootstrap Popup Model
type: Question
accepted answer: http://stackoverflow.com/a/29567263
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has body: I have Bootstrap hide model in my page with FORM on it. it display when page is Load. what i want to do is it should be disappear only if form is submitted. but the problem is when visitor click 'X' button in the Top right or Click background outside the model it gets disappear. how to edit the plugin according to that? or is there any other easy Popup plugins to achieve this?
favorite count: 0
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/29567263

http://stackoverflow.com/comment/47453967
score: 0
type: Comment
has text: Edited it to fix the typo and slightly incorrect, sorry!
type: AnswerComment
comment on: http://stackoverflow.com/a/29655913

http://stackoverflow.com/comment/47613144
has text: Thanks , but i tried your code, you can get the edited of mine above. but after putting the same code and refresh my page, it got a blank page.
comment on: http://stackoverflow.com/a/29678648
score: 0
type: AnswerComment
type: Comment

php
tags question: http://stackoverflow.com/q/29609876
tags question: http://stackoverflow.com/q/29631037
tags question: http://stackoverflow.com/q/29537766
tags question: http://stackoverflow.com/q/29615458
tags question: http://stackoverflow.com/q/29581566
tags question: http://stackoverflow.com/q/29541628
tags question: http://stackoverflow.com/q/29563822
tags question: http://stackoverflow.com/q/29544468
tags question: http://stackoverflow.com/q/29568440
tags question: http://stackoverflow.com/q/29673750
tags question: http://stackoverflow.com/q/29686290
tags question: http://stackoverflow.com/q/29552282
tags question: http://stackoverflow.com/q/29615680
tags question: http://stackoverflow.com/q/29678003
tags question: http://stackoverflow.com/q/29573617
tags question: http://stackoverflow.com/q/29667624
tags question: http://stackoverflow.com/q/29585724
tags question: http://stackoverflow.com/q/29542899
tags question: http://stackoverflow.com/q/29663126
tags question: http://stackoverflow.com/q/29557196
tags question: http://stackoverflow.com/q/29552814
tags question: http://stackoverflow.com/q/29652723
tags question: http://stackoverflow.com/q/29656849
tags question: http://stackoverflow.com/q/29540095
tags question: http://stackoverflow.com/q/29660189
tags question: http://stackoverflow.com/q/29607209
tags question: http://stackoverflow.com/q/29618806
tags question: http://stackoverflow.com/q/29657678
tags question: http://stackoverflow.com/q/29573421
tags question: http://stackoverflow.com/q/29581707
tags question: http://stackoverflow.com/q/29642351
tags question: http://stackoverflow.com/q/29646446
tags question: http://stackoverflow.com/q/29530859
tags question: http://stackoverflow.com/q/29683647
tags question: http://stackoverflow.com/q/29604970
tags question: http://stackoverflow.com/q/29537450
tags question: http://stackoverflow.com/q/29578759
tags question: http://stackoverflow.com/q/29632711
tags question: http://stackoverflow.com/q/29594784
tags question: http://stackoverflow.com/q/29554488
tags question: http://stackoverflow.com/q/29634500
tags question: http://stackoverflow.com/q/29673937
tags question: http://stackoverflow.com/q/29614640
tags question: http://stackoverflow.com/q/29651376
tags question: http://stackoverflow.com/q/29602813
tags question: http://stackoverflow.com/q/29680972
tags question: http://stackoverflow.com/q/29533254
tags question: http://stackoverflow.com/q/29565170
tags question: http://stackoverflow.com/q/29678489
tags question: http://stackoverflow.com/q/29677931
tags question: http://stackoverflow.com/q/29532776
tags question: http://stackoverflow.com/q/29687877
tags question: http://stackoverflow.com/q/29682031
tags question: http://stackoverflow.com/q/29534612
tags question: http://stackoverflow.com/q/29635400
tags question: http://stackoverflow.com/q/29536330
tags question: http://stackoverflow.com/q/29586916
tags question: http://stackoverflow.com/q/29546648
tags question: http://stackoverflow.com/q/29687179
tags question: http://stackoverflow.com/q/29651274
tags question: http://stackoverflow.com/q/29623887
tags question: http://stackoverflow.com/q/29560727
tags question: http://stackoverflow.com/q/29686542
tags question: http://stackoverflow.com/q/29632081
tags question: http://stackoverflow.com/q/29623290
tags question: http://stackoverflow.com/q/29604918
tags question: http://stackoverflow.com/q/29603227
tags question: http://stackoverflow.com/q/29556006
tags question: http://stackoverflow.com/q/29659159
tags question: http://stackoverflow.com/q/29581510
tags question: http://stackoverflow.com/q/29550035
tags question: http://stackoverflow.com/q/29626240
tags question: http://stackoverflow.com/q/29583109
tags question: http://stackoverflow.com/q/29574288
tags question: http://stackoverflow.com/q/29624714
tags question: http://stackoverflow.com/q/29662567
tags question: http://stackoverflow.com/q/29566518
tags question: http://stackoverflow.com/q/29596284
tags question: http://stackoverflow.com/q/29672200
tags question: http://stackoverflow.com/q/29653185

http://stackoverflow.com/comment/47404441
type: AnswerComment
has text: Yes, I agree, the string is in the document!
type: Comment
comment on: http://stackoverflow.com/a/29630773
score: 0

http://stackoverflow.com/a/29664789
answers question: http://stackoverflow.com/q/29664006
score: 0
has body: Why don't you use knockout mapping plugin: http://knockoutjs.com/documentation/plugins-mapping.html You would then have something like: var modelxInstance= ko.mapping.fromJS(child); There are a few mapping plugins for knockout, the one i like the most is actually this one: https://github.com/LucasLorentz/knockout.mapper And the reason is that it is more configurable and it is faster.
type: Answer

http://stackoverflow.com/comment/47462428
type: Comment
comment on: http://stackoverflow.com/a/29661126
has text: @Shane I updated my question, see if it fits your needs
type: AnswerComment
score: 0

http://stackoverflow.com/q/29547332
type: Question
has comment: http://stackoverflow.com/comment/47246610
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/47246384
has answer: http://stackoverflow.com/a/29547505
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47246511
has comment: http://stackoverflow.com/comment/47246606
score: 0
has comment: http://stackoverflow.com/comment/47246297
tagged with: ngroute
has title: AngularJS Not Loading on Other Paths
has body: I am sure this has been answered before, but I have no idea how to phrase this, so I was not able to find anything on Google. I am writing a website using Node.js, Express, and Angular. My Angular app only loads when I visit the home page 127.0.0.1:8080. When I click a link for a review (say to 127.0.0.1:8080/review/8ja9d8Kkjnmd), I successfully route to my next controller and the next page in my angular app. However, if I manually enter the url and press enter, the node.js api just serves me the JSON I serve the Angular app. So the Angular app takes this JSON and renders it for my view. How do I still load the angular page by manually entering the url and not just ping the node api? I feel like this would be a common problem, and again I apologize because I am sure it has been answered time and time again. This is the structure to my angular app public/js ├── app.js ├── appRoutes.js ├── controllers │ ├── MainCtrl.js │ └── ReviewCtrl.js ├── views │ ├── index.html │ ├── home.html │ └── review.html └── services ├── MainService.js └── ReviewService.js app.js is: // public/js/app.js angular.module('sampleApp', ['ngRoute', 'appRoutes', 'MainCtrl','MainService','ReviewCtrl','ReviewService','underscore']); appRoutes.js is: // public/js/appRoutes.js angular.module('appRoutes', []).config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) { $routeProvider // home page .when('/', { templateUrl: 'views/home.html', controller: 'MainController' }) .when('/review/:review_id', { templateUrl: 'views/review.html', controller: 'ReviewController' }) .otherwise({redirectTo: '/'}); $locationProvider.html5Mode(true); }]); If there is any more code I need to post, just let me know.
tagged with: node.js
tagged with: angularjs
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/16569841

http://stackoverflow.com/comment/47398838
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29569915
has text: @Joe : with a loop you can check what radio button is checked and then retrieve its value ("add", "edit", etc.). Better than write a switch-case statement (redundant code).
score: 0

http://stackoverflow.com/comment/47330094
comment on: http://stackoverflow.com/q/29591522
score: 0
type: Comment
type: QuestionComment
has text: The pages just appears blank. Apologies if I was unclear

http://stackoverflow.com/comment/47291259
score: 0
type: AnswerComment
has text: @BenjaminGruenbaum I see nothing in the question that would lead me to believe the text file contains JSON. If it did, why would the question even be asked as you would basically be asking "how do I convert JSON to JSON?",
comment on: http://stackoverflow.com/a/29570758
type: Comment

http://stackoverflow.com/a/29638872
type: Answer
answers question: http://stackoverflow.com/q/29638040
score: 0
has body: You're missing an opening bracket in your if statement. This: if (curcookie &gt; result2) &amp;&amp; (curcookie &lt; result3)) { $(".div2").show(); } Should be this: if ((curcookie &gt; result2) &amp;&amp; (curcookie &lt; result3)) { $(".div2").show(); } Check out the fixed version here - DEMO

http://stackoverflow.com/a/29588972
type: Answer
upvote count: 4
downvote count: 0
has body: for..in loops over enumerable properties and arrays have numerical properties which acts as index. It is to be used with only objects. Doing so with Arrays will also give you properties which you won't be interested in(such as those properties which are on the higher chain of prototypic inheritance from Object object) So use a simple for loop or Array.forEach products.forEach(function(str){ console.log(str); }); // or for(var i = 0; i &lt; products.length; i++) console.log(products[i]);
has comment: http://stackoverflow.com/comment/47325343
accepted answer of: http://stackoverflow.com/q/29588928
score: 4
answers question: http://stackoverflow.com/q/29588928
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47325191

http://stackoverflow.com/q/29590219
answer count: 1
has comment: http://stackoverflow.com/comment/47328062
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29590912
has body: I'm new to Grunt.js. I've been working on a micro project that aims to produce a single .html file that is very portable without any external dependencies. It will have CSS and Javascript within the HTML document but I'd like to work on the project with external sass and js files while using grunt tasks to assemble the final .html file with each change. As a result I'm "watching" all scss, js, and html file changes. When any file changes I need to rebuild the html file (also using grunt-includes). It's all working right now, technically. But it seems like some tasks are repeating. I'm out of my league reading this accurately so I'm interested in: Is there a way I can avoid multiple passes over the same tasks? With this being my first pass at a grunt task set, is there anything completely off / backwards in my code so far as you can tell (happy to provide more info as needed)? My grunt.js file contents: module.exports = function(grunt) { "use strict"; require("matchdep").filterDev("grunt-*").forEach(grunt.loadNpmTasks); grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), includes: { files: { src: ['build/*.html','build/*.css','build/*.js'], dest: './', flatten: true, cwd: '.', options: { silent: true, includePath: 'build/includes' } } }, concat: { fields: { src: ['build/fieldTypes/*.html'], dest: 'build/includes/fieldTypes.inc.html', options: { separator: '\n\n\t&lt;hr/&gt;\n\n\n' } }, js: { src: ['build/js/ga.js', 'build/js/core.js'], dest: 'build/includes/scripts.inc.js', options: { separator: '\n\n' } }, }, sass: { options: { style: 'compressed', sourcemap: 'none' }, dist: { files: [{ expand: true, flatten: true, src: 'build/sass/styles.scss', dest: 'build/includes/', ext: '.inc.css' }] } }, watch: { css: { files: 'build/**/*.scss', tasks: ['sass', 'includes'] }, js: { files: 'build/**/*.js', tasks: ['concat', 'includes'] }, html: { files: 'build/**/*.html', tasks: ['concat','includes'] } } }); grunt.registerTask('default',['watch']); }; The log after a c…
favorite count: 0
has title: Grunt Watch task repeating steps unnecessarily
type: AnsweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/47328046
tagged with: grunt-contrib-watch
type: Question
has comment: http://stackoverflow.com/comment/47327594
score: 1
tagged with: gruntjs
has answer: http://stackoverflow.com/a/29590912
downvote count: 0
has comment: http://stackoverflow.com/comment/47327954

http://stackoverflow.com/comment/47256916
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29552832
score: 1
has text: 1) `setAge` is already global (in the scope of your question's code). You are not setting `setAge` to equal `bob.setAge`, you are in fact doing the opposite; you are setting the property `setAge` on object `bob` to equal `setAge` (the global function)

http://stackoverflow.com/q/29599661
has comment: http://stackoverflow.com/comment/47346431
tagged with: javascript
has body: I'm using bootstrap as a main front-end framework for my web site project and sigma.js as it's graph visualization library. ... &lt;div id="graph-container" style="width: 540px; height: 300px;"&gt; &lt;/div&gt; &lt;script&gt; ... $(document).ready(function() { s = new sigma({ graph: graph, container: 'graph-container' }) }); &lt;/script&gt; What I'm struggling on is to remove those hard-coded graph-container sizes and delegate it's layout to bootstrap's grid system. However, it just shrinks to nothing when I just simply remove the style attribute. Is there any way to embed sigma.js seamlessly within bootstrap's grid system?
score: 0
answer count: 1
tagged with: twitter-bootstrap
tagged with: sigma.js
type: AnsweredQuestion
has title: How to embed sigma.js graph container div within bootstrap's responsive grid system
type: Question
has answer: http://stackoverflow.com/a/30200643
accepted answer: http://stackoverflow.com/a/30200643

http://stackoverflow.com/q/29601730
has answer: http://stackoverflow.com/a/29622934
has title: Can't put angular-foundation typeahead above other foundation-apps grid-block
tagged with: angularjs
tagged with: css
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/29622934
tagged with: javascript
score: 0
tagged with: typeahead.js
has body: See the following plunker (better with smaller screen). I'm using foundation-apps with grid-blocks generated by ng-repeat. The inputs are using angular-foundation typeahead. When you type an 'a' in one of the input, the dropdown will appear strictly within its grid-block. Consequently I obtain a scroll bar while I would like to see the dropdown above everything else... A z-index does not seem to change anything.
tagged with: zurb-foundation
answer count: 1

http://stackoverflow.com/a/29549514
type: Answer
answers question: http://stackoverflow.com/q/29549275
has body: Create a variable outside your function called index var index =0; Then replace your else code with var td = tr.insertCell(); td.appendChild(document.createTextNode(Myarray[index])); td.style.border = "1px solid black"; if(i == 1 &amp;&amp; j == 1){ td.setAttribute('rowSpan', '1'); } index++;
score: 0

http://stackoverflow.com/q/29562476
has answer: http://stackoverflow.com/a/29628446
has answer: http://stackoverflow.com/a/29565193
tagged with: javascript
has comment: http://stackoverflow.com/comment/47275639
has comment: http://stackoverflow.com/comment/47275653
has comment: http://stackoverflow.com/comment/47275266
score: 0
has title: chrome extension changing host/domain warning
tagged with: google-chrome-extension
has comment: http://stackoverflow.com/comment/47275996
has body: I am trying to create a chrome extension that will notify me of host/domain changes when I'm testing a specific website. Often links will be present that point towards developer or live environments and I'd like to be warned if I follow one of these links as the websites are often identical. Edit for clarity: I want it to alert me when a link takes me away from http(s)://example.staging.something.com and ends up on the live site http(s)://www.example.com or the dev site http(s)://example.dev.something.com So far I have managed to create a script that identifies when I am on a staging url (our test environment) however I've been unable to reverse this logic to give me a warning when I navigate to a url that doesn't contain 'staging'. My manifest.json { "manifest_version": 2, "name": "A What URL", "description": "This extension monitors and warns you of domain changes", "version": "1.0", "browser_action": { "default_icon": "icon.png", "default_popup": "popup.html" }, "background": { "scripts": ["background.js"], "persistent": false }, "permissions": [ "activeTab", "webNavigation" ] } my background.js chrome.webNavigation.onCommitted.addListener(function(e) { alert ("you are still on staging!"); }, {url: [{hostContains: 'staging'}]}); I'm sure this is simple but it appears my brain is far simpler!
has comment: http://stackoverflow.com/comment/47388077
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/47275058
type: Question
type: AnsweredQuestion
answer count: 3
has answer: http://stackoverflow.com/a/29563408
accepted answer: http://stackoverflow.com/a/29563408
possible better answer: http://stackoverflow.com/a/29565193

http://stackoverflow.com/q/29598957
possible better answer: http://stackoverflow.com/a/29599281
downvote count: 0
has answer: http://stackoverflow.com/a/29599281
favorite count: 0
has comment: http://stackoverflow.com/comment/47345084
has comment: http://stackoverflow.com/comment/47346366
has body: Hi for the following code function employee() { this.name="john"; } employee.prototype={ job:"manager", projects:["sales","training","construction"], display:function() { alert(this.name+" is a "+ this.job); } } var property=Object.getOwnPropertyNames(employee.prototype); alert(property); I am getting result as job,projects,display but when i am defining properties using prototype in this way function employee() { this.name="john"; } employee.prototype.job="manager"; employee.prototype.projects=["sales","training","construction"]; employee.prototype.display=function() { alert(this.name+"is a"+ this.job); } var property=Object.getOwnPropertyNames(employee.prototype); alert(property); I am getting result as constructor,job,projects,display My question is why i am not getting constructor in the result of first case?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29599167
type: Question
has comment: http://stackoverflow.com/comment/47345314
accepted answer: http://stackoverflow.com/a/29599167
tagged with: javascript
score: 4
has comment: http://stackoverflow.com/comment/47345944
upvote count: 4
has title: confusion in Object.getOwnPropertyNames
answer count: 2

http://stackoverflow.com/q/29638481
possible better answer: http://stackoverflow.com/a/29638739
has body: I have been working on loops and conditionals lately. I have been pretty successful in understanding the concepts, but the brackets continue to confuse me. Without the bracket at the end of line three, and the very last bracket at the bottom, the call log will not read "Generator #1 is off." like it should. Why do those brackets make such a big difference? var totalGen = 19; var totalMW = 0; for (var genNumber = 1; genNumber &lt;= totalGen; genNumber++){ if (genNumber &lt;= 4 &amp;&amp; genNumber % 2 == 0) { totalMW += 62; console.log("Generator #" + genNumber + " is on, adding 62 MW, for a total of " + totalMW + " MW!"); } else if (genNumber &gt;= 5 &amp;&amp; genNumber % 2 == 0) { totalMW += 124; console.log("Generator #" + genNumber + " is on, adding 124 MW, for a total of " + totalMW + " MW!"); } else { console.log("Generator #" + genNumber + " is off."); } }
has answer: http://stackoverflow.com/a/29638739
accepted answer: http://stackoverflow.com/a/29638546
favorite count: 0
answer count: 4
has answer: http://stackoverflow.com/a/29638589
has comment: http://stackoverflow.com/comment/47419194
has answer: http://stackoverflow.com/a/29638616
type: AnsweredQuestion
downvote count: 1
type: Question
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/47419183
has comment: http://stackoverflow.com/comment/47419243
has title: Trouble with brackets yet again
has answer: http://stackoverflow.com/a/29638546
upvote count: 0

http://stackoverflow.com/a/29649126
answers question: http://stackoverflow.com/q/29648517
score: 0
type: Answer
has body: There is no date formatter in Javascript, however you can create custom date string from date object as following: var day_names = new Array("SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"); var month_names = new Array("JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"); var date = new Date(); var curr_day = date.getDay(); var curr_date = date.getDate(); var curr_month = date.getMonth(); var curr_year = date.getFullYear(); var cur_hour = date.getHours(); var minutes = date.getMinutes(); var AMorPM = cur_hour &gt;= 12 ? AMorPM = "PM" : AMorPM = "AM"; cur_hour = cur_hour &gt; 12 ? cur_hour -= 12 : cur_hour; if (cur_hour &lt; 10) cur_hour = "0" + cur_hour; if (minutes &lt; 10) minutes = "0" + minutes; var finalDate = "&lt;b&gt;" + day_names[curr_day] + "&amp;nbsp;" + month_names[curr_month] + "&amp;nbsp;" + curr_date + ", " + curr_year + "&amp;nbsp;" + cur_hour + ":" + minutes + "&amp;nbsp;" + AMorPM + "&lt;/b&gt;"; document.getElementById('dateTime').innerHTML = finalDate; DEMO

internet-explorer-11
tags question: http://stackoverflow.com/q/29593349
type: Tag
tags question: http://stackoverflow.com/q/29579063
tag name: internet-explorer-11
tags question: http://stackoverflow.com/q/29609506
tags question: http://stackoverflow.com/q/29648924

http://stackoverflow.com/comment/47218619
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/29532703
has text: if you want instelliance for only particular script file.you can /// <reference path="jquery.dev.js" /> to the script file

http://stackoverflow.com/a/29569709
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/29567936
has body: You very nearly have it. Simply encapsulate your &lt;script&gt;-adding code in a function, and call it when you click the Search button: function doJSONP() { var script = document.createElement('script'); var scriptSrc = script.src = 'https://webservice.informatik.umu.se/webservice_livsmedel/getlivsmedel.php?callback=getLivsmedel&amp;namn=' + search.value; document.querySelector('body').appendChild(script); } button.addEventListener("click", function() { doJSONP(); }); This assumes that search is your input element (not the load-time value of that element, as you currently have in your fiddle), and button is your button element. Just a few notes on your fiddle: You'll need to do window.getLivsmedel = function(data) { instead of function getLivsmedel(data) { in JSFiddle, because the fiddle's Script code does not run in a global scope. JSONP requires functions are visible from the global scope. (This is not a problem outside of JSFiddle on a normal web page.) Your getLivsmedel function doesn't seem to work: there doesn't appear to be tbody in your HTML. However, this is a totally different problem (and probably easily fixed) and not related to your JSONP troubles. Here's your fiddle with my changes implemented: https://jsfiddle.net/4gt10u2p/2/
accepted answer of: http://stackoverflow.com/q/29567936
has comment: http://stackoverflow.com/comment/47289013
score: 0

http://stackoverflow.com/a/29694606
has body: In the chart you can use scatter serie with enabled lineWidth. After last point, add reference to first point, then line will be printed. { "name": "Legal", "data": [[0,4], [1,3], [2,4], [3,4], [4,4], [5,4], [6,4], null, null, null, null, null, null,[13,4],[0,4]], "color": "#206ef0" } You can set line on the edge, by setting tickInterval / endOnTick / max options. yAxis: { max:4, tickInterval:1, endOnTick:true, gridLineInterpolation: 'polygon', lineWidth: 0, min: 0 }, Example: http://jsfiddle.net/rLfj69b9/8/
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/29662712
accepted answer of: http://stackoverflow.com/q/29662712
score: 0

http://stackoverflow.com/q/29670958
type: Question
has comment: http://stackoverflow.com/comment/47482695
has title: Replace Spaces with - in angular js data binding
has comment: http://stackoverflow.com/comment/47528134
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29671460
favorite count: 0
has answer: http://stackoverflow.com/a/29671142
tagged with: angularjs
has body: Page-Title: Page-Alias: I am new to angular and using simple data-binding so that whenever a user enters the page title the alias gets auto generated but I want to identify the spaces and replace them with a "-" (dash) . For example: whenever the user enters Home Page I want the alias to be Home-Page and even better if it's home-page. I tried doing this but it doesn't work.
has answer: http://stackoverflow.com/a/29671249
answer count: 4
score: 2
upvote count: 2
has answer: http://stackoverflow.com/a/29672849
type: UnansweredQuestion

http://stackoverflow.com/q/29643609
possible better answer: http://stackoverflow.com/a/29644441
score: 8
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47429510
has comment: http://stackoverflow.com/comment/47429614
type: Question
has comment: http://stackoverflow.com/comment/47428327
linked to: http://stackoverflow.com/q/16061032
tagged with: http://stackoverflow.com/tag/json
has title: How to pass json data to highcharts series?
has comment: http://stackoverflow.com/comment/47429488
answer count: 2
tagged with: highcharts
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29647364
favorite count: 0
has answer: http://stackoverflow.com/a/29644441
upvote count: 8
linked to: http://stackoverflow.com/q/11720558
has body: I have following json array which is generated at runtime. Hence the number of name/data pairs varies. `var sales = { "SalesData" : [ { "name" : "AllProducts|Canada", "data" :[44936.0,50752.0] }, { "name" : "AllProducts|Mexico", "data" : [200679.0,226838.0] }, { "name" : "AllProducts|USA", "data" : [288993.0,289126.0] } ]} ` I want to pass this data to series in highcharts. This is how I am doing it currently. series: [ {name:sales.SalesData[0].name,data:sales.SalesData[0].data}, {name:sales.SalesData[1].name,data:sales.SalesData[1].data}, {name:sales.SalesData[2].name,data:sales.SalesData[2].data} ] But if the number of elements in array are changed then this won't work. How do I solve this problem ? Demo code will help me. I have refereed following questions but I was not able to solve the problem. Dynamically adding to Highcharts Highcharts series data array
accepted answer: http://stackoverflow.com/a/29647364

http://stackoverflow.com/comment/47466956
comment on: http://stackoverflow.com/a/29663775
has text: @gchian - the second alert is from when your page reloads and thus it again has an empty array. Remember, Javascript state is not preserved form one page load to the next. It starts over again each time the page is loaded. Your form submit was reloading the page right after it ran `radioCheck()`.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47364697
comment on: http://stackoverflow.com/q/29609574
has text: done any basic debugging, like checking if the second ajax request hits the server? added `error:` handlers to either to see if something blew up client-side?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29666008
score: 2
has body: The underlying issue here is related to the z-order of the three images. Your slide animations are only showing up where the image being slid in is above the displayed image; the "broken" transitions are actually occurring, they're just obscured by the "higher" visible image. You can fix this by explicitly setting the z-index of the new and current image. For example, on the right transition: prevLandscape.zIndex(1); currLandscape.zIndex(0); If you do this, you'll also need to increase the z-index of the arrows so they're above the images. Fiddle
type: AcceptedAnswer
downvote count: 0
upvote count: 2
accepted answer of: http://stackoverflow.com/q/29665455
type: Answer
answers question: http://stackoverflow.com/q/29665455

http://stackoverflow.com/comment/47923170
comment on: http://stackoverflow.com/q/29680352
score: 0
has text: Ok, and that's the part that's not working right now, right?
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29572094
accepted answer of: http://stackoverflow.com/q/29558323
answers question: http://stackoverflow.com/q/29558323
has comment: http://stackoverflow.com/comment/56021038
has body: EDIT: I think this is it: function texturePosToPlaneWorld(planeOb, texcoord) { var pos = new THREE.Vector3(); pos.x = (texcoord.x - 0.5) * PLANESIZE; pos.y = (texcoord.y - 0.5) * PLANESIZE; pos.applyMatrix4(planeOb.matrix); return pos; } Is used like this in the jsfiddle I made: http://jsfiddle.net/L0rdzbej/2/ var texcoord = new THREE.Vector2(0.8, 0.65); var newpos = texturePosToPlaneWorld(planeOb, texcoord); cubeOb.position.copy(newpos); Planes are simple. The edge between vertices A, B -- vector A->B defines the direction for 'x' in your texture, and A->C similarily for the other direction in which the plane goes in the 3d space .. where you have texture's 'y' mapped on the plane. Let's assume your pivot point is in the middle. So that's known in world space. Then as UV go from 0 to 1, e.g. UV coord (1.0, 0.5) would be in half way of the full width of the plane in the direction of the vector from of your Plane object pivot .. going from middle all the way to the edge. And then in the middle otherwise, where you have 0.5 in V (as in normalized texture y pixelcoord). To know the coordinates of the vertices of the plane in world space, you just multiple them with the orientation of the object.. Given you know the size of your plane, you actually don't need to look at the vertices as the orientation of the plane is already in the object matrix. So you just need to adapt your UV coord to the pivot in middle (-0.5) and multiply with the plane size to get the point in plane space. Then the matrix multiplication converts that to world space.
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/comment/47342570
score: 0
comment on: http://stackoverflow.com/q/29560441
type: QuestionComment
has text: for chrome, it is not working with set and get methods also
type: Comment

http://stackoverflow.com/comment/47366775
comment on: http://stackoverflow.com/a/29609539
score: 0
type: AnswerComment
has text: really need to compose Rooms and Furnitures as objects that don't just have properties, but functions.
type: Comment

http://stackoverflow.com/q/29648760
has answer: http://stackoverflow.com/a/29648886
has title: How can I get the value of a span element with jQuery?
type: Question
has comment: http://stackoverflow.com/comment/47437554
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/47437564
tagged with: javascript
tagged with: jquery
score: 0
accepted answer: http://stackoverflow.com/a/29648915
answer count: 3
upvote count: 1
possible better answer: http://stackoverflow.com/a/29648886
downvote count: 1
has comment: http://stackoverflow.com/comment/47437359
favorite count: 0
has answer: http://stackoverflow.com/a/29648915
has comment: http://stackoverflow.com/comment/47437535
has body: I have tested every solution I have found on Internet, but none of them works. I have this HTML: Códigos disponibles:@Model.ExternalCodesForThisProduct And this Javascript: $('#eCodesFrm').on('submit', function (e) { //use on if jQuery 1.7+ e.preventDefault(); //prevent form from submitting var availableCodes = $("#codesQuantity"); var totalCodesUsed = 0; alert(availableCodes); $('#eCodesFrm *').filter(':input').each(function () { if (this.name.match(/.Quantity$/)) { totalCodesUsed = totalCodesUsed + parseInt(this.value, 10); } }); But availableCodes is [object Object]. What am I doing wrong?
has comment: http://stackoverflow.com/comment/47437506
has answer: http://stackoverflow.com/a/29648902
tagged with: razor
has comment: http://stackoverflow.com/comment/47437642
type: AnsweredQuestion

http://stackoverflow.com/q/29652947
has answer: http://stackoverflow.com/a/29653789
type: AnsweredQuestion
tagged with: formatting
has body: So in my JS I have an object like so; [ { firstname: "John", lastname: "Smith" }, { firstname: "Peter", lastname: "Gregory" }, { firstname: "John", lastname: "Fisher" }, { firstname: "Sam", lastname: "Fisher" } ] And I'd like to display the first names in a comma-separated string. Now this would be simple enough, but I also want to display the first initial of the last name only where necessary, to distinguish two people with the same first name. So, in the end, I'd have this: John S., Peter, John F., Sam Thus far I've been able to do a loop that remembers past initials, but the problem for me becomes the fourth entry in the example; someone with a last name that has had to be distinguished with someone else, but who doesn't a share a first name with anyone. What would be the smartest way of going about this?
type: Question
tagged with: arrays
has comment: http://stackoverflow.com/comment/47445892
downvote count: 0
tagged with: javascript
answer count: 3
has answer: http://stackoverflow.com/a/29653136
possible better answer: http://stackoverflow.com/a/29653476
has answer: http://stackoverflow.com/a/29653476
tagged with: string
score: 1
favorite count: 0
upvote count: 1
has comment: http://stackoverflow.com/comment/47446007
has comment: http://stackoverflow.com/comment/47445660
has title: Get a list of first names with last name initials if necessary
accepted answer: http://stackoverflow.com/a/29653136

http://stackoverflow.com/a/29594900
has body: This will happen , what you need to do is Method 1: &lt;form method="POST" onsubmit="callFuntion()"&gt; Method 2: &lt;form action="demo_form.php" method="post"&gt; put all your php code in file demo_form.php and when the submit is clicked it will go that file , which will help you to call the function once not twice .
has comment: http://stackoverflow.com/comment/47336855
type: Answer
upvote count: 0
has comment: http://stackoverflow.com/comment/47337097
has comment: http://stackoverflow.com/comment/47336797
score: -1
downvote count: 1
answers question: http://stackoverflow.com/q/29594784
has comment: http://stackoverflow.com/comment/47336811

http://stackoverflow.com/a/29592448
has comment: http://stackoverflow.com/comment/47334345
type: Answer
answers question: http://stackoverflow.com/q/29590886
has comment: http://stackoverflow.com/comment/47335295
has comment: http://stackoverflow.com/comment/47336235
has body: It looks to me like you've specified the authors field check incorrectly, you have it matching an object where it looks like it should be an Array. Try changing the following in your method to see if you're able to save : check(postAttributes, { title: String, (...) language: String, authors: Any }); If I understand the documentation correctly, it looks like you'll need to check for an array of objects with something like [Object].
has comment: http://stackoverflow.com/comment/47336559
score: 0
has comment: http://stackoverflow.com/comment/47336710

http://stackoverflow.com/comment/47231196
type: AnswerComment
type: Comment
has text: I have tried both options, but it was not successful.
score: 0
comment on: http://stackoverflow.com/a/29538927

http://stackoverflow.com/comment/47420919
score: 2
comment on: http://stackoverflow.com/q/29639270
type: Comment
type: QuestionComment
has text: Compute the positions of the nodes yourself. The force layout is not suitable to achieve exactly this.

http://stackoverflow.com/comment/47220216
has text: Edited the question to be more clear!
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29533414
score: 0

graphics
tag name: graphics
tags question: http://stackoverflow.com/q/29602561
tags question: http://stackoverflow.com/q/29612707
tags question: http://stackoverflow.com/q/29586754
type: Tag
tags question: http://stackoverflow.com/q/29592828
tags question: http://stackoverflow.com/q/29621933

http://stackoverflow.com/comment/47219314
type: AnswerComment
comment on: http://stackoverflow.com/a/29532935
type: Comment
has text: @HogRider: No, you remember (in #1) that `"0009"` is four digits long, then convert it to a number, add one to it, convert that to a string (`"10"`), then in step #5 you add as many zeroes to the beginning as necessary to make it four digits long again -- in this case `theString.length - desiredLength` will be `-2` and so you'll end up with `"00000000000000000000000".substr(-2) + theString` which will give you `"0010"`.
score: 1

http://stackoverflow.com/a/29664704
answers question: http://stackoverflow.com/q/29663461
has comment: http://stackoverflow.com/comment/47468693
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/47468792
has body: This is how you can get the count of table rows in iterative table &lt;% int count=0; %&gt; &lt;s:iterator status="state" id="myTable"&gt; &lt;% count ++; %&gt; &lt;td&gt;&lt;s:textfield name="username" id="username" cssClass="size40" readonly="true" tabindex="-1" /&gt;&lt;/td&gt; &lt;td&gt;&lt;s:textfield name="lastName" id="lastName" cssClass="size40" readonly="true" tabindex="-1" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/s:iterator&gt; &lt;input type="text" id="tableCount" style="display:none;" value="&lt;%= count%&gt;"&gt; In javascript var x = document.getElementById("tableCount").value; alert(x);

http://stackoverflow.com/q/29539532
linked to: http://stackoverflow.com/q/15778856
has answer: http://stackoverflow.com/a/30629549
tagged with: d3.js
type: UnansweredQuestion
has body: I have been trying to project a heat map with data loaded from csv onto a orthogonal projection on D3. While rotating the earth (i.e. D3, orthogonal projection), the points/circles remain static. I have tried many combinations but failed to figure out what is missing. Basically, i need the small circles move along the path of countries. Here is the complete code : &lt;script&gt; var width = 600, height = 500, sens = 0.25, focused; //Setting projection var projection = d3.geo.orthographic() .scale(245) .rotate([0,0]) .translate([width / 2, height / 2]) .clipAngle(90); var path = d3.geo.path() .projection(projection); //SVG container var svg = d3.select("body").append("svg") .attr("width", width) .attr("height", height); // Define the gradient var gradient = svg.append("svg:defs") .append("svg:linearGradient") .attr("id", "gradient") .attr("x1", "0%") .attr("y1", "0%") .attr("x2", "100%") .attr("y2", "100%") .attr("spreadMethod", "pad"); // Define the gradient colors gradient.append("svg:stop") .attr("offset", "0%") .attr("stop-color", "#FFFF00") .attr("stop-opacity", 0); gradient.append("svg:stop") .attr("offset", "100%") .attr("stop-color", "#FF0000") .attr("stop-opacity", 1); //Adding water svg.append("path") .datum({type: "Sphere"}) .attr("class", "water") .attr("d", path) var countryTooltip = d3.select("body").append("div").attr("class", "countryTooltip"), countryList = d3.select("body").append("select").attr("name", "countries"); queue() .defer(d3.json, "world-110m.json") .defer(d3.tsv, "world-110m-country-names.tsv") .await(ready); //Main function function ready(error, world, countryData) { var countryById = {}, countries = topojson.feature(world, world.objects.countries).features; //Adding countries to select countryData.forEach(function(d) { countryById[d.id] = d.name; option = countryList.append("option"); option.text(d.name); option.property("value", d.id); }); //circles for heatmap are coming from the csv below d3.csv("cities.csv", function(error, data) { …
tagged with: orthogonal
type: Question
score: 0
upvote count: 1
answer count: 1
downvote count: 1
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/csv
has title: rotate points from csv on d3 orthogonal projection
tagged with: http://stackoverflow.com/tag/svg

http://stackoverflow.com/q/29647971
tagged with: mime
downvote count: 0
tagged with: jquery
favorite count: 0
has title: Is there a way to disable popup blocker in Safari using Javascript?
tagged with: mime-types
has body: I know this is a very vague question. But in my current application, I need to download the xls file from ajax response. So I used "window.location", and it worked out perfectly in chrome, firefox and IE. But safari is throwing an error "resource interpreted as document but transferred with mime type 'application/vnd.ms-excel'". For this I have changed the code little bit from "window.location" to "window.open('url','_blank')". It solved the mime type error. But when popup blocker is enabled in safari, it is not even prompting the user to give permission to open popup. But all other browsers did that. So my question is! Is there any possibility that, I can turn off the popup blocker in safari either using javascript or jQuery (I Know we cannot override the browser settings using the js or jQuery)? Or at-least can we know weather pop-up blocker is enabled or not?
tagged with: safari
answer count: 0
type: UnansweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: javascript

http://stackoverflow.com/a/57517416
type: Answer
has body: My quick answer will be : let newStr = string.split(''); let word = []; let num = []; for (let i = 0 ; i&lt;string.length ;i++){ isNaN(string[i])? word.push(string[i]) : num.push(string[i]) } let l=num.length-1; let pureNum=0; for (let i = 0 ; i&lt;num.length ;i++){ pureNum += num[i] * Math.pow(10,l); l--; } let wordNum = (pureNum+1).toString().split(''); for (let i = wordNum.length ; i&lt;num.length ;i++){ wordNum.unshift("0"); } return word.join("")+wordNum.join(""); }
score: 0
has comment: http://stackoverflow.com/comment/101502926
answers question: http://stackoverflow.com/q/29601303

http://stackoverflow.com/q/29637775
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29639749
has answer: http://stackoverflow.com/a/29638046
has comment: http://stackoverflow.com/comment/47417955
type: Question
tagged with: math
tagged with: javascript
score: 4
accepted answer: http://stackoverflow.com/a/29639749
has title: Calculate minimum value not between set of ranges
upvote count: 4
has body: Given an array of circles (x,y,r values), I want to place a new point, such that it has a fixed/known Y-coordinate (shown as the horizontal line), and is as close as possible to the center BUT not within any of the existing circles. In the example images, the point in red would be the result. Circles have a known radius and Y-axis attribute, so easy to calculate the points where they intersect the horizontal line at the known Y value. Efficiency is important, I don't want to have to try a bunch of X coords and test them all against each item in the circles array. Is there a way to work out this optimal X coordinate mathematically? Any help greatly appreciated. By the way, I'm writing it in javascript using the Raphael.js library (because its the only one that supports IE8) - but this is more of a logic problem so the language doesn't really matter.
answer count: 3
tagged with: trigonometry
tagged with: intervals
downvote count: 0
possible better answer: http://stackoverflow.com/a/29637960
has answer: http://stackoverflow.com/a/29637960
favorite count: 0
has comment: http://stackoverflow.com/comment/47418278
has comment: http://stackoverflow.com/comment/47417922

http://stackoverflow.com/a/29647990
accepted answer of: http://stackoverflow.com/q/29647860
type: Answer
answers question: http://stackoverflow.com/q/29647860
has comment: http://stackoverflow.com/comment/47576912
type: AcceptedAnswer
has body: If I understand correctly, you want the loop to "pause" while you perform some function with data avilable inside the loop and then perform a function. When you say "for each loop step" I assume it's for each step in the for loop. function myFunc(expr) { var array1 = [], array2 = []; for (var i = 0; i &lt; expr.length; ++i) { // ... // Perform something here after a certain time, while the loop waits. } return array2; }; As far as I know, you won't be able to achieve this exactly, however, if you have the data available you can "fake" the behaviour you want. See this jsfiddle where I created an example. function myFunc(expr) { var array1 = [], array2 = []; for (var i = 0; i &lt; expr.length; ++i) { // ... setTimeout(function(){ // Do whatever you want to do. }, i*500); // i = 0 is instantly, i = 1 is after 0.5s, i=2 is 1s, and so on... } return array2; }; Your (estimated) timeline will then be as follows, from when the for loop is started. 0s -&gt; function in timeout when i = 0 is called 0.5s -&gt; function in timeout when i = 1 is called 1.0s -&gt; function in timeout when i = 2 is called Note that timeout is not precise, and there can be deviations in the time before execution of the function. Beware of scoping issues if you modify the variables you use inside the function, inside the loop. I hope this helps!
score: 0
has comment: http://stackoverflow.com/comment/47546319

http://stackoverflow.com/a/29541722
has body: You could use the Bootstrap grid system to do something like this. You could use a combination of the columns, and offset to achieve this. &lt;div class="col-md-4"&gt;&lt;/div&gt; &lt;div class="col-md-4"&gt;&lt;/div&gt; &lt;div class="col-md-4"&gt;&lt;/div&gt; That will span three columns across the full width of the page. You could experiment with smaller width columns, and adding an offset to the first one to push it away from the left edge. http://getbootstrap.com/css/#grid-offsetting
type: Answer
answers question: http://stackoverflow.com/q/29541526
score: 0

http://stackoverflow.com/q/29588698
score: 0
answer count: 1
has body: When selected DropDownList1, the bootstrap modal gets fade out on DropDownList1_SelectedIndexChanged. × The Fastest Car Insurance Premium Calculator Car Brand <asp:DropDownList ID="ddlbrand" runat="server" class="showbtn" CssClass="form-control" AutoPostBack="True" onselectedindexchanged="ddlbrand_SelectedIndexChanged"> </asp:DropDownList> Car Model <asp:DropDownList ID="ddlmodels" runat="server" CssClass="form-control" AutoPostBack="True" onselectedindexchanged="ddlmodels_SelectedIndexChanged"> </asp:DropDownList> When I select 1st dropdownlist that is car brand the modal get fade out, in which case modal shouldn't fade JavaScript code
has comment: http://stackoverflow.com/comment/47325229
tagged with: asp.net
tagged with: twitter-bootstrap
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47329232
has answer: http://stackoverflow.com/a/29592368
type: Question
has title: How to fadein bootstrap modal on DropDownList1_SelectedIndexChanged?
tagged with: javascript

http://stackoverflow.com/q/29601925
has comment: http://stackoverflow.com/comment/47350771
tagged with: jsp
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/47350040
tagged with: http://stackoverflow.com/tag/html
has body: I am getting pagination on every page but serial no(S/N) is starting from 1 to 10 like this.And on 2nd page. i want (S/N) from 11 to 20.and so on.but on 2nd page also i am getting (S/N) from 1 to 10 only.please help me to solve this. this is my jsp page. <% int startIndex=0; int totalsize=0; Collection OBList = (Collection)request.getAttribute("request.OBAList"); if (OBList != null && OBList.size() > 0) { pageContext.setAttribute("OBList",OBList); } if(request.getAttribute("request.startIndex")!=null) startIndex=Integer.parseInt(request.getAttribute("request.startIndex").toString()); int current_page=startIndex/10; if(startIndex == 10) { startIndex=startIndex+current_page; } %> <logic:present name="OBList"> <% int count = 0;%> <logic:iterate id="OB" name="OBList"type="com.integrosys.course.app.test.bus.OBA" scope="page"> <tr class="<%=count++%2==0?"even":"odd"%>"> <%=count%> <%=OB.getName()%> <%=AProxy.getCountryName(OB.getCountry()) %> <select name="select3" onChange="JumpOnSelectactive(this, '<%=OB.getName()%>')"> Please Select Edit View Delete <html:checkbox property="checkboxes" styleId="ck" value=" <%=OB.getName()%>" ></html:checkbox> <integro:pageindex pageIndex='<%=new PageIndex(startIndex,AProxy.getMaxRecordPage(),AProxy.getAll().size())%>' url='<%="A.do?event=list&startIndex="%>' submitFlag="<%=new Boolean(false)%>"/> this is my command java class String startIndex="0"; try { Object obStartIndex = map.get("startIndex"); if(obStartIndex!=null) { startIndex= obStartIndex.toString(); } c=aProxy.getAll(); //total=c.size(); Collections.sort(((List<OBA>)c),new Comparator<OBA>() { @Override public int compare(OBA o1, OBA o2) { // TODO Auto-generated method stub return o1.getName().compareTo(o2.getName()); } }); c= ((List<OBA>)c).subList(Integer.parseInt(startIndex),Math.min(Integer.parseInt(st artIndex)+ aProxy.getMaxRecordPage(), c.size()) );
type: UnansweredQuestion
has title: How to add index in pagination in jsp using struts 1
tagged with: css
answer count: 0
tagged with: java
type: Question

http://stackoverflow.com/comment/47222221
type: AnswerComment
score: 0
has text: Yes: things before the ":" are search patterns for the attributes, and after the semicolon, the name in which it'll be stored. After the loops you can access the variable through the "out" object. like alert(out['Tel']); or alert(out.Tel); (same thing)
type: Comment
comment on: http://stackoverflow.com/a/29534000

http://stackoverflow.com/q/29623349
score: 1
tagged with: java
upvote count: 1
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47390980
downvote count: 0
has comment: http://stackoverflow.com/comment/47391059
tagged with: jquery
favorite count: 0
tagged with: jcrop
type: UnansweredQuestion
has body: I'm uploading the image file and then previewing on jquery dialog for cropping using jcrop. For small size its working fine but when i'm uploading large file the dialog become stretch. header includes: <script type="text/javascript" src="<html:rewrite page='/scripts/crop/jquery.Jcrop.js'/>"> <script type="text/javascript" src="<html:rewrite page='/scripts/jquery-plugins/jquery-ui-1.10.3.custom.min.js'/>"> <link rel="stylesheet" src="<html:rewrite page='/styles/crop/jquery.Jcrop.css'/>"/> <%--<link rel="stylesheet" type="text/css" src="<html:rewrite page='/styles/crop/jQueryUI.css'/>"/>--%> javascript code: html <html:file name="uf" property="file" size="37" onchange="readFile()" styleId="imageId" /> Here are the images:
answer count: 0
has title: jquery dialog with jcrop size issue

http://stackoverflow.com/comment/47378373
has text: @NietzscheProgrammer You mean, changing the show property too?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29614741

local-storage
tags question: http://stackoverflow.com/q/29651063
tags question: http://stackoverflow.com/q/29546756
tags question: http://stackoverflow.com/q/29687526
tags question: http://stackoverflow.com/q/29648447
tags question: http://stackoverflow.com/q/29567879
tags question: http://stackoverflow.com/q/29568543
tags question: http://stackoverflow.com/q/29629458
tag name: local-storage
tags question: http://stackoverflow.com/q/29631707
tags question: http://stackoverflow.com/q/29637026
type: Tag
tags question: http://stackoverflow.com/q/29592849

http://stackoverflow.com/q/29541409
tagged with: css
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/29541606
possible better answer: http://stackoverflow.com/a/29541651
has answer: http://stackoverflow.com/a/29541654
has answer: http://stackoverflow.com/a/29541651
has comment: http://stackoverflow.com/comment/47235569
has comment: http://stackoverflow.com/comment/47235125
type: Question
has comment: http://stackoverflow.com/comment/47234981
tagged with: javascript
has comment: http://stackoverflow.com/comment/47235461
has comment: http://stackoverflow.com/comment/47234893
accepted answer: http://stackoverflow.com/a/29541606
answer count: 3
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has comment: http://stackoverflow.com/comment/47235130
has comment: http://stackoverflow.com/comment/47234707
tagged with: dom-events
favorite count: 0
linked to: http://stackoverflow.com/q/324486
upvote count: 2
has body: My idea is when I click on the button, the div#x will lose 1% of width. Here is my code: document.querySelector('#a').onclick = function() { var lost = document.querySelector('#x').style.width, lost = lost.slice(0, -1); lost = Number(lost); lost -= 1; document.querySelector('#x').style.width = lost + '%'; } nav#control { display: flex; flex-basis: 50px; align-items: center; justify-content: center; background: #FFF; padding: 5px; width: 100% } .knob { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; cursor: pointer } #b { position: relative; flex-grow: 1; background: #EFEFEF; margin: 0 10px; height: 30px } #x { position: absolute; background: #4C8EFA; width: 100%; height: 30px; border-radius: 1px; z-index: 2 } #c { display: flex; align-items: center; justify-content: center; height: 30px; } background The blue bar (div#x) is supposed to be shorter 1% every time I click on the left button (section#a). I have check so many times but I still don't know what problem with my code. I did change some code and I think that problem is in this line lost = document.querySelector('#x').style.width because it seems like it doesn't return any value which is supposed to gimme 100% width of div#x
has comment: http://stackoverflow.com/comment/47234859
has title: Can't get width property with JavaScript

http://stackoverflow.com/q/29667624
linked to: http://stackoverflow.com/q/6070196
upvote count: 3
accepted answer: http://stackoverflow.com/a/29692109
tagged with: php
linked to: http://stackoverflow.com/q/12301358
possible better answer: http://stackoverflow.com/a/29668699
type: Question
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/47474100
has answer: http://stackoverflow.com/a/29668699
has body: I'm attempting to send the result of two merged html canvases via email. My attempt was to do this by setting the value of an input field in a form with the base64 value of the converted canvas, I would then pass this to a php emailer script where in the message section I would set the source of a html image as the base64 value (as would work in normal html pages). This doesn't seem to work however. My full function for merging the two canvases, converting to an image, downloading the image and then attempting to set the value of is as below function convertImage() { var bottleCanvas = document.getElementById('bottleCanvas'); var designCanvas = document.getElementById('editorCanvas'); var bottleContext = bottleCanvas.getContext('2d'); if($('.colourCanvas500').is(':visible')) { bottleContext.drawImage(designCanvas, 153, 250); } else if($('.colourCanvas600').is(':visible')) { bottleContext.drawImage(designCanvas, 155, 238); } else if($('.whiteCanvas500').is(':visible')) { bottleContext.drawImage(designCanvas, 132, 235); } else if($('.whiteCanvas600').is(':visible')) { bottleContext.drawImage(designCanvas, 132, 235); } var data = bottleCanvas.toDataURL("image/png"); var link = document.createElement('a'); link.download = "bottle-design.png"; var dataLink = bottleCanvas.toDataURL("image/png").replace("image/png", "image/octet-stream"); document.write(dataLink); link.href = dataLink; link.click(); $('#imageInput').val(dataLink); $('form[name="bottleDetails"]').submit(); } How would I go about sending my canvas converted image via email? HTML code for form is as below: Customise your Bottle Name: Email: Company: Bottle Size: 500ml 600ml Bottle Colour: Lid Type: Pull Up Flip Up Quantity: 25-100 100-250 250-500 500+ Email PHP code is as below: <?php if(!empty($_POST['email'])){ $name = $_POST['name']; $email = $_POST['email']; $company = $_POST['company']; $size = $_POST['size']; $colour = $_POST['colour']; $lid = $_POST['lid']; $quantity = $_POST['quantity']; $image = $_PO…
has title: Email HTML Canvas
has comment: http://stackoverflow.com/comment/47475921
tagged with: canvas
answer count: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/47474155
has comment: http://stackoverflow.com/comment/47474431
tagged with: javascript
has answer: http://stackoverflow.com/a/29692109
favorite count: 0
has comment: http://stackoverflow.com/comment/47474287
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29669029
linked to: http://stackoverflow.com/q/7505673
has comment: http://stackoverflow.com/comment/47476717
has comment: http://stackoverflow.com/comment/47474688

http://stackoverflow.com/q/29555155
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47260933
accepted answer: http://stackoverflow.com/a/29555179
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/47260949
has comment: http://stackoverflow.com/comment/47260954
has comment: http://stackoverflow.com/comment/47261005
has body: bg = "http//example.com/img.png"; html = '&lt;div style="background-image:url('+bg+')&gt;' What's wrong with my concatenation above? I did see the img path but the background image doesn't appear.
has answer: http://stackoverflow.com/a/29555179
type: AnsweredQuestion
has title: set background-image to html using js
has comment: http://stackoverflow.com/comment/47260971
possible better answer: http://stackoverflow.com/a/29555201
type: Question
has answer: http://stackoverflow.com/a/29555201
has answer: http://stackoverflow.com/a/29555203
has comment: http://stackoverflow.com/comment/47260992
linked to: http://stackoverflow.com/q/20055541

http://stackoverflow.com/comment/47488729
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29675174
has text: "Field" - I believe you mean by a text field or text area. How are we expecting a javascript in it and that to be run?
type: Comment

http://stackoverflow.com/q/29616920
has answer: http://stackoverflow.com/a/29754702
answer count: 1
has body: I have a need to launch a third party site as a pop-up iFrame. When the buttons are selected in the iFrame (Save, Cancel), the iFrame is not closing. I'm using JavaScript to open it (.modal('show');), but can't seem to execute a .modal('hide') on it. I was looking up event listeners to see if that was feasible. However, it appears I need the form id which I currently don't have and I'm not sure the 3rd party can/would provide, or even if that is a viable solution due to security reasons.
has comment: http://stackoverflow.com/comment/47379084
score: 0
tagged with: iframe
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47421009
tagged with: http://stackoverflow.com/tag/html
has title: How to close a modal when modal is 3rd party iFrame
has comment: http://stackoverflow.com/comment/47379228
type: Question
linked to: http://stackoverflow.com/q/9153445

http://stackoverflow.com/q/29592717
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/29594700
has answer: http://stackoverflow.com/a/29592758
tagged with: http://stackoverflow.com/tag/html
has title: I am trying to hide show menu from an with jquery
type: UnansweredQuestion
tagged with: css
has body: I am trying to show the .list-menu div show on click and then hide on click when the .hamburger anchor is clicked. Right now nothing is happening. $('document').ready(function() { $(".list-menu").hide(); $( ".hamburger" ).click(function() { $( ".list-menu" ).show() { }); $( ".hamburger" ).click(function() { $( ".list-menu" ).hide() { }); }); }); About Me Resume Contact
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29592742

http://stackoverflow.com/q/29634280
tagged with: express
has comment: http://stackoverflow.com/comment/47425331
tagged with: angularjs
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/29619631
tagged with: node.js
linked to: http://stackoverflow.com/q/22336177
has comment: http://stackoverflow.com/comment/47518540
type: Question
has answer: http://stackoverflow.com/a/29722443
has comment: http://stackoverflow.com/comment/47410876
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29728498
has title: What is standard practice for handling user forms and file uploads?
tagged with: javascript
tagged with: file-upload
has body: What is the standard practice for handling data in text fields and file upload fields? The question is similar to one I asked previously, but this one is slightly more general. If we borrow the example of a user registering an account, which includes a name, email, and several file upload fields, the actions taken after form submission amount to: (1) Validate all text fields name, email (2) If validation is success, create and save User instance into DB. (3) Save images to disk (4) Update User instance to include filepaths of saved images. The files uploaded aren't very big, roughly 5mb or less, so problems associated with uploading large 1GB+ files aren't really an issue for this question. From what I've read, there are two ways of handling this. Submit everything all together. There are several unanswered threads about this: https://softwareengineering.stackexchange.com/questions/239170/how-to-parse-multipart-field-file-data-separately Node.js Busboy parse fields and files seperatly I know that the text fields should come before the file fields when submitting the form thanks to mscdex's comment in my other question. But there are other problems I can see: (a) IF validations fail for text fields, that means everything will have to be resent in another form submission. This could potentially lead to a DOS attack/bandwidth issue by having a malicious user continually submit a form with bad text fields, but with lots of files. Submit files when first selected, then when form submits, upload only file hash. (a) A potential DOS attack may happen by having a malicious user upload a ton of images that just sits on the server. Even with an independent bash script that cleans up the /tmp folder after X minutes, a user could still clog the disk space in the X minutes before cleanup by continually sending files. (b) Having an independent script for cleanup creates timing issues. What if a legitimate user keeps sending a form that fails validations, but then after X minutes, …

http://stackoverflow.com/comment/47841414
score: 0
has text: what exactly are you hoping to do?: A) Just be able to `require('legacyModule')` in your browserified modules, or B) also be able to access `window.myVar`?
comment on: http://stackoverflow.com/q/29680352
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29568120
tagged with: refresh
tagged with: tablesorter
tagged with: pagination
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29568393
tagged with: javascript
tagged with: jquery
type: Question
has title: tablesorter pagination doesn't update if I change table from external script
has body: I have following tablesorter configuration: $(function(){ $table = $('#table') .tablesorter({ theme: 'blue', widthFixed: true, headerTemplate: '{content} {icon}', widgets: ['zebra','filter'], widgetOptions: { zebra: ["even", "odd"], // filter_anyMatch replaced! Instead use the filter_external option // Set to use a jQuery selector (or jQuery object) pointing to the // external filter (column specific or any match) filter_external : '.search', // add a default type search to the first name column filter_defaultFilter: { 1 : '~{query}' }, // include column filters filter_columnFilters: true, filter_placeholder: { search : 'Искать...' }, filter_saveFilters : true, filter_reset: '.reset' } }) // needed for pager plugin to know when to calculate filtered rows/pages .addClass('hasFilters') .tablesorterPager({ container: $(".table-pager"), output: '{page} of {filteredPages} ({filteredRows})', size: 5 }); }); It looks so: I have external javascript, which changes table DOM tree. But pagination doesn't update. How can I achieve refresh pagination?
score: 0
answer count: 1

http://stackoverflow.com/comment/47513189
score: 0
type: Comment
has text: But even under jQLite, an unsupported selector shouldn't give "undefined is not a function" .... should it?
type: AnswerComment
comment on: http://stackoverflow.com/a/29687995

http://stackoverflow.com/q/29542834
score: 1
upvote count: 1
duplicate of: http://stackoverflow.com/q/23478891
type: Question
has body: The first tiem I run this it prints "before: null; after: zxcv" as I expect. The second time I run it, it prints the same thing -- why is setting localStorage not persisting to the next run? (PhantomJS 1.9.8 on Windows.) webPage = require ('webpage'); page = webPage.create(); page.open('http://localhost:8080/mysite/', function(status) { var foo; foo = page.evaluate(function() { return localStorage['asdf']; }); console.log("before: " + foo); foo = page.evaluate(function() { localStorage['asdf'] = 'zxcv'; return localStorage['asdf']; }); console.log("after: " + foo); phantom.exit(); });
tagged with: javascript
has title: Confused about PhantomJS localStorage behavior
has comment: http://stackoverflow.com/comment/47238018
has comment: http://stackoverflow.com/comment/47237821
downvote count: 0
has comment: http://stackoverflow.com/comment/47238951
favorite count: 0
type: UnansweredQuestion
tagged with: phantomjs
linked to: http://stackoverflow.com/q/23478891
answer count: 0

http://stackoverflow.com/q/29591037
answer count: 2
possible better answer: http://stackoverflow.com/a/29591057
tagged with: javascript
has body: I need to set the values of the slider when it is created, how can I do it? Example: &lt;div class="slider" data-min-value="0" data-max-value="120"&gt;&lt;input type="range"&gt;&lt;/div&gt; $('.slider').slider({ range: true, create: function(event, ui) { console.log($(this).data('minValue')); ui.values[0] = $(this).data('minValue'); ui.values[1] = $(this).data('maxValue'); }, }) But ui is empty.
tagged with: jquery
has answer: http://stackoverflow.com/a/29591057
upvote count: 1
favorite count: 0
has title: Set custom values from element data-attribute in slider jquery ui
has answer: http://stackoverflow.com/a/29591106
accepted answer: http://stackoverflow.com/a/29591106
type: AnsweredQuestion
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47329137
type: Question

http://stackoverflow.com/comment/47518483
has text: Can you show more code here since this isn't making sense? Please include the entire test file.
score: 0
comment on: http://stackoverflow.com/q/29676200
type: Comment
type: QuestionComment

playframework-2.0
tags question: http://stackoverflow.com/q/29580202
type: Tag
tag name: playframework-2.0

http://stackoverflow.com/comment/47224405
type: Comment
has text: what problem you are facing?
comment on: http://stackoverflow.com/q/29535939
score: 0
type: QuestionComment

http://stackoverflow.com/q/29626613
score: 1
has title: Datatable- converting string to date type filter error
has comment: http://stackoverflow.com/comment/47399582
has answer: http://stackoverflow.com/a/29905604
has comment: http://stackoverflow.com/comment/47401145
accepted answer: http://stackoverflow.com/a/29905604
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: datatables
tagged with: datatable
favorite count: 0
upvote count: 1
has body: I have 5 columns in my table, the second being a string that acts as a date type (12 Jan 14), so when it filters, it only filters based on the the day rather than year, then month, then day. Keep in mind, I can't change the type to date as this is part of a larger project. I'm using datatables.net and new to it so any help would be appreciated, so my question being can someone convert the string to a date type and filter? &lt;script type="text/javascript" language="javascript" class="init"&gt; var mSortingString = []; var disableSortingColumn = 4; mSortingString.push({ "bSortable": false, "aTargets": [disableSortingColumn] }); $(document).ready(function () { $('#table').dataTable({ "paging": false, "ordering": true, "info": false, "aaSorting": [], "orderMulti": false, "aoColumnDefs": mSortingString }); }); &lt;/script&gt;
type: Question
type: AnsweredQuestion

http://stackoverflow.com/comment/47342063
has text: Could you please comment on the code lines that what you want to perform with those lines?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29597694

http://stackoverflow.com/comment/47288440
score: 0
type: QuestionComment
type: Comment
has text: @Sean Yes, I am sure q is not null, I just couldn't show its value here, if you tried to edit this question you will see full code.
comment on: http://stackoverflow.com/q/29569433

http://stackoverflow.com/comment/47289711
type: Comment
has text: Without diving too deep into `socket.io`, I assume that the server sends the id to the client as part of the connection setup protocol.
type: AnswerComment
comment on: http://stackoverflow.com/a/29569910
score: 0

http://stackoverflow.com/q/29671090
tagged with: mobile
has comment: http://stackoverflow.com/comment/47493232
downvote count: 0
tagged with: javascript
tagged with: passport.js
tagged with: express
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47494111
tagged with: node.js
answer count: 0
has body: I have built an e-commerce website using express.js. The authentication method used is passport.js. We store the cookie with all the information we need in redis. Everything was fine until we started driving more traffic. Now the problem When user A comes to the site, logs in and makes a purchase, every day or two 2-3 customer details are wrong. User A comes to the site and make a purchase. The email and address of the user A sometimes becomes the email and address of user B We cannot easily replicate this as this happens only once in 50 purchases.or sometimes twice in 50 purchases. So I had to call all my contacts and check what is the wrong thing we have done. And curiously one guy replied me that he also have the same issue. He is saying it the problem with passport.js, and he wrote custom authentication method to remove passport and till now he has not faced any issue. He also uses exactly my set up. NODE-EXPRESS-REDIS I am quoting his words here Whenever a user logs in from one computer, open the site in another computer then refresh the page, You can see the logged in details of the first user in second computer, and this issue is not frequent but it comes once in a while
upvote count: 1
type: Question
score: 1
has title: Session ID is duplicated, swapping the user details
has comment: http://stackoverflow.com/comment/47489988

http://stackoverflow.com/q/29675523
upvote count: 1
has body: I'm building a website (using python with django) in which you can access a users page and request something from them, but that functionality is only available for logged in users, whereas not logged in users can still see the page but not the form to send the requests. What would be the best practice for that: -loading a different template when that view is requested directly on the server or -using javascript to change what is in the place where the 'request form' would be after verifying if user is logged in or not? thanks
tagged with: django
downvote count: 1
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/29675953
accepted answer: http://stackoverflow.com/a/29675953
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29675770
score: 0
answer count: 3
linked to: http://stackoverflow.com/q/5450024
has answer: http://stackoverflow.com/a/29675780
tagged with: python
favorite count: 0
has answer: http://stackoverflow.com/a/29675770
has title: Different page for logged in vs not logged in user on server vs javascript

parsing
tags question: http://stackoverflow.com/q/29655780
tags question: http://stackoverflow.com/q/29666532
tags question: http://stackoverflow.com/q/29601608
tags question: http://stackoverflow.com/q/29658039
tag name: parsing
tags question: http://stackoverflow.com/q/29546626
tags question: http://stackoverflow.com/q/29608168
type: Tag
tags question: http://stackoverflow.com/q/29579874
tags question: http://stackoverflow.com/q/29565102
tags question: http://stackoverflow.com/q/29674650
tags question: http://stackoverflow.com/q/29573969
tags question: http://stackoverflow.com/q/29620393
tags question: http://stackoverflow.com/q/29665353
tags question: http://stackoverflow.com/q/29628752

http://stackoverflow.com/q/29626073
has comment: http://stackoverflow.com/comment/47395811
answer count: 1
favorite count: 0
has title: Model.Isvalid getting failed in my MVC 4 application. How do fix this?
has comment: http://stackoverflow.com/comment/47447587
has comment: http://stackoverflow.com/comment/47397276
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47395839
has body: I have one view and that view contains create user and log in forms. For both i have different models. When user clicks on Register button i will pass register model values and for log in click i pass log in model values.I have added some validation in model also (You can see it my code below). Since i have two model i have added one more model(Account) which holds both this model.Am passing this model(Account) from view to controller on click of register or log in. The reason why Model is invalid all the time is, when user clicks on log in button am passing account model which has both Register and log in model but with only log in details .All the values for register model will be null since user clicked on log in (Only log in data will be there). So in controller Model.Is valid is always false since no values are there for register model. So is there any other way to validate a particular model ? What is the solution in this case? @model Selfie.Models.Account @using (Html.BeginForm()) { @Html.TextBoxFor( model => model.RegisterModel.FirstName,null, new {@class="form-control",id="fn", placeholder=" First Name",required="true",maxlength="20"}) @Html.ValidationMessageFor(model => model.RegisterModel.FirstName) @Html.TextBoxFor(model => model.RegisterModel.LastName,null, new { @class = "form-control",id="ln", placeholder=" Last Name",required="true",maxlength="20"}) @Html.ValidationMessageFor(model => model.RegisterModel.LastName) Create Account } //Login @using (Html.BeginForm("Login", "Selfie", FormMethod.Post, new { })) { @Html.TextBoxFor(model => model.LoginModel.UserName,null, new { @class = "form-control",id="lem"}) @Html.ValidationMessageFor(model => model.LoginModel.UserName) @Html.TextBoxFor(model => model.LoginModel.Pwd,null, new { @class = "form-control"}) @Html.ValidationMessageFor(model => model.LoginModel.Pwd) Log In } //Controller [HttpPost] public ActionResult Register(Account registration) { if(Model.Isvalid) { string a= Account.fname; } } [HttpPost]…
has answer: http://stackoverflow.com/a/29626345
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47396089
has comment: http://stackoverflow.com/comment/47395407
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/47396847
tagged with: asp.net-mvc
tagged with: .net
tagged with: javascript
has comment: http://stackoverflow.com/comment/47395909
upvote count: 1
has comment: http://stackoverflow.com/comment/47395637

meteor
tags question: http://stackoverflow.com/q/29616065
tags question: http://stackoverflow.com/q/29546424
tags question: http://stackoverflow.com/q/29574101
tags question: http://stackoverflow.com/q/29647992
tags question: http://stackoverflow.com/q/29549839
tags question: http://stackoverflow.com/q/29621863
tags question: http://stackoverflow.com/q/29579752
tags question: http://stackoverflow.com/q/29583115
tags question: http://stackoverflow.com/q/29576601
tags question: http://stackoverflow.com/q/29539189
tags question: http://stackoverflow.com/q/29650446
tags question: http://stackoverflow.com/q/29610997
tags question: http://stackoverflow.com/q/29573001
tags question: http://stackoverflow.com/q/29617530
tags question: http://stackoverflow.com/q/29552094
tags question: http://stackoverflow.com/q/29556993
tags question: http://stackoverflow.com/q/29576649
tags question: http://stackoverflow.com/q/29670651
tags question: http://stackoverflow.com/q/29640625
tags question: http://stackoverflow.com/q/29556078
tags question: http://stackoverflow.com/q/29677016
tags question: http://stackoverflow.com/q/29600194
tags question: http://stackoverflow.com/q/29578833
tags question: http://stackoverflow.com/q/29589618
tags question: http://stackoverflow.com/q/29596408
tags question: http://stackoverflow.com/q/29588728
tags question: http://stackoverflow.com/q/29535766
tags question: http://stackoverflow.com/q/29653665
tags question: http://stackoverflow.com/q/29581291
tags question: http://stackoverflow.com/q/29589154
tags question: http://stackoverflow.com/q/29538251
tags question: http://stackoverflow.com/q/29657533
tags question: http://stackoverflow.com/q/29645930
tags question: http://stackoverflow.com/q/29612981
tags question: http://stackoverflow.com/q/29600258
tags question: http://stackoverflow.com/q/29650970
tags question: http://stackoverflow.com/q/29591194
tags question: http://stackoverflow.com/q/29683474
tags question: http://stackoverflow.com/q/29640965
tags question: http://stackoverflow.com/q/29593017
type: Tag
tags question: http://stackoverflow.com/q/29573008
tags question: http://stackoverflow.com/q/29556912
tags question: http://stackoverflow.com/q/29617844
tags question: http://stackoverflow.com/q/29542634
tags question: http://stackoverflow.com/q/29635530
tags question: http://stackoverflow.com/q/29533171
tags question: http://stackoverflow.com/q/29641220
tags question: http://stackoverflow.com/q/29593305
tags question: http://stackoverflow.com/q/29675121
tags question: http://stackoverflow.com/q/29613882
tags question: http://stackoverflow.com/q/29666029
tags question: http://stackoverflow.com/q/29590886
tags question: http://stackoverflow.com/q/29630771
tags question: http://stackoverflow.com/q/29536618
tags question: http://stackoverflow.com/q/29587914
tags question: http://stackoverflow.com/q/29581518
tags question: http://stackoverflow.com/q/29686453
tags question: http://stackoverflow.com/q/29655670
tags question: http://stackoverflow.com/q/29631304
tags question: http://stackoverflow.com/q/29595963
tags question: http://stackoverflow.com/q/29559391
tags question: http://stackoverflow.com/q/29535526
tags question: http://stackoverflow.com/q/29655251
tags question: http://stackoverflow.com/q/29534485
tags question: http://stackoverflow.com/q/29682033
tags question: http://stackoverflow.com/q/29566614
tag name: meteor
tags question: http://stackoverflow.com/q/29535423
tags question: http://stackoverflow.com/q/29650894
tags question: http://stackoverflow.com/q/29572192

http://stackoverflow.com/a/29604759
answers question: http://stackoverflow.com/q/29603304
downvote count: 0
type: Answer
score: 1
has body: I find this really bizarre, when I edit your create function like below. It works even when the callback function is empty. I'll have to look a bit more, but this could be a bug that needs to be reported. return Category.create(categories, function(err, returnModel) { sails.log.debug('This should work!!! -- Error : ' + err + 'model : ' + returnModel); });
upvote count: 1

http://stackoverflow.com/q/29640043
has comment: http://stackoverflow.com/comment/47422078
has comment: http://stackoverflow.com/comment/47422341
type: Question
has answer: http://stackoverflow.com/a/29640402
has comment: http://stackoverflow.com/comment/47422361
tagged with: javascript
has answer: http://stackoverflow.com/a/29640158
upvote count: 3
has comment: http://stackoverflow.com/comment/47422066
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47422102
downvote count: 1
tagged with: css
has title: Make a div to fill the rest of the available screen height
favorite count: 0
has comment: http://stackoverflow.com/comment/47422006
has comment: http://stackoverflow.com/comment/47422196
has comment: http://stackoverflow.com/comment/47422096
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29640843
has body: I have this structure: I would like to make content2's min-height = height of screen - height of other divs. With the HTML/CSS below, the outcome is greater than the screen height. So How can I do what I wanted? The copyright part (footer) is inside the content2, so I want to make the content2's height to be exact in the screen. body { margin:0; border:0; background-color:#24373B; color: #fff; } #headerBG { min-width:980px; background-color:#000; } #header { width:980px; } #content1 { width:980px; } #content2 { width:960px; padding:10px; margin-top:30px; background-color:#355258; min-height:100hv; } header content1 content2
score: 2
has comment: http://stackoverflow.com/comment/47422474

http://stackoverflow.com/comment/47422474
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29640043
has text: The Uknown, It still greater than the screen's height.

http://stackoverflow.com/comment/47238038
score: 0
type: Comment
type: QuestionComment
has text: Refer to http://stackoverflow.com/questions/610995/cant-append-script-element
comment on: http://stackoverflow.com/q/29543086

http://stackoverflow.com/comment/47255699
type: Comment
type: QuestionComment
has text: @SumitSagar well, have you tested my example?
comment on: http://stackoverflow.com/q/29551944
score: 0

http://stackoverflow.com/a/29563373
type: AcceptedAnswer
upvote count: 1
type: Answer
accepted answer of: http://stackoverflow.com/q/29563163
downvote count: 0
answers question: http://stackoverflow.com/q/29563163
score: 1
has body: You should use mouseenter and mouseleave events if using jQuery. mouseover and mouseout functions do not bubble from child to parent, so you end up triggering a mouseout event when you hover the child elements.

http://stackoverflow.com/comment/47327588
has text: Well, you've read the other post and all answers on it, but what did you try then? Please show us your attempt at using callbacks or promises (or whatever)
comment on: http://stackoverflow.com/q/29589758
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29680163
possible better answer: http://stackoverflow.com/a/47673606
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29681278
accepted answer: http://stackoverflow.com/a/29681278
has comment: http://stackoverflow.com/comment/47497895
tagged with: asp.net
has body: On my Login page only I am getting 18 JavaScript errors and the main one seems to be: 'ASP.NET Ajax client-side framework failed to load.' I have a feeling it has to do with security since I just recently added Forms Authentication to the site. If I login all errors go away. It seems like sys is undefined when this line tries to run : if (typeof(Sys) === 'undefined') throw new Error('ASP.NET Ajax client-side framework failed to load.'); I have the following in my Web.config: &lt;authentication mode="Forms"&gt; &lt;forms name=".FormsAuthCookie" loginUrl="Security/Login" protection="All" timeout="120" cookieless="AutoDetect" /&gt; &lt;/authentication&gt; &lt;authorization&gt; &lt;deny users="?"/&gt; &lt;/authorization&gt; THE MAIN PROBLEM after adding deny users="?": ASP.NET Ajax client-side framework is failing to load on my Login.aspx page when an anonymous user visits the site. UPDATE::: This really doesn't make much sense but after adding EnableCdn="true" to my script manager I do not get any errors when an anonymous user visits the login page.... It just seems like it is a hack for whatever my actual problem is since this is a clean .net webforms project. &lt;asp:ScriptManager runat="server" EnableCdn="True"&gt;
has title: ASP.NET Forms Authentication - JavaScript errors on Login page (when anonymous users visit)
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/47673606
tagged with: forms-authentication
tagged with: c#
tagged with: javascript
has comment: http://stackoverflow.com/comment/47497541
tagged with: webforms

http://stackoverflow.com/a/29622286
has body: Avoid eval whenever possible. For this example, a simple switch...case statement will be sufficient: var x = 5; var y = 5; var z; var p = "+"; switch (p) { case "+": z = x + y; break; case "-": z = x - y; break; } You can also use a map of functions: var fnlist = { "+": function(a, b) { return a + b; }, "-": function(a, b) { return a - b; } } var x = 5; var y = 5; var p = "+"; var z = fnlist[p](x, y);
has comment: http://stackoverflow.com/comment/47388883
type: Answer
upvote count: 15
downvote count: 0
score: 15
answers question: http://stackoverflow.com/q/29622198

http://stackoverflow.com/a/29663939
score: 0
has body: It looks to me like the rows object is undefined to indicate that there are no users with the given email address. You could change the query to select count(*) as num from users where email = $1. This would ensure a result, and you can test if result.rows[0].num == 0.
has comment: http://stackoverflow.com/comment/47467221
has comment: http://stackoverflow.com/comment/47467686
type: Answer
has comment: http://stackoverflow.com/comment/47467274
answers question: http://stackoverflow.com/q/29663883

http://stackoverflow.com/comment/47474080
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29665353
has text: @RobG It's not good to generalise like that. First of all, we're apparently talking about a nodejs app here; code size is hardly an issue there. Secondly, I'm currently working on an SPA which literally contains 1.5 MBs of libraries; but it has a very special purpose, is doing very complex things, and the page is intended to stay up all day in the browser, so the initial load time doesn't matter at all.
score: 0

http://stackoverflow.com/q/29534030
has answer: http://stackoverflow.com/a/29534262
type: Question
linked to: http://stackoverflow.com/q/6625773
has title: Code only works in jsfiddle
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47221011
accepted answer: http://stackoverflow.com/a/29534185
has comment: http://stackoverflow.com/comment/47221038
has answer: http://stackoverflow.com/a/29534101
tagged with: http://stackoverflow.com/tag/html
has body: I have a problem with some code. It only runs in jsfiddle and i dont know why it's not working in codepen or in files. Why does this code only works in jsfiddle? I tried it in codepen and just in files but it doesnt show anything http://jsfiddle.net/auagufL8/ $(function () { // Prepare demo data var data = [ { "hc-key": "nl-fr", "value": 0 }, { "hc-key": "nl-gr", "value": 1 }, { "hc-key": "nl-fl", "value": 2 }, { "hc-key": "nl-ze", "value": 3 }, { "hc-key": "nl-nh", "value": 4 }, { "hc-key": "nl-zh", "value": 5 }, { "hc-key": "nl-dr", "value": 6 }, { "hc-key": "nl-ge", "value": 7 }, { "hc-key": "nl-li", "value": 8 }, { "hc-key": "nl-ov", "value": 9 }, { "hc-key": "nl-nb", "value": 10 }, { "hc-key": "nl-ut", "value": 11 } ]; // Initiate the chart $('#container').highcharts('Map', { title : { text : 'Highmaps basic demo' }, subtitle : { text : 'Source map: The Netherlands' }, mapNavigation: { enabled: true, buttonOptions: { verticalAlign: 'bottom' } }, colorAxis: { min: 0 }, series : [{ data : data, mapData: Highcharts.maps['countries/nl/nl-all'], joinBy: 'hc-key', name: 'Random data', states: { hover: { color: '#BADA55' } }, dataLabels: { enabled: true, format: '{point.name}' } }] }); }); #container { height: 500px; min-width: 310px; max-width: 800px; margin: 0 auto; } .loading { margin-top: 10em; text-align: center; color: gray; }
answer count: 4
has comment: http://stackoverflow.com/comment/47221035
favorite count: 0
has answer: http://stackoverflow.com/a/29534076
upvote count: 1
tagged with: css
type: AnsweredQuestion
score: 1
possible better answer: http://stackoverflow.com/a/29534076
has answer: http://stackoverflow.com/a/29534185

forms
tags question: http://stackoverflow.com/q/29580402
tags question: http://stackoverflow.com/q/29582831
tags question: http://stackoverflow.com/q/29600440
tags question: http://stackoverflow.com/q/29658595
tags question: http://stackoverflow.com/q/29608139
tags question: http://stackoverflow.com/q/29625379
tags question: http://stackoverflow.com/q/29648073
tags question: http://stackoverflow.com/q/29570299
tags question: http://stackoverflow.com/q/29630587
tags question: http://stackoverflow.com/q/29628807
tags question: http://stackoverflow.com/q/29643447
tags question: http://stackoverflow.com/q/29661300
tags question: http://stackoverflow.com/q/29576548
tags question: http://stackoverflow.com/q/29552644
tags question: http://stackoverflow.com/q/29581370
tags question: http://stackoverflow.com/q/29628664
tags question: http://stackoverflow.com/q/29667866
type: Tag
tags question: http://stackoverflow.com/q/29651278
tags question: http://stackoverflow.com/q/29638093
tags question: http://stackoverflow.com/q/29590015
tags question: http://stackoverflow.com/q/29567932
tags question: http://stackoverflow.com/q/29661463
tags question: http://stackoverflow.com/q/29668487
tags question: http://stackoverflow.com/q/29549744
tags question: http://stackoverflow.com/q/29588487
tags question: http://stackoverflow.com/q/29589371
tags question: http://stackoverflow.com/q/29660939
tags question: http://stackoverflow.com/q/29601982
tags question: http://stackoverflow.com/q/29678785
tags question: http://stackoverflow.com/q/29669976
tags question: http://stackoverflow.com/q/29687356
tags question: http://stackoverflow.com/q/29638832
tags question: http://stackoverflow.com/q/29622940
tags question: http://stackoverflow.com/q/29626734
tags question: http://stackoverflow.com/q/29680920
tags question: http://stackoverflow.com/q/29664137
tags question: http://stackoverflow.com/q/29610026
tags question: http://stackoverflow.com/q/29614368
tags question: http://stackoverflow.com/q/29536840
tags question: http://stackoverflow.com/q/29558613
tags question: http://stackoverflow.com/q/29576901
tags question: http://stackoverflow.com/q/29684251
tags question: http://stackoverflow.com/q/29656877
tags question: http://stackoverflow.com/q/29646058
tags question: http://stackoverflow.com/q/29627136
tags question: http://stackoverflow.com/q/29559209
tags question: http://stackoverflow.com/q/29575374
tags question: http://stackoverflow.com/q/29652723
tags question: http://stackoverflow.com/q/29581707
tags question: http://stackoverflow.com/q/29684215
tags question: http://stackoverflow.com/q/29618123
tags question: http://stackoverflow.com/q/29582824
tag name: forms
tags question: http://stackoverflow.com/q/29632711
tags question: http://stackoverflow.com/q/29535147
tags question: http://stackoverflow.com/q/29600094
tags question: http://stackoverflow.com/q/29625290
tags question: http://stackoverflow.com/q/29615688
tags question: http://stackoverflow.com/q/29634205
tags question: http://stackoverflow.com/q/29623887
tags question: http://stackoverflow.com/q/29685589
tags question: http://stackoverflow.com/q/29590822
tags question: http://stackoverflow.com/q/29612886
tags question: http://stackoverflow.com/q/29659561
tags question: http://stackoverflow.com/q/29597479
tags question: http://stackoverflow.com/q/29628271
tags question: http://stackoverflow.com/q/29535467
tags question: http://stackoverflow.com/q/29677076
tags question: http://stackoverflow.com/q/29654046

http://stackoverflow.com/comment/47361485
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29607956
has text: thanks for the reply. I can understand if the requirement was to disable the users javascript indefinatly. However, I would just like to disable it for a single page load/session. I was wondering if I could get javascript to throw an error and stop parsing the rest of the page. Its just to allow me to disable it with a checkbox, in page.
score: 0

http://stackoverflow.com/a/29598654
score: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29531782
type: Answer
answers question: http://stackoverflow.com/q/29531782
upvote count: 1
has body: "It seems like you're trying to run ES6 syntax in a non-ES6 environment" @milkywayjoe You were in the right direction but the bigger question was exactly what syntax caused the error? I ended up doing a ember new project, then comparing file by file and the only thing that stood out was a change in the import method. I was using a strict import: import 'project/utils/plugins'; but the relative import seems to be the only thing that works import '../utils/plugins'; I was able to find one other person with this issue and it seems they also came to the same result. Addon not working He mentions the Ember apps namespace but more specifically the modulePrefix thats set up in the config file. This seems to be the only solution for this error right now.

http://stackoverflow.com/a/29656056
score: 1
answers question: http://stackoverflow.com/q/29655752
upvote count: 1
has body: json string can't contain functions, constructors ... I think what you need to do is to define a class where you can find all the methods you need, and then you can instanciate your object from the json data you get. here is a simple example : function Stats (options) { this.a = options.a; this.b = options.b; this.toString = function () { return this.a + ' ' + this.b; }; this.toJSON = function () { return { a : this.a , b : this.b }; }; // Methods return this; } in this case , whenever you get your json data, you just need to instanciate your object var stats = new Stats (JSON); console.log(stats.toString());
type: Answer
downvote count: 0

http://stackoverflow.com/comment/47364362
has text: Thanks for your answer, but as you can see, I have already found something that works.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29609056
score: 0

http://stackoverflow.com/q/29581370
has answer: http://stackoverflow.com/a/29581992
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47312175
has comment: http://stackoverflow.com/comment/47311150
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47311290
upvote count: 0
has comment: http://stackoverflow.com/comment/47311337
has title: jQuery submit by form id conditions not working
possible better answer: http://stackoverflow.com/a/29581992
has answer: http://stackoverflow.com/a/29581573
accepted answer: http://stackoverflow.com/a/29581573
downvote count: 1
has comment: http://stackoverflow.com/comment/47311404
type: AnsweredQuestion
has body: I have html form and want to make a validation by submitting the form with its specific id and validate it using jquery. Here is my code: HTML For this example, i want to get the value of the javascript variable 'url' within the jQuery condition submit. Thanks in advance :)
has comment: http://stackoverflow.com/comment/47311386
tagged with: javascript
score: -1
tagged with: forms
has comment: http://stackoverflow.com/comment/47311444
type: Question
has comment: http://stackoverflow.com/comment/47311320
answer count: 2
has comment: http://stackoverflow.com/comment/47311237
has comment: http://stackoverflow.com/comment/47311293

http://stackoverflow.com/a/29609645
has comment: http://stackoverflow.com/comment/47408067
type: AcceptedAnswer
downvote count: 0
has body: You've really 'melded' the two viewModels together... instead I would 'composite' them together, something like this: var PermitsViewModel = function(permits) { // Permits functionality and observables here } var SupervisorsViewModel = function(supervisors) { // Supervisors functionality and observables here } var ProjectModel = function(supervisors, permits) { var self = this; self.supervisorsViewModel = new SupervisorsViewModel(supervisors); self.permitsViewModel = new PermitsViewModel(permits); }; var viewModel = new ProjectModel(supervisorJSONArray,permitJSONArray); ko.applyBindings(viewModel); You could then use 'with' statements in the view to reference the appropriate view model.
has comment: http://stackoverflow.com/comment/47408041
type: Answer
accepted answer of: http://stackoverflow.com/q/29572088
has comment: http://stackoverflow.com/comment/47407028
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/29572088

http://stackoverflow.com/comment/47308599
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29579208
has text: Regarding @jfriend00 comment, I believe that heroku does proxy the application because it assigns every application a random subdomain of herokuapp.com, e.g. some-app-3213.herokuapp.com/path/to/resource.

http://stackoverflow.com/q/29611726
tagged with: javascript
tagged with: base64
upvote count: 2
has answer: http://stackoverflow.com/a/29612476
accepted answer: http://stackoverflow.com/a/29612476
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has body: I am trying to build some kind of branding tool, which adds a branding to a chosen image and lets the user download the image again. This works perfectly fine on many Browsers, but Opera and IE throw a security Error which makes me think that soon other browsers might throw errors too. Fiddle: http://jsfiddle.net/2rL8afe0/9/ Commenting out the line makes the code work: ctx.drawImage(branding, 0, 0, 30, 30); The reason is probably some false negative on cross site scripting since my app works on client side. Any Ideas how to fix this?
has title: Security violation on Canvas.ToDataUrl with Base64 Image
type: AnsweredQuestion
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47369495
has comment: http://stackoverflow.com/comment/47372739
has comment: http://stackoverflow.com/comment/47369668
type: Question
has comment: http://stackoverflow.com/comment/47369283
tagged with: canvas
has comment: http://stackoverflow.com/comment/47369324
tagged with: cross-site

http://stackoverflow.com/comment/47218988
has text: @JoshuaFrederic logically if the user does not uses Chrome than you can activate the other part of the script that uses AJAX and php to get 100 by 100 fragments of audio.
type: Comment
comment on: http://stackoverflow.com/a/29532869
type: AnswerComment
score: 0

http://stackoverflow.com/q/29578187
tagged with: jquery
has answer: http://stackoverflow.com/a/30034294
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: This is driving me crazy. If you have navigation with anchors on the same page, when popstate is invoked, the browser will naturally take you back/forward to the location of that link in your history. It would be assumed that you could disable the hash jump from happening as you would in a click event via e.preventDefault(); - but that has not been the case thus far. In most modern browsers, I have been able to hack an override by storing something like $(window).scrollTop(); in a variable and calling it back inside the popstate: $window.scrollTop(somevar); However in Safari, this workaround causes a quick blip or flash of the original anchor location before relocation to the specified scrollTop - which makes it a non solution After trying various ideas, it seems that the only way to achieve what I need is to find a way to make Safari treat those anchors the way Chrome or FF does, or somehow disable them entirely on a popstate idea. Here's sample of the previously mentioned override (works in chrome, FF etc) var scrollY; $(window).on('scroll', function(e) { scrollY = $window.scrollTop(); }); $(window).on('popstate', function(e) { // some other page location, not the history #hash $(window).scrollTop(scrollY); });
favorite count: 0
accepted answer: http://stackoverflow.com/a/30034294
tagged with: safari
tagged with: html5-history
type: AnsweredQuestion
score: 1
upvote count: 1
has title: Disable / override anchor jump from a popstate event in Safari
type: Question
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/47227263
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29536430
has text: Maybe I wasn't very clear, but I want to keep the words in the same place as they were, and keep DOM structure. So my page should look the same but the words are with different color
type: Comment

http://stackoverflow.com/q/29566238
has comment: http://stackoverflow.com/comment/47282326
has title: JavaScript Controlling users input for feet and inches
type: Question
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/1181700
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/47282229
has answer: http://stackoverflow.com/a/29566956
has comment: http://stackoverflow.com/comment/47282539
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/47283367
tagged with: http://stackoverflow.com/tag/html
has body: I have a regular expression to validate Feet and inches entered into a feet input field. RegEX ^([1-2]?[0-9]{1,3})\'([0-9]|[0-1]{2})\"$ HTML Feet: jQuery or $('#ft').mask('???0\'0?0"',{placeholder:'0\'0"'}); What if the optional characters are in the beginning? And you have two spots that are optional? What I am trying to do: Is when the user gets to the page in that text box it will already read 0'00" so then when they start filling it out it will just start filling it out keeping the " ' " and " " " already in the box for them. On the feet side going up to 2000 and on the inches side only allowing up to number 11. I am having trouble either inserting a mask like 0'00" or what to have the symbols stay there and them to start entering from left to right. Any assistance would be greatly appreciated!
has comment: http://stackoverflow.com/comment/47282131
tagged with: regex
accepted answer: http://stackoverflow.com/a/29566956

camanjs
type: Tag
tags question: http://stackoverflow.com/q/29599056
tag name: camanjs
tags question: http://stackoverflow.com/q/29573754
tags question: http://stackoverflow.com/q/29585484
tags question: http://stackoverflow.com/q/29643147

http://stackoverflow.com/a/31734467
answers question: http://stackoverflow.com/q/29614107
downvote count: 0
type: Answer
has body: I created an AngularJS+KeystoneJS Skeleton starter app which should help you get started if you want to use MEAN with KeystoneJS: https://github.com/dvdcastro/keystonejs-ng-skeleton It shows how to have several angularjs projects served using keystone infrastructure. I chose this solution because jade is a very powerful template engine which will allow you to do more with angular.
upvote count: 1
score: 1

http://stackoverflow.com/comment/47428657
comment on: http://stackoverflow.com/q/29643849
has text: possible duplicate of [Angular: calling controller function inside a directive link function using &](http://stackoverflow.com/questions/16839259/angular-calling-controller-function-inside-a-directive-link-function-using)
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29683582
score: 1
has body: Setting document.location.href will always load the code in the current page. Try: onclick="window.open($(this).attr('href')+$('#suffix4').val()); return false;"
accepted answer of: http://stackoverflow.com/q/29683446
has comment: http://stackoverflow.com/comment/47504195
answers question: http://stackoverflow.com/q/29683446
upvote count: 1
has comment: http://stackoverflow.com/comment/47504303
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47504008
type: Answer
downvote count: 0

http://stackoverflow.com/q/29626634
type: Question
answer count: 2
tagged with: validation
tagged with: javascript
has answer: http://stackoverflow.com/a/29626731
has answer: http://stackoverflow.com/a/29626740
score: 0
has body: I am new in javascript and I have been stumped by this problem. I have been through a lot of the prior posts and perhaps missed the answer but my question is a bit different, I have a form which I need to validate the user's input entries, most of the entries are numbers in the same range, another is % so it must be between 1 and 100 (the formula divides it by 100 so the user does not put in a decimal. Actually between 1 and 10 (10% is the max) My html for one of the inputs is: &lt;input style="" name="size" id="size" class="inp" value="25000" onblur="sqftvalidate();"&gt; (If I need to post the entire page or table, please let me know) the function is: &lt;script&gt; /* Test function with size input line 499 */ function sqftvalidate(x) { if(isNaN(x)||x&lt;1000||x&gt;100000) { alert("Value good "); // to test if validation is working //docalculation(); this is the function to call if the validation is good return true; } else { alert("Value must be between 1,000 and 1,000,000"); return false; } } &lt;/script&gt; &lt;!-- validate input functions end --&gt;
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47396468
has title: Javascript validation error

http://stackoverflow.com/q/29593944
answer count: 6
favorite count: 0
has title: css media query adding class to HTML
has answer: http://stackoverflow.com/a/29594024
has answer: http://stackoverflow.com/a/29594104
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29593977
tagged with: css
upvote count: 11
type: UnansweredQuestion
score: 11
has body: I have this HTML: Link Name I am then using this media query in my CSS: @media (max-width: 1000px) { ... } how can i change my tag to: when the media query takes effect?
has answer: http://stackoverflow.com/a/29594124
has answer: http://stackoverflow.com/a/71926158
type: Question
has answer: http://stackoverflow.com/a/54618482
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/47508569
type: Comment
has text: Very nice edit, and somewhat sadening, yet thank you! And if that is true @slebetman, then I am glad I found you guys. I'd like to think that I know about 99% of JavaScript knowledge myself. I am mostly puzzled at the idea of the `let` statement where, within an `if` statement, only retains block level scope. In this sense, how could there be no way to access said block level scope in javascript. I plan to edit my question.
comment on: http://stackoverflow.com/a/29684914
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47390318
type: Comment
comment on: http://stackoverflow.com/a/29620030
has text: java.lang.StringIndexOutOfBoundsException: String index out of range: -1 java.lang.String.substring(String.java:1954) uploadImage2.processRequest(uploadImage2.java:86) uploadImage2.doPost(uploadImage2.java:255) javax.servlet.http.HttpServlet.service(HttpServlet.java:644) javax.servlet.http.HttpServlet.service(HttpServlet.java:725) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
type: AnswerComment
score: 0

http://stackoverflow.com/q/29532933
tagged with: angularjs
has body: When running an angularjs application, the user access may be withdrawn from the server side. In this case, every request results in a http 302 redirect and a login html (no partial) page. Since angular does expect whatever it was requesting in case the access would still be given, it breaks as it may expect a json string but gets the html login page. Is there anything I can do do catch this event (listen to redirects, figure out whether html is returned, etc) and do a "hard" refresh of the redirect url?
tagged with: http-redirect
has answer: http://stackoverflow.com/a/29533128
upvote count: 1
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/18737674
has answer: http://stackoverflow.com/a/29533161
possible better answer: http://stackoverflow.com/a/29533128
score: 0
linked to: http://stackoverflow.com/q/21230417
tagged with: authentication
downvote count: 1
type: Question
tagged with: javascript
has title: Angular refresh browser on redirect
accepted answer: http://stackoverflow.com/a/29533161
answer count: 2
favorite count: 0

http://stackoverflow.com/a/29980321
has comment: http://stackoverflow.com/comment/48082600
has body: If the content contains new line characters you need to delimit it within double quotes. So use return '"' + sValue.replace(/&lt;br\s*\/?&gt;/ig, "\r\n") + '"'; Of course you need to do this only if the content contains \r\n (otherwise numbers get formatted as text)
has comment: http://stackoverflow.com/comment/48137385
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/48083095
upvote count: 3
answers question: http://stackoverflow.com/q/29601893
has comment: http://stackoverflow.com/comment/48081476
downvote count: 1

http://stackoverflow.com/a/29653476
answers question: http://stackoverflow.com/q/29652947
type: Answer
has body: I guess you could do something like this: var o = {}; var arr = []; people.forEach(function(val) { if (!o.hasOwnProperty(val.firstname)) { // didn't see this name before, // keeping it so we know we saw it // and keeping its index, in case we see the same name again var idx = arr.push(val.firstname); o[val.firstname] = { idx: idx - 1, val: val }; } else { // we saw this name, adding the current with a last name // also adding last name to the origninal we saved before arr.push(val.firstname + " " + val.lastname.substr(0, 1)); arr[o[val.firstname].idx] = o[val.firstname].val.firstname + " " + o[val.firstname].val.lastname.substr(0, 1); } }) console.log(arr);
score: 0

http://stackoverflow.com/comment/47475594
type: QuestionComment
comment on: http://stackoverflow.com/q/29668559
has text: Could you add your script please ?
score: 0
type: Comment

http://stackoverflow.com/comment/47257718
has text: Thanks for your input. Although, I am starting to see some viable options maybe through my own research. Alerts being one method that may present a work around.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29553178
type: AnswerComment

http://stackoverflow.com/comment/47422950
has text: Map produces a new array. Reduce accumulates some sort of single value or object. You use them instead of a for loop or .for each if they provide the kind of output you need. All are specialized iterators designed for certain types of output. A for loop is a superset of the others. More general purpose, but requires a little more typing for some things.
comment on: http://stackoverflow.com/q/29640254
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/q/29630344
score: 0
answer count: 1
tagged with: angularjs
has body: I have an AngularJS application with multiple views (using ng-view). In the app's javascript file, I have intercepted the window's OnBeforeUnload event to make sure the user does not leave the site without saving his work. However, I have noticed that the OnBeforeUnload event gets fired at weird times in IE9 (e.g., when the Angular view changes, or when the view is refreshed). Basically, OnBeforeUnload is firing when it shouldn't be. So far, I have worked around the problem by setting and clearing flags in the the routeChangeStart and routeChangeSuccess events, but there always seems to be another gotcha. Has anyone else seen this problem? Thanks in advance....
type: UnansweredQuestion
has title: OnBeforeUnload Event Triggered at weird times by AngularJS in IE9
tagged with: single-page-application
linked to: http://stackoverflow.com/q/10179488
type: Question
has answer: http://stackoverflow.com/a/35708625
tagged with: javascript

underscore.js
tags question: http://stackoverflow.com/q/29573598
tags question: http://stackoverflow.com/q/29575809
type: Tag
tag name: underscore.js
tags question: http://stackoverflow.com/q/29687195
tags question: http://stackoverflow.com/q/29677317
tags question: http://stackoverflow.com/q/29612479
tags question: http://stackoverflow.com/q/29600258
tags question: http://stackoverflow.com/q/29538967
tags question: http://stackoverflow.com/q/29561669
tags question: http://stackoverflow.com/q/29544099
tags question: http://stackoverflow.com/q/29565576
tags question: http://stackoverflow.com/q/29659729
tags question: http://stackoverflow.com/q/29614664
tags question: http://stackoverflow.com/q/29587488
tags question: http://stackoverflow.com/q/29626497
tags question: http://stackoverflow.com/q/29609151
tags question: http://stackoverflow.com/q/29687189
tags question: http://stackoverflow.com/q/29680096
tags question: http://stackoverflow.com/q/29640022
tags question: http://stackoverflow.com/q/29684866
tags question: http://stackoverflow.com/q/29680886
tags question: http://stackoverflow.com/q/29670412

http://stackoverflow.com/a/29654878
has body: For a more accurate answer, please provide a link to the template. How can I call the previous code's functionality upon page load? Try to simulate a click of the link on page load, with something like document.querySelector('.menu-toggler.responsive-toggler').click(); And what exactly is href="javascript:;" calling? How does it work? Apparently, it call javascript code from a link, but I have to say I have never this syntax before. In this particuliar case, it cancels the basic anchor functionnality to go to another webpage or id in the page.
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29654349
accepted answer of: http://stackoverflow.com/q/29654349
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/a/44366615
type: Answer
has comment: http://stackoverflow.com/comment/114944877
has comment: http://stackoverflow.com/comment/75735116
has comment: http://stackoverflow.com/comment/126642477
has comment: http://stackoverflow.com/comment/77060165
downvote count: 1
upvote count: 13
has comment: http://stackoverflow.com/comment/75776874
score: 12
has comment: http://stackoverflow.com/comment/92726426
answers question: http://stackoverflow.com/q/29572466
has body: It does not worked for me Here is what I finally do, just in case it helps someone function callerName() { try { throw new Error(); } catch (e) { try { return e.stack.split('at ')[3].split(' ')[0]; } catch (e) { return ''; } } } function currentFunction(){ let whoCallMe = callerName(); console.log(whoCallMe); }

http://stackoverflow.com/comment/47374412
type: Comment
has text: So when you start entering the address, the addresses shown by google do not have the zip code. There is provably a parameter in var options = {...} that will show the zip code. Thank you for your response
comment on: http://stackoverflow.com/a/29610683
score: 0
type: AnswerComment

http://stackoverflow.com/a/29587596
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/29587391
has body: You need to use different $.each for each object this way: $.each(json, function (key, data) { console.log(key) $.each(data, function (index, data) { console.log('index', data) }) })
answers question: http://stackoverflow.com/q/29587391
type: AcceptedAnswer
downvote count: 0
upvote count: 2

http://stackoverflow.com/q/29681632
has body: I have this question and answer format: $('.qanda button').click(function(){ var btn = $(this); btn.siblings('.answer').slideDown(function(){ $(this).attr('tabindex', '-1').focus(); btn.remove(); }); }); * {margin: 0;} .qanda { margin: 2em 0; clear: both; } .answer { display: none; clear: both; outline: none; } .qanda h2 { float: left; } .qanda button{ margin-top: 4px; margin-left: 8px; } Is the sky blue? + That depends on various factors, including whether it's night or day. http://jsbin.com/jazekotosa/ I realise I haven't practised progressive enhancement in that the answers are hidden using static CSS. However, if I added this rule with JS and used this page for many questions, I'm assuming that on some devices the answers might display for a split second while the page loads. So I'm relying on JavaScript to be running (although I'm not sure that in itself is a barrier to accessibility). When the answer reveal animation is complete, the focus is set to the displayed div, meaning screen readers will (in my limited experience) read from that point. The buttons naturally take focus, so it seems keyboard accessible. What else can I do?
has answer: http://stackoverflow.com/a/29684449
has comment: http://stackoverflow.com/comment/47500381
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: 1
has answer: http://stackoverflow.com/a/29696075
type: Question
has comment: http://stackoverflow.com/comment/47500505
has answer: http://stackoverflow.com/a/29682093
has title: How do I make my FAQ more accessible?
tagged with: javascript
tagged with: accessibility
has comment: http://stackoverflow.com/comment/47501109
answer count: 3
upvote count: 1
downvote count: 0

http://stackoverflow.com/a/29686143
score: 4
downvote count: 1
upvote count: 5
type: Answer
has body: Awesomescreenshot will actually scroll down the page taking actual screenshots, then put those images together into one long image for you. You can even set it to only capture the part of the page that's showing, or a selected section. You could mix this with a macro type program/scripting language like Auto Hot Keys. You may or may not find it easier than using command line. I suppose it depends on what you're trying to do.
has comment: http://stackoverflow.com/comment/47521085
has comment: http://stackoverflow.com/comment/47538231
answers question: http://stackoverflow.com/q/29539135

http://stackoverflow.com/comment/47389545
type: AnswerComment
has text: Thank you Mairaj, I have changed the code to following function EditCompany() { //row = $("#EditButton").parent().parent(); //row = $("#btnEdit").parent().parent(); var row = $("#btnEdit").closest("tr"); cityID = $("#cityID", row).text(); // This was giving the cityId =1 (row 1) var img = $("#btnEdit"); var row = $("#btnEdit").parent.parent; cityID = $("#cityID", row).text(); //This was also giving row 1.
type: Comment
comment on: http://stackoverflow.com/a/29619341
score: 0

http://stackoverflow.com/q/29615473
accepted answer: http://stackoverflow.com/a/29617218
has title: Rendering folder contents like mod_autoindex with express and ejs in my node.js app
type: Question
has answer: http://stackoverflow.com/a/29617218
tagged with: javascript
tagged with: express
score: 0
answer count: 1
has body: I have been using express and ejs to render raw html files in a /public folder. For example, to render http://localhost:3000/index.html, I have: var express = require('express'); var ejs = require('ejs'); app.engine('.html', ejs.__express); app.set('views', __dirname + '/public'); app.set('view engine', 'html'); app.use(express.static(__dirname + './public')); and can render files from /public: % find public/ public/index.html public/favicon.ico public/stylesheets public/stylesheets/style.css public/images public/images/banner.gif I want to be able render a folder contents, like http://localhost:3000/images/, exactly like the Apache module mod_autoindex, a table of files as links showing the directory contents. Is there a way to do this?
tagged with: node.js
type: AnsweredQuestion

http://stackoverflow.com/comment/47232660
type: Comment
type: QuestionComment
has text: "For example if I include a file on wednesday", include a file? Give the code
comment on: http://stackoverflow.com/q/29540095
score: 0

http://stackoverflow.com/comment/47286902
type: AnswerComment
comment on: http://stackoverflow.com/a/29564705
has text: Make sure to use the apps script iframe mode. Then follow the regular google charts docs, not apps script.
type: Comment
score: 0

http://stackoverflow.com/comment/47513474
comment on: http://stackoverflow.com/q/29688189
has text: @Miura-shi: No it does not: http://jsfiddle.net/d5qv69je/. Or you haven't posted the data you actually have.
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/47317135
type: AnswerComment
comment on: http://stackoverflow.com/a/29583751
score: 0
type: Comment
has text: I wasn't sure how well a different type attribute would be handled across browsers and I admit I didn't know about the tag. Very cool and it seems to be the way to go but [IE support](http://caniuse.com/#search=template) looks sketchy.

http://stackoverflow.com/comment/47372136
type: AnswerComment
type: Comment
has text: Off-topic a little but why does `ng-pattern` not require `""` like a normal attribute?
comment on: http://stackoverflow.com/a/29613245
score: 0

http://stackoverflow.com/comment/47319040
type: QuestionComment
has text: you can use async and/or defer attribs on the script tags to get the same effect
comment on: http://stackoverflow.com/q/29585270
score: 0
type: Comment

http://stackoverflow.com/comment/47495314
comment on: http://stackoverflow.com/a/29677342
type: AnswerComment
has text: also from the log Object { emp_first_name: "BOB", emp_last_name: "SMITH" }
score: 0
type: Comment

http://stackoverflow.com/q/29676707
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47490972
answer count: 4
has title: String to number conversion using JavaScript
upvote count: 1
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29676818
has answer: http://stackoverflow.com/a/29676862
tagged with: javascript
has body: This is my html code but the problem is that if I add two strings it always gives the 50 as the addition. function add() { var fname=document.getElementById("fname"); var lname = document.getElementById("lname"); var fstring = fname.toString(); var lstring = lname.toString(); var fl = fstring.length; var ll = lstring.length; var f1 = parseInt(fl,10); var l1 = parseInt(ll,10); document.getElementById("result").innerHTML = f1 + l1; }
has comment: http://stackoverflow.com/comment/47491099
score: 0
has answer: http://stackoverflow.com/a/29676852
tagged with: dom-events
favorite count: 0
has answer: http://stackoverflow.com/a/29676829
has comment: http://stackoverflow.com/comment/47491140
type: UnansweredQuestion

http://stackoverflow.com/a/29596913
type: Answer
has comment: http://stackoverflow.com/comment/47340554
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29596876
score: 1
answers question: http://stackoverflow.com/q/29596876
has body: For $(document).ready, add an event listener to document for the event "DOMContentLoaded". For .hide(), set the style.display property of the element to "none". For .on(), use .addEventListener instead.
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/q/29617399
score: 0
tagged with: stocks
tagged with: asynchronous
linked to: http://stackoverflow.com/q/20279484
has title: How to create a Javascript object that keeps track of a stock price?
has answer: http://stackoverflow.com/a/29617523
has answer: http://stackoverflow.com/a/29617745
has comment: http://stackoverflow.com/comment/47379710
tagged with: getjson
answer count: 4
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29617459
possible better answer: http://stackoverflow.com/a/35219058
type: Question
has answer: http://stackoverflow.com/a/35219058
has answer: http://stackoverflow.com/a/29617459
tagged with: javascript
tagged with: jquery
has body: I would like to make a program that can keep track of multiple stock objects and display basic information about them (IE: their price). I have this code which can successfully retrieve the price of the stock: function getStock(symbol, callback){ var url = 'https://query.yahooapis.com/v1/public/yql'; var data = encodeURIComponent("select * from yahoo.finance.quotes where symbol in ('" + symbol + "')"); $.getJSON(url, 'q=' + data + "&format=json&diagnostics=true&env=http://datatables.org/alltables.env") .done(function (data) { result = data.query.results.quote.LastTradePriceOnly; callback(result); }) .fail(function (jqxhr, textStatus, error) { var err = textStatus + ", " + error; console.log('Request failed: ' + err); }); } getStock("goog", function(){alert(result)}); I would like to be able to create a simple object that can keep track of a stock. However, I have problems with asynchrony and the JSON request. Here is my code with the "stock" object: function getStock(symbol, callback) { var url = 'https://query.yahooapis.com/v1/public/yql'; var data = encodeURIComponent("select * from yahoo.finance.quotes where symbol in ('" + symbol + "')"); $.getJSON(url, 'q=' + data + "&format=json&diagnostics=true&env=http://datatables.org/alltables.env") .done(function(data) { result = data.query.results.quote.LastTradePriceOnly; callback(result); }) .fail(function(jqxhr, textStatus, error) { var err = textStatus + ", " + error; console.log('Request failed: ' + err); }); } function stock(symbol) { this.price = 0; getStock(symbol, function(result) { //this function is my callback console.log(result); this.price = result; }); this.printPrice = function() { alert("The price is: " + this.price); } } var s = new stock("goog"); $("#button").click(function() { s.printPrice() }); Print Price As you may notice, I tried using a callback which seems to be the appropriate solution to this problem (new to Javascript). However, it doesn't seem to actually be setting the class variable. In th…

http://stackoverflow.com/q/29591058
tagged with: unit-testing
type: Question
tagged with: javascript
has body: I am having a bit of trouble figuring out how to unit test a basic Angular directive using Jasmine. Essentially all the directive does is check that two password inputs are equal and sets the the directive looks like this: angular.module('jhApp') .directive('jhEquals', function() { return { restrict: 'A', require: '?ngModel', link: linker }; function linker(scope, elem, attrs, ngModel) { if(!ngModel) { return false; } //watch own value and re-validate scope.$watch(attrs.ngModel, function() { validate(); }); //observe other value and re-validate on change attrs.$observe('jhEquals', function() { validate(); }); var validate = function() { var val1 = ngModel.$viewValue; var val2 = attrs.jhEquals; //set validity if(val1 &amp;&amp; val2) { ngModel.$setValidity('jhEquals', !val1 || !val2 || val1 === val2); } }; } }); and the spec looks like this: var scope, dirElement; beforeEach(function() { module('jhApp'); module('templates'); inject(function($rootScope, $compile) { scope = $rootScope; scope.user = {}; dirElement = angular.element('&lt;input id="password" type="password" name="password" ng-model="user.password" jh-equals="{{user.passwordconfirm}}"&gt;&lt;input id="newpasswordconfirm" type="password" name="newpasswordconfirm" ng-model="user.passwordconfirm" jh-equals="{{user.password}}&gt;'); $compile(dirElement)(scope); }); scope.$digest(); }); it('should check if values are equal', function() { var passwordInput = dirElement.find('#password'); var confirmPasswordInput = dirElement.find('#newpasswordconfirm'); angular.element(passwordInput).val('testpassword').trigger('input'); angular.element(confirmPasswordInput).val('nottestpassword').trigger('input'); scope.$digest(); //expect this to be invalid }); passwordInput &amp; confirmPasswordInput - are showing an empty objects when I console.log it out and if I check the values of val1 and val2 in validate() in the directive it is always undefined. So I guess the issue here is that I cannot figure out how to select the in…
score: 0
answer count: 1
tagged with: jasmine
tagged with: angularjs
has title: Trouble unit testing Angular directive
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29592772

ajax
tags question: http://stackoverflow.com/q/29673398
tags question: http://stackoverflow.com/q/29642543
tags question: http://stackoverflow.com/q/29687101
tags question: http://stackoverflow.com/q/29560236
tags question: http://stackoverflow.com/q/29540233
tags question: http://stackoverflow.com/q/29633650
tags question: http://stackoverflow.com/q/29595243
tags question: http://stackoverflow.com/q/29538992
tags question: http://stackoverflow.com/q/29609086
tags question: http://stackoverflow.com/q/29645836
tags question: http://stackoverflow.com/q/29598518
tags question: http://stackoverflow.com/q/29532776
tags question: http://stackoverflow.com/q/29530367
tags question: http://stackoverflow.com/q/29667176
tags question: http://stackoverflow.com/q/29548736
tags question: http://stackoverflow.com/q/29600009
tags question: http://stackoverflow.com/q/29535302
tags question: http://stackoverflow.com/q/29657524
tags question: http://stackoverflow.com/q/29551426
tags question: http://stackoverflow.com/q/29674612
tags question: http://stackoverflow.com/q/29570690
tags question: http://stackoverflow.com/q/29682814
tags question: http://stackoverflow.com/q/29676842
tags question: http://stackoverflow.com/q/29675502
tags question: http://stackoverflow.com/q/29654179
tags question: http://stackoverflow.com/q/29629624
tags question: http://stackoverflow.com/q/29550575
tags question: http://stackoverflow.com/q/29568874
tags question: http://stackoverflow.com/q/29656877
tags question: http://stackoverflow.com/q/29542566
tags question: http://stackoverflow.com/q/29542942
tags question: http://stackoverflow.com/q/29550939
tags question: http://stackoverflow.com/q/29674388
tags question: http://stackoverflow.com/q/29641216
tags question: http://stackoverflow.com/q/29599319
tags question: http://stackoverflow.com/q/29671182
tags question: http://stackoverflow.com/q/29572561
tags question: http://stackoverflow.com/q/29562468
tags question: http://stackoverflow.com/q/29607816
tags question: http://stackoverflow.com/q/29568479
tags question: http://stackoverflow.com/q/29561575
tags question: http://stackoverflow.com/q/29590969
tags question: http://stackoverflow.com/q/29537570
tags question: http://stackoverflow.com/q/29676865
type: Tag
tags question: http://stackoverflow.com/q/29618900
tags question: http://stackoverflow.com/q/29615458
tags question: http://stackoverflow.com/q/29666515
tags question: http://stackoverflow.com/q/29541628
tags question: http://stackoverflow.com/q/29633987
tags question: http://stackoverflow.com/q/29568440
tags question: http://stackoverflow.com/q/29678267
tags question: http://stackoverflow.com/q/29566042
tags question: http://stackoverflow.com/q/29585724
tags question: http://stackoverflow.com/q/29660189
tags question: http://stackoverflow.com/q/29604946
tags question: http://stackoverflow.com/q/29562505
tags question: http://stackoverflow.com/q/29569350
tags question: http://stackoverflow.com/q/29675240
tags question: http://stackoverflow.com/q/29666490
tags question: http://stackoverflow.com/q/29621664
tags question: http://stackoverflow.com/q/29595770
tags question: http://stackoverflow.com/q/29603366
tags question: http://stackoverflow.com/q/29638306
tags question: http://stackoverflow.com/q/29614909
tags question: http://stackoverflow.com/q/29642351
tags question: http://stackoverflow.com/q/29646446
tags question: http://stackoverflow.com/q/29542987
tags question: http://stackoverflow.com/q/29665149
tags question: http://stackoverflow.com/q/29683647
tags question: http://stackoverflow.com/q/29539041
tags question: http://stackoverflow.com/q/29636540
tags question: http://stackoverflow.com/q/29533865
tags question: http://stackoverflow.com/q/29632711
tags question: http://stackoverflow.com/q/29572649
tags question: http://stackoverflow.com/q/29621575
tags question: http://stackoverflow.com/q/29634500
tags question: http://stackoverflow.com/q/29559623
tags question: http://stackoverflow.com/q/29583217
tags question: http://stackoverflow.com/q/29673937

node.js
tags question: http://stackoverflow.com/q/29577235
tags question: http://stackoverflow.com/q/29551630
tags question: http://stackoverflow.com/q/29682088
tags question: http://stackoverflow.com/q/29622339
tags question: http://stackoverflow.com/q/29659474
tags question: http://stackoverflow.com/q/29680950
tags question: http://stackoverflow.com/q/29666532
tags question: http://stackoverflow.com/q/29557327
tags question: http://stackoverflow.com/q/29567116
tags question: http://stackoverflow.com/q/29577389
tags question: http://stackoverflow.com/q/29584623
tags question: http://stackoverflow.com/q/29598266
tags question: http://stackoverflow.com/q/29644048
tags question: http://stackoverflow.com/q/29539762
tags question: http://stackoverflow.com/q/29684219
tags question: http://stackoverflow.com/q/29559398
tags question: http://stackoverflow.com/q/29662523
tags question: http://stackoverflow.com/q/29590788
tags question: http://stackoverflow.com/q/29656946
tags question: http://stackoverflow.com/q/29632754
tags question: http://stackoverflow.com/q/29660972
tags question: http://stackoverflow.com/q/29599010
tags question: http://stackoverflow.com/q/29615889
tags question: http://stackoverflow.com/q/29614392
tags question: http://stackoverflow.com/q/29566253
tags question: http://stackoverflow.com/q/29659297
tags question: http://stackoverflow.com/q/29628846
tags question: http://stackoverflow.com/q/29624277
tags question: http://stackoverflow.com/q/29595474
tags question: http://stackoverflow.com/q/29537155
tags question: http://stackoverflow.com/q/29673321
tags question: http://stackoverflow.com/q/29645592
tags question: http://stackoverflow.com/q/29536739
tags question: http://stackoverflow.com/q/29668533
tags question: http://stackoverflow.com/q/29600024
tags question: http://stackoverflow.com/q/29564127
tags question: http://stackoverflow.com/q/29610997
tags question: http://stackoverflow.com/q/29594773
tags question: http://stackoverflow.com/q/29531896
tags question: http://stackoverflow.com/q/29687363
tags question: http://stackoverflow.com/q/29565918
tags question: http://stackoverflow.com/q/29579208
tags question: http://stackoverflow.com/q/29576768
tags question: http://stackoverflow.com/q/29609173
tags question: http://stackoverflow.com/q/29671090
tags question: http://stackoverflow.com/q/29580522
tags question: http://stackoverflow.com/q/29594711
tags question: http://stackoverflow.com/q/29569460
tags question: http://stackoverflow.com/q/29632288
tags question: http://stackoverflow.com/q/29666130
tags question: http://stackoverflow.com/q/29597197
tags question: http://stackoverflow.com/q/29549851
tags question: http://stackoverflow.com/q/29599110
tags question: http://stackoverflow.com/q/29625412
tags question: http://stackoverflow.com/q/29536593
tags question: http://stackoverflow.com/q/29591307
tags question: http://stackoverflow.com/q/29610850
tags question: http://stackoverflow.com/q/29556993
tags question: http://stackoverflow.com/q/29574094
tags question: http://stackoverflow.com/q/29624791
tags question: http://stackoverflow.com/q/29571941
tags question: http://stackoverflow.com/q/29566823
tags question: http://stackoverflow.com/q/29570903
tags question: http://stackoverflow.com/q/29637861
tags question: http://stackoverflow.com/q/29682163
tags question: http://stackoverflow.com/q/29665353
tags question: http://stackoverflow.com/q/29621595
tags question: http://stackoverflow.com/q/29569628
tags question: http://stackoverflow.com/q/29556078
tags question: http://stackoverflow.com/q/29566101
tags question: http://stackoverflow.com/q/29558162
tags question: http://stackoverflow.com/q/29615473
tags question: http://stackoverflow.com/q/29615695
tags question: http://stackoverflow.com/q/29616871
tags question: http://stackoverflow.com/q/29634280
tags question: http://stackoverflow.com/q/29663883
tags question: http://stackoverflow.com/q/29666341
tags question: http://stackoverflow.com/q/29638928
tags question: http://stackoverflow.com/q/29635162
tags question: http://stackoverflow.com/q/29583218

http://stackoverflow.com/comment/47306410
type: QuestionComment
has text: move `$scope.albarr.push(Album);` to the end of your function afer localStorage.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29578798

http://stackoverflow.com/q/29583639
type: Question
answer count: 1
tagged with: javascript
has title: Visual Studio 2013 developers license javascript error
score: 0
upvote count: 1
has body: I have Microsoft Visual Studio 2013 installed, and I would like to start coding windows store apps. Every time I create a project, I'm getting the notification that I need a developer license. This is fine to me, so I press the 'I agree' button. After doing this, Visual Studio seems to be trying to make some connection to the web, and the next thing happening is a JavaScript error. Literally translated from Dutch it says: You need JavaScript to login to your Microsoft-account. This browser doesn't support JavaScript or scripts are being blocked. Look into the online Help of your browser to see if the browser supports JavaScript or to enable scripts. My default browser is Google Chrome, and in the settings of Google Chrome, JavaScript is enabled by default. How do I solve all of this? I really want to start creating windows store apps.
favorite count: 0
type: UnansweredQuestion
downvote count: 1
tagged with: visual-studio
tagged with: licensing
has answer: http://stackoverflow.com/a/29593523
tagged with: windows-store
tagged with: google-chrome

http://stackoverflow.com/q/29674495
linked to: http://stackoverflow.com/q/273789
has body: I want to extract all JSON objects from a string randomly containing them and add them to an array. Sample string: "I was with {"name":"John"}{"name":"Anne"}{"name":"Daniel"} yesterday"` how can i extract the JSON objects from this sample string?
has comment: http://stackoverflow.com/comment/47486592
tagged with: http://stackoverflow.com/tag/json
accepted answer: http://stackoverflow.com/a/29675215
upvote count: 3
has comment: http://stackoverflow.com/comment/47486665
score: 0
has answer: http://stackoverflow.com/a/29675215
tagged with: javascript
has answer: http://stackoverflow.com/a/77523184
favorite count: 0
has comment: http://stackoverflow.com/comment/47487509
has answer: http://stackoverflow.com/a/29674584
downvote count: 3
answer count: 4
has comment: http://stackoverflow.com/comment/47486585
has title: How do I extract JSON objects from a string and add them to an array?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/78150330
linked to: http://stackoverflow.com/q/2583472
possible better answer: http://stackoverflow.com/a/77523184
has comment: http://stackoverflow.com/comment/47487400
type: Question

http://stackoverflow.com/q/29621402
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47386861
has comment: http://stackoverflow.com/comment/47390284
tagged with: css
has body: I am saving the content of WebView so that I can show that content when I launch my app the next time. I followed this which works almost as I wanted. @JavascriptInterface public void setHtml(String html) { SharedPreferences settings = getSharedPreferences("preferences", MODE_PRIVATE); this.html = html; SharedPreferences.Editor prefEditor = settings.edit(); prefEditor.putString("ActivityHtml", html); prefEditor.commit(); Log.d("html", html); setChanged(); notifyObservers(html); } And then : view.loadDataWithBaseURL("", settings.getString("ActivityHtml", ""), "text/html", "UTF-8", ""); However, when I see the html in Log, the Javascript and CSS have server paths like : &lt;link href="/Content/Sass/style_sass.css?version=1.0.1.15" rel="stylesheet"&gt; &lt;img src="../Images/magnify_black.png" /&gt; Now because of this, only the text content shows up while the images aren't shown. Like this : How may I get the images, css and javascript in HTML ? Just to tell I already have following in place : view.getSettings().setLoadsImagesAutomatically(true); view.getSettings().setJavaScriptEnabled(true);
tagged with: android-webview
type: Question
has answer: http://stackoverflow.com/a/29623075
has comment: http://stackoverflow.com/comment/47391302
tagged with: javascript
linked to: http://stackoverflow.com/q/10832462
has answer: http://stackoverflow.com/a/29622157
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/47386879
has title: WebView - Download javascript, css and images
type: UnansweredQuestion
tagged with: android

http://stackoverflow.com/comment/47411692
comment on: http://stackoverflow.com/a/29634412
score: 0
type: AnswerComment
type: Comment
has text: The other JS you have running and the execution and the return time of the PHP script are beyond the scope of a simple question like this. We'd need a lot more information. However I will add something to my answer that may help.

http://stackoverflow.com/q/29579423
has answer: http://stackoverflow.com/a/29579753
answer count: 1
downvote count: 0
favorite count: 0
tagged with: three.js
has comment: http://stackoverflow.com/comment/47307851
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29579753
score: 1
upvote count: 1
has title: multiply the result of subtracting one value from another
type: Question
has body: I would like to multiply: vectorDiff = placementPosition.sub(viewerPosition); by 10, so that when "model" is moved: moveModel(vectorDiff, "GPS"); it moves 10 times more than it is currently. How do i do this; im new to javascript any help would be greatly appreciated. The following is the code block the above is located in: if ( viewerPosition !== null &amp;&amp; placementPosition!== null) { vectorDiff = placementPosition.sub(viewerPosition); rotationSum = new THREE.Vector3().addVectors(placementRotation, viewerRotation) //rotationSum.setY(rotationSum.y+180); moveModel(vectorDiff, "GPS"); //rotateModel(rotationSum, "GPS");
tagged with: javascript

http://stackoverflow.com/comment/47411357
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29634531
has text: Why not just loop and delete?

http://stackoverflow.com/comment/47238951
comment on: http://stackoverflow.com/q/29542834
type: QuestionComment
has text: #smh agree it's a dup -- unfortunately my fix from last time is not working
score: 0
type: Comment

http://stackoverflow.com/a/29549043
has comment: http://stackoverflow.com/comment/47249915
has body: Keep in mind that a lot of JavaScript isn't great. It was designed in 10 days and a lot (not all) of it may not be intuitive. This is one of those times where you don't think about why and you just use isNaN(someVar) to check for it.
downvote count: 1
upvote count: 0
score: -1
has comment: http://stackoverflow.com/comment/47249767
answers question: http://stackoverflow.com/q/29548839
type: Answer

http://stackoverflow.com/q/29634910
has comment: http://stackoverflow.com/comment/47412174
score: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/29908303
tagged with: ajax
type: Question
upvote count: 2
answer count: 8
has comment: http://stackoverflow.com/comment/47849127
has comment: http://stackoverflow.com/comment/47412825
has answer: http://stackoverflow.com/a/29910449
has comment: http://stackoverflow.com/comment/47836777
has body: This is a completely updated post to explain the problem in a better way with an improved concept an code (based on the answers given here so far) I try to realize a completely ajaxed website, but I got some problems with multiple bound events. This is the basic HTML: Get Cars Get Vegetables The navigation is been created dynamically (as the content of #navigation can be replaced with another navigation), so the binding for the nav-elements would look like this: $('#navigation').off('click', '.red').on('click', '.red', function() { var type = $(this).attr('data-type'); var data = { 'param': 'content', 'type': type }; ajaxSend(data); }); The content of the site is also being loaded dynamically. For example there are two different content: 1: Here are some information about vegetables: Anything 2: While loading the content, I will also load a specific JS-file, which has all the bindings needed, for this type of content. So the loading-script looks like this: var ajaxSend = function(data) { $.ajax({ url: "script.php", type: "POST", data: data, dataType: "json" }) .done(function( json ) { if (json.logged === false) { login(ajaxSend, data); } else { $.getScript( 'js/' + json.file + '.js' ) .done(function( script, textStatus ) { $('#result').html(json.antwort); }); } }); } As you pass the parameter for the type of results you need (i.e. vegetables or cars), the result will be shown in #result. Also the files cars.js or vegetables.js would be loaded. So my problem is to avoid multiple event bindings. This is how I'm doing it: cars.js: $('#result').off('mouseover', 'img').on('mouseover', 'img', function () { // do anything }); vegetables.js: $('#result').off('click', 'button').on('click', 'button', function () { // do anything }); Is this the proper way? I think it is just a workaround to use off(). So I would appreciate any improvements! Furthermore I don't know if there is a problem, if the user clicks on the navigation multiple times: In that case the js-files are loaded…
has answer: http://stackoverflow.com/a/29635110
has comment: http://stackoverflow.com/comment/47412530
has answer: http://stackoverflow.com/a/29920492
has title: JS for different dynamically loaded content in a fully ajaxed website
has comment: http://stackoverflow.com/comment/47843715
has comment: http://stackoverflow.com/comment/47886671
has answer: http://stackoverflow.com/a/29893613
downvote count: 1
has answer: http://stackoverflow.com/a/29909160
accepted answer: http://stackoverflow.com/a/29910449
tagged with: javascript
has comment: http://stackoverflow.com/comment/47839092
has answer: http://stackoverflow.com/a/29908489
has comment: http://stackoverflow.com/comment/47837934
possible better answer: http://stackoverflow.com/a/29926130
tagged with: jquery-events
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29926130
has comment: http://stackoverflow.com/comment/47883687
tagged with: events

http://stackoverflow.com/q/29671863
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47481695
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/47481552
tagged with: javascript
score: 0
has title: Angularjs ui select space representation issue
has answer: http://stackoverflow.com/a/29672281
tagged with: angular-ui
has answer: http://stackoverflow.com/a/29672306
has body: I am using AngularJs UI select dropdown. As I need to represent children also in the same dropdown I am appending &amp;nbsp to the children and the dropdown visibility is also fine. But the problem is occurring when I select a child node with &amp;nbsp. The selected node is appearing along with &amp;nbsp, how can I avoid those &amp;nbsp appearance upon selection of a particular customer? Please find my plnkr and image for reference. As I don't want to have ugly '----', I have replaced them with '&amp;nbsp' addOptionsToDropDown(options[i].children, stringToPrepend + '&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp');
tagged with: angularjs

http://stackoverflow.com/a/29638859
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29638666
has body: The short answer: if(txVal.value==0) alert('Please enter a number.'); Is not always the best answer: var v=document.getElementById('txtVal'); v=parseInt(v,10); if(v&lt;=0) alert('Please enter a positive integer.'); Of course that probably not the best answer either but it does fix a couple of common mistakes. Although you can refer to an element by using its id as a variable name its not recomended. The value property of an input (ie txtVal.value) is a string (even if it contains only digits) so if you try to compare it to a number you may get unexpected results. In this case you are comparing it to 0 so problems are less likely but if you ever change your code to compare to another number you will probably run into problems, so its best to make it into an actual number before you do anything with it. If you want to allow decimals use parseFloat instead.
answers question: http://stackoverflow.com/q/29638666
type: Answer
has comment: http://stackoverflow.com/comment/47420011

http://stackoverflow.com/comment/47295887
type: Comment
has text: Sorry, but I'm not sure I understand your explanation. If you open the website in Firefox you will see exactly what I want to accomplish. The website works perfectly on Firefox. So yes, it just scrolls up/down to the specific sections. I think you'd call it a smooth scroll effect. If part of the code is incorrect then how come it works perfectly in Firefox?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29573326

http://stackoverflow.com/q/29584830
upvote count: 3
answer count: 3
has answer: http://stackoverflow.com/a/29584890
tagged with: reload
has answer: http://stackoverflow.com/a/29584940
type: UnansweredQuestion
has title: Reload page without disrupting currently running Javascript
has comment: http://stackoverflow.com/comment/47317910
has comment: http://stackoverflow.com/comment/47317909
has body: Is there any way to reload a page without resetting Javascript code that is currently running on the page (for example, being run via the Chrome dev console)? My situation is that I have a page that I need to keep reloading and running code on automatically. However, whenever I refresh the page using window.location.reload( ) it stops any Javascript that I'm currently running on the page. Is there any way that I can keep refreshing the page but keep running the same code?
has comment: http://stackoverflow.com/comment/47317975
has comment: http://stackoverflow.com/comment/47318016
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29584850
favorite count: 0
type: Question
score: 3
has comment: http://stackoverflow.com/comment/47317964
has comment: http://stackoverflow.com/comment/47317897

http://stackoverflow.com/q/29652660
has comment: http://stackoverflow.com/comment/47445262
type: Question
has answer: http://stackoverflow.com/a/29708918
has title: Store variable associated with button click with jquery
has body: I am trying to store the variable associated with a given button, that can then be used as one of the parameters in the data field of an ajax PUT. I have the following, but can't figure out why its not storing the value of ratio: HTML SQUARE 16-9 9-16 jQuery $(".imgly-controls-item-square").click(function () { var ratio = "square"; alert(ratio); }); $(".imgly-controls-item-16-9").click(function () { var ratio = "16-9"; alert(ratio); }); $(".imgly-controls-item-9-16").click(function () { var ratio = "9-16"; alert(ratio); }); //Will store value of selected image crop orientation, that can then be appended to ajax data parameter below var imageOrientation = ratio; Current JSFiddle: LINK
possible better answer: http://stackoverflow.com/a/29652778
score: 0
has answer: http://stackoverflow.com/a/29652778
has comment: http://stackoverflow.com/comment/47445083
has answer: http://stackoverflow.com/a/29652737
accepted answer: http://stackoverflow.com/a/29708918
has comment: http://stackoverflow.com/comment/47445077
has comment: http://stackoverflow.com/comment/47449765
has answer: http://stackoverflow.com/a/29652781
answer count: 4
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/29569109
has comment: http://stackoverflow.com/comment/49609327
has body: I have a input field in a form named feedback. I need to submit feedback and store it in database. But I am getting input value as null and empty string is getting stored. Javascript for submitting file function submitKdApproval(user,teamId) { //alert("ok"); document.getElementById("user1").value=user; document.getElementById("teamId1").value=teamId; document.forms["submitKdApprovalForm"].action ="submitKdApproval.do?go=submitKdApproval"; document.forms["submitKdApprovalForm"].submit(); } Inside action class String feedback=(String)request.getParameter("feedback"); This line is giving me a null string. Please help Here is part of my html. &lt;html:form action='/submitKdApproval.do' styleId='submitKdApprovalForm' &gt; &lt;input type="text" name="feedback" id="feedback" name="feedback" /&gt; &lt;input type="hidden" id="user1" name="user1" value='${knowledgeDashboardVO.user}'/&gt; &lt;input type="hidden" id="teamId1" name="teamId1" value='${knowledgeDashboardVO.teamId}'/&gt; &lt;/html:form&gt;
upvote count: 1
tagged with: javascript
type: UnansweredQuestion
has title: Cannot submit user input value from text field , getting null in action class
has comment: http://stackoverflow.com/comment/47288453
answer count: 0
downvote count: 0
tagged with: jsp
score: 1
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/29579310
has body: First, try not to use left and top properties when you want to move something and prefere translate:transform Second, you can delimited your call by trying something like this: if( e.pageX &gt;= div.offset().left &amp;&amp; e.pageX &lt;= div.offset().left + div.width || e.pageY &gt;= div.offset().top &amp;&amp; e.pageY &lt;= div.offset().top + div.height ) { $('.galleria-counter').css({ left: e.pageX, top: e.pageY }); } Hope it's help :)
has comment: http://stackoverflow.com/comment/47307249
answers question: http://stackoverflow.com/q/29579182
type: Answer
has comment: http://stackoverflow.com/comment/47307049
score: 0
has comment: http://stackoverflow.com/comment/47307279

http://stackoverflow.com/comment/47482408
type: Comment
score: 0
has text: You can do it in this way but it is all work around .. there needs to be angular solution to it
comment on: http://stackoverflow.com/a/29672306
type: AnswerComment

http://stackoverflow.com/a/29563749
has comment: http://stackoverflow.com/comment/47278728
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/29563630
has comment: http://stackoverflow.com/comment/47278375
has comment: http://stackoverflow.com/comment/47278653
answers question: http://stackoverflow.com/q/29563630
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47278070
has body: Note your ajax url: data.url. This is always going to be "/error/404error.html" how you currently have it. You should have data.url pull from options: $.fn.getAppData = function(options) { $this = $(this); data = $.extend({ id: options.id, // &lt;- this is now dynamic url: options.url, // &lt;- this is now dynamic callback: function(){} }, options ); Same thing with data.id. Edit I was wrong! The issue is with data =. Because you are missing var, you are assigning data to the global scope, thus overwriting it with each new call to this method. I would instead use the following: (function($){ $.fn.getAppData = function(options) { $this = $(this); var data = $.extend({ // &lt;- Only available in current scope because of "var"! id: "body", url: "/error/404error.html", callback: function(){} }, options ); $.ajax({ url: data.url, cache: false }) .done(function( html ) { //alert(data.id); $display = $(html).find('div'+data.id); $this.append($display); options.callback.call(this); }) .fail(function() { alert('Error loading '+data.id+' data.'); }); //Also note, that there was an extra bracket "}" here } }(jQuery));
type: Answer

http://stackoverflow.com/comment/47454454
comment on: http://stackoverflow.com/a/29656824
type: Comment
has text: Give it a shot. If nothing else, it would be a bit tidier. `e` would be a fine name.
score: 1
type: AnswerComment

http://stackoverflow.com/comment/47422557
type: QuestionComment
has text: how do you know the time zone?
comment on: http://stackoverflow.com/q/29640342
score: 0
type: Comment

http://stackoverflow.com/comment/57895318
comment on: http://stackoverflow.com/a/29646994
type: Comment
has text: Jordan -- You would only be able to do ResultsFinder.$http if during build you DON'T wrap your module in an IIFE. This should always be done. Or, just wrap the class in a IIFE. Doing encapsulation within the constructor will give you a performance hit.
score: 0
type: AnswerComment

visual-studio
tags question: http://stackoverflow.com/q/29675002
tags question: http://stackoverflow.com/q/29623283
type: Tag
tags question: http://stackoverflow.com/q/29653490
tags question: http://stackoverflow.com/q/29532703
tags question: http://stackoverflow.com/q/29583639
tags question: http://stackoverflow.com/q/29531505
tag name: visual-studio

http://stackoverflow.com/comment/47276863
score: 1
comment on: http://stackoverflow.com/q/29563506
type: Comment
type: QuestionComment
has text: My only idea would be to write a function which uses the replace method with a regular expression over your regex_string variable. But that can be a huge effort because there are a lot of different escape signs

http://stackoverflow.com/comment/47443788
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29632141
has text: does the tablet have internet connection? error 3 y a connection problem

http://stackoverflow.com/q/29664006
has answer: http://stackoverflow.com/a/29664790
has comment: http://stackoverflow.com/comment/47468757
tagged with: javascript
has answer: http://stackoverflow.com/a/29664789
tagged with: ajax
has comment: http://stackoverflow.com/comment/47468087
upvote count: 1
favorite count: 0
has title: dynamic observable classes for knockout
type: UnansweredQuestion
has body: I am working on a reporting related project, where I need to build lot of reports rendered using KO. All data pulled using AJAX and the model is updated. Currently I am writing tons of js functions to map the models. Something like: function modelx(child) { var self = this; self.Name = ko.observable(child.Name); self.Relation = ko.observable(child.Relation); // hundred other properties }; function modely(child) { var self = this; self.Age = ko.observable(child.Age); self.Relation = ko.observable(child.Relation); // hundred other properties }; and after AJAX call, I am filling the observable arrays for (var i = 0; i &lt; jsn.length; i++) { VM.modelxlist().push(new modelx(jsn[i])); } for (var i = 0; i &lt; jsn1.length; i++) { VM.modelylist().push(new modely(jsn1[i])); } Is there any way to avoid the definition of modelx, modely,... such that the model is automatically built without loosing the benefits of this approach while using in HTML? Of course there could be a corner case where I may not get a specific property from server, which I should check on the server side. Also, at times I may need to add additional computed observables (just to be more flexible)
downvote count: 0
score: 1
tagged with: knockout.js
type: Question
answer count: 2

http://stackoverflow.com/q/29603848
has body: I have a problem with JavaScript, webRTC and Kurento. I'm not able to solve it by myself. I'm trying to put the remote stream from a local variable in a global variable but I have some troubles. I try to explain all steps to bring the problem out: The first step, I have the Kurento webRtcEndpoint function: webRtcPeer = kurentoUtils.WebRtcPeer.startRecvOnly(videoElement, onPlayOffer, onError); It calls the function "onPlayOffer" that is: function onPlayOffer(sdpOffer) { co(function * () { try { if (!client) client = yield kurentoClient(args.ws_uri); pipeline = yield client.create('MediaPipeline'); var webRtc = yield pipeline.create('WebRtcEndpoint'); var player = yield pipeline.create('PlayerEndpoint', { uri: args.file_uri }); yield player.connect(webRtc); var sdpAnswer = yield webRtc.processOffer(sdpOffer); webRtcPeer.processSdpAnswer(sdpAnswer, recordVideo); console.log('DEBUG: ok, AGAIN, localStream: '); console.log(localStream); yield player.play(); I've edited the function processSdpAnswer to take the stream in this way: WebRtcPeer.prototype.processSdpAnswer = function(sdpAnswer, callbackEvent, successCallback) { //WebRtcPeer.prototype.processSdpAnswer = function(sdpAnswer, successCallback) { var answer = new RTCSessionDescription({ type : 'answer', sdp : sdpAnswer, }); console.log('Kurento-Utils: SDP answer received, setting remote description'); var self = this; self.pc.onaddstream = function(event) { var objectURL = URL.createObjectURL(event.stream); //Added the string below to create the callback callbackEvent(event.stream); }; self.pc.setRemoteDescription(answer, function() { if (self.remoteVideo) { var stream = self.pc.getRemoteStreams()[0]; //console.log('Kurento-Utils: Second self.pc'); //console.log(self.pc) self.remoteVideo.src = URL.createObjectURL(stream); } if (successCallback) { successCallback(); } }, this.onerror); So, in this case the callback is the function recordVideo, which is passed "event.stream" function recordVideo(stream) { console.log(…
possible better answer: http://stackoverflow.com/a/29622444
has comment: http://stackoverflow.com/comment/47358101
has answer: http://stackoverflow.com/a/29622444
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29617989
tagged with: stream
tagged with: kurento
type: Question
upvote count: 4
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: callback
score: 4
accepted answer: http://stackoverflow.com/a/29617989
has title: local variable to global javascript
tagged with: webrtc
favorite count: 0

http://stackoverflow.com/a/29645018
score: 0
answers question: http://stackoverflow.com/q/29644972
has body: The issue is because html() returns a string, so you need to convert it to a number. var PITotalAMount = 0; $(".HomePIAmtTot").each( function(){ PITotalAMount += parseFloat($(this).html().replace(',', '')); }); console.log(PITotalAMount);
type: Answer

http://stackoverflow.com/q/29656732
downvote count: 0
has title: Prevent all elements from scrolling except a popup and its contents
favorite count: 0
tagged with: css
accepted answer: http://stackoverflow.com/a/29656925
type: AnsweredQuestion
tagged with: popup
score: 1
upvote count: 1
has body: I am trying to get the following behavior to occur: When the popup element is shown, I want to prevent any and all elements from scrolling unless they are the popup and the elements within it. The behavior currently is that when scrolling within the popup element, you will reach the bottom or the top and the rest of the document continues to scroll. About the code: The popup itself is a fixed div that appears on the page (on click) when an anchor link is clicked, so the 'prevent scroll' action should occur when the anchor is clicked. I have put random elements to represent that the content outside the popup is out of your control to style it; therefore it should not matter what this content is other than it being straight forward HTML elements. The below jsFiddle contains what I have accomplished so far. My problem is certainly in 'how' to grab these elements that I need scroll prevention to occur upon. Here is is: jsFiddle. Your help is greatly appreciated!
has answer: http://stackoverflow.com/a/29656925
type: Question
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
answer count: 1

http://stackoverflow.com/q/29646738
tagged with: web-services
has answer: http://stackoverflow.com/a/29646994
accepted answer: http://stackoverflow.com/a/29646994
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47433978
has body: I'm having problems accessing Angular built-in services such as $http when creating a service with ES6. For example, I'm creating a "ResultsFinder" service that will do an AJAX call and then do some stuff. The problem is that I only have access to $http on the constructor (if I pass it as an argument), but not on other methods (such as getResults). See this code example: (() =&gt; { 'use strict'; class ResultsFinder { constructor($http) {} getResults() { return 'ResultsFinder'; } } /** * @ngdoc service * @name itemManager.service:ResultsFinder * * @description * */ angular .module('itemManager') .service('ResultsFinder', ResultsFinder); }()); Inside getResults I don't have access to $http. In order to have access I should do something that I don't feel right like this: (() =&gt; { 'use strict'; class ResultsFinder { constructor($http) { this.$http = $http; } getResults() { // Here I have access to this.$http return 'ResultsFinder'; } } /** * @ngdoc service * @name itemManager.service:ResultsFinder * * @description * */ angular .module('itemManager') .service('ResultsFinder', ResultsFinder); }()); Anyone can give me some advice about the proper way to handle this?
has comment: http://stackoverflow.com/comment/47433930
upvote count: 8
type: Question
tagged with: ecmascript-6
answer count: 1
has comment: http://stackoverflow.com/comment/47440647
tagged with: javascript
favorite count: 0
score: 8
has title: Services with ES6 (AngularJS)
tagged with: angularjs
tagged with: angular-services
downvote count: 0

audiocontext
type: Tag
tags question: http://stackoverflow.com/q/29640833
tag name: audiocontext

ruby-on-rails
tags question: http://stackoverflow.com/q/29624003
tags question: http://stackoverflow.com/q/29616033
type: Tag
tags question: http://stackoverflow.com/q/29577610
tags question: http://stackoverflow.com/q/29671109
tags question: http://stackoverflow.com/q/29614909
tags question: http://stackoverflow.com/q/29558539
tags question: http://stackoverflow.com/q/29610346
tags question: http://stackoverflow.com/q/29600371
tags question: http://stackoverflow.com/q/29636540
tags question: http://stackoverflow.com/q/29565727
tags question: http://stackoverflow.com/q/29592906
tags question: http://stackoverflow.com/q/29612811
tags question: http://stackoverflow.com/q/29663613
tags question: http://stackoverflow.com/q/29580619
tags question: http://stackoverflow.com/q/29607239
tags question: http://stackoverflow.com/q/29582541
tags question: http://stackoverflow.com/q/29650959
tags question: http://stackoverflow.com/q/29613708
tags question: http://stackoverflow.com/q/29571059
tags question: http://stackoverflow.com/q/29580511
tags question: http://stackoverflow.com/q/29624563
tags question: http://stackoverflow.com/q/29637364
tags question: http://stackoverflow.com/q/29601245
tags question: http://stackoverflow.com/q/29566376
tag name: ruby-on-rails
tags question: http://stackoverflow.com/q/29548879
tags question: http://stackoverflow.com/q/29684352
tags question: http://stackoverflow.com/q/29621848
tags question: http://stackoverflow.com/q/29596136
tags question: http://stackoverflow.com/q/29657841
tags question: http://stackoverflow.com/q/29662924
tags question: http://stackoverflow.com/q/29634899
tags question: http://stackoverflow.com/q/29676578
tags question: http://stackoverflow.com/q/29686246
tags question: http://stackoverflow.com/q/29541596
tags question: http://stackoverflow.com/q/29566595
tags question: http://stackoverflow.com/q/29667674
tags question: http://stackoverflow.com/q/29656129

http://stackoverflow.com/q/29556872
answer count: 2
downvote count: 0
favorite count: 0
possible better answer: http://stackoverflow.com/a/29557201
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29557201
tagged with: css
has title: How i get external CSS value From external JS file?
has answer: http://stackoverflow.com/a/29557168
has body: I wanna to get element background value from javascript file. I has three files - html.html css.css js.js html.html I'm Button! css.css .myBlock { width: 300px; max-width: 100%; height: 100px; max-height: 100%; margin: 0 auto; margin-top: 100px; font-size: 50px; font-weight: lighter; font-style: normal; text-align: center; line-height: 100px; position: relative; background-color: #83DF31; } js.js function heyJS() { alert(document.getElementsByClassName('myBlock')[0].style.backgroundColor); } After running the scrpit,I only get blank alert box. How can i get div background value ?
score: 1
upvote count: 1
accepted answer: http://stackoverflow.com/a/29557168
type: Question
type: AnsweredQuestion
tagged with: javascript

canvas
tags question: http://stackoverflow.com/q/29535392
tags question: http://stackoverflow.com/q/29581494
tags question: http://stackoverflow.com/q/29661555
tags question: http://stackoverflow.com/q/29558253
tags question: http://stackoverflow.com/q/29539704
tags question: http://stackoverflow.com/q/29553012
tags question: http://stackoverflow.com/q/29588091
tags question: http://stackoverflow.com/q/29657681
tags question: http://stackoverflow.com/q/29676911
tags question: http://stackoverflow.com/q/29680449
tags question: http://stackoverflow.com/q/29581431
tags question: http://stackoverflow.com/q/29596817
tags question: http://stackoverflow.com/q/29573754
tags question: http://stackoverflow.com/q/29548443
tags question: http://stackoverflow.com/q/29591089
tags question: http://stackoverflow.com/q/29583183
tags question: http://stackoverflow.com/q/29537349
tags question: http://stackoverflow.com/q/29578266
tags question: http://stackoverflow.com/q/29658761
tags question: http://stackoverflow.com/q/29599954
tags question: http://stackoverflow.com/q/29588816
tags question: http://stackoverflow.com/q/29649010
tags question: http://stackoverflow.com/q/29574682
tags question: http://stackoverflow.com/q/29635005
tags question: http://stackoverflow.com/q/29637206
tags question: http://stackoverflow.com/q/29611726
tags question: http://stackoverflow.com/q/29597242
tags question: http://stackoverflow.com/q/29565724
tags question: http://stackoverflow.com/q/29554138
tags question: http://stackoverflow.com/q/29633251
tags question: http://stackoverflow.com/q/29664580
tags question: http://stackoverflow.com/q/29582866
tags question: http://stackoverflow.com/q/29586754
tag name: canvas
tags question: http://stackoverflow.com/q/29603903
tags question: http://stackoverflow.com/q/29535305
tags question: http://stackoverflow.com/q/29579839
tags question: http://stackoverflow.com/q/29563827
tags question: http://stackoverflow.com/q/29670660
type: Tag
tags question: http://stackoverflow.com/q/29551841
tags question: http://stackoverflow.com/q/29624532
tags question: http://stackoverflow.com/q/29572560
tags question: http://stackoverflow.com/q/29667624
tags question: http://stackoverflow.com/q/29571274
tags question: http://stackoverflow.com/q/29619402
tags question: http://stackoverflow.com/q/29601940
tags question: http://stackoverflow.com/q/29539384
tags question: http://stackoverflow.com/q/29680488
tags question: http://stackoverflow.com/q/29674298
tags question: http://stackoverflow.com/q/29624049
tags question: http://stackoverflow.com/q/29633355
tags question: http://stackoverflow.com/q/29675279
tags question: http://stackoverflow.com/q/29610770
tags question: http://stackoverflow.com/q/29552998
tags question: http://stackoverflow.com/q/29605701
tags question: http://stackoverflow.com/q/29624937
tags question: http://stackoverflow.com/q/29548524
tags question: http://stackoverflow.com/q/29539271
tags question: http://stackoverflow.com/q/29592828
tags question: http://stackoverflow.com/q/29670700

http://stackoverflow.com/q/29686290
type: UnansweredQuestion
has title: Javascript PHP file upload by name
has comment: http://stackoverflow.com/comment/47510379
tagged with: php
has comment: http://stackoverflow.com/comment/47510548
type: Question
has comment: http://stackoverflow.com/comment/47510105
has body: I'm trying to upload a file using ajax call and PHP, however I'm facing some difficulty that my call was successful but I'm unable to get the uploaded file. My Javascript Function: function uploadFile(filename) { var fd = new FormData(); fd.append("RESULT_FileUpload-15", filename); $.ajax({ url: "upload.php", type: "POST", data: fd, processData: false, contentType: false, success: function(response) { alert("IM SUCCESS: ",response); }, error: function(jqXHR, textStatus, errorMessage) { console.log(errorMessage); // Optional } }); } My PHP Code: if(isset($_FILES["RESULT_FileUpload-15"]["tmp_name"])) { if ($_FILES["RESULT_FileUpload-15"]["error"] &gt; 0) { echo "Error: " . $_FILES["RESULT_FileUpload-15"]["error"] . "&lt;br /&gt;"; } else { $target_dir = dirname(__FILE__) ; $pic = basename($_FILES["RESULT_FileUpload-15"]["name"]); $target_file = $target_dir. $pic; $uploadOk = 1; if(isset($_POST["submit"])) { $uploadOk = 1; } if (file_exists($target_file)) { echo "Sorry, file already exists."; $uploadOk = 0; } if ($uploadOk == 0) { echo "Sorry, your file was not uploaded."; } else { if (move_uploaded_file($_FILES["RESULT_FileUpload-15"]["tmp_name"], $target_file)) { $a = [$target_file,$_FILES["RESULT_FileUpload-15"]["name"]]; echo json_encode($a); // echo "The file ". basename( $_FILES["RESULT_FileUpload-15"]["name"]). " has been uploaded."; } else { echo "Sorry, there was an error uploading your file."; } } } } P.S: My PHP Code works with following HTML Form. &lt;form id="uploadForm" action="upload.php" method="post"&gt; &lt;input name="RESULT_FileUpload-15" id="RESULT_FileUpload-15" size="25" type="file" /&gt; &lt;input type="submit" value="upload" class="btnSubmit" /&gt; &lt;/form&gt; How I can submit the file using javascript and PHP when I get the file name.?
has comment: http://stackoverflow.com/comment/47510324
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/2320069
tagged with: ajax
has answer: http://stackoverflow.com/a/29686516
has comment: http://stackoverflow.com/comment/47510427
score: 0
has comment: http://stackoverflow.com/comment/47509819
has comment: http://stackoverflow.com/comment/47509887
answer count: 1
tagged with: file-upload
linked to: http://stackoverflow.com/q/28207106

http://stackoverflow.com/comment/47353278
score: 1
type: Comment
comment on: http://stackoverflow.com/q/29603804
type: QuestionComment
has text: @Quentin: [It is a jquery selector](https://api.jquery.com/eq/), unavailable in css files. (I have no idea if protractor supports those...)

http://stackoverflow.com/a/29593956
type: Answer
has body: The countdown variable is declared inside the greenTea function. You have to declare it outside the function for it to be accessible from the click handler. You'll also have to put your jQuery functions inside the jQuery ready function: var countdown; function greenTea(){ var duration = 120; $(".clock").html(duration + " sec"); countdown = setInterval(function (greenTea) { if (--duration) { $(".clock").html(duration + " sec"); } else { clearInterval(countdown); $(".clock").html("End Your Steep"); } }, 1000); }; $(function(){ $("a#start").click(greenTea); $('#start').click(function(greenTea){ $('#timedisp').hide(); }); $('#reset').click(function(greenTea) { location.reload(); }); $('.ui-icon-back').click (function(){ clearInterval(countdown)); }); });
score: 0
answers question: http://stackoverflow.com/q/29593880

http://stackoverflow.com/comment/47392146
type: QuestionComment
has text: Are you sure that plugin can attach `jBox` to all the selected elements ? - `attach: $('.delete')`. I don't think so.
comment on: http://stackoverflow.com/q/29624316
score: 0
type: Comment

http://stackoverflow.com/q/29636128
has comment: http://stackoverflow.com/comment/47414514
type: Question
answer count: 2
downvote count: 3
has answer: http://stackoverflow.com/a/29636247
has body: var sentence = window.prompt('Please enter a short sentence describing this home',''); var character = window.prompt('Please enter a single character',''); var count = 0; for (var i = 0; i &lt; sentence.length(); i++) if(sentence.charAt(i) == character) // count++; document.write('The character' + character + 'is appearing ' + count + 'times in your sentence'); else document.write('Character not found.Please try again');
has title: it says "to read a single character from user and check whether the character is present in the sentence or not?please help me
possible better answer: http://stackoverflow.com/a/29636613
tagged with: javascript
has answer: http://stackoverflow.com/a/29636613
score: -3
type: AnsweredQuestion
upvote count: 0
accepted answer: http://stackoverflow.com/a/29636247
favorite count: 0

http://stackoverflow.com/q/29656744
answer count: 2
accepted answer: http://stackoverflow.com/a/29656773
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29656941
favorite count: 0
has answer: http://stackoverflow.com/a/29656773
score: 2
upvote count: 3
downvote count: 1
possible better answer: http://stackoverflow.com/a/29656941
has body: I am toggling my Div's with the following code, but cant figure out if and how to animate it. Any help would be appreciated. The link: The script:
type: AnsweredQuestion
tagged with: toggle
has comment: http://stackoverflow.com/comment/47453201
type: Question
has title: Animate toggle visibility with Jquery

http://stackoverflow.com/a/29697026
score: 4
upvote count: 4
downvote count: 0
has body: afaik isFinal is true, when the mouse is released. But I think, it's not the way to handle it. Found this: "The isFirst and isFinal are kind of internal properties, used by Hammer, but exposed anyway (doesn't hurt)" 1 Instead of unsing e.isFinal, do this: obj.hammer.on('panend',function(e){/*...*/}); But I think, you have to do it another way. So, as I understood, you want manually set the isFinal property to true, so that your "pandleft/right" handler will fire the callback. Try this: after initializing the Hammer Object, add some custom Data: window[oArgs.id + 'Hammer'] = { hammer: new window.Hammer(oArgs.el), x: x, //y: y }; window[oArgs.id + 'Hammer'].hammer.customData = {isFinal: false}; change if (e.isFinal &amp;&amp; oArgs.callback) { to if (obj.hammer.customData.isFinal &amp;&amp; oArgs.callback) { When you think, it's time to set isFinal true (based on your own rules and beliefs): window[oArgs.id + 'Hammer'].hammer.customData.isFinal = true; maybe, you want to set the property to false again in you callback.
type: Answer
has comment: http://stackoverflow.com/comment/97037826
answers question: http://stackoverflow.com/q/29549504

http://stackoverflow.com/a/29664195
has comment: http://stackoverflow.com/comment/47467802
accepted answer of: http://stackoverflow.com/q/29664169
answers question: http://stackoverflow.com/q/29664169
upvote count: 2
has comment: http://stackoverflow.com/comment/47467831
type: AcceptedAnswer
has body: This question might have dozens of answers, but here is just one of them: $j(document).on("click", ".citation", function ( ){ var book = $(this).find('span.book').html(); var divName = $(this).parent().attr('id'); } Note that since your elements are created dynamically you should use .on().
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/47467736
downvote count: 0

http://stackoverflow.com/q/29548879
answer count: 3
has comment: http://stackoverflow.com/comment/47252259
has answer: http://stackoverflow.com/a/75574738
has comment: http://stackoverflow.com/comment/47252301
has comment: http://stackoverflow.com/comment/47252267
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/47252438
has comment: http://stackoverflow.com/comment/47249891
accepted answer: http://stackoverflow.com/a/29550531
has body: Just getting started with Rails and I am trying to create clickable table rows in Rails using bootstrap tables. I have managed to do this, however there seems to be a problem where when I click on the row through to the show page, then press the back button on that page to return to the index view, the clickable rows do not work anymore. I need to refresh the page to get it to work again. I have taken a look at Rails 3 - How to make entire table row clickable using jQuery along with other answers on the site. Still does not seem to work. My code is as follows Index Page <tr data-link="<%= source_path(source) %>"> <%= source.name %> <%= source.description %> <%= link_to truncate(source.url, :length => 40), source.url, :target => '_blank' %> <%= source.category %> <%= source.user.name if source.user %> application.js jQuery(function($) { $("tr[data-link]").click(function() { window.location = this.dataset.link }); })
has comment: http://stackoverflow.com/comment/47252175
tagged with: ruby-on-rails
has comment: http://stackoverflow.com/comment/47252338
has title: Clickable Table Rows in Ruby on Rails
linked to: http://stackoverflow.com/q/20036251
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29550531
possible better answer: http://stackoverflow.com/a/75574738
has comment: http://stackoverflow.com/comment/47252414
type: Question
upvote count: 4
has answer: http://stackoverflow.com/a/78898668
tagged with: javascript
has comment: http://stackoverflow.com/comment/47252375
tagged with: jquery
score: 4

http://stackoverflow.com/q/29551347
tagged with: google-sheets
tagged with: javascript
tagged with: search
has body: So, Google recently updated Google App Script API and added lots of nice features, however, in the process, they also depreciated LOTS of API. I have been working on a Library Database user interface for the place I work on my college campus, and when I wanted to update my app to the new API, a lot of things broke, and I can't figure out how to make them work again. What I am trying to do is get a value from a Google Sheets file, and simply put that value in a text box on the web app. Currently I cannot get that work work. In addition, I discovered something that was troublesome, and that is, the debugger seems to not be correct. I know, bold accusation. Let me try to show you. Code.gs function doGet(e) { var html = HtmlService.createHtmlOutputFromFile('index') .setSandboxMode(HtmlService.SandboxMode.IFRAME); return html; } function searchBooks(searchItem, searchType){ var sI = searchItem; Logger.log(sI); var sT = searchType; Logger.log(sT); var sheets = SpreadsheetApp.getActiveSpreadsheet().getSheets(); var ss = sheets[0]; var itemDataRange = ss.getRangeByName("itemInformation"); var selectedItem = null; //the item that will be returned //var selectedSearch = searchItem; var titles = sheet.getRange("K2:K9507").getValues(); //get the titles of the items var authors = sheet.getRange("J2:J9507").getValues(); //get the authors in the sheet var barcodes = sheet.getRange("B2:B9507").getValues(); //get the barcodes in the sheet var itemsArray = new Array(); if (sT == '') { return null; } else if (sT.value == 'Please select type...') { var test = "this works"; Logger.log(test); return selectedItem; } else if(sT == 'Barcode') { var selectedBarcode = sI; for(var i = 0; i &lt; barcodes.length; i++) //search for the barcode { if(barcodes[i] == selectedBarcode) { selectedItem = titles[i]; break; //break immediately because barcodes are not duplicated } } if(selectedItem != null) { return selectedItem; } else { selectedItem = "No book(s) found"; return selectedItem; } return sel…
answer count: 1
type: UnansweredQuestion
score: 0
has title: Using Google App Script to get values from sheets and display them in text box
has answer: http://stackoverflow.com/a/29551500
type: Question
tagged with: google-apps-script
tagged with: debugging

http://stackoverflow.com/a/29660901
downvote count: 0
score: 1
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/29660819
has body: Object literals in javascript can be declared with quoted keys: { "Okeli-dokeli": "Flanders", "Doh!": "Simpson!" } You can also dynamically assign values to a key in javascript with the bracket syntax: var x = {}; x["A B C"] = "foo"; ADDED: The JSON format is based on a subset of javascript but has object keys which are always quoted. Therefore converting any javascript object to JSON will "stringify" the keys: &gt; JSON.stringify( { a : 'b' } ) &gt; "{"a":"b"}"

http://stackoverflow.com/comment/47484585
type: QuestionComment
type: Comment
has text: @shmuli: you mean two nested loops? Or what do you mean?
comment on: http://stackoverflow.com/q/29672847
score: 0

http://stackoverflow.com/a/29558867
answers question: http://stackoverflow.com/q/29557345
has body: Simply use css.No need any jquery. .myDiv:hover { background-color: #FF0000; }
score: 0
type: Answer

http://stackoverflow.com/comment/47435575
type: Comment
has text: You dont really need jQuery just for this. The performance is better with plain Javascript, given that we reduce the jQuery library loading time.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29647336

http://stackoverflow.com/comment/47432047
comment on: http://stackoverflow.com/q/29643842
score: 0
has text: @mMoovs: Your example document is fine - the code there works for webkit browsers.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/64784032
type: QuestionComment
has text: I'd rather they give an example for each function instead of those things.
comment on: http://stackoverflow.com/q/29589753
score: 4
type: Comment

http://stackoverflow.com/a/29634786
has comment: http://stackoverflow.com/comment/47898905
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29614317
type: Answer
answers question: http://stackoverflow.com/q/29614317
score: 0
has body: You have all of the right code, except you are missing one important detail. Whenever you change the value of Select2 (or any other JavaScript component), you should always trigger the change event. This event is nativly triggered by the browser when the value is changed, but it must be manually triggered when the value is changed programmatically. $("#id_invited_user").trigger("change"); This should always be placed after your call to .val(xyz).

http://stackoverflow.com/comment/47411909
has text: If you define a service by using the "provider recipe" (your fourth bullet), would you be allowed to inject it into a configuration block?
comment on: http://stackoverflow.com/a/29616402
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47364354
score: 0
comment on: http://stackoverflow.com/q/29608168
has text: ok.. this helped. `for (var i in prices) {` `if (prices.hasOwnProperty(i)) {` `// do stuff` `}` `}` But still want to get the ip details
type: QuestionComment
type: Comment

http://stackoverflow.com/q/29602069
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: windows-runtime
favorite count: 0
has title: Native Plugin For Windows 8 Using Cordova
tagged with: cordova
has answer: http://stackoverflow.com/a/29735418
upvote count: 1
type: AnsweredQuestion
tagged with: windows-8
score: 1
type: Question
accepted answer: http://stackoverflow.com/a/29735418
has body: I am creating a windows8 plugin in cordova but i want to be integarte native build like .winmd with my plugin so that through Winjs i m calling the functions of that library which is in c#. I had already added the reference and code into plugin folder and as well as in project. But still it throws an error WinRt Error : class is not register/JavaScript Error : class in not defined. I am creating same plugin in WP but there is issue in windows8 plugin development using cordova winjs with native functionality. please help to resolve this issue, provide some samples , links etc.
tagged with: c#

http://stackoverflow.com/a/29677252
type: Answer
downvote count: 1
upvote count: 0
score: -1
answers question: http://stackoverflow.com/q/29609086
has body: Blobstore is deprecated: https://cloud.google.com/appengine/docs/go/blobstore/reference. Here's how you can upload files to GCS: import ( // these are the appengine imports "golang.org/x/oauth2" "golang.org/x/oauth2/google" "google.golang.org/appengine" "google.golang.org/appengine/datastore" "google.golang.org/appengine/file" "google.golang.org/appengine/urlfetch" "google.golang.org/cloud" "google.golang.org/cloud/storage" ) func serveFilesUpload(res http.ResponseWriter, req *http.Request) { ctx := appengine.NewContext(req) // every app engine app comes with a default bucket bucket, err := file.DefaultBucketName(ctx) if err != nil { panic(err) } // we can't use the regular http client because we need // oauth headers added, and also need to use urlfetch // for app engine hc := &amp;http.Client{ Transport: &amp;oauth2.Transport{ Source: google.AppEngineTokenSource(ctx, storage.ScopeFullControl), Base: &amp;urlfetch.Transport{Context: ctx}, }, } // I'm just giving files random names id := uuid.NewRandom().String() // this get's the file out of the multipart form ff, _, err := req.FormFile("file") if err != nil { panic(err) } defer ff.Close() cctx := cloud.NewContext(appengine.AppID(ctx), hc) wc := storage.NewWriter(cctx, bucket, id) io.Copy(wc, ff) // normally you'd just defer the .Close, but in this case // we care about the error it returns err = wc.Close() if err != nil { panic(err) } json.NewEncoder(res).Encode(id) } A complete example is available here: https://github.com/calebdoxsey/tutorials/tree/master/appengine/cms.

http://stackoverflow.com/q/29651815
has answer: http://stackoverflow.com/a/29652077
has comment: http://stackoverflow.com/comment/47443608
downvote count: 0
answer count: 7
favorite count: 0
possible better answer: http://stackoverflow.com/a/56685858
upvote count: 193
has answer: http://stackoverflow.com/a/29652195
has answer: http://stackoverflow.com/a/56685858
has title: Format date and Subtract days using Moment.js
has comment: http://stackoverflow.com/comment/47443491
has comment: http://stackoverflow.com/comment/47444055
has answer: http://stackoverflow.com/a/37411397
tagged with: momentjs
type: AnsweredQuestion
has body: I would like a variable to hold yesterday's date in the format DD-MM-YYYY using Moment.js. So if today is 15-04-2015, I would like to subtract a day and have 14-4-2015. I've tried a few combinations like this: startdate = moment().format('DD-MM-YYYY'); startdate.subtract(1, 'd'); and this: startdate = moment().format('DD-MM-YYYY').subtract(1, 'd'); and also this: startdate = moment(); startdate.subtract(1, 'd'); startdate.format('DD-MM-YYYY') But I'm not getting it...
type: Question
accepted answer: http://stackoverflow.com/a/29652195
score: 193
has answer: http://stackoverflow.com/a/29652091
tagged with: javascript
has answer: http://stackoverflow.com/a/54794221
tagged with: date
has comment: http://stackoverflow.com/comment/47444006
has comment: http://stackoverflow.com/comment/47443508
has answer: http://stackoverflow.com/a/29652120
has comment: http://stackoverflow.com/comment/47443493

http://stackoverflow.com/comment/47512672
has text: But if I have lots of extenral files, and then concat them into a single file for production, there could be namespace collisions right?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29687814
type: Comment

http://stackoverflow.com/q/29598972
upvote count: 1
has comment: http://stackoverflow.com/comment/47345159
score: 1
tagged with: angular-translate
type: Question
has comment: http://stackoverflow.com/comment/47345945
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47352600
has comment: http://stackoverflow.com/comment/47429740
has comment: http://stackoverflow.com/comment/47345860
has body: I am trying to learn angular-translate using messageformat. When I click my button to change language, i get an error 'undefined is not a function' - but it's not 100% reliable. It happens very easily, but I am not sure which change triggers the error. Reproduced by: Tested in Chrome 41 Firefox developer edition 39 and IE11 also. Does not work. Here is how I reproduced it in detail: On fresh load: Set variable to another number (eg. 3) while still English. Change to Norwegian. Change number to something else. Change back to English. When I try to change the number now, it doesn't work anymore I have recreated my code in a plunker: http://plnkr.co/edit/K4xHNf93Vhkrfc5LmliV?p=preview The code is the following: HTML: {{ 'TITLE' | translate }} {{ 'FOO' | translate }} {{ 'PLURAL' | translate:translationData}} {{ 'BUTTON_LANG_EN' | translate}} {{ 'BUTTON_LANG_DE' | translate}} {{ 'BUTTON_LANG_NO' | translate}} Javascript: angular.module('app', ['pascalprecht.translate']) .config(function ($translateProvider) { $translateProvider.translations('en', { TITLE: 'Hello', FOO: 'This is a paragraph.', BUTTON_LANG_EN: 'English', BUTTON_LANG_DE: 'German', BUTTON_LANG_NO: 'Norwegian', PLURAL: "You have {NUM, plural, =0{no messages} one{1 message} other{# messages}}." }); $translateProvider.translations('de', { TITLE: 'Hallo', FOO: 'Dies ist ein Paragraph.', BUTTON_LANG_EN: 'Englisch', BUTTON_LANG_DE: 'Deutsch', BUTTON_LANG_NO: 'Norwegisch', PLURAL: "Sie haben {NUM, plural, =0{keine Nachrichten haben} one{1 Nachricht} other{# Nachrichten}}." }); $translateProvider.translations('no', { TITLE: 'Hei', FOO: 'Dette er en paragraf', BUTTON_LANG_EN: 'Engelsk', BUTTON_LANG_DE: 'Tysk', BUTTON_LANG_NO: 'Norsk', PLURAL: "Du har {NUM, plural, =0{ingen meldinger} one{1 melding} other{# meldinger}}." }); $translateProvider.useMessageFormatInterpolation(); $translateProvider.preferredLanguage('en'); $translateProvider.fallbackLanguage('en'); }) .controller('Controller', function ($scope, $translate…
tagged with: messageformat.js
has title: Changing language with angular-translate causes error with messageformat and binding
favorite count: 0
tagged with: angularjs
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/29681613
has comment: http://stackoverflow.com/comment/47508861
has comment: http://stackoverflow.com/comment/66151868
has body: I'm running into a strange error but maybe I am using md-select incorrectly. I am trying to go to a new page or sign out based on the ng-selected option. Unfortunately, I am receiving this error: Error: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. html: Settings Sign Out controller: $scope.changeSelected = function(){ switch ($scope.activePage) { case "settings": $location.path( '/account'); break; case "logout": $scope.logout(); break; } }; After navigating to the selected page or logging out I receive the error. Can md-select not be used this way? Edit: It's somehow related to leaving the page without letting md-select finish. If I add a $timeout it works. It's not ideal but at least I can move forward: $scope.changeSelected = function(){ $timeout(function() { switch ($scope.activePage) { case "settings": $location.path( '/account'); break; case "logout": Auth.logout(); break; } }, 1000);
has comment: http://stackoverflow.com/comment/47519306
has comment: http://stackoverflow.com/comment/47508387
has comment: http://stackoverflow.com/comment/47508157
has comment: http://stackoverflow.com/comment/47507987
favorite count: 0
has title: Can I use md-select in angular materials to run a function?
has comment: http://stackoverflow.com/comment/47508217
tagged with: angularjs
has answer: http://stackoverflow.com/a/29685300
type: UnansweredQuestion
upvote count: 9
has comment: http://stackoverflow.com/comment/47507542
tagged with: angular-material
has comment: http://stackoverflow.com/comment/47507707
has comment: http://stackoverflow.com/comment/47509044
score: 9
type: Question
has comment: http://stackoverflow.com/comment/47508112
has comment: http://stackoverflow.com/comment/47507852
has comment: http://stackoverflow.com/comment/47508554
downvote count: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47507604
has comment: http://stackoverflow.com/comment/47508730
has comment: http://stackoverflow.com/comment/47509315
has comment: http://stackoverflow.com/comment/47509009

http://stackoverflow.com/comment/47290966
comment on: http://stackoverflow.com/a/29570758
score: 0
type: AnswerComment
has text: Didn't downvote so can't undownvote - but hopefully downvoters will see you've fixed it.
type: Comment

http://stackoverflow.com/q/29553512
has answer: http://stackoverflow.com/a/29553613
tagged with: javascript
has answer: http://stackoverflow.com/a/29553587
has answer: http://stackoverflow.com/a/29553604
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 10
tagged with: web
has answer: http://stackoverflow.com/a/29553646
duplicate of: http://stackoverflow.com/q/7346563
has title: Reading a simple JSON File in JavaScript
has answer: http://stackoverflow.com/a/29553593
has answer: http://stackoverflow.com/a/29553584
possible better answer: http://stackoverflow.com/a/29553587
has answer: http://stackoverflow.com/a/29553654
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29553608
tagged with: http://stackoverflow.com/tag/json
linked to: http://stackoverflow.com/q/4935632
has answer: http://stackoverflow.com/a/29553586
accepted answer: http://stackoverflow.com/a/29553586
has body: I have a JSON file with this as the content: { "residents": [ { "name" : "Jacob", "title" : "King", "gender" : "Male", }, { "name" : "Luthor", "title" : "Prince", "gender" : "Male" }, { "name" : "Mileena", "title" : "Princess", "gender" : "Female" }, ] } I want to read the json in JavaScript, but certainly, I have no idea. How would I come about with this problem?
type: Question
has answer: http://stackoverflow.com/a/29553622

http://stackoverflow.com/comment/47594271
has text: Really appreciate the help .. dunno how I would have figured out how to add independent line graphs into a combo chart .. I built on your fiddle here it is: https://jsfiddle.net/dr5eaevq/5/
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29706149
type: Comment

http://stackoverflow.com/q/29585639
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29586599
has body: On click of a button, I am showing a popup with one text area and a submit button. I am able to enter a value in the textarea (e.g.: "hello1"), and when clicking on the submit button, I am checking the textarea's entered value, it gives me "hello1", and fades out the pop up. (as expected) Issue: the second time, I click the same button again, I entered the value "hello2", and after submitting, it shows me the last entered value in an alert and fades out. Below is my code: function onCalChange(cal) { // inputField = cal.inputField; startDate = cal.date; var calVal = this.id; popup2(calVal); } function popup2(calVal) { idValue = calVal.split("-"); $('.popup2').css('display','block'); //$('.popup2').addClass('pop_up_bckgd'); $(".popup2").append(" "); $(".popup2").append(" \n\ \n\ \n\ Reason for change \n\ \n\ \n\ \n\ ") } function clicksubmit(id) { var idNum= parseInt(id); if ($('#reasontxt' + idNum).val() == "") { // alert("1"); $('#reasontxt' + idNum).next(".validation").remove(); $('#reasontxt' + idNum).after(" Please enter Reason for change Field "); } else { alert('2'); alert($('#reasontxt' + idNum).val()); $('#reason' + (idNum)).val($('#reasontxt' + idNum).val()); // $('#reasontxt' + idNum).val() == "" $('.popup2').fadeOut(); } }
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47319994
has comment: http://stackoverflow.com/comment/47320871
has answer: http://stackoverflow.com/a/29586599
type: Question
has title: Not able to populate textarea value if it's updated?
answer count: 1

http://stackoverflow.com/q/29616494
tagged with: jsonp
tagged with: javascript
score: 0
answer count: 1
tagged with: backbone.js
has body: I have a RESTful json API, which I need to access in my front-end Backbone site. So, I did this: /* Goal collection */ var GoalCollection = Backbone.Collection.extend({ model: GoalModel, url: "http://staging.api.hiwarren.com:8080/api/v1/goals/?callback=?", sync: function(method, collection, options) { options.dataType = "jsonp"; // options.timeout = 10000; return Backbone.sync(method, collection, options); }, parse: function(response) { return response.results; } }); /* View for the goal collection */ var GoalCollectionView = Backbone.View.extend({ tagName: 'ul', initialize: function(callback){ var that = this; _.bindAll(this, 'render'); that.collection = new GoalCollection(); that.collection.bind('reset', this.render) that.collection.fetch({ dataType: 'jsonp', success: function(collection, response){ that.render(); if(callback) callback(that); }, error: function(collection, response){ throw new Error("Goal fetch error - " + response.statusText); } }); }, render: function(){ this.collection.each(function(goal){ var goalView = new GoalView({ model: goal }); this.$el.append(goalView.render().el); }, this); return this; } }); I am trying to use JSONP, because it is a different domain. I've followed answers to questions similar to this, as you can see in my code, but it doesn't work. Instead, I get this error message: Uncaught Error: Goal fetch error - load Backbone.View.extend.initialize.that.collection.fetch.error options.errorjquery.js:3094 jQuery.Callbacks.fire jQuery.Callbacks.self.fireWithjquery.js:8261 done jQuery.ajaxTransport.send.jQuery.prop.on.callback jQuery.event.dispatchjquery.js:4116 jQuery.event.add.elemData.handle What am I doing wrong? How can I make this work?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29786431
accepted answer: http://stackoverflow.com/a/29786431
has title: Backbone JSONP call from RESTful json API not working
type: Question

http://stackoverflow.com/q/29549834
has answer: http://stackoverflow.com/a/29549914
has body: I have been reading that console.log in IE only works when the console exists (is open). I am currently working through a timing issue in IE and for whatever reason I can only replicate the issue when the console is closed. Therefore, using console.log will not help me since I cannot replicate the issue when the console is open. Is there anyway to have console.log work in IE with the console closed? Is there another approach I could use to write debug data from the browser?
type: Question
has title: Is there a way to have console.log() log messages in IE with the console closed?
tagged with: internet-explorer
tagged with: javascript
answer count: 2
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29549930
has comment: http://stackoverflow.com/comment/47251573
score: 1
upvote count: 1

http://stackoverflow.com/comment/47406034
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29631402
has text: @Juhana yes the timepicker.js file is loaded from my server and shows a status of 200, just like the jquery source file itself.

http://stackoverflow.com/comment/47318870
comment on: http://stackoverflow.com/a/29585085
type: AnswerComment
score: 0
type: Comment
has text: I really wanted to try implementing this solution, but something's wonky for me. Maybe because the script you wrote can't be used if it's place in the init.js file? http://jsfiddle.net/vnt83hz7/2/

http://stackoverflow.com/a/29568500
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/29567838
has body: I believe the answer to your question is yes, this is the correct behavior. When an item within items changes, a new instance of the template is created while the old is simply removed. In your case, a new foo element is created and therefore, the prop attribute value is also new. This is from the Angular ngRepeat documentation: When the contents of the collection change, ngRepeat makes the corresponding changes to the DOM: When an item is added, a new instance of the template is added to the DOM. When an item is removed, its template instance is removed from the DOM. When items are reordered, their respective templates are reordered in the DOM. It doesn't explicitly state what happens on update. But, I believe the new replaces the old rather than update.
answers question: http://stackoverflow.com/q/29567838
has comment: http://stackoverflow.com/comment/47287180

http://stackoverflow.com/q/29548728
has answer: http://stackoverflow.com/a/29548780
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29548776
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/29548793
duplicate of: http://stackoverflow.com/q/4691792
linked to: http://stackoverflow.com/q/4691792
type: UnansweredQuestion
has body: I'm having issues with writing some of my first JQuery code. I'm experimenting with some Codecademy stuff, just messing around and seeing how it works. Right now I'm pretty confused about an issue with anonymous functions: calling a function anonymously works but naming the function and calling it by name does not. The code is supposed to, on clicking an icon, open a menu from the left side of the screen and shift the rest of the page to the right; then do the reverse on clicking the close icon. The first code block works perfectly, the second just opens and closes the menu immediately after the page loads and then does nothing. Is there something I'm missing about order of operations in JS/JQuery or what? Anonymous: function main() { $('.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); }); } Named: function main() { $('.icon-menu').click(open()); $('.icon-close').click(close()); } function open() { $('.menu').animate({left:'0px'}, 200); $('body').animate({left:'285px'}, 200); } function close() { $('.menu').animate({left:'-285px'}, 200); $('body').animate({left:'0px'}, 200); } Thanks to anybody who can enlighten me.
has title: anonymous function vs identical named function

http://stackoverflow.com/comment/47443977
has text: possible duplicate of [How to return the response from an asynchronous call?](http://stackoverflow.com/questions/14220321/how-to-return-the-response-from-an-asynchronous-call)
score: 0
comment on: http://stackoverflow.com/q/29652083
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47252723
comment on: http://stackoverflow.com/a/29549531
has text: How would you assign currentSegment? I see you are trying to iterate over the array with currentSegment++ but the console throws currentSegment undefined.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47323411
type: QuestionComment
has text: Try ```s.onload = function() { alert("202); };```
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29587825

http://stackoverflow.com/comment/47466476
has text: I know your intentions are good, but what you are describing is incorrect in this particular scenario. In your first example, the value of `currentValue` (or `inputValue`) does not change, unless something *inside* the function itself does it. `currentValue` (and `inputValue`) is a local variable and thus cannot be changed from the outside. So, a self invoking function is not necessary, all you have to do is *not* reassign `currentValue` (or `inputValue`) in the function. There are scenarios where what you described is a problem, but this is not one of them.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29662930

http://stackoverflow.com/a/29583450
upvote count: 7
type: Answer
has body: Here is a little step-by-step tutorial to achive this. Shrink the container size ( #underlay ) to the image by using display: inline-block. Also add position: relative. Set the markers container ( .markers ) to position: absolute and set the container dimensions by either using height: 100%; width: 100% or top: 0; right: 0; bottom: 0; left: 0;. Translate the marker contents to the center of the markers position: transform: translateX(-50%) translateY(-50%);. #underlay { display: inline-block; position: relative; } #underlay>img { height: auto; max-width: 100%; width: auto; } #underlay>.markers { position: absolute; top: 0; right: 0; bottom: 0; left: 0; } #underlay>.markers>.marker { position: absolute; } #underlay>.markers>.marker>.marker-content { -webkit-transform: translateX(-50%) translateY(-50%); -moz-transform: translateX(-50%) translateY(-50%); -ms-transform: translateX(-50%) translateY(-50%); -o-transform: translateX(-50%) translateY(-50%); transform: translateX(-50%) translateY(-50%); } DEMO: http://jsfiddle.net/31480m7n/14/
downvote count: 0
score: 7
answers question: http://stackoverflow.com/q/29582571
accepted answer of: http://stackoverflow.com/q/29582571
type: AcceptedAnswer

http://stackoverflow.com/a/29620680
type: Answer
answers question: http://stackoverflow.com/q/29620603
downvote count: 0
score: 1
has body: There is a contains selector that checks if an element containts a certain text. This seems to be what you want For example: $( "a:contains($uservar)") See the documentation for more usages of it: https://api.jquery.com/contains-selector/
upvote count: 1

http://stackoverflow.com/q/29643349
tagged with: angularjs-scope
has answer: http://stackoverflow.com/a/29643555
has answer: http://stackoverflow.com/a/47639574
has title: add watch on a non scope variable in angularjs
score: 20
answer count: 3
downvote count: 0
favorite count: 0
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/29643581
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29643555
type: Question
has answer: http://stackoverflow.com/a/29643581
tagged with: angularjs-directive
upvote count: 20
has body: Is there a way to add watch to a non scope variable. I want to add a watch to local variable. I have something like this function EditAssetRegistryController(assetregistryService, manufacturerService, assettypeService, projectService, $localStorage, $routeParams) { var vm = this; vm.manufacturers = []; vm.projects = []; vm.asset_types = []; vm.ch_group_uniq = 'none'; } here is there a way to add watch to vm.ch_group_uniq? I know how it will be done with scope variable but I have scenarios where I have to check many complex variables.
tagged with: javascript

internet-explorer
tags question: http://stackoverflow.com/q/29622822
tags question: http://stackoverflow.com/q/29649124
tag name: internet-explorer
tags question: http://stackoverflow.com/q/29607674
tags question: http://stackoverflow.com/q/29531239
tags question: http://stackoverflow.com/q/29666843
tags question: http://stackoverflow.com/q/29678969
tags question: http://stackoverflow.com/q/29666682
tags question: http://stackoverflow.com/q/29638824
tags question: http://stackoverflow.com/q/29627872
tags question: http://stackoverflow.com/q/29667922
tags question: http://stackoverflow.com/q/29557821
tags question: http://stackoverflow.com/q/29651435
tags question: http://stackoverflow.com/q/29544763
tags question: http://stackoverflow.com/q/29535735
tags question: http://stackoverflow.com/q/29589371
tags question: http://stackoverflow.com/q/29589770
tags question: http://stackoverflow.com/q/29597596
tags question: http://stackoverflow.com/q/29644378
tags question: http://stackoverflow.com/q/29651160
tags question: http://stackoverflow.com/q/29649191
tags question: http://stackoverflow.com/q/29684553
tags question: http://stackoverflow.com/q/29565477
tags question: http://stackoverflow.com/q/29646409
tags question: http://stackoverflow.com/q/29540617
tags question: http://stackoverflow.com/q/29548297
tags question: http://stackoverflow.com/q/29614966
tags question: http://stackoverflow.com/q/29557517
tags question: http://stackoverflow.com/q/29644193
tags question: http://stackoverflow.com/q/29607816
tags question: http://stackoverflow.com/q/29532063
type: Tag
tags question: http://stackoverflow.com/q/29587231
tags question: http://stackoverflow.com/q/29549834
tags question: http://stackoverflow.com/q/29627672
tags question: http://stackoverflow.com/q/29549026

http://stackoverflow.com/a/29674769
downvote count: 0
has comment: http://stackoverflow.com/comment/47489151
has comment: http://stackoverflow.com/comment/47488420
has comment: http://stackoverflow.com/comment/47487503
type: Answer
score: 2
upvote count: 2
has body: What you're experiencing is called event bubbling. Events triggered on elements deeper in the hierarchy will "bubble" up towards the root of the DOM tree, hence the parent element receives click events instantiated by the child elements. The easiest way to fix this is to check which element triggered the original event by checking event.target: Installation Wood Floor Installation Sub Floor Preparation Type of your subfloor Wood Floor Fitting Method
answers question: http://stackoverflow.com/q/29674656
has comment: http://stackoverflow.com/comment/47488796

http://stackoverflow.com/a/29601040
has body: When you retrieve request payload data you can use either BodyParsers(they use the Content-Type header to parse the payload into something else) or you can get the payload yourself via form binding or directly as JSON IF you have a JSON/textual payload in the request body. In your case, you have a Content-Type of either application/x-www-form-urlencoded OR multipart/form-data. So you need to bind to that form with a helper class get that data and IF you really want to convert it to JSON you'll just add an additional step of inserting it in a ObjectNode. If you want your form data as JSON, do the conversion directly on the frontend, if possible and send it in the body as Content-Type application/json. Now, do you understand why what you want to do just adds additional complexity for no apparent gain?
score: -1
has comment: http://stackoverflow.com/comment/47364904
has comment: http://stackoverflow.com/comment/47364828
downvote count: 1
has comment: http://stackoverflow.com/comment/47364816
answers question: http://stackoverflow.com/q/29565485
has comment: http://stackoverflow.com/comment/47365048
type: Answer
has comment: http://stackoverflow.com/comment/47357260
upvote count: 0
has comment: http://stackoverflow.com/comment/47364775
has comment: http://stackoverflow.com/comment/47364610

http://stackoverflow.com/q/29668559
favorite count: 0
has answer: http://stackoverflow.com/a/44795189
type: UnansweredQuestion
has body: I am trying to use ckeditor inline with knockoutjs in a modal dialog. But it is not working. Ckeditor all buttons are diasbled. It is not working only chrome browser. It is working on firefox and ie. I found a solution but it is not great for me. Problem is about modal showing status. &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"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;span class="sr-only"&gt;Close&lt;/span&gt;&lt;/button&gt; &lt;h4 class="modal-title" contenteditable="true" id="myModalLabel"&gt;Modal title&lt;/h4&gt; &lt;/div&gt; &lt;div id="bodyModal" contenteditable="true" 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; &lt;/div&gt; &lt;button type="button" class="btn btn-default navbar-btn margin-right-button-nav" data-toggle="modal" data-target="#myModal"&gt;&lt;span class="glyphicon glyphicon-new-window"&gt;&lt;/span&gt; Edit Modal&lt;/button&gt; CKEDITOR.disableAutoInline = true; CKEDITOR.inline('myModalLabel'); CKEDITOR.inline('bodyModal'); Here is a Fiddle
has title: Ckeditor is not working in a modal dialog
tagged with: twitter-bootstrap-3
downvote count: 2
has comment: http://stackoverflow.com/comment/47475594
type: Question
linked to: http://stackoverflow.com/q/25639922
score: -2
tagged with: javascript
tagged with: ckeditor
has answer: http://stackoverflow.com/a/29669622
has comment: http://stackoverflow.com/comment/47477172
answer count: 2
has comment: http://stackoverflow.com/comment/48943164
upvote count: 0

http://stackoverflow.com/comment/91857568
has text: it creates bin folder in application root when running app which needed sudo permissions.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29878932

http://stackoverflow.com/comment/47288982
comment on: http://stackoverflow.com/a/29568499
has text: This is probably the best reply I have ever gotten on stack overflow.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/29540308
answer count: 1
tagged with: facebook-graph-api
has answer: http://stackoverflow.com/a/29557630
favorite count: 0
type: UnansweredQuestion
tagged with: facebook
has body: I am using FB.ui to share a link: This is my code FB.ui({ method: 'feed', link: 'link', picture: 'picture', name: 'name', caption: 'title', description: 'share_text' } I am testing this inside the Facebook Application on IOS. So its a facebook canvas application. The share works fine, but after i click share i get a blank window with a cancel button. If i click the cancel button i am back to the website. From what i can tell, the popup being opened by FB.ui doesn't gets closed after share. Thanks, Radu
downvote count: 0
score: 1
type: Question
tagged with: ios
tagged with: javascript
has title: Facebook share shows blank page after share
upvote count: 1

http://stackoverflow.com/comment/47400859
type: AnswerComment
has text: That works with any animatable property.
comment on: http://stackoverflow.com/a/29628830
type: Comment
score: 1

http://stackoverflow.com/q/29560923
type: Question
accepted answer: http://stackoverflow.com/a/29803353
has comment: http://stackoverflow.com/comment/47276727
downvote count: 0
tagged with: javascript
tagged with: base64
has comment: http://stackoverflow.com/comment/47271985
has comment: http://stackoverflow.com/comment/47272451
has comment: http://stackoverflow.com/comment/47272514
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: Multiple Base64 images on Html page and smooth loading
favorite count: 0
has comment: http://stackoverflow.com/comment/47272395
has answer: http://stackoverflow.com/a/29803353
upvote count: 1
type: AnsweredQuestion
has body: Does someone know a technique to make asynchonous image parsing when multiple images are printed (base64) on a webpage ? It causes Firefox to have small freeze on loading/parsing on a gaming machine (for more than 15 images 1.5MB), so I'm a bit worried of that. Still I think giving an url and using a javascript async (lazy) image loading is better, if someone have some more informations tips, I'll be glad to hear it Thanks.
has comment: http://stackoverflow.com/comment/47272821
score: 1
has comment: http://stackoverflow.com/comment/47271633
has comment: http://stackoverflow.com/comment/47272183
tagged with: image
has comment: http://stackoverflow.com/comment/47276406

http://stackoverflow.com/a/29609534
has body: Use the two Events "Pause" and "Resume". You will find all Events here in the Apache Cordova Events Documentation. Event - Pause: The pause event fires when the native platform puts the application into the background, typically when the user switches to a different application. Event - Resume The resume event fires when the native platform pulls the application out from the background. You can add an Eventlistener for that into your code. For those two Events that would be: Pause - Quick Example document.addEventListener("pause", onPause, false); function onPause() { // Handle the pause event } Or Full Example like this: Pause Example Resume - Quick Example document.addEventListener("resume", onResume, false); function onResume() { // Handle the resume event } Or Full Example like this Resume Example Try that out and let me know, if you need further help!
has comment: http://stackoverflow.com/comment/47378160
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29606012
answers question: http://stackoverflow.com/q/29606012
type: Answer
upvote count: 59
has comment: http://stackoverflow.com/comment/85511263
score: 59
has comment: http://stackoverflow.com/comment/72806704

http://stackoverflow.com/q/29570247
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29571146
has title: Multi-View Form AngularJS reroute
answer count: 1
downvote count: 0
has body: I have been experimenting with a few ways to create this form. Scotch seemed to have a great tutorial with nested views. This is the part of the JS file I assume the problems occur. I created a demo at http://plnkr.co/edit/nNTEI4tBw0XFana1nKIS?p=preview. .controller('formController', function($scope) { // we will store all of our form data in this object $scope.formData = {}; // function to process the form $scope.processForm = function() { if ($scope.formData = '"phone":"iphone' &amp;&amp;'"type":"xbox"'){ parent.location='results'; } }; }); How do I get the submit button to reroute to the results.html? (I wouldn't be surprised if my JS was less than pristine) any help would be awesome.
favorite count: 0
tagged with: angularjs
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29571146
score: 1
upvote count: 1
type: Question
tagged with: angular-ui-router

http://stackoverflow.com/q/29643928
has answer: http://stackoverflow.com/a/29644948
type: AnsweredQuestion
has title: iPhones copy paste menu gets closed when updating view
has comment: http://stackoverflow.com/comment/47428793
tagged with: mobile-safari
has comment: http://stackoverflow.com/comment/47429477
tagged with: angularjs-scope
has comment: http://stackoverflow.com/comment/47428922
type: Question
has comment: http://stackoverflow.com/comment/47429296
has comment: http://stackoverflow.com/comment/47429334
tagged with: javascript
has body: I have an order page with a countdown which tells the user how much time he has left to complete his order. We spotted that when the user wants to paste something into an input field and opens this context menu for it, the menu will close each time the timer updates. JS var app = angular.module("EvTest", []); app.controller("TestController", function($scope, $interval) { $scope.counter = 1; $interval(function() { $scope.counter++; }, 1000); }); HTML &lt;div ng-controller="TestController"&gt; &lt;input type="text" style="width:100%;" placeholder="Test me!" /&gt; {{counter}} &lt;/div&gt; Fiddle: http://jsfiddle.net/bojarhwt/ Is there any way around this?
score: 0
has comment: http://stackoverflow.com/comment/47428939
answer count: 1
accepted answer: http://stackoverflow.com/a/29644948
has comment: http://stackoverflow.com/comment/47429193
tagged with: angularjs

http://stackoverflow.com/q/29576705
answer count: 2
has body: So I want to set up a basic node server to work with my clientside Angular application. My folder structure looks like this: .tmp //Contains css stylesheet bower //Obviously contains bower packages public //Contains client code This is what my index.html looks like (at least, the scripts/stylesheets) And this is my middleware configuration in my server.js file: app.use(logger()); //require('morgan') app.use(express.static('./')); app.use(express.static('./public/')); app.use(express.static('./tmp/')); app.use('/*', express.static('./public/index.html')); What I understand this does is that: for every request: Log it See if you can find the file request under ./ If it's not there, looks under ./public/ If it's not there, look under ./tmp/ If it's not there and the request contains something after the '/' serve index.html How I'm going to handle client-side routing (with Angular's $routeProvider) is not clear to me yet, perhaps I won't even need to do that, I'm not sure if those requests will go to the server. However doing all of this results in an infinite loop and I honestly have no idea why. I thought I understood middleware but obviously there's something wrong with my logic, or this would be working. So basically my 2 questions are: Is what I summed up how express' middleware works? If it's not, perhaps you could give me a push in the right direction? Don't just point me to express' docs, I've read them over like 5 times but I find that the documentation doesn't explain it clearly enough.
accepted answer: http://stackoverflow.com/a/29577280
downvote count: 0
has title: Having some trouble understanding middleware
favorite count: 0
possible better answer: http://stackoverflow.com/a/29577268
has answer: http://stackoverflow.com/a/29577268
tagged with: node.js
type: AnsweredQuestion
upvote count: 3
has answer: http://stackoverflow.com/a/29577280
tagged with: middleware
type: Question
score: 3
linked to: http://stackoverflow.com/q/23499853
tagged with: javascript
tagged with: express

http://stackoverflow.com/q/29612856
has comment: http://stackoverflow.com/comment/47371351
tagged with: arrays
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29613379
has body: I'm trying to filter an array and return a new array with the matching elements. So for example var names = ["Kanye, West","Drake, Ross", "Rick, Boss", "Steven, Ross"]; function filterName(arr,pattern){ //logic here return newArr } filterName(names,"ss"); //output ["Drake, Ross", "Rick, Boss", "Steven, Ross"]; Can someone point me in the right direction? Do I need regex to get something like this to work? Thank you for reading!
favorite count: 0
has answer: http://stackoverflow.com/a/29612906
possible better answer: http://stackoverflow.com/a/29612909
accepted answer: http://stackoverflow.com/a/29613379
has title: Filtering thru an array and returning a new array with matching pattern
has answer: http://stackoverflow.com/a/29612909
tagged with: regex
answer count: 4
type: AnsweredQuestion
upvote count: 1
type: Question
score: 1
has answer: http://stackoverflow.com/a/29612876

http://stackoverflow.com/a/29644441
type: Answer
has comment: http://stackoverflow.com/comment/47434455
has comment: http://stackoverflow.com/comment/47431709
has comment: http://stackoverflow.com/comment/47431748
has body: Instead of constructing the series array manually you could loop through the sales variable data and construct the array. So what ever the number of elements in the sales.SalesData array, all items will be there in the series array var series = [], salesData= sales.SalesData; for (var i=0 i&lt; salesData.length; i++) { series.push({"name" : key, "data" : sales[key]}) } This constructed series array is part of the object which you must pass as argument to highcharts method. var chartdata = { chart: {type: 'column'}, title: {text: 'Sales Data'}, xAxis: { categories: ['Category 1','Category 2'] }, yAxis: { min: 0, title: {text: 'Sales'} }, series : [] } chartdata.series = series; $('#chart').highcharts(chartdata); where #chart is the container where you want to display the chart. you can also refer to the fiddles which are available in their demo pages for each type of chart to know more on how to display a particular type of chart.
score: 5
upvote count: 5
answers question: http://stackoverflow.com/q/29643609
downvote count: 0

http://stackoverflow.com/q/29553999
has answer: http://stackoverflow.com/a/29554066
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
score: 0
has title: Ajax request on document the ready will cause slow loading jquery
upvote count: 1
tagged with: php
downvote count: 1
has body: I have a project that I make with so many ajax request on document.ready. More over i also have ajax request for every database transaction i have. I have a js file where i have ajax request and for every ajax request i have a php page where i handle the database things. For the ajax request that i send on document.ready those are the request to populate select option that the data are from database. My Question: Is there a limit on how many ajax request i should send. Will the number of ajax request slow down my project. What are the ways to avoid my project be slow.
type: Question
accepted answer: http://stackoverflow.com/a/29554066
type: AnsweredQuestion

http://stackoverflow.com/a/29535052
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47223150
upvote count: 2
has body: You can put condition ng-show=builds.builds.build.length &gt; 0 So when the builds.builds.build have data then only it will be displayed
answers question: http://stackoverflow.com/q/29534980

http://stackoverflow.com/q/29631870
accepted answer: http://stackoverflow.com/a/29636605
type: AnsweredQuestion
type: Question
has title: Multiple markers Google Map API v3 from array of addresses using Angular Js
tagged with: javascript
has answer: http://stackoverflow.com/a/29636605
tagged with: google-maps-api-3
score: 0
answer count: 2
tagged with: google-maps
has answer: http://stackoverflow.com/a/29671950
has body: I have to implement the multiple markers functionality from array of addresses using angular js. Here is my fiddle : http://jsfiddle.net/cVsdp/175/ But i'm getting the following error : Uncaught Error: [$injector:modulerr] Failed to instantiate module MyApp Can any one please help me.
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/29671950

http://stackoverflow.com/q/29630192
tagged with: ribbon
tagged with: javascript
answer count: 3
downvote count: 0
has title: Disable/Enable Ribbon for set time
possible better answer: http://stackoverflow.com/a/29702643
favorite count: 0
has answer: http://stackoverflow.com/a/29752543
accepted answer: http://stackoverflow.com/a/29752543
tagged with: plugins
has body: I have a plugin for Contact entity that triggers on Create. It then calls the WCF service and creates a new record in the back office (MSSQL). The same entity have another plugin that fires when record is Updated. Issue I am having is when if I create a new record and within a minute change detail and try to save it, the update plugin fails. This is because the Create plugin is still running. (And the record I am trying to update still doesn't exist in the back office DB) Is there a way to disable 'Save' or 'Save &amp; Close' button in the ribbon while the status of the Create plugin is not Complete or Failed? Or at least disable it for say 120 Sec so it is not clicked on right away? CRM 2011 RU18 On Premise. (All end users are restricted to use IE so I can use JS) Thank you in advance,
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/29826793
upvote count: 3
has answer: http://stackoverflow.com/a/29702643
type: Question
tagged with: dynamics-crm-2011

http://stackoverflow.com/comment/47364188
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29563408
has text: `onUpdated` fires multiple times. Try to filter by status `comlpete`.
score: 0

http://stackoverflow.com/comment/47506020
type: Comment
type: QuestionComment
has text: Hi @MarcB so far Google Analytics shows that only IE 9 and 11 have seen this script. In all instances it failed.
comment on: http://stackoverflow.com/q/29684553
score: 0

http://stackoverflow.com/comment/47280822
type: Comment
has text: @TomaszSklepowicz also you can't use `document.write` after a page loads. it will wipe out everything in the whole page. You need to return the full html as response ....inspect the request in your browser console!!
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29565416

http://stackoverflow.com/comment/47290145
score: 0
type: AnswerComment
type: Comment
has text: Ok, I have got it working how I want in somewhat of a hacky fashion lol but I have a weird issue with foundation. The html5 video background is clipping through the navbar when it is in mobile size and makes it go red. I cant find out what's causing it :-( Any ideas? Thanks again!!
comment on: http://stackoverflow.com/a/29568786

http://stackoverflow.com/comment/47365153
score: 0
type: AnswerComment
type: Comment
has text: Worked like a charm. Can you tell me what does the `div[class]` do?And what does it do "beneath the surface"? I never saw before this type of referring to an element. Does it somehow tracks only indexes of the elements with that `[class]`? I also tried it when all elements with "div[class]" have the same class (or id) , and it still works. Is that actually array of classes of nested divs?
comment on: http://stackoverflow.com/a/29608307

http://stackoverflow.com/comment/47487973
score: 0
comment on: http://stackoverflow.com/a/29674646
has text: @Beki You could wipe the canvas clean, but seriously, you should not worry about those things till they hit you, because if you're asking questions like this there are a million other things that you didn't optimize either and have a bigger effect.
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29532108
answers question: http://stackoverflow.com/q/29532066
upvote count: 1
score: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47217541
has body: To stop new values constantly being appended you need to store the original value as it was on load of the page. Using a data attribute is ideal for this. Then on the change event of the dropdown you can retrieve that value and append to it. Try this: $('#PrsIDNo').data('original-value', $('#PrsIDNo').val()); $('#Company').change(function () { var companyid = $(this).val(); var PrsIDNo = $('#PrsIDNo').data('original-value'); $('#PrsIDNo').val(companyid + PrsIDNo); }); Choose Com1 Com2 Com3
downvote count: 0
has comment: http://stackoverflow.com/comment/47217738
has comment: http://stackoverflow.com/comment/47217727
type: Answer
has comment: http://stackoverflow.com/comment/47218006
has comment: http://stackoverflow.com/comment/47217462
accepted answer of: http://stackoverflow.com/q/29532066

http://stackoverflow.com/q/29550723
linked to: http://stackoverflow.com/q/844001
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29550954
has comment: http://stackoverflow.com/comment/47253103
has comment: http://stackoverflow.com/comment/47253159
answer count: 3
has comment: http://stackoverflow.com/comment/47252981
linked to: http://stackoverflow.com/q/26923015
has comment: http://stackoverflow.com/comment/47253255
has comment: http://stackoverflow.com/comment/47253296
favorite count: 0
type: UnansweredQuestion
has body: I have the use case, where I need to allow for processing an arbitrary array of strings, by an arbitrary regex, which is created either by a regex literal, or through the new RegExp() constructor. It all works fine, until the global g flag is used with capturing groups. I read a few answers on SO, and the proposed solution is to use regex.exec(string) in a while loop, e.g. How do you access the matched groups in a JavaScript regular expression?, JavaScript regular expressions and sub-matches I also talked about it on IRC, and was advised against the implementation all together: but there's regexes that will segfault your engine, unless you're using spidermonkey. So here is a corner case, try pasting it into a fiddle or plunker, or even the console, it just breaks: var regexString = '([^-]*)'; var flags = 'ig'; var regex = new RegExp(regexString, flags); var arr = ['some-property-image.png', 'another-prop-video.png', 'y-no-work.bmp']; var result = []; arr.forEach(function(item) { var match; var inter = []; while (match = regex.exec(item)) { inter.push(match[0]); } }); console.log(result); I did tried it on regex101.com https://regex101.com/r/xG0cL4/1 It breaks even if I do it without the quantifier, i.e. /([^-])/g https://regex101.com/r/yT7sQ2/1 My question: what is the (correct|safe) way to process arbitrary regexes against arbitrary strings?
upvote count: 1
has answer: http://stackoverflow.com/a/29551205
has title: Capturing groups regex with global flag in JavaScript
tagged with: regex
has comment: http://stackoverflow.com/comment/47253247
score: 1
has answer: http://stackoverflow.com/a/29550927
type: Question
linked to: http://stackoverflow.com/q/432493
has comment: http://stackoverflow.com/comment/47253065

http://stackoverflow.com/q/29580162
tagged with: jquery-select2
type: Question
accepted answer: http://stackoverflow.com/a/29582075
has body: I have the following JSON, that is retrieved via /tags: [ { "id": "CSS", "text": "CSS" }, { "id": "HTML", "text": "HTML" }, { "id": "JavaScript", "text": "JavaScript" }, { "id": "jQuery", "text": "jQuery" }, { "id": "MySQL", "text": "MySQL" }, { "id": "PHP", "text": "PHP" } ] I have an &lt;input /&gt; that is made to accept tags by using Select2: &lt;input name="Tags" id="Tags" value="PHP,HTML,jQuery" /&gt; And I have attached Select2 this way: $("#Tags").select2({ tags: true, tokenSeparators: [",", " "], createSearchChoice: function(term, data) { if ($(data).filter(function() { return this.text.localeCompare(term) === 0; }).length === 0) { return { id: term, text: term }; } }, multiple: true, ajax: { url: '/tags', dataType: "json", data: function(term, page) { return { q: term }; }, results: function(data, page) { return { results: data }; } } }); Problems When I load the page, the default values go off. The Select2 fires a request to /tags, but it doesn't load the tags. There are no errors in the console too. I am using Select2 3.5.2 from CDN. Where am I going wrong?
score: 0
has comment: http://stackoverflow.com/comment/47367132
answer count: 1
has comment: http://stackoverflow.com/comment/47364131
has title: Select2 AJAX Tags
tagged with: tags
tagged with: javascript
tagged with: jquery
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29582075
tagged with: ajax

http://stackoverflow.com/comment/47254609
type: Comment
has text: I never read a serious article that says *why* `innerHTML` is/*should* be unsafe.
comment on: http://stackoverflow.com/q/29551391
score: 0
type: QuestionComment

http://stackoverflow.com/a/29662220
score: 1
has comment: http://stackoverflow.com/comment/47556082
answers question: http://stackoverflow.com/q/29660559
upvote count: 1
has body: You do not need special directive for this, due to value-binding u can just change scope variable and popover will change also. So u simply: Mouseenter And in changeVar you can change $scope.var any way you want. Here is example plunk ($http call emulated using $timeout): http://plnkr.co/edit/gnm1BtnHzNLnvO62Ar2i?p=preview
has comment: http://stackoverflow.com/comment/47640805
type: Answer
has comment: http://stackoverflow.com/comment/47641919
downvote count: 0
has comment: http://stackoverflow.com/comment/47512511
has comment: http://stackoverflow.com/comment/47641287
has comment: http://stackoverflow.com/comment/47556612

http://stackoverflow.com/comment/47377047
type: Comment
comment on: http://stackoverflow.com/a/29591710
has text: Seems like includes would be easier. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes
score: 0
type: AnswerComment

http://stackoverflow.com/comment/53095032
type: AnswerComment
type: Comment
has text: The download/save is ok for me too. But do you have any idea why it is not working with iframe
score: 1
comment on: http://stackoverflow.com/a/32594800

http://stackoverflow.com/q/29643478
score: 0
has comment: http://stackoverflow.com/comment/47429044
type: UnansweredQuestion
tagged with: selectize.js
tagged with: php
tagged with: laravel
answer count: 0
has title: selectize.js displaying selected value when user clicks back page button
type: Question
has body: I am using selectize.js in a project. I'm using laravel 4.2. When user posts a form and then clicks back button, the form's input values that user write are displaying on the screen. But selectboxes created by using selectize are empty. How can I display selected values of selectboxes created by using selectize when user clicks back page button on a web browser? Can anybody help with this issue?
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/49086426

http://stackoverflow.com/a/29667381
type: AcceptedAnswer
type: Answer
upvote count: 6
has comment: http://stackoverflow.com/comment/47473660
accepted answer of: http://stackoverflow.com/q/29666798
downvote count: 1
has body: There are three cases where AngularJS will perform a full page reload: Links that contain target element Example: link Absolute links that go to a different domain Example: link Links starting with '/' that lead to a different base path when base is defined Example: link Updated: Using javascript: The $location service allows you to change only the URL; it does not allow you to reload the page. When you need to change the URL and reload the page or navigate to a different page, please use a lower level API: $window.location.href. See: https://docs.angularjs.org/guide/$location https://docs.angularjs.org/api/ng/service/$location
answers question: http://stackoverflow.com/q/29666798
score: 5

http://stackoverflow.com/comment/117519073
type: Comment
score: 0
has text: autoplay="false" is not respected by Firefox 86. Should remove the attribute for it to NOT autoplay. The same happens with the attribute loop.
comment on: http://stackoverflow.com/a/29567755
type: AnswerComment

http://stackoverflow.com/a/29580409
accepted answer of: http://stackoverflow.com/q/29579088
has body: You can use this (?=([^\']*\'[^\']*\')*[^\']*$)\b(?!and\b|in\b|between\b)[a-zA-Z]\w+ with global and case-insensitive modifiers. You can add any reserved word to (?!and\b|in\b|between\b) (don't forget the boundary) See the demo.
upvote count: 2
answers question: http://stackoverflow.com/q/29579088
type: Answer
score: 2
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/29596540
answers question: http://stackoverflow.com/q/29596315
upvote count: 1
has comment: http://stackoverflow.com/comment/47339870
type: Answer
has body: If you wanted to update metalValue to include the results from the purity check, you could just update this.metalValue = function(colorTest){ // ... sum = spotPrice * this.weight * this.authentic(colorTest); return sum; } and call it with customerCindy.metalValue('brown'); Since this is just an example, there's no reason to worry about it, but presumably the purity in the real world would be just as much an instance property as the metal and the weight, and wouldn't actually be a transient value for a method like this. But that's neither here nor there.
downvote count: 0
score: 1

http://stackoverflow.com/comment/47369825
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29612141
type: AnswerComment
has text: This doesn't help me as to why it's not being set as the background image though.

http://stackoverflow.com/q/29684951
has comment: http://stackoverflow.com/comment/47508393
has body: Before I begin, I just wanted to say that I know this question is out there, but the answer was unclear, and I don't have enough reputation to comment asking for clarification. So I apologize about that. Anyway, my question (and code) is very similar (but not quite identical) to that in the link above. I'm trying to read the name of each image into an array that I can get into later, but every time I run the script, it returns an error. var images = new Array(30); //I already know there are 30 pictures var i = 0; $.ajax({ url: "projects/pj", success: function(data){ alert("success"); $(data).find("a:contains(.jpg), a:contains(.JPG), a:contains(.png), a:contains(.PNG), a:contains(.gif), a:contains(.GIF)").each(function() { images[i] = $(this).attr("href"); i++; }); }, error: function(jqXHR, textStatus, errorThrown){ alert("error"); } }); The folder "projects" is in the same directory as the script, just to be clear. Thanks so much for your help! EDIT: I just thought I'd add that I've used this technique before for getting picture names, but I didn't try to put them into an array, I just added them to a list. $.ajax({ url: "content/images", success: function(data){ $(data).find("a:contains(.jpg), a:contains(.JPG), a:contains(.png), a:contains(.PNG), a:contains(.gif), a:contains(.GIF)").each(function() { var images = "content/images/" + $(this).attr("href"); $('#container ul').append('&lt;li&gt;&lt;/li&gt;'); $('&lt;img&gt;').attr("src", images).appendTo($('li').last()); }); $('#container ul li').first().addClass('active'); } }); This one worked. Not sure why this one does and the one I'm asking about doesn't.
upvote count: 1
linked to: http://stackoverflow.com/q/25803005
has title: Constant error attempting to find images with ajax?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47508197
score: 1
accepted answer: http://stackoverflow.com/a/29685754
type: Question
has comment: http://stackoverflow.com/comment/47507929
has comment: http://stackoverflow.com/comment/47508641
has comment: http://stackoverflow.com/comment/47507896
downvote count: 0
has comment: http://stackoverflow.com/comment/47507241
tagged with: javascript
tagged with: jquery
tagged with: ajax
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47508169
answer count: 1
has comment: http://stackoverflow.com/comment/47509399
has comment: http://stackoverflow.com/comment/47506861
favorite count: 0
has comment: http://stackoverflow.com/comment/47508218
has comment: http://stackoverflow.com/comment/47508107
has answer: http://stackoverflow.com/a/29685754

http://stackoverflow.com/q/29578847
has title: D3: SVG downloadable, but attributes gone
linked to: http://stackoverflow.com/q/2483919
type: AnsweredQuestion
score: 1
type: Question
has answer: http://stackoverflow.com/a/29579084
downvote count: 0
answer count: 1
tagged with: javascript
has body: I need to make my D3-created SVG charts downloadable. I found one answer to this question that suggested encoding SVG's XML to base64, but then I found this post that said plain text should be OK too, so I came up with something like this: The above code works partially, because the download link can be opened in the browser or downloaded to a file, but in each case only the circles are visible and all else (ie. width, height, bg color) is lost, so the SVG is only properly displayed in the original HTML page. What is the right way to get the full code of SVG created with D3? I tried svg.html() and d3.select(svg).html(), but it returns null.
favorite count: 0
accepted answer: http://stackoverflow.com/a/29579084
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js
upvote count: 1

http://stackoverflow.com/comment/47374641
score: 0
type: Comment
type: QuestionComment
has text: I'll see if I can mockup a fiddle; I'm doing this at work and it's near quittin' time.
comment on: http://stackoverflow.com/q/29614438

http://stackoverflow.com/comment/47292043
comment on: http://stackoverflow.com/q/29571260
has text: I'm trying to make this line dynamic `div.type = element.value;`. So replace `type` during the `switch`.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29583226
has comment: http://stackoverflow.com/comment/47317912
has body: I worked on a sample for you: https://jsfiddle.net/tp32z47w/ $(function(){ var count = 0; var images = ['http://globe-views.com/dcim/dreams/sky/sky-01.jpg', 'http://fc07.deviantart.net/fs70/i/2010/249/8/f/funny_sky_by_miffliness_stock-d2y71pa.jpg', 'http://images.nationalgeographic.com/wpf/media-live/photos/000/010/cache/mackerel-sky_1054_990x742.jpg' ] $(window).scroll(function(){ $('body').css('background-image','url(' + images[count] + ')'); $('body').css('background-repeat','no-repeat'); count = count + 1; if(count == images.length) //reset the counter count = 0; }); }); You can have an array of image urls. Buy increasing the value of a counter variable in each scroll, you can move to the next item in the array by using the counter variable as the index of the array.
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/47315151
type: Answer
score: 1
answers question: http://stackoverflow.com/q/29583021

http://stackoverflow.com/comment/47263610
type: QuestionComment
has text: $('.editable').on('mousedown' .... something i guess
comment on: http://stackoverflow.com/q/29556510
score: 0
type: Comment

sorting
tags question: http://stackoverflow.com/q/29585459
tags question: http://stackoverflow.com/q/29532147
tags question: http://stackoverflow.com/q/29601731
tags question: http://stackoverflow.com/q/29589770
tags question: http://stackoverflow.com/q/29659738
tags question: http://stackoverflow.com/q/29642295
tags question: http://stackoverflow.com/q/29653725
tags question: http://stackoverflow.com/q/29643218
tags question: http://stackoverflow.com/q/29637847
tags question: http://stackoverflow.com/q/29686564
tags question: http://stackoverflow.com/q/29574186
tags question: http://stackoverflow.com/q/29585475
tags question: http://stackoverflow.com/q/29565422
tags question: http://stackoverflow.com/q/29679814
tags question: http://stackoverflow.com/q/29635796
tags question: http://stackoverflow.com/q/29581470
type: Tag
tags question: http://stackoverflow.com/q/29663847
tags question: http://stackoverflow.com/q/29579273
tags question: http://stackoverflow.com/q/29533325
tag name: sorting
tags question: http://stackoverflow.com/q/29533865
tags question: http://stackoverflow.com/q/29623333
tags question: http://stackoverflow.com/q/29652465
tags question: http://stackoverflow.com/q/29615381
tags question: http://stackoverflow.com/q/29612832
tags question: http://stackoverflow.com/q/29666935

http://stackoverflow.com/a/29601922
downvote count: 2
answers question: http://stackoverflow.com/q/29601836
type: Answer
has body: use this line &lt;script language="javascript" type="text/javascript"&gt;
upvote count: 0
score: -2
has comment: http://stackoverflow.com/comment/47349982

http://stackoverflow.com/a/29566551
has comment: http://stackoverflow.com/comment/47282588
upvote count: 1
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: Change this: $(this).next("a").text('Scegli'); to this: $(this).find("a").text('Scegli'); See this fiddle Or better, take advantage of chaining: $('#riga'+id_cella).children('td').each(function(index, element){ var $ele = $(element), noOre = !$ele.hasClass('ore'); if(noOre){ $ele.fadeOut('fast',function(){ $ele.removeClass('planned').addClass('planning').find("a").text('Scegli').end().fadeIn('fast'); }); } }); See this fiddle for that
score: 1
accepted answer of: http://stackoverflow.com/q/29566395
answers question: http://stackoverflow.com/q/29566395

http://stackoverflow.com/q/29655080
accepted answer: http://stackoverflow.com/a/29655223
has body: I'm trying to create a small captcha to learn JavaScript. I'm using PHP to create the captcha image, refreshing the image, clearing box, changing colors of form are done by JavaScript. My problem is starting at refreshing that PHP generated image. I've written the code using the 'src' attribute, but it doesn't work with Firefox. I just could test with Chrome (I'm currently on linux and can't access a windows computer), it works. On Firefox, I've tried with a static image. With static image, it works on Firefox also. My PHP code works perfectly (also it's not a issue about client-side) so there is my JavaScript code that refreshes the image: function cpt_refreshCaptcha() { document.getElementById("cpt_theImage").src = cpt_path + "cpt_interface.php?p=img"; console.log("src = " + document.getElementById("cpt_theImage").src); cpt_resetBox(); } I also checked the cpt_path + "cpt_interface.php?p=img part, it seems to be correct. What is my problem with Firefox?
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29655223
has title: img.src won't work with Firefox, but Chrome
linked to: http://stackoverflow.com/q/14155480
upvote count: 1
tagged with: php
has answer: http://stackoverflow.com/a/29655328
type: Question
has comment: http://stackoverflow.com/comment/47450140
type: AnsweredQuestion
duplicate of: http://stackoverflow.com/q/14155480
score: 1
has comment: http://stackoverflow.com/comment/47450682
possible better answer: http://stackoverflow.com/a/29655328
answer count: 2

http://stackoverflow.com/a/29687240
answers question: http://stackoverflow.com/q/29687010
downvote count: 0
score: 1
has body: I would suggest using jQuery to do this. In particular check out the animate() function. Now there are many different ways to accomplish this effect and they will have different implementations depending on the outcome that is need. I have a JSFiddle link following where I give you one such example. In the example I have a wrapper div that has overflow: hidden applied to it to act as the "hiding bound". Then I wrap the 3 div's in a slide wrapper to allow for vertical sliding. Then all I did was add a click event to the #first and #second div's that move the #slideWrapper up by the appropriate margin's with an animated effect supplied by jQuery $.animate() function. This should give you a good place to start. https://jsfiddle.net/ph7ryon3/2/
upvote count: 1
type: Answer

http://stackoverflow.com/a/29591106
score: 1
accepted answer of: http://stackoverflow.com/q/29591037
has body: The ui.values array is just an argument, changing it doesn't change the settings of the slider. You change the settings like this $('.slider').slider({ range: true, create: function (event, ui) { $(this).slider( "option", "max", $(this).data('maxValue') ); $(this).slider( "option", "min", $(this).data('minValue') ); } }); Note that you'd usually just do this on instantiation $('.slider').each(function() { $(this).slider({ max: $(this).data('maxValue'), min: $(this).data('minValue') }); });
answers question: http://stackoverflow.com/q/29591037
upvote count: 1
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/47405212
type: QuestionComment
comment on: http://stackoverflow.com/q/29631158
has text: I got this code from a new book called "Object-oriented javascript" by Stoyan Stefanov and Kumar Chetan Sharma
score: 0
type: Comment

http://stackoverflow.com/comment/47508310
score: 0
comment on: http://stackoverflow.com/q/29685589
type: Comment
type: QuestionComment
has text: \d is similar to[0-9] and ^ means begin with $ means end with.In this case digits. * means zero or more occurences

http://stackoverflow.com/q/29629030
has comment: http://stackoverflow.com/comment/47401019
upvote count: 0
has comment: http://stackoverflow.com/comment/47401111
has title: Where is the unary operator and the operand here?
tagged with: javascript
type: UnansweredQuestion
favorite count: 0
has answer: http://stackoverflow.com/a/29629146
tagged with: unary-operator
type: Question
score: -1
downvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/47401072
has comment: http://stackoverflow.com/comment/47401622
has body: if (document .getElementByid('header')) // Found: do something } else { // Not found: do something else } In "JavaScript and JQuery: Interactive Front-End Web Development" by Jon Duckett it is written: Because the presence of an object or array can be considered truthy, it is often used to check for the existence of an element within a page. A unary operator returns a result with just one operand. Here you can see an if statement checking for the presence of an element. If the element is found, the result is truthy, so the first set of code is run. If it is not found, the second set is run instead. Is the writer means that the if keyword is considered a unary operator and the document.getElementById('header') is the operand ?
has comment: http://stackoverflow.com/comment/47401595

http://stackoverflow.com/comment/47462634
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29661458
score: 1
has text: Check your javascript console by hitting f12 in your favorite browser. Do you see any errors?

http://stackoverflow.com/a/29613175
has comment: http://stackoverflow.com/comment/47371916
has comment: http://stackoverflow.com/comment/47372114
has body: In general there's no "explicit" binding of this. The value of this is determined whenever a function is invoked based on the nature of the invocation. It has nothing to do with the circumstances of the function's "birth". When a function is called after having its reference discovered via an object property lookup, as in: obj.someFunction(); then the object reference involved (obj, above) will be the value of this in that particular invocation of the function. However, the function reference can easily be copied to another object: var otherObj = { someFunction: obj.someFunction }; otherObj.someFunction(); Now the value of this (in that particular invocation) will be a reference to otherObj, not obj. If the reference to the function is copied to a plain variable: var func = obj.someFunction; func(); the value of this in that invocation will be a reference to window, or undefined if the code happens to be in a "strict" context. Through all this, note that the fact that the function may originally have been declared as a property value in an object literal has nothing to do with what ends up being the value of this in an invocation. A way to create an explicit "binding" is to take advantage of the built-in .call() or .apply() methods available to every function instance: function whatever() { /* ... */ } var objWhatever = function() { whatever.call(obj); }; That setup explicitly forces a reference to obj to be used as the value of this in an invocation of function whatever(). You can also use the built-in (in modern environments) .bind() function to create such a "bound" function: var objWhatever = whatever.bind(obj); I personally would hesitate to call that a "bound" function, because under the covers it's just an explicit call via .call(), but terminology is not something I worry about too much. :)
has comment: http://stackoverflow.com/comment/47371951
score: 3
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29613146
answers question: http://stackoverflow.com/q/29613146
type: AcceptedAnswer
upvote count: 3
has comment: http://stackoverflow.com/comment/47372165
type: Answer

http://stackoverflow.com/a/29585637
has comment: http://stackoverflow.com/comment/47319487
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47320899
answers question: http://stackoverflow.com/q/29585568
upvote count: 2
has body: You can simply navigate to the target page in the selected event handler: object.on('selected', function() { window.location.href = "http://www.example.com/"; })
has comment: http://stackoverflow.com/comment/47349804
type: Answer
has comment: http://stackoverflow.com/comment/69708098

http://stackoverflow.com/q/29671661
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29672865
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/47481458
has answer: http://stackoverflow.com/a/29672865
tagged with: jquery
has answer: http://stackoverflow.com/a/29674033
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has body: I have a navigation bar with a drop-down hover on the sub menu which works fine on a desktop but doesn't work very well on a mobile device as it covers all the other tabs and also doesn't work well on a touch-screen, as soon as you take your finger off the dropdown the hover will disappears. I would like to be able to click the dropdown on the sub-menu and then stay there in a line. much like the navigation itself when in mobile view. Jsfiddle Demo HTML Home other tab dropdown other sub tab other sub tab other sub tab other sub tab other sub tab other sub tab other sub tab other tab other tab other tab other tab Menu CSS nav { height:40px; width:100%; color:#fff; background:#86c024; font-size:11pt; position:relative } nav a { color:#fff; display:inline-block; width:auto; text-align:center; text-decoration:none; line-height:40px } nav ul { padding:0; margin:0 auto; max-width:1000px; width:100% } nav li { display:inline; float:left; height:40px; /* this should be the same as your nav height */ position:relative /* this is needed in order to position sub menus */ } nav li a { padding:0 15px; border-right:1px solid #fff; box-sizing:border-box; -moz-box-sizing:border-box; -webkit-box-sizing:border-box } nav a:hover { background:#2098d1; color:#fff; width:100% } nav ul ul { /* this targets all sub menus */ display:none; /* hide all sub menus from view */ position:absolute; left:0; top:40px /* this should be the same height as the top level menu -- height + padding + borders */ } nav li li a { border:none; font-size:10pt } nav ul ul li { /* this targets all submenu items */ float:none; /* overwriting our float up above */ width:100px /* This needs to match the value we set below */ } nav ul ul li a { /* target all sub menu item links */ padding:5px 10px } nav ul li:hover > ul { display:inline-block; /* show sub menus when hovering over a parent */ background:gray; text-align:center; border:0; z-index:100 } nav li a:link,a:visited { color:#fff } nav li:last-child a { border…
has title: CSS/Jquery - Navigation dropdown when viewing on mobile/tab
tagged with: navigation
type: Question
possible better answer: http://stackoverflow.com/a/29674033

http://stackoverflow.com/comment/47362712
score: 0
has text: The error message seems quite clear to me. The spec for `Access-Control-Allow-Headers` is [quite easy to find](https://duckduckgo.com/?q=W3C+Access-Control-Allow-Headers).
type: QuestionComment
comment on: http://stackoverflow.com/q/29608560
type: Comment

http://stackoverflow.com/q/29564231
has comment: http://stackoverflow.com/comment/47302059
has title: Three.js CTM object load with Orbicontrol changes focus on object
has body: I started to play around with three.js. I have decided to use THREE.CTMLoader() to load in my objects. I had a PerspectiveCamera set up with OrbitControls. It was working perfectly when I used other 3D object loading methods like .obj or .js. Now it rotates the 3D objects instead of move the camera. I think its more of a general issue, just wondering if anyone encountered with anything similar. Some code for clarification: //camera camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 1, 1000 ); camera.position.z = 300; camera.position.y = -500; controls = new THREE.OrbitControls( camera ); controls.addEventListener( 'change', render ); //model load var loader = new THREE.CTMLoader(); loader.load( "3dobjects/blue.ctm", function( geometry ) { var material = new THREE.MeshLambertMaterial( { color: 0xffffff, map: THREE.ImageUtils.loadTexture( "3dobjects/blue.jpg" ), combine: THREE.MixOperation } ); geometry.name = "blue"; callbackModel( geometry, 20, material, -150, 0, 0, 0, 0 ); }, { useWorker: true } ); I will want to juts move the camera on 2 planes instead of all 3 so I guess I will need to write my own camera control instead of using the orbit control, but it is still interests me. What did go wrong? Edit: It seems like the camera orbit size(r) turned to 0. Maybe it is a better description. Edit2: function callbackModel( geometry, s, material, x, y, z, rx, ry ) { var mesh = new THREE.Mesh( geometry, material ); mesh.position.set( x, y, z ); mesh.scale.set( s, s, s ); mesh.rotation.x = rx; mesh.rotation.z = ry; mesh.castShadow = true; mesh.receiveShadow = true; scene.add( mesh ); objects.push( mesh ); }
type: Question
tagged with: three.js
has comment: http://stackoverflow.com/comment/47325119
tagged with: perspectivecamera
score: 0
answer count: 0
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/comment/47496655
comment on: http://stackoverflow.com/a/29662066
type: AnswerComment
has text: Sure, I suggest you to write a new question. :)
score: 0
type: Comment

http://stackoverflow.com/comment/47322813
has text: I added the html its just a simple a tag
comment on: http://stackoverflow.com/q/29584445
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47419607
type: QuestionComment
comment on: http://stackoverflow.com/q/29638666
score: 0
has text: Thanks for your instant replies. ok I use the getElementById then how I check that value if it is equal to 0? Thanks
type: Comment

http://stackoverflow.com/a/29625416
has body: Add this var re = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i; return re.test(email);
downvote count: 0
answers question: http://stackoverflow.com/q/29625290
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/a/29640466
answers question: http://stackoverflow.com/q/29639551
type: Answer
has body: Quite strange use of $setValidity, but anyways: {{ key }}.
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/29639551
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/a/29642117
score: 3
has body: Use object.value to set the value and object.disabled to disable the input in Javascript. Demo: document.getElementById("button").addEventListener("click", function(){ // I have added a sample button for testing var inputElementObject = document.getElementById("input"); // get the input element object inputElementObject.value = "0"; // set the value inputElementObject.disabled = true; // set the disabled property }); Click me! Check out how to set the properties for here on MDN.
upvote count: 3
has comment: http://stackoverflow.com/comment/47425967
has comment: http://stackoverflow.com/comment/47426009
accepted answer of: http://stackoverflow.com/q/29642076
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29642076
type: Answer

http://stackoverflow.com/comment/47369056
has text: That works perfectly! So ng-change listens for changes to the ng-model?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29611622

http://stackoverflow.com/comment/47390026
score: 0
type: AnswerComment
has text: @RGraham Thanks! I've stated that.
comment on: http://stackoverflow.com/a/29622880
type: Comment

http://stackoverflow.com/q/29623642
has comment: http://stackoverflow.com/comment/47391124
has body: I have two options as below: Apple Mango My issues: if I toggle any of the value i.e Apple or mango the screen should clear the previous details which entered. If i select Apple only one tab should enable if i select Mango all the tab should enable I have 4 tabs in screen textbox1, Textbox2, Txtbox3, txtbox4. So to be clear, in txtbox1 I have select option Apple &amp; mango. If I select apple1 txtbox2 should enable, 3 &amp; 4 should disable. If I select mango all txtbox should enable
has comment: http://stackoverflow.com/comment/47391063
score: -2
has comment: http://stackoverflow.com/comment/47390978
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47390911
has answer: http://stackoverflow.com/a/29624896
has comment: http://stackoverflow.com/comment/47391037
has comment: http://stackoverflow.com/comment/47391070
type: UnansweredQuestion
downvote count: 3
upvote count: 1
has title: To clear the screen and adding the details using javascript
type: Question

http://stackoverflow.com/comment/47298170
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29534769
has text: Thank you that did it, don't know how I overlooked that. Thanks again! I would up vote you if I had the reputation btw

http://stackoverflow.com/q/29673750
has title: not work php button to perform the action
type: Question
has body: I've started to use the car dealer script. Unfortunately, this script is not possible to change the language of the visitor's side. Therefore, the first picture of the dropdown menu code, where you can choose between English and German, I copy from administrator panel. When you change the language from English to German and refresh the page, then I again left the English language. first picture In the second picture shows that this time I will present copied the update button, from administrator panel, this time changing the language and press the update button, nothing happens, the language does not change, when I refresh the page, then remains the same English. second picture Language changes only through the administrator panel. What should I do for the visitor himself could change the page language? this is a drop down menu code, which I browser from admin panel to header file &lt;div class="field"&gt; &lt;select name="lang"&gt; &lt;?php foreach(Lang::fetchLanguage() as $lang):?&gt; &lt;option value="&lt;?php echo $lang-&gt;abbr;?&gt;"&lt;?php if($core-&gt;lang == $lang-&gt;abbr) echo ' selected="selected"';?&gt;&gt;&lt;?php echo $lang-&gt;name;?&gt;&lt;/option&gt; &lt;?php endforeach;?&gt; &lt;/select&gt; &lt;/div&gt; this is an update button code &lt;button type="button" name="dosubmit" class="wojo positive button"&gt; &lt;?php echo Lang::$word-&gt;CONF_UPDATE;?&gt; &lt;/button&gt; &lt;input name="processConfig" type="hidden" value="1" /&gt; In my controller.php I found this code /* == Proccess Configuration == */ if (isset($_POST['processConfig'])): $core-&gt;processConfig(); endif; what should I do to make this feature work, the visitor could itself change the language? if you need any more info, feel free to ask me, because I'm really new to this world. Sorry for my English, English language use with google translate
tagged with: javascript
tagged with: jquery
answer count: 1
favorite count: 0
score: 4
type: UnansweredQuestion
downvote count: 2
tagged with: php
upvote count: 6
has answer: http://stackoverflow.com/a/29674383

http://stackoverflow.com/q/29633407
has title: Adding an EventListener to button
has comment: http://stackoverflow.com/comment/47409393
upvote count: 1
has body: i have an input[type="text"] that when i press the down key, it adds focus to a button. if(e.keyCode == 40 &amp;&amp; document.getElementsByClassName('list-item').length &gt; 0){ document.getElementsByClassName('list-item')[0].focus(); console.log(document.activeElement); } I want to know if it's possible for me to add an eventListener to keyboard events on a button, even if the button is a input[type="button"] or a &lt;button&gt; tag. I've added two events that worked, and the two events that are relative to the keyboard are not working. Is that possible? collection[i].addEventListener('click', function(e){ console.log('click'); }); collection[i].addEventListener('focus', function(e){ console.log('focus'); }) collection[i].addEventListener('keyup', function(e){ console.log('keyup'); }) collection[i].addEventListener('keypress', function(e){ console.log('keypress'); }) ps: i don't want any jquery
answer count: 0
tagged with: javascript
type: UnansweredQuestion
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47409397
favorite count: 0
type: Question

http://stackoverflow.com/comment/47430305
type: AnswerComment
has text: Some explanation on what the changes are and why they now works (even in code comments) would improve this answer
type: Comment
comment on: http://stackoverflow.com/a/29642978
score: 0

http://stackoverflow.com/a/29543769
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47242166
type: Answer
score: 1
has body: A couple things I noticed Use value instead of Value Place quotes around block and none &lt;script&gt; function validatePass() { var nP = document.getElementById("newPassword").value; var cP = document.getElementById("confirmPassword").value; var oP = document.getElementById("oldPassword").value; var allowSubmit = false; if (oP == null || oP == "") { document.getElementById("passMismatch").innerHTML = "Please input your current password!"; document.getElementById("passMismatch").style.display = "block"; allowSubmit = false; } else if (nP == null || nP == "") { document.getElementById("passMismatch").innerHTML = "Please input a new password!"; document.getElementById("passMismatch").style.display = "block"; allowSubmit = false; } else if (cP == null || cP == "") { document.getElementById("passMismatch").innerHTML = "Please confirm new password!"; document.getElementById("passMismatch").style.display = "block"; allowSubmit = false; } else if (cP != nP) { document.getElementById("passMismatch").innerHTML = "New password mismatch! Try again."; document.getElementById("passMismatch").style.display = "block"; allowSubmit = false; } else { document.getElementById("passMismatch").style.display = "none"; allowSubmit = true; } return allowSubmit; } &lt;/script&gt;
accepted answer of: http://stackoverflow.com/q/29543437
downvote count: 0
answers question: http://stackoverflow.com/q/29543437
upvote count: 1

http://stackoverflow.com/q/29616101
has comment: http://stackoverflow.com/comment/47380035
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47378789
has comment: http://stackoverflow.com/comment/47381130
has comment: http://stackoverflow.com/comment/47389843
tagged with: html5-appcache
accepted answer: http://stackoverflow.com/a/29623060
has comment: http://stackoverflow.com/comment/47377950
type: Question
tagged with: javascript
has title: Cache Website after login
tagged with: caching
score: 0
has comment: http://stackoverflow.com/comment/47378134
answer count: 1
has answer: http://stackoverflow.com/a/29623060
has comment: http://stackoverflow.com/comment/47383910
has body: Let me explain my situation I have a website that is connected with mysql to verify login credentials so the user can login to his profile page. I have read about HTML 5 App cache and it suits me,but how can i force App cache to cache files for offline use after the login verification? I know that i can store (username and password) in javascript but this is wrong because anyone can see the username and password after. So to summarise, is it possible my Website to be stored offline with app cache but after the login page?
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/47595200
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29688221
has text: You could create a different plashkha for each location?

http://stackoverflow.com/comment/47310035
type: Comment
comment on: http://stackoverflow.com/a/29576680
has text: ok, I see. sorry but i don't understand the last phrase. the easing function is from a % to the next % (eg. 0%-20%). You can check my attempt in this [fiddle link](http://jsfiddle.net/ocy13kh9/7/). by the way, you already answered me saying _there's not a better method than the one I exposed_, so I assume this is the best answer!
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47303820
comment on: http://stackoverflow.com/q/29577610
has text: where exactly to add the click()
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47230063
score: 0
has text: Are you running this from your own machine or a hosted service? Did you check your Spam? Did you start the session? Not having a `From:` in headers could be why. Many services will consider it as spam and discarded.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29538734

http://stackoverflow.com/q/29596026
type: UnansweredQuestion
tagged with: express
tagged with: sqlite
linked to: http://stackoverflow.com/q/17954743
has comment: http://stackoverflow.com/comment/47339017
type: Question
linked to: http://stackoverflow.com/q/23667086
tagged with: node.js
duplicate of: http://stackoverflow.com/q/23667086
has comment: http://stackoverflow.com/comment/47338998
has title: Why JS function's execution sequence for controlling sqlite3 database is not step by step?
score: 0
has body: I have a sqlite3 js controller function for node.js : exports.findUser=function findUser(user){ var temp ; var db = new sqlite3.Database('kitchen.db'); var stmt_user_find = "SELECT * FROM user WHERE un = ?"; db.all(stmt_user_find,user,save); function save(err, rows) { if (err) throw err; console.log(rows); temp = rows; } db.close(); return temp; } and another function in router using Express: app.post('/login', function (req, res){ var un=req.body.un; var pw=req.body.pw; console.log('router '+db.findUser(un)); }); The result of console is : router undefined [ { un: 'as', em: 'sss', pw: 'sss' } ] The second function aims to get the value from sqlite database, but the result from console shows that the 'return temp' statement is executed firstly and return to the second function, and later the inner function (save) of findUser function is executed. So why it is like this and how can I get value from database? Thank you, I have tried for hours in this problem.
has answer: http://stackoverflow.com/a/29596118
answer count: 1
has comment: http://stackoverflow.com/comment/47338908
tagged with: javascript

http://stackoverflow.com/q/29667294
has body: I need to create a drilldown on the type of column graph shown below. This is what I have done so far. I am able to create the simple graph but not sure how to implement the dropdown functionality. Any help on this would be appreciated. Please note that the sample data given comes from a python script. function create_graph() { var maingraph = chart = new Highcharts.Chart ({ chart: { height: 600, width: 1200, renderTo: container1, type: 'column' //reflow: false }, title: { text: maingraph[0].graphTitle }, xAxis: { categories: maingraph[0].xAxisLabels }, yAxis: { min: 0, title: { text: maingraph[0].yAxisTitle } }, tooltip: { headerFormat: '{point.key} ', pointFormat: ' {series.name}: ' + ' {point.y} ', footerFormat: ' ', shared: true, useHTML: true }, plotOptions: { column: { pointPadding: 0.2, borderWidth: 0 } }, series: generateMainData(), <!--drilldown: { <!--series: generateChildData() <!--} }); } function generateMainData(g) { return [{ name: 'Males', data: g[0].yAxisValues <!--drilldown: what to write here? }, { name: 'Females', data: g[1].yAxisValues }]; <!--drilldown: what to write here? } if () { create_graph(); } maingraph = [{'xAxisLabels': ['Trait1', 'Trait2'], 'yAxisTitle': 'yTitle', 'graphTitle': 'Title', 'xAxisTitle': 'Traits', 'yAxisValues': [0.41, 0.71]}, {'xAxisLabels': ['Trait1', 'Trait2'], 'yAxisTitle': 'yTitle', 'graphTitle': 'Title', 'xAxisTitle': 'Traits', 'yAxisValues': [0.28, 0.27]}] childgraph = [{'Trait1': {'xAxisLabels': ['Facet1', 'Facet2'], 'yAxisTitle': 'yTitle', 'graphTitle': 'Title', 'xAxisTitle': 'Facets', 'yAxisValues': [0.19, 0.17]}, 'Trait2': {'xAxisLabels': ['Facet3', 'Facet4'], 'yAxisTitle': 'yTitle', 'graphTitle': 'Facets', 'xAxisTitle': 'Facets', 'yAxisValues': [0.96, 0.22]}}, {'Trait1': {'xAxisLabels': ['Facet1', 'Facet2'], 'yAxisTitle': 'yTitle', 'graphTitle': 'Facets', 'xAxisTitle': 'Facets', 'yAxisValues': [0.33, 0.34]}, 'Trait2': {'xAxisLabe…
type: Question
score: 0
tagged with: highcharts
tagged with: drilldown
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/29668741
has title: Drilldown on column graph using Highcharts
type: UnansweredQuestion

http://stackoverflow.com/q/29637033
type: Question
has title: Adobe Livecycle - Creating an object
tagged with: javascript
tagged with: livecycle-designer
upvote count: 1
has comment: http://stackoverflow.com/comment/47417595
tagged with: adobe
favorite count: 0
has body: I want to create an object in Livecycle. Let say I want to create the object Person which will hold name, address, age, profession. With JavaScript for example, it would be simple. function person(name, address, age, profession) { this.name = name this.address = address this.age = age this.profession = profession } But how can I do it in Livecycle ? Thanks !
answer count: 0
downvote count: 0
type: UnansweredQuestion
score: 1

http://stackoverflow.com/q/29634958
has answer: http://stackoverflow.com/a/44671193
tagged with: angularjs-ng-options
type: Question
tagged with: angularjs-ng-model
tagged with: javascript
tagged with: angularjs-scope
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/29635283
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29635218
has title: AngularJS ngModel Directive with select field and ngOptions
has body: I'm trying to have some code run during the link callback of the ngModel directive using AngularJS on a select field that uses ngOptions. module.directive("ngModel",function(){ console.log('ng-model called'); return { restrict: 'A', priority: -1, // give it lower priority than built-in ng-model link: function(scope, element, attr) { console.log('watching'); scope.$watch(attr.ngModel,function(value){ if (value){ console.log("changing"); } }); } } }); See this fiddle which demonstrates the problem: http://jsfiddle.net/d3r3zwLj/3/ The first select field is populated using ng-options, while the second has its options explicitly written out in html. If you open up the console, you can see that you only see the "changing" message when you change the second select field. Changing the first does nothing. You'll also notice immediately that you only see 'ng-model called' and 'watching' once, even though there are two fields with ng-model on them. I'd expect ngModel directive to work on both select fields. What is ng-options doing that is preventing the ngModel from working? Thanks!

http://stackoverflow.com/comment/47482016
type: QuestionComment
has text: Then @MrVentzi 's answer below is what you're looking for.
score: 0
comment on: http://stackoverflow.com/q/29671862
type: Comment

http://stackoverflow.com/comment/47267233
type: QuestionComment
has text: Lets see your code in full please.
comment on: http://stackoverflow.com/q/29558533
score: 1
type: Comment

http://stackoverflow.com/comment/47337170
score: 3
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29593544
has text: Note that you would usually do `var bar = Object.create( Foo.prototype );`, which gives you the expected behaviour.

http://stackoverflow.com/q/29660552
linked to: http://stackoverflow.com/q/111102
has comment: http://stackoverflow.com/comment/47460549
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/29660571
answer count: 2
has answer: http://stackoverflow.com/a/29660656
has title: Why does this function not increment the timeout?
has body: I'm trying to figure out why this script doesn't increment the timeout by i, which is what I'd expect it to do: for( var i=0; i&lt;10; i++ ){ setTimeout( function(){ console.log( i ); }, i*10 ); } This just logs 10, ten times. setTimeout should have access to i, as should the function, from what I can tell. Still, it doesn't work as I expect it to. Here is a fiddle
possible better answer: http://stackoverflow.com/a/29660656
has comment: http://stackoverflow.com/comment/47460579
linked to: http://stackoverflow.com/q/5226285
linked to: http://stackoverflow.com/q/750486
accepted answer: http://stackoverflow.com/a/29660571
has comment: http://stackoverflow.com/comment/47460526
type: AnsweredQuestion
duplicate of: http://stackoverflow.com/q/5226285
has comment: http://stackoverflow.com/comment/47460552
type: Question

http://stackoverflow.com/comment/47443325
comment on: http://stackoverflow.com/a/29651727
has text: @user500468 couldnt add fiddle link without code so there is the link i hope this helps
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47370248
type: Comment
type: QuestionComment
score: 0
has text: When do you want the change to happen? On click, or when the extension finishes running? What's the change you wish to see? What would the HTML look like (a) after the extension and (b) after the "change"? And of course, what have you tried?
comment on: http://stackoverflow.com/q/29611982

http://stackoverflow.com/q/29560844
accepted answer: http://stackoverflow.com/a/29562404
tagged with: node.js
type: AnsweredQuestion
has body: I am fairly new to node.js, and have a program that I have to set an environment variable in order to run (using the noble library, my bash command is: sudo NOBLE_HCI_DEVICE_ID=x node program.js, to tell my code which Bluetooth adapter - HCI device - to use). The reason behind this is that I have a number of modules, each needing their own Bluetooth adapter, and I wish to specify in my code which adapter each module should use. I've found lots of articles telling me how to consume environment variables in my code and set them via the command line (process.env.VARIABLE_NAME), but nothing telling me how to set them from within node.js. Is it possible to set the environment variables in my node.js code?
tagged with: bluetooth-lowenergy
has answer: http://stackoverflow.com/a/29562998
linked to: http://stackoverflow.com/q/22312671
upvote count: 44
possible better answer: http://stackoverflow.com/a/29562998
type: Question
has title: Node.js - how to set environment variables in code
has answer: http://stackoverflow.com/a/29562404
tagged with: javascript
has comment: http://stackoverflow.com/comment/101486363
answer count: 3
has answer: http://stackoverflow.com/a/29560968
downvote count: 0
score: 44
favorite count: 0
tagged with: linux

http://stackoverflow.com/comment/47284067
score: 0
type: Comment
type: QuestionComment
has text: if you look at the documentation, if you make changes to the stick ie resize the window you need to use ($("#headerbg2").unstick()) first so it clears it first. i put in an on resize event in the demo to demonstrate it dynamically -- http://jsfiddle.net/2qe4zg21/
comment on: http://stackoverflow.com/q/29550981

http://stackoverflow.com/q/29683677
has comment: http://stackoverflow.com/comment/52949013
has answer: http://stackoverflow.com/a/32532509
downvote count: 0
tagged with: ace-editor
type: UnansweredQuestion
has body: I'm currently trying to require ace-builds (installed from bower) with webpack. Since it's a huge lib, I'm adding the whole folder to noParse option. I'm running webpack with -d option on terminal. The problem is: when my code tries to require it, it is an empty object. Also, it's not loaded by the browser. Here are some information of what I'm doing: My file: // custom_editor.js // ace-builds are aliased by ace keyword var Ace = require('ace/ace'); // This is an empty Object when I'm debugging with breakpoints Config file: // webpack.config.js var webpack = require('webpack'); var path = require('path'); module.exports = { entry: { form: path.join(__dirname, 'static/main_files/form.js'), vendor: [ 'jquery', 'react', 'underscore', 'query-string', 'react-dnd', 'react-select-box' ] }, output: { path: path.join(__dirname, 'static/bundle'), filename: '[name].bundle.js' }, module: { loaders: [{ test: /\.jsx$/, loader: 'jsx-loader?insertPragma=React.DOM' }], noParse: [ /ace-builds.*/ ] }, resolve: { extensions: ['', '.js', '.jsx'], root: [ __dirname, path.join(__dirname, 'static'), path.join(__dirname, 'node_modules') ], alias: { jQueryMask: 'node_modules/jquery-mask-plugin/dist/jquery.mask', twbsDropdown: 'node_modules/bootstrap-sass/assets/javascripts/bootstrap/dropdown', 'twbs-datetimepicker': 'node_modules/eonasdan-bootstrap-datetimepicker/src/js/bootstrap-datetimepicker', ace: 'bower_components/ace-builds/src', 'select-box': 'node_modules/react-select-box/lib/select-box', queryString: 'node_modules/query-string/query-string', moment: 'node_modules/moment/moment' } }, plugins: [ new webpack.ResolverPlugin( new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin("bower.json", ["main"]) ), new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery' }) ] }; It was not loaded on Chrome's Network panel It is showing on Chrome's Sources panel (Don't know why because no ace.map file were loaded either) Really running out of ideas of what I'm doing wrong here. Is there any go…
type: Question
score: 14
has comment: http://stackoverflow.com/comment/47507884
has title: How to require 'ace-builds/ace' with Webpack and noParse option
tagged with: webpack
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/52922384
favorite count: 0
upvote count: 14

http://stackoverflow.com/q/29670991
tagged with: javascript
has title: ReactJS: text-align justify not working
has comment: http://stackoverflow.com/comment/47481292
answer count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/48161985
has comment: http://stackoverflow.com/comment/47480459
tagged with: css
has comment: http://stackoverflow.com/comment/47481639
has comment: http://stackoverflow.com/comment/48164208
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29671924
linked to: http://stackoverflow.com/q/11589590
tagged with: text-justify
type: Question
tagged with: reactjs
score: 5
has body: I have been using text-align: justify to evenly distribute menus. Following this tutorial and it is working perfectly. However, it breaks when I use ReactJS to create the view. A comparison can be found here: http://jsfiddle.net/j7pLprza/1/. I use these two simple components to populate the menus: var MenuItem = React.createClass({ render: function() { return ( &lt;li&gt; {this.props.title} &lt;/li&gt; ); } }); var TopMenus = React.createClass({ render: function() { return ( &lt;div className="break"&gt; &lt;nav&gt; &lt;ul&gt; {this.props.menus.map(function(menu) { return (&lt;MenuItem title={menu.title} /&gt;); })} &lt;/ul&gt; &lt;/nav&gt; &lt;/div&gt; ); } }); After exploration, I think it is caused by ReactJS, which removes all line-break and white-space after &lt;li&gt; items. This will disable text-align: justify. It happens for AngularJS as well (but I can fix it by using a add-space-all directive). I reached only this issue after googling: https://github.com/facebook/jsx/issues/19. But I quickly got lost. I tried to add some extra content, such as {'\n'} and {' '}, but ReactJS reports syntax errors. Please help. Thanks. UPDATE 1: Following the accepted answer, my menus works in Chrome Emulator. However, when I visit from iPhone 5c (Chrome browser), the result is as if the extra space is not recognized. After trying different combinations, this one works: var TopMenus = React.createClass({ render: function() { return ( &lt;div className="break"&gt; &lt;nav&gt; &lt;ul&gt; {this.props.menus.map(function(menu) { return [(&lt;MenuItem title={menu.title} /&gt;), '&amp;nbsp; ']; })} &lt;/ul&gt; &lt;/nav&gt; &lt;/div&gt; ); } }); Please be noted that the extra space in &amp;nbsp; is necessary. Missing either &amp;nbsp; or breaks it. It works then on Nexus 7, iPhone 5c (Chrome and Safari). However, I do not know the exact reason. If anyone knows, please help. UPDATE 2: Still buggy. So I switched to Flex layout. And it is super easy. An example is: http://jsfiddle.net/…
accepted answer: http://stackoverflow.com/a/29671924
upvote count: 5

http://stackoverflow.com/comment/47337051
has text: `[a-z]`, not `a-z`. Well, an unset argument does _return_ `undefined`, but then again `undefined == null` which is why it probably worked…
type: AnswerComment
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29595009

http://stackoverflow.com/comment/47491678
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29666373
has text: Thanks, that seem to work great so I have marked your response as the answer
score: 0

http://stackoverflow.com/comment/47383752
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29619548
has text: i would 2nd this, but with a twist: load the local version while booting and immediately dispatch a request to grab a new one. save that new one that comes in and reconcile and changes.

http://stackoverflow.com/q/29561299
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29561828
type: Question
has title: How can I merge an Array with an object in javascript
tagged with: arrays
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/29561828
answer count: 3
has comment: http://stackoverflow.com/comment/47273097
favorite count: 0
has comment: http://stackoverflow.com/comment/47275040
has comment: http://stackoverflow.com/comment/47272389
has answer: http://stackoverflow.com/a/29562928
possible better answer: http://stackoverflow.com/a/29561363
upvote count: 1
has answer: http://stackoverflow.com/a/29561363
downvote count: 1
has body: I'm having an array of object var todos= [ { id: 1, name: test, description: test } ] How can I insert an object with properties stored in different variable say var newTodos={id:2,name:test2,description:test2,purpose:NA} so that the final arrray looks like var todos= [ { id: 1, name: test, description: test }, id: 2, name: test2, description: test2, purpose: NA ]
has comment: http://stackoverflow.com/comment/47272456

http://stackoverflow.com/a/52635978
has body: import { Route, Redirect } from "react-router-dom"; class App extends Component { render() { return ( &lt;div&gt; &lt;Route path='/'&gt; &lt;Redirect to="/something" /&gt; &lt;/Route&gt; //rest of code here this will make it so that when you load up the server on local host it will re direct you to /something
answers question: http://stackoverflow.com/q/29552601
downvote count: 0
type: Answer
upvote count: 7
score: 7

http://stackoverflow.com/comment/47280649
score: 0
comment on: http://stackoverflow.com/q/29565505
type: Comment
type: QuestionComment
has text: Try `console.log($rootScrope.on)` to get an idea whether you're passing the right thing

http://stackoverflow.com/q/29586147
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47320308
tagged with: codeigniter
upvote count: 1
downvote count: 1
type: Question
tagged with: javascript
has title: Call php function with parameters from ajax (DataTable jQuery)
has answer: http://stackoverflow.com/a/29586217
score: 0
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: ajax
has body: I need to call a php function with parameter from jQuery (DataTable), like above: table = $('#tbl').DataTable({ "oLanguage": { [...] //"ajax" : "users/list", //"data": {"id", "1"}, "ajax": { "url": "users/list", "data": { "id": 1 } }, [...] }); php function (users.php): function list($id){ [...] } Error message: Missing argument 1 for users::list()
has comment: http://stackoverflow.com/comment/47320463
tagged with: php
accepted answer: http://stackoverflow.com/a/29586217

http://stackoverflow.com/a/29614052
accepted answer of: http://stackoverflow.com/q/29613882
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/29613882
score: 2
has body: If you're sure the user has one address, which should be the case you can use emails.0.address instead of emails.$.address. This should work for nearly all use cases. The exception is when there are many emails associated with a user. In this case: If you are on the server &amp; only on the server, you can use the positional operator to update a specific email, if there are multiple addresses. You need to, in this case specify the current email in the query portion of the update. I.e: {_id: this.userId, 'emails.$.address' : &lt;current address&gt; } The $ positional update operator is not currently available on the mongo client in Meteor.

http://stackoverflow.com/comment/47465220
score: 0
has text: @Alrazah isnt good idea, that wil be problem with performance on mobile.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29658086

http://stackoverflow.com/comment/47332445
comment on: http://stackoverflow.com/q/29592680
has text: related: [How to cancel an EMCAScript6 (vanilla JavaScript) promise chain](http://stackoverflow.com/q/29478751/1048572)
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47241262
type: Comment
has text: I think my form is ok. I add pasbin links. Hidden or not I can not see any change.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29543494

http://stackoverflow.com/comment/47293066
has text: Yes indeed. Now I'll place all other code into the "complete" section.
type: AnswerComment
comment on: http://stackoverflow.com/a/29571723
score: 0
type: Comment

http://stackoverflow.com/comment/47423133
type: Comment
comment on: http://stackoverflow.com/a/29622731
has text: yes,i have read that document too. but it has the opportunity to bypass this setting or not
score: 1
type: AnswerComment

http://stackoverflow.com/a/29604899
type: Answer
score: 1
has body: If you want to fail all emails and only allow the stand-alone @ or @ + whatever, you can try using this regex: \B@(?:\S+\.[a-zA-Z]+)? This will catch all cases where @text or @ is not preceded by a user name. TLD regex can be adjusted. \B makes it possible for us to match @ at the non-word boundary. So, if you pass info@gmail.com it will fail if you write @ or @demo, you will have @ matched. See demo here.
upvote count: 1
answers question: http://stackoverflow.com/q/29604641
downvote count: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29604641

http://stackoverflow.com/a/29679870
answers question: http://stackoverflow.com/q/29679685
score: 0
has body: You can use javascript string indexOf function to see if a string contains another string as: var fullname = $('#full-name').val(); var searchFor = 'string-to-search-in-fullname'; if(fullname.indexOf(searchFor) !== -1) { // fullname contains searchFor string } else { // fullname not contain searchFor string }
type: Answer

http://stackoverflow.com/q/29618832
score: -1
has body: $(document).ready(function() { $('.product-item').click(function(){ $("#col").addClass('left', 5000, "linear"); $("#col .col-md-3").removeClass('col-md-3').addClass('product-open',5000,"linear"); }); }); Hello , I am using add.Class() and removeClass() jQuery functions for my website , the functions are working , however I can not regulate the timer in order to add some delay to the removal and addition process , it is done instantly and it is not nice in this way , I do not understand why the timer of addClass() is not working ...
has comment: http://stackoverflow.com/comment/47382291
downvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/29618874
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47382280
type: UnansweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/47382255
has title: add.Class() jQuery is not working properly
type: Question
tagged with: javascript

http://stackoverflow.com/comment/47367409
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29573212
has text: juan the question was not too broad at all... got some great answers.

http://stackoverflow.com/a/29605753
score: 0
has comment: http://stackoverflow.com/comment/47383411
type: Answer
has body: you can have a link inside each div to refresh the specific div for example lets say it looks like this: Refresh $( document ).ready(function() { $('a').on('click', function(e){ e.preventDefault(); var which_div = $(this).parent().attr('id'); //do refresh to that specific div }); });
answers question: http://stackoverflow.com/q/29602813
has comment: http://stackoverflow.com/comment/47387519

http://stackoverflow.com/comment/47256924
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29552832
has text: @KirillSlatin It's a comment, I'm just suggesting

http://stackoverflow.com/comment/47320463
has text: yes thats about it, you just concatenate it
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29586147

http://stackoverflow.com/comment/47297228
type: QuestionComment
comment on: http://stackoverflow.com/q/29568382
has text: @geocodezip, I add the contents of infowindow in the loop I forgot to paste it I apologize.
score: 0
type: Comment

http://stackoverflow.com/comment/47372443
score: 0
type: Comment
type: QuestionComment
has text: Woah... you were so quick there that you beat my screens refresh rate lol
comment on: http://stackoverflow.com/q/29613437

http://stackoverflow.com/a/29595305
downvote count: 0
has comment: http://stackoverflow.com/comment/47338838
accepted answer of: http://stackoverflow.com/q/29595245
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/47337700
upvote count: 1
has comment: http://stackoverflow.com/comment/47337559
answers question: http://stackoverflow.com/q/29595245
has body: I think this answer will fall under the category of an opinion, but I'll try and make as logical an argument as I can for each statement. Should I combine all js (Bootstrap, jQuery, jQuery UI, mine) into a single js file and serve it myself? Yes. A single resource means fewer round trips to the server, however don't be lazy with that server, look into some different options than just serving it from your domain. Should I combine all css (Bootstrap, jQuery UI, mine) into a single css and serve it myself? Yes, for the same reasons. Should I combine images into a css sprite? Maybe, this can be hard to maintain, and the benefits really depend on your application. Other things I should consider? Consider hosting your static content with a service like Amazon's Cloud Front, this will have your users faster access to these bits of static content without as much effort (or cost). You can also look into combining your pages into a single page web app. This way your users will only download and execute your resource once, while subsequent pages will only load in data. This approach presents other challenges though like searching/indexing as well as complexity in the code.
type: AcceptedAnswer

http://stackoverflow.com/comment/47374311
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29609379
has text: The camera plugin is in the `cordova list`.. So I'll try the device ready tomorrow.. Maybe we can start a discussion tomorrow? it's easier to talk in there. @laughingpine

http://stackoverflow.com/q/29606392
has answer: http://stackoverflow.com/a/29606866
has title: Changing the color of the specific day which has been clicked
favorite count: 0
has body: How can I change the color of the specific day which has been clicked on my calendar? This is my code: selectable: true, selectHelper: true, select: function(calEvent, jsEvent, view) { var moment = $('#calendar').fullCalendar('getDate'); /** * calEvent is the event object, so you can access it's properties */ if(confirm("Would you like to cancel the meal delivery ?")){ delete event in backend jQuery.post("/vacation/deleteEvent", { "id": calEvent.id } ); delete in frontend $(this).css('border-color', 'red'); } },
type: UnansweredQuestion
downvote count: 2
tagged with: spring-mvc
upvote count: 0
has comment: http://stackoverflow.com/comment/47358509
type: Question
score: -2
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/29622427
has title: Sending data from the Python TCP Socket(as server) to the JS client
tagged with: tcp
type: AnsweredQuestion
type: Question
tagged with: python-2.7
answer count: 1
has body: So, the question is in the following: How? I have already implemented the TCP server on Python. It sends the data to a client(also implemented on Python). So now I want to make it on JavaScript Any reccomendations or suggestions?
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/29622541
accepted answer: http://stackoverflow.com/a/29622541
linked to: http://stackoverflow.com/q/12407778

http://stackoverflow.com/comment/47431165
type: Comment
type: QuestionComment
has text: In general, sorting by n columns works as follows: check the results of compare(a.col1, b.col1), compare(a.col2, b.col2), ... until you get a non-zero result or you have checked all the columns, return that result.
score: 0
comment on: http://stackoverflow.com/q/29642295

http://stackoverflow.com/a/29643724
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29643464
downvote count: 0
answers question: http://stackoverflow.com/q/29643464
type: Answer
has body: Be sure to make your files be served by a web server (Apache or Ngnix). I tried both, when files are served by Apache, it works like a charm, when directly opened in Chrome (no problem with Safari), I have the same error.
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47467747

http://stackoverflow.com/a/29565331
has comment: http://stackoverflow.com/comment/47286076
has comment: http://stackoverflow.com/comment/47414714
accepted answer of: http://stackoverflow.com/q/29565102
type: Answer
has comment: http://stackoverflow.com/comment/47471440
has comment: http://stackoverflow.com/comment/47544229
has comment: http://stackoverflow.com/comment/47471516
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47425999
has comment: http://stackoverflow.com/comment/47286647
has comment: http://stackoverflow.com/comment/47285842
has comment: http://stackoverflow.com/comment/47411434
has body: The price is constructed with the help of javascript being executed when you load the page in the browser. The desired price is actually inside one the script tags which you can locate with Scrapy, extract the object containing price with regular expressions, load it via JSON and get the price. Demo from the Scrapy Shell: $ scrapy shell http://www.bedstore.co.uk/p/Diamante_Faux_Leather_Bed_Frame.htm In [1]: import re In [2]: import json In [3]: pattern = re.compile(r"qubit_product_list = (.*?);", re.M) In [4]: script = response.xpath("//script[contains(., 'qubit_product_list')]/text()").extract()[0] In [5]: data = pattern.search(script).group(1) In [6]: json.loads(data) Out[6]: {u'6516-DBL-BLK': {u'category': u'', u'currency': u'GBP', u'description': u'Double Black', u'id': u'6516', u'name': u'Diamante Faux Leather Bed Frame', u'sku_code': u'LPDF:DIAMANTE-BD', u'stock': 100, u'unit_price': 129.99, u'unit_sale_price': 129.99, u'url': u'/p/Diamante_Faux_Leather_Bed_Frame.htm'}, u'6516-DBL-WHT': {u'category': u'', u'currency': u'GBP', u'description': u'Double White', u'id': u'6516', u'name': u'Diamante Faux Leather Bed Frame', u'sku_code': u'LPDF:DIAMANTE-WD', u'stock': 100, u'unit_price': 129.99, u'unit_sale_price': 129.99, u'url': u'/p/Diamante_Faux_Leather_Bed_Frame.htm'}, u'6516-KS-BLK': {u'category': u'', u'currency': u'GBP', u'description': u'Kingsize Black', u'id': u'6516', u'name': u'Diamante Faux Leather Bed Frame', u'sku_code': u'LPDF:DIAMANTE-BK', u'stock': 99, u'unit_price': 149.99004, u'unit_sale_price': 149.99004, u'url': u'/p/Diamante_Faux_Leather_Bed_Frame.htm'}, u'6516-KS-WHT': {u'category': u'', u'currency': u'GBP', u'description': u'Kingsize White', u'id': u'6516', u'name': u'Diamante Faux Leather Bed Frame', u'sku_code': u'LPDF:DIAMANTE-WK', u'stock': 100, u'unit_price': 154.98996, u'unit_sale_price': 154.98996, u'url': u'/p/Diamante_Faux_Leather_Bed_Frame.htm'}}
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29565102

http://stackoverflow.com/a/29616700
score: 1
answers question: http://stackoverflow.com/q/29616449
upvote count: 1
type: Answer
has body: you should use a closure: function updateValues(){ val=document.getElementsByName('valueAN'); for ( i=0; i &lt; val.length; i++ ){ (function(i){ $.post('',{func:'updateAN',index:i}, function(data,status){ val[i].value = data; }); })(i); } }
downvote count: 0

http://stackoverflow.com/a/29638321
has comment: http://stackoverflow.com/comment/47418883
answers question: http://stackoverflow.com/q/29638270
type: Answer
has body: You should just need to echo it straight up without any extra quotes because it's a JSON object &lt;body onload="init(&lt;?php echo $domainsJS ?&gt;);"&gt;
score: 0

http://stackoverflow.com/q/29565735
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47281037
has comment: http://stackoverflow.com/comment/47281200
has comment: http://stackoverflow.com/comment/47281074
linked to: http://stackoverflow.com/q/8859828
score: 0
has comment: http://stackoverflow.com/comment/47281159
type: Question
has body: What I'm trying to achieve is: [1,2,3].power(2) === [1,4,9]; So far I did: Array.prototype.power = function(value) { for (var i = 1; i &lt; this.length; i++) { this[i] = Math.pow(this[i], value); } } but for some reason it return false and the array looks like: [1, 4, 9, power: function...] What I'm doing wrong here?
answer count: 2
has answer: http://stackoverflow.com/a/29565817
has title: Creating new array method
has comment: http://stackoverflow.com/comment/47281158
tagged with: javascript
has answer: http://stackoverflow.com/a/29566226
has comment: http://stackoverflow.com/comment/47281127

http://stackoverflow.com/comment/47379155
type: Comment
type: QuestionComment
has text: Also `if(confirm('...') == true)` can be better written as `if(confirm('...'))`
comment on: http://stackoverflow.com/q/29616954
score: 0

http://stackoverflow.com/q/29573847
has answer: http://stackoverflow.com/a/29573872
accepted answer: http://stackoverflow.com/a/29573864
has comment: http://stackoverflow.com/comment/47296622
answer count: 4
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29574817
upvote count: 3
has answer: http://stackoverflow.com/a/29574817
type: Question
score: 3
has comment: http://stackoverflow.com/comment/47296643
tagged with: javascript
has title: How do I send a GET request while typing in AngularJS?
has answer: http://stackoverflow.com/a/29577079
downvote count: 0
has answer: http://stackoverflow.com/a/29573864
has body: I'm new to AngularJS. I want to set it up so that as I type, I send a GET request, but only if what I've typed in the input field is at least three characters long. Here's index.html: &lt;html ng-app="myApp"&gt; &lt;div ng-controller="fetchTagsCtrl"&gt; &lt;input type="text" ng-model="userInput.fetchTag" placeholder="Type something"&gt; &lt;/div&gt; &lt;/html&gt; My Javascript: var app = angular.module('myApp',[]); app.controller('fetchTagsCtrl',function($scope){ $scope.userInput = { fetchTag: '' }; $http({ url: '/myURL', method: 'GET', param: { someParameter: $scope.userInput } }).success(function(response){ console.log(response); }) }); But this doesn't seem to work. How do I fix this?
has comment: http://stackoverflow.com/comment/47296670
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/q/29595025
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has body: I need to create a link or a button so that users can navigate to different urls (needs to be generated in a js function based on values selected in multiple dropdown) I tried with a button but it doesn't navigate to the link, and with not able to change values of href it adds to previous values. Can you please help
has comment: http://stackoverflow.com/comment/47337060
has title: HTML: Navigate to a different url using button
possible better answer: http://stackoverflow.com/a/29595064
type: Question
has comment: http://stackoverflow.com/comment/47336980
tagged with: javascript
has comment: http://stackoverflow.com/comment/47336981
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29595064
has answer: http://stackoverflow.com/a/29595600
accepted answer: http://stackoverflow.com/a/29595600

http://stackoverflow.com/q/29613054
has answer: http://stackoverflow.com/a/29616155
favorite count: 0
tagged with: ember.js
has comment: http://stackoverflow.com/comment/47371615
downvote count: 0
type: UnansweredQuestion
has body: I'm getting this error after the Displaying Model Data step while trying to follow the TodoMVC demo app on the Ember site (http://guides.emberjs.com/v1.10.0/getting-started/). My javascript code up to this point is: window.Todos = Ember.Application.create(); Todos.ApplicationAdapter = DS.FixtureAdapter.extend(); Todos.Router.map(function () { this.resource('todos', { path: '/' }); }); Todos.TodosRoute = Ember.Route.extend({ model: function () { return this.store.find('todo'); } }); Todos.Todo = DS.Model.extend({ title: DS.attr('string'), isCompleted: DS.attr('boolean') }); Todos.Todo.FIXTURES = [ { id: 1, title: 'Learn Ember.js', isCompleted: true }, { id: 2, title: '...', isCompleted: false }, { id: 3, title: 'Profit!', isCompleted: false } ];
score: 1
has comment: http://stackoverflow.com/comment/47372083
type: Question
has title: Error while processing route: todos undefined is not a function
upvote count: 1
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/47244040
type: AnswerComment
has text: Thanks for showing me this. I used `function(v) {return !evens(v)}`
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29545903

http://stackoverflow.com/a/29579781
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/29571578
upvote count: 6
has body: I would ask Why you want to write this code for yourself? From personal experience, trying to filter efficiently and on all browsers is a non-trivial task. If you are doing this as a learning experience, then look at source of the packages listed below as examples. With 5000 rows, it would be more efficient to do server side filtering and sorting. Then use ajax to update the displayed table. I would suggest that you look at using one of the several JavaScript packages that already do this. There are many more packages that the two below. I'm showing these two as examples of what is available. http://datatables.net/ - This is a very full featured package that handles both client and server side filtering and sorting. http://www.listjs.com/ - is a lightweight client side filtering and sorting package.
score: 6

http://stackoverflow.com/comment/47416271
score: 0
has text: hmm, the "id" attribute isn't coming through on those tags at all. It doesn't appear that ' ' is doing what you want it to do, right?
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29636543

http://stackoverflow.com/q/29661559
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47464354
score: 1
type: Question
tagged with: object
tagged with: arrays
tagged with: javascript
has body: I am trying to wrap an svg label by wrapping the string in tspan tags. My problem is that the property isn't working when split() occurs. My object doesn't seem to work inside the function, however it seems to work in console. d.text returns in console but as far as working inside the function, something is off. function wrap(text, width) { text.each(function (d) { console.log("is d.text defined?" + d.text /* this gets returned ok - logs all the d.text*/) wordwrap = ( function (){return "These are long labels" /*hardcoded label strings: this gets returned ok*/}) wordwrap = ( function (){return d.text; /* undefined is not a function */}) wordwrap = d.text; /* number is not a function */ var text = d3.select(this), words = wordwrap().split(/\s+/).reverse(), word, line = [], lineNumber = 0, lineHeight = 1.1, // ems x = text.attr("x"), y = text.attr("y"), dy = 0, //parseFloat(text.attr("dy")), tspan = text.text(null) .append("tspan") .attr("x", x) .attr("y", y) .attr("dy", dy + "em"); while (word = words.pop()) { line.push(word); tspan.text(line.join(" ")); if (tspan.node().getComputedTextLength() &gt; width) { line.pop(); tspan.text(line.join(" ")); line = [word]; tspan = text.append("tspan") .attr("x", x) .attr("y", y) .attr("dy", ++lineNumber * lineHeight + dy + "em") .text(word); } console.log(d.text) /* this gets returned ok*/ } }); }
tagged with: jquery
upvote count: 1
downvote count: 0
favorite count: 0
has title: Unable to split an objects properties
answer count: 0

http://stackoverflow.com/comment/47466673
comment on: http://stackoverflow.com/q/29663578
type: QuestionComment
type: Comment
has text: One problem is that you're not updating `imgCt` when you change the array. You should probalby just not use that variable at all. Just refer to `myPix.length` whenever you want the count.
score: 0

http://stackoverflow.com/q/29578258
tagged with: nvd3.js
tagged with: d3.js
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47305156
has comment: http://stackoverflow.com/comment/47305293
has answer: http://stackoverflow.com/a/29580496
has comment: http://stackoverflow.com/comment/47305119
has body: I am not able to parse the JSON string in D3.js if I keep it. If I mention any JSON file name I am able to display the graph. CODE d3.json("mperday.json",function(json){ //graph displayed now }); var myjson = "[ [ { "time": "2014-02-19", "y": 10 } ], [ { "time": "2014-02-19", "y": 12 } ], [ { "time": "2014-02-19", "y": 14 } ]]"; d3.json(myjson,function(json){ //graph not displaying now }); d3.json(JSON.parse(myjson),function(json){ //graph not displayed now }); Kindly, provide me some solution.
type: Question
tagged with: javascript
score: 0
has title: D3.js not parsing the JSON string
answer count: 1

http://stackoverflow.com/a/29604675
score: 0
answers question: http://stackoverflow.com/q/29589719
has body: After more research I settled on a Javascript library isMobile. https://github.com/kaimallea/isMobile It seems that many use it, so I assume it would work. My worry is that if a new device comes up, i have to continually update this library...
type: Answer

http://stackoverflow.com/comment/47422702
comment on: http://stackoverflow.com/a/29640422
type: Comment
type: AnswerComment
has text: edit: Why does scope need to be passed in? Is "scope" a keyword here somehow? edit 2: Looks like I can just do function(x){return x.myVar}. Is there some sort of general convention here, or is this a peculiarity of $watch?
score: 0

http://stackoverflow.com/q/29624519
has answer: http://stackoverflow.com/a/30054977
answer count: 1
downvote count: 0
tagged with: jquery
has title: Match exact words single or multiple words using highlight plugin
favorite count: 0
has body: I am trying to exactly match the Arabic keywords with Arabic text. I am using Highlight plugin which works fine for English version but breaks in arabic. If we use partial option in script then it will match the partial string but i want to use exact feature which breaks the script as it may not be supported by the plugin. I tried different thing but nothing seems to work so far with Arabic text matching and highlighting Below is the fiddle http://jsfiddle.net/tg8vtpqk/2/ i tried regex = '(\\b' + regex + '\\b)(?=\\s|$)'; for exact match but it breaks the string while same works in C#. I have been looking for any plugin which can highlight exact words of Arabic text.
tagged with: regex
type: UnansweredQuestion
score: 1
upvote count: 1
tagged with: javascript
type: Question

http://stackoverflow.com/comment/47401431
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29629208
has text: A little explanation and reference links would be great, second I don't see any jQuery UI - Accordion in OPs code
score: 0

http://stackoverflow.com/comment/47256166
type: Comment
comment on: http://stackoverflow.com/a/29552123
score: 0
has text: i try that but it didn't work for me. i want when i click on the banner i hide it. i already add a webpage that contain 3 banners with a timer; it will start when you click on the div but didn't when you click in the banner. look on this page:http://allaroundtheworldtv.eu5.org/Test/new2a.html
type: AnswerComment

http://stackoverflow.com/q/29570807
has title: jQuery conflicts using Content Carousel with Bootstrap 3 and Fancy Box
type: Question
has comment: http://stackoverflow.com/comment/47362692
tagged with: javascript
tagged with: jquery
tagged with: conflicting-libraries
tagged with: circular-content-carousel
score: 0
linked to: http://stackoverflow.com/q/28924283
answer count: 0
tagged with: twitter-bootstrap
has body: I am working on a site that is using the Circular Content Carousel from Tympanus in conjunction with FancyBox on a site built with Bootstrap 3. I've noticed however, that the collapsible mobile menu that is part of Bootstrap is not working on this page. I realized that Content Carousel is using jQuery 1.6.2 while Bootstrap uses 1.9 or higher. When I remove the link to jQuery-1.6.2 the mobile menu works but the Carousel breaks, and when I remove jQuery-1.11.1, the carousel works but the mobile menu is broken. Linking both results in the carousel working but the mobile menu not working. I've tried using the jQuery.conflict script to no avail (whoever built the site had already begun to implement this unsuccessfully). I've tried changing lines 217 and 227 of the contentcarousel.js file from .live to .on as per the stack overflow link here and removing the older jquery file. Now everything almost works except when you click on the + sign to enter the lightbox and then exit out of the lightbox, the content carousel no longer works. I've also noticed that after this change, when you hover over the dropdown menu, it stays in an active 'mouseover' state. The site is here http://smmcnyc.com/work/bnc/history.html with history2.html being the version with the modified contentcarousel.js file. Suggestions? Advice? Please help!
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47291763

http://stackoverflow.com/comment/47260677
comment on: http://stackoverflow.com/q/29554927
score: 0
type: Comment
type: QuestionComment
has text: You want the prefilled textbox?

http://stackoverflow.com/a/29658734
downvote count: 0
has comment: http://stackoverflow.com/comment/47457236
has comment: http://stackoverflow.com/comment/61401643
score: 4
has body: Try marking the content as "display: none;" in either a stylesheet or an inline style. Then use Knockout's "visible" binding to control the visibility. The content will be hidden until Knockout has a chance to evaluate, setting the visibility to whatever your Knockout logic dictates. RequireJS is probably loading your scripts asynchronously, so the markup is rendering before your JavaScript has a chance to execute. Therefore you'll need a synchronous way to hide the content until your JavaScript executes. ngCloak uses the exact same trick: there is a CSS selector that hides any elements with the ngCloak attribute until Angular's JavaScript has a chance to execute. https://docs.angularjs.org/api/ng/directive/ngCloak
has comment: http://stackoverflow.com/comment/47498483
type: Answer
answers question: http://stackoverflow.com/q/29657606
upvote count: 4

http://stackoverflow.com/comment/47266829
type: QuestionComment
has text: as others have said, submitting something causes a page reload which means you are stuck in a loop
comment on: http://stackoverflow.com/q/29558093
score: 0
type: Comment

http://stackoverflow.com/a/29598570
has comment: http://stackoverflow.com/comment/47343777
type: Answer
score: 1
has body: var options = ["bg_color", "bottom_bar_color", "button_color", "dialog_color", "notify_color", "button_text_color"]; var options_target = ["body", "#bottom", ".ugly-button", ".dialog", ".notification .notification-body", ".ugly-button"]; var options_change = ["background", "background", "background", "background", "color"]; options length is 6. options_target length is 7. options_change length is 5. So: i goes from 0 to 5. $(options_target[i]).css(options_change[i], getL(options[i])); When i is 5: options[i] has value, options_change[i] is undefined, because it is out of range...
upvote count: 1
answers question: http://stackoverflow.com/q/29598428
accepted answer of: http://stackoverflow.com/q/29598428
has comment: http://stackoverflow.com/comment/47343696
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/47415928
comment on: http://stackoverflow.com/q/29636740
score: 0
has text: no, but you can start caching it before they click to cut down the delay.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47276224
comment on: http://stackoverflow.com/a/29562101
score: 0
type: AnswerComment
type: Comment
has text: That is a totally unrelated issue. Add `z-index:1` to the `.caption-box` styles and the problem will be solved

http://stackoverflow.com/a/29610174
has body: You need a variable outside the .each() loop that can keep track of the running total and you need to rotate each element only the prior running total (not including the current value) such as: var runningTotal = 0; $('.home-slider-chart-container .home-slider-chart').each(function() { var thisRotation = (runningTotal / 100 * 360); $(this).data('rotate', thisRotation); // now update the running total for the next segment runningTotal += $(this).data('percent'); }); Working jsFiddle demo: http://jsfiddle.net/jfriend00/14rc3zL6/
has comment: http://stackoverflow.com/comment/47366207
has comment: http://stackoverflow.com/comment/47366173
upvote count: 2
accepted answer of: http://stackoverflow.com/q/29609925
has comment: http://stackoverflow.com/comment/47366501
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29609925
type: Answer
score: 2
downvote count: 0

append
tags question: http://stackoverflow.com/q/29593760
tag name: append
tags question: http://stackoverflow.com/q/29649361
tags question: http://stackoverflow.com/q/29595349
tags question: http://stackoverflow.com/q/29544605
type: Tag
tags question: http://stackoverflow.com/q/29664007

http://stackoverflow.com/q/29542756
type: Question
has comment: http://stackoverflow.com/comment/47238725
score: 0
tagged with: javascript
tagged with: jquery-isotope
has comment: http://stackoverflow.com/comment/47248818
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47237634
has body: Im using isotope menu on wordpress page. Everything works fine till i use another plugin to expand content (menu actually). Since that menu showes only first position and i have to manually select category to display all position properly. This is the code im using for the menu: if ( $('#menus-container').length ) { // Zebra stripes $('.menu-list .menu-item:even').addClass('even'); $('.menu-list .menu-item:odd').addClass('odd'); // Isotope var $menus = $('.menu-list'), filter = $('#menus-filter .menu-icon a').eq(0).attr('data-sort'); $menus.imagesLoaded(function() { $menus.isotope({ itemSelector: '.menu-item', filter: filter, animationEngine: engine, layoutMode : 'fitRows', animationOptions: { duration: 400, easing: 'linear', queue: true } }); $('#products').isotope( 'reloadItems' ).isotope(); $('#menus-filter .menu-icon').eq(0).addClass('selected'); $('.menus-category h5').text( $('#menus-filter .menu-icon a').eq(0).text() ); }); $('#menus-filter .menu-icon a').on('click touchend', function() { $('#menus-filter .selected').removeClass('selected'); $(this).parent().addClass('selected'); var menusFilter = $(this).attr('data-sort'); var menusLegend = $(this).text(); $('.menus-category h5').text( menusLegend ); $menus.isotope({filter: menusFilter}); }); $('.menus-options a').click(function() { $menus.isotope(); }); // Binding mouse and touch events var bindOver, bindOut; if ( !isMobile.any() ) { bindOver = 'mouseover'; bindOut = 'mouseout'; } else { bindOver = 'touchstart'; bindOut = 'touchend'; } // Image hover and zoom icon overlay $('a.menu-image').each(function() { var dataColor = $(this).attr('data-color'); $(this).on(bindOver, function(e) { $(this).find('.menu-overlay').css({'width': $(this).find('img').width()}); $(this).find('.menu-overlay').stop().animate({'background-color': $.Color(dataColor).transition('transparent', 0.3)}, 400); $(this).find('.menu-overlay .menu-zoom').stop().fadeIn(300); }); $(this).on(bindOut, function(e) { $(this).find('.menu-overlay').…
has title: Isotope elements refresh / redraw
answer count: 0
tagged with: wordpress

http://stackoverflow.com/q/29645534
has title: I can't access to caller of jquery plugins method
type: Question
has answer: http://stackoverflow.com/a/29647107
tagged with: javascript
tagged with: jquery
has body: I have a jQuery plugin like this: (function(e) { e.fn.dmHall = function(args) { var st = { push: 30, rtl: false, }; e.extend(st, args); var main = e(this); e.fn.dmHall.hideThis() = function(args){ this.hide(); } $('#myelement').click(function(e){ $(this).dmHall.hideThis(); }); } })(jQuery) However this not working and I cannot get $('#myelement') as caller of hideThis() method without set it as argument. I want to create a submethod that can work like hide() or anything.
upvote count: 1
answer count: 1
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47431771
downvote count: 0
score: 1

http://stackoverflow.com/comment/47444982
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29648038
type: Comment
has text: Yeah, just open an issue on their Github if they do not have one already. Request **does** add things to req and res, but if you use the piece of code I gave you you will access the object before they're modified by `request` so it should still be the same. Also, don't serialize the whole object, you should just log the interesting properties of the object like status code, path, relevant headers, etc. Glad my answer was useful to you!

http://stackoverflow.com/comment/47325290
type: Comment
score: 0
has text: Yes, someone should create a simple Notepad type program for coding with an option to minify, for efficiency on sites, and an option to unminify, which would expand the code out for easy readability to edit.
type: AnswerComment
comment on: http://stackoverflow.com/a/29588939

http://stackoverflow.com/comment/47246713
type: QuestionComment
comment on: http://stackoverflow.com/q/29547003
score: 1
has text: I controll and this is the respose: Our API supports CORS (Cross Origin Resource Sharing), which means that it can be called straight from the browser using JavaScript, or more traditionally from the server using the back-end language of your choice.
type: Comment

http://stackoverflow.com/comment/47349171
type: QuestionComment
has text: `applyBindingsToNode` was indeed the answer. Thanks! I see similar questions that might be better formulated: http://stackoverflow.com/questions/20164974/dynamically-bound-elements-with-applybindingstonode-not-responding-to-changes Hm...delete the question?
comment on: http://stackoverflow.com/q/29600885
score: 0
type: Comment

http://stackoverflow.com/a/29667422
answers question: http://stackoverflow.com/q/29666859
accepted answer of: http://stackoverflow.com/q/29666859
type: AcceptedAnswer
score: 0
type: Answer
has body: You can try var percent = 50; $('div').css('top', function(i, obj) { return i * percent; }); div { width: 50px; height: 50px; background: red; position: absolute; top: 10px; left: 10px; }

http://stackoverflow.com/q/29671344
favorite count: 0
has title: Remove href functionality to a specific category menu in magento
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/47512247
downvote count: 3
score: -3
type: Question
tagged with: magento
upvote count: 0
has comment: http://stackoverflow.com/comment/47481275
answer count: 1
has body: I'm using magento 1.9.1.0. I would like to disable the href functionality of a specific category menu specially if it has a sub category under it. It will only serve as a normal text when hover and will not jump to another page when clicked. I followed this tutorial but no luck. Can anyone help me with this problem? Late Update I am using web and people responsive menu extensions. I created a folder in app/code/local/Mage/Catalog/Block and copied the Navigation.php from app/code/core/Mage/Catalog/Block. I updated this code from $html[] = 'getCategoryUrl($category).'"'.$linkClass.'>'; $html[] = '' . $this->escapeHtml($category->getName()) . ''; $html[] = ''; to if($category->getLevel()== 2 && $hasActiveChildren) { $html[] = ''; $html[] = '' . $this->escapeHtml($category->getName()) . ''; $html[] = ''; } else { $html[] = 'getCategoryUrl($category).'"'.$linkClass.'>'; $html[] = '' . $this->escapeHtml($category->getName()) . ''; $html[] = ''; } Thanks!
has answer: http://stackoverflow.com/a/29671572
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/29655106
upvote count: 2
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/29654122
answers question: http://stackoverflow.com/q/29654122
has body: Just add a break; after the splice() call in the loop.
has comment: http://stackoverflow.com/comment/47450336
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/29656036
tagged with: jquery
score: 0
tagged with: slickgrid
has title: Browser search (Ctrl+F) for Slickgrid column header is giving focus on column header but column data is out of alignment
has comment: http://stackoverflow.com/comment/47498669
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47511564
has comment: http://stackoverflow.com/comment/47510959
has comment: http://stackoverflow.com/comment/47451919
type: Question
has body: When I try to search in the page, pressing CTRL+F or using browser find for slickgrid column which is out of the viewport (not scrolled into view), It would focus on column header but column data is not getting scrolled and slickgrid data is missing alignment with column header. Any help would be highly appreciated!! please find attached image:
tagged with: javascript

http://stackoverflow.com/comment/49438927
score: 2
comment on: http://stackoverflow.com/a/29535464
has text: @MichelleGlauser I'm just doing ajax to a local endpoint, then doing a server side call via the Stripe API to confirm if the coupon is valid. If it's valid, I just render a 200, with details of the coupon in json, other wise I render a 404.
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29532215
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47253870
has comment: http://stackoverflow.com/comment/47218067
has comment: http://stackoverflow.com/comment/47654520
type: Answer
has comment: http://stackoverflow.com/comment/47265736
has comment: http://stackoverflow.com/comment/47340578
has body: You can use: $('input:checkbox').change(function(){ if($('input:first-child:checked').length==1){ var firstcheckedelementindex=$('input:first-child').index($('input:first-child:checked')); var secondcheckedelementindex=$('input:nth-child(2)').filter(function(){ return this.checked; }).length; return( secondcheckedelementindex==1 &amp;&amp; $('input:nth-child(2)').not(':eq('+firstcheckedelementindex+')').is(':checked')) }else{ return false; }}); Working Demo
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29531758
has comment: http://stackoverflow.com/comment/47227027
has comment: http://stackoverflow.com/comment/47227344
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29531758
has comment: http://stackoverflow.com/comment/47218193
has comment: http://stackoverflow.com/comment/47269526
has comment: http://stackoverflow.com/comment/47218040

http://stackoverflow.com/comment/47371566
score: 0
type: AnswerComment
has text: I understand I could use a sanitizer javascript library, but the library I found are too big for me to load on the front end. That's way I want to using regex to filter out the contents. BTW, `` will lead to XSS i.e. `fail`.
type: Comment
comment on: http://stackoverflow.com/a/29612983

http://stackoverflow.com/a/29605063
answers question: http://stackoverflow.com/q/29604626
accepted answer of: http://stackoverflow.com/q/29604626
has comment: http://stackoverflow.com/comment/60619749
has comment: http://stackoverflow.com/comment/47356741
score: 22
type: AcceptedAnswer
has body: Reason why Url.Action not working is that the &amp; char in url is encoded, so you must use @Html.Raw as below window.location.href = "@Html.Raw(@Url.Action("ABC", "XYZ", new { @A= ViewBag.A , @B = ViewBag.B }))";
type: Answer
upvote count: 22
has comment: http://stackoverflow.com/comment/47356214
downvote count: 0

http://stackoverflow.com/a/29549372
has body: for(var q = 0; q &lt; arrayLength; q++){ td.appendChild(document.createTextNode(Myarray[q])) } This loops thru and create a textNode for each element. If you want one element use Myarray[index]; in this case index is i * sqroot + j. td.appendChild(document.createTextNode(Myarray[i * sqroot + j]))
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/47250842
has comment: http://stackoverflow.com/comment/47310621
has comment: http://stackoverflow.com/comment/47250313
has comment: http://stackoverflow.com/comment/47310801
answers question: http://stackoverflow.com/q/29549275
has comment: http://stackoverflow.com/comment/47310735
accepted answer of: http://stackoverflow.com/q/29549275
type: AcceptedAnswer

http://stackoverflow.com/comment/47408651
has text: can u share a jsfiddle?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29633062
score: 3

http://stackoverflow.com/comment/47402346
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29629771
has text: Post related code is a start.

http://stackoverflow.com/comment/47323894
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29588223
type: Comment
has text: That worked for the specific example. The question is how general this is? Is this targeting the specific illegal token?

http://stackoverflow.com/comment/47423323
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29640773
score: 0
has text: Do you mean like /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?!.*\s).*$/

http://stackoverflow.com/comment/47353607
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29603811
score: 1
has text: You might want to take a look at [this article](http://tympanus.net/codrops/2014/07/10/inspiration-for-custom-select-elements/), especially the Box select demo which seems quite similar to what you want to achieve. I think that can serve as a foundation for you to tweak it to your liking. Edit : You'll need to add additional HTML code for the method mentioned in the article, it's not only CSS modification since select can't be styled as such.

http://stackoverflow.com/comment/47459438
comment on: http://stackoverflow.com/a/29659917
has text: Use the true parameter if u want it recursively.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47353521
comment on: http://stackoverflow.com/q/29603928
has text: learn about arguments and how they are passed and what they do.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29687086
score: 0
type: Answer
has body: Remove the inline event handler, use a proper event handler, then prevent the form from submitting, and submit it programatically when the geocoder completes and the value is added to the form. The return false in your code does not prevent the form from submitting btw. document.getElementsByName('addLocation')[0].addEventListener('submit', function(e) { e.preventDefault(); var self = this; var adress = document.getElementById("adress").value; var geocoder = new google.maps.Geocoder(); var geoloc = document.getElementById("geolocation"); geocoder.geocode({'address': adress}, function (results, status) { if (status == google.maps.GeocoderStatus.OK) { var latitude = results[0].geometry.location.lat(); var longitude = results[0].geometry.location.lng(); geoloc.value = latitude + " " + longitude; self.submit(); } else { alert("geocode failed:" + status); } }); });
accepted answer of: http://stackoverflow.com/q/29686976
answers question: http://stackoverflow.com/q/29686976
type: AcceptedAnswer

http://stackoverflow.com/a/29531500
score: 1
has body: One solution might be to use target="_parent" element for the form inside iframe. Have a look at this answer. In such case you do not need to use JavaScript.
upvote count: 1
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/29531319
downvote count: 0
answers question: http://stackoverflow.com/q/29531319

http://stackoverflow.com/a/29647615
upvote count: 1
answers question: http://stackoverflow.com/q/29638932
downvote count: 0
type: AcceptedAnswer
has body: <?xml version="1.0" encoding="utf-8"?> <system.webServer> <validation validateIntegratedModeConfiguration="false" /> <remove name="ChartImageHandler" /> <add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD,POST" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> </system.webServer> database connections--- <system.web> <add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" /> <add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting" assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> <add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" /> <add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add assembly="AjaxControlToolkit, Version=4.5.7.1213, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"/> <httpRuntime targetFramework="4.5" /> <!-- <forms defaultUrl="~/default.aspx" loginUrl="~/Login.aspx" slidingExpiration="true" timeout="20" /> --> roles <deny users="*" /> <add name="WindowsProvider" type="System.Web.Security.WindowsTokenRoleProvider" /> <!-- <add namespace="System.Web.Optimization" /> <add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt" /> --> </system.web> <add key="ValidationSettings:UnobtrusiveValidationMode" value="None" /> <add key="ChartImageHandler" value="storage=file;timeout=20;dir=C:\TempImageFiles\;" /> <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" /> <assemblyId…
has comment: http://stackoverflow.com/comment/47465017
type: Answer
score: 1
accepted answer of: http://stackoverflow.com/q/29638932

http://stackoverflow.com/q/29646959
has answer: http://stackoverflow.com/a/29648936
downvote count: 0
score: 1
accepted answer: http://stackoverflow.com/a/29648936
favorite count: 0
possible better answer: http://stackoverflow.com/a/38767854
upvote count: 1
has answer: http://stackoverflow.com/a/38767854
type: AnsweredQuestion
tagged with: jqgrid
has title: ColumnChooser free-jqgrid is not working on IE9
type: Question
has body: After upgrade of my application from jqGrid 4.6 to free-jqgrid 4.8 the columnChooser functionality is not working. It's only on IE9. Demo is available here: http://jsfiddle.net/2tkkqbeq/15/ (Please open it in IE9 mode). The problem I think is in apply_perm function in jqGrid library: apply_perm: function () { var perm = []; $("option", select).each(function () { if ($(this).is("[selected]")) { $self.jqGrid("showCol", colModel[this.value].name); } else { $self.jqGrid("hideCol", colModel[this.value].name); } }); } When I changed if ($(this).is("[selected]")) to if ($(this).is(":selected")) it started to work. What is the difference between is("[selected]") and is[":selected"]?
tagged with: javascript
tagged with: jquery
tagged with: free-jqgrid
answer count: 2

http://stackoverflow.com/a/29556552
has comment: http://stackoverflow.com/comment/47264134
has body: The embed tag is only for media files, not for entire websites. You probably want to use an iframe instead. For example:
has comment: http://stackoverflow.com/comment/47266056
has comment: http://stackoverflow.com/comment/47263562
has comment: http://stackoverflow.com/comment/47263953
score: 0
answers question: http://stackoverflow.com/q/29556417
has comment: http://stackoverflow.com/comment/47263927
type: Answer

http://stackoverflow.com/a/29648278
score: 3
upvote count: 3
has body: My approach is similar to @Dan Prince, but the implementation differs a bit Create a directive, that accepts name of the model variable, and then inject your model service in the directive itself to perform the getting and setting. Edit : As specified by @Werlang, writing an attribute that replaces ngModel will refrain you from features like validation, formatting, debounced update, ng-change etc. So instead of writing a replacement, we will instead wire up a supplementary attribute . app.directive('dynamicInput', function() { return { restrict: 'A', link: function(scope, el, attr) { scope.variableName = angular.copy(attr.ngModel); // Saving the variable name scope[attr.ngModel] = (attr.ngModel + '_1'); // Setting a dummy value in the scope variable. // In your case it will look something like scope[attr.ngModel] = Model.getValue(attr.ngModel); scope.$watch(attr.ngModel, function(newValue, oldValue) { console.log(scope.variableName + " ==&gt; " + newValue); //Model.setValue(scope.variableName, newValue); }); } }; }) Then in your HTML : &lt;input ng-model='balance' dynamic-input /&gt;
has comment: http://stackoverflow.com/comment/47437196
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29647549
type: Answer
answers question: http://stackoverflow.com/q/29647549
has comment: http://stackoverflow.com/comment/47474639

http://stackoverflow.com/comment/47223334
has text: Is your image loaded? You probably have to put a callback on img. If it is working 100% of the time in Chrome, it is likely that it is just cached there for you.
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/29535305

http://stackoverflow.com/q/29666540
tagged with: mysql
possible better answer: http://stackoverflow.com/a/29666683
has answer: http://stackoverflow.com/a/29666762
type: Question
has comment: http://stackoverflow.com/comment/47472047
has comment: http://stackoverflow.com/comment/47472029
tagged with: javascript
has comment: http://stackoverflow.com/comment/47471973
tagged with: jquery
has comment: http://stackoverflow.com/comment/47472739
tagged with: ajax
has body: I have this code,when i input invoice code it will get data from MySQL and fill the others text with Ajax. but my ajax don't get return from my controller, any body help me? where I'm wrong? My controller in PHP to get data. <?php public function getDetail_transaction($invoice_id){ $result = $this->db->get_where('tblTransaction', array('payment_trx_id' => $invoice_id))->first_row(); $data = json_encode($result); return $data; } ?> My view: Confirm Your Payment <form name='ConfirmPayment' action="<?php echo base_url('Payment/ConfirmPayment');?>" method="POST" enctype="multipart/form-data"> Invoice ID Cek Nama Rekening Pembayar Bank Asal Bank Tujuan No Transafer Transfer Date Deskripsi Total Transfer Bukti Transaksi (optional) Submit Ajax Script $(document).ready(function(){ $("#cek_invoice").click(function(){ data_invoice = $('#invoice_id').val(); var url = "<?php echo base_url('Payment/getDetail_transaction/');?>"+'/'+data_invoice; $.ajax({ url : url, type: "POST", success: function(data) { alert(data); $('#payment_bank_user_name').val(data.payment_bank_user_name); }, failure: function() { alert('fail'); } }); }); });
has comment: http://stackoverflow.com/comment/47476001
score: 0
has comment: http://stackoverflow.com/comment/47472066
has answer: http://stackoverflow.com/a/29666641
accepted answer: http://stackoverflow.com/a/29666641
answer count: 3
has title: Get data with ajax from php and mysql
has answer: http://stackoverflow.com/a/29666683
has comment: http://stackoverflow.com/comment/47471888
has comment: http://stackoverflow.com/comment/47472525
has comment: http://stackoverflow.com/comment/47472226
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47472496
has comment: http://stackoverflow.com/comment/47472365

http://stackoverflow.com/comment/47275718
score: 1
comment on: http://stackoverflow.com/q/29562964
type: QuestionComment
type: Comment
has text: Changes as expected for me, see [jsfiddle](http://jsfiddle.net/jkyqgh9k/1/).

http://stackoverflow.com/a/29590372
answers question: http://stackoverflow.com/q/29589770
upvote count: 1
has body: The solution is very simple actually. Change this return parseInt(a.id) &gt; parseInt(b.id) to this return parseInt(a.id) - parseInt(b.id) Check here for more information: https://stackoverflow.com/a/949970/1845408
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/29589770
score: 1

http://stackoverflow.com/comment/47412439
type: AnswerComment
has text: Yeah That for sure :)
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29633052

http://stackoverflow.com/q/29615476
has comment: http://stackoverflow.com/comment/47376589
possible better answer: http://stackoverflow.com/a/29615568
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/47376787
tagged with: regex
has comment: http://stackoverflow.com/comment/47376625
has comment: http://stackoverflow.com/comment/47376273
score: 0
accepted answer: http://stackoverflow.com/a/29615559
has comment: http://stackoverflow.com/comment/47376822
tagged with: javascript
has body: I have a regex that I'm using to try to get some values from the getComputedStyle object. I would expect that when I run it against exec at each iteration starting at index 1 my matches would be located, but at each iteration two new elements are added to myArray and elements set before are now undefined. var styleAsDashedStr = window.getComputedStyle(document.getElementById("container")).cssText; var styleRe = /(?:;\s?(background.*?)\:\s?(.*?);)|(?:;\s?(font.*?)\:\s?(.*?);)|(?:;\s?(border.*?)\:\s?(.*?);)|(?:;\s?(margin.*?)\:\s?(.*?);)|(?:;\s?(padding.*?)\:\s?(.*?);)/g; //var individuallySetStyles = styleAsDashedStr.match(styleRe); var myArray; while ((myArray = styleRe.exec(styleAsDashedStr)) !== null) { console.log(myArray); } First iteraction 0: "; background-blend-mode: normal;" 1: "background-blend-mode" 2: "normal" 3: undefined 4: undefined 5: undefined 6: undefined 7: undefined 8: undefined 9: undefined 10: undefined And subsequent iterations have two elements defined, but the other 8 are not. Is there a way to get an array where elements one and two are the current captures?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29615568
has comment: http://stackoverflow.com/comment/47376854
has title: exec not returning matches in arr[1] - n
tagged with: exec
has answer: http://stackoverflow.com/a/29615559

http://stackoverflow.com/comment/47383506
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29619473
has text: @शेखर: pass them through `data-` attributes

http://stackoverflow.com/comment/47423338
type: QuestionComment
type: Comment
has text: I think user agent maybe same on multi devices. It seems I need to create a support native app or service to help client detect device.
comment on: http://stackoverflow.com/q/29640697
score: 0

http://stackoverflow.com/a/29615263
has comment: http://stackoverflow.com/comment/47376476
has comment: http://stackoverflow.com/comment/47375965
has comment: http://stackoverflow.com/comment/47376536
type: Answer
has body: You just need to clear your options before appending: $('.codeSelection option').remove(); There's a runnable snippet below if you want to see it in action. As soon as you click off the name, the dropdown options will change. $('.nameInput').on("blur", function() { if ($('.nameInput').val() =="Smith") { var myOptions = { val1 : "Tom", val2 : "John" }; $('.codeSelection option').remove(); $.each(myOptions, function(val, text){ $('.codeSelection').append($(' ').val(val).html(text)); }); } }); $(function() { $(".nameInput").get(0).focus(); }); Code Name One Name
answers question: http://stackoverflow.com/q/29614902
score: 0

http://stackoverflow.com/a/29542332
upvote count: 4
answers question: http://stackoverflow.com/q/29542292
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29542292
type: Answer
score: 4
has body: The value of this in your .each() loop will be a reference to an element, not a jQuery object. Thus: $(".list").each(function() { $(this).children("li").each(function() { arr.push(this.innerHTML); }); }); That is, $(this).children instead of this.children. Note that you could avoid the outer .each() (not that there's anything terrible about it): $(".list &gt; li").each(function() { arr.push(this.innerHTML); });
has comment: http://stackoverflow.com/comment/47236866

http://stackoverflow.com/q/29593773
score: -1
has comment: http://stackoverflow.com/comment/47334532
has answer: http://stackoverflow.com/a/29593828
downvote count: 1
type: Question
tagged with: javascript
tagged with: jquery
has title: Jquery and Javascript val() input issue
has body: I am trying to make a div with the class 'backarea' disappear and at the same time having a different div with the class 'successLog' appear on the screen. Sounds easy I know but the hard part is that I want that to happen only when a certain username and password are entered into 2 different input boxes and the log in button is clicked. The username that has to be entered in is "CodeAcademy" and the password has to be "fun-coding". I don't know what I did wrong but hopefully if you look at my code below you can tell me. I posted all of my code because I don't know what will, and won't be use full. Thank you. HTML: Log in box Home Dashboard Contact Us Event Calender Bookings Picture Gallery Login Sign Up Saved Info Friends Document Profile Account Email Forum Phone-numbers Facebook Twitter Hello! Welcome back Code Acedamy Log Out Username: Password: Log In Don't have an account? Creat one. Sorry but that username or password is incorrect. CSS: body { background-color:#F0F0F0; } .successLog { background-color:#8A8A8A; height:450px; width:700px; z-index:1; opacity:0; } .backarea { background-color:#6DE3E3; width:255px; height:300px; border:1px solid black; border-radius:9px; position:relative; top:67px; left:230px; position:fixed; } .userInput { padding:5px; margin:7px; font-family: 'Lato', sans-serif; position:relative; top:50px; left:35px; border:1px solid white; } .userInput:hover { border:2px solid #60BF68; } .username { color:#E60716; font-family: 'Oswald', sans-serif; position:relative; bottom:50px; left:75px; } .passInput { padding:5px; margin:7px; font-family: 'Lato', sans-serif; position:relative; top:20px; left:35px; border:1px solid white; } .passInput:hover { border:2px solid #60BF68; } .password { color:#E60716; font-family: 'Oswald', sans-serif; position:relative; bottom:80px; left:75px; } .login { color:white; background-color:#E60716; padding:5px; font-family: 'Oswald', sans-serif; border:none; margin:10px; position:relative; bottom:60; left:71; height…
upvote count: 0
answer count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: input
tagged with: css

http://stackoverflow.com/comment/47269307
has text: well actually you can probably do all of this an easier way. Basically two loops should be enought first you do a loop over all rows and inside this loop if value of first checked element is duplicated then you loop trought the rest of row elements to make sure that all elements in row are duplicated. if so you set a flag(variable) to 1 so it won't add a row, otherwise it will add a row. Could you give us the html code on which you work, what kind of elements do you work with. As for cell value it is becouse the value you have in cell is input so you should call cell.val() or something.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29558656

http://stackoverflow.com/comment/47302627
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29577052
type: Comment
has text: There's no way you can set the contents of one web page from another. You can pull a same-origin web page into your javascript using Ajax, but that's different.

http://stackoverflow.com/a/29673649
has body: You probably just need to encode your values for use in a query string: var cautionArrayString = encodeURIComponent(JSON.stringify(arry)); var dangerArrayString = encodeURIComponent(JSON.stringify(arry1)); var queryString = "email=" + encodeURIComponent(Email) + "&amp;caution=" + cautionArrayString + "&amp;danger=" + dangerArrayString; Converting it to json does not automatically encode it correctly for use in a url so characters in your values could break the query string. Assuming the different quotes are caused by copy-pasting...
answers question: http://stackoverflow.com/q/29673398
score: 1
accepted answer of: http://stackoverflow.com/q/29673398
has comment: http://stackoverflow.com/comment/47485691
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1

http://stackoverflow.com/a/29583786
answers question: http://stackoverflow.com/q/29583566
score: 0
has body: Say you have have Hello World On your CSS, you would have: #message { display:none; /* other css*/ } On your JavaScript you could have something like: /* after some event or something */ document.getElementById("message").style.display = "block"; What do you think?
type: Answer
has comment: http://stackoverflow.com/comment/47315713

http://stackoverflow.com/q/29679092
has comment: http://stackoverflow.com/comment/47554947
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
has answer: http://stackoverflow.com/a/29709854
has comment: http://stackoverflow.com/comment/47555150
type: AnsweredQuestion
score: 2
tagged with: share-button
upvote count: 2
has answer: http://stackoverflow.com/a/29888147
has body: I am pretty new to Jekyll, but I am trying to build my own tech blog over it. I want to add to each post a footer containing a list of buttons (icons) to share to social networks an article. Searching around for a solution, I've seen that such buttons are implemented using SVG images. So, inside the post.html file, I've added an include to a share.html file, where to refer to these share buttons. The problem is: where have I to put the SVG icons? I've seen over the Internet that in many jekyll blogs' filesystem there are not SVG file at all, What the hell is going on? EDITED I know that it is possible to inline an svg icon using the svg tag. But it is not what I meant. I post here an example that I found 0 I've searched for icon-twitter class in all the Git repository, but I did not find that anywhere.
type: Question
has title: Add to Jekyll social share buttons
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29682623
accepted answer: http://stackoverflow.com/a/29888147
answer count: 3
has answer: http://stackoverflow.com/a/29682623
tagged with: jekyll
downvote count: 0

http://stackoverflow.com/comment/47225938
has text: Do you have the list elements in an array or anything like that?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29536725
type: Comment

http://stackoverflow.com/q/29658443
favorite count: 0
answer count: 0
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/47456648
score: 1
has comment: http://stackoverflow.com/comment/47457002
has body: I currently have a dropdownbox, @Html.DropDownList("selectSize", Model.Sizes, "--select--") Because my database is to have 100s of sizes, how could I change this into a search bar, rather than having a super long dropdown box? When the dropdown is selected, the below javascript autocompletes my userform. &lt;script type="text/javascript"&gt; $(function () { $("[name='selectSize']").change(function () { $.getJSON('@Url.Action("GetSize")', { sizeID: $("[name='selectSize']").val() }, function (Size) { // Fill the fields according to the Jsondata we requested $("#KID").val(Size["KammID"]); $("#KOD").val(Size["KammOD"]); $("#SID").val(Size["SpacerID"]); $("#SOD").val(Size["SpacerOD"]); $("#WOD").val(Size["WashersOD"]); }); }); }); &lt;/script&gt; This script uses a controller function to contact the database and update the userform on change, the controller function is: public JsonResult GetSize(int sizeID) { var Size = db.AllSizes.Find(sizeID); return Json(Size, JsonRequestBehavior.AllowGet); }
type: Question
has title: Creating a search bar with javascript & getJson, to search database and autocomplete form
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/47456582
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47456610
has comment: http://stackoverflow.com/comment/47458281
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47456587
has comment: http://stackoverflow.com/comment/47457216

http://stackoverflow.com/a/44885424
score: -1
has body: You have to control Google's HTTP headers , make sure to use valid options X-Frame-Options
upvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29658088
downvote count: 1

http://stackoverflow.com/comment/96104875
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/38378350
has text: This should be downvoted more. `item` is not defined in your "right way"

http://stackoverflow.com/q/29586615
tagged with: css
has comment: http://stackoverflow.com/comment/47321168
has body: I'm working on a project that has some draggable content in it. All of the images that are draggable have portion that are transparent and overlap other content. I set up an example on JSFiddle: Draggable Example The background is transparent, but if you grab ANYWHERE in the border you can drag the image around. img{ border: solid black 1px; } In the example you can grab the image by holding down the left mouse button anywhere within the borders of the image, even if they are transparent. In this example my goal would be to only be able to drag the image if you grabbed a visible portion of the planet Jupiter. Is this possible in html?
has comment: http://stackoverflow.com/comment/47321203
type: Question
has answer: http://stackoverflow.com/a/29586718
has comment: http://stackoverflow.com/comment/47321075
has comment: http://stackoverflow.com/comment/47321519
linked to: http://stackoverflow.com/q/15036386
tagged with: jquery-ui
has comment: http://stackoverflow.com/comment/47321979
has comment: http://stackoverflow.com/comment/47321094
has comment: http://stackoverflow.com/comment/47321135
has comment: http://stackoverflow.com/comment/47321396
has comment: http://stackoverflow.com/comment/47321184
score: 0
has comment: http://stackoverflow.com/comment/47321610
has title: How do you make a portion of the image undraggable?
has comment: http://stackoverflow.com/comment/47321530
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47321126
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/29541123
has answer: http://stackoverflow.com/a/29541600
answer count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47262934
accepted answer: http://stackoverflow.com/a/29541600
score: 0
type: Question
has body: I created a plugin which adds a h1 formatting to a given text. Therefore I added the command to the toolbar which works perfect. Now I try to bind my new command "heading-h1-cmd" to a shortcut: config.keystrokes = CKEDITOR.ALT + 77, 'heading-h1-cmd' ; Why is my command not triggered? Other shortcuts like 'bold' work like they should.
tagged with: javascript
tagged with: ckeditor
has title: Add a hotkey to plugin command for CKEditor

http://stackoverflow.com/q/29551689
tagged with: javascript
tagged with: iis-7.5
favorite count: 0
has comment: http://stackoverflow.com/comment/47846841
tagged with: angularjs
type: UnansweredQuestion
has body: I'm working on angular app for intranet application. I hosted angular and WebApi in IIS as separate application. I need to validate the current windows logged-in user against Active-Directory group. So when user loads the angular page, it should automatically send in the logged-in userId. I tried with $windows service, but it does not have the user information. Any approach which I could use here.
score: 2
answer count: 0
has comment: http://stackoverflow.com/comment/47968628
upvote count: 3
downvote count: 1
has comment: http://stackoverflow.com/comment/50933856
tagged with: windows-authentication
has title: AngularJs Intranet Windows Authentication
type: Question
tagged with: asp.net-web-api2

sqlite
tags question: http://stackoverflow.com/q/29676037
type: Tag
tags question: http://stackoverflow.com/q/29604545
tags question: http://stackoverflow.com/q/29596026
tags question: http://stackoverflow.com/q/29623616
tags question: http://stackoverflow.com/q/29530390
tags question: http://stackoverflow.com/q/29534431
tags question: http://stackoverflow.com/q/29662950
tag name: sqlite

http://stackoverflow.com/comment/47429639
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29644406
type: AnswerComment
has text: I doubt most dev work is done with pre-minified files though :)

http://stackoverflow.com/comment/47427625
type: Comment
has text: @JamesCrosswell You can easily have the showModal and closeModal methods just set an observable bool property `isShowingModal`. That way the bindingHandler can just bind to that bool property and show/hide the modal based on the value. If you would like it, I can write an example of what I mean as an answer. Just let me know.
comment on: http://stackoverflow.com/a/29627787
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47492288
comment on: http://stackoverflow.com/a/29677385
score: 0
type: AnswerComment
type: Comment
has text: why not ? it is ok using it

http://stackoverflow.com/comment/47327117
has text: http://stackoverflow.com/questions/5915893/stop-form-submission-with-submit-eventlistener
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29590015
score: 0

http://stackoverflow.com/q/29594060
tagged with: webforms
tagged with: asp.net
favorite count: 0
has answer: http://stackoverflow.com/a/29594298
upvote count: 1
tagged with: vb.net
has title: Can I cache a segment of HTML with javascript?
accepted answer: http://stackoverflow.com/a/29594298
type: AnsweredQuestion
has body: My scenario: I have a page—let's call it items.aspx—that has an HTML table that is generated with a $.get() call to my ASP Web API controller. When a user clicks on one of the items in the HTML table, the user is sent to a page representing that item's details—let's call that one itemDetails.aspx. I predict it will be common to view the itemDetails.aspx page and then decide to cancel and redirect back to the items.aspx page. The problem: The problem is that each time the items.aspx page is loaded, the ajax call runs again and it takes a couple seconds to populate the table. The question: Is it possible to, when the user clicks the item to go to the itemDetails.aspx page, store/cache the HTML output of the table for a limited time? Since I only want this to happen if the user clicks the item link, I figured javascript would be the best tool.
score: 1
tagged with: caching
type: Question
answer count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/29620416
tagged with: fancybox-2
score: 3
tagged with: javascript
has body: I have a dynamic fancy-box image gallery with Elevate Zoom Implemented in it, When the user clicks on from the fancy-box image the Elevate Zoom plugin is initialized and can see the magnified image in the fancy-box. After disabling the Elevate Zoom plugin I'm not able to scroll the image from the fancy-box. Is there any way to bind the scroll feature back to the fancy-box div after disabling the Elevated Zoom ? I'm using Fancy-box 2.15v and Elevate Zoom 3.0.8v $(".fancybox-thumb").attr("rel","gallery").fancybox({ scrolling: 'no', prevEffect : 'none', nextEffect : 'none', type :'image', maxHeight : '150%', maxWidth : '90%', fitToView : true, arrows : true, mouseWheel : false, afterShow : function(){ $('.fancybox-image').click(function() { $('.fancybox-image').elevateZoom({ zoomType : "lens", scrollZoom : true, lensSize : 900, }); $('#fancybox-buttons').hover(function() { $('.zoomContainer').remove(); $('.zoomWindowContainer').remove(); $(".zoomLens").remove(); }); }); }, beforeClose: function(){ $(".zoomContainer").remove(); $('.zoomWindowContainer').remove(); $(".zoomLens").remove(); } });
type: Question
tagged with: ruby-on-rails-4
downvote count: 0
has title: Not able to scroll the image inside fancybox after Initializing Elevate Zoom
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 0
upvote count: 3
type: UnansweredQuestion

http://stackoverflow.com/comment/47322698
type: AnswerComment
score: 0
type: Comment
has text: yes, i closed the div and capitalized the P.. seems now its not reading the jquery part.. no errors in the console. I added this to my .js file `$('.EndPoint').on('click', function () { $('.EndPoint').find('div').hide(); $(this).find('div').show(); });`
comment on: http://stackoverflow.com/a/29585766

http://stackoverflow.com/a/29619341
has comment: http://stackoverflow.com/comment/47389928
has comment: http://stackoverflow.com/comment/47677742
has comment: http://stackoverflow.com/comment/47390122
has comment: http://stackoverflow.com/comment/47390208
has body: You are clicking on img and passing that img reference to function but your spans from where you are getting values is in row so you need to get row.Here is how you can get the row and than get the values. You will pass img to function and in function you will get the row by using below code. var row = $(img).closest("tr"); OR var row = $(img).parent().parent(); You can use anyone of these. function EditCompany(img) { var row = $(img).closest("tr"); cityID = $("#cityID", row).text(); country = $("#country", row).text(); name = $("#company", row).text(); desc = $("#description", row).text(); DisplayCompany(); return false; }
answers question: http://stackoverflow.com/q/29618458
has comment: http://stackoverflow.com/comment/47424549
has comment: http://stackoverflow.com/comment/47680384
has comment: http://stackoverflow.com/comment/47679720
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29618458
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/47419126
has comment: http://stackoverflow.com/comment/47389545

http://stackoverflow.com/comment/47388176
comment on: http://stackoverflow.com/a/29622155
score: 0
type: AnswerComment
has text: Need to clear intervals before creating new interval, so that it don't go into multiple loops. Same thing happens with jQuery Stop(), before animate. It clears the animation queue.
type: Comment

http://stackoverflow.com/q/29665783
type: Question
has answer: http://stackoverflow.com/a/29665804
linked to: http://stackoverflow.com/q/1593083
tagged with: javascript
score: -10
answer count: 2
upvote count: 0
tagged with: jquery
has body: I have following table structure and i want to loop through table inside my td. Please help me with same.
favorite count: 0
has answer: http://stackoverflow.com/a/29666003
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: How can i loop through table in td using javascript
has comment: http://stackoverflow.com/comment/47472235
downvote count: 10

http://stackoverflow.com/comment/47279884
has text: _“The problem is, I don't know how to get a text based on its preceding one”_ – don’t try to look _forward_, look _back_ instead. When you encounter the `Paragraph` line in your input data, consult the variable that you stored the value of the _previous_ line into.
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/29564526

http://stackoverflow.com/comment/47452314
has text: this will remove first element not the last
type: AnswerComment
comment on: http://stackoverflow.com/a/29656312
score: 0
type: Comment

http://stackoverflow.com/comment/47515796
comment on: http://stackoverflow.com/a/29617906
type: Comment
has text: Now i removed main_theme and added te originals javescripts which i consolidated and minified to main_theme.js now check if you find any thing. https://tvseriesden.com/templates/svarog/js/foxycomplete.js https://tvseriesden.com/templates/svarog/js/custom.js i figure it out these 2 js are interfering with it. But when i removed both these javascripts from my code still not working tried every single possibility but not working . It is working on fiddle but not on my website strange. @garethb
type: AnswerComment
score: 0

http://stackoverflow.com/a/29537095
has body: $("#selectCategory").on("change", function() { $(".showable").hide(); $("#" + $(this).val()).show(); }) div { width: 40px; height: 40px; } -- please choose -- Red Green Blue
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29536840

http://stackoverflow.com/q/29542258
type: Question
has title: Change font size on my website with Javascript
has comment: http://stackoverflow.com/comment/47236370
tagged with: javascript
has comment: http://stackoverflow.com/comment/47236472
has answer: http://stackoverflow.com/a/29542417
score: 0
linked to: http://stackoverflow.com/q/195951
answer count: 3
has body: This is my website http://natjecanje.interes.hr/ I want to have big A and small A and by pressing one of this "A" people can change all letters size on website, all elements need change font size, Thank you! :) P.S. I did google search, but i didn't find what i was looking for.
has answer: http://stackoverflow.com/a/29542601
has answer: http://stackoverflow.com/a/29556636
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47236451
has comment: http://stackoverflow.com/comment/47236392

http://stackoverflow.com/q/29568235
tagged with: python
has answer: http://stackoverflow.com/a/29568396
type: AnsweredQuestion
has title: Get dynamic list elements to server in Flask/Javascript
type: Question
tagged with: javascript
tagged with: flask
score: 0
has comment: http://stackoverflow.com/comment/47286111
answer count: 1
accepted answer: http://stackoverflow.com/a/29568396
has body: I'm trying to write a very basic Flask/Javascript app that can check the order of a list of elements every time the "submit" button is clicked (and send it to the server); I've tried a lot of different variants of "request.get" and can't seem to find anything that will pull any information on the listWithHandle element. This seems like a simple operation, but I'm pretty new to web programming and I haven't been able to decode the docs that I'm sure contain the solution. There are two files: app.py from flask import Flask, render_template, request, redirect app = Flask(__name__) names = ['Ivuoma', 'Carla', 'Aly'] @app.route('/') def hello_world(): # When "submit" button is clicked, # print order of names to console, # then reorder python names list and render_template. return render_template('index.html', names=names) if __name__ == '__main__': app.run(debug=True) index.html: Sortable Test! {% for name in names %} :+:{{ name }} {% endfor %} Submit The fix, based on the accepted answer: app.py prelim_names = ['Carla', 'Aly', 'Ivuoma'] @app.route('/', methods=['GET', 'POST']) def hello_world(): names = request.form.getlist('handles[]') if not names: names = prelim_names print('names to display', names) return render_template('index.html', names=names) index.html {% for name in names %} :+: {{ name }} {% endfor %} Submit

http://stackoverflow.com/a/29680648
accepted answer of: http://stackoverflow.com/q/29672213
upvote count: 30
has body: Within a service worker, self.registration.scope will give you the associated scope. This is available in Chrome 42+ (which just became the stable release), so it should be safe to use. I think you might also be asking about how to get the a reference to all of the active pages that a service worker controls, too? If that's the case, the answer is to use self.clients.matchAll() (also available in Chrome 42+), which will return a (potentially empty) array of WindowClient objects, corresponding to each open, controlled page. WindowClient exposes a url property with the corresponding URL.
type: AcceptedAnswer
type: Answer
score: 30
has comment: http://stackoverflow.com/comment/47499219
downvote count: 0
answers question: http://stackoverflow.com/q/29672213

http://stackoverflow.com/comment/47222227
score: 0
type: Comment
type: QuestionComment
has text: @Jai every other part of the site is 100% percent angular, and works perfectly. It is just this one situation where I could not think of an angular solution.
comment on: http://stackoverflow.com/q/29534537

http://stackoverflow.com/comment/47371677
comment on: http://stackoverflow.com/a/29612983
score: 0
type: AnswerComment
has text: @LinDong I meant you should prefer serverside parsing to client side, as well and non-regex to regex. And like I said, tags with attributes would be matched, so literally only could get through, would be matched.
type: Comment

http://stackoverflow.com/a/29581016
has comment: http://stackoverflow.com/comment/47315123
downvote count: 0
has comment: http://stackoverflow.com/comment/47315023
has comment: http://stackoverflow.com/comment/47315025
score: 1
accepted answer of: http://stackoverflow.com/q/29580748
answers question: http://stackoverflow.com/q/29580748
upvote count: 1
has comment: http://stackoverflow.com/comment/47314687
has comment: http://stackoverflow.com/comment/47315396
has comment: http://stackoverflow.com/comment/47310624
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47315510
has comment: http://stackoverflow.com/comment/47314540
has comment: http://stackoverflow.com/comment/47315208
has body: div[class="class1"] as a selector cannot work, because you don't have any &lt;div&gt; elements in your markup that have the class1 class. You can try the following, but it won't get you far: this.getElementsAttribute('a.class1', 'href'); Building an array of objects in the page context It is hard and may be error prone to do this only with CasperJS functions. It is much easier to do this by iterating over all the links and fetching the parts that you need. casper.then(function(){ var info = this.evaluate(function(){ var links = document.querySelectorAll(".class1"); // iterate over links and collect stuff return Array.prototype.map.call(links, function(link){ return { href: link.href, hrefText: link.textContent.trim(), afterText: link.parentNode.childNodes[2].textContent.trim() }; }); }); require('utils').dump(info); }); How this works: You can get all the links by querying all for all the elements with class1. Since the result of querySelectorAll() is not an array, but an array-like NodeList, you can't directly use .map() on it. Each link has a href property and a textContent property. The text after the link is a little tricky. You first need to get the parent of the link (&lt;p&gt;) and then try to get the TextNode after the link by accessing the childNodes property. childNodes[2] must probably be used instead of childNodes[1], because the first (childNodes[0]) is probably a TextNode containing whitespace, so everything after it shifts. Building a single string in the page context You can also iterate over it to get it in a textual representation: casper.then(function(){ var info = this.evaluate(function(){ var links = document.querySelectorAll(".class1"); // iterate over links and collect stuff return Array.prototype.map.call(links, function(link){ return [ link.href, link.textContent.trim(), link.parentNode.childNodes[2].textContent.trim() ].join('\n'); }).join('\n\n'); }); this.echo(info); }); How it works: JavaScript arrays have a join() function. It can joins…
type: Answer
has comment: http://stackoverflow.com/comment/47314977
has comment: http://stackoverflow.com/comment/47315105
has comment: http://stackoverflow.com/comment/47315348

http://stackoverflow.com/q/29547556
accepted answer: http://stackoverflow.com/a/29547730
tagged with: javascript
has answer: http://stackoverflow.com/a/29547819
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has title: Create divs and add images on the fly
tagged with: css
has answer: http://stackoverflow.com/a/29547838
possible better answer: http://stackoverflow.com/a/29547819
has body: I'm creating 4 divs and adding 4 images in to each div. var divid = ["aa","bb","cc","dd"], imgid = ["a.png","b.png","c.png","d.png"]; for(var i = 0; i &lt; divid.length;i++ ){ document.write('&lt;div id="'+divid[i]+'" class="divCl"&gt;&lt;input type="image" src="'+imgid[i]+'" class="imgCl"/&gt;&lt;/div&gt;'); } css:- .divCl{ /*display: none;*/ } .imgCl{ width: 100px; height: 100px; } Why isn't the css applying? also is it ok to use this method to create divs and add images?
has answer: http://stackoverflow.com/a/29547730
type: AnsweredQuestion
type: Question
score: 0

http://stackoverflow.com/q/29532493
has answer: http://stackoverflow.com/a/29532869
has title: Google Text to Speech Api on click play website
tagged with: google-text-to-speech
tagged with: php
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29532869
linked to: http://stackoverflow.com/q/14723973
downvote count: 2
tagged with: text-to-speech
has body: i have this paragraph A tattoo of angel wings on the back of the young girl pointed officers to a runaway, a 15-year-old school girl called Tina Fontaine. Within days Tina's case was making headlines throughout Canada not just for the horrific nature of her death, but for what she had come to represent. and want to play it on my website on click ! so far this is my best code, they say it cant handle more than 100 characters. var audio = new Audio(); audio.src ='http://translate.google.com/translate_tts?ie=utf-8&amp;tl=en&amp;q=Hello%20World.'; audio.play(); Any suggesions ? using only jquery / Javascript / PHP Thankyou
linked to: http://stackoverflow.com/q/18914629
type: Question
score: -2
tagged with: javascript
upvote count: 0
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/47218602
favorite count: 0

http://stackoverflow.com/comment/47221430
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29534000
has text: You can copy/past in an html file and execute step by step to understand precisely... And thank you Pavlo.
score: 0

http://stackoverflow.com/a/29622904
answers question: http://stackoverflow.com/q/29622642
has body: You could use css3 transitions and changing background color. You set the transition and then, by just changing the background color, the animation performs. Check this fiddle: http://jsfiddle.net/en2cb2vq/ CSS Code: .square { width: 50px; height: 50px; transition: background-color 0.5s ease; background-color: red; } .square.green { background-color: green; } HTML Code: click me Javascript (with jQuery): $("a").click( function() { $(".square").addClass("green"); return false; });
score: 0
type: Answer

http://stackoverflow.com/q/29654656
type: UnansweredQuestion
upvote count: 6
has comment: http://stackoverflow.com/comment/47449103
downvote count: 1
type: Question
score: 5
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/29654697
tagged with: jquery
has title: Javascript - Multiple selector
has answer: http://stackoverflow.com/a/29654693
favorite count: 0
has body: $(document).on('click', '.SELECTOR1 OR #SELECTOR2', function(){ // some code }); What I want to achieve is to run some code if either one of the elements is clicked.

http://stackoverflow.com/q/29600253
type: Question
has comment: http://stackoverflow.com/comment/47347182
tagged with: jquery-ui
has comment: http://stackoverflow.com/comment/63349740
tagged with: javascript
has title: JQuery Datepicker OnSelect not working returns "Uncaught TypeError: undefined is not a function"
has comment: http://stackoverflow.com/comment/47347290
has comment: http://stackoverflow.com/comment/47347447
has comment: http://stackoverflow.com/comment/47346925
tagged with: jquery
has body: I have this code, I am using jquery datepicker. but it won't work. I am trying to set the second datepicker's minDate to the selected date of the first datepicker. &lt;script type="text/javascript" src="js/jquery-ui.1.10.4.js"&gt;&lt;/script&gt; &lt;script src="js/jquery-ui-1.11.1.js"&gt;&lt;/script&gt; &lt;link rel="stylesheet" type="text/css" href="css/jquery-ui-1.10.4.css"&gt; &lt;input type="text" id="Inspection_Date"&gt; &lt;input type="text" id="Shipment_Date"&gt; &lt;script&gt; $(function() { $( "#Inspection_Date" ).datepicker({ minDate: 1, numberOfMonths: 2, onSelect : function(selectedDate) { $( "#Shipment_Date" ).datepicker("option","minDate",selectedDate); } }); $( "#Shipment_Date" ).datepicker({ minDate: 1, numberOfMonths: 2, onSelect : function(selectedDate) { $( "#Inspection_Date" ).datepicker("option","minDate",selectedDate); } }); }); &lt;/script&gt; the console error points to this line of code $( "#Shipment_Date" ).datepicker("option","maxDate",selectedDate); any help would be appreciated.. thanks
has comment: http://stackoverflow.com/comment/47347488
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47347390
has comment: http://stackoverflow.com/comment/47347159
tagged with: datepicker
has comment: http://stackoverflow.com/comment/47347175
has comment: http://stackoverflow.com/comment/47347428
answer count: 0
score: 0

http://stackoverflow.com/a/29623838
downvote count: 0
score: 1
upvote count: 1
type: Answer
has body: $("div").css('left') will return only in px not in percentage so change your condition to if($("div").position().left/$(window).width() * 100 == "90%") this will return position percentage
answers question: http://stackoverflow.com/q/29623619

http://stackoverflow.com/comment/47501754
type: Comment
comment on: http://stackoverflow.com/a/29675619
has text: thank you I have one comment, In addition to loading after 5 seconds, how would i work it so that it only load one every 2 hours and not per page.As of right now the modal appears every time the page is load, but i would like to load every 2 hours that page is load, so if i load the page now i see it, but if i load it 10 minute later i don't see it but if load this page again in 2 hours i see it or per browser session
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47477660
comment on: http://stackoverflow.com/a/29669552
type: Comment
has text: See my comment in the original question: "Modify my server to accept non-HTML-encoded values: for various reasons I won't go into this is problematic and not a practical solution." The form is dynamically generated and processed, so there's no property to add the attribute to.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/48157176
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29857071
has text: @Imray, that's an issue with all draggables. There always a way to implement scroll-drag behavior. It may require extending the directive -- forking the repo and adding that kind of behavior. It's an interesting issue. Make a plunkr / fiddle and post it as a question. LMK when you do.

http://stackoverflow.com/a/29542890
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29542566
answers question: http://stackoverflow.com/q/29542566
score: 0
type: Answer
has body: I think the reason is that your pho script is echoing the string start with "Array". The Ajax .get method does a smart guess for return object. When it receive a string from php, it could not convert it into either Jason nor xml so it think the dataSG is simply string. The Json_encode did not do it successfully. You have to format your php output to be something like "['a','b']", then Ajax can successfully convert it into a JavaScript array.

http://stackoverflow.com/q/29667470
has title: Which JavaScript design pattern is this?
linked to: http://stackoverflow.com/q/8228281
has answer: http://stackoverflow.com/a/29668125
answer count: 5
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47474936
tagged with: design-patterns
has answer: http://stackoverflow.com/a/29668551
has comment: http://stackoverflow.com/comment/47474202
has answer: http://stackoverflow.com/a/29668165
upvote count: 1
has answer: http://stackoverflow.com/a/29670138
downvote count: 1
type: Question
tagged with: javascript
has body: I'm not sure which JavaScript design pattern I'm following. Can someone please help shed some light on it? var masonrySupport = ({ large__videos__support: function() { $('.masonry-container .largeRec').find('.itemMasVideo').parent().addClass('item_largeRec_video_height'); }, smallRec__videos__support: function() { $('.masonry-container .smallRec').find('.itemMasVideo').parent().addClass('item_smallRec_video_height'); }, init: function() { this.large__videos__support(), this.smallRec__videos__support() } }) masonrySupport.init();
has answer: http://stackoverflow.com/a/29667992
score: 0
has comment: http://stackoverflow.com/comment/47474991
favorite count: 0

http://stackoverflow.com/q/29662966
downvote count: 0
possible better answer: http://stackoverflow.com/a/29663836
favorite count: 0
has body: I have around 4 buttons that shows content when clicked $(function() { $(".hidden").hide(); $('.button').on('click', function() { var circle = $(this).attr('data-circle'); $('.'+circle).toggle(); $(this).find('i').toggleClass('fa-minus fa-plus'); }); }); My html biographies pictures poetry content content content The content is hidden because I want to reveal it each time it is clicked, I'm also using font awesome as you can see and this gives me a plus sign when the content is visible and a minus sign once it is hidden. How can I save the toggle state of both the content and icon class? http://jsfiddle.net/hv4aywa4/
has answer: http://stackoverflow.com/a/29663836
accepted answer: http://stackoverflow.com/a/29664552
has title: Save toggle state + class toggle using cookies
type: AnsweredQuestion
tagged with: cookies
score: 1
upvote count: 1
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29664552
answer count: 2

http://stackoverflow.com/a/29656437
has comment: http://stackoverflow.com/comment/47452536
type: Answer
answers question: http://stackoverflow.com/q/29655994
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47453103
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47452591
has body: If you cannot use lookbehinds you may want to try and cleverly expand your match like I.e. ( :\/) Note the extra space which could of course be something more sophisticated. Update (:\/)(?!\/) did the trick by using a negative lookahead (which Javascript supports) for a /.
accepted answer of: http://stackoverflow.com/q/29655994

http://stackoverflow.com/comment/47365987
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29608139
score: 0
has text: @Alex it's Blackbaud Net Community

http://stackoverflow.com/comment/47428490
has text: Did you try `widgetPositioning { vertical: 'bottom'; }`?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29643679
type: Comment

http://stackoverflow.com/a/29679040
answers question: http://stackoverflow.com/q/29678986
accepted answer of: http://stackoverflow.com/q/29678986
type: Answer
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/47495441
has comment: http://stackoverflow.com/comment/47495387
has body: When a key is not found the entire prototype chain will be traversed, looking for that key. From ECMA-262 §4.2.1 Objects: Every object created by a constructor has an implicit reference (called the object’s prototype) to the value of its constructor’s "prototype" property. Furthermore, a prototype may have a non-null implicit reference to its prototype, and so on; this is called the prototype chain. When a reference is made to a property in an object, that reference is to the property of that name in the first object in the prototype chain that contains a property of that name. In other words, first the object mentioned directly is examined for such a property; if that object contains the named property, that is the property to which the reference refers; if that object does not contain the named property, the prototype for that object is examined next; and so on.
upvote count: 3
type: AcceptedAnswer

http://stackoverflow.com/a/29615562
downvote count: 0
answers question: http://stackoverflow.com/q/29575381
type: Answer
score: 1
has body: I think the problem you are having is just a misunderstanding of how $watch works. $watch is expected to initialize with equal values. See the documentation here. Specifically: After a watcher is registered with the scope, the listener fn is called asynchronously (via $evalAsync) to initialize the watcher. In rare cases, this is undesirable because the listener is called when the result of watchExpression didn't change. To detect this scenario within the listener fn, you can compare the newVal and oldVal. If these two values are identical (===) then the listener was called due to initialization So in other words, your check for if they are equal is so you don't detect the initial call In your provided Plunker, if you need to do some initialization code, you can do two things: You can check if they are equal in the $watch function, and if they are then that is the initial call with their initial values Or, outside of that function in the link function, the values are their initial values there (since the link function is equivalent to post-link, which means scope values have already been linked) so you can put your code there Forked your Plunker here. Notice I moved the alert outside of the $watch, and the value is still valid EDIT: The reason you see a difference when it is not in the ng-repeat and it is set up like your commented out code in the Plunkr is due to you adding data in a $timeout. When the page initially loads, below are what the two types render as: &lt;a1 prop="data[0]"&gt;&lt;/a1&gt; HTML looks as it was written. data=[]. directive element exists, calling link with data[0]=undefined. $watch called with prop=undefined &lt;!-- ngRepeat: element in data track by $index --&gt; HTML is simply a comment. waiting for data to be populated. No directive element exists, which means link is not called When you add items to data after the timeout, they look like this: &lt;a1 prop="data[0]"&gt;&lt;/a1&gt; Same as above. data[0] is now defined so prop is defined &…
upvote count: 1
has comment: http://stackoverflow.com/comment/47377247
has comment: http://stackoverflow.com/comment/47377377
has comment: http://stackoverflow.com/comment/47378259

http://stackoverflow.com/q/29623077
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
has comment: http://stackoverflow.com/comment/47392521
has body: I'm using jquery fileupload with a django project. I want to add an additional field to my fileupload form . I followed this documentation. However, when I try to upload the images I get an forbidden error, django's console error is: [14/Apr/2015 09:40:37]"POST /upload/ HTTP/1.1" 403 2274 My script is as follows: $(document).ready(function() { $('form#fileupload').bind('fileuploadsubmit', function (e, data) { var name = $('form#{{ opts.model_name }}_form').find('input[name="name"]').val(); $('form#fileupload').find('input[name="image_name"]').val( name ); data.formData = { 'image_name': name }; if (!data.formData.image_name) { data.context.find('button').prop('disabled', false); return false; } }); }); My request is: Remote Address:127.0.0.1:8000 Request URL:http://localhost:8000/upload/ Request Method:POST Status Code:403 FORBIDDEN Response Headers view source Content-Type:text/html Date:Tue, 14 Apr 2015 08:40:37 GMT Server:WSGIServer/0.1 Python/2.7.8 X-Frame-Options:SAMEORIGIN Request Headers view source Accept:application/json, text/javascript, */*; q=0.01 Accept-Encoding:gzip, deflate Accept-Language:en-US,en;q=0.8,es-419;q=0.6,es;q=0.4,pt;q=0.2,ko;q=0.2,gl;q=0.2 Connection:keep-alive Content-Length:29144 Content-Type:multipart/form-data; boundary=----WebKitFormBoundaryURf6WD0fBem7roLF Cookie:PHPSESSID=fqdqkmd9cmb3oi2odcd6ogiru7; _osra_session=[binary]--2880fbb1b8182485ef09f12b95fd3e7c6d71a714; sessionid=asmv53nr7qc4f1ra930ux7zp29k0vdks; csrftoken=cqqQDJsMROiJa5AtzxVJshOYK49Hl2WL Host:localhost:8000 Origin:http://localhost:8000 Referer:http://localhost:8000/admin/imageboard/image/add/ User-Agent:Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36 X-Requested-With:XMLHttpRequest Request Payload ------WebKitFormBoundaryURf6WD0fBem7roLF Content-Disposition: form-data; name="image_name" asd ------WebKitFormBoundaryURf6WD0fBem7roLF Content-Disposition: form-data; name="files[]"; filename="4f9.jpg" Content-Type: imag…
tagged with: file-upload
type: Question
tagged with: django
tagged with: python
linked to: http://stackoverflow.com/q/19333098
score: 0
has comment: http://stackoverflow.com/comment/47390975
has comment: http://stackoverflow.com/comment/47390720
has title: Forbidden error on jquery fileupload with django
linked to: http://stackoverflow.com/q/7214909
has comment: http://stackoverflow.com/comment/47390053
answer count: 0

http://stackoverflow.com/a/29556054
answers question: http://stackoverflow.com/q/29555677
has body: When you set up your $http request, you can pass in an optional "config" object. This config object has a timeout property for which you can provide a promise. When this promise is resolved, your $http request will be aborted. You can use this concept to "cancel" any outstanding $http requests when you receive the first 401 response back and then redirect the user to any authentication process you need. I am about 80% of the way through finishing up a blog post on this very subject: http://jonnyknowsbest.co.uk/abort-cancelling-http-calls/
has comment: http://stackoverflow.com/comment/47264893
score: 0
type: Answer

http://stackoverflow.com/a/29564867
upvote count: 1
has comment: http://stackoverflow.com/comment/47539905
has body: I'm not sure about plugins and ckeditor, but generally browsers and probably editors then don't allow inline elements to contain block elements, hence paragraph can not have division inside. The P element represents a paragraph. It cannot contain block-level elements (including P itself). We discourage authors from using empty P elements. User agents should ignore empty P elements. Source: http://www.w3.org/TR/html401/struct/text.html#h-9.3.1
has comment: http://stackoverflow.com/comment/47286849
downvote count: 0
type: Answer
score: 1
answers question: http://stackoverflow.com/q/29562393

http://stackoverflow.com/q/29558539
accepted answer: http://stackoverflow.com/a/29644405
has body: products_controller.js var myApp1 = angular.module('myapplication', ['ngRoute', 'ngResource']); //Factory myApp1.factory('Products', ['$resource',function($resource){ return $resource('/products.json', {},{ query: { method: 'GET', isArray: true }, create: { method: 'POST' } }) }]); myApp1.factory('Product', ['$resource', function($resource){ return $resource('/products/:id.json', {}, { show: { method: 'GET' }, update: { method: 'PUT', params: {id: '@id'} }, delete: { method: 'DELETE', params: {id: '@id'} } }); }]); //Controller myApp1.controller("ProductListCtr", ['$scope', '$http', '$resource', 'Products', 'Product', '$location', function($scope, $http, $resource, Products, Product, $location) { $scope.products = Products.query(); $scope.deleteProduct = function (productId) { if (confirm("Are you sure you want to delete this product?")){ Product.delete({ id: productId }, function(){ $scope.products = Products.query(); $location.path('/'); }); } }; }]); myApp1.controller("ProductUpdateCtr", ['$scope', '$resource', 'Product', '$location', '$routeParams', function($scope, $resource, Product, $location, $routeParams) { $scope.product = Product.get({id: $routeParams.id}) $scope.update = function(){ if ($scope.productForm.$valid){ Product.update({id: $scope.product.id},{product: $scope.product},function(){ $location.path('/'); }, function(error) { console.log(error) }); } }; }]); myApp1.controller("ProductAddCtr", ['$scope', '$resource', 'Products', '$location', function($scope, $resource, Products, $location) { $scope.product = {:name, :price, :description }]} $scope.save = function () { if ($scope.productForm.$valid){ Products.create({product: $scope.product}, function(){ $location.path('/'); }, function(error){ console.log(error) }); } } }]); //Routes myApp1.config([ '$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) { $routeProvider.when('/products',{ templateUrl: '/templates/products/index.html', controller: 'ProductListCtr' }); $rout…
type: Question
downvote count: 0
tagged with: javascript
score: 3
has title: Template is not showing in angularjs + rails application
has comment: http://stackoverflow.com/comment/47274848
answer count: 1
favorite count: 0
tagged with: angularjs
tagged with: ruby-on-rails
has answer: http://stackoverflow.com/a/29644405
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47268405
upvote count: 3

http://stackoverflow.com/comment/47301769
comment on: http://stackoverflow.com/a/29576682
type: Comment
has text: You're welcome :) Also refer to that link by @Kaiido as well. It will be useful to you :)
score: 0
type: AnswerComment

http://stackoverflow.com/comment/58615160
has text: @loganfsmyth, your example isn't working for me at least in my tests with node 4.2.2. with `--harmony_destructuring` enabled. I see "SyntaxError: Unexpected token ."
comment on: http://stackoverflow.com/a/29621542
type: Comment
score: 3
type: AnswerComment

datetime
tags question: http://stackoverflow.com/q/29621826
tags question: http://stackoverflow.com/q/29625475
tags question: http://stackoverflow.com/q/29630266
tags question: http://stackoverflow.com/q/29532112
tags question: http://stackoverflow.com/q/29538872
tags question: http://stackoverflow.com/q/29544763
tags question: http://stackoverflow.com/q/29551073
tags question: http://stackoverflow.com/q/29563865
tag name: datetime
tags question: http://stackoverflow.com/q/29533856
tags question: http://stackoverflow.com/q/29617268
tags question: http://stackoverflow.com/q/29533373
type: Tag
tags question: http://stackoverflow.com/q/29654485
tags question: http://stackoverflow.com/q/29536224
tags question: http://stackoverflow.com/q/29643488

http://stackoverflow.com/comment/47353985
has text: your aggregation is good but in your second `$group` use `_id: null` instead of `_id: "1"`
type: Comment
comment on: http://stackoverflow.com/a/29603423
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47422196
has text: Can you add your html?
comment on: http://stackoverflow.com/q/29640043
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/29600323
answer count: 1
favorite count: 0
has body: I am very new in Node.js and javasript. Is it possible return value from request? Thanks var request = require('request'); //parse text function(text) { request(text, function (error, response, body) { if (!error &amp;&amp; response.statusCode == 200) { var $ = cheerio.load(body); //get title var title = $("title").text(); }) I NEED TITLE HERE };
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29602998
tagged with: node.js
has title: Return value from Request
has comment: http://stackoverflow.com/comment/47346924
type: Question
downvote count: 0
tagged with: javascript
score: 2

http://stackoverflow.com/comment/47364687
comment on: http://stackoverflow.com/q/29609574
type: Comment
score: 4
has text: You are passing some_mail and some_text in data while your variable names are mail and text.
type: QuestionComment

http://stackoverflow.com/comment/47371421
type: QuestionComment
has text: You can't do this using JavaScript on the browser. To do it you'd have to do something server side; before it has a chance to get to the client (otherwise someone could inject custom javascript to remove your JavaScript removal).
type: Comment
comment on: http://stackoverflow.com/q/29612562
score: 0

http://stackoverflow.com/comment/47505285
comment on: http://stackoverflow.com/q/29684145
score: 0
type: QuestionComment
has text: To check if all of them are done, you can use [`$q.all()`](https://docs.angularjs.org/api/ng/service/$q).
type: Comment

http://stackoverflow.com/q/29615709
answer count: 1
has comment: http://stackoverflow.com/comment/47376760
has comment: http://stackoverflow.com/comment/47376811
tagged with: javascript
tagged with: jquery
has title: if variable is undefined
favorite count: 0
upvote count: 0
has comment: http://stackoverflow.com/comment/47376806
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29615822
has comment: http://stackoverflow.com/comment/47376817
accepted answer: http://stackoverflow.com/a/29615822
tagged with: cookies
type: Question
downvote count: 2
has body: This probably looks like a duplicate, but nevertheless, i couldn't make it work. What i'm trying to do is with every click, get a certain value, add it to already existing one in cookies, and replace the cookie value with a new total. And i still get not a number error var nextqurl = $(".nav-next a").attr('href'); var curcookie = $.cookie('test'); var initscore = 0; alert(curcookie); $(".answer").click(function(){ var score = $(this).attr('id'); var updatedscore = parseInt(curcookie) + parseInt(score); if (typeof curcookie === 'undefined') { $.cookie('test',initscore, {path: '/'}); } else { $.cookie('test',updatedscore, {path: '/'}); } $.cookie('test',updatedscore, {path: '/'}); window.location.replace(nextqurl); }); }); p.s. cookies are working fine
score: -2

http://stackoverflow.com/q/29561397
downvote count: 0
has body: I am trying to do an autocomplete textbox input field in wordpress. I am using the below code, but it is not working. I'm getting the error XMLHttpRequest cannot load. Course Name :
score: 1
tagged with: wordpress
has comment: http://stackoverflow.com/comment/47272640
type: Question
tagged with: autocomplete
tagged with: javascript
tagged with: jquery
upvote count: 1
has answer: http://stackoverflow.com/a/29561592
answer count: 1
favorite count: 0
has title: How to add autocomplete to text input input field in wordpress
type: UnansweredQuestion

http://stackoverflow.com/a/29603926
has body: Is this what you want? If so, then you can do that with the help of jQuery. And google before posting anything, there are tons of tutorials out there. $(document).ready(function() { window.holdOffset = $('#sticky_navigation').offset().top; $(window).scroll(function() { sticky_navigation(); }); }); function sticky_navigation() { var scroll_top = $(window).scrollTop(); if (scroll_top > holdOffset) $('#sticky_navigation').css({ 'position': 'fixed', 'top':0, 'left':0 }); else $('#sticky_navigation').css({ 'position': 'relative' }); }; body { margin:0px; } p { margin-left:100px; margin-right:100px; } #my_logo { font-size:80px; } #sticky_navigation_wrapper { width:100%; height:50px; } #sticky_navigation { width:100%; height:50px; background:black; } #sticky_navigation ul { list-style:none; margin:0; padding:5px; } #sticky_navigation ul li a { display:block; float:left; margin:0 0 0 5px; padding:0 20px; height:40px; font-size:24px; color:#ddd; } Site Logo Link #1 Link #2 Link #3 Scroll down to see this navigation menu sticking to the top of the page. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ultrices pellentesque facilisis. In semper tellus mollis nisl pulvinar vitae vulputate lorem consequat. Fusce odio tortor, pretium sit amet auctor ut, ultrices vel nibh. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer malesuada convallis mauris in rutrum. Suspendisse dolor lorem, consequat sit amet rutrum at, cursus ut felis. Aliquam pellentesque sodales enim. Vivamus sed adipiscing arcu. Duis tincidunt iaculis lobortis. Sed laoreet mollis tempus. Nam cursus magna in mauris pellentesque vestibulum. Ut non risus a enim pellentesque tincidunt. Maecenas vulputate dolor eu sem convallis convallis. Nulla viverra pharetra tortor, eu adipiscing risus imperdiet a. Nam eu nibh vitae diam accumsan tempus vel eget nisl. Quisque et urna lacus, a mollis ipsum. Mauris in augue elit, sed posuere justo. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec …
type: Answer
downvote count: 0
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29603109

http://stackoverflow.com/a/29570561
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/47293582
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29568403
has body: This is some slightly unintuitive behaviour. Forget the dragging and resizing, they have nothing to do with it. Just look at Project 1. It is two days long on the calendar but it's specified date is {start: "7/1/2015", end: "7/3/2015"} The docs mention this in the Event Object section under end: The exclusive date/time an event ends. Optional. A Moment-ish input, like an ISO8601 string. Throughout the API this will become a real Moment object. It is the moment immediately after the event has ended. For example, if the last full day of an event is Thursday, the exclusive end of the event will be 00:00:00 on Friday! Since the end date has no time, the time is "00:00:00". And this time is immediately after the event.
type: Answer
accepted answer of: http://stackoverflow.com/q/29568403

http://stackoverflow.com/comment/47480305
type: AnswerComment
has text: Ok thank for trying anyway ! :) Don't worry about the files on the server, it's a free hosting that I only use for stackoverflow . Have a nice day !
type: Comment
comment on: http://stackoverflow.com/a/29670699
score: 0

http://stackoverflow.com/a/29581573
answers question: http://stackoverflow.com/q/29581370
type: AcceptedAnswer
has body: Use this -> Fiddle var url = ""; $("#contactform3412").submit(function(e){ url= 'works well!'; alert(url); return true; }); Anyways you set url value and perform operations after submit,so use url value there only. In your problem, url could not set to "works well" as submit event was not fired.
has comment: http://stackoverflow.com/comment/47313203
accepted answer of: http://stackoverflow.com/q/29581370
type: Answer
score: 0

http://stackoverflow.com/comment/47465152
type: QuestionComment
has text: Have you checked the console? It should state you must have a `key` for your ` `
comment on: http://stackoverflow.com/q/29662782
score: 0
type: Comment

http://stackoverflow.com/comment/47430208
type: QuestionComment
has text: It would help if you provide sample code.
comment on: http://stackoverflow.com/q/29644771
score: 0
type: Comment

http://stackoverflow.com/q/29532445
has body: I have use https://github.com/chinmaymk/angular-charts this code with ionic framework i got result properly but unfortunately my x-axis chart text label overlap on each other. Current Output : Expected :
upvote count: 1
accepted answer: http://stackoverflow.com/a/30411856
has comment: http://stackoverflow.com/comment/47220355
has title: Angular Chart X-axis Text label overlap on each other
favorite count: 0
has comment: http://stackoverflow.com/comment/47220065
tagged with: angularjs
downvote count: 0
has answer: http://stackoverflow.com/a/30411856
type: AnsweredQuestion
score: 1
tagged with: hybrid-mobile-app
tagged with: ionic-framework
has comment: http://stackoverflow.com/comment/47218081
type: Question
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47220131

http://stackoverflow.com/a/29584838
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/29584791
has body: alias this into that to avoid ambiguity in the event handler between the instance and the event-raising element: function Canvas(_canvas) { var that=this; this.pixels = new Array(); for (var i = 0; i&lt;this.canvas.width; i++) { var row = new Array(); for (var j=0; j&lt;this.canvas.height; j++) { row.push(i*j); } this.pixels.push(row); } $("#" + _canvas).mousemove(function(e){ var offset = $(this).offset(); console.log(that.pixels[parseInt(e.clientX-offset.left)][parseInt(e.pageY-offset.top)]); }); };
answers question: http://stackoverflow.com/q/29584791
score: 0

http://stackoverflow.com/comment/47292887
has text: can you explain whats going on?
type: AnswerComment
type: Comment
score: 2
comment on: http://stackoverflow.com/a/29571690

kml
tags question: http://stackoverflow.com/q/29593694
tag name: kml
type: Tag

http://stackoverflow.com/q/29659044
accepted answer: http://stackoverflow.com/a/29659799
upvote count: 3
downvote count: 1
type: AnsweredQuestion
tagged with: typescript
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/29659138
has body: Got a Problem with Typescript and jQuery. The elements get appended to body and show up but nothing happens when i click the button. I suppose its something with the this.fooClick() that gets passed to the button but doesnt get called or the wrong jquery elements gets saved to the class variables. Anyone help? test.ts /// &lt;reference path="jquery.d.ts" /&gt; class foo { private button; private text; constructor() { this.button = $('&lt;button&gt;').html("click").click(this.fooClick()); this.text = $('&lt;p&gt;').html("foo"); $('body').append(this.button); $('body').append(this.text); } public fooClick() { $(this.text).html("bar"); } } $(function() { var foobar = new foo(); }) test.js /// &lt;reference path="jquery.d.ts" /&gt; var foo = (function () { function foo() { this.button = $('&lt;button&gt;').html("click").click(this.fooClick()); this.text = $('&lt;p&gt;').html("foo"); $('body').append(this.button); $('body').append(this.text); } foo.prototype.fooClick = function () { $(this.text).html("bar"); }; return foo; })(); $(function () { var bar = new foo(); });
has answer: http://stackoverflow.com/a/29659799
tagged with: this
tagged with: javascript
tagged with: jquery
tagged with: callback
possible better answer: http://stackoverflow.com/a/29659138
has title: jQuery Callback inside Typescript Class
has comment: http://stackoverflow.com/comment/47458010
favorite count: 0
score: 2

http://stackoverflow.com/a/29575577
has body: That's just how the for ... in loop works for arrays: var a = ['a','b','c']; for (var i in a) { alert(i); // alerts 0,1,2 alert(a[i]); // alerts a,b,c } Thus, you just need to index your array with the loop variable: var value = data[i][key]; var result = $.isArray(value); if (result == true) { var string = key; var splitstring = string.split("#"); for (var valueIndex in value) { console.log(value[valueIndex]); $("input[type='checkbox'][groupid='" + splitstring[0] + "'][value='" + value[valueIndex] + "']").attr('checked', true); //cb } }
score: 0
answers question: http://stackoverflow.com/q/29575501
type: Answer

http://stackoverflow.com/comment/47417323
has text: No reason to create an object, you could just return the function itself.
type: Comment
comment on: http://stackoverflow.com/a/29637157
type: AnswerComment
score: 0

http://stackoverflow.com/q/29637953
tagged with: checkbox
type: AnsweredQuestion
score: -1
type: Question
accepted answer: http://stackoverflow.com/a/29638320
tagged with: url
tagged with: javascript
has answer: http://stackoverflow.com/a/29638320
downvote count: 2
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I have a website with checkboxes in the html: &lt;input onclick="markAsChanged(this); toggleApproveDeny(this);" name="2c9923914b887d47014c9b30b1bb37a1_approveChk" type="checkbox"&gt; &lt;input onclick="markAsChanged(this); toggleApproveDeny(this);" name="2c9923914b887d47014c9b30b1bb37a1_denyChk" type="checkbox"&gt; &lt;input onclick="markAsChanged(this); toggleApproveDeny(this);" name="2c9923914b887d47014c9b8b4f0337df_approveChk" type="checkbox"&gt; &lt;input onclick="markAsChanged(this); toggleApproveDeny(this);" name="2c9923914b887d47014c9b8b4f0337df_denyChk" type="checkbox"&gt; I need a line/script that will 'check' all the boxes with '_approveChk' and leave the others unchecked. Is there a way to do this in url "javascript:alert();" style? or a way to call a javascript script stored locally through the url?
has comment: http://stackoverflow.com/comment/47418336
has comment: http://stackoverflow.com/comment/47419921
favorite count: 0
has title: Javascript - Manipulating certain checkpoints with differnet names from url

http://stackoverflow.com/comment/49985820
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29688457
type: AnswerComment
has text: That solution didn't work either. The thing is that when the TTL has a value, protractor waits for the angular-growl message to dissapear. Then, when the expectation is made, there is no such div.

http://stackoverflow.com/comment/47432684
score: 0
type: Comment
has text: `return Backbone.Model.sync.call(this, method, model, options);` Works fine without the `prototype` part too
type: AnswerComment
comment on: http://stackoverflow.com/a/29645105

http://stackoverflow.com/q/29675712
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29677055
type: AnsweredQuestion
score: 3
has body: I have a form with an HTML table that has a button (#addRows) that when clicked will clone the first table row and append it to the bottom of the table. This table resides in a section of HTML with some other input fields that can also be cloned and appended onto the bottom of my form. When I am cloning the section I am changing all child element ID's to include a number that can be iterated dependent on how many times the user clones the section. Example ... ... ... I am doing this with JQuery like this $(function() { var $section = $("#facility_section_info").clone(); var $cloneID = 1; $( ".addSection" ).click(function() { var $sectionClone = $section.clone(true).find("*[id]").andSelf().each(function() { $(this).attr("id", $(this).attr("id") + $cloneID); }); $('#facility_section_info').append($sectionClone); $cloneID++; }); }); When I clone the section that holds the table I am also cloning the #addRows button which when clicked should append a table row to the table it is being clicked on. However if I clone my section and I click on my second `#addRows button it will clone my table row but it is appending to my first table and not the second. Here is my addRows button and event handler $(function() { var $componentTB = $("#component_tb"), $firstTRCopy = $("#row0").clone(); $idVal = 1; $(document).on('click', '.addRows', function(){ var copy = $firstTRCopy.clone(true); var newId = 'row' +$idVal; copy.attr('id', newId); $idVal += 1; copy.children('td').last().append("Remove"); $componentTB.append(copy); }); }); My question is, when I clone my section of HTML that holds my table and #addButton how can I ensure that when the user clicks on the original button it will clone and append to that table or if I click the cloned button it will clone and append to the cloned table only? If anything is unclear please let me know so I can try to better explain what I am trying to do, thanks. Here is a JSFiddle demonstrating the problem I am having.
downvote count: 0
type: Question
has comment: http://stackoverflow.com/comment/47489775
has comment: http://stackoverflow.com/comment/47499452
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47499526
upvote count: 3
has comment: http://stackoverflow.com/comment/47489127
has title: Appending an element to a cloned element
answer count: 1
accepted answer: http://stackoverflow.com/a/29677055
favorite count: 0

http://stackoverflow.com/q/29598267
upvote count: 2
has body: I am using the zurb foundation and all is working well except for data-alert. I am unable to close data-alert with the X. In other posts, people say to add the $(document.foundation(); again after the data-alert div. I have tried it with and without the second initialization. Here is the code. &lt;!DOCTYPE HTML&gt; &lt;html class="no-js" lang="en"&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt; &lt;meta content="text/html; charset=utf-8" http-equiv="Content-Type"&gt; &lt;link rel="stylesheet" href="/css/foundation.min.css"&gt; &lt;script src="/js/vendor/jquery.js"&gt;&lt;/script&gt; &lt;script src="/js/foundation.min.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).foundation(); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div data-alert class="alert-box alert radius hide-for-print"&gt;You can't close this!!!&lt;a href="#" class="close"&gt;&amp;times;&lt;/a&gt;&lt;/div&gt; &lt;script&gt; $(document).foundation(); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; I would appreciate any help I can get on this.. Thanks.
type: Question
tagged with: javascript
has title: Foundation data-alert box won't close
tagged with: zurb-foundation
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/29598339
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
tagged with: css
score: 2

http://stackoverflow.com/q/29598493
has answer: http://stackoverflow.com/a/29599355
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47344212
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47455301
has comment: http://stackoverflow.com/comment/47343455
has title: Angular Model Change not Applying
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/29599266
tagged with: javascript
score: 0
has body: I have a div on which I have applied the textangular directive <div text-angular ng-model="htmlContent" ng-change="processChange()" Then I added the processChange function to the scope function demoController($scope) { $scope.htmlContent = ' شاہ مکھی کاتب ....'; $scope.processChange = function () { $scope.htmlContent = $scope.htmlContent.replace('b', 'ب'); $scope.apply(); }; }; Now, even though I'm calling apply(), the replacement does not bind back to the display, until I loose focus from the div. While I'm still typing, it does not apply. What must I do for the model change to immediately reflect back, as the user is still typing? I'm trying to allow conversion of characters from one language to another, without the user having the need to install its specific keyboard. Update: Plunker script http://plnkr.co/edit/HSPxDBoPjzNNeaKoKEtY?p=preview

http://stackoverflow.com/comment/47291507
type: Comment
comment on: http://stackoverflow.com/q/29571005
has text: I don't think you can do that with AJAX. What you can do, however, is redirect the client to the URL that gives them the desired PDF.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/47342926
type: QuestionComment
type: Comment
has text: *"Look at the picture below"* where is picture? and what you have tried post some code here?
score: 1
comment on: http://stackoverflow.com/q/29598231

http://stackoverflow.com/comment/47242536
score: 2
comment on: http://stackoverflow.com/q/29545531
type: Comment
type: QuestionComment
has text: The "octet stream" in your question is just an ordinary array of JavaScript numbers. Is that the actual situation, or do you really have some sort of binary buffer (somehow)?

http://stackoverflow.com/comment/47308785
comment on: http://stackoverflow.com/a/29580139
has text: What Changes I have to make if I declare my directive as comment i.e.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47394827
comment on: http://stackoverflow.com/a/29625670
score: 0
type: AnswerComment
type: Comment
has text: our site can be run from `http://host` or `http://host/folder` and it helps us manage that

http://stackoverflow.com/a/29568776
has body: As a professor once told me, much of writing code involves "being the computer". Consider your function's output for a moment and you should see the issue pretty quickly: &lt;img src=whatever/your/context/path/is/images/image1.gif width="25" height="25" onClick="mySampleTest(12345, this is a comment)"&gt; Your javascript is invalid: mySampleTest(12345, this is a comment) It should be: mySampleTest(12345, 'this is a comment') // &lt;--- notice the quotes Which would translate all the way back to: return "&lt;img src=\"&lt;%=request.getContextPath()%&gt;/images/image1.gif\" width=\"25\" height=\"25\" onClick=\"mySampleTest('"+ myId +"' , '"+comments+"')\"&gt;"; Not to mention your src attribute really needs quotes.
answers question: http://stackoverflow.com/q/29568439
score: 3
downvote count: 0
upvote count: 3
type: Answer

http://stackoverflow.com/q/29658660
answer count: 0
tagged with: d3.js
type: UnansweredQuestion
score: 0
has comment: http://stackoverflow.com/comment/47479317
has body: I am trying to plot a bubble chart(caChart in the code), but due to the function (function(p,v)) returning null; the bubbles are always black. Could you please give me a hint what is wrong with my function? I would be also grateful if you share with me how to implement clicking on each bubble so that I could be forwarded onto another page(different for each bubble)? here is my code: var numberFormat = d3.format(".2f"); var caChart = dc.bubbleOverlay("#ca-chart") .svg(d3.select("#ca-chart svg")); var incidentChart = dc.barChart("#incident-chart"); var homicideChart = dc.lineChart("#homicide-chart"); function isTotalCrimeRateRecord(v) { return v.type == "Total, all violations" &amp;&amp; v.sub_type == "Rate per 100,000 population"; } function isTotalCrimeIncidentRecord(v) { return v.type == "Total, all violations" &amp;&amp; v.sub_type == "Actual incidents"; } function isViolentCrimeRateRecord(v) { return v.type == "Total violent Criminal Code violations" &amp;&amp; v.sub_type == "Rate per 100,000 population"; } function isViolentCrimeIncidentRecord(v) { return v.type == "Total violent Criminal Code violations" &amp;&amp; v.sub_type == "Actual incidents"; } function isHomicideRateRecord(v) { return v.type == "Homicide" &amp;&amp; v.sub_type == "Rate per 100,000 population"; } function isHomicideIncidentRecord(v) { return v.type == "Homicide" &amp;&amp; v.sub_type == "Actual incidents"; } function isNumberOfCalls(v) { return v.type == "Homicide" &amp;&amp; v.sub_type == "Actual incidents"; } d3.csv("test445_9.csv", function(data) { var facts = crossfilter(data); var dtgFormat = d3.time.format("%d/%m/%y %H:%M").parse; data.forEach(function(d) { d.date = dtgFormat(d.date); d.totalCalls = d.NC; d.totalErrors = d.SR; }); var dateDim = facts.dimension(function(d) {return d.date;}); var minDate = dateDim.bottom(2)[0].date; var maxDate = dateDim.top(1)[0].date; var totalByYear = dateDim.group().reduceSum(function (d) { return d.totalCalls;}); var totalByYear_2 = dateDim.group…
type: Question
has comment: http://stackoverflow.com/comment/47457484
tagged with: javascript
has title: Can't colour bubble chart with D3.js

http://stackoverflow.com/q/29564113
has body: I have several SELECT tags with some options. Selected options must be unique in all lists, while unselected options are shared and should be available for each select. Then, when some option is selected in one SELECT, it should be removed from other lists. When some option is unselected, then it should be available again in all lists. My problem is that I can't find which option is just (un)selected. I tried onChange event on SELECT but can't find which option is selected last. Also, I tried various events on OPTION tag but event is not triggered. Of course, if I use value of SELECT in JavaScript then I just get all values separated by comma and I can't know from that which value is just added or removed. Is it possible to use some event on OPTION tag, to get value of currently selected or unselected item? Thanks!
favorite count: 0
has title: HTML Select Multiple - Find which option is selected
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47277927
downvote count: 4
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/47277921
score: -4
possible better answer: http://stackoverflow.com/a/29564541
has comment: http://stackoverflow.com/comment/47279007
type: Question
has answer: http://stackoverflow.com/a/29564677
accepted answer: http://stackoverflow.com/a/29564677
has answer: http://stackoverflow.com/a/29565867
answer count: 3
has answer: http://stackoverflow.com/a/29564541
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/29560711
has body: I have a MVC Application where I'm using a lot of function on javascript and I have a separate file (that's why I cant use URL helpers) for those javascript call msa.js and it is in the folder Scripts I referenced on my mvc View like this: &lt;script type="text/javascript" src="~/Scripts/msa.js"&gt;&lt;/script&gt; The reference work fine, but the problem is in the javascript file: I have a lot of calls to server methods using ajax that's why I have to use the property "url" many times on the ajax call. The problem is that on my local computer it's work fine and the url is structure like this: http://localhost:59655/WorkPanel/GetListOfPermissons And it is correct!! But when I want to upload the application for the server I have to use a Virtual Directory that's why the url change for: http://10.10.25.161/MSA/WorkPanel/ When I Execute the application on the server mvc try to put the url like this: http://10.10.25.161/WorkPanel/GetListOfPermissons And there is the problem don't execute the function because the directory MSA is missing from the url: this is an example of my code javascript: $.ajax({ type: "POST", url: '/WorkPanel/GetListOfPermissons', data: {}, contentType: "application/json; charset=utf-8", dataType: "json", Any body had faced this problem?? How did you solved this. Thank you in advanced... Jose
linked to: http://stackoverflow.com/q/2116788
type: UnansweredQuestion
score: 2
has answer: http://stackoverflow.com/a/29560901
has answer: http://stackoverflow.com/a/29561125
downvote count: 0
has title: MVC Routing Issue with Javascript function
tagged with: asp.net-mvc-routing
type: Question
tagged with: asp.net-mvc
tagged with: javascript
has answer: http://stackoverflow.com/a/29561216
upvote count: 2
answer count: 3
favorite count: 0

http://stackoverflow.com/q/29560542
favorite count: 0
type: AnsweredQuestion
has title: why do minus(negative) values work with index?
has body: I am new to jquery and basically , i decided to put Jquery to some practical use and so i build the following script : $(function () { $(document).on('keydown', checkey); var index = 0, $items = $('ul li a'); function checkey(e) { // console.log($items); if (e.which == 38) { // key up index -= 1; }; if (e.which == 40) { //key down index += 1; } console.log(index); $items.eq(index).trigger('focus'); } }); useing this script you can navigate your menu useing the up and down arrow keys . the fiddle is here. now i have one question about the code that i have used , in particular the below line of code: $items.eq(index).trigger('focus'); now, the index variable is incremented and decremented in my script, but when i keep pressing keyup, and the index keep decrementing and goes below 0 I.E. -1 , -2 , -3 , -4 ... etc , $items.eq(index).trigger('focus');, this line still works , i was't expecting it to work with negative values , i was expecting it only to work from 0-4 . so how and why do negative values work with the below statement : eg. $items.eq(-2).trigger('focus'); ?? NOTE : in the fiddle please check the console and experiment with arrow up and arrow down, to understand what i am talking about .
type: Question
has comment: http://stackoverflow.com/comment/47271001
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29560605
score: -1
downvote count: 2
upvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/29560605
tagged with: jquery

http://stackoverflow.com/comment/47279716
comment on: http://stackoverflow.com/q/29558435
score: 0
type: Comment
has text: Convert to JSON string and then save to localStorage. In contacts.html, retrieve from localStorage: http://www.w3schools.com/html/html5_webstorage.asp
type: QuestionComment

http://stackoverflow.com/a/69915122
has body: I was facing this same issue with http-proxy-middleware. After reading @ChrisMckenzie's answer, I decided to simply move the body parser middleware to after the proxy middleware. so instead of this: router.use(bodyParser.json()); router.get('/', function(){...}); router.use(httpProxy()); I did this: router.use(httpProxy()); router.use(bodyParser.json()); router.get('/', function(){...});
score: 5
upvote count: 5
downvote count: 0
has comment: http://stackoverflow.com/comment/137047171
type: Answer
answers question: http://stackoverflow.com/q/29631945
has comment: http://stackoverflow.com/comment/138009423

http://stackoverflow.com/a/29598550
upvote count: 39
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/47344252
downvote count: 1
accepted answer of: http://stackoverflow.com/q/29598540
answers question: http://stackoverflow.com/q/29598540
score: 38
has body: You can use lastIndexOf and substring: var uri= $('#item').css('background-image'); var lastslashindex = uri.lastIndexOf('/'); var result= uri.substring(lastslashindex + 1).replace(".png",""); or using .split() and .pop() var uri= $('#item').css('background-image'); var result=uri.split("/").pop().replace(".png","");

http://stackoverflow.com/a/29636671
has comment: http://stackoverflow.com/comment/47418437
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47418820
has body: code in Chrome for opening new active tab with history internal page chrome.tabs.create({'url': 'chrome://history', 'active': true});
upvote count: 2
answers question: http://stackoverflow.com/q/29636347

http://stackoverflow.com/a/29548900
accepted answer of: http://stackoverflow.com/q/29548839
has body: NaN is Not a Number, there is no evaluated numberic value to compare - Use IsNaN() To compare NaN values. W3 Schools link
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/29548839
score: 1

http://stackoverflow.com/comment/47293445
type: Comment
comment on: http://stackoverflow.com/q/29571975
score: 0
has text: @charlietfl -- Yes, but Owl needs those links to already exist somewhere, or at least be created to be clicked, as far as I know. In fact, I took the callbacks example from their documentation. You can see that example in the fiddle I posted. Are you saying there is another way to get the same behaviour without using callbacks and URLhashListeners?
type: QuestionComment

http://stackoverflow.com/comment/47367561
score: 0
type: Comment
type: QuestionComment
has text: I'm already using this. As you can see in the code.
comment on: http://stackoverflow.com/q/29610970

angularjs
tags question: http://stackoverflow.com/q/29624217
tags question: http://stackoverflow.com/q/29624647
tags question: http://stackoverflow.com/q/29588728
tags question: http://stackoverflow.com/q/29553031
tags question: http://stackoverflow.com/q/29579430
tags question: http://stackoverflow.com/q/29553927
tags question: http://stackoverflow.com/q/29582894
tags question: http://stackoverflow.com/q/29610253
tags question: http://stackoverflow.com/q/29562710
tags question: http://stackoverflow.com/q/29670864
tags question: http://stackoverflow.com/q/29571890
tags question: http://stackoverflow.com/q/29573066
tags question: http://stackoverflow.com/q/29598493
tags question: http://stackoverflow.com/q/29631141
tags question: http://stackoverflow.com/q/29549790
tags question: http://stackoverflow.com/q/29657490
tags question: http://stackoverflow.com/q/29573212
tags question: http://stackoverflow.com/q/29620595
tags question: http://stackoverflow.com/q/29609748
tags question: http://stackoverflow.com/q/29647748
tags question: http://stackoverflow.com/q/29569123
tags question: http://stackoverflow.com/q/29537805
tags question: http://stackoverflow.com/q/29672196
tags question: http://stackoverflow.com/q/29569916
tags question: http://stackoverflow.com/q/29532349
tags question: http://stackoverflow.com/q/29624870
tags question: http://stackoverflow.com/q/29609032
tags question: http://stackoverflow.com/q/29644532
tags question: http://stackoverflow.com/q/29638225
tags question: http://stackoverflow.com/q/29679772
tags question: http://stackoverflow.com/q/29655418
tags question: http://stackoverflow.com/q/29604923
tags question: http://stackoverflow.com/q/29584324
tags question: http://stackoverflow.com/q/29570201
tags question: http://stackoverflow.com/q/29568316
tags question: http://stackoverflow.com/q/29625289
tags question: http://stackoverflow.com/q/29585693
tags question: http://stackoverflow.com/q/29572447
tags question: http://stackoverflow.com/q/29617688
tags question: http://stackoverflow.com/q/29570247
tags question: http://stackoverflow.com/q/29585313
tags question: http://stackoverflow.com/q/29667674
tags question: http://stackoverflow.com/q/29672130
tags question: http://stackoverflow.com/q/29603804
tags question: http://stackoverflow.com/q/29636572
tags question: http://stackoverflow.com/q/29587038
tags question: http://stackoverflow.com/q/29610155
tags question: http://stackoverflow.com/q/29644310
tags question: http://stackoverflow.com/q/29547332
tags question: http://stackoverflow.com/q/29619775
tags question: http://stackoverflow.com/q/29610966
tags question: http://stackoverflow.com/q/29642197
tags question: http://stackoverflow.com/q/29670266
tags question: http://stackoverflow.com/q/29579839
tags question: http://stackoverflow.com/q/29660098
tags question: http://stackoverflow.com/q/29687881
tags question: http://stackoverflow.com/q/29612842
tags question: http://stackoverflow.com/q/29566432
tags question: http://stackoverflow.com/q/29564379
tags question: http://stackoverflow.com/q/29679944
tags question: http://stackoverflow.com/q/29638264
tags question: http://stackoverflow.com/q/29649824
tags question: http://stackoverflow.com/q/29531298
tags question: http://stackoverflow.com/q/29658086
tags question: http://stackoverflow.com/q/29606375
tags question: http://stackoverflow.com/q/29633725
tags question: http://stackoverflow.com/q/29681435
tags question: http://stackoverflow.com/q/29591051
tags question: http://stackoverflow.com/q/29608723
tags question: http://stackoverflow.com/q/29544102
tags question: http://stackoverflow.com/q/29634967
tags question: http://stackoverflow.com/q/29623022
type: Tag
tags question: http://stackoverflow.com/q/29684416
tags question: http://stackoverflow.com/q/29560947
tags question: http://stackoverflow.com/q/29681909
tags question: http://stackoverflow.com/q/29625798
tags question: http://stackoverflow.com/q/29587888
tags question: http://stackoverflow.com/q/29631887
tags question: http://stackoverflow.com/q/29576517

http://stackoverflow.com/q/29559529
upvote count: 1
has title: Javascript currency validation doesn't work if clamp button
downvote count: 1
has comment: http://stackoverflow.com/comment/47269150
has comment: http://stackoverflow.com/comment/47269087
type: Question
has answer: http://stackoverflow.com/a/29559732
tagged with: javascript
has answer: http://stackoverflow.com/a/29559618
has comment: http://stackoverflow.com/comment/47269191
has answer: http://stackoverflow.com/a/29559757
has comment: http://stackoverflow.com/comment/47269003
tagged with: currency-formatting
has comment: http://stackoverflow.com/comment/47269413
score: 0
possible better answer: http://stackoverflow.com/a/29559652
tagged with: validation
has answer: http://stackoverflow.com/a/29559652
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/29559732
has body: I want to validate my input according following requirements: value can be from 1.00 to 9999.99 value fractional part cannot have more than 2 digits I have wrote following code: html: &lt;input id="amount" maxlength="7" type="text" /&gt; js: $("#amount").on("keyup", function(){ var valid = /^[1-9]{1}\d{0,3}(\,\d{0,2})?$/.test(this.value), val = this.value; if(!valid){ console.log("Invalid input!"); this.value = val.substring(0, val.length - 1); } }); But if I clamps '0' it works bad. Please help to fix. JSFIDDLE P.S. If I press '0' for 3-4 seconds I see expected result - all input input be clear
answer count: 4
has comment: http://stackoverflow.com/comment/47269174
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47269231

http://stackoverflow.com/comment/47300710
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29575381
has text: Also, it's a little unclear how the `ctrl.data` relates to the data in the `ng-repeat`s in the html. Where is `ctrl.data` used in the html exactly? This might help figure out any scope/structure issues
score: 0

http://stackoverflow.com/comment/117311288
has text: @cobote's comment above doesn't require jquery!
comment on: http://stackoverflow.com/a/29647801
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47480209
type: Comment
score: 1
type: QuestionComment
has text: it should be like this : .controller('MessagesController', ['$scope', '$http', '$log', '$rootScope','PubNub' , function($scope, $http, $log, $rootScope, PubNub) { .
comment on: http://stackoverflow.com/q/29667674

http://stackoverflow.com/comment/47320474
type: QuestionComment
has text: @dandavis Thanks! That was the direction I was looking to be pointed in. Do you have any examples of how to do this in node without using libraries that abstract away the task?
comment on: http://stackoverflow.com/q/29586092
score: 0
type: Comment

http://stackoverflow.com/comment/47268341
type: QuestionComment
score: 3
comment on: http://stackoverflow.com/q/29549845
has text: @JoshHarington If you want to use it as Captcha, doing it with CSS will reveal the passcode?
type: Comment

http://stackoverflow.com/q/29555599
has comment: http://stackoverflow.com/comment/47262168
has title: Javascript uncaught syntaxerror unexpected identifier error
has body: Basically, the method prints a list with values and when I click on a value, I get this error : Uncaught SyntaxError: Unexpected identifier on line 6. As a result,I am unable to pass the value that I click on,onto the liveSearch method. I have tried searching the net in hopes of solving the error but to no avail,I couldn't find a solution. Please advise. function printSuggestResult(arrOfSuggestText,getRows){ var htmlStr = " Found &nbsp "; for(var i=0; i<arrOfSuggestText.length; i++){ htmlStr += " "; if(arrOfSuggestText[i] != "null"){ htmlStr += ' '+arrOfSuggestText[i]+''; } htmlStr += " "; } htmlStr += " "; document.getElementById('searchResultList').innerHTML = htmlStr; $('#resultCount').text(getRows); } function liveSearch(getText){ var arrOfText = new Array(); var arrOfLat = new Array(); var arrOfLon = new Array(); getText = getText.replace(" ","+"); var testy = encodeURIComponent(getText); }
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47261871
downvote count: 4
favorite count: 0
has comment: http://stackoverflow.com/comment/47262067
upvote count: 0
has answer: http://stackoverflow.com/a/29555805
accepted answer: http://stackoverflow.com/a/29555805
tagged with: innerhtml
has comment: http://stackoverflow.com/comment/47262268
score: -4
tagged with: css
has comment: http://stackoverflow.com/comment/47262060
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47262172
type: Question
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/47393660
type: Comment
type: QuestionComment
has text: Maybe they don't have to, you explicitly invoke the callback parameter `callback()`
score: 0
comment on: http://stackoverflow.com/q/29625167

http://stackoverflow.com/comment/47268903
score: 3
comment on: http://stackoverflow.com/q/29559482
type: Comment
type: QuestionComment
has text: AJAX or an iframe is the best options here, AJAX being the preferable. Why do you not want to use it?

http://stackoverflow.com/q/29671314
upvote count: 2
has comment: http://stackoverflow.com/comment/47483549
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47480600
has comment: http://stackoverflow.com/comment/47485130
has comment: http://stackoverflow.com/comment/47480590
score: 2
has comment: http://stackoverflow.com/comment/47480588
has body: I am assigning the filter function in a variable. Is it the right way of assignation? It’s accounting “Uncaught SyntaxError: Unexpected identifier”. var relevantState = $(cityMap).filter(function () { return this.state == selectedState; }); Here is the complete code: http://jsfiddle.net/rvurn2n7/
answer count: 0
downvote count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47482010
type: Question
has title: Assigning function to variable in jquery
tagged with: javascript
has comment: http://stackoverflow.com/comment/47544372
has comment: http://stackoverflow.com/comment/47481401

http://stackoverflow.com/q/29676060
answer count: 2
has body: I'm trying to print the content of a div when the "Print" button is clicked. I keep getting this error: "Unable to set value of the property 'innerHTML': object is null or undefined." I read some posts over the Internet but I still can't find a working solution. Here is my javascript code I use to print (got from here): &lt;script type="text/javascript"&gt; function printDiv(divName) { var printContents = document.getElementById(divName).innerHTML; var originalContents = document.body.innerHTML; document.body.innerHTML = printContents; window.print(); document.body.innerHTML = originalContents; } &lt;/script&gt; My button event raises here: &lt;asp:Button ID="ButtonPrint" runat="server" Text="Print »" OnClientClick="printDiv('content');return false"&gt;&lt;/asp:Button&gt; And this is the div I'm supposed to print: &lt;div id="content" runat="server"&gt; &lt;h1 class="title" runat="server" id="formulario"&gt;&lt;/h1&gt; &lt;asp:Table ID="TableForm" runat="server"&gt;&lt;/asp:Table&gt; &lt;div id="TableQuest" runat="server"&gt; &lt;/div&gt; &lt;asp:Table ID="TableText" runat="server"&gt;&lt;/asp:Table&gt; &lt;asp:Label ID="LabelInfo" runat="server" Text=""&gt;&lt;/asp:Label&gt; &lt;/div&gt; Any help would be greatly appreciated!
accepted answer: http://stackoverflow.com/a/29676822
has comment: http://stackoverflow.com/comment/47490494
has comment: http://stackoverflow.com/comment/47489803
linked to: http://stackoverflow.com/q/468881
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47490618
has title: Unable to print div's content using Javascript
possible better answer: http://stackoverflow.com/a/29676249
has answer: http://stackoverflow.com/a/29676822
has answer: http://stackoverflow.com/a/29676249
type: Question
has comment: http://stackoverflow.com/comment/47490105
tagged with: javascript
has comment: http://stackoverflow.com/comment/47490738
has comment: http://stackoverflow.com/comment/47489958
has comment: http://stackoverflow.com/comment/47490448
score: 0

http://stackoverflow.com/comment/47245081
type: Comment
comment on: http://stackoverflow.com/a/29546271
has text: This explains the basics of what i'm saying: https://jsfiddle.net/L6kmcbnL/ . The issue here has nothing to do with angular, really, just how javascript works. `.directive` expects an argument of a function that returns a configuration object for a directive. The original question's function returns `undefined` rather than the config object.
score: 0
type: AnswerComment

http://stackoverflow.com/q/29599101
has answer: http://stackoverflow.com/a/44194605
possible better answer: http://stackoverflow.com/a/55298965
has answer: http://stackoverflow.com/a/29601022
score: 4
has comment: http://stackoverflow.com/comment/47345066
has answer: http://stackoverflow.com/a/55298965
upvote count: 4
has body: I have several data listed on the jquery dataTable and its done pagination by the DataTable plugins default. I want to get the current page of the dataTable while processing the data and set that page into active after the action is processed and reload the data.
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47345019
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/40973693
has comment: http://stackoverflow.com/comment/47344857
answer count: 5
accepted answer: http://stackoverflow.com/a/29601022
type: AnsweredQuestion
has title: How to stay on the active page in jquery DataTable
has comment: http://stackoverflow.com/comment/47345172
tagged with: datatables
has answer: http://stackoverflow.com/a/29600044
type: Question

http://stackoverflow.com/comment/47320786
has text: By the way. what if a creates a test? How can I add it in the tests variable?
comment on: http://stackoverflow.com/a/29586098
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/29624027
tagged with: php
answer count: 4
has answer: http://stackoverflow.com/a/29624115
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29624959
tagged with: http://stackoverflow.com/tag/json
has body: I have written some PHP code which generates 2 JSON responses. I need to create a another one (in PHP or JavaScript) The first one is: { "date": [ 1428912000, 1428915600, 1428919200, 1428922800 ] } The second one is: { "values": [ 4.932, 4.934, 4.935, 4.937 ] } The result in need is this: { "new": [ [ 1428912000, 4.932 ], [ 1428915600, 4.934 ], [ 1428919200, 4.935 ], [ 1428922800, 4.937 ] ] } How can I achieve this result?
downvote count: 3
has title: JSON : Create 1 array from 2 json strings
possible better answer: http://stackoverflow.com/a/29624106
type: Question
has answer: http://stackoverflow.com/a/29624106
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29624115
score: -3
has answer: http://stackoverflow.com/a/29624313
upvote count: 0
tagged with: arrays
favorite count: 0

http://stackoverflow.com/comment/47445869
type: QuestionComment
comment on: http://stackoverflow.com/q/29653024
has text: are you using jquery?
score: 0
type: Comment

http://stackoverflow.com/q/29594366
tagged with: null-coalescing
has title: Operating on undefined variable - null coalescing
has comment: http://stackoverflow.com/comment/47335726
type: AnsweredQuestion
tagged with: undefined
has comment: http://stackoverflow.com/comment/47335735
has comment: http://stackoverflow.com/comment/47335640
type: Question
has body: function add(num) { var sum; for (var i = 1; i &lt; num + 1; i++){ sum = (sum || 0) + i; }; return sum; } add(9); What is a keyword to describe the behavior for defining sum when it gets added to "i" in the for loop? Is this a ternary operation? Obviously the first time it loops through it is undefined, so javascript chooses 0. Why is that?
has answer: http://stackoverflow.com/a/29594409
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/29594409
tagged with: javascript

http://stackoverflow.com/comment/47239586
type: AnswerComment
type: Comment
has text: I'll give that a shot and see what happens. Also, I've heard about $digest, and had logging in my filter which showed that it executed 4 or 5 times. Can you describe digest more or give a link to documentation about it?
comment on: http://stackoverflow.com/a/29542047
score: 0

http://stackoverflow.com/q/29566020
upvote count: 1
downvote count: 1
has title: Adding 'X' button with working javascript next to the text field
has answer: http://stackoverflow.com/a/29566317
type: Question
has body: i'm not familiar (at all) with JavaScript and i googled and found an awesome demo tutorial for adding text-fields with js. This is the link. I got it working but it lacks one feature - removing text field. I also downloaded awesome icon set to put it next to the button, but could anyone describe how to remove text field by pressing the button? This is the default javascript from page (i modified the entry part a bit to fit my needs) var counter = 1; var limit = 65; function addInput(divName){ if (counter == limit) { alert("You have reached the limit of adding " + counter + " inputs"); } else { var newdiv = document.createElement('div'); newdiv.innerHTML = "Nimi " + (counter + 1) + " &lt;input type='text' name='myInputs[]' class='field'&gt;"; document.getElementById(divName).appendChild(newdiv); counter++; } } and this is the html part &lt;form method="POST"&gt; &lt;script src=form.js&gt;&lt;/script&gt; &lt;div id="dynamicInput"&gt; Nimi 1&lt;input type="text" name="myInputs[]" class="field"&gt; &lt;/div&gt; &lt;input type="button" value="Add another text input" onClick="addInput('dynamicInput');"&gt; &lt;/form&gt; It's easy to add button next to it but could someone make a quick js code to remove the text field with clicking on the button next to it??
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29566328
tagged with: javascript
score: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/29566256
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29566256
accepted answer: http://stackoverflow.com/a/29566328
favorite count: 0

http://stackoverflow.com/a/29628974
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29628452
type: Answer
answers question: http://stackoverflow.com/q/29628452
has body: A value of null seems to work. You can change your tooltip to not display if the value is null too: http://jsfiddle.net/SheldonNeilson/95um4x0q/1/ $(function () { $('#container').highcharts({ chart: { type: 'heatmap', marginTop: 40, marginBottom: 80 }, title: { text: 'Sales per employee per weekday' }, xAxis: { categories: ['Alexander', 'Marie', 'Maximilian', 'Sophia', 'Lukas', 'Maria', 'Leon', 'Anna', 'Tim', 'Laura'] }, yAxis: { categories: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'], title: null }, colorAxis: { min: 0, minColor: Highcharts.getOptions().colors[0], maxColor: '#FFFFFF' }, legend: { align: 'right', layout: 'vertical', margin: 0, verticalAlign: 'top', y: 25, symbolHeight: 280 }, tooltip: { formatter: function () { if(this.point.value == null){ return 'No data' ; }else{ return '' + this.series.xAxis.categories[this.point.x] + ' sold ' + this.point.value + ' items on ' + this.series.yAxis.categories[this.point.y] + ''; } } }, series: [{ name: 'Sales per employee', borderWidth: 1, data: [[0, 0, null], [0, 1, 19], [0, 2, 8], [0, 3, 24], [0, 4, 67], [1, 0, 92], [1, 1, 58], [1, 2, 78], [1, 3, 117], [1, 4, 48], [2, 0, 35], [2, 1, 15], [2, 2, 123], [2, 3, 64], [2, 4, 52], [3, 0, 72], [3, 1, 132], [3, 2, 114], [3, 3, 19], [3, 4, 16], [4, 0, 38], [4, 1, 5], [4, 2, 8], [4, 3, 117], [4, 4, 115], [5, 0, 88], [5, 1, 32], [5, 2, 12], [5, 3, 6], [5, 4, 120], [6, 0, 13], [6, 1, 44], [6, 2, 88], [6, 3, 98], [6, 4, 96], [7, 0, 31], [7, 1, 1], [7, 2, 82], [7, 3, 32], [7, 4, 30], [8, 0, 85], [8, 1, 97], [8, 2, 123], [8, 3, 64], [8, 4, 84], [9, 0, 47], [9, 1, 114], [9, 2, 31], [9, 3, 48], [9, 4, 91]], dataLabels: { enabled: true, color: '#000000' } }] }); });
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/a/29557898
type: Answer
score: -1
downvote count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/47266715
has body: Try specifying a colour for the :disabled pseudo class of the select element: select:disabled{color:#000;}
answers question: http://stackoverflow.com/q/29557821

http://stackoverflow.com/a/29651138
answers question: http://stackoverflow.com/q/29650907
score: 1
upvote count: 1
type: Answer
downvote count: 0
has body: Note the s in getElementsByClassName. It means you need to loop over these. You can use either the code var className= document.getElementsByClassName("gv-field-4-custom"); for(i=0;i&lt;className.length;i++) { className[i].innerHTML = "text"; } like @saina suggested, or use document.getElementsByClassName('gv-field-4-custom')[0] like @Imran suggested.

http://stackoverflow.com/q/29663376
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47466428
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29664123
has comment: http://stackoverflow.com/comment/47468187
has title: Why does nesting my divs break document.getElementById()?
type: Question
tagged with: javascript
has body: I'm having an issue while designing a music player. My music player works with the following code: playlist_index = 0; // Set object references playbtn = document.getElementById("playpausebtn"); seekslider = document.getElementById("seekslider"); volumeslider = document.getElementById("volumeslider"); curtimetext = document.getElementById("curtimetext"); durtimetext = document.getElementById("durtimetext"); playlist_status = document.getElementById("playlist_status"); playerImg = document.getElementById("playerImg"); // Audio Object audio = new Audio(); audio.src = dir+playlist[0].song_url; audio.loop = false; playlist_status.innerHTML = playlist[playlist_index].song_name + '-' + playlist[playlist_index].band_name; // Add Event Handling playbtn.addEventListener("click",playPause); mutebtn.addEventListener("click", mute); seekslider.addEventListener("mousedown", function(event){ seeking=true; seek(event); }); seekslider.addEventListener("mousemove", function(event){ seek(event); }); seekslider.addEventListener("mouseup",function(){ seeking=false; }); volumeslider.addEventListener("mousemove", setvolume); audio.addEventListener("timeupdate", function(){ seektimeupdate(); }); audio.addEventListener("ended", function(){ switchTrack(); }); audio.addEventListener("play", function(){ playbtn.style.background = "url(http://localhost/wordpress/wp-content/themes/virtue-child/pause.png) no-repeat"; }); // Functions function switchTrack(){ if(playlist_index == (playlist.length - 1)){ playlist_index = 0; } else { playlist_index++; } playlist_status.innerHTML = playlist[playlist_index].song_name + '-' + playlist[playlist_index].band_name; audio.src = dir+playlist[playlist_index].song_url; setTimeout(audio.play(), 2000); } (plus some more functions for updating seek bars and times) and the following HTML: 00:00 00:00 But when I start housing elements in container divs, the above code fails to update the time and the seek slider doesn't work. The housed and styled audio player HTML…

http://stackoverflow.com/comment/47341542
type: Comment
comment on: http://stackoverflow.com/a/29597431
type: AnswerComment
has text: OMG it was that simple... Thought i was losing my mind... damn IDs... Thank you!
score: 0

http://stackoverflow.com/q/29670384
possible better answer: http://stackoverflow.com/a/29680086
tagged with: openlayers-3
has answer: http://stackoverflow.com/a/29680086
accepted answer: http://stackoverflow.com/a/30557809
has body: I use ol3 as a map service. I have made a linestring with two points with coordinates : [[0,0],[0,1000]] and calculated the distance using the vincenty formula. This resulted in 1000 meter, what is accurate. But when i made another linestring for example [[4052627,3971934],[4052627,3972934]] vincenty distance was around 850 meters. I dont know what i forgot here. Any way to correct that? I want to calculate epgs:3857 meters (units) for a given real distance.
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
favorite count: 0
type: Question
has title: ol3 - calculate real meters in epgs 3857
score: 3
has answer: http://stackoverflow.com/a/30557809
upvote count: 3
answer count: 3
has answer: http://stackoverflow.com/a/29672432

http://stackoverflow.com/comment/47344651
comment on: http://stackoverflow.com/a/29598990
type: Comment
has text: Thanks for your answer. Maybe my question I did not explain well. What I mean is, How do I reset the dropdownlist of faculty and course (without reset button) to the default(empty) whenever the branch changed (either PK or ZZ)? ;D
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47223105
score: 0
has text: place above mentioned reference tag in a file named as `_references.js`
comment on: http://stackoverflow.com/q/29532703
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47234507
type: Comment
type: QuestionComment
has text: `I've tried some preloading scripts ` ..please show what you tried. We can't help otherwise
score: 1
comment on: http://stackoverflow.com/q/29540986

http://stackoverflow.com/q/29559143
has body: I'm new to Knockout.js tech where I Googled many site to resolve my situation where I couldn't find a better option. How to validate a date using Knockout.js? Where in my case if the user typed the date in a wrong format say for e.g if the valid date format is dd-M-yyyy but the user is typing M-dd-yyyy it should automatically convert it to a valid date format. My sample code is this, self.dateOfBirth = ko.observable(0).extend({ required: { message: 'Date of Birth is required', params: true }, date: { format: 'dd-M-YYYY' , message: 'Not a valid date format',params:true } My HTML design is this, &lt;input class="form-control" id="dateOfBirth" autocomplete="off" placeholder="Date of Birth" type="text" data-bind="value: dateOfBirth, format:'dd-M-YYYY', valueUpdate: 'afterkeydown'"&gt;
has comment: http://stackoverflow.com/comment/47269107
has comment: http://stackoverflow.com/comment/47269658
tagged with: knockout.js
type: Question
tagged with: asp.net-mvc
tagged with: javascript
has comment: http://stackoverflow.com/comment/47269422
score: 0
answer count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47268956
tagged with: http://stackoverflow.com/tag/html
has title: Knockout.js validation
has comment: http://stackoverflow.com/comment/47269886
has comment: http://stackoverflow.com/comment/47268623
has answer: http://stackoverflow.com/a/53288824
has answer: http://stackoverflow.com/a/29560249

http://stackoverflow.com/comment/47236875
comment on: http://stackoverflow.com/q/29542566
has text: Have you checked the console to see what the *exact* response is?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47214750
score: 0
type: Comment
type: QuestionComment
has text: @madalinivascu You are adding click listener to every DOM element which will have performance impact.
comment on: http://stackoverflow.com/q/29530521

http://stackoverflow.com/q/29624049
answer count: 1
tagged with: charts
tagged with: chart.js
tagged with: javascript
type: UnansweredQuestion
has title: Emphasize a point in Chart.js
tagged with: canvas
downvote count: 0
score: 1
has body: Is there a way to put the points on emphasis on the charts in chart.js? Like they would get bigger or be visible when hovered over ? I am trying to build a fixed tooltip that you would constantly capture the points hovered and when clicking on the canvas it would capture the point clicked on, or the closest, and emphasize it and fixing the value of the tooltip. When clicking again the the tooltip should resume capturing the points hovered and the emphasis should disappear. I try to find out a way to do this but couldn't reach anything conclusive. Using getPointsAtEvent gets me the points over but then to change the properties and have this updated on the canvas does not seem to bear fruits. I try updating or redrawing the canvas but that did not changed the canvas in any way. Any help is most welcome. EDIT I have manage to do something. Through the custom tooltip I have created a fixed tooltip (as asked per the requirements). Then I use an click event on the div of the canvas that will use the getPointsAtEvent. There are a few issues with this, first it returns many values instead of one, making it not precise (a way to increase precision would be nice). For the emphasis, I am supposed to create a canvas on top, but this canvas is deleted by my subsequent call to showtooltip. Again any help is most welcome.
favorite count: 0
type: Question
upvote count: 1
has answer: http://stackoverflow.com/a/29633172

http://stackoverflow.com/q/29591336
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47330693
type: Question
tagged with: c#
has body: I'm working on an plugin-based MVC application and I want to use angularjs as route provider. (I'm newbie in angular.) I have specified the necessary information in my app.js and it's working properly for those views, which are in the same project (i.e. /home): var app = angular.module('app', ['ngRoute']); app.config(function ($routeProvider) { $routeProvider .when('/home', { templateUrl: 'Home/Index', controller: 'mainController' }) .when('/about', { templateUrl: 'Plugin.App/Home/About', controller: 'aboutController' }) .otherwise({ redirectTo: 'Home/SomeLocation' }); }); app.controller('mainController', mainController); app.controller('aboutController', aboutController); But, when I tried to locate any partial view from my plugin, I got 404. Do you have any suggestion to solve this situation? Thanks for any help in advance! Craig85
tagged with: asp.net-mvc
has title: How to use angularjs routeProvider with MVC plugins
has comment: http://stackoverflow.com/comment/47330107
has comment: http://stackoverflow.com/comment/47331837
score: 0
has comment: http://stackoverflow.com/comment/47331001
has comment: http://stackoverflow.com/comment/47330651
tagged with: javascript
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47330019
has comment: http://stackoverflow.com/comment/47329756
has comment: http://stackoverflow.com/comment/47330305
has comment: http://stackoverflow.com/comment/47330040
answer count: 0
has comment: http://stackoverflow.com/comment/47336169

http://stackoverflow.com/comment/47356710
type: Comment
comment on: http://stackoverflow.com/q/29605540
score: 0
type: QuestionComment
has text: your `window.alert('result');` will not display the exact result, as your calling that in single quote.

http://stackoverflow.com/comment/47365540
comment on: http://stackoverflow.com/a/29609548
has text: For some reason when I try this in my code I keep getting an empty list.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47383810
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29619721
has text: What if you try with ``` app.use(express.static('./public', { 'index': ['index.html'] })); ```
score: 0

http://stackoverflow.com/q/29589698
has title: How do i animate images in a cyclic manner?`
has body: .move { background-image: url("http://placehold.it/100x100"),url("http://www.billboard.com/files/charts/weekly/793-stack.svg"); width: 100%; height: 300px; background-repeat: no-repeat; background-size: 100vw 100vh; animation-name: move; animation-delay: 2s; animation-duration: 5s; animation-timing-function:linear; animation-iteration-count: infinite; background-position: 0 0, -100vw 0; } @keyframes move { 0%,40%{background-position: 0 0, -100vw 0} 50%,90%{background-position: 100vw 0, 0 0} 100%{background-position:0 0,100vw 0}/*pblm is here*/ } &lt;div class="move"&gt; &lt;/div&gt; I am just trying to move images as you have seen in most of the best designed web pages. The problem is: once the iteration over, i am not able to loop it from the initial stage. I want it to flow from left to right, once all the images has finished an iteration, it must start from the beginning. 1) Can i achieve this with only html and css3? like keyframes. 2) If not, how do i achieve it with jquery without any external plugins
accepted answer: http://stackoverflow.com/a/29590757
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/29590757
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery

http://stackoverflow.com/q/29622942
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/47389602
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29623230
has comment: http://stackoverflow.com/comment/47389722
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29623322
accepted answer: http://stackoverflow.com/a/29623322
has answer: http://stackoverflow.com/a/29623335
answer count: 3
tagged with: css-selectors
has comment: http://stackoverflow.com/comment/47389664
has comment: http://stackoverflow.com/comment/47389693
favorite count: 0
has title: Add CSS class to dynamic ul li a tag using javascript
possible better answer: http://stackoverflow.com/a/29623230
has comment: http://stackoverflow.com/comment/47389804
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I have a list of ul li in div on which I want to add CSS classes based on click on a tag. Here is my html of ul li: Here are the functions that are calling on these a tags: function change_program(){ document.getElementById("program").style.display="none"; document.getElementById("bcs_sub").style.display="block"; document.getElementById("trial").style.display="none"; document.getElementById("sd").style.display="none"; document.getElementById("graphs").style.display="none"; document.getElementById("summary").style.display="none"; document.getElementById("response").style.display="none"; document.getElementById("enforces").style.display="none"; document.getElementById("sro").style.display="none"; document.getElementById("lro").style.display="none"; document.getElementById("prompt").style.display="none"; } function change_sd(){ document.getElementById("sd").style.display="block"; document.getElementById("program").style.display="none"; document.getElementById("trial").style.display="none"; document.getElementById("bcs_sub").style.display="none"; document.getElementById("graphs").style.display="none"; document.getElementById("summary").style.display="none"; document.getElementById("response").style.display="none"; document.getElementById("enforces").style.display="none"; document.getElementById("sro").style.display="none"; document.getElementById("lro").style.display="none"; document.getElementById("prompt").style.display="none"; } function change_response(){ document.getElementById("response").style.display="block"; document.getElementById("sd").style.display="none"; document.getElementById("trial").style.display="none"; document.getElementById("program").style.display="none"; document.getElementById("bcs_sub").style.display="none"; document.getElementById("graphs").style.display="none"; document.getElementById("summary").style.display="none"; document.getElementById("enforces").style.display="none"; document.getElementById("sro").style.display="none"; document.getElem…
has comment: http://stackoverflow.com/comment/47389721

http://stackoverflow.com/comment/47412516
type: Comment
comment on: http://stackoverflow.com/a/29631705
type: AnswerComment
has text: Network tab shows it's being loaded, and I am using your version, which loads directly from the URL.
score: 0

http://stackoverflow.com/q/29534516
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47221863
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: UnansweredQuestion
upvote count: 1
has body: I add an element to the DOM with a left position off the screen and then immediately afterwards set the left position to being on screen so it can do a transition animation, but this doesnt seem to work without a setTimeOut function. but strangely when I do the same but with the element having a width of 0px first and then setting it to full width straight after I dont need the SetTimeOut. Can anyone explain why this is?
has comment: http://stackoverflow.com/comment/47236394
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29542804
has comment: http://stackoverflow.com/comment/47221866
has title: css transition setTimeout for left position but not width
score: 0

http://stackoverflow.com/comment/47465236
type: AnswerComment
has text: Your approach has the disadvantage of not being able to see which direction the player came from. You'll have a rough time getting such thing bug free. To do this you're probably better of storing a speed vector for each player, and adjusting it as desired when hit by a bullet, being affected by gravity, hitting a platform or jumping.
score: 0
comment on: http://stackoverflow.com/a/29660418
type: Comment

http://stackoverflow.com/comment/47241027
has text: uploadFile is used on my back. If I add an other input ( not hidden ) it does not change anything.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29543494
type: Comment

http://stackoverflow.com/q/29603813
tagged with: webstorm
linked to: http://stackoverflow.com/q/12907678
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29607740
has answer: http://stackoverflow.com/a/29605373
type: UnansweredQuestion
has title: How to access environment variables in Grunt file
type: Question
tagged with: heroku
has body: I have an angular application which runs in 3 different environment- Development, Staging and Production. Heroku builds the application based on my build script. I have a Gruntfile which as release task which uglifies the code. Heroku runs this command Grunt release for both staging and production environment. But I need logs to be enabled in staging and disabled in production environment. For doing this, I tried accessing process.env.NODE_ENV in my grunt file. But it says process.env.NODE_ENV is undefined. I am using webstorm to start the server in which I have defined process.env.NODE_ENV to production. But I am unable to access this in Grunt file. Kindly let me know how to proceed.
tagged with: javascript
tagged with: gruntjs

http://stackoverflow.com/a/29577395
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/47303433
has body: localStorage, like cookies, is for storing strings. If you attempt to store a complex object in storage it will first be cast to its string representation. Therefore, you need to stringify when saving it and parse it back into a complex object when attempting to iterate over it later. Save: var obj = {foo: 'bar'}; localStorage.setItem('obj', JSON.stringify(obj)); //&lt;-- saved as JSON string Read later: var obj = JSON.parse(localStorage.getItem('obj')); for (var i in obj) { alert(i+' = '+obj[i]); //&lt;-- "foo = bar" }
answers question: http://stackoverflow.com/q/29577334
has comment: http://stackoverflow.com/comment/47303249
accepted answer of: http://stackoverflow.com/q/29577334
upvote count: 9
has comment: http://stackoverflow.com/comment/47303943
score: 9

http://stackoverflow.com/a/29540309
has comment: http://stackoverflow.com/comment/47233545
has comment: http://stackoverflow.com/comment/47232668
accepted answer of: http://stackoverflow.com/q/29540127
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29540127
has comment: http://stackoverflow.com/comment/47232722
has comment: http://stackoverflow.com/comment/47233368
type: Answer
has comment: http://stackoverflow.com/comment/47232577
has body: You can do something like this using JQuery: JQuery $( "#horiz-menu a" ).click(function(e){ $(this).next('ul').toggleClass('active'); }); CSS #horiz-menu ul.active { opacity: 1; visibility: visible; margin: 0; } Heres a fiddle. https://jsfiddle.net/hw9fsLb2/1/

http://stackoverflow.com/comment/110934521
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/62729894
has text: Do you have specific information as to how Chrome uses system configuration to decide what the memory limits are?

http://stackoverflow.com/comment/47508051
type: Comment
has text: And you've included the shopsService script file in your index.html (or whatever)? Can you post a fiddle or plunker or somewhere to reproduce the problem?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29684314

http://stackoverflow.com/a/29582687
has comment: http://stackoverflow.com/comment/47315166
has comment: http://stackoverflow.com/comment/47315136
has comment: http://stackoverflow.com/comment/47314009
type: Answer
has body: this is not necessary, it's just a way to do it. Another trivial way would be simpleObject.n. However, it seems that you want the identifier n to be avaluated to a reference to simpleObject.n. Identifiers are resolved using property lookups to the binding object of the environment record of the LexicalEnvironment of the running execution context. Initially, it is Scope: 10.4.3 Entering Function Code The following steps are performed when control enters the execution context for function code contained in function object F, a caller provided thisArg, and a caller provided argumentsList: Let localEnv be the result of calling NewDeclarativeEnvironment passing the value of the Scope internal property of F as the argument. Set the LexicalEnvironment to localEnv. To achieve what you want, you need to set the running execution context's LexicalEnvironment to NewObjectEnvironment(this, oldEnvironment). You can achieve that using the width statement: The with statement adds an object environment record for a computed object to the lexical environment of the current execution context. It then executes a statement using this augmented lexical environment. Finally, it restores the original lexical environment. var simpleObject = {n: 70}; simpleObject.testMethod = function(){ with(this) { console.log(n); } }; simpleObject.testMethod(); // 70 However, note that the use of with is discouraged, and won't work in strict mode. Another way is taking advantage of the fact that the scope in event handler content attributes is the global one shadowed by the document, the form owner, and the element: Let Scope be the result of NewObjectEnvironment(document, the global environment). If form owner is not null, let Scope be the result of NewObjectEnvironment(form owner, Scope). If element is not null, let Scope be the result of NewObjectEnvironment(element, Scope). Then, you can let your object be an HTML element, and let your method be an internal raw uncompiled handler: var el = do…
has comment: http://stackoverflow.com/comment/47313712
has comment: http://stackoverflow.com/comment/47313914
has comment: http://stackoverflow.com/comment/47313767
answers question: http://stackoverflow.com/q/29582453
score: 0

http://stackoverflow.com/comment/47286325
comment on: http://stackoverflow.com/a/29562813
has text: @VladimirCvetic As per your question "What I am wondering if there are any best practices, good examples of captcha implementation in this case? " You just wanted about some good captcha.So I gave the name as well as link for that . If you'll open the link you'll find demo and example. And if you want whole code then stackoverFlow is not the right place.Because stackoverflow is not about giving/providing code.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/29602140
has comment: http://stackoverflow.com/comment/47351694
has comment: http://stackoverflow.com/comment/47350743
score: -3
has comment: http://stackoverflow.com/comment/47433321
upvote count: 1
has answer: http://stackoverflow.com/a/29693156
has comment: http://stackoverflow.com/comment/47426756
type: Question
has comment: http://stackoverflow.com/comment/47353630
downvote count: 4
accepted answer: http://stackoverflow.com/a/29693156
answer count: 1
has comment: http://stackoverflow.com/comment/47351397
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47351566
tagged with: dojo
has title: tag not working in .properties file
has body: I have a DOJO JavaScript project wherein I am using x.js rendered from the file x.properties virtually. I mean internally .properties is getting converted to a .js I have key value pairs in it, for example: x.properties: name=pavan class=xyz school=Lions Model school. &lt;br&gt; Primary school. Something like this. I wanted the primary school to be displayed in a new line. The output looks something like the following: Lions Model school. &lt;br&gt; Primary school. Instead of newline, i am getting &lt;br&gt; displayed like a string. What I tried until now is: \n \\n \r\n &lt;br&gt; &lt;br/&gt; But nothing worked so far, am I doing something wrong here?
type: AnsweredQuestion

http://stackoverflow.com/q/29543803
type: AnsweredQuestion
upvote count: 3
accepted answer: http://stackoverflow.com/a/29574457
has body: I cannot really pinpoint whether the issue is with Ember or Ember data, or if it's even an issue, but here's what happens: Let's say you've got your model called tell_me_a_story. This will be the name that your JSON should provide, should you be using ActiveModelAdapter. Regardless, when Ember or Ember Data process it internally, it'll camelize it and it becomes tellMeAStory, correctly indicating that "A" and "Story" are two separate words. However, when internally it is decamelized to lookup for the model, the decamelize function will convert it into tell_me_astory. This final behavior seems flawed to me, but when looking at the tests that derived this behavior, it is actually intended to manage acronyms in that fashion. (Compare the following example with the "innerHtml" that I would expect for camel casing multi-letter acronyms.) QUnit.test("converts a camelized string into all lower case separated by underscores.", function() { deepEqual(decamelize('innerHTML'), 'inner_html'); if (Ember.EXTEND_PROTOTYPES) { deepEqual('innerHTML'.decamelize(), 'inner_html'); } }); (Source in Ember Runtime) So, which is the correct way to use single-letter words in models with Ember? Are they even supported? Here's an example of what I'm trying to do: // this comes from a separate data source, e.g. REST APIs var myModelName = 'tell_me_a_story'; // this line will throw if the model file is named "tell-me-a-story" if (!store.getById(myModelName, 1)) { // this line will throw if the model file is named "tell-me-astory" store.pushPayload(myModelName, myObject); }
type: Question
score: 3
tagged with: javascript
has comment: http://stackoverflow.com/comment/47241712
downvote count: 0
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/29574457
has title: Are single-lettered word models supported in EmberJS?
tagged with: ember.js

http://stackoverflow.com/comment/47709997
comment on: http://stackoverflow.com/a/29676862
score: 0
type: AnswerComment
has text: This is not that i want. I want to convert char to integer such as "hello" to 32 or any other number.
type: Comment

http://stackoverflow.com/q/29621940
type: Question
has body: Using the library here https://github.com/danialfarid/ng-file-upload. What is a angular way or clearing the input file from the element after a successful upload? (so it goes back to saying "No file selected") &lt;input ng-file-select ng-model="vm.files" name="filename" accept="*" type="file" ng-file-change="vm.checkFileSize($files)" /&gt;
tagged with: javascript
score: 0
answer count: 1
tagged with: file-upload
has title: With NG-File-Upload what is a angular way of clearning the input type="file" after a successful upload
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29622589

http://stackoverflow.com/comment/47414887
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29557515
has text: I think you must first enable the "ssh2 module" in your php configuration. Follow theses instructions : http://stackoverflow.com/questions/15134421/php-install-ssh2-on-windows-machine

http://stackoverflow.com/comment/47264792
comment on: http://stackoverflow.com/a/29557153
has text: I'd say you could do away with the `value: value`, but otherwise this is a decent solution.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47271915
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29560523
has text: possible duplicate of [ASP.NET MVC. Check if user is authorized from JavaScript](http://stackoverflow.com/questions/5666270/asp-net-mvc-check-if-user-is-authorized-from-javascript)
score: 0

http://stackoverflow.com/comment/47544274
type: QuestionComment
has text: I use version 1.11.1. In my special case I use an ajax load as i wrote above.
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29678709

http://stackoverflow.com/comment/47233455
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29540567
has text: I did it like this `var result = (hours &gt; 10 ? "0" + hours : hours)...` without the `CDATA`
type: AnswerComment

http://stackoverflow.com/q/29539947
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47232093
tagged with: jquery-events
has answer: http://stackoverflow.com/a/29540846
answer count: 1
has comment: http://stackoverflow.com/comment/47232362
has body: Let's say we have the following HTML (with a button added after the page has loaded): Static button Dynamical button Now I'd like to know the exact difference between these two event handlers: $(document).on('click', '#container button', function() {}); $('#container').on('click', 'button', function() {}); As far I as I understand the event bubbling, the second example executes the callback function slightly faster. That's because the click event gets fired when the container anchor is reached and in the first example it's fired when the document is reached. I can imagine that in complex structured website that could cause some performance gain. Am I right with this? Are there any other benefits? And if the performance differences are vanishing can I just attach all events to the document to guarantee that dynamically added elements are handled as well?
accepted answer: http://stackoverflow.com/a/29540846
type: AnsweredQuestion
tagged with: event-delegation
has title: Event delegation from document or next static parent
score: 0
has comment: http://stackoverflow.com/comment/47232237

http://stackoverflow.com/comment/47309754
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29579706
has text: @Tenali_raman That's no problem, but what you're asking really isn't clear; I was just trying to get rid of the noise in your question.
score: 0

http://stackoverflow.com/comment/47257366
comment on: http://stackoverflow.com/a/29553066
type: Comment
score: 0
has text: So basically you're saying, if I need to create a canvas with a bunch of text drawn in to it, using a plugin like `html2canvas` is the way to go?
type: AnswerComment

http://stackoverflow.com/q/29548443
linked to: http://stackoverflow.com/q/29169940
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47248750
has comment: http://stackoverflow.com/comment/47248929
has comment: http://stackoverflow.com/comment/47256947
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/29553381
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: mouse
has title: Javascript (jQuery) limit mouse movement speed inside an element
has comment: http://stackoverflow.com/comment/47249778
upvote count: 1
has comment: http://stackoverflow.com/comment/47248727
tagged with: coordinates
has body: The task is to draw a curve ob canvas. The problem is that if mouse is moved too fast, the coordinates are skipped and not captured. (Html5/Js canvas capturing mouse coords when it moves fast - my previous post..) Is there a cross-browser way to limit mouse speed inside an element (div, canvas, etc.)?
tagged with: canvas

http://stackoverflow.com/comment/47301221
type: QuestionComment
type: Comment
has text: I just wanted to note that some browsers might have [problems with trailing commas in object literals](http://stackoverflow.com/questions/5036618/does-internet-explorer-9-choke-on-extra-commas-at-the-end-of-array-and-object-li).
comment on: http://stackoverflow.com/q/29576218
score: 0

http://stackoverflow.com/comment/47455247
type: AnswerComment
comment on: http://stackoverflow.com/a/29657555
type: Comment
has text: var ok Ext.ComponentQuery.query('menuitem{text.search( \'You menu item text\' )!=-1}'); ok.fireEvent('click'); how can i fire an event to that specific menu item search ? it doens't support fireEvent
score: 0

http://stackoverflow.com/comment/47229739
type: QuestionComment
type: Comment
has text: When do you call that function? the code seems to be ok and it's working
score: 1
comment on: http://stackoverflow.com/q/29538809

http://stackoverflow.com/comment/47478064
comment on: http://stackoverflow.com/a/29669456
type: AnswerComment
score: 0
type: Comment
has text: @MarkWhitaker I'm sorry I didn't understand your question correctly but what will happen if you enter in the url a serialized but not html-encoded string? Will it be encoded? I don't think so (or I'm wrong?)

http://stackoverflow.com/comment/47388380
type: Comment
comment on: http://stackoverflow.com/q/29622180
type: QuestionComment
has text: Use ajax request. Define the route and use `list` to generate the `html`.
score: 0

http://stackoverflow.com/q/29533342
type: Question
accepted answer: http://stackoverflow.com/a/29534142
tagged with: jquery-ui-sortable
tagged with: jquery-ui
tagged with: javascript
has comment: http://stackoverflow.com/comment/47220006
score: 0
has comment: http://stackoverflow.com/comment/47221442
answer count: 1
tagged with: jquery
has title: Force order between two jquery UI sortable lists
has answer: http://stackoverflow.com/a/29534142
type: AnsweredQuestion
has body: Surprised this question hasn't been asked before, at least I haven't been able to find it. I have multiple lists or elements that are all connected together using jQuery UI sortable. Its all working as the docs say it should, however I would like to make the lists force sort. For example, when each list is loaded in, the items are ordered by date. When you move an item from list 1 into list two, you can place that item anywhere in the list, regardless of its date. Similarly you can move items within the same list so they are out of date order. Is there a way to make it calculate the date ordering and render the items in the correct order once an item has been moved? Once an item is moved from one list to another it performs an ajax request to save that item to that list, a possible solution would be for that request to return that list in a sorted order and then re-render that list, however that doesnt seem like a particularly clean approach as you already have all the data. Any easier/better ways of doing this? If its also possible to prevent reordering within the same list that would be ideal. thanks.

http://stackoverflow.com/comment/47332628
type: Comment
type: QuestionComment
has text: [a-wA-Wy-zY-Z0-9]{5}[a-wA-W1-9] may be this work for u
comment on: http://stackoverflow.com/q/29592689
score: 0

http://stackoverflow.com/comment/47512511
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29662220
has text: Haven't had time to try it yet, but I'll try it when i get a chance! Thanks!

http://stackoverflow.com/comment/47427346
has text: @MarcusTan I have updated code with regex and simple jquery function to check you can use any of these ways
comment on: http://stackoverflow.com/a/29642468
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29789371
downvote count: 0
upvote count: 2
type: Answer
has body: Your algorithm has a flaw. Your function looks only one step forward. You need to add loop inside to look over all rest values. function ArrayAdditionI(arr) { // sorting the array to easily remove the biggest value // slice added to prevent original array modification var sArr = arr.slice().sort(function (a, b) { return a - b; }); // removing the biggest value var biggest = sArr.pop(); function recursion(start, i) { var result = false; // looking over all rest values of array for (var j = i; j &lt; sArr.length &amp;&amp; !result; j++) { if (sArr[j] + start === biggest) { result = true; } else if (start + sArr[j] &lt; biggest) { result = recursion(start + sArr[j], j + 1); } } return result; } return recursion(0, 0); }
score: 2
has comment: http://stackoverflow.com/comment/47762700
answers question: http://stackoverflow.com/q/29650834

http://stackoverflow.com/a/29656375
upvote count: 5
score: 5
downvote count: 0
has comment: http://stackoverflow.com/comment/47452575
has comment: http://stackoverflow.com/comment/47452619
has body: You should split them up into different classes like this. .myBody { font-size: 11px; color: Black; border: 1px solid; } .background_red { background: red; } .background_green { background: green; } Then use them like this &lt;div class="mybody background_red"&gt;&lt;/div&gt; &lt;div class="mybody background_green"&gt;&lt;/div&gt; You also have the ability to overwrite css like this: .myBody { background:red; } .overwrite_background { background:green; } &lt;div class="myBody"&gt;&lt;/div&gt; &lt;div class="myBody overwrite_background"&gt;&lt;/div&gt; The first div would have a background of red where the second one would have a background of green. Here is another post you should look at. This reference a couple of options you have to handle this situation. How to pass parameters to css classes Another option is to use Sass. Sass allows you to use a programming language to create your css. This is wonderful for changing things over a mass on the fly. If you use the same color in multiple places, or if you want to have a different configuration for each site and still carry the same css just different colors.
has comment: http://stackoverflow.com/comment/47452871
type: Answer
answers question: http://stackoverflow.com/q/29656276
has comment: http://stackoverflow.com/comment/47453039

http://stackoverflow.com/q/29661458
has comment: http://stackoverflow.com/comment/47462634
has comment: http://stackoverflow.com/comment/47475209
answer count: 4
has comment: http://stackoverflow.com/comment/47462932
has answer: http://stackoverflow.com/a/29661663
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29661756
has comment: http://stackoverflow.com/comment/47462795
tagged with: jquery-ui
possible better answer: http://stackoverflow.com/a/29661663
has body: I am new to JQuery stuff ,but this is ridiculous ,i cant do drag and drop work .php file PHP Test Drag me my drag js file $(document).ready(function() { $('#drag').draggable(); }); By the way, do i need to have JQuery UI to make drag and drop stuff? Thank you
has title: Simple JQuery Drag and Drop not working at all
has comment: http://stackoverflow.com/comment/47462755
type: Question
has comment: http://stackoverflow.com/comment/47462775
has answer: http://stackoverflow.com/a/29661735
has answer: http://stackoverflow.com/a/29661685
accepted answer: http://stackoverflow.com/a/29661685
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/q/29620595
score: 0
accepted answer: http://stackoverflow.com/a/29620787
has body: I have an ng-repeat that loads an ng-include. I'd like to have a separate controller inside the view that the ng-include loads. But I'm having trouble accessing the item from ng-repeat in that controller. I tried something like this, and it fails. How do I get at result inside of SubController? view/someinclude.html: ... controller js: angular.module('SubController', []) .controller('SubController', ['$scope', function ($scope) { //fails console.log($scope.result); } ]);
tagged with: javascript
has answer: http://stackoverflow.com/a/29620693
tagged with: angularjs
has answer: http://stackoverflow.com/a/29620787
answer count: 3
has title: How to pass an item from ng-repeat to a controller created/loaded by ng-include?
has answer: http://stackoverflow.com/a/29620910
possible better answer: http://stackoverflow.com/a/29620693
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/47236518
type: AnswerComment
type: Comment
has text: The `>` won't work in the updated question, since the inputs are actually in a `div` element inside the form. You can just leave it out.
comment on: http://stackoverflow.com/a/29542374
score: 0

http://stackoverflow.com/a/29614625
score: 1
answers question: http://stackoverflow.com/q/29614601
has body: The code you have already will do that. You are probably trying to read the value of state before the callback has fired. This is why we normally put the code to process the data in the callback: to make sure it runs after the asynchronous event has occurred.
upvote count: 1
type: Answer
downvote count: 0

http://stackoverflow.com/q/29638434
answer count: 1
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/29465242
score: 0
tagged with: slider
tagged with: http://stackoverflow.com/tag/html
has body: So, what I am seeking is simple in context, but challenging to implement. I want the hover function to be disabled until the user clicks the play button and then the pause button. So, basically I would like the mouse-over function of the slider to be void until the user clicks the Un-Mute Button (Play Youtube Button) and then clicks the Mute Button (Pause YT Button). If you go to the JSFiddle you will see that, upon load, if your mouse hovers over the slider and then hovers out ... the slider moves (After 6 sec). I do not want the slider to start until the user starts the Youtube video. var W = $('#image_rotator').width(), N = $('#slider .slide').length, C = 0, S = 0, intv; if (N &lt;= 1) $('#left, #right').hide(); $('#slider').width(W * N); $('#left, #right').click(function () { C = (this.id == 'right' ? ++C : --C) &lt; 0 ? N - 1 : C % N; $('#slider').stop().animate({ left: -C * W }, 300, function () { if (C == 0) { $('#playiunmute').show(); } if (C == 1) { $('#left').show(); } if (C == 1) { $('#right').show(); } if (C == 1) { $('#playiunmute').hide(); } if (C == 10) { $('#slider').css("left", "0"); $('#right').click(); } }); }); function setResetInterval(e) { var intv = $("#slider"); if (e) { timer = setInterval(function () { $('#right').click(); }, 6000); } else { clearInterval(timer); } } $("#imute").click(function (e) { e.preventDefault(); setResetInterval(true); S = 0; }); $("#iunmute").click(function (e) { e.preventDefault(); setResetInterval(false); S = 1; }); $("#playiunmute").click(function (e) { e.preventDefault(); setResetInterval(false); S = 1; }); $('#slider, #left, #right, #playiunmute').hover(function (e) { return (e.type == 'mouseleave' &amp;&amp; S != 1) ? setResetInterval(true) : setResetInterval(false); }); 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 onYo…
type: UnansweredQuestion
has title: JQuery Slider Help - Mouse-Over event solution
tagged with: jsfiddle
has answer: http://stackoverflow.com/a/29664199
type: Question

http://stackoverflow.com/comment/47447318
score: 0
type: Comment
type: QuestionComment
has text: @Ted, I thought there was a delay as well, but there isn't it's just not working
comment on: http://stackoverflow.com/q/29653629

http://stackoverflow.com/comment/47240050
type: Comment
has text: Have you tried specifying HTML5 instead of XHTML? Replace your `DOCTYPE` with ` ` to try.
type: QuestionComment
comment on: http://stackoverflow.com/q/29544176
score: 1

windows-authentication
tags question: http://stackoverflow.com/q/29551689
tag name: windows-authentication
type: Tag

http://stackoverflow.com/q/29659697
score: 8
has answer: http://stackoverflow.com/a/29659828
type: AnsweredQuestion
has title: Polymorphism nodeJS
has comment: http://stackoverflow.com/comment/47459270
type: Question
tagged with: javascript
answer count: 1
downvote count: 0
has body: I develop a restful API with nodeJS. exports.postCreature = function (req, res) { var creature = new Creature({ name: req.body.name, id_user: req.user._id }); creature.save(function (err) { if (err) res.status(400).send(Error.setError('impossible to save the your creature', err)); else res.status(201).send(); }); }; //CODE DUPLICATE exports.createCreature = function(user, callback) { console.log('Creature created'); var creature = new Creature({ name: user.username, id_user: user._id }); creature.save(function (err) { if (err) callback(err, null); else callback(null, creature); }); } The two functions execute the same code but not with the same parameters. I would like to avoid duplication in my code. How can do in order to avoid duplication of my code ?
favorite count: 0
accepted answer: http://stackoverflow.com/a/29659828
upvote count: 8
tagged with: node.js

http://stackoverflow.com/q/29586833
type: AnsweredQuestion
type: Question
has title: Why isn't .forEach() working inside Array.prototype.fillB()? (a custom function)
accepted answer: http://stackoverflow.com/a/29586892
tagged with: javascript
tagged with: prototype
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29586876
has body: I started experimenting with prototypes and I ran into a case that I don't understand. I am trying to add a .fill(val) method to the Array prototype. This code taken from another StackOverflow answer works: Array.prototype.fillA = function(val) { var i; for (i = 0; i &lt; this.length; i++) { this[i] = val; } return this; }; It looked like I could clean that up with a .forEach: Array.prototype.fillB = function(val) { this.forEach(function(origVal, i, theArray) { theArray[i] = val; }); return this; }; But that doesn't work. (After .fillB is called, the array has not been changed). So, what exactly is wrong with .fillB? Here are some Runnable Snippets that demonstrate the problem: .fillA() Array.prototype.fillA = function(val) { var i; for (i = 0; i &lt; this.length; i++) { this[i] = val; } return this; }; var arr, output; arr = new Array(5).fillA(5); alert('arr = "' + arr.join(',') + '"'); .fillB() Array.prototype.fillB = function(val) { this.forEach(function(origVal, i, theArray) { theArray[i] = val; }); return this; }; var arr, output; arr = new Array(5).fillB(5); alert('arr = "' + arr.join(',') + '"'); Disclaimers: I know that you should actually check that the .fill() function doesn't exist in the prototype before overriding it. Modifying a global prototype like this could have unintended consequences with other code libraries doing things like (for..in, etc), so it is usually a bad idea. .fillA and .fillB would actually do different things, i.e. .fillA only works properly on contiguous arrays starting at 0, but .fillB should work on all arrays.
possible better answer: http://stackoverflow.com/a/29586876
has answer: http://stackoverflow.com/a/29586892

http://stackoverflow.com/comment/47380332
score: 2
comment on: http://stackoverflow.com/q/29617742
has text: You can add the display none to the buttons without using javascript. Is there a reason you need to use js?
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47469313
comment on: http://stackoverflow.com/a/29617906
type: Comment
score: 0
type: AnswerComment
has text: still not working added readmore.js reference into my header.tpl aswell as added the above of your code to my page where i wanted. It stop showing blank page now but plugin isnt enabled. Check https://tvseriesden.com/show/the-vampire-diaries/season/6/episode/17

http://stackoverflow.com/a/29585390
type: Answer
answers question: http://stackoverflow.com/q/29585331
has body: Just use loop through the players array and update the property rating for the matched users UpdateRating = function(winnerId, LoserId){ for(var i = 0; players.length; i++){ if(players[i].id === winnerId) players[i].rating = players[i].rating + 10; else if(players[i].id === LoserId) players[i].rating = players[i].rating - 10; } }
score: 0

http://stackoverflow.com/comment/47509164
type: QuestionComment
has text: I see your example but I am having trouble following your paragraphs after the code. Can you reword it a bit? Oh, and what sebastien said.
score: 0
comment on: http://stackoverflow.com/q/29686004
type: Comment

http://stackoverflow.com/comment/47369201
type: QuestionComment
comment on: http://stackoverflow.com/q/29610569
has text: Are you generating the table all at once, or are you adding rows dynamically on user input? I'd like to see more code, where this function is being called. There is likely a better way to structure it.
score: 0
type: Comment

http://stackoverflow.com/q/29540117
possible better answer: http://stackoverflow.com/a/29540322
score: 1
favorite count: 0
has body: I would like to remove any HTML 5 validation on all input elements. Preferably using pure javascript. Thinking it would be nice to create a file that can be included when developing, which would bring certain functionallity. Such as removing all required attributes, dumping post data, error reporting on/off, etc. I have some jquery to remove the attribute from certain elements: $('div').removeAttr('required');​​​​​ But would like to see something that works without jquery and applys to all elements that support html5 validation.
has comment: http://stackoverflow.com/comment/47232725
has answer: http://stackoverflow.com/a/29540265
has comment: http://stackoverflow.com/comment/47232394
upvote count: 1
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47232586
has title: Remove HTML 5 validation from all elements
type: Question
accepted answer: http://stackoverflow.com/a/29540265
answer count: 2
has comment: http://stackoverflow.com/comment/47232396
linked to: http://stackoverflow.com/q/3090369
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29540322
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/18770925

http://stackoverflow.com/comment/47221939
score: 0
has text: use error_reporting(E_ALL); ini_set('display_errors', 1); at the top of page and check the error and check your browser colsole
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29534431

http://stackoverflow.com/q/29666227
tagged with: famo.us
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/48221717
type: Question
tagged with: crosswalk-runtime
has body: I have tried various ways given in documentation to run famo.us app which is running using android application. As the famo.us animations are not running smooth, I want to run it using Crosswalk application to run smoothly as crosswalk provides chromium browser. Can anyone tell the step wise description of which plugins to install in eclipse and the execution process of creating .apk file?
has comment: http://stackoverflow.com/comment/48219445
has comment: http://stackoverflow.com/comment/48166727
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Famo Crosswalk: How can I run Famo.us app using Crosswalk platform?
favorite count: 0
tagged with: android
has comment: http://stackoverflow.com/comment/48342114
has comment: http://stackoverflow.com/comment/48178889
has comment: http://stackoverflow.com/comment/48170931
score: 2
has comment: http://stackoverflow.com/comment/47596622
has comment: http://stackoverflow.com/comment/48171029
answer count: 0

http://stackoverflow.com/a/29612807
type: Answer
answers question: http://stackoverflow.com/q/29612691
score: 0
has body: In Index View you have &lt;script&gt; $(function () { $("#Details").click(function () { $.get('@Url.Action("Details","Home")', function (data) { $('#divDetails').replaceWith(data); }); }); &lt;/script&gt; which is a shortcut of &lt;script&gt; $(document).ready(function () { $("#Details").click(function () { $.get('@Url.Action("Details","Home")', function (data) { $('#divDetails').replaceWith(data); }); }); &lt;/script&gt; So the binding to an event performed when DOM is fully loaded While in Contacts view you don't have the $(document).ready() part So binding performed before DOM loads. If you want it to work in Contacts view simply use the: &lt;script&gt; $(function () { $("#Details").click(function () { $.get('@Url.Action("Details","Home")', function (data) { $('#divDetails').replaceWith(data); }); }); &lt;/script&gt;

http://stackoverflow.com/q/29640773
has comment: http://stackoverflow.com/comment/47423339
linked to: http://stackoverflow.com/q/6837580
type: Question
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47423401
favorite count: 0
has body: I am trying to validate that a password matches my specified pattern. I got the password pattern from http://html5pattern.com/. It should validate that my password contains uppercase, lowercase, and a number. I have checked the string 'Asdf1' on the above site and it works fine. I also added my regex pattern to W3Schools "Try It Yourself" example and it also returned TRUE. However when I try to check the string pattern in my code it returns FALSE, as it does in JSFiddle: https://jsfiddle.net/rnwilis/9okh6ppc/5/ Here is my named function: function validatePassword(data){ var testStr = "Asdf1"; var pattern = new RegExp('^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?!.*\s).*$', 'g'); var result = pattern.test(testStr); return result; } As you can see, I created a self executing anonymous function in Fiddle. This is a named function that I will call in my code. I hard-coded the string just to try to get the expected results. Ultimately testStr = data as I am passing in the user input password to the named function. I have also tried creating the RegExp object with and without the 'g' tag, which I don't really think makes a difference in this circumstance.
has comment: http://stackoverflow.com/comment/47423274
tagged with: regex
answer count: 0
duplicate of: http://stackoverflow.com/q/6837580
type: UnansweredQuestion
upvote count: 1
has title: JavaScript RegExp.test() not returning true
score: 1
has comment: http://stackoverflow.com/comment/47423323

http://stackoverflow.com/comment/47389017
score: 0
has text: @RahulDesai there is a value because if i press F5 the page is refreshed and it has the value it is working i need to dynamically add the value when ajax refreshes. :/
comment on: http://stackoverflow.com/a/29621530
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47391362
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29622485
has text: Simon i am new to sencha so could you post any example or link about same.

http://stackoverflow.com/comment/47238756
type: Comment
has text: You mentioned do a ajax request to get other fields. In the controlled I generate a model containing other fields and passing to the view as ToList() as IEnumerable.. if I do foreach loop in the view i see all the fields and data.. but you are saying it is not possible to get other fields without calling another request and passing the id? no way to do something like model[id]?
comment on: http://stackoverflow.com/a/29542732
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47508795
type: QuestionComment
comment on: http://stackoverflow.com/q/29684352
has text: sure, here's an example: https://anchorage.io/locations/potato-harbor
score: 0
type: Comment

http://stackoverflow.com/q/29562088
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29562198
favorite count: 0
has body: I would like to make my form editable after I'll click button. I write code for a button click but I don't how to change state of the inputs in a form. viewModel.test= function () { //code here } &lt;input type="text"/&gt; // Enable/Disable this Can I disable/enable all inputs in the form or I just need to do it one by one?
has answer: http://stackoverflow.com/a/29562517
tagged with: input
possible better answer: http://stackoverflow.com/a/29562517
has title: Enable/Disable input - knockout
type: AnsweredQuestion
score: 7
upvote count: 7
tagged with: knockout.js
type: Question
has answer: http://stackoverflow.com/a/29562198
tagged with: asp.net-mvc
downvote count: 0
tagged with: javascript
answer count: 2

http://stackoverflow.com/comment/47400984
type: Comment
type: QuestionComment
has text: Changed answer to support simple state checking (also works well with checkboxes). Toggling events `on` and `off` can be a real maintenance/debugging problem.
score: 0
comment on: http://stackoverflow.com/q/29628807

http://stackoverflow.com/q/29592833
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/47332648
has comment: http://stackoverflow.com/comment/47332668
type: AnsweredQuestion
has title: Issues with Event Delegation
score: 1
has answer: http://stackoverflow.com/a/29592856
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47332606
has body: I am trying to use this jQuery plugin: http://ethaizone.github.io/Bootstrap-Confirmation/# The fact that I load the buttons over AJAX is causing me issue. I know that i need event delegation to solve this but sadly I can't figure out how to correctly do that. My current code is: (function($) { $(document).on( "click", "a[data-toggle='confirmation']", function( event ) { $(this).confirmation() }); }(jQuery)); And the HTML button: Click me Sadly there are some issues. If I click the button, it redirects me to the given href attribute without showing the dialog first. If I remove the href, then I need to click the button 2 times to bring up the dialog (after that once click on the same button is enough to bring it up again). What am I doing wrong?
has comment: http://stackoverflow.com/comment/47332693
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47332656
accepted answer: http://stackoverflow.com/a/29592856
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47332531
favorite count: 0

http://stackoverflow.com/q/29547003
has answer: http://stackoverflow.com/a/29548043
has comment: http://stackoverflow.com/comment/47245897
has body: I'm writting my webApp and I'm using AngularJS. In this app I have created a file called script.js and I report this code: var modulo = angular.module('progetto', ['ngRoute']); // configure our routes modulo.config(function ($routeProvider, $httpProvider) { $routeProvider // route for the home page .when('/', { templateUrl: 'listaFilm.html', controller: 'listaController' }) // route for the description page .when('/:phoneName', { templateUrl: 'description.html', controller: 'descriptionController' }); $httpProvider.defaults.headers.common['Access-Control-Allow-Origin'] = '*'; }); modulo.controller('listaController', function ($scope, $http) { $http.get('https://api.getevents.co/event?&amp;lat=41.904196&amp;lng=12.465974').success(function (data) { $scope.names = data; }). error(function (data, status) { $scope.names = "Request failed"; }); }); With this code I call API following RESTful principles. When I run the code i have this problem: XMLHttpRequest cannot load https://api.getevents.co No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8383' is therefore not allowed access. Reading on the web I understood that I have a problem called CORS...I have tried several solutions proposed but I didn't resolve the problem. How can I fix the problem? What's the code that I must add for fix it?
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/20035101
favorite count: 0
duplicate of: http://stackoverflow.com/q/20035101
score: 52
tagged with: angularjs
type: UnansweredQuestion
upvote count: 52
tagged with: xmlhttprequest
has comment: http://stackoverflow.com/comment/47245759
has title: AngularJS: No "Access-Control-Allow-Origin" header is present on the requested resource
has comment: http://stackoverflow.com/comment/102525071
has comment: http://stackoverflow.com/comment/47246713
has answer: http://stackoverflow.com/a/29548846
has comment: http://stackoverflow.com/comment/47246755
linked to: http://stackoverflow.com/q/35329384
type: Question
linked to: http://stackoverflow.com/q/41683195
answer count: 2
tagged with: cors
downvote count: 0
linked to: http://stackoverflow.com/q/23823010
tagged with: javascript

http://stackoverflow.com/q/29536646
type: Question
type: AnsweredQuestion
score: 3
answer count: 1
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/29537041
upvote count: 3
has comment: http://stackoverflow.com/comment/47226174
has title: AngularJS - Some beginner questions on performance and scope
has answer: http://stackoverflow.com/a/29537041
tagged with: angularjs
downvote count: 0
has body: I have recently inherited an angular module written by a third party developer. I have never worked with angular before and have been asked to make some fairly basic changes, but I am struggling with a couple of issues (I promise there is a question at the end of this). In essence the module is just a multiple choice questionnaire, with a sequence of buttons and you click one to select an answer, and a forward / back button to move between questions. At the moment the module is hard coded to use 5 buttons, and the position of the buttons is set in the controller as so: // scope here is the scope for the main controller $scope.answerOptions = [ { pos: 70 }, { pos: 215 }, { pos: 360 }, { pos: 505 }, { pos: 650 } ]; The pos is simply the left offset and the vertical position is fixed. this is implemented on the template like so: &lt;div class="circle" ng-repeat="o in answerOptions" option-pos="{{o.pos}}" ng-hide="sectionEnd" ng-class="selectedOptionStyle($parent.selectedAnswer - 1 == $index)" ng-click="selectAnswer($index)"&gt; &lt;/div&gt; And the directive optionPos is then: .directive('optionPos', function(){ return function(scope, elm, attrs) { attrs.$observe('optionPos', function(x){ elm.css('left', x - 60 + 'px'); }) } }) I have been asked to make it work with arbitrary number of buttons and positioning in both x and y, and to allow customisable answers (at the moment it just sends the array index of the clicked button back to the server). I thought this would be an easy change, and admittedly it would be easy enough if I implemented the same system, setting the x and y using interpolation, then just adding Y to the optionPos directive. However I have a couple of problems with this approach: it doesn't scale well for the number of attributes on a button. e.g. as well as x and y there is some other data I would like to assign to the button from the answerOption object (such as the answer to send to the server, and potentially other things in the future), and I don…

http://stackoverflow.com/q/29574113
has body: I am new to d3.js and JSON. I am learning by doing some small small visualizations. Now, I am trying to load a JSON data and visualize the details based on the country code. My JSON data is like : [ { "Id":"SWE", "Country":"Sweden", "Population":9592552 }, { "Id":"NOR", "Country":"Norway", "Population":5084190 }, . . . ] I have world countries geo JSON which I can able to visualize successfully and also able to highlight the selected country and get the selected country's id. Now I need to get the details (population and country name of that country based on the id I got from selection). Can Some one tell how can I get the values from the JSON array. I tried like population = data.map( function(d) { return d["Population"] }); but this one gives me entire populations as an array. How do I get population for SWE based on Id ? I can get the index of the id and use that for finding population in the population array. But I need to find based on Id. Can Some one please tell me how can I get this.
possible better answer: http://stackoverflow.com/a/29574184
upvote count: 3
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/29574210
favorite count: 0
has comment: http://stackoverflow.com/comment/53421347
has answer: http://stackoverflow.com/a/29574184
type: AnsweredQuestion
downvote count: 0
tagged with: d3.js
has title: How to get the specific JSON array from a value in that array
type: Question
linked to: http://stackoverflow.com/q/21513957
score: 3
tagged with: http://stackoverflow.com/tag/json
accepted answer: http://stackoverflow.com/a/29574210

http://stackoverflow.com/comment/74140780
type: Comment
comment on: http://stackoverflow.com/a/34667584
score: 0
type: AnswerComment
has text: @user643011 yep, it was tested on my own machine.

http://stackoverflow.com/a/29627775
answers question: http://stackoverflow.com/q/29627660
has comment: http://stackoverflow.com/comment/47398682
score: 1
has comment: http://stackoverflow.com/comment/47398492
has comment: http://stackoverflow.com/comment/47437814
has body: Here we go. $('body').click(function(e) { if (e.target.id == 'myDiv') { alert('My Div!!!!'); } });​
type: Answer
has comment: http://stackoverflow.com/comment/47425695
upvote count: 2
has comment: http://stackoverflow.com/comment/47423154
has comment: http://stackoverflow.com/comment/47425861
has comment: http://stackoverflow.com/comment/47398580
downvote count: 1

http://stackoverflow.com/a/29663487
score: 5
upvote count: 5
has body: You'll want to get each item, split on a space (if exists) then add up the corresponding split. Something like this: var origValues = ['32 68', '56 78', '77 99', '7']; var addedValues = origValues.map(function(value) { return value.split(' ') .map(function(sArray) { return parseInt(sArray); }) .reduce(function(a, b) { return a + b; }); }); document.write(JSON.stringify(addedValues)); Note that this above example handles the case where you have a single digit inside your array value as well. To provide some explanation as to what is happening... You start off taking your original array and you are mapping a function on to each value which is what is passed into that function. Inside that function, I am splitting the value by a space which will give me an array of (possibly) two values. I then apply the map function again onto the array and parse each value in the array to an integer. Last, I reduce the integer array with a summation function. Reduce applies an accumulator function to each item in the array from left to right so you will add up all your values. This result is returned all the way back up so you get your new array with your answers. Kind of what it looks like in "drawing" form: Start: origValues = ['32 68', '56 78', '77 99', '7'] Apply map (this will track one value): value = '32 68' Apply the split: ['32', '68'] Map the parse integer function (I'm going to track both values): [32, 68] Reduce: 32 + 68 = 100
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29663300
accepted answer of: http://stackoverflow.com/q/29663300
type: Answer

http://stackoverflow.com/q/29608997
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: Add a bootstrap accordion to a website with an old version of jQuery in a non-conflict way
has body: I need to make my bootstrap accordion work correctly, somehow the animation is broken, (it works but it's broken) how can i make it work? Its probably because i'm including an old version of jquery or because the theme's creators added a custom way of doing it or something, the thing is, the animation is broken. I also tried adding another accordion, but it doesn't work at all. This is what is partially working at the moment: Collapsible Group Item #1 Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. Collapsible Group Item #2 Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. Collapsible Group Item #3 Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffe…
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/47365869
has answer: http://stackoverflow.com/a/29610123
accepted answer: http://stackoverflow.com/a/29610123
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47365844
type: Question
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/29679200
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29677016
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29677016
has body: It is not optimal to use Meteor.call in a helper. The helper's function will re-run every time there is a reactive change. This is why it runs so many times. Use the Template.onCreated callback instead: Template.posts.onCreated(function() { Meteor.call('getPosts', "tifu", function(e, results){ var result = JSON.parse(results.content).data.children; Session.set('postsResults', result); }); }); And your helper: Template.posts.helpers({ posts : function () { var r = Session.get('postsResults') for(var i=0; i&lt;7; i++){ if(!r) continue; var result = r[i].data; if(Posts.find({r_id: result.id}).count() == 0){ console.log("if"); } else { console.log("else"); }; }; return Posts.find(); } }); Second thing to keep in mind is Session.get('postsResults') will be null while the result of Meteor.call is returned, for a few hundred milliseconds. If you do Session.get('postsResults')[i].data you will get an exception. This is why i added a conditional check to continue the loop if r is null. This way you wait for the result and the posts function will re-run and recalculate the results with the new data.
type: Answer

http://stackoverflow.com/a/29572910
has comment: http://stackoverflow.com/comment/47295215
has comment: http://stackoverflow.com/comment/47295186
has comment: http://stackoverflow.com/comment/47296154
answers question: http://stackoverflow.com/q/29572889
type: Answer
has comment: http://stackoverflow.com/comment/47295297
has comment: http://stackoverflow.com/comment/47295264
accepted answer of: http://stackoverflow.com/q/29572889
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47295716
has comment: http://stackoverflow.com/comment/47295268
has body: Test the status in the loop. Since you only want to show the first endpoint that's in progress, you should break out of the loop when you find it. for (var i = 0; i < response.endpoints.length; i++) { var endpoint = response.endpoints[i]; if (endpoint.statusMessage == "In progress") { //console.log(endpoint); $pending0.html(" Server Name: " + endpoint.serverName + " Status: " + endpoint.statusMessage + " Progress: " + endpoint.statusDetailsMessage); break; } }
has comment: http://stackoverflow.com/comment/47295596
has comment: http://stackoverflow.com/comment/47295662
type: AcceptedAnswer
downvote count: 0

storage
tag name: storage
tags question: http://stackoverflow.com/q/29601492
type: Tag

http://stackoverflow.com/comment/47336857
comment on: http://stackoverflow.com/a/29594864
type: AnswerComment
has text: I have tried this code here: http://jsfiddle.net/Q2TYv/2058/ but no success. Can you try?
score: 0
type: Comment

http://stackoverflow.com/comment/47308185
type: QuestionComment
has text: npm install -g node-dev
comment on: http://stackoverflow.com/q/29579844
type: Comment
score: 0

http://stackoverflow.com/q/29538628
has body: here my probleme, in some project i need to validate a string, it must be a length of 4 character and contains one and only one number but i don't know it's place (can be "er1t" or "4frt" but not "sdfd" or "4fd5") i have made a regex which work : (?:[a-z]\d[a-z]{2}|\d[a-z]{3}|[a-z]{2}\d[a-z]|[a-z]{3}\d) but it's not optimised and I don't find how i search for a number in a string in regex, i use a javascript regex. Thank in advance, ekanS
has comment: http://stackoverflow.com/comment/47229321
has comment: http://stackoverflow.com/comment/47229255
has title: make a regex to validate a string with only one number
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47229932
linked to: http://stackoverflow.com/q/16814000
type: Question
has answer: http://stackoverflow.com/a/29538755
answer count: 1
tagged with: javascript
score: 0
tagged with: regex
accepted answer: http://stackoverflow.com/a/29538755

http://stackoverflow.com/comment/47505505
type: Comment
has text: I cannot understand why I cannot link the FIddle the same way as usual but the post section isn't allowing me to which is strange but nevertheless, the link is there
comment on: http://stackoverflow.com/a/29684294
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47333974
comment on: http://stackoverflow.com/a/29593374
score: 0
type: AnswerComment
type: Comment
has text: That works! Thank you for your help. I will spend more time with the "for" statement as I can use this in other scripts. Thank you again Pointy you have given me back some of my SUNDAY time.

http://stackoverflow.com/comment/47963379
type: Comment
comment on: http://stackoverflow.com/a/29857071
has text: I updated the Fiddle with different cards. Each card I start to drag, becomes a King. http://jsfiddle.net/y1o0oqjw/7/
type: AnswerComment
score: 0

http://stackoverflow.com/a/29632855
answers question: http://stackoverflow.com/q/29632496
type: Answer
has comment: http://stackoverflow.com/comment/47408937
has comment: http://stackoverflow.com/comment/47408806
has comment: http://stackoverflow.com/comment/47409137
accepted answer of: http://stackoverflow.com/q/29632496
has body: A better way to achieve all this is via css animation. I have prepared a JSFiddle for this to show the main idea: https://jsfiddle.net/uuwdr5Ly/3/ Here is the css code that make animation possible: ul.social-container &gt; li{ -webkit-transition: all 0.4s; -moz-transition: all 0.4s transition: all 0.4s; width:75px; } ul.social-container &gt; li:hover {width:150px} Also take a look at JSFiddle because I change more css in order to make it work with your code.
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47408702
has comment: http://stackoverflow.com/comment/47409058

http://stackoverflow.com/a/29673822
type: Answer
score: 1
upvote count: 1
has body: You have two options here: You should deinitialize (destroy) OwnCarousel on componentWillUpdate and init it againt on componentDidUpdate after React rerendered the component with new images You should return false in shouldComponentUpdate and manually update DOM in componentWillReceiveProps using nextProps.images value and jQuery
answers question: http://stackoverflow.com/q/29626054
downvote count: 0
has comment: http://stackoverflow.com/comment/95554400

http://stackoverflow.com/a/29657594
has comment: http://stackoverflow.com/comment/47456448
has comment: http://stackoverflow.com/comment/47456946
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/47455770
has comment: http://stackoverflow.com/comment/47456986
has comment: http://stackoverflow.com/comment/47455750
type: AcceptedAnswer
downvote count: 0
has body: Your action is expecting a List of arrays: watchClasses(IEnumerable&lt;SelectedClassesArray&gt; selectedClassesArray) You probably want to get only the array, which is in the view model: watchClasses(SelectedClassesArray selectedClassesArray) And what @taxicala said makes sense, try passing only the array, not an array inside another array: data: { selectedClassesArray: selected } The posted property name must match the view model parameter's name.
answers question: http://stackoverflow.com/q/29657512
has comment: http://stackoverflow.com/comment/47455861
type: Answer
has comment: http://stackoverflow.com/comment/47455605
accepted answer of: http://stackoverflow.com/q/29657512

http://stackoverflow.com/a/29569541
has comment: http://stackoverflow.com/comment/47288729
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/29569122
answers question: http://stackoverflow.com/q/29569122
has body: request is probably not defined (in scope) in your function. Either you can call it and use this or of the following function createElements(request) {//Get the 'request' passed. // Parse JSON response. var elements = JSON.parse(request.responseText); elements.datas.forEach(function (element) { var div = document.getElementById(element.id); div.innerHTML = element.value; }); } var request = new XMLHttpRequest(); request.onreadystatechange = function() { if (request.readyState === 4) { createElements(request);//Pass in 'request' } } request.responseType = "application/json";//Remove line if there are errors request.open("GET", "datas.json", true); request.send();

http://stackoverflow.com/comment/47363313
comment on: http://stackoverflow.com/a/29607956
type: AnswerComment
score: 0
has text: For the reason of portability, I would prefer not to have to mess with any source files. I was planning on storing the value in a session, then if met either thorw some JS exception to break it, or search for script tags and comment out.
type: Comment

http://stackoverflow.com/a/29576034
type: Answer
accepted answer of: http://stackoverflow.com/q/29575858
answers question: http://stackoverflow.com/q/29575858
score: 6
downvote count: 0
has body: The best way to do it is not to use id param multiple times but separate your values with another character and always get an array and you are ready to go! script.js (function() { var app = angular.module('app', ['ngRoute']); app.config([ '$routeProvider', function($routeProvider) { $routeProvider.when('/', { templateUrl: 'home.html', controller: 'HomeCtrl' }); } ]); app.controller('HomeCtrl', [ '$scope', '$routeParams', function($scope, $routeParams) { $scope.id = $routeParams.id.split('-'); } ]); })(); home.html #/?id=12-34-56 Array #/?id=12 Array id: id[0]:
type: AcceptedAnswer
upvote count: 6

http://stackoverflow.com/q/29531394
answer count: 2
linked to: http://stackoverflow.com/q/31345638
has title: Reset bootstrap switch state
tagged with: javascript
tagged with: jquery
favorite count: 0
upvote count: 4
type: AnsweredQuestion
downvote count: 0
possible better answer: http://stackoverflow.com/a/70741656
has body: Firstly, here is a JsFiddle: http://jsfiddle.net/VTv2j/76/ This is what I want to happen: Switch starts in the indeterminate / in-between state (this works) Event fires when user chooses either state (this works) When use clicks RESET the switch goes back to the indeterminate / in-between state (this works) Event fires when user chooses either state (this DOES NOT work) What is happening is if the user goes back to whatever the previous state was then no event fires. So say it was on YES, they click RESET, then click YES again - no event fires (but if it was previously on YES, and the reset then went to NO then the event would fire). I've got no idea how to approach this. I've tried things like destroying and recreating the switch: $('input[name=test]').bootstrapSwitch('destroy'); $('input[name=test]').bootstrapSwitch(); To no avail unfortunately. Here is the important thing for me - all I need to know is when the user moves from the indeterminate state to ANY state. I don't actually care what they choose, as long as they choose something. So if anyone can think of a different type of workaround with that in mind (maybe it makes it easier) that would definitely be welcome. Any help is appreciated, this is driving me crazy.
type: Question
has answer: http://stackoverflow.com/a/29531751
accepted answer: http://stackoverflow.com/a/29531751
has answer: http://stackoverflow.com/a/70741656
has comment: http://stackoverflow.com/comment/47216541
score: 4

http://stackoverflow.com/comment/47228460
score: 0
type: Comment
type: QuestionComment
has text: I already updated my post. I forgot to post the HTML file. Sorry.
comment on: http://stackoverflow.com/q/29538002

http://stackoverflow.com/q/29652392
answer count: 0
type: UnansweredQuestion
upvote count: 7
tagged with: audio
score: 7
type: Question
has comment: http://stackoverflow.com/comment/50648568
downvote count: 0
tagged with: javascript
has title: Surround sound (5.1) Web Audio support
tagged with: http://stackoverflow.com/tag/html
tagged with: web
favorite count: 0
has body: I'm trying to create simple aplication to play stereo / mono music in all 5.1 channels. After studying Web audio specification I spend 4 hours to try code it. Unfortunately I got nowhere. Audio is playing only over 2 channels. If I set merger.channelCountMode = "explicit" it plays only from center channel. If I set merger.channelInterpretation = "discrete"; it plays only from left channel. What I'm doing wrong? Thank you very much. My code: var audio; function PlaySurround(){ context = new AudioContext(); audio = new Audio(); audio.src = "a.mp3"; var source = context.createMediaElementSource(audio); context.destination.channelCount = 6; audio.currentTime = Math.random() * 200; //Create a splitter to "separete" the stereo audio data to two channels. var splitter = context.createChannelSplitter(6); splitter.channelCount = 6; //splitter.channelInterpretation = "discrete"; //splitter.channelCountMode = "explicit"; console.log(splitter); //Connect your source to the splitter (usually, you will do it with the last audio node before context destination) source.connect(splitter); //Create two gain nodes (one for each side of the stereo image) var panLeft = context.createGain(); var panRight = context.createGain(); var panLeftSurround = context.createGain(); var panRightSurround = context.createGain(); var panCenter = context.createGain(); var panSubwoofer = context.createGain(); //Connect the splitter channels to the Gain Nodes that we've just created splitter.connect(panLeft, 0); splitter.connect(panRight, 1); splitter.connect(panCenter, 2); splitter.connect(panSubwoofer, 3); splitter.connect(panLeftSurround, 4); splitter.connect(panRightSurround, 5); panLeft.gain.value = 1; panRight.gain.value = 1; panLeftSurround.gain.value = 1; panRightSurround.gain.value = 1; panCenter.gain.value = 1; panSubwoofer.gain.value = 1; //Create a merger node, to get both signals back together var merger = context.createChannelMerger(6); merger.channelCount = 6; //merger.channelInterpretation…

asp.net-mvc
tags question: http://stackoverflow.com/q/29630214
tags question: http://stackoverflow.com/q/29537984
tags question: http://stackoverflow.com/q/29578250
tags question: http://stackoverflow.com/q/29684251
tags question: http://stackoverflow.com/q/29634475
tags question: http://stackoverflow.com/q/29542354
tags question: http://stackoverflow.com/q/29677392
tags question: http://stackoverflow.com/q/29633293
tags question: http://stackoverflow.com/q/29646181
tags question: http://stackoverflow.com/q/29584980
tags question: http://stackoverflow.com/q/29630587
tags question: http://stackoverflow.com/q/29559935
tags question: http://stackoverflow.com/q/29626968
tags question: http://stackoverflow.com/q/29562088
tags question: http://stackoverflow.com/q/29570814
tags question: http://stackoverflow.com/q/29555653
tags question: http://stackoverflow.com/q/29634762
tags question: http://stackoverflow.com/q/29657512
tags question: http://stackoverflow.com/q/29671208
tags question: http://stackoverflow.com/q/29591145
tags question: http://stackoverflow.com/q/29539802
tags question: http://stackoverflow.com/q/29630479
tags question: http://stackoverflow.com/q/29612691
tags question: http://stackoverflow.com/q/29647939
tags question: http://stackoverflow.com/q/29651900
tags question: http://stackoverflow.com/q/29566649
tags question: http://stackoverflow.com/q/29682493
tags question: http://stackoverflow.com/q/29626073
tags question: http://stackoverflow.com/q/29556457
tags question: http://stackoverflow.com/q/29648330
tags question: http://stackoverflow.com/q/29559143
tags question: http://stackoverflow.com/q/29591336
tag name: asp.net-mvc
tags question: http://stackoverflow.com/q/29650291
tags question: http://stackoverflow.com/q/29532304
tags question: http://stackoverflow.com/q/29560711
tags question: http://stackoverflow.com/q/29663559
tags question: http://stackoverflow.com/q/29598213
tags question: http://stackoverflow.com/q/29531727
tags question: http://stackoverflow.com/q/29552955
tags question: http://stackoverflow.com/q/29562882
tags question: http://stackoverflow.com/q/29662690
tags question: http://stackoverflow.com/q/29674447
tags question: http://stackoverflow.com/q/29648760
tags question: http://stackoverflow.com/q/29678198
tags question: http://stackoverflow.com/q/29604626
tags question: http://stackoverflow.com/q/29674393
tags question: http://stackoverflow.com/q/29658443
tags question: http://stackoverflow.com/q/29645836
tags question: http://stackoverflow.com/q/29558533
tags question: http://stackoverflow.com/q/29553692
tags question: http://stackoverflow.com/q/29665484
tags question: http://stackoverflow.com/q/29635613
tags question: http://stackoverflow.com/q/29633248
type: Tag
tags question: http://stackoverflow.com/q/29652224
tags question: http://stackoverflow.com/q/29530235
tags question: http://stackoverflow.com/q/29643363
tags question: http://stackoverflow.com/q/29588492
tags question: http://stackoverflow.com/q/29643479
tags question: http://stackoverflow.com/q/29631019
tags question: http://stackoverflow.com/q/29631453
tags question: http://stackoverflow.com/q/29669879
tags question: http://stackoverflow.com/q/29564353
tags question: http://stackoverflow.com/q/29673313
tags question: http://stackoverflow.com/q/29608893

http://stackoverflow.com/q/29578186
has answer: http://stackoverflow.com/a/29578275
upvote count: 1
type: Question
has title: Use Javascript to write src attribute as data-src, as page is loading
tagged with: javascript
has answer: http://stackoverflow.com/a/29593215
answer count: 3
tagged with: user-agent
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/29580815
has body: Background: Back in December I wanted my (custom) PHP page-building engine to build a page one-way if the User Agent (UA) could handle Javascript and a different way if the UA could not. To achieve this, I needed to learn: How to detect UA Javascript capability via PHP, prior to PHP building the page on-the-fly: Detecting javascript in PHP, before PHP builds page Thanks to some very helpful guidance from @skobaljic, @Abhi Beckert and @GolezTrol, I learned that we can use Javascript to place a session cookie which PHP will be able to query on all subsequent page loads. Consequently, for every page after the first one, PHP will know whether the UA is Javascript-capable or not So far, so good. Now I have reached the stage where I am no longer building pages with PHP on-the-fly but pre-generating them and uploading them to the server as static HTML documents. If you're still with me, you'll have guessed correctly this means I am currently needing to pre-generate two static documents for each page - one for the non-JS-capable UAs and one for the JS-capable UAs. This isn't really ideal, hence my question below. On the face of it, this looks like it ought to be a straightforward problem. For Javascript-non-capable UAs, I want to build a document which contains lines like this: &lt;img src="/myfolder/myimage.png" alt="My Image" /&gt; For Javascript capable UAs, I want to build the same document which contains lines like this: &lt;img data-src="/myfolder/myimage.png" alt="My Image" /&gt; (for those who are curious, a javascript after onload converts all the data-src properties into src properties, following which many tens of server round-trips ensue but - crucially - only after the page has already substantially loaded). I have already achieved this via PHP and a session cookie (see Background above), but now, if it's possible, I want to execute the whole thing on the front-end. How can I write an attribute into the &lt;img /&gt; elements in the DOM as src by default but, a…
favorite count: 0
linked to: http://stackoverflow.com/q/27412949
accepted answer: http://stackoverflow.com/a/29593215
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29578275

http://stackoverflow.com/q/29632496
tagged with: jquery
has answer: http://stackoverflow.com/a/29632855
accepted answer: http://stackoverflow.com/a/29632855
has comment: http://stackoverflow.com/comment/47407957
has comment: http://stackoverflow.com/comment/47408555
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/29632893
tagged with: css
has answer: http://stackoverflow.com/a/29632893
type: AnsweredQuestion
has title: Advice on better way to program jquery animation
type: Question
tagged with: javascript
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/47407853
has body: I have a list of social icons that when hovered over increase in width to reveal more content while the rest decrease width to keep the overall ul width the same. I was wondering if someone could tell me if the way I did is good or if there is a better way of doing it. I am still trying to learn jquery and its best practices. Also everything seems to be working well except the last list item will drop down occasionally. I'm thinking it has something to do with the hovered items width increasing at a different rate than the other items decreasing. Here is what I have (note only facebook has content associate with it at the moment): $(function() { $('.social-container &gt; li').on({ mouseenter: function () { $('.social-container &gt; li').stop().animate({'width':'16%'},400); $(this).stop().animate({'width':'50%'},400).queue(function(){ $(this).find(".icon-placeholder").hide(); $(this).find(".icon-link").stop().fadeIn("slow").show(); $(this).dequeue(); }); }, mouseleave: function () { $('.social-container &gt; li').stop().animate({'width':'25%'},400); $(this).stop().animate({'width':'25%'},400); $(this).find(".icon-link").stop().fadeOut("slow").hide(); $(this).find(".icon-placeholder").show(); } }); }); https://jsfiddle.net/jfunchio/uuwdr5Ly/1/

http://stackoverflow.com/comment/47365101
has text: Thanks! That helped. Now I have a different problem (I'm getting a stack trace). I guess I'll make a different post and reference this URL).
type: AnswerComment
comment on: http://stackoverflow.com/a/29598511
score: 0
type: Comment

http://stackoverflow.com/q/29587769
has comment: http://stackoverflow.com/comment/49775591
type: Question
has answer: http://stackoverflow.com/a/29587850
has answer: http://stackoverflow.com/a/29587896
has comment: http://stackoverflow.com/comment/49771133
has answer: http://stackoverflow.com/a/30813397
linked to: http://stackoverflow.com/q/16510973
tagged with: javascript
has answer: http://stackoverflow.com/a/30848358
answer count: 16
has comment: http://stackoverflow.com/comment/49875477
has answer: http://stackoverflow.com/a/30883172
has answer: http://stackoverflow.com/a/30812362
downvote count: 1
has body: I'm performing a small text with JavaScript with the getElementsByClassName() and I am getting some unwanted results. I would like the script to change each CSS class to a new class. The issue is that every other class is only changing... I would like to use pure js how this issue as it is for practice purposes. The first thing that came to mind was white spaces, although when removing the this did not make any differnce. Can anyone point our what I am doing wrong? BLOCK1 BLOCK2 BLOCK3 BLOCK4 BLOCK5 BLOCK6 BLOCK7 BLOCK8 CSS Classes: .block-default { width: 100px; height:50px; background-color: green; border: 1px solid red; padding:10px; } .block-selected { width: 100px; height:50px; background-color: blue; border: 1px solid white; padding:10px; }
linked to: http://stackoverflow.com/q/16777885
favorite count: 0
has answer: http://stackoverflow.com/a/30867406
has answer: http://stackoverflow.com/a/30823343
has answer: http://stackoverflow.com/a/30849892
type: UnansweredQuestion
upvote count: 26
has answer: http://stackoverflow.com/a/29587849
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/26479289
has answer: http://stackoverflow.com/a/30812521
has title: className only changing every other class
tagged with: css
has answer: http://stackoverflow.com/a/30816417
score: 25
linked to: http://stackoverflow.com/q/5187918
has comment: http://stackoverflow.com/comment/49788680
has comment: http://stackoverflow.com/comment/49701582
has answer: http://stackoverflow.com/a/30812259
linked to: http://stackoverflow.com/q/16335527
has answer: http://stackoverflow.com/a/30864330
has answer: http://stackoverflow.com/a/73153005
has answer: http://stackoverflow.com/a/29587882

http://stackoverflow.com/a/29707836
upvote count: 3
score: 3
downvote count: 0
answers question: http://stackoverflow.com/q/29684811
type: Answer
has body: If you go through these tutorials I hope they would make it clear that a perspective matrix only goes so far. There's still a divide by w that happens before you arrive at clipspace. So if the original world -> clip space is tempPoint = projectionMatrix * viewMatrix * worldSpacePoint clipSpacePoint = tempPoint / tempPoint.w Then to go backward it's tempPoint = clipSpacePoint * tempPoint.w worldSpacePoint = inverse(projectMatrix * viewMatrix) * tempPoint We know from the projectMatrix that tempPoint.w will be zNear when it's at the near plane of the frustum and zFar when it's at the far plane. So go backward from the mouse to 3D first you have to convert the mouse to clipspace (-1 + 1). Assuming you have canvas relative mouse coordinates clipX = mouseX / gl.canvas.clientWidth * 2 - 1; clipY = mouseY / gl.canvas.clientHeight * -2 + 1; // because GL is 0 at bottom clipZ = -1 (for close) +1 for (far) So clipNear = [clipX, clipY, -1, 1]; clipFar = [clipX, clipY, 1, 1]; Now you need to multiply by zNear or zFar. We could have done that in the first step tempNear = [clipX * zNear, clipY * zNear, -zNear, zNear]; tempFar = [clipX * zFar , clipY * zFar , zFar , zFar]; Or we could use some function. As far as I can tell J3DImath doesn't have a function we can use to do that. Now you're back to the value just after the perspective matrix was applied so you can finally multiply by the inverse perspective or the inverse viewPerspective if you have a camera, as in if you're not viewing from 0,0,0. Unfortunately, as far as I can tell, J3DIMath doesn't have a function to do this. The only function I see is J3DIVector3.prototype.multVecMatrix but looking at the source that function assumes w will be 1 but we can see above w is not 1. So, I'd recommend using another math library. In the meantime this code should work. function multVec4J3DIMatrix function(vec4, matrix) { var x = vec4[0]; var y = vec4[1]; var z = vec4[2]; var w = vec4[3]; var m = matrix.$matrix; return [ x * m.m11 + y *…

http://stackoverflow.com/comment/47384709
has text: Why are you using jquery.js and jquery-latest.js? Use only one and rating.js should be after jquery file.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29620279
type: Comment

http://stackoverflow.com/comment/47433520
score: 0
type: Comment
type: QuestionComment
has text: @Sacho: doesn't unbind.I'm not getting any errors either.
comment on: http://stackoverflow.com/q/29646427

http://stackoverflow.com/comment/47264003
score: 0
type: Comment
has text: It is not working, if we put in table ( in two rows)
type: AnswerComment
comment on: http://stackoverflow.com/a/29555103

http://stackoverflow.com/comment/47413023
score: 0
comment on: http://stackoverflow.com/q/29635282
type: Comment
type: QuestionComment
has text: i think they just meant to spell it out for clarity; js is not like php where you need to assign vars to somethings in order to use it because expressions (including assignments) are leaky in JS.

http://stackoverflow.com/a/29683721
type: Answer
upvote count: 1
score: 1
has body: This will fail. You need to send the mail in another method, don't use: header("location: mailto:mail@domain.com" ); Try something like: if(isset($_POST['submit'])) { mail("mail@domain.com", "Form Posted Response data", print_r($_POST)); mysql_query("UPDATE bla bla bla"); header("location: index.php....." ); }; And as always Do Not Use MySQL - it is no longer supported. Switch to MySQLi or PDO and start using Prepared Statements to protect from Injection.
answers question: http://stackoverflow.com/q/29674846
downvote count: 0

http://stackoverflow.com/a/29650351
score: 0
has comment: http://stackoverflow.com/comment/47485116
type: Answer
has comment: http://stackoverflow.com/comment/47446683
has body: have you tried: query.include("User"); query.equalTo("User", currentUser);
has comment: http://stackoverflow.com/comment/47440862
answers question: http://stackoverflow.com/q/29650197

http://stackoverflow.com/q/29566595
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: ruby-on-rails
score: 1
has title: Rails with 3 Cascading Drop Down List
tagged with: cascading
type: Question
has body: I have 3 cascading drop down lists named; Country, City and District. The relation between them is the following; #country.rb class Country &lt; ActiveRecord::Base has_many :cities has_many :districts, :through =&gt; :cities end #city.rb class City &lt; ActiveRecord::Base belongs_to :country has_many :districts end #district.rb class District &lt; ActiveRecord::Base belongs_to :city end I have a problem that, when I choose Country and City at the network tab of chrome response seems correct but the list does not renew it self. Here is what it looks like; So I select France - Nice but the last drop down has to show 5,6,7,8 instead of 1,2,3,4. However, at the response tab it seems fine; But whatever the city or country I select response is fine but it does not show at the drop down list. Here is my controller; class WelcomeController &lt; ApplicationController def index @countries = Country.all @cities = City.where("country_id = ?", Country.first.id) @districts = District.where("city_id = ?", City.first.id) end def show @city = City.find_by("id = ?", params[:trip][:city_id]) @district = District.find_by("id = ?", params[:trip][:district_id]) end def update_cities @cities = City.where("country_id = ?", params[:country_id]) respond_to do |format| format.js end end def update_districts @districts = District.where("city_id = ?", params[:city_id]) respond_to do |format| format.js end end end Here is the index.html file; &lt;%= form_for :trip, url: {action: "show"}, html: {method: "get"} do |f| %&gt; &lt;%= f.select :country_id, options_for_select(@countries.collect { |country| [country.name.titleize, country.id] }, 1), {}, { id: 'countries_select' } %&gt; &lt;%= f.select :city_id, options_for_select(@cities.collect { |city| [city.name.titleize, city.id] }, 0), {}, { id: 'cities_select' } %&gt; &lt;%= f.select :district_id, options_for_select(@districts.collect { |district| [district.name.titleize, district.id] }, 0), {}, { id: 'district_select' } %&gt; &lt;%= f.submit "Go!…
downvote count: 0
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/29543506
score: 0
type: AcceptedAnswer
has body: The best and most compatible way to include JS to a web page is to save it to a .js file and to include it in the html page with: If you really want it to be in the same page, remove the src property and put the code between the script tags, but you might have problems since you'll have the < and > symbols in your JS code, which aren't allowed in xml, so this won't be valid xhtml. In any case, this code you have uses the JQuery library, so you'll need to import it before you do anything. In your , put: Make sure you import it before your own code. Finally, you need to make sure the page has loaded before executing code on its content. You can do that in JQuery with the $ shortcut: $(function() { // code goes here }); So your whole page should look like: Title goes here
answers question: http://stackoverflow.com/q/29543303
accepted answer of: http://stackoverflow.com/q/29543303
type: Answer

http://stackoverflow.com/q/29623225
has title: JavaScript dependent drop down list
has comment: http://stackoverflow.com/comment/47393028
score: 7
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47393032
has comment: http://stackoverflow.com/comment/47390710
upvote count: 7
has comment: http://stackoverflow.com/comment/47435744
has comment: http://stackoverflow.com/comment/47391869
has answer: http://stackoverflow.com/a/29624809
has body: How do you make a dependent drop down list with JavaScript? I need first category list to trigger other 2 (or more) categories to show up with lists that depends on what was your selection on first category. Is that possible? Here's my code : function dropdownlist(listindex) { document.formname.category2.options.length = 0; switch (listindex) { case "Home Ware" : document.formname.category2.options[0]=new Option("Select Category2",""); document.formname.category2.options[1]=new Option("Air-Conditioners/Coolers","Air-Conditioners/Coolers"); document.formname.category2.options[2]=new Option("Audio/Video","Audio/Video"); document.formname.category2.options[3]=new Option("Beddings","Beddings"); document.formname.category2.options[4]=new Option("Camera","Camera"); document.formname.category2.options[5]=new Option("Cell Phones","Cell Phones"); break; case "Education" : document.formname.category2.options[0]=new Option("Select Category2",""); document.formname.category2.options[1]=new Option("Colleges","Colleges"); document.formname.category2.options[2]=new Option("Institutes","Institutes"); document.formname.category2.options[3]=new Option("Schools","Schools"); document.formname.category2.options[4]=new Option("Tuitions","Tuitions"); document.formname.category2.options[5]=new Option("Universities","Universities"); break; case "Books" : document.formname.category2.options[0]=new Option("Select Category2",""); document.formname.category2.options[1]=new Option("College Books","College Books"); document.formname.category2.options[2]=new Option("Engineering","Engineering"); document.formname.category2.options[3]=new Option("Magazines","Magazines"); document.formname.category2.options[4]=new Option("Medicine","Medicine"); document.formname.category2.options[5]=new Option("References","References"); break; } return true; } Html : Category1 : Select Category1 Home Ware Education Books Category2 : Select Category2 I believe it is not possible to create a third list that would be t…
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47390297
has comment: http://stackoverflow.com/comment/47398635
has comment: http://stackoverflow.com/comment/47391861
has answer: http://stackoverflow.com/a/29623625
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/47278595
comment on: http://stackoverflow.com/q/29551630
type: QuestionComment
type: Comment
has text: The GeoJSON points in the error messages and posted in your question both index fine for me. What version of MongoDB are you using? Can you post a minimal example that fails for you?
score: 0

http://stackoverflow.com/q/29566417
has comment: http://stackoverflow.com/comment/47283378
tagged with: jquery
has body: Upon clicking an element, x-editable creates an input element. Within the validate callback, how can I access that element? I "could" do so by assigning a unique class using inputclass to each time the plugin is applied to an element, however, this offers very little flexibility. Within the call back, this references the original element, not the input element. https://jsfiddle.net/cgym6m3v/1/ Name $('#name').editable({ type: 'text', title: 'Name', url: '/echo/json/', pk: 123, validate: function (value) { console.log(this,value); } });
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47283611
has answer: http://stackoverflow.com/a/29579937
has comment: http://stackoverflow.com/comment/47288054
tagged with: dom
type: Question
has comment: http://stackoverflow.com/comment/47283785
has comment: http://stackoverflow.com/comment/47283179
has comment: http://stackoverflow.com/comment/47283588
tagged with: javascript
has comment: http://stackoverflow.com/comment/47282638
score: 0
has title: Access x-editable dynamically generated form or input
answer count: 1
tagged with: x-editable

http://stackoverflow.com/comment/47250713
type: Comment
has text: JS crazies: http://wtfjs.com/
comment on: http://stackoverflow.com/a/29549070
type: AnswerComment
score: 0

http://stackoverflow.com/q/29671449
downvote count: 0
tagged with: undefined
possible better answer: http://stackoverflow.com/a/29671493
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29671498
type: AnsweredQuestion
score: 1
has body: I'm a new Javascript coder and this is my first question here. I have the following code that: takes each value from the variable named celsius takes that value to the function named calculate and convert it into fahrenheit. the value of the fahrenheit is taken back to the first function and then printed to the first function function calculate() { var celsius = [12, 45, 99, -40]; for (i=0 ; i&lt;celsius.length; i++) { document.write("The value is " + celsius[i] + " and is equal to " + count(celsius[i]) + "&lt;br&gt;") } } function count(num) { var degfarhen = 9/5 * parseFloat(num) + 32; degfarhen = degfarhen.toFixed(1); document.write(degfarhen) } but this happens 53.6The value is 12 and is equal to undefined 113.0The value is 45 and is equal to undefined 210.2The value is 99 and is equal to undefined -40.0The value is -40 and is equal to undefined The value of fahrenheit is printed before the sentence and where it actually have to be printed stays undefined.
has title: The js for-loop code is printed before it is called
upvote count: 1
type: Question
tagged with: for-loop
accepted answer: http://stackoverflow.com/a/29671498
tagged with: function
tagged with: javascript
has answer: http://stackoverflow.com/a/29671493
answer count: 2

http://stackoverflow.com/comment/47464470
comment on: http://stackoverflow.com/a/29659761
has text: No problem, and yeah was just giving a hindsight of a way to approach the problem, glad you improved it ;). Good luck with your proyect
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47357558
comment on: http://stackoverflow.com/q/29605764
score: 0
type: Comment
type: QuestionComment
has text: @Pointy actually I was considering a loop involving the array to splice as index, Siguza's solution involves a loop with chunkEachBy as cycle index, which indeed does not change :)

http://stackoverflow.com/comment/47500347
comment on: http://stackoverflow.com/a/29681001
has text: Yes that's true. Javascript is Prototype oriented and the prototype way is faster. @Minding 's code loops and creates much instances of `tagEditor` classes, so it will re-create all functions over and over again. That is slow. I think the prototype way is better here. I never yet founded an case where I need Classical OOP in javascript.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47379037
comment on: http://stackoverflow.com/a/29616525
type: AnswerComment
score: 0
type: Comment
has text: @Bergi, none of my code is tested and I could easily have made a slip. From memory, `jQuery.map()` differs from `Array.prototype.map()` in that the jQuery version (a) filters out an element on null return, and (b) returns a jQuery-wrapped array (hence the need for .get()).

http://stackoverflow.com/a/29607812
has comment: http://stackoverflow.com/comment/47367791
accepted answer of: http://stackoverflow.com/q/29595804
answers question: http://stackoverflow.com/q/29595804
score: 0
has comment: http://stackoverflow.com/comment/47368455
type: AcceptedAnswer
type: Answer
has body: This code also replaces things like &lt;br class="xyz" /&gt; but doesn't match any other possible XML tags like e.g. &lt;brown&gt;: fields[1] = fields[1].replace(/&lt;br\s*(\s+[^&gt;]+)*[\/]?&gt;/gi, "\r\n"); I tested it against: &lt;br&gt;, &lt;br/&gt;, &lt;br /&gt;, &lt;br class="xyz"&gt;, &lt;br class="xyz" /&gt;

http://stackoverflow.com/q/29671120
tagged with: http://stackoverflow.com/tag/json
has title: Dynamic Pie Chart With Json Data using chart.js
tagged with: javascript
has answer: http://stackoverflow.com/a/29671830
score: 0
answer count: 1
tagged with: jquery
has body: I am creating a piechart using chart.js. I have a json data like [ { "Subcontractor": "C1", "Deficiency": 67 }, { "Subcontractor": "C2", "Deficiency": 25 }, { "Subcontractor": "C3", "Deficiency": 12 }, { "Subcontractor": "C5", "Deficiency": 7 }, { "Subcontractor": "C4", "Deficiency": 5 }, { "Subcontractor": "C6", "Deficiency": 1 } ] I want to use the Subcontractor value as the pie chart label and the Deficiency value as the chart value. How to pass this dynamically into the pie chart in chart.js? Also, when I click on a particular slice I want to reload/refresh the pie chart with different data.
type: UnansweredQuestion
type: Question
tagged with: chart.js

http://stackoverflow.com/comment/47400613
comment on: http://stackoverflow.com/q/29628701
score: 1
has text: well received question!
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47392001
score: 0
type: AnswerComment
has text: the same think : Request method 'DELETE' not supported
type: Comment
comment on: http://stackoverflow.com/a/29623376

http://stackoverflow.com/q/29573481
upvote count: 3
type: Question
type: AnsweredQuestion
score: 3
has title: d3.js scatterplot with different colors and symbols - issues encountered
answer count: 2
has answer: http://stackoverflow.com/a/29584163
downvote count: 0
has body: I am trying to create a scatterplot of hundreds of datapoints, each with about 5 different attributes. The data is loaded from a .csv as an array of objects, each of which looks like this: {hour: "02",yval: "63",foo: "33", goo:"0", bar:"1"}, I want to display the scatterplot with the following attributes: Shape for bar: -circle to represent all points where bar=0, and a triangle-down to represent those where bar=1 (this is a dummy variable). Color for foo and goo: All points start as grey. goo is categorical with values [0,1,2] while foo is quantitative with a range from 0-50. foo and goo are mutually exclusive, so only one of them has a value. In other words, for each data point either foo=0 or goo=0. Points with goo=1 should be orange; points with goo=2 should be red. foo should be mapped onto a linear color scale from light blue to dark blue, ie d3.scale.linear().domain([0, 50]).range(["#87CEFF", "#0000FF"]); I can do each of these individually, but defining everything together is creating issues for me. My code with reproducible data is here: http://jsfiddle.net/qy5ohw0x/3/ Issues For the symbol, i tried .append("svg:path") .attr("d", d3.svg.symbol()) which did not work. I tried a different approach altogether, but this did not map the values correctly: var series = svg.selectAll("g.series") .data(dataSet, function(d, i) { return d.bar; }) .enter() .append("svg:g") series.selectAll("g.point") .data(dataSet) .enter() .append("svg:path") .attr("transform", function(d, i) { return "translate(" + d.hour + "," + d.yval + ")"; }) .attr("d", function(d,i, j) { return d3.svg.symbol().type(symbolType[j])(); }) .attr("r", 2); For the goo colors (grey/orange/red), i mapped the values to the 3 colors manually: First define var colors = ["grey", "orange", "red"]; Then while drawing the data points chain .style("fill", function (d) { return colors[d.type]; }) This worked alone, but not with the different symbols. Finally, can i chain a second color .attr for foo? d3.scale.lin…
tagged with: javascript
favorite count: 0
possible better answer: http://stackoverflow.com/a/29574538
accepted answer: http://stackoverflow.com/a/29584163
has answer: http://stackoverflow.com/a/29574538
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js

http://stackoverflow.com/a/29562101
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47276224
answers question: http://stackoverflow.com/q/29561181
type: Answer
has comment: http://stackoverflow.com/comment/47275942
has comment: http://stackoverflow.com/comment/47275353
has comment: http://stackoverflow.com/comment/47275692
has comment: http://stackoverflow.com/comment/47275825
has comment: http://stackoverflow.com/comment/47276038
has body: The code for the images is incomplete, and had to create my own version to be able to replicate the issue. But once that was done, the problem was easy to find. You can see it working on this JSFiddle: http://jsfiddle.net/Lbrcbhxw/2/ (I took the liberty of cleaning it a bit so it was easier to read). The problem is that .static has a font-size:0 that makes the text invisible. Remove it (or don't wrap the div with the images with it), and the problem will be solved. .static { position: relative; width: 200px; height: 200px; text-align: center; /* font-size: 0; */ border-style: solid; border-width: 1px; border-color: #CCCCB2; border-radius: 5px; } The text version isn't wrapped around that .static, so that's why it was displayed correctly and didn't have the problem.
accepted answer of: http://stackoverflow.com/q/29561181
score: 0

http://stackoverflow.com/comment/47494395
score: 0
type: Comment
has text: Cheers, glad to help out. Accepting the answer would be much appreciated. :-)
comment on: http://stackoverflow.com/a/29674854
type: AnswerComment

http://stackoverflow.com/comment/47489373
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29674388
type: Comment
has text: You are welcome. Maybe you can edit again your post and remove `&` and I will transfer the solution in an answer. So the problem will be visible. As you want

http://stackoverflow.com/q/29558111
type: UnansweredQuestion
has body: I am having a problem with passing a cookie while trying to make subsequent requests with AJAX to my Spring MVC controller. For e.g. I have a /login endpoint to which I pass some JSON via POST method and it sets the cookie. I see the cookie in the firebug: As you can see it is there. I am creating a cookie like this: NewCookie cookie = new NewCookie(new Cookie(SECURITY_TICKET, encodedTicket, configKey, null), null, (int) TimeUnit.MINUTES.toSeconds(expireTime), expireTimeDate, false, false) And setting it to HTTP headers: httpHeaders.add(HttpHeaders.SET_COOKIE, cookie.toString()); Then these headers are being added to ResponseEntity like this: ResponseEntity entity = new ResponseEntity&lt;&gt;(this.entity, this.httpHeaders, this.status) And this response entity is returned. My conroller's methods are all REST based. So then I am trying to call the other (/search) endpoint after successful login which functionality is expecting the cookie and it obviosly fails because for some reason cookie is not being passed back. My AJAX calls looks like this: $(function () { $.ajax({ url: 'http://localhost:8080/dev-citigroup-citi/login', type: 'POST', dataType: 'json', data: '{ "username": "client1", "password": "*******", "platform": "iOS", "UUID": "321321321", "application": "CitiReach", "applicationVersion": "1.0" }', success: function (data, status, xhr) { $.ajax({ url: 'http://localhost:8080/dev-citigroup-citi/search/eventattendee?q=*:*&amp;start=0&amp;rows=1&amp;wt=json&amp;indent=true', type: 'GET', xhrFields: { withCredentials:true }, success: function (data, status, xhr) { console.log(data); }, error: function (jqXHR) { console.log(jqXHR); } }); }, error: function (jqXHR) { console.log(jqXHR); } }); }); As I mentioned the /login is OK but the other call fails. I am adding xhrFields: { withCredentials:true } which should be including the cookie in the /search request but for some reason it is not. I also have CORS being set up correctly: Access-Control-Allow-Origin: http:/…
tagged with: spring-mvc
score: 2
tagged with: java
type: Question
upvote count: 2
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: ajax
has title: Cookie not being passed on subsequent requests
tagged with: rest
has answer: http://stackoverflow.com/a/29559596
favorite count: 0

http://stackoverflow.com/q/29600079
tagged with: javascript
type: UnansweredQuestion
tagged with: google-maps-api-3
tagged with: google-maps
downvote count: 0
tagged with: angular-ui
score: 1
has title: unable to initiate angular-google-maps
favorite count: 0
tagged with: angularjs
type: Question
has body: i'm trying to initiate google map by using angular-google-maps however, i'm having these errors, although i have followed the guide on the quickstart page so i google the error but i got nothing, but i saw some similar issues and it caused by AdBlock, so i use an incognito windows to test again,these errors are gone but the google map still not on my app here's my full code master.html(contain all the src) app.js[angular.js] var app = angular.module('app',['ngMaterial','ngSanitize','ngAnimate','satellizer','ngResource','ui.router','ngMessages','angular-loading-bar','uiGmapgoogle-maps']). config(['$stateProvider','$urlRouterProvider','$authProvider','$locationProvider','$mdThemingProvider','cfpLoadingBarProvider','uiGmapGoogleMapApiProvider', function($stateProvider,$urlRouterProvider,$authProvider,$locationProvider,$mdThemingProvider, cfpLoadingBarProvider, uiGmapGoogleMapApiProvider) { uiGmapGoogleMapApiProvider.configure({ // key: 'your api key', v: '3.17', libraries: 'weather,geometry,visualization' }); $stateProvider .state('home', { url: '/', templateUrl: '/static/views/index.html', controller: 'IndexCtrl' }) . . . controller.js[angular.js] angular.module('app').controller('IndexCtrl', [ '$scope', '$http', '$rootScope', '$auth', 'Account', 'uiGmapGoogleMapApi', function ($scope, $http, $rootScope,$auth,Account,uiGmapGoogleMapApi) { uiGmapGoogleMapApi.then(function(maps) { $scope.map = { center: { latitude: 45, longitude: -73 }, zoom: 8 }; }); } ]); index.html {{map.center}} the {{map.center}} is able to display but not the map.
has answer: http://stackoverflow.com/a/29617839
answer count: 3
upvote count: 1
has comment: http://stackoverflow.com/comment/47367947
has comment: http://stackoverflow.com/comment/47359959
has answer: http://stackoverflow.com/a/29634220
has comment: http://stackoverflow.com/comment/57026921
has answer: http://stackoverflow.com/a/29602716

http://stackoverflow.com/comment/100454415
type: AnswerComment
comment on: http://stackoverflow.com/a/29544442
type: Comment
has text: If you're going to use `reduce` then you should use the full capabilities of it. `array.reduce((all, one, _, src) => all += one / src.length, 0)`
score: 7

http://stackoverflow.com/q/29543563
downvote count: 0
has comment: http://stackoverflow.com/comment/47239492
favorite count: 0
accepted answer: http://stackoverflow.com/a/29544269
has body: Now I'm making my own chat system, thing (practice). Everything is working bar one bit. When I enter a new message, ever message in the database is added again instead of just updating the existing log. For example the log: 9th-Apr dunkirk: come a bit closer 16:57 Then I'll add another message saying TOO FAR! and it will update, but it'll repeat such like: 9th-Apr dunkirk: come a bit closer 16:57 9th-Apr dunkirk: come a bit closer 16:57 &lt;--repeating everything again 9th-Apr dunkirk: TOO FAR! 16:58 There's a fair amount of code so I'll only include the offending piece (as far as I can see): function updateMessages(){ if (xmlhttp.readyState==4) { if (xmlhttp.status==200) { try{ xmlText = xmlhttp.responseXML; messages = xmlText.getElementsByTagName('messages'); for (var i = 0; i &lt; messages.length; i++) { time = '&lt;td&gt;'+messages[i].getElementsByTagName('time')[0].innerHTML+'&lt;/td&gt;'; date = '&lt;td&gt;'+messages[i].getElementsByTagName('date')[0].innerHTML+'&lt;/td&gt;'; username = '&lt;td&gt;'+messages[i].getElementsByTagName('username')[0].innerHTML+'&lt;/td&gt;'; message = '&lt;td&gt;'+messages[i].getElementsByTagName('message')[0].innerHTML+'&lt;/td&gt;'; text = date+username+message+time; tr = document.createElement('tr'); tr.innerHTML = text; document.getElementById('chatMessages').appendChild(tr); }; }catch(e){ console.log(e); } } }; } I'd like it to show all messages, without repeating, but still updating when a new message is met, like most chats. I had a similar issue before with the registration system which I fixed with a while loop, but that fix didn't seem to work in this instance. Said previous fix was: while (update.firstChild) { update.removeChild(update.firstChild); } Checking if the parent had a child, if not continue, if so, delete the child. I'm sure the solution is incredibly simple regarding the initial text creation, but as you can likely tell I'm fairly new to this.
has title: Ajax chat messages repeating rather than just updating
upvote count: 1
possible better answer: http://stackoverflow.com/a/29544045
has answer: http://stackoverflow.com/a/29544045
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47239127
score: 1
has comment: http://stackoverflow.com/comment/47239370
tagged with: chat
type: Question
has answer: http://stackoverflow.com/a/29544269
tagged with: javascript
tagged with: ajax
has comment: http://stackoverflow.com/comment/47239480
answer count: 2

http://stackoverflow.com/comment/47416546
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29608428
has text: Hi @Ale I think your solution would work but unfortunately I can't edit the html of the submit button. It's generated by a part on our CMS. I'll try it in Developer anyway and if it works will script it in somehow.
score: 0

http://stackoverflow.com/q/29638606
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47419413
has body: How do I not accomplish very simply functionality which should of been included in the core by NOT RENDERING what is inside of tags. This is parsed by wordpress. ok to parse this:
tagged with: wordpress
type: Question
has comment: http://stackoverflow.com/comment/47419391
tagged with: javascript
has title: Wordpress javascript in post
has answer: http://stackoverflow.com/a/29639187
score: 0
has comment: http://stackoverflow.com/comment/47419618
answer count: 1

http://stackoverflow.com/q/29683488
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29684443
tagged with: notifications
answer count: 3
has answer: http://stackoverflow.com/a/29683789
has body: On my site I have an important notification that prompts a native alert() in order to bring the site to the foreground if the window is not already focused. The problem is that on some browsers, if the user is in another desktop application (Photoshop, Microsoft Word, etc), it will not bring the browser on top of that application. In this case the alert is pretty much useless and I would like to omit it (since it blocks the other scripts on my page). Is there a way to tell that a browser is the active application on a device? Or is there a different, non-blocking way to bring a window to the foreground? Thanks! Clarifications: I already know how to check if a window is active within a browser, but I just don't know how to check if the browser application itself is active. Also, browsers I need to support are Chrome, Safari, Firefox, and IE >= 9
favorite count: 0
possible better answer: http://stackoverflow.com/a/29683789
score: 5
upvote count: 6
type: AnsweredQuestion
downvote count: 1
has answer: http://stackoverflow.com/a/29683653
linked to: http://stackoverflow.com/q/3479734
type: Question
tagged with: browser
has answer: http://stackoverflow.com/a/29684443
has title: Is there a way to tell if a browser is active?

state
tag name: state
tags question: http://stackoverflow.com/q/29537299
tags question: http://stackoverflow.com/q/29633441
type: Tag

jsp
tags question: http://stackoverflow.com/q/29685927
tags question: http://stackoverflow.com/q/29542399
tags question: http://stackoverflow.com/q/29686976
tags question: http://stackoverflow.com/q/29643688
tags question: http://stackoverflow.com/q/29546366
tags question: http://stackoverflow.com/q/29600009
tags question: http://stackoverflow.com/q/29641422
tags question: http://stackoverflow.com/q/29556843
tags question: http://stackoverflow.com/q/29675174
tags question: http://stackoverflow.com/q/29607013
tags question: http://stackoverflow.com/q/29532579
tags question: http://stackoverflow.com/q/29614318
tags question: http://stackoverflow.com/q/29577278
tags question: http://stackoverflow.com/q/29582959
tags question: http://stackoverflow.com/q/29643023
tags question: http://stackoverflow.com/q/29659106
type: Tag
tags question: http://stackoverflow.com/q/29574854
tags question: http://stackoverflow.com/q/29626007
tags question: http://stackoverflow.com/q/29625171
tags question: http://stackoverflow.com/q/29598775
tags question: http://stackoverflow.com/q/29554224
tags question: http://stackoverflow.com/q/29621575
tags question: http://stackoverflow.com/q/29681415
tag name: jsp
tags question: http://stackoverflow.com/q/29599999
tags question: http://stackoverflow.com/q/29674779
tags question: http://stackoverflow.com/q/29620279
tags question: http://stackoverflow.com/q/29601925
tags question: http://stackoverflow.com/q/29619906
tags question: http://stackoverflow.com/q/29569775
tags question: http://stackoverflow.com/q/29552703
tags question: http://stackoverflow.com/q/29663461
tags question: http://stackoverflow.com/q/29569109
tags question: http://stackoverflow.com/q/29544464
tags question: http://stackoverflow.com/q/29672038
tags question: http://stackoverflow.com/q/29530989

http://stackoverflow.com/q/29577389
has title: handle the form data using node.js
tagged with: javascript
has answer: http://stackoverflow.com/a/29579481
tagged with: express
has body: Here is my simple form.html : Email password Here is my express node.js code app.js: app.post('/form', passport.authenticate('local-login', { failureFlash: true // allow flash messages }), function (req, res) { console.log("hello"); if (req.body.remember) { req.session.cookie.maxAge = 1000 * 60 * 3; } else { req.session.cookie.expires = false; } res.redirect('/'); }); When I wrote app.js path "our-project/app.js" in the action attribute and submited the form there is no any response. the form.html path "our-project/form/form.html"
tagged with: passport-local
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/29579481
answer count: 1
tagged with: node.js
score: 0
has comment: http://stackoverflow.com/comment/47304380

http://stackoverflow.com/a/29673811
downvote count: 0
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/29672131
has body: There are 2 possible option either if you are using jquery then it will be easier. Let's see first jQuery's solution Apply class="category" to all the element which you want to manipulate dynamically. put value in html want to show like data-show="nextCategory1" apply css .category{ display:none; } Put this JS function $('#parentCategory input').on('click',function(e){ $('.category').hide(); $('#'+$(this).data('show')).show(); }); View Fiddle Now Let's see Javascript solution which is also bit of simillar function showNextCat(id) { var item = document.getElementById(id); var elem = document.querySelectorAll(".category") var i; for (i = 0; i &lt; elem.length; i++) { elem[i].style.display='none'; } item.style.display='block'; } View Fiddle2

http://stackoverflow.com/q/29622642
has answer: http://stackoverflow.com/a/29624875
type: Question
has answer: http://stackoverflow.com/a/29623076
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29623064
score: 0
has answer: http://stackoverflow.com/a/29622904
has comment: http://stackoverflow.com/comment/47389373
tagged with: css
linked to: http://stackoverflow.com/q/5047498
has comment: http://stackoverflow.com/comment/47389487
has body: I've found this nice animating progress bar tutorial: http://www.cssflow.com/snippets/animated-progress-bar/demo However the progress bar doesn't use jquery and the tutorial doesn't tell you how to link multiple buttons to the progressbar. So after searching I found this tutorial: http://www.jcode.ninja/id/8561710 I've simply used the code in the tutorial above for now just to see if i can get it working. My question is how do you animate the progress in the same way as the first tutorial? Is it possible to apply a gradient starting with green then fading to orange then fading into red. I can do this in photoshop, which isnt a problem but can you add it as a progressbar "skin" rather than the default grey? Thanks in advance
answer count: 5
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29623004
has title: Animating jQuery progress bar

http://stackoverflow.com/comment/47356846
comment on: http://stackoverflow.com/q/29605402
score: 0
type: Comment
type: QuestionComment
has text: Just render it over and over with different values and update it. EJS doesn't do 2 way bindings or anything like that.

http://stackoverflow.com/comment/47265466
score: 0
type: Comment
type: QuestionComment
has text: i can set the data, no problem with that. But how do i change the other fields? 'setName' per se ?
comment on: http://stackoverflow.com/q/29549969

http://stackoverflow.com/q/29535147
has title: How do I take the values of a Radio Button to a new page, after i have checked if they are correct?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29535295
has body: I am making a questionnaire and am not brilliant with JS. I want to take the results of the radio buttons which have been marked, so either True or False, and then show them on another page. I have the questions in a form. CODE: 1 How many clicks do developers use to keep the user close to information? 1 4 3 6 How are developers using the 404 Error Page, for keep the users happy? Including links displaying a video playing music Should you rely on colour alone in a website build? Yes No A H2 Tag is useful for? The disabled autoreaders Pretty webpages What is correct name given to page of the websites pages? Tube Map Site Map Map Page List A webpage heading should do what? Tell the user about the content in a few words include meaningless text Be short The Alt tag is used for what.... Would you use this website again for information? Yes No send
score: 0
type: Question
tagged with: javascript
tagged with: forms
has comment: http://stackoverflow.com/comment/47280479
tagged with: function
tagged with: arrays
answer count: 1

http://stackoverflow.com/q/29684658
has answer: http://stackoverflow.com/a/40736574
has comment: http://stackoverflow.com/comment/47507354
tagged with: routes
answer count: 2
has comment: http://stackoverflow.com/comment/47507334
downvote count: 0
favorite count: 0
tagged with: angularjs
upvote count: 2
has answer: http://stackoverflow.com/a/29685308
score: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29685308
tagged with: ionic-framework
type: Question
has body: I'm building an app with Ionic and AngularJS. Now I have a page with a list of items. Each item has an ID, and so a click results in something like this: /item/1 or /item/2 where 1 and 2 are ID's. Now I have the default state like this, for the homepage with this list: .state('app.home', { url: "/home/", views: { 'menuContent': { templateUrl: "app/home.html" }, }, controller: 'HomeCtrl' }) What I want is to pass the paramater to the controller. What I found is the following solution, but this isn't working. The reason is that it doesn't know which controller to use (in above example, HomeCtrl is specified.). .state('app.item', { url: "/item/:id", views: { 'menuContent': { templateUrl: "app/item.html" }, }, controller: function($scope, $stateParams) { $scope.id = $stateParams.id; } }) As you can see controller now has a function, but where do I specify the actual controller to use? Also, is this the right way or is there a better/easier way?
possible better answer: http://stackoverflow.com/a/40736574
has title: Angular stateParams to controller, $urlRouterProvider
tagged with: javascript

http://stackoverflow.com/a/29600773
upvote count: 2
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/47351100
answers question: http://stackoverflow.com/q/29600659
has comment: http://stackoverflow.com/comment/47350986
has comment: http://stackoverflow.com/comment/47350358
downvote count: 0
has body: Actually there's a difference between new Date() and 1 * new Date(): new Date() returns the date object and 1 * new Date() returns the timestamp in milliseconds. Try them out! var date = 1 * new Date(); var date2 = new Date(); alert("milliseconds: " + date + " and object: " + date2); So I wouldn't remove the 1 *, because it seems GA uses that millisecond timestamp. Leave it as it is.
has comment: http://stackoverflow.com/comment/47347692

http://stackoverflow.com/comment/47449040
type: Comment
has text: @Karl-André Gagnon: Added your suggestion (and the reason I got into that habit - smaller minified code).
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29654376

http://stackoverflow.com/comment/47364114
has text: You'd have to convert the image on the serverside if it's coming from an online source that doesn't support CORS.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29606961

http://stackoverflow.com/a/29674775
upvote count: 2
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/29674704
answers question: http://stackoverflow.com/q/29674704
has body: Use each() : demo _anim.each(function(){ $(this).transition({ x: 40}, 1000) .transition({ y: 40}, 1000) .transition({ x: 0}, 1000) .transition({ y: 0}, 1000); });
has comment: http://stackoverflow.com/comment/47490594
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/29685704
downvote count: 0
has comment: http://stackoverflow.com/comment/47508740
favorite count: 0
accepted answer: http://stackoverflow.com/a/29686412
possible better answer: http://stackoverflow.com/a/29685901
has answer: http://stackoverflow.com/a/29685901
tagged with: http-redirect
has title: php rows with each row having a button that I want redirect to external page
has comment: http://stackoverflow.com/comment/47508912
tagged with: php
answer count: 4
type: AnsweredQuestion
score: 1
has body: I have displayed 4 rows of a table (gids) from phpmyadmin. Now I have added for each row a button, I want to redirect each button to an external page (book.php). Now when I use the classname "data" in javascript to try to redirect to book.php, this doesn't work for all 4 buttons. What should I change so these buttons work for each row? <?php if(isset($_SESSION['FBID'])){ // Create connection $conn = new mysqli("localhost", "root", "root", "phpproject"); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "SELECT gids_voornaam, gids_naam, gids_bio, gids_richting, gids_jaar, gids_stad FROM gids"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { echo ' '. " ".' '. " "."voornaam: ".$row["gids_voornaam"]. " ". "Achternaam: ". $row["gids_naam"]. " ". "Richting: ". $row["gids_richting"]. " ". "Jaar: ". $row["gids_jaar"]. " ". "Biografie: " . $row["gids_bio"]. " "." ".' boekingsdata '. ' '; } } else { echo "0 results"; } $conn->close(); } ?>
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29686412
has comment: http://stackoverflow.com/comment/47508727
tagged with: javascript
tagged with: rows
has answer: http://stackoverflow.com/a/29685970
has answer: http://stackoverflow.com/a/29685917
has comment: http://stackoverflow.com/comment/47508785

http://stackoverflow.com/a/29608271
type: Answer
score: 0
answers question: http://stackoverflow.com/q/29608071
has body: It's because the default dialog header has a background image. Try changing it to the following code: $(".ui-dialog-title").css("background", "green"); $(".ui-dialog-titlebar").css({"background": "green", "border": "none"}); See this fiddle: http://jsfiddle.net/dEvKb/3258/

http://stackoverflow.com/a/29648479
has comment: http://stackoverflow.com/comment/47471297
has body: Using jQuery You can compare the two arrays using jQuery: // example arrays: var firstArray = [ 1, 2, 3, 4, 5 ]; var secondArray = [ 5, 4, 3, 2, 1 ]; // compare arrays: var isSameSet = function( arr1, arr2 ) { return $( arr1 ).not( arr2 ).length === 0 &amp;&amp; $( arr2 ).not( arr1 ).length === 0; } // get comparison result as boolean: var result = isSameSet( firstArray, secondArray ); Here is a JsFiddle Demo See this question helpful answer
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29648234
type: Answer
answers question: http://stackoverflow.com/q/29648234
has comment: http://stackoverflow.com/comment/69374060
has comment: http://stackoverflow.com/comment/47467638
score: 6
upvote count: 7
downvote count: 1
has comment: http://stackoverflow.com/comment/47478026

http://stackoverflow.com/q/29598160
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/29598225
has comment: http://stackoverflow.com/comment/47342806
type: AnsweredQuestion
score: 4
has title: How does angularjs handle csrf?
type: Question
upvote count: 4
has comment: http://stackoverflow.com/comment/47342881
downvote count: 0
tagged with: csrf
tagged with: javascript
has comment: http://stackoverflow.com/comment/47342948
has body: I am having a bit trouble understanding the following code run.$inject = ['$http']; function run($http) { $http.defaults.xsrfHeaderName = 'X-CSRFToken'; $http.defaults.xsrfCookieName = 'csrftoken'; } as I always thought that csrf is injected into html forms or ajax calls and not cookie, since csrf is a protection against any adversary trying to use your cookie for authentication. Can someone give a detail explanation on how angular is handling csrf and how does it get the token from the backend?
has answer: http://stackoverflow.com/a/29598225
tagged with: security
has comment: http://stackoverflow.com/comment/47342898
answer count: 1
has comment: http://stackoverflow.com/comment/47342786
favorite count: 0

http://stackoverflow.com/comment/47361527
comment on: http://stackoverflow.com/q/29607866
type: Comment
type: QuestionComment
has text: The link method should only executed once per element which is being transformed by this directive. Is this not the case for your application?
score: 0

http://stackoverflow.com/comment/47222390
comment on: http://stackoverflow.com/q/29534537
score: 0
type: QuestionComment
has text: @PierreGranger it is registering the firstClick but not the second.
type: Comment

http://stackoverflow.com/comment/47419247
comment on: http://stackoverflow.com/a/29638134
score: 1
type: AnswerComment
type: Comment
has text: Javascript can't do a header redirect. Headers are something sent with the server response. JS is client side. The headers are already done by the time JS starts. Without redirecting the user, using any sort of browser history for navigation will show that page. Whether that is the user pressing back or you redirecting back with JS. The only other way to "go back" in javascript with out that page is to not use history. Just go forward to the previous URL and fill in the form with the previously submitted data. `page1` -> `page2` -> `page1 (fill in form with previous submitted data)`.

http://stackoverflow.com/comment/47402631
type: Comment
has text: Never used jsfiddle, reading on it now, and will post as soon as I have it figured. :)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29629740

http://stackoverflow.com/q/29577278
has answer: http://stackoverflow.com/a/29577405
type: Question
upvote count: 1
has comment: http://stackoverflow.com/comment/47317961
score: 0
tagged with: java
has answer: http://stackoverflow.com/a/29584851
has answer: http://stackoverflow.com/a/29577472
has comment: http://stackoverflow.com/comment/47304165
downvote count: 1
answer count: 4
tagged with: jsp
tagged with: javascript
has answer: http://stackoverflow.com/a/29577802
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47303610
has title: Is it possible to get Javascript array in JSP page
favorite count: 0
has body: I am developing a web application in which I which I have a JavaScript array and I want this array in my JSP page and iterate it save the data in database. var value = response; for (var key in value) { if (value.hasOwnProperty(key)) { alert(key + " -&gt; " + value[key]); var sample = new Array(); sample=value[key]; console.log(sample); // document.getElementById(''); } } }); I want this data on my JSP page is it possible. If it is possible, then how?

http://stackoverflow.com/comment/47313655
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29582644
type: AnswerComment
has text: yes Had you declared n as an property to simpleObject2 you wouldn't have got undefined. My problem is why JavaScript is not going for object simpleObject for resolution of n if i don't use this this keyword.

http://stackoverflow.com/comment/47323106
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29587682
score: 1
has text: AFAIK [`.on()`](http://api.jquery.com/on/) doesn't expect jquery object as argument. Why not to bind listener immediately to `scrollableDiv`: `scrollableDiv.on(..)`?

http://stackoverflow.com/a/29644623
answers question: http://stackoverflow.com/q/29631019
has comment: http://stackoverflow.com/comment/47436373
has body: I'll leave a working fiddle example at the bottom. The part that needed some work was primarily: exportTableToCSV.apply(this, [$('#dvData&gt;table'), 'export.csv']); To: exportTableToCSV.apply(this, [$('#dvData'), 'export.csv']); Then it was a matter of formatting the results: // actual delimiter characters for CSV format colDelim = ",", rowDelim = "\r\n", // Grab text from table into CSV formatted string csv = $rows.map(function (i, row) { var $row = $(row), $cols = $row.find('td'); return $cols.map(function (j, col) { var $col = $(col), text = '"' + $col.text().replace(/(\r\n|\n|\r)/gm,"").trim() + '"'; return text //.replace('"', '""'); // escape double quotes }).get().join(tmpColDelim); }).get().join(tmpRowDelim) .split(tmpRowDelim).join(rowDelim) .split(tmpColDelim).join(colDelim), It now returns a comma separated list, where each column is enclosed with quotes. Example on jsFiddle I'll leave the fine tuning to you.
score: 2
downvote count: 0
type: Answer
upvote count: 2
has comment: http://stackoverflow.com/comment/47435813

http://stackoverflow.com/comment/47382696
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29619019
type: Comment
has text: I don't want to fuel this pointless discussion, but you made your edit at `2015-04-14 04:11:08Z`, while the comment by @Ankit was posted at `2015-04-14 04:10:52Z`.

http://stackoverflow.com/comment/47290610
type: Comment
type: QuestionComment
has text: If you're using jQuery please add the tag.
score: 0
comment on: http://stackoverflow.com/q/29570593

http://stackoverflow.com/comment/47438201
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29649191
type: Comment
has text: You are using Visual Studio??

http://stackoverflow.com/comment/47391398
has text: `function avancerLeft() { var batmanp=document.getElementById("batman"); x=batman.position().left; batman.animate({left:x-50+'px'},100); console.log(x); batmanp.className="dirGauche"; return false; }` `$('#fullbody').on('keyup',function(){ batman.stop(); });` Here you go. By super-smooth i mean, a very fluid animation and when you stop pressing the key, it immediately stops moving
type: AnswerComment
comment on: http://stackoverflow.com/a/29621959
score: 0
type: Comment

http://stackoverflow.com/q/29644005
linked to: http://stackoverflow.com/q/1740700
has answer: http://stackoverflow.com/a/29644069
tagged with: javascript
has body: Is it possible to get all colorvalues that exist in a div with a certain class, and its child elements? for example, i have: Link1 Span Subtitle I want an array to get all colors: background of the parent div color of the element color of the element color of the element Also, i'm using highcharts to display charts in the same div. Is it possible to get the colors used there aswell? I don't think i can put this any clearer for you guys, Many thanks! Job
possible better answer: http://stackoverflow.com/a/29644069
answer count: 3
accepted answer: http://stackoverflow.com/a/29644096
tagged with: highcharts
downvote count: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/47428916
has title: Getting all colors from a div with jQuery/JS
has comment: http://stackoverflow.com/comment/47428910
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: 2
type: AnsweredQuestion
upvote count: 2
has answer: http://stackoverflow.com/a/29644096
has answer: http://stackoverflow.com/a/42181132
type: Question

http://stackoverflow.com/q/29558681
has answer: http://stackoverflow.com/a/29572993
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29558962
tagged with: java
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/29559100
has body: This is my Backbone Model define([ 'underscore', 'backbone', 'models/baseModel' ], function (_, Backbone, BaseModel) { var category = BaseModel.extend({ initialize: function(options) { this.catId = options.catId; }, url: function () { var test_json = { k: { k_catId: this.catId, k_dateText: 'last30Days', k_countryCode: $.cookie('countryCode'), } } var json = JSON.stringify(test_json); return applicationUrl + "/service/user/brands/content-category/" + this.catId + "?dateText=last30Days&amp;token=" + $.cookie('token') + "&amp;countryCode=" + $.cookie('countryCode') + "&amp;json=" + json } }); return category; }); I need this json to be passed to my java backend and want to get it through "@QueryParam" property. But it is showing that variable "json" can not be resolver. My java code is as follows: @POST @Path("/content-category/{catId}") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public final Object getContentCategoryData(@Auth AuthToken userAuth, @PathParam("catId") long catId, @QueryParam("dateText") String dateText, @QueryParam("countryCode") String countryCode, @QueryParam("json") String json) { long userId = userAuth.getUserId(); HashMap&lt;String, Object&gt; response = new HashMap&lt;String, Object&gt;(); try { //some code } catch(Exception e){ } } Looking for any type of help. Thanks.
type: Question
possible better answer: http://stackoverflow.com/a/29558962
accepted answer: http://stackoverflow.com/a/29572993
tagged with: javascript
score: 0
tagged with: rest
answer count: 3
tagged with: backbone.js
has title: Pass JSON parameter in rest call using annotations

http://stackoverflow.com/comment/47236568
type: AnswerComment
score: 0
type: Comment
has text: I mean on font-size for ex. normal is 16 and by pressing A+ it will become 17px on whole page
comment on: http://stackoverflow.com/a/29542417

http://stackoverflow.com/comment/47344056
has text: You could have a different function which creates your query string. So every time you change a value in a dropdown box, replace the value for Y, PK or ZZ with the newly selected value.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29598775

http://stackoverflow.com/a/29633303
has body: There is a risk of running several setIntervals here if start command is called in succession. If they are they will pile up and could explain why the memory is increasing. I would suggest the following changes. Without you could simply check if timerID existed in the start method, but centralizing the methods will help keep track. clearInterval() can be called with a null argument with no consequences other that it will ignore it. So in essence: var timerID = null; var interval = 100; function tickBack() { // share callback for timer postMessage("tick") } function startTimer() { // centralize start method stopTimer(); // can be called with no consequence even if id=null timerID = setInterval(tickBack, interval) } function stopTimer() { // centralize stop method clearInterval(timerID); timerID = null; } onmessage = function(e){ if (e.data === "start") { startTimer(); } else if (e.data === "stop") { stopTimer() } else if (e.data.interval) { interval = e.data.interval; if (timerID) startTimer(); } };
has comment: http://stackoverflow.com/comment/47448116
type: Answer
accepted answer of: http://stackoverflow.com/q/29606764
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47580531
has comment: http://stackoverflow.com/comment/47580587
has comment: http://stackoverflow.com/comment/47503219
has comment: http://stackoverflow.com/comment/47446115
answers question: http://stackoverflow.com/q/29606764
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/29620034
has comment: http://stackoverflow.com/comment/47384608
answer count: 0
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47390433
type: Question
has body: hellow i got ta problem with intel xdk,i create an apps for detect a network on emulator and remote its work but when i try to build to apk.its not workking here the code : on emulator and remote its work perfectly but when build its just say tidak ada (which mean no internet detected in this case i already put the network on) function doesConnectionExist() { var xhr = new XMLHttpRequest(); var file = "http://upload.wikimedia.org/wikipedia/commons/d/d9/MS-Arc-Mouse.jpg"; var randomNum = Math.round(Math.random() * 10000); xhr.open('HEAD', file + "?rand=" + randomNum, false); try { xhr.send(); if (xhr.status &gt;= 200 &amp;&amp; xhr.status &lt; 304) { alert("Internet ON"); PostDB(); return true; } else { alert("tidak ada"); return false; } } catch (e) { alert("tidak ada catch"); return false; } }
has title: intel xdk build not like the emulator
tagged with: javascript
tagged with: jquery
upvote count: 1
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/29604893
score: 0
has answer: http://stackoverflow.com/a/29608374
tagged with: outlook-redemption
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29605521
type: Question
tagged with: outlook
tagged with: c#
answer count: 2
tagged with: activexobject
has title: Save email to outlook folder using ActiveXObject or Office Javascript API?
tagged with: javascript
has body: In outlook, there is a feature “Home page address” of folder through which we can view web site within the outlook. If we set http://app.abctest.com in the Home page address of a folder, then when we click this folder in the outlook, it will display that page. I have a very specific requirement for enabling end user to browse a web site (in my case, it basically lists some archived emails) within from the Outlook. This can be easily done by setting the “Home page address” in the properties windows of any Folder of Outlook. The user will see the page within outlook. He can search the old archived emails in the page. Then, the users should be able to download that email and save it to a folder in outlook. End users are basically searching the emails within outlook and downloading them from the server directly to their outlook folder. When user click the download\save link or button, then the outlook’s “Select Folder” dialog should appear where user can select the destination folder. When user click “OK” button, that email should be save to the selected folder in the outlook. Currently, I have very few solutions but not sure if they can achieve the goal. Solution 1: ActiveXObject I tried to use Outlook ActiveXObject in javascript (used the following code in my test page) but I got the following Script error Popup message. “Automation server cannot create the object”. Javascript code: var objO = new ActiveXObject('Outlook.Application'); Solution 2: Javascript API for Office I have started to read the MSDN documentation https://msdn.microsoft.com/en-us/library/office/fp142185.aspx but have not got any sample code. Could someone please sheds some light on it? Or what would be the best solution for this? Or any alternative solution.

http://stackoverflow.com/comment/48207941
type: Comment
comment on: http://stackoverflow.com/q/29646210
score: 0
type: QuestionComment
has text: If you solve your own question the right thing to do is to share your answer so that others may benefit from what you learned.

http://stackoverflow.com/comment/47509301
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29685843
has text: Assuming that I do not have the time to read up on javascript and PHP. Can this be done using only html?
score: 0

http://stackoverflow.com/comment/47444059
score: 0
type: Comment
type: QuestionComment
has text: And there the second most upvoted [answer](http://stackoverflow.com/a/16825593/402037)
comment on: http://stackoverflow.com/q/29652083

http://stackoverflow.com/comment/47273637
type: Comment
has text: Did you check this? http://jsfiddle.net/sudiptabanerjee/93eTU/
type: QuestionComment
comment on: http://stackoverflow.com/q/29561346
score: 0

http://stackoverflow.com/q/29535558
accepted answer: http://stackoverflow.com/a/29539902
has comment: http://stackoverflow.com/comment/47230739
has comment: http://stackoverflow.com/comment/47231336
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47223937
has body: I'm trying to use JQuery to reload a PartialView in an ASP.Net MVC application. My code: &lt;div class="partial"&gt; @Html.Action("GetRemainingSeats", "Layout") &lt;/div&gt; &lt;script src="@Url.Content("~/Scripts/jquery-1.10.2.min.js")"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; setTimeout( $(function () { setInterval(function () { $('#partial').load('@Html.Action("GetRemainingSeats", "Layout")'); }, 5000) }), 6000); &lt;/script&gt; The partial view is loaded correctly, but immediately after that, it will again execute the action, without waiting for the setTimeout function timer to elapse. After that it will stop doing anything. Edit: Inside the PartialView there is a table with shows in a cinema together with how many seats are left for each show. So I want that to update very couple of seconds so the employees can see how many seats are left for a show. I'm using the timeout and setinterval function because on pageload the action is called. After that I want it to wait a couple of seconds before starting the interval
tagged with: asp.net-mvc-partialview
has comment: http://stackoverflow.com/comment/47224429
downvote count: 1
has comment: http://stackoverflow.com/comment/47224924
type: Question
has comment: http://stackoverflow.com/comment/47230958
has answer: http://stackoverflow.com/a/29539902
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/47227807
has title: SetInterval and SetTimeout not working when trying to load a Partial View
possible better answer: http://stackoverflow.com/a/29535702
tagged with: asp.net-mvc-5
answer count: 2
has answer: http://stackoverflow.com/a/29535702
upvote count: 0
tagged with: jquery
tagged with: asp.net
favorite count: 0
has comment: http://stackoverflow.com/comment/47224309

http://stackoverflow.com/comment/47353243
type: AnswerComment
comment on: http://stackoverflow.com/a/29593152
type: Comment
has text: No AJAX thing going on.
score: 0

http://stackoverflow.com/a/77033637
upvote count: 0
has body: use this function, then call it in code: doesFileExist(path: string) { let xhr = new XMLHttpRequest(); xhr.open('HEAD', path, false); xhr.send(); if (xhr.status == 404) { return false; } else { return true; } }
type: Answer
downvote count: 1
answers question: http://stackoverflow.com/q/29681907
score: -1

http://stackoverflow.com/a/29577587
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/29577563
type: Answer
upvote count: 2
has body: This is called the conditional operator (and is the only ternary operator in JavaScript). It this case it is equivalent to if((Math.abs(variable1)&gt;Math.abs(variable2))) { variable3= variable1; } else { variable3 = variable2; }

http://stackoverflow.com/comment/47473988
comment on: http://stackoverflow.com/a/29667668
score: 1
type: AnswerComment
has text: `if(form[0].getElementsByName('slide').length == 0) {` gives error `Uncaught TypeError: undefined is not a function`
type: Comment

http://stackoverflow.com/comment/47412344
comment on: http://stackoverflow.com/a/29635036
type: AnswerComment
type: Comment
score: 1
has text: I think that storing the result in an array doesn't makes much sense. What if you have an different string after the second `Karri` which doens't repeats ? What count is relative to it ? http://jsfiddle.net/dr75vafL/

http://stackoverflow.com/a/29675509
accepted answer of: http://stackoverflow.com/q/29675434
has body: You need to call the functions defined in the $.proxy(): this.myValue.on("change", function () { $.proxy(self.functionOne, self)(); $.proxy(self.functionTwo, self)(); }) Note the trailing ().
score: 8
has comment: http://stackoverflow.com/comment/47488719
has comment: http://stackoverflow.com/comment/47489121
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29675434
upvote count: 8
type: Answer

http://stackoverflow.com/a/29546729
score: 0
accepted answer of: http://stackoverflow.com/q/29546728
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29546728
has body: The file names coming from the server had :s in them, which is a valid filename character on Linux ext4, but not on Windows ntfs. Changing var name = regexp.exec(content_disposition)[1]; to var name = regexp.exec(content_disposition)[1].replace(':', '-'); solved this particular problem.
type: Answer

http://stackoverflow.com/q/29533965
has answer: http://stackoverflow.com/a/29534049
tagged with: javascript
has body: A JavaScript program is required to request, via a dialogue box, a password from a user. The input, which can be of any length, must be validated such that it is only valid if it has no spaces. Any character, other than a space, is permissible. As soon as a space is detected, the program should terminate with a message provided in an alert box stating: Invalid, contains a space! Can anyone help me correct my code, this is my attempt &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;body&gt; &lt;form action=""&gt; Password: &lt;input type="password" name="password"&gt; &lt;/form&gt; ; var i ; var validpassword = "" ; var passworduser ; var isNoSpace = (?!.*\\s) if(isNoSpace = false; i &gt; charAt(i)) // alert("Password contains a space!") for(j = 1; j&lt;=yourString.length; j++){ validpassword += ’*’; } document.write("valid password") else document.write("password not valid") &lt;/body&gt; &lt;/html&gt;
has comment: http://stackoverflow.com/comment/47221008
has comment: http://stackoverflow.com/comment/47220965
answer count: 3
tagged with: while-loop
has comment: http://stackoverflow.com/comment/47220908
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47220968
has comment: http://stackoverflow.com/comment/47225862
type: UnansweredQuestion
tagged with: loops
tagged with: passwords
has answer: http://stackoverflow.com/a/29534025
type: Question
score: 0
has title: A password tester which alerts the user if spaces are present
has answer: http://stackoverflow.com/a/29534061

http://stackoverflow.com/q/29666960
linked to: http://stackoverflow.com/q/16020105
score: 2
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29669830
has comment: http://stackoverflow.com/comment/47474485
type: Question
has comment: http://stackoverflow.com/comment/47473664
has title: Ace Editor - Custom keybind for paste
accepted answer: http://stackoverflow.com/a/29669830
favorite count: 0
tagged with: ace-editor
upvote count: 2
answer count: 1
has comment: http://stackoverflow.com/comment/47474593
has body: The paste functionality in Ace is currently handled through events. Is there a way to add a custom key binding for the paste event? I've tried the following with no such luck (see here): editor.commands.addCommand({ name: "customPaste", bindKey: {win: "Ctrl-q", mac: "Command-q"}, exec: function(editor) { console.log("customPaste"); editor.session._emit('paste'); } }); The key binding is recognized (as indicated by the console output), but it does not appear to be triggering a paste event.
has comment: http://stackoverflow.com/comment/47473763
has comment: http://stackoverflow.com/comment/47474284
has comment: http://stackoverflow.com/comment/47473907

http://stackoverflow.com/comment/47402684
has text: You could probably do something with `flexbox` https://css-tricks.com/snippets/css/a-guide-to-flexbox/
comment on: http://stackoverflow.com/q/29629771
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47225255
score: 1
has text: $('.combo-wrapper')[0] is DOM Element, not jQuery object.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29536381

http://stackoverflow.com/a/29688504
has comment: http://stackoverflow.com/comment/47515620
has body: Here is my solution to your problem. Tested on 3 mayor browsers and it works fine! see fiddle Take a look at my changes on the following classes: remove position relative from .sbContent-one add height: 100% to .sbContent-two (new rule) major changes on .sbMainContent position absolute for .sbMenuTrigger the main problems were: unnecessary position relative and absolute position from .sbContent-one and .sbMainContent. position fixed is relative to the window, so its behavior varies across browsers when you translate the element.
type: Answer
score: 10
upvote count: 11
has comment: http://stackoverflow.com/comment/47515844
downvote count: 1
answers question: http://stackoverflow.com/q/29627672

http://stackoverflow.com/comment/47245207
score: 0
type: AnswerComment
has text: @ENGR024 you have to include `jquery` in your page, see the snippet. add this in your header ` `
comment on: http://stackoverflow.com/a/29545773
type: Comment

http://stackoverflow.com/comment/47229163
type: QuestionComment
score: 0
has text: I edited the question, hope its clearer now
comment on: http://stackoverflow.com/q/29537775
type: Comment

http://stackoverflow.com/a/29666990
has body: For redirect to different page you should use $window.open('url', '_self') Which will load your page again.
has comment: http://stackoverflow.com/comment/47473345
has comment: http://stackoverflow.com/comment/47473110
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47473135
answers question: http://stackoverflow.com/q/29666798
type: Answer
upvote count: 2

http://stackoverflow.com/a/29682436
downvote count: 0
score: 4
has comment: http://stackoverflow.com/comment/47504327
accepted answer of: http://stackoverflow.com/q/29682163
has body: Your call to db.query is asynchronous. What that means is this: The call to db.query(...) returns immediately, returning nothing. Instead of assigning a return value to a variable (var results = db.query(...)), you pass in a callback function as an argument so that the db module can call when it's done fetching its results. It will hang onto the callback function until the database has your results, then it will call the function when it's ready. Because the call to db.query(...) returns immediately, your for loop will complete and the call to sample() will fire before the callback functions you supplied to your queries are ever called by the db module. To ensure that sample runs when all of your calls are done, you'll need to track the completion of each query and then fire the sample function when all of the queries have returned. In my opinion, the easiest way to do this without introducing you to complex topics like "promises", is with a module called async and its parallel method. $ npm install async --save var async = require('async'); var queries = []; function inboxUsers(){ uniqueArray.forEach(function (userId) { var getUsername = 'SELECT userName FROM users WHERE userId = ' + userId; queries.push(function (done) { db.query(getUsername, done); }); }); async.parallel(queries, function (err, allQueryResults) { if (err) { return console.error(err); } allQueryResults.forEach(function (queryResults) { queryResults.forEach(function (result) { console.log('single', result.userName); inboxUserList.push(result.userName); }); }); sample(); }); } function sample(){ console.log('same function'); } Here it is again but with fewer shortcuts taken and detailed comments. var async = require('async'); // create an array to store a bunch of functions that the async library // should fire and wait to finish. var queries = []; function inboxUsers(){ uniqueArray.forEach(function (userId) { var getUsername = 'SELECT userName FROM users WHERE userId = ' + userId; var queryFunc = f…
type: Answer
has comment: http://stackoverflow.com/comment/47504653
has comment: http://stackoverflow.com/comment/47503213
has comment: http://stackoverflow.com/comment/47503513
upvote count: 4
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29682163

http://stackoverflow.com/q/29572267
has body: I have two buttons where each button do the same function but one variable. I'm using ajax to handle some PHP. I'm thinking the problem is that the ajax is being run before the js function. Do you have any solutions for passing a parameter along the specific button click? $('.button').click(function(){ $.ajax({ type: "POST", data: { userid: &lt;?php echo $userid ?&gt;, upgradePrice: price, resource: upgResource }, url: "UpgradeResHandler.php", dataType: "json", async: true, beforeSend: function(){ $(".ajaxTest").text("Trying to upgrade..."); }, success: function(data) { $(".ajaxTest").text(data.a); if (data.b == "true") { location.reload(); } } }); }); function setResource(resource) { var upgResource = resource; } &lt;input type="submit" class="button" name="upgGold" value="Upgrade" onclick="setResource('gold')" /&gt; &lt;input type="submit" class="button" name="upgMetal" value="Upgrade" onclick="setResource('metal')" /&gt;
has answer: http://stackoverflow.com/a/29572403
downvote count: 0
tagged with: javascript
tagged with: ajax
has answer: http://stackoverflow.com/a/29572360
has comment: http://stackoverflow.com/comment/47294202
accepted answer: http://stackoverflow.com/a/29572357
answer count: 4
favorite count: 0
has title: AJAX: Passing Variable Along Specific Button Click
has answer: http://stackoverflow.com/a/29572441
type: AnsweredQuestion
score: 3
upvote count: 3
has answer: http://stackoverflow.com/a/29572357
possible better answer: http://stackoverflow.com/a/29572441
type: Question

http://stackoverflow.com/q/29577854
upvote count: 1
possible better answer: http://stackoverflow.com/a/29577948
has answer: http://stackoverflow.com/a/29578040
has answer: http://stackoverflow.com/a/29577948
has answer: http://stackoverflow.com/a/29578028
type: AnsweredQuestion
downvote count: 0
has title: How to edit this table filter script to filter by selected columns?
tagged with: javascript
score: 1
tagged with: jquery
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
has body: I am using this script: (function(document) { 'use strict'; var LightTableFilter = (function(Arr) { var _input; function _onInputEvent(e) { _input = e.target; var tables = document.getElementsByClassName(_input.getAttribute('data-table')); Arr.forEach.call(tables, function(table) { Arr.forEach.call(table.tBodies, function(tbody) { Arr.forEach.call(tbody.rows, _filter); }); }); } function _filter(row) { var text = row.textContent.toLowerCase(), val = _input.value.toLowerCase(); row.style.display = text.indexOf(val) === -1 ? 'none' : 'table-row'; } return { init: function() { var inputs = document.getElementsByClassName('light-table-filter'); Arr.forEach.call(inputs, function(input) { input.oninput = _onInputEvent; }); } }; })(Array.prototype); document.addEventListener('readystatechange', function() { if (document.readyState === 'complete') { LightTableFilter.init(); } }); })(document); and this input: &lt;input type="search" class="light-table-filter" data-table="order-table"&gt; When I type something in the filter input, it filters a table so I see only entries I have in there matching the text. Like this: http://codepen.io/chriscoyier/pen/tIuBL How can I edit this script so it does not filter by the whole table, but instead only by some selected columns? Like maybe the first three columns is what I need to filter through.
accepted answer: http://stackoverflow.com/a/29578028
answer count: 3

http://stackoverflow.com/a/29637475
type: Answer
has body: Figured it out, in retrospect kind of silly: Just make a containing div that can't get any larger than the parent element, and make sure that it has the overflow property set so it gets the scrollbars. then the image inside can get is big as it wants: http://jsfiddle.net/abrady0/d3y0b8bd/2/ .lightboxRoot { position: fixed; width: 100%; height: 100%; /*aesthetic*/ background-color: red; } .lightboxContainer { position: absolute; top: 50%; left: 50%; margin-right: -50%; transform: translate(-50%, -50%); max-width: 90%; max-height: 90%; overflow: auto; /*aesthetic*/ background-color: blue; } and the html: &lt;div class="lightboxRoot"&gt; &lt;div class="lightboxContainer"&gt; &lt;div&gt; &lt;img id="imgElt" src="foo"&gt;&lt;/img&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; one thing to fix in this case is that I'd still like the div's scroll centered with pure CSS, but this is a good first step.
score: 1
type: AcceptedAnswer
upvote count: 1
answers question: http://stackoverflow.com/q/29633243
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29633243

http://stackoverflow.com/comment/47402759
type: QuestionComment
comment on: http://stackoverflow.com/q/29614752
has text: @sam I updated your question to give it a bit better context, if you disagree please let me know and I can undo it. The issue is with your ES6 syntax and is not specific to Aurelia. Make sense?
score: 0
type: Comment

http://stackoverflow.com/comment/47296470
comment on: http://stackoverflow.com/q/29573708
score: 0
type: Comment
has text: @mohamedrias: yes, that's a typo. Please ignore. thanks.
type: QuestionComment

http://stackoverflow.com/q/29633904
tagged with: http://stackoverflow.com/tag/html
tagged with: text
has comment: http://stackoverflow.com/comment/47410263
has comment: http://stackoverflow.com/comment/47410508
has comment: http://stackoverflow.com/comment/47410159
has answer: http://stackoverflow.com/a/29634381
has title: Populating a form with names from a .txt file
type: Question
has comment: http://stackoverflow.com/comment/47410204
tagged with: javascript
has body: I am trying to populate a dropdown list with a bunch of names that are stored in a .txt in the same directory as the HTML code. Each name is on a new line of this file and"names" is the id of the dropdown that will store the names. Upon loading the page, the list is not populated at all. Any guidance would be awesome. &lt;script type = "text/javascript"&gt; window.onload = function () { var select = document.getElementById("names"); var textFile = "/names.txt"; jQuery.get(textFile, function(textFileData) { var EachLineInTextFile = textFileData.responseText.split(","); for (var i = 0, len = EachLineInTextFile.length; i &lt; len; i++) { var option = document.createElement('option'); option.text = option.value = EachLineInTextFile[i]; select.add(option, 0); }; }; }; &lt;/script&gt; Thanks!
has comment: http://stackoverflow.com/comment/47410626
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47410265
has comment: http://stackoverflow.com/comment/47410553
has comment: http://stackoverflow.com/comment/47410510
has comment: http://stackoverflow.com/comment/47410212
type: UnansweredQuestion

http://stackoverflow.com/comment/47303145
comment on: http://stackoverflow.com/a/29559359
score: 0
type: AnswerComment
type: Comment
has text: Thank you very much for your answers, It's been helping me a lot, I finally managed to make it work, the only problem left is that when I arrive on the map, I redirect directly to the first filter by a transitionTo, but, the model is not updated (the model function on the router is not called), instead, the query param I gave is taken as the current model (if I transitionTo("filter", { filter : "today"}); it's { filter : "today" } who's gonna end up being the model...).

http://stackoverflow.com/a/29545399
answers question: http://stackoverflow.com/q/29545060
score: 1
upvote count: 1
downvote count: 0
type: Answer
has body: $scope and myCtrl identifier aren't interchangeable. 'Controller as' is a syntactic sugar that was introduced in 1.2 and tried to fix the experience from $scope (at least the part of it that suffered from undesirable effects of scope prototypal inheritance). &lt;body ng-controller="MyCtrl as myCtrl"&gt; ... app.controller('MyCtrl', function () { ... }); is identical to &lt;body ng-controller="MyCtrl"&gt; ... app.controller('MyCtrl', function ($scope) { $scope.myCtrl = this; ... }); It doesn't eliminate the need for scope but introduces useful pattern into the controller (note that you don't need to inject $scope in the former example, unless you need $scope.$on, etc. there). You can easily see it by yourself by logging both $scope and myCtrl.

http://stackoverflow.com/comment/47429181
has text: would you please help me to draw route from first address to 2nd on Google map using lat,long from text boxes i have
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29643989
type: Comment

angularjs-ng-repeat
tags question: http://stackoverflow.com/q/29604939
tags question: http://stackoverflow.com/q/29672241
tags question: http://stackoverflow.com/q/29589649
tags question: http://stackoverflow.com/q/29534980
tags question: http://stackoverflow.com/q/29567402
tags question: http://stackoverflow.com/q/29621914
type: Tag
tags question: http://stackoverflow.com/q/29569494
tags question: http://stackoverflow.com/q/29608450
tags question: http://stackoverflow.com/q/29635796
tags question: http://stackoverflow.com/q/29610253
tag name: angularjs-ng-repeat
tags question: http://stackoverflow.com/q/29663958
tags question: http://stackoverflow.com/q/29672954
tags question: http://stackoverflow.com/q/29538133
tags question: http://stackoverflow.com/q/29651492
tags question: http://stackoverflow.com/q/29538898
tags question: http://stackoverflow.com/q/29628819
tags question: http://stackoverflow.com/q/29609748
tags question: http://stackoverflow.com/q/29569916
tags question: http://stackoverflow.com/q/29572447
tags question: http://stackoverflow.com/q/29680145
tags question: http://stackoverflow.com/q/29563190
tags question: http://stackoverflow.com/q/29591051
tags question: http://stackoverflow.com/q/29670921

http://stackoverflow.com/comment/47252742
has text: d3 makes little sense for this, an accordion is basic DOM manipulation
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29549883

http://stackoverflow.com/q/29651678
has answer: http://stackoverflow.com/a/34706566
has title: Using Microsoft OCR Library with JS/jQuery in VS 2013
has comment: http://stackoverflow.com/comment/47711099
downvote count: 0
tagged with: ocr
favorite count: 0
tagged with: visual-studio-2013
tagged with: cordova
tagged with: visual-studio-cordova
type: Question
score: 37
answer count: 1
has comment: http://stackoverflow.com/comment/57158942
has comment: http://stackoverflow.com/comment/48122696
has comment: http://stackoverflow.com/comment/48178524
has comment: http://stackoverflow.com/comment/47711442
upvote count: 37
has body: I am currently working on a windows 8.1 application and I am using web languages and mostly jQuery (Cordova type project) as it might be used on other platforms. I need to use the Microsoft OCR Library (not Tesseract or any other ones, I know them but I really need to use this one for now) in order to analyze image and use the extracted text in my application. I downloaded the JavaScript sample app from MSDN and I launched it : it is fully working (after installing the OCR plugin in VS 2013 of course). I am now trying to integrate the OCR engine in my application (I installed the OCR plugin in my project too) but it is not working at all. In fact, when I try to launch my app on my machine, the execution fails and returns me this error message : Unmanagable exception on line 11, column 5 in ms-appx://io.cordova.blankcordovaapp2/www/scripts/myscript.js 0x800a1391 - JavaScript execution error : « WindowsPreview » is undefined" Here is the "buggy" portion of code (it is at the very beginning of my script) : $(document).ready(function () { "use strict"; // Keep objects in-scope across the lifetime of the scenario. var FileToken = ""; // Define namespace and API aliases. var FutureAccess = Windows.Storage.AccessCache.StorageApplicationPermissions.futureAccessList; // Should be initialising the OCR engine var OCR = WindowsPreview.Media.Ocr; var ocrEngine = new OCR.OcrEngine(OCR.OcrLanguage.french); document.addEventListener("deviceready", onDeviceReady, false); I tried to initialize the OCR engine the same way as it is done in the microsoft OCR sample. VS seems not to find WindowsPreview.Media.Ocr which should be, according to the official documentation : The Microsoft OCR Library for Windows Runtime contains the WindowsPreview.Media.Ocr namespace. The library is distributed as a NuGet package - it is not included in the Windows Software Development Kit (SDK). I did install the plugin in the project using the NuGet command line so I don't know why it isn't identified and c…
has comment: http://stackoverflow.com/comment/47694905
has comment: http://stackoverflow.com/comment/47693146
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/q/29551093
has answer: http://stackoverflow.com/a/29551177
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29551134
possible better answer: http://stackoverflow.com/a/29551177
has comment: http://stackoverflow.com/comment/47253691
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/47253692
has comment: http://stackoverflow.com/comment/47253678
has comment: http://stackoverflow.com/comment/47253627
tagged with: jquery
has title: Using .each() method to validate form fields in jquery
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29551253
has answer: http://stackoverflow.com/a/29551134
type: AnsweredQuestion
has body: I'm trying to build a function using the .each() method in jQuery that scans for empty input fields, highlights them in red, and then provides an alert message to let the user know what needs to change. Here's my sample html: Analyze Here's the function to loop through the table data and add the CSS: $(".analyze").click(function() { $(".required").each(function() { if ($(this).val() === "") { $(this).parents("td").addClass("redClass"); alert("Looks like some of the fields aren't filled out correctly. They're highlighted in red."); } }); }); The issue is that the code goes through the array one-by-one and creates an alert message for every single empty cell. Ideally it'd add .redClass to the empty fields all at once and just present one alert message at the end if any are empty.
type: Question

http://stackoverflow.com/comment/47251235
has text: Your code is fine. How do you call it?
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/29549836

http://stackoverflow.com/comment/47266504
has text: What's the purpose of submitting the form on page load?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29558093
score: 1

http://stackoverflow.com/comment/47394212
score: 0
type: QuestionComment
type: Comment
has text: another thing i noticed is that isNaN should not be a part of email i made that mistake
comment on: http://stackoverflow.com/q/29625290

http://stackoverflow.com/comment/47305734
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29578676
has text: I'm using firefox 37... and also Opera gives me the same issue, the counter is not updated...

http://stackoverflow.com/a/29644172
has body: If you want that you will have to use cookies! mmm... anyway about cookies: http://www.w3schools.com/js/js_cookies.asp Code: document.cookie="height: 99px"; Now you can document.getElementById("div1").height(document.cookie);
type: Answer
score: 0
answers question: http://stackoverflow.com/q/29643738

http://stackoverflow.com/comment/47367841
type: Comment
has text: look here http://odetocode.com/blogs/scott/archive/2014/05/20/using-resolve-in-angularjs-routes.aspx
type: QuestionComment
comment on: http://stackoverflow.com/q/29610966
score: 0

http://stackoverflow.com/a/29584354
has body: The reason the error is being thrown is because somehow that piece of code is not getting that action value, the reason the website is not throwing that error is probably because the php.ini that the website uses has errors turned off. If that is the case, then the error is still there just not being shown. I hope this information is helpful in you finding the error, other than that I am not familiar with Codeigniter, so if it's something to do with Codeigniter I wouldn't know.
type: Answer
answers question: http://stackoverflow.com/q/29583109
score: 0

http://stackoverflow.com/comment/47442638
type: Comment
type: QuestionComment
has text: Yes, it is same function, operating three different elements
comment on: http://stackoverflow.com/q/29651006
score: 0

http://stackoverflow.com/comment/47477167
score: 0
type: QuestionComment
has text: Not yet. I have to add that the weird thing is that i only get http 0 status when pointing the url to the actual page that should handle the POST. If I for example add a wrong port number or point to a non existing page on that server, then i get the expected 404. So it seems that its not like the app can't reach the server at all. So given that, Wireshark wasn't my first line of thought.
comment on: http://stackoverflow.com/q/29661157
type: Comment

http://stackoverflow.com/a/29675101
type: Answer
has body: Yes, there is a very simple filter property in CSS3 you can apply to all other elements if you wish to do so. filter: blur(5px); -webkit-filter: blur(5px); Do note this is not supported in IE. IE had an older property that worked up to IE8, but it doesn't work from IE9+ filter:progid:DXImageTransform.Microsoft.Blur(PixelRadius='5');
answers question: http://stackoverflow.com/q/29674817
score: 0

http://stackoverflow.com/comment/47289888
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29570129
has text: I went with the window['describe'] and that seemed to allow both tests and running the application. Thanks.

http://stackoverflow.com/q/29666449
tagged with: twitter-bootstrap
answer count: 5
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29666925
has answer: http://stackoverflow.com/a/29666933
downvote count: 1
has comment: http://stackoverflow.com/comment/47472093
score: 10
has answer: http://stackoverflow.com/a/29666901
has body: I want to append html code in bootstrap modal HTML content: close Share this Event Javascript code: var modal_event_name=document.getElementById("modal_event_name"); var modal_event_startdate=document.getElementById("modal_event_name"); var modal_city_name=document.getElementById("modal_event_name"); $('#share12').modal('show'); The problem I'm getting: modal is now working guide how to show HTML content in bootstrap modal JSFiddle: http://jsfiddle.net/4gW4y/115/
has answer: http://stackoverflow.com/a/29668045
type: Question
has title: How to append html content in bootstrap modal
has answer: http://stackoverflow.com/a/29667263
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47472245
tagged with: css
upvote count: 11
favorite count: 0
has comment: http://stackoverflow.com/comment/47472144

http://stackoverflow.com/a/29539040
has body: $('div').each(function(idx,div){ $(div).addClass('div'+idx) }) This will result in
downvote count: 0
answers question: http://stackoverflow.com/q/29538809
type: AcceptedAnswer
upvote count: 2
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/29538809

http://stackoverflow.com/a/29608189
upvote count: 2
has comment: http://stackoverflow.com/comment/47362030
answers question: http://stackoverflow.com/q/29608118
type: Answer
has comment: http://stackoverflow.com/comment/47363120
score: 1
has comment: http://stackoverflow.com/comment/47368754
has comment: http://stackoverflow.com/comment/47363204
has body: This would be simpler like this: $('#content:empty').text('Hej'); There is no need for another test, #content:empty supplies the test. However, the initial problem is that the div block contains whitespace and should be done inside one single line. <?php include("edit/franvarande.txt"); ?> Doing this will not work, in case you wanted to try that later on: <?php include("edit/franvarande.txt"); ?> (Hidden) Carriage returns count as data and will be considered as not empty, in turn failing.
downvote count: 1
has comment: http://stackoverflow.com/comment/47363345
has comment: http://stackoverflow.com/comment/47364997

http://stackoverflow.com/a/29666675
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29666621
score: 1
accepted answer of: http://stackoverflow.com/q/29666621
upvote count: 1
has body: first option try this js code, but when u will change first time then there will be no previous selected value. var previous; function saveToDatabase(editableObj,column,id) { alert(previous); //print previous value var $selected = $(this).find(':selected'); previous= $selected.text(); } second option change this line &lt;select id = "selectedUnit" class="form-control" onchange="saveToDatabase(this.value,'Unit','&lt;?php echo $ingredientArray[$i][0]; ?&gt;')"&gt; to this &lt;select id = "selectedUnit" class="form-control" onclick="saveToDatabase(this.value,'Unit','&lt;?php echo $ingredientArray[$i][0]; ?&gt;')"&gt; and js for this will be function saveToDatabase(editableObj,column,id) { var $selected = $(this).find(':selected'); previous= $selected.text(); alert(previous); }

http://stackoverflow.com/comment/47251790
type: Comment
comment on: http://stackoverflow.com/a/29550127
has text: It's not using `new`, it's just calling the `Boolean` function.
type: AnswerComment
score: 0

http://stackoverflow.com/q/29552965
has body: This is my web service's declaration @POST @Path("/upload") @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces("application/json") public DeviceDbUploadResponse upload(@FormDataParam("file1") InputStream file1, @FormDataParam("file2") InputStream file2, @FormDataParam("name1") String filename1, @FormDataParam("name2") String filename2, @FormDataParam("ID") String ID) My web service call var fd=new FormData(); fd.append("ID",ID); /* lines of code here */ $.ajax({ url: 'http://localhost:8080/linterm2m/webapi/m2m/upload', data: fd, processData: false, contentType: false, type: 'POST' }); Everything works well so far. Now it is required to receive all the data (filename and ID) through an Request Object, something like: public class Request{ String ID; String filename1; String filename2; } But I doubt it can be fulfilled because of the multipart-form-data consuming type. I need some enlightenment and a solution.
type: Question
downvote count: 0
has answer: http://stackoverflow.com/a/29555039
accepted answer: http://stackoverflow.com/a/29555039
tagged with: javascript
has comment: http://stackoverflow.com/comment/47259669
tagged with: glassfish
tagged with: ajax
tagged with: multipartform-data
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47261627
has comment: http://stackoverflow.com/comment/47257665
linked to: http://stackoverflow.com/q/24535189
type: AnsweredQuestion
has title: Sending a class object to a multipart-form-data-expected web service
score: 1
tagged with: java
upvote count: 1

http://stackoverflow.com/comment/47464135
type: QuestionComment
has text: Just to make sure, you want to output the book name (e.g. `Stranger In A Strange Land`) to the ouput div with the appropriate ID (e.g. `div#output001`)?
comment on: http://stackoverflow.com/q/29662209
score: 0
type: Comment

http://stackoverflow.com/q/29678513
answer count: 2
tagged with: validation
tagged with: zurb-foundation
downvote count: 0
has comment: http://stackoverflow.com/comment/47495359
has body: I'm trying to get Foundation's Abide validation working with a simple static form, but I'm not getting any errors or response from it. I'm expecting to see data-invalid attributes added to the invalid input elements, but they remain unchanged. I've included Modernizr, jQuery and as far as I can see from the Zurb docs, all the dependencies that Abide requires. I don't care about CSS right now, just want to be able to have Abide validate the form. Most of the following code has been taken from the Zurb Foundation docs: Abide test... Your name required Name is required and must be a string. Email required An email address is required. Submit Can anyone see what's wrong with the above? All the .js files are loading, no 404 errors in Chrome console.
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: zurb-foundation-5
score: 2
upvote count: 2
has title: Zurb Foundation - Abide validation won't trigger
type: Question
has answer: http://stackoverflow.com/a/30270295
tagged with: javascript
has comment: http://stackoverflow.com/comment/47501156
has comment: http://stackoverflow.com/comment/47498489
has answer: http://stackoverflow.com/a/36076465

http://stackoverflow.com/q/29539263
type: Question
has body: How do i edit this code below so that the activeSong.Play() will only occur for 10 seconds, then it will trigger the activeSong.pause() event I have tried to code it but i thought it would be easier to post the clean code rather than my butchered attempt &lt;script type="text/javascript"&gt; var activeSong; //Plays the song. Just pass the id of the audio element. function play(id){ //Sets the active song to the song being played. All other functions depend on this. activeSong = document.getElementById(id); //Plays the song defined in the audio tag. activeSong.play(); //Calculates the starting percentage of the song. var percentageOfVolume = activeSong.volume / 1; var percentageOfVolumeMeter = document.getElementById('volumeMeter').offsetWidth * percentageOfVolume; //Fills out the volume status bar. document.getElementById('volumeStatus').style.width = Math.round(percentageOfVolumeSlider) + "px"; } //Pauses the active song. function pause(){ activeSong.pause(); } //Does a switch of the play/pause with one button. function playPause(id){ //Sets the active song since one of the functions could be play. activeSong = document.getElementById(id); //Checks to see if the song is paused, if it is, play it from where it left off otherwise pause it. if (activeSong.paused){ activeSong.play(); }else{ activeSong.pause(); } } //Updates the current time function so it reflects where the user is in the song. //This function is called whenever the time is updated. This keeps the visual in sync with the actual time. function updateTime(){ var currentSeconds = (Math.floor(activeSong.currentTime % 60) &lt; 10 ? '0' : '') + Math.floor(activeSong.currentTime % 60); var currentMinutes = Math.floor(activeSong.currentTime / 60); //Sets the current song location compared to the song duration. document.getElementById('songTime').innerHTML = currentMinutes + ":" + currentSeconds + ' / ' + Math.floor(activeSong.duration / 60) + ":" + (Math.floor(activeSong.duration % 60) &lt; 10 ? '0' : '') + Ma…
has title: HTML5 Audio player, make pause and play on time out
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/47240612
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47236462
answer count: 0

firebase
tags question: http://stackoverflow.com/q/29568979
tags question: http://stackoverflow.com/q/29561426
tags question: http://stackoverflow.com/q/29608875
tags question: http://stackoverflow.com/q/29594308
tags question: http://stackoverflow.com/q/29647748
tags question: http://stackoverflow.com/q/29577715
tags question: http://stackoverflow.com/q/29570924
type: Tag
tags question: http://stackoverflow.com/q/29661549
tag name: firebase
tags question: http://stackoverflow.com/q/29651589

http://stackoverflow.com/comment/47360942
type: Comment
comment on: http://stackoverflow.com/a/29607424
has text: I sad that that key isn't the problem in here. When I have map created in the **index.js** there is no problem... but I want to have it in another file
score: 0
type: AnswerComment

http://stackoverflow.com/q/29563691
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question
has answer: http://stackoverflow.com/a/29565394
accepted answer: http://stackoverflow.com/a/29565394
tagged with: bootstrap-modal
tagged with: javascript
has title: How can jade attributes be set for Dynamically click generated variables in Bootstrap Modal?
upvote count: 1
tagged with: pug
has body: I have returned a valid JSON through mongoose to my Jade file, the JSON named things looks like this, [{ _id: ObjectId("7788h356i0909v7863b75999"), important: "Critical123", property:[{name: "Test456"},{name: "Test789"},{name: "Test101112"}] }, { _id: ObjectId("7788h356i0909v7863b75908"), important: "Critical", property:[{name: "TestNew"},{name:"TestNewlyOpened"}] } ] I have a certain jade file spitting out details of a page I wanted like below Basically when you click on glyphicon-plus-sign, I am opening a modal window if thing each something in thing tr.odd.gradeX(id="firstRow" rowspan="2") td.imp(type="button") #{something.important} a.glyphicon-plus-sign(id="#{something._id}" data-toggle="modal" data-target=".bs-example-modal-lg") My Modal is declared in the samefile below as .modal.fade.bs-example-modal-lg(id="modalBoxSomething" tabindex='-1', role='dialog', aria-labelledby='myLargeModalLabel', aria-hidden='true', style='display: none;') .modal-dialog.modal-lg .modal-content .modal-header#headerModal h4#myLargeModalLabel.modal-title button.close(id="modalCloseButton" type='button', data-dismiss='modal', aria-label='Close') span(aria-hidden='true') &amp;times; .modal-body .somethingDetails.col-md-6.col-lg-6 if property each nameProperty in property p#propertyName #{nameProperty.name} This doesn't work. Can I loop over nested sub items in an array for a specific item click event? I want to repeat the values of property array for each something in this modal window. Or Should I write a Javascript to do this? for(var k=0; k&lt;things.length; k++){ for(var m=0; k&lt;things[k].property.length; m++){ $('#propertyName').append('&lt;p&gt;'+JSON.stringify(things[k].property[m].name+'&lt;/p&gt;'); } } What is the best practice here? The Javascript solution works, But it would be great if what I am trying to achieve in Jade works sublimely.
answer count: 1
favorite count: 0
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/47279914
tagged with: node.js

http://stackoverflow.com/comment/47296398
comment on: http://stackoverflow.com/q/29573421
has text: Can't you just do `$("form").serialize()`?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47481521
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29671422
has text: Using 0.8.2 so unfortunately it's not this, I think it might be because I haven't added the service to the $rootScope as mentioned in that Github issue linked by @ExpertSystem earlier. I'll report back when I get a chance to try that fix out.

http://stackoverflow.com/comment/47464732
comment on: http://stackoverflow.com/a/29662577
score: 0
has text: I know how to add two lines manually by adding another series as mentioned in the question. However, I would like to avoid manual work. What if I will have 50 series of line? I need to find a way to make it modular.
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29638085
answers question: http://stackoverflow.com/q/29637517
has comment: http://stackoverflow.com/comment/47418727
upvote count: 1
has comment: http://stackoverflow.com/comment/47460316
has body: Hope it helps!! ;) Jquery solution, checking with scrolltop the relative position with the size of the body element! $(window).scroll(function() { $("#menu").css("opacity", $("body").scrollTop() / $("body").height()); }); #menu { opacity: 0.0; width: 1200px; height: 90px; background-color: rgba(0, 0, 0, 0.3); position: fixed; } #text { width: 1000px; height: 1000px; background-color: #31fa87; }
type: Answer
has comment: http://stackoverflow.com/comment/47418561
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47459447

http://stackoverflow.com/comment/47373705
comment on: http://stackoverflow.com/q/29613531
score: 0
type: QuestionComment
type: Comment
has text: Is it posible with css3 property named `column-count`. Take a look at this : http://w3bits.com/css-masonry/ and http://caniuse.com/#feat=multicolumn

http://stackoverflow.com/a/29626637
has comment: http://stackoverflow.com/comment/47410988
type: Answer
has body: Share on facebook Besides when you pass OG image as querystring to the target URL, in the target URL you will need a code which retrievs the image address and set it as OG image. So in target URL you will need this line: <meta property="og:image" content="<?php $_GET['img'] ?>">
accepted answer of: http://stackoverflow.com/q/29626314
answers question: http://stackoverflow.com/q/29626314
upvote count: 2
has comment: http://stackoverflow.com/comment/47411128
score: 2
has comment: http://stackoverflow.com/comment/47397793
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47401574

http://stackoverflow.com/comment/47500387
score: 1
type: AnswerComment
has text: Yeah, the slicing is not really the problem though. The tough part is the skewing and warping of the projection, so the image fits the cube map.
type: Comment
comment on: http://stackoverflow.com/a/29681646

http://stackoverflow.com/q/29624177
tagged with: javascript
has comment: http://stackoverflow.com/comment/47411757
has comment: http://stackoverflow.com/comment/47393253
has comment: http://stackoverflow.com/comment/47394088
favorite count: 0
accepted answer: http://stackoverflow.com/a/29624414
has title: D3 add link with delay
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js
score: 1
upvote count: 1
has body: I want to add some functionality to the D3 graph below, such that each link and its corresponding nodes are added after a delay of 1 second (i.e. one at a time). Is there any way to do that? The data come from an external JSON file (not shown here) that is loaded once. Here, we assume that the JSON file will not change over time, so it's just enough if we parse the JSON file once at the beginning. &lt;!DOCTYPE html&gt; &lt;meta charset="utf-8"&gt; &lt;style&gt; .link { stroke: #ccc; } .node text { pointer-events: none; font: 10px sans-serif; } &lt;/style&gt; &lt;body&gt; &lt;script src="http://d3js.org/d3.v3.min.js"&gt;&lt;/script&gt; &lt;script&gt; //Constants for the SVG var width = 2480, height = 2880; //Set up the colour scale var color = d3.scale.category10(); //Set up the force layout var force = d3.layout.force() .charge(-100) .linkDistance(300) .size([width, height]); //Append a SVG to the body of the html page. Assign this SVG as an object to svg var svg = d3.select("body").append("svg") .attr("width", width) .attr("height", height); //Read the data from the mis element d3.json("data.json", function(error, graph) { force .nodes(graph.nodes) .links(graph.links) .start(); //Create all the line svgs but without locations yet var link = svg.selectAll(".link") .data(graph.links) .enter().append("line") .attr("class", "link") .style("stroke-width", function (d) { return Math.sqrt(d.value); }); //Do the same with the circles for the nodes - no //Changed var node = svg.selectAll(".node") .data(graph.nodes) .enter().append("g") .attr("class", "node") .call(force.drag); node.append("circle") .attr("r", 8) .style("fill", function (d) { return color(d.group); }) node.append("text") .attr("dx", 10) .attr("dy", ".35em") .text(function(d) { return d.name }); //End changed //Now we are giving the SVGs co-ordinates - the force layout is generating the co-ordinates which this code is using to update the attributes of the SVG elements force.on("tick", function () { link.attr(…
type: Question
has comment: http://stackoverflow.com/comment/47396641
tagged with: force-layout
has comment: http://stackoverflow.com/comment/47470225
has answer: http://stackoverflow.com/a/29624414
has comment: http://stackoverflow.com/comment/47422036
answer count: 1
has comment: http://stackoverflow.com/comment/47392984
downvote count: 0

http://stackoverflow.com/comment/47557446
score: 0
type: Comment
has text: @Darkrum No problem, it makes me really happy that you're learning good code practices. Learning design patterns will serve you better than learning any one language, and using them propertly will make everyone who has to maintain and use your code very happy. :D
comment on: http://stackoverflow.com/a/29710868
type: AnswerComment

http://stackoverflow.com/comment/47262167
score: 0
type: Comment
type: QuestionComment
has text: Is this supposed to support a dynamic number of cells like your excel image implies?
comment on: http://stackoverflow.com/q/29555627

http://stackoverflow.com/q/29545867
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47245886
upvote count: 1
tagged with: dojo
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/47276229
has body: I am using dojo to create a bar chart with multiple vertical axes (one for an actual count, the other for a percentage), and when I do, the title for the right axis always gets cut off (i.e., the half of it that's furthest from the chart gets cut off by the edge of the chart). I've already tried using chart.resize(w,h), but this only shrinks the data in the chart, while maintaining the same margins from the edge (and thus the same title cut as before). Does anyone know how to get the title to properly display? For reference, here's the code I'm using, both to create the div node and the chart. chartNode = domConstruct.create("div", { id : this.context.viewid + "_ChartNode", }, this.context.element, "first"); domStyle.set(chartNode, { width : "800px", height : "400px" }); var chart = new Chart(chartNode); chart.addPlot("default", { type : "Columns", markers : true, gap : 5 }); chart.addPlot("something", { type : "Columns", vAxis : "percent" }); chart.addAxis("x", { title : "Person", titleOrientation : "away", minorTicks : false, majorTickStep : 1, dropLabels : false }); chart.addAxis("y", { vertical : true, fixLower : "includeZero", title : "Count", min : 0, max : data[0].totalSubmitted }); chart.addAxis("percent", { title : "Percentage", titleGap : 20, vertical : true, leftBottom : false, fixLower : "includeZero", min : 0, max : 100, }) chart.addSeries("y", data); chart.render(); Edit: This is what my code is actually generating, with the cutoff being highlighted in red.
has comment: http://stackoverflow.com/comment/47280774
type: Question
has comment: http://stackoverflow.com/comment/47281133
tagged with: javascript
tagged with: dojox.charting
has comment: http://stackoverflow.com/comment/47252363
has title: Dojo charting - rightmost axis title getting cut in half
downvote count: 0
favorite count: 0

http://stackoverflow.com/a/29624670
score: 1
has comment: http://stackoverflow.com/comment/47393006
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47392904
has body: Your script is written to "run on load". If the starting time of an operation is critical you should never depend on the script load time. Change that script to be a library of functions (that get started externally). e.g. Put this part of your code in another function: // Global vars outside all functions var canvas = document.getElementById('myCanvas'); var context = canvas.getContext('2d'); var counter = 0; var completeCycle = [0]; var leftColumn = ["word1", "word2", "word3", "word4", "word5", "word6", "word7"]; var rightColumn = ["word1", "word2", "word3", "word4", "word5", "word6", "word7"]; var a = [1,2,3,4,5,6]; var b = [0,1,2,3,4,5,6]; function startup(){ newOrder(); loop(); } and call on completion of the animation: jQuery(document).ready(function(){ jQuery('.splash_container').delay(5000).fadeOut(); jQuery('.canvas_container').delay(5500).fadeIn(startup); }); Your script then just gets loaded, up-front, like any other library.
has comment: http://stackoverflow.com/comment/47392940
accepted answer of: http://stackoverflow.com/q/29624532
type: Answer
answers question: http://stackoverflow.com/q/29624532
upvote count: 1

http://stackoverflow.com/q/29555653
score: 1
has body: $("#Camera").webcam({ width: 320, height: 240, mode: "save", swffile: "@Url.Content("~/Content/jQueryWebcam/jscam.swf")", onTick: function () { }, onSave: function () { }, onCapture: function () { webcam.save("@Url.Content("~/StudentRSRegistration/Capture?StudentIDD="+$("#StudentID").val())"); }, debug: function () { }, onLoad: function () { } }); code above displays an error near $("#StudentID").val() dollar sign. How to escape his character?
type: Question
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/47262004
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29555702
upvote count: 1
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/29555702
favorite count: 0
has title: Jquery $ mark escape
has comment: http://stackoverflow.com/comment/47262085
tagged with: asp.net-mvc-4
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/q/29579222
has body: I'm trying to get asp:ValidationSummary to use Bootstrap's alert styles and to include a close button. The styling works, but the close button isn't added. This is how my .aspx looks like: &lt;asp:ValidationSummary class="alert alert-danger alert-dismissable" ID="ValidationSummary1" ShowSummary="true" runat="server" DisplayMode="BulletList"/&gt; I've tried to get jQuery to add the button, in $(document).ready, like this: $('.alert-dismissable').each(function () { $(this).prepend('&lt;button type="button" class="close" data-dismiss="alert"&gt;&amp;times;&lt;/button&gt;'); }); This works just fine if I use a regular div element, but not with asp:ValidationSummary. If I examine the markup on the client, the button isn't rendered there. I've also tried subclassing asp:ValidationSummary to insert the markup in Render (HtmlTextWriter writer). But the result is the same as with the previous attempts. I've also tried to enclose the ValidationSummary inside a div, like this: &lt;div class="alert alert-danger alert-dismissable"&gt; &lt;button type="button" class="close" data-dismiss="alert"&gt;&amp;times;&lt;/button&gt; &lt;asp:ValidationSummary ID="ValidationSummary1" ShowSummary="true" runat="server" DisplayMode="BulletList"/&gt; &lt;/div&gt; Which seems to render fine in the browser, but closing with the button prevents the ValidationSummary from showing up again as its parent div is now invisible.
downvote count: 0
has answer: http://stackoverflow.com/a/31588052
tagged with: asp.net
favorite count: 0
has title: How do you add Bootstrap's close button to ValidationSummary in ASP.NET Forms?
tagged with: css
tagged with: twitter-bootstrap
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/33097343
score: 18
tagged with: javascript
upvote count: 18
answer count: 2

http://stackoverflow.com/q/29631826
answer count: 1
has comment: http://stackoverflow.com/comment/47406440
tagged with: javascript
has body: I am trying to create an application with Angularjs, angular ui and bootstrap 3. I need to create new tabs on the fly by adding object to the array. Add Person Remove Person Instead of buttons to add and remove I want to add a Dropdown tab to the end. See the plunk... http://plnkr.co/edit/GtuG3UCS2WZvEZpoSiAj?p=preview
has title: Tabs with dropdowns angular ui
accepted answer: http://stackoverflow.com/a/29632673
type: AnsweredQuestion
tagged with: angular-ui
tagged with: angularjs
type: Question
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/29632673
score: 0

http://stackoverflow.com/comment/47481124
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29671526
has text: format it as : `if("wo" == "man" || "wo" == "wo") { ... }`
score: 0

http://stackoverflow.com/comment/47472235
has text: possible duplicate of [What is an efficient way to set CSS class for each cell in a given table row?](http://stackoverflow.com/questions/1593083/what-is-an-efficient-way-to-set-css-class-for-each-cell-in-a-given-table-row)
comment on: http://stackoverflow.com/q/29665783
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47297188
comment on: http://stackoverflow.com/a/29574035
type: AnswerComment
score: 0
type: Comment
has text: What I have done is fine, there is nothing wrong with using it as is.

http://stackoverflow.com/a/29636543
has comment: http://stackoverflow.com/comment/47416271
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47415918
has comment: http://stackoverflow.com/comment/47416332
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47416173
accepted answer of: http://stackoverflow.com/q/29635014
has body: I don't think your problem comes from the ID being a number. We haven't seen what jQuery you've tried, but you most likely don't need jQuery at all. Assuming what you have is working correctly, and the PowerSchool code is putting out elements the way you expect them to be (View Source in your browser to be sure, if this doesn't work), you should be able to grab the ID from the selected option inside your changeValue function, store it in a variable, and push that value into the "secnum" field as follows: function changeValue(){ var courseDropdown = document.getElementById('courseno'); var selectedElement=courseDropdown.options[courseDropdown.selectedIndex]; var option=selectedElement.value; var courseNo = selectedElement.getAttribute("id"); if(option=="E100"){ document.getElementById('credval').value="10"; document.getElementById('credtype').value="EngFresh"; } else if(option=="E200"){ document.getElementById('credval').value="10"; document.getElementById('credtype').value="EngSoph"; } document.getElementById('secnum').value=courseNo; } I changed the way that your "option" variable is being set, but it will work the same way. You might end up wanting to move the last line, where the "secnum" field is being set, or wrap it in an "if", etc.; I don't know your full requirements. All that said, there would be nothing wrong with using jQuery in this situation, but it's not necessary in this case unless you need extreme backwards-browser compatibility.
has comment: http://stackoverflow.com/comment/47415969
answers question: http://stackoverflow.com/q/29635014

http://stackoverflow.com/comment/47220674
has text: sorry, how to test, if i enter more email id with using alert? thanks
type: Comment
comment on: http://stackoverflow.com/a/29533242
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47358070
type: Comment
has text: I gave you a basis of the slider to use. It took me literally 1 minute to change it into a time-stamp slider. Check the fiddle again please, and next time use some creative mind : )
comment on: http://stackoverflow.com/a/29606089
score: 0
type: AnswerComment

http://stackoverflow.com/q/29538165
downvote count: 0
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47228427
score: 1
has comment: http://stackoverflow.com/comment/47228642
tagged with: dom
type: Question
has answer: http://stackoverflow.com/a/29538334
upvote count: 1
accepted answer: http://stackoverflow.com/a/29538334
answer count: 1
has title: jQuery .remove(Selector) doesn't work
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47228379
has body: Look at this snippet: var div = $('#createDrugForm'); div.remove('input[type=hidden]'); //the hidden field is still there div.find('input[type=hidden]').remove(); //the hidden was removed Why does the first method of removal not work?
has comment: http://stackoverflow.com/comment/47228469

http://stackoverflow.com/a/29632902
accepted answer of: http://stackoverflow.com/q/29616140
downvote count: 0
answers question: http://stackoverflow.com/q/29616140
type: AcceptedAnswer
type: Answer
has body: I think what you meant to have is the sticky navbar, and changing background when the main content reaches it on scroll. See the updated code and the pen demo as follows. $(document).ready(function () { var scroll_start = 0; var startchange = $(".maintext"); var offset = startchange.offset(); if (startchange.length) { $(document).scroll(function () { scroll_start = $(this).scrollTop(); if (scroll_start > offset.top) { $("nav").css('background-color', 'rgba(0,0,0,.75)'); } else { $('nav').css('background-color', 'transparent'); } }); } }); * { box-sizing: border-box; margin: 0; padding: 0; } body { background: #666; min-height: 5000px; } header { /* background-image: url('images/main.jpg'); */ background-position: center center; background-size: cover; position: relative; } nav { position: fixed; width: 100%; top: 0; right: 0; z-index: 1; letter-spacing: .2em; line-height: 1; padding: 30px; } nav ul { text-align: right; list-style: none; padding: 0; margin: 0; } nav li { padding: 0 10px; display: inline-block; } nav li:last-child { border-right: none; } nav li a { padding: 10px; color: white; display: block; font-weight: 400; text-decoration: none; color: #FFFFFF; font-family:'Raleway', sans-serif, Helvetica, Verdana; text-transform: uppercase; -webkit-font-smoothing: antialiased; } nav li a:hover { background-color: rgba(40, 40, 40, 0.5); -moz-transition: all .3s ease; -o-transition: all .3s ease; -ms-transition: all .3s ease; -transition: all .3s ease; -webkit-transition: all .3s ease; -webkit-font-smoothing: antialiased; } .logo { width: 200px; display: block; float: left; font-size: 1.8em; font-weight: 800; text-decoration: none; color: #FFFFFF; font-family:'Raleway', sans-serif, Helvetica, Verdana; text-transform: uppercase; font-weight: bold; letter-spacing: 5px; } .logo a { font-size: 1.8em; font-weight: 800; text-decoration: none; color: #FFFFFF; font-family:'Raleway', sans-serif, Helvetica, Verdana; text-transform: uppercase; font-weight: bold; letter-spacin…
score: 1
upvote count: 1

http://stackoverflow.com/a/29652754
answers question: http://stackoverflow.com/q/29626711
score: 0
type: Answer
has body: in the angular docs, I found the exact explinations for my doubt. It is ok to put the "doSomething" method in side scope which is in "controller", because, The controller is instantiated before the pre-linking phase and it is shared with other directives. This allows the directives to communicate with each other and augment each other's behavior. check angular doc link

http://stackoverflow.com/q/29544323
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29544360
tagged with: jquery
type: Question
has body: I have a DIV that I rotate based on the mouse position, here's the fiddle: http://jsfiddle.net/JqBZb/550/ And the JS: var img = $('.image'); if(img.length &gt; 0){ var offset = img.offset(); function mouse(evt){ var center_x = (offset.left) + (img.width()/2); var center_y = (offset.top) + (img.height()/2); var mouse_x = evt.pageX; var mouse_y = evt.pageY; var radians = Math.atan2(mouse_x - center_x, mouse_y - center_y); var degree = (radians * (180 / Math.PI) * -1) + 90; img.css('-webkit-transform-origin', '15px 50%'); img.css('-moz-transform', 'rotate('+degree+'deg)'); img.css('-webkit-transform', 'rotate('+degree+'deg)'); img.css('-o-transform', 'rotate('+degree+'deg)'); img.css('-ms-transform', 'rotate('+degree+'deg)'); } $(document).mousemove(mouse); } First of all I say the code is taken from another post. The problem is that I want to limit the rotation of the DIV 75 degrees. I want to make that the DIV can't point behind itself. Thanks in advance!
score: 0
answer count: 1
has title: Limit mouse rotation to specific degrees
tagged with: javascript

http://stackoverflow.com/comment/47333576
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29592856
type: Comment
has text: Nevermind, he has this in the js file, no idea why. Removed it and now it works perfectly.

http://stackoverflow.com/q/29662447
linked to: http://stackoverflow.com/q/5364714
has title: HTML How do I display a timer using javascript?
answer count: 1
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/29662964
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47465760
has comment: http://stackoverflow.com/comment/47465305
has comment: http://stackoverflow.com/comment/47465269
has comment: http://stackoverflow.com/comment/47465259
has body: I am having a problem displaying a timer for a website. The timer should appear between the two parallel bars that have nothing in between them. Also, my links at the bottom of the page are not taking me to the correct pages. As a matter of fact the pages don`t go anywhere is the problem. Here is my code so far: Chapter 9-1 Midwest Bridal Expo Midwest Bridal Expo Planning your summer or fall wedding The Midwest Bridal Expo opens in Michigan on February 12, 2014 at the Ford Convention Center. This Expo is for all couples planning to get married in the next year, with an emphasis on those planning a summer or fall wedding. We have assembled a group of experts from all areas of wedding planning to help you plan your perfect day. What awaits you Our full day of events include seminars with keynote speakers, one-on-one sessions with professional wedding planners, and various vendors from bakers to photographers with experience at all levels of wedding planning. You will be able to sample wedding cakes, see photo galleries by acclaimed photographers, and meet with hall rental representatives. And do not forget to discuss whether you want a live band or a DJ to provide music at that all-important reception. When you arrive, be sure to register for the grand prize drawing. Many of the individual vendors will also have raffles at their booths for special prizes, like free wedding cakes, free limo service, or free bouquets for the bride. For more information about the Expo: Select a topic Vendor List Schedule Wedding Tips Ticket Information: For ticket reservations call 555-555-5555 x2205. Early bird ticket holders get a 10% discount..
upvote count: 1
downvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29662964
has comment: http://stackoverflow.com/comment/47465485
type: Question
score: 0

http://stackoverflow.com/a/29568617
answers question: http://stackoverflow.com/q/29568412
accepted answer of: http://stackoverflow.com/q/29568412
has body: Passing a parent's state into a child's props is the primary way of communicating with children. Passing function references to a child's props is the primary way of allowing the child to communicate back to the parent. I personally avoid the &lt;DisplayList {...this.state} /&gt; pattern because I prefer to be explicit about the DisplayList's API and what props need to be passed. Passing the whole state can lead to subtle bugs when you add another variable later. The antipattern you mention is probably the pattern of taking a component's props and copying them to that same component's state—it then becomes more difficult to figure out who owns the data, and whether you should call setState or call some method on this.props.
type: Answer
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/29534388
has comment: http://stackoverflow.com/comment/47222556
has comment: http://stackoverflow.com/comment/47223143
tagged with: knockout.js
type: Question
has comment: http://stackoverflow.com/comment/47222261
has answer: http://stackoverflow.com/a/29537098
has body: Update I realize this is not "the knockout way" but. I'd like to update the data on an bound element directly. To get the element's data I would use var data = ko.dataFor(this); I would like to do something like ko.setData(element, key, value) to set the elements internal data, without triggering any bindings. I am currently doing the following. var data = {new_data:"yes please"}; ko.cleanNode(element); ko.applyBindings(data, element); I realize this is not best practice but I'd like to find a cleanish manageable way to do it anyhow. After viewing the source. Is it possible to get at the setter for the datastore? set: function (node, key, value) https://github.com/knockout/knockout/blob/master/src/utils.domData.js line 24;
has comment: http://stackoverflow.com/comment/47226495
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/47224956
has comment: http://stackoverflow.com/comment/47222731
answer count: 2
has comment: http://stackoverflow.com/comment/47225219
downvote count: 1
has answer: http://stackoverflow.com/a/29543992
favorite count: 0
has comment: http://stackoverflow.com/comment/47223830
has comment: http://stackoverflow.com/comment/47221940
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47223053
has comment: http://stackoverflow.com/comment/47227530
has title: knockout set element data
upvote count: 0

http://stackoverflow.com/a/29640795
type: AcceptedAnswer
has body: By setting immediate=true you are suppressing the auth popup. It should be false the first time through and is generally set to true thereafter for each hourly refresh.
type: Answer
score: 3
upvote count: 3
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29637774
answers question: http://stackoverflow.com/q/29637774

http://stackoverflow.com/q/29670277
favorite count: 0
score: 2
downvote count: 0
type: UnansweredQuestion
has title: Jquery match all words in string
has answer: http://stackoverflow.com/a/29670612
has comment: http://stackoverflow.com/comment/47478948
linked to: http://stackoverflow.com/q/15364298
has answer: http://stackoverflow.com/a/29670609
type: Question
upvote count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29670668
answer count: 3
duplicate of: http://stackoverflow.com/q/15364298
has body: I have a script that replaces text and adds a class. It works great, but I have two classes that both have "new" in them and then contain doesn't work. How do I match all the words in the string? code: $('body').ready(function(){ $( "span.conditionHilite:contains('Begagnat')" ).text('Refurbished').addClass("refurbHilite" ); $( "span.conditionHilite:contains('New Spares')" ).text('New spares').addClass( "refurbHiliteSpares" ); $( "span.conditionHilite:contains('New')" ).text('New').addClass( "refurbHiliteNew" ); });
tagged with: regex

event-handling
tag name: event-handling
tags question: http://stackoverflow.com/q/29572728
tags question: http://stackoverflow.com/q/29571731
tags question: http://stackoverflow.com/q/29656693
tags question: http://stackoverflow.com/q/29677612
type: Tag

http://stackoverflow.com/a/41384708
answers question: http://stackoverflow.com/q/29602667
has body: A bit late to this answer, but just wrap the AJAX call around the Dygraph declaration (jQuery assumed here) $.getJSON('data.json', function (data) { var g = new Dygraph(document.getElementById("graphdiv"), data.rows, { //options }); }) // AJAX callbacks .done(function() { console.log('getJSON request succeeded!'); })
upvote count: 1
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/a/29574281
type: Answer
has comment: http://stackoverflow.com/comment/47305627
has comment: http://stackoverflow.com/comment/47346836
accepted answer of: http://stackoverflow.com/q/29574086
answers question: http://stackoverflow.com/q/29574086
score: 0
type: AcceptedAnswer
has body: I'll start off by mentioning that aside from Math.random() being a pseudo-random number generator, your randomization algorithm is biased towards the front of the array and will never select anything past "Graham". You can fix this by using this randomiser instead: /* * * @param upper_bound is the total number of elements in your array. * */ function randomize (upper_bound) { return Math.floor(Math.random() * upper_bound); } To answer your question, you have to need to grab the value of the input before you call the addToArray() function. Replace &lt;input type="button" value="Add Array" onclick="addToArray();"&gt; with &lt;button onclick="addInput()"&gt;&lt;/button&gt; Then add this function to your code: function addInput () { var name = document.getElementById("name").value; addToArray(name); } Hope that helps.

http://stackoverflow.com/a/29677396
score: 7
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29677082
type: Answer
has body: Using @Avinash regexp along with my answer from this question, you can achieve what you want with that code : $('.singleSpace').keyup(function() { var foo = this.value.replace(/\D/g, '').replace(/(\d{8})(?!$)/g, "$1,") var carretPos = doGetCaretPosition(this) carretPos += foo.length - this.value.length this.value = foo; setSelectionRange(this, carretPos, carretPos) }); //Code taken from // https://stackoverflow.com/questions/17858174/set-cursor-to-specific-position-on-specific-line-in-a-textarea function setSelectionRange(input, selectionStart, selectionEnd) { if (input.setSelectionRange) { input.focus(); input.setSelectionRange(selectionStart, selectionEnd); } else if (input.createTextRange) { var range = input.createTextRange(); range.collapse(true); range.moveEnd('character', selectionEnd); range.moveStart('character', selectionStart); range.select(); } } //Code taken from // https://stackoverflow.com/questions/2897155/get-cursor-position-in-characters-within-a-text-input-field function doGetCaretPosition (oField) { // Initialize var iCaretPos = 0; // IE Support if (document.selection) { // Set focus on the element oField.focus (); // To get cursor position, get empty selection range var oSel = document.selection.createRange (); // Move selection start to 0 position oSel.moveStart ('character', -oField.value.length); // The caret position is selection length iCaretPos = oSel.text.length; } // Firefox support else if (oField.selectionStart || oField.selectionStart == '0') iCaretPos = oField.selectionStart; // Return results return (iCaretPos); } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;input type="text" class="singleSpace" /&gt; Basically, use the regexp to make your change. Be sure to remove every non digit character before running the regexp adding commas. Then, you need to use the code snippet to place the caret where it was when replacing the value.
accepted answer of: http://stackoverflow.com/q/29677082
upvote count: 7

http://stackoverflow.com/comment/47345815
comment on: http://stackoverflow.com/q/29599319
score: 0
has text: @AwRak nope, it is just a "" string.
type: Comment
type: QuestionComment

dom
tags question: http://stackoverflow.com/q/29595959
tags question: http://stackoverflow.com/q/29636205
tags question: http://stackoverflow.com/q/29562917
type: Tag
tags question: http://stackoverflow.com/q/29650350
tags question: http://stackoverflow.com/q/29538002
tags question: http://stackoverflow.com/q/29618880
tags question: http://stackoverflow.com/q/29571578
tags question: http://stackoverflow.com/q/29618806
tags question: http://stackoverflow.com/q/29672051
tags question: http://stackoverflow.com/q/29618999
tags question: http://stackoverflow.com/q/29642681
tags question: http://stackoverflow.com/q/29576558
tags question: http://stackoverflow.com/q/29596551
tags question: http://stackoverflow.com/q/29596357
tags question: http://stackoverflow.com/q/29679990
tags question: http://stackoverflow.com/q/29653656
tags question: http://stackoverflow.com/q/29665816
tags question: http://stackoverflow.com/q/29570981
tags question: http://stackoverflow.com/q/29624148
tags question: http://stackoverflow.com/q/29570541
tags question: http://stackoverflow.com/q/29627324
tags question: http://stackoverflow.com/q/29587190
tags question: http://stackoverflow.com/q/29682165
tags question: http://stackoverflow.com/q/29668148
tags question: http://stackoverflow.com/q/29538165
tags question: http://stackoverflow.com/q/29636255
tags question: http://stackoverflow.com/q/29582145
tags question: http://stackoverflow.com/q/29595245
tags question: http://stackoverflow.com/q/29647471
tags question: http://stackoverflow.com/q/29642311
tags question: http://stackoverflow.com/q/29566602
tags question: http://stackoverflow.com/q/29554509
tags question: http://stackoverflow.com/q/29637275
tags question: http://stackoverflow.com/q/29680268
tags question: http://stackoverflow.com/q/29567151
tags question: http://stackoverflow.com/q/29632903
tags question: http://stackoverflow.com/q/29563712
tags question: http://stackoverflow.com/q/29570730
tags question: http://stackoverflow.com/q/29556212
tags question: http://stackoverflow.com/q/29642146
tags question: http://stackoverflow.com/q/29597580
tags question: http://stackoverflow.com/q/29599170
tags question: http://stackoverflow.com/q/29582882
tags question: http://stackoverflow.com/q/29663408
tags question: http://stackoverflow.com/q/29680027
tags question: http://stackoverflow.com/q/29652522
tags question: http://stackoverflow.com/q/29658975
tags question: http://stackoverflow.com/q/29605220
tags question: http://stackoverflow.com/q/29566417
tags question: http://stackoverflow.com/q/29643368
tags question: http://stackoverflow.com/q/29641088
tags question: http://stackoverflow.com/q/29583766
tag name: dom
tags question: http://stackoverflow.com/q/29616375
tags question: http://stackoverflow.com/q/29555703
tags question: http://stackoverflow.com/q/29533935
tags question: http://stackoverflow.com/q/29532026
tags question: http://stackoverflow.com/q/29537801
tags question: http://stackoverflow.com/q/29604945
tags question: http://stackoverflow.com/q/29572728

http://stackoverflow.com/q/29615754
answer count: 1
tagged with: submit
has answer: http://stackoverflow.com/a/29616092
accepted answer: http://stackoverflow.com/a/29616092
type: AnsweredQuestion
score: 0
type: Question
tagged with: polymer
has body: After submited "ajax-form", I can not get the responseText from java HttpServlet to Javascript. HTML Code: .... JavaScript Code: this.$.upload.submit(); Servlet Code: response.getWriter().append("responseText ");
tagged with: responsetext
tagged with: javascript
has title: How can i get responseText with Polymer is-ajax submit?
tagged with: ajax

http://stackoverflow.com/q/29634262
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/29635124
has answer: http://stackoverflow.com/a/29635124
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47412228
has title: Compiling dynamically generated buttons in Angular
accepted answer: http://stackoverflow.com/a/29634951
type: Question
tagged with: angularjs-compile
has comment: http://stackoverflow.com/comment/47410955
tagged with: javascript
has body: I'm trying to dynamically generate a button in Angular. On click, that button needs to call the deleteRow() function and pass in a username. The applicable username is successfully passed to the controller and the resulting button code appears to be properly generated. However, they button ends up passing undefined to the deleteRow() function. Is this a problem with how I'm using $compile? validationApp.controller('usersController', function ($scope, $compile, $http, $timeout){ $(document).on("click", ".open-confirm-dialog", function () { var username = $(this).data('id'); var btnHtml = '&lt;button class="btn btn-danger" data-title="Delete" ng-click="deleteRow(' + username + ')"&gt;DELETE&lt;/button&gt;'; var temp = $compile(btnHtml)($scope); angular.element(document.getElementById('deleteButton-dynamic')).append(temp); }); $scope.deleteRow = function(username){ alert(username); //This shows 'undefined' in the pop-up var request = $http({ method: "post", url: "scripts/delete.php", data: { un: username }, headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }); request.success(function() { }); location.reload(); }; HTML as follows: &lt;div class="row" ng-controller="usersController"&gt; &lt;div class="table-responsive col-md-12" ng-show="filteredItems &gt; 0"&gt; &lt;table id="users" class="table table-bordred table-striped"&gt; &lt;thead&gt; &lt;th ng-click="sort_by('username');"&gt;Username:&amp;nbsp;&lt;i class="glyphicon glyphicon-sort"&gt;&lt;/i&gt;&lt;/th&gt; &lt;th ng-click="sort_by('submitted_info');"&gt;Submitted Info.:&amp;nbsp;&lt;i class="glyphicon glyphicon-sort"&gt;&lt;/i&gt;&lt;/th&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr ng-repeat="data in filtered = (list | orderBy : predicate :reverse)"&gt; &lt;td&gt;{{data.username}}&lt;/td&gt; &lt;td&gt;{{data.submitted_info}}&lt;/td&gt; &lt;td&gt;&lt;a href="#confirmModal" class="open-confirm-dialog" data-toggle="modal" data-id='{{data.username}}'&gt;&lt;span class="glyphicon glyphicon-trash"&gt;&lt;/s…
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/47412038
has comment: http://stackoverflow.com/comment/47410891
has comment: http://stackoverflow.com/comment/47412016
has answer: http://stackoverflow.com/a/29634951

webbrowser-control
type: Tag
tag name: webbrowser-control
tags question: http://stackoverflow.com/q/29637219

http://stackoverflow.com/q/29632141
has comment: http://stackoverflow.com/comment/47445209
has answer: http://stackoverflow.com/a/54017726
tagged with: mobile
has comment: http://stackoverflow.com/comment/47527457
has comment: http://stackoverflow.com/comment/47445464
downvote count: 0
has title: Cordova FileTransfer Download - always returns error 3
tagged with: javascript
tagged with: phonegap-plugins
answer count: 6
has answer: http://stackoverflow.com/a/61396903
favorite count: 0
has comment: http://stackoverflow.com/comment/47443788
tagged with: android
has answer: http://stackoverflow.com/a/29721908
linked to: http://stackoverflow.com/q/32631184
tagged with: cordova
possible better answer: http://stackoverflow.com/a/29686188
upvote count: 2
has answer: http://stackoverflow.com/a/29686188
has comment: http://stackoverflow.com/comment/47509431
has comment: http://stackoverflow.com/comment/47445613
score: 2
has answer: http://stackoverflow.com/a/59660647
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29721908
has body: I've ran into some problems while using cordova plugin File Transfer. Thats my code: window.requestFileSystem( LocalFileSystem.PERSISTENT, 0, function onFileSystemSuccess(fileSystem) { fileSystem.root.getFile( "dummy.html", {create: true, exclusive: false}, function gotFileEntry(fileEntry) { var sPath = fileEntry.fullPath.replace("dummy.html", ""); var fileTransfer = new FileTransfer(); fileEntry.remove(); fileTransfer.download( 'http://cordova.apache.org/images/cordova_bot.png', sPath + photo.original_name, function (theFile) { alert('success: ' + JSON.stringify(theFile)); console.log("download complete: " + theFile.toURI()); // showLink(theFile.toURI()); }, function (error) { alert('error: ' + JSON.stringify(error)); console.log("download error source " + error.source); console.log("download error target " + error.target); console.log("upload error code: " + error.code); }, true ); }) }, function (error) { alert('error request: ' + JSON.stringify(error)); } ); The fileTransfer.download's error callback is being returned with error code 3, http 401. I already updated the File and FileTransfer plugins, my cordova version is 4.3.0. Also checked my config.xml for &lt;access origin="*" /&gt; but it's there. I tried adding the header Connection: close, but no result. Tried setting the download's 4th param to its default (false) too - no luck. Testing on Android tablet. Anyone anything? Thanks!
type: Question
has answer: http://stackoverflow.com/a/76407879

http://stackoverflow.com/comment/47294329
type: Comment
type: QuestionComment
has text: post your relevant code
score: 0
comment on: http://stackoverflow.com/q/29572528

http://stackoverflow.com/q/29598231
tagged with: jquery
tagged with: ipad
favorite count: 0
has body: I tried with focus, select, triggering click/tap events but no luck. I see Facebook sign up page implementing this.There is a exclamation mark. It will show up if you touch any of the birthday select control without changing it and then focus elsewhere. The interesting thing happens when you tap the exclamation mark on iPad Safari. The year options will show up. (It doesn't show on desktop Chrome which I'm using to type this ask). So the question is how to implement the same behavior for iPad? I put the picture of the Facebook sign up page at https://i.sstatic.net/U9DKU.jpg Some code I tried: $('#someselect').val('test'); $('#someselect').focus(); $('#someselect').click(); $('#someselect').prop('selectedIndex',0); $('#someselect').mousedown(); $('#someselect').prop('size',10);
tagged with: http://stackoverflow.com/tag/html
upvote count: 0
has answer: http://stackoverflow.com/a/29598440
accepted answer: http://stackoverflow.com/a/29598440
type: AnsweredQuestion
score: -2
has comment: http://stackoverflow.com/comment/47342926
type: Question
has comment: http://stackoverflow.com/comment/47343088
downvote count: 2
has title: How to programatically open html select options on ipad
answer count: 1
tagged with: ios
tagged with: javascript

twilio
tag name: twilio
type: Tag
tags question: http://stackoverflow.com/q/29565502

http://stackoverflow.com/a/29601858
score: 1
has comment: http://stackoverflow.com/comment/47357926
type: AcceptedAnswer
downvote count: 0
has body: I am not sure if it can be done directly with the data in the given structure. So, what you can do is, iterate through the 'investment' and 'revenue' arrays and create a intermediate structure of the data, from which you can generate the desired output structure. I am assuming that the dates will be unique with-in the respective arrays. You can create a new object with the date as key and the investment and revenue as its properties. var entries = {} if (data.investment != undefined &amp;&amp; data.investment.length &gt; 0) { for (var i = 0; i &lt; data.investment.length; i++) { entries[data.investment[i].date] = {'investment' : parseFloat(data.investment[i].amount), 'revenue' : 0 }; } } if (data.revenue != undefined &amp;&amp; data.revenue.length &gt; 0) { for (var i = 0; i &lt; data.revenue.length; i++) { if (entries.hasOwnProperty(data.revenue[i].date)) { entries[data.revenue[i].date].revenue = parseFloat(data.revenue[i].amount); } else { entries[data.revenue[i].date] = {'revenue' : parseFloat(data.revenue[i].amount), 'investment' : 0 }; } } } Now from this entries object we can generate the array structure. var dataAreaChart = "Date", "Investment", "Revenue"; for (entry in entries) { dataAreaChart.push([entry, entries[entry].investment, entries[entry].revenue]) }
type: Answer
accepted answer of: http://stackoverflow.com/q/29600989
upvote count: 1
answers question: http://stackoverflow.com/q/29600989

http://stackoverflow.com/q/29569350
accepted answer: http://stackoverflow.com/a/29569473
downvote count: 0
answer count: 1
has title: How to process submit data from complex Angular.js web form
tagged with: jquery
favorite count: 0
tagged with: ajax
tagged with: angularjs
has answer: http://stackoverflow.com/a/29569473
type: AnsweredQuestion
tagged with: form-submit
score: 1
upvote count: 1
type: Question
has body: My web form (built with Bootstrap 3 and Angular.js 1.3) is lengthy and mildly dynamic. In other words, there are a few cases of tabular arranged input fields and other regular input fields with an associated "Add another" button, as well as some input fields that toggle (hide/show) based on the input or selection in preceding fields. In the controller JS, I set up an object in scope to hold all the form data as follows: // Angular.js controller function $scope.formData = {}; In the form's HTML, I backed all the fields with ng-model as follows: Username So by the time the form is filled, $scope.formData would have the following structure: $scope.formData => { "username": "jdoe", "roles": [ "Employee", "Lead Engineer", "Coordinator" ], "location": "Palo Alo, CA", "and so": "on..." } I want to use $http to asynchronously post the data to an ASP.NET generic HTTP handler, which will process the form submission and respond back in JSON format. What is the recommended approach to post the data? When I use JSON.parse($scope.formData), the object is broken into individual request parameters and not submitted as a single object. And if I do get the object across as single object, how do I process the form submitted data? Ideally, I want to convert that entire formData object into a C# DTO object that I can work with on the server side.
tagged with: javascript

http://stackoverflow.com/comment/47509578
comment on: http://stackoverflow.com/a/29634633
score: 0
type: AnswerComment
has text: As I first said, by assigning a fill and stroke directly using obj.style.fill="". I originally tried simply changing the class of the path but that didn't work. Also, you should be aware JQuery does not support many features of svg.
type: Comment

http://stackoverflow.com/q/29543077
tagged with: javascript
favorite count: 0
tagged with: onerror
has answer: http://stackoverflow.com/a/44759947
has title: "this" onerror in an iframe
has body: Let's say I have an iframe and that this iframe contains some JavaScript: function triggerError() { throw "error"; } window.onerror = function() { alert('error detected, initial iframe'); } Let's also say that from the root window I have a reference to this iframe called "win". I can trigger the alert by calling win.triggerError(). However, if I try to overwrite the error function from the outside, it will not work. win.onerror = function () { alert('error detected, set from parent window'); }; win.onerror appears to change if checked externally, although checking the value of onerror from inside of the iframe's window shows that the original function is still there. However, I've found that this works: win.test = function () { this.onerror = function () { alert('error detected, set using test()'); }; }; win.test(); Why is this? Is this a this/scoping issue, or a browser-related issue? Note: I am using IE9 with Quirks mode, unfortunately.
type: UnansweredQuestion
tagged with: iframe
upvote count: 1
score: 1
type: Question
tagged with: this
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/47258841
type: Comment
type: QuestionComment
has text: @RonakShah.. Ok. Then can you plz provide a plunkr or fiddle..
comment on: http://stackoverflow.com/q/29553905
score: 0

http://stackoverflow.com/comment/47455568
type: QuestionComment
score: 0
has text: @AlvaroMontoro it's a CSS3 thing. CSS2 only allows `attr()` on the `content` property.
comment on: http://stackoverflow.com/q/29656276
type: Comment

http://stackoverflow.com/comment/47337049
type: AnswerComment
has text: But...I still don't get why substring(0,1) didn't work even though it seems the first one or two characters aren't a blank space. There's some weird non-character thing in there. Very confused about that part of it.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29595009

http://stackoverflow.com/comment/47403977
score: 2
has text: Your question will be more concise if you replace the words 'better' and 'bad' with what you mean. I am gathering you meant 'faster' and 'slower'?
comment on: http://stackoverflow.com/q/29630600
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47372160
comment on: http://stackoverflow.com/q/29613146
score: 0
type: Comment
has text: @FelixKling thanks, but not really what I was asking.
type: QuestionComment

object-literal
tag name: object-literal
type: Tag
tags question: http://stackoverflow.com/q/29564033

http://stackoverflow.com/comment/47497942
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/29653796
has text: It sounds like you're trying to test the jQuery library instead of any logic in your code. Don't do that.
type: Comment

webpage-screenshot
type: Tag
tags question: http://stackoverflow.com/q/29539135
tag name: webpage-screenshot

http://stackoverflow.com/q/29622094
duplicate of: http://stackoverflow.com/q/20035101
answer count: 2
linked to: http://stackoverflow.com/q/20035101
downvote count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47388120
has comment: http://stackoverflow.com/comment/47395120
type: UnansweredQuestion
has title: Unable to use TrueMd Api using Js
has answer: http://stackoverflow.com/a/47562570
upvote count: 0
has body: I am trying to use trueMd.in api. But i am unable to get the response. The url is correct as i am getting response by just pasting the url in the browser. But the code is not working Kindly help. &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;div id="id01"&gt;&lt;/div&gt; &lt;script&gt; var xmlhttp = new XMLHttpRequest(); var url = "http://www.truemd.in/api/medicine_suggestions/?id=Benadryl&amp;key=ApiKey"; xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200) { var myArr = JSON.parse(xmlhttp.responseText); myFunction(myArr); } alert(xmlhttp.readyState); } xmlhttp.open("GET", url,true); xmlhttp.send(); function myFunction(arr) { var out = ""; out=arr; document.getElementById("id01").innerHTML = out; } &lt;/script&gt; &lt;/head&gt; &lt;/html&gt;
type: Question
has answer: http://stackoverflow.com/a/29622228
tagged with: javascript
score: -1

object
tags question: http://stackoverflow.com/q/29670944
tag name: object
tags question: http://stackoverflow.com/q/29570706
tags question: http://stackoverflow.com/q/29579220
tags question: http://stackoverflow.com/q/29556237
tags question: http://stackoverflow.com/q/29638527
tags question: http://stackoverflow.com/q/29623333
tags question: http://stackoverflow.com/q/29564033
tags question: http://stackoverflow.com/q/29659281
tags question: http://stackoverflow.com/q/29644854
tags question: http://stackoverflow.com/q/29553287
tags question: http://stackoverflow.com/q/29590788
tags question: http://stackoverflow.com/q/29668787
tags question: http://stackoverflow.com/q/29634531
tags question: http://stackoverflow.com/q/29661559
tags question: http://stackoverflow.com/q/29616245
tags question: http://stackoverflow.com/q/29628443
tags question: http://stackoverflow.com/q/29585475
tags question: http://stackoverflow.com/q/29533514
tags question: http://stackoverflow.com/q/29612744
tags question: http://stackoverflow.com/q/29655752
tags question: http://stackoverflow.com/q/29617659
tags question: http://stackoverflow.com/q/29678095
tags question: http://stackoverflow.com/q/29640355
tags question: http://stackoverflow.com/q/29608723
tags question: http://stackoverflow.com/q/29553378
type: Tag
tags question: http://stackoverflow.com/q/29604740
tags question: http://stackoverflow.com/q/29532825
tags question: http://stackoverflow.com/q/29556906
tags question: http://stackoverflow.com/q/29561053

http://stackoverflow.com/a/29666641
has comment: http://stackoverflow.com/comment/47472187
upvote count: 2
has comment: http://stackoverflow.com/comment/47472316
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29666540
has body: you should 'echo' result after encode it! see this: &lt;?php public function getDetail_transaction($invoice_id){ $result = $this-&gt;db-&gt;get_where('tblTransaction', array('payment_trx_id' =&gt; $invoice_id))-&gt;first_row(); $data = json_encode($result); echo $data; //echo data } ?&gt; in ajax you should parseJSON your data : $(document).ready(function(){ $("#cek_invoice").click(function(){ data_invoice = $('#invoice_id').val(); var url = "&lt;?php echo base_url('Payment/getDetail_transaction/');?&gt;"+'/'+data_invoice; $.ajax({ url : url, type: "POST", success: function(data) { var dun = $.parseJSON(data); $('#payment_bank_user_name').val(dun.payment_bank_user_name); }, failure: function() { alert('fail'); } }); }); });
score: 2
accepted answer of: http://stackoverflow.com/q/29666540

http://stackoverflow.com/comment/47380397
comment on: http://stackoverflow.com/q/29617742
type: QuestionComment
type: Comment
has text: @druidicwyrm: Please correct me, if I am wrong. I am new to all of these. I use jQuery `hide()` because I want to be able to show them back at one point. I not even sure which way is better, as long as I can trigger to show them back, I am happy. Please advise.
score: 0

http://stackoverflow.com/comment/47290627
type: AnswerComment
comment on: http://stackoverflow.com/a/29566956
has text: Ok, found the issue, fixed.
type: Comment
score: 0

http://stackoverflow.com/comment/47455276
comment on: http://stackoverflow.com/q/29657678
type: Comment
type: QuestionComment
has text: @DontVoteMeDown json_decode() prints blank...
score: 0

http://stackoverflow.com/q/29574094
accepted answer: http://stackoverflow.com/a/29596878
answer count: 1
tagged with: rally
tagged with: javascript
has body: My unit tests that were passing a couple weeks ago are now failing. The unit tests are now failing when they try to create a workspacepermission. I am using the same api-key, which has subscription-level access, so authorization is not a problem. Here is what WSAPI is returning when i try to create the workspacepermission: Also, I am using rally-node v0.2.0, and here is my code that is failing: rally_util.setWorkspacePermission = function(personRef, permission){ var deferred = Q.defer(); restApi.create({ type: 'workspacepermission', limit: Infinity, data: { Workspace: workspaceRef, User:personRef, Role:permission }, scope: { workspace: workspaceRef }, }, function(error, result) { if(error) deferred.reject(error); else deferred.resolve(); }); return deferred.promise; }; Again, i think the permissions model in Rally changed recently or something because my tests haven't changed.
score: 0
tagged with: wsapi
tagged with: permissions
tagged with: node.js
type: AnsweredQuestion
type: Question
has title: rally wsapi workspacepermission 500 error
has answer: http://stackoverflow.com/a/29596878

http://stackoverflow.com/comment/47397662
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29627324
has text: "*One level down in the DOM*" from where..?
type: QuestionComment

http://stackoverflow.com/comment/47333816
type: QuestionComment
comment on: http://stackoverflow.com/q/29592610
has text: Okay I understand that adding another class would do the trick (I didn't think of that TBH) ... now the thing is, I don't understand the `$('#header').scrollFix(style: false);` code ... when I use this code, other javascript plugins don't work ... if you go to https://jsfiddle.net/075t5mto/2/ ... you will see I've added a media query and a class `.no_scroll` but I don't know how to implement this into the javascript?
score: 0
type: Comment

http://stackoverflow.com/comment/47459929
score: 0
type: QuestionComment
type: Comment
has text: `DataTransferItem.getAsFile()`. Thanks, Chrome.
comment on: http://stackoverflow.com/q/29658911

http://stackoverflow.com/comment/47479920
type: AnswerComment
type: Comment
has text: That means your textbox is possibly in the latter Content Place Holder/s.Try enclosing the function with a `$(document).ready()`.
comment on: http://stackoverflow.com/a/29667718
score: 0

http://stackoverflow.com/q/29539389
has comment: http://stackoverflow.com/comment/47232566
has comment: http://stackoverflow.com/comment/47232196
has comment: http://stackoverflow.com/comment/47232376
has answer: http://stackoverflow.com/a/29606904
tagged with: jsf
has comment: http://stackoverflow.com/comment/47231361
tagged with: primefaces
type: Question
has comment: http://stackoverflow.com/comment/47231538
tagged with: commandbutton
has title: How can I get click event when I click to primefaces commandbutton in jsf?
has comment: http://stackoverflow.com/comment/47231448
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47231694
has comment: http://stackoverflow.com/comment/47232031
score: 0
has comment: http://stackoverflow.com/comment/47231920
answer count: 1
has body: I would like to know how to get click event from primefaces commandbutton ? Here is my code about my problem: JSF file: &lt;h:outputScript library="js" name="TreeListFilter.js" target="head" /&gt; &lt;script type="text/javascript"&gt; $ = jQuery; $(document).ready( function() { $('#form\\:taniara2').treeListFilter( '.ui-tree-container', 200); } ); &lt;/script&gt; &lt;script type="text/javascript"&gt; alert("123"); $ = jQuery; $(document).ready(function() { $('#form\\:aratani').click(function() { alert("456"); }); }); &lt;/script&gt; Original code is in here: FileTreeView
type: UnansweredQuestion

http://stackoverflow.com/q/29601203
has comment: http://stackoverflow.com/comment/47350231
has comment: http://stackoverflow.com/comment/47349181
downvote count: 0
has answer: http://stackoverflow.com/a/29603233
has comment: http://stackoverflow.com/comment/47349738
type: Question
has comment: http://stackoverflow.com/comment/47349906
has answer: http://stackoverflow.com/a/29602485
has comment: http://stackoverflow.com/comment/47348521
has comment: http://stackoverflow.com/comment/47349702
tagged with: javascript
has comment: http://stackoverflow.com/comment/47348620
has comment: http://stackoverflow.com/comment/47349847
upvote count: 2
has answer: http://stackoverflow.com/a/29602075
answer count: 3
has comment: http://stackoverflow.com/comment/47348661
has comment: http://stackoverflow.com/comment/47349499
has comment: http://stackoverflow.com/comment/47350101
tagged with: variables
has comment: http://stackoverflow.com/comment/47349075
favorite count: 0
tagged with: ajax
has body: i have this code: <?php $i=12; ?> And my load.php file is this: <?php $i = $_REQUEST["i"]; echo $i; $i=$i+1; echo "<?php $i=".$i."?>"; ?> When I click on the page it loads load.php and it echo out the value of $i. I add 1 to the value of $i, and I want that when I click the second time the value be 2, and so on, adding 1 to the $i value. However it always output 1. The output is 111111111 and am looking to get 1234567 etc. I really appreciate any help you can provide.
type: UnansweredQuestion
has title: Ajax, change variable after load
tagged with: load
tagged with: php
has comment: http://stackoverflow.com/comment/47348945
score: 2

http://stackoverflow.com/q/29633248
has comment: http://stackoverflow.com/comment/47409121
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: signalr
type: Question
tagged with: asp.net-mvc
tagged with: .net
tagged with: javascript
has comment: http://stackoverflow.com/comment/47408972
upvote count: 1
answer count: 1
has body: I have 2 projects in a solution, one is MVC app and the second one is simple Windows Forms app. What I'm currently trying to do, for testing purposes, is to control content on my MVC app through Windows Forms app. To simplify this further, I have a button on my app, which should, when clicked, update HTML on my connected clients. So MVC should manage client connections, and Forms app should be dedicated to content administration. What I did is this - MVC hub setup public class ConnectionHub : Hub { public void Update() { Clients.All.updatesequence(" "); } } MVC Startup setup: [assembly: OwinStartup(typeof(Web.Startup))] namespace Web { public class Startup { public void Configuration(IAppBuilder app) { GlobalHost.DependencyResolver.UseSqlServer( ConfigurationManager.ConnectionStrings["signalr"].ConnectionString); app.MapSignalR(); } } } Forms app - on button clicked event: private void button1_Click(object sender, EventArgs e) { var context = GlobalHost.ConnectionManager.GetHubContext&lt;ConnectionHub&gt;(); context.Clients.All.updatesequence(" "); } Javascript client function "updatesequence()" should be ok because I tested it in different setups and it worked. Database connection also works. EDIT: my question is - how to make this work? It doesn't work in current setup. Context in Forms is loaded and "updatesequence" method is called, but nothing happens.
favorite count: 0
has title: SignalR sharing connection between 2 apps
tagged with: signalr-hub
has answer: http://stackoverflow.com/a/29685064
accepted answer: http://stackoverflow.com/a/29685064

http://stackoverflow.com/q/29634292
tagged with: pseudocode
has comment: http://stackoverflow.com/comment/47507004
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/29634663
downvote count: 0
tagged with: javascript
tagged with: data-structures
has comment: http://stackoverflow.com/comment/47411117
tagged with: logic
has title: Assistance with pseudocoding
has answer: http://stackoverflow.com/a/29634663
favorite count: 0
has body: From the viking code school engineering principles prep course: 10 friends are sitting in a circle around a table and decide to play a new game. In it, they count up through the numbers from 1 to 100. The first person says "1", the second says "2" and so on... but with a few catches: Whenever the number is divisible by 7, they switch directions. So person 6 will say "6", person 7 will say "7", then person 6 again will say "8". Whenever the number is divisible by 11, they skip the next person. Pseudocode a program that will determine which player is the one to say "100". How does one begin figuring out the logic to this one?
has answer: http://stackoverflow.com/a/29684177
accepted answer: http://stackoverflow.com/a/29684177
upvote count: 1
type: AnsweredQuestion
tagged with: algorithm
score: 1
has comment: http://stackoverflow.com/comment/47505526

http://stackoverflow.com/comment/47400577
comment on: http://stackoverflow.com/q/29628807
score: 0
has text: I wouldn't have asked it I didn't search google.... Thanks for helpful advice though.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29629820
answers question: http://stackoverflow.com/q/29629547
score: 0
has comment: http://stackoverflow.com/comment/47403067
has body: The jQuery is looking for the class ui-slider-handle. You have to set your scroll to be that class. Edit:
type: Answer

http://stackoverflow.com/comment/47412111
comment on: http://stackoverflow.com/a/29634658
type: AnswerComment
has text: @CarlEdwards indexOf` returns `-1` if the `key` is not found in `keep`.
score: 0
type: Comment

http://stackoverflow.com/comment/47457111
type: QuestionComment
type: Comment
has text: @jfriend00 I think so because Chrome OS is essentially just the Chrome Browser. I want to detect the OS, and not the browser type. Correct me if I'm wrong.
comment on: http://stackoverflow.com/q/29657165
score: 0

http://stackoverflow.com/q/29561229
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/29561554
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/29561554
has body: I'm trying to adjust a script I found on another stackoverflow question. Basically I want to be able to get the data attribute which is the count number and count from zero up to that number for each instance of that div. Basically I'm trying to loop through each div element and make a variable of the data-attribute and then perform the count animation on that respective element. My HTML: 0 0 0 My jQuery: $(".count_item").each(function(i) { var count_val = $(this).data('count'); $("body").append(count_val); console.log(count_val); $({countNum: $(i).text()}).animate({countNum: count_val}, { duration: 8000, easing:'linear', step: function() { $(i).text(Math.floor(this.countNum)); }, complete: function() { $(i).text(this.countNum); alert('finished'); } }); }); I can't workout why if you look at the console it's getting two of the values and then it errors before the third. Help appreciated. Working example: http://jsbin.com/yenunijemo/2/
has title: jQuery get data attr from each and then perform count up animation
has comment: http://stackoverflow.com/comment/47272462
has comment: http://stackoverflow.com/comment/47272466
answer count: 1
downvote count: 0

http://stackoverflow.com/a/29571196
type: Answer
has body: The documentation explains how to retrieve a thumbnail for a file and includes a cURL example: curl https://api.box.com/2.0/files/FILE_ID/thumbnail.png?min_height=256&amp;min_width=256 \ -H "Authorization: Bearer ACCESS_TOKEN" Note that the access token is given in the authorization header and not as a query parameter. I'd be really surprised if this used to work. Access tokens expire every hour, so after an hour the image would stop loading. You should also be really careful when including an access token in markup. Anyone that can see that image source URL would be able to gain access to the account (until the token expires).
answers question: http://stackoverflow.com/q/29555437
has comment: http://stackoverflow.com/comment/47345409
has comment: http://stackoverflow.com/comment/47342531
score: 0

http://stackoverflow.com/comment/47345172
score: 0
comment on: http://stackoverflow.com/q/29599101
type: Comment
type: QuestionComment
has text: Processing means doing the actions like editing, deleting, completing,... etc

http://stackoverflow.com/q/29649643
linked to: http://stackoverflow.com/q/18835477
tagged with: javascript
score: 24
has answer: http://stackoverflow.com/a/29650005
linked to: http://stackoverflow.com/q/13059190
has body: Currently, I am working on a quiz game and in that, for each question, I wish to place a countdown timer. I got some plugins, but I wish if I could create it myself. What I am trying to create looks like the one in the image below.Can you please tell me how I can do it? Is there a way to assign a border to only up to a specified percentage of the perimeter, so that I could give a border, first in full, and then as each second advances, I can keep decreasing/increasing it so that I would get it in the perfect way. The timer I wish to create should look somewhat like this (hope you understand how its blue border will increase every second):
answer count: 2
downvote count: 4
has answer: http://stackoverflow.com/a/29650186
favorite count: 0
has comment: http://stackoverflow.com/comment/47439539
has title: How to create a circular countdown timer using HTML, CSS or JavaScript?
tagged with: timer
upvote count: 28
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47439339
tagged with: css
type: Question

http://stackoverflow.com/a/29658872
has comment: http://stackoverflow.com/comment/47458598
has comment: http://stackoverflow.com/comment/47458094
answers question: http://stackoverflow.com/q/29658344
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/47458861
has body: if($('a:contains("Wizards")').length){ //there is at least one instance of Wizards in an &lt;a&gt; tag }

http://stackoverflow.com/comment/47339870
has text: I realize Scott its a poor example for the real world, lol, sorry. I was just trying to think of a good one and I guess this is all I could muster up. Thanks though, works good.
type: AnswerComment
comment on: http://stackoverflow.com/a/29596540
score: 0
type: Comment

http://stackoverflow.com/comment/47363410
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29603854
has text: So you don't want to make ` ... ` **not** editable in WYSIWYG mode or merely preserve the formatting?
type: Comment

http://stackoverflow.com/a/29637009
score: 7
has comment: http://stackoverflow.com/comment/47416358
has comment: http://stackoverflow.com/comment/47417203
has comment: http://stackoverflow.com/comment/47416560
has comment: http://stackoverflow.com/comment/47417046
upvote count: 7
has body: Is there a way to tell browsers not to buffer so much? The buffering process is initially controlled completely by the client * (see update below on how this can be controlled programatically) and we can only hint to it what we need using the preload attribute. Using preload = "auto" (or just a blank string) indicates to the browser that it is likely that the video will be played completely: Even with this the client can override it if it finds it necessary. source Update *) There is up and coming Media Source Extension (thanks @Tim McClure) which do allow programmatic control of buffering. The support varies - source: Internet Explorer from version 11 on Windows 8 (MP4). (2013 October) Google Chrome since early 2013, also on Android (MP4, WEBM). Safari 8 on OS X (MP4, TS). It can be enabled in Firefox under flags (about:config). For more details on how to use this, see this longer four part series (from Tim McClure in comments). Specification details
answers question: http://stackoverflow.com/q/29636740
has comment: http://stackoverflow.com/comment/47417575
type: Answer
has comment: http://stackoverflow.com/comment/47417867
downvote count: 0
has comment: http://stackoverflow.com/comment/47417700
has comment: http://stackoverflow.com/comment/47417182
has comment: http://stackoverflow.com/comment/47418298
has comment: http://stackoverflow.com/comment/47416275

http://stackoverflow.com/comment/47714168
has text: curve like shape, so that the label can be aligned with the curve of the slice in chart. Is it feasible?
score: 2
comment on: http://stackoverflow.com/q/29565211
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29555677
possible better answer: http://stackoverflow.com/a/29556054
accepted answer: http://stackoverflow.com/a/29555989
tagged with: authentication
type: Question
upvote count: 2
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/29555989
tagged with: javascript
has body: My question is rather theoretical than how to do it. I would like to know how the experts manage situation like I'm going to describe below. I have a SPA using Angular and Breeze. The authentication is token based. I have an interceptor set up in Angular which takes care about that the requests contain the token, if the server returns 401 then the user will be redirected to the login page. Breeze uses the same $http instance as Angular. When the app starts it fires 1-5 requests to the server and because the user is not authenticated, so that the request does not contain the token so the app gets 401 and the redirection will be fired. I'm planning that every user will be authenticated as Visitor who has very little grants, or Registered user where the user rights are managed. My problem is that, when the first 401 result comes back, I don't know which one will arrive back first, the redirection will be fired, but the remaining results when coming back they throw errors in the console. I really don't like it and I don't like the method not paying attention to these exceptions. For me it is obvious I need a request to the server to know whether the user is authenticated or not. I'm thinking about to make a request which will be fired as the very first. Until it comes back other requests to the server won't be fired. Due to that Angular's $http can't be set up to working synchronously I need a service which has a flag and until the flag is false other services can't make calls. But it seems a little bit clumsy solution. The question is that how situations like this are handled? Do you have blogs dealing with situation like this? Thanks for any help in advance!
favorite count: 0
has answer: http://stackoverflow.com/a/29556054
tagged with: angularjs
score: 2
type: AnsweredQuestion
has title: Synchronous calls until the user is authenticated as visitor with angular

http://stackoverflow.com/q/29582771
answer count: 1
favorite count: 0
type: AnsweredQuestion
tagged with: satellite
accepted answer: http://stackoverflow.com/a/29582970
downvote count: 1
has title: Google maps: change from map view to satellite view
type: Question
tagged with: google-maps
upvote count: 5
tagged with: javascript
tagged with: jquery
score: 4
has answer: http://stackoverflow.com/a/29582970
has body: I have a google map with javascript and i want after zoom in 100%,(full zoom) change the mode map from map view to satellite view, how done it in following javascript code? DEMO:http://jsfiddle.net/keL4L2h0/ //////// Loading Google Map ////////////////////////////////////////////////////////////////////////////////// $(function() { var latitude = $('input[name="latitude"]').val(); var longitude = $('input[name="longitude"]').val(); var lat = (latitude ? latitude : 38.341656192795924), lng = (longitude ? longitude : -122.68604278564453), latlng = new google.maps.LatLng(lat, lng), image = 'http://www.google.com/intl/en_us/mapfiles/ms/micons/blue-dot.png'; //zoomControl: true; //zoomControlOptions: google.maps.ZoomControlStyle.LARGE; var mapOptions = { center: new google.maps.LatLng(lat, lng), zoom: (latitude ? 16 : 7), panControl: false, zoomControl: true, zoomControlOptions: { style: google.maps.ZoomControlStyle.LARGE }, mapTypeControl: false, streetViewControl: false, overviewMapControl: true, rotateControl: false, mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions); var marker = new google.maps.Marker({ position: latlng, map: map, icon: image, draggable: true, animation: google.maps.Animation.DROP }); var input = document.getElementById('searchTextField'); var autocomplete = new google.maps.places.Autocomplete(input, { types: ["geocode"] }); autocomplete.bindTo('bounds', map); var infowindow = new google.maps.InfoWindow(); google.maps.event.addListener(autocomplete, 'place_changed', function(event) { infowindow.close(); var place = autocomplete.getPlace(); if (place.geometry.viewport) { map.fitBounds(place.geometry.viewport); } else { map.setCenter(place.geometry.location); map.setZoom(17); } moveMarker(place.name, place.geometry.location); $('.MapLat').val(place.geometry.location.lat()); $('.MapLon').val(place.geometry.location.lng()); }); google.maps.event.addListener(marker, 'dragend', function…

http://stackoverflow.com/comment/47461512
has text: Tried this too. When I refresh it goes to the top but when I click a link to a new page it doesn't.
comment on: http://stackoverflow.com/a/29660919
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47304446
type: QuestionComment
comment on: http://stackoverflow.com/q/29577799
has text: Use curl http://stackoverflow.com/questions/9784567/net-equivalent-of-curl-to-upload-a-file-to-rest-api
score: 0
type: Comment

http://stackoverflow.com/a/29685041
type: Answer
downvote count: 0
score: 1
has body: you have passed incorrect argument to BoxGeometry. transformVector3 is Vector3 so you should write: geometry = new THREE.BoxGeometry(transformVector3.scale.x, transformVector3.scale.y, transformVector3.scale.z ); position is not assigned to your mesh: transform = transformVector3; material = materialShader; mesh = new THREE.Mesh(geometry, material); //here mesh.position.copy(transform.position);
answers question: http://stackoverflow.com/q/29660277
upvote count: 1

http://stackoverflow.com/comment/47372586
type: AnswerComment
type: Comment
has text: I just edited the answer so that `image_src = current.image.src` as per the pattern of my other example above it.
comment on: http://stackoverflow.com/a/29612141
score: 0

http://stackoverflow.com/a/29979634
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/62360096
has body: It might be simpler than you expected! Please have a look at this Plunker Basically, all plugins, Angularjs $watch need to be based on something. I'm not 100% sure for jQuery-select2; but I think that's just the control's normal DOM events. (And in the case of Angular $watch, it is a "dirty checking loop") My idea is that let's trust jquery-Select2 and AngularJS for handling those change events. We just need to watch for change in Angular's ways and update the select in Select2's ways var refreshSelect = function() { if (!element.select2Initialized) return; $timeout(function() { element.trigger('change'); }); }; //... scope.$watch(attrs.ngModel, refreshSelect); Notice: I have added in 2 new watch which I think you would like to have!
score: 8
type: Answer
downvote count: 0
upvote count: 8
answers question: http://stackoverflow.com/q/29644310
has comment: http://stackoverflow.com/comment/58844098
has comment: http://stackoverflow.com/comment/55906763
accepted answer of: http://stackoverflow.com/q/29644310
has comment: http://stackoverflow.com/comment/55910380

http://stackoverflow.com/q/29603366
score: 0
accepted answer: http://stackoverflow.com/a/29603407
has body: I am trying to get the tags from my api. Everything works fine but I cant able to add new tags. Here is what i tried: $(function(){ var user_email = localStorage.getItem('email'); var api = localStorage.getItem("user_api_key"); var auth = "apikey" +' ' +(user_email+":"+api); $('#s2id_id_add-places').select2({ multiple: true, tags: [], tokenSeparators: [",", " "], width: "200px", ajax: { placeholder: "Click to enter who", type: "GET", beforeSend: function(xhr) { xhr.setRequestHeader("Authorization", auth); xhr.setRequestHeader("Content-Type","application/json"); xhr.setRequestHeader("Accept","application/json"); }, url: "https://example.com/api/v3/places/", dataType: "json", contentType: "application/json", processData: true, quietMillis: 50, data: function(term) { return { term: term }; }, results: function(data) { var results = []; if(data.objects.length &gt; 0) { for (i=0; i&lt;data.objects.length; i++) { results.push({id: data.objects[i].id, text: data.objects[i].label, isNew: true}); } } return { results: results }; }, }); }); By using the above code, I can only get the tags but I cant able to add the new tags. how can i add the new tags? Please help
upvote count: 1
downvote count: 1
type: Question
type: AnsweredQuestion
has title: How to add new tags in select2?
has answer: http://stackoverflow.com/a/29603407
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
tagged with: jquery-select2

http://stackoverflow.com/a/29646074
has body: There are obviously many ways of getting an array of unique objects. As far as I am aware, there is no built-in mechanism in d3 providing this functionality. I have always done it by having an associative array to keep track of objects which are already present in the output array. Adjusted to your needs it would be something like: var contains = {}, unique = []; for (var i = 0; i &lt; data.length; i++) { if(!contains[data[i].id]) { contains[data[i].id] = true; unique.push(data[i]); } } See this JSFiddle.
answers question: http://stackoverflow.com/q/29638615
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29638615
score: 1
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/47483821
type: Comment
comment on: http://stackoverflow.com/q/29672847
score: 0
type: QuestionComment
has text: Also, this implementation isn't that great. Since it uses loose comparison, it would return false positives. E.g. `[[1, 2]]` and `['1,2']` are considered equal by this algorithm.

http://stackoverflow.com/q/29639159
has answer: http://stackoverflow.com/a/29639296
accepted answer: http://stackoverflow.com/a/29639296
downvote count: 0
type: Question
type: AnsweredQuestion
score: 1
has body: If I have unpacked binary data 1700885369 # translates to 'easy' How can I get back to a byte array (most preferably without importing anything)? Like Python's struct.Struct(format).pack: &gt;&gt;&gt; import struct &gt;&gt;&gt; s = struct.Struct('&gt;1I') # a big-endian, two-byte, unsigned int &gt;&gt;&gt; s.pack(1700885369) b'easy' # bytearray([101, 97, 115, 121])
tagged with: endianness
has title: Packing binary data in JavaScript
upvote count: 1
tagged with: arrays
answer count: 1
tagged with: javascript
favorite count: 0

http://stackoverflow.com/a/29676603
has comment: http://stackoverflow.com/comment/47497467
has comment: http://stackoverflow.com/comment/47497229
has comment: http://stackoverflow.com/comment/47495690
has comment: http://stackoverflow.com/comment/47496590
has body: It's an event listener. See documentation here: http://www.w3schools.com/js/js_htmldom_events.asp and here:http://www.w3schools.com/js/js_htmldom_eventlistener.asp You might like to try the Visual Event extension for Chrome. It shows you all event listeners that are currently attached to the page displayed.
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/47496035
downvote count: 0
answers question: http://stackoverflow.com/q/29676457
score: 1

http://stackoverflow.com/comment/47498083
type: Comment
has text: No, you cannot. The example I provided is the closest way you can match what you are describing.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29657661

http://stackoverflow.com/comment/47298333
score: 0
type: Comment
has text: I see. j is the index for b, and i for a. You are looping through the longer string and storing the "not found/different" char in result. I like it. Since regex is not possible, I'll mark this as my preferred answer. Thanks Millie!
comment on: http://stackoverflow.com/a/29574724
type: AnswerComment

http://stackoverflow.com/comment/47361372
type: QuestionComment
has text: If you only want to disable JS while debugging you could purposely throw a js exception? that would prevent anything else from getting executed.
score: 3
comment on: http://stackoverflow.com/q/29607873
type: Comment

http://stackoverflow.com/q/29600230
tagged with: angularjs
type: UnansweredQuestion
tagged with: jscolor
has answer: http://stackoverflow.com/a/29601740
has title: JSColor pick up color to trigger AngularJS ng-change
type: Question
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/47348316
has body: I use this plugin, JSColor (http://jscolor.com/) and bind the input value with AngularJS ng-model like the following: I expect everytime I pick up a color AngularJS will alert the changed value of myColor, but nothing happens. What else should I do? thank you! :) add: I also tried this: texttext to bind text color in textarea, also doesn't works.
score: 0
has answer: http://stackoverflow.com/a/29600533

http://stackoverflow.com/a/29596242
has comment: http://stackoverflow.com/comment/47339564
upvote count: 1
has comment: http://stackoverflow.com/comment/47339691
has comment: http://stackoverflow.com/comment/47339539
accepted answer of: http://stackoverflow.com/q/29596147
type: AcceptedAnswer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29596147
has comment: http://stackoverflow.com/comment/47339585
type: Answer
has body: This will do what you need: Note that I gave the checkboxes the class enable I have also added the disabled property to the actual html inputs, you'll need to add this in your php code I also gave each input a unique name If you're allowing multiple fields and will be submitting the form, they will all need unique names $('.enable').change(function(){ var set = $(this).is(':checked') ? false : true; // ternary operator to test if the changed checkbox is now checked $(this).nextAll('input').first().attr('disabled',set); // find the next input and set it's disabled property according to the previous check }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;form class='additionals'&gt; &lt;input class='additional-checkbox enable' type='checkbox' name='additional_id1' value='somevalue' /&gt;somevalue &lt;input type='number' name='additional_quantity1' value='1' min='1' max='5' disabled/&gt; &lt;br/&gt; &lt;input class='additional-checkbox enable' type='checkbox' name='additional_id2' value='somevalue' /&gt;somevalue &lt;input type='number' name='additional_quantity2' value='1' min='1' max='5' disabled/&gt; &lt;br/&gt; &lt;input class='additional-checkbox enable' type='checkbox' name='additional_id3' value='somevalue' /&gt;somevalue &lt;input type='number' name='additional_quantity3' value='1' min='1' max='5' disabled/&gt; &lt;br/&gt; &lt;input class='additional-checkbox enable' type='checkbox' name='additional_id4' value='somevalue' /&gt;somevalue &lt;input type='number' name='additional_quantity4' value='1' min='1' max='5' disabled/&gt; &lt;br/&gt; &lt;input class='additional-checkbox enable' type='checkbox' name='additional_id5' value='somevalue' /&gt;somevalue &lt;input type='number' name='additional_quantity5' value='1' min='1' max='5' disabled/&gt; &lt;br/&gt; &lt;/form&gt;
has comment: http://stackoverflow.com/comment/47339612
has comment: http://stackoverflow.com/comment/47339747

http://stackoverflow.com/a/29636842
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29636808
has body: Your code never increments c. The only element of str that's ever modified is element 0. Use str.push(myarr[i][j]); and you won't need c at all.
answers question: http://stackoverflow.com/q/29636808
upvote count: 2

http://stackoverflow.com/comment/47339622
has text: It's worth also noting that the *undefined* value is returned when accessing •undeclared* properties.
score: 3
comment on: http://stackoverflow.com/a/29595762
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29534485
has comment: http://stackoverflow.com/comment/47226824
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29537340
possible better answer: http://stackoverflow.com/a/30991853
answer count: 2
has answer: http://stackoverflow.com/a/30991853
tagged with: meteor
has comment: http://stackoverflow.com/comment/47226893
tagged with: meteor-helper
has title: Meteor Template.myTemplate.helpers not rendering output
has comment: http://stackoverflow.com/comment/47226718
type: AnsweredQuestion
has body: I am new to meteor and i am wondering why is it myTemplate.helper is not rendering its supposed output when i started putting these files in my /client/template directory. These are the following files: /clinent/template/body.html: {{#each projects}} {{> projectList}} {{/each}} /client/template/body.js: Project = new Mongo.Collection("project"); if (Meteor.isClient) { Template.body.helpers({ projects: function(){ var projects = Project.find({}); return projects; } }); }; /client/template/templates.html: {{name}} However it is rendering the ouptut properly when i put body.html and body.js at the root / directory.
score: 0
has answer: http://stackoverflow.com/a/29537340
type: Question

http://stackoverflow.com/a/51219312
score: 1
upvote count: 1
has body: Try var a = {a1:1, a2: 2, a3: 3}; var b = {b1:1, b2: 2, b3: 3}; const newVar = (() =&gt; ({a1, a2, b1, b2})).bind({...a, ...b}); const val = newVar(); console.log({...val}); // print: Object { a1: 1, a2: 2, b1: 1, b2: 2 } or console.log({...(() =&gt; ({a1, a2, b1, b2})).bind({...a, ...b})()});
answers question: http://stackoverflow.com/q/29620686
type: Answer
downvote count: 0

http://stackoverflow.com/comment/47334900
type: Comment
score: 2
has text: @Feirell just not call `this.constructor`
type: AnswerComment
comment on: http://stackoverflow.com/a/29593434

http://stackoverflow.com/q/29623767
tagged with: jquery
tagged with: asp.net
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29624408
has comment: http://stackoverflow.com/comment/47392532
has comment: http://stackoverflow.com/comment/47391412
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47391533
tagged with: c#
has answer: http://stackoverflow.com/a/29624469
type: Question
answer count: 2
has title: Trigger asp.net event from html controls added by jquery
tagged with: javascript
has body: In my WebApplication I have some code like this. $('.form-content').append(' ' + ' User 1 ' + ' User 2 ' + ' User 3 ' + ' '); But, when I select the list item, the Event doesn't trigger. Is there any way to bind ASP.NET event to html control which is dynamically generated by JQuery/Javascript ? I tried using WebMethod. But, It cannot update the ASP.Net controls since the method is static.

http://stackoverflow.com/a/29602614
score: 0
has body: $(function() is equivalent to $(document).ready(function() {});, which should not be used in jQuery Mobile. Put your JS code in this event handler: $("#mapPage").on("pagecreate", function() { // your code });
type: Answer
answers question: http://stackoverflow.com/q/29600180

http://stackoverflow.com/a/29621051
upvote count: 4
has body: change code as below . in ajax call you pass comboA value with 'make='+make+'. so you will not get comboA without passing as data. var obj = document.getElementById("comboA"); var make= obj.options[obj.selectedIndex].value; var dataString = 'make='+make+'&amp;model='+model; PHP &lt;?php $model = $_POST['model']; $make = $_POST['make']; // use make not comboA echo $make.$model; ?&gt; Option 2 or change your data string as below . replace make with comboA var dataString = 'comboA='+make+'&amp;model='+model; PHP &lt;?php $model = $_POST['model']; $make = $_POST['comboA']; echo $make.$model; ?&gt; as yo are using jquery library you can change your code as below to get value. var model= $('#model').val(); var make= $('#comboA').val();
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29621017
score: 4

http://stackoverflow.com/comment/47447871
type: AnswerComment
has text: maybe you wanna mean that "when clicking next, make the submit button active, or something like this?, then control the click on submit?"
type: Comment
comment on: http://stackoverflow.com/a/29653223
score: 0

http://stackoverflow.com/a/29663156
score: 0
type: Answer
has body: Well, you regex doesn't match the newline at the end, so it won't affect it. To fix this, add \n to the end. Regex101 demo of the idea -- notice, on the right, how the match isn't movie, it's movie with a newline after it. A few other things that may or may not apply to your actual regex that I'd like to recommend: You need to escape your slashes (/ => \/) in your regex, or it might cause issues. You need to escape literal full stops (. => \.) or it'll match any character in that position (i.e. backup.rar will match backup:rar as well)
accepted answer of: http://stackoverflow.com/q/29663043
answers question: http://stackoverflow.com/q/29663043
type: AcceptedAnswer

http://stackoverflow.com/q/29539930
accepted answer: http://stackoverflow.com/a/29540411
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29540488
has title: AngularJS: the $q.defer() cannot be shared by factory methods
type: Question
has answer: http://stackoverflow.com/a/29540565
possible better answer: http://stackoverflow.com/a/29540488
tagged with: javascript
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/29540411
tagged with: ajax
has body: In my webapp, I write a factory methods for serving ajax calls and returning promises by using the $q service. As you can probably tell, I am still on the learning curve of using AngularJS; I found something interesting on the $q.defer() object, which cannot be shared by factory methods. I write the following fake ajax calls in a factory component (plnker here): (function() { 'use strict'; angular.module('testAjax') .factory('AjaxPromiseService', AjaxPromiseService); AjaxPromiseService.$inject = ['$q', '$timeout']; function AjaxPromiseService($q, $timeout) { //var deferred = $q.defer(); //cannot be claimed for sharing here var methodObj = {getDummyData : getDummyData, getName: getName }; return methodObj; /******************** implementations below **********/ function getDummyData() { var data = {"data" : "dummy data from ajax!"}; var deferred = $q.defer(); $timeout(function() { deferred.resolve(data); }, 3000); //3 seconds return deferred.promise; } //getDummyData function getName() { var deferred = $q.defer(); $timeout(function() { deferred.resolve({"name": "my name is john doe!"}); }, 2000); //2 seconds return deferred.promise; } //getName } }()); In my controller, I have the following: (function() { 'use strict'; angular.module('testAjax', ['ui.router', 'Constants']) .controller('testController', testController); testController.$inject = ['$log', 'AjaxPromiseService', '$http', '$q', 'URL_CONFIGS']; function testController($log, AjaxPromiseService, $http, $q, URL_CONFIGS) { $log.info('in the testController'); var vm = this; vm.message = URL_CONFIGS.home; vm.getData = function() { AjaxPromiseService.getDummyData().then(function(data) { vm.message += data.data; //$log.info($q); }).catch(function(err) { $log.info('error in getting data'); }).finally(function() { $log.info('getData is completed'); }); //getDummyData }; //getData vm.getName = function() { AjaxPromiseService.getName().then(function(data) { vm.message += data.name; //$log.info($q); }).catch(function(er…
tagged with: promise
tagged with: angularjs
tagged with: factory
linked to: http://stackoverflow.com/q/6801283

http://stackoverflow.com/comment/109615250
type: Comment
has text: I have separate files for each model so where should i call ```sequelize.sync();```
comment on: http://stackoverflow.com/a/29616098
type: AnswerComment
score: 0

http://stackoverflow.com/q/29608071
has answer: http://stackoverflow.com/a/29608196
has title: change colour of title bar in jquery pop up
tagged with: javascript
tagged with: jquery
answer count: 3
downvote count: 0
has answer: http://stackoverflow.com/a/29608310
favorite count: 0
has answer: http://stackoverflow.com/a/29608271
type: UnansweredQuestion
has body: Messing about trying to change the background colour of the title bar in a jquery pop to to green (seen as blue in the jsfiddle)...cant seem to get it...any suggestions welcome? $("#dia").dialog({ autoOpen: true, title:"Access Point", height: 200, width: 300, modal: false, draggable: true, position: [900, 150], dialogClass: "foo", //show: {effect: 'bounce', duration: 350, times: 3} show: {effect: 'fade', duration: 2000} }); $(".ui-dialog-titlebar").css("background-color", "green"); $(".ui-dialog").css("background-color", "green"); $(".ui-dialog-title").css("background-color", "green"); $(".ui-dialog-content").css("background-color", "green"); please see http://jsfiddle.net/dEvKb/3254/
has comment: http://stackoverflow.com/comment/47361968
tagged with: css
score: 1
has comment: http://stackoverflow.com/comment/47361940
upvote count: 1
type: Question

http://stackoverflow.com/comment/47351009
score: 0
type: QuestionComment
type: Comment
has text: But i did't get the answer :( @Reena
comment on: http://stackoverflow.com/q/29602421

http://stackoverflow.com/q/29604970
tagged with: client
has comment: http://stackoverflow.com/comment/47355774
score: 0
has title: Insert javascript into php file (or vice versa)
type: Question
has answer: http://stackoverflow.com/a/29605195
tagged with: server
tagged with: javascript
answer count: 1
has body: I have a Server file written in php, and a client html file (mainly javascript), I want to have both put into one file and still communicate. I tried copying the php code of the server above the client code but it didn't work. So this is how it was like: <?php // prevent the server from timing out set_time_limit(0); // include the web sockets server script (the server is started at the far bottom of this file) require 'class.PHPWebSocket.php'; // when a client sends data to the server function wsOnMessage($clientID, $message, $messageLength, $binary) { global $Server; $ip = long2ip( $Server->wsClients[$clientID][6] ); // check if message length is 0 if ($messageLength == 0) { $Server->wsClose($clientID); return; } $x = 0; //The speaker is the only person in the room. Don't let them feel lonely. for ($i=1; $i <= 10; $i++) { $q=".68.111.160"; $string =100+$i*10; $string .= $q; $Server->wsSend($clientID, $string); sleep (3); } } // when a client connects function wsOnOpen($clientID) { global $Server; $ip = long2ip( $Server->wsClients[$clientID][6] ); $Server->log( "$ip ($clientID) has connected." ); //Send a join notice to everyone but the person who joined foreach ( $Server->wsClients as $id => $client ) if ( $id != $clientID ) $Server->wsSend($id, "Visitor $clientID ($ip) has joined the room."); } // when a client closes or lost connection function wsOnClose($clientID, $status) { global $Server; $ip = long2ip( $Server->wsClients[$clientID][6] ); $Server->log( "$ip ($clientID) has disconnected." ); //Send a user left notice to everyone in the room foreach ( $Server->wsClients as $id => $client ) $Server->wsSend($id, "Visitor $clientID ($ip) has left the room."); } // start the server $Server = new PHPWebSocket(); $Server->bind('message', 'wsOnMessage'); $Server->bind('open', 'wsOnOpen'); $Server->bind('close', 'wsOnClose'); // for other computers to connect, you will probably need to change this to your LAN IP or external IP, // alternatively use: gethostbyaddr(gethos…
has comment: http://stackoverflow.com/comment/47355822
has comment: http://stackoverflow.com/comment/47355636
type: UnansweredQuestion
tagged with: php

http://stackoverflow.com/a/29625990
accepted answer of: http://stackoverflow.com/q/29624714
answers question: http://stackoverflow.com/q/29624714
has comment: http://stackoverflow.com/comment/47425965
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47428486
score: 0
type: Answer
has body: The way of communication you are using now is correct. I have seen your screenshot ( https://drive.google.com/file/d/0B2lBPXKQBuQHQngxS2g0ZEhUT2c/view?usp=sharing ) and that should not happen. Reading your code I can't see where you draw the graph but I see that in drawOutput function you add what you receive to the page (that could be why it appears at the top). Try replacing this function by this one: function drawOutput(responseText) { drawVisualization(responseText) } You should modify the drawVisualization function so that it uses the data you pass and appends it to the right html tag.

http://stackoverflow.com/q/29578645
downvote count: 0
tagged with: javascript
tagged with: express
favorite count: 0
upvote count: 3
has title: Breaking express router into multiple files
has body: I googled this question and was initially quite hopeful at the number of responses. That hopefulness quickly turned into disappointment as I read through the first 4 links, as well as the Express documentation and could not find any viable resolutions to my inquiry. I want to break my routes into two files: One file for GET request and one file for POST request. Many articles on the internet hint at the ability to do this, or they state how to do it but in a very context specific application. Can someone please provide a generalized and fully complete way to break an Express router into multiple files with code examples? router.js var express = require('express'); var models = require('../db/models.js'); var util = require('../core/utilities.js'); var router = express.Router(); router.get('/messages', function (req, res) { util.log('RECEIVED a GET request', req.query); models.retrieveMarks(req.query) .then(function(msg) { util.log('SENT message array to user', msg); res.status(200); res.send(msg); }, function(err) { util.log('SENT error code to user', err); res.sendStatus(400); }); }); router.post('/messages', function(req, res) { util.log('RECEIVED a POST request', req.body); //input: {x: float, y: float, z: float, message: string, userToken: string} models.createMessage(req.body) .then(function(msg) { util.log('SENT success code to user', msg); res.sendStatus(201); }, function(err) { util.log('SENT error code to user', err); res.sendStatus(400); }); }); //input: {userToken: string} router.post('/usertoken', function (req, res) { var token = req.body.userToken; util.log('RECEIVED a new user token from user', token); models.createUser(token) .then(function(user) { util.log('SENT success code to user', user); res.sendStatus(201); }, function(err) { util.log('SENT error code to user', err); res.sendStatus(400); }); }); //input: {messageId: string, userToken: string} router.post('/upvote', function (req, res) { util.log('RECEIVED upvote request', req.body); models.crea…
type: Question
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/29578796
accepted answer: http://stackoverflow.com/a/29578796
answer count: 1

http://stackoverflow.com/q/29678909
has comment: http://stackoverflow.com/comment/47495183
linked to: http://stackoverflow.com/q/596314
has comment: http://stackoverflow.com/comment/47495749
has comment: http://stackoverflow.com/comment/47495100
has answer: http://stackoverflow.com/a/29679091
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/29679191
tagged with: jquery-selectors
has comment: http://stackoverflow.com/comment/47495289
tagged with: jquery-ui-multiselect
has comment: http://stackoverflow.com/comment/47495212
has body: I am using jquery with a jquery multi select extension. For my html syntax: 1 2 3 I then get the values of the multi-select with: $(function() { $('#test').change(function() { console.log($(this).val()); }).multipleSelect({ width: '100%' }); }); This works 100%. my question is how do I get this to work when the ID has a space in it. I know it isnt ideal to have a space in an ID or Name but it is what it is currently and I need to get the multiple select options from the ID with a space. so example: 1 2 3 $(function() { $('#test two').change(function() { console.log($(this).val()); }).multipleSelect({ width: '100%' }); }); this fails with the space in it. I have tried a few options like below without any success. any advice appreciated a always. $(function() { $("#test two").change(function() { console.log($(this).val()); }).multipleSelect({ width: '100%' }); });
answer count: 5
has comment: http://stackoverflow.com/comment/47495148
has answer: http://stackoverflow.com/a/29678966
possible better answer: http://stackoverflow.com/a/29678973
has answer: http://stackoverflow.com/a/29679073
has answer: http://stackoverflow.com/a/29678973
accepted answer: http://stackoverflow.com/a/29679073
has comment: http://stackoverflow.com/comment/47495659
has comment: http://stackoverflow.com/comment/47495134
type: AnsweredQuestion
has title: jquery reference ID with space in name
has comment: http://stackoverflow.com/comment/47495099
type: Question

http://stackoverflow.com/comment/47338740
has text: @Gofoboso I think that comment was for a different question
comment on: http://stackoverflow.com/q/29595593
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47230814
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29538777
has text: But the idea is not to store the concatenated text, it would be just to extract the parts you need from it with the regular expression and then use the output of the regular expression instead. Also, note that concatenation isn't fully necessary, you could perform the regular expression for each one of the files and then perform your logic with each of the outputs. I just mentioned that way because it would be the easiest perform for the simplest case.
type: AnswerComment

http://stackoverflow.com/comment/47288405
comment on: http://stackoverflow.com/q/29569435
score: 0
type: Comment
has text: @TimLewis Sorry, I added more info.
type: QuestionComment

http://stackoverflow.com/a/29642201
has body: Wrap the script code inside document.ready function like: $(document).ready(function(){ alert("I am an alert box!"); $("div").click(function(){ alert("test1"); }); $(".btn-green").click(function(){ alert("test2"); }); });
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29642141

http://stackoverflow.com/q/29603507
possible better answer: http://stackoverflow.com/a/29605827
has answer: http://stackoverflow.com/a/29605827
tagged with: http://stackoverflow.com/tag/html
tagged with: http://stackoverflow.com/tag/xml
score: 2
upvote count: 2
has body: I can not write XML data into my HTML page. It seems it's not even reading, because it doesn't even alert. What part am I missing ? My XML: <ProgramOgrenmeCiktilari> Bilgi <Title> Kuramsal, Olgusal - Matematik, fen bilimleri ve ilgili mühendislik disiplinine özgü konularda yeterli bilgi birikimi;... Beceriler <Title> Bilişsel, Uygulamalı - Karmaşık bir sistemi, süreci, cihazı veya ürünü gerçekçi kısıtlar ve koşullar altında,... Yetkinlikler <Title> Bağımsız Çalışabilme ve Sorumluluk Alabilme Yetkinliği - Disiplin içi ve çok disiplinli... </ProgramOgrenmeCiktilari> jQuery part $(document).ready(function () { /* here goes some other codes about other buttons... */ $("#program").click(function () { $.get('ProgramOgrenmeCiktilari.xml', function (data) { $(xml).find('Category').each(function () { var TopTitle = $(this).find('TopTitle').text(); var Title = $(this).find('Title').text(); var Text = $this.find('Text').text(); var html = ' TopTitle '; html += ' Title Text '; $(".kutu_icerik").html(data); }); }); }); });
has comment: http://stackoverflow.com/comment/47352762
type: Question
type: AnsweredQuestion
tagged with: javascript
has answer: http://stackoverflow.com/a/29603846
has title: Getting XML Data with jQuery
answer count: 2
downvote count: 0
accepted answer: http://stackoverflow.com/a/29603846
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47353009

jquery-mobile
tags question: http://stackoverflow.com/q/29548339
tags question: http://stackoverflow.com/q/29685043
tags question: http://stackoverflow.com/q/29639176
tags question: http://stackoverflow.com/q/29600180
type: Tag
tags question: http://stackoverflow.com/q/29655697
tags question: http://stackoverflow.com/q/29687526
tags question: http://stackoverflow.com/q/29541441
tags question: http://stackoverflow.com/q/29535200
tags question: http://stackoverflow.com/q/29615117
tags question: http://stackoverflow.com/q/29579584
tags question: http://stackoverflow.com/q/29558435
tags question: http://stackoverflow.com/q/29664636
tags question: http://stackoverflow.com/q/29559013
tags question: http://stackoverflow.com/q/29650549
tags question: http://stackoverflow.com/q/29644612
tags question: http://stackoverflow.com/q/29545112
tags question: http://stackoverflow.com/q/29611125
tags question: http://stackoverflow.com/q/29579328
tags question: http://stackoverflow.com/q/29651160
tags question: http://stackoverflow.com/q/29552951
tags question: http://stackoverflow.com/q/29636593
tags question: http://stackoverflow.com/q/29600064
tag name: jquery-mobile

http://stackoverflow.com/comment/47368764
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29611130
has text: @Top25 `navBarElement.css("width", "1000px")` ?

http://stackoverflow.com/q/29580042
downvote count: 2
has answer: http://stackoverflow.com/a/29580321
type: AnsweredQuestion
has body: I have a simple Thursday through Sunday button layout and I would like to be able to add markers (and subsequently remove them) based on which button is pressed. If Friday is pressed, it removes the existing markers (if there are any) and adds data tied to Friday. Here is my code: function initialize() { var mapOptions = { zoom: 12, center: newYork, disableDefaultUI: true, mapTypeControlOptions: google.maps.MapTypeId.SATELLITE }; map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); } function loadMarkers(val) { marker = new google.maps.Marker({ position: val, map: map, title: "Hi there!" }); } $(document).ready(function() { google.maps.event.addDomListener(window, 'load', initialize); $('#thurs').on('click', function() { if(!marker) { loadMarkers(newYork); console.log(marker); } else if(marker) { marker.setMap(null); } }); }) On the first click, the marker is added; the second click removes the marker, but subsequent clicks do nothing.
accepted answer: http://stackoverflow.com/a/29580321
type: Question
tagged with: google-maps
upvote count: 0
score: -2
answer count: 1
tagged with: javascript
tagged with: google-maps-api-3
has title: How can I add and effectively delete google map markers with buttons?
favorite count: 0

http://stackoverflow.com/comment/47439482
score: 0
comment on: http://stackoverflow.com/q/29649817
type: Comment
has text: If you can add fiddle, than we can help you in better way..
type: QuestionComment

http://stackoverflow.com/q/29532094
favorite count: 0
has body: For recursion practice/fun I was hoping to build a recursive function that would execute a deep compare of two unique objects. My code thus far, with pseudo-code comments. I think my error is possibly in my understanding of delete because the recursion isn't solving a reduced size of obj1 and obj2. function deepCompare(obj1, obj2) { //Base Cases if (obj1 === obj2) { return true; }; if (Object.keys(obj1).length !== Object.keys(obj2).length) { return false; }; //Getting arbitrary key of obj1 var key = Object.keys(obj1)[0]; //Check to see if key is in obj2 if (obj2.hasOwnProperty(key)) { //Check equality of value at key if (obj2.key == obj1.key) { //Remove key/value pair from each object, recursively call delete obj2.key; delete obj1.key; deepCompare(obj1, obj2); } else { return false; } } else { return false; } }
has answer: http://stackoverflow.com/a/29533991
type: AnsweredQuestion
score: 3
downvote count: 0
type: Question
tagged with: recursion
has answer: http://stackoverflow.com/a/29536321
accepted answer: http://stackoverflow.com/a/29536321
tagged with: algorithm
tagged with: javascript
tagged with: comparison
has title: Recursive Deep Compare
possible better answer: http://stackoverflow.com/a/29533991
upvote count: 3
answer count: 2

http://stackoverflow.com/q/29643760
has body: I have written the below code to click a skip button and to goto a certain frame in Flash cc. Now I want to use the skip button to navigate to another html file. How can I do that? /*JavaScript*/ this.skipBtn.addEventListener("click", fl_ClickToGoToAndStopAtFrame.bind(this)); function fl_ClickToGoToAndStopAtFrame() { this.gotoAndPlay(5);//to go to a particular frame }
has answer: http://stackoverflow.com/a/29691607
type: AnsweredQuestion
downvote count: 0
type: Question
score: 1
tagged with: flash
upvote count: 1
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29691607
favorite count: 0
has title: navigating to another scene using javascript in flash

http://stackoverflow.com/q/29661449
has answer: http://stackoverflow.com/a/29661636
score: 0
answer count: 2
upvote count: 1
downvote count: 1
has title: How to convert an object into nested object
accepted answer: http://stackoverflow.com/a/29661513
has comment: http://stackoverflow.com/comment/47462593
has comment: http://stackoverflow.com/comment/47462826
type: AnsweredQuestion
tagged with: javascript
favorite count: 0
has body: How can I transform the following: { Eldoret: "900", Nairobi: "1900" } into: [ { y:"Eldoret", a: 900 }, { y:"Nairobi", a:1900 } ] using JavaScript. I've tried using the following snippet but it just picks on the last property for(var key in data3){ if(data3.hasOwnProperty(key)){ data_obj.y = key; data_obj.a = data3[key]; } Output: { y: "Nairobi", a: "1900" }
has answer: http://stackoverflow.com/a/29661513
type: Question
possible better answer: http://stackoverflow.com/a/29661636

http://stackoverflow.com/q/29673162
upvote count: 4
answer count: 2
has answer: http://stackoverflow.com/a/29673256
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/47483940
tagged with: http://stackoverflow.com/tag/html
tagged with: css
possible better answer: http://stackoverflow.com/a/29673345
has body: I am trying to make a text-area resizable with this code: ...contents... However, it's not working, and I can't find out why (it should be that simple, right?). Besides, is there any CSS property or similar to make the window always fit the window size? Thanks a lot.
has answer: http://stackoverflow.com/a/29673345
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29673256
has comment: http://stackoverflow.com/comment/47483885
has title: Can't make text-area resizable to fit windows size
type: Question
has comment: http://stackoverflow.com/comment/47484245
tagged with: javascript
score: 4

http://stackoverflow.com/comment/47227027
type: AnswerComment
has text: if one clicks 'true' on question number 1 of the latter example, the result should be one selected option only
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29532215

http://stackoverflow.com/q/29615117
type: Question
score: -1
has body: On a desktop, my code works. I need to adapt it for mobile and am not having any luck. I tried jQuery mobile tap and taphold without any luck. I would like the user to be able to tap anywhere on the screen and show a hidden image. I actually have about 20 divs,each containing an image, but I want to only show one at a time. For desktop, I am using keyup/keydown and it works perfectly. JSFiddle $(window).on('keydown', function(e) { $(data-key=" ' + e.which + ' ").show();
has comment: http://stackoverflow.com/comment/47375549
has comment: http://stackoverflow.com/comment/47502259
has comment: http://stackoverflow.com/comment/47500432
answer count: 1
downvote count: 1
tagged with: http://stackoverflow.com/tag/gif
has comment: http://stackoverflow.com/comment/47407077
has title: How can I use jQuery Mobile to show a gif on touch?
has comment: http://stackoverflow.com/comment/47421446
type: UnansweredQuestion
tagged with: touch
has comment: http://stackoverflow.com/comment/47376089
has answer: http://stackoverflow.com/a/29687845
upvote count: 0
has comment: http://stackoverflow.com/comment/47376599
tagged with: jquery-mobile
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47379944
favorite count: 0

http://stackoverflow.com/comment/47343471
type: Comment
comment on: http://stackoverflow.com/a/29598440
type: AnswerComment
score: 0
has text: Sorry, the question is about how to open the dropdown option list when you click on the icon instead of showing the icon. Thanks!

http://stackoverflow.com/a/29543525
upvote count: 1
answers question: http://stackoverflow.com/q/29543437
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/47242242
score: 1
has body: You could pass your form into javascript onsubmit callback using this keyword. It gives you possibility to submit your form from code. Try this: Change Password JS:

http://stackoverflow.com/q/29650291
answer count: 2
has title: How to send model parameter to js in ASP net?
has answer: http://stackoverflow.com/a/29652609
linked to: http://stackoverflow.com/q/6201529
tagged with: asp.net-mvc
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/50122739
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29650979
has comment: http://stackoverflow.com/comment/47441916
tagged with: asp.net
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47468031
has answer: http://stackoverflow.com/a/29650979
has body: I need to send model parameter from div to script. This is my not working .cshtml file @model List&lt;Dialog&gt; @foreach (Dialog dialog in Model) { &lt;div onclick="SelectDialog(@dialog)"&gt;&lt;/div&gt; } &lt;script&gt; function SelectDialog(dialog) { //work with dialog } &lt;/script&gt; How can I send current dialog from view to script?
type: Question
possible better answer: http://stackoverflow.com/a/29652609

http://stackoverflow.com/a/29667777
has body: This should do the trick Fiddle $(function(){ var active_menu = "menu2"; $('#'+active_menu).addClass('active'); $('#'+active_menu).find('a').addClass('active'); });
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/29667551
downvote count: 0

http://stackoverflow.com/comment/47235520
comment on: http://stackoverflow.com/q/29541519
score: 0
type: Comment
type: QuestionComment
has text: [Why does jQuery or a DOM method such as getElementById not find the element?](http://stackoverflow.com/questions/14028959/why-does-jquery-or-a-dom-method-such-as-getelementbyid-not-find-the-element)

http://stackoverflow.com/q/29532423
has comment: http://stackoverflow.com/comment/47218004
has title: ng-bind and ng-href issue. ng-href not loading data from controller?
score: -1
upvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/29532591
tagged with: http://stackoverflow.com/tag/html
has body: I'm not able to figure out why ng-href is not loading data from controller? And Code is as follows: {{myurl}} Questions are 1. Without ng-bind, the expression {{myurl}} (innerHtml) is not getting displayed, i.e. it is not loading data from controller. Why? 2. And even with ng-bind, ng-href expression is not loading data from controller. Why? Where is my code doing wrong? Not able to figure out why the is not becoming clickable.
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47218268
has comment: http://stackoverflow.com/comment/47218014
downvote count: 1
type: Question

typeahead
type: Tag
tags question: http://stackoverflow.com/q/29619524
tag name: typeahead

http://stackoverflow.com/comment/47322605
has text: Well, as @slash197 pointed out, you are not passing id to showItems() so it currently has nothing to loop on.
comment on: http://stackoverflow.com/q/29587391
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29588466
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47325049
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: So when I get HTML and CSS validated, it's not required to be indented to pass validation. However, when I get JS validated, it needs to be indented to pass. I don't indent any of my code because practically all my pages are relatively short and simple so I actually find it more effort and a waste of space to indent. However, is it especially important that I do so for JS? Is there a reason it's required for JS but not HTML or CSS?
downvote count: 0
has comment: http://stackoverflow.com/comment/47324384
has title: HTML/CSS Indentation Optional, JS Indentation Mandatory?
has comment: http://stackoverflow.com/comment/47325013
has comment: http://stackoverflow.com/comment/47324365
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47324882
has comment: http://stackoverflow.com/comment/47324418
score: 1
has answer: http://stackoverflow.com/a/29588939
accepted answer: http://stackoverflow.com/a/29588939
type: Question
upvote count: 1

http://stackoverflow.com/a/29547968
accepted answer of: http://stackoverflow.com/q/29547586
downvote count: 0
score: 1
has body: Here is an option: http://jsfiddle.net/sh1fcygt/1/ Launch the modal though data attributes in the '.show-report' button. function reportFormatter(row, cell, value, columnDef, dataContext) { return " show ";} Comment the modal show in subscribe event. grid.onClick.subscribe(function(e,args) { if ($(e.target).hasClass('show-report')) { //$('#myModal').modal('show');
upvote count: 1
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/29547586

http://stackoverflow.com/comment/47505219
has text: PS - there's no reason to call `path.join` if you're going to use forward slashes in the second argument instead of breaking it up into multiple arguments ;) `path.join(__dirname, '..', 'config', 'xlsImport')`
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29682792

imagemagick
tags question: http://stackoverflow.com/q/29537155
type: Tag
tag name: imagemagick

http://stackoverflow.com/q/29679944
tagged with: javascript
score: 0
has body: I'm riding a chart using Kendo UI, however necessary that the category x-axis is a month, and what defines the beginning and the end are the startDate and endDate field Postgres database. Example: startDate: 02/15/2015 enddate: 04/15/2016 Then the x axis of the category will be Feb / 2015 Mar / 2015 ..., Apr / 2016 Below the code, see that the months are fixed, but want it to be in accordance with the start and end fields of the database. &lt;Div id="chart" style="width: 1000px; altura: 2000px"&gt;&lt;/div&gt; &lt;script&gt; var dataSource = new kendo.data.DataSource({ transport : { read : { url : "rest/project", contentType : "application/json; charset=utf-8", dataType : "jsonp" } } }); console.log(dataSource); eixox = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ]; $("#chart").kendoChart({ title : { text : "Dashboard Project" }, legend : { position : "bottom" }, seriesDefaults : { type : "line" }, series : [ { name : "Atual", data : [ 20, 16.7, 20, 23.5, 26.6 ] }, { name : "Planejado", data : [ 67.96, 68.93, 75, 74, 78 ] } ], valueAxis : { labels : { format : "{0}$" } }, //VALORES DO EIXO X categoryAxis : { categories : eixox, crosshair : { tooltip : { format : "Month: {0}", visible : true }, visible : true } }, });
answer count: 1
has title: How to get data from the database to set the chart's x axis using kendo ui
tagged with: kendo-ui
tagged with: postgresql
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29829419
type: Question

datetimepicker
type: Tag
tag name: datetimepicker
tags question: http://stackoverflow.com/q/29531498

http://stackoverflow.com/a/29534953
type: Answer
answers question: http://stackoverflow.com/q/29534612
score: 1
upvote count: 1
downvote count: 0
has body: You need to use $location.search() This returns an object with your params so lets say you have url?param1=val&amp;param2=val2 This will give the following back { param1 : val, param2 : val2 } Also make sure you enable $locationProvider.html5Mode(true);

c#
tags question: http://stackoverflow.com/q/29560523
tags question: http://stackoverflow.com/q/29634398
tags question: http://stackoverflow.com/q/29633293
tags question: http://stackoverflow.com/q/29680366
tags question: http://stackoverflow.com/q/29597694
tags question: http://stackoverflow.com/q/29577234
tags question: http://stackoverflow.com/q/29663946
tags question: http://stackoverflow.com/q/29632352
tags question: http://stackoverflow.com/q/29630587
tags question: http://stackoverflow.com/q/29638932
tags question: http://stackoverflow.com/q/29546562
tags question: http://stackoverflow.com/q/29628174
tags question: http://stackoverflow.com/q/29640380
tag name: c#
tags question: http://stackoverflow.com/q/29672517
tags question: http://stackoverflow.com/q/29591336
tags question: http://stackoverflow.com/q/29669600
tags question: http://stackoverflow.com/q/29640889
tags question: http://stackoverflow.com/q/29680163
tags question: http://stackoverflow.com/q/29626580
tags question: http://stackoverflow.com/q/29630057
tags question: http://stackoverflow.com/q/29556088
tags question: http://stackoverflow.com/q/29658433
tags question: http://stackoverflow.com/q/29602069
tags question: http://stackoverflow.com/q/29563950
tags question: http://stackoverflow.com/q/29591145
tags question: http://stackoverflow.com/q/29539802
tags question: http://stackoverflow.com/q/29655527
tags question: http://stackoverflow.com/q/29651531
tags question: http://stackoverflow.com/q/29587931
tags question: http://stackoverflow.com/q/29680485
tags question: http://stackoverflow.com/q/29561445
tags question: http://stackoverflow.com/q/29562882
tags question: http://stackoverflow.com/q/29551137
tags question: http://stackoverflow.com/q/29573636
tags question: http://stackoverflow.com/q/29566649
tags question: http://stackoverflow.com/q/29629679
tags question: http://stackoverflow.com/q/29678314
tags question: http://stackoverflow.com/q/29626073
tags question: http://stackoverflow.com/q/29685822
tags question: http://stackoverflow.com/q/29592768
tags question: http://stackoverflow.com/q/29539921
tags question: http://stackoverflow.com/q/29627279
tags question: http://stackoverflow.com/q/29666492
tags question: http://stackoverflow.com/q/29673121
tags question: http://stackoverflow.com/q/29561092
tags question: http://stackoverflow.com/q/29552752
tags question: http://stackoverflow.com/q/29542605
tags question: http://stackoverflow.com/q/29598213
tags question: http://stackoverflow.com/q/29678922
tags question: http://stackoverflow.com/q/29538635
tags question: http://stackoverflow.com/q/29643479
tags question: http://stackoverflow.com/q/29623767
tags question: http://stackoverflow.com/q/29660561
tags question: http://stackoverflow.com/q/29559142
tags question: http://stackoverflow.com/q/29664706
tags question: http://stackoverflow.com/q/29589165
tags question: http://stackoverflow.com/q/29645836
tags question: http://stackoverflow.com/q/29553692
tags question: http://stackoverflow.com/q/29630214
tags question: http://stackoverflow.com/q/29604673
tags question: http://stackoverflow.com/q/29568140
tags question: http://stackoverflow.com/q/29617257
tags question: http://stackoverflow.com/q/29586824
tags question: http://stackoverflow.com/q/29536889
type: Tag
tags question: http://stackoverflow.com/q/29568554
tags question: http://stackoverflow.com/q/29677392
tags question: http://stackoverflow.com/q/29604893
tags question: http://stackoverflow.com/q/29609428
tags question: http://stackoverflow.com/q/29583576
tags question: http://stackoverflow.com/q/29604631
tags question: http://stackoverflow.com/q/29657649
tags question: http://stackoverflow.com/q/29627023
tags question: http://stackoverflow.com/q/29586983
tags question: http://stackoverflow.com/q/29667124
tags question: http://stackoverflow.com/q/29578250
tags question: http://stackoverflow.com/q/29620091
tags question: http://stackoverflow.com/q/29668160
tags question: http://stackoverflow.com/q/29604859

date
tags question: http://stackoverflow.com/q/29674247
tags question: http://stackoverflow.com/q/29577879
tags question: http://stackoverflow.com/q/29568140
tag name: date
tags question: http://stackoverflow.com/q/29614408
tags question: http://stackoverflow.com/q/29577234
tags question: http://stackoverflow.com/q/29683349
tags question: http://stackoverflow.com/q/29545687
tags question: http://stackoverflow.com/q/29594594
tags question: http://stackoverflow.com/q/29538673
tags question: http://stackoverflow.com/q/29616687
tags question: http://stackoverflow.com/q/29563865
type: Tag
tags question: http://stackoverflow.com/q/29550806
tags question: http://stackoverflow.com/q/29627533
tags question: http://stackoverflow.com/q/29651815
tags question: http://stackoverflow.com/q/29675884
tags question: http://stackoverflow.com/q/29533373
tags question: http://stackoverflow.com/q/29662359
tags question: http://stackoverflow.com/q/29544582
tags question: http://stackoverflow.com/q/29663098
tags question: http://stackoverflow.com/q/29630754
tags question: http://stackoverflow.com/q/29597653
tags question: http://stackoverflow.com/q/29680859

http://stackoverflow.com/comment/47522800
has text: I've got an answer saying that grunt does the deduplication, not concat. Which means there's probably no way to achieve this through plugin settings.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29685644
type: Comment

http://stackoverflow.com/q/29563369
has title: How to call jsbeautifier from Java/scala?
has comment: http://stackoverflow.com/comment/68456885
tagged with: js-beautify
type: UnansweredQuestion
tagged with: scala
has answer: http://stackoverflow.com/a/29563647
has body: I want to format some json files from Java code, and I want to use the famous http://jsbeautifier.org library. I followed this question: Call external javascript functions from java code , but can't find a correct function to call. I tried inv.invokeFunction("js_beautify", json), but it reports: java.lang.NoSuchMethodException: no such method: js_beautify My code (actually it's Scala, but just using Java API): val manager = new ScriptEngineManager() val engine = manager.getEngineByName("JavaScript") // read script file engine.eval(FileUtils.readFileToString(new File("beautify.js"))) val inv = engine.asInstanceOf[Invocable] // call function from script file inv.invokeFunction("js_beautify", json).asInstanceOf[String] And the structure of file beautify.js is: (function() { // a lot of js code // ... if (typeof define === "function" &amp;&amp; define.amd) { // Add support for AMD ( https://github.com/amdjs/amdjs-api/wiki/AMD#defineamd-property- ) define([], function() { return { js_beautify: js_beautify }; }); } else if (typeof exports !== "undefined") { // Add support for CommonJS. Just put this file somewhere on your require.paths // and you will be able to `var js_beautify = require("beautify").js_beautify`. exports.js_beautify = js_beautify; } else if (typeof window !== "undefined") { // If we're running a web page and don't have either of the above, add our one global window.js_beautify = js_beautify; } else if (typeof global !== "undefined") { // If we don't even have window, try global. global.js_beautify = js_beautify; } }()); Maybe I need to provide some global or window context from Java? Update: I followed the "JSBeautify NetBeans plugin" from @tiblu's answer: class FormatJson { def apply(json: String): String = { val context = Context.enter() context.setLanguageVersion(Context.VERSION_1_6) val scope = context.initStandardObjects() val reader = new FileReader(new File("beautify.js")) context.evaluateReader(scope, reader, "Beautify", 1, null) val fct = scope.…
tagged with: java
type: Question
score: 0
linked to: http://stackoverflow.com/q/18985
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47276464
has comment: http://stackoverflow.com/comment/68450491
linked to: http://stackoverflow.com/q/22856279

http://stackoverflow.com/a/29574633
type: Answer
has body: The console readout gave a clue: Failed to load resource: net::ERR_INSECURE_RESPONSE You're loading your fiddle via https, but the YUI script is via http. Just chop off the s in your address bar and you're golden :)
has comment: http://stackoverflow.com/comment/47298204
has comment: http://stackoverflow.com/comment/47298158
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29574292
answers question: http://stackoverflow.com/q/29574292
has comment: http://stackoverflow.com/comment/47342811

http://stackoverflow.com/comment/47452210
comment on: http://stackoverflow.com/q/29655780
score: 0
has text: @AaditMShah What is the difference?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47457976
type: Comment
comment on: http://stackoverflow.com/a/29658971
score: 0
type: AnswerComment
has text: Welcome to JavaScript :) The idea behind the NaN inequality is that several mathematical operations return NaN, and it wouldn't make sense if 0/0 were equal to sqrt(-1), for example. So the language needs something else to check for NaN.

http://stackoverflow.com/a/29654034
has comment: http://stackoverflow.com/comment/47454756
has comment: http://stackoverflow.com/comment/47459753
has comment: http://stackoverflow.com/comment/47448136
has comment: http://stackoverflow.com/comment/47482082
type: Answer
has comment: http://stackoverflow.com/comment/47448295
downvote count: 0
has comment: http://stackoverflow.com/comment/47458413
answers question: http://stackoverflow.com/q/29653725
score: 3
accepted answer of: http://stackoverflow.com/q/29653725
upvote count: 3
has body: You don't need the continue. And make sure to return 0 when the objects are a match: rows.sort (a, b) -&gt; for key, value of a if a[key] &lt; b[key] return -1 else if a[key] &gt; b[key] return 1 return 0 The larger problem - object keys aren't sorted. There's no reason to expect, each time through the for loop, that the first key will be date, the second will be cpc, etc. You really want to have a predefined array of the keys, in order, and use that instead of just getting the key list from the objects keys = ["a","b","c"] rows.sort (a, b) -&gt; for key in keys if a[key] &lt; b[key] return -1 else if a[key] &gt; b[key] return 1 return 0 Example
has comment: http://stackoverflow.com/comment/47449658
has comment: http://stackoverflow.com/comment/47450857
type: AcceptedAnswer

http://stackoverflow.com/comment/47370768
score: 0
type: AnswerComment
has text: @Nikola Yes, it's opposite of what you have read. If you notice, the authors who write such things probably don't care about performance at all when they make these claims.
comment on: http://stackoverflow.com/a/29612440
type: Comment

http://stackoverflow.com/comment/47472654
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29666723
has text: As per the document it is just preparing the form. Not submitting it - **Prepares a form to be submitted via AJAX by adding all of the necessary event listeners. It does not submit the form. Use ajaxForm in your document's ready function to prepare your form(s) for AJAX submission. ajaxForm takes zero or one argument. The single argument can be either a callback function or an Options Object.**

http://stackoverflow.com/comment/47320248
score: 0
has text: When I try to scroll up the chatbox, it always goes down. which is not good for making chatbox
type: Comment
comment on: http://stackoverflow.com/a/29585990
type: AnswerComment

http://stackoverflow.com/a/29551500
score: 0
has comment: http://stackoverflow.com/comment/47294076
answers question: http://stackoverflow.com/q/29551347
has comment: http://stackoverflow.com/comment/47421955
has body: There's probably an error in your code. It's probably coming from line: var itemDataRange = ss.getRangeByName("itemInformation"); Your variable ss is not a spreadsheet class, it's a sheet class. You can't get a RangeByName of a sheet class. There is no getRangeByName() method of the Sheet class. I'd change your code to this: var ss = SpreadsheetApp.getActiveSpreadsheet(); var itemDataRange = ss.getRangeByName("itemInformation"); If you need to get the first sheet: var theFirstSheet = ss.getSheets()[0];
has comment: http://stackoverflow.com/comment/47275856
has comment: http://stackoverflow.com/comment/47277917
type: Answer
has comment: http://stackoverflow.com/comment/47295695

http://stackoverflow.com/comment/47262201
score: 0
type: QuestionComment
type: Comment
has text: Yes, since its bound to an angular array, with 'x' values, it needs to be dynamic, as i have mentioned above
comment on: http://stackoverflow.com/q/29555627

http://stackoverflow.com/comment/47347496
score: 0
comment on: http://stackoverflow.com/a/29583493
type: AnswerComment
type: Comment
has text: ok it's done, but the problem no is how to get the value of "c" in the ModifyStructure.html page ?

http://stackoverflow.com/q/29555088
has comment: http://stackoverflow.com/comment/47260912
has answer: http://stackoverflow.com/a/29555178
has comment: http://stackoverflow.com/comment/47260922
has answer: http://stackoverflow.com/a/29555172
favorite count: 0
has comment: http://stackoverflow.com/comment/47260929
answer count: 4
has answer: http://stackoverflow.com/a/29555161
type: AnsweredQuestion
has title: The importance of brackets
has comment: http://stackoverflow.com/comment/47260869
downvote count: 2
accepted answer: http://stackoverflow.com/a/29555161
upvote count: 1
has comment: http://stackoverflow.com/comment/47260902
type: Question
possible better answer: http://stackoverflow.com/a/29555267
has answer: http://stackoverflow.com/a/29555267
has body: I am currently learning javascript basics through code school.com, and i am having difficulty understanding some basic things. Within this code: var numSheep = 4; var monthsToPrint = 12; for (var monthNumber = 1; monthNumber &lt;= monthsToPrint; monthNumber++) { if (numSheep &gt; 10000) { numSheep / 2; console.log("Removing " + numSheep + " sheep from the population.");} numSheep *= 4; console.log("There will be " + numSheep + " sheep after " + monthNumber + " month(s)!"); } Why does the bracket after (numSheep &gt; 10000) change my output so much? Sorry for the simple question, and thank you for your patience.
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/47260881

http://stackoverflow.com/q/29590957
downvote count: 0
tagged with: javascript
favorite count: 0
has title: Querying A Column In User Object Using Parse - Java Script
has answer: http://stackoverflow.com/a/29591628
tagged with: http://stackoverflow.com/tag/html
score: 2
tagged with: parse-platform
upvote count: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29591628
has body: Hey guys i am having a small issue with Parse for Javascript at the moment, I have used Parse before but for Android and for some reason found it more easier to understand than using it with Javascript. My current issue is that I am trying to query the User object in my parse database to see whether or not they are an admin or not by checking to see in the "role" column has an integer of 1 or 2. 1 representing a Admin and 2 representing an ordinary user. If I can remember correctly querying a User is different from querying a normal object in the database, So I am unsure why this query does not carry out correctly. If i take out the query the function works fine and displays the set message of "welcome" in an alert box but when I add in the query it doesnt seem to carry out the function. My table in the database looks like this: My current code is as follows: $('.form-signin').on('submit', function(e) { // Prevent Default Submit Event e.preventDefault(); // Get data from the form and put them into variables var data = $(this).serializeArray(), username = data[0].value, password = data[1].value; // Call Parse Login function with those variables Parse.User.logIn(username, password, { // If the username and password matches var query = new Parse.Query(Parse.User); query.equalTo("role", 1); //finding the role number query.find({ success: function(user) { alert('Welcome!'); }, // If there is an error error: function(user, error) { console.log(error); } }); }); });
type: Question
answer count: 1

http://stackoverflow.com/a/29625258
has body: You can work with max-height. .item { max-height:100%; } .collapse { max-height: 64px; } http://jsfiddle.net/L8hktsgn/9/
upvote count: 2
score: 1
downvote count: 1
answers question: http://stackoverflow.com/q/29625037
type: Answer

http://stackoverflow.com/comment/47472201
type: Comment
has text: *for..in* over Array with no *hasOwnProperty* guard or check for numeric properties is not robust, particularly when polyfills for ES5 methods are likely to abound. ;-)
type: AnswerComment
comment on: http://stackoverflow.com/a/29666661
score: 0

http://stackoverflow.com/comment/47319028
type: Comment
score: 0
has text: `list[0].map(function(a){ return list[1].map(function(b){ return [a, b];});});`
type: QuestionComment
comment on: http://stackoverflow.com/q/29585401

http://stackoverflow.com/comment/47237884
has text: Can you please provide a full example.. as in the page your putting this in to. Ideally a jsFiddle so we can work with your example. You would be better of creating a new script tag instead of using prepend..
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29543086
score: 2

http://stackoverflow.com/comment/91520652
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29569013
type: Comment
has text: yep, its the initalising `{}` that i wasn't doing that fixed it.

http://stackoverflow.com/q/29561667
accepted answer: http://stackoverflow.com/a/29561718
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47273142
tagged with: http://stackoverflow.com/tag/html
answer count: 7
has title: Show and hide div jQuery
tagged with: css
favorite count: 0
has answer: http://stackoverflow.com/a/29561779
upvote count: 2
has answer: http://stackoverflow.com/a/29561899
has answer: http://stackoverflow.com/a/29562111
has answer: http://stackoverflow.com/a/29561844
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/29561810
has body: I have about this structure: HTML: Button Content Button Content jQuery: $(document).ready(function () { $('.a').click(function () { if ($('.b').is(":visible")) { $('.b').hide(); } else { $('.b').show(); } return false; }); }); How to make that shows only the div on which I clicked JSFiddle.
has answer: http://stackoverflow.com/a/29561718
possible better answer: http://stackoverflow.com/a/29561810
type: Question
has answer: http://stackoverflow.com/a/29561814

http://stackoverflow.com/q/29545652
has answer: http://stackoverflow.com/a/29545800
has answer: http://stackoverflow.com/a/29545748
answer count: 5
tagged with: http://stackoverflow.com/tag/html
has title: jQuery swap image on hover, then replace it with original on hover off
has answer: http://stackoverflow.com/a/29545855
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/29545729
accepted answer: http://stackoverflow.com/a/29545729
has body: I am using the following code to swap an image src out on hover of the child's parent. How can I save the original source in a variable and on hover off return the image to its original source? $("#parent span").hover(function(){ var currentImage = $('img', this ).attr("src","images/orbs/yellowBar.png"); $('img', this ).attr("src","images/yellowBar.png"); },function(){ $('img', this ).attr("src",currentImage); });
type: Question
tagged with: javascript
upvote count: 3
has comment: http://stackoverflow.com/comment/47242822
has answer: http://stackoverflow.com/a/29545834
downvote count: 1
tagged with: jquery
possible better answer: http://stackoverflow.com/a/29545834
favorite count: 0

http://stackoverflow.com/comment/47268123
comment on: http://stackoverflow.com/a/29558646
score: 0
type: AnswerComment
has text: Thanks, I suspected so.
type: Comment

http://stackoverflow.com/a/29540002
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29539863
has body: This is how they do it. Just do the same but append any word from you list of words as you like. It's not clear how you're supposed to select what words to add. Specify that and we can be more helpful. var form = document.querySelector('form'); var input = document.getElementById('field'); form.addEventListener('submit', function(ev) { ev.preventDefault(); var redirect = 'https://google.com/search?q=zlatan+' + input.value; window.location = redirect; });
accepted answer of: http://stackoverflow.com/q/29539863
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/47232081
upvote count: 1
has comment: http://stackoverflow.com/comment/47232624
has comment: http://stackoverflow.com/comment/47264309

http://stackoverflow.com/comment/47517615
type: Comment
has text: P.S. Only helping you out so much since I'm going to start using your site! :)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29617906

http://stackoverflow.com/comment/47370155
type: QuestionComment
has text: Why don't you just use a new method, `object.setInfo(name, edition, year)`?
score: 3
comment on: http://stackoverflow.com/q/29612316
type: Comment

http://stackoverflow.com/comment/47455610
score: 0
comment on: http://stackoverflow.com/q/29657972
type: Comment
type: QuestionComment
has text: Check this out: http://stackoverflow.com/questions/11237936/mobile-web-disable-long-touch-taphold-text-selection

http://stackoverflow.com/a/29621959
score: 2
has comment: http://stackoverflow.com/comment/47396349
has comment: http://stackoverflow.com/comment/47390751
downvote count: 0
answers question: http://stackoverflow.com/q/29621501
type: Answer
has body: Since you have tagged jquery I would suggest you to use jquery animate and I've tried something like below which gives a smooth movement but to make it perfect you need work little bit on that. You can also include jquery-easing.js and do more perfect operations on animations. Give a try. Same stands for your jump and drop. animate will help you in the said scenarios. function avancerRight() { var batman=document.getElementById("batman"); x=batman.style.left; batman.className="dirDroite"; $(batman)..stop().animate({left: parseInt(x)+10+'px'}); //this change //batman.style.left=parseInt(x)+10+"px"; return false; } function avancerLeft() { console.log("dedede"); var batman=document.getElementById("batman"); x=batman.style.left; batman.className="dirGauche"; $(batman).stop().animate({left: parseInt(x)-10+'px'});//this change //batman.style.left=parseInt(x)-10+"px"; return false; } var jumpHeight = 200; var jumping = false; function jump() { if (!jumping) { jumping = true; setTimeout(land, 500); } if (jumping) { y=batman.style.top; batman.style.top=parseInt(y)-jumpHeight+"px"; } } function land() { jumping=false; y=batman.style.top; batman.style.top=parseInt(y)+jumpHeight+"px"; } body { padding: 0; margin: 0; background: url('http://image.noelshack.com/fichiers/2015/16/1428996568-bg.png'); background-color: #B4381F; background-repeat: no-repeat; background-attachment: fixed; background-size: 100%; background-position: 50% 30%; } #batman{ background-image:url('http://image.noelshack.com/fichiers/2015/16/1428996568-batman.png'); width:85px; height:85px; display:block; background-repeat: no-repeat; position:absolute; margin-top: -80px; } .dirDroite{ background-position: -95px 0px; } .dirGauche{ background-position: 0px 0px; } #fullbody { margin: auto; width: 100%; height: 100%; } #floor { position: absolute; right: 0; bottom: 0; left: 0; background: url("http://image.noelshack.com/fichiers/2015/16/1428996568-platform5.png"); background-repeat: repeat-x; background-size: 10…
has comment: http://stackoverflow.com/comment/47395633
has comment: http://stackoverflow.com/comment/47388320
upvote count: 2
has comment: http://stackoverflow.com/comment/47389884
has comment: http://stackoverflow.com/comment/47391281
has comment: http://stackoverflow.com/comment/47387900
has comment: http://stackoverflow.com/comment/47391728
has comment: http://stackoverflow.com/comment/47391398

http://stackoverflow.com/comment/47486146
has text: You could use just a callback: `var askGoogle = function(lang, callback){ //... };`
comment on: http://stackoverflow.com/q/29674198
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29614578
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/48463481
has title: aptana studio 3 refactor rename operation unavailable on javascript variable
type: UnansweredQuestion
upvote count: 1
tagged with: aptana3
has answer: http://stackoverflow.com/a/34798175
tagged with: refactoring
has body: I downloaded and began using Aptana Studio 3 today to work on a JS project. Having used Eclipse for years, I looked forward to using a tool with which I was familiar and provided refactorings like those with which I am familiar when editing java. Unfortunately, I tried a very simple refactor rename of a var which throws up a modal dialog error box stating: "Select a javaScript project, source folder, resource, or a JavaScript file, or a non-readonly type, var, function, parameter, local variable or type variable." In the following code snippet, I tried renaming the var SummaryResponse. Why does this fail? it('should return a promise that returns an error object when the request for contact changes failed', function() { var mockResponse = { message: 'Invalid Access', exception: 'AccessDeniedException' }; var uri = '/BackOffice/v3/' + ipCookie('uriuserid') + '/contacts/changes'; uri = encodeURIComponent(uri); httpBackend.whenGET(drexServiceHost + '/ExplorerService/gateway?env=DEV' + '&amp;uri=' + uri).respond(400, mockResponse); var summaryResponse; var promise = service.getContactChanges(); promise.then(function(result) { summaryResponse = result; }); httpBackend.flush(); expect(summaryResponse.status).toBeDefined(); expect(summaryResponse.status).toEqual('error'); expect(summaryResponse.errorMessage).toBeDefined(); });
linked to: http://stackoverflow.com/q/22389718
type: Question
answer count: 1

http://stackoverflow.com/q/29564127
type: Question
has comment: http://stackoverflow.com/comment/47278705
has title: Does the Webpack "Resolve" feature resolve AMD style path definitions?
tagged with: amd
has comment: http://stackoverflow.com/comment/47279305
upvote count: 2
tagged with: webpack
answer count: 1
has comment: http://stackoverflow.com/comment/47278901
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47279149
has comment: http://stackoverflow.com/comment/47279511
tagged with: node.js
has body: I'm trying to get a very simple proof of concept working here... I have a js lib that uses AMD, but I need the dependencies to resolve to node_modules. So I have the following: webpack.config.js module.exports = { entry: "./resources/content/scripts/twitter_module", output: { path: path.join(__dirname, "build"), filename: "out.js", }, resolve: { root: __dirname, modulesDirectories: [ path.join(__dirname, "node_modules") ] } }; This is the output I get from webpack: Hash: bab530b56faec6755978 Version: webpack 1.8.2 Time: 49ms Asset Size Chunks Chunk Names out.js 8.6 kB 0 [emitted] main [0] ./resources/content/scripts/twitter_module.js 6.44 kB {0} [built] [3 errors] ERROR in ./resources/content/scripts/twitter_module.js Module not found: Error: Cannot resolve module 'vendor.asset.jquery/jquery' in /Users/bob/projects/repository/resources/content/scripts @ ./resources/content/scripts/twitter_module.js 3:0-198:2 ERROR in ./resources/content/scripts/twitter_module.js Module not found: Error: Cannot resolve module 'vendor.asset.jquery/jquery.ie.cors' in /Users/bob/projects/repository/resources/content/scripts @ ./resources/content/scripts/twitter_module.js 3:0-198:2 ERROR in ./resources/content/scripts/twitter_module.js Module not found: Error: Cannot resolve module 'vendor.asset.moment/moment' in /Users/bob/projects/repository/resources/content/scripts @ ./resources/content/scripts/twitter_module.js 3:0-198:2 The output suggests that the resolve config isn't being used/applied. It's still looking for scripts in the same directory of the module that's trying to import them. Does resolve only work for common.js requires? Every thing in the docs and examples I've read seems to suggest that this should work. Including Directory Structure: ➜ repository pwd /Users/bob/projects/repository ➜ repository ls resources/content/scripts/twitter_module.js resources/content/scripts/twitter_module.js external dependencies exist in these vendor packages: ➜ repository ls vendor.asset.jquer…
score: 2
has answer: http://stackoverflow.com/a/29567593
downvote count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47283606
has comment: http://stackoverflow.com/comment/47278103
has comment: http://stackoverflow.com/comment/47281540

http://stackoverflow.com/a/29645510
has comment: http://stackoverflow.com/comment/47435583
answers question: http://stackoverflow.com/q/29645243
upvote count: 1
has comment: http://stackoverflow.com/comment/47431723
has body: $(document).on("click", ".jumpTo .number", function(){ console.log("Jump"); }); In this case the click handler is set on the document object. So whenever you click somewhere on the page, it will fire and look for a ".jumpTo .number" element inside it. If it finds it, it will check if the click was on it and your function will execute. $(".jumpTo").on("click", ".number", function(){ console.log("Jump"); }); Here the click handler will be on .jumpTo As Al.G said probably this code gets executed multiple times, so you actually add that handler multiple times, hence the double firing. One way to solve it is to do something like this: $(".jumpTo").unbind("click").on("click"... Another is to change your code to make sure the .on() call doesn't get executed twice.
has comment: http://stackoverflow.com/comment/47436175
has comment: http://stackoverflow.com/comment/47432053
has comment: http://stackoverflow.com/comment/47435693
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47432532
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/47432860
accepted answer of: http://stackoverflow.com/q/29645243
has comment: http://stackoverflow.com/comment/47431605

http://stackoverflow.com/comment/47344847
type: QuestionComment
has text: Ok. Can you provide some documentation about `tiltShift`? I can't find it here: http://camanjs.com/api/
score: 0
comment on: http://stackoverflow.com/q/29599056
type: Comment

http://stackoverflow.com/a/29676416
answers question: http://stackoverflow.com/q/29670254
type: Answer
score: 0
has body: It's Constellation you can Google it and you will found some ready code out there
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29670254

http://stackoverflow.com/comment/50695286
type: Comment
has text: @mido22 - That might work, though it may be simpler to instead signal the offerer so that renegotiation is always initiated from the same side.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29552565

http://stackoverflow.com/q/29601245
has comment: http://stackoverflow.com/comment/47348518
tagged with: ruby
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47349457
tagged with: ruby-on-rails
type: Question
has body: When I add my rails code into my jquery I have this problem: Uncaught SyntaxError: Unexpected token &lt; Here my controller: class WelcomeController &lt; ApplicationController def index @a = "12345" end end My index.js jQuery(function($) { $(document).ready(function($) { var a = &lt;%= @a %&gt; var url = "http://www.google.com" console.log(a) }); }); I don't know how to fix that, please help me!
has comment: http://stackoverflow.com/comment/47348526
has comment: http://stackoverflow.com/comment/47349083
has comment: http://stackoverflow.com/comment/47348813
has answer: http://stackoverflow.com/a/29602059
accepted answer: http://stackoverflow.com/a/29602059
linked to: http://stackoverflow.com/q/2721880
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47348538
has title: Can't add ruby code to jquery

http://stackoverflow.com/a/29602165
score: -1
answers question: http://stackoverflow.com/q/29601836
has body: try this Demo
type: Answer
upvote count: 0
downvote count: 1

http://stackoverflow.com/comment/47412446
type: Comment
has text: @dandavis sure but that doens't makes much sense(at least the OP didn't show us a purpose on that). Look [this fiddle](http://jsfiddle.net/dr75vafL/) I've made from techfoobar example. If you add an unique string in the sequence it breaks up the result. Unless if you repeat the count for each position of each string to know which count is relative to which string, what I think is more complex.
comment on: http://stackoverflow.com/a/29634987
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47369688
comment on: http://stackoverflow.com/a/29610599
type: AnswerComment
score: 0
type: Comment
has text: Thanks, but it is still loading a lot more than 10 records, and I also get a confirmation box stating that there was an AJAX error with DataTables. I feel like there is something wrong what I am trying to pull in from the controller.

http://stackoverflow.com/comment/84846210
has text: This answer is misleading due to the high number of up-votes. You're mutating state directly. This is exactly how not to update state in react
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/38378350
score: 1

http://stackoverflow.com/comment/47226709
type: Comment
comment on: http://stackoverflow.com/a/29537111
score: 0
type: AnswerComment
has text: app.use(express.static(process.env.PWD + '/public')); ^ ReferenceError: express is not defined

http://stackoverflow.com/a/29531908
type: Answer
has body: This Post can help you. from linked post you have two options: Use jquery-csv Plugin to parse CSV file. Second option is to write function in javascript (Code is given here) that will parse the CSV file. Now choice is yours. You may need to dig into these two options to get the correct results as the CSV file content you showed in Question is bit different and Uncommon.
score: 0
answers question: http://stackoverflow.com/q/29531676

http://stackoverflow.com/q/29605421
has body: I'm trying to use angularJS to filter data in a table. I need to load the data from a json file which looks like this(sample file) [{name: "Moroni", age: 50}, {name: "Tiancum", age: 43}, {name: "Jacob", age: 27}, {name: "Nephi", age: 29}, {name: "Enos", age: 34}, {name: "Tiancum", age: 43}, {name: "Jacob", age: 27}, {name: "Nephi", age: 29}, {name: "Enos", age: 34}, {name: "Tiancum", age: 43}, {name: "Jacob", age: 27}, {name: "Nephi", age: 29}, {name: "Enos", age: 34}, {name: "Tiancum", age: 43}, {name: "Jacob", age: 27}, {name: "Nephi", age: 29}, {name: "Enos", age: 34}]; Here's my HTML file: {{test.date}} {{test.deviceName}} {{test.name}} {{test.deviceType}} here's the script.js file var app = angular.module('main', ['ngTable']). controller('DemoCtrl', function($http, $scope, $filter, ngTableParams) { $http.get('test.json') .then(function(res){ var data = res.data; $scope.tableParams = new ngTableParams({ page: 1, // show first page count: 1000000000000000000, // count per page filter: { name: '' // initial filter } }, { total: data.length, // length of data getData: function($defer, params) { // use build-in angular filter var orderedData = params.filter() ? $filter('filter')(data, params.filter()) : data; $scope.users = orderedData.slice((params.page() - 1) * params.count(), params.page() * params.count()); params.total(orderedData.length); // set total for recalc pagination $defer.resolve($scope.users); } });alert(data); }); }); The file is getting read as the alert function returns all data however nothing is showing in the table.
tagged with: javascript
has title: AngularJS Table filter
has answer: http://stackoverflow.com/a/29606456
answer count: 2
downvote count: 0
favorite count: 0
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/29605557
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29605557
accepted answer: http://stackoverflow.com/a/29606456
score: 2
type: AnsweredQuestion
upvote count: 2
type: Question

http://stackoverflow.com/comment/47445550
has text: @Pointy: Should I use `...` for `sumTo` as well to make it clearer? I was not sure.
comment on: http://stackoverflow.com/a/29652715
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/29658911
has body: I'm working on some drag-drop stuff right now, and as a normalization step I'd like to check if the list of objects I have are actually Files. It appears that what I normally get from event.dataTransfer is a FileList / DataTransferFileList, but the function I'm writing might end up accepting File objects from a non-event source. So, I was thinking about checking if individual items within are instances of File or DataTransferItem. However, it seems like what I can actually get out of JS is all over the place. MDN tells me that DataTransfer.files contains a FileList; Chrome Devtools shows it as a DataTransferItemList (in the console). An item within the list should be a 'File', according to MDN, but Devtools shows it as a DataTransferItem. Oddly though, DataTransferItem is undefined in the Devtools console, and certainly doesn't work for an instanceof call. File, FileList, and DataTransferItemList are all there, though. I haven't even started poking into other browsers yet.... So, my question has two parts: What's with these variations? Does MDN preference Gecko functionality over an interpretation of the W3C spec? Am I seeing Webkit datatypes in the Devtools console, but these datatypes don't necessarily translate to anything accessible (i.e. a JS constructor) in JS that I can use to instanceof? How can I tell if something is a list of Files, given all these variations? Should I be relying on some duck typing solution instead of instanceof?
tagged with: drag-and-drop
has comment: http://stackoverflow.com/comment/47458816
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47459583
tagged with: file
accepted answer: http://stackoverflow.com/a/29662505
type: Question
has title: How can I tell if I have a list of File objects?
tagged with: javascript
score: 4
has comment: http://stackoverflow.com/comment/47459929
upvote count: 4
downvote count: 0
answer count: 1
tagged with: file-upload
has answer: http://stackoverflow.com/a/29662505
favorite count: 0

http://stackoverflow.com/q/29673262
has comment: http://stackoverflow.com/comment/47484234
has title: How to use easeOutBounce animiation on display block?
type: AnsweredQuestion
tagged with: jquery-ui
has answer: http://stackoverflow.com/a/29673625
accepted answer: http://stackoverflow.com/a/29673625
type: Question
has comment: http://stackoverflow.com/comment/47484493
tagged with: javascript
tagged with: jquery
score: 0
has body: So I'd like to use jQuery ui effect easeOutBounce on my mobile menu, the script goes as follows: $("#navbar-checkbox, .mobile-menu-wrapper .13").click(function(){ $("#mobile-nav").({ display: 'block' }, 600, 'easeOutBounce'); }) but this doesn't work, it doesn't even change the css to display: block. How can I use display block with animation? Can you please show me how to apply easeOutBounce to it as well Thank you.
answer count: 1
tagged with: css
has comment: http://stackoverflow.com/comment/47484484
tagged with: animation

http://stackoverflow.com/comment/47324956
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/29588633
type: Comment
has text: @Chirag no, I know, dfsq probaly has the solution to your problem :)

http://stackoverflow.com/q/29563847
score: 0
has comment: http://stackoverflow.com/comment/47277430
has comment: http://stackoverflow.com/comment/47278084
has comment: http://stackoverflow.com/comment/47279133
has comment: http://stackoverflow.com/comment/47277859
has body: In the below code I am getting the return value using AJAX and now I want to filter the values. My return value looks like this: "ProductID":1 , "ProductName": Salt I want only the ProductName. Please help me to do this. function LoadProducts() { var LocationID = $('#<%= ddlLocations.ClientID %>').val(); var ProductTypeID = $('#<%= ddlProductTypes.ClientID %>').val(); $("#product").dataTable({ "oLanguage": { "sZeroRecords": "No records to display", "sSearch": "Search" }, "aLengthMenu": [[10, 25, 50, 100, 150, 250, 500, -1], [10, 25, 50, 100, 150, 250, 500, "All"]], "iDisplayLength": 10, "bSortClasses": false, "bStateSave": false, "bPaginate": true, "bAutoWidth": false, "bProcessing": true, "bServerSide": false, "bDestroy": true, "sAjaxSource": "ProductsNew.aspx/GetProducts", "bJQueryUI": true, "sPaginationType": "simple", "bDeferRender": true, "fnServerData": function (sSource, aoData, fnCallback) { $.ajax({ "dataType": 'json', "contentType": "application/json; charset=utf-8", "type": "POST", "url": sSource, "data": "{'vLocationID': '" + LocationID + "','vProductTypeID': '" + ProductTypeID + "'}", "success": function (msg) { var json = jQuery.parseJSON(msg.d); window.localStorage.setItem("Productlist", msg.d); fnCallback(json); $("#product").show(); } }); }, "aoColumns": [ { "mDataProp": "Location", "sWidth": "125px" }, { "mDataProp": "ProductCode", "sWidth": "100px" }, { "mDataProp": "ProductName", "sWidth": "125px" }, { "mDataProp": "ProductTypeName", "sWidth": "125px" }, { "mDataProp": "CurrentStock", "sWidth": "50px" }, { "mDataProp": "UnitType", "sWidth": "50px" }, { "mDataProp": "ProductID" }, { "mDataProp": "LocationID" }, { "mDataProp": "ProductID", "bSearchable": false, "bSortable": false, "sWidth": "40px", "mRender": function (data, type, full) { var str = ' Edit '; return str; } } ], "columnDefs": [ { "visible": false, "targets": 6 }, { "visible": false, "targets": 7 }, { "sClass": "relative-postition-and-break-word" } ] }); }
has comment: http://stackoverflow.com/comment/47278327
has comment: http://stackoverflow.com/comment/47278245
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47277796
has comment: http://stackoverflow.com/comment/47277922
has comment: http://stackoverflow.com/comment/47277784
answer count: 0
has comment: http://stackoverflow.com/comment/47277368
type: Question
has comment: http://stackoverflow.com/comment/47278035
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47277887
has comment: http://stackoverflow.com/comment/47278089
has title: To filter the values using javascript

http://stackoverflow.com/a/29658275
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29658039
has body: I think you need to add a return before getValueFromArray(arr[currentIndex], indexes); To make the final calculated value to recurse up the recursive method call stack as each recursed call returns.

http://stackoverflow.com/a/29534025
answers question: http://stackoverflow.com/q/29533965
score: 0
type: Answer
has body: Try with var isNoSpace = passworduser == passworduser.replace(" ", "");. It will check if the passworduser string is the same even when spaces are removed. If it is, it will return true (so isNoSpace = true). The syntax I have used is equivalent to this var isNoSpace; if (passworduser == passworduser.replace(" ", "")) { isNoSpace = true; else isNoSpace = false;

http://stackoverflow.com/comment/47791566
has text: I initally thought that it must be a good solution, I still think but something is missing, cause I'm getting on form post action formatted date as default value (01/01/0001).
type: AnswerComment
comment on: http://stackoverflow.com/a/29637286
score: 0
type: Comment

http://stackoverflow.com/comment/47457737
type: Comment
comment on: http://stackoverflow.com/a/29658683
has text: Yes, but it's the #select element (a span) that you are testing with the :checked pseudoclass selector.
score: 0
type: AnswerComment

http://stackoverflow.com/a/29606445
type: Answer
has comment: http://stackoverflow.com/comment/47362475
answers question: http://stackoverflow.com/q/29604939
has body: I think a the switch is the best approach because it's most readable in your html 1 2 3 http://plnkr.co/edit/ygy6coKCyQNGBoKmSES0?p=preview
has comment: http://stackoverflow.com/comment/47363802
score: 0
has comment: http://stackoverflow.com/comment/47360351

http://stackoverflow.com/q/29540233
has comment: http://stackoverflow.com/comment/47232608
has title: Why is my dynamically generated id for a div element 'undefined'?
has comment: http://stackoverflow.com/comment/47232993
tagged with: ajax
has comment: http://stackoverflow.com/comment/47233135
has comment: http://stackoverflow.com/comment/47232797
has answer: http://stackoverflow.com/a/29543960
has comment: http://stackoverflow.com/comment/47232674
type: AnsweredQuestion
has body: I have collection of files and the corresponding titles to pdf uploads that is displayed on the screen. The user is able to delete this list. Upon deletion of selected files, the list of files is supposed to be refreshed without reloading the page. I am able to successfully perform an ajax request and get the files deleted and the server return the list of successfully deleted file as a json stirng. My problem is, I cannot appear to jQuery select for dynamically generated div elements and delete them (specifically the div with 'id: id_name'). I am getting 'undefined' ids. Please can someone advise? my dynamically generated content of files and their titles: $.ajax({ url: 'http://localhost/webservice/showlist.php', success: function(data){ $.each(data, function(i, element){ // display 'filename' and corresponding 'title'. var id_name = element['filename']; var id_title = element['title']; $('&lt;div/&gt;', { id: id_name }) .append('&lt;input type="checkbox" name="checkvalue[]" disabled="disabled" class="check_box"'+id_name+'" value='+element['filename']+' &gt;') .append('&lt;div&gt;' + id_name +'&lt;/div&gt;') .append('&lt;div class="clss_'+id_name+'"&gt;' + id_title + '&lt;/div&gt;') .appendTo(mainDiv); }); } This is part of the code that is executed when the 'Delete' button is pressed: $.ajax({ url: 'http://localhost/webservice/delete_pdf.php', data: {delete_array: jsonString}, dataType: 'json', type: 'POST', success: function(data){ // Retrieve the success_delete array from json response. var toDelete_Array = data.success_delete; // Remove the filenames from the displayed list. //iterate through the success_delete array $.each(toDelete_Array,function(i, file_name){ // The id of each wrapper_div member is equal to corresponding filename var x = $('#'+file_name).attr('id'); console.log('id for div: '+ x); &lt;---- this returns 'undefined' // I have tried $('#'+file_name).remove(); and nothing happens. I am guessing it is due to the 'undefined' id of the div that i a…
has comment: http://stackoverflow.com/comment/47232745
type: Question
has comment: http://stackoverflow.com/comment/47234109
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29543960
possible better answer: http://stackoverflow.com/a/29540364
score: 0
has answer: http://stackoverflow.com/a/29540364
answer count: 2
has comment: http://stackoverflow.com/comment/47232611

http://stackoverflow.com/comment/47495354
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29676964
has text: .entries() (and/or .values()) returns ArrayIterator object, not array.

http://stackoverflow.com/comment/47271281
score: 1
comment on: http://stackoverflow.com/a/29560568
type: AnswerComment
has text: Both answers are correct, shall mark 1st as correct only because it was first. Thank you
type: Comment

http://stackoverflow.com/a/29642888
has comment: http://stackoverflow.com/comment/47948346
has comment: http://stackoverflow.com/comment/47427398
type: Answer
upvote count: 2
accepted answer of: http://stackoverflow.com/q/29642567
score: 2
has body: You need to add the ng-model. Based on your info.value.lang you can set the selected : true to the model value. function MyCntrl($scope) { $scope.info = info; $scope.selectedItem = null; angular.forEach(info.value.lang, function(lang) { if (lang.selected === true){ $scope.selectedItem = lang.value; } }); } Demo : http://plnkr.co/edit/RMr19uwuOH3EEjMd7cRL
answers question: http://stackoverflow.com/q/29642567
type: AcceptedAnswer
downvote count: 0

mpd
tag name: mpd
type: Tag
tags question: http://stackoverflow.com/q/29652373

http://stackoverflow.com/comment/47492612
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29677486
has text: I tried this, and I received "success" in console.log, but nothing shows on the php side

http://stackoverflow.com/a/29545260
answers question: http://stackoverflow.com/q/29545060
downvote count: 0
type: Answer
upvote count: 1
score: 1
has body: The controllerAs syntax uses this inside controllers which gets bound to $scope. But $scope is a special object which contain $watch, $on and other special properties attached to it. So when you awnt to watch for some variables or listen to events still you must use $scope only.

http://stackoverflow.com/comment/47390500
type: Comment
has text: Thanks a lot for your help, it works now smoothly :) Do you happen to know a good tutorial on manipulating dom elements using JQuery? I tried the JQuery website where I see a lot of functions but couldn't really grab the idea on how to manipulate dom elements there. Thanks
comment on: http://stackoverflow.com/a/29622796
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47956180
comment on: http://stackoverflow.com/q/29665484
score: 0
type: Comment
type: QuestionComment
has text: Hi, do you want to do a full refresh of the page? In that case you can't do it when saying /# since it points at an anchor... Did I understand you correctly?

http://stackoverflow.com/q/29579651
score: 0
has comment: http://stackoverflow.com/comment/47311677
has comment: http://stackoverflow.com/comment/47308253
answer count: 1
tagged with: arrays
has comment: http://stackoverflow.com/comment/47314670
has comment: http://stackoverflow.com/comment/47309531
has comment: http://stackoverflow.com/comment/47307734
has answer: http://stackoverflow.com/a/29593357
has comment: http://stackoverflow.com/comment/47307830
has comment: http://stackoverflow.com/comment/47308600
has body: I have a question. When querying my Json object, although i have my Field as same name and all Json rows available give me an error that is undefined. //e.g: row.DepParentId Bellow is my code. Am I missing some tag? function convert(rows) { debugger; function exists(rows, parent) { for (var i = 0; i &lt; rows.length; i++) { if (rows[i].DepId === parent) return true; } return false; } var nodes = []; // get the top level nodes for (var i = 0; i &lt; rows.length; i++) { var row = rows[i]; if (!exists(rows, row.DepParentId)) { nodes.push({ id: row.DepId, name: row.Title }); } } var toDo = []; for (var i = 0; i &lt; nodes.length; i++) { toDo.push(nodes[i]); } while (toDo.length) { var node = toDo.shift(); // the parent node // get the children nodes for (var i = 0; i &lt; rows.length; i++) { var row = rows[i]; if (row.DepParentId == node.Id) { var child = { Id: row.DepId, Name: row.Title }; if (node.options) { node.options.push(child); } else { node.options = [child]; } toDo.push(child); } } } return nodes; } My Json example for one row picked from Firefox "{"DepId":7,"DepParentId":3,"Title":"OTT"}" Thanks for helping Joao
has title: JavaScript Json row undefined for TreeView
has comment: http://stackoverflow.com/comment/47308305
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47308391
type: Question
has comment: http://stackoverflow.com/comment/47308756
has comment: http://stackoverflow.com/comment/47308667
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has comment: http://stackoverflow.com/comment/47308460

http://stackoverflow.com/a/29609650
score: 2
has body: You have mis-matched variable names - $( "#gobutton" ).click(function() { var mail = $("#mail").val(); var text = $("#mytextarea").val(); $.ajax({ url: 'page.php', type: "POST", data: { mail : mail, // note change to match actual variable text : text // note change to match actual variable }, success: function(response) { alert("Thanks!"); } }); });
accepted answer of: http://stackoverflow.com/q/29609574
answers question: http://stackoverflow.com/q/29609574
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer

http://stackoverflow.com/q/29607322
tagged with: javascript
has comment: http://stackoverflow.com/comment/47360392
has answer: http://stackoverflow.com/a/29616902
possible better answer: http://stackoverflow.com/a/29607410
score: 0
has comment: http://stackoverflow.com/comment/47360637
answer count: 3
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/29607622
accepted answer: http://stackoverflow.com/a/29607622
has comment: http://stackoverflow.com/comment/47361595
tagged with: datepicker
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/14810602
has body: I have a datepicker from the internet on my system and I want to restrict a user choice so they are only allowed to pick from today on wards. Below shows my javascript and the HTML form the datepicker is held in is held in. I tried using minDate : '0' as well as the one that is in the function now. Any help appreciated. Start Date:
has answer: http://stackoverflow.com/a/29607410
type: AnsweredQuestion
has title: Restricting date picker to start from today only hml
upvote count: 1
downvote count: 1
type: Question

http://stackoverflow.com/a/29629863
has comment: http://stackoverflow.com/comment/47404608
answers question: http://stackoverflow.com/q/29629732
has comment: http://stackoverflow.com/comment/47402571
has comment: http://stackoverflow.com/comment/47404740
score: 0
type: Answer
has body: Try this : for (var i = 1; i &lt;= rows.length; i++) { console.log(rows[i]); }

http://stackoverflow.com/q/29660413
answer count: 2
possible better answer: http://stackoverflow.com/a/29660583
tagged with: javascript
has body: I have a fairly large Application and I'm currently trying to find a way around having to pass Data from PHP (User Tokens for 3rd Party API's and such) through the DOM. Currently I use data-* attributes on a single element and parse the Data from that, but it's pretty messy. I've considered just making the contents of the element encoded JSON with all the config in, which would greatly improve the structure and effectiveness, but at the same time storing sensitive information in the DOM isn't ideal or secure whatsoever. Getting the data via AJAX is also not so feasible, as the Application requires this information all the time, on any page - so running an AJAX request on every page load before allowing user input or control will be a pain for users and add load to my server. Something I've considered is having an initial request for information, storing it in the Cache/localStorage along with a checksum of the data, and include the checksum for the up-to-date data in the DOM. So on every page load it'll compare the checksums and if they are different (JavaScript has out-of-date data stored in Cache/localStorage), it'll send another request. I'd rather not have to go down this route, and I'd like to know if there are any better methods that you can think of. I can't find any alternative methods in other questions/Google, so any help is appreciated.
has answer: http://stackoverflow.com/a/29660697
score: 0
tagged with: php
accepted answer: http://stackoverflow.com/a/29660697
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29660583
has title: Alternative to passing Data to JavaScript from PHP?
type: Question

http://stackoverflow.com/comment/75999545
score: 0
type: Comment
type: QuestionComment
has text: Also don't conflate Classical inheritance and all associated baggage with the concept of interfaces, which in languages like C# and Java are useful to escape single inheritance. Interfaces have plenty of usages and well defined types are not inherently evil or inflexible. I would encourage, however, maintaining a healthy fear of OOP in js
comment on: http://stackoverflow.com/q/29600453

http://stackoverflow.com/comment/47273248
type: QuestionComment
has text: Can you please provide html code.
score: 0
comment on: http://stackoverflow.com/q/29561610
type: Comment

http://stackoverflow.com/comment/47329265
comment on: http://stackoverflow.com/a/29590311
type: AnswerComment
has text: @yankee You can see update. The thing is your directive can be as flexible as you want. You can parameterize it endlessly.
score: 0
type: Comment

http://stackoverflow.com/comment/47307257
comment on: http://stackoverflow.com/a/29579457
type: Comment
has text: I've tried both, and to my understanding there's effectively no difference between the two in the basic way I'm implementing it
score: 0
type: AnswerComment

http://stackoverflow.com/q/29586441
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/29586582
linked to: http://stackoverflow.com/q/13246378
has answer: http://stackoverflow.com/a/29586527
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29586577
score: 1
has body: I can do something such as the following every 30 seconds to reload the page, and the backend logic will determine which session have been invalidated: setInterval(function () { location.reload() }, 30000); However, how would I only run this 30s location.reload() if the user is not active? For example, how banks will have a user-timeout if the user has not been active on the page (which only starts counting after the user is 'inactive'). How would this be done?
has answer: http://stackoverflow.com/a/29586550
has comment: http://stackoverflow.com/comment/47320873
upvote count: 1
type: Question
has title: setTimeout function if user not active
possible better answer: http://stackoverflow.com/a/29586582
has comment: http://stackoverflow.com/comment/47320823
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29586527

http://stackoverflow.com/comment/47465426
comment on: http://stackoverflow.com/q/29662363
has text: So sorry, typo in the url. The code posted is correct and effective for the tabs. It doesn't work in accordion mode though. The tabs are at the top of the page and the link to the demo page has been amended. The tab attributes aren't carried through to the accordion mode, which is why it won't work. I'm just not sure what to do to make it work in accordion mode. I'm just helping out a friend who's developer quit on him. Thank you for your assistance.
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/q/29539438
tagged with: ionic-framework
type: Question
has answer: http://stackoverflow.com/a/75661964
has comment: http://stackoverflow.com/comment/47241227
tagged with: javascript
has comment: http://stackoverflow.com/comment/47333491
score: 0
answer count: 2
has body: I'm building an app using Cordova/ionic in which I now fetch a PDF from an API (which I am authenticated with). I then want to display this PDF in the inAppBrowser which I normally open with window.open('http://example.com/the-file.pdf', "_blank", "location=no");. But since I already fetched the data I cannot provide a url, but instead I want to provide the data as binary. I searched around but I only found this SO answer, which unfortunately doesn't work for me. Does anybody know how I can pass a PDF as binary data through window.open()? All tips are welcome!
favorite count: 0
tagged with: binary
tagged with: cordova
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/9620497
has comment: http://stackoverflow.com/comment/47232561
has title: How to pass a PDF as binary to window.open()?
linked to: http://stackoverflow.com/q/43296095
tagged with: file
upvote count: 1
has comment: http://stackoverflow.com/comment/47256991
has answer: http://stackoverflow.com/a/29593442
downvote count: 1

http://stackoverflow.com/a/29545347
has comment: http://stackoverflow.com/comment/47244658
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29544965
has body: Here's what your regex does: (\w) [\s,]+ (\w?) one character at least one whitespace or comma one or zero characters When you have something like q w e r t y in your input box, here's how it gets captured: 'q' is a word-character and matches (\w), so 'q' is stored in $1 ' ' is a whitespace and matches [\s,]+, keep going 'w' is a word-character and matches (\w?), so 'w' is stored in $2 and the match ends. That's why q w e r t y returns multiple matches in pairs (q,w)(e,r)(t,y), which gets turned into q,ue,rt,y. There are many ways to do what you actually want. Since regex is greedy by default and will match as many characters as possible, you can do this: (\w+)[\s,]* (\w+) Will capture the longest sequence of word characters possible. [\s,]* Will then consider any whitespace and commas after that as part of the "match" but not as part of the $1 capture.
has comment: http://stackoverflow.com/comment/47243395

http://stackoverflow.com/q/29594711
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/29610293
type: Question
tagged with: javascript
has title: How to build socket io server in different file except app.js
tagged with: express
answer count: 1
downvote count: 0
has body: I am pretty new to node.js and now I am doing a project on building a website on node.js. Sorry if my question is very naive. I am using express framework. My app.js is listening at port (3000). In my route.js, I got some data from calling some API. I want to display the data to my datapoint.jade file. And because I want to draw those datapoint I have to embed a javascript file in jade. I want to use socket.io to achieve this sending and receiving data. However, all the examples to construct socket is in app.js. I get data in router.js(in one of its callback function). app.js require router.js. How can I send data from route.js to app.js and then send out to client side. Could you please guide me some related and useful information? Or my design would not work at all?
favorite count: 0
tagged with: sockets
accepted answer: http://stackoverflow.com/a/29610293
tagged with: node.js
has comment: http://stackoverflow.com/comment/47341286
type: AnsweredQuestion

http://stackoverflow.com/comment/47466127
score: 0
type: QuestionComment
type: Comment
has text: ideally you could just do it with a class.
comment on: http://stackoverflow.com/q/29663348

http://stackoverflow.com/comment/47351176
comment on: http://stackoverflow.com/a/29561447
has text: Thanks for your answer. Writing "height: auto" will not work for any reason.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/29543382
accepted answer of: http://stackoverflow.com/q/29541628
answers question: http://stackoverflow.com/q/29541628
type: AcceptedAnswer
upvote count: 23
has body: With jQuery, use serialize() the form and post it to your route. $('#form').submit(function(e) { e.preventDefault(); var url = &quot;{{ path('YOUR_PATH') }}&quot;; var formSerialize = $(this).serialize(); $.post(url, formSerialize, function(response) { //your callback here alert(response); }, 'JSON'); }); In your action if ($form-&gt;isSubmitted() &amp;&amp; $form-&gt;isValid()) { .... // or return new JsonResponse($anyData); return new Response(json_encode(['status'=&gt;'success'])); } it must be ok like this. but you can add some parameters like the format, methods etc... in your routing.
has comment: http://stackoverflow.com/comment/47239799
has comment: http://stackoverflow.com/comment/68954406
type: Answer
has comment: http://stackoverflow.com/comment/109351930
has comment: http://stackoverflow.com/comment/68954793
downvote count: 0
score: 23

http://stackoverflow.com/comment/47223572
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29535400
score: 0
has text: No that doesn't work. That only returns 'Value: [object Object]'. I need to log a value of that object,

http://stackoverflow.com/comment/47296284
comment on: http://stackoverflow.com/q/29573242
has text: Theres no code in your plunker that updates any of the service's variables other than when the controller for the `date-picker` directive is created (`calculationDataService.firstDate = $scope.dt;`). What did you want updated in the service when the picker is updated?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29642076
possible better answer: http://stackoverflow.com/a/29642135
favorite count: 0
has title: How to change style using javascript?
has comment: http://stackoverflow.com/comment/47425560
has answer: http://stackoverflow.com/a/29642117
accepted answer: http://stackoverflow.com/a/29642117
has answer: http://stackoverflow.com/a/29642215
linked to: http://stackoverflow.com/q/2874688
answer count: 4
type: AnsweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/29642305
type: Question
has comment: http://stackoverflow.com/comment/47425585
score: -2
tagged with: javascript
has answer: http://stackoverflow.com/a/29642135
has body: &lt;div class="club_member"&gt; &lt;input type="text" size="5" onclick="this.value=''" name="scienceClub" value="2"&gt; &lt;/div&gt; How can I use a simple javascript command to change the value to "0" and place a 'disable=""' in the input style?
linked to: http://stackoverflow.com/q/5457739
downvote count: 2

http://stackoverflow.com/comment/47253627
comment on: http://stackoverflow.com/q/29551093
score: 0
type: Comment
type: QuestionComment
has text: You can add a counter variable that increases by one each time a field fails validation. Then at the end if the variable is greater than zero, display the alert.

http://stackoverflow.com/a/29607410
score: 1
has comment: http://stackoverflow.com/comment/47360714
answers question: http://stackoverflow.com/q/29607322
downvote count: 0
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/47360780
has body: &lt;input type="date" min="2000-01-02"&gt; date input type has an min and max attribute to restrict the date selection. Here you can get today's date in JavaScript and set that value to your date input type. I just gave an example in above code snippet.

http://stackoverflow.com/q/29668758
score: 0
answer count: 1
has body: I want to open a modal declaring the modal file name, and an image url I want to use in the scope of the modal. e.g.: ng-click="showModal('screenshot','http://placehold.it/800x550')" When I try the above I'm getiing the following error: Error: [$injector:unpr] Unknown provider: imageUrlProvider &lt;- imageUrl &lt;- ModalController Here's the code I'm trying - Modal Controller: hmwsApp.controller('ModalController', function($scope, close, imageUrl) { $scope.imageUrl = imageUrl; $scope.close = function(result) { close(result, 500); // close after 500ms to allow for bootstrap to animate }; }); Main Controller: hmwsApp.controller('mainController', ['$scope', '$http', '$rootScope', 'ModalService', function($scope, $http, $rootScope, ModalService) { $scope.showModal = function(modalUrl, imageUrl) { ModalService.showModal({ templateUrl: '/views/modals/' + modalUrl + '.html', controller: "ModalController", resolve: { imageUrl: function () { return imageUrl; } } }) .then(function(modal) { modal.element.modal(); modal.close.then(function(result) { $scope.message = "Image shown " + result; }); }); }; }]); Is there anything obviously wrong?
has answer: http://stackoverflow.com/a/29668825
tagged with: angularjs
has title: Pass variables into function - Angular
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47479600
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47475991

http://stackoverflow.com/a/29563080
score: 2
upvote count: 2
downvote count: 0
answers question: http://stackoverflow.com/q/29546942
type: Answer
has body: I think there are no way, as per addEventListener specification: The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on. The event target may be an Element in a document, the Document itself, a Window, or any other object that supports events (such as XMLHttpRequest). And indeed, you can check it by searching on the event reference list here. Apparently, you'll need to: (a.) call the handler functions manually before and after every ajax call you make; or (b.) use a javascript framework to make ajax calls (so it does the manual work for you) In case you choose (b.): There are a lot of frameworks around there, but I'm suggesting here jQuery or AngularJs. You can find interesting free courses here¹ if you need some introduction to them If you choose jQuery: use ajaxSuccess for handling all responses set a global beforeSend on ajaxSetup for handling all requests If you choose AngularJS: use Interceptors when globally handling responses and requests there's another nice angular interceptor tutorial ¹ I do not work for the linked course site. I posted it here as a personal suggestion.

http://stackoverflow.com/q/29555798
has answer: http://stackoverflow.com/a/29555850
has title: Javascript function scope discrepncy between chrome and firefox, which one is correct
has comment: http://stackoverflow.com/comment/47262293
downvote count: 3
tagged with: google-chrome
type: Question
upvote count: 0
tagged with: firefox
has comment: http://stackoverflow.com/comment/47264601
tagged with: javascript
score: -3
has comment: http://stackoverflow.com/comment/47264076
has comment: http://stackoverflow.com/comment/47264228
answer count: 1
favorite count: 0
type: UnansweredQuestion
has body: I see different behavior for the following Javascript code executed on Chrome and Firefox: var outer = function (param) { var inner = function (theinput) { return theinput * 2; }; return 'The result is ' + inner(param); }; console.log(outer(2)); console.log(inner(5)); Result on Firefox: "The result is 4" 10 Result on Chrome: "The result is 4" undefined Since inner is declared as "var", I guess the output on Chrome is correct as the function "inner" acts as a private function. I think firefox implementation is incorrect. If "var" was removed for inner, the inner function becomes promoted as global function after its first execution.Is my understanding correct?
has comment: http://stackoverflow.com/comment/47262339

http://stackoverflow.com/comment/47332689
type: Comment
type: QuestionComment
has text: where is the duplication
comment on: http://stackoverflow.com/q/29592754
score: 0

http://stackoverflow.com/comment/47250661
has text: COULD BE because you are re-loading ```$('.wrapper:first .main_sec')``` every time, making load event propagate(event bubbling) to ```body``` tag in each loop of ```function open_existing_widgets( )```
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29548736
type: QuestionComment

http://stackoverflow.com/q/29557312
score: 2
answer count: 0
upvote count: 2
tagged with: file
has title: Javascript parse binary file
type: Question
tagged with: javascript
downvote count: 0
has body: I'm trying to transfer a binary file from server (PHP) to client. Then I need to parse binary file in javascript so I can plot values using a chart. To parse binary file I'm using JParser library. When I try to read a negative int16 value result is wrong. Here some code: AJAX POST $.ajax({ url: '/getComtrade.php', type: 'POST', data: { getDat: "filename.dat" }, success: function(data){ handleDatFile(data); console.log(parser.parse('header')); }, error: function(jqXHR, textStatus, errorThrown){ alert(jqXHR.responseText); } ); JPARSER STRUCT function handleDatFile(data){ var view = new jDataView(data, undefined, undefined, true); parser = new jParser(view, { header: { ID: 'uint32', sample: 'uint32', analogs: ['array', 'int16', 8], digitals: ['array', 4, 29] } }); } PHP CODE public static function getFileDat($fileName) { $filepath = COMTRADE_DIR . "/" . $fileName; echo file_get_contents($filepath); } In particular, hex value 'F52E' is parsed in '-722'. Correct value is '-2770'. Thank you.
favorite count: 0
tagged with: binary
type: UnansweredQuestion
tagged with: php

http://stackoverflow.com/q/29570386
has body: I was trying to play off of the example code shown here in order to have an overlay trigger that displays a popover upon invalid username field regex for my form component. I'm getting the classic Cannot update during an existing state transition (such as within "render"). Render methods should be a pure function of props and state. error upon trying to execute this code: var UserField = React.createClass({ getInitialState: function() { return { value: '' }; }, getValue: function() { return this.refs.input.getValue(); }, validationState: function() { let valueCode = this.state.value; if (valueCode.length > 0) { switch (valueCode.match(/^[A-Za-z0-9_-]+$/)) { case null: this.refs.userHint.show(); return 'warning'; break; default: this.refs.userHint.hide(); return ''; break; } } }, handleChange: function() { this.setState({ value: this.refs.input.getValue() }); }, render: function() { return ( ); } }); Any help on this is very much appreciated, as always. Thank you.
tagged with: react-bootstrap
upvote count: 2
tagged with: reactjs
answer count: 1
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/29581391
has answer: http://stackoverflow.com/a/29581391
score: 2
type: AnsweredQuestion
downvote count: 0
tagged with: twitter-bootstrap
has title: React-Bootstrap Popover with Form field Validation
type: Question

http://stackoverflow.com/a/29670699
score: 1
has body: 1) You should change your form class to class="ac-custom ac-checkbox ac-cross" 2) Maybe you should try to load JQuery and Bootstrap before : Bootstrap 101 Template Actually, the problem is that your JavaScript code is not creating the svg element (the image is the preview of the working demo) : I'm not sure it will fix the whole problem, but I will continue to look for it. If I find something, I will edit this post.
upvote count: 1
has comment: http://stackoverflow.com/comment/47479615
type: Answer
has comment: http://stackoverflow.com/comment/47480305
downvote count: 0
has comment: http://stackoverflow.com/comment/47480146
answers question: http://stackoverflow.com/q/29670264
has comment: http://stackoverflow.com/comment/47479554

http://stackoverflow.com/q/29603930
has title: Closures variables memory impact
linked to: http://stackoverflow.com/q/864516
has answer: http://stackoverflow.com/a/29604067
type: Question
type: AnsweredQuestion
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
accepted answer: http://stackoverflow.com/a/29604067
has body: I am working on a simple api that creates and manages the creation of some html ( doesn't matter really.. ). Anyway, this api is wrapped in one of the UMD snippets, which basically receives an anonymous function as one of its arguments: Take a look at the code for the actual question: What happens to 'queues' in terms of memory when: The initial state turns to "after usage" state? If "someUniqueKey1" object is referenced by some anonymous function passed to jQuery ? Code: +function( root, factory ) { if ( typeof define === 'function' &amp;&amp; define.amd ) { // AMD. Register as an anonymous module. define( [ 'jquery' ], factory ); } else if ( typeof exports === 'object' ) { // Node. Does not work with strict CommonJS, but // only CommonJS-like environments that support module.exports, // like Node. module.exports = factory( require( 'jquery' ) ); } else { // Browser globals (root is window) root.Alert = factory( jQuery ); } }( this, function( $ ) { var queues = {}; // &lt;-- initial state // after usage state: queues = { "someUniqueKey1": { "someProperty": [] }, "someUniqueKey2": { "someProperty": [] }, } // constructor some here... // prototyping goes here.. // .... return alertAPI } ); I tried profiling using chrome dev tools, but all I can see is the created instances and what happens when they are removed.
tagged with: memory-management

http://stackoverflow.com/comment/47399840
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29626711
has text: if your are using 100 times on single page at a time, then it would make impact on performance, still depends directive contains any event, watcher, etc.

http://stackoverflow.com/q/29656916
score: 0
has body: I am trying to draw the states of India map (with disputed territories ) by D3 Map. I successfully generate the topojson file which looks good in http://www.mapshaper.org/ And the json link is https://dl.dropboxusercontent.com/s/wk9qd47wn1nhsjm/dddtopo.json But I failed to draw the map. The link http://jsfiddle.net/sEFjd/47/ is how I did under jsfiddle. var topoJsonUrl = "https://dl.dropboxusercontent.com/s/wk9qd47wn1nhsjm/dddtopo.json"; var width = 360, height = 360; d3.json(topoJsonUrl, function(error, mx) { var projection = d3.geo.mercator(); // create the path var path = d3.geo.path().projection(projection); var svg = d3.select("body").append("svg") .attr("width", width) .attr("height", height); console.log(mx); var geoPaths = svg.append("g") .attr("class", "municipalities") .selectAll("path") .data(topojson.feature(mx, mx.objects.india).features); geoPaths.enter().append("path") .attr("d", path); var p= svg.append("path") .datum(topojson.mesh(mx, mx.objects.india)) .attr("d", path) .attr("class", "state-boundary"); geoPaths.style("fill", function(d) { return Math.random() &gt; 0.5 ?'gray' : 'blue'; }); }); The code works well with other countries(Germany, Mexico) Not sure why it does not work this time. Any help will be very appreciated.
linked to: http://stackoverflow.com/q/14492284
tagged with: d3.js
has comment: http://stackoverflow.com/comment/47491321
tagged with: dictionary
tagged with: topojson
has title: D3 Map - Cannot apply the suitable projection for indian map
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47456433
type: Question
has comment: http://stackoverflow.com/comment/47475737
tagged with: javascript

http://stackoverflow.com/q/29677902
tagged with: gwt
type: AnsweredQuestion
type: Question
has body: We have a GWT app that displays ads on the page with this code: </body The problem with this code is its a blocking and it delays the loading of the app. What we want is to make sure that the GWT app has fully loaded (especially its UI) before the ads script will even load. Is that possible?
has title: Delay load Javascript in HTML page with GWT
tagged with: javascript
has comment: http://stackoverflow.com/comment/47502010
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/29680776
accepted answer: http://stackoverflow.com/a/29680776

http://stackoverflow.com/a/29559596
upvote count: 1
answers question: http://stackoverflow.com/q/29558111
has body: I found the solution, so rather than having xhrFields: { withCredentials:true } on the method level, I've put it globaly: $.ajaxSetup({ xhrFields: { withCredentials: true } }); And cookie is passed now within the subsequent requests. No idea why it doesn't work on method level, maybe a bug in jquery... jQuery version I was using: 2.1.3 Maybe this will help someone in future.
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/comment/47509792
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29685408
has text: @romuleald Already tried. Doesn't include the file at all...
score: 0

http://stackoverflow.com/a/29598389
has body: JavaScript uses prototypal inheritance. To inherit from Base class, use like Foo.prototype = new Base(); But you can't pass parameters into Foo. You need to move model save logic to Foo. NOTE: Don't return the created object from constructor functions. By default, created object is returned. EDITED function Base() { } Base.prototype.modelName = function () { return self._model.Name; }; function Foo(model) { this._model = model this.hello = function () { return 'Hello World'; } } Foo.prototype = new Base();
answers question: http://stackoverflow.com/q/29598229
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29598229
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/47343351
score: 1
has comment: http://stackoverflow.com/comment/47343239
type: AcceptedAnswer

http://stackoverflow.com/a/29579634
type: Answer
answers question: http://stackoverflow.com/q/29579569
score: 0
has body: You can set a duration of 0 or 1 ms which would do the trick: var leftPos = $('#container').scrollLeft(); $("#container").animate({ scrollLeft: leftPos - 800 }, 0);

http://stackoverflow.com/a/29675535
score: -1
downvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/29674656
upvote count: 0
has body: You can use target property. just use this code in child element. target="_parent" Thanks, Hayat S.

http://stackoverflow.com/comment/47520897
score: 0
type: AnswerComment
has text: You are not getting the error when you use window.location("url"), because, you are being redirected to a different page. So the previous errors you were getting in the console are getting refreshed. That is the reason, you are not seeing any error in console.
type: Comment
comment on: http://stackoverflow.com/a/29676070

http://stackoverflow.com/comment/47310505
has text: thanks the explanation. Just in case this helps somebody else, I found a helpful article - http://www.html5rocks.com/en/tutorials/es6/promises/). Here's a paragraph that improved my understanding how promises work (i.e. how _getStatus also returns a promise object even though only 1 was explicitly created in _finishTask): If you return a value, the next "then" is called with that value. However, if you return something promise-like (anything with a "then" method as promise-like), the next "then" waits on it, and is only called when that promise settles (succeeds/fails).
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29575161
type: Comment

http://stackoverflow.com/q/29586568
has comment: http://stackoverflow.com/comment/47320918
type: Question
has body: As a newbie, function foo() { } confuses me. Why is it used with so many purposes? What is it built for? Doesn't this make maintenance of code difficult? edit: I'm not talking about "foo" but about functions in general.
tagged with: javascript
answer count: 2
has comment: http://stackoverflow.com/comment/47320972
has title: In Javascript, is function foo() { } a class, a standard function, or a function with properties?
has comment: http://stackoverflow.com/comment/47321042
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29586666
has comment: http://stackoverflow.com/comment/47320942
has answer: http://stackoverflow.com/a/29586593
score: 0
has comment: http://stackoverflow.com/comment/47320946

http://stackoverflow.com/comment/47254622
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29551391
has text: You cannot change the text of a DIV element using `element.value = "blah"`. `value` applies only to form action elements.

http://stackoverflow.com/comment/47498048
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29669976
score: 0
has text: Thanks @Isouza ! `$request->get()` works. It's because of `$sort = $request->query->get()` that was wrong. Also, thanks to @herr for your help !

http://stackoverflow.com/comment/47250309
comment on: http://stackoverflow.com/q/29548736
type: QuestionComment
has text: Why are you splitting up your functions like this?
score: 0
type: Comment

http://stackoverflow.com/q/29615607
answer count: 2
tagged with: javascript
favorite count: 0
upvote count: 9
tagged with: http://stackoverflow.com/tag/svg
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: React & SVG max width
has answer: http://stackoverflow.com/a/56983886
downvote count: 0
has body: I want to use max-width in a React component. I tried both max-width and maxWidth attributes , but it looks like that it's omitted from the element when I inspect it. (When I put it in the CSS it works.)
has answer: http://stackoverflow.com/a/29615701
score: 9
type: Question
tagged with: reactjs

http://stackoverflow.com/comment/47419268
type: Comment
score: 0
has text: I need bindings that is why I can not use the normal onclick .
type: AnswerComment
comment on: http://stackoverflow.com/a/29637229

http://stackoverflow.com/comment/47321075
type: Comment
type: QuestionComment
has text: The image in your example isn't draggable. It would help if you added your jQuery source code to the example to make the image draggable. I believe using css would allow you to shape the element but depending on the images you want to use, this could prove tricky.
comment on: http://stackoverflow.com/q/29586615
score: 0

http://stackoverflow.com/q/29646654
has title: filter outgoing requests in node.js for logging
has comment: http://stackoverflow.com/comment/47434229
score: 5
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29648177
upvote count: 5
accepted answer: http://stackoverflow.com/a/29648038
possible better answer: http://stackoverflow.com/a/29648177
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47434067
has comment: http://stackoverflow.com/comment/47436539
has body: I am building an Express app which on certain requests has to make its own HTTP calls. I could use Superagent, request or node's own http.request. Thing is, I need to log all of those server originating requests and their respective responses. Calling log.info before each and every of those seems silly. How can you add a pre-filter for all outgoing HTTP calls, and ideally access both req and res? NOTE: I am not interested in logging requests coming in to the server I am building, only in the requests that the server itself kicks off. Think of my server as a client to another black box server.
favorite count: 0
has comment: http://stackoverflow.com/comment/47435292
has answer: http://stackoverflow.com/a/29648038

http://stackoverflow.com/comment/47325088
type: QuestionComment
comment on: http://stackoverflow.com/q/29588845
has text: So what is the problem?
score: 0
type: Comment

http://stackoverflow.com/q/29675539
duplicate of: http://stackoverflow.com/q/11901074
upvote count: 15
answer count: 4
favorite count: 0
has answer: http://stackoverflow.com/a/29675560
accepted answer: http://stackoverflow.com/a/29675560
score: 13
has body: I have this function, which I would like to be executed after 5 seconds: $(document).ready(function() { $("#signInButton").trigger('click'); }); Thank you
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29675619
linked to: http://stackoverflow.com/q/11901074
has answer: http://stackoverflow.com/a/29675598
type: Question
possible better answer: http://stackoverflow.com/a/29675619
has answer: http://stackoverflow.com/a/29675578
tagged with: javascript
has title: execute javascript function after 5 seconds
tagged with: jquery
tagged with: click
tagged with: ajax
downvote count: 2
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/29636606
score: 0
type: Answer
has body: You have a function onYouTubePlayerReady that isn't called anywhere in the code you have posted. I think you may be experiencing this problem: Why isn't the YouTube iframe player calling onYouTubePlayerReady when it's loaded? Also when I tried you page the video returns from fullscreen on a second click of the fullscreen icon. The video still takes up the whole page because you have set the iframe's size, is this really the behaviour you intended?
answers question: http://stackoverflow.com/q/29636239

asp.net-identity-2
tags question: http://stackoverflow.com/q/29582779
tag name: asp.net-identity-2
type: Tag

http://stackoverflow.com/comment/47396736
has text: I'd recommend reading up on `this`: [here](http://toddmotto.com/understanding-the-this-keyword-in-javascript/) or [here](http://javascriptissexy.com/understand-javascripts-this-with-clarity-and-master-it/)
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29626729

http://stackoverflow.com/comment/47290303
comment on: http://stackoverflow.com/a/29569552
type: AnswerComment
score: 0
type: Comment
has text: @user1234 his answer is intended to clean up the list, removing duplicate options *after they're created and appended to the DOM*. You would run to run that, maybe using a timeout, after your .each()

http://stackoverflow.com/q/29615891
has answer: http://stackoverflow.com/a/29615968
has answer: http://stackoverflow.com/a/29616010
has answer: http://stackoverflow.com/a/29616032
answer count: 5
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47377234
duplicate of: http://stackoverflow.com/q/11737873
has title: Using .click() in jquery vs calling a function using onclick
has comment: http://stackoverflow.com/comment/47377235
has comment: http://stackoverflow.com/comment/47377103
has comment: http://stackoverflow.com/comment/47377254
linked to: http://stackoverflow.com/q/12627443
upvote count: 1
type: Question
has body: I'm rather new to jQuery but i want to know what the best practice is when making a button do something. Should i use .click() HTML Submit JS $('#submit').click(function(){ //DO SOMETHING }); Or call a function HTML Submit JS function Submit() { //DO SOMETHING } My question is, do these two methods behave the same way? If not, what are the advantages of one over the other. *I've tried and seems to work the same way but being new to jQuery i wanted to make sure.
has comment: http://stackoverflow.com/comment/47377144
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29615989
has comment: http://stackoverflow.com/comment/47377372
duplicate of: http://stackoverflow.com/q/12627443
has answer: http://stackoverflow.com/a/29615984
has comment: http://stackoverflow.com/comment/47377123
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
score: 1
linked to: http://stackoverflow.com/q/11737873
favorite count: 0

http://stackoverflow.com/q/29654946
upvote count: 1
type: Question
has body: I am looking for Javascript expertise to be able to find specific words after mySQL outputs my text. I have numerous fields in a column in my phpmyadmin database with sentences such as: Bobby ran down the hill. He saw nothing. Bobby went home. I would like to create a javascript code that finds the periods . and be able to replace them with html code &lt;br&gt; because I cannot add a line break in the mySQL fields even though I've tried concatenation. Help on this issue would be appreciated! Here is my script: $("#tips").append("&lt;li class='treatment'&gt;" + treat.Tips + "&lt;/li&gt;"); $("#tips-text").text(treat.Tips); treat.Tips = txt.replace(/\./g, "&lt;br /&gt;"); $('#tips').listview('refresh');`
answer count: 2
has comment: http://stackoverflow.com/comment/47450277
has answer: http://stackoverflow.com/a/29655004
tagged with: javascript
downvote count: 0
has comment: http://stackoverflow.com/comment/47450121
favorite count: 0
accepted answer: http://stackoverflow.com/a/29655004
has answer: http://stackoverflow.com/a/29655067
tagged with: phpmyadmin
possible better answer: http://stackoverflow.com/a/29655067
has title: Javascript to 'find and replace' from mySQL output
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47449844
score: 1
tagged with: mysql

http://stackoverflow.com/comment/47476104
score: 1
comment on: http://stackoverflow.com/q/29650730
type: QuestionComment
type: Comment
has text: @Mitch fiddle check this post http://stackoverflow.com/questions/8255520/php-foreach-print-array-with-previous-and-next-element

http://stackoverflow.com/a/29548083
has comment: http://stackoverflow.com/comment/47249088
has comment: http://stackoverflow.com/comment/47248640
has comment: http://stackoverflow.com/comment/47247976
has comment: http://stackoverflow.com/comment/47247765
score: 0
has comment: http://stackoverflow.com/comment/47248151
has comment: http://stackoverflow.com/comment/47248086
has comment: http://stackoverflow.com/comment/47247924
has body: I'm spotting something dead simple here, otherwise i'm being dead simple.... " $('.swap').fadeOut('slow', function(){" You have no class labelled swap in the HTML?
type: Answer
has comment: http://stackoverflow.com/comment/47250354
has comment: http://stackoverflow.com/comment/47249953
answers question: http://stackoverflow.com/q/29547553

http://stackoverflow.com/comment/47339831
has text: The data that is being received is transmitted from an arduino using serial.println() to send the characters as ASCII text. That could very well be part of the issue. Thanks!
type: AnswerComment
comment on: http://stackoverflow.com/a/29596247
score: 0
type: Comment

http://stackoverflow.com/comment/47413302
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29614776
has text: Benjamin C. yes file path was the problem thank you
type: Comment

http://stackoverflow.com/q/29534604
has title: Jquery remove or change JSON root element
possible better answer: http://stackoverflow.com/a/29534786
tagged with: php
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/29534769
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
score: 0
accepted answer: http://stackoverflow.com/a/29534769
has answer: http://stackoverflow.com/a/29534786
has body: I am getting some data back from a third party web service. When the data is returned the root element for the JSON is set to the username of the user. Since this username changes I am trying to find a way to either remove or change this root element. If this can't be done is there a way to modify the lookup of the root element dynamically? Example returned JSON for one user: { "someuseraccount":{ "data1": 3980203, "name": "someuseraccount", "data2": 33, "data3": 23, "data4": 989839 } } Example returned JSON for another user: { "someuseraccount2":{ "data1": 3980203, "name": "someuseraccount2", "data2": 33, "data3": 23, "data4": 989839 } } When I read the data out into a variable its done through obj.someuseraccount2.data1. This causes an issue with the application as it makes it only useable for one user. Preferably this would be done through Jquery but could also be done through php. Thanks

http://stackoverflow.com/q/29538866
has answer: http://stackoverflow.com/a/29540332
linked to: http://stackoverflow.com/q/27240776
tagged with: angularjs
has answer: http://stackoverflow.com/a/32927483
answer count: 3
has body: I have the following code: {{ item.name }} <hide-button /> Imagine that I have 10 items. When I click the button, I set the item.hide to true and the item disappear. When I hide all 10 items, I want to hide the main div. What's the best way to achieve this with AngularJS?
has comment: http://stackoverflow.com/comment/47229913
accepted answer: http://stackoverflow.com/a/29539024
type: AnsweredQuestion
upvote count: 1
type: Question
score: 1
has title: AngularJS: Hide parent based on number of hidden children
has answer: http://stackoverflow.com/a/29539024
has comment: http://stackoverflow.com/comment/47377174
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29540332
favorite count: 0

http://stackoverflow.com/comment/114089142
comment on: http://stackoverflow.com/a/56553109
score: 2
type: AnswerComment
has text: this does not answer the OP's original question on converting css cubic bezier easing to javascript, not using css cubic bezier
type: Comment

http://stackoverflow.com/q/29612400
downvote count: 1
type: Question
tagged with: google-maps
has title: How to pull in all elements from database in a JavaScript array?
answer count: 1
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/47372834
tagged with: google-maps-api-3
tagged with: google-maps-markers
has answer: http://stackoverflow.com/a/29612504
accepted answer: http://stackoverflow.com/a/29612504
favorite count: 0
upvote count: 0
has body: I need to put google maps markers on a map and here's the code that I'd like to use for this task: function codeAddress() { var address = document.getElementById('address').value; geocoder.geocode( { 'address': address}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { map.setCenter(results[0].geometry.location); var marker = new google.maps.Marker({ map: map, position: results[0].geometry.location }); } else { alert('Geocode was not successful for the following reason: ' + status); } }); } Now this script works, but I'd like to modify it for use with an array of addresses. Can you please show me how to do it? I would get the addresses from a php SQL loop.
type: AnsweredQuestion

http://stackoverflow.com/comment/47389440
score: 0
type: Comment
type: QuestionComment
has text: Could you post the code which causes the error in addition to the debug log?
comment on: http://stackoverflow.com/q/29622748

http://stackoverflow.com/q/29552712
has comment: http://stackoverflow.com/comment/47256742
has title: How can I return two values?
has answer: http://stackoverflow.com/a/29552783
type: Question
answer count: 2
tagged with: javascript
has body: I have a database column that populates a label. It is date format so it saves entries as yy-mm-dd 00:00.0. I used this code to change it to the format that I wanted when it is listed. var yyyymmdd = value.split(" ")[0].split("-"); return yyyymmdd[1] + "-" + yyyymmdd[2] + "-" + yyyymmdd[0]; Now I need to possibly change the color and this is the code I use to do it. if(value.dead){ $(element).css({"color": "#E33"}); }else if(value.pairout){ $(element).css({"color": "#0c9999"}); } return value.Date; My question is: how can I combine both of these codes to make them work together to reorder the date and possibly change the color.
linked to: http://stackoverflow.com/q/2917175
has answer: http://stackoverflow.com/a/29552858
has comment: http://stackoverflow.com/comment/47256720
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47256728
has comment: http://stackoverflow.com/comment/47256768
tagged with: return-value
has comment: http://stackoverflow.com/comment/47256797
score: 0
has comment: http://stackoverflow.com/comment/47256667

http://stackoverflow.com/comment/57020877
type: Comment
score: 2
has text: This gets even more confusing because for cjs modules that were compiled from ES6/Babel, the new `import * as <name> from <'module'>` syntax still works
type: AnswerComment
comment on: http://stackoverflow.com/a/29598404

http://stackoverflow.com/q/29598472
has body: I have some markup like so: Ut in nulla enim. Phasellus molestie magna non est bibendum non venenatis nisl tempor. Suspendisse dictum feugiat nisl ut dapibus. Mauris iaculis porttitor posuere. Praesent id metus massa, ut blandit odio. Proin. Ut in nulla enim. Phasellus molestie magna non est bibendum non venenatis nisl tempor. Suspendisse dictum feugiat nisl ut dapibus. Mauris iaculis porttitor posuere. Praesent id metus massa, ut blandit odio. Proin. Ut in nulla enim. Phasellus molestie magna non est bibendum non venenatis nisl tempor. Suspendisse dictum feugiat nisl ut dapibus. Mauris iaculis porttitor posuere. Praesent id metus massa, ut blandit odio. Proin. Ut in nulla enim. Phasellus molestie magna non est bibendum non venenatis nisl tempor. Suspendisse dictum feugiat nisl ut dapibus. Mauris iaculis porttitor posuere. Praesent id metus massa, ut blandit odio. Proin. And I'm trying to get it so that, when the element in #landing is clicked, jQuery scrolls the page down to the #header element. Going by the jQuery docs, I would have assumed it would be as simple as: $('#landing p').click(function() { $('#header').scrollTop(250); }); But that doesn't appear to work at all. Plus, every other thread I look at (including some answers to my previous / similar threads) that uses the scrollTop method seems to use more complex code. So then I thought maybe I need to have something like this: $('#landing p').bind('click', function(e) { try { e.preventDefault(); target = this.hash; $('#header').animate({ scrollTop: 0 }, 150); } catch (error) { alert('error - ' + error); } }); Yet that doesn't work either. I get no error messages in the console but the event just won't seem to trigger. I've tested it with a simple alert statement which works fine, just I can't get it to scroll
tagged with: scrollto
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
has title: jQuery scrollTop Not Triggering
has answer: http://stackoverflow.com/a/29598571
has comment: http://stackoverflow.com/comment/47343473
tagged with: scrolltop
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29598571
tagged with: jquery-plugins

http://stackoverflow.com/q/29547963
tagged with: javascript
tagged with: ckeditor
has comment: http://stackoverflow.com/comment/47248152
favorite count: 0
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47257513
upvote count: 1
has comment: http://stackoverflow.com/comment/47251723
score: 1
has title: CKEditor - Using GetData()
type: Question
has body: I am struggling with implementing the following: I have the a button which creates the CKE instance (outside the form): Edit I then have a save button (outside the form): Save I then use the following javascript to post to a mySQL database: $(document).ready(function (argument) { $('.btn').click(function () { id = $(this).attr('id').replace('save',''); $edit = CKEDITOR.instances.editor81.getData(); $cid = $('#cid' + id).val(); $action = $('#action' + id).val(); $eid = $('#eid' + id).val(); $.ajax({ url: 'include/editupdate.php', type: 'post', data: { data: $edit, cid: $cid, eid: $eid, action: $action }, datatype: 'html', success: function (rsp) { alert(rsp); } }); }); }); The information posts fine to the database except it does not pick up any data from the editor instance, so that field is always blank. All of the other fields are OK. The suffix 81 is the record ID. I also would like to know how to close the editor instance after posting to the database. Many thanks
downvote count: 0

http://stackoverflow.com/comment/47500783
score: 0
type: AnswerComment
has text: jquery is a library to make us live more easy and our javascript code more clean for example `var example = document.getElementById('id').value;` could be reduced to `$('#id').val()` using jQuery but like i say, if you are learning first give a try to plain old javascript and lester you understand the basic jump to jQuery
type: Comment
comment on: http://stackoverflow.com/a/29681379

http://stackoverflow.com/a/29641882
answers question: http://stackoverflow.com/q/29641815
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47452394
has comment: http://stackoverflow.com/comment/48462295
has body: I noticed you've still got the :hover pseudoclass in your CSS. If you're trying to trigger the menus on click, you cannot use the :hover pseudoclass. There's no faking it. So your first step is to replace the :hover pseudoclass with a proper class. Here is a generic example: /* change anything like this */ .my-element:hover { ... styles ... } /* to this */ .my-element.hover { .. styles ... } For this next part, I'm going to assume jQuery, because it's quicker and easier to write. Then, you need to detect a click on your element, apply the class, and remove it from your other elements. This can be done like so: $('.my-element').on('click', function(e) { e.preventDefault(); // remove .hover class from all other elements $('.my-element').removeClass('hover'); // apply it to the current element $(this).addClass('hover'); }); These examples are not specific to your example, but it should get you on the right track.
upvote count: 1
has comment: http://stackoverflow.com/comment/47468223

http://stackoverflow.com/q/29572797
tagged with: javascript
favorite count: 0
has body: I am building a Yeoman generator and dependencies needed for this come from https://github.com/sboudrias/mem-fs-editor#copytplfrom-to-context-settings and https://github.com/SBoudrias/Inquirer.js/ The idea is to be able to ask the user a question and repeat the same question i.e. would you like to add another... if the user adds another then it will bind and record that answer and if the user says 'no' or hits return the prompt will stop. I would like to then have all of the answers binded to an arrary that can be passed to another object function so that it can list out the responses as an array. Here is the code so far... First is the prompt: askForTest1: function () { if (this.type == 'foundation5') { var cb = this.async(); var prompts = { type: 'input', name: 'test1', message: chalk.yellow(' What is your favorite movie'), default: 'Star Wars!' }; this.prompt(prompts, function (props) { this.templatedata.test1 = props.test1; cb(); }.bind(this)); } }, Then is the copyTpl object that will bind options for template builds: This is the desired output I would like to occur... and keep in mind this copy tpl lives in the same index.js file as the prompts. i.e. this template... this.fs.copyTpl( this.templatePath('/index2.html'), this.destinationPath('app/index2.html'), { title: [this.templatedata.test1-a, this.templatedata.test1-b, this.templatedata.test1-c, ...], h1: this.applicationName } ); as a result... a template with this code... using will produce this... using foo1 using foo2 is this possible and how would I go about doing this.
has answer: http://stackoverflow.com/a/29787776
has comment: http://stackoverflow.com/comment/47305628
tagged with: yeoman
tagged with: yeoman-generator
has comment: http://stackoverflow.com/comment/47297877
has answer: http://stackoverflow.com/a/29735806
has comment: http://stackoverflow.com/comment/47318426
tagged with: npm
has comment: http://stackoverflow.com/comment/47377832
has comment: http://stackoverflow.com/comment/47294977
upvote count: 7
possible better answer: http://stackoverflow.com/a/29735806
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29787776
score: 7
has comment: http://stackoverflow.com/comment/47298007
has comment: http://stackoverflow.com/comment/47378642
has title: is there a way to do a while loop for prompted input questions, bind them and have all answers available in an array?
type: Question
answer count: 2
tagged with: arrays
downvote count: 0

http://stackoverflow.com/q/29531319
downvote count: 2
accepted answer: http://stackoverflow.com/a/29531500
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/47216054
favorite count: 0
has body: So I have an iframe opening page Y inside page X. And Page Y contains a form, on submit of which it redirects to page Z. But Page Z is opening inside the iframe but I want it to open in the parent window, basically on submit of the form it should redirect to page Z from page X in the parent window. Any solution for this ?
has answer: http://stackoverflow.com/a/29531500
has comment: http://stackoverflow.com/comment/47216168
type: AnsweredQuestion
upvote count: 0
tagged with: iframe
has comment: http://stackoverflow.com/comment/47216325
type: Question
score: -2
has title: How to force redirect in an iframe to open in parent window?
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/9352195

http://stackoverflow.com/comment/47245733
score: 1
comment on: http://stackoverflow.com/q/29547033
has text: DOM can never be manipulated with HTML or CSS. You'll need javascript for that. I don't think you can achieve what you want with pure CSS. Why don't you want to use JS?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/50390457
has text: Conflicted.. I want to upvote this (great writeup), but I personally disagree on CWS publishing being complicated. Yes, it costs money: once, and nowhere near as much as Android publishing, for example. I will upvote after all.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/31192753
type: AnswerComment

http://stackoverflow.com/q/29612316
has comment: http://stackoverflow.com/comment/47370202
has comment: http://stackoverflow.com/comment/47370139
has comment: http://stackoverflow.com/comment/47370132
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47370276
has answer: http://stackoverflow.com/a/29612532
has comment: http://stackoverflow.com/comment/47370158
type: Question
upvote count: 4
has title: How can I pass more than one argument to set attribute of object property in JavaScript?
has body: Consider code below. var book = { name: "JavaScript Test Book", edition: 3, year: 2014 }; Object.defineProperty(book, "info", { get: function() { return "\"" + this.name + "\" edition " + this.edition + " published on " + this.year; }, set: function(info) { this.name = info[0]; this.edition = info[1]; this.year = info[2]; } }); console.log(book.info); //"JavaScript Test Book" edition 3 published on 2014 book.info = ["JavaScript Recipe", 1, 2015]; console.log(book.info); //"JavaScript Recipe" edition 1 published on 2015 So for my set attribute, the function is only accepting one argument, the array. And this is the only way i know to pass multiple arguments. Is there any other ways to pass multiple arguments? So my set function could be set: function(name,edition,year) { this.name = name; this.edition = edition; this.year = year; }
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/47370214
tagged with: javascript
score: 4
has comment: http://stackoverflow.com/comment/47370449
accepted answer: http://stackoverflow.com/a/29612532
favorite count: 0
has comment: http://stackoverflow.com/comment/47370155

http://stackoverflow.com/comment/47395839
type: Comment
type: QuestionComment
has text: I one view which contains register form and login. For both i have diffrent models. Register() method will be called onclick of register button. Login method will be called onclick of login button. Am keeping both registration and login in one view.
comment on: http://stackoverflow.com/q/29626073
score: 0

http://stackoverflow.com/comment/47507393
score: 0
type: Comment
has text: It would also save you a bunch of typing! : )
type: AnswerComment
comment on: http://stackoverflow.com/a/29684356

http://stackoverflow.com/comment/108125813
score: 1
has text: I would be great to know in an answer whether people are affiliated with a framework that they are recommending or not @HelenDikareva
type: AnswerComment
comment on: http://stackoverflow.com/a/41120390
type: Comment

http://stackoverflow.com/a/29578275
type: Answer
has comment: http://stackoverflow.com/comment/47310401
has comment: http://stackoverflow.com/comment/47310278
score: 2
has comment: http://stackoverflow.com/comment/47309867
upvote count: 2
has body: Like this - not tested but should work: var imgs = document.getElementsByTagName('img'); for(var i = 0; i &lt; imgs.length; i++) { var currentSrc = imgs[i].getAttribute('src'); imgs[i].setAttribute('src',''); // remove old src data imgs[i].setAttribute('data-src','currentSrc'); } All this does is add a new data-src attribute, and clears the current src (if needed) Add just before the &lt;/body&gt; tag
answers question: http://stackoverflow.com/q/29578186
has comment: http://stackoverflow.com/comment/47306476
has comment: http://stackoverflow.com/comment/47326381
downvote count: 0
has comment: http://stackoverflow.com/comment/47305900
has comment: http://stackoverflow.com/comment/47305552
has comment: http://stackoverflow.com/comment/47305593
has comment: http://stackoverflow.com/comment/47306129

slideshow
tags question: http://stackoverflow.com/q/29563890
tags question: http://stackoverflow.com/q/29572327
type: Tag
tag name: slideshow
tags question: http://stackoverflow.com/q/29671211
tags question: http://stackoverflow.com/q/29659076

http://stackoverflow.com/a/29627767
has comment: http://stackoverflow.com/comment/47436686
downvote count: 0
has comment: http://stackoverflow.com/comment/47437474
score: 6
has body: $(document).on("click","#myDiv", function (event) { alert(event.target.id); });
type: Answer
has comment: http://stackoverflow.com/comment/47436646
has comment: http://stackoverflow.com/comment/47435666
upvote count: 6
answers question: http://stackoverflow.com/q/29627660
has comment: http://stackoverflow.com/comment/47398494
has comment: http://stackoverflow.com/comment/47436784

http://stackoverflow.com/q/29650205
linked to: http://stackoverflow.com/q/27103898
has answer: http://stackoverflow.com/a/34493920
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29653714
answer count: 2
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has body: I am using Bootstrap Multiselect plugin for my select option elements. When user select one (or all options) from one select option element, all elements from other select options element needs to be unchecked. I checked documents for solution and when I use code in documentation I got error: bootstrap-multiselect.js:1042 (Uncaught TypeError: undefined is not a function) Does someone knows where's the problem? Here is my code: $('#select1').multiselect({ includeSelectAllOption: true, enableFiltering: true, onChange: function(element, checked) { //alert ("OK");//Alerts pop ups $('#select2').multiselect('deselectAll', false); $('#select2').multiselect('updateButtonText') } });
type: AnsweredQuestion
has title: Bootstrap Multiselect plugin fails to uncheck all elements
has answer: http://stackoverflow.com/a/29653714
tagged with: twitter-bootstrap
upvote count: 3
has comment: http://stackoverflow.com/comment/47441207
tagged with: bootstrap-multiselect
has comment: http://stackoverflow.com/comment/47443404
type: Question
possible better answer: http://stackoverflow.com/a/34493920
score: 3
has comment: http://stackoverflow.com/comment/47442758

rest
tags question: http://stackoverflow.com/q/29623007
tags question: http://stackoverflow.com/q/29568430
tags question: http://stackoverflow.com/q/29595474
tags question: http://stackoverflow.com/q/29626887
tags question: http://stackoverflow.com/q/29605541
tags question: http://stackoverflow.com/q/29582894
tags question: http://stackoverflow.com/q/29562710
type: Tag
tags question: http://stackoverflow.com/q/29617138
tags question: http://stackoverflow.com/q/29650990
tags question: http://stackoverflow.com/q/29558111
tag name: rest
tags question: http://stackoverflow.com/q/29545913
tags question: http://stackoverflow.com/q/29558681
tags question: http://stackoverflow.com/q/29622610
tags question: http://stackoverflow.com/q/29541216

playframework
tags question: http://stackoverflow.com/q/29666465
tags question: http://stackoverflow.com/q/29565485
tags question: http://stackoverflow.com/q/29591249
tags question: http://stackoverflow.com/q/29580202
tags question: http://stackoverflow.com/q/29631536
type: Tag
tags question: http://stackoverflow.com/q/29562835
tag name: playframework

http://stackoverflow.com/comment/47530474
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29675211
type: Comment
has text: user4329628: Note if you wrap your code in a shortcut DOM ready handler like `JQuery(function($){YOUR CODE HERE});` you can use the standard `$` for jQuery without fear of clashing (and much shorter).

http://stackoverflow.com/comment/47331536
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29586619
has text: In my browser, I need to change the print statement to `console.log(data.value)` to get this behavior. But otherwise, this is a very good explanation of the underlying behavior.
score: 0

http://stackoverflow.com/q/29539989
possible better answer: http://stackoverflow.com/a/33304974
tagged with: liferay
answer count: 2
has answer: http://stackoverflow.com/a/33304974
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29541929
tagged with: velocity
tagged with: portlet
has body: I'm trying to add a link to a velocity template that calls an action in an instanceable portlet. It looks like this click here Is there a way to get the instance id (ia9r3lKTG3YL) using the portlet name (displayportlet_WAR_myportlets) using javascript or some built in function or do I really have to hardcode it? This template is used for several instances of the same site and the instance ids are different on each site.
has title: How to get Liferay portlet instance id in velocity template
favorite count: 0
upvote count: 1
type: AnsweredQuestion
score: 1
tagged with: java
type: Question
has answer: http://stackoverflow.com/a/29541929

http://stackoverflow.com/q/29582646
has comment: http://stackoverflow.com/comment/47314059
type: Question
has comment: http://stackoverflow.com/comment/47313928
has title: Bootstrap's textarea renders oddly and ugly in firefox
tagged with: javascript
has answer: http://stackoverflow.com/a/29582817
tagged with: firefox
answer count: 1
downvote count: 0
favorite count: 0
tagged with: twitter-bootstrap
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/47313598
has comment: http://stackoverflow.com/comment/47313630
type: AnsweredQuestion
score: 2
accepted answer: http://stackoverflow.com/a/29582817
upvote count: 2
has body: I'm trying to make theme using Bootstrap and i'm having problems with textarea. it works fine in chrome and chrome based browsers but it looks odd and ugly in firefox. Here is a working fiddle (open in Firefox). How do i fix it??? I want it to look normal. and i don't want to break anything else by fixing this. &lt;div&gt; &lt;br /&gt; &lt;br /&gt; &lt;textarea id="s" type="text" name="s" value="Enter Text" &gt;&lt;/textarea&gt; &lt;/div&gt;

http://stackoverflow.com/a/29554155
score: 0
has body: Hi you could try this also $(function () { var span = $("name"); $("#one").append(span); $("#two").append(span.html()); }); http://jsfiddle.net/72ky7o28/
type: Answer
answers question: http://stackoverflow.com/q/29554076

http://stackoverflow.com/q/29583253
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29585933
accepted answer: http://stackoverflow.com/a/29585933
downvote count: 0
has body: I'm getting the following error while trying to use Tokenfield for Bootstrap: Uncaught TypeError: undefined is not a function Does anyone know how to fix this? The error happens at (about line 180): this.$input.autocomplete(r) this.$input points to an array containing the input field, but this.$input.autocomplete is undefined (when debugging from Chrome's console). I've tried adding noconflict (as discussed here), but that didn't work. Here's the manipulated html: &lt;div class="tokenfield form-control" style="width: 100%;"&gt; &lt;input id="hident15" name="f14" type="text" required="" value="" class="form-control" tabindex="-1" style="position: absolute; left: -10000px;"&gt; &lt;input type="text" tabindex="-1" style="position: absolute; left: -10000px;"&gt; &lt;input type="text" class="token-input" autocomplete="off" placeholder="" id="hident15-tokenfield" tabindex="0" style="min-width: 60px; width: 333px;"&gt; &lt;/div&gt;
type: Question
has title: Tokenfield for Bootstrap error
tagged with: javascript
upvote count: 2
answer count: 1
favorite count: 0
tagged with: twitter-bootstrap

http://stackoverflow.com/comment/47307982
score: 0
comment on: http://stackoverflow.com/q/29579752
type: Comment
type: QuestionComment
has text: Are you sure there's not an `asynchronous` call going on somewhere?

http://stackoverflow.com/comment/47351408
type: Comment
comment on: http://stackoverflow.com/q/29538926
has text: Fiddle is not loading. And please indent your code so it's formatted nicely.
score: 0
type: QuestionComment

http://stackoverflow.com/a/29616092
accepted answer of: http://stackoverflow.com/q/29615754
answers question: http://stackoverflow.com/q/29615754
type: Answer
has body: According to the doc, the XMLHttpRequest object is available in the submitted event: http://ajax-form.raynicholus.com/components/ajax-form/#ajax-form.events.submitted So you could handle that something like this: handleResponse: function(event) { this.response = event.detail.responseText; // do whatever you need to do with it. } If you're using this inside a Polymer element, you can use declarative event mapping like this: &lt;form is="ajax-form" on-submitted="{{handleResponse}} action="URL" id="formID" method="POST" enctype="multipart/form-data" &gt; ... &lt;/form&gt; Or you can add the listener imperatively: this.$.formID.addEventListener('submitted', handleResponse); Hope this helps.
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/47462842
type: Comment
comment on: http://stackoverflow.com/a/29661024
type: AnswerComment
has text: ... I've read many many posts on it. Tried many and none worked. So I tried this approach, I'm almost there I just need to get the right value
score: 0

eclipse-jsdt
tags question: http://stackoverflow.com/q/29675927
tag name: eclipse-jsdt
type: Tag

http://stackoverflow.com/a/29668601
type: Answer
has comment: http://stackoverflow.com/comment/47482596
has body: Again, it's all in the docs. And please, spent some time producing a readable question. The call should be /{page_id}/insights/page_views?period=day&amp;since=1427846400&amp;until=1429142400&amp;access_token={access_token} Replace {access_token} with an actual Access Token with read_insights permission, and {page_id} with a page id. This returns the daily page views from April 1st to April 15th. See https://developers.facebook.com/docs/graph-api/reference/v2.3/insights#readfields https://developers.facebook.com/docs/graph-api/using-graph-api/v2.3#paging
has comment: http://stackoverflow.com/comment/47479590
has comment: http://stackoverflow.com/comment/47481312
has comment: http://stackoverflow.com/comment/47484030
has comment: http://stackoverflow.com/comment/47483513
has comment: http://stackoverflow.com/comment/47483992
score: 0
has comment: http://stackoverflow.com/comment/47483757
has comment: http://stackoverflow.com/comment/47479233
has comment: http://stackoverflow.com/comment/47483788
answers question: http://stackoverflow.com/q/29667665
has comment: http://stackoverflow.com/comment/47481581

http://stackoverflow.com/q/29569916
type: Question
answer count: 1
has comment: http://stackoverflow.com/comment/47289460
has comment: http://stackoverflow.com/comment/47289398
accepted answer: http://stackoverflow.com/a/29570020
score: 0
has comment: http://stackoverflow.com/comment/47289372
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/47289353
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/47289366
type: AnsweredQuestion
has body: I'm trying to iterate through the JSON array and through the ingredients/directions array using ng-repeat. What I have isn't working. Any advice? Thanks! Controller: recipeControllers.controller('DetailsController', ['$scope', '$http','$routeParams', function($scope, $http, $routeParams) { $http.get('app/data.json').success(function(data) { $scope.recipe = data; $scope.whichItem = $routeParams.itemId; $scope.recipeIngredients = recipe[whichItem].ingredients; }]); HTML: &lt;div class="recipe"&gt; &lt;div class="ingredients"&gt; &lt;ul&gt; &lt;li ng-repeat="item in recipeIngredients"&gt;{{recipeIngredients[whichItem].ingredients}}&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; JSON Data: [ { "dish":"thai_chicken_satay", "ingredients": ["chicken", "sauce", "stuff"], "directions": ["step1", "step2", "step3"] }, { "dish":"duck_confit", "ingredients": ["duck", "confit", "otherstuff"], "directions": ["step1", "step2", "step3"] } ]
has answer: http://stackoverflow.com/a/29570020
has comment: http://stackoverflow.com/comment/47289377
tagged with: angularjs-ng-repeat
favorite count: 0
has title: Using ng-repeat on an array within an array
tagged with: angularjs

http://stackoverflow.com/comment/47306877
type: Comment
type: QuestionComment
has text: What is your question?
score: 1
comment on: http://stackoverflow.com/q/29579198

http://stackoverflow.com/comment/47492447
has text: http://stackoverflow.com/questions/1631959/how-to-capture-the-browser-window-close-event
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29676857

mirth
tags question: http://stackoverflow.com/q/29550305
tag name: mirth
type: Tag

http://stackoverflow.com/q/29574832
linked to: http://stackoverflow.com/q/13587184
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/29574892
upvote count: 1
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has body: I am familiar with a few web technologies, but currently was asked to find an easy solution for the task below - and I struggle to decide what approach to take. Is there an existing solution for this? Can this be done in javascript? Or does it require flash? The user will be shown a photo and will have to select a rectangle within the photo (which will later be cropped). The selected rectangle must meet certain size/ration requirements. The actual cropping can easily be done by the server, but I wanted to ask for suggestions what would the best way be to tackle the front-end interface which would take the selected rectangle coordinates, possibly do basic calculations (check ratio etc) on them and upon approval send them to the server. This is gives you an idea: https://i.sstatic.net/Fp2H9m.png No special mobile support needed - ie desktop browsers only. Thanks a million, FSG
has comment: http://stackoverflow.com/comment/47298444
has answer: http://stackoverflow.com/a/29575202
accepted answer: http://stackoverflow.com/a/29575202
has title: Web Interface to allow user to select rectangle within image
possible better answer: http://stackoverflow.com/a/29574892

http://stackoverflow.com/comment/47401587
score: 0
has text: https://jsfiddle.net/alexcoady/L9dfg74f/7/
type: Comment
comment on: http://stackoverflow.com/q/29628701
type: QuestionComment

http://stackoverflow.com/q/29626580
type: Question
tagged with: c#
answer count: 1
tagged with: javascript
score: 0
type: UnansweredQuestion
has title: ScriptManager.RegisterClientScriptBlock not working in Visual WebPart
has body: I am working in VisualWebPart and want to call Javascript method from c#. Below is my code. If I replace myFunction(); with alert() then alert is working. However, myFunction() is not getting called. I tried with ScriptManager.RegisterStartUpScript too but fail. I debugged and there was no error too. Am I doing anything wrong? &lt;script type="text/javascript"&gt; function myFunction() { alert('Function called successfully!'); } &lt;/script&gt; &lt;asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /&gt; c# protected void Button1_Click(object sender, EventArgs e) { ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "myFunction", "myFunction();", false); }
has answer: http://stackoverflow.com/a/29626663

http://stackoverflow.com/comment/47388576
type: Comment
has text: You can try it, but I wouldn't expect it to be reliable long term if it does work as the auth data should be considered private parse data - best to ask them if it will work (long term)
comment on: http://stackoverflow.com/a/29620857
score: 0
type: AnswerComment

http://stackoverflow.com/a/29665810
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29665778
has body: You're defining an anonymous function and then immediately invoking it with the this parameter. If you're just looking to understand the meaning of this, then refer to this other question.

http://stackoverflow.com/q/29554151
has comment: http://stackoverflow.com/comment/47261042
tagged with: closures
downvote count: 0
possible better answer: http://stackoverflow.com/a/29554476
tagged with: javascript
tagged with: jquery
tagged with: callback
accepted answer: http://stackoverflow.com/a/29554439
has answer: http://stackoverflow.com/a/29554476
has body: Issue Resolved, any comments on best practice would be welcome I'm working on a JS (and JQuery) Battleships game and have function 'dropBoat' that allows a user to place a ship on a board. The details of this function are not important (it takes board and boatLength as arguments) however I'm unable to reuse it to place a second boat. I'm trying to achieve this chain of events: dropBoat function called --> dropBoat function called --> dropBoat function called --> StartPlay function called. Here's a sketch of my current attempt. var dropBoat = function(board, length, callback){ //function code here $(document).keydown(function(e){ if(e.which == "38"){ //more function code here callback() } } } var dropThirdBoat = dropBoat(board1, 3, startPlay); var dropSecondBoat = dropBoat(board1, 2, dropThirdBoat); var dropFirstBoat = dropBoat(board1, 3, dropSecondBoat)(); this seems to work var dropThirdBoat = function(){ dropBoat(board1, 3, startPlay); } var dropSecondBoat = function(){ dropBoat(board1, 2, dropThirdBoat); } var dropFirstBoat = dropBoat(board1, 3, dropSecondBoat); var dropBoat = function(board, length, callback){ //function code here $(document).keydown(function(e){ if(e.which == "38"){ //more function code here callback(); } } }
answer count: 3
linked to: http://stackoverflow.com/q/2190850
has comment: http://stackoverflow.com/comment/47260552
favorite count: 0
has title: Self-referential Callbacks
upvote count: 1
has comment: http://stackoverflow.com/comment/47260946
has answer: http://stackoverflow.com/a/29554921
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29554439
score: 1
type: Question

http://stackoverflow.com/comment/47217821
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29532304
has text: You can pass an anonymous object - `return Json(new { Message = "A Mistake just happend", Passed = false }, JsonRequestBehavior.AllowGet);`
type: Comment

http://stackoverflow.com/comment/47371336
comment on: http://stackoverflow.com/q/29612714
score: 0
has text: Execution context changes, `console` is no longer `this` when used as a reference
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29566706
score: 0
answers question: http://stackoverflow.com/q/29566545
type: Answer
has body: Use IDs: var Plane_Images = { top: "images/Top.png", structure: "images/ata21.png", electrics: "images/ata26.png", fuel: "images/Top.png", hydraulics: "images/Top.png" } var i=1; for(var images in Plane_Images){ var image_src = Plane_Images[images]; $("#menu").append("&lt;div class='schematics' id='bgImage"+i+"'&gt;&lt;/div&gt;"); // add ID $("#bgImage"+i).css("background-image", "url(" +image_src +")"); // reference ID not class console.log(image_src); i++; // increase i so no multiple IDs }

http://stackoverflow.com/q/29540359
answer count: 1
has title: JS working in Chrome but not Firefox
has answer: http://stackoverflow.com/a/29540725
accepted answer: http://stackoverflow.com/a/29540725
has comment: http://stackoverflow.com/comment/47232649
has body: This script stopped working in FireFox a couple of weeks ago, around the time I added an SSL certificate to the site. I've confirmed that SSL is being used everywhere, and I've tried disabling all recently installed plugins, to no avail. I've looked at it with Web Console and don't see any errors there either - though I'm not very experienced with that. I've also looked at other threads here about js working in Chrome but not FF, but none of the proposed solutions seem to apply to my script. The problem is that the js is apparently not being called at all - it should show up between the introduction and the "share" graphic. Any ideas? This is the page where it should show up, between the text and the "share" graphic: Quiz And this is the js file: Javascript Here is the code: $.each(questions, function (key, value) { //console.log( key + ": " + value.question ); question = value.question; qtype = value.qtype; opts = value.opts; answer = value.answer; special = value.special; $('#quiz-form').append('&lt;p&gt;&amp;#160;&lt;br&gt;' + parseInt(key + 1) + ") " + question + '&lt;/p&gt;'); if (qtype == "radio") { opt_array = opts.split(','); for (i = 0; i &lt; opt_array.length; i++) { $('#quiz-form').append('&lt;p&gt;&lt;input data-ftype="radio" type="radio" name="question_' + key + '" class="question_' + key + '" value="' + opt_array[i] + '"&gt; ' + opt_array[i] + ' &lt;/p&gt;'); } } else if (qtype == "checkbox"} else if (qtype == "checkbox") { opt_array = opts.split(','); for (i = 0; i&lt;opt_array.length;i++) { $('#quiz-form').append('&lt;p&gt;&lt;input data-ftype="checkbox" type="checkbox" name="question_' + key + '" class="question_' + key + '" value="'+ opt_array[i] + '"&gt; ' + opt_array[i] + '&lt;/p&gt;'); } } else if (qtype == "input") { $('#quiz-form').append('&lt;p&gt;&lt;input data-ftype="text" name="question_' + key + '" type="text" class="question_' + key + '" value="" style = "border:1px solid" &gt;&lt;/p&gt;'); } $('#quiz-form').append('&lt;p&gt;&lt;input na…
type: AnsweredQuestion
tagged with: wordpress
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47232699
score: 0
tagged with: firefox

http://stackoverflow.com/q/29592283
tagged with: angularjs-directive
type: AnsweredQuestion
score: 1
tagged with: angularjs-scope
has comment: http://stackoverflow.com/comment/47331619
type: Question
answer count: 1
linked to: http://stackoverflow.com/q/12506329
tagged with: javascript
has title: How to dynamically set title tag on page load in AngularJS?
has answer: http://stackoverflow.com/a/29592636
has body: I'm trying to set the page title dynamically on page load. Here is my code: Hello {{ user.name }} Clicked {{ counter.clicks }} times Click I suppose that setting $rootScope.title in run() could update the title in page load, but it doesn't.
accepted answer: http://stackoverflow.com/a/29592636
favorite count: 0
has comment: http://stackoverflow.com/comment/47344523
tagged with: angularjs
upvote count: 2
has comment: http://stackoverflow.com/comment/47331576
downvote count: 1

http://stackoverflow.com/comment/47397271
type: AnswerComment
has text: @Xufox Because, according to the jsfiddle in the question, the functions are called without parameters.
type: Comment
comment on: http://stackoverflow.com/a/29627053
score: 0

permissions
tag name: permissions
type: Tag
tags question: http://stackoverflow.com/q/29574094

http://stackoverflow.com/comment/95147924
has text: @viery365 Oh didn't know that, you should add your own answer with our solution. That may be better for just `forEach()`.
type: AnswerComment
comment on: http://stackoverflow.com/a/29626762
score: 0
type: Comment

http://stackoverflow.com/q/29685656
tagged with: css
linked to: http://stackoverflow.com/q/14473769
has answer: http://stackoverflow.com/a/29686154
score: 0
has comment: http://stackoverflow.com/comment/47508874
has comment: http://stackoverflow.com/comment/47508759
type: Question
has title: bootstrap modal overflow issue
has comment: http://stackoverflow.com/comment/47508663
has comment: http://stackoverflow.com/comment/47508731
tagged with: javascript
has body: I have a Bootstrap modal with a button. When I click the button it shows a right under the button. The contains a ul list with anchor links in it. The problem is that if I don't set the height to a higher value then that inside the modal the last items is not visislbe because the div is outside the modal. I don't want to use overflow because i don't want it to scroll. The inside the modal is a dropdown menu which i made my self. The CSS for the : .wrapper-for-dropdown { width: 300px; z-index:9999; color: #333; background-color: #fff; position: absolute; display: none; border: solid; border-width: 1px; border-radius: 4px; border-color: #ccc; z-index:32432423432; overflow-wrap:normal; } .wrapper-for-dropdown:hover { border: solid; border-width: 1px; border-color: #ccc; } .dropdown-ul { list-style-type: none; -moz-st color: white; text-align: left; padding-left: 10px; overflow-y: visible; } .dropdown-ul li { float: left; display: inline-block; height: auto; width: 250px; } .dropdown-ul li:hover { } .dropdown-ul li a { color: #38546d; display: block; float: left; } .dropdown-ul li a:hover { color: black; display: block; float: left; } HTML: &lt;!-- Modal --&gt; &lt;div class="modal" id="modalCreateNewManualResync" tabindex="-1" role="dialog" aria-labelledby="modalCreateNewManualResyncLabel" aria-hidden="true"&gt; &lt;div class="modal-dialog" id="createNewSyncDialog"&gt; &lt;div class="modal-content" style=""&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="modalCreateNewManualResyncLabel"&gt;Create New Resync &lt;/h4&gt; &lt;/div&gt; &lt;!-- Model Body --&gt; &lt;div class="modal-body" &gt; &lt;div class="container-fluid"&gt; &lt;div class="modal-content-div"&gt; &lt;label&gt;Company:&lt;/label&gt; &lt;label&gt;Sync Reason:&lt;/label&gt; &lt;/div&gt; &lt;div class="modal-content-div-data"&gt; &lt;butt…
linked to: http://stackoverflow.com/q/11899870
answer count: 1
has comment: http://stackoverflow.com/comment/47508677
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/50589769
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29584100
has text: Getting "File Not Found" on your thesis URL. Are you still having this issue?

http://stackoverflow.com/comment/47497680
type: Comment
has text: Can you setup a fiddle where the error is reproduced? The code works right away, so you must have something else that are causing the error. BTW, why not use the existing rowgrouping plugin?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29677967

http://stackoverflow.com/comment/47464421
type: AnswerComment
type: Comment
has text: thanks for the effort, however I do not neither want to concatenate them or use separate datasource since I need to handle multiple linesources. In addition to that, this data source attributes are exactly same.
comment on: http://stackoverflow.com/a/29662466
score: 0

tampermonkey
tags question: http://stackoverflow.com/q/29663954
type: Tag
tags question: http://stackoverflow.com/q/29605771
tag name: tampermonkey

http://stackoverflow.com/a/29550325
type: Answer
answers question: http://stackoverflow.com/q/29549686
has body: Can you count on the delimiters and the location of the text you want to replace in relation to the delimiters? If so, here's couple methods of replacing text spliting and spliceing on delimiters. Simpler one, split on comma, replace second element in its entirety: JSFiddle var str = 'User ID: 2894, Task ID: 68, Some other text' arr1 = str.split(', ') arr1.splice(1, 1, 'Task ID: &lt;replaced&gt;') str = arr1.join(', ') console.log(str) A little more complex, first split on comma, then colon: JSFiddle var str = 'User ID: 2894, Task ID: 68, Some other text' arr1 = str.split(', ') arr2 = arr1[1].split(': ') arr2.splice(1, 1, '&lt;replaced&gt;') arr1[1] = arr2.join(': ') str = arr1.join(', ') console.log(str) Simply an alternative to replace. I think the replace option is better for the case you presented.
score: 0

http://stackoverflow.com/a/29666088
type: Answer
score: 2
downvote count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/47471446
has comment: http://stackoverflow.com/comment/47471862
has body: You should place the code inside the /lib folder /lib if(Meteor.isServer){ database = new MongoInternals.RemoteCollectionDriver("mongodb://localhost:27017/adaptiveid"); idpool = new Mongo.Collection("idpool", {_driver:database}); //rest of the code..... } Why the isServer and the /lib? Well the /lib folder is the very first meteor loads at the start, but that code is shared between client/server thats why you should specify it to use that code only in the server Note the Error: A method named '/idpool/insert' is already defined cames here because you are declaring the collection idpool twice. idpool = new Mongo.Collection("idpool", {_driver:database}) You already declare the collection there, why are you declaring it twice?, just remove the second idpoll = new Mongo.Collection('idpool')
has comment: http://stackoverflow.com/comment/47471395
answers question: http://stackoverflow.com/q/29666029
has comment: http://stackoverflow.com/comment/47471941

http://stackoverflow.com/a/29687325
type: AcceptedAnswer
has body: Regarding what @romuleald was saying, this is probably a little bit better way to structure your code. It eliminates the need to find the same arrays each time you go through your for loop. function() { // build products object var prods = []; var brand = document.querySelectorAll('.txtStayRoomLocation'); var name = document.querySelectorAll('.txtStayRoomDescription'); var price = document.querySelectorAll('.txtStayRoomSplashPriceAmount'); for(i=0; i &lt; brand.length; i++) { //set granular vars var prd = {}; //add to prd object prd.brand = brand[i].textContent; prd.name = name[i].textContent; prd.price = price[i].textContent; prd.quantity = window.session_context_vars.BookingContext.Booking.ReservationLineItems[i].ReservationCharges.length/2;; //add to prods array prods.push(prd); } var ecommerceData = { 'ecommerce': { 'purchase': { 'actionField': {'id': {{transaction id}}, 'revenue': {{transaction amount}}, 'tax': {{tax}}}, 'products': prods } } }; return ecommerceData; } As for the error, can you give us more details? What error is thrown in the debugger?
type: Answer
has comment: http://stackoverflow.com/comment/47537413
downvote count: 0
answers question: http://stackoverflow.com/q/29684553
score: 1
accepted answer of: http://stackoverflow.com/q/29684553
upvote count: 1

http://stackoverflow.com/comment/47349573
type: AnswerComment
has text: In rails you do not have to do the AJAX-request yourself, if you put a link with `remote: true`, then rails works the AJAX-magic for you. So what you put in the `bookmark.js.erb` is only your responses, success and error. Then you decide what JavaScript-action you want to do in both cases.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29596274

http://stackoverflow.com/comment/101603080
score: 0
type: Comment
has text: Thanks. I have tried the same but it does not show the icloud option in the ipa. If we run directly it shows. Any idea?
type: AnswerComment
comment on: http://stackoverflow.com/a/45794236

http://stackoverflow.com/a/29680754
accepted answer of: http://stackoverflow.com/q/29678896
score: 6
type: Answer
has comment: http://stackoverflow.com/comment/47521435
has body: When you instantiate the ActiveUsers component instance you can pass in an ids property: var activeUsers = new gapi.analytics.ext.ActiveUsers({ ids: 'ga:XXXX', container: 'active-users-container', pollingInterval: 5 });
upvote count: 6
answers question: http://stackoverflow.com/q/29678896
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/47359479
comment on: http://stackoverflow.com/a/29605707
score: 0
type: AnswerComment
has text: Well, i never did any jquery before that, i'll stay on my simple version which works with blur, it in't that bad as event ! :p Updated my first post to show you wich version works
type: Comment

http://stackoverflow.com/a/29660522
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29660363
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29660363
has comment: http://stackoverflow.com/comment/47461765
upvote count: 1
type: Answer
has body: Create a function that takes the string of words to replace, and the string to repeat until the length, then simply keep appending to a variable until the length is reached: function replaceTextWithLength(textToReplace, replaceText) { var length = textToReplace.length; var text = ""; while (text.length &lt; length) { text += replaceText; } return text.substring(0, length); } var words = replaceTextWithLength("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed id dui tincidunt", "sample text "); console.log(words); Demo: http://jsfiddle.net/zdvz59yb/

http://stackoverflow.com/q/29617482
score: 1
tagged with: http://stackoverflow.com/tag/json
accepted answer: http://stackoverflow.com/a/29617549
answer count: 1
tagged with: highcharts
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: ColdFusion JSON return in a specific format
has answer: http://stackoverflow.com/a/29617549
tagged with: coldfusion
has body: I'm trying to return data from database into jQuery based charts called HighCharts with no luck so far. My cfquery returns two columns - DateOnly and total If I use the following code, where I manually type in 7 dates, it works perfectly. &lt;cfset response = serializeJSON([ [tmz.DateOnly[1],tmz.total[1]], [tmz.DateOnly[2],tmz.total[2]], [tmz.DateOnly[3],tmz.total[3]], [tmz.DateOnly[4],tmz.total[4]], [tmz.DateOnly[5],tmz.total[5]], [tmz.DateOnly[6],tmz.total[6]], [tmz.DateOnly[7],tmz.total[7]]]) /&gt; &lt;cfoutput&gt;#response#&lt;/cfoutput&gt; However, this way I am limited to the seven days and the length of the list cannot be expanded dynamically. Is there a way to convert cfquery into this type of list that would get accepted by javascript charts? BTW, this is just one of the different attempts that I've tried, that did not work: &lt;cfset a = ArrayNew(1)&gt; &lt;cfoutput query="tmz"&gt; &lt;cfset b = ArrayNew(1)&gt; &lt;cfset ArrayAppend(b,DateOnly)&gt; &lt;cfset ArrayAppend(b,total)&gt; &lt;cfset b = Arraytolist(b,",")&gt; &lt;cfset a[currentrow] = b&gt; &lt;/cfoutput&gt; &lt;cfset b = ""&gt; &lt;cfloop from="1" to="#ArrayLen(a)#" index="i"&gt; &lt;cfset b = b &amp; "["&amp;a[i]&amp;"],"&gt; &lt;/cfloop&gt; &lt;cfset response = serializeJSON(b)&gt;
type: AnsweredQuestion
upvote count: 1
type: Question

http://stackoverflow.com/comment/47401057
score: 2
comment on: http://stackoverflow.com/a/29627738
has text: As far as I know, event isn't always passed as a parameter by all browsers. event.target also doesn't exist in older IE versions. To ensure it works in older browsers you can add: "event = event || window.event;" and "event.target = event.target || event.srcElement;"
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47508461
type: Comment
type: QuestionComment
has text: NORBERT VAN NOBELEN, Could you ellaborate?
score: 0
comment on: http://stackoverflow.com/q/29685377

http://stackoverflow.com/a/29534578
has comment: http://stackoverflow.com/comment/47262804
answers question: http://stackoverflow.com/q/29533514
has comment: http://stackoverflow.com/comment/47242101
has comment: http://stackoverflow.com/comment/47251040
has comment: http://stackoverflow.com/comment/47223117
type: Answer
has comment: http://stackoverflow.com/comment/47258855
has comment: http://stackoverflow.com/comment/47222730
has body: Try this: function forEachProperty(loc,object, callback) { for (var property in object) { if (!object.hasOwnProperty(property)) { continue; } if (object[property].constructor === Object) { if(loc[property]===undefined)loc[property]={}; this.forEachProperty(loc[property],object[property], callback); } else { callback(loc,object, property); } } } var self={bar:{baz:999}}; var options={test:'hello world',bar:{foo:8}} // Usage forEachProperty(self,options, function (loc,object, property) { if (property !== 'timeUrl' &amp;&amp; property !== 'element') { loc[property] = object[property]; } });
accepted answer of: http://stackoverflow.com/q/29533514
has comment: http://stackoverflow.com/comment/47222541
score: 0
has comment: http://stackoverflow.com/comment/47222931
type: AcceptedAnswer

http://stackoverflow.com/comment/47276860
type: Comment
has text: @Andy, please could you demonstrate how it should be on the HTML file. Please!
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29544893

http://stackoverflow.com/a/29567595
has body: To add to what others said in the comments, one way to set these variables is as you launch your node.js program, for example: PORT=9100 node server.js Another way it to set the variable first and make it available (with EXPORT) as Dave Newton indicated: export PORT=9100 node server.js
answers question: http://stackoverflow.com/q/29567116
type: Answer
upvote count: 3
has comment: http://stackoverflow.com/comment/90775415
score: 3
has comment: http://stackoverflow.com/comment/90813948
downvote count: 0

http://stackoverflow.com/q/29604112
has comment: http://stackoverflow.com/comment/47354304
favorite count: 0
has answer: http://stackoverflow.com/a/29604278
has answer: http://stackoverflow.com/a/29604312
has title: Calling a function from custom directive on click? - AngularJS
possible better answer: http://stackoverflow.com/a/29604282
upvote count: 1
has body: I'm calling a function from my custom directive on button click. This is the code I've in my JSP &lt;input type="button" value="button" text="{{item.id}}" data-href="divSlide" show-notifications&gt; This is my custom directive hello.directive("showNotifications", ["$interval", function($interval, $scope) { return { restrict: "A", link: function(scope, elem, attrs) { //On click $(elem).click(function() { console.log('before'); scope.$parent.getJSON(scope.text); if ($('tr#' + $(this).data("href")).is(":visible")) { $('tr#' + $(this).data("href")).remove(); } else { console.log('after'); $(this).closest('tr').after('&lt;tr id="' + $(this).data("href") + '"&gt;&lt;td colspan="5"&gt;' + $('#' + $(this).data("href")).html() + '&lt;/td&gt;&lt;/tr&gt;'); } }); }, scope:{ text: "@text" } }; }]); And this is my function $scope.getJSON= function(id){ jsonService.getJSONData(id).then(function(data){ $scope.data= []; $scope.data= data['dataList']; console.log('insidejson'); } }); }; When I execute the code the console prints the logs in the below order, before after insidejson But ideally it should be before insidejson after Why is it executing the next statement after the function call before the function gets executed? What am I doing wrong?
accepted answer: http://stackoverflow.com/a/29604278
has answer: http://stackoverflow.com/a/29604282
tagged with: angularjs-directive
type: AnsweredQuestion
score: 1
tagged with: angularjs-scope
type: Question
downvote count: 0
has comment: http://stackoverflow.com/comment/47354026
tagged with: javascript
tagged with: angularjs
answer count: 3

http://stackoverflow.com/comment/47361175
type: Comment
score: 0
type: AnswerComment
has text: @huggilou "You should use a PDF conversion on client side to keep graphs and etc" How can i make this thing ? are you have an example ?
comment on: http://stackoverflow.com/a/29607128

http://stackoverflow.com/comment/47284186
score: 0
type: AnswerComment
type: Comment
has text: Thanks for your reply. However, I am afraid to tell you that I am not able to see the expected result with that. I did exactly what you asked me do but doing `alert window.data` gives me null in my javascript.
comment on: http://stackoverflow.com/a/29566618

http://stackoverflow.com/q/29556483
tagged with: javascript
has comment: http://stackoverflow.com/comment/47263812
upvote count: 1
answer count: 1
downvote count: 0
tagged with: jquery
has body: By clicking Create I want to give continuing class name: For example now if you click Create button, it should create the following Div 3 : Div 1 Div 2 Here is JS function add(){ $("#container").append(" Div 3 ") } https://jsfiddle.net/5gmr5j8z/
favorite count: 0
has answer: http://stackoverflow.com/a/29556511
accepted answer: http://stackoverflow.com/a/29556511
has comment: http://stackoverflow.com/comment/47263544
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47263426
score: 1
has comment: http://stackoverflow.com/comment/47263879
has title: On creating div element give ordered class name
type: Question

http://stackoverflow.com/q/29650894
tagged with: meteor
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29651132
linked to: http://stackoverflow.com/q/27007264
type: Question
has title: Why does calling a method using Meteor.setInterval throw a TypeError exception?
has body: I am trying to use the Meteor.setInterval function but I have some troubles using it. Here is my code : Meteor.methods({ init : function(){ console.log('test'); }, start : function(period){ console.log('start : period '+period); Meteor.setInterval(Meteor.call('init'),period); } }); Meteor.call('start', 100); I see "test" in my console 1 time, then I get the following error : Exception in setInterval callback: TypeError : undefined is not a function. I've been looking at this question : Exception in setInterval callback but I did it in a different way (using Method.methods). What is happening and how can I fix it?
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/29651132
score: 0
tagged with: setinterval

http://stackoverflow.com/comment/47319553
has text: I should add, while trying to keep html, js and php seperated
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29585724
score: 0

http://stackoverflow.com/q/29607472
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47361047
downvote count: 0
has body: I seem to be having an issue with Angularjs using 'NgRoute' to navigate to a page. I have 3 other pages with controllers and they work absolutely fine, however when trying to go the the Dashboard page it only loads the view and not the controller. AngularJS App var app = angular.module('app', ['ngRoute']); app.config(function ($routeProvider) { $routeProvider.when("/dashboard", { contoller: "dashboardController", templateUrl: "/app/views/dashboard.html", }) $routeProvider.when("/machines", { controller: "machineController", templateUrl: "/app/views/machines.html", }) $routeProvider.when("/departments", { controller: "departmentController", templateUrl: "/app/views/departments.html", }) $routeProvider.when("/users", { controller: "userController", templateUrl: "/app/views/users.html", }); $routeProvider.otherwise({ redirectTo: "/dashboard" }); }); Controller 'use strict'; app.controller('dashboardController', ['$scope', '$http', 'Page', function ($scope, $http, Page) { Page.setTitle('Dashboard'); }]); HTML When I debug the controller it doesn't get past the instantiation of the Controller on the second line. Anyone have any ideas?
possible better answer: http://stackoverflow.com/a/29607593
has comment: http://stackoverflow.com/comment/47360614
has comment: http://stackoverflow.com/comment/47360598
has answer: http://stackoverflow.com/a/29607593
type: Question
has title: Angularjs failing to enter a controller
upvote count: 2
has answer: http://stackoverflow.com/a/29607671
accepted answer: http://stackoverflow.com/a/29607671
answer count: 2
tagged with: javascript
favorite count: 0
tagged with: angularjs
tagged with: mvvm
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/47297342
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29573700
has text: If you have abcd and bde, what do you want to the result to be? If you have bd and dbe, what is your desired result? What about if we swap the strings in the examples to where string 1 is string 2 and string 2 is string 1?

http://stackoverflow.com/comment/47265167
comment on: http://stackoverflow.com/a/29557089
type: AnswerComment
score: 0
type: Comment
has text: @herby Can you link to that spec? MDN says *"in the same order as that provided by a for...in loop"*, which is *"arbitrary"*.

http://stackoverflow.com/comment/47221979
type: QuestionComment
comment on: http://stackoverflow.com/q/29532934
type: Comment
has text: @ToddMark using preventDefault() in 'dblclick' unfortunately does not prevent Chrome from selecting all characters in textbox.
score: 0

http://stackoverflow.com/comment/47507696
type: Comment
type: QuestionComment
has text: First of all you are linking angular.min.js twice, one at the beginning and one at the end. Also put the link to angular-material in last-place, after angular-animate
comment on: http://stackoverflow.com/q/29634213
score: 0

http://stackoverflow.com/a/29623376
has comment: http://stackoverflow.com/comment/47396800
has comment: http://stackoverflow.com/comment/47402612
has comment: http://stackoverflow.com/comment/47396694
has comment: http://stackoverflow.com/comment/47407563
answers question: http://stackoverflow.com/q/29623007
has comment: http://stackoverflow.com/comment/47392001
has comment: http://stackoverflow.com/comment/47407577
has comment: http://stackoverflow.com/comment/47392151
has comment: http://stackoverflow.com/comment/47393781
has comment: http://stackoverflow.com/comment/47402896
has comment: http://stackoverflow.com/comment/47395342
score: 0
type: Answer
has body: It looks correct. Maybe you forgot to add the application context to your requestUrl. Try it with a relativ path, like this: $scope.deleteST = function (ids) { $http.delete('structure/deleteStruct/' + ids). success(function (data) { alert(ids); }); }

http://stackoverflow.com/comment/47406481
has text: On further investigation, I think that error is key. It looks like that error is preventing the click handlers from working. If I change the button to just an tag, then the click works. I have no idea why that error happens in Casper but not chrome, though.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29616350

http://stackoverflow.com/comment/47318037
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29584873
has text: Create a div 500px and repeat the image inside it
score: 0

http://stackoverflow.com/a/31373835
accepted answer of: http://stackoverflow.com/q/29663380
upvote count: 3
answers question: http://stackoverflow.com/q/29663380
type: Answer
has body: Try placing your jquery code inside a $(document).ready(). E.G. : componentDidMount: function() { var _this = this; $(document).ready(function() { $(_this.getDOMNode()).popover(); }); } Edit #1: In response to comment: "You should also explain why" – Rohit Gupta If you ask why too much, it will destroy the wonder of it all. I joke. I came across the answer because I was having the same problem as the OP. I was using jQuery to reinitialize a Materialize.css accordion widget(which uses jQuery) in my componentDidMount function--or at least I was trying. But it wasn't working like I figured it should. Then I came here, saw the OP had tried using setTImeout, and it worked; I tried it; it worked for me--even at 1ms--then I had the idea that slapping in a document(ready) function might work since basically it does something similar to the componentDidMount lifecycle function. $(document).ready listens for the entire document to load before it runs anything in the callback--compondentDidMount listens for the component to mount before it runs anything. When you put a $(document).ready function inside the componentDidMount function(and put all the stuff into the former that which would typically only be in the latter), it will delay the code in the componentDidMount function until the whole document is loaded rather than just the component that the componentDidMount function resides in. The popover function acts on some element of the page that has yet to load. With the OP's original code you can manually call the popover event in the console after the page has loaded, which will then initialize the effect, which implies that the element that is needed for the popover does not exist when componentDidMount is called, but does exist after the page is fully loaded--which is why $(document).ready works: that is when its callback is triggered. That is my theory atleast :) Any alternative theories of why it works?
downvote count: 0
score: 3
has comment: http://stackoverflow.com/comment/50726894
type: AcceptedAnswer

http://stackoverflow.com/q/29634205
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/29634348
accepted answer: http://stackoverflow.com/a/29634348
has answer: http://stackoverflow.com/a/29634238
upvote count: 1
type: AnsweredQuestion
has title: Highlight form border not working
has comment: http://stackoverflow.com/comment/47411989
score: 1
has body: I have a form: &lt;form id="shippingAddressForm"&gt; When I click a button, I want the border of that form to turn red: $("#shippingAddressForm").css('border','red'); However, my form's border doesn't turn red. Any thoughts? Thank you in advance!
tagged with: forms
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/29634238
downvote count: 0
has comment: http://stackoverflow.com/comment/47410710
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/47462795
comment on: http://stackoverflow.com/q/29661458
score: 0
has text: Please make sure the resource mentioned is in the correct location ("js" directory?). Here is [your example in jsfiddle](http://jsfiddle.net/sxzrm32s/).
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47503122
score: 0
type: Comment
type: QuestionComment
has text: @DanielJamrozik You probably want to bind a repeater to an array in your model, then add/remove elements to that (which will in turn add/remove nodes in the document).
comment on: http://stackoverflow.com/q/29682993

http://stackoverflow.com/comment/47550654
type: Comment
comment on: http://stackoverflow.com/q/29658108
score: 0
type: QuestionComment
has text: Did you check if it was interrupted? …`series.exit().transition('exitTrans').duration(`…

http://stackoverflow.com/q/29570924
accepted answer: http://stackoverflow.com/a/29571252
answer count: 1
has body: When I add a opmerking to a child node called 'leerling' using .push(), the new node is actually added without a problem but unintentionally the existing opmerking node is replaced in the process. I has a similar issue before, see post Firebase push doesn&#39;t add but replace (JavaScript) which was then resolved, but that solution doesn't apply here. Here is a fiddle of the complete source code. Please just change the firebase database name to your own (or is there a test/demo database available?) in order to test it. $(document).ready(function(){ $("#submit").click(function(){ var _leerling = $("#Leerling").val(); var _opmerking = $("#Opmerking").val(); var _bestanden = $("#Bestanden").val(); var _door = $("#Door").val(); var success = true; if( _leerling == "Maak een keuze..." || _leerling == "" || _leerling == "5H:" || _leerling == "6V:" || _opmerking == "Typ hier jouw opmerking over de leerling die je geselecteerd hebt." || _opmerking == "" || _door == "Maak een keuze..." || _door == "" ) { alert("Alle velden met * zijn verplicht"); } else { event.preventDefault(); var ref = new Firebase("https://torrid-inferno-6428.firebaseio.com/"); var leerlingNummer = _leerling.substring(0,6).trim(); var updatedObj = {}; // truc om key een waarde te geven, kan niet rechtstreeks met JavaScript updatedObj[leerlingNummer] = { "naam": _leerling.substring(7,33).trim(), "klas": _leerling.substring(34,38), "klaskort": _leerling.substring(35,37), "leerlingdropdown": _leerling}; ref.child("leerling").update(updatedObj, function(data) { if (data) { alert(data); success = false; } }); ref.child("leerling").child(leerlingNummer).child("opmerkingen").push({ "opmerking": _opmerking, "bestanden": _bestanden, "door": _door}, function(data) { if (data) { alert(data); success = false; } if (success) { alert("Bedankt! Jouw opmerking is opgeslagen."); $('#form')[0].reset(); //To reset form fields } }); } }); });
favorite count: 0
upvote count: 1
has title: Firebase push doesn't add but replace
tagged with: firebase
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/29571252
linked to: http://stackoverflow.com/q/29377925
type: Question
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/47287756
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29566195
has text: Thanks! :D now I know what dog's balls means ^^

http://stackoverflow.com/comment/47477752
comment on: http://stackoverflow.com/q/29669744
type: Comment
has text: Do you get any runtime errors? Try `alert(hiddenInput)` or even better `console.log(hiddenInput)`.
type: QuestionComment
score: 2

http://stackoverflow.com/q/29582990
tagged with: angularjs
upvote count: 2
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29583170
has title: Access $http data from outside function
type: Question
has answer: http://stackoverflow.com/a/29583163
possible better answer: http://stackoverflow.com/a/29583156
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29583156
favorite count: 0
answer count: 3
has body: Sorry if the title hasn't made much sense, I don't really know a better way of explaining. I have the following... app.controller('viewProductController', ['$scope', 'dataFactory', '$routeParams', function($scope, dataFactory, $routeParams) { dataFactory.getProduct($routeParams.viewProduct) .success(function (data, status, headers, config) { $scope.product = data[0]; }) .error(function (data, status, headers, config) { }); }]); factory('dataFactory', ['$http', function($http) { var urlBase = 'get.php?get='; var dataFactory = {}; dataFactory.getProducts = function () { return $http.get(urlBase + 'products'); }; }]); It works perfectly when I go to the DOM and use {{product.product_name}} (example), but what I want also is to be able to use $scope.product.product_name inside the controller, however it comes up undefined. I think this is because $scope.product is set inside of a function, therefore I cannot get this outside of the function. If I use console.log($scope.product); inside the same function it is set, I see the array inside the console, but if I use it outside of the function where $scope.product is set, I cannot access and it says undefined. Thanks!!
accepted answer: http://stackoverflow.com/a/29583163

http://stackoverflow.com/q/29600258
has comment: http://stackoverflow.com/comment/47346954
tagged with: regex
type: AnsweredQuestion
tagged with: underscore.js
type: Question
has comment: http://stackoverflow.com/comment/47346791
has body: HTML(JADE) p#result Lorem ipsum is javascript j s lo 1 2 4 this meteor thismeteor. meteor input.search JS Template.pg.events({ 'keyup .search': function(e){ e.preventDefault(); var text = $('p#result').text(); var splitText = text.match(/\S+\s*/g); var input = $(e.target).val(); var splitInput = input.match(/\S+\s*/g); if(_.intersection(splitText, splitInput)) { var match = _.intersection(splitText, splitInput); var matchToString = match.toString(); $('p#result').text().replace(matchToString, '&lt;b&gt;'+matchToString+ '&lt;/b&gt;') } console.log(splitText); //check what I get console.log(splitInput); //check what I get } }) I have the above code. What I'm trying to do is matching the input field's value, and then matching the text. I added it the function to keyup so that this is reactive. When the fields and text match, it will add bold tagsto the matched strings (texts). I think I'm almost there, but not quite yet. How would I proceed on from here? MeteorPad Here
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29605760
score: 0
linked to: http://stackoverflow.com/q/13253856
has title: Match String of Input to text/element and highlight reactive
accepted answer: http://stackoverflow.com/a/29605760
answer count: 1
tagged with: meteor

http://stackoverflow.com/comment/47478986
has text: There is a small glitch in your code. The links (active, inactive, banned) work the first time. but if you use them and then change or empty the text in the textbox and then try to use them again, it doesent update. Also the headers disappear when filtering.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29670447
type: AnswerComment

http://stackoverflow.com/q/29594236
has body: I am using x-editable and would like to know how to populate my select element using jquery and ajax. [EDIT - For clarity] This is my code: jQuery(document).ready(function() { //toggle `popup` / `inline` mode $.fn.editable.defaults.mode = 'popup'; var getSource = function() { var url = "/api/rpc/payments/status_options"; $.ajax({ type: 'GET', async: true, url: url, dataType: "json", success: function(responseObject){ } }); }; //make status editable $('.payments-click').editable({ type: 'select', title: 'Select status', placement: 'right', value: 2, source: getSource() /* //uncomment these lines to send data on server ,pk: 1 ,url: '/post' */ }); }); I am trying to get the source: source: getSource() From the function but am not 100% sure how to return the data from the Ajax call.
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/35245844
score: 3
has answer: http://stackoverflow.com/a/35245844
accepted answer: http://stackoverflow.com/a/29594948
upvote count: 3
has title: X-Editable - How to pull form data using ajax
type: Question
answer count: 2
downvote count: 0
tagged with: x-editable
tagged with: javascript
tagged with: jquery
tagged with: ajax
has answer: http://stackoverflow.com/a/29594948
linked to: http://stackoverflow.com/q/14220321
favorite count: 0
tagged with: twitter-bootstrap

http://stackoverflow.com/q/29559209
tagged with: safari7
answer count: 1
tagged with: javascript
tagged with: ajax
has title: Safari 7 infinite POST request
downvote count: 1
favorite count: 0
upvote count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29648749
has comment: http://stackoverflow.com/comment/47268796
score: -1
tagged with: forms
tagged with: post
type: Question
has body: I've get stuck with such issue. I have a form. When user submits his data, I'm sending some data via post ajax request. On success I set some data to hidden form, which has action pointing to current url subdomain, but in fact to partner site url that is set over CNAME. Then I trigger jQuery submit event on this hidden form, so after response user is on partner site (hidden form has no target attribute). It works fine in any browser except Safari 7 on mac. It just load for infinite time. Any help is appreciated. Well, there's not much code. Onsuccess of I run this: if (response.result === true) { this.targets.login.$email.val(response.data.data.email); this.targets.login.$password.val(response.data.data.password); this.targets.login.$form.submit(); } My hidden form looks like this: &lt;form action="http://someurlunderCNAME" method="POST"&gt; &lt;input type="hidden" name="_method" value="POST"&gt; &lt;input type="text" name="data[User][email]"&gt; &lt;input type="password" name="data[User][password]"&gt; &lt;/form&gt;

http://stackoverflow.com/q/29682860
favorite count: 0
has title: :Active style appears as being applied to random divs on tap in Mobile Safari
has body: Upon release of a button, one of the other buttons flickers on its :active styling. You can see in my gif that it seems to only happen when clicking the function and advanced divs. ( tapping on the design div seems to behave normally ). Some backstory: This problem only arose after adding html{ position:fixed } to my CSS to fix this problem: iPhone viewport height too large in landscape mode I was hoping for a CSS solution to this problem that doesn't reproduce my previous problem with the iphone viewport. But of course, Vanilla JavaScript is welcome. This is happening on my Iphone 4S, running IOS7 and only when the phone is in landscape mode AND the Safari UI( The address bar and bottom toolbar ) are active. Only then, does this problem happen. html, body{ margin:0; padding:0; width:100%; height:100%; background:#fff; font-family:Arial; overflow:hidden; } html{ position:fixed; } p{ margin:0; padding:0; } nav{ height:100%; } .vCenter{ position:relative; top:50%; -webkit-transform:translateY( -50% ); -ms-transform:translateY( -50% ); transform:translateY( -50% ); } .option{ margin:0; width:33.33%; height:100%; background:#transparent; text-align:center; text-transform:uppercase; font-size:110%; cursor:pointer; -webkit-touch-callout:none; -webkit-user-select:none; -moz-user-select:none; -ms-user-select:none; user-select:none; float:left; -webkit-transition: background 0.5s ease, color 0.5s ease, font-size 0.5s ease; transition: background 0.5s ease, color 0.5s ease, font-size 0.5s ease; } .option:active, .option:hover{ background:#0bb; color:#eee; } @media( min-height:299px ) and ( max-height:371px ){ .option{ width:100%; height:33.33%; box-sizing:border-box; } #function{ border-bottom:none; } } @media( height:372px ){ .option{ width:100%; height:124px; box-sizing:border-box; } #function{ border-bottom:1px solid #eee; } } @media( min-height:373px ) and ( max-height:568px ){ .option{ width:100%; height:33.4%; box-sizing:border-box; } #function{ border-bottom:none; } } …
type: UnansweredQuestion
tagged with: css
tagged with: ios7
tagged with: mobile-safari
type: Question
upvote count: 4
tagged with: javascript
has answer: http://stackoverflow.com/a/29993485
score: 4
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
linked to: http://stackoverflow.com/q/29664403

http://stackoverflow.com/comment/47314322
type: QuestionComment
has text: By starting to code I guess. What have you done so far?
type: Comment
score: 5
comment on: http://stackoverflow.com/q/29583021

http://stackoverflow.com/a/29661148
has comment: http://stackoverflow.com/comment/47461838
answers question: http://stackoverflow.com/q/29660972
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47461903
upvote count: 1
has body: Here's a simplified method to help translate an array of array(size 2) function addToObject(object, row, keyIndex, valueIndex) { object[row[keyIndex]] = row[valueIndex]; } function test() { var data = [[ 'Name', 'Language' ], [ 'English', 'Fr' ], [ 'German', 'Gr' ], [ 'France', 'London' ]]; var obj = {}; for(var i = 1; i &lt; data.length; i++) // NOTE data[i] can come from any place addToObject(obj, data[i], 0, 1); return obj; }

http://stackoverflow.com/a/29560901
has comment: http://stackoverflow.com/comment/47271605
type: Answer
has comment: http://stackoverflow.com/comment/47271819
answers question: http://stackoverflow.com/q/29560711
has body: A good solution is to work with a global variable where you would stance the virtual directory: var dir = "/WorkPanel" And you ajax calls would be: $.ajax({ type: "POST", url: dir + "/GetListOfPermissons', data: {}, contentType: "application/json; charset=utf-8", dataType: "json", }); When ou want to use the other dir, just change in the file. Hope it helps, thanks!
score: 0

http://stackoverflow.com/comment/47290269
comment on: http://stackoverflow.com/a/29570020
has text: @breken, following your example, is this what you want? http://plnkr.co/edit/Yx1IOw1C9Adzp1nSbErz?p=preview
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/29587241
has comment: http://stackoverflow.com/comment/47337801
has comment: http://stackoverflow.com/comment/47392520
has comment: http://stackoverflow.com/comment/47322099
tagged with: azure
has answer: http://stackoverflow.com/a/29671819
tagged with: http://stackoverflow.com/tag/html
has title: Azure Mobile Services in HTML
downvote count: 0
answer count: 1
favorite count: 0
has body: How can I implement my Windows Azure Mobile Services in an HTML page?? I tried the code snippets that are present in the Azure portal but it just didn't work.. The code snippets that they ask me to put in my HTML page are: &lt;script src="http://ajax.aspnetcdn.com/ajax/mobileservices/MobileServices.Web-1.2.5.min.js"&gt;&lt;/script&gt; and var client = new WindowsAzure.MobileServiceClient("key1", "key2"); Then when I try to insert a record into the database I use this code: var get_table = client.getTable("People"); get_table.insert({ FirstName: "Marwan", LastName: "Younis" });
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/47322437
score: 1
type: Question
has comment: http://stackoverflow.com/comment/47327692
tagged with: azure-mobile-services
tagged with: javascript

http://stackoverflow.com/comment/47401042
has text: This isn't `onload` event but shorthand for jQuery `ready` pseudo event
comment on: http://stackoverflow.com/a/29629082
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/29668293
has body: I am trying to make MVC structure of application in canjs. For that I am using requireJS to separate the code in different file. I have searched in google and i am following this tutorial but in that tutorail I dont find to access module variables in different modules. therefore I am following this method to do so. But I cannot achieve that. This is my code: requirejsconfig.js file : requirejs.config({ paths :{ enforceDefine: true, waitSeconds : 0, jquery : "https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min", main : "view/main", player : "view/player", PlayerModel : "/models/PlayerModel", hbs : "/models/view/js/handlebars", fixture : "/models/view/js/can.fixture", can : "/models/view/js/can.jquery" } }); main.js : require(["player"],function(player){ player.PlayerModel(); }); I want to use that model methods in my controller. player.js : define(['PlayerModel'],function(){ function PlayerModel(){ var Player = PlayerModel.Player; Players =can.Control({ defaults :{view:view/players.hbs' }},{ init: function(){ this.element.html(can.view(this.options.view, { players: this.options.players })); } $(document).ready(function(){ $.when(Player.findAll()).then( function(playersResponse){ var players = playersResponse[0]; new Players('.players', { players: players }); }); }); } }); PlayerModel.js: define(function(){ var Player = can.Model({ findAll: 'GET /models/players.json', findOne: 'GET /players.json/{id}' }); return { Player:Player } }); Every file is being loaded (saw in network tab-chrome devtools) but nothing is being populated in output. Can anybody help me ? Thanks in advance!
tagged with: javascript
has title: Accessing variable from different files(module) using requirejs
has answer: http://stackoverflow.com/a/29672326
has answer: http://stackoverflow.com/a/29674524
accepted answer: http://stackoverflow.com/a/29674524
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47480683
tagged with: requirejs
type: Question
possible better answer: http://stackoverflow.com/a/29672326
linked to: http://stackoverflow.com/q/23649078
tagged with: canjs
has comment: http://stackoverflow.com/comment/47480614
score: 0
answer count: 2

http://stackoverflow.com/a/29688254
accepted answer of: http://stackoverflow.com/q/29688189
has comment: http://stackoverflow.com/comment/47513718
has body: To find a match you could use jQuery.grep(): var res = $.grep(arr, function(item) { return item.short_name == 'US'; }); It returns an array, which will be empty if there are no matches found. Alternatively, you could use Array.prototype.filter(): var res = arr.filter(function(item) { return item.short_name == 'US'; }); Bonus You can generalise it further: function searchFunction(field) { return function(arr, term) { return arr.filter(function(item) { return item[field] == term; }; }; } var searchByShortName = searchFunction('short_name'); if (searchByShortName(arr, 'US').length) { // .. }
answers question: http://stackoverflow.com/q/29688189
score: 5
type: Answer
type: AcceptedAnswer
upvote count: 5
downvote count: 0

http://stackoverflow.com/comment/47437346
comment on: http://stackoverflow.com/a/29627145
type: AnswerComment
has text: The example is wrong, the tag "portlet:resourceURL" declares a variable String who has the url value for the method serveResource. Change at the example this line: var url = '<%=ajaxResourceURL %>'. Sorry, you must read the comments
score: 0
type: Comment

http://stackoverflow.com/comment/47477721
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29669552
has text: @Mark Whitaker: The only server-side alternative is to turn it off for the controller, or for the server. Are either of these an option?
score: 0

http://stackoverflow.com/comment/47267757
score: 0
type: AnswerComment
has text: can i change the value
type: Comment
comment on: http://stackoverflow.com/a/29558697

http://stackoverflow.com/q/29633725
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29634062
has body: I have been trying to dynamically change the array number of my expression. My initial state: {{data[0].title}} {{data[0].sub_title}} Data is just an array returned from an http request. What I want is that when I click or swipe an element on the page that it jumps to the second item in the data array, e.g.: {{data[1].title}} {{data[1].sub_title}} I have been trying to make an expression in an expression, but I think that that is very wrong. Also, I have tried adding a variable to the $scope in the controller: $scope.update = function (whateverispassedinfromotherfunction){ var item = whateverispassedinfromotherfunction; return "data["+whateverispassedinfromotherfunction+"].sub_title"; } and then this in the HTML {{update}} but that does not make any sense to Angular and to me neither :). Anyone that knows a solution?
type: Question
possible better answer: http://stackoverflow.com/a/29634062
score: 0
has answer: http://stackoverflow.com/a/29633811
answer count: 2
tagged with: arrays
tagged with: javascript
has title: How can I go to next item of array in Angularjs expression?
accepted answer: http://stackoverflow.com/a/29633811
tagged with: angularjs

http://stackoverflow.com/a/29606456
accepted answer of: http://stackoverflow.com/q/29605421
type: Answer
answers question: http://stackoverflow.com/q/29605421
has comment: http://stackoverflow.com/comment/47361543
downvote count: 0
has body: Your Json was invalid, All the properties should be wrapped in " double quotes [ { "name": "Moroni", "age": 50, "deviceName": "test" }, { "name": "Tiancum", "age": 43, "deviceName": "test" }, { "name": "Jacob", "age": 27, "deviceName": "test" }, { "name": "Nephi", "age": 29, "deviceName": "test" } ] Also you should bind data retrieved from Ajax to $scope.tables Working Plunkr
score: 1
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/q/29582014
type: AnsweredQuestion
has body: I'm trying to allow a user to filter over d3 node data points via the following code; http://jsfiddle.net/hiwilson1/40yooowa/ However when you click the 'Filter Data' button post cb selection the nodes the user has selected aren't the nodes displayed onscreen. See code here: function filterData() { var cbChecked = {}; var newDataSet = []; d3.select("#cbs").selectAll("input") .each(function(cb) { if(this.checked) { cbChecked[this.value] = {name: this.value} } }) d3.keys(cbChecked).forEach(function(key) { dataset.forEach(function(dataVal) { if (key == dataVal.source.name || key == dataVal.target.name) { newDataSet.push({source: dataVal.source.name, target: dataVal.target.name, type: dataVal.type}) } }) }) var fullDataSet = [] dataset.forEach(function(dataVal) { fullDataSet.push({source: dataVal.source.name, target: dataVal.target.name, type: dataVal.type}) }) newDataSet.length ? update(newDataSet) : update(fullDataSet) } If I toggle to function filterrData() on button click, with a fixed new data set (not based on user input) then it works just fine and returns expected results, but I don't think the data set I've built based on user input is configured any differently to this fixed data set? function filterrData() { var newDataSet = [ {source: "Microsoft", target: "Amazon", type: "licensing"}, {source: "Microsoft", target: "HTC", type: "licensing"}, {source: "Samsung", target: "Apple", type: "suit"}, {source: "Motorola", target: "Apple", type: "suit"}, {source: "Nokia", target: "Apple", type: "resolved"} ] update(newDataSet) } This is of course based on Mobile Patent Suits - http://bl.ocks.org/mbostock/1153292 - so credit to the author.
type: Question
tagged with: d3.js
score: 0
has answer: http://stackoverflow.com/a/29582120
answer count: 1
has title: d3 filtering over data points via checkboxes not working as it should
accepted answer: http://stackoverflow.com/a/29582120
tagged with: javascript

http://stackoverflow.com/a/29547219
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47246122
accepted answer of: http://stackoverflow.com/q/29547011
type: Answer
answers question: http://stackoverflow.com/q/29547011
score: 1
has body: No, you don't have to define tons of tiny modules. In Angular, you can reference an existing module by omitting the second argument: angular.module('moduleName'); By doing this, you can split your various toolbar directives, controllers, and services into separate files and in each file simply reference the toolbar module like so: angular.module('toolbar') .controller('MenuCtrl', function() { // ... });
upvote count: 1
downvote count: 0

http://stackoverflow.com/comment/47418349
has text: +1 for collapsing the intervals, that seems to be what the OP didn't think of. Btw, you could check whether any interval includes the center during calculating all the intersections, even before sorting them.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29637960

http://stackoverflow.com/q/29662363
has comment: http://stackoverflow.com/comment/47464490
tagged with: responsive-design
tagged with: javascript
has body: I'm using the JelleKralt Responsive tabs at https://github.com/jellekralt/Responsive-Tabs on this design: http://www.sitesellprosdesign.com/demo.html I need some of the tabs to open an external url and was successfully able to do so using: &lt;script type="text/javascript"&gt; $('a[href^="#tab-4"]').on('click', function(event) { window.location.href="http://www.google.com"; }); &lt;/script&gt; However, when the tabs switch to accordion, the redirect does not work. I need a way to make the accordion titles open an external url when clicked as well. Any help would be most appreciated. I'm not at all versed in javascript/jQuery so I'm winging it here.
has comment: http://stackoverflow.com/comment/47465426
type: AnsweredQuestion
tagged with: jquery
type: Question
tagged with: http://stackoverflow.com/tag/html
has title: How to make a closed accordion tab open an external url when clicked
has answer: http://stackoverflow.com/a/29674144
has comment: http://stackoverflow.com/comment/47468026
accepted answer: http://stackoverflow.com/a/29674144
score: 0
has comment: http://stackoverflow.com/comment/47467825
answer count: 1

http://stackoverflow.com/q/29550019
has comment: http://stackoverflow.com/comment/47253697
tagged with: sockets
has comment: http://stackoverflow.com/comment/47281437
has title: io.sockets is defined, but socket isn't
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47281316
has comment: http://stackoverflow.com/comment/47279906
tagged with: socket.io
type: Question
has comment: http://stackoverflow.com/comment/47295338
has body: io.sockets.emit works fine and sends the message out to all connected sockets, but socket.emit doesn't work and socket is undefined. Any ideas? var app = require('express')(); var http = require('http').Server(app); var io = require('socket.io')(http); var net = require('net'); var express = require('express'); var sqlite3 = require('sqlite3').verbose(); var db = new sqlite3.Database('test-db.db'); var tools = require('./public/js/tools.js'); var app_tools = require('./public/js/app.js'); db.serialize(function() { db.run("CREATE TABLE if not exists names (info TEXT)"); }); app.use(express.static(__dirname + '/public')); app.get('/', function(req, res){ res.sendFile(__dirname + '/index.html'); }); io.on('connection', function(socket){ socket.on('chat message', function(msg){ console.log('message from geomon-ui: ' + msg); if(msg.indexOf("add") &gt;= 0) { console.log("adding to database table"); var words = msg.split(' '); console.log("name to add = " + words[1]); var insertString = "INSERT into names (info) VALUES ('" + words[1] + "')"; db.run(insertString); db.each("SELECT rowid AS id, info FROM names", function(err, row) { console.log(row.id + ": " + row.info); }); } else if(msg.indexOf("delete") &gt;= 0) { console.log("deleting from database table"); var words = msg.split(' '); console.log("name to delete = " + words[1]); var deleteString = "DELETE from names WHERE (info) = '" + words[1] + "'"; console.log(deleteString); db.run(deleteString); db.each("SELECT rowid AS id, info FROM names", function(err, row) { console.log(row.id + ": " + row.info); }); } else if(msg == "print") { db.each("SELECT rowid AS id, info FROM names", function(err, row) { console.log(row.id + ": " + row.info); }); } else if(msg == "status off") { console.log(socket); console.log(io.sockets); socket.emit("colorChange", { status: 'off' }); } else if(msg == "status on") { io.sockets.emit("colorChange", { status: 'on' }); } else if(msg == "hello") { tools.hello(); } else if(msg == "send") { var …
has answer: http://stackoverflow.com/a/29566196
accepted answer: http://stackoverflow.com/a/29566196
score: 0
answer count: 1
tagged with: websocket
tagged with: javascript

http://stackoverflow.com/comment/47307709
has text: `async: false` is deprecated in jQuery 1.8+ and the way the call is written you are expecting asyncronious result, I'm not .`done` will work in that case as you expect.
comment on: http://stackoverflow.com/a/29574615
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47300147
comment on: http://stackoverflow.com/a/29575782
score: 1
type: AnswerComment
has text: Perfect! Thanks a trillion! Just wanted to make sure...sometimes it's hard for me to wrap my head around how things are passed when it comes to arrays and objects... well not so much, but when you start of arrays full of objects, or objects of arrays, with objects in the arrays, etc. Anyway, thanks!
type: Comment

http://stackoverflow.com/a/29661024
has comment: http://stackoverflow.com/comment/47462890
has comment: http://stackoverflow.com/comment/47462304
has comment: http://stackoverflow.com/comment/47462142
has comment: http://stackoverflow.com/comment/47463469
has comment: http://stackoverflow.com/comment/47461956
has comment: http://stackoverflow.com/comment/47462467
has comment: http://stackoverflow.com/comment/47462759
score: 0
has comment: http://stackoverflow.com/comment/47462842
has comment: http://stackoverflow.com/comment/47463124
has comment: http://stackoverflow.com/comment/47463692
type: Answer
has comment: http://stackoverflow.com/comment/47463458
answers question: http://stackoverflow.com/q/29660561
has comment: http://stackoverflow.com/comment/47462391
has comment: http://stackoverflow.com/comment/47461990
has comment: http://stackoverflow.com/comment/47462283
has comment: http://stackoverflow.com/comment/47462998
has comment: http://stackoverflow.com/comment/47462170
has body: Without your server side code, we won't be able to find the ideal solution. However, you could potentially do the following: Use a Hidden Field to store the value. Use a global variable for the page, to pass the value to global variable in your JavaScript. The easiest would be the Hidden Field, the reason is you can easily modify the data on both Client and Server without any real issues. You'll want to ensure that you do not modify the state to often. &lt;input type="hidden" id="hdTimer" runat="server" /&gt; Then you can do your JavaScript, such as: $('#Example').on('change', function () { $('#hdTimer').val('60'); }); Now throughout the Client code you'll be able to modify the field with no issues, but when you need to submit a form, for a PostBack. You can use the field server side: var content = hdTimer.value; As I noted though, excessive cross manipulation may cause an issue at some point. Depending on the complexity. Your other approach would be the Global. // Server Side var example = 60; protected void Page_Load(object sender, EventArgs e) { } So this Global will hold the value, but when you reinitialize the value at Page Load it will hold be able to push an updated value to your JavaScript: //Client Side: var example = '&lt;%= example %&gt;'; The key though, will be to ensure you properly reinitialize the value. When you do a PostBack your page is reinitialized, which can modify values on you if you aren't aware. This is incredibly important.

http://stackoverflow.com/comment/93933139
comment on: http://stackoverflow.com/a/29606016
score: 1
type: AnswerComment
type: Comment
has text: upvoted! lets say I want to keep an array with 1000 elements at any point in time and I keep adding new data every second or so, how efficient is shift in such a scenario

http://stackoverflow.com/a/29632893
has comment: http://stackoverflow.com/comment/47409284
has body: https://jsfiddle.net/uuwdr5Ly/4/ You'd better use some css animations instead of jquery - it's pretty possible nowadays. What I've done to your code? .icon-link{ opacity: 0; position: absolute; You can't animate an item from display: none to display: block, unfortunately - therefore you can hide it with opacity set to 0 and position absolute. ul.social-container:hover li{ width: 16%; } ul.social-container li:hover { width: 50%; } Here you can set the way how your socials will be resized on mouseover. On mouseout they will get their base 25% width. No need to write .on('mouseover')! ul.social-container, ul.social-container li { transition: width .4s ease; } ul.social-container .icon-placeholder, ul.social-container .icon-link { transition: opacity .4s ease; } And that is how you can define transitions on this elements. Always pick the one prop you're actually changing, to save some memory. ul.social-container li:hover .icon-placeholder { opacity: 0; } ul.social-container li:hover .icon-link { opacity: 1; display: inline; } And that's how you're hiding-showing you icon-content! GL! P.S. Don't forget IE8 is dead but you still need all these prefixes (-ms, -moz, -webkit).
downvote count: 0
has comment: http://stackoverflow.com/comment/47409314
type: Answer
answers question: http://stackoverflow.com/q/29632496
upvote count: 1
has comment: http://stackoverflow.com/comment/47408849
score: 1

http://stackoverflow.com/comment/47481536
type: QuestionComment
has text: And would like to know other constraints and conditions like if 1. there is any possibility of duplicate elements on your response from the API 2. if the level of nesting is going to be maximum three . That will give us a clear idea if the solution should be generic enough to handle all such cases
score: 0
comment on: http://stackoverflow.com/q/29670944
type: Comment

http://stackoverflow.com/comment/47475718
has text: I hope my ASCII art isn't too ugly though :-)
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29668636

http://stackoverflow.com/q/29643218
tagged with: http://stackoverflow.com/tag/html
score: 1
upvote count: 1
has title: How to Sort multiple elements of different type in jquery data table
type: UnansweredQuestion
answer count: 0
downvote count: 0
has body: I have a scenario to sort a column having multiple type of elements, drop-down list and string(HTML) type. I want to sort that particular column containing drop-down list and HTML type of data. This is what I Have tried using "orderDataType": "dom-select" and "sType": 'html' $.fn.dataTable.ext.order['dom-select'] = function (settings, col) { return this.api().column(col, { order: 'index' }).nodes().map(function (td, i) { return $('select', td).val(); }); } But only the string is sorting. The drop down list is not sorting. Please give me suggestions
tagged with: javascript
tagged with: jquery
tagged with: sorting
favorite count: 0
type: Question

http://stackoverflow.com/comment/47351228
has text: that is the whole point of Object.freeze - to prevent any modifications on it.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29602584
score: 0

http://stackoverflow.com/comment/47369616
type: Comment
type: QuestionComment
has text: You need to ask a question. Please also bear in mind that questions like "Why isn't this code working?" are not accepted on StackOverflow.
comment on: http://stackoverflow.com/q/29591145
score: 0

http://stackoverflow.com/comment/47446200
has text: Hi Juvian! Thanks for your advice. It is absolutely better than reading it over and over. I don't know how to do it yet, but I will look it up. Thanks!!
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29653024

http://stackoverflow.com/comment/47461740
has text: Here's the fiddle: https://jsfiddle.net/joshturn/zLygvv6d/
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29661079
type: Comment

http://stackoverflow.com/comment/47801246
score: 1
type: Comment
comment on: http://stackoverflow.com/q/29573728
type: QuestionComment
has text: @Bergi Map of Maps – immutable all the way down.

http://stackoverflow.com/a/29650186
type: Answer
has body: you should look at my jquery plugin Knob https://github.com/aterrien/jQuery-Knob, generated canvas circular input, and set timer behavior like : var time = 0, maxTime = 60; $('#dial').knob({ readOnly : true, thickness : 0.1, max : maxTime }); setInterval(function() { if(time&gt;maxTime) time = 0; time++; $('#dial') .val(time) .trigger('change'); }, 1000); I made a codepen here : http://codepen.io/pik_at/pen/azeYRg
score: -3
upvote count: 1
answers question: http://stackoverflow.com/q/29649643
downvote count: 4

http://stackoverflow.com/q/29599629
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/47345538
answer count: 1
has answer: http://stackoverflow.com/a/29608085
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47345687
has comment: http://stackoverflow.com/comment/47345779
has body: I am using a custom directive for date picker in angular js but that seems to be not working . (angular-resource.js is included) code : var myApp = angular.module('myApp',[ 'ngRoute', 'myAppControllers', 'ui.bootstrap', 'ngSanitize', ]); myApp.directive('jqdatepicker', function () { return { restrict: 'A', require: 'ngModel', link: function (scope, element, attrs, ngModelCtrl) { element.datepicker({ dateFormat: 'DD, d MM, yy', onSelect: function (date) { scope.date = date; scope.$apply(); } }); } }; }); &lt;input type="text" class="form-control datepicker" ng-model="formData[field.name.field_name]" jqdatepicker/&gt; There is a fiddle which is working but my code doesn't
has comment: http://stackoverflow.com/comment/47345592
type: Question
has title: Custom directive not working in angular js

http://stackoverflow.com/comment/47473199
comment on: http://stackoverflow.com/q/29667199
has text: it's equiv to `var y = function () { var x; ...`, which leaves `x` local to the function and un-assigned. if blocks won't "stop" `var` from hoisting
type: QuestionComment
score: 1
type: Comment

http://stackoverflow.com/q/29554058
has comment: http://stackoverflow.com/comment/47265881
has comment: http://stackoverflow.com/comment/47260675
answer count: 0
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/47272430
tagged with: jquery-tags-input
type: Question
has body: I have created a page where I have a table with few column. I have used datatables and initially shown 10 records. On the second column I have a input box with class ".inittags" and I have added jquery tagsinput to all the input boxes on the second column. I have initialized the datatables like this var oDataTable = $('#recordstable').dataTable(); and I have intialized the jquery tags input this way $('.inittags').tagsInput({ width : 'auto', 'placeholder' : 'Type Client Name', 'placeholderColor' : '#e2e2e2', onAddTag : function(){ // }, onRemoveTag : function(){ // }, maxTags : 1, autocomplete_url : function(request, response) { if(request.term.length &gt; 1){ $.ajax({ url : 'fetchDetails.php', data : {'term' : request.term, 'fetchfor' : 'clients'}, type : 'POST', dataType : 'json', success : function(data){ response(data); } }); } } }); The problem is, on the first page it is working fine since all the 10 records are visible, then when I click the next button it shows up the next 10 record which were initially hidden. So the tags input is not getting initialized on the initially hidden elements. How can I solve it ??
score: 1
has title: Jquery tagsinput not working with datatables
has comment: http://stackoverflow.com/comment/53192100
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/47265086
score: 0
type: AnswerComment
type: Comment
has text: Well, good question :) But I guess it is defined in that way. You will find more about it here https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle
comment on: http://stackoverflow.com/a/29557168

http://stackoverflow.com/q/29569168
has title: innerHTML not showing up when added input element dynamically
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29569183
answer count: 2
has body: I am trying to add an &lt;input&gt; element using Javascript. However, the innerHTML is not showing up. Below is my code: function addElements() { container = document.getElementById("duration"); //a div container var input1 = document.createElement("input"); var input2 = document.createElement("input"); input1.type = "number"; input1.min = "0"; input1.max = "10"; input1.required = true; input1.innerHTML = "years"; input2.type = "number"; input2.min = "0"; input2.max = "12"; input2.required = true; input2.innerHTML = "months"; container.appendChild(input1); container.appendChild(input2); } The result of this code only produces two number input fields without the innerHTML. Is there anything wrong with my code?
favorite count: 0
has answer: http://stackoverflow.com/a/29569276
type: AnsweredQuestion
upvote count: 2
score: 0
tagged with: innerhtml
downvote count: 2
has comment: http://stackoverflow.com/comment/47287742
accepted answer: http://stackoverflow.com/a/29569276
has comment: http://stackoverflow.com/comment/47287666
type: Question
has answer: http://stackoverflow.com/a/29569183

http://stackoverflow.com/a/29561752
type: Answer
accepted answer of: http://stackoverflow.com/q/29561445
downvote count: 0
answers question: http://stackoverflow.com/q/29561445
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/47275238
type: AcceptedAnswer
has body: could you not do this? &lt;asp:Button OnClick="foo" runat="server" ID="foo" OnClientClick="return myconfirm()");" /&gt; &lt;script&gt; function myconfirm() { return confirm("&lt;%= GetLocalResourceObject("fooRessource") %&gt;"); } &lt;/script&gt;
has comment: http://stackoverflow.com/comment/47275879

http://stackoverflow.com/comment/47399295
type: QuestionComment
has text: Can we see what you've tried so far, please?
comment on: http://stackoverflow.com/q/29628192
score: 0
type: Comment

http://stackoverflow.com/a/29659714
downvote count: 0
has body: Try var str = " Gilbert Arenas is still a Washington Wizards </inline fan. The above Instagram photo -- especially the caption -- is evidence of this. The former All-Star guard didn't wait to find out the Wizards' first-round opponent to start talking trash -- both the Toronto Raptors and Chicago Bulls were targets. Honestly, though, I'm a little disappointed in this. Dissing the Canadian anthem? Frying bologna? Arenas can do better, I'm sure. Really hope Drake -- or Masai Ujiri, perhaps? -- fires back. "; var data = [{ "canon": "Dakota Wizards", "text": "Wizards", "begin": "258", "end": "265", }, { "canon": "Dakota Wizards", "text": "Wizards", "begin": "430", "end": "437", }, { "canon": "Toronto Raptors", "text": "Toronto Raptors", "begin": "495", "end": "510", }, { "canon": "Chicago Bulls", "text": "Chicago Bulls", "begin": "515", "end": "528", }]; var res = $.parseHTML(str.slice(data[0].begin, data[0].end).replace(/\//, "")) .some(function(el) { return el.nodeName === "A" }); console.log(res); // `true`
has comment: http://stackoverflow.com/comment/47461832
answers question: http://stackoverflow.com/q/29658344
type: Answer
has comment: http://stackoverflow.com/comment/47494489
has comment: http://stackoverflow.com/comment/47462071
has comment: http://stackoverflow.com/comment/47494868
has comment: http://stackoverflow.com/comment/47462131
upvote count: 1
has comment: http://stackoverflow.com/comment/47505711
has comment: http://stackoverflow.com/comment/47460857
score: 1
has comment: http://stackoverflow.com/comment/47460583
has comment: http://stackoverflow.com/comment/47461678
has comment: http://stackoverflow.com/comment/47461147
has comment: http://stackoverflow.com/comment/47496572

http://stackoverflow.com/a/29682366
downvote count: 0
has comment: http://stackoverflow.com/comment/47502627
has comment: http://stackoverflow.com/comment/47504026
has comment: http://stackoverflow.com/comment/47502677
type: Answer
score: 1
has body: You are most likely experiencing this problem because your db.query() function is not synchronous. It expects a callback function that it can invoke when it's finished. Your code inboxUserList.push(...) will not be called until your database library queries the database and gets a result. Meanwhile, your for loop will continue running, prepping all of your queries and continuing before they all finish. Then sample() is called, because the for loop is done, even if the callbacks you passed in have not been called yet. There are many solutions, but perhaps the simplest with your current code would be something like this: function inboxUsers(){ var completed = 0; for (var i=0; i&lt;uniqueArray.length; i++){ var getUsername = 'SELECT userName FROM users WHERE userId = ' + uniqueArray[i]; db.query(getUsername, function(err, results) { if (err) { console.log('Error in database'); throw err; } for(var i in results){ console.log('single',results[i].userName); inboxUserList.push(results[i].userName); } completed++; if (completed == uniqueArray.length) { sample(); } }); } } function sample(){ console.log('same function'); }
upvote count: 1
has comment: http://stackoverflow.com/comment/47503072
has comment: http://stackoverflow.com/comment/47503115
has comment: http://stackoverflow.com/comment/47502918
has comment: http://stackoverflow.com/comment/47503267
has comment: http://stackoverflow.com/comment/47503696
answers question: http://stackoverflow.com/q/29682163

http://stackoverflow.com/q/29564379
score: -2
has title: How can I use Promise or Defer to accomplish this?
has comment: http://stackoverflow.com/comment/47278950
type: Question
has answer: http://stackoverflow.com/a/29564774
answer count: 2
upvote count: 0
has comment: http://stackoverflow.com/comment/47279109
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47278682
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47278451
possible better answer: http://stackoverflow.com/a/29564774
accepted answer: http://stackoverflow.com/a/29564752
has body: I have an app.run() block that: uses an Angular service that uses a $http.get to get some values and sets them in the $rootScope calls another Angular component that uses the values from the $http.get The issue is that the code in the second step runs before the HTTP call has replied with the values in the first step. I don't want the code in the second step to call the service directly. How can I force the second step to wait for the first step to complete? service.js function getSomeConfigs() { var promise = $http.get('/blah'); $rootScope.promise = promise .then(function () { $rootScope.someVariable = data.someVariable; }); } helper.js $rootScope.someVariable is undefined
downvote count: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29564752

http://stackoverflow.com/a/29594752
has comment: http://stackoverflow.com/comment/47336776
has comment: http://stackoverflow.com/comment/47336630
has comment: http://stackoverflow.com/comment/47336790
has comment: http://stackoverflow.com/comment/47337287
score: 0
has body: It is because when you write $(".image").contextMenu(), it means, that you are bind new event to existing .image on the page. When you crate/load more elements, you should apply $(".image_new").contextMenu() to them. One of solutions is to attach event listeners to your images like so: $(".image").off("contextMenu").on('contextMenu', function() {}); It means, that first, you bind off contextMenu event from all images and then you bind contextMenu event to all images. You shoul run this code when new images loaded. Does it makes sense? UPDATE: That is exactly what you want, i think: $(document).contextmenu({ delegate: ".image", //menu: "myMenu", menu: [ {title: "Cut Ctrl+X", cmd: "cut", uiIcon: "ui-icon-scissors"}, {title: "Copy Ctrl+C", cmd: "copy", uiIcon: "ui-icon-copy"} ], select: function(event, ui) { switch(ui.cmd){ case "copy": alert('copy'); break case "cut": alert('cut'); break } } });
has comment: http://stackoverflow.com/comment/47336610
type: Answer
answers question: http://stackoverflow.com/q/29594613

http://stackoverflow.com/q/29549608
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/641407
type: Question
linked to: http://stackoverflow.com/q/641407
has comment: http://stackoverflow.com/comment/47250710
has answer: http://stackoverflow.com/a/29549639
has comment: http://stackoverflow.com/comment/47251011
has body: I've seen a few answers that deal with this question but was unable to get them to work. What is a regex that would match "LOGGED_IN" but not match "NOT_LOGGED_IN"?
answer count: 1
tagged with: javascript
score: 0
tagged with: regex
has title: Javascript regex to match string not preceded by

http://stackoverflow.com/comment/47463654
score: 0
has text: If you are trying to set a global variable `value` to `text` then you need to delete `return text;` and change the `value = "text";` line to `value = text;`
type: QuestionComment
comment on: http://stackoverflow.com/q/29661029
type: Comment

http://stackoverflow.com/a/29640734
accepted answer of: http://stackoverflow.com/q/29639340
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: You can modify JavaScript save and refresh your browser. JavaScript is interpreted in your browser not visual studio. You can't debug JavaScript in visual studio as far as I am aware.
has comment: http://stackoverflow.com/comment/47509849
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29639340
has comment: http://stackoverflow.com/comment/47460887

http://stackoverflow.com/comment/47310735
has text: @StephenGevanni You have `i` as the row part and `j` as the column part. So you multiply `i` by the row length, `sqroot`, to get to the right row then add `j` to get to the right column within the row.
comment on: http://stackoverflow.com/a/29549372
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/q/29545858
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/29545911
upvote count: 3
type: Question
has body: How to negate a boolean function? Such that using something like: _.filter = function(collection, test) { var tmp = [] _.each(collection, function(value){ if (test(value)) { tmp.push(value); } }) return tmp }; var bag = [1,2,3]; var evens = function(v) { return v % 2 === 0}; This is wrong: // So that it returns the opposite of evens var result = _.filter(bag, !evens); result: [1,3]
answer count: 2
accepted answer: http://stackoverflow.com/a/29545903
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29545911
downvote count: 0
has answer: http://stackoverflow.com/a/29545903
favorite count: 0
has title: negate boolean function in javascript

http://stackoverflow.com/comment/47291109
comment on: http://stackoverflow.com/a/29567843
has text: @zfrisch I don't want to start a discussion in the comments, can you go to [the relevant room](chat.stackoverflow.com/rooms/17/javascript) and ping me? (Like in comments that's @MyName)
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29593672
type: Answer
has body: Yes, the problem is likely minification. If a minifier garbles your code into this: .controller('Foobar', function (e) { .. }) then Angular doesn't have any information about what exactly it needs to inject. That's why the alternative injection syntax exists, which you need to use everywhere: .controller 'Foobar', ['$scope', '$location', ($scope, $location) -&gt; .. ] You specify each dependency twice: once as a string, which will not get minified, and the second time as an arbitrary variable name in your actual function signature.
downvote count: 0
answers question: http://stackoverflow.com/q/29593610
score: 3
accepted answer of: http://stackoverflow.com/q/29593610
upvote count: 3
type: AcceptedAnswer

http://stackoverflow.com/a/29660123
downvote count: 0
type: Answer
has body: Try breaking it down in several functions: Let's call the span toggle, as it can select and de-select all. Select All And we'll have a function to select and de-select all of the values. No need to iterate through the list as prop sets the value for all elements function SetAll(value){ $(".checkbox").prop("checked", value); } Then for the toggle button: $("#toggle").click(function(){ if($(this).text() == "Select All"){ SetAll(true); $(this).text("De-select All"); } else { SetAll(false); $(this).text("Select All"); } }); Finally we need an onchange event for each checkbox: $(".checkbox").change(function(){ var allCheckboxes = $(".checkbox"); var allChecked = $.grep(allCheckboxes, function(n,i){ return $(n).is(":checked"); }); //grep returns all elements in array that match criteria var allUnchecked = $.grep(allCheckboxes, function(n,i){ return $(n)is(":checked"); },true); //invert=true returns all elements in array that do not match // check the lengths of the arrays if (allChecked.length == allCheckboxes.length) $("#toggle").text("De-select All"); if (allUnchecked.length == allCheckboxes.length) $("#toggle").text("Select All"); }):
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29657853

http://stackoverflow.com/q/29651099
upvote count: 2
answer count: 1
has body: What I want to do: Add a new element to my DOM and animate its opacity with css3. My solution A div ".bar.fade" is added via JavaScript and then a class "in" will instantly added. Problems with my solution Without using the setTimout() function, the div will instantly be drawn visible (without css transition). Why does this happen and how to prevent it? I assume, using setTimeout() isn't the best practice, is it? SCSS .bar { position: absolute; bottom: 0; top: 0; width: 100%; background-color: red; z-index: -1; opacity: 0; visibility: hidden; &amp;.fade { @include transition( visibility .75s ease-in-out, opacity .75s ease-in-out ); } &amp;.in { opacity: 1; visibility: visible; } } JS (Zepto) $('.foo').on('click', function() { $('body').append('&lt;div class="bar fade"&gt;&lt;/div&gt;'); $('.bar').addClass('in'); }); $('.fooDelay').on('click', function() { $('body').append('&lt;div class="bar fade"&gt;&lt;/div&gt;'); setTimeout(function(){ $('body &gt; .bar').addClass('in'); }, 50); }); $('.fooRemove').on('click', function(){ $('body').find('.bar').remove(); }) I've made a codepen for better testing: http://codepen.io/dschu/pen/wBVmLp
favorite count: 0
linked to: http://stackoverflow.com/q/7069167
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29651423
tagged with: css
has title: CSS transition not occurring with addClass function
score: 2
downvote count: 0
tagged with: css-transitions
has comment: http://stackoverflow.com/comment/47442453
has comment: http://stackoverflow.com/comment/47442248
type: Question
duplicate of: http://stackoverflow.com/q/7069167
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/29676680
has body: Below is the array that has 2 elements with Plan as name.I want to group the array using Javascript by name but the StartDate should be the minimum of all startdates that has name as Plan and EndDate should be max of all enddates that has name as plan.I want to group the elements and not sort them. [{"Name":"Define","StartDate":"2015-04-09","EndDate":"2015-04-22"}, {"Name":"Plan","StartDate":"2015-04-22","EndDate":"2015-04-29"}, {"Name":"Plan","StartDate":"2015-04-30","EndDate":"2015-05-14"]}] So my final array should be like below [{"Name":"Define","StartDate":"2015-04-09","EndDate":"2015-04-22"}, {"Name":"Plan","StartDate":"2015-04-22","EndDate":"2015-05-14"]}] I have got stucked in building the logic.Help appreciated.
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/29677160
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47491408
has title: How do I group array by name but taking minimum of all start dates and max of all end dates using Javascript
has comment: http://stackoverflow.com/comment/47493505
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/47493225
linked to: http://stackoverflow.com/q/10123953
type: Question
linked to: http://stackoverflow.com/q/22954066
has comment: http://stackoverflow.com/comment/47491315
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29677160
has comment: http://stackoverflow.com/comment/47491495
has comment: http://stackoverflow.com/comment/47493163
score: 0

http://stackoverflow.com/comment/47336632
has text: can you explain what you have in the picture that was not achievable in CSS?
type: QuestionComment
comment on: http://stackoverflow.com/q/29594783
score: 0
type: Comment

http://stackoverflow.com/comment/47355885
type: QuestionComment
comment on: http://stackoverflow.com/q/29604946
score: 0
type: Comment
has text: I don't know, as you've not given us your code.

http://stackoverflow.com/a/29600021
has body: If you use jquery you can listen for the unload event https://api.jquery.com/unload/ or using JS window.onbeforeunload = function() {... Then of couse you could fire some ajax to call the server side code.
has comment: http://stackoverflow.com/comment/47346288
has comment: http://stackoverflow.com/comment/47348301
has comment: http://stackoverflow.com/comment/47349031
upvote count: 2
has comment: http://stackoverflow.com/comment/47378855
has comment: http://stackoverflow.com/comment/47349150
answers question: http://stackoverflow.com/q/29599947
accepted answer of: http://stackoverflow.com/q/29599947
has comment: http://stackoverflow.com/comment/47346883
score: 2
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/47352047
has text: @AnthonyGrist it was removing all li tag
comment on: http://stackoverflow.com/q/29603059
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/q/29674190
answer count: 3
has body: Why does this (Firebug Console): &gt; ";" == ";" &gt; false But this: &gt; ';' == ';' &gt; true Anyone knows why this is happening?
downvote count: 1
has comment: http://stackoverflow.com/comment/47486225
favorite count: 0
has answer: http://stackoverflow.com/a/29674240
tagged with: equals
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47486198
tagged with: conditional-statements
tagged with: equality
has answer: http://stackoverflow.com/a/77830095
type: Question
has title: Why does ";" == ";" evaluates to "false"?
possible better answer: http://stackoverflow.com/a/29674310
upvote count: 1
tagged with: firebug
tagged with: javascript
has answer: http://stackoverflow.com/a/29674310
has comment: http://stackoverflow.com/comment/47486072
accepted answer: http://stackoverflow.com/a/29674240
score: 0

http://stackoverflow.com/comment/47359601
score: 0
type: AnswerComment
type: Comment
has text: Thank you, that fixed it! I'm a novice with Java/jQuery currently. However I work best by dissecting working code. I'll run this through a diff checker and see what edits you made, though I think I immediately see it.. and am batting my forehead.
comment on: http://stackoverflow.com/a/29606781

http://stackoverflow.com/comment/47504604
type: Comment
type: QuestionComment
has text: Move the jquery code into the angular click handler. **HOWEVER:** it's very likely that right after that click event, the digest cycle will happen again thus ending your show or hide animation.
score: 0
comment on: http://stackoverflow.com/q/29683835

http://stackoverflow.com/comment/47238586
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29543224
has text: hmm it works in your demo indeed but mine doesnt still can;t find the reason

http://stackoverflow.com/q/29575627
tagged with: jquery
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/47327150
linked to: http://stackoverflow.com/q/4923631
score: 18
downvote count: 2
answer count: 3
has answer: http://stackoverflow.com/a/29693420
possible better answer: http://stackoverflow.com/a/29700186
has comment: http://stackoverflow.com/comment/47712203
has answer: http://stackoverflow.com/a/29700186
upvote count: 20
has body: I am using FullCalendar http://fullcalendar.io/ to display some events on a web page. The calendar is created like this $('#calendar').fullCalendar({ header: { left: 'prev,next today', center: 'title', right: 'month,agendaWeek,agendaDay' }, allDayDefault: false, selectable: true, selectHelper: true, editable: true, eventLimit: true, // allow "more" link when too many events }); Events are created through the renderEvent operation (not json feed) like $('#calendar').fullCalendar('renderEvent', newEvent, 'stick'); where the newEvent is created like this newEvent = { title : 'mytitle', start : startDate, allDay: false, id: eventId, description: 'my test event' }; the problem is that events are correctly shown in month view but are not shown in week or day views. UPDATE I am using this date format: 2015-02-01T01:00:00
has title: FullCalendar events shown in month view only
tagged with: fullcalendar
has answer: http://stackoverflow.com/a/29787660
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29693420
tagged with: javascript

http://stackoverflow.com/a/29553646
has body: First and foremost your json string has error. { "residents": [ { "name" : "Jacob", "title" : "King", "gender" : "Male", }, { "name" : "Luthor", "title" : "Prince", "gender" : "Male" }, { "name" : "Mileena", "title" : "Princess", "gender" : "Female" }, ] } There won't be comma after the third parenthesis from the end. JSONString = '{ . . . . }'; JSONObject = JSON.parse(JSONString); This way you can access the json data from JSONObject.
downvote count: 1
answers question: http://stackoverflow.com/q/29553512
score: -1
has comment: http://stackoverflow.com/comment/47258337
upvote count: 0
type: Answer

http://stackoverflow.com/a/29640197
upvote count: 1
answers question: http://stackoverflow.com/q/29640022
has body: I think _.map will always return an array so its not the best solution. Try the code bellow. var t = {"state":["Saved","Published"],"discipline":["Marketing"]}, newObj = {}; _.each(t, function(obj, index) { newObj[index] = {}; if(_.isArray(obj)){ var toReturn = {}; _.each(obj, function(index,item){ toReturn[index] = true; }); newObj[index] = toReturn; } }); console.log(newObj);
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47442184
type: Answer
score: 1
accepted answer of: http://stackoverflow.com/q/29640022

http://stackoverflow.com/a/29578361
score: -3
downvote count: 3
answers question: http://stackoverflow.com/q/29541534
upvote count: 0
has body: Did you include SocialSharing.js in your project and load it like this? Make sure the S are upper case in the file name too...
has comment: http://stackoverflow.com/comment/47819258
type: Answer

http://stackoverflow.com/q/29643361
type: Question
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29644311
tagged with: twitter-bootstrap
has body: I have a bootstrap navigation menu where I have also added a search icon. The search icon shows up the search box on click. Added a toggle in the search icon to show and hide the search box. Now, when I click on the search icon and it is it open state showing the search box and then I click on any one of the dropdown menu in the navigation menu the dropdown appears over the search box. I need to close the search box once any other dropdown menu is clicked. I know its very simple but but not getting a proper solution. Can anyone suggest? Here is the link of the code: JSFiddle $('.tablet-toggle a').click(function (e) { if($('ul.dropdown-menu.tablet-toggle').css('display') == 'block'){ $('.desktop-search').hide(); } }); $(".search-icon").click(function () { $("#searchForm form").slideToggle("fast", function() { // Animation complete. }); });
has answer: http://stackoverflow.com/a/29644012
has answer: http://stackoverflow.com/a/29643538
possible better answer: http://stackoverflow.com/a/29644067
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29644067
accepted answer: http://stackoverflow.com/a/29644012
has title: How to hide a div on click of another dropdown link?

search-engine
type: Tag
tags question: http://stackoverflow.com/q/29556487
tag name: search-engine

http://stackoverflow.com/q/29612512
downvote count: 0
score: 1
has title: setInterval and clearInterval in JavaScript as a single thread language
type: Question
answer count: 2
tagged with: single-threaded
tagged with: javascript
tagged with: clearinterval
has answer: http://stackoverflow.com/a/29612622
accepted answer: http://stackoverflow.com/a/29612622
upvote count: 1
tagged with: setinterval
possible better answer: http://stackoverflow.com/a/29612561
linked to: http://stackoverflow.com/q/940120
favorite count: 0
has answer: http://stackoverflow.com/a/29612561
has body: I have a problem understanding the way in which setInterval and clearInterval work in JavaScript. I have read different articles on these two functions but I am still confused. Given the fact that JavaScript is single thread then when we call test=setInterval(function(){}, t) we will schedule our function to be executed every t miliseconds. Unless we clearInterval(test). What does that mean? Does it mean that by clearInterval we cancle the setInterval which is already in the queue of JavaScript? What would happen if we setInterval several times but clearInterval only once? Can we clearInterval in setInterval? How JavaScript handles the scheduled process?
type: AnsweredQuestion

http://stackoverflow.com/q/29639943
score: 0
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/29640034
tagged with: ember.js
type: UnansweredQuestion
has title: EmberJS - Calling a controller method within a routes setupController
has body: I have a controller with a few methods attached to it. I have a relevant route. I added the methods inside the controller so that they can be re-used in a few other places. These methods retrieve some data from the server. Inside the setupController of the route, I'm calling these methods and everything works as expected. But once I concatenate the files, Ember throws an error saying the method I'm trying to call is undefined. I use grunt-contrib-concat plugin but also tried changing it to use uglify. Still the same issue. I don't think there is anything wrong with the concatenation as it always worked previously. However, I never used the setupController before other than to set properties. Added the sample code below. Any help is appreciated. /* Ember 1.10.0 Debug version */ /* Route */ App.DashboardRoute = Ember.Route.extend({ model: function() { return []; }, setupController: function(controller, model) { this._super(controller, model); /* Setting values on the controller works */ controller.set('currentDate', new Date()); /* Calling a method works normally but throws error when minified */ /* Error: dashboard undefined is not a function */ controller.addNumbers(); } }); /* Controller */ App.DashboardController = Ember.ArrayController.extend({ currentDate: null, addNumbers: function() { return 1 + 2; } });
type: Question

http://stackoverflow.com/comment/47284203
comment on: http://stackoverflow.com/q/29567257
has text: @adricadar - it's in a function, which is called via a click... this is not a loading issue
type: Comment
score: 1
type: QuestionComment

http://stackoverflow.com/comment/47311546
score: 0
has text: Can you please log the values of `songToStartFrom`, too?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29581499

http://stackoverflow.com/comment/47482642
has text: indeed I had forgotten to update the name of the file in the pro guard, thank you for the notice.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29670809

http://stackoverflow.com/q/29656267
type: Question
has answer: http://stackoverflow.com/a/29656312
has answer: http://stackoverflow.com/a/29656310
has comment: http://stackoverflow.com/comment/47452339
possible better answer: http://stackoverflow.com/a/29656312
has comment: http://stackoverflow.com/comment/47452215
has comment: http://stackoverflow.com/comment/47452275
has answer: http://stackoverflow.com/a/29656379
upvote count: 1
answer count: 4
tagged with: arrays
accepted answer: http://stackoverflow.com/a/29656310
tagged with: javascript
has comment: http://stackoverflow.com/comment/47452404
has title: Remove elements from javascript array by position
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47452755
has body: I have a javascript array var countries = ["India","USA","China","Canada","China"]; I want to remove "China" only from 2nd position, and return var countries = ["India","USA","Canada","China"]; Something similar to java linkedlist.remove(index) I have read following question but I don't know how to use it if there are duplicate elements in array. How do I remove a particular element from an array in JavaScript?
downvote count: 0
linked to: http://stackoverflow.com/q/5767325
score: 1
has answer: http://stackoverflow.com/a/29656565
favorite count: 0

http://stackoverflow.com/comment/47233310
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29540703
type: AnswerComment
has text: more details about selector priorities: https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity

http://stackoverflow.com/comment/47407323
comment on: http://stackoverflow.com/q/29631652
score: 0
type: Comment
type: QuestionComment
has text: @DanPrince I mean in this case

http://stackoverflow.com/a/29606331
type: Answer
answers question: http://stackoverflow.com/q/29599481
accepted answer of: http://stackoverflow.com/q/29599481
type: AcceptedAnswer
has body: I finally figured that you can not simulate a post by doing a submit. So I am clicking the button instead, which triggers a post. And it does what I want. onchange='document.frmupphoto.upload.click();' What I was trying to do was to post the form as soon as the file selection window is closed. The above is the onchange for the " input type=file "
score: 0

http://stackoverflow.com/a/29546690
has comment: http://stackoverflow.com/comment/47284809
has comment: http://stackoverflow.com/comment/47250339
has comment: http://stackoverflow.com/comment/47250360
type: Answer
has comment: http://stackoverflow.com/comment/47248753
has comment: http://stackoverflow.com/comment/47247444
has body: http://getbootstrap.com/javascript/#tabs According to Bootstrap's documentation (under the title "Markup"), you are still missing some HTML. So this is mostly right, except we need the a link's href to point to an id of your actual tab, and not just a hash mark #. A B And then we need the actual tabs to be created. ... ... Hope it helps!
has comment: http://stackoverflow.com/comment/47248572
accepted answer of: http://stackoverflow.com/q/29546366
has comment: http://stackoverflow.com/comment/47247761
score: 0
has comment: http://stackoverflow.com/comment/47248202
has comment: http://stackoverflow.com/comment/47247375
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29546366

http://stackoverflow.com/comment/47472530
type: AnswerComment
has text: I didn't see that you were trying to remove the element from your array. That being the case, you should go with @RobG's answer.
type: Comment
comment on: http://stackoverflow.com/a/29666661
score: 0

http://stackoverflow.com/comment/47219744
type: QuestionComment
has text: can you paste the code for index.html?
comment on: http://stackoverflow.com/q/29530540
score: 0
type: Comment

http://stackoverflow.com/q/29646366
tagged with: android
tagged with: http://stackoverflow.com/tag/html
has body: I want to access camera using HTML JavaScirpt in a webview in Android phone within my native application. I tried a lot of solutions none were helpfull. The html string is as follows, String html = " "+ " "+ " "+ " "+ " Display Webcam Stream "+ " "+ " "+ " "+ " "+ " "+ " "+ " "+ " "+ " "+ " "+ " "+ " "+ " "+ " "; I am loading this string into my webview, WebView browser; browser=(WebView)findViewById(R.id.WebView01); browser.getSettings().setJavaScriptEnabled(true); browser.getSettings().setPluginsEnabled(true); browser.addJavascriptInterface(new WebAppInterface(this), "Android"); browser.loadDataWithBaseURL("", html, mimeType, encoding, ""); I always get an exception in the log messages: "Using the 'capture' attribute as an enum is deprecated. Please use it as a boolean and specify the media types that should be accepted in the 'accept' attribute." (or) "block webkit draw" Any help will be greatfull. Thanks in advance
downvote count: 0
has answer: http://stackoverflow.com/a/29648667
type: UnansweredQuestion
tagged with: webview
type: Question
tagged with: camera
score: 1
upvote count: 1
answer count: 1
tagged with: javascript
has title: Open Camera in Android WebView using HTML JS?
favorite count: 0
linked to: http://stackoverflow.com/q/7387978

http://stackoverflow.com/comment/47494791
score: 0
type: Comment
has text: I removed it and the success function is working. but neither the alerts are working when the dataType is removed. and the server side is till not reading and data from the client side.
comment on: http://stackoverflow.com/a/29677281
type: AnswerComment

http://stackoverflow.com/q/29593306
has answer: http://stackoverflow.com/a/29609201
score: 2
has title: Dojo require - error on Firefox
tagged with: firefox
downvote count: 0
tagged with: javascript
tagged with: struts2
has body: I'm using Dojo to issue SMD calls in a Struts2 framework. When including this line dojo.require("dojo.rpc.JsonService"); i'm getting an error on Firefox's console: not well-formed (JsonService.js) not well-formed (RpcService.js) not well-formed (url.js) I researched a bit about this but there's no clear answer yet. Anyone has any idea?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47343153
has comment: http://stackoverflow.com/comment/47347065
favorite count: 0
accepted answer: http://stackoverflow.com/a/29609201
type: Question
upvote count: 2
answer count: 1
tagged with: dojo
has comment: http://stackoverflow.com/comment/47348092
has comment: http://stackoverflow.com/comment/47359850
has comment: http://stackoverflow.com/comment/47364022

http://stackoverflow.com/comment/47520104
score: 0
comment on: http://stackoverflow.com/a/29676070
type: Comment
has text: Do you see any errors or warnings, in the browser console, after you click the button?
type: AnswerComment

http://stackoverflow.com/comment/47229575
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29538642
has text: @jcubic Thanks. Seems to work. Is this considered a proper approach? For my real application, I need to pass multiple parameters, and am just trying to make my script more concise. See http://jsbin.com/folutu/1/
score: 0

http://stackoverflow.com/a/29674574
downvote count: 0
has body: Try out this out for reset function just reset it with sessionDefault copy like as shown below vm.reset = function () { vm.session = angular.copy(sessionDefault); }; here this refers to the controller instance Notice that I use var vm = this; and then I decorate vm with the members that should be exposed and data-bindable to to the View. vm simply denotes view modal This does 3 things for me. Provides a consistent and readable method of creating bindings in my controllers Removes any issues of dealing with this scoping or binding (i.e. closures in nested functions) Removes $scope from the controller unless I explicitly need it for something else Working Demo script var app = angular.module('myApp', []); app.controller('LoginController', function ($scope) { var vm = this; vm.session = {}; var sessionDefault = { email: "", psw: "" }; vm.reset = function () { vm.session = angular.copy(sessionDefault); }; }); html Email: {{login.session.email}} Psw: {{login.session.psw}} Reset Take a look at this beautiful stuff. AngularJS’s Controller As and the vm Variable
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29674369
upvote count: 2
accepted answer of: http://stackoverflow.com/q/29674369
type: Answer
has comment: http://stackoverflow.com/comment/47490243
score: 2
has comment: http://stackoverflow.com/comment/47490586
has comment: http://stackoverflow.com/comment/47490971
has comment: http://stackoverflow.com/comment/47490820

http://stackoverflow.com/comment/47504269
type: Comment
comment on: http://stackoverflow.com/a/29683359
type: AnswerComment
has text: Do you have more than one element with the class 'bio-input'?
score: 0

http://stackoverflow.com/comment/47377673
comment on: http://stackoverflow.com/q/29616170
has text: The point is that service is instance. http://stackoverflow.com/questions/15666048/service-vs-provider-vs-factory/15666049#15666049
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29673984
answers question: http://stackoverflow.com/q/29673860
has body: Remember that things like &lt will be not regarded as a part of HTML code but some character. So if you want to show the text which is bold, you should let it return as below TEST - do you see me? However, if you don't have permission to edit the result, other answers are good.
score: 0
type: Answer

http://stackoverflow.com/comment/47299132
type: QuestionComment
has text: @zerkms That's certainly true, but I would enjoy reading a hacky solution if one were possible possible.
type: Comment
comment on: http://stackoverflow.com/q/29574186
score: 0

http://stackoverflow.com/comment/47481695
type: Comment
comment on: http://stackoverflow.com/q/29671863
has text: I have already attached the plunker.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/47319383
type: AnswerComment
comment on: http://stackoverflow.com/a/29582442
type: Comment
has text: @bjb568 My intention was only to copy over the ones that are needed. I don't know if this is possible, but that's what I was hoping for. It seems like someone would have attempted to solve this, but maybe not.
score: 0

http://stackoverflow.com/q/29555198
has title: Changing the structure of JSON object
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
score: -1
downvote count: 2
has answer: http://stackoverflow.com/a/29555859
upvote count: 1
tagged with: arrays
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47261140
has body: This question seems odd but am finding it difficult to convert the below given JSON [ { "id": 2, "name": "NP", "description": "North Pit", "boxList": [ { "id": 3, "name": "Box1", "description": "First Box", "locationId": 1, "benches": [ { "id": 1, "name": "Sample Bench", "description": "Sample Bench" }, { "id": 2, "name": "Sample Bench1", "description": "Sample Bench1" } ] }, { "id": 6, "name": "Box2", "description": "Second Box", "locationId": 1, "benches": [ { "id": 1, "name": "Sample Bench", "description": "Sample Bench" }, { "id": 2, "name": "Sample Bench1", "description": "Sample Bench1" } ] } ] } ] into [ { "pit": { "id": 1, "name": "SouthPit", "description": "South Description" }, "boxList": [ { "boxes": { "id": 1, "name": "Sample Box", "description": "Sample Box" }, "benchList": [ { "id": 2, "name": "Sample Bench1", "description": "Sample Bench" } ] }, { "boxes": { "id": 2, "name": "Sample Box", "description": "Sample Box" }, "benchList": [ { "id": 1, "name": "Sample Bench", "description": "Sample Bench" } ] } ] } ] wherein each object is a repeating object where there can be multiple boxes for a single pit or multiple benches for a pit.Can anybody throw some light . I have tried to construct the JSON function constructPitData(data) { var firstLevel; var constructedPitDetails = []; for (var i = 0; i &lt; data.length; i++) { firstLevel= { id:data[i].pit.id, name: data[i].pit.name, desc: data[i].pit.description, locId: data[i].pit.mineLocationId, boxDetails:[] } constructedPitDetails.push(firstLevel); constructBoxDetails(data, firstLevel); } } function constructBoxDetails(data, pit) { var boxFirstLevel; var constructedBoxDetails = []; for (var j = 0; j &lt; data.length; j++) { if (pit.id === data[j].pit.id) { var newBox = { } } } }
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/47261589
accepted answer: http://stackoverflow.com/a/29555859

http://stackoverflow.com/a/29571804
accepted answer of: http://stackoverflow.com/q/29571613
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/116190984
answers question: http://stackoverflow.com/q/29571613
has comment: http://stackoverflow.com/comment/47294918
has body: I'd suggest: $('tr.Entries').each(function() { var t = this.cells[1].textContent.split('-'); $(this).data('_ts', new Date(t[2], t[1]-1, t[0]).getTime()); }).sort(function (a, b) { return $(a).data('_ts') &lt; $(b).data('_ts'); }).appendTo('tbody'); http://jsfiddle.net/rmva17gr/
type: Answer
has comment: http://stackoverflow.com/comment/47295813
has comment: http://stackoverflow.com/comment/47294086
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/47295723
has comment: http://stackoverflow.com/comment/68255608

http://stackoverflow.com/comment/47289409
has text: No it still dumps an empty array
comment on: http://stackoverflow.com/a/29569343
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47379933
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29617420
has text: if it´s for a mobile, i strongly recomend you to search by the orientation. There are also media queries that will make your life easier! Check this for example!! http://davidwalsh.name/orientation-change
type: AnswerComment

http://stackoverflow.com/a/29558373
upvote count: 5
accepted answer of: http://stackoverflow.com/q/29557938
answers question: http://stackoverflow.com/q/29557938
type: AcceptedAnswer
downvote count: 0
score: 5
type: Answer
has body: I would encapsulate your markers into their own data model that takes care of the interaction with Google Maps behind the scenes: // we have to give it access to the map object, so that // it can register and de-register itself var Pin = function Pin(map, name, lat, lon, text) { var marker; this.name = ko.observable(name); this.lat = ko.observable(lat); this.lon = ko.observable(lon); this.text = ko.observable(text); marker = new google.maps.Marker({ position: new google.maps.LatLng(lat, lon), animation: google.maps.Animation.DROP }); this.isVisible = ko.observable(false); this.isVisible.subscribe(function(currentState) { if (currentState) { marker.setMap(map); } else { marker.setMap(null); } }); this.isVisible(true); } Now you can create your pins with pin = new Pin(map, 1, 2, 'text'), and when you toggle their visibility state with pin.isVisible(false), they automatically register or deregister with the map. Your filter function thus becomes self.filterPins = ko.computed(function () { var search = self.query().toLowerCase(); return ko.utils.arrayFilter(self.pins(), function (pin) { var doesMatch = pin.name().toLowerCase().indexOf(search) &gt;= 0; pin.isVisible(doesMatch); return doesMatch; }); });

http://stackoverflow.com/comment/47337287
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29594752
has text: @MadianMalfi watch an upfate in my answer, I think now it fully answers your question.
type: Comment

http://stackoverflow.com/comment/47412193
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29627372
has text: That is strange, you noticed that I removed one bracket? For me it seems to work. You didn't close the form correctly, some browsers have problem with that. Try again, I updated it. http://jsfiddle.net/r9b3ugs5/3/

http://stackoverflow.com/comment/47294591
score: 0
comment on: http://stackoverflow.com/q/29569394
type: Comment
type: QuestionComment
has text: Sparky! Thank you. Sorry, have a day job and just got back. Also sorry for the different questions (however, I think they were different, but might be confusing things). I am okay with an answer to this particular question. Thank you very much.

http://stackoverflow.com/comment/47314159
comment on: http://stackoverflow.com/a/29556977
has text: check this if you have trouble in attaching jquery http://stackoverflow.com/q/5232968/2907017
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47321150
comment on: http://stackoverflow.com/a/29586666
type: AnswerComment
has text: Is the difference between normal classes and prototypes in JavaScript really meaningful in practice? Few applications take advantage of dynamic prototypal inheritance, they just use it to set a static class-like hierarchy. I'm glad that ES6 is finally optimizing for common use by just calling a class a class.
score: 0
type: Comment

http://stackoverflow.com/a/29812357
score: 0
has body: you inject the router into the module as it is a singleton object, which should give you access to whatever you need from the router. //route definition {route: product/:id, moduleId: 'product', title: 'Product Details', nav: false} define(['knockout','router'], function (ko, router){ var routeData = ko.observable(); return { router: router, activate: activate, }; function activate(id){ routeData(id); } }); One thing to note is that the any paramteres on the route will get injected into the activate method for the module to use.
type: Answer
answers question: http://stackoverflow.com/q/29531510

http://stackoverflow.com/comment/47471933
has text: The usual way is using {{scope.model}}, which populates the HTML from Angular. I'd like to do it the other way around. Set a value in a regular HTML tag and then have Angular read & update that value as usual
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29666533

waveform
tag name: waveform
type: Tag
tags question: http://stackoverflow.com/q/29596140

http://stackoverflow.com/comment/47429815
type: Comment
has text: there is already a post on SO : [http://stackoverflow.com/q/5959788/4682796](http://stackoverflow.com/q/5959788/4682796)
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29643989

http://stackoverflow.com/comment/47476763
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29669029
has text: Although, I believe there may be an issue in terms of the javascript - as the canvas needs converting through that I'm not entirely sure on the best way to pass it to php?
score: 0

http://stackoverflow.com/q/29605197
has comment: http://stackoverflow.com/comment/47356162
downvote count: 0
answer count: 1
has body: I have created an utterly simple blackjack game that stores the first value of a shuffled array of cards into corresponding players' arrays, dealing them as actual hands. For some odd reason, I can't seem to find a way to execute the core part of the code multiple times without getting an infinite loop. For the time being, I have only tried running the quite commonplace "for" command which is meant for multiple statements, but just doesn't seem to work here. The programm on its primitive form is as follows... var dealerCards = []; var playerCards = []; var firstDeck = []; function shuffle(o){ for(var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x); return o; } function createShuffledDeckNumber(array, x) { for (i = 0; i &lt; 4*x; i++) { array.push(1,2,3,4,5,6,7,8,9,10,11,12,13); } shuffle(array); } function drawCard(playersHand, playerSoft, playerHard) { playersHand.push(firstDeck[0]); firstDeck.shift(); } function checkDeckDrawOne(playersHand) { if (firstDeck.length === 0) { createShuffledDeckNumber(firstDeck, 1); drawCard(playersHand); }else{ for (i = 0; i &lt; 1; i++) { drawCard(playersHand); } } } for (i = 0; i &lt; 4; i++) { dealerCards = []; playerCards = []; checkDeckDrawOne(dealerCards); checkDeckDrawOne(dealerCards); checkDeckDrawOne(playerCards); checkDeckDrawOne(playerCards); console.log("dealerCards",dealerCards,"playerCards",playerCards); console.log("firstDeckDrawn", firstDeck, "Number", firstDeck.length); } Additional Notes; The presumed objective could be performing calculations to figure out the winner by imitating the effect of consecutive computing rounds based on a finite number of values stored in each player's array. Although, I've tried a seried of different things when it comes to emulating the real life circumstances of actually playing blackjack, this version seems to do just that, by also giving the programmer the ability to introduce counting systems like KO or HiLo. The main logic behind the wh…
favorite count: 0
has title: Blackjack javascript game infinite loop
accepted answer: http://stackoverflow.com/a/29605549
type: AnsweredQuestion
tagged with: blackjack
score: 1
tagged with: loops
upvote count: 1
type: Question
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/29605549

http://stackoverflow.com/q/29531727
has title: JQuery hide() not work on Mozzila but works on Chrome
tagged with: jquery
has answer: http://stackoverflow.com/a/29531987
has comment: http://stackoverflow.com/comment/47216896
has answer: http://stackoverflow.com/a/29531861
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47217090
has answer: http://stackoverflow.com/a/29531839
type: Question
tagged with: asp.net-mvc
tagged with: javascript
tagged with: mozilla
score: 0
answer count: 3
tagged with: firefox
has body: I have a several spans and one of them must be hided depending on conditions: @for (int i = 0; i < Model.Options.Count; i++) { ... ... ... } And somewhere in jquery I have: for (var i = 0; i < tpoCount; i++) { var enabledVALUE = $('#enabled_VALUE_' + i + ''); var disabledVALUE = $('#disabled_VALUE_' + i + ''); ... Action ... if (result == 'True') { enabledVALUE.hide(); disabledVALUE.show(); } else { enabledVALUE.show(); disabledVALUE.hide(); } } Works fine in Chrome, but in Firefox/Mozzila for some reason span are never hiding. It is strange because at this page I also have another hide() which works on Firefox/Mozzila. The only difference is that it is not added with for help: ... ... ... and in jquery: if (result == 'True') { $('#enabled_FIX').hide(); $('#enabled_FIX').show(); } else { $('#enabled_FIX').show(); $('#disabled_FIX').hide(); } I can't understand what am I missing. How can I prevent this kind of issue?

http://stackoverflow.com/comment/47492536
score: 1
has text: No that seems to be along the right lines, i will try it and update my post.
type: AnswerComment
comment on: http://stackoverflow.com/a/29677297
type: Comment

http://stackoverflow.com/comment/47478414
has text: See this demo http://jsfiddle.net/vals/NfX56/9/ and this answer http://stackoverflow.com/a/18025979/1926369
score: 0
comment on: http://stackoverflow.com/q/29668238
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/77398566
has text: or a similar moment-timezone! Ha - Ha, sorry :(
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29771723
type: Comment

http://stackoverflow.com/a/29663836
score: 1
downvote count: 0
has body: Go here for a straightforward tutorial on cookies: http://www.w3schools.com/js/js_cookies.asp Add the following functions to your JS (of course modifying them slightly to remove the alert statements, etc.): setCookie() and getCookie() Then, on page load you check if the cookie already exists (I'm assuming you name the cookie "toggleStatus") using "getCookie('toggleStatus')". If they don't exist, create as many of them as you need using: setCookie('toggleStatus','hidden', 30); setCookie('toggleStatus2','hidden', 30); etc.... If they already do exist, then update the status of the buttons accordingly. Then on each button click, check the cookies current value, and update them accordingly: if(getCookie('toggleStatus') === 'hidden') { setCookie('toggleStatus', 'show', 30); } else { setCookie('toggleStatus', 'hidden', 30); } This is an untested answer which may or may not have typos :)
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/29662966

http://stackoverflow.com/comment/47360041
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29607189
score: 1
has text: Short answer: You can't. If you are using wordpress you have the ability to use PHP... as well as javascript. You could dynamically change images with both of those languages. What makes you think you can only use HTML. Do you have FTP access, etc.

http://stackoverflow.com/comment/47368455
type: Comment
has text: `g` is "greedy", so it matches all occurences and not just the first one (as in CezarisLTs answer). `i` is "(case) insensitive", so it matches both ` ` and ` `
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29607812

http://stackoverflow.com/a/29645066
downvote count: 0
has body: Another solution :( notice the + sign , which when added before a string , it becomes a number) var PITotalAMount = 0; $(".HomePIAmtTot").each( function(){ PITotalAMount += +$(this).html().replace(",",""); }); console.log(PITotalAMount); http://jsfiddle.net/pbo5bker/3/
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/47430799
has comment: http://stackoverflow.com/comment/47430736
score: 1
answers question: http://stackoverflow.com/q/29644972
has comment: http://stackoverflow.com/comment/47430705

http://stackoverflow.com/comment/47329606
comment on: http://stackoverflow.com/q/29591249
type: QuestionComment
type: Comment
has text: Could you maybe try to explain better what you are trying to achieve?
score: 1

http://stackoverflow.com/a/29613627
downvote count: 1
has body: You can make this done by different ways, one of them (left column - "floatLeft" class, right column - "floatRight" class): .element{width:50%;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;} .floatLeft{ float:left; } .floatRight{ float:right; } .blue{background-color:#3aa9e3} .red{background-color:#f15743;} .green{background-color:#8aba56;} My content goes here! My content goes here! My content goes here! My content goes here! My content goes here! My content goes here! My content goes here! My content goes here! My content goes here! My content goes here! My content goes here! My content goes here! My content goes here! My content goes here! My content goes here! My content goes here! My content goes here! My content goes here! My content goes here! My content goes here! My content goes here! My content goes here! My content goes here! My content goes here! My content goes here! My content goes here! My content goes here! My content goes here!
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/29613531
has comment: http://stackoverflow.com/comment/47372908
score: 1

http://stackoverflow.com/comment/47466157
comment on: http://stackoverflow.com/q/29663348
score: 0
has text: There's [attribute selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors). In this case, the selector would look like `[class^=row1]` or `[class^=row11]`. Of course, this is complicated by the fact you could have more than one class, which might work with `[class*=row1]` for example, unless you have something like `class='row11 striped-row1'`, where you would match the latter as well, possibly where you don't want to.
type: QuestionComment
type: Comment

http://stackoverflow.com/q/29537132
upvote count: 1
has comment: http://stackoverflow.com/comment/49615847
score: 1
has title: unable to clear dates range in bootstrap datepicker input-daterange
has answer: http://stackoverflow.com/a/29537980
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/30955088
tagged with: jquery
has comment: http://stackoverflow.com/comment/47228175
has body: I've used the input-daterange of Bootstrap datepicker which is working fine. But the problem is, I'm unable to clear the dates and the selection(range) in it. $(document).ready(function() { datespicker(); }); function datespicker() { $('#data_5 .input-daterange').datepicker({ keyboardNavigation: false, forceParse: false, autoclose: true //format: "dd/mm/yyyy" }); } function ClearUsersStatistics() { $('#dtStartDate').val(''); $('#dtEndDate').val(''); //$('#datepicker').val('').datepicker('update'); //$('#datepicker').val(""); //$('#datepicker').datepicker('setDate', null); //$("input[id$='dtStartDate'], input[id$='dtEndDate']").datepicker("option", "maxDate", null); //$("input[id$='dtStartDate'], input[id$='dtEndDate']").datepicker("option", "minDate", null); } Range select to As you can see on the snippet, I'm only able to clear the text on the date-pickers, but the selection range inside the date-pickers is not clearing. Any help would be greatly appreciated!!!
tagged with: datepicker
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/22196162
has comment: http://stackoverflow.com/comment/49618905

http://stackoverflow.com/a/29593397
answers question: http://stackoverflow.com/q/29579073
score: 2
upvote count: 2
downvote count: 0
type: Answer
has body: After a lot of painful trial and error I was able to do it. Posting here so that others could benefit. private native FusionTablesLayer createFusionTableLayer()/*-{ return new $wnd.google.maps.FusionTablesLayer({ query: { select: 'geometry', from: '1tJkzVXTv-B2-rFeQVO9bX_vICCvJ9Xq1LU6xog5f' }, styles: [{ polygonOptions: { fillColor: '#00FF00', fillOpacity: 0.3 } }, { where: 'birds &gt; 300', polygonOptions: { fillColor: '#0000FF' } }, { where: 'population &gt; 5', polygonOptions: { fillOpacity: 1.0 } }] }); }-*/;

http://stackoverflow.com/a/29596666
score: 2
has body: Your lists variable object properties were not separated with a comma. Before: var lists = { todo: document.getElementById('todo') done: document.getElementById('done') }; After: var lists = { todo: document.getElementById('todo'), done: document.getElementById('done') }; I assume you just left this off the code you posted, but you can not just have function(){} at the beginning. You need to have foo = function(){} or function foo(){}.
answers question: http://stackoverflow.com/q/29596606
upvote count: 2
downvote count: 0
type: Answer

java
tags question: http://stackoverflow.com/q/29548559
tags question: http://stackoverflow.com/q/29552965
tags question: http://stackoverflow.com/q/29611821
tags question: http://stackoverflow.com/q/29558681
tags question: http://stackoverflow.com/q/29615606
tags question: http://stackoverflow.com/q/29601925
tags question: http://stackoverflow.com/q/29563369
tags question: http://stackoverflow.com/q/29599947
tags question: http://stackoverflow.com/q/29565485
tags question: http://stackoverflow.com/q/29666982
tags question: http://stackoverflow.com/q/29619906
tags question: http://stackoverflow.com/q/29672299
tags question: http://stackoverflow.com/q/29602589
tags question: http://stackoverflow.com/q/29573548
tags question: http://stackoverflow.com/q/29624094
tags question: http://stackoverflow.com/q/29596982
tags question: http://stackoverflow.com/q/29539989
tags question: http://stackoverflow.com/q/29582895
tags question: http://stackoverflow.com/q/29539241
tags question: http://stackoverflow.com/q/29552703
tags question: http://stackoverflow.com/q/29670924
tags question: http://stackoverflow.com/q/29556173
tags question: http://stackoverflow.com/q/29558216
tags question: http://stackoverflow.com/q/29686596
tags question: http://stackoverflow.com/q/29643688
tags question: http://stackoverflow.com/q/29646617
tags question: http://stackoverflow.com/q/29649799
tags question: http://stackoverflow.com/q/29591249
tags question: http://stackoverflow.com/q/29578224
tags question: http://stackoverflow.com/q/29559956
tags question: http://stackoverflow.com/q/29549513
tags question: http://stackoverflow.com/q/29607013
tag name: java
tags question: http://stackoverflow.com/q/29663461
tags question: http://stackoverflow.com/q/29614318
tags question: http://stackoverflow.com/q/29673489
tags question: http://stackoverflow.com/q/29577278
tags question: http://stackoverflow.com/q/29558111
tags question: http://stackoverflow.com/q/29562285
tags question: http://stackoverflow.com/q/29603629
tags question: http://stackoverflow.com/q/29614340
tags question: http://stackoverflow.com/q/29623349
tags question: http://stackoverflow.com/q/29555738
tags question: http://stackoverflow.com/q/29574773
tags question: http://stackoverflow.com/q/29598518
tags question: http://stackoverflow.com/q/29582959
tags question: http://stackoverflow.com/q/29561136
tags question: http://stackoverflow.com/q/29554634
tags question: http://stackoverflow.com/q/29555197
tags question: http://stackoverflow.com/q/29565386
tags question: http://stackoverflow.com/q/29654179
tags question: http://stackoverflow.com/q/29653288
tags question: http://stackoverflow.com/q/29655292
tags question: http://stackoverflow.com/q/29668369
type: Tag
tags question: http://stackoverflow.com/q/29540489
tags question: http://stackoverflow.com/q/29626007
tags question: http://stackoverflow.com/q/29554224

http://stackoverflow.com/comment/47521975
type: Comment
comment on: http://stackoverflow.com/q/29665127
type: QuestionComment
score: 1
has text: @Web_Developer You simply need to drag up the window on the very bottom of the screen. http://i.imgur.com/PRomW2S.png

http://stackoverflow.com/a/29553876
has comment: http://stackoverflow.com/comment/47259364
has comment: http://stackoverflow.com/comment/49302372
score: 1
has body: Its not clear as to what you are trying to achieve when a value from the dropdown is clicked, but assuming you are looking for an event that will be triggered each time someone clicks an item from the dropdown you could try something similar to this: $(document).ready(function () { $('#mymenu li').click( function (clickedItem) { alert(clickedItem.currentTarget.innerText); //do other stuff }); }); You can see a demo of this solution here
has comment: http://stackoverflow.com/comment/47260173
upvote count: 1
answers question: http://stackoverflow.com/q/29553406
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29553406
type: Answer

http://stackoverflow.com/q/29642146
tagged with: dom
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47425654
has answer: http://stackoverflow.com/a/29642221
tagged with: http://stackoverflow.com/tag/html
has title: Manipulate DOM on Response from Server
has body: I have a HTML page that sends a query and gets the response from a server using JQuery's POST ($.post().done()) Web Service Search Engine Search The response from Check.php is a few links which are already formatted Crawled WSDL Documents/21272_United_States_shortlynx.wsdl Crawled WSDL Documents/16932_United_States_dailycomicsservice.wsdl Crawled WSDL Documents/15465_United_States_measurementconversions.wsdl Crawled WSDL Documents/14242_United_States_converter.wsdl Crawled WSDL Documents/17606_Spain_conversor.wsdl How do I put this response inside the DIV tag with the id = Results ??
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/29642228
score: 1

http://stackoverflow.com/comment/47298585
type: AnswerComment
comment on: http://stackoverflow.com/a/29574898
type: Comment
has text: Sure, I've added example code to my answer. It's almost 3am here so my "star" is a bit wonky shaped, but it illustrates the process :-) Good luck with your project!
score: 1

http://stackoverflow.com/q/29600892
has answer: http://stackoverflow.com/a/29601446
has comment: http://stackoverflow.com/comment/47348170
has answer: http://stackoverflow.com/a/29642294
has comment: http://stackoverflow.com/comment/47347984
type: Question
has comment: http://stackoverflow.com/comment/47348564
tagged with: oop
linked to: http://stackoverflow.com/q/7662147
tagged with: javascript
has comment: http://stackoverflow.com/comment/47348304
score: 0
has comment: http://stackoverflow.com/comment/47348053
has body: I have created two constructor Person and Employee. Employee construct inheriting the property of Person. This working fine. Now I want to add new property in Person constructor with prototype. But getting blank string. Please help. JS Code function Person (age, weight) { this.age = age; this.weight = weight; } Person.prototype.name = name; //we will give Person the ability to share their information. Person.prototype.getInfo = function () { return "I am " + this.age + " year old and weight " + this.weight + " kg."; }; function Employee (age, weight, salary, name) { //Person.call(this, age, weight); // by call parameters as arguments Person.apply(this, arguments); // by apply arguments as array this.salary = salary; } Employee.prototype = new Person(); Employee.prototype.constructor = Employee; Employee.prototype.getInfo = function () { return "I am "+this.name+" " + this.age + " year old and weight " + this.weight + " kg having $" + this.salary +" pm salary"; } var person = new Employee(30, 70, 4000, "Manish"); console.log(person.getInfo()); document.write(person.getInfo()); Demo Fiddle
answer count: 2
linked to: http://stackoverflow.com/q/16063394
has comment: http://stackoverflow.com/comment/47348364
has comment: http://stackoverflow.com/comment/47348504
has title: How to add new property in existing constructor as a parameter
has comment: http://stackoverflow.com/comment/47348484
type: UnansweredQuestion

http://stackoverflow.com/q/29586822
tagged with: arrays
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29586873
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/29587393
answer count: 4
tagged with: angularjs
upvote count: 2
has title: I want to match the particular id in angular foreach
accepted answer: http://stackoverflow.com/a/29587393
score: 2
has answer: http://stackoverflow.com/a/29587057
type: AnsweredQuestion
has body: I'm trying to match the id and i need to get the description of the particular how can i get this ?? How can i fix this ? $scope.getAlbumList = '[{"album_desc":"Test1","id":1,"album_title":"Test","ImageName":"Desert.jpg","album_pics":[{"media_type":"image/jpeg","last_modified_date":1247549551000,"thumnail_pic_loc":"Desert.jpg","large_pic_loc":"Desert.jpg","filter_type":"image/jpeg","pic_id":"d5bd"}]},{"album_desc":"Test1","id":2,"album_title":"Test1","ImageName":"Koala.jpg","album_pics":[{"media_type":"image/jpeg","last_modified_date":1247549551000,"thumnail_pic_loc":"Koala.jpg","large_pic_loc":"Koala.jpg","filter_type":"image/jpeg","pic_id":"d5bd"}]},{"album_desc":"Album Title","id":3,"album_title":"Album Title","ImageName":"Tulips.jpg","album_pics":[{"media_type":"image/jpeg","last_modified_date":1247549551000,"thumnail_pic_loc":"Tulips.jpg","large_pic_loc":"Tulips.jpg","filter_type":"image/jpeg","pic_id":"d5bd"}]},{"album_desc":"fsdfdsfds fsdfds fds fdsfdsfdsfsdfdsfbdsfkdskjfh dskjfh skjdfhdskjhfk sjdhfdskjhfksjdhfkjdsfh sf dfsjfnkjdshf dsjhf ksksfhkjfhds fdshfhkjdsfhdskjhfkj dshf dskjfh skjdhfskjdhfkjdsfhdskjfhkjdsfhsd fkjdshfkjsdhfkj hjshdjfhdskjfhs fdsjhf dskjhfdskjfh dskjfhdskjfhsdkjfhdskjfsdk jdshfkjdsh kjfdshkjfshkjdfshkj fdshkjdskjsh kjds hfkjsd kdshfkjdshfkjsdhfkjdshfkjdshfkjsdkjf fkjdsh fkjshdfkjdshf dskjf","id":4,"album_title":"sdfds","ImageName":"Lighthouse.jpg","album_pics":[{"media_type":"image/jpeg","last_modified_date":1247549551000,"thumnail_pic_loc":"Lighthouse.jpg","large_pic_loc":"Lighthouse.jpg","filter_type":"image/jpeg","pic_id":"d5bd"}]}]'; $scope.getalbumarray = 'http://localhost/learn/comment/#/album_details/1'; angular.forEach($scope.getAlbumList, function(item) { $scope.albumDescription = item.id; //console.log(item.id); //console.log($scope.getalbumarray[$scope.getalbumarray.length - 1]); if(item.id == $scope.getalbumarray[$scope.getalbumarray.length - 1]){ $scope.albumDescription = item.album_desc; //console.log('1'); }else{ //console…
type: Question
has answer: http://stackoverflow.com/a/29586969
possible better answer: http://stackoverflow.com/a/29586873

http://stackoverflow.com/q/29602841
has answer: http://stackoverflow.com/a/29602946
type: Question
tagged with: flash
tagged with: javascript
score: 4
answer count: 2
favorite count: 0
has comment: http://stackoverflow.com/comment/47352045
tagged with: actionscript-3
possible better answer: http://stackoverflow.com/a/29602899
has comment: http://stackoverflow.com/comment/47351508
has body: function pauseScene(evt:MouseEvent):void { stop(); pause_btn.visible = false; play_btn.visible = true; } I have written the above code in Actionscript to stop a mouse event. Now I want to convert that into Javascript so that the scene in flash cc will be converted to Html5. For that I have used the below code as function pausescene() { this.stop(); } But this is not satisfying my requirement. Please do help me.
has title: How can i stop a mouseevent in javascript?
upvote count: 4
accepted answer: http://stackoverflow.com/a/29602946
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47351713
downvote count: 0
has answer: http://stackoverflow.com/a/29602899

http://stackoverflow.com/q/29686657
has comment: http://stackoverflow.com/comment/47514829
type: Question
has comment: http://stackoverflow.com/comment/47510442
tagged with: javascript
has body: I have seen several related issues about this on here but none has solved my problem yet. I am trying to access the freckle(letsfreckle.com) api in a small web app I'm building but I'm having issues. It works when I start chrome browser without security but its not working on github pages and when I package the app as a chrome extension. This is what my service looks like jXtnsion.factory('freckle', ['$http', function($http){ return $http.get('https://api.letsfreckle.com/v2/projects?freckle_token=kacgnpf0og0hfi1it32o9xtc2ls2328-gmeb1nwcp1ko8o0f0ygi4mlxxxxxxxx&amp;f&amp;format=jsonp') .success(function(freckleData){ return freckleData; }) .error(function(err){ return err; }); }]); I keep getting a 'XMLHttpRequest cannot load https://api.letsfreckle.com/v2/projects?freckle_token=kacgnpf0og0hfi1it32o9xtc2ls2328-gmeb1nwcp1ko8o0f0ygi4mlxxxxxxxx&amp;f&amp;format=jsonp. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://andela-asogbein.github.io' is therefore not allowed access. Why is this not working?
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/47517635
has comment: http://stackoverflow.com/comment/47510492
has answer: http://stackoverflow.com/a/29690612
has comment: http://stackoverflow.com/comment/47510424
tagged with: angularjs
has title: Access Control Allow Origin Issue with AngularJS
has answer: http://stackoverflow.com/a/29718219
type: UnansweredQuestion

http://stackoverflow.com/q/29539075
tagged with: metrics
type: Question
tagged with: d3.js
has body: I have been working with tools like grafana or influga, which are fantastic projects which facilitate the creation of dashboards with charts and various type of graphs. I was wondering, would it be possible to separate the 2 core features of these apps in a standalone javascript library that can be reused in existing web apps (that can be made easy to use by end-users also)? The 2 key features would be: graph editor (query, labels, colors, ecc.) graph view (see the graph, change date range, zoom in and out, ecc) The problem with grafana and similar solutions is that they are not easy to integrate with existing web apps, and these projects are growing in complexity and adding new features, while something many people might need is some kind of integration in existing web apps. Is there anybody working on this? If yes, what are the 2 most promising projects?
tagged with: influxdb
upvote count: 11
has title: JS based influxdb graph editors like Grafana, Influga, are there reusable libraries?
has comment: http://stackoverflow.com/comment/53848354
answer count: 1
linked to: http://stackoverflow.com/q/32971011
tagged with: javascript
type: UnansweredQuestion
score: 11
has answer: http://stackoverflow.com/a/29543942
has comment: http://stackoverflow.com/comment/54097029
tagged with: grafana
downvote count: 0
favorite count: 0

http://stackoverflow.com/comment/55347681
comment on: http://stackoverflow.com/a/29589044
has text: I deleted all the breakpoints and restarted the IDE, but the solution didn't work for me.
score: 5
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29664820
has comment: http://stackoverflow.com/comment/47469012
score: 1
has body: Take a look at the following links Change an element&#39;s class with JavaScript and http://www.kirupa.com/html5/setting_css_styles_using_javascript.htm Also please check the position attribute for the elements, see below example: https://jsfiddle.net/masoodalam78/e3erq6j4/ var elementObj = document.querySelector("#menu"); elementObj.style.backgroundColor = "blue"; elementObj.left = "200px";
upvote count: 1
answers question: http://stackoverflow.com/q/29664572
downvote count: 0
type: Answer

http://stackoverflow.com/q/29659561
has answer: http://stackoverflow.com/a/29659757
has answer: http://stackoverflow.com/a/29660001
type: Question
has answer: http://stackoverflow.com/a/29660568
possible better answer: http://stackoverflow.com/a/29660239
tagged with: javascript
tagged with: jquery
has body: In jquery, when you want to submit a form $(document).ready(function(){ $("form").submit(function(){ alert("Submitted"); }); }); My problem is: I have a bunch of fields (that not in same form, or not in any form at all). And when I press send button, jquery will get values of all those fields and send to server (as sending a form). I don't know how to this in jquery. Please tell me thanks :)
has answer: http://stackoverflow.com/a/29660239
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 4
accepted answer: http://stackoverflow.com/a/29660001
type: AnsweredQuestion
has title: Submit Data to server from different fields not in same form
tagged with: forms
has comment: http://stackoverflow.com/comment/47458813
has comment: http://stackoverflow.com/comment/47459158

http://stackoverflow.com/comment/47497785
type: QuestionComment
has text: You're being downvoted because SO is for solving issues with code, not for plugin recommendations. That said, the first hit in google for 'bootstrap slider' was this: http://seiyria.github.io/bootstrap-slider/. hopefully its of some help.
score: 1
comment on: http://stackoverflow.com/q/29680213
type: Comment

http://stackoverflow.com/comment/47241991
has text: Thanks for you pointing out my confusion between lazy evaluation and functional programming. One thing I was wondering about then, is whether Underscore.js is just a syntactic sugar then? I was expecting to get the benefits of lazy evaluation. But in fact, Underscore.js code would be equivalent to: var list = [1, 2, 3]; var squares = []; for (var i = 0; i < list.length; i++) { squares.push (list[i]*list[i]); }; var sum_squares = 0; for (var i = 0; i < squares.length; i++) { sum_squares += squares[i]; };
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29544499
type: Comment

http://stackoverflow.com/comment/47338035
score: 0
type: QuestionComment
type: Comment
has text: do all the select elements in page have an ID? If not don't call `checkSelectAllOthers` if id doesn't exist. Also you are calling that function before assigning value to one of it's arguments `optionValues`. Order is wrong
comment on: http://stackoverflow.com/q/29595533

http://stackoverflow.com/comment/47392089
has text: Thanks for that. Where would I put this code in an Angular project?
type: Comment
comment on: http://stackoverflow.com/a/29619306
score: 0
type: AnswerComment

http://stackoverflow.com/q/29621623
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47387256
tagged with: javascript
tagged with: jquery
has body: I'm trying to change text color inside an option with the style.color property while inserting in to a select without success. its working on browser but not on mobile device for(var i = 0; i &lt; 4; i++) { var x = document.getElementById("selectCode"); var option = document.createElement("option"); option.value = i; option.text = i; option.style.color = 'darkblue'; x.add(option); } Is style.color = 'colorname' property approachable with javascript on mobile device, if not what is the approachable way? Here is my Jsfiddle
has title: Changing select option text color property within manually insert
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47387363
tagged with: cordova
has comment: http://stackoverflow.com/comment/47387503
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47387388
has comment: http://stackoverflow.com/comment/47387579
has comment: http://stackoverflow.com/comment/47387314
has answer: http://stackoverflow.com/a/29621870
has comment: http://stackoverflow.com/comment/47387286
has comment: http://stackoverflow.com/comment/47387706
type: Question

http://stackoverflow.com/q/29539163
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29543819
has comment: http://stackoverflow.com/comment/47232239
has body: I have written a script which must copy the data from One spreadsheet to another along with date stamp. I am unable to achieve this, can you help me with this as I am a newbie to scripting. function triggerOnTime() { var SpreadSheetKeyA = "MY key"; var SpreadSheetKeyB = "MY key"; var sheet1 = SpreadsheetApp.openById(SpreadSheetKeyA).getActiveSheet(); var sheet2 = SpreadsheetApp.openById(SpreadSheetKeyB).getActiveSheet(); var data = sheet1.getRange(5,11,10,5).getValues(); var time = new Date (); var array = []; for (var y = 1; y &lt; data.length; y++) { for (var x = 0; x &lt; 5; x++){ array.push(data[y][x]); } sheet2.appendRow([time,array]); array = []; //reset the array contents } } Spreadsheet-1: Data present in Spreadsheet-1, Name apple android windows linux Germany 3 4 6 7 America 4 1 6 2 Sweden 1 6 1 6 Paris 5 0 2 4 Spreadsheet-2: Data present in Spreadsheet-2, Date Name apple android windows linux The data present in the spreadsheet-1 is changed everyday. I would like to backup the data to spreadsheet-2 whenever new data is present in spreadsheet-1. It is like creating a log of data everyday with a date stamp.
type: Question
tagged with: google-apps-script
answer count: 2
tagged with: google-sheets
tagged with: javascript
linked to: http://stackoverflow.com/q/29626337
has comment: http://stackoverflow.com/comment/47237549
score: 0
has title: Append data from one sheet to another with date stamp
has answer: http://stackoverflow.com/a/29543819
has answer: http://stackoverflow.com/a/29541679
has comment: http://stackoverflow.com/comment/47231472
has comment: http://stackoverflow.com/comment/47232862
has comment: http://stackoverflow.com/comment/47234272
possible better answer: http://stackoverflow.com/a/29541679

http://stackoverflow.com/comment/47291185
score: 0
type: AnswerComment
has text: @MikeBrant I think the assumption here is that the data is already serialised as JSON
type: Comment
comment on: http://stackoverflow.com/a/29570758

http://stackoverflow.com/comment/58033683
type: AnswerComment
has text: @bigp haha ok no problem :)
type: Comment
comment on: http://stackoverflow.com/a/29681947
score: 0

http://stackoverflow.com/a/29605760
accepted answer of: http://stackoverflow.com/q/29600258
score: 1
upvote count: 1
has body: In your code, you seem to only be matching on whole words, although your question does not specify that. If you want to match on any text in the input (e.g., if you type "a", all "a"s in the text are made bold), you can do that relatively easily using the javascript split and join String methods: Template.pg.events({ 'keyup .search': function(e){ e.preventDefault(); var text = $('p#result').text(); var input = $(e.target).val(); var splitText = text.split(input); // Produces an array without whatever's in the input console.log(splitText); var rep = splitText.join("&lt;b&gt;" + input + "&lt;/b&gt;"); // Produces a string with inputs replaced by boldened inputs console.log(rep); $('p#result').html(rep); } }); Notably, you have to replace the text on the page using $('p#result').html(), which was missing in your MeteorPad example. Note also that this is a case-sensitive implementation; you can use a regex to do the split, but it gets a bit more complicated when you want to replace the text in the join. You can play around with it on this MeteorPad. To do this case-insensitively, the split is very straightforward -- you can use a RegExp like so: ... var regex = new RegExp($(e.target).val(), 'gi'); // global and case-insensitive, where `input` used to be The tricky thing is to extract the correct case of what you want to pull out, then put it back in -- you can't do this with a simple join, so you'll have to interleave the two arrays. You can see an example of interleaved arrays here, which was taken from this question. I've amended that a bit to deal with the uneven array lengths, here: var interleave = function(array1, array2) { return $.map(array1, function(v, i) { if (array2[i]) { return [v, array2[i]]; } // deals with uneven array lengths else { return [v]; } }); } I've also created another MeteorPad that you can play around with that does all of this. lo is a good test string to check out.
has comment: http://stackoverflow.com/comment/47371423
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29600258
type: Answer
has comment: http://stackoverflow.com/comment/47372537

http://stackoverflow.com/a/64998440
type: Answer
has body: Late to the party but, TBH, none of the answers give an explanation to 50% of the original question ("why the raw: Array[1]") 1. Why is it possible to call the function without parenthesis, using backticks? console.log`1` As others have pointed out, this is called Tagged Template (more details also here). Using this syntax, the function will receive the following arguments: First argument: an array containing the different parts of the string that are not expressions. Rest of arguments: each of the values that are being interpolated (ie. those which are expressions). Basically, the following are 'almost' equivalent: // Tagged Template fn`My uncle ${uncleName} is ${uncleAge} years old!` // function call fn(["My uncle ", " is ", " years old!"], uncleName, uncleAge); (see point 2. to understand why they're not exactly the same) 2. Why the ["1", raw: Array[1]] ??? The array being passed as the first argument contains a property raw, wich allows accessing the raw strings as they were entered (without processing escape sequences). Example use case: let fileName = "asdf"; fn`In the folder C:\Documents\Foo, create a new file ${fileName}` function fn(a, ...rest) { console.log(a); //In the folder C:DocumentsFoo, create a new file console.log(a.raw); //In the folder C:\Documents\Foo, create a new file } What, an array with a property ??? ??? Yes, since JavaScript arrays are actually objects, they can store properties. Example: const arr = [1, 2, 3]; arr.property = "value"; console.log(arr); //[1, 2, 3, property: "value"]
answers question: http://stackoverflow.com/q/29660381
has comment: http://stackoverflow.com/comment/136449137
upvote count: 47
downvote count: 0
score: 47

http://stackoverflow.com/q/29662779
accepted answer: http://stackoverflow.com/a/29680724
possible better answer: http://stackoverflow.com/a/29663118
type: Question
upvote count: 4
answer count: 2
has answer: http://stackoverflow.com/a/29663118
has body: I have one modal inside another modal and I've managed to make the inner one close without affecting the other. The problem is that when the second modal is closed it triggers the 'hidden.bs.modal' event for its self and for the first modal. Open demo modal × Demo Modal Upload image Close × Upload new image Testing Area Cancel Accept $('#btnUploadCancel').click(function () { $('#uploadImage').modal('toggle'); }); $(document).on('hidden.bs.modal', '#myModal', function () { alert("hello"); }); $(document).on('hidden.bs.modal', '#uploadImage', function () { alert("goodbye"); }); Here is a jsFiddle example that I made. The reason for this question is that I need to trigger an action only when the second modal gets hidden and then something else when the first one gets hidden. Any ideas on how to fix this using the event for each of them??? Note: The second modal has to be inside the other as they are called as a partial view.
downvote count: 0
tagged with: bootstrap-modal
tagged with: javascript
tagged with: jquery
score: 4
favorite count: 0
has answer: http://stackoverflow.com/a/29680724
tagged with: twitter-bootstrap-3
tagged with: twitter-bootstrap
has title: Bootstrap 3: prevent modal inside modal to trigger (hidden.bs.modal) every time
type: AnsweredQuestion

http://stackoverflow.com/comment/47544539
has text: if its a id, then use Ext.getcmp('fieldID'), If its a itemId, then Ext.getcmp('#fieldID')
comment on: http://stackoverflow.com/q/29685541
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29682885
answers question: http://stackoverflow.com/q/29682790
score: 0
upvote count: 1
downvote count: 1
has body: try this: $('.hover12').click(function() { $(this).find('.fa').toggleClass('fa-star-o').toggleClass('fa-star orange12'); });
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/47503127
accepted answer of: http://stackoverflow.com/q/29682790

http://stackoverflow.com/comment/47443908
has text: now I know how to tally lots of rep-points here. thanks for the tutorial. As an alternative approach. Maybe if we have access to the server, we can request the file in base64 text.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29651524
type: Comment

charts
tags question: http://stackoverflow.com/q/29652775
tags question: http://stackoverflow.com/q/29563509
tags question: http://stackoverflow.com/q/29538926
tags question: http://stackoverflow.com/q/29614365
tags question: http://stackoverflow.com/q/29537336
tags question: http://stackoverflow.com/q/29544373
tags question: http://stackoverflow.com/q/29562159
tags question: http://stackoverflow.com/q/29659507
tags question: http://stackoverflow.com/q/29564445
tags question: http://stackoverflow.com/q/29592171
tags question: http://stackoverflow.com/q/29576123
tags question: http://stackoverflow.com/q/29544599
type: Tag
tags question: http://stackoverflow.com/q/29603390
tags question: http://stackoverflow.com/q/29687486
tags question: http://stackoverflow.com/q/29624054
tags question: http://stackoverflow.com/q/29551888
tags question: http://stackoverflow.com/q/29680810
tags question: http://stackoverflow.com/q/29657828
tags question: http://stackoverflow.com/q/29624049
tags question: http://stackoverflow.com/q/29674247
tags question: http://stackoverflow.com/q/29534457
tags question: http://stackoverflow.com/q/29664435
tags question: http://stackoverflow.com/q/29613326
tags question: http://stackoverflow.com/q/29645378
tags question: http://stackoverflow.com/q/29609257
tag name: charts
tags question: http://stackoverflow.com/q/29665491
tags question: http://stackoverflow.com/q/29549969
tags question: http://stackoverflow.com/q/29595604

http://stackoverflow.com/q/29656946
tagged with: node.js
has body: I'm having trouble properly sequencing tasks in Grunt. What I'm building has a lot of code built into it, so I'm going to simplify the code to show you what I'm struggling with. I have a folder with a bunch of files that start with a 4-digit ID number. Each ID has about 12 files with ~200MB of total JSON data. I have a task that looks like this: // Run data by ID grunt.registerTask('run', 'Publish data for a single ID', function(id) { var done = this.async(); // (1) Process data for that ID and store it into 6 huge arrays // (2) DB connection opened and each array is inserted // into 6 different collections via mongoose grunt.log.ok('ID '+id+' has processed'); db.close(), done(); }); This task works as it should. Depending on the ID's total file size, this task takes anywhere from 15-45 seconds per ID. My next challenge is to take it a step further and use grunt.file.recurse() to find all of the IDs in the directory and then fire off subsequent "run" tasks for each id. without getting into grunt.file.recurse(), here is a basic example of how it would run 3 IDs: // Run data grunt.registerTask('runALL', 'Publish all data', function(id) { grunt.task.run(['run:0001','run:0002','run:0003']); // etc }); When I fire the command "grunt runALL", the grunt log erroneously says... &gt;&gt; ID 0001 has processed &gt;&gt; ID 0001 has processed &gt;&gt; ID 0002 has processed &gt;&gt; ID 0001 has processed &gt;&gt; ID 0002 has processed &gt;&gt; ID 0003 has processed So as you can see... every time it goes into another iteration, its starting from the beginning again. Instead, I want the tasks to run in sequence and have the result like... &gt;&gt; ID 0001 has processed &gt;&gt; ID 0002 has processed &gt;&gt; ID 0003 has processed What am I doing wrong and how can I make each ID run only once from the "runALL" task? Thank you for any advice you can offer.
answer count: 0
downvote count: 0
type: UnansweredQuestion
type: Question
score: 3
tagged with: gruntjs
upvote count: 3
tagged with: javascript
favorite count: 0
has title: Custom grunt tasks are repeating themselves and not running sequentially

http://stackoverflow.com/comment/47221884
has text: Yes it can be done with jQuery
score: 0
comment on: http://stackoverflow.com/q/29534440
type: Comment
type: QuestionComment

html-framework-7
tag name: html-framework-7
tags question: http://stackoverflow.com/q/29642573
type: Tag

http://stackoverflow.com/a/29678619
type: Answer
upvote count: 3
has body: The issue is because the event you fire on the child element is then bubbled up the DOM back to the .selector-wrapper which then fires on the child again and so on recursively. Instead, don't fire the event on the child element, but do whatever logic you require in the event handler, such as adding a class to change the styling. Try this: $('.selector-wrapper').on('mouseenter mouseleave', function(e) { $(this).find('.selector').toggleClass('foo'); // whatever logic you require here... }); .selector-wrapper { width: 100%; height: 100px; background-color: #C00; } .selector { width: 50px; height: 50px; background-color: #0C0; } .foo { width: 100px; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div class="selector-wrapper"&gt; &lt;div class="selector"&gt;&lt;/div&gt; &lt;/div&gt;
score: 3
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29678550
answers question: http://stackoverflow.com/q/29678550

http://stackoverflow.com/comment/47392662
has text: you can check here http://jsbin.com/catojenupa/1/edit
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29624448
score: 0

http://stackoverflow.com/a/29563322
answers question: http://stackoverflow.com/q/29563163
score: 0
has comment: http://stackoverflow.com/comment/47281864
type: Answer
has body: You can use preventdefault(). after that you can write your own code $("a").click(function(e){ e.preventDefault(); //You can write other code what you want to write }); This code may help you to get override the other code or you may use e.stopPropagation() in stead of e.preventDefault(); it will stop all other active events

http://stackoverflow.com/a/29646929
type: Answer
has comment: http://stackoverflow.com/comment/47438114
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47434933
has comment: http://stackoverflow.com/comment/47437209
has comment: http://stackoverflow.com/comment/47435112
has body: put this in your .httacces file : RewriteEngine On # Specify search friendly URLs RewriteRule ^index\.html/([A-Za-z0-9-]+)/?$ /index.html#$1 [L]
downvote count: 0
answers question: http://stackoverflow.com/q/29646776

http://stackoverflow.com/a/29624154
answers question: http://stackoverflow.com/q/29624025
accepted answer of: http://stackoverflow.com/q/29624025
score: 4
type: AcceptedAnswer
has body: You can achieve the desired effect by using callbacks. This executes the .text() call when the .fadeOut() is complete, just before the .fadeIn(): $("#bottomMiddle").hover(function(){ $("#rightHeading").fadeOut(function() { $(this).text("Hello").fadeIn(); }); $("#rightContent").fadeOut(function() { $(this).text("World").fadeIn(); }); },function(){ $("#rightHeading").fadeOut(function() { $(this).text("This is the original content").fadeIn(); }); $("#rightContent").fadeOut(function() { $(this).text("This is the original content").fadeIn(); }); }); button { width: 300px; height: 50px; } Button This is the original heading This is the original content
type: Answer
upvote count: 4
downvote count: 0

http://stackoverflow.com/comment/47402352
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29582557
type: Comment
has text: Apologies for not providing the answer you were looking for. But your question was very short and simple. If you already have a sound understanding on the subject and actually mean to ask the question from a specific point of view as you've explained (i.e. in comparison with other languages), then next time I'd suggest being more clear so we can be more helpful.

http://stackoverflow.com/comment/47451571
has text: testing purposes, Yes, it's already in the DOM. I just want to programmatically test it to see if it works as it should.
score: 0
comment on: http://stackoverflow.com/q/29654630
type: Comment
type: QuestionComment

http://stackoverflow.com/a/43261167
has comment: http://stackoverflow.com/comment/87937846
answers question: http://stackoverflow.com/q/29544371
downvote count: 10
has comment: http://stackoverflow.com/comment/108419962
score: 20
has comment: http://stackoverflow.com/comment/132465805
upvote count: 30
has body: The MacGyver way, just for lulz var a = [80, 77, 88, 95, 68]; console.log(eval(a.join('+'))/a.length)
type: Answer
has comment: http://stackoverflow.com/comment/97992359

http://stackoverflow.com/comment/51500800
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29647998
has text: Did you solved this problem?

http://stackoverflow.com/a/29685981
type: Answer
score: 1
has body: Another option would be to use Regular Expressions to match your targets, as in: var maps = { // result =&gt; RegExp '64-bit Microsoft Windows 7': /64-bit.+?NT\s6\.1/, '32-bit Microsoft Windows 8': /32-bit.+?NT\s6\.2/, '64-bit Microsoft Windows 8': /64-bit.+?NT\s6\.2/ }; var test_data={ "64-bit Microsoft Windows NT 6.2.9200": 1, "32-bit Microsoft Windows NT 6.2.9137": 2, "64-bit Microsoft Windows NT 6.1.3700": 3, "64-bit Microsoft Windows NT 6.1.1200": 4 }; var result={}; for(key in test_data){ for(target in maps){ if(maps[target].test(key)){ if(!result[target]){ result[target]=0; } result[target]+=test_data[key]; break; } } } console.dir(result); which will produce: { '64-bit Microsoft Windows 8': 1, '32-bit Microsoft Windows 8': 2, '64-bit Microsoft Windows 7': 7 } UPDATED The regexes could be a little more precise, to expose possible outlying cases, by anchoring them to the start and end of the string, as in: `/^64-bit.+?NT\s6\.1.+$/` which can be described as: ^ # beginning of target string 64-bit # literal '64-bit' .+? # one or more chars, non-greedy NT # literal 'NT' \s # literal space 6\.1 # literal '6.1' .+ # one or more chars, greedy $ # end of target string You may also wish to report targets that do not match your target patterns by refactoring to: for(key in test_data){ var found=false; for(target in maps){ if(maps[target].test(key)){ if(!result[target]){ result[target]=0; } result[target]+=test_data[key]; found=true; break; } } if(!found){ console.warn('encountered unknown record at key "%s"',key) } }
upvote count: 1
answers question: http://stackoverflow.com/q/29685671
downvote count: 0
has comment: http://stackoverflow.com/comment/47509047

http://stackoverflow.com/q/29648330
linked to: http://stackoverflow.com/q/203198
has body: I am using .load function of jquery to display partial view as a modal when a button is clicked on the html page. It is very weird that when I change something in the partial view and click the button for the first time, the partial view data is retrieved and it is correctly shown on the UI too. But when I later click the button, a request is made to fetch the partial view, data is also returned but the modal never appears till I again change something in the partial view. Why could this be happening. I tried disabling cache for ajax as suggested here, but still it didn't work. Following is my code. &lt;button class=&quot;btn btn-primary btn-lg&quot; data-toggle=&quot;modal&quot; data-target=&quot;#myModal&quot;&gt;Launch demo modal&lt;/button&gt; &lt;div class=&quot;modal&quot; id=&quot;myModal&quot;&gt; &lt;/div&gt; &lt;script&gt; $('#myModal').on('show.bs.modal', function(e) { $('#myModal').load('myFile.cshtml'); //When loading from a file/url }) &lt;/script&gt; My Partial View Markup: &lt;div class=&quot;modal-dialog&quot;&gt; &lt;div class=&quot;modal-content&quot;&gt; &lt;div class=&quot;modal-header&quot;&gt; &lt;button type=&quot;button&quot; class=&quot;close&quot; data-dismiss=&quot;modal&quot; aria-hidden=&quot;true&quot;&gt;&amp;times;&lt;/button&gt; &lt;h4 class=&quot;modal-title&quot; id=&quot;mymodallabel&quot;&gt;modal title&lt;/h4&gt; &lt;/div&gt; &lt;div class=&quot;modal-body&quot;&gt; &lt;p&gt;Second from partial with clear cache&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;modal-footer&quot;&gt; &lt;button type=&quot;button&quot; class=&quot;btn btn-default&quot; data-dismiss=&quot;modal&quot;&gt;close&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; EDIT: The question for which this has been marked as duplicate refers to events for dynamically loaded elements whereas my question is on the static elements, the event on which will bring in new (dynamic) elements
has comment: http://stackoverflow.com/comment/47437292
tagged with: bootstrap-modal
tagged with: javascript
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/47472905
has comment: http://stackoverflow.com/comment/47473056
has comment: http://stackoverflow.com/comment/47437873
linked to: http://stackoverflow.com/q/12286332
linked to: http://stackoverflow.com/q/18933301
answer count: 0
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/203198
has comment: http://stackoverflow.com/comment/47472722
has title: Jquery load function loading data only when ran for the first time, but not on subsequent calls
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/47437485
type: Question
score: 0

http://stackoverflow.com/a/29666199
upvote count: 22
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29666036
type: Answer
answers question: http://stackoverflow.com/q/29666036
score: 22
has body: JSON.parse('{"x": "\n"}') fails because '{"x": "\n"}' is not a valid JSON string due to the unescaped slash symbol. JSON.parse() requires a valid JSON string to work. '{"x": "\\n"}' is a valid JSON string as the slash is now escaped, so JSON.parse('{"x": "\\n"}') will work. JSON.parse(JSON.stringify({"x" : "\n"})) works because JSON.stringify internally escapes the slash character. The result of JSON.stringify({"x" : "\n"}) is {"x":"\n"} but if you try to parse this using JSON.parse('{"x":"\n"})' it will FAIL, as it is not escaped. As JSON.stringify returns an escaped character, JSON.parse(JSON.stringify()) will work.

http://stackoverflow.com/comment/47451401
comment on: http://stackoverflow.com/a/29655400
has text: yeah I also, checked it doesn't change, but that doesn't mean they aren't doing something in JS to get keep them in sync.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29643122
tagged with: socket.io
type: Question
score: 3
tagged with: sails.js
accepted answer: http://stackoverflow.com/a/29643307
tagged with: javascript
tagged with: multiplayer
has title: how to use sails.js and socket.io for online game server-side
answer count: 1
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/29643307
tagged with: node.js
type: AnsweredQuestion
upvote count: 3
has body: I'm trying to create an online multiplayer game. After some digging, I came up with sails and socketio. The server needs to be real-time. I want to use the sails as my data controller(like player authentication), and the socketio for real-time connection. Questions: 1. Is sails able to integrate with socketio? 2. If so, Can I connect to socket.io with a connection from my game? (NO Javascipts in client side), and how? 3. Is there something I'm missing? any other options? EDIT: 1. how can I use sails as my authentication system for online players and socket.io as my real-time connection? 5. The connection must be TCP or UDP or I should use HTTP? Does anyone have any experience in online gaming? please give me hint where to start and what to use for a multiplayer online game like MOBA games? Thanks.

http://stackoverflow.com/a/29654740
score: 5
has body: Using .val() in this way will just return the current value of #imageurl. $('#imageurl').val() .val is a function call that works as a getter and a setter. To set the value, try this: $('#imageurl').val(source);
upvote count: 5
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/29654535

http://stackoverflow.com/comment/47461722
has text: Perhaps you have a virtual defined on a model somewhere, and it's fooling you?
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29661053

http://stackoverflow.com/a/29607977
has comment: http://stackoverflow.com/comment/55259451
has comment: http://stackoverflow.com/comment/55257229
has comment: http://stackoverflow.com/comment/47443108
has comment: http://stackoverflow.com/comment/55256620
has comment: http://stackoverflow.com/comment/55256710
has body: Here is what official docs said… updateIn You don't need updateIn, which is for nested structures only. You are looking for the update method, which has a much simpler signature and documentation: Returns a new List with an updated value at index with the return value of calling updater with the existing value, or notSetValue if index was not set. update(index: number, updater: (value: T) =&gt; T): List&lt;T&gt; update(index: number, notSetValue: T, updater: (value: T) =&gt; T): List&lt;T&gt; which, as the Map::update docs suggest, is "equivalent to: list.set(index, updater(list.get(index, notSetValue)))". where element with name "third" That's not how lists work. You have to know the index of the element that you want to update, or you have to search for it. How can I update list where element with name third have its count set to 4? This should do it: list = list.update(2, function(v) { return {id: v.id, name: v.name, count: 4}; });
has comment: http://stackoverflow.com/comment/59962866
type: Answer
score: 19
has comment: http://stackoverflow.com/comment/47442401
answers question: http://stackoverflow.com/q/29589753
has comment: http://stackoverflow.com/comment/59965138
downvote count: 2
upvote count: 21

http://stackoverflow.com/a/29595600
answers question: http://stackoverflow.com/q/29595025
score: 0
accepted answer of: http://stackoverflow.com/q/29595025
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47339533
has body: function link(url){ window.location.assign(url); } &lt;button onclick="link('http://www.stackoverflow.com/')"&gt;Go to Stack Overflow without using an &amp;lt;a&amp;gt;!&lt;/button&gt;
has comment: http://stackoverflow.com/comment/47338222
type: Answer
has comment: http://stackoverflow.com/comment/47338077

http://stackoverflow.com/q/29662987
downvote count: 0
has title: remove a select2 tags with specific index?
favorite count: 0
has answer: http://stackoverflow.com/a/44564944
has comment: http://stackoverflow.com/comment/47493027
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47469080
has body: I manipulated my select2 to accept equal tagged text, but with different value. example: city-0, city-1, 2-city, city-3 ... Now, I need to delete a specific tag (city-2) This code does not work for me, because I create dynamically equal texts ... $(".select2-search-choice div").filter(function() { return $(this).text() === "Hawaii"; }).parent().remove(":eq(0)"); Is there a command to get the tag index in select2 multi? Tks!
has comment: http://stackoverflow.com/comment/95182970
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47491775
has comment: http://stackoverflow.com/comment/47465884
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47466000
has comment: http://stackoverflow.com/comment/47466111
answer count: 1

http://stackoverflow.com/comment/47358847
type: AnswerComment
comment on: http://stackoverflow.com/a/29558099
score: 0
type: Comment
has text: Thanks Anthony, i have looked this up and it seems you were right. I have updated the jsfiddle to use .on http://jsfiddle.net/oczqkbpd/8/

http://stackoverflow.com/q/29568243
has body: I am trying to parse xml data with javascript in ajax call.But responseXML is returning null value.Here is my code Here is my "myxml.xml" file <?xml version="1.0" encoding="iso-8859-1"?> <grandChild1_1>textOfGrandChild1_1</grandchild1_1> <grandChild2_1>textOfGrandChild2_1</grandchild2_1> <grandChild3_1>textOfGrandChild3_1</grandchild3_1> <grandChild1_2>textOfGrandChild1_2</grandchild1_2> <grandChild2_2>textOfGrandChild2_2</grandchild2_2> <grandChild3_2>textOfGrandChild3_2</grandchild3_2> <grandChild1_3>textOfGrandChild1_3</grandchild1_3> <grandChild2_3>textOfGrandChild2_3</grandchild2_3> <grandChild3_3>textOfGrandChild3_3</grandchild3_3> When I tried with alert(xhr.responseText) it showed the xml file as it is.But when using responseXML it is giving null value.Where is the problem?
accepted answer: http://stackoverflow.com/a/29568463
has comment: http://stackoverflow.com/comment/47286023
has title: responseXML is returning null
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47291310
possible better answer: http://stackoverflow.com/a/29568460
downvote count: 1
has answer: http://stackoverflow.com/a/29568460
type: Question
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/29568463
answer count: 2
upvote count: 0
has comment: http://stackoverflow.com/comment/47286089
favorite count: 0
tagged with: http://stackoverflow.com/tag/xml
linked to: http://stackoverflow.com/q/134494

http://stackoverflow.com/comment/47314679
type: QuestionComment
has text: Try this example: http://jsfiddle.net/31480m7n/9/
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29582571

http://stackoverflow.com/q/29566432
type: UnansweredQuestion
has title: Can I pass a class to be used with css in a .json object?
has comment: http://stackoverflow.com/comment/47282658
tagged with: css
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/47282948
type: Question
has answer: http://stackoverflow.com/a/29566778
answer count: 1
tagged with: javascript
has body: I have a .json object that's then displayed through Angular by ng-bind: The .json has this structure: { "header":"A", "url":"#/us/en/a/b/c/c", "paragraphs":[ "Something something blah blah." ] } The code is pulled through but the class is dropped. No errors in console. How do I append class to that link?
score: 0
tagged with: angularjs

http://stackoverflow.com/comment/47376806
type: QuestionComment
has text: check if `score` contains anything?
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29615709

http://stackoverflow.com/a/29630619
score: 2
has body: try setting a timeout, and then if another input has focus, clear the time out to avoid the fadeout: var timeout; form.find('input').on('focusout', function(){ timeout = setTimeout(function() {form.fadeout();}, 2000); }); form.find('input').on('focusin', function(){ clearTimeout(timeout); });
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47404215
answers question: http://stackoverflow.com/q/29630503
type: Answer
accepted answer of: http://stackoverflow.com/q/29630503
upvote count: 2

http://stackoverflow.com/comment/47315025
type: Comment
score: 0
type: AnswerComment
has text: gist:3924d0fddd2bee70c33a
comment on: http://stackoverflow.com/a/29581016

http://stackoverflow.com/q/29661300
answer count: 1
tagged with: button
tagged with: jquery
has comment: http://stackoverflow.com/comment/47462235
tagged with: php
has comment: http://stackoverflow.com/comment/47462297
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47462399
has answer: http://stackoverflow.com/a/29661639
has body: I have this code to add fields dynamicly and out of nothing the button to add new fields start behaving weird. I was working fine and out of nothing it started to process the form like the submit button. I tried setting the button as button but then it stop adding the fields. The html: Add More Fields The JS:
type: Question
has comment: http://stackoverflow.com/comment/47462360
has comment: http://stackoverflow.com/comment/47462423
tagged with: javascript
has title: Button behaving weird
tagged with: forms
score: 0

http://stackoverflow.com/comment/47366501
type: Comment
has text: Thanks for helping this, this works as desired. I think I was nearly there. Really appreciated.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29610174

http://stackoverflow.com/comment/47458220
score: 0
type: Comment
type: QuestionComment
has text: Thanks you all for your replies. After readign through the examples I now have a better idea of how to use this. Sorry it might have been a duplicated post.
comment on: http://stackoverflow.com/q/29650907

http://stackoverflow.com/q/29648424
type: Question
answer count: 2
tagged with: session
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47436810
has answer: http://stackoverflow.com/a/29648548
has title: remove session in javascript and jquery
score: 8
favorite count: 0
has body: we all know that we can set and get session using javascript like below: session.setItem("name", "value"); session.getItem("name"); I need to know how to destroy particular and all session variable in javascript. I used google but I'm unable to get exactly what I need. Please help me to find the solution. jQuery answers are also welcome (without plugin) Thank you in advance
has comment: http://stackoverflow.com/comment/131481313
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/29648539
accepted answer: http://stackoverflow.com/a/29648548
has answer: http://stackoverflow.com/a/29648539
upvote count: 11
type: AnsweredQuestion
downvote count: 3

http://stackoverflow.com/a/29596730
downvote count: 0
score: 1
has body: If you insist on regex, then use below one: (?:value=")([^"]+) Here is DEMO Using JavaScript it will look like: var value = document.querySelectorAll("input[type=submit]")[0].value;
has comment: http://stackoverflow.com/comment/47340585
answers question: http://stackoverflow.com/q/29596656
has comment: http://stackoverflow.com/comment/47341313
upvote count: 1
type: Answer

http://stackoverflow.com/comment/47379666
has text: Not sure what to make of the Warnings webpack is dumping. If they made more sense to me I prolly wouldn't be posting.
type: QuestionComment
comment on: http://stackoverflow.com/q/29616871
type: Comment
score: 0

http://stackoverflow.com/comment/47279713
type: Comment
type: QuestionComment
has text: something wrong in your routing design. Sounds like you are expecting a single page app to work on multiple server routes which doesn't make sense
comment on: http://stackoverflow.com/q/29564649
score: 0

http://stackoverflow.com/comment/47487387
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29674529
score: 0
has text: Have u injected youtube like this... angular.module('myApp', ['youtube-embed']);

http://stackoverflow.com/comment/47319373
score: 0
has text: you can't do this without the user pressing [ctrl]+[c] themselves...
type: Comment
comment on: http://stackoverflow.com/q/29585592
type: QuestionComment

http://stackoverflow.com/comment/47348301
score: 0
type: AnswerComment
has text: yea am leaving the page without invalidate the session that only my problem
type: Comment
comment on: http://stackoverflow.com/a/29600021

http://stackoverflow.com/comment/47303285
type: AnswerComment
has text: may i now, where i can add your code from my existing code? thanks
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29576650

http://stackoverflow.com/q/29632903
favorite count: 0
has comment: http://stackoverflow.com/comment/47408449
type: UnansweredQuestion
downvote count: 1
has comment: http://stackoverflow.com/comment/47408437
has answer: http://stackoverflow.com/a/29633037
score: -1
tagged with: dom
type: Question
has comment: http://stackoverflow.com/comment/47408431
has title: DOM with javascript not working
upvote count: 0
tagged with: javascript
answer count: 3
has body: I'm newbie to web programming and I can't understand why the following code doesn't work. It is supposed to remove permanently the content of the div element when the button is pressed, but it disappears for a while and then reappears. The code is the following: CONTENEDOR UNO
has answer: http://stackoverflow.com/a/29632977
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29634270

http://stackoverflow.com/q/29684805
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47509923
has body: I've seen bunches of questions about this, but wanted to clarify my understanding. It all started when I was setting up jQuery validation on a popup form. If I added the validate() method while the form wasn't visible, the validation didn't work (straight submit). If I added validation after the form element was visible, all is well... the validate fires and doesn't submit the form. So, I tried to isolate this behavior and this is what I ended up with: https://jsfiddle.net/KyleMit/ph8ue5j5/ Here's the HTML: &lt;form id="form" style="display: none;"&gt; &lt;input type="text" name="name" id="name" placeholder="Name" required="requited" /&gt;&lt;br/&gt; &lt;input id="submit" class="button" type="submit" value="submit"/&gt; &lt;/form&gt; Here's the JS: $(function() { $('#form').validate({ rules: { name: { required: true, minlength: 2 } }, messages: { name: { required: "Please enter your name", minlength: "Name should be more than 2 characters" } } }); window.setTimeout(function() { $("#form").show() }, 3000); }); If you run this, you will see the form is first invisible. Then after 3 seconds, becomes visible. This is the same setup as my popup form. What surprises me is the validations works! This goes against what I have been reading and what I've witnessed in my web project. Can anyone explain this?
possible better answer: http://stackoverflow.com/a/29686540
tagged with: jquery-validate
has answer: http://stackoverflow.com/a/29686540
answer count: 2
has title: jQuery Validate Non-Visible Fields
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47506532
favorite count: 0
linked to: http://stackoverflow.com/q/2623514
has answer: http://stackoverflow.com/a/29685180
score: 3
has comment: http://stackoverflow.com/comment/47510275
accepted answer: http://stackoverflow.com/a/29685180
has comment: http://stackoverflow.com/comment/47506953
upvote count: 3
type: Question

http://stackoverflow.com/q/29542839
has comment: http://stackoverflow.com/comment/47259310
tagged with: swipe
type: Question
has comment: http://stackoverflow.com/comment/47266510
has body: I'm using jQuery 1.9.2. I've been trying to add swiping functionality to my app, but nothing I do works. On Google's mobile emulator, nothing happens when I swipe. What am I missing? Here's the most vanilla example I could think of: &lt;script type="text/javascript"&gt; $('html').on("swipeleft",function() { $('html').html(""); }); &lt;/script&gt;
has comment: http://stackoverflow.com/comment/47253172
tagged with: javascript
tagged with: jquery
has title: jQuery swipe doesn't do anything
score: 0
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/47280650
has comment: http://stackoverflow.com/comment/47244448
has comment: http://stackoverflow.com/comment/47237469
favorite count: 0
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/47465259
type: Comment
type: QuestionComment
score: 2
has text: You should really attempt to boil this down to the minimum amount of code that produces the bug. Putting into a runnable environment like http://plnkr.co/ or http://jsfiddle.net would also help
comment on: http://stackoverflow.com/q/29662447

http://stackoverflow.com/comment/47452424
has text: @OmriAharon: Yes, your solution will work. But still unsolved are: ` ` I cannot tell validity checkers that my ` ` is not referencing a not existing id. Additionally I need to adapt my directive to include all possible attributes I need if new ones come up and I add a number of scope watches that do nothing but cost performance. Additionally the use of `ng-model` and `id` needs no documentation: Developers know those attributes. `myid` and `model` are different. It works, but it is not pretty...
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29590311
type: Comment

http://stackoverflow.com/q/29558533
has comment: http://stackoverflow.com/comment/47267233
type: Question
tagged with: google-maps
tagged with: asp.net-mvc
tagged with: javascript
has title: Google map markers are not displayed
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29558811
has body: I am displaying google map with markers.I have made a function called loadmap(); When i place this function into '$(document).ready(function () {})' then it works proper. But when i call the same function on button click event then markers are not loaded. Please give me any suggestion. &lt;script type="text/javascript"&gt; var map; var data = '@Model.LatLongList'; var markers = eval(JSON.parse(data.replace(/&amp;quot;/g, '"'))); var radiusRange = ""; var letter = ""; var myLatlng = ""; var marker = ""; var infoWindow; var zoomLevel = 10; $(document).ready(function () { debugger; var mapOptions = { center: new google.maps.LatLng(markers[0].Latitude, markers[0].Longitude), zoom: 10, mapTypeId: google.maps.MapTypeId.ROADMAP }; infoWindow = new google.maps.InfoWindow(); map = new google.maps.Map(document.getElementById("mapSerachResult"), mapOptions); //google.maps.event.addListener(map, 'idle', loadmap); }); function loadmap() { $("#tblSearchList").hide(); //document.getElementById('mapSerachResult').style.display = "block"; google.maps.event.trigger(map, 'resize'); debugger; for (i = 0; i &lt; markers.length; i++) { letter = String.fromCharCode("A".charCodeAt(0) + i); data = markers[i]; myLatlng = new google.maps.LatLng(data.Latitude, data.Longitude); marker = new google.maps.Marker({ position: myLatlng, map: map, title: data.PanelGroupName, icon: "http://maps.google.com/mapfiles/marker" + letter + ".png" }); (function (marker, data) { google.maps.event.addListener(marker, "mouseover", function (e) { }) }) (marker, data); } }
has answer: http://stackoverflow.com/a/29558683
type: UnansweredQuestion

http://stackoverflow.com/comment/47286968
has text: Thank you, I noticed it too after I posted it, but anyway , thank you. About the chaning code while running - any possibility how to do that?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29568780

http://stackoverflow.com/comment/47453751
type: QuestionComment
has text: Did you wait until document ready before initializing it with the jquery submit?
comment on: http://stackoverflow.com/q/29656395
score: 0
type: Comment

http://stackoverflow.com/a/29641675
score: 0
has body: How about using $scope.$watch, this function will be called every time the expiration is changed: $scope.$watch('expiration',function(newValue, oldValue){ if(newValue.length == 2) $scope.expiration = $scope.expiration +'/'; }); https://docs.angularjs.org/api/ng/type/$rootScope.Scope
type: Answer
answers question: http://stackoverflow.com/q/29641504

http://stackoverflow.com/comment/47574712
type: Comment
has text: Thanks :) I've been putting off learning game dev maths for a while ... I guess it's time
comment on: http://stackoverflow.com/a/29661390
score: 0
type: AnswerComment

http://stackoverflow.com/q/29570738
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
possible better answer: http://stackoverflow.com/a/29570758
has comment: http://stackoverflow.com/comment/47291046
accepted answer: http://stackoverflow.com/a/29584504
type: Question
answer count: 2
downvote count: 4
upvote count: 0
has comment: http://stackoverflow.com/comment/47291226
tagged with: javascript
has title: In Javascript, I have text data, need JSON data
favorite count: 0
has body: I asked a question (How can I request a webpage that is a .txt file?) about how to get a .txt file. Now that I have it, how do I turn it into JSON data?
linked to: http://stackoverflow.com/q/29569316
has comment: http://stackoverflow.com/comment/47291111
has comment: http://stackoverflow.com/comment/47291974
has comment: http://stackoverflow.com/comment/47290893
has comment: http://stackoverflow.com/comment/47317796
has comment: http://stackoverflow.com/comment/47290941
has answer: http://stackoverflow.com/a/29584504
has comment: http://stackoverflow.com/comment/47291020
score: -4
has answer: http://stackoverflow.com/a/29570758
tagged with: node.js
linked to: http://stackoverflow.com/q/29567703

http://stackoverflow.com/q/29681773
has answer: http://stackoverflow.com/a/29682053
possible better answer: http://stackoverflow.com/a/29681857
has answer: http://stackoverflow.com/a/29682051
has comment: http://stackoverflow.com/comment/47501977
has answer: http://stackoverflow.com/a/29681857
has comment: http://stackoverflow.com/comment/47500878
type: Question
has answer: http://stackoverflow.com/a/29681851
has comment: http://stackoverflow.com/comment/47501023
has comment: http://stackoverflow.com/comment/47501185
accepted answer: http://stackoverflow.com/a/29682051
has comment: http://stackoverflow.com/comment/47501157
has comment: http://stackoverflow.com/comment/47500796
has body: I've written the following two functions: &lt;script&gt; $('.tile').on('click', function () { $(".tile").addClass("flipOutX",1000).promise().done(function () { $(".tile-group.six").load("musability-musictherapy-company-overview.html"); }); }); &lt;/script&gt; The first one performs a transition on some tiles that lasts about 3 seconds, and even though I have included .promise and .done the second function still loads the html page right away instead of waiting for the effect/transition to finish. I was thinking of using a setTimeinterval to make the second function wait until the first one finishes but I don't know how to use that to accomplish my desired behavior. THE WHOLE CSS OF TRANSITIONS ON THE PAGE .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.two { -webkit-animation-delay: 120ms; animation-delay: 120ms; } .animated.three { -webkit-animation-delay: 320ms; animation-delay: 320ms; } .animated.four { -webkit-animation-delay: 520ms; animation-delay: 320ms; } .animated.five { -webkit-animation-delay: 720ms; animation-delay: 720ms; } .animated.six { -webkit-animation-delay: 920ms; animation-delay: 920ms; } .animated.seven { -webkit-animation-delay: 1020ms; animation-delay: 1020ms; } .animated.eight { -webkit-animation-delay: 1220ms; animation-delay: 1220ms; } .animated.nine { -webkit-animation-delay: 1620ms; animation-delay: 1620ms; } .animated.ten { -webkit-animation-delay: 1820ms; animation-delay: 1820ms; } .animated.eleven { -webkit-animation-delay: 2020ms; animation-delay: 2020ms; } .animated.twelve { -webkit-animation-delay: 2220ms; animation-delay: 2220ms; } @-webkit-keyframes flipInX { 0% { -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg); transform: perspective(400px) rotate3d(1, 0, 0, 90deg); -webkit-transition-timing-function: ease-in; transiti…
linked to: http://stackoverflow.com/q/29445014
score: 0
has title: Run one jQuery function after another one finishes effect
answer count: 5
has answer: http://stackoverflow.com/a/29682735
tagged with: timing
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery

google-oauth
type: Tag
tags question: http://stackoverflow.com/q/29637774
tags question: http://stackoverflow.com/q/29580202
tag name: google-oauth
tags question: http://stackoverflow.com/q/29674435

http://stackoverflow.com/comment/47373774
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29592770
has text: I think in this case the event is `force.drag`.
score: 0

http://stackoverflow.com/comment/47484510
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29673014
has text: I add e.preventDefault(); but now user can not delete input

http://stackoverflow.com/q/29647471
has answer: http://stackoverflow.com/a/29647526
type: AnsweredQuestion
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29647867
tagged with: dom
has answer: http://stackoverflow.com/a/29647867
type: Question
tagged with: browser
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/29647526
has body: I have read in http://www.w3schools.com/js/js_htmldom_nodes.asp that adding an element goes in two steps: * create in document object * add to the parent node. But when removing, I just remove from the parent node, and don't delete in the document object. Will there be a memory leak or something if I repeat creating, adding and removing?
has title: Remove DOM Node from a browser's document object

http://stackoverflow.com/comment/47272237
comment on: http://stackoverflow.com/a/29561120
type: AnswerComment
type: Comment
has text: BTW the function itself is available in all browsers, just ability to specify a locale and other specific options isn't supported in browsers like Safari.
score: 1

http://stackoverflow.com/comment/47411989
type: Comment
has text: Can you include the `#shippingAddressForm` css in your question.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29634205

http://stackoverflow.com/q/29595939
answer count: 1
tagged with: drop-down-menu
favorite count: 0
has comment: http://stackoverflow.com/comment/47338999
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/29596078
tagged with: css
has comment: http://stackoverflow.com/comment/47338818
has title: how to make div overlap another CSS?
score: 1
type: Question
downvote count: 0
tagged with: javascript
has body: I'm trying to make a sort of dropdown menu using list, but the list only shows partially, part of it is hidden by other divs. How can I make it overlap them?? HTML About Work Plus Costumers Gallery contact The CSS #mph1{ height:auto; }
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/47232452
comment on: http://stackoverflow.com/q/29540264
has text: `addClass` is instantaneous, unless there are some kind of `transition` defined within the CSS styles for that class, in which case you would need to remove those, or separate them to another class.
type: Comment
score: 4
type: QuestionComment

http://stackoverflow.com/comment/47267464
comment on: http://stackoverflow.com/q/29557042
has text: Yes that sounds OK. So status 200 and no body. I suggest you've got a problem at your server end that needs fixing. Use a packet sniffer or log your PHP responses to a file to inspect what you're sending out.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47286521
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29556487
has text: None of these strategies are going to help you if someone links to one of the pages from another site. Best approach IMHO is to use robots.txt for polite crawlers, IP blocking for known bad crawlers, and accept the fact that you won't get all of them.
score: 0

http://stackoverflow.com/a/29640468
type: Answer
has comment: http://stackoverflow.com/comment/47422765
upvote count: 1
score: 1
has body: Your a is a number. To be able to use the substring function, it has to be a string first, try var a = (Math.floor(100000 + Math.random() * 900000)).toString(); a = a.substring(-2);
has comment: http://stackoverflow.com/comment/47422735
downvote count: 0
answers question: http://stackoverflow.com/q/29640432

http://stackoverflow.com/comment/70726792
type: QuestionComment
type: Comment
has text: @GerardoNavarroSuarez better to ask this as your own question with your own code and explanation than to ask about a question I left a comment on almost two years ago. You'll get more eyes on it that way, and probably a better response than I can give you based on just a comment.
score: 1
comment on: http://stackoverflow.com/q/29545805

http://stackoverflow.com/a/29590876
has comment: http://stackoverflow.com/comment/47331567
has comment: http://stackoverflow.com/comment/47331630
upvote count: 1
has body: You can set data-id attribute on the div: &lt;div class="innerbox" data-id="&lt;?php echo $v['id']; ?&gt;"&gt; &lt;div class="imagebox"&gt;&lt;img src="&lt;?php echo $v['image'];?&gt;" /&gt;&lt;/div&gt; div class="namebox"&gt;&lt;?php echo $v["name"];?&gt;&lt;/div&gt; &lt;div class="pricebox"&gt;£&lt;?php echo $v["price"];?&gt;&lt;/div&gt; &lt;/div&gt; using jQuery you can easily get the data: $('.innerbox').click(function() { window.location.href = "product.php?id=" + $(this).data('id'); }); and in php you can access id using $_GET['id'] $sql = "SELECT name, description, price, image FROM shop WHERE id = " . intval($_GET['id']);
type: Answer
answers question: http://stackoverflow.com/q/29590841
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47331733
has comment: http://stackoverflow.com/comment/47331970

http://stackoverflow.com/q/29675611
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47489406
upvote count: 1
tagged with: php
has title: Angular http request missing post values
score: 1
has comment: http://stackoverflow.com/comment/47489108
has comment: http://stackoverflow.com/comment/47489113
has answer: http://stackoverflow.com/a/29676613
has comment: http://stackoverflow.com/comment/47489493
tagged with: httprequest
type: Question
linked to: http://stackoverflow.com/q/11442632
tagged with: javascript
has comment: http://stackoverflow.com/comment/47489219
has comment: http://stackoverflow.com/comment/47490454
has comment: http://stackoverflow.com/comment/47489440
tagged with: http-post
has comment: http://stackoverflow.com/comment/47488959
has comment: http://stackoverflow.com/comment/47489388
answer count: 1
downvote count: 0
has body: I'm making a http request where i need to send some values with it. Http request $http({ url: 'user_resources/delete.php', method: 'POST', data: { parent_state: parent_state, course_id: course_id, filename: material_to_delete.material.file_name } }); It runs the php file but the $_POST values aren't there. I've also tried to include headers: {'Content-Type': 'application/x-www-form-urlencoded'} in my http request but without any luck. Can somebody help me figure out what I'm doing wrong? Thank you in advance! Update Controller app.controller('CourseEditController', ['$http', '$scope','$sessionStorage','$state','$log','Session','api','$filter', function ($http, $scope, $sessionStorage, $state, $log, Session, api, $filter) { var course_id = $state.params.course_id; var parent_state = $state.$current.parent.name; $scope.deleteMaterial = function (idx) { var material_to_delete = $scope.course.course_has_materials[idx]; $http({ headers: {'Content-Type': 'application/x-www-form-urlencoded'}, url: 'user_resources/delete.php', method: 'POST', data: { parent_state: parent_state, course_id: course_id, filename: material_to_delete.material.file_name } }); }; }]); HTML ... {{ material.material.file_name }} {{ material.material.file_type }}
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/comment/47219161
type: Comment
has text: @JoshuaFrederic you'll have to incorporate both. JS AJAX > to > PHP
score: 0
comment on: http://stackoverflow.com/a/29532869
type: AnswerComment

http://stackoverflow.com/a/29537561
type: Answer
has body: EDIT: After much playing around I managed to pull the SVG part out and the string into seperate variables: $("document").ready(function() { $("p.mod-articles-category-readmore a").each(function() { var $svg = $(this).children().first().get(0); var $str = $.trim($(this).last().text()); $html = $str + $svg; $(this).html($html); }); }); Only issue when trying to reinject both back into the DOM, the variable containing the SVG dumps as a jquery object string. There is a JS fiddle here that might at least get you started.
score: 0
answers question: http://stackoverflow.com/q/29536892

http://stackoverflow.com/a/29675166
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29674447
has body: Two solutions Use type="button" in your button control Save or remove onclick="getPage('@(Url.Action("Save", "Carriers"))'), because the submit button take a post action in default . Save

html-table
tags question: http://stackoverflow.com/q/29683533
tag name: html-table
tags question: http://stackoverflow.com/q/29536289
tags question: http://stackoverflow.com/q/29602414
tags question: http://stackoverflow.com/q/29543059
tags question: http://stackoverflow.com/q/29629732
tags question: http://stackoverflow.com/q/29546348
tags question: http://stackoverflow.com/q/29609748
type: Tag
tags question: http://stackoverflow.com/q/29558173
tags question: http://stackoverflow.com/q/29621914
tags question: http://stackoverflow.com/q/29659738

http://stackoverflow.com/q/29559737
has comment: http://stackoverflow.com/comment/47269473
has comment: http://stackoverflow.com/comment/47269434
has answer: http://stackoverflow.com/a/29560022
accepted answer: http://stackoverflow.com/a/29560022
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47269465
upvote count: 2
score: 0
has body: I have this code: $('body').append("&lt;div class='foo'&gt;&lt;/div&gt;"); var test = $('.foo'); I can't find foo. What am I doing wrong here?
tagged with: jquery-selectors
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/47269338
favorite count: 0
has comment: http://stackoverflow.com/comment/47269903
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47269594
has comment: http://stackoverflow.com/comment/47269361
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47269607
has title: Find element by class after append()
downvote count: 2

http://stackoverflow.com/q/29598229
has comment: http://stackoverflow.com/comment/47343321
tagged with: javascript
has answer: http://stackoverflow.com/a/29598389
tagged with: inheritance
has comment: http://stackoverflow.com/comment/47343446
score: 0
has comment: http://stackoverflow.com/comment/47343503
has body: I know this question was answered so many times, but I am so confused about how to inherit (yes, inherit....again) two Javascript functions. Assumed that I have a class called 'Base' which is the one that I want to inherit; function Base(model) { var self=this; self._model=model; return self; } Base.prototype.modelName= function() { return self._model.Name; }; Then I create a new class call Foo. function Foo() { var self=this; self.hello=function() { return 'Hello World'; } return self; } What code should I add to the Foo class to be able to do something like this? var myModel={type:1, name:'My Model'}; var myObj=new Foo(myModel); var result= MyObj.modelName(); I know I should use the object.create() method, but I cannot understand exactly how! :( Thank you guys, and again sorry for this silly question.....I am really struggling with this basic concept here!!!!
duplicate of: http://stackoverflow.com/q/13040684
answer count: 1
has comment: http://stackoverflow.com/comment/47342924
has comment: http://stackoverflow.com/comment/47343449
favorite count: 0
linked to: http://stackoverflow.com/q/13040684
accepted answer: http://stackoverflow.com/a/29598389
has comment: http://stackoverflow.com/comment/47343368
upvote count: 1
has comment: http://stackoverflow.com/comment/47343480
linked to: http://stackoverflow.com/q/816071
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/3079887
linked to: http://stackoverflow.com/q/4152931
downvote count: 1
has title: Javascript function Inheritance
type: Question
has comment: http://stackoverflow.com/comment/47343185
has comment: http://stackoverflow.com/comment/47343499

http://stackoverflow.com/comment/47341223
has text: I don't have any idea. I don't know how your server-side code works.
comment on: http://stackoverflow.com/q/29593230
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/29598080
type: Answer
upvote count: 1
has body: There are a number of different strategies for dealing with conflicting edits. Which to use depends upon a lot of things including the infrastructure you're using (e.g. type of data store), the frequency of conflict, the need or lack of need to save both edits, whether you can use a locking system, etc... In any case, here are some possible strategies: Lock Before Change. Before editing, require a user to "lock" a resource and when the resource is locked, do not allow any other user to try to edit it. You will have to invent some method of expiring a lock if the client never releases the lock (e.g. timeout). Lock During Update. Version check when retrieve/save. Reject edits that occurred during a conflict. When a client gets a version that they wish to edit, it also gets a version number. When submitting an edit, it also submits the version number that it thinks that it edited. If the version in the repository has since changed, then a conflicting edit may have occurred and the edit can be rejected. Lock During Update. Version check when retrieve/save. Merge edits that occurred during a conflict. When a client gets a version that they wish to edit, it also gets a version number. When submitting an edit, it also submits the version number that it thinks that it edited. If the version in the repository has since changed, then a conflicting edit may have occurred and the server can attempt to merge the edits or if a merge fails, then the edit can be rejected. Lock During Update. Version check when retrieve/save. Save both versions during a conflict. When a client gets a version that they wish to edit, it also gets a version number. When submitting an edit, it also submits the version number that it thinks that it edited. If the version in the repository has since changed, then a conflicting edit may have occurred and both edited versions can be saved. (This is what EverNote does if two clients try to save conflicting edits to the same note). Reads and Writes to your da…
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/29597197

http://stackoverflow.com/comment/47467580
type: QuestionComment
has text: yup. do note that you don't need to over-specify _async_ on js-generated script tags, the behavior is the same with or without. you could have them use async and put the tag at the bottom of the body, where it won't stop rendering (but will still delay onload for old IE users, if anyone cares).
comment on: http://stackoverflow.com/q/29663906
score: 1
type: Comment

http://stackoverflow.com/comment/47409314
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29632893
type: Comment
has text: no worries. welcome to SO :) we always need good helpers/coders to be around ;)

http://stackoverflow.com/a/29559426
has comment: http://stackoverflow.com/comment/47273148
type: Answer
answers question: http://stackoverflow.com/q/29558938
has comment: http://stackoverflow.com/comment/47268892
accepted answer of: http://stackoverflow.com/q/29558938
has body: @RobG convinced me to rewrite your piece of code using a real object definition. JsFiddle here. var sleeper = { text: document.getElementById("text"), eat: function (kind) { text.innerHTML += " Eat " + kind + " "; return this; }, sleep: function (delay, func, param) { setTimeout(function () { func(param); //text.innerHTML += " Sleep " + delay + " "; }, delay); return this; }, hello: function (str) { text.innerHTML += " Hello, " + str + " "; return this; } }; sleeper.hello("guy").sleep(3000, sleeper.eat, "dinner"); It's way much better. But this way you won't be abble to perform a chain of more than one call.
has comment: http://stackoverflow.com/comment/47271694
score: 0
has comment: http://stackoverflow.com/comment/47269051
type: AcceptedAnswer

http://stackoverflow.com/a/29614379
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/47410613
has comment: http://stackoverflow.com/comment/47375897
answers question: http://stackoverflow.com/q/29613564
has body: First off you need to fix the 404 error for the jquery map. Google and find a download. Then you need to fix your javascript error in this file: main_part_1_npm_3.js

http://stackoverflow.com/comment/47484069
type: AnswerComment
comment on: http://stackoverflow.com/a/29670306
has text: You will have to enter the HTML into the array, which is being converted to JSON. $array = array(" ".$searchResult." "); json_encode($array);... Please remember to accept the answer as correct. Thank you.
type: Comment
score: 0

http://stackoverflow.com/q/29637536
score: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29722411
has body: My form is simple. It uses ng-flow to handle file uploads: &lt;form class="form-horizontal" enctype="multipart/form-data"&gt; &lt;div flow-init="{target: '/test', testChunks: false, query: {'_csrf': '{{csrf}}', 'somestring': 'teststring'} }" flow-files-submitted="data.flow.upload()" flow-name="data.flow"&gt; &lt;input type="file" flow-btn/&gt; &lt;/div&gt; &lt;/form&gt; Once an image is selected, ng-flow will do a POST to the target route. It seems like the image was sent since the Request Payload has a bunch of things like: 1048576 ------WebKitFormBoundaryw2YAG9m602ICPd0Q Content-Disposition: form-data; name="flowCurrentChunkSize" The image isn't very big (~1MB) On the nodejs side (with express): var busboy = require('connect-busboy')({ limits: { fileSize: 10 * 1024 * 1024 } }); router.post('/test', busboy, function(req, res) { console.log('test called'); console.log(req.busboy); if (req.busboy) { req.busboy.on('file', function(fieldname, file, filename, encoding, mimetype) { console.log("this is fieldname: " + fieldname); }); req.busboy.on('field', function(fieldname, val, fieldnameTruncated, valTruncated) { console.log('Field [' + fieldname + ']: value: ' + inspect(val)); }); } res.json(); }); req.busboy returns an object full of things, but req.busboy.on('file'... and req.busboy.on('field'...) never trigger. Why isn't busboy seeing my strings and images?
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: express
favorite count: 0
tagged with: busboy
has answer: http://stackoverflow.com/a/29722411
has title: busboy won't receive uploaded files
upvote count: 2
tagged with: node.js

robots.txt
tags question: http://stackoverflow.com/q/29556487
type: Tag
tag name: robots.txt

http://stackoverflow.com/comment/47383581
has text: I think I made a mistake. It's not ajax load but rather the fact the text area losing focus. If it's merely the DOM change then going to inbox would also unhide the cursor.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29619558
score: 1

http://stackoverflow.com/a/29654534
type: AcceptedAnswer
downvote count: 0
score: 4
accepted answer of: http://stackoverflow.com/q/29654403
answers question: http://stackoverflow.com/q/29654403
type: Answer
has comment: http://stackoverflow.com/comment/47460987
has body: You can use the HTML5 elements: select{ border: none; appearance: none; color: red; } select option{ color: red; } DEMO HERE Note: Currently there is no way to apply css(hover) in the option to get your desired result
upvote count: 4

http://stackoverflow.com/q/29590412
tagged with: php
tagged with: handshake
answer count: 1
has comment: http://stackoverflow.com/comment/47329136
has comment: http://stackoverflow.com/comment/47327894
score: 2
downvote count: 0
tagged with: websocket
tagged with: javascript
type: UnansweredQuestion
favorite count: 0
has body: I've coded websocket server/client with PHP and it worked for me during 2 years. Now it is not working, saying: Error during WebSocket handshake: Incorrect 'Sec-WebSocket-Accept' header value My clientside code is essentially this: socket = new WebSocket("ws://&lt;?= EVENT_SERVER_ADDR ?&gt;:"+EVENT_SERVER_PORT+"&lt;?= EVENT_SERVER_WWW_PATH ?&gt;"); PHP serverside code is this: list ($resource, $host, $connection, $version, $origin, $key, $protocol, $upgrade) = $this-&gt;getheaders ($buffer); $this-&gt;log ("Handshaking..."); $reply = "HTTP/1.1 101 Switching Protocols\r\n" . "Upgrade: {$upgrade}\r\n" . "Connection: {$connection}\r\n" . "Sec-WebSocket-Version: {$version}\r\n" . "Sec-WebSocket-Origin: {$origin}\r\n" . "Sec-WebSocket-Location: ws://{$host}{$resource}\r\n" . "Sec-WebSocket-Accept: " . $this-&gt;calcKey ($key) . "\r\n"; if ($protocol) $reply .= "Sec-WebSocket-Protocol: $protocol\r\n"; $reply .= "\r\n"; // Closes the handshake socket_write ($user-&gt;socket, $reply, strlen ($reply)); function calcKey ($key) { // Constant string as specified in the ietf-hybi-17 draft $key .= "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; $key = sha1 ($key, true); // $key = pack ('H*', $key); // should I uncomment this line? $key = base64_encode ($key); return $key; } function getheaders ($buffer) { $resource = $host = $connection = $version = $origin = $key = $protocol = $upgrade = null; preg_match ('#GET (.*?) HTTP#', $buffer, $match) &amp;&amp; $resource = $match[1]; preg_match ("#Host: (.*?)\r\n#", $buffer, $match) &amp;&amp; $host = $match[1]; preg_match ("#Connection: (.*?)\r\n#", $buffer, $match) &amp;&amp; $connection = $match[1]; preg_match ("#Sec-WebSocket-Version: (.*?)\r\n#", $buffer, $match) &amp;&amp; $version = $match[1]; preg_match ("#Origin: (.*?)\r\n#", $buffer, $match) &amp;&amp; $origin = $match[1]; preg_match ("#Sec-WebSocket-Key:\s*(.*?)\r\n#", $buffer, $match) &amp;&amp; $key = $match[1]; preg_match ("#Sec-WebSocket-Protocol:\s*(.*?)\r\n#", $buffer, $match) &…
type: Question
has comment: http://stackoverflow.com/comment/47328754
has title: Error during WebSocket handshake: Incorrect 'Sec-WebSocket-Accept' header value with PHP
has comment: http://stackoverflow.com/comment/47328730
upvote count: 2
has answer: http://stackoverflow.com/a/30109228

facebook
tags question: http://stackoverflow.com/q/29663125
tags question: http://stackoverflow.com/q/29626314
type: Tag
tags question: http://stackoverflow.com/q/29540308
tags question: http://stackoverflow.com/q/29536081
tags question: http://stackoverflow.com/q/29554488
tags question: http://stackoverflow.com/q/29546130
tags question: http://stackoverflow.com/q/29612497
tags question: http://stackoverflow.com/q/29600542
tags question: http://stackoverflow.com/q/29545506
tags question: http://stackoverflow.com/q/29552814
tags question: http://stackoverflow.com/q/29541890
tags question: http://stackoverflow.com/q/29664191
tags question: http://stackoverflow.com/q/29578712
tags question: http://stackoverflow.com/q/29672026
tags question: http://stackoverflow.com/q/29609173
tag name: facebook
tags question: http://stackoverflow.com/q/29539454
tags question: http://stackoverflow.com/q/29655830
tags question: http://stackoverflow.com/q/29544176
tags question: http://stackoverflow.com/q/29545689
tags question: http://stackoverflow.com/q/29558688
tags question: http://stackoverflow.com/q/29665790
tags question: http://stackoverflow.com/q/29667665
tags question: http://stackoverflow.com/q/29641210
tags question: http://stackoverflow.com/q/29534115
tags question: http://stackoverflow.com/q/29556173
tags question: http://stackoverflow.com/q/29680614
tags question: http://stackoverflow.com/q/29672786

http://stackoverflow.com/comment/47366207
type: Comment
has text: @braw - I've modified my answer to what I think you want and included a jsFiddle. You want the start point (e.g. the rotation) of each segment to be the running total of everything that came before NOT counting the current value.
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29610174

http://stackoverflow.com/a/29679934
has comment: http://stackoverflow.com/comment/47497437
has comment: http://stackoverflow.com/comment/47497921
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47497312
has comment: http://stackoverflow.com/comment/47497286
has comment: http://stackoverflow.com/comment/47497647
has body: Well, there are two things here - the difference between a keypress and a real user originating keyPress and there's why your code isn't working. Why your code isn't working Let's start with why your code isn't working - Angular knows how to update its DOM through something called the digest cycle. It does this by having every Angular system function schedule a digest if one is not already in progress. Your code needs to simulate this by calling $rootSCope.$apply(). Also, consider not manipulating the DOM with jQuery but using Angular instead for the task - change the value #username is binding to in the controller scope. As for the difference One is a trusted DOM event and the other is not - although that's not a big deal or the causing factor of your issue. Some interactions with the DOM will not happen when you trigger an event but will happen with a real user interaction - this is a security feature that does not kick into play here.
answers question: http://stackoverflow.com/q/29679813
downvote count: 0

http://stackoverflow.com/comment/47353941
comment on: http://stackoverflow.com/q/29604121
type: Comment
type: QuestionComment
has text: Neither JavaScript's `forEach` nor `filter` does what you're doing in the case of an object that isn't array-like (nor do they limit themselves to arrays, just things that are array-*like*). If you want to know exactly what they do, the [spec is fairly clear](http://www.ecma-international.org/ecma-262/5.1/#sec-15.4.4.18). The parts of your functions that handle arrays are reasonably on-target, although there are lots of details that are slightly different. Probably the most significant difference is that JavaScript's version doesn't call the callback for entries that don't exist.
score: 2

http://stackoverflow.com/comment/47321728
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29586712
has text: Are you sure the $(window).scroll function is working? Maybe try adding a console.log(scroll) to check what the value of scroll is? I tried your code and it works for me locally.
score: 0

http://stackoverflow.com/q/29617301
tagged with: php
has body: I generate and save .pdf bills on my server. The files are saved in a "reciept" folder and they look like this: vydej38_1.pdf vydej38_2.pdf vydej38_3.pdf I create them dynamically by connecting a contract id (38) to the string and then adding "_1". If I create the file again and it exists, I increment the 1 so I get "_2" etc. I do all of this in controller in PHP. But now I need to create download links for those files. I can do it for just one file like this Download But how can I create the download links dynamically according to the number of files and their names?
has title: How to dynamically create download links to files saved on server?
tagged with: model-view-controller
score: 1
type: Question
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47380048
has comment: http://stackoverflow.com/comment/47379457
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29617672
favorite count: 0
has comment: http://stackoverflow.com/comment/47379532
downvote count: 0
has comment: http://stackoverflow.com/comment/47379500
type: UnansweredQuestion

http://stackoverflow.com/comment/47511370
comment on: http://stackoverflow.com/a/29679287
score: 0
type: AnswerComment
type: Comment
has text: No, I specifically want to create objects that inherit from a common parent prototype, but that can also be applied to arguments as a function. Thank you!

http://stackoverflow.com/a/29543494
has comment: http://stackoverflow.com/comment/47241027
has comment: http://stackoverflow.com/comment/47265395
has comment: http://stackoverflow.com/comment/47265438
has comment: http://stackoverflow.com/comment/47240342
score: 2
has comment: http://stackoverflow.com/comment/47264563
answers question: http://stackoverflow.com/q/29543095
downvote count: 0
has body: To retrieve your field, you need to use : request.param("url") And your file with var file = request.file("xlsx_file_to_import");
upvote count: 2
has comment: http://stackoverflow.com/comment/47241121
type: Answer
has comment: http://stackoverflow.com/comment/47239782
has comment: http://stackoverflow.com/comment/47265527
has comment: http://stackoverflow.com/comment/47239865
has comment: http://stackoverflow.com/comment/47264632
has comment: http://stackoverflow.com/comment/47241262

http://stackoverflow.com/comment/47297294
type: Comment
comment on: http://stackoverflow.com/a/29574184
has text: With that data structure, no. It shouldn't be a problem if you have a *whole lot* of array elements.
type: AnswerComment
score: 0

http://stackoverflow.com/a/29632874
has body: Your form is probably still trying to submit the normal way because you aren't properly intercepting it. Add an Id to your form. &lt;form id="myForm" method="post" action=""&gt; Change your code to the below and give it a shot. What we're doing is intercepting the form submit and preventing the default action. $("#myForm").submit(function(event){ $.ajax({ cache: false, url: 'php/login.php', type: 'POST', dataType: 'json', data: { uname: $('#uname').val(), pass: $('#pass').val() }, success: function (data) { Cookies.set('uid', data[0].uid); alert("test"); }, error: function (xhr, status) { alert("Sorry, there was a problem!"); }, }); event.preventDefault(); });
type: Answer
score: 1
accepted answer of: http://stackoverflow.com/q/29632711
upvote count: 1
answers question: http://stackoverflow.com/q/29632711
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/29656904
has title: In Javascript, can you make a function return the value of evaluating other function based on conditionals?
has comment: http://stackoverflow.com/comment/47454440
has answer: http://stackoverflow.com/a/29657599
tagged with: google-apps-script
has comment: http://stackoverflow.com/comment/47454726
has body: I tried asking the question in a simplified form and ended up being impossible to understand. I rewrote the question with the real case to make it meaningful. I am writing a Google Apps Script in which I am using a self-made library to handle common tasks. Can I call a helper function from another function (in this case, the doGet() function which is called as a standard http request when you publish the app), and evaluate its return value in the outer scope? To be clear, I want doGet(e) to return the result of Security.permissionGateway (TARS_Errors.throwErrorPage(403)) if the "testgroup" doesn't have the proper permissions. Otherwise, I want it to render "HI THERE". And this is because what the doGet(e) function returns is what is rendered in the browser. .throwErrorPage() function returns this: return html.evaluate() .setTitle(code) .setSandboxMode(HtmlService.SandboxMode.IFRAME); Maybe I am missing something very basic, but I am kinda lost here :\ function A: function doGet(e) { TARS.Security.permissionGateway("testgroup"); return HtmlService.createHtmlOutput("HI THERE"); } function B: Security.permissionGateway = function(group) { if (!Security.activeUserBelongsToGroup(group)) { return TARS_Errors.throwErrorPage(403); } } Sorry if it is not so clear, but what I am really trying to explain is, how can I make THIS: function doGet(e) { TARS.Security.permissionGateway("testgroup"); return HtmlService.createHtmlOutput("HI THERE"); } Behave like THIS: function doGet(e) { if (!Security.activeUserBelongsToGroup(group)) { return TARS_Errors.throwErrorPage(403); } return HtmlService.createHtmlOutput("HI THERE"); } I am very sorry about my other post and putting up a horrible example.
tagged with: javascript
has answer: http://stackoverflow.com/a/29657661
favorite count: 0
has answer: http://stackoverflow.com/a/29657737
type: Question
has answer: http://stackoverflow.com/a/29664397
score: 0
has comment: http://stackoverflow.com/comment/47456420
upvote count: 1
has comment: http://stackoverflow.com/comment/47466457
downvote count: 1
has answer: http://stackoverflow.com/a/29657688
has comment: http://stackoverflow.com/comment/47467195
answer count: 5
type: UnansweredQuestion

http://stackoverflow.com/q/29589730
has comment: http://stackoverflow.com/comment/56037680
has title: How to filter Google Map Markers with Knockout.js
tagged with: http://stackoverflow.com/tag/html
answer count: 1
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/29557938
tagged with: knockout.js
type: Question
tagged with: google-maps
has answer: http://stackoverflow.com/a/45113604
tagged with: javascript
tagged with: jquery
has body: I am trying to filter Map Markers via a input box. I want to do a full text sort on the markers on map markers name property. //JS I thought I could add the markers to an array and try and clear them but it its not working. here is my markers array. this.markers = ko.observableArray([]); //Create array of hotspot locations this.hotSpotList = ko.observableArray([]); This adds my "hotSpot" objects to the array of hotspots initialHotSpots.forEach(function(spot){ self.hotSpotList.push(new hotSpot(spot)); }); This is the filter string that is being searched against the hotSpots name property. this.filter = ko.observable(""); This is the computed value of the filtered array. This part works because I can sort a list of my arrays using a foreach data-bind on the view. this.searchLocation = ko.computed(function() { var filter = this.filter().toLowerCase(); if (!filter) { return this.hotSpotList(); } else { return ko.utils.arrayFilter(this.hotSpotList(), function(item){ return item.name().toLowerCase().indexOf(filter) != -1; }); } }, this); This is creating the google map. var mapOptions = { center: new google.maps.LatLng(39.203714,-76.861046), zoom: 13, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById('map'), mapOptions); var infoWindow = new google.maps.InfoWindow; var marker , i; var contentString = ""; var makers var url = "" ; This is my first attempt at trying to clear the markers before I add the new set. It just wipes them out so far and they dont show up again. // this.clearLocations = function() { // for (var i = 0; i < this.markers.length; i++) { // makers[i].setMap(null) // } // } I thought if I just subscribed to the searchLocation arrays It would remove the old markers and create new ones. It works but only the first time then it does not sort the markers again if the text filter string changes. this.searchLocation.subscribe(function() { //Initialize marker and infowindow console.log('changed'); for (i = 0; i < s…
score: 0

http://stackoverflow.com/q/29588317
has answer: http://stackoverflow.com/a/29588434
tagged with: jquery
favorite count: 0
has body: Recently i switched to materialize (it's based on Bootstrap i guess) and i'm trying to make modal work. it just doesn't show up. the button is there but it triggers nothing. I'm using starter template from Materialize website. All i did was copy and paste modal code from Materialize modal page. I put the code in starter template but it doesn't work. i also tested it on another theme based on materialize but that didn't work either. also jQuery is loaded properly. edit: it's index.html Starter Template - Materialize Logo Navbar Link Navbar Link Starter Template A modern responsive front-end framework based on Material Design Modal Modal Header A bunch of text Agree Speeds up development We did most of the heavy lifting for you to provide a default stylings that incorporate our custom components. Additionally, we refined animations and transitions to provide a smoother experience for developers. User Experience Focused By utilizing elements and principles of Material Design, we were able to create a framework that incorporates components and animations that provide more feedback to users. Additionally, a single underlying responsive system across all platforms allow for a more unified user experience. Easy to work with We have provided detailed documentation as well as specific code examples to help new users get started. We are also always open to feedback and can answer any questions a user may have about Materialize. Company Bio We are a team of college students working on this project like it's our full time job. Any amount would help support and continue development on this project and is greatly appreciated. Settings Link 1 Link 2 Link 3 Link 4 Connect Link 1 Link 2 Link 3 Link 4 Made by Materialize modal code: Modal Modal Header A bunch of text Agree Here's a demo of Starter template Here's download link of template
has title: Materialize Modal doesn't work on starter template
tagged with: materialize
upvote count: 10
possible better answer: http://stackoverflow.com/a/41341607
tagged with: templates
type: AnsweredQuestion
downvote count: 0
score: 10
has answer: http://stackoverflow.com/a/41341607
accepted answer: http://stackoverflow.com/a/29588434
type: Question
answer count: 2
tagged with: modal-dialog
tagged with: javascript

http://stackoverflow.com/q/29588480
upvote count: 1
type: Question
downvote count: 0
tagged with: javascript
has title: getElementsByTagName() method doesnt work as expected
has comment: http://stackoverflow.com/comment/47324303
has answer: http://stackoverflow.com/a/29588497
favorite count: 0
linked to: http://stackoverflow.com/q/15763358
tagged with: twitter-bootstrap
has body: I'm trying to simply change the text inside all elements with this code from this I expect work to appear on the page, but the result is just a blank page with no text. why?
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29588761
has answer: http://stackoverflow.com/a/29588506
accepted answer: http://stackoverflow.com/a/29588506
has answer: http://stackoverflow.com/a/29588503
answer count: 4
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29588497
score: 1

http://stackoverflow.com/comment/47320358
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29585883
has text: ex: `contentPromise.then(console.log);`

http://stackoverflow.com/q/29603903
has comment: http://stackoverflow.com/comment/47354224
tagged with: highcharts
tagged with: javascript
has title: Export Highcharts to jsPDF - canvg error
tagged with: jspdf
answer count: 2
has answer: http://stackoverflow.com/a/31346265
upvote count: 1
has comment: http://stackoverflow.com/comment/47395200
has answer: http://stackoverflow.com/a/46298824
favorite count: 0
has comment: http://stackoverflow.com/comment/47676657
has comment: http://stackoverflow.com/comment/47397990
has comment: http://stackoverflow.com/comment/47353444
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47396074
has body: I'm looking for a solution about highcharts export to PDF with jsPDF. I used this solution to export my graph as image to my pdf -> Export Highcharts to PDF (using javascript and local server - no internet connection) It's working fine, but for some graph i could not generate the image because of this error : Uncaught TypeError: undefined is not a function -- canvg.js:2000 svg.Element.text.getAnchorDelta -- canvg.js:2010 svg.Element.text.renderChild -- canvg.js:1989 svg.Element.text.renderChildren -- canvg.js:679 svg.Element.ElementBase.render -- canvg.js:698 svg.Element.ElementBase.renderChildren -- canvg.js:679 svg.Element.ElementBase.render -- canvg.js:698 svg.Element.ElementBase.renderChildren -- canvg.js:679 svg.Element.ElementBase.render -- canvg.js:2723 svg.loadXmlDoc.draw -- canvg.js:2733 svg.loadXmlDoc -- canvg.js:2646 svg.loadXml -- canvg.js:62 canvg -- indicateurs.js:3237 $.bind.H.Chart.createCanvas -- indicateurs.js:3171 (anonymous function) -- jquery-1.10.2.min.js:4 x.extend.each -- indicateurs.js:3164 _indicateurs.hightcharts.graph_to_pdf -- indicateurs.js:3262 (anonymous function) -- jquery-1.10.2.min.js:5 x.event.dispatch -- jquery-1.10.2.min.js:5 x.event.add.v.handle Following, the canvas method throwing the error (canvg.js) : this.getAnchorDelta = function (ctx, parent, startI) { var textAnchor = this.style('text-anchor').valueOrDefault('start'); if (textAnchor != 'start') { var width = 0; for (var i=startI; i&lt;parent.children.length; i++) { var child = parent.children[i]; if (i &gt; startI &amp;&amp; child.attribute('x').hasValue()) break; // new group width += child.measureTextRecursive(ctx); // ######## PROBLEM LOCATED ON THIS LINE } return -1 * (textAnchor == 'end' ? width : width / 2.0); } return 0; } Any first ideas about what could be make this error ?
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47353699
tagged with: canvg
has comment: http://stackoverflow.com/comment/47353950
type: Question
linked to: http://stackoverflow.com/q/25630811
tagged with: canvas

http://stackoverflow.com/q/29588404
has comment: http://stackoverflow.com/comment/47324474
has comment: http://stackoverflow.com/comment/47324447
tagged with: sprite
type: Question
has comment: http://stackoverflow.com/comment/47324211
has comment: http://stackoverflow.com/comment/47324556
has comment: http://stackoverflow.com/comment/47324339
duplicate of: http://stackoverflow.com/q/4467539
tagged with: rotation
has comment: http://stackoverflow.com/comment/47324562
has body: I am writing a game in HTML5 and having problems with a piece of Javascript to do with the conversion of radians to degrees. Currently my sprite is turned when the left and right keys on the keyboard are pressed/held down. The framework I am using outputs the rotation value in radians however the number can go above/below 1 and -1. Each time the right key applies a +0.05 to the rotation value and -0.05 from the left key. Everything works fine when I constantly rotate clockwise (right key) using the following code: game.player.rotationdeg = (ship.rotation * (180/Math.PI)) % 360; Even if I go through a full rotation over 360 degrees the resulting degrees start back at 0 and continues to provide the correct angle. When I go counter clockwise and the rotation value goes below 0 then things go out of whack. Instead of 270 degrees I get -90. This is causing me a lot of time and stress and I would appreciate any assistance. I believe I might be able to check if the result is a negative and then just minus it from 360 but I am unsure of where to put that in the code I have or if it needs a separate function to work it out. I believe it might just be a problem with how I am approaching the situation.
tagged with: javascript
linked to: http://stackoverflow.com/q/4467539
has comment: http://stackoverflow.com/comment/47324357
score: 0
has comment: http://stackoverflow.com/comment/47324602
has comment: http://stackoverflow.com/comment/47324588
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47324634
has title: Using Javascript to convert radians to degrees with positive and negative values
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/47465958
score: 2
has text: I can't give you the specifics, but it might be an option to use a single click event handler on the svg element then you some sort of coordinate system to determine what was clicked using your own predefined rules
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29663196

http://stackoverflow.com/q/29575052
downvote count: 1
type: Question
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/29575118
score: 0
answer count: 3
accepted answer: http://stackoverflow.com/a/29575098
has body: How to count empty input text fields amount.. i have written this code to count empty fields. this works fine on fields with pre-loaded value. but after i type something in other text fields and try the function again it gives the same result of "2". it seems function is neglecting the values which have added after the loading. how can i improve this to work fine with even after typing texts in fields after the html is loaded? *i searched on stack and found no good answers for this question. $(document).on("click", ".pool", function() { var count = $('.option[value=""]').length; alert(count); }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div id="optionlist"&gt; &lt;input type="text" class="option form-control" value="bla bla"&gt; &lt;input type="text" class="option form-control" value=""&gt; &lt;input type="text" class="option form-control" value=""&gt; &lt;/div&gt;
duplicate of: http://stackoverflow.com/q/10486716
has answer: http://stackoverflow.com/a/29575118
favorite count: 0
has answer: http://stackoverflow.com/a/29575094
has answer: http://stackoverflow.com/a/29575098
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/10486716
upvote count: 1
has title: How to count empty input text fields amount?

http://stackoverflow.com/a/29607910
has comment: http://stackoverflow.com/comment/47361765
has body: OK, I'll answer the narrower part of your question. Node.js has indeed a single thread for the JavaScript engine, but it uses multiple threads for handling asynchronous actions such as… database (and other) I/O. It could very well ask two of its threads connect to the database to edit the same document at the same time. Look here: Does node.js use threads/thread pool internally? So no, Node doesn't save you from race conditions on async operations. MongoDB does, to some extent (for which you really should read the documentation because it's a complex topic).
downvote count: 0
has comment: http://stackoverflow.com/comment/47364332
answers question: http://stackoverflow.com/q/29607453
type: Answer
has comment: http://stackoverflow.com/comment/47361537
upvote count: 3
score: 3
has comment: http://stackoverflow.com/comment/47367175

http://stackoverflow.com/comment/47384955
type: Comment
type: QuestionComment
has text: What exactly is your issue?
score: 1
comment on: http://stackoverflow.com/q/29620306

http://stackoverflow.com/a/29642606
has body: Your markup is invalid, Though you want to make it working then try to couple the event with li also. In addition to that you have to use .closest() with this to grab the relevant a tag, $(document).ready(function(){ //initial $("#active").css("left", $("#a1").offset().left); $("#navul").on("mouseover","a,li" ,function(){ $(this).closest('a').html('&lt;li&gt;&lt;img src="img/00'+$(this).attr('num')+'a.png"&gt;&lt;/li&gt;'); //$("#active").stop().animate({left: $(this).offset().left},400); }); $("#navul").on("mouseout","a,li" ,function(){ $(this).closest('a').html('&lt;li&gt;&lt;img src="img/00'+$(this).attr('num')+'.png"&gt;&lt;/li&gt;'); }); });
type: Answer
answers question: http://stackoverflow.com/q/29642528
score: 0
has comment: http://stackoverflow.com/comment/47426486
has comment: http://stackoverflow.com/comment/47426506
has comment: http://stackoverflow.com/comment/47427632

http://stackoverflow.com/q/29559669
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29560035
accepted answer: http://stackoverflow.com/a/29559894
has title: How to show error status after click the next button in javascript?
score: 0
upvote count: 1
possible better answer: http://stackoverflow.com/a/29559973
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29559973
has body: It show error status when I am typing email address, I need to show error status after click the next button, and also I added "more view friends" link, I set when I click "more view friends" link, it will show one more textboxes at each link. Now the error status show only first 5 textboxes.. and it didn't work other textboxes which is got by clicked link. But in my jsfiddle link, "invite more friends" link didnt work, but in webpage it works fine. javascript: $(document).ready(function() { var container = $(document.createElement('div')).css({ padding: '5px', margin: '0'}); for (i = 0; i &lt; 4; i++) { $(container) .append('&lt;div&gt;&lt;input type="text" class="input" id="tb'+i+'" placeholder="Email" /&gt;&lt;/div&gt;'); } $('#main').before(container); $("input", container).keyup(function() { validateEmail($(this)); }); var iCnt = 4; function validateEmail(el) { if (!isValidEmail($(el).val())) { $(el).parent().addClass('invalid'); return false; } else { $(el).parent().removeClass('invalid'); return true; } } }); var divValue, values = ''; function GetTextValue() { $(divValue).empty(); $(divValue).remove(); values = ''; $('.input').each(function() { divValue = $(document.createElement('div')).css({ padding:'5px', width:'200px' }); values += this.value.trim(); } }); document.all.contact_list.value = values; } May i know, what is my mistake, how to fix this? thanks in advance.
has comment: http://stackoverflow.com/comment/47269385
tagged with: javascript
answer count: 6
has answer: http://stackoverflow.com/a/29560238
has answer: http://stackoverflow.com/a/29559919
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29559894
has answer: http://stackoverflow.com/a/29559796
tagged with: css

http://stackoverflow.com/a/29621347
has body: I recommend that you use ajaxForm plugin and in the autosave function just fire $('form').submit(); this is the fast and good way
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/47386978
downvote count: 1
answers question: http://stackoverflow.com/q/29621214
has comment: http://stackoverflow.com/comment/47386760
has comment: http://stackoverflow.com/comment/47386955
score: 0
has comment: http://stackoverflow.com/comment/47387062

http://stackoverflow.com/q/29612707
score: 0
has comment: http://stackoverflow.com/comment/47383467
answer count: 1
tagged with: graphics
accepted answer: http://stackoverflow.com/a/29623618
type: AnsweredQuestion
tagged with: highcharts
tagged with: javascript
type: Question
has title: Define yAxis value with two different yAxis scale highcharts
has answer: http://stackoverflow.com/a/29623618
has body: Hello I have a chart with Highcharts, it's a line chart with two different yAxis. The left one graphics % and the right one minutes. I want to "hardcode" the left to be in this scale "0%, 20%, 40%, 60%, 80%, 100%" This is my code var chartTot = { chart: { renderTo: 'grafTot', type: 'line', marginBottom: 110, }, legend: { itemDistance: 20, itemWidth: 190 }, title: { text: '' }, plotOptions: { series: { marker: { enabled: false } } }, xAxis: { categories: $scope.hours }, yAxis: [{ //1st yAxis title: { text: 'Clients %' }, min: 0, // I want my graphic 0 to 100 but with this i get max: 100, // 0- 120 because of the second axis labels: { format: '{value} %', }, }, { //2nd yAxis title: { text: 'Minutes' }, min: 0, max: 60, labels: { format: '{value} min', style: { color: Highcharts.getOptions().colors[6] } }, opposite: true } ] }; How can I define the 1st yAxis scale and left the 2nd dynamic? Thanks a lot

http://stackoverflow.com/comment/47371190
has text: ruby is a server side language and javascript is client side, you're gonna have to think of another way to do what you want. perhaps using ajax
type: Comment
comment on: http://stackoverflow.com/q/29612811
score: 0
type: QuestionComment

http://stackoverflow.com/comment/79212618
has text: Perfect, after having spent 15 minutes reading other posts I have finally found exactly what I've been looking for!
comment on: http://stackoverflow.com/a/29616952
score: 3
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29629219
type: Question
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29629339
has body: I know we can use this code to enable CORS on a single image var canvas = document.getElementById('canvas'); var ctx = canvas.getContext('2d'); var img = new Image(); img.crossOrigin = ''; img.src = 'http://crossdomain.com/image.jpg'; canvas.width = img.width; canvas.height = img.height; ctx.drawImage(img, 0, 0, img.width, img.height); Is there any way to do it for multiple image URLs at once?
upvote count: 2
possible better answer: http://stackoverflow.com/a/29629339
accepted answer: http://stackoverflow.com/a/29630168
tagged with: javascript
has title: Enable CORS on multiple images at once
tagged with: cors
score: 2
type: AnsweredQuestion
tagged with: html5-canvas
downvote count: 0
has answer: http://stackoverflow.com/a/29630168
favorite count: 0

http://stackoverflow.com/comment/47430809
has text: I'm not sure if that's a typo, but the code you posted uses `!==` while the image shows `!=`
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29644870

http://stackoverflow.com/q/29533543
has title: AngualrJS - Variable Attached to Scope that Increments/Decrements
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29533681
tagged with: angularjs-controller
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/29533681
tagged with: angularjs-scope
accepted answer: http://stackoverflow.com/a/29533745
type: Question
answer count: 2
tagged with: javascript
linked to: http://stackoverflow.com/q/29508857
has body: Aim: On click of a next/previous button the label changes to the next/previous category of that current slide. Category Slider Wireframe of what I want to achieve. Background: I previously attempted this 'Obtain Next/Previous Value from Object'. However I had issues where I had to have this in my ng-repeat and even though the data I wanted was produced it did not function with the bxSlider plugin (I could not duplicate the arrows). Therefore I need to maintain these arrows and labels outside of my ng-repeat. Next Solution: I realised potentially the best solution for this would be to keep this outside the ng-repeat. In order to do so I believe I would have to variable attached to the scope that will increment/decrement. So the appropriate Next/Previous buttons can be viewed. I naively attempted ng-click="activeCat = activeCat + 1" however that obviously just added ones to the end of the category. Any help is greatly appreciated :) HTML {{ employees[getNextCategoryIndex($index)].category }} {{nextCat}} {{ employees[getPrevCategoryIndex($index)].category }} {{prevCat}} Controller: var personControllers = angular.module('personControllers', ['ngAnimate']); //PersonSearch Controller personControllers.controller('PersonList', ['$scope', '$http', function($scope, $http) { $http.get('../static/scripts/data2.json'). success(function(data) { console.log("JSON file loaded"); console.log(data); $scope.employees = data; $scope.activeCat = data[0].category; $scope.nextCat = data[0 + 1].category; //$scope.prevCat = data[0 - 1].category; }). error(function(){ console.log("JSON file NOT loaded"); }); }]); JSON: [ { "category": "Technology", "shortname": "tech", "icon": "fa-desktop", "cat_id": 0, "cards": [ { "id": "card-1", "name": "George Sofroniou", "shortname": "G_Sof", "age": "23", "company": "Pirean Ltd.", "role": "Graduate UI Developer" }, { "id": "card-2", "name": "Steve Jobs", "shortname": "S_Jobs", "age": "56 (Died)", "company": "Apple Inc.", "role": "Former CEO" }, ] }, {…
score: 0
has answer: http://stackoverflow.com/a/29533745
tagged with: angularjs

http://stackoverflow.com/q/29667004
has answer: http://stackoverflow.com/a/29667122
answer count: 3
tagged with: css
score: 2
tagged with: http://stackoverflow.com/tag/svg
has comment: http://stackoverflow.com/comment/47474138
has comment: http://stackoverflow.com/comment/47474614
has answer: http://stackoverflow.com/a/29668120
upvote count: 2
accepted answer: http://stackoverflow.com/a/29668120
type: AnsweredQuestion
type: Question
has title: Translate (gradually - with animate) an svg element after a delay using jQuery
has answer: http://stackoverflow.com/a/29667123
downvote count: 0
tagged with: svg-animate
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/29667122
favorite count: 0
has body: I have this cubes which I want to translate to a different X and Y point after a delay of say 3000. I am not able to understand how to do this with the help of jQuery. Here is a JS Fiddle. Below is the code. JS // code for fade in one by one console.log("game begins"); allSVGs = $("g"); fadeIn(0); setTimeout(function () { $("#cubeTop").animate({ svgTransform: "translate(0, -160)" }); }, 3000); function fadeIn(svgIndex) { console.log(svgIndex); allSVGs.eq(svgIndex).css({ "display": "block", "opacity": "0" }); allSVGs.eq(svgIndex).animate({ "opacity": "1" }, { complete: function () { svgIndex++; if (svgIndex &lt; allSVGs.length) //Making sure we don't exceed the maximum available SVG elements fadeIn(svgIndex); //Recursively calling the next elements animation (hide) from the completed one. }, duration: 400 }); } Thanks in advance. PS: Sorry for not being clear. I just made an edit to the question.

http://stackoverflow.com/a/29682093
score: 3
upvote count: 3
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29681632
has body: The easiest way to make this gracefully degrade is to have a snippet of code something like this: &lt;noscript&gt;&lt;link rel=stylesheet src="no_js.css"&gt;&lt;/noscript&gt; and then have a CSS file no_js.css like so: .answer { display: inline !important; } so that when scripting is turned off, that stylesheet overrides the original styles to make all .answers visible.

http://stackoverflow.com/a/29650279
has body: I would do something like this: var count = {}; for (var x = 0; x &lt; allDataJson.length; x++) { var current = allDataJson[x]; if (!count[current["Year"]]) count[current["Year"]] = 1; else count[current["Year"]] = count[current["Year"]] + 1; } var result = [] for(key in count){ result.push({ "Year" : key, "Total" : count[key] }) } console.log(result) //prints [{"Year":"2013","Total":1},{"Year":"2015","Total":2}] see fiddle here: https://jsfiddle.net/
type: Answer
answers question: http://stackoverflow.com/q/29649972
score: 0

http://stackoverflow.com/comment/47272095
type: QuestionComment
has text: see my example, array of variable names
score: 0
comment on: http://stackoverflow.com/q/29560913
type: Comment

http://stackoverflow.com/q/29566716
tagged with: jquery
has title: Stop div scrolling when it reaches bottom of window
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47293558
tagged with: css
has comment: http://stackoverflow.com/comment/47282885
has comment: http://stackoverflow.com/comment/47282962
has answer: http://stackoverflow.com/a/29569044
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47313900
tagged with: javascript
type: Question
has body: I'm attempting to have a div stop scrolling on a page when it reaches the bottom edge of the browser window. There's nothing below it and I'm trying to avoid empty space there. I've seen many methods for stopping something at the top of the screen or when another div comes into view, but not this situation. Any ideas?
score: 0
answer count: 1

http://stackoverflow.com/comment/47255856
has text: See [this helpful page](http://www.regular-expressions.info/email.html) for good suggestions for email regexes.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29551388
score: 0

http://stackoverflow.com/q/29596551
linked to: http://stackoverflow.com/q/13392463
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29596581
has answer: http://stackoverflow.com/a/29596581
upvote count: 11
tagged with: dom
type: Question
has comment: http://stackoverflow.com/comment/47340162
has title: How can I get find the attribute name of an element, and all elements with that attribute?
answer count: 2
score: 5
has body: Here is a demo code: Here are two things I want: the attribute name, ie: 'myAttribute'. the element that contains the attribute 'myAttribute', ie: the div.
tagged with: javascript
tagged with: jquery
downvote count: 6
accepted answer: http://stackoverflow.com/a/29596697
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29596697

http://stackoverflow.com/comment/47487553
has text: Yeah, that's exactly what it's doing. thanks for the answer and the update, I'll try it out.
type: AnswerComment
comment on: http://stackoverflow.com/a/29653794
score: 0
type: Comment

http://stackoverflow.com/comment/47287081
score: 0
type: Comment
has text: Yes ! it will disappear :)
type: QuestionComment
comment on: http://stackoverflow.com/q/29564383

http://stackoverflow.com/comment/47320720
has text: Yeah, it's even impossible, since users can always change it themselves. I'd be curious to know how you think `eval` can be made to evaluate malicious code when called with a string obtained entirely from a static and trusted source (beside compromising the whole server or MitM attacks, which makes the whole point irrelevant).
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29564772
score: 0

http://stackoverflow.com/q/29537122
has comment: http://stackoverflow.com/comment/47226530
type: Question
tagged with: javascript
has body: I have this formula in a javascript string: var testString = '(var01+var02+var03)/3'; I would like to know which is the best way to obtain the following result in a array: ['var01', 'var02', 'var03']
score: 0
has answer: http://stackoverflow.com/a/29537209
answer count: 1
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47226534
has comment: http://stackoverflow.com/comment/47226429
has comment: http://stackoverflow.com/comment/47226569
has title: obtain words from a string using javascript

http://stackoverflow.com/q/29663712
has answer: http://stackoverflow.com/a/29663972
has title: Why is my hide/unhide button only working on the second click?
score: 0
answer count: 1
has body: I just read this question, but the answers don't seem to help me. Also, I would think that this code would initially have the tables hidden but that's also not working. This is for a chrome extension so cross browser functionality is unnecessary. Pure javascript answers only, please. var observer = new MutationObserver(function(mutations) { tables = main_pm_node.getElementsByClassName('featureOptions'); //alert("outside - number of tables found: " + tables.length); if(tables.length > 0){ observer.disconnect(); console.log("number of tables found: " + tables.length); for(i=0; i<tables.length; i++){ (function(i) { var sp = document.createElement('span'); var act_table = document.createElement('table'); act_table.id = 'act-tests-' + i; act_table.style = 'display:none';//'visibility: visible'; act_table.innerHTML =' blah blah html html '; sp.appendChild(act_table); tables[i].parentElement.appendChild(sp); var row = tables[i].insertRow(-1); var cell = row.insertCell(0); var cell1 = row.insertCell(1); cell1.className = "optionLabel pull-left"; var button = document.createElement('button'); button.innerHTML = 'Show ACT tests'; button.className = 'btn pull-left'; button.type = 'button'; button.onclick = function(){ var lTable = document.getElementById(act_table.id); console.log(act_table.id + ' ' + lTable); lTable.style.display = (lTable.style.display == 'block') ? 'none' : 'block'; }; cell1.appendChild(button); //.innerHTML = ' ' ; })(i); } } });
accepted answer: http://stackoverflow.com/a/29663972
type: AnsweredQuestion
tagged with: javascript
linked to: http://stackoverflow.com/q/25255486
type: Question

http://stackoverflow.com/q/29568405
has title: Angular $resource - Expected response to contain an array but got an object
has body: I'm using a $resource in Angular, and have set up the resource like this: angular.module('MyApp') .factory('Appointment', function($resource){ return $resource('/api/admin/:id', { id: "@_id" }, { query: {method:'GET', isArray:true} }); }) Now, when I use this resource in one controller (adminController) it works ok: angular.module('MyApp') .controller('adminController', ['$scope', 'Appointment', '$state', '$rootScope' , '$stateParams', '$log', '$modal','uiGmapGoogleMapApi', function($scope, Appointment, $state, $rootScope, $stateParams, $log, $modal, uiGmapGoogleMapApi) { $scope.apps = Appointment.query(); }]) but when I try to use it in another one (DetailCtrl) i get the above error: angular.module('MyApp') .controller('DetailCtrl', ['$scope', 'Appointment', '$state', '$rootScope' , '$stateParams', '$log', '$modal', 'uiGmapGoogleMapApi', function($scope, Appointment, $state, $rootScope, $stateParams, $log, $modal, uiGmapGoogleMapApi) { $scope.detail = Appointment.query({id: $stateParams.id}) }]) can anyone explain what it going on? I'm getting this error: Error: [$resource:badcfg] Error in resource configuration for action `query`. Expected response to contain an array but got an object
answer count: 1
has answer: http://stackoverflow.com/a/29568468
has comment: http://stackoverflow.com/comment/47286304
tagged with: angularjs
type: UnansweredQuestion
tagged with: angular-resource
has comment: http://stackoverflow.com/comment/47286393
score: 0
type: Question
linked to: http://stackoverflow.com/q/20020087
tagged with: javascript

http://stackoverflow.com/comment/47494001
score: 0
type: Comment
has text: Sorry dude. So essentially just toggle the class on the bt-menu div when the menu button top left exceeds the top section - it's height. Updated my fiddle to show why, as the menu button would loose clarity when it leaves the section : http://jsfiddle.net/zwsx7k0x/3/
comment on: http://stackoverflow.com/a/29675211
type: AnswerComment

http://stackoverflow.com/q/29615324
favorite count: 0
has comment: http://stackoverflow.com/comment/47549656
has title: How to Add Global/Public Variables to grunt-contrib-uglify Output
type: Question
tagged with: npm
tagged with: node.js
upvote count: 2
has comment: http://stackoverflow.com/comment/47457668
answer count: 2
has answer: http://stackoverflow.com/a/42544295
has comment: http://stackoverflow.com/comment/47549750
has comment: http://stackoverflow.com/comment/47549513
tagged with: javascript
type: UnansweredQuestion
tagged with: gruntjs
has answer: http://stackoverflow.com/a/32107897
tagged with: grunt-contrib-uglify
score: 2
downvote count: 0
has body: Okay, so I am way new to Grunt and Node.js. I am building a site, and decided that the 'main.js' file was getting way too big. So, I split it up, and I am now trying to use Grunt to piece all of these JS files back together. The issue that I have is that I need to make some global variables available to all of the various functions in all of these JS files. To be more specific, every page on our site is identified via an id in the body tag: &lt;body id="home"&gt; Many of these JS files contain if statements that ensure certain functions only run if the appropriate page is loaded. For example: if (page == 'home') { var title = "Home Page" $('.page-title').text(title); } Notice the page variable? That guy is the one that I need to make available to all of these files (after grunt-contrib-uglify merges them together). So, I figured I'd assign a new "unique" variable name, and make it global. I noticed that grunt-contrib-uglify has a 'wrap' option listed in its documentation. However, no examples are given as to how to use it. Can anyone tell me: - How to use the 'wrap' option in 'grunt-contrib-uglify' - If this is the right grunt plugin for what I am trying to do? One idea I had (as a last resort) is to create a before.js and after.js and put the beginning and end (respectively) of what I wish to wrap around the other files in each. But, I think the 'wrap' option is what I need, yes? UPDATE: Here is a link to my "merged" JS file: main.js And a link to my Gruntfile: Gruntfile.js

http://stackoverflow.com/a/29641166
has body: variable "email" is undefined, so you can't using search function on a undefined variable. You need get the email value first. function validation() { var emailCheck = document.getElementById("email").value.search(/^[a-zA-z0-9_]+\@[a-zA-z0-9_]+\.[a-zA-z]{2,3}$/); if (emailCheck==-1) alert("Please enter a valid email address"); else document.getElementById("signup").action = "success.php"; }
score: 0
answers question: http://stackoverflow.com/q/29640954
type: Answer

http://stackoverflow.com/comment/47305674
score: 0
has text: It works for me. Checked with debugger. Check your network tab, the ajax requests are sent.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29578676

http://stackoverflow.com/comment/47243571
comment on: http://stackoverflow.com/a/29545281
score: 0
type: Comment
has text: If you console.log(alltext), what does it look like?
type: AnswerComment

http://stackoverflow.com/comment/47490892
score: 0
has text: http://stackoverflow.com/questions/6873973/how-to-find-control-in-templatefield-of-gridview
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29673121

http://stackoverflow.com/a/29653744
has body: Thanks to ezanker's comment problem solved. window.location.href hash navigation for jquery mobile not working with Internet Explorer Answer: in jQuery Mobile you should navigate pages using the pagecontainer widget change method: api.jquerymobile.com/pagecontainer/#method-change, $( ":mobile-pagecontainer" ).pagecontainer( "change", "#" + newViewDiv, { transition: "slide" }); – ezanker
score: -1
accepted answer of: http://stackoverflow.com/q/29651160
upvote count: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29651160
type: Answer
downvote count: 1

http://stackoverflow.com/comment/47468788
score: 0
type: Comment
has text: @Hoyen: edited to use my orig ideas on a solution that works, now that i understand it because of your help.
type: AnswerComment
comment on: http://stackoverflow.com/a/29585826

http://stackoverflow.com/comment/47309737
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29579706
score: 0
has text: @AstroCB i neva said or mean `This isn't working properly:` , please revert to the original line . :D peace .

http://stackoverflow.com/a/29596112
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29596077
type: Answer
score: 3
downvote count: 0
has body: It's because you're document.writing a function, which returns undefined implicitly due to the rules of Javascript. Inside of that function are the document.writes you really wanted. Try: "use strict"; var i, mois, ventes, a, b; mois=["Janvier","Fevrier","Mars","Avril","Mai","Juin","Juillet","Aout","Septembre","Octobre","Novembre","Decembre"]; ventes=[120,500,350,400,600,890,450,100,250,300,650,450]; function Fventes(a, b) { for (i=0; i<12; i++) { document.write(' ', a[i],' ',b[i],' '); } } document.write(' Tableau des ventes '); Fventes(mois, ventes); document.write(' '); Fiddle: https://jsfiddle.net/zsh18999/
upvote count: 3
answers question: http://stackoverflow.com/q/29596077

http://stackoverflow.com/a/29680441
answers question: http://stackoverflow.com/q/29680354
upvote count: 5
type: Answer
has body: It looks like content is loaded with ajax. you can use below function. $(document).on("click", '#save', function(event) { alert("button pressed"); });
downvote count: 0
score: 5

http://stackoverflow.com/a/29665804
answers question: http://stackoverflow.com/q/29665783
has body: $('table').find('td').each(function(){ //Do Something })
type: Answer
upvote count: 3
score: 3
downvote count: 0

http://stackoverflow.com/a/58200021
answers question: http://stackoverflow.com/q/29658088
has body: While using Google APIs I find it easier setting up a virtual host and adding it to the OS hosts file. If you know how to set up self-signed certificates it can also be helpful. Personally set up all my projects using Vagrant and Homestead with the SSL flag on. That way I can use the URL https://project.local/ and the browser doesn't complain as much about the X-Frame-Options To enable SSL put ssl: true under the authorize: ~/.ssh/id_rsa.pub in the Homestead.yaml file that gets generated. By default the certificate won't be trusted so you will have to tell your OS that you want to trust it. I am afraid I don't remember how exactly I did that the last time.
score: 0
type: Answer

http://stackoverflow.com/comment/47509642
comment on: http://stackoverflow.com/q/29686269
type: Comment
type: QuestionComment
has text: Doesn't bootstrap handle the toggle for you? `$('.dropdown-menu')` selects every element with that class.
score: 0

http://stackoverflow.com/q/29605016
tagged with: subtraction
has comment: http://stackoverflow.com/comment/47355909
has body: I want to subtract the values once a user put the value in textfield but unable to do so. Here is an example of sum but I want it same for subtracting: 1 Butter 2 Eggs 3 Bread 4 Soap Sum : 0 Here is jquery:
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29605231
type: Question
has title: Subtract HTML Textbox Values using jQuery / JavaScript
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1

http://stackoverflow.com/q/29624937
upvote count: 1
answer count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: leaflet
downvote count: 0
score: 1
has title: Leaflet.js Canvas click indexing doesn't work as expected
type: Question
tagged with: canvas
has body: I'm trying to draw 5000 squares on top of a virtual hockey field using Leaflet.js with a Simple CRS and the Canvas element. For inspiration and getting started, I studied the sourcecode of http://build-failed.blogspot.nl/2012/04/maps-and-boardgames-part-3-client-side.html, but this works with hexagons and I want squares. After some hacking, I ended up with a grid of squares on top of the hockeyfield. Clicking squares doesn't work as intended however. The grid generating code looks like this: for (var i = 0; i &lt; columns; i++) { for (var j = 0; j &lt; rows; j++) { var square = createSquare(s, i, j); squares.push(square); squaresIndexed['' + i + ',' + j] = square; } } The squaresIndexed array holds a copy of all squares and is used for interaction later on in Leaflet's click handler: map.on('click', function(e) { var offset = projections.LatLongToPixelXY_optimized(startlat, startLon, levelOfDetail); var result = projections.LatLongToPixelXY_optimized(e.latlng.lat, e.latlng.lng, levelOfDetail); result.x = result.x - offset.x +200; result.y = result.y - offset.y +200; s = new squareDefinition(); var uv = s.getReferencePoint(result.x, result.y); var square = squaresIndexed['' + uv.u + ',' + uv.v]; console.log('square', square); L.marker([square.center.lat, square.center.lng]).addTo(map); selectedSquare = new L.Polygon(square.coordinates); map.addLayer(selectedSquare); }); The square is 'fetched' back from the squareIndexed array by using the 'reverse' of squareDefiniton.getPixelCoordinates() which is squareDefinition.getReferencePoint() This is where it seems to go wrong in my opinion. I suspect it has to do with the 'offset' being off and I can't figure out how to correct for it. To see it in effect, have a look at the jsfiddle I composed, and zoom out maximally. Then click on the field and see the selection appear on the far left: http://jsfiddle.net/gnijholt/wzennher/2/ As stated, this code is in the process of quick and dirty hacking so sorry for any ugliness or st…
tagged with: javascript
has answer: http://stackoverflow.com/a/29650179

http://stackoverflow.com/q/29563960
tagged with: reactive-programming
type: AnsweredQuestion
tagged with: bacon.js
downvote count: 0
tagged with: frp
accepted answer: http://stackoverflow.com/a/29576798
has body: I've read about FRP and was very excited. It looks great, so you can write more high-level code, and everything is more composable, and etc. Then I've tried to rewrite my own little game with a few hundreds sloc from plain js to Bacon. And I found that instead of writing high-level logic-only code, I actually beating with Bacon.js and its adherence to principles. I run into some headache that mostly interfere clean code .take(1) Instead of getting value, I should create ugly constructions. Circular dependencies Sometimes they should be by logic. But implementing it in FRP is scary Active state Even creator of bacon.js have troubles with it. As example here is the peace of code to demonstrate the problem: Task is to not allow two players stay at same place Implemented with bacon.js http://jsbin.com/zopiyarugu/2/edit?js,console function add(a) {return function(b){return a + b}} function nEq(a) {return function(b){return a !== b}} function eq(a) {return function(b){return a === b}} function always(val) {return function(){return val}} function id(a){return a} var Player = function(players, movement, initPos){ var me = {}; me.position = movement .flatMap(function(val){ return me.position .take(1) .map(add(val)) }) .flatMap(function(posFuture){ var otherPlayerPositions = players .filter(nEq(me)) .map(function(player){return player.position.take(1)}) return Bacon .combineAsArray(otherPlayerPositions) .map(function(positions){ return !positions.some(eq(posFuture)); }) .filter(id) .map(always(posFuture)) }) .log('player:' + initPos) .toProperty(initPos); return me; } var moveA = new Bacon.Bus(); var moveB = new Bacon.Bus(); var players = []; players.push(new Player(players, moveA, 0)); players.push(new Player(players, moveB, 10)); moveA.push(4); moveB.push(-4); moveA.push(1); moveB.push(-1); moveB.push(-1); moveB.push(-1); moveA.push(1); moveA.push(-1); moveB.push(-1); What I want to demonstrate is: me.positions have dependency on its own It's not easy to understand this cod…
possible better answer: http://stackoverflow.com/a/29760362
has answer: http://stackoverflow.com/a/29760362
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/29576798
upvote count: 6
tagged with: javascript
has title: Fighting with FRP
favorite count: 0
score: 6

http://stackoverflow.com/q/29533254
tagged with: node.js
answer count: 4
downvote count: 0
tagged with: codeigniter
score: 17
tagged with: socket.io
has answer: http://stackoverflow.com/a/29726602
type: Question
has body: How can I integrate node.js and socket IO in code igniter. As mentioned in this SO question here. My view file with codeigniter is in localhost/myproject but nodejs listen to port using localhost:8000. So how can I connect socket IO. Like var socket = io.connect('http://localhost:8000'); //here I need to make socket IO listen to localhost/myproject instead of localhost:8000 . How is this possible?
has answer: http://stackoverflow.com/a/29730368
linked to: http://stackoverflow.com/q/12213067
tagged with: javascript
has comment: http://stackoverflow.com/comment/47220380
has comment: http://stackoverflow.com/comment/47220862
upvote count: 17
has answer: http://stackoverflow.com/a/29645125
favorite count: 0
has answer: http://stackoverflow.com/a/29636936
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47220468
has title: Integrate node js and socket IO with codeigniter
has comment: http://stackoverflow.com/comment/47405483
tagged with: php
has comment: http://stackoverflow.com/comment/47426791

http://stackoverflow.com/q/29595190
answer count: 2
accepted answer: http://stackoverflow.com/a/29604488
downvote count: 0
possible better answer: http://stackoverflow.com/a/32106401
favorite count: 0
tagged with: javascriptcore
has title: JavascriptCore not exporting methods from clases
tagged with: swift
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/29604488
upvote count: 1
type: Question
tagged with: ios
tagged with: javascript
has body: I'm trying to call a method from a singleton instance of a swift class. Here is my protocol: @objc public protocol MyProtocol: JSExport { var name: String { get set } func sum(a:Int, b: Int) -&gt; Int } And here is my class: private let sharedInstance = MySingleton() @objc public class MySingleton: NSObject, MyProtocol { // Singleton public class var sharedApp : MySingleton { return sharedInstance } public var username: String override private init() { self.username = "Oscar" super.init() } public func sum(a: Int, b: Int) -&gt; Int { return a + b } } I ran some tests. When I'm accessing a property it passes: func testName() { var virtualMachine = JSVirtualMachine() js = JSContext(virtualMachine: virtualMachine) var singleton: MySingleton = MySingleton.sharedApp self.context.setObject( singleton.self, forKeyedSubscript: "Singleton") let name = js.evaluateScript("Singleton.username").toString() XCTAssertTrue(name == "Oscar", "Name is not Colossal, was " + name); // PASS!!!!! } However, when I call a method it fails: func testSum() { var virtualMachine = JSVirtualMachine() js = JSContext(virtualMachine: virtualMachine) var singleton: MySingleton = MySingleton.sharedApp self.context.setObject( singleton.self, forKeyedSubscript: "Singleton") let name = js.evaluateScript("Singleton.sum(3, 2);").toInt32() XCTAssertTrue(sum == 5, "Sum was " + String(sum)); // Fails. Says sum was 0 } It only works when reading/writing properties from/to the Javascript object, not when calling a method.... What am I doing wrong?
has answer: http://stackoverflow.com/a/32106401

http://stackoverflow.com/comment/47412274
type: Comment
comment on: http://stackoverflow.com/a/29634987
score: 0
type: AnswerComment
has text: i think he wants to count each of those names in a big array of names and then return an ordered count array in the same order as the list of names to search for in the big array (not shown)

http://stackoverflow.com/comment/47460554
type: Comment
comment on: http://stackoverflow.com/q/29660529
score: 1
type: QuestionComment
has text: Have you watched the script execute in IE11 using the debugger (F12)?

http://stackoverflow.com/comment/113335938
type: Comment
has text: You might want to take a look at [Greasemonkey](https://addons.mozilla.org/en-us/firefox/addon/greasemonkey/ "Greasemonkey"). It allows you to add a javascript file to any page.
score: 0
comment on: http://stackoverflow.com/q/29639448
type: QuestionComment

http://stackoverflow.com/comment/47463135
has text: Please consider to use *comments* for comments.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29607931

http://stackoverflow.com/q/29616569
has comment: http://stackoverflow.com/comment/47378247
has body: just started learning javascript from the book the definitive guide, there is one line which I couldn't figure it out. Here is the complete code: // Replace the method named m of the object o with a version that logs // messages before and after invoking the original method. function trace(o, m) { var original = o[m]; // Remember original method in the closure. o[m] = function() { // Now define the new method. console.log(new Date(), "Entering:", m); // Log message. var result = original.apply(this, arguments); // Invoke original. console.log(new Date(), "Exiting:", m); // Log message. return result; // Return result. }; } the author did not comment on the line and I have a few questions regarding this code. What does this, arguments refer to respectively? How is this invocation works exactly? Explanations on the closures in this particular code would be welcomed too! Thank you
has answer: http://stackoverflow.com/a/29616641
has comment: http://stackoverflow.com/comment/47378644
has answer: http://stackoverflow.com/a/29616665
type: UnansweredQuestion
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/47378429
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
has title: javascript - what does this line mean: var result = original.apply(this, arguments)
favorite count: 0

http://stackoverflow.com/comment/47236604
type: Comment
has text: Thanks. I'm sure I'm not getting something here, but I have added the script to the specified folder, and have configured the script manager (in my master page, but as it isn't part of an assembly, it won't run. And I can't add to a resource file as I don't have the option.
comment on: http://stackoverflow.com/a/29540733
score: 0
type: AnswerComment

http://stackoverflow.com/q/29598623
accepted answer: http://stackoverflow.com/a/29598644
tagged with: regex
has body: I've been trying to solve this problem for some time, but I've been unable to. I have to make a form and I must validate the name input to have at least 3 words in it within JavaScript. I think the best way to do it is with Regex and its \b property. This is &lt;input type="text" class="texto" name="Nombre" id="name" title="nombre_cliente" style="color:#888;" placeholder="Nombre del cliente" /&gt; What I mean to do in my JavaScript code is this: if(document.getElementById("name").value.match(RegExCodeForMin3Words) === null){ alert("Name invalid"); } So far I've been unable to learn how to make regex match the amount of words (I'm still a beginner at Regex). Can you help me tackle this problem? Maybe Regex isn't the best option available to solve this? Thanks!
answer count: 4
has answer: http://stackoverflow.com/a/29598763
has answer: http://stackoverflow.com/a/29598758
has title: How can I validate a minimum of 3 words in a HTML form?
score: 5
has comment: http://stackoverflow.com/comment/47344990
possible better answer: http://stackoverflow.com/a/29598840
has answer: http://stackoverflow.com/a/29598840
type: AnsweredQuestion
upvote count: 5
linked to: http://stackoverflow.com/q/4630908
has answer: http://stackoverflow.com/a/29598644
has comment: http://stackoverflow.com/comment/47343694
type: Question
tagged with: validation
downvote count: 0
tagged with: counter
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/47230374
type: Comment
comment on: http://stackoverflow.com/a/29538681
has text: Yes at cleint side I am sure its not overridden. Its working fine in plain text but causing problem when I have HTML elements
score: 0
type: AnswerComment

http://stackoverflow.com/q/29607674
has comment: http://stackoverflow.com/comment/47360986
tagged with: google-visualization
answer count: 1
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47361377
has answer: http://stackoverflow.com/a/29608036
type: UnansweredQuestion
upvote count: 1
has body: The following JS exception is thrown while using the Google Charts' Bar Chart on IE: Unable to set property 'data' of undefined or null reference However the chart renders correctly. I tried debugging, but the error is thrown from deep within the charts code. The file that throws the error is: https://www.google.com/uds/api/visualization/1.0/ce7a9bd29458c92c2c25b7969aaf2727/format+en,default+en,ui+en,corechart+en.I.js And the line number is 244. The error is thrown only on IE (tried both 11 and 9), and for other chart types as well. Has anyone encountered this error before? Any ideas for how to debug this?
tagged with: internet-explorer
has title: Google Charts on IE: "Unable to set property 'data' of undefined or null reference"
type: Question

http://stackoverflow.com/comment/47235191
type: Comment
has text: Jaw.sh, thanks for the elaboration, it makes sense to me now. And of course, thank you Simon.
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29541101

http://stackoverflow.com/comment/47495959
type: AnswerComment
has text: edited my post. Anyway, I will google it in any case, thanks for the tip
score: 0
comment on: http://stackoverflow.com/a/29679094
type: Comment

http://stackoverflow.com/q/29607185
tagged with: jquery
favorite count: 0
has body: I have problem, if user clicks too fast on button, animation queue is keep piling up so it stops works properly. I would need behaviors, that when he clicks on button animation will always start current animation from beginning and forget about past animations in queue. I tried stop(true, true) and clearQueue() adding to code below, but I'm doing this based on luck because don't understand jQuery well and didn't succeed with hours of trying. var o, s, l; e.animate = function(n, a, r, l, u) { o = u, s = [], i(n), t(".unddd").each(function(e, n) { Z.enqueue(function() { t(n).removeClass("unddd", 1, null, Z.dequeue) }) }), Z.enqueue(function() { t(".unindicated").addClass("used_for_hand", o, null, Z.dequeue) }, t(".unindicated").size()), Z.enqueue(function() { t("#paybe").addClass("highlight"), Z.dequeue() }), Z.enqueue(function() { }), Z.startDequeue() }, e.animateOut = function(e) { e ? Z.enqueue(function() { t(".status").hide(), t(".ble").addClass("discard", o, null, Z.dequeue) }, t(".ble").size()) : Z.enqueue(function() { t(".ble").not(".held").addClass("discard", o, null, Z.dequeue) }, t(".ble").not(".held").size()), Z.startDequeue() }
type: UnansweredQuestion
tagged with: animation
has comment: http://stackoverflow.com/comment/47365233
has title: jquery prevent animation queue build up
has answer: http://stackoverflow.com/a/29613728
downvote count: 1
type: Question
tagged with: javascript
score: -1
answer count: 2
upvote count: 0
has answer: http://stackoverflow.com/a/29607351

http://stackoverflow.com/comment/47495745
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29678559
score: 0
has text: You need to listen to `RTCPeerConnection.onicecandidate`. There can easily be upwards of 20-50 ICE candidates. I don't think it's very feasible to copy them over one by one.

http://stackoverflow.com/q/29625322
has answer: http://stackoverflow.com/a/29625585
has title: Validate dateFormat in dd/mm/yyyy using regex
answer count: 4
type: AnsweredQuestion
upvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29625429
accepted answer: http://stackoverflow.com/a/29625878
favorite count: 0
linked to: http://stackoverflow.com/q/26355985
type: Question
has body: I want to validate the format of the date value entered by a user using regex with javascript. My regex doesn't allow the '/' character , /[^0-9\.]/g,'' But I want to let '/' pass the regex test too. What modification do I need to make here?
linked to: http://stackoverflow.com/q/5465375
tagged with: regex
score: -1
duplicate of: http://stackoverflow.com/q/5465375
has answer: http://stackoverflow.com/a/29625825
has comment: http://stackoverflow.com/comment/47393929
downvote count: 1
has comment: http://stackoverflow.com/comment/85739524
possible better answer: http://stackoverflow.com/a/29625585
has answer: http://stackoverflow.com/a/29625878

http://stackoverflow.com/a/29652724
has body: As part of find, MongoDB can't sort an array field of a document. You could define a virtual of Mongoose to return the array in sorted order. You could also maintain the array in sorted order, as shown below: &gt; db.test.drop() // note: not in order when inserted &gt; db.test.insert({ "_id" : 0, "users" : [ { "user" : 1, "going" : 1, "created" : 22 }, { "user" : 2, "going" : 1, "created" : 775 }, { "user" : 1, "going" : 1, "created" : 6432 } ] }) // insert user to array and sort as part of update &gt; db.test.update({ "_id" : 0 }, { "$push" : { "users" : { "$each" : [{ "user" : 2, "going" : 1, "created" : 5532 }], "$sort" : { "created" : -1 } } } }) &gt; &gt; db.test.findOne() { "_id" : 0, "users" : [ { "user" : 1, "going" : 1, "created" : 6432 }, { "user" : 2, "going" : 1, "created" : 5532 }, { "user" : 2, "going" : 1, "created" : 775 }, { "user" : 1, "going" : 1, "created" : 22 } ] } That way, when you perform your find query, the arrays in the matching documents will already be in the desired order.
downvote count: 0
score: 3
answers question: http://stackoverflow.com/q/29638752
upvote count: 3
type: Answer

http://stackoverflow.com/q/29625284
has answer: http://stackoverflow.com/a/29625404
type: Question
answer count: 2
has body: I have a div which when clicked shows a contact us form . That is, on toggle it shows and hides. How can I make it to hide on clicking from other part of document. The code is below function showCctFrm(){ var frmWidth = '-40'; $("#quick_cct_form").toggle(function(e){ if($("#quick_cct_form").is(":visible")){ frmWidth = "200"; } if($("#quick_cct_form").is(":hidden")){ frmWidth = "-40"; } $("#fixed_cct_us").css("right",frmWidth+"px"); //e.stopPropagation(); }); //alert(frmWidth); } I tried this to hide on clicked outside: $(document).click(function(e) { if(e.target.id != 'fixed_cct_us') { $("#quick_cct_form").hide(); $("#fixed_cct_us").css("right","-40px"); } }); the HTML div for that is as below &lt;div id="fixed_cct_us" style="right: 240px;"&gt; &lt;a title="connect" href="javascript: showCctFrm();"&gt;connect &amp;nbsp;&lt;/a&gt; &lt;/div&gt;
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29625382
linked to: http://stackoverflow.com/q/1403615
score: 0
has comment: http://stackoverflow.com/comment/47393985
tagged with: http://stackoverflow.com/tag/html
has title: How to hide/show on toggle and hide on clicking outside the div
type: UnansweredQuestion

http://stackoverflow.com/a/29540925
type: Answer
accepted answer of: http://stackoverflow.com/q/29540807
answers question: http://stackoverflow.com/q/29540807
score: 2
downvote count: 0
upvote count: 2
type: AcceptedAnswer
has body: This link states: The instanceof operator tests presence of constructor.prototype in object's prototype chain.

http://stackoverflow.com/comment/47402813
comment on: http://stackoverflow.com/q/29629804
type: Comment
has text: yes, but I need at least 10 reputation to post image, so, please see image via link: https://i.sstatic.net/8C6JL.png, you can see my issue.
type: QuestionComment
score: 0

http://stackoverflow.com/comment/47426532
comment on: http://stackoverflow.com/a/29642481
type: Comment
has text: i have one doubt, when i click again somewhere around that name, it didn't hide menus. may i know why?..
score: 0
type: AnswerComment

http://stackoverflow.com/q/29587419
possible better answer: http://stackoverflow.com/a/29587433
has answer: http://stackoverflow.com/a/29587433
type: AnsweredQuestion
has title: JS - How to get the correct val of a map?
type: Question
upvote count: 4
answer count: 2
accepted answer: http://stackoverflow.com/a/29587443
downvote count: 0
tagged with: javascript
tagged with: jquery
score: 4
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has body: On load I create a map, the key is an anker-element and the value the offset of that anker. Unfortunately I cannot read out the val correctly, it always returns the value of the last key. What is wrong? js fiddle HTML AnkerAnkerAnker JS var ankers = {}; $('a').each(function(){ var pos = $(this).offset().left; ankers[$(this)] = pos; }); $('a').click( function(e) { e.preventDefault(); alert(ankers[$(this)]); });
has answer: http://stackoverflow.com/a/29587443

http://stackoverflow.com/comment/47297465
type: Comment
type: QuestionComment
has text: What has to do a desktop application with some php script? I don't get it.
score: 1
comment on: http://stackoverflow.com/q/29574288

http://stackoverflow.com/a/29651727
score: -1
downvote count: 2
has comment: http://stackoverflow.com/comment/49031514
upvote count: 1
answers question: http://stackoverflow.com/q/29650550
type: Answer
has comment: http://stackoverflow.com/comment/47443258
has comment: http://stackoverflow.com/comment/47443325
has body: You could take a look at this example HTML: {{Person.firstName}} {{Person.lastName}} {{Choice.Name}}: {{Choice.SelectedOption.ID}} JavaScript: var myApp = angular.module('myApp', []); myApp.controller("SomeController", function($scope) { $scope.People = [{ "firstName": "John", "lastName": "Doe", "Choices": [ { "Name":"Dinner", "Options":[{Name:"Fish",ID:1}, {Name:"Chicken",ID:2}, {Name:"Beef",ID:3}], "SelectedOption":{Name:"Chicken",ID:2} }, { "Name":"Lunch", "Options":[{Name:"Macaroni",ID:1}, {Name:"PB&J",ID:2}, {Name:"Fish",ID:3}], "SelectedOption":"" } ], }, { "firstName": "Jane", "lastName": "Doe" }]; }); CSS: body{ font-family: verdana; font-size: 10pt; } .listheader{ font-weight: bold; text-decoration: underline; padding-top: 5px; } fiddle link

http://stackoverflow.com/a/29570712
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29570541
answers question: http://stackoverflow.com/q/29570541
type: Answer
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/48387963
has body: I did this recently by setting up an Interval function like this : var timesTest = 0; var checkExists = setInterval(function() { if ($('.yourClassElement').length) { // ok element found : do your stuff and clear the Interval... // stuff... clearInterval(checkExists); timesTest = 0; } timesTest++; // I won't let this run more than 5 seconds, so : if (timesTest*100 &gt; 5000) clearInterval(checkExists); }, 100);

http://stackoverflow.com/a/31289292
has body: This functionality not working in angular material v0.9.8, actually i need a functionality on a dialog box when i click outside the box it should hide in v 0.9.8 of angular material.
has comment: http://stackoverflow.com/comment/50576275
answers question: http://stackoverflow.com/q/29570956
downvote count: 0
type: Answer
score: 2
upvote count: 2

mysql
tags question: http://stackoverflow.com/q/29681126
tags question: http://stackoverflow.com/q/29599110
tags question: http://stackoverflow.com/q/29640245
tags question: http://stackoverflow.com/q/29649178
tags question: http://stackoverflow.com/q/29556265
tags question: http://stackoverflow.com/q/29650730
tag name: mysql
tags question: http://stackoverflow.com/q/29617268
tags question: http://stackoverflow.com/q/29545805
tags question: http://stackoverflow.com/q/29666409
tags question: http://stackoverflow.com/q/29584002
tags question: http://stackoverflow.com/q/29612368
tags question: http://stackoverflow.com/q/29651313
tags question: http://stackoverflow.com/q/29687356
tags question: http://stackoverflow.com/q/29539733
tags question: http://stackoverflow.com/q/29589455
tags question: http://stackoverflow.com/q/29670390
tags question: http://stackoverflow.com/q/29563506
tags question: http://stackoverflow.com/q/29572143
type: Tag
tags question: http://stackoverflow.com/q/29630266
tags question: http://stackoverflow.com/q/29615680
tags question: http://stackoverflow.com/q/29594784
tags question: http://stackoverflow.com/q/29651376
tags question: http://stackoverflow.com/q/29586916
tags question: http://stackoverflow.com/q/29604038
tags question: http://stackoverflow.com/q/29662567
tags question: http://stackoverflow.com/q/29674846
tags question: http://stackoverflow.com/q/29619906
tags question: http://stackoverflow.com/q/29654946
tags question: http://stackoverflow.com/q/29615889
tags question: http://stackoverflow.com/q/29666540
tags question: http://stackoverflow.com/q/29576035
tags question: http://stackoverflow.com/q/29683880
tags question: http://stackoverflow.com/q/29567048
tags question: http://stackoverflow.com/q/29531896

http://stackoverflow.com/comment/47248583
comment on: http://stackoverflow.com/q/29548277
score: 0
type: QuestionComment
has text: allows you to only enter numerical values into a text box
type: Comment

http://stackoverflow.com/comment/47280604
comment on: http://stackoverflow.com/q/29565386
score: 0
type: QuestionComment
type: Comment
has text: @gtgaxiola Anywhere. Could be used to split up the digits.

http://stackoverflow.com/q/29566208
type: Question
has comment: http://stackoverflow.com/comment/47282319
has comment: http://stackoverflow.com/comment/47282220
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29566794
has title: Need help understanding what is going on in JQuery's noConflict() function
has body: I'm looking at the source code of this site and trying to figure out how a part of the Javascript works because I want to copy their expanding list functionary (e.g. "WHEN &amp; WHERE CAN I TURN IN MY SOLD TICKETS &amp; MONEY") into my site. Lines 74-75 of the source code are &lt;script type="text/javascript" src="http://newjs.finalsite.com/150409/javascript/jQuery/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; var $j = jQuery.noConflict(); &lt;/script&gt; which basically sets $j to whatever the function noConflict() returns. Then, at the bottom of the code, they include the JS file http://newjs.finalsite.com/150409/javascript/pages/multicontent/multi_expand.js, which consists of the function $j(function(){ if(clickToClose){ $j('.mcExpandingList').accordion({ collapsible:'true', autoHeight: false }); if(!mc_viewOption1){ $j('.mcExpandingList').accordion( 'option', 'active', false ); } }else{ $j('.mcExpandingList').addClass('ui-accordion ui-widget ui-helper-reset ui-accordion-icons'); $j('.mcExpandingList h4').addClass('ui-accordion-header ui-helper-reset ui-state-default ui-corner-all') .prepend('&lt;span class="ui-icon ui-icon-triangle-1-e"&gt;&lt;/span&gt;') .hover(function(){ $j(this).toggleClass('ui-state-hover') }) .click(function(){ $j(this).toggleClass('ui-state-active ui-corner-top ui-corner-all'); $j(this).next().toggle('blind'); $j(this).find('span').eq(0).toggleClass('ui-icon-triangle-1-s'); return false; }); $j('.contentElement').addClass('ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom').css('display','none'); if (mc_viewOption1) { $j('.mcExpandingList h4').eq(0).toggleClass('ui-state-active ui-corner-top ui-corner-all'); $j('.mcExpandingList h4').eq(0).next().show(); $j('.mcExpandingList h4').eq(0).find('span').eq(0).addClass('ui-icon-triangle-1-s'); }; } }); which, as I understand, is passing an anonymous function to the noConflict() object that was returned, which gives me the idea that $j is itself a …
accepted answer: http://stackoverflow.com/a/29566794
has comment: http://stackoverflow.com/comment/47282043
type: AnsweredQuestion

http://stackoverflow.com/a/29547300
score: 0
has body: something like this should do: $('#list_userInput_location').on('change', function(){ alert($(this).val()); }); This will give you the value each time an option is selected. Here's an example
answers question: http://stackoverflow.com/q/29547135
type: Answer

jssor
tags question: http://stackoverflow.com/q/29578984
tags question: http://stackoverflow.com/q/29572327
tags question: http://stackoverflow.com/q/29621032
tags question: http://stackoverflow.com/q/29591717
tag name: jssor
tags question: http://stackoverflow.com/q/29678709
tags question: http://stackoverflow.com/q/29588242
type: Tag

http://stackoverflow.com/comment/47365739
type: Comment
comment on: http://stackoverflow.com/a/29609548
score: 0
type: AnswerComment
has text: Nvm! I got it working! It didn't capitalize something. Thank you so much! You just saved my life! :D

http://stackoverflow.com/a/29576728
score: 0
has body: document.forms is a HTMLCollection. Its named items' names are the id or name of a node. Your form has neither the id "input" nor the name "input", so document.forms["input"] doesn't return it.
type: Answer
answers question: http://stackoverflow.com/q/29576548

http://stackoverflow.com/q/29580522
score: 5
answer count: 1
downvote count: 0
tagged with: passport.js
favorite count: 0
has body: I am trying to build a very simple authentication api using passport.js, but I my code always returns 500 internal error status. var express = require('express'); var bodyParser = require('body-parser'); var cookieParser = require('cookie-parser'); var expressSession = require('express-session'); var logger = require('morgan'); var path = require('path'); var passport = require('passport'); var passportLocal = require('passport-local'); var app = express(); app.set('port', process.env.PORT || 3000); app.set('view engine', 'ejs'); app.use(logger('dev')); app.use(bodyParser.urlencoded({ extended: false })); app.use(cookieParser()); app.use(expressSession({ secret: process.env.SESSION_SECRET || 'secret', resave: false, saveUninitialized: false })); app.use(passport.initialize()); app.use(passport.session()); passport.use(new passportLocal.Strategy(function (username, password, done) { console.log('login using ' + username); done(null, { id: 1, username: 'test', password: '12345'}); })); passport.serializeUser(function(user, done) { done(user.id); }); passport.deserializeUser(function(id, done) { done({ id: id, username: 'test', password: '12345' }); }); app.get('/', function(req, res) { res.render('index', { isAuthenticated: req.isAuthenticated(), user: req.user }); }); app.get('/login', function(req, res) { res.render('login'); }); app.post('/login', passport.authenticate('local'), function(req, res) { res.redirect('/'); }); app.listen(app.get('port'), function(){ console.log('server is listenning on port ' + app.get('port')); }); I have a simple post form at my '/login' path, I test my server by entering whatever I want in the username and password fields, then the browser sends the post request to '/login', then the server successfully reach the line: console.log('login using ' + username); And the result is that the server returns the value 1 ( id: 1 ) to the browser and a 500 internal server error. what am I missing?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29580792
tagged with: node.js
has title: Passport.js always returning 500 internal error
type: Question
upvote count: 5
tagged with: javascript
tagged with: express
has comment: http://stackoverflow.com/comment/47309862

http://stackoverflow.com/a/29611144
downvote count: 0
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29610982
score: 1
has body: Add $("#list").tablesorter(); at the end (when table is already filled with all data, thead and tbody)... I am using the same in my application and works fine.
answers question: http://stackoverflow.com/q/29610982
type: AcceptedAnswer

http://stackoverflow.com/a/29615665
type: Answer
score: 0
answers question: http://stackoverflow.com/q/29614136
has body: The following should get you what you need. It uses flatten() to create one array, and from there, reduce() to create a new array with '0' duplicates allowed, and all other duplicates removed. _([arr_1, arr_2]) .flatten() .reduce(function(result, item) { if (item === '0' || !_.includes(result, item)) { result.push(item); } return result; }, []);

http://stackoverflow.com/a/29638348
has body: Wolf War's answer is correct, however, for a content script an additional step is needed. You need a background (or better, event) page to process the request, since content scripts can't call that API. You need to use Messaging: // Content script // element is your DOM element element.addEventListener("click", function(e) { chrome.runtime.sendMessage({command: "openHistory"}); }); // Event script chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) { if(command == "openHistory") { chrome.tabs.create({'url': 'chrome://history'}); } });
answers question: http://stackoverflow.com/q/29636347
accepted answer of: http://stackoverflow.com/q/29636347
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47418936
downvote count: 0
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/q/29683903
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47505072
downvote count: 3
type: Question
has body: I have a site at www.casualdispatch.com that basically updates people as jobs are being dispatched from a physical dispatch window where tickets are being handed out. Currently, users must refresh the page manually but I would like the update to function without a page reload. How can I accomplish this? Currently, I am using php and each update is made by posting a form and adding mysql records of each update. These jobs are also dispatched very quickly, one after another. Its also very hard to input them one by one. I'd like to make a form that consists of a table with everyone's dispatch number and when you touch one it marks it off leaving it highlighted and then updates the main page. Is this possible?
accepted answer: http://stackoverflow.com/a/29684240
tagged with: javascript
has answer: http://stackoverflow.com/a/29684240
has comment: http://stackoverflow.com/comment/47504805
upvote count: 0
has title: Best way for live updates?
answer count: 1
favorite count: 0
tagged with: ajax
score: -3
tagged with: php

http://stackoverflow.com/q/29686304
has comment: http://stackoverflow.com/comment/47509948
has comment: http://stackoverflow.com/comment/47509744
downvote count: 1
has comment: http://stackoverflow.com/comment/47509646
favorite count: 0
has answer: http://stackoverflow.com/a/29686387
type: AnsweredQuestion
tagged with: mathematical-optimization
has comment: http://stackoverflow.com/comment/47509884
score: 1
possible better answer: http://stackoverflow.com/a/29686387
type: Question
tagged with: performance
tagged with: algorithm
has body: In JavaScript, is there a more efficient way of calculating perfect squares working from odd numbers than this (the last perfect square stored in the array perfectSqrs is console.logged): let n = 999, oddNums = [], i; for (i = 3; i &lt; n; i += 1) { if (i % 2 !== 0) { oddNums.push(i); } } let oddLength = oddNums.length; let perfectSqrs = [1], j = 0; while (j &lt; oddLength - 1) { perfectSqrs[j + 1] = perfectSqrs[j] + oddNums[j]; j += 1; } console.log(perfectSqrs[perfectSqrs.length - 1]);
has comment: http://stackoverflow.com/comment/47509978
tagged with: javascript
has answer: http://stackoverflow.com/a/29686467
has comment: http://stackoverflow.com/comment/47509859
accepted answer: http://stackoverflow.com/a/29686467
upvote count: 2
has title: Perfect squares from odd numbers
answer count: 2

http://stackoverflow.com/a/43235785
score: 140
answers question: http://stackoverflow.com/q/29652862
has comment: http://stackoverflow.com/comment/105837062
has body: Here is my simple twoliner helper method: getHighlightedText(text, highlight) { // Split text on highlight term, include term itself into parts, ignore case const parts = text.split(new RegExp(`(${highlight})`, 'gi')); return {parts.map(part => part.toLowerCase() === highlight.toLowerCase() ? {part} : part)}; } It returns a span, where the requested parts are highlighted with tags. This can be simply modified to use another tag if needed. UPDATE: To avoid unique key missing warning, here is a solution based on spans and setting fontWeight style for matching parts: getHighlightedText(text, highlight) { // Split on highlight term and include term into parts, ignore case const parts = text.split(new RegExp(`(${highlight})`, 'gi')); return { parts.map((part, i) => { part } ) } ; }
has comment: http://stackoverflow.com/comment/79352253
has comment: http://stackoverflow.com/comment/90288394
has comment: http://stackoverflow.com/comment/101510918
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/118839302
downvote count: 0
upvote count: 140
accepted answer of: http://stackoverflow.com/q/29652862
type: Answer

http://stackoverflow.com/a/29660533
has comment: http://stackoverflow.com/comment/47460756
score: 1
has body: You should include $(this).scrollTop(0); within a $(document).ready(); call, like so: $(document).ready(function() { $(this).scrollTop(0); }); In your code, you are calling $(this).scrollTop(0); before the page unloads, rather than after the page and DOM have been reloaded.
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/47460662
answers question: http://stackoverflow.com/q/29660319
has comment: http://stackoverflow.com/comment/47460700
downvote count: 0

http://stackoverflow.com/q/29619906
has answer: http://stackoverflow.com/a/29620030
has body: I am uploading a image using jsp and servlet. I am using enctype=multipart/form-data. But i can not fetch input field values into servlet. Here is my jsp code Select file to upload: And here is my sevlet code protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); response.setContentType("text/html;charset=UTF-8"); HttpSession sess=request.getSession(); PrintWriter out = response.getWriter(); int i=0; String u_id=(String) sess.getAttribute("uid"); String saveFile=""; String contentType = request.getContentType(); if((contentType != null)&&(contentType.indexOf("multipart/form-data") >= 0)){ DataInputStream in = new DataInputStream(request.getInputStream()); int formDataLength = request.getContentLength(); byte dataBytes[] = new byte[formDataLength]; int byteRead = 0; int totalBytesRead = 0; while(totalBytesRead < formDataLength){ byteRead = in.read(dataBytes, totalBytesRead,formDataLength); totalBytesRead += byteRead; } saveFile = file.substring(file.indexOf("filename=\"") + 10); saveFile = saveFile.substring(0, saveFile.indexOf("\n")); saveFile = saveFile.substring(saveFile.lastIndexOf("\\") + 1,saveFile.indexOf("\"")); String boundary = contentType.substring(lastIndex + 1,contentType.length()); int pos; pos = file.indexOf("filename=\""); pos = file.indexOf("\n", pos) + 1; pos = file.indexOf("\n", pos) + 1; pos = file.indexOf("\n", pos) + 1; int boundaryLocation = file.indexOf(boundary, pos) - 4; int startPos = ((file.substring(0, pos)).getBytes()).length; File ff = new File("D:/images/"+saveFile); FileOutputStream fileOut = new FileOutputStream(ff); fileOut.write(dataBytes, startPos, (endPos - startPos)); fileOut.flush(); fileOut.close(); try{ Connection con; PreparedStatement ps,ps1; ResultSet rs; Class.forName("com.mysql.jdbc.Driver"); con = DriverManager.getConnection("jdbc:mysql://localhost:3306/dfmc","root","93Pb3gaNv0"); String sql="inser…
upvote count: 1
answer count: 1
favorite count: 0
duplicate of: http://stackoverflow.com/q/2422468
type: UnansweredQuestion
has title: How to fetch image name and another input field values at the same time from form into servlet
downvote count: 0
score: 1
tagged with: java
tagged with: mysql
linked to: http://stackoverflow.com/q/2422468
tagged with: servlets
type: Question
has comment: http://stackoverflow.com/comment/48257452
tagged with: jsp
tagged with: javascript

http://stackoverflow.com/q/29685364
has answer: http://stackoverflow.com/a/29685470
score: 2
type: AnsweredQuestion
has title: Boolean variable returns as string from javascript function
downvote count: 0
has comment: http://stackoverflow.com/comment/102075611
type: Question
upvote count: 2
answer count: 2
duplicate of: http://stackoverflow.com/q/3082475
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29685400
accepted answer: http://stackoverflow.com/a/29685470
favorite count: 0
linked to: http://stackoverflow.com/q/3082475
linked to: http://stackoverflow.com/q/15788709
has body: Why is it that when I'm returning, what I think is, a boolean variable from a javascript function, it is detected in the calling function as a string, but if I return a boolean literal, the calling function detects it as a boolean? So, for example: $( document ).ready(function(){ $('#result').text(typeof validate()); $('#result2').text(typeof validate2()); }); function validate(){ status = true; status = false; return status; } function validate2(){ return true; } Hello
has answer: http://stackoverflow.com/a/29685400
has comment: http://stackoverflow.com/comment/47507893

http://stackoverflow.com/comment/48098081
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29617775
score: 0
has text: @rangerover.js - yes, toggle a class on the element (like `show-i` and in your CSS add the rule: `.show-i { display: block !important; }`

http://stackoverflow.com/a/29580815
has comment: http://stackoverflow.com/comment/47310525
has body: This is a hacky way of doing it but all browsers (ie6+) support it:
answers question: http://stackoverflow.com/q/29578186
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47310568
upvote count: 1

http://stackoverflow.com/comment/47445754
score: 2
comment on: http://stackoverflow.com/q/29652950
has text: Unfortunately your English skills need to be better to use this website. I can _sort of_ see what you're getting at, but it's still very ambiguous.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29596958
has comment: http://stackoverflow.com/comment/47341331
score: 0
answers question: http://stackoverflow.com/q/29596886
has comment: http://stackoverflow.com/comment/47341321
type: Answer
has body: This is probably an issue with RequireJS and the fact that the page is already loaded. RequireJS should already be waiting for all the files to load so use the below code. Example: console.log("main.js ran"); function render() { console.log("render ran"); } render(); If you are trying to wait for an HTML element to load use jQuery: //will run once the page DOM is ready $(element).ready(function(){ ... }); //will run once the entire page is //loaded including images and iframes $(element).load(function(){ ... });
upvote count: 1
downvote count: 1

http://stackoverflow.com/comment/47702797
type: Comment
has text: Thanks Jamie, the problem is the box is moving with the coordinates of the mouse, I just need the position of the box to be fixed and in size of the element of left panel that is hovered by user. The reason is if you move the mouse on the element it causes the red box to blink, as its position changes.
comment on: http://stackoverflow.com/a/29769520
type: AnswerComment
score: 0

http://stackoverflow.com/comment/89095516
comment on: http://stackoverflow.com/q/29681949
score: 0
type: Comment
type: QuestionComment
has text: Did you get a solution with this? I'm having the same problem and I don't find any solution :(

http://stackoverflow.com/comment/47335639
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29594257
has text: For me the `onclick` part works fine but the assigned function brings some issues as `t[i]` won’t be defined within that function. I’ll edit my answer for a possible fix.
type: AnswerComment

http://stackoverflow.com/q/29614902
has comment: http://stackoverflow.com/comment/47375576
linked to: http://stackoverflow.com/q/317095
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47376302
has answer: http://stackoverflow.com/a/29615263
has body: I have a dropdown menu: Code. The options of "code" come from the database and the dropdown is populated. I have a textbox: Name. For certain values populated in Name (again from database), I want to replace the dropdown menu options with my own set of options, essentially overwriting the ones that are already there. Is there a way to do this? My Code: HTML: Code Name Code that I tried so far: (followed How do I add options to a DropDownList using jQuery?) $('.nameInput').html(""); $('.nameInput').val(data[0].codeValue); if ($('.nameInput').val() =="Smith") { var myOptions = { val1 : "Tom", val2 : "John" }; $.each(myOptions, function(val, text){ $('.codeSelection').append($(' ').val(val).html(text)); }); } This still gives me the old dropdown and just displays the values "Tom" and "John" as text.
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/47375340
tagged with: javascript
has comment: http://stackoverflow.com/comment/47375208
has comment: http://stackoverflow.com/comment/47375946
score: 0
answer count: 2
has title: How to replace dropdown menu options with your own options using JQuery?
tagged with: drop-down-menu
tagged with: jquery
has answer: http://stackoverflow.com/a/29615237

http://stackoverflow.com/comment/47215309
comment on: http://stackoverflow.com/q/29530882
score: 0
has text: I already posted an answer!
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47306025
has text: @thefourtheye sorry updated my question.
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29578784
type: QuestionComment

http://stackoverflow.com/comment/47411628
has text: Just another reason why MS Word isn't a very good text editor!
type: Comment
comment on: http://stackoverflow.com/a/29634307
score: 0
type: AnswerComment

http://stackoverflow.com/q/29666859
answer count: 3
has title: increment within a loop to alter css value doesn't work
possible better answer: http://stackoverflow.com/a/29666904
tagged with: zepto
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29667422
accepted answer: http://stackoverflow.com/a/29667422
has answer: http://stackoverflow.com/a/29666904
has body: I tried to increment the value of current 'top' property value within a foreach. http://jsfiddle.net/fqmnksgL/ var percent = 50; $('div').forEach(function (obj, i) { $(obj).css('top', $(obj).css('top') + percent); }); Is there anything wrong with my code above?
type: Question
has answer: http://stackoverflow.com/a/29667005
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47472505
score: 0

http://stackoverflow.com/comment/47383679
type: QuestionComment
comment on: http://stackoverflow.com/q/29619558
score: 1
has text: @JamesWayne I don't think it's either. I just checked gmail again and it looks like it doesn't unhide mouse at all this time when I checked. I suspect we can create a mouse move event once the keypress is detected.
type: Comment

http://stackoverflow.com/q/29620686
has answer: http://stackoverflow.com/a/48847008
has answer: http://stackoverflow.com/a/29621542
has comment: http://stackoverflow.com/comment/47385932
has answer: http://stackoverflow.com/a/47208169
upvote count: 192
type: Question
tagged with: ecmascript-6
possible better answer: http://stackoverflow.com/a/44727502
has answer: http://stackoverflow.com/a/56871430
has answer: http://stackoverflow.com/a/44727502
tagged with: javascript
has answer: http://stackoverflow.com/a/40624564
answer count: 17
favorite count: 0
has answer: http://stackoverflow.com/a/48617807
has comment: http://stackoverflow.com/comment/47385969
has comment: http://stackoverflow.com/comment/76437514
has title: Is it possible to destructure onto an existing object? (JavaScript ES6)
has body: For example, if I have two objects: var foo = { x: "bar", y: "baz" } and var oof = {} and I wanted to transfer the x and y values from foo to oof. Is there a way to do that using the ES6 destructuring syntax? Perhaps something like: oof{x,y} = foo
has answer: http://stackoverflow.com/a/39513820
has answer: http://stackoverflow.com/a/52222271
has comment: http://stackoverflow.com/comment/47385596
has answer: http://stackoverflow.com/a/76741620
has answer: http://stackoverflow.com/a/51219312
has answer: http://stackoverflow.com/a/43331441
downvote count: 2
accepted answer: http://stackoverflow.com/a/40624564
tagged with: destructuring
has answer: http://stackoverflow.com/a/39420319
has answer: http://stackoverflow.com/a/43240713
has answer: http://stackoverflow.com/a/41966418
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/46642672
score: 190
has answer: http://stackoverflow.com/a/58604023

http://stackoverflow.com/a/29583937
has comment: http://stackoverflow.com/comment/47316041
accepted answer of: http://stackoverflow.com/q/29583844
has comment: http://stackoverflow.com/comment/47316372
has comment: http://stackoverflow.com/comment/47461471
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47316258
downvote count: 0
has body: Try this: var arr=[4,8,6,2]; var toNum=parseInt(arr.join(''))+1; arr=toNum.toString().split('').map(Number); console.log(arr);//[4, 8, 6, 3] with function: function addOne(arr){ for(var i=0;i&lt;arr.length;i++){ if(arr[i]&gt;9 || arr[i]&lt;-1)return null; } var toNum=parseInt(arr.join(''))+1; arr=toNum.toString().split('').map(Number); return arr; } var a=[4,8,6,2]; a=addOne(a);
type: Answer
answers question: http://stackoverflow.com/q/29583844
upvote count: 2
score: 2

http://stackoverflow.com/q/29573969
answer count: 1
tagged with: parsing
tagged with: serialization
type: UnansweredQuestion
has body: Everything is in the title! ^^ I know about some SourceCode browsers for js; they usually permit to find some small stuff when the code relatively abides in structure by the current informal js coding norm. (eg, use of the new operator, functions mainly created through definitions (F foo() {}) rather than through expression statements or literal objects (var foo = F(){}, { foo: F(){} }), etc; norm i precisely happen not to do adhere to). but, what would truly interest me would be a full parsing of the code, a tool returning, for example, a JSON file containing the whole code, that is, all the statements, function calls, even the parameters of the function calls (usually forgotten in js sourcebrowsers, because those objects are de facto anonymous objects/functions; however they are precisely abundantly used in functional-like programming, and thus get invisible to all source browsers i met) the purpose of course would be to create from that JSONized code, my own source browser, that would hopefully go farther than the average one, and would meet my needs to browse my code easily, see also easily, which variable is defined where, and some other stuff that might enhance my coding experience. anyhow; i'm not particularly attached to the JSON format, altho of course since i'd code my source browser in JS, it'd be the immediate easy input, but any other data representation format is OK, what matters is a parser that transforms code into a mouthpiece object¹. Anything looking and doing sth like that (eg a L/Hinter with a more verbose and informative output, or else) is welcome ;) thanks in advance :) ¹ "object": an object as JS defines it, ie, an abstract data alike or identical to a dictionary; not an object as class-based OO languages define it (class instances)
tagged with: representation
has comment: http://stackoverflow.com/comment/47297814
has comment: http://stackoverflow.com/comment/47297315
has comment: http://stackoverflow.com/comment/47296990
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/47297248
type: Question
has comment: http://stackoverflow.com/comment/47297816
tagged with: javascript
has title: howto get a JSON (or equivalent) representation of a JavaScript *code file* (the code, as a string, in input)?
score: 0
has answer: http://stackoverflow.com/a/37412930

http://stackoverflow.com/comment/47434176
comment on: http://stackoverflow.com/a/29646340
has text: yes it is already what I have don, am looking for a way to tell the ref that you will not pop up the "save as" window but download it automatically to the default location
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47370963
type: QuestionComment
has text: Does your app have more code than the one you put in the question? If yes, could you also add that, as with the current code it's hard to tell what the problem is.
score: 0
comment on: http://stackoverflow.com/q/29612175
type: Comment

http://stackoverflow.com/a/29623830
answers question: http://stackoverflow.com/q/29623619
downvote count: 0
upvote count: 3
type: AcceptedAnswer
has body: No need to get fancy with percentages, just keep it simple with this: $("button").click(function() { if($("div").position().left &lt; 0){ $("div").animate({left: "0px"},1000); }else{ $("div").animate({left: "-90%"},1000); } }); Demo: http://jsbin.com/juxoko/4/
type: Answer
accepted answer of: http://stackoverflow.com/q/29623619
score: 3

http://stackoverflow.com/comment/47256195
has text: Did you... clear the cache after changing?
comment on: http://stackoverflow.com/q/29536318
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/64714823
type: Comment
comment on: http://stackoverflow.com/a/29549390
score: 0
type: AnswerComment
has text: Huge help - this worked great for me when hiding columns and needing to wrap to the next row.

http://stackoverflow.com/comment/47480459
has text: React doesn't remove anything in this case, since there is no whitespace between elements in the first place. If you want to add whitespaces between the li elements, you can interleave the array with `' '`. Example: http://jsfiddle.net/j7pLprza/2/
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29670991

http://stackoverflow.com/q/29608893
has body: I have two MVC Razor views (.cshtml) that have a virtually identical Javascript function within them. In order to de-duplicate my javascript code I want to extract the Javascript from the views to a single external Javascript file (.js) containing the function (with a parameter that can be used to differentiate the minor differences need for each view). The Javascript in the views contains Razor syntax to access many asp.net resource file (.resx) text values (e.g. var foo = '@ResourceFileName.Bar';) which the Razor engine unfortunately does not parse for me. To overcome this I could pass all the resource file text values to the function in the .js file as parameters – but I prefer not to do that as the parameter list would become very large. The RazorJS package (http://www.nuget.org/packages/RazorJS) will allow me to use Razor syntax within a .js file but this package was last published way back in 2011, which worries me. What techniques could I use to call the externalised function without a huge long parameter list ?
score: 0
answer count: 1
tagged with: razor
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29608994
tagged with: asp.net-mvc
has title: Call an external .js file javascript function without a long parameter list
type: Question
has answer: http://stackoverflow.com/a/29608994
tagged with: javascript

http://stackoverflow.com/comment/47442965
score: 0
type: Comment
has text: so you don't need to wrap $q.defer() in $http() to return a promise?
comment on: http://stackoverflow.com/a/29651410
type: AnswerComment

http://stackoverflow.com/q/29568554
answer count: 1
tagged with: code-behind
tagged with: javascript
has answer: http://stackoverflow.com/a/29568609
has body: I have a weird problem. I use JavaScript on a Sharepoint page. I reference following JavaScript code: var statusId = ''; var notifyId = ''; function AddNotification(message) { notifyId = SP.UI.Notify.addNotification(message, true); } function RemoveNotification() { SP.UI.Notify.removeNotification(notifyId); notifyId = ''; } function AddStatus(message) { statusId = SP.UI.Status.addStatus(message); SP.UI.Status.setStatusPriColor(statusId, 'red'); } function RemoveLastStatus() { SP.UI.Status.removeStatus(statusId); statusId = ''; } function RemoveAllStatus() { SP.UI.Status.removeAllStatus(true); } Then when the user clicks a button, a notification should appear with the message "please wait...". Before the calling C# method exits, it should remove the notification. Like this: protected void SaveButton_Click(object sender, EventArgs e) { System.Web.UI.ScriptManager.RegisterStartupScript(this, this.GetType(), "Notif", "AddNotification('" + Core.Classes.ResourceHelper.LoadResource(Core.Classes.ResourceName.PleaseWaitString) + "');", true); //Busiess logic... if (ActivityDate.SelectedDate == null || //Date required ActivityProjectnumber.SelectedIndex == 0 || //Project number required ActivityActivity.Text == string.Empty || //Activity description required EndTime.SelectedDate.Hour &lt; StartTime.SelectedDate.Hour || // EndTime.SelectedDate.Hour == StartTime.SelectedDate.Hour &amp;&amp; //Start time should not be less or equal end time EndTime.SelectedDate.Minute &lt;= StartTime.SelectedDate.Minute) // { StatusSetter.SetPageStatus(Core.Classes.ResourceHelper.LoadResource(Core.Classes.ResourceName.CheckRequiredFieldsString), Core.Classes.ResourceHelper.LoadResource(Core.Classes.ResourceName.WarningString), this.Controls); return; } //If business logic passed, save item. SaveItem(); System.Web.UI.ScriptManager.RegisterStartupScript(this, this.GetType(), "Notif", "RemoveNotification();", true); //Problem lies here... } The notification is displayed when the user clicks the but…
tagged with: scriptmanager
type: AnsweredQuestion
has title: System.Web.UI.ScriptManager.RegisterStartupScript only getting executed once
accepted answer: http://stackoverflow.com/a/29568609
type: Question
tagged with: c#
tagged with: sharepoint
score: 0

http://stackoverflow.com/comment/47294026
has text: Yup, it worked. And thanks for the instructions for using the site. There goes checkmark!
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29561688
type: Comment

http://stackoverflow.com/comment/47232561
type: QuestionComment
comment on: http://stackoverflow.com/q/29539438
score: 0
has text: have you tried a data: url?
type: Comment

http://stackoverflow.com/q/29554634
has body: I have a class which implements interface, I need to call that method from JSNI in GWT.see the below code, interface: public interface HeaderFormatter { String format(String value); } class: public GWTGrouping implements HeaderFormatter { public String format(String value){ return "&lt;span&gt;&lt;i class='fa fa-stop'&gt;&lt;/i&gt;&lt;/span&gt;"; } public void performGrouping(){ if(isgroup){ grouping(); } } public static native void grouping() /*-{ //dont want to pass whole class to this method (this) //Need to access format(String value) Method which will return some logic //How to access that method here by passing interface not whole class }-*/; }
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29616638
has title: How to call interface(instantiate) from JSNI in Google Web toolkit(GWT)
has answer: http://stackoverflow.com/a/29616638
type: AnsweredQuestion
type: Question
tagged with: gwt
tagged with: java
score: 0
answer count: 1

http://stackoverflow.com/comment/47297018
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29574033
type: Comment
has text: thank you for you answer @Kaiido, I'm afraid that wont do the job because the element is rotated, and getBoundingClientRect will give me the rect surrounding my given rectangle and I need the values of the inner one

http://stackoverflow.com/a/29546252
has comment: http://stackoverflow.com/comment/47244924
answers question: http://stackoverflow.com/q/29545689
score: 1
upvote count: 1
has body: You mean a single UNFOLLOW button that will allow your visitor to unfollow a particular user's Facebook, Twitter &amp; Instagram profile? If that's the case, then you need to dig into the APIs &amp; SDKs of these three social networks. My guess is that the latest version of Facebook Graph API doesn't allow such things to be done programmatically. In fact, FB removed many things that were earlier very handy for the developers, in the new Graph API as part of reducing spammy and unwanted apps. A simple alternative solution is to use the Follow Button plugin of Facebook. You could just echo the profile link of the FB user at runtime on it like this: &lt;div class="fb-follow" data-href="https://www.facebook.com/zuck" data-colorscheme="light" data-layout="standard" data-show-faces="true"&gt;&lt;/div&gt; So, if your visitor is already logged in to Facebook and have been following that user, then your visitor could simply click the faded blue Follow button of this plugin, allowing them to unfollow that profile! For the other two social networks, just go through their APIs.
downvote count: 0
has comment: http://stackoverflow.com/comment/47267126
type: Answer

http://stackoverflow.com/comment/47392371
type: Comment
has text: @reporter i added a link in the description
comment on: http://stackoverflow.com/q/29624336
score: 0
type: QuestionComment

http://stackoverflow.com/comment/47375586
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29596357
has text: → [meta post](http://meta.stackoverflow.com/q/290054/1048572) discussing this question
score: 0

http://stackoverflow.com/comment/47527002
has text: [ReSharper](https://www.jetbrains.com/resharper/) is the asp.net cousin to WebStorm, designed to work with VS, and uses the same plugins as WebStorm and other JetBrains IDEs.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29684416

http://stackoverflow.com/q/29657804
tagged with: nav
downvote count: 1
tagged with: highlighting
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47455866
answer count: 1
has body: I have a web page with anchor links and I wish for them to stay highlighted when they are clicked AND when the user manually scrolls down. I have seen some jquery code here codepen.io/jakob-e/pen/mhCyx that does what I wish to do, however I wish to achieve this effect using raw javascript and I can't see it posted anywhere. Thanks for any help.
favorite count: 0
has answer: http://stackoverflow.com/a/29658305
type: UnansweredQuestion
has title: Highlighting nav without jquery
upvote count: 2
score: 1

http://stackoverflow.com/comment/47506528
type: AnswerComment
comment on: http://stackoverflow.com/a/29684434
type: Comment
has text: Actually, your code seems to work if you include the jQueryUI library: http://jsfiddle.net/do6usepq/
score: 0

http://stackoverflow.com/a/29569702
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47289136
type: Answer
accepted answer of: http://stackoverflow.com/q/29569435
has body: Basically, this was a bunch of undefined references. This is how I ended up solving this: var timeout = null; $(".wysiwygtext").on("keyup keypress paste mouseup", function (e, t) { clearTimeout(timeout); var element = $(this).html(); var value = $(this).val(); timeout = setTimeout(function (e, t) { console.log(element); console.log(value); }, 2000); }); I defined timeout outside the function, as clearTimeout(timeout); was throwing a timeout is undefined error. Next, I defined element and value outside of the timeout as $(this).html() and $(this).val() weren't referencing the right thing. Lastly, I kept console.log(element) and colsole.log(value) inside the timeout, so they will log 2 seconds after one of the above events.
score: 2
answers question: http://stackoverflow.com/q/29569435
downvote count: 0
has comment: http://stackoverflow.com/comment/47289307
has comment: http://stackoverflow.com/comment/47289527
has comment: http://stackoverflow.com/comment/47289506
has comment: http://stackoverflow.com/comment/47289241
upvote count: 2
has comment: http://stackoverflow.com/comment/47289187

http://stackoverflow.com/a/29590311
has comment: http://stackoverflow.com/comment/47337619
has comment: http://stackoverflow.com/comment/47473231
has comment: http://stackoverflow.com/comment/47330392
has comment: http://stackoverflow.com/comment/47330460
upvote count: 18
has comment: http://stackoverflow.com/comment/47515681
has comment: http://stackoverflow.com/comment/47336368
has comment: http://stackoverflow.com/comment/47452338
has body: To be honest, I'm not quite sure why it's caused and what's causing your date to be "toString-ed" before showing it in the input. However, I did find places to restructure your directive, and remove much unnecessary code, such as $compile service, attributes changes, scope inheritance, require in the directive, etc.. I used isolated scope, since I don't think every directive usage should know the parent scope as this might cause vicious bugs going forward. This is my changed directive: angular.module('ui.bootstrap.demo').directive('myDatepicker', function() { return { restrict: 'A', scope: { model: "=", format: "@", options: "=datepickerOptions", myid: "@" }, templateUrl: 'datepicker-template.html', link: function(scope, element) { scope.popupOpen = false; scope.openPopup = function($event) { $event.preventDefault(); $event.stopPropagation(); scope.popupOpen = true; }; scope.open = function($event) { $event.preventDefault(); $event.stopPropagation(); scope.opened = true; }; } }; }); And your HTML usage becomes: &lt;div my-datepicker model="container.two" datepicker-options="dateOptions" format="{{format}}" myid="myDP"&gt; &lt;/div&gt; Edit: Added the id as a parameter to the directive. Plunker has been updated. Plunker
has comment: http://stackoverflow.com/comment/47452161
has comment: http://stackoverflow.com/comment/47330299
has comment: http://stackoverflow.com/comment/47329197
score: 17
has comment: http://stackoverflow.com/comment/47335111
has comment: http://stackoverflow.com/comment/47522398
has comment: http://stackoverflow.com/comment/47453776
has comment: http://stackoverflow.com/comment/47465123
has comment: http://stackoverflow.com/comment/47329265
has comment: http://stackoverflow.com/comment/47329892
has comment: http://stackoverflow.com/comment/47329152
has comment: http://stackoverflow.com/comment/47452424
answers question: http://stackoverflow.com/q/29562213
type: Answer
has comment: http://stackoverflow.com/comment/47330101
downvote count: 1

http://stackoverflow.com/q/29643738
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29645033
has comment: http://stackoverflow.com/comment/47429522
has title: Change div position after refresh page
has comment: http://stackoverflow.com/comment/47429104
tagged with: css
has answer: http://stackoverflow.com/a/29644172
has comment: http://stackoverflow.com/comment/47430123
has comment: http://stackoverflow.com/comment/47428450
has comment: http://stackoverflow.com/comment/47428491
type: Question
has comment: http://stackoverflow.com/comment/47428576
tagged with: javascript
score: 0
answer count: 2
has body: I have 3 div like this code :- and when click refresh button Refresh We change my div, But i need when refresh my page, Change my div. So, I don't need to click on refresh, I need when open page change the position of div every time My Javascript code is :- var chain = [ document.getElementById("div1"), document.getElementById("div2"), document.getElementById("div3") ], wrapper = document.getElementById("wrapper"), refresh = document.getElementById("refresh"); refresh.onclick = function() { chain.push( chain.shift() ); for ( var i=0, len = chain.length; i < len; i++ ) { var el = chain[i]; wrapper.removeChild(el); wrapper.appendChild(el); }; console.log(chain); };
tagged with: jquery
has comment: http://stackoverflow.com/comment/47428839
type: UnansweredQuestion

http://stackoverflow.com/q/29626054
type: Question
has comment: http://stackoverflow.com/comment/47396931
has title: Owl Carousel with React
has comment: http://stackoverflow.com/comment/47397772
has answer: http://stackoverflow.com/a/29673822
upvote count: 4
tagged with: reactjs
answer count: 2
has answer: http://stackoverflow.com/a/33780078
has body: I want to use Owl Carousel with React, and I am new to React. Please see this jsfiddle, I spent much time to do it. The JSX code var Carousel = React.createClass({ componentDidMount: function(){ $(React.findDOMNode(this)).owlCarousel({ items: 4 }); }, render: function(){ return( &lt;div id="inx-carousel-thumb" className="owl-carousel"&gt; { this.props.images.map(function(image, index){ return ( &lt;div className="item" key={index}&gt;&lt;img src={image} /&gt;&lt;/div&gt; ) }.bind(this)) } &lt;/div&gt; ); } }); var imagesList = [['http://www.myfacewhen.net/uploads/3908-troll-smile.jpg', 'http://www.captionite.com/templates/thumb-success.jpg', 'http://pauljadam.com/forma11y/img/rage-guy-teeth-smile.jpg'],['http://i2.kym-cdn.com/entries/icons/original/000/004/073/smile.png']]; var Container = React.createClass({ getInitialState: function(){ return { images: imagesList[0] }; }, changeImages: function(index) { this.setState({images: imagesList[index]}); }, render: function(){ return( &lt;div&gt; &lt;Carousel images={this.state.images} /&gt; &lt;input type="button" onClick={this.changeImages.bind(this, 0)} value="Images List 0" /&gt; &lt;input type="button" onClick={this.changeImages.bind(this, 1)} value="Images List 1" /&gt; &lt;/div&gt; ); } }); $(document).ready(function(){ React.render( &lt;Container /&gt;, document.getElementById('container') ); }); I included Jquery, Reactjs, Owl Carousel, too. The problem is that when I tap button "Images List 1" to change the source array of Owl Carousel, the item count of carousel should become 1. However, it is still 3, and it only change first item. I think React only replace first item and ignore whole div, but I don't know how to fix it. Please give me some hints.
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/25436445
score: 4
has comment: http://stackoverflow.com/comment/47396591
type: UnansweredQuestion

http://stackoverflow.com/a/29553572
answers question: http://stackoverflow.com/q/29553375
has body: Something like the following? function myFunction() { document.getElementById('target').value = document.getElementById('target').value.replace(/\b[a-z]/g, function(a) { return a.toUpperCase(); }); }; Go! How this works So first we detect when the button is clicked. Then we set the value to its original value but... We get the first letter in a word, then capitalize it. As simple as that!
type: Answer
score: 0

http://stackoverflow.com/q/29680899
tagged with: jquery
score: 0
answer count: 1
has title: Smooth refresh / display of updated table data
has answer: http://stackoverflow.com/a/29681280
accepted answer: http://stackoverflow.com/a/29681280
type: AnsweredQuestion
has body: I am using this function to populate a table with values from my database And I have a filter so it's possible to search But when I update my table, remove the old html and insert the new one, the page very briefly don't have anything, so it's blank, and it looks ugly if I am typing a long sentence like "bobby" That's 5 keyup functions and 5 refreshes, I hope you understand what I am on about, I want it so it looks smooth function getData(filter) { $.ajax({ url: '/Person/GetData', type: 'GET', data: { Filter: filter }, success: function (data) { // Template for HTML var template = ''; // Loop through the data $.each(data, function (index, value) { // Values from the database var personId = value['Id']; var firstName = value['FirstName']; var lastName = value['LastName']; var age = value['Age']; // Template for a new template += ' ' + ' ' + firstName + ' ' + ' ' + lastName + ' ' + ' ' + age + ' ' + ' Slett ' + ' '; }); // Add the template to the table body $('tbody').html(template); } }); }
has comment: http://stackoverflow.com/comment/47499050
type: Question
tagged with: javascript

http://stackoverflow.com/comment/47261791
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29555449
type: AnswerComment
has text: I'm sorry, I did not quite understand the problem. What do you mean by "need to achieve with my code"? You have a validate function in the comment of your question. You can swap that out with my checkEmail function.

http://stackoverflow.com/comment/47416131
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29636931
has text: hi Vlado - tried that - still no luck

marker
tag name: marker
tags question: http://stackoverflow.com/q/29605673
type: Tag

http://stackoverflow.com/comment/47491848
type: AnswerComment
type: Comment
has text: You *should* bind to the `submit` event instead of the `click` event, since forms can be submitted without clicking the button at the end.
comment on: http://stackoverflow.com/a/29677099
score: 2

http://stackoverflow.com/a/29617837
score: 1
has body: Starting in html5, there is a new hidden attribute that controls whether an element is shown or not. You should probably add this to the elements. That way, the elements are hidden at the same time the html is parsed, and there is no delay. You can also add this the standard way with jquery, by using $(element).attr("hidden", "true"); However, if you add the attribute with jquery, the delay will still be there, as there will be a delay between when the html is shown and when the js is loaded and run. Note: this only works in IE 11+
upvote count: 1
answers question: http://stackoverflow.com/q/29617742
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/47380499

http://stackoverflow.com/a/29610599
answers question: http://stackoverflow.com/q/29610422
has body: Do some changes in your datatable properties for pagination : $('.passes').dataTable({ "serverSide": true, "processing": true, "ajax": "/Pass/Datatable", "bDestroy": true, "iDisplayLength": 10, "aLengthMenu": [5, 10, 25, 50, 100], "sPaginationType": "full_numbers", "columns": [ { "orderDataType": "dom-text-numeric " }, { "orderDataType": "dom-text-numeric" }, { "orderDataType": "dom-text-numeric" }, { "orderDataType": "dom-text-numeric" }, { "orderDataType": "dom-text-numeric" }, { "orderDataType": "dom-checkbox" }, { "orderDataType": "dom-text-numeric" } ], "order": 5, "desc" });
type: Answer
has comment: http://stackoverflow.com/comment/47369688
score: 0

http://stackoverflow.com/a/29678442
score: 0
has comment: http://stackoverflow.com/comment/47494535
has comment: http://stackoverflow.com/comment/47495258
type: Answer
has body: Your variable names are just mis-matched on the fadeIn function. function fadeIn(element_input) { element_input.style.transition = "opacity 2.0s linear 0s"; element_input.style.opacity = 1; }
answers question: http://stackoverflow.com/q/29678148

http://stackoverflow.com/comment/47508874
type: Comment
type: QuestionComment
has text: The height of the div (drop down ) is set to auto. Setting overflow style on the modal and modal body only gives me a scroll content. I don't want that. I want a drop down that expands over the modal dialog which is does bit the anchors can't be clicked.
comment on: http://stackoverflow.com/q/29685656
score: 0

http://stackoverflow.com/comment/47307862
score: 0
type: Comment
has text: @naniyaw updated the answer that will skip if id is `""` or if there is no id.
type: AnswerComment
comment on: http://stackoverflow.com/a/29579468

http://stackoverflow.com/q/29546901
tagged with: javascript
has comment: http://stackoverflow.com/comment/47246842
type: UnansweredQuestion
favorite count: 0
has comment: http://stackoverflow.com/comment/47245539
type: Question
score: -2
has body: I am using jspdf to generate PDf file. When I use save function, it saves / download the file to 'Download' folder. Instead of that, I would like to save file to a specific folder automatically through JavaScript
downvote count: 2
answer count: 1
has comment: http://stackoverflow.com/comment/47245359
has comment: http://stackoverflow.com/comment/47245360
has answer: http://stackoverflow.com/a/29546958
has comment: http://stackoverflow.com/comment/47245364
has comment: http://stackoverflow.com/comment/47245327
has title: Save file to folder
upvote count: 0

http://stackoverflow.com/a/29658517
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29658146
has body: One easy solution would be to use placeholders that you shouldn't otherwise expect in the given context. I've used unicode zero-width characters in the below example: var arr = "A &amp;gt; , lgt; B , lgt; C &amp;gt; ; 100, 119, 150" .replace(/&amp;gt;/g, "\u200B") .replace(/&amp;lt;/g, "\u200C") .split(";"); arr.forEach(function(el, i) { arr[i] = el.replace(/\u200B/g, "&amp;gt;").replace(/\u200C/g, "&amp;lt;"); }); console.log(arr); //outputs ["A &amp;gt; , lgt", " B , lgt", " C &amp;gt; ", " 100, 119, 150"] Addressing the update you added to your question: Despite regex occasionally looking shorter, it usually offers worse performance by far, see for example this article on Coding Horror.
score: 1
has comment: http://stackoverflow.com/comment/47456991
has comment: http://stackoverflow.com/comment/47456718
answers question: http://stackoverflow.com/q/29658146
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47456652
type: Answer
has comment: http://stackoverflow.com/comment/47457100
has comment: http://stackoverflow.com/comment/47456953

http://stackoverflow.com/comment/47256423
comment on: http://stackoverflow.com/q/29552282
score: 0
type: Comment
type: QuestionComment
has text: This code is specifically to fix underscores found in *keys* of your array, not for values.

http://stackoverflow.com/q/29566614
has answer: http://stackoverflow.com/a/29573833
has title: How to hide a button on a template in a certain URL path for Meteorjs?
answer count: 2
upvote count: 1
tagged with: javascript
tagged with: meteor
has answer: http://stackoverflow.com/a/29567060
favorite count: 0
type: UnansweredQuestion
has body: I am quite new to Meteorjs, but finding it great to use. I want to know what is the best way to hide an element of a template depending on the route/url. Since I would like to use the same template again elsewhere but without certain elements in it. Thanks my code according to below solutions My helpers Template.postItem.helpers({ ownPost: function() { return this.userId === Meteor.userId(); }, commentsCount: function() { return Comments.find({postId: this._id}).count(); }, routeNameEqual: function(name){ var routeName= Router.current().route.getName(); return routeName === name; } }); My html {{#if routeNameEqual 'postsList2' }} Learn More {{else}} {{/if}} Crucial!! it is the route name not the route's path
downvote count: 0
score: 1
type: Question

http://stackoverflow.com/q/29591249
has comment: http://stackoverflow.com/comment/47329606
linked to: http://stackoverflow.com/q/16676311
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47329488
score: 0
has title: play framework javascript Routing Failed to load resource
tagged with: playframework
answer count: 1
has answer: http://stackoverflow.com/a/29604804
linked to: http://stackoverflow.com/q/14905392
has comment: http://stackoverflow.com/comment/64756853
has body: I am trying to make some Javascript Rounting in my Play Framework app and am running into some errors: I have a button with the id #next which should use Ajax to load some new image and text into a div named #content. In my Application.java I have implemented the following two methods: public static Result nextUser(int i) { return ok(content.render(users.get(i))); } public static Result javascriptRoutes() { response().setContentType("text/javascript"); return ok( Routes.javascriptRouter("jsRoutes", controllers.routes.javascript.Application.nextUser() ) ); } Made this content.scala.html file: @(user: User) &lt;img id="user" src="@routes.Assets.at(user.getImg())" /&gt; &lt;h2&gt;@user.getStatus()&lt;/h2&gt; Added this into to the routes file: GET /nextuser controllers.Application.nextUser(i: Int) GET /assets/javascripts/routes controllers.Application.javascriptRoutes() And then tried this Javascript code: &lt;script type="text/javascript" src="@routes.Application.javascriptRoutes()"&gt;&lt;/script&gt; &lt;script&gt; var userIndex = 1; $("#next").click(function() { jsRoutes.controllers.Application.nextUser(userIndex).ajax({ success : function(data) { $("#content").html(data); }, error: function(err) { } }); }); &lt;/script&gt; In the Application.java file in the javascriptRoutes Method the controllers.routes. can not be found. Does anybody know what is causing the error? Edit: I could solve the initial error thanks to this: Unable to resolve reverse routing methods in IntelliJ Now it looks like this: The nextUser Method cannot be found even when cleary defined. When I compile the application using activator compile and run it using activator run my chrome console looks like this: so still the routes file somehow cant be found.
accepted answer: http://stackoverflow.com/a/29604804
type: AnsweredQuestion
tagged with: playframework-2.3
tagged with: java

http://stackoverflow.com/q/29651435
upvote count: 1
has answer: http://stackoverflow.com/a/29651524
tagged with: internet-explorer
has body: I need to get the binary data from input type file using JavaScript. In IE10+ there is no problem because of FileReader, but in IE9 I do not know how to figure out. I saw some post that recomends to use Flash or ActiveX but ActiveX will require extra changes in security settings in IE and Flash to install Shockwave. Is there no any other options? Really?
tagged with: internet-explorer-9
has answer: http://stackoverflow.com/a/29652665
has title: IE9 input type file get binary data
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
score: 1
has comment: http://stackoverflow.com/comment/47443375
has comment: http://stackoverflow.com/comment/47443217
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/29558519
tagged with: jquery
linked to: http://stackoverflow.com/q/8125709
possible better answer: http://stackoverflow.com/a/29558787
downvote count: 1
score: 8
favorite count: 0
upvote count: 9
has title: how to split String based on \r\n
has answer: http://stackoverflow.com/a/29558562
accepted answer: http://stackoverflow.com/a/29558562
duplicate of: http://stackoverflow.com/q/8125709
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29558787
type: Question
tagged with: split
answer count: 2
has body: We are Developing phonegap application.We get Data form CSV file. It's look like this We need Data Split into two strings Like String1 String2 We tried like this but We don't have luck so Please guide me var split = string.split('\r\n'); Please help me
tagged with: arrays
tagged with: javascript

http://stackoverflow.com/comment/47496665
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29679061
has text: I dont get an exception in both of them but I do get 0 results. I double check the Id... it is correct. both: ".find({'admins': {$elemMatch: {'_id': '54b932c7ac3ec34a85e6256c'}}})" and ".find({'admins._id': '54b932c7ac3ec34a85e6256c'}})" didn't worked

http://stackoverflow.com/comment/47290980
comment on: http://stackoverflow.com/a/29567843
score: 0
type: Comment
has text: @BenjaminGruenbaum how is it not pure JavaScript? I'm being serious, I have no idea what you're talking about and I'm interested to know.
type: AnswerComment

http://stackoverflow.com/a/52456732
type: Answer
answers question: http://stackoverflow.com/q/29577977
has body: Alexandre Kirszenberg is correct, But another important thing to pay attention to , is where you put your binding. I have been stuck with a situation for days(probably because I'm a beginner), but unlike others, I knew about bind(Which I had applied already) so I just couldn't get my head around why I was still having those errors. It turns out that I had the bind in wrong order. Another is also perhaps the fact that I was calling the function within "this.state", which was not aware of the bind because it happened to be above the bind line, Below is what I had(By the way this is my first ever posting, But I thought it was very important, as I couldn't find solution any where else): constructor(props){ super(props); productArray=//some array this.state={ // Create an Array which will hold components to be displayed proListing:productArray.map(product=&gt;{return(&lt;ProRow dele={this.this.popRow()} prodName={product.name} prodPrice={product.price}/&gt;)}) } this.popRow=this.popRow.bind(this);//This was the Issue, This line //should be kept above "this.state"
score: 0

http://stackoverflow.com/q/29585646
has comment: http://stackoverflow.com/comment/47319481
has body: I have been a web developer for nearly 15 years, mostly backend PHP stuff and dabbled with frontend over all those years. Here recently the last few years I find myself building more and more with JavaScript so I have put an effort towards learning better. I am building a Project Management app now and the code below is part of a section that will open a click on Task record into a popup Modal window. A Task Modal allows edit-in-place task fields, an AJAX loaded comments/events panel, custom scrollbar DIVs, Date picker calendars, custom alerts, and more. So There is a LOT going on in the Task Modal code. There is literally a million ways to code a JavaScript app. I seem to prefer this style below for most of my recent apps... It is clean to read and easy to follow and understand. I saw an example design pattern tonight that is just like my code below and the are calling it a Facade. I never thought this was a Facade but maybe it is? I have a LOT to learn still. My question is about the mockup code below, it was over 1,000 lines and I removed 90% of it for this demo and post as my question is simple.... Inside of other functions in my code, I can access a cached selector or variable like this: projectTaskModal.cache.NAME My question is, since the cache section is not a function, when my code is ran, are the DOM Elements I am trying to cache, are they even called/cached? In other part of my app I have functions which are called which then execute the code within but this cache section has no function call. SO I am not sure if on page load, if these value would be set or not? If not, how would you suggest I go about mass-caching selectors? Sorry this question might not be great, i've been awake 48 hours~ var projectTaskModal = { // Turn ON/OFF Console and Alert Debug Messages projectDebugConsole: true, //true; projectDebugAlert: false, //true; // Cache some values for use across the Application cache: { taskId: $('#Task-id'), projectId: $('#Task-project-id'), isTaskMod…
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: Basic JavaScript Project Task Modal Structure
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/47319430
type: Question
has answer: http://stackoverflow.com/a/29585722
accepted answer: http://stackoverflow.com/a/29585722
score: 1

http://stackoverflow.com/q/29666029
type: Question
has answer: http://stackoverflow.com/a/29666229
has answer: http://stackoverflow.com/a/39907661
tagged with: javascript
upvote count: 2
answer count: 3
has answer: http://stackoverflow.com/a/29666088
has title: meteor.js using aldeed:tabular with RemoteCollectionDriver
tagged with: meteor
favorite count: 0
type: UnansweredQuestion
has body: I'm encountering an issue when trying to populate data from by collection to the aldeed:tabular module for meteor. My code looks like this and is the root of the project as a common.js file. All the code below is in a single file: root/lib/hello.js if (Meteor.isServer) { Meteor.startup(function () { // code to run on server at startup database = new MongoInternals.RemoteCollectionDriver("mongodb://localhost:27017/mydb"); idpool = new Mongo.Collection("idpool", {_driver:database}); Meteor.publish('idpool', function(){ return idpool.find(); }); }); } if (Meteor.isClient) { Meteor.subscribe("idpool"); } TabularTables = {}; Meteor.isClient &amp;&amp; Template.registerHelper('TabularTables', TabularTables); TabularTables.idpool = new Tabular.Table({ name: "idpool", collection: idpool, columns: [ {data: "_id", title: "id"} ] }); The Tabular code must be in common code any visible to the server and client but when I run the above the "idpool" collection is not defined (out of scope.) Reference Error: idpool is not defined Moving the DB declaration outside the scope to the top of the JS, then I cant publish and subscribe to it. i.e. : database = new MongoInternals.RemoteCollectionDriver("mongodb://localhost:27017/adaptiveid"); idpool = new Mongo.Collection("idpool", {_driver:database}); //rest of the code..... And if I try to add the a second time by the common Tabular portion of the code like this: idpool = new Mongo.Collection("idpool"); I get the following error : Error: A method named '/idpool/insert' is already defined What am I doing wrong here? How do I declare the DB server side and expose it to the common tabular code.
score: 2
downvote count: 0

http://stackoverflow.com/comment/47333038
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29574442
has text: tried everything so thanks for this it now works perfectly :)
type: Comment

http://stackoverflow.com/q/29619775
upvote count: 2
answer count: 1
tagged with: unique
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/29620135
accepted answer: http://stackoverflow.com/a/29620135
has title: Unique not working in angular.js
type: AnsweredQuestion
score: 2
downvote count: 0
has body: This is my code &lt;ul&gt; &lt;li ng-repeat="x in names | orderBy:'-name' | unique: 'name'"&gt; {{ ' Name = ' + (x.name | uppercase) + ' &amp;nbsp; &amp;nbsp; Roll No = ' + x.rollno }} &lt;/li&gt; &lt;/ul&gt; &lt;script&gt; angular.module('myApp', []).controller('namesCtrl', function($scope) { $scope.names = [ {name:'aaaaaa',rollno:'1'}, {name:'aabbbb',rollno:'2'}, {name:'aabbcc',rollno:'3'}, {name:'ddeegg',rollno:'4'}, {name:'ddeegg',rollno:'4'}, ]; }); &lt;/script&gt; It displays results as something like this Name = DDEEGG | Roll No = 4 Name = DDEEGG | Roll No = 4 Name = AABBCC | Roll No = 3 Name = AABBBB | Roll No = 2 Name = AAAAAA | Roll No = 1 But I want results with no duplicate entry like Name = DDEEGG | Roll No = 4 Name = AABBCC | Roll No = 3 Name = AABBBB | Roll No = 2 Name = AAAAAA | Roll No = 1
type: Question
tagged with: javascript

http://stackoverflow.com/a/29578719
type: Answer
answers question: http://stackoverflow.com/q/29578373
downvote count: 0
has body: I usually just leave it to lib like underscore or lodash to do this type of things, but you can definitely do this using plain vanilla js like user3906922 suggested. See below (and open your console to see the result...): var dishes = [ {nameEnglish: 'TAPENADE', nameLocal: 'Tapenade', description: 'xxxxxx', region: 'Provence-Alpes-Côte d\'Azur', regioncode: 'FR.B8', itemid: 'FR002', cuisineTypeIsoCode: 'FR', dishCategory: 'Bakery', country: 'France', type: 'top_10'}, {nameEnglish: 'GREEK STYLE MUSHROOMS ', nameLocal: 'xxxxx', region: 'All', regioncode: '', itemid: 'FR003', cuisineTypeIsoCode: 'FR', dishCategory: 'Pie / pizza', country: 'France', type: ''}, {nameEnglish: 'HAM &amp; CHEESE TOASTED SANDWICHS / WITH EGGS', nameLocal: 'Croque Monsieur / Croque Madame', description: 'xxxxxxx', region: 'All', regioncode: '', itemid: 'FR005', cuisineTypeIsoCode: 'FR', dishCategory: 'Sandwich', country: 'France'}, {nameEnglish: 'ONION SOUP', nameLocal: 'Soupe à l’oignon', description: 'xxxxx', region: 'All', regioncode: '', itemid: 'FR008', cuisineTypeIsoCode: 'FR', dishCategory: 'Pie / pizza', country: 'France', type: 'top_10'}, {nameEnglish: 'VEAL ESCALOPE WITH CREAMY MUSHROOM DRESSING', nameLocal: 'xxxxx', region: 'Lower Normandy', regioncode: 'FR.99', itemid: 'FR047', cuisineTypeIsoCode: 'FR', dishCategory: 'Side dish', country: 'France'}, {nameEnglish: 'ROASTED PORK WITH PRUNES', nameLocal: 'Roti de porc aux pruneaux', description: ' ', region: 'Poitou-Charentes', regioncode: 'FR.B7', itemid: 'FR048', cuisineTypeIsoCode: 'FR', dishCategory: 'Side dish', country: 'France'}, {nameEnglish: 'STUFFED TOMATOES', nameLocal: 'Tomates farcies', description: 'xxxx', region: 'All ', regioncode: '', itemid: 'FR049', cuisineTypeIsoCode: 'FR', dishCategory: 'Meat', country: 'France'}, {nameEnglish: 'VEAL PAUPIETTES', nameLocal: ' ', region: 'Lower Normandy', regioncode: 'FR.99', itemid: 'FR050', cuisineTypeIsoCode: 'FR', dishCategory: 'Meat', country: 'France'}, {nameEnglish: 'ROAST …
score: 1
upvote count: 1

http://stackoverflow.com/q/29574143
downvote count: 1
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29574190
has title: How to focus on imgs with same classes
answer count: 1
tagged with: javascript
score: 0
tagged with: focus
has answer: http://stackoverflow.com/a/29574190
tagged with: http://stackoverflow.com/tag/html
has body: Guys i tried to search but i couldn't understand any of the answers explanations, so here we go. I got three imgs (links to facebook, twitter and instagram) and i want to focus on the img when the cursor is above her. It works, but only on the first image. Any tips ? Here the code: HTML: &lt;div class="eight columns img-footer"&gt; &lt;img src="img/fb.png" class="img" onMouseOver="focaImg(event.type)" onMouseOut="focaImg(event.type)"&gt; &lt;img src="img/twitter.png" class="img" onMouseOver="focaImg(event.type)" onMouseOut="focaImg(event.type)"&gt; &lt;img src="img/insta.png" class="img" onMouseOver="focaImg(event.type)" onMouseOut="focaImg(event.type)"&gt; &lt;/div&gt; JavaScript: function focaImg(e){ var img = document.querySelector(".img"); if(e == "mouseover"){ img.style.opacity = "1"; img.focus(); }else{ img.style.opacity = "0.5"; } }
tagged with: css
favorite count: 0
has comment: http://stackoverflow.com/comment/47297227
upvote count: 1

http://stackoverflow.com/a/29642653
has comment: http://stackoverflow.com/comment/47452639
has comment: http://stackoverflow.com/comment/47453171
score: 0
type: AcceptedAnswer
has body: You are parsing the JSON string and instead of looping through the parsed value, you are looping through JSON strring. var obj = JSON.parse(jsonarry); myLogger("jsonarry.length == " + jsonarry.length); for (var key in jsonarry) { if (jsonarry.hasOwnProperty(key)) { myLogger(jsonarry[key].entryID + " - " + jsonarry[key].distance + " - " + jsonarry[key].calories); } } Use like below. var obj = JSON.parse(jsonarry); myLogger("jsonarry.length == " + jsonarry.length); for (var key in obj) { if (jsonarry.hasOwnProperty(key)) { myLogger(jsonarry[key].entryID + " - " + jsonarry[key].distance + " - " + jsonarry[key].calories); } } But, why are you looping through object ? You need to loop through array inside that object right ?
has comment: http://stackoverflow.com/comment/47471039
accepted answer of: http://stackoverflow.com/q/29642580
type: Answer
answers question: http://stackoverflow.com/q/29642580

http://stackoverflow.com/comment/47355103
comment on: http://stackoverflow.com/q/29604725
has text: What is the error message?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29571837
score: 1
has comment: http://stackoverflow.com/comment/47509379
has comment: http://stackoverflow.com/comment/47508562
has comment: http://stackoverflow.com/comment/47509453
has body: The line document.getElementById('three' +str).innerHTML = xmlhttp.responseText; fill just the 'three'+str element. You have to assign the AJAX response to a variable and to split it. Or, better, you can modify the edit_attendee.php script to return the whole div id=three[id] innerHTML with values assigned to the various columns. Here is, more or less, what to do in the edit_attendee.php: $id = filter_var($_GET['id'], FILTER_SANITIZE_STRING); // id comes from the query $choice = filter_var($_GET['choice'], FILTER_SANITIZE_STRING); // choice comes from the query $snum = filter_var($_GET['snum'], FILTER_SANITIZE_STRING); // snum comes from the query $first = 'column 1'; $second = 'column 2'; $third = 'column 3'; $fourth = 'column 4'; $fifth = " "; echo " $first $second $third $fourth $fifth "; I suggest you to avoid to use styles directly in the HTML code: to assign classes is far better, because the code is more manageable. For the same reason it is better to avoid too many open-close php tags between the code: a single echo printing a whole line is far easier to be debugged. A class="MyRow" assigned to your "three_something" row will require this CSS: .MyRow { display: table-row; } With this class you can assign without hassles other styles to every contained with the CSS: .MyRow div { display: table-cell; } Then the php to generate your page will be: <?php foreach ($rowing as $row) { echo " 1. 2. 3. 4. "; } ?> Variables in the form ${row['id']} allow you to write them between quotes without the need to open and close quotes, so the code is more readable. See https://php.net/manual/en/language.types.string.php#language.types.string.parsing.complex for more details. A small digression for a quicker explanation of the {} curly brackets: $glut = 'but'; echo "$glutton" // shows nothing, $glutton is not defined echo "${glut}ton" // shows "button" Back to your Javascript snippet, with these modifications the line document.getElementById('three' +str).innerHTML = xmlhttp.r…
accepted answer of: http://stackoverflow.com/q/29568874
has comment: http://stackoverflow.com/comment/47513670
has comment: http://stackoverflow.com/comment/47513575
answers question: http://stackoverflow.com/q/29568874
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47507214
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/47513620

http://stackoverflow.com/a/36925558
score: 1
has body: You can replace the <asp:button> with an HTML button, and use onclick to call your JavaScript function, and if you need a server side function add runat="server"
answers question: http://stackoverflow.com/q/29631847
upvote count: 1
type: Answer
downvote count: 0

http://stackoverflow.com/q/29672051
has body: I have written some very basic JS to hide, manipulate or change some text inside label tags that are child of some divs with specific names set by a (poor) CMS in response to a change on a select element. The obvious choice was to use DOM, however once a label has been changed once it doesn't change anymore, and I'm at a loss as to why. This is the JS: campi=["nome","avv_cat","ogg","dat_pub","dat_scad","scad_perm","ur","info","mod_pres","target"] for (i=0;i<campi.length;i++){ document.getElementById("layer_".concat(campi[i])).style.display="block"; } var sel= document.getElementById("avv_cat").value; switch (sel) { case "altr": ecc=[]; camb=["mod_pres","target"]; testi=["Modalità presentazione domanda:","A chi è rivolto?"]; break; case "cimit": ecc=["mod_pres","target"]; camb=[]; testi=[]; break; case "cont": ecc=[]; camb=["mod_pres"]; testi=["Scadenza e modalità presentazione domande"]; break; case 'conser': ecc=["dat_scad","scad_perm"]; camb=["target","mod_pres"]; testi=["Sono invitati:","Data e luogo della conferenza:"]; break; case 'manint': ecc=["target"]; camb=["mod_pres"]; testi=["Scadenza e modalità presentazione domande"]; break; } for (i=0;i<ecc.length;i++){ document.getElementById("layer_".concat(ecc[i])).style.display="none"; } //Ciclo per cambiare etichetta for (i=0;i<camb.length;i++){ //Crea il nuovo nodo nel DOM alert("tr"); var lay=document.getElementById("layer_".concat(camb[i])); var txt= document.createTextNode(testi[i]); //Rimpiazza lay.replaceChild(txt, lay.getElementsByTagName("LABEL")[0]); } And this is the HTML of the divs and the select concerned: (*) Titolo avviso(*): (*) Categoria(*): Altro Cimiteriale Contributi Conferenza di Servizi Manifestazione di Interesse Oggetto Avviso: Data Pubblicazione: Data Scadenza: Senza scadenza? : Modalità presentazione: L'avviso e' rivolto a: Per informazioni: Ufficio Responsabile: Seleziona Reset
score: 0
answer count: 1
type: UnansweredQuestion
tagged with: dom
tagged with: javascript
has title: JS DOM replaceChild not working the second time
type: Question
has answer: http://stackoverflow.com/a/29672901
has comment: http://stackoverflow.com/comment/47481868

http://stackoverflow.com/comment/47508297
has text: Please make it clear what your question is.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29685618
score: 0

http://stackoverflow.com/a/29583167
has comment: http://stackoverflow.com/comment/47316242
has comment: http://stackoverflow.com/comment/47316163
has comment: http://stackoverflow.com/comment/47314879
downvote count: 0
answers question: http://stackoverflow.com/q/29582590
type: Answer
has body: Each time you add the same control asp.net repeat it in with the same page, this lead to repeat the script section in your page with the same code and function names since ASP.NET renaming the controls, you need to depend on &lt;%=this.ClientID=> and just update all the controls that has the value $('[id*="lblTimeElapsed"]').text("set value"); my solution is to add prefix on your function name like this function &lt;%=this.ClientID %&gt;AutoUpdateValues(){ setInterval(function () { &lt;%=this.ClientID %&gt;UpdateValues(); }, 5000); } function &lt;%=this.ClientID %&gt;UpdateValues(){// your logic } instated of $('#&lt;%=lblTimeElapsed.ClientID%&gt;').text("set value"); use this $('[id^="&lt;%=this.ClientID %&gt;lblTimeElapsed"]').text("set value"); so when you call method will be something like this &lt;%=this.ClientID %&gt;UpdateValues(); &lt;%=this.ClientID %&gt;AutoUpdateValues(); anther solution can raise here to solve a problem of invoke one method to a set of controls in the same time with out run many functions is to use singleton object as follow.
score: 1
has comment: http://stackoverflow.com/comment/47315818
has comment: http://stackoverflow.com/comment/47316111
upvote count: 1

http://stackoverflow.com/comment/47409986
type: Comment
type: QuestionComment
has text: grep your wordpress folder(s) for "wplibs"
comment on: http://stackoverflow.com/q/29633511
score: 0

http://stackoverflow.com/q/29640761
has comment: http://stackoverflow.com/comment/47427784
tagged with: switch-statement
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/29641134
has comment: http://stackoverflow.com/comment/47423462
tagged with: arrays
has body: I am trying capture the number of vowels in input text, add them to an array, and then output the results to a form. The first part of my Javascript works fine (i.e. it uses the regular expressions to count the data as required). However, when I add them to the array and try to output a sorted list to colour code the top 3 results, my script fails. Can anyone help me where I've gone wrong? function countVowels() { var str = document.getElementById('inputTextUser').value; var countA = 0; var countE = 0; var countI = 0; var countO = 0; var countU = 0; for (var i = 0; i &lt; str.length; i++) { if (str.charAt(i).match(/[a-z]/i) !== null) { if (str.charAt(i).match(/a/i)) { countA++; } if (str.charAt(i).match(/e/i)) { countE++; } if (str.charAt(i).match(/i/i)) { countI++; } if (str.charAt(i).match(/o/i)) { countO++; } if (str.charAt(i).match(/u/i)) { countU++; } } } document.getElementById("vowelsA").value = countA; document.getElementById("vowelsE").value = countE; document.getElementById("vowelsI").value = countI; document.getElementById("vowelsO").value = countO; document.getElementById("vowelsU").value = countU; var vowelCounts = new Array(); vowelCounts[0] = countA; vowelCounts[1] = countE; vowelCounts[2] = countI; vowelCounts[3] = countO; vowelCounts[4] = countU; vowelCounts.sort(); var length = vowelCounts.length; //gets the array's length once before the loop var bigOne = vowelCounts[-1]; //Set background color for the first three higher counts. var color = ['red', 'green', 'blue']; for (i = 0; i &lt; length - 2; i++) { switch (bigOne) { case avowel: document.getElementById("vowelsA").style.backgroundColor = color[i]; avowel = ""; break; case evowel: document.getElementById("vowelsE").style.backgroundColor = color[i]; evowel = ""; break; case ivowel: document.getElementById("vowelsI").style.backgroundColor = color[i]; ivowel = ""; break; case ovowel: document.getElementById("vowelsO").style.backgroundColor = color[i]; ovowel = ""; break; case uvowel: document.getE…
tagged with: javascript
has comment: http://stackoverflow.com/comment/47423940
score: 0
has comment: http://stackoverflow.com/comment/47427902
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29640960
has title: Using a Switch statement to output to a form from Javascript array
has comment: http://stackoverflow.com/comment/47423536

http://stackoverflow.com/comment/47294597
type: QuestionComment
comment on: http://stackoverflow.com/q/29572143
has text: That is not what this code does. You should check the number of rows before you fetch anything. `id='msg'` is `echo`ed every time, and only the first row of the results. Every time you call your fetch method it retrieves a new row of results. Since you are not running this in a while loop it just deals with the first result row. It's being called again and again because of `setInterval()`, which is fine, but really you should look into my original comment.
score: 0
type: Comment

http://stackoverflow.com/a/29605549
accepted answer of: http://stackoverflow.com/q/29605197
has comment: http://stackoverflow.com/comment/47593977
answers question: http://stackoverflow.com/q/29605197
type: AcceptedAnswer
upvote count: 2
type: Answer
has body: Your variable i in function checkDeckDrawOne() has global scope, meaning it alters the value of i in the main loop: for (i = 0; i &lt; 4; i++) { dealerCards = []; playerCards = []; checkDeckDrawOne(dealerCards); checkDeckDrawOne(dealerCards); checkDeckDrawOne(playerCards); checkDeckDrawOne(playerCards); console.log("dealerCards",dealerCards,"playerCards",playerCards); console.log("firstDeckDrawn", firstDeck, "Number", firstDeck.length); } Change this: for (i = 0; i &lt; 1; i++) { drawCard(playersHand); } to this: for (var i = 0; i &lt; 1; i++) { drawCard(playersHand); } although why you need a loop here anyway is baffling.
score: 2
has comment: http://stackoverflow.com/comment/47360967
downvote count: 0

http://stackoverflow.com/comment/47242608
comment on: http://stackoverflow.com/q/29545484
type: Comment
type: QuestionComment
has text: if(e=1) should be if(e==1)
score: 1

http://stackoverflow.com/comment/47314712
has text: You could add a few event listeners like `mousedown`, `mouseup` and `mousemove` to the `window`. You can then read the button states on the `DOMContentLoaded` event. As far as I know there’s no way to detect mouse button state changes _before_ a page begins loading… With `mousedown` you can look at the `buttons` property.
type: Comment
comment on: http://stackoverflow.com/q/29583118
score: 0
type: QuestionComment

http://stackoverflow.com/q/29654630
score: 4
has comment: http://stackoverflow.com/comment/47451571
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47452175
has body: I have a button that once clicked, will expand a menu item, I want to be able to click one of those menu items programmatically through the java script console. Here's what i have for clicking the button, but need a little help on clicking the Ext.menu.Menu var fireButton=Ext.ComponentQuery.query('button[itemId=buttonID]')[0]; //find button id fireButton.fireEvent('click'); //open button/submenu var ok = Ext.ComponentQuery.query('menuitem')[0]; //excess menu item //how to click a menu item?? here's my menu: menuButton: new Ext.menu.Menu({ items: [ {text: 'OK', value: 'ok'}, {text: 'Next', value: 'next'}, ], listeners: { click: 'onClickMenuButton', } onClickMenuButtonItem: function(menu, item){ this.makeVisible(menu, item); }, makeVisible: function(menu, item){ var menuItem = Ext.getCmp(item.value); menuItem.isVisible()){ menuItem.setVisible(false); item.setIconCls('plusSign'); }), var openMenu = Ext.ComponentQuery.query('button[itemId=buttonID]')[0]; openMenu.fireEvent('click', openMenu); var clickMenu = Ext.ComponentQuery.query("menu")[0] clickMenu.items.filter('text','OK').fireEvent('click'); //Don't work!
has comment: http://stackoverflow.com/comment/47451692
type: Question
upvote count: 4
answer count: 2
has comment: http://stackoverflow.com/comment/47452319
has title: Click menu items from a Ext.menu.Menu
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47452417
has comment: http://stackoverflow.com/comment/47451895
has answer: http://stackoverflow.com/a/29657555
favorite count: 0
has comment: http://stackoverflow.com/comment/47451529
tagged with: extjs
has answer: http://stackoverflow.com/a/29657443
has comment: http://stackoverflow.com/comment/47453760

http://stackoverflow.com/comment/47512873
type: QuestionComment
has text: Ok, I think I solved my problem. I was in the process of making the jsFiddle and I removed all the other libraries that I was using. It turns out Box2DWeb.min.js was causing the problem. It works fine in v68 but not in v71. Anyway thanks :)
score: 0
comment on: http://stackoverflow.com/q/29685716
type: Comment

http://stackoverflow.com/comment/47373190
type: QuestionComment
comment on: http://stackoverflow.com/q/29609021
has text: You should build a minimal code example. Your fiddle has over 1000 lines of JS and a lot of CSS, I have not enough time to read all of that.
score: 0
type: Comment

http://stackoverflow.com/comment/47507979
type: Comment
comment on: http://stackoverflow.com/q/29684758
type: QuestionComment
score: 0
has text: @romuleald, sorry, my code shows the wrong function name at the end, loadCalendar should actually say createCalendar, I forgot to switch that out when i was cleaning up my code before posting it here. I'll edit it.

http://stackoverflow.com/comment/47281420
score: 2
has text: Are you trying to win an unnecessarily obfuscated regex contest? What exactly are you trying to do?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29565683

http://stackoverflow.com/comment/47344663
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29599111
has text: http://stackoverflow.com/a/358083/393908
score: 0

http://stackoverflow.com/comment/47232925
score: 0
type: AnswerComment
has text: All this does is change some hard coded button text...how does this answer question?
comment on: http://stackoverflow.com/a/29539376
type: Comment

http://stackoverflow.com/q/29549864
accepted answer: http://stackoverflow.com/a/29549956
type: AnsweredQuestion
score: 0
type: Question
has body: Hiding modal windows works fine on desktop computer with this code $(document).mouseup(function (e){ if ($("#full_window_dim").is(':visible') &amp;&amp; !$("#hodnotenie_hl_okno").is(e.target) &amp;&amp; $("#hodnotenie_hl_okno").has(e.target).length === 0){ $("#full_window_dim").fadeOut(); $('html, body').removeClass('stop-scrolling'); } }); but this code is not working on mobile phones (I have tried with iPhone 5 - Safari) How can I hide the element when users taps outside of the window on mobile phones ?
answer count: 2
has title: JavaScript - hide element when click outside not working on mobile phone
tagged with: mobile
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29549956
has answer: http://stackoverflow.com/a/30562479
possible better answer: http://stackoverflow.com/a/30562479

http://stackoverflow.com/a/29681827
answers question: http://stackoverflow.com/q/29680806
type: AcceptedAnswer
downvote count: 0
has body: Using slice works: Here is a Plunkr showing this.
type: Answer
accepted answer of: http://stackoverflow.com/q/29680806
score: 1
upvote count: 1

http://stackoverflow.com/comment/47483464
score: 2
comment on: http://stackoverflow.com/q/29672786
has text: That is not possible. Instead, redirect human visitors that follow the link to your Open Graph object from their Facebook feed to your index page, either client-side via JavaScript, or server-side (the latter would need an exception for the Facebook scraper, so that it will still read your meta data from the actually shared URL – see description of Like button for what User Agent it sends.)
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47473876
comment on: http://stackoverflow.com/a/29665242
type: AnswerComment
has text: Thanks for your answer. The problem with this is if I have empty or null values in my store which will be the case in my app the chart looks like this: https://fiddle.sencha.com/#fiddle/lbc Do you have any further suggestions for me?
score: 0
type: Comment

http://stackoverflow.com/comment/112016325
type: Comment
type: QuestionComment
has text: You might need to install the 'Express' $ npm install express --save [ExpressJS](https://expressjs.com/)
comment on: http://stackoverflow.com/q/29531896
score: 0

http://stackoverflow.com/comment/60190026
has text: @WilfredSpringer Please define "break on IE11". `flex-grow` is supposed to be animatable according to the spec; If IE11 doesn't implement that, this is its fault, not the spec nor the answer.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29625471

http://stackoverflow.com/q/29648982
has comment: http://stackoverflow.com/comment/47438015
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47438269
has body: I have this DIV: ...CONTENT... Then I have this snippet to hide it: $(function(){ $('.bTest').click(function(){ $('#p1').hide(function(){ alert("complete"); }); }); }); When I click the Testbutton on the Desktop Version, it is completely fine, it hides the div and fires the alert when done. On mobile (tested iPhone5 and Nexus 6) it hides the div. fires the alert and then SHOWS the div again? Why is that and what am I missing? //EDIT: This is the bTest class TEST //Full markup (not sure what's relevant): http://pastebin.com/4mc8ziyX
downvote count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/47438107
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47437917
score: -1
has comment: http://stackoverflow.com/comment/47438516
has comment: http://stackoverflow.com/comment/47437961
has comment: http://stackoverflow.com/comment/47437943
has answer: http://stackoverflow.com/a/29649088
answer count: 1
tagged with: jquery
favorite count: 0
has title: Unable to hide div in mobile device on click
type: UnansweredQuestion

http://stackoverflow.com/comment/47216588
score: 0
comment on: http://stackoverflow.com/q/29531493
has text: @Mairaj Ahmad yes onchange not working
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/57307435
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29673331
has text: Looks like your updated answer does answer the original question.
score: 0

http://stackoverflow.com/a/29678038
has comment: http://stackoverflow.com/comment/47493568
upvote count: 0
has body: You can get the children divs using: $("#combobox").children(); if you want the html/text you can use: $("#combobox").html() // or $("#combobox").text() Docs: http://api.jquery.com/children/ EDIT: Put this code inside your callback handler function. EDIT: If you want child's (which was clicked) text, use: $("#combobox").on("click", "div", function(){ console.log($(this).text()); // or .html() }); [You won't probably need the handler function for this]
has comment: http://stackoverflow.com/comment/47494015
score: -1
has comment: http://stackoverflow.com/comment/47494124
answers question: http://stackoverflow.com/q/29677918
has comment: http://stackoverflow.com/comment/47493843
downvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/47493490

http://stackoverflow.com/a/29657870
upvote count: 5
accepted answer of: http://stackoverflow.com/q/29657681
type: Answer
downvote count: 0
has body: Try $(document).ready(function() { $('.design').each(function() { var design = $(this).attr('data-design'); var id = $(this).attr('id'); var canvas = $(this).find("canvas")[0]; var ctx = canvas.getContext("2d"); var img = new Image; img.onload = function() { ctx.drawImage(this, 0, 0); }; img.src = design; }); }); name asset
score: 5
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29657681

http://stackoverflow.com/a/29597344
type: Answer
has comment: http://stackoverflow.com/comment/47404526
has body: Changing the app version (in app.yaml) should do what you need. Think of the app version as a (usually) hidden part of the namespace.
answers question: http://stackoverflow.com/q/29596501
score: 0

http://stackoverflow.com/comment/47293939
type: QuestionComment
comment on: http://stackoverflow.com/q/29571512
score: 0
has text: In any bug report, you need to record three things: what you did, what you wanted to see, and what you saw. Without those things, any attempt to respond to the bug is guesswork.
type: Comment

http://stackoverflow.com/a/29628106
score: 4
answers question: http://stackoverflow.com/q/29627627
type: Answer
has comment: http://stackoverflow.com/comment/47399678
has comment: http://stackoverflow.com/comment/47399530
has body: Programatically this is quite simple: Disable all checkboxes, except for the first one, at runtime When a checkbox is checked, disable it after that, and enable the next checkbox See the demo below, it should work as intended: $(function() { $('#status input[type="checkbox"]').each(function() { // Disable all but the first checkbox if ($(this).closest('tr').index() !== 0) { $(this).prop('disabled', true); } }).on('change', function() { // Once checked, disable it $(this).prop('disabled', true); // Then enable the next checkbox $(this).closest('tr').next('tr').find('input[type="checkbox"]').prop('disabled', false); }); }); Ready Set Go Warning: When input elements are disabled, their values are not sent when a form is submitted. You might want to disable interaction in other ways instead of relying on the boolean attribute disabled. @Rich has an alternative solution of disabling pointer events, which I have modified my demo for. I have added some CSS styles so users can tell if a checkbox is clickable or not: $(function() { $('#status input[type="checkbox"]').each(function() { // Disable all but the first checkbox if ($(this).closest('tr').index() !== 0) { $(this).closest('tr').addClass('disabled'); } }).on('change', function() { // Once checked, disable it $(this).closest('tr').addClass('disabled checked'); // Then enable the next checkbox $(this).closest('tr').next('tr').removeClass('disabled'); }); }); tr { background-color: #BEEB9F; } tr.disabled { background-color: #FFFF9D; } tr.disabled.checked { background-color: #97C4A6; } tr.disabled input { pointer-events: none; } Ready Set Go
upvote count: 4
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29627627

url
tags question: http://stackoverflow.com/q/29580629
tags question: http://stackoverflow.com/q/29619143
tag name: url
tags question: http://stackoverflow.com/q/29683302
tags question: http://stackoverflow.com/q/29549309
tags question: http://stackoverflow.com/q/29552317
tags question: http://stackoverflow.com/q/29672213
tags question: http://stackoverflow.com/q/29637953
tags question: http://stackoverflow.com/q/29634157
type: Tag
tags question: http://stackoverflow.com/q/29609876

http://stackoverflow.com/comment/47365505
type: Comment
type: QuestionComment
has text: You need to wrap the alert in an anonymous handler. That is how event handling works. Currently `init()` call fires the alert. http://jsfiddle.net/295sgf5c/3/
score: 5
comment on: http://stackoverflow.com/q/29609979

http://stackoverflow.com/comment/47340314
score: 0
type: Comment
has text: This is the answer!! That works, callback is a very smart method in asynchronous environment, I also found another [way](http://stackoverflow.com/questions/17954743/node-js-and-express-passing-sqlite-data-to-one-of-my-views) but I did not try it and it seems breaking the clear structure of database controller. Thank you very much!
comment on: http://stackoverflow.com/a/29596118
type: AnswerComment

http://stackoverflow.com/comment/47655812
type: Comment
has text: The best that I could come up with was using background-image property of the and injecting svg into it as shown in this [jsfiddle](https://jsfiddle.net/cannibalflea/zvybwkjp/6/)
score: 0
comment on: http://stackoverflow.com/a/29604029
type: AnswerComment

http://stackoverflow.com/comment/47439292
comment on: http://stackoverflow.com/a/29596981
type: AnswerComment
has text: Maybe o need to open new question. Cause you are right on my first prolem. Thank very much.
score: 0
type: Comment

http://stackoverflow.com/comment/70699427
has text: do you want to achieve something like this? [jsfiddle](https://jsfiddle.net/prisoner849/gmtLf02u)
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29682858

http://stackoverflow.com/a/29556163
has comment: http://stackoverflow.com/comment/47265159
score: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/47264843
answers question: http://stackoverflow.com/q/29555964
has comment: http://stackoverflow.com/comment/47264691
type: Answer
upvote count: 1
has body: $(#element).text() will not return value from input or select . to get value from input, select you need to use .val() function . $(#element).val() will give value of selected element in select box to get text of selected option you need to use below code var text = $("#element option:selected").text(); to get value of selected option you need to use below code var value = $("#element option:selected").val(); or var value = $("#element").val();

http://stackoverflow.com/a/29616155
score: 0
has body: I think your router.map is wrong. Try using it in this way - Todos.Router.map( function () { this.resource('todos', { path: '/' }, function () { this.route('active'); this.route('completed'); }); });
type: Answer
answers question: http://stackoverflow.com/q/29613054
has comment: http://stackoverflow.com/comment/47383284

http://stackoverflow.com/a/29566627
has comment: http://stackoverflow.com/comment/47286056
type: Answer
has body: Simplest way to pass location: function getImages(location) { $.ajax({ type: "GET", url: 'loadImages.php?location='+location, // simply add as query string success: function(data) { $('#gallery').html(data); } }); } Then in your PHP file: # Path to image folder $imageFolder = $_GET["location"];
answers question: http://stackoverflow.com/q/29565170
score: 0

http://stackoverflow.com/comment/47513579
type: Comment
comment on: http://stackoverflow.com/a/29685987
has text: @user3364730 my apologies, my emitter code was missing a line. I've updated it in my answer, please copy it into your codebase again and try again ( from looking at your site everything is in the right spots ).
score: 0
type: AnswerComment

http://stackoverflow.com/a/29645023
type: Answer
has body: Change this code $(this).html(); Into parseFloat($(this).html().replace(",",""));
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29644972
upvote count: 1

http://stackoverflow.com/a/29533990
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47221187
type: Answer
answers question: http://stackoverflow.com/q/29533856
score: 2
upvote count: 2
has body: I think the do should be capitalized, e.g: var time = moment(raw, 'YYYY-MM-DD HH:mm:SS').format('MMMM Do YYYY h:mm:ss a'); (See docs http://momentjs.com/) That appears to work for me in your JSFiddle example.
accepted answer of: http://stackoverflow.com/q/29533856

http://stackoverflow.com/comment/47520951
type: Comment
comment on: http://stackoverflow.com/a/29677063
score: 1
has text: @Vistor it not finish solution, just a sample, you should test it well. As i say above - it possibly not working or working with errors in some cases
type: AnswerComment

http://stackoverflow.com/comment/47319322
type: Comment
type: QuestionComment
score: 0
has text: Yeah, the lengths are always equal, and the sort array always contains the ids of each item in the objects array.
comment on: http://stackoverflow.com/q/29585475

http://stackoverflow.com/comment/47495619
has text: it will return error `Failed to execute 'querySelector' on 'Document': '#1' is not a valid selector`
comment on: http://stackoverflow.com/a/29679078
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/66200891
comment on: http://stackoverflow.com/a/29682623
has text: I post a dead link.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47389210
type: QuestionComment
comment on: http://stackoverflow.com/q/29622643
score: 0
has text: show us which plugin you have used?
type: Comment

geography
type: Tag
tag name: geography
tags question: http://stackoverflow.com/q/29665035

http://stackoverflow.com/comment/47253255
comment on: http://stackoverflow.com/q/29550723
has text: yes, this is a tool to be used in a small framework.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29643903
tagged with: angularjs-scope
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29648379
favorite count: 0
linked to: http://stackoverflow.com/q/28638823
tagged with: angularjs
upvote count: 1
tagged with: angularjs-directive
has answer: http://stackoverflow.com/a/29648379
type: AnsweredQuestion
has title: angularjs many controllers ng design material
score: 1
tagged with: angularjs-controller
has body: Ng-design-material requiers a controller to manage ui component. But I also need a controller on the same page to manage user data and logics (such as input or timer). According this Q/A, it's not possible to have two controllers in the same element. So the question is, what could be the best practice, better solution to do what I want ? http://codepen.io/anon/pen/jEgYwd var app = angular.module('HelloApp', ['ngMaterial']); app.controller('AppCtrl', ['$scope', '$mdSidenav', function($scope, $mdSidenav){ $scope.data = ""; $scope.toggleRight = function() { $mdSidenav('right').toggle() .then(function(){ $log.debug("toggle RIGHT is done"); })} }]); In the example above, "data" should be somewhere else?

http://stackoverflow.com/comment/47287447
comment on: http://stackoverflow.com/q/29569027
type: Comment
has text: The browser should do this for you automagically if the headers being sent from the server for those files are allowing caching (usually by default yes for javascript files)
type: QuestionComment
score: 2

http://stackoverflow.com/comment/98936816
type: Comment
has text: @Osiris I'm facing the same problem. 2019 and leaflet-heatmap doesn't have the getValueAt method yet. I wonder if you solved it already and could give me a hand, please
comment on: http://stackoverflow.com/a/29680876
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47271316
has text: Can you check this [JSFiddle](http://jsfiddle.net/uegqfu01/5/) Just try changing 24 mjeseci and 12 mjeseci, when 12 mjeseci is selected only "95 kn/mj" should be shown, without "Promotivna cijena" text
type: Comment
comment on: http://stackoverflow.com/a/29557156
score: 0
type: AnswerComment

http://stackoverflow.com/q/29642205
has comment: http://stackoverflow.com/comment/47425735
answer count: 0
has title: HTML tags not working with Content-Type: application/json
has comment: http://stackoverflow.com/comment/47426035
type: Question
has comment: http://stackoverflow.com/comment/47425991
has body: HTML tags are displaying on browser when I use header("Content-Type: application/json; charset=UTF-8"); When I use bellow table code in file, it is displaying same code on browser, it should display just inner content. On browser table is displaying like this. &lt;table&gt; &lt;tr&gt; &lt;td&gt;Id&lt;/td&gt; &lt;td&gt;Name&lt;/td&gt; &lt;td&gt;Email&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&amp;nbsp;&lt;/td&gt; &lt;td&gt;&amp;nbsp;&lt;/td&gt; &lt;td&gt;&amp;nbsp;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; it should display Name1 Name2 Name3 It is my complete code &lt;?php header("Access-Control-Allow-Origin: *"); header("Content-Type: application/json; charset=UTF-8"); $conn = new mysqli("localhost", "root", "", "angular"); $result = $conn-&gt;query("SELECT * FROM user"); $outp = ""; while($rs = $result-&gt;fetch_array(MYSQLI_ASSOC)) { if ($outp != "") { $outp .= ","; } $outp .= '{"id":"' . $rs["id"] . '",'; $outp .= '"name":"' . $rs["name"] . '",'; $outp .= '"father":"'. $rs["father"] . '"}'; $outp .= '"designation":"'. $rs["designation"] . '"}'; } $outp ='{"records":['.$outp.']}'; $conn-&gt;close(); echo($outp); ?&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt;Id&lt;/td&gt; &lt;td&gt;Name&lt;/td&gt; &lt;td&gt;Email&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&amp;nbsp;&lt;/td&gt; &lt;td&gt;&amp;nbsp;&lt;/td&gt; &lt;td&gt;&amp;nbsp;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has comment: http://stackoverflow.com/comment/47426132
score: 0
has comment: http://stackoverflow.com/comment/47425849
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has comment: http://stackoverflow.com/comment/47426134
has comment: http://stackoverflow.com/comment/47425838

http://stackoverflow.com/comment/47546414
type: Comment
has text: Go into the web part configuration and go to the Miscellaneous section and deselect 'Disable View Selector Menu' You can also turn on/off the search box that way.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29679884

http://stackoverflow.com/comment/47524619
has text: I will take a look to the github issue. Your answer is the way to go in the given circumstances, so i accept it.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29633820
type: Comment

http://stackoverflow.com/comment/47362493
type: Comment
has text: You could use jQuery. $('.button').on('click', function() { $('.div').css('overflow-x', 'hidden'); });
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29607510

http://stackoverflow.com/a/29537323
answers question: http://stackoverflow.com/q/29537116
has body: if i understand right this is what you want? // JavaScript Document var cell = $('td.bg_status'); // Get the td value var avai_value = $('.avai').text(); cell.each(function() { var cell_value = $(this).html(); // continue if td value is not 20 if(avai_value!=20){ if ((cell_value &gt;= 0) &amp;&amp; (cell_value &lt;=19)) { $(this).css({'background' : '#FF9900'}); } else if ((cell_value &gt;= 20) &amp;&amp; (cell_value &lt;=39)) { $(this).css({'background' : '#99cc00'}); } else if (cell_value &gt;= 40) { $(this).css({'background' : '#99ccff'}); } } });
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/89094101

asp.net-mvc-3
tags question: http://stackoverflow.com/q/29567286
tag name: asp.net-mvc-3
type: Tag

http://stackoverflow.com/a/29624214
downvote count: 0
type: Answer
has body: Your best option is to not render all those things and store object versions of them and only show a max of 50 rows at a time via pagination. Storing that many objects in memory, in JS is no problem. Storing all of those in DOM on the other hand will bring browsers to their knees. 5000 is at around the upper bound of what a browser can do on a good machine while maintaining decent performance. If you start modifying some of those rows and tweaking things ('hiding', 'showing') things definitely will get even slower. The steps would look something like: Organize the data into an array of objects, your hash map is great for supplementary and quick access purposes. Write some sorting and filtering functions that will give you the subsets of data you need. Write a paginator so you can grab sets of data and then get the next set based on some modified params Replace your "draw/render" or "update" method with something that displays the current set of 50 that meets the criteria entered. The following code should be considered pseudo code that probably works: // Represents each row in our table function MyModelKlass(attributes) { this.attributes = attributes; } // Represents our table function CollectionKlass() { this.children = []; this.visibleChildren = []; this.limit = 50; } CollectionKlass.prototype = { // accepts a callback to determine if things are in or out filter: function(callback) { // filter doesn't work in every browser // you can loop manually or user underscorejs var filteredObjects = this.children.filter(callback); this.visibleChildren = filteredObjects; this.filteredChildren = filteredObjects; this.showPage(0); }, showPage: function(pageNumber) { // TODO: account for index out of bounds this.visibleChildren = this.filteredChildren.slice( pageNumber * this.limit, (pageNumber + 1) * this.limit ); }, // Another example mechanism, comparator is a function // sort is standard array sorting in JS sort: function(comparator) { this.children.sort(comparator); } } fu…
has comment: http://stackoverflow.com/comment/47410356
upvote count: 4
answers question: http://stackoverflow.com/q/29571578
has comment: http://stackoverflow.com/comment/47412919
score: 4
has comment: http://stackoverflow.com/comment/47409941
has comment: http://stackoverflow.com/comment/47396626
has comment: http://stackoverflow.com/comment/47413220

firefox-addon
tags question: http://stackoverflow.com/q/29662790
tags question: http://stackoverflow.com/q/29661063
type: Tag
tags question: http://stackoverflow.com/q/29589874
tags question: http://stackoverflow.com/q/29535871
tag name: firefox-addon
tags question: http://stackoverflow.com/q/29618019
tags question: http://stackoverflow.com/q/29681489
tags question: http://stackoverflow.com/q/29541428
tags question: http://stackoverflow.com/q/29639448

http://stackoverflow.com/comment/47453647
score: 0
type: Comment
type: QuestionComment
has text: Some HTML that we can look at?
comment on: http://stackoverflow.com/q/29656888

http://stackoverflow.com/comment/47513061
type: QuestionComment
comment on: http://stackoverflow.com/q/29688021
has text: wow. i knew i was missing something stupid. THANK YOU
score: 0
type: Comment

http://stackoverflow.com/comment/47497704
comment on: http://stackoverflow.com/q/29677316
score: 0
type: Comment
type: QuestionComment
has text: The website is not mine, I just try to login to it using firebug command line.

http://stackoverflow.com/comment/47462423
type: Comment
comment on: http://stackoverflow.com/q/29661300
has text: Holy! It works on jsfiddle but it's not working here. What can it be? As I said, it was working fine and then stopped and I change nothing.
score: 0
type: QuestionComment

http://stackoverflow.com/q/29533103
has comment: http://stackoverflow.com/comment/47219230
tagged with: javascript
has answer: http://stackoverflow.com/a/29533167
downvote count: 4
has comment: http://stackoverflow.com/comment/47219471
has comment: http://stackoverflow.com/comment/47219291
possible better answer: http://stackoverflow.com/a/29533167
has answer: http://stackoverflow.com/a/29533183
favorite count: 0
has answer: http://stackoverflow.com/a/29533292
has body: I need to create a list in my html with the results I get from a JavaScript function. My code is the following function (data) { for(var i=0; i&lt;data.length;i++){ alert(data[i].name) $("resultados").innerHTML = data[i].name+"\n" } }
score: -3
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29533213
upvote count: 1
has comment: http://stackoverflow.com/comment/47219354
type: Question
accepted answer: http://stackoverflow.com/a/29533213
has title: Create a list from javascript

http://stackoverflow.com/a/29587243
type: AcceptedAnswer
score: 0
type: Answer
has body: Since you're trying to get an object's Key by value, you can't really access it as an array using bracket notation. I used a function that can be found on this SO question: JavaScript object get key by value Then, I simply changed your click part to this: elem.bind("plotclick", function (event, pos, item) { if(item){ scope.dis= getKeyByValue(item.series.xaxis.categories, item.dataIndex); scope.$apply(); } }); Fiddle
accepted answer of: http://stackoverflow.com/q/29587038
answers question: http://stackoverflow.com/q/29587038
has comment: http://stackoverflow.com/comment/47337707

http://stackoverflow.com/comment/47278837
type: QuestionComment
type: Comment
has text: if you need to transfer entire functions through the 'Net, then you probably have a design error. That aside, you *can* transfer the source code of the function as a string and then `eval()` it, but ask any decent JavaScript developer whether you *should* do that – they'll say "nope nope nope".
comment on: http://stackoverflow.com/q/29564577
score: 0

http://stackoverflow.com/a/29639171
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/29627096
answers question: http://stackoverflow.com/q/29627096
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/59698904
has body: You have to make a general check using some conditional statement like if...else and comparing if the current Lat/Lng is falling out of a specified boundary (which is a world bound in your case). I would recommend you to look at this SO question that may provide you some leads of how to proceed.

http://stackoverflow.com/a/29605285
has comment: http://stackoverflow.com/comment/47356280
type: Answer
has comment: http://stackoverflow.com/comment/47356305
has comment: http://stackoverflow.com/comment/47356430
score: 2
has comment: http://stackoverflow.com/comment/47356413
answers question: http://stackoverflow.com/q/29605266
downvote count: 0
upvote count: 2
has body: document should not be a string: $(document).ready(function() { $("#name").mask("99/99/9999"); });

http://stackoverflow.com/a/29571908
score: 0
type: Answer
has body: The onLoadFinished event is triggered when the whole dom of the page has been loaded but if some javascript on the page dynamically loads some more resources or does some XHR calls you will have to watch the DOM. You can have a look at CasperJS which is written on top of phantomJS and has some waitForSelector methods for example to wait for a specific element to appear in the dom or waitForResource if you want to wait for a specific external resource. You can also check this answer that shows how to implement such a feature with plain PhantomJS.
answers question: http://stackoverflow.com/q/29571664
has comment: http://stackoverflow.com/comment/47301042

http://stackoverflow.com/comment/47454202
score: 0
type: Comment
type: QuestionComment
has text: Yes, i had try to research before i posted, but i had try most of the concatenation solution but none of them are working on mine, that is why i posted the question here and ask for a expert to point out my error.
comment on: http://stackoverflow.com/q/29657060

http://stackoverflow.com/q/29584822
score: 1
has comment: http://stackoverflow.com/comment/47317874
type: Question
accepted answer: http://stackoverflow.com/a/29591603
tagged with: javascript
has comment: http://stackoverflow.com/comment/47318665
upvote count: 1
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/29591603
tagged with: jquery
has body: I'm trying to pass a variable created with dynamic content to a function inside Javascript. The only problem is in the console it returns undefined, but its undefined with the value being passed Uncaught ReferenceError: zukeru is not defined profile.html:1 onclick Code: function getFriend(friend){ console.log(friend,toString()); document.cookie = "getuser="+friend; window.location="profile.html"; // change url to your's } function getFriendlist(){ var profile_pic_friend = ''; var flist = Cynergi.get('http://:3000/friends?my_username=eq.' + get_user); var flist_html = 'Friends: '; $.each(flist, function(i, item) { var profile_pic_ret = Cynergi.get('http://:3000/profile_pictures?username=eq.' + item.friend_username ); $.each(profile_pic_ret, function(i, item) { profile_pic_friend = item.pic_location; }); flist_html = flist_html + "&lt;div&gt;&lt;a onclick='getFriend("+item.friend_username+");'&gt;&lt;img width='100' height='100' src='"+ profile_pic_friend + "'&gt;&lt;br&gt;" + item.friend_username + "&lt;/a&gt;&lt;/div&gt;" }); $("#flist").html(flist_html); setTimeout(function() { getFriendlist(); }, 1000); } getFriendlist();
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has title: js passing a variable to a function returning undefined
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47317983

http://stackoverflow.com/comment/47310130
comment on: http://stackoverflow.com/a/29572688
type: Comment
has text: The correct term for the comma operator is "operand", not "argument".
score: 0
type: AnswerComment

http://stackoverflow.com/q/29613935
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: linechart
has answer: http://stackoverflow.com/a/30433255
tagged with: memory-leaks
favorite count: 0
has comment: http://stackoverflow.com/comment/48607254
tagged with: nvd3.js
tagged with: d3.js
type: AnsweredQuestion
score: 3
upvote count: 3
has title: nvd3 memory leak when creating a new chart
has body: I switched from google charts API to NVD3 and I am getting some huge problems with memory. The chart is created from the data acquired from the server, which changes depending on the passed parameters. When the parameters change (triggered by clicks on legend texts), the chart has to be redrawn as it may have different number of data lines. When the chart is drawn for the first time, everything works as expected (apart from one minor(?) error which I will describe later). However, after the parameters are changed, the chart initializes correctly, but after a few AJAX calls, the memory used by the chrome tab increases in a second to 1.5 GB and the tab freezes. There are no other errors when it happens. It's probably an issue of incorrect nvd3 usage as the data passed to the graph seems to be all right. I would really appreciate some help in resolving this problem. Edit: I think I located the problem and it might be some bug in nvd3. It happens when all the data lines (at least two) that are plotted in the chart have the same numerical data. In my case, I am getting temperature readings from the server and when the readings could not be correctly obtained the temperature is set to -273 for example. Then, when no readings could be obtained, all the data lines are like constant function y=-273 and the tab almost instantly eats up 1.5gb of memory and freezes. But if there is at least one other data line built using even a bit different data let's say y=-273.1 everything works ok. Does anybody have a clue what's going on? The other problem I mentioned is an error: Uncaught TypeError: Cannot read property 'each' of undefined nv.d3.js:5854 although it doesn't seem to have any effect on the generation of the chart. Below I post the relevant part of code. var chart; var dataSet = []; var initialized = false; function collectD3Data() { $.ajax({ type: 'GET', url: '/chartdata', data: { // some parameters to get different data from server }, success: function(response) { console.…
type: Question
accepted answer: http://stackoverflow.com/a/30433255
has comment: http://stackoverflow.com/comment/48607142

http://stackoverflow.com/comment/47508418
type: Comment
comment on: http://stackoverflow.com/a/29684030
type: AnswerComment
has text: Note that i included the logic directly in the template for simplicity, it would be perfectly fine to instead handle it within the controller and click event handler.
score: 0

http://stackoverflow.com/comment/47358509
type: QuestionComment
comment on: http://stackoverflow.com/q/29606392
score: 4
has text: And what is the problem?
type: Comment

http://stackoverflow.com/comment/47430992
type: QuestionComment
score: 0
has text: @Grundy - That should ideally be posted as an answer.
type: Comment
comment on: http://stackoverflow.com/q/29645101

http://stackoverflow.com/comment/47505252
type: QuestionComment
has text: How should I get shops array? I don't use $http, just define shops in main.js
comment on: http://stackoverflow.com/q/29683657
score: 0
type: Comment

http://stackoverflow.com/q/29624025
type: Question
has answer: http://stackoverflow.com/a/29624600
has comment: http://stackoverflow.com/comment/47391720
tagged with: javascript
tagged with: jquery
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47391719
has answer: http://stackoverflow.com/a/29624255
has body: I am using jquery to swap text on hover, as follows: $("#bottomMiddle").hover(function(){ $("#rightHeading").text("CMS heading"); $("#rightContent").text("CMS content"); },function(){ $("#rightHeading").text("This is the original heading"); $("#rightContent").text("This is the original content"); }); This works but the effect is harsh and would like to fade the text in and out, I have tried using .fadeIn(); but had no success. Is there any way to use this hover swap and get it to fade at the same time?
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29624255
has answer: http://stackoverflow.com/a/29624154
has title: Fade text when using jquery .hover
accepted answer: http://stackoverflow.com/a/29624154

http://stackoverflow.com/comment/47488041
type: Comment
type: QuestionComment
has text: hm...the [link](http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/xaxis/plotlines-color/) seems to open ok for me
comment on: http://stackoverflow.com/q/29671272
score: 0

http://stackoverflow.com/comment/47227873
type: QuestionComment
comment on: http://stackoverflow.com/q/29537766
score: 1
has text: Tried what? There are lots of tutorials and plugin scripts available. We don't know what problems you had implementing them
type: Comment

http://stackoverflow.com/comment/47236266
comment on: http://stackoverflow.com/a/29540347
type: AnswerComment
has text: no its not working .I need if i edit audi to bmw and click on listbox on page then i get updated value in listbox....not to need page refresh....
type: Comment
score: 0

http://stackoverflow.com/comment/47264843
type: Comment
has text: Your text and value are same??
comment on: http://stackoverflow.com/a/29556163
score: 0
type: AnswerComment

youtube-javascript-api
type: Tag
tags question: http://stackoverflow.com/q/29657100
tags question: http://stackoverflow.com/q/29641683
tag name: youtube-javascript-api
tags question: http://stackoverflow.com/q/29624319

http://stackoverflow.com/comment/47317386
type: Comment
has text: If you where writing your own, yes this is not a problem. If you where using the library linked to you need to use the name they gave it.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29584519

http://stackoverflow.com/comment/47223749
type: Comment
has text: This is not a solution... but as a fix you could simply put a named function as event handler rather than anonymous and call that function. And I will check why this issue happens? and has any better solution?
type: QuestionComment
comment on: http://stackoverflow.com/q/29535467
score: 0

http://stackoverflow.com/q/29535391
upvote count: 0
tagged with: arrays
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/29535498
accepted answer: http://stackoverflow.com/a/29535498
possible better answer: http://stackoverflow.com/a/29535794
has comment: http://stackoverflow.com/comment/47223752
downvote count: 1
has answer: http://stackoverflow.com/a/29535794
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47223463
has body: My Expected Output var Album = { album_desc: AlbumTitle, id: 1, album_title: 'ss', AlbumDescription: 'sdsd', ImageName: 'image.jpg', album_pics: below array }; I need to push the array dynamically like below,Above is my array how can i use this dynamically while uploading images ? how can i push the array in array ? Any suggestions ? "album_pics": [{ "media_type": "image", "last_modified_date": "2015-01-16T00:40:39.071Z", "thumnail_pic_loc": "3fe2a54346b3d54e-pinaki2.jpg", "large_pic_loc": "3fe2a54346b3d54e-pinaki2.jpg", "filter_type": "image/jpeg", "pic_id": "d5bc" } My expected output: { "album_desc": "Album 1", "id": "399234688", "album_title": "Album 1", "album_pics": [{ "media_type": "image", "last_modified_date": "2015-01-16T00:40:39.071Z", "thumnail_pic_loc": "3fe2a54346b3d54e-pinaki2.jpg", "large_pic_loc": "3fe2a54346b3d54e-pinaki2.jpg", "filter_type": "image/jpeg", "pic_id": "d5bc" }, { "media_type": "image", "last_modified_date": "2015-01-16T00:40:39.071Z", "thumnail_pic_loc": "3fe2a54346b3d54e-pinaki3.jpg", "large_pic_loc": "3fe2a54346b3d54e-pinaki3.jpg", "filter_type": "image/jpeg", "pic_id": "d5bd" }], }
score: -1
type: Question
answer count: 2
has title: how to push the array values in javascript

http://stackoverflow.com/q/29565444
has answer: http://stackoverflow.com/a/29565517
tagged with: javascript
has comment: http://stackoverflow.com/comment/47280529
tagged with: jquery
has answer: http://stackoverflow.com/a/29565690
favorite count: 0
has comment: http://stackoverflow.com/comment/47280548
type: Question
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47280508
tagged with: css
score: -1
has title: jQuery: wrap numerals inside div in a span
accepted answer: http://stackoverflow.com/a/29565517
answer count: 3
downvote count: 1
possible better answer: http://stackoverflow.com/a/29565774
has answer: http://stackoverflow.com/a/29565774
has body: I'm trying to figure out if this is at all possible, I have a setup like the markup below: £12.95 from £9.95 £6.95 £16.95 £11.95 from £1.95 but what I'm ideally after, if possible is something like this: £12.95 from £9.95 £6.95 £16.95 £11.95 from £1.95 Thus just wrapping the numerals in a span tag with the class price excluding any £ or from etc etc. Any suggestions would be greatly appreciated!
type: AnsweredQuestion
upvote count: 0

http://stackoverflow.com/q/29587721
has body: My understanding is that the Object.hasOwnProperty method checks if the object has a property name of it's own, meaning a non-inherited property. That would mean that the function should return false whenever the property a. doesn't exist, or b. if it's inherited. Correct me if I'm wrong, but unless this doesn't use classical inheritance, doesn't bar inherit from Foo in the code below? Why is the hasOwnProperty method returning true when the propname property is an inherited property? What did I get wrong here? Also, how would I use the hasOwnProperty on the Foo object? The code here returns false when checking the the Foo object. function Foo() { this.propname = 'test'; } var bar = new Foo(); console.log(bar.hasOwnProperty('propname')); // returns true console.log(Foo.hasOwnProperty('propname')); // returns false
answer count: 5
has comment: http://stackoverflow.com/comment/47323109
tagged with: hasownproperty
has answer: http://stackoverflow.com/a/29587855
type: AnsweredQuestion
score: 2
has title: JavaScript: Why does the Object.hasOwnProperty method behave like this?
possible better answer: http://stackoverflow.com/a/29587766
upvote count: 3
has answer: http://stackoverflow.com/a/29587766
has comment: http://stackoverflow.com/comment/47323202
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/29587855
tagged with: javascript
has comment: http://stackoverflow.com/comment/47323033
tagged with: inheritance
has comment: http://stackoverflow.com/comment/47323027
has answer: http://stackoverflow.com/a/29587800
has answer: http://stackoverflow.com/a/29587759
favorite count: 0
has answer: http://stackoverflow.com/a/29587812

http://stackoverflow.com/a/29589627
has body: jsFiddle demo $("#btntbl").click(function () { var parts = $("#txthidden").val().split(";"), i=0; for (;i&lt;parts.length;) { var j=0, tr="&lt;tr&gt;", subParts=parts[i++].split(","); for (;j&lt;3;) tr += "&lt;td&gt;" + (subParts[j++]||"") +"&lt;/td&gt;"; // concatenate $("#testTable").append( tr +"&lt;/tr&gt;" ); // Append once } });
score: 1
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29589575
has comment: http://stackoverflow.com/comment/47326397
upvote count: 1
has comment: http://stackoverflow.com/comment/47326338

http://stackoverflow.com/comment/47467676
has text: Can you add your html code please?, if you can use fiddle
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29664182

http://stackoverflow.com/comment/47395555
has text: i would upvote that if the question was how to show the category when at least one item is _present_, but i think the op wants to show the category if at least one _item.show is truthy_ for that category - at least that is how i understand it
comment on: http://stackoverflow.com/a/29626114
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/29601630
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29601303
has comment: http://stackoverflow.com/comment/47475336
has comment: http://stackoverflow.com/comment/47349476
has body: function pad(number, length, filler) { number = number + ""; if (number.length &lt; length) { for (var i = number.length; i &lt; length; i += 1) { number = filler + number; } } return number; } function incrementString (input) { var orig = input.match(/\d+$/); if (orig.length === 1) { orig = pad(parseInt(orig[0]) + 1, orig[0].length, '0'); input = input.replace(/\d+$/, orig); return input; } return input + "1"; } What does it do? It first checks if there is a trailing number. If yes, increment it and pad left it with zeros (with the function "pad" which you'd be able to sort it out yourself). string.replace is a function which works with argument 1 the substring to search (string, regex), argument 2 the element to replace with (string, function). In this case I've used a regex as first argument and the incremented, padded number. The regex is pretty simple: \d means "integer" and + means "one or more of the preceeding", which means one or more digits. $ means the end of the string. More info about regular expressions (in JavaScript): https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/RegExp (thanks @Casimir et Hippolyte for the link)
has comment: http://stackoverflow.com/comment/47383377
answers question: http://stackoverflow.com/q/29601303
type: Answer
has comment: http://stackoverflow.com/comment/47349530
has comment: http://stackoverflow.com/comment/47512756
score: 0
has comment: http://stackoverflow.com/comment/47491246

http://stackoverflow.com/a/29652187
score: 1
answers question: http://stackoverflow.com/q/29651844
upvote count: 1
type: AcceptedAnswer
has body: If you go with the instructions in the readme, you should get something along the lines of: var sortable = Sortable.create(simpleList, {}); $("#button").click(function () { sortable.option("disabled", true); });
type: Answer
accepted answer of: http://stackoverflow.com/q/29651844
downvote count: 0

http://stackoverflow.com/comment/47430761
score: 0
has text: working like a charm and thanks for your explantion too
type: Comment
comment on: http://stackoverflow.com/a/29645015
type: AnswerComment

spring
tags question: http://stackoverflow.com/q/29673748
type: Tag
tags question: http://stackoverflow.com/q/29569886
tag name: spring
tags question: http://stackoverflow.com/q/29555197
tags question: http://stackoverflow.com/q/29540489

http://stackoverflow.com/comment/48322469
type: Comment
type: QuestionComment
has text: I've added JSFiddle, however you cannot see the delay on the JSFiddle.
score: 0
comment on: http://stackoverflow.com/q/29626783

image
tags question: http://stackoverflow.com/q/29659042
tags question: http://stackoverflow.com/q/29655182
tags question: http://stackoverflow.com/q/29530557
tags question: http://stackoverflow.com/q/29659076
tags question: http://stackoverflow.com/q/29668574
tags question: http://stackoverflow.com/q/29575790
tags question: http://stackoverflow.com/q/29630464
tags question: http://stackoverflow.com/q/29561141
tags question: http://stackoverflow.com/q/29584873
tags question: http://stackoverflow.com/q/29572560
tags question: http://stackoverflow.com/q/29663578
tags question: http://stackoverflow.com/q/29640887
tags question: http://stackoverflow.com/q/29606123
tags question: http://stackoverflow.com/q/29687519
tags question: http://stackoverflow.com/q/29622643
tags question: http://stackoverflow.com/q/29644474
tags question: http://stackoverflow.com/q/29531418
tags question: http://stackoverflow.com/q/29541890
tags question: http://stackoverflow.com/q/29630578
tags question: http://stackoverflow.com/q/29617177
tags question: http://stackoverflow.com/q/29606850
tags question: http://stackoverflow.com/q/29595679
tag name: image
tags question: http://stackoverflow.com/q/29582866
tags question: http://stackoverflow.com/q/29551883
tags question: http://stackoverflow.com/q/29626314
tags question: http://stackoverflow.com/q/29560923
tags question: http://stackoverflow.com/q/29599171
type: Tag
tags question: http://stackoverflow.com/q/29678802
tags question: http://stackoverflow.com/q/29595597

http://stackoverflow.com/comment/47424258
has text: Can you just replicate the problem in fiddle? because I do not find the problem in normal bootstrap template.
comment on: http://stackoverflow.com/q/29641091
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47258169
score: 0
has text: I only want my JavaScript app from my domain to use the API exposed via GAE endpoints. Basically I have an API key set up already, but what does GAE offer in terms of validating that the usage of said key matches the restrictions I put on it? Clearly I need to check the existence of the key and those restrictions before my API does anything...
comment on: http://stackoverflow.com/a/29553476
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47351414
type: QuestionComment
comment on: http://stackoverflow.com/q/29602584
score: 0
type: Comment
has text: You have created `specificObject` using the frozen object. So, it's prototype is frozen and you are trying to modify the frozen property. How do you think it will work ?

http://stackoverflow.com/q/29638093
type: AnsweredQuestion
has body: I've multiple forms to navigate from starting form to final, I've NEXT and BACK buttons in each form in order to go forward and backward. What I want is to avoid confirmation of resubmission of form (Confirm Form Resubmission) ad my forms are using PHP Sessions and GET/POST values. What is the best approch to avaoid this according to my current scenario? I've a couple of things that are same over all in all forms &lt;input type="submit" name="PreviousSubmit" value="&lt;&lt;" class="submit_button" id="PrevSubmit"&gt; and form name: name="myform" The Jquery onclick action, jQuery(function () { // Back button $("#PrevSubmit").click(function () { history.go(-1); return false; }); }); What is the best approach in order to get the previous page without the confirmation of resubmission.
upvote count: 1
has answer: http://stackoverflow.com/a/29638134
type: Question
score: 1
has title: PHP multiple forms resubmission avoidance
tagged with: forms
downvote count: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/29638134
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: php

http://stackoverflow.com/q/29559218
has comment: http://stackoverflow.com/comment/47269067
has body: My problem is creating a method that (on clicking a element) collapse all other elements within the nestled list that are not the target element or associated parent containers. I have looked around but nothing works for my list. Basically I'm trying to collapse all active list elements except the target one. Using bootstrap to handle a lot of things. I have a method that makes a list element active on click. The alert seems to output the ids of elements that need to be affected, and nothing collapses. Suggestions? List Structure: - Building - Floor - Room Code: //JS - Attempt to collapse all elements not clicked: $('.expandable-menu a').click(function(e) { var parent = $("#" + e.target.id).attr('data-parent'); $(".expandable-menu a").each(function() { //if 1. has class active 2.Not target event, 3.Not a parent of target if ($(this).hasClass('active') && $(this).attr('id') !== (e.target.id) && $(this).attr('id') !== (parent)) { // alert($(this).attr('id') ); $(this).removeClass('active').addClass('collapsed'); } }); }); Biology Floor 4 Floor 3 Room 112
has comment: http://stackoverflow.com/comment/47269545
score: 2
has comment: http://stackoverflow.com/comment/47269206
has answer: http://stackoverflow.com/a/29559590
type: Question
has title: Auto-collapse nestled list using jQuery & Bootstrap
has comment: http://stackoverflow.com/comment/47276776
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47269131
has comment: http://stackoverflow.com/comment/47275629
upvote count: 2
tagged with: twitter-bootstrap
type: UnansweredQuestion

http://stackoverflow.com/q/29531676
tagged with: javascript
has title: how to convert array to JSON in javascript
has answer: http://stackoverflow.com/a/29531719
has body: We developing Phone-Gap app.We need Get CSV file data and into sqlite DB.We get data FILE API in phoneGap We code like this function readDataUrl(file) { var reader = new FileReader(); reader.onloadend = function(evt) { console.log("Read as data URL"); console.log(evt.target.result); }; reader.readAsDataURL(file); } function readAsText(file) { console.log('in readAsText'+file); var reader = new FileReader(); reader.onloadend = function(evt) { ss=evt.target.result; alert(ss); console.log("Read as text"); console.log(evt.target.result); }; reader.readAsText(file); } We get Like this But this format not insert into sqLite DB .We need JSON data. We need like this [ { "FOC":1, "price":0, "customerid":"ARU005", "lineamount":0, "items":"W.D.M.W HERBAL 250Mx24", "tdate":"2015-4-7", "qty":8, "orderId":"Himansu16:23:20020", "umo":"CTN", "descriptions":"100mg", "bookorder":"ABCARU0052320" } ] [ { "TOTALAMOUNT":1000, "DISCOUNT":1, "NETAMOUNT ":900, "VAT":0, "GROSSAMOUNT ":900, "BOOKORDER":"ABCARUOO7451", "CUSTOMERID":"ARU007", "TODAYDATE":"2015-4-7" } ] Please guide me.We get data form CSV file.NOW We need getting data convert into JSON so Please help me.
favorite count: 0
tagged with: android
score: 2
tagged with: cordova
has answer: http://stackoverflow.com/a/29531908
downvote count: 0
type: UnansweredQuestion
type: Question
tagged with: http://stackoverflow.com/tag/json
upvote count: 2
answer count: 2
linked to: http://stackoverflow.com/q/1293147
tagged with: arrays

http://stackoverflow.com/a/31400365
answers question: http://stackoverflow.com/q/29642987
has body: Convert your xml to java objects. This is unrelated to JGraph. If the .xsd is available, you can use JAXB for example. Once you have the java objects from your xml, you can use the information contianed in them to create edges and vertices. In your JGraph based application, the mxGraph class has methods insertVertex and insertEdge, which will take your positions and labels as parameters. You can for example loop throught the java objects parsed from the XML and call graph.insertVertex() for each. If the mxGraph object is not directly available, you can use mxGraphComponent.getGraph() to reach it. mxGraphComponent should be obtainable from the editor of your choice, ie. editor.getGraphComponent().
score: 0
type: Answer

http://stackoverflow.com/a/29534885
type: Answer
has body: Change the jquery version to lower. By seeing this thread i think version 1.10.2 is not support for ie8. i also tried in jsfiddle and test in ie8 there isissues. when i change to change the version it's working Fiddle $('#secondClick').click();
answers question: http://stackoverflow.com/q/29534537
score: 0
has comment: http://stackoverflow.com/comment/47223048

http://stackoverflow.com/q/29680950
answer count: 0
upvote count: 3
has body: I'm a bit confused, why this window.onbeforeunload = function () { socket.emit('foo') } does nothing, while this $(window).on("beforeunload", function () { socket.emit('foo'); }); Makes the job done on chrome 42.0.2311.90 m What is the difference? And how reliable jQuery version is? I want to use onbeforeunload to distinguish disconnect event while user leaves the app from disconnect event while something terribly failed in socket connection on the server or user side.
has title: jQuery beforeunload reliability
tagged with: socket.io
type: Question
score: 3
tagged with: javascript
has comment: http://stackoverflow.com/comment/47508766
linked to: http://stackoverflow.com/q/7255649
has comment: http://stackoverflow.com/comment/47555227
has comment: http://stackoverflow.com/comment/47499147
downvote count: 0
duplicate of: http://stackoverflow.com/q/7255649
tagged with: jquery
tagged with: onbeforeunload
favorite count: 0
has comment: http://stackoverflow.com/comment/47499429
type: UnansweredQuestion
tagged with: node.js

http://stackoverflow.com/comment/47251424
comment on: http://stackoverflow.com/a/29549914
type: AnswerComment
score: 0
type: Comment
has text: Also you can add certain console.warn() to certain lines of code to open the debugger. Similarly to console.debug from chrome

http://stackoverflow.com/comment/47294504
score: 0
comment on: http://stackoverflow.com/a/29572625
type: Comment
has text: And this explains the OP's question, which is that his two alternatives don't return the same result, how?
type: AnswerComment

http://stackoverflow.com/q/29650276
tagged with: validation
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/75068353
has body: how do I validate a string of html using javascript/jquery e.g of html string &lt;style type="text/css"&gt; .nai {position:absolute;top:0px;right:0px;z-index:90000; background-image:url("http://example.com/test.png"); background-repeat:no-repeat;width:19px;height:15px;} .nai:hover {width: 77px; background-image:url("http://example.com /test.png");} &lt;/style&gt; &lt;div style="width:160px;height:600px;position:absolute"&gt;&lt;/div&gt; am looking for basic validations like.whether start/end tag is proper or not tried using jquery's fns as follows var $str1 = $(str1); // html string into real html var len = $str1.length; // console.log($str1); for(var i=0;i&lt;len;i++){ if(typeof $($str1[i]).get(0).outerHTML!='undefined'){ final1+=unescapeHtml($($str1[i]).get(0).outerHTML); } } but above code doesnt validate &amp; rectify child elments tag/or start tag of an element if absent.
has answer: http://stackoverflow.com/a/29650792
has answer: http://stackoverflow.com/a/29650670
has comment: http://stackoverflow.com/comment/47440413
has comment: http://stackoverflow.com/comment/47440455
has title: validate html syntax using javascript/jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47440536
type: Question
tagged with: javascript
tagged with: jquery
score: 0
answer count: 3

http://stackoverflow.com/a/29589839
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47326889
upvote count: 2
type: Answer
score: 2
has body: number_format inserts a comma for numbers >= 1000 number_format(1100, 2) prints "1,100.00" Running parseFloat("1,100.00") will output 1 and 1200 - 1 = 1199. This should work better with parseFloat: number_format($total_sales, 2, ".", "");
accepted answer of: http://stackoverflow.com/q/29589713
answers question: http://stackoverflow.com/q/29589713
downvote count: 0
has comment: http://stackoverflow.com/comment/47326771

http://stackoverflow.com/q/29678896
type: Question
has answer: http://stackoverflow.com/a/29680754
has body: I'm trying to draw a Google Analytics graph to display on my own dashboard using a Third Party vendor's API. My code works, but I have several webs registered, and it always shows me the same default unless I change it manually (the field is called PROPERTY). I would like a different default web. I tried to hide the view selector and put the ids directly (ga:'xxxx'), and that works if put it into the chart execution: renderWeekOverWeekChart('ga:123456'); and it works correctly, showing to me the correct chart I want. How do I show the active users? I don't know where can I define ids value for it. Here is my code (I have changed CLIENT ID to 'XXX') Thirtd Party Visualizations
answer count: 1
tagged with: google-analytics-api
upvote count: 3
tagged with: google-analytics
accepted answer: http://stackoverflow.com/a/29680754
downvote count: 0
tagged with: javascript
has title: Embed API Third Party Visualizations Google analytics
type: AnsweredQuestion
score: 3
favorite count: 0

http://stackoverflow.com/comment/47265351
type: Comment
comment on: http://stackoverflow.com/a/29555748
type: AnswerComment
score: 0
has text: In meanwhile I managed to figure it out :) and checked the content with the $scope.$watch('$viewContentLoaded', function(){ ..., and it gets back the datas I want to see :) Unfortunately in my view, nothing renders :s Here is the view: {{ selectedWork.Title }} {{ selectedWork.subTitle }} Maybe mistyped something?

http://stackoverflow.com/comment/47445612
comment on: http://stackoverflow.com/a/29607654
score: 0
type: AnswerComment
has text: I have added a fiddle so it is easier to understand. Actually I changed it a little bit, so that both pullouts remain underneath each others on the left side. ultimately I'd like to make the inactive pullouts invisible when one pullout is clicked and only have them return to visibility when the active pullout is closed. http://jsfiddle.net/schakalwal/gwu2gob3/
type: Comment

http://stackoverflow.com/q/29553290
tagged with: node.js
score: 1
has answer: http://stackoverflow.com/a/29554411
upvote count: 1
linked to: http://stackoverflow.com/q/29552397
type: Question
has title: Get access to Express mountpath from inside a module
tagged with: javascript
has answer: http://stackoverflow.com/a/29560567
has body: In an attempt to build a truly modular express app (one that can run stand alone or as a part of another app) I need to find out the cleanest way to find the mount path from inside the subapp. For a short example, lets say that there are two files: main.js and subapp.js main.js var express = require('express'); var app = express(); var localApp = express(); var subapp = require('./subapp'); app.use('/foo', subapp); app.use('/bar', localApp); console.log(localApp.mountpath); // yes, this prints '/bar' as expected ... subapp.js var express = require('express'); var app = express(); var truePath = app.mountpath; // I wish this would point to '/foo', but instead points to '/' ... module.exports = app; What is the best way (as in cleanest) to find the mountpath from inside the module? I'm doing this trying to solve this problem: Access to mountpath variable from inside a template using express in a non hardwired way. As shown in the example, tried already with app.mountpath without success
tagged with: express
answer count: 3
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29554256

http://stackoverflow.com/comment/47459507
type: Comment
comment on: http://stackoverflow.com/a/29570753
has text: I was trying something like this: {{cards[index].titles}} . What this index-1 do ? it reverse the array ? Anyway Thanks again
score: 0
type: AnswerComment

http://stackoverflow.com/a/29602109
has body: This problem is only solve using headers. in html or in php header('Content-Type: text/html; charset=utf-8');
score: 0
answers question: http://stackoverflow.com/q/29601656
has comment: http://stackoverflow.com/comment/47350662
type: Answer

http://stackoverflow.com/a/29698719
has body: I see you are binding the same event twice: In the first code snippet: $(document).keydown(function(e) { //Fonctionne touche[e.keyCode] = true; }); In the second code snippet: $(document).on('keydown', function (e) { var top = $roger.offset().top; var left = $roger.offset().left; var newTop = top; var newLeft = left; switch (e.keyCode) { case 32: newTop = top - 400; $roger.css("top", newTop); setTimeout(function () { $roger.css("top", top); }, 100); break; case 37: newLeft = left - 50; $roger.css({left: newLeft}); break; case 39: newLeft = left + 50; $roger.css({left: newLeft}); break; } }); If you merge both codes together, that means that these 2 events will conflict and only one of the two will work. Solution Merge them properly together like this to solve it: $(document).on('keydown', function (e) { touche[e.keyCode] = true; var top = $roger.offset().top; var left = $roger.offset().left; var newTop = top; var newLeft = left; switch (e.keyCode) { case 32: newTop = top - 400; $roger.css("top", newTop); setTimeout(function () { $roger.css("top", top); }, 100); break; case 37: newLeft = left - 50; $roger.css({left: newLeft}); break; case 39: newLeft = left + 50; $roger.css({left: newLeft}); break; } });
type: AcceptedAnswer
upvote count: 1
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29683233
answers question: http://stackoverflow.com/q/29683233
type: Answer
score: 1

http://stackoverflow.com/comment/47244037
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29545418
has text: sorry I'm trying hard to reformat my code comment to view it nicely like you did :)
score: 0

http://stackoverflow.com/q/29581556
type: AnsweredQuestion
tagged with: jquery
type: Question
has title: Trying to pass <%> HTML Variable to Javascript - Node, Passport, and Stripe
tagged with: http://stackoverflow.com/tag/html
tagged with: node.js
score: 0
answer count: 1
has body: A bit of a newbie here. I've been looking for an answer that works and found some similarities in a Jade problem but I'm not using Jade. I have passed an "user" attribute into an HTML view as so: app.get('/profile', isLoggedIn, function(req, res) { res.render('profilePage/profilePage.html', { user : req.user // get the user out of session and pass to template }); }); Then, in my profile HTML, I can access my user property like so: &lt;%=user.local.firstname%&gt;'s Profile However, I want to allow Stripe to send the user's credit card info via the Stripetoken. I have managed to include a variable amount from a text field the user inputs. However, I want to append the user property so I can use it in my callback. Here is the javascript/jquery that's included in the profile html: &lt;!-- New section --&gt; &lt;script type="text/javascript"&gt; &lt;!-- Fill in your publishable key --&gt; Stripe.setPublishableKey('pkkey'); var stripeResponseHandler = function(status, response) { var $form = $('#contactForm'); var $amount = $('#amount').val(); if (response.error) { // Show the errors on the form $form.find('.payment-errors').text(response.error.message); $form.find('button').prop('disabled', false); } else { // token contains id, last4, and card type var token = response.id; // Insert the token into the form so it gets submitted to the server $form.append($('&lt;input type="hidden" name="stripeToken" /&gt;').val(token)); $form.append($('&lt;input type="hidden" name="amount" /&gt;').val($amount)); // and re-submit $form.get(0).submit(); } }; jQuery(function($) { $('#contactForm').submit(function(e) { var $form = $(this); // Disable the submit button to prevent repeated clicks $form.find('button').prop('disabled', true); Stripe.card.createToken($form, stripeResponseHandler); // Prevent the form from submitting with the default action return false; }); }); &lt;/script&gt; As you can see, I have managed to append the $amount variable so I can access it in the callback: module…
has answer: http://stackoverflow.com/a/30108524
tagged with: javascript
accepted answer: http://stackoverflow.com/a/30108524

http://stackoverflow.com/q/29616643
tagged with: iphone
has title: Is it possible to configure iOS native HTML5 date picker?
tagged with: ios
downvote count: 0
has body: I'm using the native date and time pickers with type=date for the mobile version of a website. I want to able to configure the iOS native HTML5 datetime picker keyboard to be RTL for arabic. Is that's possible at all?
tagged with: javascript
favorite count: 0
tagged with: android
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/29616728
score: 1
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/29616905

http://stackoverflow.com/comment/47336511
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29594563
score: 0
has text: I'm still quite new to d3 so I'm not exactly sure. But I don't think I'm using a data join as I'm not using the `join()` method anywhere in my script.

http://stackoverflow.com/q/29612451
has comment: http://stackoverflow.com/comment/47376846
favorite count: 0
has answer: http://stackoverflow.com/a/29613137
tagged with: asynchronous
accepted answer: http://stackoverflow.com/a/29616628
has comment: http://stackoverflow.com/comment/47376212
upvote count: 1
has comment: http://stackoverflow.com/comment/47373023
has answer: http://stackoverflow.com/a/29616628
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29613137
score: 1
type: Question
answer count: 2
has title: Incorrect returns from $.getJSON and node-async - server side node/express jsonp
has body: I'm getting an odd error when using $.getJSON with node-async to a server running node/express with jsonp response. I make two calls to the server using node-async iterating over an array but when all is done the second result has some properties which contain the values from the first. The odd thing is that the server side response IS coming back - as one of the properties that came back is correct - but another property looks like it is overwritten on the second call by the property from the first. On the server side, I've debugged it and checked the res.jsonp line which is returning the correct results, I've also checked it with some console logging server side. Code below - TLDR results are as follows: //Expecting results to be: [ {"series":1, options:{serverSays:"Here is series 1"},data: [a:1,b:2,c:3]}, {"series":2, options:{serverSays:"Here is series 2"}, data: [x:9, y:8, z:7]} ] //Actual Results are [ {"series":1, options:{serverSays:"Here is series 1"}, data: [a:1,b:2,c:3]}, {"series":2, options:{serverSays:"Here is series 2"}, data: [a:1,b:2,c:3]} ] Here's a simplified version of the code (with much junk taken out but logic remaining intact): var series = [ {id: 1}, {id: 2} ] var results = []; //A function to get data from the server and return it function getData(id, cb) { var url = serverUrl + "/GetSomeData/" + id; $.getJSON(url) .done(function (serverResponse) { console.log("Response from server: ", serverResponse) cb({"series": id, options: serverResponse.options, data: serverResponse.data}); } } //A function to iterate through the series using async.forEach function iterator(s, callback) { getData(s.id, function(data) { //Use the data results.push(data); //Tell async we are done with this iteration callback() }); } function done(err) { console.log("Finished"); //Expecting results to be //[ // {"series":1, options:{serverSays:"You Requested Series 1"},data: [a:1,b:2,c:3]}, // {"series":2, options:{serverSays:"You Requested Series 2"}, data: [x:9, y:8, z…
downvote count: 0
tagged with: node-async
tagged with: javascript
tagged with: jquery

asp.net
tags question: http://stackoverflow.com/q/29546562
tags question: http://stackoverflow.com/q/29634762
tags question: http://stackoverflow.com/q/29669600
tags question: http://stackoverflow.com/q/29640889
tags question: http://stackoverflow.com/q/29556088
tags question: http://stackoverflow.com/q/29604859
tags question: http://stackoverflow.com/q/29594060
tags question: http://stackoverflow.com/q/29567580
tags question: http://stackoverflow.com/q/29669744
tags question: http://stackoverflow.com/q/29632740
tags question: http://stackoverflow.com/q/29561445
tags question: http://stackoverflow.com/q/29565547
tags question: http://stackoverflow.com/q/29597694
tags question: http://stackoverflow.com/q/29562530
tags question: http://stackoverflow.com/q/29629679
tags question: http://stackoverflow.com/q/29618458
tags question: http://stackoverflow.com/q/29685822
tags question: http://stackoverflow.com/q/29582590
tags question: http://stackoverflow.com/q/29640380
tags question: http://stackoverflow.com/q/29650291
tags question: http://stackoverflow.com/q/29668792
tags question: http://stackoverflow.com/q/29640306
tags question: http://stackoverflow.com/q/29538595
tags question: http://stackoverflow.com/q/29680163
tags question: http://stackoverflow.com/q/29647644
tags question: http://stackoverflow.com/q/29542605
tags question: http://stackoverflow.com/q/29664935
tags question: http://stackoverflow.com/q/29678922
tags question: http://stackoverflow.com/q/29680485
tags question: http://stackoverflow.com/q/29531493
tags question: http://stackoverflow.com/q/29538635
tags question: http://stackoverflow.com/q/29562882
tags question: http://stackoverflow.com/q/29674447
tags question: http://stackoverflow.com/q/29643571
tags question: http://stackoverflow.com/q/29614887
tags question: http://stackoverflow.com/q/29535558
tags question: http://stackoverflow.com/q/29592760
tags question: http://stackoverflow.com/q/29678314
tags question: http://stackoverflow.com/q/29685951
tags question: http://stackoverflow.com/q/29559980
tags question: http://stackoverflow.com/q/29631847
tags question: http://stackoverflow.com/q/29665484
tags question: http://stackoverflow.com/q/29592768
tags question: http://stackoverflow.com/q/29602420
tags question: http://stackoverflow.com/q/29681435
tags question: http://stackoverflow.com/q/29647547
tags question: http://stackoverflow.com/q/29666492
tags question: http://stackoverflow.com/q/29673121
tags question: http://stackoverflow.com/q/29684416
tags question: http://stackoverflow.com/q/29543495
type: Tag
tags question: http://stackoverflow.com/q/29543224
tags question: http://stackoverflow.com/q/29581823
tags question: http://stackoverflow.com/q/29540534
tags question: http://stackoverflow.com/q/29556846
tags question: http://stackoverflow.com/q/29604631
tags question: http://stackoverflow.com/q/29623767
tags question: http://stackoverflow.com/q/29627023
tags question: http://stackoverflow.com/q/29660561
tags question: http://stackoverflow.com/q/29601535
tags question: http://stackoverflow.com/q/29559142
tags question: http://stackoverflow.com/q/29664706
tags question: http://stackoverflow.com/q/29571199
tags question: http://stackoverflow.com/q/29671383
tags question: http://stackoverflow.com/q/29687727
tags question: http://stackoverflow.com/q/29634475
tags question: http://stackoverflow.com/q/29661443
tags question: http://stackoverflow.com/q/29568456
tags question: http://stackoverflow.com/q/29548805
tags question: http://stackoverflow.com/q/29620306
tags question: http://stackoverflow.com/q/29534455
tags question: http://stackoverflow.com/q/29568140
tags question: http://stackoverflow.com/q/29579222
tags question: http://stackoverflow.com/q/29618847
tags question: http://stackoverflow.com/q/29636740
tags question: http://stackoverflow.com/q/29536889
tags question: http://stackoverflow.com/q/29560523
tags question: http://stackoverflow.com/q/29677392
tags question: http://stackoverflow.com/q/29530328
tag name: asp.net

http://stackoverflow.com/q/29614777
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29617078
score: 0
answer count: 1
type: UnansweredQuestion
has body: I'm stuck guys, I hope someone can help me figure this out. I have three node types that I'm populating JStree with. Folder Project Job I have some rules that need to be considered when trying to drag and drop one node into another. Folders can have children of type "folder" &amp; "project" Projects can only have children of type "job" Jobs cannot have any children Problem: JSTree ignores the boolean values I'm returning and allows DND for all elements. Normally returning "false" would set the red X and also disallow a drop, this is not the case. I've written the return of my function checkNodeCB() to the console and my true/false logic appears to be sound. See my code below: core: { check_callback: function(e,node,parent,position,more){ function checkNodeCB(oNode,tNode){ if(tNode.type === "folder" &amp;&amp; oNode.type !== "job"){ //console.log("I want to place a "+oNode.type+" inside a folder"); return true; } if(tNode.type === "project" &amp;&amp; oNode.type === "job"){ //console.log("I want to place a job under a project"); return true; } return false; }; if((e === 'copy_node' || e === 'move_node') &amp;&amp; more.dnd){ if (oldNode !== more.ref.id){ oldNode = more.ref.id; //Set the oldNode to the current ID so it no longer executes //console.log(checkNodeCB(node.original,more.ref.original)); return checkNodeCB(node.original,more.ref.original); } } return true; }, worker: true }, dnd:{ check_while_dragging:true },
has title: JSTree - DND Not Honoring Return
type: Question
tagged with: jstree

http://stackoverflow.com/q/29563201
has comment: http://stackoverflow.com/comment/47276958
upvote count: 3
has comment: http://stackoverflow.com/comment/47276729
type: Question
has answer: http://stackoverflow.com/a/29563479
tagged with: javascript
has comment: http://stackoverflow.com/comment/47276844
has comment: http://stackoverflow.com/comment/47276850
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/47277434
tagged with: jquery
favorite count: 0
has title: Wrong Convert amount
has body: The following function works perfect, but when the amount over 1 million, the function don't work exactly. Example: AMOUNTPAID = 35555 The output is: 35.555,00 - work fine But when the amount paid is for example: 1223578 (over 1 Million), is the output the following output value: 1.223.235,00 (but it must be: 1.223.578,00) - there is a deviation of 343 Any ideas? I call the function via HTML as follows: € # Here ist the Javascript: function Convertamount( amount ){ var number = amount; number = Math.round(number * Math.pow(12, 2)) / Math.pow(12, 2); number = number.toFixed(2); number = number.toString(); var negative = false; if (number.indexOf("-") == 0) { negative = true ; number = number.replace("-",""); } var str = number.toString(); str = str.replace(".", ","); // number before decimal point var intbeforedecimaln = str.length - (str.length - str.indexOf(",")); // number of delimiters var intKTrenner = Math.floor((intbeforedecimaln - 1) / 3); // Leading digits before the first dot var intZiffern = (intbeforedecimaln % 3 == 0) ? 3 : (intbeforedecimaln % 3); // Provided digits before the first thousand separator with point strNew = str.substring(0, intZiffern); // Auxiliary string without the previously treated digits strHelp = str.substr(intZiffern, (str.length - intZiffern)); // Through thousands of remaining ... for(var i=0; i<intKTrenner; i++) { // attach 3 digits of the nearest thousand group point to String strNew += "." + strHelp.substring(0, 3); // Post new auxiliary string without the 3 digits being treated strHelp = strHelp.substr(intZiffern, (strHelp.length - intZiffern)); } // attach a decimal var szdecimal = str.substring(intbeforedecimaln, str.length); if (szdecimal.length < 3 ) { strNew += str.substring(intbeforedecimaln, str.length) + '0'; } else { strNew += str.substring(intbeforedecimaln, str.length); } var number = strNew; if (negative) { number = "- " + number ; } return number; }
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47276497
score: 3

http://stackoverflow.com/a/29607351
has comment: http://stackoverflow.com/comment/47362115
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/47365237
has body: You could add a boolean check "isRunning" and set it to true during your animate function, then set it to false when the animation is complete. After that, just check isRunning == false before calling any animation methods. The animation will only run if it isnt already running.
answers question: http://stackoverflow.com/q/29607185
has comment: http://stackoverflow.com/comment/47360450
has comment: http://stackoverflow.com/comment/47361008

http://stackoverflow.com/comment/47229735
type: QuestionComment
score: 2
has text: Where and when is the code running, and how are you determining the contents of the array afterwards?
comment on: http://stackoverflow.com/q/29538809
type: Comment

http://stackoverflow.com/q/29576035
type: Question
score: 2
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29576248
favorite count: 0
has title: JQuery auto complete with links
has comment: http://stackoverflow.com/comment/47300605
tagged with: pdo
upvote count: 2
tagged with: php
has answer: http://stackoverflow.com/a/29576248
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47300714
has body: I'm in the process of establishing a website which uses JQuery's auto complete to give users suggestions on pages. I store the page ID and title in a SQL database (connecting using PDO). At the moment, I've got the auto complete feature working, however, I am absolutely stumped on how to get the auto complete list to turn into clickable links which direct the user to the relevant page based off the page ID in the database. Here's my search.php file &lt;?php require('includes/connect.class.php'); if (isset($_GET['term'])) { $return_arr = array(); try { $stmt = $conn-&gt;prepare('SELECT id, locationName FROM locations WHERE locationsName LIKE :term'); $stmt-&gt;execute(array( 'term' =&gt; '%' . $_GET['term'] . '%' )); while ($row = $stmt-&gt;fetch()) { $return_arr[] = $row['locationName']; } } catch (PDOException $e) { echo 'ERROR: ' . $e-&gt;getMessage(); } echo json_encode($return_arr); } ?&gt; and my JavaScript $(function() { $(".locationlist").autocomplete({ source: "search.php", minLength: 1 }); }); The database looks like this Locations |---ID---||---locationName---| | 1 || Test1 | | 2 || Test2 | ---------------------------- I've done some research, and I believe I need to modify JQuery to display an array of objects. I'm not too sure how to do this. What would be the best way to have my auto complete list get the page ID from the SQL database and become clickable links?
tagged with: mysql

customising
tag name: customising
tags question: http://stackoverflow.com/q/29630617
type: Tag

http://stackoverflow.com/comment/47392462
has text: @gonkan That it! When I remove it everything OK! but I need it and adding the $parent didn't help.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29624217
type: Comment

http://stackoverflow.com/q/29659823
tagged with: server
has title: How to check if player is facing cube node.js
score: 1
tagged with: 3d
tagged with: direction
downvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/29661390
tagged with: javascript
favorite count: 0
has body: I'm making the server for a 3d space game and am currently working on combat. the basic idea is like an fps, i.e. if the spaceship is facing another spaceship and he shoots and the distances between the ships is small enough, it's a hit. i've decided to represent each ships hit box as just a cube of 20x10 units. so my question is. I have a player and his direction is (dX, dY, dZ) and position is (x,y,z) and i have a cube who's position is (x1, y1, z1). How can i tell if the player is facing the cube?
has comment: http://stackoverflow.com/comment/47459271
tagged with: node.js
type: UnansweredQuestion
upvote count: 1
type: Question

http://stackoverflow.com/comment/47323457
comment on: http://stackoverflow.com/a/29587732
type: Comment
has text: Ok i made it work like this :P http://stackoverflow.com/questions/17074201/toggling-with-jquery-working-on-jsfiddle-but-not-my-site Thanks for the help!
type: AnswerComment
score: 0

http://stackoverflow.com/a/29606087
score: 10
has comment: http://stackoverflow.com/comment/47357869
upvote count: 10
answers question: http://stackoverflow.com/q/29605980
type: Answer
downvote count: 0
has body: You're running into the fact that .getElementsByTagName() returns a live NodeList. That means that the new &lt;div&gt; elements that you're adding to the page become part of the list as soon as you do so. What you can do is turn that NodeList into a plain array beforehand: var allDivs = document.getElementsByTagName("div"); allDivs = [].slice.call(allDivs, 0); Now using "allDivs" in the loop will just append your new elements into the ones that were there when you originally went looking for them.

http://stackoverflow.com/comment/47332494
comment on: http://stackoverflow.com/q/29592575
score: 0
has text: You need to provide more information. Typing a word into an HTML file will never return anything. So, that's not possible. Do you want to type something into an input field, and get information back? Are you familiar with `google.script.run`? That's probably where you need to start. [Google Documentation - google.script.run](https://developers.google.com/apps-script/guides/html/reference/run)
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29536228
tagged with: jquery
type: UnansweredQuestion
has body: I am extending the contentItem.value.data with the Jquery extend but the changes are not reflected in the target object. And after sometimes it get reflected. I think something has delayed the setting the value to the particular property. var based = contentItem.value.data[0]; //data will contain several properties and `EmployeeID-9` is one of them $.extend(based,{EmployeeID:4}); And now after extending the EmployeeID still has 9 but after sometimes(some delay) it has 4. How can i extend the contentItem data is there any way to do this?
has comment: http://stackoverflow.com/comment/47226177
has comment: http://stackoverflow.com/comment/48059387
answer count: 0
tagged with: visual-studio-lightswitch
type: Question
has title: Unable to extend LightSwitch HTML Client visual collection(`contentItem.value.data`) using jquery extend
tagged with: javascript
score: 0

http://stackoverflow.com/comment/47279559
comment on: http://stackoverflow.com/q/29564884
score: 0
type: Comment
type: QuestionComment
has text: You can control the visibility of any dom element using javascript through setting its display style

http://stackoverflow.com/comment/47326578
has text: http://blog.slaks.net/2015-01-04/async-method-patterns/
type: QuestionComment
comment on: http://stackoverflow.com/q/29589758
score: 0
type: Comment

http://stackoverflow.com/comment/47406620
type: Comment
type: QuestionComment
has text: Why do you want to access the property in a different script tag?
comment on: http://stackoverflow.com/q/29631887
score: 0

http://stackoverflow.com/comment/47510394
score: 0
type: Comment
has text: Thanks very much! I'm just starting to learn about JS, arrays,etc. Sorry for my clampsyness. 1. It says error, not sure if it's synthax. 2. How can you call the ``multiplyBy´´ only once. 3. This is because mine is not a general function that can be applied to other numbers, correct? I'll try to indent the code next time too!
comment on: http://stackoverflow.com/a/29686384
type: AnswerComment

http://stackoverflow.com/comment/47377001
comment on: http://stackoverflow.com/q/29615816
score: 0
has text: No it doesn't make sense to me. Maybe you need a little bit more debugging? What is the sourcecode of `MyView`?
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47473539
score: 0
type: Comment
type: QuestionComment
has text: Why don't you show us the code of what you tried?
comment on: http://stackoverflow.com/q/29666982

http://stackoverflow.com/comment/47443982
has text: https://learn.jquery.com/events/event-delegation/
score: 3
comment on: http://stackoverflow.com/q/29652067
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29684443
accepted answer of: http://stackoverflow.com/q/29683488
has comment: http://stackoverflow.com/comment/47506587
has comment: http://stackoverflow.com/comment/47507901
type: Answer
has body: You can use the Page Visibility API for this. It is compatible with IE 10+. Small example of code: document.addEventListener("visibilitychange", function(e) { console.log("visibility changed!", e); if (document.visibilityState === 'visible') { console.info("window is visible now!"); } else { console.info("something else, maybe you changed tab or minimized window!"); } console.log("check the visibilityState property on document object for more info"); }); This will work even if the user minimizes the browser while the tab is open, so I guess this suits your needs :)
answers question: http://stackoverflow.com/q/29683488
has comment: http://stackoverflow.com/comment/47506778
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/47507220
has comment: http://stackoverflow.com/comment/47506921
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/29686004
upvote count: 5
type: UnansweredQuestion
has title: How can I pass a variable from one .js file to another .js?
has comment: http://stackoverflow.com/comment/47509522
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47509164
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/47512221
has answer: http://stackoverflow.com/a/29686135
answer count: 2
has comment: http://stackoverflow.com/comment/47510788
has answer: http://stackoverflow.com/a/29687168
score: 5
has body: I have a Symfony application with a menu that creates lashes and use a .js file to load into a div the ulr pointed to each menu option using the load () method. This .js is a variable that acts counter to reference each created tab. This idea can be seen in this example: http://jsfiddle.net/JMMS_85/o7610t24/ $("#tabs-"+tabCounter).load($(this).attr('href')); The URL that is loaded into the div has other links, so I created another .js file to block the original link to "preventDefault ()" and I have to reload these links in it earlier div, that is display the url of the new link in the same div, so I have to use the variable counter another .js file on it to know what is the actual div selected. file1.js $(document).ready(function () { $("#tabs").tabs(); var tabCounter = 1; var cont =1; //Code creating the tabs omitted $(".container div a").on("click",function(event) { event.preventDefault(); tabTitle = $(this).attr("title"), addTab(); $("#tabs-"+tabCounter).load($(this).attr('href')); tabCounter++; $("#tabs").tabs({active: $('.ui-tabs-nav li:last').index()}); }); }); file2.js $(document).ready(function () { $("a").click( function(event) { event.preventDefault(); $("#tabs-"+tabCounter).load(this.href); }); My problem is how to use the counter variable first .js file to another file.

http://stackoverflow.com/a/29669984
has comment: http://stackoverflow.com/comment/47480345
has comment: http://stackoverflow.com/comment/47487317
has comment: http://stackoverflow.com/comment/47480487
score: 0
answers question: http://stackoverflow.com/q/29669063
has comment: http://stackoverflow.com/comment/52860387
has comment: http://stackoverflow.com/comment/47487758
type: Answer
has body: It seems to be an issue of skrollr: https://github.com/Prinzhorn/skrollr/issues/347 Did you try the height: 100% !important;?

http://stackoverflow.com/comment/47387577
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29621748
has text: @ Ace what have you done so far?

http://stackoverflow.com/comment/47515357
type: QuestionComment
has text: Take a look at [this](https://www.discovermeteor.com/blog/spacebars-secrets-exploring-meteor-new-templating-engine/). It may provide you some insight.
score: 0
comment on: http://stackoverflow.com/q/29686453
type: Comment

http://stackoverflow.com/comment/47453180
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29656395
score: 0
has text: [Your code](http://jsfiddle.net/mblase75/doa6qLar/) runs correctly, so there must be another problem. Perhaps there's still a JS error somewhere else, which you're not seeing because the URL changes right away.

http://stackoverflow.com/a/29630954
has comment: http://stackoverflow.com/comment/47404596
downvote count: 1
has comment: http://stackoverflow.com/comment/47404919
score: 3
upvote count: 4
has comment: http://stackoverflow.com/comment/47405058
has comment: http://stackoverflow.com/comment/47404654
type: AcceptedAnswer
has body: The :nth-of-type() pseudo-class pays attention only to the element type. None of your "tab" elements are the first, second, or third &lt;div&gt; in their container, so none match the selector. You could, I think, do this: $('.op:nth-of-type(3n+1)').click(function(){ $('.tab:nth-of-type(3n+1)').slideToggle(); }); You'd have to make sure that the 3 was updated when you add/remove a tab of course. Alternatively you could do this: $(".op").click(function() { $(".tab").eq($(this).index()).slideToggle(); }); Then you'd just need to set up one handler.
answers question: http://stackoverflow.com/q/29630854
type: Answer
has comment: http://stackoverflow.com/comment/47404849
has comment: http://stackoverflow.com/comment/47404678
accepted answer of: http://stackoverflow.com/q/29630854

http://stackoverflow.com/comment/47510286
type: Comment
type: QuestionComment
has text: Is your data barcoded into a JSON file? Or is the data being pulled from your database and you are creating the JSON from the data being retrieved? Once I know this, I can assist.
score: 0
comment on: http://stackoverflow.com/q/29686542

razor
tags question: http://stackoverflow.com/q/29682493
tags question: http://stackoverflow.com/q/29562882
tags question: http://stackoverflow.com/q/29631019
tags question: http://stackoverflow.com/q/29648760
tags question: http://stackoverflow.com/q/29608893
type: Tag
tag name: razor
tags question: http://stackoverflow.com/q/29671208
tags question: http://stackoverflow.com/q/29631937
tags question: http://stackoverflow.com/q/29539802
tags question: http://stackoverflow.com/q/29630479
tags question: http://stackoverflow.com/q/29664935
tags question: http://stackoverflow.com/q/29566649

http://stackoverflow.com/a/75535025
score: 0
has body: import React from 'react'; //cm_chandan_ export default function App() { const getSelection = () => { if (window.getSelection().focusNode) { var sel = window.getSelection(); var range = sel.getRangeAt(0); if ( sel.rangeCount && range.startContainer.isSameNode(range.endContainer) ) { var selectionAnchorOffset = sel.anchorOffset; var selectionFocusffset = sel.focusOffset; if (selectionAnchorOffset > selectionFocusffset) { selectionAnchorOffset = sel.focusOffset; selectionFocusffset = sel.anchorOffset; } let parentNodeSelection = sel.anchorNode.parentNode; let childNodesArr = parentNodeSelection.childNodes; for (let i = 0; i < childNodesArr.length; i++) { if (childNodesArr[i].nodeType === 3) { if (childNodesArr[i].isEqualNode(sel.anchorNode)) { let contentNodeText = childNodesArr[i].textContent; let startTextNode = document.createTextNode( contentNodeText.slice(0, selectionAnchorOffset) ); let endTextNode = document.createTextNode( contentNodeText.slice( selectionFocusffset, contentNodeText.length ) ); let highlightSpan = document.createElement('span'); highlightSpan.innerHTML = sel.toString(); highlightSpan.style.background = 'red'; childNodesArr[i].after(endTextNode); childNodesArr[i].after(highlightSpan); childNodesArr[i].after(startTextNode); childNodesArr[i].remove(); } } } } else { alert('Wrong Text Select!'); } } else { alert('Please Text Select!'); } }; return ( <> Organization’s vision An organization’s vision for a privacy program needs to include data protection as well as data usage functions. To be effective, the privacy program vision may also need to include IT governance if this is lacking. Executive sponsorship is the formal or informal approval to commit resources to a business problem or challenge Privacy is no exception: without executive sponsorship, privacy would be little more than an idea.As vision gives way to strategy, the organization’s privacy leader must ensure that the information privacy program fits in with the rest of the organization. …
type: Answer
answers question: http://stackoverflow.com/q/29652862

http://stackoverflow.com/q/29555521
accepted answer: http://stackoverflow.com/a/29555542
favorite count: 0
has answer: http://stackoverflow.com/a/68371815
has answer: http://stackoverflow.com/a/29555542
has body: How can i validate a phone number with plus sign optional only at the beginning and after that any number of digits with number only. I tried this:- /^\+(?:[\d]*)$/ How will be the modification
tagged with: regex
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/22937618
type: Question
possible better answer: http://stackoverflow.com/a/68371815
has title: Phone number validation with plus sign optional
tagged with: javascript
upvote count: 2
score: 0
downvote count: 2
answer count: 2
has comment: http://stackoverflow.com/comment/135372185
tagged with: validation

http://stackoverflow.com/comment/47353413
has text: Your test is nonetheless wrong.
comment on: http://stackoverflow.com/q/29603680
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29557777
answers question: http://stackoverflow.com/q/29557042
score: 0
has body: According to the docs, $http.success returns data in the first argument, which is converted to JSON only if the active transformResponse can detect is is the appropriate format: Angular provides the following default transformations: ... Response transformations ($httpProvider.defaults.transformResponse and $http.defaults.transformResponse): If XSRF prefix is detected, strip it (see Security Considerations section below). If JSON response is detected, deserialize it using a JSON parser. If your server is responding with an empty string (which seems the case here) then it will not be detected as a JSON object and will remain an empty string. Check your server response, it may be responding with no body and an error status. One thing to watch for if you are requesting data from a different domain (even if it's ultimately the same server) is same-origin policy.
type: Answer

http://stackoverflow.com/comment/48324671
has text: The full codes are: (function() { var root = this; var SOMEVAR; SOMEVAR = root.SOMEVAR = {}; SOMEVAR.windowOffset = 0; SOMEVAR.defaultBase = 195; SOMEVAR.resizeIFrame = function(){ // some codes }; SOMEVAR.resetIFrameSize = function(height) { // some codes } window.SOMEVAR = SOMEVAR; })(this); What confused me is the "this" here doesn't seem like useful. Is it?
comment on: http://stackoverflow.com/a/29665826
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47311688
score: 0
comment on: http://stackoverflow.com/q/29581053
type: QuestionComment
type: Comment
has text: I think you could clone your merged table, and then remove the hidden elements from the cloned table. For the Excel export I would use that cloned table instead. More info https://api.jquery.com/clone/ . I haven't tested it but it could work.

http://stackoverflow.com/comment/47483408
comment on: http://stackoverflow.com/q/29668369
has text: Could you add your entire code here .. it would be easier to understand
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29540297
favorite count: 0
type: Question
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has body: I am not so into JavaScript and I have the following problem. Into a JSP page I have some "links" like this: Comunicazioni As you can see in the previous code snippet the link is not yet implemented by a classic a href but, in its place, it is done by JavaScript using this expression: onclick="Javascript: document.location.href='edi.do?serv=4.1';" So, correct me if I am saying wrong assertion, I think that (when the user click on the tr) by the Javascript: it perform the following JavaScript operation that open the link. Is it the correct interpretation? It works but my problem is that, before doing it, I have to perform a specific loadingPopUp() JavaScript function defined into the section of my page. So my problem is: how can I perform the loadingPopUp() function before the Javascript: document.location.href='edi.do?serv=4.1'; on theonclick event?
score: 0
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/29540776
tagged with: http://stackoverflow.com/tag/xhtml
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29540469
has title: How to perform a JavaScript function when this specific onclick event is performed?
tagged with: jquery
tagged with: dom-events

properties
tags question: http://stackoverflow.com/q/29569886
type: Tag
tag name: properties
tags question: http://stackoverflow.com/q/29616245
tags question: http://stackoverflow.com/q/29533514

http://stackoverflow.com/q/29665514
score: 1
type: Question
has comment: http://stackoverflow.com/comment/47470158
has comment: http://stackoverflow.com/comment/47470847
has body: I have a markup like this {{macro}} var macros = [ "Hey {{activeUserName}} ! I'm sorry" ]; Here {{activeUserName}} is not interpolated. How can I resolve it
has title: Interpolation inside ng-repeat
has comment: http://stackoverflow.com/comment/47470262
tagged with: javascript
has comment: http://stackoverflow.com/comment/47470133
upvote count: 1
has comment: http://stackoverflow.com/comment/47470100
accepted answer: http://stackoverflow.com/a/29665916
has comment: http://stackoverflow.com/comment/47471197
answer count: 1
has comment: http://stackoverflow.com/comment/47470091
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/29665916
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/q/29560050
type: Question
has answer: http://stackoverflow.com/a/29560143
has answer: http://stackoverflow.com/a/29561475
downvote count: 0
score: 10
tagged with: javascript
tagged with: jquery
answer count: 3
has answer: http://stackoverflow.com/a/29560256
has title: Why isn't window.onresize working? (javascript/jquery)
has comment: http://stackoverflow.com/comment/47270061
favorite count: 0
possible better answer: http://stackoverflow.com/a/29561475
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29560143
has body: I'm trying to make this site show a tab-box on large screens, but just a normal layout on smaller screens. Here's what I have: function adapt() { if(document.documentElement.clientWidth &gt; 800) { $(document).ready(function() { $(".box").hide(); $(".box:first").show(); $("ul.tabs li").click(function() { $("ul.tabs li").removeClass("active"); $(this).addClass("active"); $(".box").hide(); var activeTab = $(this).attr("rel"); $("#"+activeTab).show(); }); }); }else{ $(document).ready(function () { $('.box').show(); }); };} window.onload = adapt(); window.onresize = adapt(); The onload event handler works, so the tab-box jquery function only works if the page is loaded on a larger screen, and it shows all the content when loaded on a smaller screen. I added the onresize event so it would also change when the browser window is shrunk down, but it doesn't work. If I load on a large screen and then shrink it, all that shows is the content that was in the first tab, and if I load on a small screen, and then make the window bigger, all the content is displayed and the tab buttons don't work. Am I just misinterpreting how window.resize is supposed to work? I'm guessing that maybe the event only fires once the first time the resize occurs, and if the difference isn't enough that time for my other conditional to take over, it doesn't happen. If this is the case, is there a way to make it continually check for screen size, like with CSS media queries?
upvote count: 10

http://stackoverflow.com/comment/47297819
type: Comment
type: QuestionComment
has text: @PhuongNguyen For this particular plugin, `this` within `inputclass` refers to a created `input` element while within `validate` refers to the originally element which the plugin was applied to.
comment on: http://stackoverflow.com/q/29574413
score: 0

http://stackoverflow.com/q/29680036
tagged with: kendo-ui
accepted answer: http://stackoverflow.com/a/29775517
has body: I have a login form on a view and if the login is successful (when the user clicks on the login button) I would like to transition the user to another view. How can I change the click event of the login button to support the successful login and transition to the new view? Login
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47619848
has comment: http://stackoverflow.com/comment/47624526
has comment: http://stackoverflow.com/comment/47507619
type: AnsweredQuestion
tagged with: onclick
score: 0
has title: Kendo UI submit button click and transition to view
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47624291
linked to: http://stackoverflow.com/q/20974447
has answer: http://stackoverflow.com/a/29775517
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/47624271

http://stackoverflow.com/comment/47286373
type: AnswerComment
comment on: http://stackoverflow.com/a/29568393
score: 0
type: Comment
has text: I tryed - when I execute this code - external changes cancels. It is not expected behaviour for me.

http://stackoverflow.com/q/29607225
answer count: 1
has answer: http://stackoverflow.com/a/29607654
type: UnansweredQuestion
tagged with: css
type: Question
has title: how to simplify or combine 2 jquery pullout functions
tagged with: javascript
tagged with: jquery
score: 0
has body: I am using a simple page with 2 pullout functions, one on the left and one on the right side. I would like to simplify or combine the two functions into one and make one pullout close, when I click on the other one, so that only one can be seen at a time. Javascript &lt;script type="text/javascript"&gt; $(document).ready(function () { $("#clickme").click(function () { if($(this).parent().hasClass("popped")){ $(this).parent().animate({left:'-750px'}, {queue: false, duration: 400}).removeClass("popped"); $(".overlay").fadeOut(500); }else { $(this).parent().animate({left: "0px" }, {queue: false, duration: 400}).addClass("popped"); $(".overlay").fadeIn(500); } }); $(".overlay").click(function(){ $("#clickme").click(); }); $("#clickme2").click(function () { if($(this).parent().hasClass("popped")){ $(this).parent().animate({right:'-750px'}, {queue: false, duration: 400}).removeClass("popped"); $(".overlay2").fadeOut(500); }else { $(this).parent().animate({right: "0px" }, {queue: false, duration: 400}).addClass("popped"); $(".overlay2").fadeIn(500); } }); $(".overlay2").click(function(){ $("#clickme2").click(); }); }); CSS #slideout, #slideout2 { background: #f4f4f4; position: fixed; width: 750px; height: auto; top: 20%; -webkit-transition: all 0.5s ease-in-out; -moz-transition: all 0.5s ease-in-out; -o-transition: all 0.5s ease-in-out; transition: all 0.5s ease-in-out; z-index:9999; } #slideout { left:-750px; } #slideout2 { top: 40%; right: -750px; } #clickme, #clickme2 { position: absolute; top: 0; height: 102px; width: 184px; background: url(../../assets/images/pullout.png) top left no-repeat; cursor: pointer; -webkit-transition: all 0.2s 1s ease-in-out; -moz-transition: all 0.2s 1s ease-in-out; -o-transition: all 0.2s 1s ease-in-out; transition: all 0.2s 1s ease-in-out; } #clickme { right: -184px; } #clickme2 { background: url(../../assets/images/pullout2.png) top left no-repeat; left: -184px; } #slidecontent, #slidecontent2 { float: left; font-size: 15px; line-height:…
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/29609526
has title: Define row of data based on search criteria in Google Apps Script
has comment: http://stackoverflow.com/comment/47990382
upvote count: 1
has comment: http://stackoverflow.com/comment/47369767
has answer: http://stackoverflow.com/a/30489834
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47935744
tagged with: google-sheets
tagged with: javascript
has comment: http://stackoverflow.com/comment/47935496
tagged with: google-apps-script
score: 0
has comment: http://stackoverflow.com/comment/47988823
has comment: http://stackoverflow.com/comment/47991245
answer count: 1
has comment: http://stackoverflow.com/comment/47935456
favorite count: 0
has body: I am trying to set a row as a range based on a search criteria. I know which column I want to search and based on that I want that specific row to be the data range. Once the data range is set I format it as a table and send an email with the table in it. The code I have is pretty messed up by all the different attempts I have made so I don't have any to post. Below is just a sample of the row and column N is what I am searching on. Then I want that row with D - Y as my range. So search for MLS/MRL Weekend which is row 89 and set range D89:Y89 as the range based off of the search. This is not pretty.. I am learning as I go and this really new territory for me. function rowOf(team1, dataRange) { var ss = SpreadsheetApp.openById("spreadsheetid"); var sheet1 = ss.getSheetByName("Stats1"); var dataRange = sheet1.getSheetValues(1,14,150,1); var ss1 = SpreadsheetApp.openById("otherspreadsheetid"); var sheet = ss1.getSheetByName("Form Responses 1"); var data = sheet.getRange(sheet.getLastRow(), 1, 1, sheet.getLastColumn()).getValues(); var email = data[0][2]; var team1 = data[0][1]; var subject = team1 +" Team Stats"; var outRow = null; for (var i = 0; i < dataRange.length; i++) { if (dataRange[i][0] == team1) { outRow = i+1; break; } } var Header = sheet1.getRange('d1:y1').getValues(); var u13gneongoalsg1 = sheet1.getRange(outRow,4).getValues(); var u13gneonshotsg1 = sheet1.getRange(outRow,5).getValues(); var u13gneontopg1 = sheet1.getRange(outRow,6).getValues(); var u13gneontop1g1 = sheet1.getRange(outRow,7).getValues(); var u13gneonfirstg1 = sheet1.getRange(outRow,8).getValues(); var u13gneonpassesg1 = sheet1.getRange(outRow,9).getValues(); var u13gneonpasscompg1 = sheet1.getRange(outRow,10).getValues(); var u13gneonnumpassstringg1 = sheet1.getRange(outRow,11).getValues(); var u13gneonavgpassstringg1 = sheet1.getRange(outRow,12).getValues(); var u13gneonlongpassstringg1 = sheet1.getRange(outRow,13).getValues(); var u13gneonogoalsg1 = sheet1.getRange(outRow,16).getValues…
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47971350
has comment: http://stackoverflow.com/comment/47934251

http://stackoverflow.com/q/29682277
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: I am trying to create a function that would give me a matching percentage based on the search result so for example if search is matches 2/9 fields from my array then I would get appropriate percentage of that match so if it matches a contract from an array that would be 9/9 it would display 100%. Here's the code: https://jsfiddle.net/f45gfx2p/2/ HTML: Any Phone4You Any Phone4You Select phone brand Sony Motorola Samsung Apple LG Model Select a network Z-Mobile O3 Fodavone NN 0 Text Data Upfront Cost Monthly Cost Contract Length @Copyright Reserved by Przemyslaw Wojtas @2015-2016 !Do not copy! CSS: html { margin: 0; padding: 0; } body { margin: 0; padding: 0; } .margin { margin-left: auto; margin-right: auto; } .textalign { text-align: left; } .textalign2 { text-align: center; } .header { top: 2%; height: 20%; width: 100%; background-color: rgb(39, 133, 203); color: white; font-size: 36px; font-family:'Yanone Kaffeesatz', sans-serif; display: inline-block; } h1 { left: 5%; padding-top: 1%; padding-left: 1%; margin: 0; } .main { float: right; width: 80%; height: 1000px; background-color: rgb(98, 204, 255); } .search { float: left; width: 20%; height: 1000px; background-color: rgb(39, 133, 203); opacity: 0.9; } footer { clear: both; bottom: 0px; width: 100%; font-family:'Yanone Kaffeesatz', sans-serif; } fieldset { display: block; } form { font-size: 16px; width:100%; border: 1px solid; box-shadow: 10px 10px 5px #000000; background-color:rgba(255, 255, 255, 0.4); } /* this will style my form */ input, select, textarea { display: block; margin:2%; } /* this style all input, select and textarea tags */ input { border:2px solid #CCC; width: 70%; margin-top: 2%; } /* further styling to input tag */ textarea { width:50%; border:3px solid #CCC; } /* further styling to textarea tag */ /* overflow-y: scroll; height: 200px; */ JS: /* var brand=["Motorola","Nokia","Apple","Apple","Samsung","Samsung","LG","Nokia","LG","Sony","Sony"]; var model=["StarTAC","3310","iPhone 5C","iPhon…
tagged with: css
score: 0
has comment: http://stackoverflow.com/comment/47501625
type: Question
has answer: http://stackoverflow.com/a/29682785
has title: working out percentage based on search result in js
tagged with: javascript
has comment: http://stackoverflow.com/comment/47502053
answer count: 1

http://stackoverflow.com/a/29538759
has body: You are searching for all buttons when you have $(".btn:first-child") you need to be relative to your current element: $(".dropdown-menu li a").click(function () { var item = $(this).text(); $(this).closest(".btn-group").find(".btn:first-child").text(item); $(this).closest(".btn-group").find(".btn:first-child").val(item); });
type: AcceptedAnswer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/29538561
type: Answer
answers question: http://stackoverflow.com/q/29538561
upvote count: 1

http://stackoverflow.com/comment/47235649
comment on: http://stackoverflow.com/a/29541929
type: AnswerComment
score: 0
type: Comment
has text: I am using friendly urls

http://stackoverflow.com/comment/47336866
comment on: http://stackoverflow.com/q/29584435
score: 0
type: Comment
type: QuestionComment
has text: JSON doesn't need sanitizing, it encodes everything safely, only the decoded inner values could pose a risk.

http://stackoverflow.com/a/30177912
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/79419313
has comment: http://stackoverflow.com/comment/139685347
has body: Right - you could start with the custom sliders, but that won't dynamically update. It will only force a constant sum. If you go to innovation exchange linked below you can download an example of survey that does this though. You have to upload the survey to qualtrics, and the only way at least I'm familiar with this is to go into an existing survey and go to the advanced options. You'll find "Import Survey," which is what you want. Import that QSF file and you'll have a version of the slider to play with. This is the link with more info and the qsf file. http://www.qualtrics.com/innovation-exchange/dan-ariely-tradeoff-question/ Here's a link with a preview I just mocked up. Not pretty, but I'm sure you can toy with the css. https://az1.qualtrics.com/jfe3/preview/SV_6lIzOgpiSm91X4F
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/79345214
answers question: http://stackoverflow.com/q/29538632

http://stackoverflow.com/a/29611668
has comment: http://stackoverflow.com/comment/47378818
has comment: http://stackoverflow.com/comment/47371750
has body: The drag event is not fired by circle, it's fired by the the drag behavior (source), calling force.drag will return that behavior and you can set a listener there: force.drag() .on("dragstart", function () { console.log(arguments); }) Demo, see the console's output Update: I forked the example link you posted which doesn't use d3.json and it's working fine: demo
type: Answer
has comment: http://stackoverflow.com/comment/47378513
accepted answer of: http://stackoverflow.com/q/29592770
score: 2
answers question: http://stackoverflow.com/q/29592770
upvote count: 2
has comment: http://stackoverflow.com/comment/47375960
has comment: http://stackoverflow.com/comment/47380708
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/47510777
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29686425
score: 0
has text: Why don't you use the jQuery `$(function(){})`? Bootstrap needs it for animation so it is already included.

http://stackoverflow.com/comment/47246057
has text: clone() makes a 'deep copy' of the jQuery object(s), and html() returns the HTML contents of the jQuery object. clone() has its place when you want to do things like duplicate DOM elements. Whether you need clone() or html() depends significantly on what you want to do with the select options.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29546999
type: Comment

http://stackoverflow.com/a/29624128
answers question: http://stackoverflow.com/q/29618805
type: Answer
accepted answer of: http://stackoverflow.com/q/29618805
has body: See my comments in the code... var jdata = [ { "date": "2013-01", "value": "53" }, { "date": "2013-02", "value": "165" }, { "date": "2013-03", "value": "269" }, { "date": "2013-04", "value": "344" }, { "date": "2013-05", "value": "376" }, { "date": "2013-06", "value": "410" }, { "date": "2013-07", "value": "421" }, { "date": "2013-08", "value": "405" }, { "date": "2013-09", "value": "376" }, { "date": "2013-10", "value": "359" }, { "date": "2013-11", "value": "392" }, { "date": "2013-12", "value": "433" }, { "date": "2014-01", "value": "455" }, { "date": "2014-02", "value": "478" } ], //root = JSON.parse(jdata), //***EDIT*** jdata is not a string as required by JSON.parse //it's already well formed so just use it data = jdata, margin = {top: 20, right: 20, bottom: 70, left: 40}, width = 600 - margin.left - margin.right, height = 300 - margin.top - margin.bottom, // Parse the date / time //***a better comment would be "for parsing the date and time"... parseDate = d3.time.format("%Y-%m").parse, x = d3.scale.ordinal().rangeRoundBands([0, width], .05), y = d3.scale.linear().range([height, 0]), xAxis = d3.svg.axis() .scale(x) .orient("bottom") .tickFormat(d3.time.format("%Y-%m")), yAxis = d3.svg.axis() .scale(y) .orient("left") .ticks(10), svg = d3.select("body").append("svg") //***EDIT*** //the data method returns the enter collection and your not ready for it yet... //.data(root) .attr("width", width + margin.left + margin.right) .attr("height", height + margin.top + margin.bottom) .append("g") .attr("transform","translate(" + margin.left + "," + margin.top + ")"); //d3.json //d3.csv("bar-data.csv", function(error, data) { //d3.selectAll('g').data(function(data){ data.forEach(function (d) { //NOW is parsing the date and time d.date = parseDate(d.date); d.value = +d.value; }); x.domain(data.map(function(d) { return d.date; })); y.domain([0, d3.max(data, function(d) { return d.value; })]); svg.append("g") .attr("class", "x axis") .attr("transform", "translate(0," + heig…
score: 4
upvote count: 4
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/47294017
has text: DC has yet to produce code that implement what he calls "classical inheritance" correctly. Maybe the following answer can explain the things he and you are doing wrong: http://stackoverflow.com/a/16063711/1641941 the following book is also very good: https://github.com/getify/You-Dont-Know-JS/blob/master/README.md
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29565740

http://stackoverflow.com/a/29602398
answers question: http://stackoverflow.com/q/29601731
has comment: http://stackoverflow.com/comment/47354171
has body: var data = [{ "cod_nivel": "INC2", "cod_modelo": "B" }, { "cod_nivel": "INC2", "cod_modelo": "D" }, { "cod_nivel": "INC2", "cod_modelo": "B" }, { "cod_nivel": "PRIM1", "cod_modelo": "B" }, { "cod_nivel": "INC2", "cod_modelo": "B" }, { "cod_nivel": "INC1", "cod_modelo": "D" }, { "cod_nivel": "INC2", "cod_modelo": "B" }, { "cod_nivel": "PRIM2", "cod_modelo": "D" }, { "cod_nivel": "BAC2", "cod_modelo": "B" }, { "cod_nivel": "BAC2", "cod_modelo": "D" }, { "cod_nivel": "BAC2", "cod_modelo": "A" }]; var sortOrder = ['INC1', 'INC2', 'PRIM1', 'PRIM2', 'BAC1', 'BAC2']; data.sort(function (a, b) { // first have a look at cod_nivel // get the indices of the given sortOrder // take the difference of the indices var delta = sortOrder.indexOf(a.cod_nivel) - sortOrder.indexOf(b.cod_nivel); // test, if the indices are the same if (delta === 0) { // the comparison should usually return 0, // but this will here not work. we need // the comparison of the second sort order of cod_modelo. // take the variables and make a real comparison, // while we expecting strings to be compared return a.cod_modelo === b.cod_modelo ? 0 : (a.cod_modelo &lt; b.cod_modelo ? -1 : 1); } // otherwise return the delta return delta; }); as thefortheye mentioned, the former version does not compute very well. so here is the type safe version for number/number or string/string comparison.
score: 3
downvote count: 1
has comment: http://stackoverflow.com/comment/47352994
type: Answer
upvote count: 4

universal-analytics
tag name: universal-analytics
type: Tag
tags question: http://stackoverflow.com/q/29536135

http://stackoverflow.com/comment/47485890
type: QuestionComment
has text: "0000.11 => 0.11" contradicts "removes any 0 at the begginin of a string if is an integer."
score: 2
comment on: http://stackoverflow.com/q/29674029
type: Comment

http://stackoverflow.com/a/29563498
type: Answer
score: 1
upvote count: 1
downvote count: 0
has body: HTML Text Goes Here Text Goes Here 2 Text Goes Here 2 JS $(document).ready(function () { $('.hover').each(function (index, el) { var thiz = $(this); var text = thiz.find('.text'); thiz.on('mouseover', function (e) { text.removeClass('hidden'); }); thiz.on('mouseleave', function(e){ text.addClass('hidden') }); }); }); jsFiddle
has comment: http://stackoverflow.com/comment/47277145
answers question: http://stackoverflow.com/q/29553268

http://stackoverflow.com/comment/47383615
has text: Yeah, but then don't use //= require_tree
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29619526

http://stackoverflow.com/q/29584980
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29585000
score: 0
has body: I have a javascript method that runs, which hides certain parts of the screen, based on some values, which are sourced from a property in my MVC view model. &lt;body onload="TransferAmountDisplayToggle(@Model.EntityEventTypeId)"&gt; When the screen loads, all controls are visible for around half a second, and then the controls hide, and the screen is ready. Is there anyway to stop this from happening? i.e. Not show the screen until the javascript is complete?
has comment: http://stackoverflow.com/comment/47318243
type: UnansweredQuestion
tagged with: asp.net-mvc
has title: Javascript runs After page load
type: Question
answer count: 1

http://stackoverflow.com/q/29675142
has comment: http://stackoverflow.com/comment/47488069
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/29675358
type: Question
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47488075
has body: So I have a table.. It's in jade templating format so i've not created a jsfiddle for it. Anyhow, the user clicks a button within the table and this toggles a class which displays all the information to do with that table. The user clicks and this code gets executed: $(function() { $('.information-button').click(function() { detailsPopup(this); }); }); The onclick calls the function below: function detailsPopup(el) { // $(el).find("td").each(function(index){ // var bookingData = $(this).html(); // }) array1.indexOf(td [ fromIndex]) console.log($(el)); $(".details--info, .overlay--contain").toggle('600'); } The problem i'm having, is I need to loop through all the td elements of the booking, grab the index and pass it through the onclick event. So when I toggle the class that displays the information, it only shows the information for that table cell. Anyone know how I can achieve this? Thanks!
score: 0
has comment: http://stackoverflow.com/comment/47488086
accepted answer: http://stackoverflow.com/a/29675358
has comment: http://stackoverflow.com/comment/47488276
tagged with: javascript
has comment: http://stackoverflow.com/comment/47488035
has comment: http://stackoverflow.com/comment/47488758
has title: Get index of td elements in table using Javascript or jQuery
type: AnsweredQuestion

http://stackoverflow.com/comment/47440242
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29643171
type: AnswerComment
has text: Not. The moment the javascript gets evaluated its at the client. If you want it serverside you would need to do a json request to the server where it can be dealt in a seperate process.

http://stackoverflow.com/a/29549914
type: Answer
answers question: http://stackoverflow.com/q/29549834
has comment: http://stackoverflow.com/comment/47251424
score: 0
has body: If you are using IE9+ you can deattach the debugger console. Then keep open the console but in its own window.

http://stackoverflow.com/a/29586317
has body: You're solving the wrong problem. Instead of using alert, why not use console.log instead? Gives you a more detailed breakdown of the object you're trying to inspect. With regard to your question, FavAppnd is a jQuery object. You can do FavAppnd.wrap('&lt;div/&gt;').parent().html(). wrap is needed since .html() returns the HTML representation of the object but excludes the top element. We everything in a &lt;div&gt; so that the &lt;div&gt; is the one excluded.
type: Answer
answers question: http://stackoverflow.com/q/29586297
upvote count: 1
type: AcceptedAnswer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/29586297

http://stackoverflow.com/comment/47476192
has text: Thanks for the answer but the problem with this approach is that I want to change the new value of the label to database. And if I use blur, it will always hit the database whenever the lable is out of focus.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29668839

http://stackoverflow.com/q/29577563
has body: I found a script using the following syntax: var variable3 = (Math.abs(variable1)&gt;Math.abs(variable2)) ? variable1 : variable2; As far, as I get it, that seems to compare if variable1 is bigger than variable2. Then output, if yes, variable1, otherwise variable2? I couldn't find any description and this seems to be something handy, could someone explain it? THX!
upvote count: 2
type: UnansweredQuestion
answer count: 4
tagged with: syntax
has comment: http://stackoverflow.com/comment/47303501
score: 0
downvote count: 2
has answer: http://stackoverflow.com/a/29577615
has answer: http://stackoverflow.com/a/29577605
linked to: http://stackoverflow.com/q/6259982
has title: JS, what syntax is this? "var3 = (var1 > var2) ? var1 : var2"
type: Question
duplicate of: http://stackoverflow.com/q/6259982
tagged with: javascript
has answer: http://stackoverflow.com/a/29577587
has answer: http://stackoverflow.com/a/29577608
favorite count: 0

http://stackoverflow.com/a/29585933
type: AcceptedAnswer
downvote count: 0
has body: It turns out jQuery UI is also a dependency. This wasn't obvious from the documentation.
has comment: http://stackoverflow.com/comment/47320394
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/29583253
accepted answer of: http://stackoverflow.com/q/29583253

http://stackoverflow.com/q/29625659
score: 0
has comment: http://stackoverflow.com/comment/47394574
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47394513
answer count: 0
has comment: http://stackoverflow.com/comment/47394838
has body: I'm trying to reload a single nested view but it reload the full page. Here is my state provider : $stateProvider .state('connected',{ views: { 'friendsList': { templateUrl: '/angular/php/connectedFriendsList.php', controller: 'friendsListController' }, 'statusTextInput': { templateUrl: '/angular/php/statusTextInput.php', controller: 'statusTextInputController' }, } }) .state('connected.refresh',{ parent: 'connected', views: { 'status@': { templateUrl: '/angular/php/status.php', controller: 'statusController' }, } }) And here is my function tu refresh "connected.refresh" : refresh: function(){ $templateCache.remove('/angular/php/status.php'); $state.transitionTo('connected.refresh', {}, { reload: 'connected.refresh', inherit: true, notify: true}); } Thanks in advance!
type: Question
has comment: http://stackoverflow.com/comment/47395075
tagged with: javascript
has title: AngularJs prevent full page reload when transitionTo nested view

http://stackoverflow.com/a/29775517
score: 1
accepted answer of: http://stackoverflow.com/q/29680036
upvote count: 1
has body: I found the answer here: http://www.telerik.com/forums/button-press-event---transition-to-a-view I just used AJAX call to allow the user to login and use the success event of that to allow the user to navigate to a different view using the function given below: app.mobileApp.navigate('home/view.html');
answers question: http://stackoverflow.com/q/29680036
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/a/29615205
has comment: http://stackoverflow.com/comment/47462042
type: Answer
answers question: http://stackoverflow.com/q/29615058
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47416993
has comment: http://stackoverflow.com/comment/47416975
has body: Use a for loop to concatenate 10 copies of the HTML code. Then use .after() to put this after the DIV. $("#add_another_product_name").click(function() { var html = ''; for (var i = 0; i &lt; 10; i++) { html += 'html code that you want to repeat'; } $("#add_remove_product_name").after(html); }
has comment: http://stackoverflow.com/comment/47416775
upvote count: 1

http://stackoverflow.com/q/29571750
has answer: http://stackoverflow.com/a/33632111
has answer: http://stackoverflow.com/a/29999705
has body: I am developing in JavaScript/HTML/CSS an app that uses Google Maps. I am getting the following alert dialog box: "This page was unable to display a Google Maps element. The provided Google API key is invalid or this site is not authorized to use it. Error Code: InvalidKeyOrUnauthorizedURLMapError" The app does actually display the map element; the alert is not a problem except it should not appear at all. The map displays properly. I have gone in to the Google Developer's Console and, in the "Credentials" section, have "edited allowed referrers" to be mydomain.com/* I have also gone in to the Google Developer's Console in the APIs section and enabled 11 Google Maps APIs.
has answer: http://stackoverflow.com/a/34566527
answer count: 10
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/31690456
has comment: http://stackoverflow.com/comment/47423761
has answer: http://stackoverflow.com/a/32268676
has comment: http://stackoverflow.com/comment/55891771
has comment: http://stackoverflow.com/comment/47613184
has answer: http://stackoverflow.com/a/33315005
type: Question
accepted answer: http://stackoverflow.com/a/33632111
has title: Google Map error: InvalidKeyOrUnauthorizedURLMapError
linked to: http://stackoverflow.com/q/29846040
has answer: http://stackoverflow.com/a/31750426
has comment: http://stackoverflow.com/comment/47294710
has answer: http://stackoverflow.com/a/33801836
tagged with: javascript
has answer: http://stackoverflow.com/a/33384555
has comment: http://stackoverflow.com/comment/47296196
score: 22
tagged with: google-maps-api-3
upvote count: 22
has answer: http://stackoverflow.com/a/30357350
has comment: http://stackoverflow.com/comment/47295398
has comment: http://stackoverflow.com/comment/47796955
has comment: http://stackoverflow.com/comment/47293000
downvote count: 0
has comment: http://stackoverflow.com/comment/47818165
favorite count: 0
possible better answer: http://stackoverflow.com/a/29999705

http://stackoverflow.com/comment/47304840
score: 0
type: Comment
has text: right div must have width 100% because in some pages left div is hidden, so right div should cover the entire page .
comment on: http://stackoverflow.com/a/29578254
type: AnswerComment

http://stackoverflow.com/q/29612886
has title: Execution failed: TypeError: Cannot find function getResponseForItem in object
has comment: http://stackoverflow.com/comment/47382895
answer count: 0
tagged with: forms
has comment: http://stackoverflow.com/comment/47383044
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47372954
score: 0
tagged with: google-forms
has body: I am hoping for some help with the following instructions I was trying to use with the Google add-on Form Notifications. I followed the directions on this page: https://developers.google.com/apps-script/quickstart/forms-add-on#set_it_up I was positive I had copied and pasted the code right and did the test. I was able to get the Form Submission Email Notification just fine and it works, but when I tried testing the Respondent Email Notification by submitting the form with my own email address I did not get the Respondent Email Notification. When I run the Execution Transcript I get this: [15-04-13 14:22:39:887 EDT] FormApp.getActiveForm() [0.245 seconds] [15-04-13 14:22:40:023 EDT] FormApp.getActiveForm() [0.083 seconds] [15-04-13 14:22:40:057 EDT] Starting execution [15-04-13 14:22:40:489 EDT] FormApp.getActiveForm() [0.425 seconds] [15-04-13 14:22:40:726 EDT] PropertiesService.getDocumentProperties() [0.236 seconds] [15-04-13 14:22:40:742 EDT] (class).getProperty([respondentEmailItemId]) [0.013 seconds] [15-04-13 14:22:40:804 EDT] Form.getItemById([1914529909]) [0.061 seconds] [15-04-13 14:22:40:807 EDT] Execution failed: TypeError: Cannot find function getResponseForItem in object [object Object]. (line 274, file "Code") [0.742 seconds total runtime] I checked the line in the "Code" file and can see this: } /** * Sends out respondent notificiation emails. * * @param {FormResponse} response FormResponse object of the event * that triggered this notification */ function sendRespondentNotification(response) { var form = FormApp.getActiveForm(); var settings = PropertiesService.getDocumentProperties(); var emailId = settings.getProperty('respondentEmailItemId'); var emailItem = form.getItemById(parseInt(emailId)); var respondentEmail = response.getResponseForItem(emailItem) .getResponse(); if (respondentEmail) { var template = HtmlService.createTemplateFromFile('RespondentNotification'); template.paragraphs = settings.getProperty('responseText').split('\n'); template…
type: UnansweredQuestion

http://stackoverflow.com/a/29609704
score: 0
has comment: http://stackoverflow.com/comment/47422178
has body: One option is to read window.performance.getEntries object that contains all timing information - How to access performance object of every resource in a web page? (you may need to also configure IE to run in latest mode instead of IE8 or whatever default is for WebBrowser control). Another option is to configure browser to use proxy and point it to your own proxy (maybe the same process). This way you'll see all requests and will be able to measure or even modify them. You can use FiddlerCore as proxy implementation.
has comment: http://stackoverflow.com/comment/47422920
type: Answer
answers question: http://stackoverflow.com/q/29609428

http://stackoverflow.com/comment/47372691
comment on: http://stackoverflow.com/q/29612333
type: Comment
score: 0
has text: Really did not search for the edit question, sorry for that. Thank you for the links!
type: QuestionComment

http://stackoverflow.com/comment/52092474
type: Comment
type: QuestionComment
has text: Added an answer after a lot of research, hope it helps :)
comment on: http://stackoverflow.com/q/29683182
score: 0

http://stackoverflow.com/a/29620852
type: Answer
has comment: http://stackoverflow.com/comment/47385774
has comment: http://stackoverflow.com/comment/47386431
has comment: http://stackoverflow.com/comment/47386006
answers question: http://stackoverflow.com/q/29620393
has comment: http://stackoverflow.com/comment/47386159
score: 0
has body: Thank you so much everyone, the answer was easier than i though: The file test.json: { "test": "Hello World!" } And the code: var a = OwNet.get( 'core/config/test.json', function( Res ) { // Res is the response from an AJAX request (where i requested the test.json file) if( Res !== "" &amp;&amp; Res !== undefined &amp;&amp; Res !== null ) { // Replacing the line breaks, carriage returns and spaces Res = Res.replace( /\r\n|\r|\n|\s*/gm, "" ); // Erased the JSON.stringify and replaced tmp by Res return JSON.parse( Res ); } else return null; });

http://stackoverflow.com/comment/47403058
score: 0
type: Comment
type: QuestionComment
has text: http://stackoverflow.com/questions/11079756/using-same-id-for-in-multiple-html-tags
comment on: http://stackoverflow.com/q/29630109

http://stackoverflow.com/comment/47340123
type: Comment
has text: This would be a lot easier to take in for someone new to this if there were clearly listed (close to) equivalents for common jQuery methods.
score: 2
type: AnswerComment
comment on: http://stackoverflow.com/a/29596358

http://stackoverflow.com/comment/47325744
has text: That means that it will be done for every radio button. It would be better to move it outside the loops, so it's only done once. Edit: Putting it ouside the inner loop still means that it's done for each question.
type: AnswerComment
comment on: http://stackoverflow.com/a/29589304
score: 0
type: Comment

http://stackoverflow.com/comment/47273628
comment on: http://stackoverflow.com/a/29543081
type: Comment
has text: You are welcome :) I have added more comments, to make it even easier to understand the logic.
score: 0
type: AnswerComment

http://stackoverflow.com/q/29607221
tagged with: jquery
favorite count: 0
score: 0
has comment: http://stackoverflow.com/comment/47360161
possible better answer: http://stackoverflow.com/a/47852440
has answer: http://stackoverflow.com/a/29615156
has comment: http://stackoverflow.com/comment/47363968
has answer: http://stackoverflow.com/a/47852440
has title: jQuery not firing on first click
upvote count: 1
has comment: http://stackoverflow.com/comment/47360190
downvote count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29615156
has comment: http://stackoverflow.com/comment/47360173
has comment: http://stackoverflow.com/comment/47360163
type: Question
answer count: 2
has body: I'm making a custom jQuery slider and for whatever reason, my jQuery function is not firing on the first click, only subsequent clicks. I've searched stackoverflow for solutions, but none of them seem to match my issue. Here is my code: var theTestimonial = jQuery('.testimonial-wrapper'); var theWidth = theTestimonial.width(); var widthCount = theWidth; jQuery('.testimonial-container').wrap(' '); jQuery('.testimonial-container').css('margin-left', '0px'); jQuery('.extra-wrapper').css({ width: function() { return theWidth; }, position: 'relative', overflow: 'hidden' }); //get total of image sizes and set as width for ul var totalWidth = theTestimonial.length * theWidth; jQuery('.testimonial-container').css({ width: function(){ return totalWidth; } }); jQuery('.next').on("click", function () { if (widthCount < totalWidth) { widthCount = widthCount + 995; jQuery('.testimonial-container').animate({ "margin-left": theWidth = theWidth - 996 }, 750); } }); jQuery('.prev').on("click", function () { if (widthCount >= totalWidth && widthCount > 0) { jQuery('.testimonial-container').animate({ "margin-left": theWidth = theWidth + 996 }, 750); widthCount = widthCount - 996; } }); HMTL: < > <?php if( have_rows('testimonials') ) : ?> <?php while( have_rows('testimonials') ) : the_row(); ?> <?php echo the_sub_field('section_title',$postID);?> <img src="<?php the_sub_field('testimonial_image',$postID);?>" alt=""> <?php the_sub_field('testimonial_copy',$postID);?> <?php the_sub_field('testimonial_by',$postID);?> <?php endwhile; ?> <?php endif; ?> CSS .testimonial-outer { float: left; width: 100%; background: #fbb52e; padding: 40px 0 74px; } .testimonial-outer .section-title h3 { color: #fff; } .wrapper { width: 996px; margin: 0 auto; } .testimonial-outer .testimonial { float: left; width: 100%; padding: 37px 0 0; } .testimonial-left { float: left; width: 32.3%; } .testimonial-left img { max-width: 100%; } .testimonial-right { float: right; width: 65%; padding: 50px 0 0 70px; backgrou…
tagged with: javascript

http://stackoverflow.com/comment/47307286
score: 0
comment on: http://stackoverflow.com/q/29579198
type: Comment
type: QuestionComment
has text: seems to be a perfect fit.

http://stackoverflow.com/comment/47392670
has text: no. values are not coming to it. I need to catch the form with values input by the user & not the form content only
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29624224

http://stackoverflow.com/q/29555813
has answer: http://stackoverflow.com/a/29555945
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/9618504
downvote count: 1
has comment: http://stackoverflow.com/comment/47262327
has comment: http://stackoverflow.com/comment/47262363
type: Question
has title: Javascript : Cant get radio button value in var
score: -1
answer count: 2
upvote count: 0
tagged with: javascript
favorite count: 0
has body: I am trying to do arithmetic operation based on radio button value. Enter first number: Enter second number: Add Multiply Subtract Calculate
has answer: http://stackoverflow.com/a/29556161

google-sheets
tags question: http://stackoverflow.com/q/29609526
tags question: http://stackoverflow.com/q/29591099
tags question: http://stackoverflow.com/q/29661612
tags question: http://stackoverflow.com/q/29626337
tags question: http://stackoverflow.com/q/29551347
tags question: http://stackoverflow.com/q/29680988
type: Tag
tags question: http://stackoverflow.com/q/29686324
tags question: http://stackoverflow.com/q/29573752
tags question: http://stackoverflow.com/q/29539163
tags question: http://stackoverflow.com/q/29677865
tag name: google-sheets
tags question: http://stackoverflow.com/q/29670686

http://stackoverflow.com/a/29653289
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/47466442
has comment: http://stackoverflow.com/comment/47447443
has body: Documentation say : You might need to call setCoords on an object after centering, to update controls area. So doing this.Obj.setCoords(); after this.Obj.center(); should do the trick.
answers question: http://stackoverflow.com/q/29647944
upvote count: 7
score: 7
has comment: http://stackoverflow.com/comment/47454513
accepted answer of: http://stackoverflow.com/q/29647944

http://stackoverflow.com/comment/47386595
has text: it might be duplicate question: http://stackoverflow.com/questions/18723399/cascading-select-dropdowns and http://stackoverflow.com/questions/18082609/angularjs-populating-dependent-combobox
type: Comment
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/29621260

http://stackoverflow.com/comment/47597392
comment on: http://stackoverflow.com/q/29672842
score: 0
type: Comment
type: QuestionComment
has text: ``pageId`` is defintely correct. http://codepen.io/anon/pen/NqKyWJ - missing libraries (as mentioned in code: jQuery, iDangerous swiper) and some css code (mobile.css for example). Problem is not loading the libraries but simply the swiper itself is not working at all. The DOM itself is valid after jQuery manipulation.

http://stackoverflow.com/comment/47235768
type: AnswerComment
comment on: http://stackoverflow.com/a/29536986
has text: I haven't yet accepted your answer yet because for some reason, the order is still messed up when I navigate away and back... I have upvoted it though. Also, how would I make this work the same way but the opposite way? I have changed -1 to +1 but I don't understand the code completely to make it choose the first li after switching from last li.
type: Comment
score: 0

http://stackoverflow.com/comment/47255210
has text: regardless of where you are running it, xammp or live, my answer will work, you just need to adjust the file path
score: 0
comment on: http://stackoverflow.com/q/29544561
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47273289
comment on: http://stackoverflow.com/a/29561617
type: Comment
has text: Are you sure, those references will work inside bootstrap modals ? I don't want to use another library for date picker since I am already using pixel-admin.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47243486
type: AnswerComment
has text: What form should the `octetStream` be in? An array of Uint8s? Can you show me how to create this? `Uint8Array.from` is undefined for me.
type: Comment
comment on: http://stackoverflow.com/a/29545637
score: 0

http://stackoverflow.com/comment/47349537
score: 0
type: Comment
type: QuestionComment
has text: It is perfectly fine to answer your own question and accept it. Perhaps it will help other people in the future.
comment on: http://stackoverflow.com/q/29561335

http://stackoverflow.com/a/29682530
score: 0
has comment: http://stackoverflow.com/comment/47623557
type: Answer
has body: Problem 2: I want to reference an object by the value of a namespaced attribute, namely inkscape:label Try "[inkscape\\:label=" + labelVal + "]" var labelVal = "abc"; $("[inkscape\\:label=" + labelVal + "]").text("abc");
answers question: http://stackoverflow.com/q/29681949

http://stackoverflow.com/q/29585123
tagged with: node.js
type: AnsweredQuestion
score: 3
possible better answer: http://stackoverflow.com/a/29586910
downvote count: 0
type: Question
tagged with: database
tagged with: javascript
has body: With the RethinkDB JavaScript driver, is there a way to determine if there is another document available while within a "cursor.each" or a "cursor.on('data')" event? Via each cursor.each(function(err, doc) { if (err) throw err; // process document here // Is there a way to tell if there is another doc coming? }, function() { // End of data here, no document passed }) ); or via Event Emitter cursor.on('data', function(doc) { // handle doc, check if another doc is coming or not }); cursor.on('end', function() { // no document passed, just indicating end of data })
upvote count: 3
answer count: 2
accepted answer: http://stackoverflow.com/a/29612030
has title: RethinkDB: Determine if there is a next document in result set
favorite count: 0
tagged with: rethinkdb
has answer: http://stackoverflow.com/a/29586910
has answer: http://stackoverflow.com/a/29612030

inheritance
tags question: http://stackoverflow.com/q/29533164
tags question: http://stackoverflow.com/q/29612333
tags question: http://stackoverflow.com/q/29678952
tag name: inheritance
tags question: http://stackoverflow.com/q/29635844
type: Tag
tags question: http://stackoverflow.com/q/29631158
tags question: http://stackoverflow.com/q/29587721
tags question: http://stackoverflow.com/q/29598229
tags question: http://stackoverflow.com/q/29668603
tags question: http://stackoverflow.com/q/29602693
tags question: http://stackoverflow.com/q/29565101
tags question: http://stackoverflow.com/q/29565740

http://stackoverflow.com/comment/47318307
score: 0
type: AnswerComment
has text: @xslibx Is your code used on a site/page somewhere we could see it?
type: Comment
comment on: http://stackoverflow.com/a/29584705

angularjs-directive
tags question: http://stackoverflow.com/q/29532279
tag name: angularjs-directive
tags question: http://stackoverflow.com/q/29573242
tags question: http://stackoverflow.com/q/29531668
tags question: http://stackoverflow.com/q/29592283
tags question: http://stackoverflow.com/q/29540457
tags question: http://stackoverflow.com/q/29539264
tags question: http://stackoverflow.com/q/29558597
tags question: http://stackoverflow.com/q/29623683
tags question: http://stackoverflow.com/q/29632911
tags question: http://stackoverflow.com/q/29575578
tags question: http://stackoverflow.com/q/29615005
tags question: http://stackoverflow.com/q/29644059
tags question: http://stackoverflow.com/q/29584102
tags question: http://stackoverflow.com/q/29604112
tags question: http://stackoverflow.com/q/29626081
tags question: http://stackoverflow.com/q/29537805
tags question: http://stackoverflow.com/q/29644310
tags question: http://stackoverflow.com/q/29678827
tags question: http://stackoverflow.com/q/29686668
tags question: http://stackoverflow.com/q/29674529
tags question: http://stackoverflow.com/q/29643903
tags question: http://stackoverflow.com/q/29647187
tags question: http://stackoverflow.com/q/29626718
tags question: http://stackoverflow.com/q/29607866
tags question: http://stackoverflow.com/q/29585313
tags question: http://stackoverflow.com/q/29547738
tags question: http://stackoverflow.com/q/29658086
tags question: http://stackoverflow.com/q/29644689
type: Tag
tags question: http://stackoverflow.com/q/29560947
tags question: http://stackoverflow.com/q/29576517
tags question: http://stackoverflow.com/q/29662729
tags question: http://stackoverflow.com/q/29549883
tags question: http://stackoverflow.com/q/29604939
tags question: http://stackoverflow.com/q/29643349
tags question: http://stackoverflow.com/q/29562213
tags question: http://stackoverflow.com/q/29634839
tags question: http://stackoverflow.com/q/29569459
tags question: http://stackoverflow.com/q/29608747
tags question: http://stackoverflow.com/q/29641504
tags question: http://stackoverflow.com/q/29686236
tags question: http://stackoverflow.com/q/29551379
tags question: http://stackoverflow.com/q/29555509
tags question: http://stackoverflow.com/q/29662723
tags question: http://stackoverflow.com/q/29680145
tags question: http://stackoverflow.com/q/29666835
tags question: http://stackoverflow.com/q/29665800
tags question: http://stackoverflow.com/q/29546131
tags question: http://stackoverflow.com/q/29542307
tags question: http://stackoverflow.com/q/29604979
tags question: http://stackoverflow.com/q/29572477

http://stackoverflow.com/q/29534560
answer count: 0
duplicate of: http://stackoverflow.com/q/7372038
has body: I have HTML5 Date input on my Webapp which is mostly used on tablets. On Desktop when I check the format in which I enter, It is dd/mm/yyyy, I can just go ahead and enter it in same format. On tablet when I touch the field It opens big Popup with sliders for Date, Month &amp; Year, After I select everything. It goes back to normal view but now date format mentioned there is in format of mm/dd/yyyy Is there any way to keep same format for both desktop and tablet and preferably Keep dd/mm/yyyy for both. &lt;input type="date" name="bday"&gt; or you can consider any datepicker Live example you may get here http://www.w3schools.com/html/tryit.asp?filename=tryhtml_input_date
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/47222059
has comment: http://stackoverflow.com/comment/47224420
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: HTML5 Date field format preference
linked to: http://stackoverflow.com/q/7372038

cordova
tags question: http://stackoverflow.com/q/29539438
tags question: http://stackoverflow.com/q/29653490
tags question: http://stackoverflow.com/q/29605865
tags question: http://stackoverflow.com/q/29554157
tags question: http://stackoverflow.com/q/29606003
tags question: http://stackoverflow.com/q/29688141
tags question: http://stackoverflow.com/q/29609941
tags question: http://stackoverflow.com/q/29598376
tags question: http://stackoverflow.com/q/29636912
tags question: http://stackoverflow.com/q/29538175
tags question: http://stackoverflow.com/q/29573008
tags question: http://stackoverflow.com/q/29624801
tags question: http://stackoverflow.com/q/29688099
tags question: http://stackoverflow.com/q/29632141
tags question: http://stackoverflow.com/q/29580172
tags question: http://stackoverflow.com/q/29679111
tags question: http://stackoverflow.com/q/29541534
tags question: http://stackoverflow.com/q/29630923
tags question: http://stackoverflow.com/q/29623616
tags question: http://stackoverflow.com/q/29656179
tags question: http://stackoverflow.com/q/29649800
tags question: http://stackoverflow.com/q/29687877
tags question: http://stackoverflow.com/q/29642573
tags question: http://stackoverflow.com/q/29664254
tags question: http://stackoverflow.com/q/29602069
tags question: http://stackoverflow.com/q/29531676
tags question: http://stackoverflow.com/q/29632077
tags question: http://stackoverflow.com/q/29573982
tags question: http://stackoverflow.com/q/29682351
tags question: http://stackoverflow.com/q/29669051
tags question: http://stackoverflow.com/q/29687655
tags question: http://stackoverflow.com/q/29640102
tag name: cordova
tags question: http://stackoverflow.com/q/29603812
tags question: http://stackoverflow.com/q/29672581
tags question: http://stackoverflow.com/q/29621623
tags question: http://stackoverflow.com/q/29636102
tags question: http://stackoverflow.com/q/29531505
tags question: http://stackoverflow.com/q/29644798
tags question: http://stackoverflow.com/q/29655830
tags question: http://stackoverflow.com/q/29558435
tags question: http://stackoverflow.com/q/29606012
tags question: http://stackoverflow.com/q/29647998
tags question: http://stackoverflow.com/q/29634266
tags question: http://stackoverflow.com/q/29533708
tags question: http://stackoverflow.com/q/29642019
tags question: http://stackoverflow.com/q/29568433
tags question: http://stackoverflow.com/q/29670997
tags question: http://stackoverflow.com/q/29649520
tags question: http://stackoverflow.com/q/29566223
tags question: http://stackoverflow.com/q/29650549
tags question: http://stackoverflow.com/q/29644612
tags question: http://stackoverflow.com/q/29626482
tags question: http://stackoverflow.com/q/29635806
tags question: http://stackoverflow.com/q/29651678
tags question: http://stackoverflow.com/q/29548601
type: Tag
tags question: http://stackoverflow.com/q/29629459
tags question: http://stackoverflow.com/q/29590281
tags question: http://stackoverflow.com/q/29609379
tags question: http://stackoverflow.com/q/29631247
tags question: http://stackoverflow.com/q/29673545
tags question: http://stackoverflow.com/q/29598220
tags question: http://stackoverflow.com/q/29644942

http://stackoverflow.com/q/29629771
tagged with: css
has comment: http://stackoverflow.com/comment/47402411
has comment: http://stackoverflow.com/comment/47409898
has comment: http://stackoverflow.com/comment/47402684
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29629864
has answer: http://stackoverflow.com/a/29630776
accepted answer: http://stackoverflow.com/a/29630776
upvote count: 1
downvote count: 7
type: Question
has comment: http://stackoverflow.com/comment/47409964
has comment: http://stackoverflow.com/comment/47402346
answer count: 2
has comment: http://stackoverflow.com/comment/47402674
has comment: http://stackoverflow.com/comment/47402435
tagged with: javascript
has comment: http://stackoverflow.com/comment/47410223
has comment: http://stackoverflow.com/comment/47409918
has comment: http://stackoverflow.com/comment/47402407
has comment: http://stackoverflow.com/comment/47410087
has comment: http://stackoverflow.com/comment/47403086
possible better answer: http://stackoverflow.com/a/29629864
has comment: http://stackoverflow.com/comment/47410121
has body: I am trying to get this layout using CSS but the most close implementation to get it is from pinterest.com but they need some Javascript for actually get the layout. I need to know if I can do it without use Javascript for calculate the position of the next item.
has comment: http://stackoverflow.com/comment/47402428
has title: How to create this layout using CSS
tagged with: http://stackoverflow.com/tag/html
score: -6
favorite count: 0
tagged with: semantic-ui
has comment: http://stackoverflow.com/comment/47402572
has comment: http://stackoverflow.com/comment/47410268

http://stackoverflow.com/comment/47290941
comment on: http://stackoverflow.com/q/29570738
type: Comment
type: QuestionComment
has text: So I'm guessing you're going to continue asking particular questions until the community has coded your entire application for you?
score: 0

http://stackoverflow.com/q/29656679
favorite count: 0
linked to: http://stackoverflow.com/q/11806253
duplicate of: http://stackoverflow.com/q/11806253
has title: Having 2 function in one onchange
has body: How can i add return confirm in the onchange function? This is want i want to add return confirm('Are you sure?'); &lt;select name='&lt;?php echo "sel".$a; ?&gt;' onchange='this.form.submit()' style='width: 150px'&gt;
has comment: http://stackoverflow.com/comment/47453069
score: 2
upvote count: 2
type: UnansweredQuestion
tagged with: php
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/29656713

http://stackoverflow.com/comment/47260623
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29554509
score: 0
has text: @Regent In C++, beginners often wonder, when is a virtual function called, what happens in the instantiation of polymorphic class, i.e, people will want to care about minute details for predictability. I believe, I'm asking an equivalent question here for PHP/HTML/CSS/JS.

http://stackoverflow.com/comment/52155394
type: QuestionComment
comment on: http://stackoverflow.com/q/29598925
has text: This Httpd server is amazing. It serves static pages (as GET) as well as Thrift processing.
score: 0
type: Comment

http://stackoverflow.com/a/29628559
score: 2
has comment: http://stackoverflow.com/comment/47400025
upvote count: 2
has body: If you want to share data like this between controllers I suggest you create a service that they can both depend on. HTML: &lt;div ng-app="app"&gt; &lt;p ng-controller="controller1"&gt;{{message}}&lt;/p&gt; &lt;p ng-controller="controller2"&gt;{{message}}&lt;/p&gt; &lt;/div&gt; JavaScript: var app = angular.module('app', []); app.service('dataService', function() { return { message: 'Hello world!' }; }).controller('controller1', function($scope, dataService) { $scope.message = dataService.message; }).controller('controller2', function($scope, dataService) { $scope.message = dataService.message; }); Working fiddle here: https://jsfiddle.net/ben1729/yeLd9rnb/3/
answers question: http://stackoverflow.com/q/29628369
downvote count: 0
type: Answer

http://stackoverflow.com/q/29571059
tagged with: javascript
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/47292695
favorite count: 0
tagged with: instagram
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47292007
has title: Instagram Api OAuthAccessTokenException 400 error
score: 1
has comment: http://stackoverflow.com/comment/47291947
upvote count: 1
tagged with: ruby-on-rails
type: Question
tagged with: google-maps
has body: I am having an issue with my Rails 4.0 web app. I am using Google maps Api to return the lat and long then passing that info to Instagram's Api. However I am getting an error: {"meta":{"error_type":"OAuthAccessTokenException","code":400,"error_message":"The access_token provided is invalid."}} I have gone through the process of creating multiple AccessTokens but still nothing. Has anyone run into this before and if so how did you solve it? This is my code: var codeAddressLat; var codeAddressLng; var addMarkerLat; var addMarkerLng; var locationLat; var locationLong; var accessToken; var mediaEndPoint; $(document).ready(function(){ var accessToken="USER_ACCESSTOKEN_PLACEHOLDER"; $('.get_photo').click(function(){ mediaEndPoint = ("https://api.instagram.com/v1/media/search?lat=" + locationLat + "&amp;lng=" + locationLong + "&amp;access_token=" + accessToken + "?callback=?"); if (addMarkerLng !== null &amp;&amp; addMarkerLat !== null ) { locationLong=addMarkerLng; locationLat=addMarkerLat; console.log("Add Marker " + mediaEndPoint) }else if (codeAddressLat !== null &amp;&amp; codeAddressLng !== null) { locationLat=codeAddressLat; locationLong=codeAddressLng; console.log("Code Address: "+ mediaEndPoint) }else{ alert("Oops! Something went wrong, please try again!") } $(".insta-list").empty(); $.getJSON(mediaEndPoint, function(jsonResult){ var items = jsonResult["data"]; var container =[] $.each(items, function(){ var val = this["images"]["standard_resolution"]["url"] container.push("&lt;img src=" + val + "&gt;" ); }); $("&lt;ul/&gt;",{ "class": "insta-list", html: imageContanier.join( "" ) }).appendTo(".modal-body"); }) }); });
has answer: http://stackoverflow.com/a/29571982

http://stackoverflow.com/q/29534537
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47222020
has comment: http://stackoverflow.com/comment/47222626
has answer: http://stackoverflow.com/a/29534885
has answer: http://stackoverflow.com/a/29534716
has comment: http://stackoverflow.com/comment/47222194
type: Question
has comment: http://stackoverflow.com/comment/47222077
has comment: http://stackoverflow.com/comment/47222671
has comment: http://stackoverflow.com/comment/47222390
has answer: http://stackoverflow.com/a/29534742
has comment: http://stackoverflow.com/comment/47222144
has comment: http://stackoverflow.com/comment/47222495
has comment: http://stackoverflow.com/comment/47222182
score: 0
answer count: 3
has title: Triggering click event on an element not working in IE8
possible better answer: http://stackoverflow.com/a/29534742
has comment: http://stackoverflow.com/comment/47222631
has comment: http://stackoverflow.com/comment/47222455
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47222227
has comment: http://stackoverflow.com/comment/47222715
has body: I am making an angular app but I have found an instance where I need to use jQuery. I need to click a button which raises a click event on another hidden button. I know this seems odd but I need this functionality because an angular module I am using, ng-file-upload, will not work on styled icons. My solution was to create two buttons, one hidden, one transparent. I then put the styled icon on the transparent button and made the other button hidden. I then used jQuery to cause the second button to be clicked when the first is clicked. This works fine in modern firefox/chrome but not at all in IE8. Upload $(document).on('click', '#firstClick', function() { $('#secondClick').trigger('click'); }); I am currently using jQuery version 1.10.2. Any help with this or alternative ways to achieve this would be greatly appreciated. Thanks in advance! UPDATE: I think the problem may have to do with angular-file-select as the secondClick is now firing. However angular-file-select is not. Also I set secondClick to visible and when I click it directly it fires ng-file-select.
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47222471
has comment: http://stackoverflow.com/comment/47223281
tagged with: angular-file-upload
has comment: http://stackoverflow.com/comment/47221945
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47222577
accepted answer: http://stackoverflow.com/a/29534716

http://stackoverflow.com/comment/47415295
type: Comment
type: QuestionComment
has text: Hi JDB - I think I understand. I'm not sure this is any better, but it's true - the ~(curstudid) call gets an ID number that is not the record number. It's simply an identifier - does that make a difference in your warning?
comment on: http://stackoverflow.com/q/29635014
score: 0

http://stackoverflow.com/q/29682865
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
favorite count: 0
upvote count: 0
has body: Okay, So I want to refresh 2 divs with ONLY 1 CLICK OF 1 BUTTON without actually refreshing the page itself. I've tried the following HTML: Click to continue Jquery: This in the HTML: needs to activate 2 div refreshes, I did this so i can hook two things up. The following scripts just bugs out and can only refresh itself once instead of a couple of times, please help.
type: UnansweredQuestion
tagged with: css
has comment: http://stackoverflow.com/comment/47504062
has comment: http://stackoverflow.com/comment/47504263
has answer: http://stackoverflow.com/a/29683581
has comment: http://stackoverflow.com/comment/47512010
type: Question
has title: Refresh 2 divs with one click Jquery
answer count: 2
has comment: http://stackoverflow.com/comment/47502806
has answer: http://stackoverflow.com/a/29683798
tagged with: javascript
tagged with: jquery
score: -1

http://stackoverflow.com/q/29569435
downvote count: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/29569702
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47288206
favorite count: 0
has comment: http://stackoverflow.com/comment/47288313
has title: Uncaught TypeError: Cannot read property 'createDocumentFragment' of undefined (using wysiwyg)
tagged with: http://stackoverflow.com/tag/html
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/47288492
has comment: http://stackoverflow.com/comment/47288395
has comment: http://stackoverflow.com/comment/47288490
has body: Here is my jQuery: $(".wysiwygtext").on("keyup keypress paste mouseup", function (e, t) { clearTimeout(timeout); timeout = setTimeout(function (e, t) { var element = $(this).html(); //throws 'Uncaught TypeError: Cannot read property 'createDocumentFragment' of undefined' var value = $(this).val(); //throws 'Uncaught TypeError: Cannot read property 'toLowerCase' of undefined' error console.log(element); console.log(value); }, 2000); }); .wysiwyg is a class applied to certain divs, like so (html is generated from the server): &lt;div class='wysiwygtext' data-guid='" + statementGuid + "' value='" + statementGuid + "'&gt;" + lastbody + "&lt;/div&gt; I just need to retrieve the contents of the div (html) and the value (or ID) of the div upon any text change, but I am getting this error: Uncaught TypeError: Cannot read property 'createDocumentFragment' of undefined Thank you for any assistance.
has answer: http://stackoverflow.com/a/29569702
type: Question
type: AnsweredQuestion
tagged with: wysiwyg
has comment: http://stackoverflow.com/comment/47288405
has comment: http://stackoverflow.com/comment/47288541

http://stackoverflow.com/comment/47395016
type: AnswerComment
has text: thanks this works, is there a way to get this to check when the window is resized. At the moment it works perfectly as it seems checks on load of page and then decides what to do with the logo. I would also like it to change the logo when the window changes width once the page has loaded not just on load.
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29624915

http://stackoverflow.com/a/29614381
has comment: http://stackoverflow.com/comment/47393662
has comment: http://stackoverflow.com/comment/47384774
has comment: http://stackoverflow.com/comment/47394011
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47389584
has comment: http://stackoverflow.com/comment/47392806
accepted answer of: http://stackoverflow.com/q/29588844
has comment: http://stackoverflow.com/comment/47390237
type: AcceptedAnswer
downvote count: 0
has body: It seems that you want to change the rowid of the row after editing. You send the editing data to the server using prmNames: { id: "_rowid", ...} option. So postdata._rowid should contains the rowid of editing row. The response from the server after editing seems looks something like {"PrimaryKeyValues":["1","change","004"],"Id":"1ä_63_68_61_6E_67_65ä004"} where Id property contains new rowid after editing the row. In the case you can use afterComplete callback afterComplete: function (jqXhr, postdata, $form, formOper) { if (formOper !== "add") { var json = $.parseJSON(jqXhr.responseText), p = $(this).jqGrid("getGridParam"), oldId = p.idPrefix + postdata._rowid, newId = p.idPrefix + json.Id, i; $("#" + $.jgrid.jqID(oldId)).attr("id", newId); if (p.selrow === oldId) { p.selrow = newId; i = $.inArray(oldId, p.selarrrow); if (i &gt;= 0) { p.selarrrow[i] = newId; } } } } You should include such callback in the editParams which you use for the form editing: var editParams = { afterSubmit: function (response, postdata) { return EditAddForm_AfterSubmit(response, postdata); }, afterComplete: function (jqXhr, postdata, $form, formOper) { if (formOper !== "add") { var json = $.parseJSON(jqXhr.responseText), p = $(this).jqGrid("getGridParam"), oldId = p.idPrefix + postdata._rowid, newId = p.idPrefix + json.Id, i; $("#" + $.jgrid.jqID(oldId)).attr("id", newId); if (p.selrow === oldId) { p.selrow = newId; i = $.inArray(oldId, p.selarrrow); if (i &gt;= 0) { p.selarrrow[i] = newId; } } } }, url: 'http://example.com/Edit?_entity=Grnait', closeAfterEdit: true, };
answers question: http://stackoverflow.com/q/29588844
has comment: http://stackoverflow.com/comment/47392369
type: Answer

http://stackoverflow.com/comment/47476546
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29668826
has text: I did as you suggested above, but when I debug the JS function, the id is passed just like this: "<%=lblGVDeleteMessage.ClientID%>" and therefore the elem is null. As I've said, both the button and the label are inside columns of a gridview and I'm also using a master page.

http://stackoverflow.com/comment/47239940
has text: Try to `window.SomeClass({})` on your console.
comment on: http://stackoverflow.com/q/29544147
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/comment/47340004
comment on: http://stackoverflow.com/q/29596357
score: 6
has text: possible duplicate of [What do people mean when they say "DOM Manipulation"?](http://stackoverflow.com/questions/3934826/what-do-people-mean-when-they-say-dom-manipulation)
type: Comment
type: QuestionComment

http://stackoverflow.com/a/45120037
score: 2
answers question: http://stackoverflow.com/q/29677339
downvote count: 0
has body: You need to use a BlobBuilder in that case. From: https://github.com/bpampuch/pdfmake/issues/294#issuecomment-104029716 try { blob = new Blob([result], { type: 'application/pdf' }); } catch (e) { // Old browser, need to use blob builder window.BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder; if (window.BlobBuilder) { var bb = new BlobBuilder(); bb.append(result); blob = bb.getBlob("application/pdf"); } }
upvote count: 2
type: Answer

http://stackoverflow.com/comment/47453488
has text: Coud you make a Codepen example that reproduces this error? You can fork this pen: http://codepen.io/onsen/pen/IDvFJ
score: 0
comment on: http://stackoverflow.com/q/29649520
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29664790
has body: I think this is what you want.. With ko.mapping.fromJS method u can automatically observe all the properties from your object.. Take some time to read about that..
score: 0
answers question: http://stackoverflow.com/q/29664006
type: Answer

http://stackoverflow.com/a/29591984
type: Answer
score: 0
answers question: http://stackoverflow.com/q/29591881
has body: As per the docs you should be checking whether the new value and old value differ e.g. $scope.$watch('user.name', function(newVal, oldVal) { if (newVal !== oldVal) { // Do something with newVal } });

http://stackoverflow.com/comment/47335889
comment on: http://stackoverflow.com/q/29594319
type: Comment
type: QuestionComment
has text: Its probably a referenced value vs a copied one. Try A = JSON.parse(JSON.stringify(A)) between your A = myFunct(A) calls. I cannot test I am on my iPhone
score: 1

http://stackoverflow.com/q/29676789
has body: I have an ExtJS (version 4.1.1) application with a single JSP page but multiple screens created using Ext JS components. When I click on the back button in the browser, I want to display the last visited screen within the application, rather than using the browser's default behavior of redirecting to the last visited web page. How can I achieve this?
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: extjs
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29678644
downvote count: 0
score: 1
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29678644
has title: ExtJS app navigation using browser back button

http://stackoverflow.com/a/29686224
upvote count: 1
has comment: http://stackoverflow.com/comment/47509808
type: AcceptedAnswer
downvote count: 0
has body: I have implemented a similar solution in my blog a few years ago. I got it working by scripting this way: Add a variable scrollTop which would contain the value in pixels scrolled from the window top. var scrollTop = $(window).scrollTop(); See, I use jquery function scrollTop applied to the selected object "window". It would return the value scrolled from the very top of the browser. It does work on Wordpress, I have tried it on my blog. Put this code in a function scrollUpdate. We'll call it later to update the scroll value from top function scrollUpdate() { var scrollTop = $(window).scrollTop(); } The function should also contain all the logic checking the scrollTop value and thus applying styles and etc. Let's make this function be called on every scroll. window.onscroll = scrollUpdate; Try it yourself! P.S. I got a weird feeling, but you should better use hide / show instead of adding a whole css class to the page.
type: Answer
accepted answer of: http://stackoverflow.com/q/29685853
score: 1
answers question: http://stackoverflow.com/q/29685853

http://stackoverflow.com/a/29571168
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29570917
type: Answer
answers question: http://stackoverflow.com/q/29570917
has body: I tried to fix the errors in your code: https://jsfiddle.net/840xyrL7/1/ Item1 Item2 $("#position").change(function() { //one selection is 1, the other is 0. if(this.selectedIndex === 1){ var row = $(" "); var year = $(' '); var position = $(' '); year.append(position); row.append(year); $("#position").after(row); } }); Here are the lessons learned for you: Do not put comma between the attributes: type = "text", id= Be careful about closing quotes: id='row_position> Do not use append if you want to add a new control next to another control: $("#position").append(row);, instead use .after()
score: 1
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/47407590
comment on: http://stackoverflow.com/a/29625878
type: AnswerComment
has text: Awesome job! I just spotted one bug - it do not match `10` as a day, because there is pattern `[01][1-9]`. So we need one more case `(?:0[1-9]|1\d)` – [Debuggex Here](https://www.debuggex.com/r/c59u1dAfNc0879AW)
score: 0
type: Comment

http://stackoverflow.com/comment/47399641
type: Comment
comment on: http://stackoverflow.com/q/29628174
score: 0
type: QuestionComment
has text: According to the [Autocomplete demos](https://jqueryui.com/autocomplete/#remote-jsonp), `response` is a callback function to which you should be *passing* your data (e.g. `response($.map(...))`).

http://stackoverflow.com/a/29574265
has body: If you are only concerned with testing whether a given string contains two or more sequential dot '.' characters: var string = '$1..00', regexp = /(\.\.+)/; alert('Is this regular expression ' + regexp + ' found in this string ' + string + '?\n\n' + regexp.test(string) + '\n\n' + 'Match and captures: ' + regexp.exec(string)); If you need it to match the currency format: var string = '$1..00', regexp = /\$\d*(\.\.+)(?:\d\d)+/; alert('Is this regular expression ' + regexp + ' found in this string ' + string + '?\n\n' + regexp.test(string) + '\n\n' + 'Match and captures: ' + regexp.exec(string)); But I caution you that Regular Expressions aren't for comparing the differences between two strings; they are used for defining patterns to match against given strings. So, while this may directly answer how to find the "multiple dots" pattern, it is useless for "finding the difference between two strings". The StackOverflow tag wiki provides an excellent overview and basic reference for RegEx. See: https://stackoverflow.com/tags/regex/info
has comment: http://stackoverflow.com/comment/47298176
upvote count: 0
score: -2
has comment: http://stackoverflow.com/comment/47321331
has comment: http://stackoverflow.com/comment/47320367
type: Answer
answers question: http://stackoverflow.com/q/29573700
has comment: http://stackoverflow.com/comment/47320421
downvote count: 2
has comment: http://stackoverflow.com/comment/47320342

http://stackoverflow.com/comment/47350207
type: AnswerComment
comment on: http://stackoverflow.com/a/29601828
type: Comment
score: 0
has text: I am testing it and it is not giving the nedeed result. I can understand that i don't need to sort it twice, but as told, I need to be in the array first the objects "cod_nivel"='INC1' then 'INC2' objects then 'PRIM1'...with your code is ordering 'BAC1' objects at the beginning of the array because it is ordering by cod_nivel ascending and BAC1 is before INC1... am i wrong?

http://stackoverflow.com/a/29616382
has body: You need to set all the data you need in an object, and send it as a JSON string in an AJAX request. document.getElementById('send').onclick = function (evt) { var errors = false; //Gets all the inputs from contact form var myNodeList = document.querySelectorAll('input, textarea, select'); var data = {}; //Declar the vars //var i, val; // empty Array //Start of loop for (i = 0; i &lt; myNodeList.length; i++) { // Get element val = myNodeList[i].value; data[myNodeList[i].id] = val; //Get pattern attribute of regEx regEx = new RegExp(val.getAttribute("pattern")); //Get Error message err = document.getElementById(val.id + "-error") //By default, set the class to error, which hides the error message err.className = "error"; //Test value "val" again the regEx if (!regEx.test(val.value)) { //input fails and does not pass regEx test, set .display class err.className += " display"; errors = true; } } evt.preventDefault(); if (errors === false) { var req = new XMLHttpRequest(); req.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); req.open('POST', 'http://wirehopper.net/ajax-submit.php'); req.onload = function () { if(req.status == 200) alert(req.response); } //TODO: implement error handling req.send(JSON.stringify(data)); }; }
score: 1
answers question: http://stackoverflow.com/q/29616202
accepted answer of: http://stackoverflow.com/q/29616202
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47378091
has comment: http://stackoverflow.com/comment/47378214
type: Answer
has comment: http://stackoverflow.com/comment/47378668
upvote count: 1
has comment: http://stackoverflow.com/comment/47378065

http://stackoverflow.com/q/29640102
type: UnansweredQuestion
score: 2
downvote count: 0
has body: I'm currently developing an app with angularjs and cordova. I use Gulp to compile all the js, less, etc and merge it into a www folder. It's a big project and many apps will be created based on the same base core. I don't want to "clone" the entire project each time a have a new client because if a bug is found or a feature has to change I will have to redo everything in every single project. I want to know if there's a way to create a build system with Gulp, where I could have a base core js/less, and that base js/less core could be replaced if the same js (or angular module name for instance) is found on another folder. Example image: folder structure In the above example, I will need a specific task to build "ProjectA". I was thinking in something like "gulp build ProjectA" and then all files in "AppCore" folder would be compile only if there wasn't the same js, less or angular module inside "ProjectA" folder. Or I don't know if is possible also to compile everything in "AppCore" and then override that result with the content found in "ProjectA" if equal. If something new in "ProjectA" that would be added. Is there any gulp plugin to achieve this? Or does this have to be done in a different way? What is the best way to create a flexible project like this with a shared based code core? Thank you
type: Question
has title: AngularJS share app core with multiple projects with Gulp
tagged with: javascript
upvote count: 2
tagged with: shared
tagged with: gulp
favorite count: 0
tagged with: cordova
tagged with: angularjs
answer count: 0

http://stackoverflow.com/q/29647802
tagged with: carousel
tagged with: height
possible better answer: http://stackoverflow.com/a/45491861
tagged with: css
has answer: http://stackoverflow.com/a/29648148
has title: Owl carousel full screen doesn't work
has answer: http://stackoverflow.com/a/45491861
type: AnsweredQuestion
type: Question
tagged with: fullscreen
has comment: http://stackoverflow.com/comment/47436094
accepted answer: http://stackoverflow.com/a/29648148
tagged with: javascript
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/47435827
has body: I am trying to make owl carousel slider full screen for my site. This is what I need, feel free to resize Your browser And this is what I have, fiddle $(document).ready(function() { // carousel setup $(".owl-carousel").owlCarousel({ navigation : false, slideSpeed : 300, paginationSpeed : 400, singleItem: true, autoHeight: true, afterMove: top_align, }); function top_align() { $(window).scrollTop(0); console.log('move'); } }); is there any solution to fix it? Thx
linked to: http://stackoverflow.com/q/29629780

http://stackoverflow.com/comment/47400427
type: AnswerComment
type: Comment
has text: Good information, I will definitely have to do a little more research into this! I would up vote but I need 15 reputation!
comment on: http://stackoverflow.com/a/29628294
score: 0

http://stackoverflow.com/a/29608186
type: Answer
has comment: http://stackoverflow.com/comment/47364121
accepted answer of: http://stackoverflow.com/q/29608118
answers question: http://stackoverflow.com/q/29608118
has comment: http://stackoverflow.com/comment/47363978
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47364451
has comment: http://stackoverflow.com/comment/47364195
has comment: http://stackoverflow.com/comment/47364161
has comment: http://stackoverflow.com/comment/47364232
has comment: http://stackoverflow.com/comment/47364351
type: AcceptedAnswer
has body: There is whitespace in your div, which also exists when the text file is empty. Instead, do: <?php include("edit/franvarande.txt"); ?> However, include() is meant for PHP files. If your file is 'just text', you could use file_get_contents(), so that the file doesn't go through PHP, instead: <?php echo file_get_contents("edit/franvarande.txt"); ?> You can split it up over three lines for readability: <?php echo file_get_contents("edit/franvarande.txt"); ?> Have a look at this snippet. The top right table cell is 'empty', but has whitespace, and because of this it's not selected with :empty. $( "td:empty" ) .text( "Was empty!" ) .css( "background", "rgb(255,220,200)" ); TD #0 TD #2 TD#5
upvote count: 1
has comment: http://stackoverflow.com/comment/47363296

http://stackoverflow.com/comment/47373385
comment on: http://stackoverflow.com/a/29592596
score: 0
type: AnswerComment
has text: There's a reason that database best practices say to always use INT and autoincrement for IDs, but it's your prerogative as to whether you want to follow best practices I guess.
type: Comment

http://stackoverflow.com/comment/47286930
type: Comment
score: 0
has text: Here, let's move this to a chat to prevent too many back and forths. http://chat.stackoverflow.com/rooms/74965/when-enter-a-date-in-text-box-start-date-automatically-show-dates-of-next-one-yea
comment on: http://stackoverflow.com/a/29568271
type: AnswerComment

http://stackoverflow.com/comment/47476023
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29668120
type: AnswerComment
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/75363/discussion-between-guruprasad-rao-and-thomas-sebastian).

http://stackoverflow.com/q/29668358
type: UnansweredQuestion
tagged with: model-view-controller
score: 2
has answer: http://stackoverflow.com/a/29668564
has body: I have two controller's and I want to call other parent controller function with parameter when user clicks the button. Html Click Controller controller: function($scope) { .......... $scope.test= $scope.$parent.parentTest(t);// it fails... ..........} Parent Controller $scope.parentTest= function(m) { var my=m; ...Something... } If I run function without any parameter, it works. If I run the function with parameter it doesn't. I want to call parent function with parameter.
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47475659
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/29668670
favorite count: 0
has title: AngularJs call parent controller function with parameter
tagged with: angularjs
upvote count: 2

http://stackoverflow.com/q/29686513
has body: setInterval(function () {myFunction()}, 1000); (function myFunction() { ... })(); The parenthesis around the function make it run automatically. However, it causes problems with setting the interval for that function. Is there any way to fix this? Or, perhaps, a better way to make functions run automatically? Thank you in advance.
answer count: 1
type: UnansweredQuestion
has title: Auto-execute parenthesis creates problems with setInterval?
type: Question
has answer: http://stackoverflow.com/a/29686532
tagged with: javascript
score: 0

http://stackoverflow.com/comment/47250375
type: Comment
comment on: http://stackoverflow.com/q/29549030
score: 1
type: QuestionComment
has text: The behaviour is different between angular 1.2 and 1.3. Update to angular 1.3+ and you'll find that this issue has been resolved.

http://stackoverflow.com/comment/47258337
has text: Also, your string has error on >> "name" : "Jacob","title" : "King","gender" : "Male", << there won't be any comma after "male"
score: 0
comment on: http://stackoverflow.com/a/29553646
type: Comment
type: AnswerComment

http://stackoverflow.com/q/29590975
tagged with: twitter-bootstrap
tagged with: ng-class
type: Question
tagged with: javascript
score: 0
answer count: 1
has title: Updating class name in ngClass directive when model changes
tagged with: angularjs
has body: I'm using AngularJS and Bootstrap grid in order to present some information that needs to be updated real-time. However, this should also update the bootstrap column size and offset. I have two nested repeats and I access the data in the grandparent scope (due to child scopes created by repeats): &lt;div class="col-xs-{{$parent.$parent.colWidth}}" ng-repeat="w in $parent.widths track by $index" ng-class="{'col-xs-offset-{{$parent.$parent.colOffset}}':$first}"&gt; The problem arises when I update $scope.colOffset: the [value] in col-xs-offset-[value] is not affected. However, if I add elements to $scope.widths the newly created elements have the correct value whereas the original elements have the outdated value. I am using $watch to track changes in $scope.plate.width (which is the changing value) and updating the depedent variables $scope.colOffset, $scope.colWidth, $scope.widths: $scope.$watch('plate.width', function(newValue, oldValue) { var newValue = parseInt(newValue); $scope.colWidth = Math.floor(Math.min(12 / newValue, 12)); $scope.colOffset = Math.floor((12 - $scope.colWidth * newValue) / 2); $scope.widths = $scope.getNumber(newValue); }); $scope.getNumber = function(n) { var ar = new Array(n); return ar; } Interesting remark here is that col-xs-[value] is updated but col-xs-offset-[value] is not.
has answer: http://stackoverflow.com/a/29591061
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29591061

http://stackoverflow.com/a/29551812
score: 3
answers question: http://stackoverflow.com/q/29544421
downvote count: 0
type: Answer
has body: Create another array with pure data and put all the information you need. So you will get something like: var markersData = [] When you create a marker inside a loop add an index: var marker = new google.maps.Marker({ position: latlng, map: googleMap, title: 'Hello World!', labelContent: "A", labelAnchor: new google.maps.Point(3, 30), labelClass: "labels", labelInBackground: false, index: i }); markersData.push(marker); Then inside your handler you can access the data by google.maps.event.addListener(marker, 'click', function () { var info = markersData[this.index]; ... });
upvote count: 3

http://stackoverflow.com/comment/47318249
score: 0
comment on: http://stackoverflow.com/q/29584445
type: Comment
type: QuestionComment
has text: Your problem is happening because of the css being added to the body. When I run your code (with my own html since you didn't provide any) it works fine if the body css is removed. I can inspect the elements and see the the cursor css is being applied. Can you update your question with the minimum html required to reproduce the issue?

http://stackoverflow.com/comment/47375606
has text: I'm sorry but relative to what? relative to base?
score: 0
comment on: http://stackoverflow.com/q/29614917
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47479907
comment on: http://stackoverflow.com/q/29659845
type: Comment
type: QuestionComment
has text: In your source - in line 162. You logging your result position. But why are you so sure in your `data`? Log `data` before calling for `lonLatToVector3(data.latitude, data.longitude);` Seems like you have now `data.longitude` member.
score: 0

http://stackoverflow.com/a/43193892
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29635162
score: 1
upvote count: 1
has body: Instead of manually dealing with React.render you can use a library called react-helper (https://github.com/tswayne/react-helper). It sets up a div for you, binds your react components to the div, allows you to pass properties to your components server side, and can even handle server-side rendering if you have webpack configured for your node app or are willing to use babel-register (not recommended for prod).

http://stackoverflow.com/a/29575098
accepted answer of: http://stackoverflow.com/q/29575052
answers question: http://stackoverflow.com/q/29575052
score: 3
has comment: http://stackoverflow.com/comment/47298925
downvote count: 0
has body: $(document).ready(function(){ $(document).on("click", ".pool", function() { var count=0; $(".option").each(function(){ count = count+($.trim($(this).val())=="" ? 1 : 0); }); alert(count); }); }); Fiddle
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47298978
upvote count: 3
has comment: http://stackoverflow.com/comment/47298866
type: Answer

http://stackoverflow.com/comment/47462071
has text: False was returned at el.nodeName === "A" because el was the string "Wizards" so el.nodeName returns "undefined" undefined === "A" = false
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29659714

http://stackoverflow.com/comment/47506604
score: 0
type: AnswerComment
type: Comment
has text: @user1336321, I actually posted that and Grant added the details. Sorry about that, it didn't really answer your question. You were basically looking to understand the logic behind deciding what a successful response is versus a "failure". Interesting topic and Michael did a nice job explaining it a little further above.
comment on: http://stackoverflow.com/a/29682140

http://stackoverflow.com/comment/47338421
comment on: http://stackoverflow.com/q/29595693
type: QuestionComment
score: 1
has text: `undefined` is just a data type/value in JS, similar to `null`. There can certainly be confusion between saying "the variable is undefined" and " the variable has the value undefined".
type: Comment

http://stackoverflow.com/q/29543116
tagged with: gruntjs
score: 0
answer count: 1
linked to: http://stackoverflow.com/q/221539
has body: I am trying to pull the latest revision number using a regular expression that is not working. Could someone helped a novice regexer with this: revision: 2020 stdout.match(/^r(\d+)/m)[1]) Thank you for any help you can give EDIT I should have put my whole task here so all would know what I am trying to do. grunt.registerTask('version', 'Updating to latest revision', function () { var done = this.async(); grunt.util.spawn({ cmd: 'svn info', args: ['-r HEAD'] }, function (err, result, code) { var output = result.stdout; if (output) { var revision = result.stdout.match(/\d+/)[0]; grunt.file.write('web/version2.js', 'var UIVERSION = ' + revision); } done(); }); } );
tagged with: node.js
type: AnsweredQuestion
has title: Grunt match regular expression
type: Question
has answer: http://stackoverflow.com/a/29543314
accepted answer: http://stackoverflow.com/a/29543314
tagged with: javascript

http://stackoverflow.com/comment/47345147
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29597781
type: AnswerComment
has text: What I ended up with is very close to your example :) I'll have to remember that the sort method (function?) uses ascending lexicographic order by default to save some typing next time. Thanks again!!

http://stackoverflow.com/comment/47472944
score: 0
has text: Sounds like another syntax error. Are you absolutely sure there are none? Common things like trailing commas (`[1,2,3,]`) will break IE8.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29666682

http://stackoverflow.com/q/29568316
has body: AngularJS expression not updating variable value on view, simply it print as source. Here is my controller code, controller('loginCtrl', ['$scope', '$state', '$rootScope', function ($scope, $state, $rootScope) { $scope.testMessage = "Test Msg from scope"; $rootScope.testMessageRoot = "Test Msg from root scope"; }]); When I render variables testMessage and testMessageRoot on view using expression it simply print the source code as it is. Account Access {{testMessage}} {{ 5 + 5 }} {{$root.testMessageRoot}} Same controller works well with ng-bind, Account Access AngularJS v1.3.10 used in my application, I couldn't understand what went wrong, your help appreciated.
has answer: http://stackoverflow.com/a/29569137
has title: Angular JS expression {{ }} not working
has comment: http://stackoverflow.com/comment/47296278
has comment: http://stackoverflow.com/comment/47296249
has answer: http://stackoverflow.com/a/43498285
score: 2
has comment: http://stackoverflow.com/comment/79222866
upvote count: 2
type: Question
tagged with: javascript
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47286108
has comment: http://stackoverflow.com/comment/47286156
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/comment/136909950
type: AnswerComment
has text: This answer is not clear to me.
type: Comment
comment on: http://stackoverflow.com/a/64497934
score: 0

http://stackoverflow.com/q/29640675
score: 4
has answer: http://stackoverflow.com/a/29641751
answer count: 3
has body: I've got a site with an HTML5 audio player and embedded YouTube music videos. I'd like to make it so that when the user clicks on a YouTube video to play it the music will stop. Wrapping the iframe in YT stuff works for the sliver of pixels outside of the iframe, but not when you click on the actual video. Anyone have any ideas?
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has answer: http://stackoverflow.com/a/77044120
tagged with: iframe
upvote count: 4
tagged with: youtube
has title: Possible to add an onclick event to a YouTube iframe?
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/69800252
type: Question
accepted answer: http://stackoverflow.com/a/29641751
possible better answer: http://stackoverflow.com/a/69800252
tagged with: javascript

http://stackoverflow.com/comment/47363069
comment on: http://stackoverflow.com/a/29608744
type: Comment
score: 0
type: AnswerComment
has text: @Maneesh M S: Can you provide HTML too as it may is likely just a styling issue? perhaps a JSFiddle?

http://stackoverflow.com/q/29654485
type: AnsweredQuestion
has title: 2011-01-22T03:41:02+0000 - What is time zone?
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29654570
has comment: http://stackoverflow.com/comment/47448857
type: Question
linked to: http://stackoverflow.com/q/1091372
upvote count: 0
answer count: 1
has body: 2011-01-22T03:41:02+0000 - What time zone is for that string? And how can I get the current time in this time zone in javascript?
favorite count: 0
has comment: http://stackoverflow.com/comment/47448819
tagged with: datetime
score: -2
has comment: http://stackoverflow.com/comment/47448967
has answer: http://stackoverflow.com/a/29654570
downvote count: 2

http://stackoverflow.com/a/29558656
has comment: http://stackoverflow.com/comment/47270269
has comment: http://stackoverflow.com/comment/47270940
score: 0
has comment: http://stackoverflow.com/comment/47268962
answers question: http://stackoverflow.com/q/29558173
type: Answer
has comment: http://stackoverflow.com/comment/47269307
has body: from what i can see you still have call to insertRow function inside loop body, which mean that it will add as many rows as there is already in table if they don't match. What i would do is add some kind of variable which would be changed if comparing the rows will return true. var temp = 0; if(all_rows=true){temp++;} and after the loop i would add: if(temp &gt; 0) {insertRow();} So it would be something like this: function compareRows(){ var table=document.getElementById("Gebruikers"); var rowCount=table.rows.length; var temp = 0; //check first cell of the row. when it is the same as firstName check surName for(var i=0;i&lt;rowCount;i++) { var row=table.rows[i]; var vCheck=row.cells[0]; if(vCheck===firstName) { //check second cell of the row. when it is the same as surName check email for(var i=0;i&lt;rowCount;i++) { var row=table.rows[i]; var vCheck=row.cells[1]; if (aCheck===surName) { //check third cell of the row. when it is the same as email show prompt that use allready exists. //if email doesnt exist check next row for(var i=0;i&lt;rowCount;i++) { var row=table.rows[i]; var eCheck=row.cells[2]; if (eCheck===email) { prompt ("Deze gebruiker bestaat al!") temp++; }; }; }; }; //when all rows have been checked for input execute insertRow function } else { }; } if(temp &gt; 0) { insertRow(firstName, surName, email); } };

http://stackoverflow.com/q/29571580
accepted answer: http://stackoverflow.com/a/29571690
possible better answer: http://stackoverflow.com/a/29571693
tagged with: replace
has body: Given a string "translateX(-50%) scale(1.2)" with N transform functions 1) How can I match the names ["translateX", "scale"]? 2) How can I match the values ["-50%", "1.2"]?
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/47292604
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/29571690
favorite count: 0
tagged with: regex
tagged with: css
has answer: http://stackoverflow.com/a/29571693
score: 1
has comment: http://stackoverflow.com/comment/64245461
has title: Regular Expression (Regex) on CSS3 Transform String
downvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47293608
tagged with: webkit-transform
linked to: http://stackoverflow.com/q/3432446

http://stackoverflow.com/q/29556212
favorite count: 0
type: UnansweredQuestion
tagged with: performance
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/29556387
tagged with: dom
tagged with: event-propagation
type: Question
answer count: 2
has body: I have a huge document and I need to listen on all mousemoves on this document. My first obvious idea was addEventListener() on body, but it might introduce some performance issues (you know, bubbling stuff). There is a mythical parameter in addEventListener() - useCapture. I don't quite get the inner workings of event propagation in DOM, but it looks promising. Will it be better to use capture phase, or it is not worth it?
tagged with: javascript
has answer: http://stackoverflow.com/a/29556608
has title: addEventListener('mousemove',...) on body - how bad is it?
tagged with: mousemove
upvote count: 1
has comment: http://stackoverflow.com/comment/47262985

http://stackoverflow.com/comment/48320424
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29626783
type: QuestionComment
has text: Okay, i will ad jsfiddle within couple of hours

http://stackoverflow.com/comment/47338283
type: QuestionComment
comment on: http://stackoverflow.com/q/29595597
has text: It is not clear to me how you're proceeding. In your code you are using "image" as an ID, then you read an "id" from an "ALT" attribute. I'm pretty sure this is indeed *not* the way to do it. To know "what image you're looking at", you need to ask yourself - what must one do to *look at an image*? If he e.g. **clicks** on it, you just add a click handler and set an attribute there: $(this).attr("clicked") (*and clear any leftover attribute from other images*). Without actually seeing the gallery code, one can't be much more specific than this.
score: 0
type: Comment

http://stackoverflow.com/comment/47463597
score: 0
has text: @DavidThomas I did edit for correct formatting but looks like you and Thomas have gone over that edit. Good job too because i didn't see the escaped quotes in the script tags. I did see it in the javascript but not in the tags.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29661904

http://stackoverflow.com/comment/47245284
comment on: http://stackoverflow.com/q/29546745
type: Comment
score: 1
has text: You might have opened a form tag somewhere before and forgot to close it.
type: QuestionComment

http://stackoverflow.com/q/29564526
upvote count: 1
downvote count: 1
has body: I'm writing a Markdown parser with ES6: Input: # Title * * * Paragraph Another paragraph Sample code: // create a find/replace based on a regex and replacement // to later be used with the conversion functions function massReplace(text, replacements) { let result = text for (let [regex, replacement] of replacements) { result = result.replace(regex, replacement) } return result } // match text with # and replace them for html headings function convertHeadings(text, orig) { if (orig.match(/^#{1,6}\s/)) { return massReplace(text, [/^### (.*)/gm, ' $1 '], [/^## (.*)/gm, ' $1 '], [/^# (.*)/gm, ' $1 '] ] ) } } // match text without # and surround them with p tags function convertParagraphs(text, orig) { if (!orig.match(/^#{1,6} (.*)/)) { return ` ${text} ` } } // take the source, split on new lines, make a copy (to // have a "clean" version to be used in the if statements), // and finally apply the conversion functions to them with // the help of a loop and excluding those that output undefined function convertToHTML(markdownSource) { let data = markdownSource.split('\n\n') , orig = data.slice() , conversions = [ convertHeadings, convertParagraphs] for (let i = 0, l = orig.length; i < l; ++i) { for (let conversion of conversions) { let result = conversion(data[i], orig[i]) if (result !== undefined) { data[i] = result } } } return data.join('\n\n') } What I want now is to wrap p tags with the class no-indent around text that has * * * preceding it (Paragraph in the example above). The problem is, I don't know how to get a text based on its preceding one (* * * in this case). To give an idea this is the desired output: Title * * * Paragraph Another paragraph
type: Question
has comment: http://stackoverflow.com/comment/47292354
has title: How can I get the preceding text in the following ES6 loop?
tagged with: javascript
has comment: http://stackoverflow.com/comment/47279571
tagged with: ecmascript-6
score: 0
tagged with: for-loop
has comment: http://stackoverflow.com/comment/47278995
answer count: 1
has answer: http://stackoverflow.com/a/29574774
favorite count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/1979884
has comment: http://stackoverflow.com/comment/47279884
has comment: http://stackoverflow.com/comment/47279414

http://stackoverflow.com/q/29533171
answer count: 0
type: UnansweredQuestion
tagged with: meteor-autoform
score: 1
type: Question
tagged with: javascript
upvote count: 1
has title: cfs:autoform package not recognizing chosen file in meteor (1.1.2)
downvote count: 0
tagged with: meteor
favorite count: 0
has body: After I upgraded meteor from (1.0.5 to 1.1.2) When I tried to upload files using cfs:autoform it refused to hold files. Like I would chose a file and click submit, but it would throw an error and tell me the file does not exist (The field was required). Is this a none bug or am I doing something wrong? I have put my code below: School Create {{#autoForm collection="Schools" id="school_create" type="insert"}} Add a School {{> afQuickField name='name'}} {{> afQuickField name='sub_domain'}} {{> afQuickField name='image' type="cfs-file" collection="images"}} {{> afQuickField name="primary_color"}} Add a School {{/autoForm}} schools collection js Schools = new Mongo.Collection("Schools"); //Defining the schema Schools.attachSchema(new SimpleSchema({ name: { type:String, label: "Name", max:200 } user_id:{ type: String, autoform: { type: "hidden", label: false }, autoValue: function(){ if (this.isInsert) { return Meteor.userId(); } else if (this.isUpsert) { return {$setOnInsert: Meteor.userId()}; } else { this.unset(); } }, denyUpdate:true }, image: { type: String, label: "Logo", autoform: { afFieldInput: { type: "cfs-file", collection: "images" } } }, ... common.js FS.debug = true; // enable CFS debug logging // Image collection methods Images = new FS.Collection("images", { stores: [new FS.Store.FileSystem("images")] }); Images.allow({ download: function () { return true; }, fetch: null });

http://stackoverflow.com/a/29619064
has body: You can repeatedly find the array.indexOf(6,lastmatch) var array= [1, 2, 4, 6, 1, 2, 6, 6, 2, 4]; var resultArray= [], i, incr= 0; while((i= array.indexOf(6, incr))!= -1){ i+= 1; resultArray.push(i-incr); incr= i; } resultArray returned value: (Array) [4,3,1]
score: 0
answers question: http://stackoverflow.com/q/29617435
type: Answer

http://stackoverflow.com/comment/47289539
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29569739
has text: @charlietfl Can you give me an example of code adapted to my system for me to understand better?
score: 0

http://stackoverflow.com/q/29544102
has comment: http://stackoverflow.com/comment/47262852
tagged with: javascript
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47241970
has body: I'm working on my first angular application and am trying to make it as modular as possible. My application clicks through 'screens' each screen has its own controller based on its type. The content for the screen comes from an api - text, image and audio. I need to be able to determine how items are loaded on the page. I have a sequence in my API. var sequence = [ [ { "item": 't1', "type": 'fadeUp' } ], [ { "item": 't2', "type": 'fadeUp' }, { "item": 'a1' } ], [ { "item": 't3', "type": 'fadeUp' }, { "item": 'i1', "type": 'fadeUp' }, { "item": 'a2' } ], [ { "item": 't4', "type": 'fadeUp' } ] ]; There are 4 steps in this sequence and I don't want it to move onto the next one until all the sub-items are completed. eg/ dont move onto the next step until the audio has finished playing - How can I do this? At the moment I'm using $emit which the relevant controllers pick up and display the content but it all happens at once because I'm looping through the second level of the array without any delay. I assume I need to use $q.all? but i'm not sure what this would look like? an example of my code: I couldn't get an example working :( Factory: (function () { "use strict"; var sequenceFactory = function (clinicalCasesSettings, $rootScope, $timeout, utils, $q) { var factory = {}; factory.startSequence = function (sequence, screen) { _.each(screen.sequence, function (sequencePos, i) { console.info('SEQUENCE ' + i); _.each(sequencePos, function (action) { var actionType = _determineActionType(action.item); $rootScope.$emit('start' + utils.ucFirst(actionType), i); }); }); } // helper methods for the factory function _determineActionType(item) { var actionType; actionType = item.replace(/[^a-zA-Z]+/g, ""); return clinicalCasesSettings.actionTypes[actionType]; } return factory; }; sequenceFactory.$inject = ['clinicalCasesSettings', '$rootScope', '$timeout', 'utils', '$q']; angular.module('clinicalCases').factory('sequenceFactory', sequenceFactory); }()); One of the Controllers lis…
has comment: http://stackoverflow.com/comment/47262825
has comment: http://stackoverflow.com/comment/47241957
answer count: 0
type: UnansweredQuestion
score: 0
has comment: http://stackoverflow.com/comment/47240216
has title: Can I use $emit/$broadcast and callbacks together?
type: Question

http://stackoverflow.com/comment/47246445
type: AnswerComment
comment on: http://stackoverflow.com/a/29546999
type: Comment
has text: Now that I've read your update indicating you simply want to copy the options from one select to another, you'll want to use the html() option. You are simply copying a string; no need to bring clone() into this.
score: 0

http://stackoverflow.com/comment/47286911
comment on: http://stackoverflow.com/q/29556938
score: 0
has text: Also... I'd take a look at using passport.js or similar - simplifies a lot of the authentication!
type: Comment
type: QuestionComment

ruby-on-rails-4
type: Tag
tags question: http://stackoverflow.com/q/29577610
tags question: http://stackoverflow.com/q/29655418
tags question: http://stackoverflow.com/q/29621725
tags question: http://stackoverflow.com/q/29580619
tags question: http://stackoverflow.com/q/29647794
tags question: http://stackoverflow.com/q/29624563
tags question: http://stackoverflow.com/q/29686170
tags question: http://stackoverflow.com/q/29603859
tags question: http://stackoverflow.com/q/29566376
tags question: http://stackoverflow.com/q/29620416
tags question: http://stackoverflow.com/q/29676578
tags question: http://stackoverflow.com/q/29617268
tag name: ruby-on-rails-4
tags question: http://stackoverflow.com/q/29541596
tags question: http://stackoverflow.com/q/29593610
tags question: http://stackoverflow.com/q/29596972

http://stackoverflow.com/a/29593408
has body: The one works well: var UTCTime= (new Date()).toUTCString();
answers question: http://stackoverflow.com/q/29593265
score: 0
type: Answer

http://stackoverflow.com/a/30365411
downvote count: 0
answers question: http://stackoverflow.com/q/29563833
score: 1
has body: I didn't find any JS library which could use apache velocity templates to produce HTML. However, we did find a NPM which could be used to generate HTML page using apache velocity template. Here is URL => Velocity NPM
upvote count: 1
type: Answer

http://stackoverflow.com/comment/47341014
has text: Ok, I can at least avoid freezing phantomjs by doing this: `var foo = page.evaluate(function() {var test = "test"; return test; }); console.log(foo);`. Could it be that console.log (being a function) is not allowed inside page.evaluate? And, if so, could it be that ajax requests are also not allowed there?
comment on: http://stackoverflow.com/a/29596628
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47345924
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29598089
has text: the condition is staff cannot book the subject not more than 2 times in a day and per week he can take 12 subject.
score: 0

http://stackoverflow.com/q/29568621
tagged with: http://stackoverflow.com/tag/html
has title: Centre two divs, one with a logo and one with text, side by side on top of a html5 video and still be responsive?
tagged with: css
tagged with: video
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29568786
has body: I am currently trying to build a website for my university project to promote my gaming YouTube channel. On the main page i have set up a short, looping html5 video to have as a background. Then I wish to put a logo and a heading and some text on top of it. I also then have splitter images to separate the sections of the page. I have got the layering right for the z-index and I have got a piece of jQuery code which resizes the video working fine. My problem is that I just cant for the life of me work out how to centre the image and text on the screen in the middle of the video and have it stay like that and resize with the window size. I would like this website to work on mobile as well hence the responsive stuff. I also want to have the splitter image at the bottom of the video at all times. I think I am mostly there with what I'm trying to accomplish but I just cant get it quite right. Here is the link to the website: http://www.willcaddy.com/ Here is a link to the pastebin code if that's easier: http://pastebin.com/vnH7LRNm If anyone can help me out I would appreciate it a lot!
tagged with: javascript
type: Question
score: 0
answer count: 2
tagged with: jquery
has answer: http://stackoverflow.com/a/29568862

http://stackoverflow.com/comment/47340025
type: QuestionComment
has text: @Qantas94Heavy No, that's *barely tangentially related*.
comment on: http://stackoverflow.com/q/29596357
score: 4
type: Comment

http://stackoverflow.com/a/29670589
type: Answer
has body: EDIT - new answer OK mate. If you has this html and you can't change that try to .stop(true) the fadeOut animation every time you trigger mouseenter or over to prevent the fadeOut. I don't know if this is possibile with hoverIntent plugin, but you can use this code instead: $(".hover").on({ "mouseenter" : function(e){ $(".sub").stop(true); $(".sub").fadeIn(); }, "mouseleave" : function(e){ $(".sub").delay(50).fadeOut(); }, }) EDIT #2 - PREVENT ACCIDENTALLY OVER To prevent accidentally over simple add a delay to the fadeIn effect if user is "over" the .hover button (but not when is over .sub). And also in mouseleave add .stop(true) to prevent the fadeIn on "fast moving": $(".hover,.sub").on({ "mouseenter" : function(e){ _delay = ($(this).hasClass("hover")) ? 200 : 0 ; $(".sub").stop(true); $(".sub").delay(_delay).fadeIn(); }, "mouseleave" : function(e){ $(".sub").stop(true); $(".sub").delay(50).fadeOut(); }, }) Work with delay and fadeIn time to create the best performance. EXAMPLE: http://jsfiddle.net/hfx7ucnw/8/ OLD answer It's a problem that I know. From my experience I can tell you that the only way to create a "dropdown" or a "submenu" that show on mouseover and hide on mouseleave is to indent the child element to parent I edit Your fiddle to show you my way. with some simple change on CSS and HTML http://jsfiddle.net/hfx7ucnw/5/ Tell me if this way is your.
has comment: http://stackoverflow.com/comment/47479222
score: 3
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29669896
answers question: http://stackoverflow.com/q/29669896
has comment: http://stackoverflow.com/comment/47479685
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47480996
has comment: http://stackoverflow.com/comment/47480322
upvote count: 3

http://stackoverflow.com/q/29631453
has comment: http://stackoverflow.com/comment/47405731
has comment: http://stackoverflow.com/comment/47407816
type: UnansweredQuestion
has title: Call Controller ActionResult to modify ViewBag variable and reload View?
has comment: http://stackoverflow.com/comment/47639197
has comment: http://stackoverflow.com/comment/47405961
tagged with: viewbag
has comment: http://stackoverflow.com/comment/47726694
has comment: http://stackoverflow.com/comment/47408115
has comment: http://stackoverflow.com/comment/47407124
has comment: http://stackoverflow.com/comment/47408270
has comment: http://stackoverflow.com/comment/47416015
has body: I have an MVC5 application. My HomeController on application load fills a simple list that gets passed to the Index View via the ViewBag and passes my Model to the View. On the View I also have a grid component with the paging size set by the ViewBag variable (on load, the default is 10 records): public ActionResult Index() { List<SelectListItem> pagingIntervalList = new List<SelectListItem>(); pagingIntervalList.Add(new SelectListItem { Text = "5", Value = "5" }); pagingIntervalList.Add(new SelectListItem { Text = "10", Value = "10" }); pagingIntervalList.Add(new SelectListItem { Text = "25", Value = "25" }); pagingIntervalList.Add(new SelectListItem { Text = "50", Value = "50" }); pagingIntervalList.Add(new SelectListItem { Text = "100", Value = "100" }); pagingIntervalList.Add(new SelectListItem { Text = "250", Value = "250" }); pagingIntervalList.Add(new SelectListItem { Text = "500", Value = "500" }); ViewBag.pagingIntervalList = pagingIntervalList; // Set default paging to 10 records on Load. ViewBag.PageSize = 10; var assetList = db.INV_ASSETS.ToList(); return View(assetList); } On this View, I'm attempting to use the @Html.DropDownList() that I fill using the SelectList from the Controller and allow users to specify the interval they wish paging to occur at (5, 10, 25, 50, 100, 250, 500, etc.): Page every @Html.DropDownList("pagingIntervalList") Records. What I cannot figure out is how to reload the View with the newly selected paging interval. In my attempts I have created copy of my Index() controller action that expects a parameter value which should be used in the ViewBag and passed to the View to set the new selection for paging records: public ActionResult NewPagingInterval(string selection) { List<SelectListItem> pagingIntervalList = new List<SelectListItem>(); pagingIntervalList.Add(new SelectListItem { Text = "5", Value = "5" }); pagingIntervalList.Add(new SelectListItem { Text = "10", Value = "10" }); pagingIntervalList.Add(new SelectListItem { Tex…
type: Question
has comment: http://stackoverflow.com/comment/47406662
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/47416594
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has comment: http://stackoverflow.com/comment/47406873
has comment: http://stackoverflow.com/comment/47407675
score: 0
has comment: http://stackoverflow.com/comment/47638830
has comment: http://stackoverflow.com/comment/47407940
has comment: http://stackoverflow.com/comment/47417274
has comment: http://stackoverflow.com/comment/47408165
has answer: http://stackoverflow.com/a/29632357
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/47406395

http://stackoverflow.com/comment/47464077
has text: All clear paul. Just one more thing... IIFE? Cheers!
type: Comment
comment on: http://stackoverflow.com/a/29662138
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47220251
type: QuestionComment
has text: I agree on AngularJS, beautiful framework for 2 way data binding. Definitely worth the look! https://angularjs.org/
comment on: http://stackoverflow.com/q/29533288
score: 0
type: Comment

http://stackoverflow.com/comment/47382048
score: 0
type: AnswerComment
type: Comment
has text: Thank you! But it still doesn't populate the textbox. Is that because it isn't connected to the journal name? I updated my code in the original question to what I have now - what am I missing that won't make it work?
comment on: http://stackoverflow.com/a/29618394

http://stackoverflow.com/a/29623625
answers question: http://stackoverflow.com/q/29623225
type: Answer
has comment: http://stackoverflow.com/comment/47391730
has comment: http://stackoverflow.com/comment/47391972
has body: Basic example (just javascript, no jQuery): 1 2 FIRST FIRST
score: 0

http://stackoverflow.com/q/29620661
tagged with: javascript
has comment: http://stackoverflow.com/comment/47385638
score: 0
answer count: 1
has title: google map load issue in wordpress custom javascript code
tagged with: css
type: AnsweredQuestion
has body: I have a JavaScript code which loads Google map. But it is not loading map properly. Check this screenshot for issue. Map should fit in whole window. But it load only in left corner.
has answer: http://stackoverflow.com/a/29622106
accepted answer: http://stackoverflow.com/a/29622106
tagged with: wordpress
type: Question
tagged with: google-maps

http://stackoverflow.com/comment/47448471
comment on: http://stackoverflow.com/q/29654189
has text: var myData = []; rows.each(function (index) { var obj = { id: $this.find('.elementOne').val(), name: $this.find('.elementTwo').text() }; myData.push(obj); }); I had this as an example and pushed the values to the json array and retrun but I get only the first value of the loop
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/42741234
has comment: http://stackoverflow.com/comment/72645665
score: -2
has body: You could possibly use a work around, design a program/script/server(I would use PHP, being a html client) to get the UDP gram from the server, if you would like I could help, I have worked on something similar.
upvote count: 2
downvote count: 4
type: Answer
answers question: http://stackoverflow.com/q/29532157

http://stackoverflow.com/q/29565016
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/47279786
tagged with: php
has body: I have code that draws a plot using flot library. The data for plot is in my local database. In one file there are php, javascript and html code. How can I seperate the php code to different file, that there would be left just html and javascript. The code looks like this: <?php $server = "localhost"; $user="root"; $password=""; $database = "testing"; $connection = mysqli_connect($server,$user,$password,$database); $query = "SELECT longLocation, latLocation FROM coords"; $result = $connection->query($query); while($row = mysqli_fetch_assoc($result)) { $dataset1[] = array($row['longLocation'],$row['latLocation']); } ?>
score: -1
tagged with: http://stackoverflow.com/tag/json
downvote count: 2
accepted answer: http://stackoverflow.com/a/29568754
upvote count: 1
answer count: 1
tagged with: javascript
has title: How to seperate my code to different php file?
type: AnsweredQuestion
tagged with: flot
has answer: http://stackoverflow.com/a/29568754

http://stackoverflow.com/q/29609021
has body: I am pretty new to angularjs and flot bar chart I am trying to display filtered data in a list on click based on filters. I have created a custom directive to plot the chart and a custom filter which I use with data gotten on the click method but the list is not displayed. Please help take a look http://jsfiddle.net/6h1gL2sh/22/ App.directive('chart', function () { return { restrict: 'EA', link: function (scope, elem, attrs) { var chart = null, options = { series: { stack: true, bars: { show: true, clickable: true, barWidth: 0.1, align: "center" } }, axisLabels: { show: true }, xaxis: { axisLabel: 'Test Dates', axisLabelUseCanvas: true, axisLabelFontSizePixels: 12, axisLabelPadding: 5, mode: "categories", tickLength: 0 }, yaxis: { axisLabel: 'Pass/Fail Count', axisLabelUseCanvas: true, axisLabelFontSizePixels: 12, axisLabelPadding: 5 }, grid: { hoverable: true, clickable: true } } var data = scope[attrs.ngModel]; var getKeyByValue = function (obj, value) { for (var prop in obj) { if (obj.hasOwnProperty(prop)) { if (obj[prop] === value) return prop; } } } scope.$watch(attrs.ngModel, function (v) { if (!chart) { chart = $.plot(elem, v, options); elem.show(); } else { chart.setData(v); chart.setupGrid(); chart.draw(); } }); elem.bind("plotclick", function (event, pos, item) { if (item) { scope.show = false scope.plotdate = getKeyByValue(item.series.xaxis.categories, item.dataIndex); switch (item.series.label) { case 'Passed': scope.details = scope.arr.passdetails; break; case 'Failed': scope.details = scope.arr.faildetails; break; scope.$apply(); } } console.log('details= ', scope.details) console.log('Plotdate= ', scope.plotdate) console.log('Show= ', scope.show) }); } } }); App.filter('getdata', function () { return function (items, date) { var arrayToReturn = []; for (var i in items) { if (items[i].start_date == date) { arrayToReturn.push(items[i]); } } return arrayToReturn; }; });
score: 2
has title: How to show list of data on flot bar chart click event with angularjs
tagged with: angularjs
upvote count: 2
has answer: http://stackoverflow.com/a/29623102
has comment: http://stackoverflow.com/comment/47372624
has comment: http://stackoverflow.com/comment/47386710
type: AnsweredQuestion
tagged with: angularjs-ng-show
has comment: http://stackoverflow.com/comment/47368603
has comment: http://stackoverflow.com/comment/47373190
type: Question
accepted answer: http://stackoverflow.com/a/29623102
has comment: http://stackoverflow.com/comment/47373688
tagged with: flot
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47389351
favorite count: 0

http://stackoverflow.com/a/29564647
score: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29564577
answers question: http://stackoverflow.com/q/29564577
has body: You cant have functions in JSON, it is a data only format. You could use pass code back in your JSON and then use eval() but that is a terrible idea for many reasons. Another option is to provide them with an JS API client you have written that has all the functionality you need.
type: Answer
upvote count: 1

http://stackoverflow.com/q/29636829
has title: Javascript external function with event handler to generate DOM elements is not outputting html
has answer: http://stackoverflow.com/a/29637354
tagged with: dynamic
has comment: http://stackoverflow.com/comment/47415898
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29637354
type: Question
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/29636902
tagged with: javascript
has body: I am trying to dynamically generate and remove input boxes based on selection. However, I have been tweaking this code for hours but can't figure out why it's not generating the html elements. Calculator <link rel="stylesheet" href="css/main.css." type="text/css" // HTML Code No. of Ports // External Javascript File function addInputs(num_of_inputs, div_id) { "use strict"; var main_container, div, fieldLabel, input, count, label_array; // Labels for input fields label_array = ["Name", "Height", "Width", "Depth", "Position x", "Position Y"]; // main container id main_container.document.getElementById('container'); // this div is to hold the input fields div.document.createElement('div'); div.id = div_id; // create labels and inputs while (count < num_of_inputs) { fieldLabel.createElement('input'); fieldLabel.type = "text"; fieldLabel.value = label_array[count]; fieldLabel.id = "r-port_label" + count; input.document.createElement('input'); input.type = "number"; input.value = "0"; input.id = "r_port_input" + count; // attach inputs and labels to parent div div.appendChild(fieldLabel); div.appendChild(input); //increment input fields & labels count += 1; } // attach parent div to page container main_container.appendChild(div); } //CSS Code #container{ width: 400px; min-height: 400px; background: #eeeeee; }
tagged with: dom-events
has answer: http://stackoverflow.com/a/29636902
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/29535387
tagged with: javascript
tagged with: extjs
tagged with: extjs4
has answer: http://stackoverflow.com/a/30255547
downvote count: 0
answer count: 1
favorite count: 0
tagged with: model
has title: Ext.js problems building model relations from json
type: AnsweredQuestion
score: 3
accepted answer: http://stackoverflow.com/a/30255547
upvote count: 3
tagged with: http://stackoverflow.com/tag/json
type: Question
has body: In my project, I need to create a questionnaire (a form). The questions are generated dynamically depending on a category, and are on a server, in a database. To get the questions a REST API is used, so sending a request to /getquestions/1 returns a JSON having all the data needed for form generation. The JSON looks like this: { "questions":[ { "id":4, "text":"Question1", "type":"NUMBER", "mandatory":true, "visible":true }, { "id":5, "text":"Dropdown type question", "type":"DROPDOWN", "mandatory":true, "visible":true, "values":[ { "id":1, "text":"Answer1", "selected":false }, { "id":2, "text":"Answer2", "selected":false } ] }, { "id":7, "text":"Question 3 as Radio", "type":"RADIO", "mandatory":false, "visible":false, "values":[ { "id":1, "text":"Yes", "selected":false }, { "id":2, "text":"No", "selected":false } ], "dependencies":{ "mark_visible":[ { "question_id":5, "operation":"=", "value":2 } ], "mark_mandatory":[ { "question_id":5, "operation":"=", "value":2 }, { "question_id":4, "operation":"&lt;=", "value":5000 } ] } } ] } ] } I have store and model for questions. I think I need a store for values as well, to make it visible in a dropdown list, and another one for the dependencies too. I just wondering, whether is it possible to fill all stores somehow without any explicite coding, using ext and model relations like hasMany and so. I am basically looking for the best practice and fastest solution in Ext.js to create models and relations out of this JSON any idea woud be really helpful.

http://stackoverflow.com/a/29593270
accepted answer of: http://stackoverflow.com/q/29593118
has comment: http://stackoverflow.com/comment/47333442
type: Answer
answers question: http://stackoverflow.com/q/29593118
has comment: http://stackoverflow.com/comment/47334392
score: 0
has comment: http://stackoverflow.com/comment/47333370
has comment: http://stackoverflow.com/comment/47333754
has body: You have a typo in secondController definition. You have there app.controler, which obviously does not make a controller out of the secondController but sth else.
type: AcceptedAnswer

http://stackoverflow.com/a/29637528
has comment: http://stackoverflow.com/comment/47417556
has comment: http://stackoverflow.com/comment/47498742
downvote count: 0
answers question: http://stackoverflow.com/q/29637468
has comment: http://stackoverflow.com/comment/47417514
has comment: http://stackoverflow.com/comment/47549286
has comment: http://stackoverflow.com/comment/47417607
has comment: http://stackoverflow.com/comment/47417642
has comment: http://stackoverflow.com/comment/47494593
type: Answer
has body: Cache the selection, slice away the first 3 and then index the collection directly. To log the ID, just use the .id property of the DOM element. var cls = $('.class'); cls.slice(3).each(function(i, el){ console.log(cls[i].id, el.id); }); var pre = $("pre")[0]; var cls = $('.class'); cls.slice(3).each(function(i, el) { pre.textContent += cls[i].id + ", " + el.id + "\n"; }); Item 1 Item 2 Item 3 Item 4 Item 5 Item 6 Item 7 Item 8 Item 9 Item 10 Or without jQuery: var cls = document.querySelectorAll('.class'); [].slice.call(cls, 3).forEach(function(el, i){ console.log(cls[i].id, el.id); }); var pre = document.querySelector("pre"); var cls = document.querySelectorAll('.class'); [].slice.call(cls, 3).forEach(function(el, i){ pre.textContent += cls[i].id + ", " + el.id + "\n"; }); Item 1 Item 2 Item 3 Item 4 Item 5 Item 6 Item 7 Item 8 Item 9 Item 10
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/47498666
has comment: http://stackoverflow.com/comment/47417268

http://stackoverflow.com/comment/47434883
has text: what datetimepicker are you using?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29643488

http://stackoverflow.com/comment/47513821
score: 0
type: Comment
type: QuestionComment
has text: @ChristianHain Sorry about the confusion, I've edited the current date into the question to make it clearer for anyone else reading it. With the dates I provided in my code, I wanted the results -1,0,1,2
comment on: http://stackoverflow.com/q/29688098

http://stackoverflow.com/q/29571589
tagged with: http://stackoverflow.com/tag/html
answer count: 1
score: 0
has answer: http://stackoverflow.com/a/29571662
has body: I write a demo on JSFIDDLE, please see demo. HTML: firstname secondname lastname lorem ipsum css lorem ipsum css lorem ipsum css lorem ipsum css lorem ipsum css CSS: tr,td{border:1px solid black;} JS: $("tbody input").click(function(){ var closestTr = $(':checkbox:checked').closest('input').attr('id'); alert(closestTr);}); In demo I want to alert id number of each line when user clicks on checkbox. For example: when you click checkbox on line 2, browser alerts 2 and when you click checkbox on line 3, browser then alerts 3. But I didn't implement this in demo. Please give me some advice.
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29571662
has title: Get Checkbox's id number when it is clicked in grid with JQuery
type: Question
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/47504758
score: 2
type: QuestionComment
has text: What's the error message?
type: Comment
comment on: http://stackoverflow.com/q/29683951

http://stackoverflow.com/comment/47520570
comment on: http://stackoverflow.com/q/29661399
type: QuestionComment
type: Comment
has text: Good! Too bad that I can't mark your answer as solved. You get an upvote anyhow, so more seekers will be able to find the solution.
score: 0

http://stackoverflow.com/comment/47311720
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29580977
type: Comment
has text: @HUSTEN I've updated the example with a proper fiddle. Here's the link https://jsfiddle.net/crisbeto/f0buajyz/3/

http://stackoverflow.com/q/29629092
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29629682
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29629614
favorite count: 0
score: -1
type: Question
has title: jQuery - inArray with ID of elements - 'else' not working
has answer: http://stackoverflow.com/a/29629490
has answer: http://stackoverflow.com/a/29629485
has comment: http://stackoverflow.com/comment/47401907
downvote count: 1
possible better answer: http://stackoverflow.com/a/29629485
has body: I create a set of questions and answers. HTML: Theard + Question? + Answer... jQuery: $('.question').click(function() { ShowFAQ('#' + $(this).parent().attr("id")); } ); var faq_arr = []; function ShowFAQ(el) { if($.inArray(el, faq_arr) == -1) faq_arr[el] = 0; //if not exist = set default value. if(faq_arr[el] == 0) { $(el + ' .answer:first' ).slideDown(); faq_arr[el] = 1; $(el + ' .qshow:first').text('-'); } else { $(el + ' .answer:first').slideUp(); faq_arr[el] = 0; $(el + ' .qshow:first').text('+'); } } It's work great, but in the "ShowFAQ" does not execute the code in the 'else'. I know that this is a problem with the "$ .inArray". I do not want to manually print out ID elements. How do I fix this?
tagged with: slideup
accepted answer: http://stackoverflow.com/a/29629490
tagged with: if-statement
upvote count: 0

http://stackoverflow.com/a/29636902
upvote count: 1
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/29636829
score: 1
has body: I think you have a typo, should'nt this: main_container.document.getElementById('container'); div.document.createElement('div'); fieldLabel.createElement('input'); input.document.createElement('input'); be: main_container = document.getElementById('container'); div = document.createElement('div'); fieldLabel = document.createElement('input'); input = document.createElement('input');

http://stackoverflow.com/q/29648234
has answer: http://stackoverflow.com/a/29648479
tagged with: javascript
has answer: http://stackoverflow.com/a/29648565
has answer: http://stackoverflow.com/a/29648381
has comment: http://stackoverflow.com/comment/47436402
has comment: http://stackoverflow.com/comment/47436786
has comment: http://stackoverflow.com/comment/47436396
tagged with: arrays
downvote count: 0
answer count: 7
has comment: http://stackoverflow.com/comment/47436337
has title: Is there a way to check if two arrays have the same elements?
has comment: http://stackoverflow.com/comment/47436633
has body: Let say I have 2 arrays firstArray = [1, 2, 3, 4, 5]; secondArray = [5, 4, 3, 2, 1]; I want to know if they contain the same elements, while order is not important. I know I can write a function to sort them and then loop through them to check, but is there a pre-built function for this? (not only Vanilla JS, other javascript library is also okay)
favorite count: 0
linked to: http://stackoverflow.com/q/4025893
linked to: http://stackoverflow.com/q/1773069
accepted answer: http://stackoverflow.com/a/29648479
has comment: http://stackoverflow.com/comment/47436430
has comment: http://stackoverflow.com/comment/47436492
score: 11
has answer: http://stackoverflow.com/a/69613841
has answer: http://stackoverflow.com/a/67713235
linked to: http://stackoverflow.com/q/7837456
has comment: http://stackoverflow.com/comment/47436414
upvote count: 11
has comment: http://stackoverflow.com/comment/47590033
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47437332
has comment: http://stackoverflow.com/comment/47436498
has comment: http://stackoverflow.com/comment/47436609
has comment: http://stackoverflow.com/comment/47436742
has answer: http://stackoverflow.com/a/29648714
possible better answer: http://stackoverflow.com/a/69613841
has answer: http://stackoverflow.com/a/68998304
has comment: http://stackoverflow.com/comment/47436524
type: Question

http://stackoverflow.com/comment/47498347
comment on: http://stackoverflow.com/q/29680379
type: Comment
has text: I don't think you can get the `abid` with javascript in a website, if you are using PhoneGap or something like that you can search for a plugin.
type: QuestionComment
score: 0

http://stackoverflow.com/q/29596059
answer count: 1
has title: I want to flip or rotate this ribbon text to make it readable?
tagged with: dom-events
favorite count: 0
has body: I don't want to rotate box, I just want to rotate or flip text on ribbon box. If you rotate box directly it will disturb the string Animation. (function(){ var STATE_CLOSED = 0, STATE_DETACHED = 1, STATE_OPENED = 2, TAG_HEIGHT = 30, TAG_WIDTH = 200, MAX_STRAIN = 40, // Factor of page height that needs to be dragged for the // curtain to fall DRAG_THRESHOLD = 0.36; VENDORS = [ 'Webkit', 'Moz', 'O', 'ms' ]; var dom = { ribbon: null, ribbonString: null, ribbonTag: null, curtain: null, closeButton: null }, // The current state of the ribbon state = STATE_CLOSED, // Ribbon text, correlates to states closedText = '', detachedText = '', friction = 1.04; gravity = 1.5, // Resting position of the ribbon when curtain is closed closedX = TAG_WIDTH * 0.55, closedY = -TAG_HEIGHT * 0.1, // Resting position of the ribbon when curtain is opened openedX = TAG_WIDTH * 0.4, openedY = TAG_HEIGHT, velocity = 0, rotation = 45, curtainTargetY = 0, curtainCurrentY = 0, dragging = false, dragTime = 0, dragY = 0, anchorA = new Point( closedX, closedY ), anchorB = new Point( closedX, closedY ), mouse = new Point(); function initialize() { dom.ribbon = document.querySelector( '.forkit' ); dom.curtain = document.querySelector( '.forkit-curtain' ); dom.closeButton = document.querySelector( '.forkit-curtain .close-button' ); if( dom.ribbon ) { // Fetch label texts from DOM closedText = dom.ribbon.getAttribute( 'data-text' ) || ''; detachedText = dom.ribbon.getAttribute( 'data-text-detached' ) || closedText; // Construct the sub-elements required to represent the // tag and string that it hangs from dom.ribbon.innerHTML = '' + closedText + ''; dom.ribbonString = dom.ribbon.querySelector( '.string' ); dom.ribbonTag = dom.ribbon.querySelector( '.tag' ); // Bind events dom.ribbon.addEventListener( 'click', onRibbonClick, false ); document.addEventListener( 'mousemove', onMouseMove, false ); document.addEventListener( 'mousedown', onMouseDown, false ); document.addEventListener( 'mouseup', onMouseUp, …
tagged with: css
type: AnsweredQuestion
downvote count: 1
type: Question
tagged with: rotation
has answer: http://stackoverflow.com/a/29596427
tagged with: javascript
score: -1
accepted answer: http://stackoverflow.com/a/29596427
upvote count: 0

http://stackoverflow.com/a/29607956
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/47363558
upvote count: 2
has comment: http://stackoverflow.com/comment/47361604
answers question: http://stackoverflow.com/q/29607873
has body: You can't disable JavaScript with JavaScript. Simply put, you can't make sure your JS is the first to execute, nor can you reliably disable scripts all over the page. Imagine how that would mess with normal browsing... Some malicious site disables JS on your browser, and you're gonna have to figure out where the setting is. I'm sure that you can dream about resetting it, after an hour or 2 of browsing.
has comment: http://stackoverflow.com/comment/47361485
accepted answer of: http://stackoverflow.com/q/29607873
has comment: http://stackoverflow.com/comment/47362675
has comment: http://stackoverflow.com/comment/47363506
has comment: http://stackoverflow.com/comment/47363313

http://stackoverflow.com/comment/47284835
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29550981
has text: check answer because it also need to use ($("#headerbg2").sticky('update')) to update the sticky otherwise the (unstick) by it self wont work properly
score: 0

http://stackoverflow.com/q/29599917
favorite count: 0
tagged with: css
score: 2
tagged with: visual-studio-2013
answer count: 0
upvote count: 2
type: UnansweredQuestion
has title: How to use two rows, one with a slideshow and the next one with an image, as background?
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I am using Visual Studio 2013 Ultimate, to create a web application. For the home page, I want to recreate the effect similar to the below template: http://www.templatemonster.com/demo/52270.html I made many attempts to achieve a fixed header in the first row, with the second row having a slideshow for background and the third row has a simple complementing image for background. The second and third row together provide a backdrop for the animated tabs to slide in at a precise position. So far I have achieved a slideshow that stretches into the entire page, a fixed header. Problem 1: Unable to place the tabs at the bottom of the row. As shown in the image, current position is displayed in colors and the black squares are where i want the tabs. The code that caused this: <ajaxToolkit:ToolkitScriptManager ID="tsm1" runat="server"></ajaxToolkit:ToolkitScriptManager> <asp:Table ID="table1" runat="server" Width="100%" Height="100%" CellPadding="5" CellSpacing="5" HorizontalAlign="Center"> <asp:TableHeaderRow Width="100%" BackColor="White"> <asp:TableHeaderCell ColumnSpan="2" BackColor="White" Width="90%" HorizontalAlign="Center" VerticalAlign="Middle"> <asp:Image ID="img_banner" runat="server" Width="90%" ImageAlign="Middle" ImageUrl="~/Images/logistics-and-stores-banner.png" /> </asp:TableHeaderCell> </asp:TableHeaderRow> <asp:TableRow Width="100%" VerticalAlign="Bottom"> <asp:TableCell Width="50%" HorizontalAlign="Right" VerticalAlign="Bottom"> <asp:LinkButton ID="lb_logistics" runat="server" BackColor="#E74C3C" Width="200px" Height="150px" Text="Logistics" Font-Bold="true" Font-Underline="false" Font-Size="XX-Large" Font-Names="Calibri" ForeColor="White" OnClick="lb_logistics_Click"></asp:LinkButton> </asp:TableCell> <asp:TableCell Width="50%" HorizontalAlign="Left" VerticalAlign="Bottom"> <asp:LinkButton ID="lb_stores" runat="server" BackColor="#9DC02E" Text="Stores" Width="200px" Height="150px" Font-Bold="true" Font-Underline="false" Font-Size="XX-Large" Font-Names=…

http://stackoverflow.com/q/29628466
has comment: http://stackoverflow.com/comment/47427939
type: Question
has title: Bootstrap Datetimepicker not working in collapse
tagged with: javascript
score: 0
linked to: http://stackoverflow.com/q/8018760
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/29628581
tagged with: momentjs
type: AnsweredQuestion
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/47400056
accepted answer: http://stackoverflow.com/a/29628581
has body: Im using the bootstrap3 linked datetimepickers within a bootsrap collapse javascript component. The problem is that the datetimepicker is not showing. Im not sure what is causing the issue because I have tried z-index as many others have recommended and it has not solved my issue. This is my script code. I am not very experienced with jQuery but I made this code to dynamically add rows to the form with collapsible views

http://stackoverflow.com/comment/47277653
type: Comment
comment on: http://stackoverflow.com/a/29561241
has text: @CocoFlouq Since `.display` already has the `table` and `titre` attributes, you can get them with `$(obj).attr('table');` and `$(obj).attr('titre');`. You need to study it more. See jQuery [selectors](https://api.jquery.com/category/selectors/) and [traversing](https://api.jquery.com/category/traversing/) documentation for further guidance, and [try jQuery](https://www.codeschool.com/courses/try-jquery) course.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47266490
type: QuestionComment
has text: Mh, perhaps my reduction wasn't clear enough. I'm using `arg--` as a substitute for "do some work with `arg`". For example, think submitting a paged API request with `{ page: arg }`.
comment on: http://stackoverflow.com/q/29557809
score: 0
type: Comment

http://stackoverflow.com/comment/47448070
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29654032
has text: Welcome to SO Geovani! Sounds to me like you could use a `while` loop. Check whether the amount left is greater than the cost of another item, if it is, subtract another item. Otherwise, return the remainder and the number of items (a counter). Remember that SO is meant to provide questions that will be useful to many people, not just solve your problem, so try to do as much background research as possible to avoid downvotes.
score: 0

http://stackoverflow.com/a/29603644
answers question: http://stackoverflow.com/q/29603588
score: 3
upvote count: 3
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47353115
type: Answer
has comment: http://stackoverflow.com/comment/47353783
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29603588
has body: You don't need regex, but that would probably be simplest. It's a straight forward character class, put the characters you want to disallow inside [...], e.g.: if (/[,.?\-]/.test(rspace)) { // .... } Note that within [], - is special, so if you want to include it put a backslash before it (as above). Same with backslash, come to that. Note that you never need to write == true in a condition. You can if you want, but it serves no purpose from the JavaScript engine's perspective.

http://stackoverflow.com/a/35204254
answers question: http://stackoverflow.com/q/29658550
score: 2
upvote count: 2
has body: I used something like this $(window).on("touchstart", function(e) { var container = $("#menu"); if (!container.is(e.target) // if the target of the click isn't the container... &amp;&amp; container.has(e.target).length === 0) // ... nor a descendant of the container { $('#menu').slicknav('close'); } });
type: Answer
downvote count: 0

http://stackoverflow.com/q/29569925
has answer: http://stackoverflow.com/a/29570129
upvote count: 2
type: Question
accepted answer: http://stackoverflow.com/a/29570129
type: AnsweredQuestion
tagged with: typescript
has body: In my IDE all of the .ts TypeScript files are compiled into a single file. This includes my unit test files. This allows me to have type checking in my tests and a build all in one step. However, when I boot my dev server it cannot find the jasmine method describe() so I'm overloading it if it's not defined. // If jasmine functions are not defined (i.e. not running tests) skip functions if (describe === undefined) { var describe = (function () { // Duplicate identifier 'describe' return function (description: string, callback: () =&gt; void) { return } })(); } And in jasmine.d.ts declare function describe(description: string, specDefinitions: () =&gt; void): void; The issue is TypeScript correctly recognizes that I'm redefining an existing function but I'm intending to do this (hence the if (describe === undefined)). Question: Is there a way to suppress this error? I think I'm looking for some thing like a function describe() implements jasmine.describe but as far as I can tell this is only available for classes. Note: I'm using TypeScript 1.4
tagged with: javascript
answer count: 2
has title: Overwrite previously declared TypeScript function
score: 2
downvote count: 0
favorite count: 0
possible better answer: http://stackoverflow.com/a/29570056
has answer: http://stackoverflow.com/a/29570056

http://stackoverflow.com/q/29587520
tagged with: angularjs
tagged with: restangular
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29589342
type: Question
has title: Why is my Restangular save() making wrong put call.
answer count: 1
tagged with: javascript
has body: So here is my JS code: api.allServiceProviders.one(routeParams.spid).get().then(function(response){ $scope.service_provider = response }) $scope.editServiceProvider = function(){ $scope.service_provider.save().then(function(response){ }) } The first API call returns the correct response by making a call to /serviceprovider/14 When I get into the edit function then the save call makes a put to /serviceprovider/14/14 For the love of god, I am not ab;t to figure what I did wrong. Can someone help me out?
score: 0

http://stackoverflow.com/q/29565576
has title: Why use _.each it only returns the original list
has answer: http://stackoverflow.com/a/29569584
score: -4
has comment: http://stackoverflow.com/comment/47280832
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47289716
tagged with: underscore.js
has comment: http://stackoverflow.com/comment/47280952
has comment: http://stackoverflow.com/comment/47281311
type: Question
has comment: http://stackoverflow.com/comment/47280778
downvote count: 4
accepted answer: http://stackoverflow.com/a/29569584
tagged with: functional-programming
upvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47282455
answer count: 1
has comment: http://stackoverflow.com/comment/47280879
tagged with: lodash
favorite count: 0
has comment: http://stackoverflow.com/comment/47283368
has body: I'm clearly doing something wrong but I can't seem to get the values I'm seeking using _.each I have a number of key value pairs, where each value is an array of objects. I want to get a value out of each object in the array and then sum those values. The code: var step = {key: array[1], key1: array[3]} array = [object, object . . .] object = {objKey: value, objKey1: value} I want to get: var step1 = {key: value, key: value}//where value is the sum of objKey in each object in the array for each key in step. I'm using the following to try and get that: _.each(step, function(n){return _.compact(_.pluck(n, "amount")).reduce(function (a, b) {return a + b;}, 0);})

http://stackoverflow.com/q/29568742
has comment: http://stackoverflow.com/comment/47287904
upvote count: 1
downvote count: 1
type: Question
has body: I've been using javascript replace() with to limit input to digits and a single decimal like this: &lt;input id="dialog-input" type="text" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');" \&gt; This works perfectly fine and if I can get dialog content from the existing input like this: &lt;input id="dialog-input" type="text" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');" \&gt; dialog = $( '#dialog-input' ).dialog({ }); However, if rendered the input directly as a jQuery object for the dialog like this, the second regex replace seems to fail getting the capturing group and something happens where it will only allow a single character in the input: dialog = $( '&lt;input type="text" oninput="this.value = this.value.replace(/[^0-9.]/g, \'\').replace(/(\..*)\./g, \'$1\');" \&gt;' ).dialog({ }); Why does this work in one case but fail in the other? I have a hunch that some part of my regex needs to be escaped but I've tried a multitude of variations and nothing seems to work.
tagged with: javascript
has answer: http://stackoverflow.com/a/29568911
score: 0
has comment: http://stackoverflow.com/comment/47290051
has comment: http://stackoverflow.com/comment/47287050
has comment: http://stackoverflow.com/comment/47286872
answer count: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47288019
accepted answer: http://stackoverflow.com/a/29568911
tagged with: regex
has title: Javascript replace() function not working in jQuery UI Dialog
type: AnsweredQuestion

http://stackoverflow.com/q/29616954
downvote count: 0
has comment: http://stackoverflow.com/comment/47378958
score: 1
has comment: http://stackoverflow.com/comment/47378933
has comment: http://stackoverflow.com/comment/47379155
has comment: http://stackoverflow.com/comment/47379190
type: Question
has comment: http://stackoverflow.com/comment/47378914
upvote count: 1
has comment: http://stackoverflow.com/comment/47378991
has comment: http://stackoverflow.com/comment/47379299
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47378981
has body: Here is where I register the .click() $(document).ready( function() { $("#newRoundId").click(function() { if(inGame()) { alert(1); if(confirm("Are you sure?") == true) { alert(2); $.post("../php/fetch_word.php", function(word) { startNewRound(word); }, "text"); } } else { alert(3); $.post("../php/fetch_word.php", function(word) { startNewRound(word); }, "text"); } }); }); Here is fetch_word.php &lt;?php require_once "config.php"; do { $result = $db-&gt;query("SELECT word FROM words ORDER BY rand() LIMIT 1"); $resultArr = $result-&gt;fetch_all(MYSQLI_ASSOC); $word = implode($resultArr[0]); $dupResult = $db-&gt;query("SELECT word FROM guessed_words WHERE word = '$word'"); } while($dupResult-&gt;num_rows); $db-&gt;query("INSERT INTO guessed_words (word) VALUES ('$word')"); echo $word; ?&gt; The code works fine when inGame() is false and when the confirm("Are you sure"?) is true, I get back multiple words, but it still "works", but when the confirm() is false, $.post() request is sent to the server and multiple words return, and if I keep doing it, I get a seemingly random amount of words returned, followed by a fatal error of the server request timing out for >30 seconds. Really confused, as my php code worked before, and now that I am testing it with this new .click() function, I get this. The alert()'s are there for debugging purposes.
has comment: http://stackoverflow.com/comment/47379265
has comment: http://stackoverflow.com/comment/47379025
answer count: 0
has comment: http://stackoverflow.com/comment/47379031
type: UnansweredQuestion
has title: jQuery .click() event has unexpected behaviour with $.post to php script
tagged with: php

http://stackoverflow.com/a/29560347
has comment: http://stackoverflow.com/comment/47307599
has comment: http://stackoverflow.com/comment/47376558
has comment: http://stackoverflow.com/comment/47345711
type: Answer
has comment: http://stackoverflow.com/comment/47366811
has comment: http://stackoverflow.com/comment/47307788
answers question: http://stackoverflow.com/q/29553777
has comment: http://stackoverflow.com/comment/47307549
has comment: http://stackoverflow.com/comment/47345781
has body: Whenever you navigate (for instance, with chrome.tabs.update({ url: URL_2 });, but that happens of every navigation) the JS contexts attached to the page are completely torn down. Your content script does not survive. As such, your content script just restarts (since it's re-injected after the navigation). Also, timers are not shared across pages, so you can't cancel a timer from background. Also, since it's set to load into every page, it makes the browsing unusable: If any page happens to have a #framerate or #fps element, it will signal your extension and the tab will be hijacked If a page has no such elements, your script just fizzles with a fatal error on trying to access null.innerHTML A good strategy would be keeping the state in the background page itself, and also inject the scripts programmatically instead of injecting it everywhere. So: 1) Remove the content scripts section from the manifest, and add URLs of your tests to "permissions" (required for injection). By the way, you don't need the "tabs" permission. 2) Make a generic script that works on both pages: setTimeout(function(){ var fps_element = document.getElementById("framerate") || document.getElementById("fps"); if(fps_element) { var fps = fps_element.innerHTML; chrome.runtime.sendMessage( {"message": "FPS", "frames": fps}); } else { // No such element found; fail somehow } }, 10000); 3) Keep track of the state and inject scripts as needed in the background: var test = 0; chrome.browserAction.onClicked.addListener(function(activeTab){ if(test == 0) { // Only react if test is not running yet chrome.tabs.create({ url: URL_1 }, function(tab) { chrome.tabs.executeScript(tab.id, {file: "content.js"}); }); test = 1; } }); chrome.runtime.onMessage.addListener(function(msg, sender) { if (msg.message === "FPS") { switch(test) { case 1: frames_per_demo.TC1_Result = msg.frames; // You really shouldn't use `alert`, since it blocks execution; // Try chrome.notifications? Or use console for debugging. alert("t…
has comment: http://stackoverflow.com/comment/47307534
has comment: http://stackoverflow.com/comment/47307620
score: 0
has comment: http://stackoverflow.com/comment/47294966
has comment: http://stackoverflow.com/comment/47300729

http://stackoverflow.com/comment/47241413
type: Comment
comment on: http://stackoverflow.com/a/29531003
has text: Odd, it still gets both of the svg images. Attached is a screenshot of what I am talking about. The image circled in green is the one that has properly been replaced, and the one circled in red is the one that shouldn't be replaced. [imgur link](http://i.imgur.com/Bc808fM.png)
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47344572
type: Comment
has text: Try to swap the arguments
comment on: http://stackoverflow.com/q/29599056
score: 0
type: QuestionComment

http://stackoverflow.com/comment/117866275
comment on: http://stackoverflow.com/a/47803998
score: 4
type: AnswerComment
has text: Note that this uses lodash `_.escapeRegExp`
type: Comment

http://stackoverflow.com/comment/47272844
score: 0
comment on: http://stackoverflow.com/a/29559590
type: Comment
has text: Plus I have done this already, I need to implement the collapse of other elements on same level, so if I selected another First Level it would collapse the Active ones.
type: AnswerComment

http://stackoverflow.com/q/29539189
score: -1
has body: In my onBeforeAction method I need to wait for a function to complete and then call this.next(). Router.onBeforeAction(function () { var self = this; functionToWait(function () { // Success callback self.next(); }); }); But it appears that onBeforeAction is completed before the function and thus when I am calling self.next() it throws an exception. I have asked a similar question here but my problem is not solved. How to make onBeforeAction call wait until a function call inside finishes in meteor.js? What needs to happen is that the site needs authentication. And there is a token stored in Session for this purpose. What I would like to achieve is that the token needs to be validated whenever the route has changed. I am trying to do this validation inside onBeforeAction. The new API from iron-router says that I need to call this.next() in this method. But the problem is that the onBeforeAction method finishes running BEFORE the validation. And thus in the validation's success callback, calling self.next() will throw an exception. What I have tried: Write a handler to tell onBeforeAction to wait until validation is completed and then proceed, but the answer from my previous question gave me an infinite loop and I don't know how to solve it. Create a session variable tokenValidated, run the validtion on clientStart. and set it to true in the success call back. And check this variable in the onBeforeAction. The problem for this solution is that it won't work when you try to refresh the page, for the same reason that onBeforeAction is completed before the validation. Call the onBeforeAction inside the validation success callback directly. This works after logging in, but when first access the site is not protected. Wait on the Session variable tokenValidated directly like this this.wait(Meteor.subscribe('token', Session.get('tokenValidated'))); And check if it's ready if (this.ready()) // proceed And it doesn't seem to work either. The authentication token is stored by …
has title: How to wait for a function to finish and then call this.next() in onBeforeAction?
linked to: http://stackoverflow.com/q/29493809
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: meteor
favorite count: 0
tagged with: iron-router
type: UnansweredQuestion
downvote count: 1
has answer: http://stackoverflow.com/a/29543289
type: Question

http://stackoverflow.com/comment/47487147
type: AnswerComment
has text: I think we have a winner ^_^ @marcel: would you mind adding a new answer so I can accept it?
comment on: http://stackoverflow.com/a/29672888
type: Comment
score: 0

http://stackoverflow.com/q/29645930
has comment: http://stackoverflow.com/comment/47453205
has body: I have a collection which has style properties which I iterate through and apply to the corresponding element: // server side Meteor.publish('elements', function(){ return Elements.find(); }); //client side Meteor.subscribe("elements"); setupElements = function () { var currentUserId = Meteor.userId(); var elements = Elements.find({user: currentUserId}).fetch(); elements.forEach(function(e){ var elementId = e._id; eval("document.getElementById('" + elementId + "').removeAttribute(\"style\")"); var width = e.width; for (var i in width) { eval("document.getElementById('" + elementId + "').style.width"= \"" + width[i] + "\""); } }); } Template.element.rendered = function() { if(!this._rendered) { this._rendered = true; // iterate through element and apply width style to each setupElements(); } } // template {{#each element}} {{text}} {{/each}} Change style The template renders and applies the corresponding width to each element. However, when I trigger an update like below: 'click #change-style': function() { Meteor.call('updateElements'); // assume server-method successfully updated all elements setupElements(); // thought this will fetch new style and re-apply }, The documents are updated in the database but the template/view does not react to the change until I refresh the page or trigger the event again. Seems like the database is not refreshed on the client-side when the server updates it. Wondering what's the right setup to make the re-apply style reactive, or if there is a way to force refresh template. Thanks in advance!
score: 0
has comment: http://stackoverflow.com/comment/47432829
answer count: 1
tagged with: meteor
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47451870
has title: Meteor update collection doesn't refresh on client
type: Question
has answer: http://stackoverflow.com/a/29656183
accepted answer: http://stackoverflow.com/a/29656183
tagged with: mongodb
tagged with: javascript

http://stackoverflow.com/comment/47508201
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29684758
has text: Since it said unrefined, that means the file isn't loaded, use the network of you devtoolbar to see if there's no problem or the fine is empty by whatever reason
score: 0

http://stackoverflow.com/comment/47377303
comment on: http://stackoverflow.com/a/29615879
type: AnswerComment
score: 0
type: Comment
has text: Regarding your edit: [why does changing an argument variable change the `arguments` “array”?](http://stackoverflow.com/questions/10221009/javascript-why-does-changing-an-argument-variable-change-the-arguments-array). So long as an argument is provided for it, `options` is a getter/setter for `arguments[0]`.

http://stackoverflow.com/comment/47287991
has text: Out of the box, it doesn't do anything. He's using a TypeScript plugin and that plugin contains the shortcut, which he mentions, compiles the file. `Ctrl + alt + y` would be the standard Windows equivalent, but you'd need to have the same plugin, he is using, installed.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29569147

http://stackoverflow.com/q/29677082
type: Question
possible better answer: http://stackoverflow.com/a/29677180
answer count: 2
has answer: http://stackoverflow.com/a/29677180
tagged with: regex
linked to: http://stackoverflow.com/q/17858174
has body: Given the following input: 123456781234567812345678 I am trying to accomplish the following: 12345678,12345678,12345678 Right now the work to accomplish this currently reads as: parts = parts.replace(/\B(?=(\d{8})+(?!\d))/g, ","); The issue I am getting is that the regex reads from right to left. I have created a JSFIDDLE to show the issue. The result I get is something like. 123,45678910,12345678 Lastly when I use the arrow keys to move around, it throws me back to the end of the input. REGEX101
linked to: http://stackoverflow.com/q/2897155
has title: Add comma to every eight digits
accepted answer: http://stackoverflow.com/a/29677396
score: 8
has comment: http://stackoverflow.com/comment/47491790
tagged with: javascript
tagged with: jquery
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47495939
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/47491727
linked to: http://stackoverflow.com/q/23277541
upvote count: 8
has answer: http://stackoverflow.com/a/29677396

http://stackoverflow.com/comment/47434067
type: Comment
comment on: http://stackoverflow.com/q/29646654
score: 0
has text: You might want to decide first what library you use for your outgoing requests, and then see how you can log those. What do you want to log, just the headers? Or also full request bodies?
type: QuestionComment

http://stackoverflow.com/comment/47465669
type: QuestionComment
has text: Try this one, look at the console log: http://jsfiddle.net/qr3Ln5v5/
score: 0
comment on: http://stackoverflow.com/q/29661904
type: Comment

http://stackoverflow.com/comment/47281074
type: QuestionComment
type: Comment
score: 2
comment on: http://stackoverflow.com/q/29565735
has text: Your method will not return `false`, it will return `undefined`, which is correct as you have no `return` anywhere in your method.

http://stackoverflow.com/a/29660965
type: Answer
downvote count: 0
score: 6
answers question: http://stackoverflow.com/q/29660906
has comment: http://stackoverflow.com/comment/47461534
has comment: http://stackoverflow.com/comment/47461453
accepted answer of: http://stackoverflow.com/q/29660906
has body: The most natural way in this case would be to store parameters count in some property (maybe private). I'm not sure why you need this, but, yea, something like this: var EventData = function (ID, Name, StartDate, StartTime, EndDate, EndTime, Location, Notes) { this._paramsCount = arguments.length; this.type = "event"; this.id = ID; this.name = Name; this.startDate = StartDate; this.startTime = StartTime; this.endDate = EndDate; this.endTime = EndTime; this.location = Location; this.notes = Notes; }; EventData.prototype.count = function () { return this._paramsCount; }; UPD. Based on the edited question, look like you want to calculate number of own properties of the instance. In this case you would use convenient Object.keys method which returns an array of property names. EventData.prototype.count = function () { return Object.keys(this).length; };
type: AcceptedAnswer
upvote count: 6
has comment: http://stackoverflow.com/comment/47461452
has comment: http://stackoverflow.com/comment/47461603

http://stackoverflow.com/q/29659748
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
tagged with: asp.net
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/29659917
linked to: http://stackoverflow.com/q/6044047
upvote count: 1
answer count: 1
accepted answer: http://stackoverflow.com/a/29659917
tagged with: jqgrid
has body: I have 10 jqgrids in an ASP.NET webpage and each of them display different data to the user. Except colNames, colModel, pager and sortname properties, all other properties the are same. See my code below, datatype: "local", mtype: "GET", cmTemplate: { sortable: true, resizable: true }, height: 'auto', altRows: true, altclass: '', pgbuttons: false, pgtext: "", gridview: true, loadonce: true, shrinkToFit: false, pager: gridPager, autoencode: true, sortname: 'Id', width: $('.grid-wrapper').width() - 20, emptyrecords: 'No records found', viewrecords: true, sortorder: "desc", scrollrows: true, loadui: 'disable', toppager: true, Is it possible to put all of the above properties in a common variable and reuse the variable in all the 10 different grid's? The idea is to save some space and make the changes in one place. Note: I am using jqgrid plugin 4.6.0. Solution Applied: Added the following code to the top of my js file and removed the same properties from all the 10 jqgrids. Working great! //DEFAULTS $.extend($.jgrid.defaults, { datatype: "local", mtype: "GET", cmTemplate: { sortable: true, resizable: true }, height: 'auto', altclass: '', pgbuttons: false, pgtext: "", gridview: true, loadonce: true, shrinkToFit: false, autoencode: true, emptyrecords: 'No records found', viewrecords: true, sortorder: "desc", scrollrows: true, loadui: 'disable' });
type: AnsweredQuestion
has title: put jqgrid properties in a common variable and reuse them?

http://stackoverflow.com/a/29625572
has body: You can use JQuery : $("#content").val(signature) See val-vs-text-for-textarea
has comment: http://stackoverflow.com/comment/47404989
has comment: http://stackoverflow.com/comment/47402793
type: Answer
answers question: http://stackoverflow.com/q/29625335
score: 0

http://stackoverflow.com/comment/47265805
type: AnswerComment
comment on: http://stackoverflow.com/a/29557703
type: Comment
has text: Thanks for your hit, apparently in my production code I had position on static set by some JS.
score: 0

http://stackoverflow.com/comment/47437405
score: 3
has text: You can't... the properties of an object can't be sorted.. use an array instead like `[{key: 'B', total: 4},{key: 'C', total: 4},{key: 'A', total: 2}]`
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29648767

http://stackoverflow.com/a/29696290
score: 0
type: Answer
has body: You can create multiple ng-app. Each ng-app has its own $rootScope from which you can call broadcast (publish). See those additional, relevant links: https://stackoverflow.com/questions/16846210/angular-bootstrap-to-run-https://stackoverflow.com/questions/24830679/why-we-use-rootscope-broadcast-in-angularjs
answers question: http://stackoverflow.com/q/29681435
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29681435

http://stackoverflow.com/q/29610281
has comment: http://stackoverflow.com/comment/47446274
tagged with: javascript
has body: I have following requirejs config: require.config({ baseUrl: '/js', shim: { ... highcharts: { deps: ['highcharts-more'], exports: 'Highcharts' } ... }, paths: { ... 'highcharts': 'http://code.highcharts.com/highcharts', 'highcharts-more': 'http://code.highcharts.com/highcharts-more' ... } }); Then in my view: define([ ... 'highcharts', ... ], function (Highcharts) { // The speed gauge // Example http://www.highcharts.com/demo/gauge-solid $('#container-speed').highcharts(...); }); In console i have: ReferenceError: Highcharts is not defined in highcharts-more.js Any correct way how to load Highcharts-more.js with RequireJS?
score: 2
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/15672872
has title: highcharts-more + requirejs, Highcharts undefined
tagged with: highcharts
has comment: http://stackoverflow.com/comment/47390713
downvote count: 0
has comment: http://stackoverflow.com/comment/47443957
has answer: http://stackoverflow.com/a/29611326
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/47392059
has comment: http://stackoverflow.com/comment/47431696
has comment: http://stackoverflow.com/comment/47433023
has comment: http://stackoverflow.com/comment/47392875
has comment: http://stackoverflow.com/comment/47444023
has comment: http://stackoverflow.com/comment/47445922
upvote count: 2
has comment: http://stackoverflow.com/comment/47432036
accepted answer: http://stackoverflow.com/a/29611326
tagged with: requirejs
has comment: http://stackoverflow.com/comment/47397437
answer count: 1

http://stackoverflow.com/comment/47377208
has text: @A.B I'll try that :), just remembered doing that few months ago for something else so still got the code in my folder somewhere. Thx
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29615702
type: QuestionComment

angularjs-http
tags question: http://stackoverflow.com/q/29666063
tag name: angularjs-http
type: Tag
tags question: http://stackoverflow.com/q/29675240
tags question: http://stackoverflow.com/q/29673285

http://stackoverflow.com/comment/47405321
has text: Well then alter the 'scope' in which you're using it.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29631251

http://stackoverflow.com/comment/47510466
comment on: http://stackoverflow.com/a/29684408
score: 0
has text: @bomblord Short of doing what you suggested with the submit button, you could also try making all changes to a clone of `#bulletin-course-listings` in the loop and then reassign the original node once you're done. It's so slow now because the DOM is being redrawn on each loop, each time you make a CSS change, and that's very complex. You could try this: http://pastebin.com/hYTeCcby This will redraw the DOM just *once*, and should be the fastest yet. If not, your idea of going with the submit event might be the best bet.
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29646788
accepted answer: http://stackoverflow.com/a/29740467
has comment: http://stackoverflow.com/comment/47435855
answer count: 1
has body: Basically I hope it works like this: suppose there is a long web page and its content has two parts: "content of index 1" and "content of index 2". And my PC screen can only present one part. Also there is a list of 2 items on the side of the page with every item indicating one part of the web page. What I want is I will set item1 with CSS class 'live' when part 1 is present in the screen; and I will set item2 with CSS class 'live' when part 2 is present in the screen (on the same time, I will remove 'live' from item 1). To be clear, just like this website's implementation. http://v2.bootcss.com/components.html Thanks,
downvote count: 5
has title: How to change element CSS class when different part of web page is present?
has comment: http://stackoverflow.com/comment/47433839
type: AnsweredQuestion
upvote count: 0
score: -5
has answer: http://stackoverflow.com/a/29740467
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47433841
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/q/29552703
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47257027
has comment: http://stackoverflow.com/comment/47266867
has comment: http://stackoverflow.com/comment/47256715
type: Question
has comment: http://stackoverflow.com/comment/47293235
tagged with: java
has comment: http://stackoverflow.com/comment/47266122
has comment: http://stackoverflow.com/comment/47261755
score: 0
has comment: http://stackoverflow.com/comment/47270264
tagged with: jsp
has body: I have included my javascript file in head of jsp file! What i want that there is a variable which is increasing everyone using click on the map, and i want that value in the jsp page. Please tell me how to do that, here is my code! The JSP file code! incremental value i is defined is ClickHandler.js <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> Insert title here This is login Page Here is my ClickHandler.js file code! var i=0; var map,vectorLayer, selectedFeature; var lat=33.7167; var lon=73.0667; var zoom=10; var map; var curpos = new Array(); var position; var fromProjection = new OpenLayers.Projection("EPSG:4326"); // Transform from WGS 1984 var toProjection = new OpenLayers.Projection("EPSG:900913"); // to Spherical Mercator Projection var cntrposition = new OpenLayers.LonLat(lon, lat).transform( fromProjection, toProjection); function init() { map = new OpenLayers.Map("Map",{ controls: [ new OpenLayers.Control.PanZoomBar(), new OpenLayers.Control.LayerSwitcher({}), new OpenLayers.Control.Permalink(), new OpenLayers.Control.MousePosition({}), new OpenLayers.Control.ScaleLine(), new OpenLayers.Control.OverviewMap(), ] } ); var mapnik = new OpenLayers.Layer.OSM("MAP"); map.addLayers([mapnik]); //map.addLayer(mapnik); map.setCenter(cntrposition, zoom); //markers.addMarker(new OpenLayers.Marker(cntrposition)); var click = new OpenLayers.Control.Click(); map.addControl(click); click.activate(); }; OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, { defaultHandlerOptions: { 'single': true, 'double': false, 'pixelTolerance': 0, 'stopSingle': false, 'stopDouble': false }, initialize: function(options) { this.handlerOptions = OpenLayers.Util.extend( {}, this.defaultHandlerOptions ); OpenLayers.Control.prototype.initialize.apply( this, arguments ); this.handler = new OpenLayers.Handler.Click( this, { 'click': this.trigger }, this.handlerOptions ); }, trigger: function(e) { var lonlat = map.getLonLatFromPixe…
tagged with: javascript
tagged with: openlayers
has comment: http://stackoverflow.com/comment/47261553
tagged with: http://stackoverflow.com/tag/html
has title: Accessing javascript variable in jsp in java

http://stackoverflow.com/q/29585679
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29585826
has answer: http://stackoverflow.com/a/29585804
has answer: http://stackoverflow.com/a/29585831
score: 7
upvote count: 7
has comment: http://stackoverflow.com/comment/47319535
has title: Find maximum difference in array
type: Question
has answer: http://stackoverflow.com/a/79348317
has body: I'm working on an algorithm to return the difference of any pair of numbers, such that the larger integer in the pair occurs at a higher index (in the array) than the smaller integer. Examples... Array: [2, 3, 10, 2, 4, 8, 1] Solution: 10 - 2 = 8 Output: 8 Array: [7, 9, 5, 6, 3, 2] Solution: 9 - 7 = 2 Output: 2 Here is what I have but it doesn't work for all tests... var a = [22, 2, 4, 5, 6, 444, 1, 666]; // declare variables var minNumber = a[0], // initilize to first element maxNumber = a[0], // --- ^ minNumberIndex = 0, // min index maxNumberIndex = a.length - 1; // max index // loop through each element in array for(i = 0; i &lt; a.length; i++) { // find min if (a[i] &lt; minNumber &amp;&amp; i &lt; maxNumberIndex) { minNumber = a[i]; minNumberIndex = i; } // find max if (a[i] &gt;= maxNumber &amp;&amp; i &gt; minNumberIndex) { maxNumber = a[i]; maxNumberIndex = i; } } // return results console.log("max: \t" + maxNumber); console.log("min: \t" + minNumber + "index: " + minNumberIndex); console.log(maxNumber - minNumber); Please help!
has answer: http://stackoverflow.com/a/53134889
has answer: http://stackoverflow.com/a/29662273
has answer: http://stackoverflow.com/a/63188821
tagged with: javascript
has answer: http://stackoverflow.com/a/46081493
answer count: 13
has comment: http://stackoverflow.com/comment/47319464
has answer: http://stackoverflow.com/a/72689988
has answer: http://stackoverflow.com/a/47118085
has answer: http://stackoverflow.com/a/32198001
downvote count: 0
has answer: http://stackoverflow.com/a/47118159
has comment: http://stackoverflow.com/comment/47319440
has answer: http://stackoverflow.com/a/29664888
favorite count: 0

http://stackoverflow.com/q/29609982
upvote count: 0
has body: { brandBrandId: { brandId: 2, brandName: "Hikka", isGun: true }, modelId: "1", modelName: "Hikka model" }, { brandBrandId: { brandId: 3, brandName: "Bebrand", isGun: true }, modelId: "2", modelName: "Bebrand model 1" }, { brandBrandId: { brandId: 2, brandName: "Hikka", isGun: true }, modelId: "3", modelName: "Hikka model2" } javascript var models = $scope.models; console.log("selectedBrand----&gt;" + selectedBrand); for (var i = 0; i &lt; models.length; i++) { console.log(i+" : " +[i].brandBrandId.brandId)//ERROR HERE! Error TypeError: Cannot read property 'brandId' of undefined Question How can I search models under the brand 2 with JavaScript? Like give me every model which has brandId=2. I was trying to for loop it, but I really can't do it and I hope that there is some better and wiser way to do it. I need every modelId and modelName under the specific brand. THANKS! Solution function getModels() { var brandsmodels=new Array(); for (var i = 0; i &lt; models.length; i++) { if (models[i].brandBrandId.brandId === selectedBrand) { brandsmodels.push({ "modelId": ""+models[i].modelId, "modelName": ""+models[i].modelName, "brandId": ""+selectedBrand }); } } $scope.brandsmodels=brandsmodels; }
has comment: http://stackoverflow.com/comment/47366392
score: -4
has comment: http://stackoverflow.com/comment/47368877
has title: Get information from an array/object in JavaScript
type: Question
has comment: http://stackoverflow.com/comment/47365517
has comment: http://stackoverflow.com/comment/47367163
has comment: http://stackoverflow.com/comment/47366752
tagged with: javascript
has comment: http://stackoverflow.com/comment/47365581
has comment: http://stackoverflow.com/comment/47365674
has comment: http://stackoverflow.com/comment/47365653
has comment: http://stackoverflow.com/comment/47365566
answer count: 1
has comment: http://stackoverflow.com/comment/47366075
favorite count: 0
has comment: http://stackoverflow.com/comment/47366650
linked to: http://stackoverflow.com/q/11922383
has answer: http://stackoverflow.com/a/29610067
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47365573
has comment: http://stackoverflow.com/comment/47370088
has comment: http://stackoverflow.com/comment/47365635
downvote count: 4

http://stackoverflow.com/q/29683182
tagged with: jquery-easyui
has comment: http://stackoverflow.com/comment/52092474
type: UnansweredQuestion
has title: JQuery JEasyUI treegrid or FancyTree but responsive for mobile
has answer: http://stackoverflow.com/a/32098983
type: Question
has body: I'm searching the same functionality as fancytree but as it uses right click is a no-go for mobile, can i put buttons in the side instead of using the context menu for mobile devices? What other alternative it is for fancytree? can i put buttons to the actions of fancytree and Jeasyui treegrid to customize layout?
has comment: http://stackoverflow.com/comment/52070465
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: treegrid
tagged with: fancytree
score: 0

http://stackoverflow.com/comment/47334557
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29586188
type: Comment
has text: I would say only a disconnect may cause this and I see you figured it out.

http://stackoverflow.com/comment/47436887
score: 1
has text: @saestris : Updated. Anyway as @Dan Prince said, it's better to refine your data structure : if you can't follow his advice, I suggest this : instead of storing clones of selected objects in `selectedWorkshops` , you should put references. For example : `selectedWorkshops.push(workshops[2])`. or write a function : `selectedWorkshops.push(getWorkshopById('8v')); `
comment on: http://stackoverflow.com/a/29632051
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29654189
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47449800
upvote count: 1
has title: Creating a JSON object in JavaScript dynamically
type: Question
has body: I need to create a JSON object dynamically in JavaScript using a for loop. I have tried using the array.Push method but it is not working. I am only getting the first value getting stored. The remaining values of the iteration are not getting stored. This is what I am trying: var array = []; for (var i = 0; i &lt; 4; i++) { var username = drlist.reportees[i].name; var think40 = getthink40(n,m); if (think40.isSuccessful){ var result = think40.array; var length = result.length; var tes= 0; for (var j = 0; j &lt; length-1; j++){ tes = tes + parseFloat(result[j].duration); } var hours = tes/60; var think = (hours/40)*100; if (think &gt; 100) { think =100; } array.push( { name: username, hours: think }); } return array; }
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has answer: http://stackoverflow.com/a/29654451
has comment: http://stackoverflow.com/comment/47448566
has comment: http://stackoverflow.com/comment/47448471
answer count: 2
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/29654432
tagged with: worklight-adapters
has comment: http://stackoverflow.com/comment/47448213

http://stackoverflow.com/q/29595245
has title: Optimizing page speed when jQuery needed to render
has answer: http://stackoverflow.com/a/29595305
has body: I'm using the Google PageSpeed service to improve the page loading time of my site. The site is on GAE/P but I don't think that matters so much. My page depends on a few resources: Bootstrap (css and js) jQuery (js) jQuery UI (js and css) My own stuff (js, css, and images) The waterfall of a page load (link) is below. In this page, I use Javascript to render a jQuery UI sortable. The PageSpeed recommendations of inlining needed css/js seems impractical because of Bootstrap and jQuery. I'm looking for advice as to how I can get the most bang for my buck to improve page speed. For example: Should I combine all js (Bootstrap, jQuery, jQuery UI, mine) into a single js file and serve it myself? Should I combine all css (Bootstrap, jQuery UI, mine) into a single css and serve it myself? Should I combine images into a css sprite? Other things I should consider? I'd appreciate your ideas.
type: Question
accepted answer: http://stackoverflow.com/a/29595305
upvote count: 1
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: css
favorite count: 0
type: AnsweredQuestion
downvote count: 0
tagged with: pagespeed
score: 1
tagged with: dom

http://stackoverflow.com/q/29557198
accepted answer: http://stackoverflow.com/a/29560288
tagged with: php
has body: I want to swing an image using jQuery. I have gone through so many tutorials but I was unable to find out how to do this.
type: AnsweredQuestion
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/47264756
has answer: http://stackoverflow.com/a/29560288
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47269037
has comment: http://stackoverflow.com/comment/47265780
has title: Swing an image by using j Query

http://stackoverflow.com/a/29592750
upvote count: 1
has body: Not sure if this will help you but I have a listener for the actual event, and it sets a timeout whenever an event is received. If the event fires before the previous timeout expires, I cancel the previous one. And the timeout actually triggers the action. So a stream of similar events that occur right after each other is silenced and discarded. I use this mainly for window resize events but it might apply here too. Pure js code could look something like this: var resizeTimeout = null, wait = 200; window.onresize = function(){ if (resizeTimeout !== null) { window.clearTimeout(resizeTimeout); resizeTimeout = null; } resizeTimeout = setTimeout(function(){ //do whatever is needed to deal with window resize. }, wait); } (But I have a wrapper "class" called Timer that make it a bit cleaner to do this kind of thing)
has comment: http://stackoverflow.com/comment/49247336
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/49247240
has comment: http://stackoverflow.com/comment/49268735
type: Answer
accepted answer of: http://stackoverflow.com/q/29592641
score: 1
answers question: http://stackoverflow.com/q/29592641

http://stackoverflow.com/comment/47376787
has text: @Pointy I'm not sure I explained myself well. I get that storing them in an object will be best, but I just want to match the entire set of words. But the regex is failing after all the `background`s are stored in that object. Border, font, etc fail. Do you know how I could ensure I match those strings as well? Thanks again.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29615476

http://stackoverflow.com/comment/47300600
has text: *In general, my way is to use few families of Hierarchies. E.g. Entities are having root/list/detail, while login has no hierarchy. Documentations can share root but end with root.doc... This way we can share lot of code, while still having ability to distinguish (by logical "families")...*
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29576063
score: 3

http://stackoverflow.com/comment/47386902
has text: Add the length to what?
comment on: http://stackoverflow.com/q/29621358
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/29642070
has comment: http://stackoverflow.com/comment/47425792
type: Answer
has comment: http://stackoverflow.com/comment/47425825
has comment: http://stackoverflow.com/comment/47425865
downvote count: 0
score: 1
has body: Try this: function x(a, b) { arguments[1] = "foo"; console.log(b); } x("hello", "world"); You'll see "foo" in the console. The arguments object has array-like properties that alias the formal parameters declared by the function. That means that when you change arguments[0], that also changes the value of the first explicitly-declared formal parameter. There's no other way in JavaScript to alias variables, so that makes arguments "unusual".
has comment: http://stackoverflow.com/comment/47425820
answers question: http://stackoverflow.com/q/29642062
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29642062

http://stackoverflow.com/q/29589230
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/29589304
favorite count: 0
type: UnansweredQuestion
has title: Why wont my loop within a loop in Javascript work?
has body: This is suppose to store the chosen answer for multiple questions. When I use this code, it only checks the first question and disregards the other questions. for(i = 0; i &lt; questions.length-1; i++){ radios = document.getElementsByName(questions[i]); for (var t = 0; length &lt; radios.length; t++) { if (radios[t].checked) { var qResults = JSON.parse(localStorage["qResults"]); num = radios[t].value; checked = num.toString(); var temp = (id[0] + ";" + questions[i] + ";" + checked); alert(temp); qResults.push(temp); localStorage["qResults"] = JSON.stringify(qResults); } } alert("question finished"); }
has answer: http://stackoverflow.com/a/29589255
tagged with: loops
downvote count: 1
type: Question
answer count: 2
tagged with: for-loop
upvote count: 0

http://stackoverflow.com/q/29640386
type: Question
score: 0
answer count: 1
tagged with: javascript
has title: What is the "scope" that gets passed to a $scope.$watch function?
tagged with: angularjs
has body: $scope.$watch( function(scope) {return scope.aNumber;}, function(newValue, oldValue) {alert("Value changed");} ); }); What is the "scope" that $scope.$watch takes in its first function? (everything after this is extra info that is tangentially related). I know "scope" without the $ generally represent just a variable, as in the directive link function (scope, element, attributes, ngController), etc. However I have no idea where it "comes from" here. Clearly it's connected to the controller's $scope, but how? Also, the official doc states "The watchExpression is called on every call to $digest() and should return the value that will be watched. (Since $digest() reruns when it detects changes the watchExpression can execute multiple times per $digest() and should be idempotent.)" So what's the advantage to doing the return function rather than just saying $scope.valueToWatch (which doesn't work for me, but I have seen people do it). Plunk with working watch just for the hell of it, don't really need it for q: http://plnkr.co/edit/y86Wr93xLIao3wTwVsT8?p=preview For those reading with same q later: Good article on $watch: http://tutorials.jenkov.com/angularjs/watch-digest-apply.html
has answer: http://stackoverflow.com/a/29640422
accepted answer: http://stackoverflow.com/a/29640422
type: AnsweredQuestion

http://stackoverflow.com/comment/49621953
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29664585
has text: yup i have resolved that use https://github.com/grevory/angular-local-storage

http://stackoverflow.com/a/29653799
has body: If you want to highlights word that starts with lu, then you can use this regex: var text= '(?:^|\\s)lu\\w*' Working demo var text= '(?:^|\\s)lu\\w*' $('ul li').each(function(){ var reg = new RegExp('(' + text + ')', 'gi') txt = $(this).text(); txt = txt.replace(reg, "" + '$1' + ""); $(this).html(txt); }) .highlight{color:red} blue diamond blue diamond lue gold lue diamond lue gold lue diamond lue
type: Answer
downvote count: 0
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29653619

http://stackoverflow.com/a/29601971
answers question: http://stackoverflow.com/q/29601836
upvote count: 2
type: Answer
downvote count: 1
has body: The reason you are getting that error is because the function you have defined there is invalid, so it is not loaded. The problem lies with (float) - you can't typecast like that in JavaScript. Use the parseFloat() function as follows: var txt1 = parseFloat(document.getElementById('text1').value); Note that Rajesh is also correct in that you need to change &lt;script language="text/javascript"&gt; to &lt;script type="text/javascript"&gt; The complete, correct script is as follows: &lt;script type="text/javascript"&gt; function calc() { var txt1 = parseFloat(document.getElementById('text1').value); var txt2 = parseFloat(document.getElementById('text2').value); document.getElementById('text3').value = (txt1 * txt2); } &lt;/script&gt;
score: 1

http://stackoverflow.com/q/29677514
has comment: http://stackoverflow.com/comment/47492631
has title: How to fade out a list by clicking a button using javascript?
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/29677608
tagged with: javascript
answer count: 1
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/29677608
has body: I am currently having problem fading and showing another user in javascript, I am able to get the data from the database but the fading is not working. Below I have added the code in the order in which they occur: <?php $conn = mysqli_connect("localhost","username","password","subscribers"); ?> <?php $sql=mysqli_query($conn,"SELECT * FROM users2 LIMIT 10"); while($row=mysqli_fetch_array($sql)) { $user_id=$row['id']; $user_name=$row['name']; $user_image=$row['image']; ?> <li id="list<?php echo $user_id; ?>"> <img src="<?php echo $user_image; ?> " /> <a href="#" class="delete" id="<?php echo user_id; ?>">X <?php echo $user_name;?> Add as Friend <?php } ?>
tagged with: php
type: AnsweredQuestion

http://stackoverflow.com/a/29672694
downvote count: 0
has body: I would recommend you to fix it on server side. However you can use, $(document).ready(function() { //Read attribute and replace text $('#img__kw_field_id').attr('fbphotobox-src', function(){ return $(this).attr('fbphotobox-src').replace(";",""); }); alert($('#img__kw_field_id').attr('fbphotobox-src')); }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;img id="img__kw_field_id" fbphotobox-src=" Uploads/Images/OriginalImages/developer_635647972105434266.jpg;" src="Uploads/Images/ResizedImages/developer_635647972105434266.jpg" alt="" /&gt;
accepted answer of: http://stackoverflow.com/q/29672517
type: Answer
answers question: http://stackoverflow.com/q/29672517
score: 1
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/47492772
type: AnswerComment
type: Comment
has text: The explanation given is a massive red herring that doesn't explain what the solution actually is.
comment on: http://stackoverflow.com/a/29677602
score: 0

http://stackoverflow.com/comment/59895556
has text: I've got a similar error. I created a file in path `..\Phone\Android\data\com.ionicframework.appname761153\files` called test.txt. it *succeeded* as i saw in debugging (via USB directly from Android Device) but there is no such file in the Folder.
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/29632077

http://stackoverflow.com/q/29584760
upvote count: 0
tagged with: arrays
tagged with: javascript
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29584781
score: -1
has answer: http://stackoverflow.com/a/29585686
downvote count: 1
type: Question
has body: $('.add').click(function(){ runFunction(); //loop //i++ }); $('.deduct').click(function(){ runFunction(); //loop //i-- }); I have the above code, where within the the two click() functions, there's only slightly differences, just the increment and decrements different in a loop. I thought of simply storing the selector into an array, is this possible? var arr = ['$('.deduct')', '$('.add')']` ??
answer count: 3
has title: store jquery selector into an array?
has answer: http://stackoverflow.com/a/29584986

http://stackoverflow.com/comment/47509696
score: 0
type: AnswerComment
has text: It doesn't make any sense what you're asking. If you need just a link why don't you use the `a` tag ? `book` ?!
type: Comment
comment on: http://stackoverflow.com/a/29685970

http://stackoverflow.com/comment/47272202
type: Comment
score: 0
type: QuestionComment
has text: I'm using nodemailer 1.0. Could it be why? When I was using 0.7 it was fine ...
comment on: http://stackoverflow.com/q/29561130

http://stackoverflow.com/a/29545845
type: Answer
has body: You can use this to redirect to previous page inside your script tag window.location.href='javascript:history.go(-1)';
accepted answer of: http://stackoverflow.com/q/29545069
downvote count: 0
answers question: http://stackoverflow.com/q/29545069
score: 1
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/q/29607048
answer count: 1
downvote count: 0
has body: I have old jquery-like project. Our team start to develop new feature and I would like to use React 0.13 on this. I put scripts into site folder (react.0.13.min.js, JSXTransformer.js) and below put my app.react.js How I can write some test code, in this case? I try to type: 'use strict'; class Story extends React.Component { render() { var story = this.props.story; return ( &lt;View&gt; &lt;Image uri={story.author.profile_picture.uri} /&gt; &lt;Text&gt;{story.author.name}&lt;/Text&gt; &lt;Text&gt;{story.text}&lt;/Text&gt; &lt;/View&gt; ); } } From Chrome debugger I can access to React variable. What I need to do?
tagged with: javascript
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47387777
has comment: http://stackoverflow.com/comment/47361185
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47361620
upvote count: 1
has title: How I can use react 0.13 with ES6 syntax on old project?
has answer: http://stackoverflow.com/a/29622028
has comment: http://stackoverflow.com/comment/47361398
has comment: http://stackoverflow.com/comment/47368330
type: Question
tagged with: reactjs

http://stackoverflow.com/comment/47464791
type: QuestionComment
score: 0
has text: @FelixKling of course you're right; it's interesting to contemplate the impact on answer rates of a general philosophy that questions with answers derivable by trivial experimentation should be ignored :)
comment on: http://stackoverflow.com/q/29662596
type: Comment

http://stackoverflow.com/comment/47468575
type: Comment
type: QuestionComment
score: 0
has text: i would like to point out that a for loop is valid as long as it has the the following structure `for(; ; ){}`. JS doesn't care what goes between those semi colons but they must exist. Your loop doesn't work because you are trying with index -1 which is invalid. the loop fails on the 1st iteration itself and doesn't continue further.
comment on: http://stackoverflow.com/q/29664531

http://stackoverflow.com/q/29611130
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has body: I want to get the screen size and if after that the browser gets resized it should not be changed to the new browser width. How I can do that through CSS? Or jQuery? If I load a web page into my browser and the current screen width is 1000px, after that I resized my web browser which is equivalent to 700px width. But my navbar width should be 1000px; it must not be changed. That is my requirement.
has comment: http://stackoverflow.com/comment/47367793
type: Question
has comment: http://stackoverflow.com/comment/47367886
tagged with: css
has comment: http://stackoverflow.com/comment/47368106
has answer: http://stackoverflow.com/a/29623177
has comment: http://stackoverflow.com/comment/47368764
has comment: http://stackoverflow.com/comment/47369022
has comment: http://stackoverflow.com/comment/47367966
answer count: 3
downvote count: 3
has comment: http://stackoverflow.com/comment/47368843
has comment: http://stackoverflow.com/comment/47367843
has title: Get Screen width and fixed it to fixed size
has comment: http://stackoverflow.com/comment/47368206
has comment: http://stackoverflow.com/comment/47368088
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
score: -3
has comment: http://stackoverflow.com/comment/47369104
has answer: http://stackoverflow.com/a/29611429
upvote count: 0
has answer: http://stackoverflow.com/a/29611949

http://stackoverflow.com/a/29610312
has body: You should NOT use inside tag, why? I changed it to . I adjusted the jQuery slightly, added alignment classes to the parent tag. Along with some CSS updates as follows. $(document).ready(function () { // has "view details" box $('img.wrapme').each(function () { $(this).wrap(''); if ($(this).hasClass('alignright')) { $(this).parent().parent().addClass('alignright'); } else if ($(this).hasClass('aligncenter')) { $(this).parent().parent().addClass('aligncenter'); } else if ($(this).hasClass('alignleft')) { $(this).parent().parent().addClass('alignleft'); } $(this).parent().append('View Details'); }); // no "view details" box $('img.nowrap').each(function () { $(this).wrap(''); if ($(this).hasClass('alignright')) { $(this).parent().parent().addClass('alignright'); } else if ($(this).hasClass('aligncenter')) { $(this).parent().parent().addClass('aligncenter'); } else if ($(this).hasClass('alignleft')) { $(this).parent().parent().addClass('alignleft'); } }); }); .wrapper { position: relative; display: inline-block; } .aligncenter { text-align: center; } .alignleft { text-align: left; } .alignright { text-align: right; } .countbox { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background-color: #fff; padding: 10px; } Center Align Left Align Right Align Photo by Francois de Halleux via Flickr (Creative Commons by-nc-nd) Fiddle Demo: http://jsfiddle.net/tu374zy5/
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29609712
answers question: http://stackoverflow.com/q/29609712
upvote count: 2

http://stackoverflow.com/comment/47416852
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29637229
has text: Nothing wrong with the way i am using knockout. If i pass a value by id, it works just fine. It is the only "$(this)" thing causing problem.

http://stackoverflow.com/q/29636344
tagged with: javascript
has title: How could I check my regexp value it correct?
score: 0
tagged with: regex
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47415133
has comment: http://stackoverflow.com/comment/47415194
has comment: http://stackoverflow.com/comment/47415118
has answer: http://stackoverflow.com/a/29636368
has answer: http://stackoverflow.com/a/29636411
type: Question
has body: I need to check that value provided by user is correct and correspond to the following format 47:VkqFAUUZ, 5:dkqdAU3d. The first path is number and the second part is string of 7-14 length? EDIT: the second part could be the following symbols A-Z, a-z, 0-9, _-
answer count: 2

http://stackoverflow.com/q/29611125
tagged with: ajax
has title: Jquerymobile filter listview not working when fetching data dynamically
has body: Jquerymobile filter listview not working when fetching data dynamically the code for displaying data using url getfilms.php var xmlhttp = new XMLHttpRequest(); var url = "./getfilms.php"; xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { myFunction(xmlhttp.responseText); } } xmlhttp.open("GET", url, true); xmlhttp.send(); function myFunction(response) { var arr = JSON.parse(response); //var arr = obj.records; var i; var out = ""; for (i = 0; i < arr.length; i++) { out += " " + arr[i].Film + " "; } document.getElementById("searchfilmsbyname").innerHTML = out; } The code for displaying the listview in html side using id="searchfilmsbyname"
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29611414
score: 1
upvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29611414
downvote count: 0
tagged with: jquery-mobile
answer count: 1
tagged with: jquery
favorite count: 0

http://stackoverflow.com/a/29609573
score: -2
downvote count: 2
has body: Right from the JQuery documentation on $.get() If a request with jQuery.get() returns an error code, it will fail silently unless the script has also called the global .ajaxError() method. Alternatively, as of jQuery 1.5, the .error() method of the jqXHR object returned by jQuery.get() is also available for error handling.
has comment: http://stackoverflow.com/comment/47368368
answers question: http://stackoverflow.com/q/29609490
type: Answer
upvote count: 0

http://stackoverflow.com/q/29683863
possible better answer: http://stackoverflow.com/a/29684245
upvote count: 0
has answer: http://stackoverflow.com/a/29684245
tagged with: javascript
has comment: http://stackoverflow.com/comment/47517614
favorite count: 0
accepted answer: http://stackoverflow.com/a/29691232
has body: I have a JSON object allDataJson which have around 500 objects and looks like this: [{"Researchers":"Karri, Ismo","Year":"2013","Title":"A"}, {"Researchers":"Grigori, Ahmed, Roope, Arto, Daisuke, Arasawa,IkeHama","Year":"2015","Title":"B"}, {"Researchers":"Grigori, Ahmed, Roope, Arto, Daisuke","Year":"2015","Title":"C"}, {"Researchers":"Grigori, Ahmed, Roope, Arto, Daisuke","Year":"2014","Title":"D"}] I need to create another JSON object with the following structure: var json =[ {"Published": [[2013, 1]], "Total": 1, "Researcher": "Karri"}, {"Published": [[2015, 2], [2014, 1]], "Total": 3, "Researcher": "Grigori"} //for all of the researchers] (For example, Karri published 1 article in 2013, Grigori published 2 articles in 2015 and 1 article in 2014 etc.) So far I could only push the Total and Researcher names to json object as follows. Any ideas about how to push Published values to the Json object? Here is my code: function FlowChartJson(fullnames, allDataJson){ var occurences = { }; var json =[]; for (var i = 0; i &lt; fullnames.length; i++) { if (typeof occurences[fullnames[i]] == "undefined") { occurences[fullnames[i]] = 1; } else { occurences[fullnames[i]]++; } } for(var name in occurences){ json.push( {"Researcher":name, "Total":occurences[name] }); } return json; }
downvote count: 1
has title: Counting certain JSON elements
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29691232
tagged with: http://stackoverflow.com/tag/json
score: -1
type: Question
answer count: 2

http://stackoverflow.com/comment/47254079
type: QuestionComment
has text: How can I make this document ready
comment on: http://stackoverflow.com/q/29551137
score: 0
type: Comment

http://stackoverflow.com/a/29668219
has comment: http://stackoverflow.com/comment/47475337
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/47475415
answers question: http://stackoverflow.com/q/29668148
has body: Try this: var myClassElement = $(".my-class #x").parents('.my-class'); // Do something with myClassElement If you want to do something with .my-class element event if it doesn't contain #x element use this: $(".my-class").each(function() { var containsXElement = $(this).find("#x").length &gt; 0; if (containsXElement){ // Do something with $(this) } });
has comment: http://stackoverflow.com/comment/47475500
has comment: http://stackoverflow.com/comment/47474978

http://stackoverflow.com/a/29676404
answers question: http://stackoverflow.com/q/29675279
has body: Normally, people who draw a lot of stuff in a canvas will make their own shape objects with style properties. For example: http://jsfiddle.net/b93cc3ww/ context = document.getElementById("myCanvas").getContext("2d"); function Rectangle(params) { this.x = params.x || 0; this.y = params.y || 0; this.width = params.width || 0; this.height = params.height || 0; this.fillStyle = params.fillStyle || "#FFFFFF"; this.strokeStyle = params.strokeStyle || "#000000"; this.lineWidth = params.lineWidth || 0; } Rectangle.prototype.draw = function () { if (this.fillStyle) { context.fillStyle = this.fillStyle; context.fillRect(this.x, this.y, this.width, this.height) } if (this.strokeStyle &amp;&amp; this.lineWidth) { context.strokeStyle = this.strokeStyle; context.lineWidth = this.lineWidth; context.strokeRect(this.x, this.y, this.width, this.height); } } rectangles = [ new Rectangle({ x: 10, y: 10, width: 300, height: 150, fillStyle: "#FF0000" }), new Rectangle({ x: 250, y: 10, width: 100, height: 80, fillStyle: "#00FF00", strokeStyle: "#00AA00", lineWidth: 5 }), new Rectangle({ x: 10, y: 200, width: 250, height: 80, strokeStyle: "#FF0000", lineWidth: 1 }) ] for (var i = 0; i &lt; rectangles.length; ++i) { rectangles[i].draw(); } If you like the way CSS works, you could make a shape object which can take a "class" parameter and then store a list of "clases" in an array at the top of your code.
has comment: http://stackoverflow.com/comment/47493070
score: 5
upvote count: 5
has comment: http://stackoverflow.com/comment/74694048
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/47500315

http://stackoverflow.com/comment/47286433
has text: Easy, Html has a Disabled property you can add to the element you want using jquery or javascript. just build a timer function that will add this property at the beginning and it will removed it after one minute.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29568479

http://stackoverflow.com/a/29585956
downvote count: 0
has body: In your ajax success callback, you can use auto scroll the div element: var element = document.getElementById('chatlogs'); element.scrollTop = element.clientHeight; //You can even use // element.scrollTop = element.scrollHeight; Based on div height, it will scroll to the bottom of the div. setInterval(function() { $('#chatlogs').load('logs.php'); var element = document.getElementById('chatlogs'); element.scrollTop = element.clientHeight; }, 2000);
has comment: http://stackoverflow.com/comment/47320300
has comment: http://stackoverflow.com/comment/47320453
type: Answer
has comment: http://stackoverflow.com/comment/47320637
answers question: http://stackoverflow.com/q/29585884
has comment: http://stackoverflow.com/comment/47320147
has comment: http://stackoverflow.com/comment/47320055
has comment: http://stackoverflow.com/comment/47320191
upvote count: 1
has comment: http://stackoverflow.com/comment/47320420
score: 1
has comment: http://stackoverflow.com/comment/47320075

http://stackoverflow.com/comment/47407446
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29632316
has text: Please check the edited code, i just want to give it a gallery look that automatically handle the columns according to size

http://stackoverflow.com/a/29540797
has body: You should be able to call render() on the chart's legend to re-render it: chart.legend.render();
answers question: http://stackoverflow.com/q/29540742
score: 0
has comment: http://stackoverflow.com/comment/47236444
type: Answer

http://stackoverflow.com/q/29533935
has title: Javascript,if condition works without && logical operator when && is present it doesnt work
accepted answer: http://stackoverflow.com/a/29533956
has comment: http://stackoverflow.com/comment/47221265
tagged with: dom
has body: I want the error message to display if the length of characters in the #nameT id is less than < 3 or greater <than 20.When I use && logical operator it doesn't work as intended when && is absent if I execute the code one by one it works perfectly. Name : Error please type less than 15 characters Password :
tagged with: logical-operators
has comment: http://stackoverflow.com/comment/47221674
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47220830
downvote count: 0
tagged with: javascript
score: 1
has comment: http://stackoverflow.com/comment/47221164
favorite count: 0
possible better answer: http://stackoverflow.com/a/29533995
type: Question
has answer: http://stackoverflow.com/a/29533995
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 2
has comment: http://stackoverflow.com/comment/47221568
upvote count: 1
has answer: http://stackoverflow.com/a/29533956

backbone.js
tags question: http://stackoverflow.com/q/29616494
tags question: http://stackoverflow.com/q/29536108
tags question: http://stackoverflow.com/q/29612014
tags question: http://stackoverflow.com/q/29626497
tags question: http://stackoverflow.com/q/29568952
tags question: http://stackoverflow.com/q/29674366
tags question: http://stackoverflow.com/q/29667282
tags question: http://stackoverflow.com/q/29646956
tags question: http://stackoverflow.com/q/29621664
tags question: http://stackoverflow.com/q/29623169
tags question: http://stackoverflow.com/q/29644681
tags question: http://stackoverflow.com/q/29642157
tags question: http://stackoverflow.com/q/29599111
tags question: http://stackoverflow.com/q/29558681
tags question: http://stackoverflow.com/q/29645588
tags question: http://stackoverflow.com/q/29644156
tags question: http://stackoverflow.com/q/29620798
tags question: http://stackoverflow.com/q/29615457
tags question: http://stackoverflow.com/q/29634767
tags question: http://stackoverflow.com/q/29546194
tags question: http://stackoverflow.com/q/29613743
tags question: http://stackoverflow.com/q/29621810
tags question: http://stackoverflow.com/q/29610581
tags question: http://stackoverflow.com/q/29677317
tags question: http://stackoverflow.com/q/29566730
tags question: http://stackoverflow.com/q/29675903
tags question: http://stackoverflow.com/q/29555838
tags question: http://stackoverflow.com/q/29664650
tags question: http://stackoverflow.com/q/29559956
tags question: http://stackoverflow.com/q/29685825
tags question: http://stackoverflow.com/q/29615816
type: Tag
tags question: http://stackoverflow.com/q/29650990
tags question: http://stackoverflow.com/q/29545425
tags question: http://stackoverflow.com/q/29589829
tags question: http://stackoverflow.com/q/29656743
tag name: backbone.js

http://stackoverflow.com/a/29656000
downvote count: 0
answers question: http://stackoverflow.com/q/29655795
upvote count: 2
type: Answer
accepted answer of: http://stackoverflow.com/q/29655795
score: 2
has comment: http://stackoverflow.com/comment/47453446
has body: You need to make a copy of the array in each invocation of your function, as all arguments reference the same array otherwise (and modify it). You can use the Array slice method for that. function recursiveFunction (id,ids) { if (typeof ids === 'undefined') ids = []; else ids = ids.slice(); // copy ids.push(id); for (var i=0; i&lt;id; i++) recursiveFunction(id-1, ids); if (id === 0) console.log('id is zero and ids is: ' + ids); } Now if you incorporate the i of the loop in your array, you get different outputs.
type: AcceptedAnswer

http://stackoverflow.com/a/29670832
has comment: http://stackoverflow.com/comment/47567140
score: 0
has body: arr_A = ["a","b","d","f","g"]; arr_B = ["a","c","f","h"]; var newArr = []; var item while ( item = arr_B.shift() ) { arr_A.contains ( item ) &amp;&amp; newArr[ newArr.length ] = item ; } newArr;// ["a", "f"];
has comment: http://stackoverflow.com/comment/47509987
type: Answer
answers question: http://stackoverflow.com/q/29606843

http://stackoverflow.com/comment/47368153
type: Comment
comment on: http://stackoverflow.com/q/29610746
has text: It's not very clear what you are trying to do...
score: 0
type: QuestionComment

http://stackoverflow.com/comment/47458179
type: Comment
comment on: http://stackoverflow.com/a/29659239
score: 0
type: AnswerComment
has text: Thank you for your help but unfortunately my buttons look like this http://i.imgur.com/gqGD1LV.png not like the image in the code you gave me

http://stackoverflow.com/q/29538967
type: Question
downvote count: 0
tagged with: javascript
has title: how to split array into n groups? (factorize, or _.partition array)
accepted answer: http://stackoverflow.com/a/29539162
answer count: 1
tagged with: lodash
favorite count: 0
has answer: http://stackoverflow.com/a/29539162
duplicate of: http://stackoverflow.com/q/11345296
linked to: http://stackoverflow.com/q/11345296
type: AnsweredQuestion
score: 3
tagged with: underscore.js
has body: Let's say I have an array = [0,1,2,3,4,5,6] and I want to "partition" it into 3 arrays, based on reminder after division by 3. so basically I'd want something like: _.my_partition([0,1,2,3,4,5,6], function(item) {return item % 3;}) // [[0,3,6], [1,4],[2,5]] (I can use lodash, underscore, if ti helps...)
upvote count: 3

http://stackoverflow.com/comment/47469758
comment on: http://stackoverflow.com/q/29656205
has text: Just replace `drag` event by `stop` event in `draggable` options.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/29630464
favorite count: 0
has answer: http://stackoverflow.com/a/29632245
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29630918
has title: How to display images based on date
upvote count: 1
downvote count: 1
type: Question
has body: Images names has this structure: 16-04-2015 15-04-2015 14-04-2015_1 14-04-2015_2 13-04-2015 12-04-2015 11-04-2015 The images are placed one a folder in the project and are loaded with the image date as the name. There are two buttons next and previous buttons. When buttons are clicked the corresponding image will be displayed based on the date . How to achieve that?
tagged with: javascript
has comment: http://stackoverflow.com/comment/47404586
tagged with: image
score: 0
answer count: 2
tagged with: jquery

http://stackoverflow.com/comment/47256506
type: Comment
comment on: http://stackoverflow.com/a/29552341
score: 0
type: AnswerComment
has text: Good idea and much simpler, but yes I am trying to slide the channels like turning a dial. I think this would be much easier for users to understand in this context because the channels always stay in the same order. Thank you though, I will keep this code in mind for future applications!

http://stackoverflow.com/a/29651305
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47459667
type: Answer
has comment: http://stackoverflow.com/comment/47443764
accepted answer of: http://stackoverflow.com/q/29651123
has comment: http://stackoverflow.com/comment/47444148
downvote count: 0
has comment: http://stackoverflow.com/comment/47459692
score: 1
has comment: http://stackoverflow.com/comment/47444219
has comment: http://stackoverflow.com/comment/47443182
answers question: http://stackoverflow.com/q/29651123
has body: Thats because in javascript, "this" is a reference to the current scope, so, If you call a function/callback outside the original scope, most probably that "this" will be the "window", since "window" is the one that is calling the function/callback. A workaround in order to maintain "this" to the scope you want to, you have to bind your functions to that given scope when you are declaring it: function Foo() { this.bar(); }.bind(this); //-&gt; Here you bind Foo to the current scope, so inside Foo, this will be always the scope where it was bound.
upvote count: 1

http://stackoverflow.com/a/29546210
has body: There is a more efficient way of handling duplicates, as discussed here: https://stackoverflow.com/a/1300116/1845408 You can use DistinctBy from MoreLINQ. var distinctValues = _dbContext.CustomerUsers.DistinctBy(c =&gt; c.CustomerUserId);
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29544235
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29544235

http://stackoverflow.com/q/29651426
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29651476
type: Question
tagged with: javascript
score: 0
has body: I am trying to hide a span if the context of the span is empty. However, the content of the span is some complicated calculation. What I want to do, is exactly below, however, I do not want to call the function twice. The element below is also in a "Loop" (ASP.NET MVC foreach in the razor page :( ). Here is is @for(...) { &lt;span ng-hide="GetDataCount() &gt; 0"&gt;{{GetDataCount()}}&lt;/span&gt; } As you can see, this will work, but I have to call the function 2 times. Any ideas how I can make this work if the "span" element we're currently in doesn't have a value? (i.e. if GetDataCount returns null or 0). Thanks!
has title: Prevent duplicate calls with AngularJS method binding
answer count: 1
has answer: http://stackoverflow.com/a/29651476

http://stackoverflow.com/comment/47380427
comment on: http://stackoverflow.com/q/29617659
score: 0
type: Comment
type: QuestionComment
has text: Please learn how to work with JS variables before you dive into much more complex topics (like constructor functions).

http://stackoverflow.com/q/29542742
answer count: 2
has answer: http://stackoverflow.com/a/29543453
downvote count: 0
tagged with: javascript
score: 4
tagged with: google-chrome-extension
favorite count: 0
has title: Chrome Extension: Open new tab without losing popup focus
accepted answer: http://stackoverflow.com/a/29543453
has body: I have a simple list of research links on a Chrome Extension: Research Link 1 Research Link 2 Research Link 3 On any webpage, I could ctrl+click all three links, opening new tabs in the background. However, this doesn't seem to be the case with a Chrome Extension Popup. If you ctrl+click on a link, the extension closes the popup, which prevents you from clicking more than one link at any time. I've tried an on-click chrome.tabs.create approach which is described in several other posts, but that seems similar to just clicking target="_blank" as it just opens a new tab with focus. chrome.tabs.create({url: 'http://www.google.com'}); Is there any way to open a new tab without focus (ctrl+click), while still allowing the extension popup to remain visible in the current tab so that the user can click a second, third, or fourth link? That way the user doesn't have to rerun the extension several times, which takes time as it has to authenticate and query for the data all over again.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29546551
type: Question
upvote count: 4
possible better answer: http://stackoverflow.com/a/29546551

http://stackoverflow.com/q/29570814
score: 0
type: UnansweredQuestion
type: Question
tagged with: asp.net-mvc
tagged with: database
has answer: http://stackoverflow.com/a/29571031
has body: Good Afternoon All, I am working on part of a site that will read data from a table in a database and display the data sequentially with a click of the previous and next buttons, in a JQuery Dialog box. I am really not that good with Javascript or Jquery for that matter and need a little guidance here. I can get the the content on the first page of the dialog, but it pulls each id body column for the specific value. I want it to pull one instance with the given id, click next and get the next and so on. The code is below. Here is the script Here is the code on my View Page <% IQueryable<#######.#####.######.######> tutorials = gr.GetEntriesByStream(13); %> This is dialog box for the tutorial data. <%foreach (var item in tutorials) { %> <%if (item.seOrder == 0) {%> <%: item.seBody %> <%} %> <%} %> Go To Tutorial
has title: Jquery Dialog Box and Pulling content from a Database
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/29660933
has comment: http://stackoverflow.com/comment/47461597
answer count: 2
has comment: http://stackoverflow.com/comment/47461455
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has comment: http://stackoverflow.com/comment/47461418
has body: I need to create an array of the id's from each in a selected div. HTML Teamcenter Completed: NX Manager Completed: There are multiple div's like this one with different id's to them. My code selects the div first. I can get it to filter the correct div. I can't get it to create the array of the check box id's inside that div. JavaScript $.get('content/page.php', function(data) { data1 = $(data).filter('#' + actSite + '-' + actUT + '-CAD'); data2 = $(data1).filter(`*Not sure what to put here*`); }); data1 works as it should and gets from ... I need something to end looking like data1 = ["tc", "nxm", ...] If I were to create an array for each item I need an array for, it would take weeks. I need to be able to change the data in data1 over and over again. EDIT / SOLUTION - 4/21/2015 I have changed all my ID's for the checkboxes as many have commented. Here is my WORKING code: var NewArray = []; $(':checkbox').each(function(index, element) { NewArray.push(this.id); }); //results NewArray = [ADC-Designer-CAD-tc,ADC-Designer-CAD-nxm,....]
has answer: http://stackoverflow.com/a/29661033
has answer: http://stackoverflow.com/a/29661369
has title: How to create array of input id's
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29661369
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47461515
type: Question
accepted answer: http://stackoverflow.com/a/29661033
tagged with: arrays
downvote count: 0
has comment: http://stackoverflow.com/comment/47461484
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47461386

http://stackoverflow.com/q/29609173
tagged with: javascript
has body: I am trying to use the Facebook Marketing API to create a new ad campaign in Node.js. I have successfully gotten an access token from this url: var fbApi = { 'method': 'GET', 'url' : 'https://graph.facebook.com/oauth/access_token?client_id=MYCLIENTID&amp;client_secret=MYSECRET&amp;grant_type=client_credentials' } I then make this POST request (using the 'request' module). I am posting values for 'name' and 'campaign_group_status' which I understand are required values. I am posting to the endpoint https://graph.facebook.com/&lt;API_VERSION&gt;/act_&lt;AD_ACCOUNT_ID&gt;/adcampaign_groups and I'm passing the access token via the URL as per this from the docs: http://graph.facebook.com/endpoint?key=value&amp;access_token=app_id|app_secret . Full code (sensitive info replaced by dummy data): var request = require('request'); var fbOptions = { 'name' : 'test2', 'campaign_group_status' : 'PAUSED' } var fbOptionsString = JSON.stringify(fbOptions); var fbPost = { 'uri' : ' https://graph.facebook.com/v2.3/act_5374356645419299/adcampaign_groups?access_token=56345345453773242|iert_arfwYfwfwxD-pLxHcpASFTNm', 'method': 'POST', 'headers': { 'Content-Type' : 'application/json', }, 'body' : fbOptionsString } request(fbPost, function(error, response, body){ console.log('request says ----', body); }) . Error response that I'm seeing: request2 says ---- {"error":{"message":"Unsupported post request.","type":"GraphMethodException","code":100}} . Before I was getting an error about permission, and another saying the 'name' value was required. Those have been solved. So I believe I have the right access and Facebook is getting the body content of the request. Help would be greatly appreciated!
score: 0
tagged with: facebook-graph-api
has comment: http://stackoverflow.com/comment/47364991
type: UnansweredQuestion
has title: Facebook Marketing API | node js | "message":"Unsupported post request.","type":"GraphMethodException","code":100
tagged with: facebook
tagged with: node.js
has answer: http://stackoverflow.com/a/29645956
type: Question
answer count: 1

http://stackoverflow.com/comment/47275784
comment on: http://stackoverflow.com/a/29558089
score: 0
type: Comment
has text: To get the current path use `d3.select(this).style("stroke","red");`
type: AnswerComment

http://stackoverflow.com/q/29660381
tagged with: template-literals
tagged with: javascript
linked to: http://stackoverflow.com/q/9952126
answer count: 3
linked to: http://stackoverflow.com/q/24816777
tagged with: template-strings
favorite count: 0
upvote count: 157
downvote count: 2
score: 155
has answer: http://stackoverflow.com/a/53084271
has title: Backticks (`…`) calling a function in JavaScript
has body: I'm not sure how to explain this, but when I run console.log`1` In google chrome, I get output like console.log`1` VM12380:2 ["1", raw: Array[1]] Why is the backtick calling the log function, and why is it making a index of raw: Array[1]? Question brought up in the JS room by Catgocat, but no answers made sense besides something about templating strings that didn't really fit why this is happening.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29660634
possible better answer: http://stackoverflow.com/a/53084271
has answer: http://stackoverflow.com/a/64998440
has comment: http://stackoverflow.com/comment/47460933
tagged with: tagged-templates
accepted answer: http://stackoverflow.com/a/29660634
type: Question
tagged with: ecmascript-6
linked to: http://stackoverflow.com/q/27782577

http://stackoverflow.com/comment/47483602
type: Comment
score: 0
has text: Okay wait few seconds
comment on: http://stackoverflow.com/a/29672688
type: AnswerComment

http://stackoverflow.com/q/29538339
tagged with: javascript
favorite count: 0
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/29538464
has title: Changing the property from browser console doesn't fire the binding
downvote count: 1
has answer: http://stackoverflow.com/a/29538464
has comment: http://stackoverflow.com/comment/47228898
has comment: http://stackoverflow.com/comment/47228718
has body: Here is my controller code var app = angular.module('plunker', []); app.controller('MainCtrl', function($scope) { window.foo = {bar: 'Foobar'}; $scope.foo = foo; }); Here is my template code Hello {{foo.bar}}! I tried to change the value of foo.bar from the chrome console as follows foo.bar = "New Name" But I don't see a change in the template, I'm a newbie at AngularJS. Can anybody explain what I am missing here ? You can see the demonstration here http://plnkr.co/edit/MQv2wJdycAKN6MoajTkI?p=preview Note: Since we cannot access global variables as it's a iframe, I'm using a setTimeout(I deliberately did not use $timeout) in this example
type: Question
type: AnsweredQuestion
score: 1
upvote count: 2
has comment: http://stackoverflow.com/comment/47228916
answer count: 1

http://stackoverflow.com/a/29639070
has body: You need to take the new lines (\n) from the text area and convert them to &lt;br /&gt;. Something like this fiddle: https://jsfiddle.net/62bfv61d/1/ should work for you.
type: Answer
accepted answer of: http://stackoverflow.com/q/29638940
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29638940

http://stackoverflow.com/comment/47357140
type: QuestionComment
score: 0
has text: If you want those custom property at client side i.e. javascript only, then you can add those to listitem as attribute, I can help you on, let me know if that is your requirement? But if you want to change those custom property and access in serverside, that might not be feasible.
comment on: http://stackoverflow.com/q/29604631
type: Comment

http://stackoverflow.com/comment/47455947
type: QuestionComment
comment on: http://stackoverflow.com/q/29658079
score: 0
has text: alejandro-bar, I don't know how to see that. I use Chrome...
type: Comment

http://stackoverflow.com/q/29577715
has body: I have nodes /person/<personid>/remarks/<remarkid> with therein the fields remark, by, date. How do I retrieve a straightforward list containing the remark, by and date of each remark of each person in order to put them in a html-table? I tried to figure it out with the text on https://www.firebase.com/docs/web/guide/retrieving-data.html but I get stuck altogether. What I got so far is:
tagged with: firebase
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47306808
type: Question
has title: How to retrieve nested node content from firebase?
accepted answer: http://stackoverflow.com/a/29582015
tagged with: javascript
has answer: http://stackoverflow.com/a/29582015
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47312303

http://stackoverflow.com/comment/47411594
has text: No errors, everything has been transferred from my computer to the server and all the files are on the server, so I have no clue why the files such as CSS or Javascript are not functioning.
type: Comment
comment on: http://stackoverflow.com/q/29634611
score: 0
type: QuestionComment

http://stackoverflow.com/q/29611994
type: Question
score: 0
linked to: http://stackoverflow.com/q/203198
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47369579
duplicate of: http://stackoverflow.com/q/203198
accepted answer: http://stackoverflow.com/a/29612078
answer count: 3
has title: Jquery don't detect a click after showing search results
tagged with: http://stackoverflow.com/tag/html
has body: I have a small problem with Jquery click. On page load we display some things from a database. The startup code I mean is placed in the same file where the html is (This will be removed when the user searches for the first time because the div where are the list-item are in wil be cleared after searching to make place for the search results). When you click on one of the items you get a popup menu with some info. Now the problem: On the page we also have a search bar that searches things in a database. When you press search you get a list of search result. It is the same html code as on the page load but this time Jquery don't detect a click. html: <div class="list-item" data-singer= <?php echo '"'.$name.'"' ?> > <?php echo $name ?> <?php echo $tag ?> other info Jquery: $('.list-item').click(function(){ alert(); name = $(this).data('singer'); name_modified = name.replace(" ", "_"); $(name_modified).ready(function(){ $('.popup > .content').empty(); $('.popup > .content').load('singers/' + name_modified + '.xml'); $('.popup').slideDown(500); }); }); There is also another problem with the js code but I am already happy when I fix this problem. When you need more information leave a comment and I will add it. And a message to downvoters. Leave a comment please.
has comment: http://stackoverflow.com/comment/47369641
has comment: http://stackoverflow.com/comment/47369768
has answer: http://stackoverflow.com/a/29612080
has answer: http://stackoverflow.com/a/29612085
has comment: http://stackoverflow.com/comment/47369771
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29612078
possible better answer: http://stackoverflow.com/a/29612080
has comment: http://stackoverflow.com/comment/47369584

http://stackoverflow.com/q/29619383
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47383172
accepted answer: http://stackoverflow.com/a/29619492
has title: Why slider handle can not be moved?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47383191
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/29619492
type: Question
has body: I am trying to test slider but the slider handle can not move. Could you please help me this. I have attached a Fiddle for the reference. My JS: var current_plan = {}; var plans = [ { 'name' : 'Business', 'ram' : '1024 MB', 'disk' : '25 GB', 'bandwidth' : 'Unlimited', 'cores' : 4, 'price' : { 'uk' : 7.5, 'us' : 12 }, 'comment' : 'Ideal for simple websites, secondary nameservers & small test environments.' }, { 'name' : 'Power', 'ram' : '2048 MB', 'disk' : '50 GB', 'bandwidth' : 'Unlimited', 'cores' : 4, 'price' : { 'uk' : 15, 'us' : 24 }, 'comment' : 'Ideal for wordpress, drupal & other CMS, forums and medium sized web shops.' }, { 'name' : 'High-Traffic', 'ram' : '4096 MB', 'disk' : '100 GB', 'bandwidth' : 'Unlimited', 'cores' : 4, 'price' : { 'uk' : 30, 'us' : 48 }, 'comment' : 'Ideal for cPanel and other hosting controlpanels as well as busy sites and forums.' }, { 'name' : 'Power', 'ram' : '8192 MB', 'disk' : '200 GB', 'bandwidth' : 'Unlimited', 'cores' : 4, 'price' : { 'uk' : 60, 'us' : 96 }, 'comment' : 'Ideal for complex web apps, multiple busy sites, forums or web shops.' }, { 'name' : 'High-Traffic', 'ram' : '16384 MB', 'disk' : '400 GB', 'bandwidth' : 'Unlimited', 'cores' : 4, 'price' : { 'uk' : 120, 'us' : 192 }, 'comment' : 'Ideal for complex web apps, multiple busy sites, forums or web shops.' } ]; function calc_price() { var os_price = { 'uk': { os: { windows: 5, cpanel: 7.5, ubuntu: 0, centos: 0 }, }, 'us': { os: { windows: 7.5, cpanel: 10, ubuntu: 0, centos: 0 }, } }; var total_price = current_plan.price[country_code] + os_price[country_code].os[$("input[name=os_template]:checked").val()]; $('.price-val').text(total_price.toFixed(2)); var signUpUrl = ["https://control.vps.net/cart/ssd-vps"]; signUpUrl.push(parseInt(current_plan.ram, 10)); signUpUrl.push($("input[name=locations_template]:checked").val()); signUpUrl.push($("input[name=os_template]:checked").val()); signUpUrl.push("ssdvps-" + Math.floor(Math.random()*(99999-10000+1)+10000) + ".vps.net")…
tagged with: javascript
tagged with: jquery
tagged with: slider
upvote count: 1

http://stackoverflow.com/q/29584420
accepted answer: http://stackoverflow.com/a/30045041
upvote count: 4
has comment: http://stackoverflow.com/comment/47379835
has comment: http://stackoverflow.com/comment/47342460
tagged with: javascript
has comment: http://stackoverflow.com/comment/47318834
has comment: http://stackoverflow.com/comment/47317099
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: On my webpage, I have an audio file inside of an tag. I want to chop up this file stored in an tag into multiple 10 second audio files that I could then insert into the webpage as their own audio files in seperate tags. Is it possible to do this in javascript?
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/30045041
tagged with: html5-audio
type: Question
has comment: http://stackoverflow.com/comment/47318513
has title: How to manipulate the contents of an audio tag and create derivative audio tags from it?
answer count: 1
score: 4

http://stackoverflow.com/q/29648409
type: AnsweredQuestion
has body: I am using DOMPDF version (0.6 beta).I am getting following error: Fatal error: Call to a member function append_child() on null in C:\xampp\htdocs\practice\application\helpers\dompdf\include\frame_tree.cls.php on line 220 Here is my code snippet: $this-&gt;load-&gt;helper(array('dompdf', 'file')); $quoteId = $this-&gt;uri-&gt;segment('4'); $filename ='ship-'.uniqid().'.pdf'; $data = pdf_create($html, '', false); $html = file_get_contents(BASE_URL.'index.php/admin/quotes/createQuotePDF/'.$quoteId); I am stuck with this error for the past 4 hours. Couldn't get much from Google as well.Any help would be appreciated
accepted answer: http://stackoverflow.com/a/29699262
tagged with: dompdf
type: Question
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/29699262
has comment: http://stackoverflow.com/comment/47437122
has title: Error while creating a PDF using DOMPDF
tagged with: http://stackoverflow.com/tag/pdf
tagged with: php

http://stackoverflow.com/a/29665454
has body: $(function (){ var init_width = $(window).width(); var all_div = $('div'); var init_left = function (){ var result = []; all_div.each(function (i){ var left = parseInt($(all_div[i]).css('left')); result.push(left); }); return result; }(); $(window).resize(function (){ var width = $(window).width(); all_div.each(function (i){ var now_left = init_left[i]/init_width * width; $(all_div[i]).css('left',now_left); }); }); }); img { border:1px solid; } .bubble1 { width:50px; height:50px; background:pink; opacity:0.8; position:absolute; top:65px; left:45px; } .bubble2 { width:50px; height:50px; background:cyan; opacity:0.8; position:absolute; top:135px; left:155px; } .bubble3 { width:50px; height:50px; background:orange; opacity:0.8; position:absolute; top:190px; left:68px; } .bubble4 { width:50px; height:50px; background:red; opacity:0.8; position:absolute; top:220px; left:213px; } I make a draft DEMO to achieve the responsive layout. The key mind is: when the DOM ready you could get a set of numbers of these div's leftand then you must handle these data to percent for responsive you should recalculate the window width when resize. actually, when you work out the first key mind, you will make it. the** resize ** just make the DEMO have more adapted.
has comment: http://stackoverflow.com/comment/47471922
score: -1
has comment: http://stackoverflow.com/comment/47474611
has comment: http://stackoverflow.com/comment/47470190
downvote count: 1
answers question: http://stackoverflow.com/q/29665105
type: Answer
has comment: http://stackoverflow.com/comment/47473705
upvote count: 0

http://stackoverflow.com/q/29599984
has title: How can i execute a css3 transition when the document loads using javascript?
tagged with: javascript
has body: i was just wondering if i could make a form slide when the page loads that's the code im working on note: this html will be placed inside an iframe any responses would be appreciated
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
favorite count: 0
tagged with: css
has answer: http://stackoverflow.com/a/29600041
type: AnsweredQuestion
score: 3
upvote count: 3
accepted answer: http://stackoverflow.com/a/29600041
type: Question

http://stackoverflow.com/q/29628349
has answer: http://stackoverflow.com/a/29628622
favorite count: 0
answer count: 3
has answer: http://stackoverflow.com/a/29628751
has title: javascript objects not getting assigned correct member value
upvote count: 3
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47399776
has answer: http://stackoverflow.com/a/29628948
score: 3
has comment: http://stackoverflow.com/comment/47399733
type: Question
has body: I have 2 JS arrays and I am iterating through both of them to find similar ones. anomalies.forEach(function(anomaly) { links.forEach(function(link) { if ((link.source.name === anomaly.source) &amp;&amp; (link.target.name === anomaly.target)) { console.log("anomaly"); link.type = "anomaly"; console.log(link); } else { link.type = "normal"; } }); }); console.log(links); In a case where the value of link.type should be "anomaly", still its reflecting to be "normal". Why is it so and what should be done?
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/47316889
score: 0
type: AnswerComment
type: Comment
has text: Thanks for the answer, that's very helpful! Do you know if your advice also applies to Dimple or NVD3?
comment on: http://stackoverflow.com/a/29584283

http://stackoverflow.com/q/29650907
tagged with: javascript
has title: Using Javascript replace with getElementsByClassName not working
favorite count: 0
has answer: http://stackoverflow.com/a/29651070
linked to: http://stackoverflow.com/q/21711417
answer count: 5
has answer: http://stackoverflow.com/a/29650995
accepted answer: http://stackoverflow.com/a/29651086
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29651138
possible better answer: http://stackoverflow.com/a/29651070
has body: I posted a question a few days ago which worked great and I thank those who helped but for reasons beyond my control I have to classes instead of id's as per my original post. Basically what I am trying to do is remove the word "Other" from a string (The content is added dynamically through a form). Here is the code I am trying to use: var str = document.getElementsByClassName('gv-field-4-custom').innerHTML; var text = str.replace("Other", " "); document.getElementsByClassName('gv-field-4-custom').innerHTML = text; .gv-field-4-custom { color: #ff0000; } Complex interventions, Evidence Synthesis (randomised trials), Studies within a Trial (SWAT), Trial Conduct, Trial Design, Other Core Outcome Sets (COS) Any advise as to what I am doing wrong?
has answer: http://stackoverflow.com/a/29651111
upvote count: 1
downvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47441519
has answer: http://stackoverflow.com/a/29651086
type: Question
linked to: http://stackoverflow.com/q/29607869
score: 0
has comment: http://stackoverflow.com/comment/47458220
has comment: http://stackoverflow.com/comment/47442244

http://stackoverflow.com/comment/47441349
has text: `get` is an Asynchronous call...You are trying to eat the delivery pizza before it is delivered to your house.
comment on: http://stackoverflow.com/q/29650778
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/q/29541441
tagged with: jquery-mobile
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47279954
has title: Having same page footer when open RSS pages
has comment: http://stackoverflow.com/comment/47241716
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47274398
has comment: http://stackoverflow.com/comment/47277099
answer count: 0
has comment: http://stackoverflow.com/comment/47276095
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/47275430
has comment: http://stackoverflow.com/comment/47276690
has body: When I click on RSS items in my mobile app, I would like to see same page footer as I have in my first page. I've created my app using Cordova 4.3.0, jQuery mobile and read RSS feeds using jQuery in my onDeviceReady() function in index.js file as follow: onDeviceReady: function () { $(function () { $.get('http:myRssUrl.cshtml',function(data) { var $XML = $(data); var html = ''; $XML.find("item").each(function() { var $this = $(this), item = { title: $this.find("title").text(), link: $this.find("link").text(), description: $this.find("description").text(), pubDate: $this.find("pubDate").text(), author: $this.find("author").text(), enclosure: $this.find("enclosure").attr('url'), }; html += '' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + item.title +' ' + ' ' + item.description +' ' + ' ' }); jQuery('#result').html(html); }); }); app.receivedEvent('deviceready'); } I also have my footer navigation bar in footer.html file which will be loaded in index.html file as follows: My problem is that I can't load my page footer navbar in my RSS pages, I saw some relevant examples about it and applied different approaches, but still have the same problem.
tagged with: cordova-3
score: 0
has comment: http://stackoverflow.com/comment/47263422
has comment: http://stackoverflow.com/comment/47279277
has comment: http://stackoverflow.com/comment/47280301

http://stackoverflow.com/comment/47378579
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29616687
score: 1
has text: Is there only unusual behavior when the date of the month is 29, 30, or 31?

http://stackoverflow.com/comment/47358855
score: 0
comment on: http://stackoverflow.com/q/29606294
type: Comment
type: QuestionComment
has text: You can do like this `var $next = $active.next('img').length ? $active.next('img'): $('#slideshow IMG:first');`.

http://stackoverflow.com/a/29606089
answers question: http://stackoverflow.com/q/29605288
has comment: http://stackoverflow.com/comment/47358070
has body: From the jQuery docs : Price range: Edit Added a time format for the slider Fiddle
score: 0
type: Answer

http://stackoverflow.com/a/29641415
type: Answer
has body: Your original code doesn't work because the stop function is passed to setTimeout without any context - it does not know which object it is supposed to act on. If you invoke it like this: oscillator.stop(); Then within stop, the special variable this is set to the object pointed to by oscillator. But if you refer to it like this: var x = oscillator.stop; The function is not actually invoked. Rather, a reference to the function is simply extracted from oscillator and stored elsewhere. The function does not remember where it came from, and could be stored in many different variables or object properties at the same time. For example: var x = {}; x.foo = oscillator.stop; x.foo(); The last line calls stop with a context of x (this is set to x) rather than oscillator. (The function's body will cause errors since stop makes assumptions about what its context looks like, but the call itself is legal.) Alternatively, if you do this: var foo = oscillator.stop; foo(); Then stop will be called with only a default context. In strict mode, this will be set to undefined, and in non-strict mode, this will be set to window. When you do this: setTimeout(function(){oscillator.stop()}, 500) The anonymous function invokes stop with the proper context. If, as suggested by @elclanrs in comments, you do this: setTimeout(oscillator.stop.bind(oscillator), 500) It is effectively the same thing: an anonymous function is created that calls stop with a context of oscillator.
downvote count: 0
score: 9
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29640833
has comment: http://stackoverflow.com/comment/93497964
upvote count: 9
answers question: http://stackoverflow.com/q/29640833
has comment: http://stackoverflow.com/comment/47427649

http://stackoverflow.com/q/29666796
has title: YouTube Rate (like/dislike) comments, Share, Add To, More
score: 0
tagged with: youtube-api
answer count: 1
has body: I'm trying to embed YouTube video on website along with complete section having rating(like, dislike), Share, Add to playlist, More actions and Comments( ). Embed iframe is providing just video to play .I know we have YouTube data API V3 to build this but is their any existing library/plugin to integrate ?
type: UnansweredQuestion
tagged with: javascript
type: Question
tagged with: php
has answer: http://stackoverflow.com/a/29667181

http://stackoverflow.com/comment/47246885
has text: Ok... so, next best solution?
comment on: http://stackoverflow.com/q/29547106
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/47509137
has text: @WebWanderer Note that [`let`](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-let-and-const-declarations) is introduced by ECMAScript 6, which is still a draft. It binds the variables to the running execution context’s LexicalEnvironment (see [Execution Contexts](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-execution-contexts)). That doesn't affect the [`if` statement](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-if-statement-runtime-semantics-evaluation), though.
type: AnswerComment
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29684914

http://stackoverflow.com/q/29622311
tagged with: css
answer count: 1
has answer: http://stackoverflow.com/a/29622421
has title: :first selector doesn't work in my case
has comment: http://stackoverflow.com/comment/47388598
downvote count: 4
upvote count: 0
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
score: -4
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/47388592
has body: I tried to use :first: $(function(){ $('.awardDltBtn:first').remove(); }); to select the first matched element but it doesn't work in my case. HTML: &lt;section&gt; &lt;/section&gt; I also tried first-of-type and nth-of-type.
has comment: http://stackoverflow.com/comment/47388559
has comment: http://stackoverflow.com/comment/47388512

http://stackoverflow.com/a/29616098
has comment: http://stackoverflow.com/comment/67601780
accepted answer of: http://stackoverflow.com/q/29615889
type: Answer
answers question: http://stackoverflow.com/q/29615889
has body: Figured it out!! Hopefully this will help others. So basically the commands below are async operations, they get executed at different times, resulting in sequelize to fail, since the tables are dependent on other tables, order of execution matters. Group.sync({force: true}); User.sync({force: true}); Message.sync({force: true}); Instead of doing the above, if you call sync() on sequelize instead, sequelize knows exactly what order the commands need to executed in. sequelize.sync();
score: 17
upvote count: 17
has comment: http://stackoverflow.com/comment/109615250
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/111923068

http://stackoverflow.com/comment/47456496
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29658362
type: Comment
has text: Can describe difference between this solution , solution at updated post, above ?

http://stackoverflow.com/q/29679441
has comment: http://stackoverflow.com/comment/47497703
answer count: 1
has comment: http://stackoverflow.com/comment/47498650
tagged with: jquery
has comment: http://stackoverflow.com/comment/47572675
tagged with: css-position
has comment: http://stackoverflow.com/comment/47496629
has comment: http://stackoverflow.com/comment/47573946
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47573869
tagged with: css
has body: Right now I have a Jade template that is rendering very well and set up like this: div.rulers div.ruler-con.js.this-site div.ui.red.progress div.label jQuery div.bar.jquery div.ruler-con.js.template.pretty-good div.ui.red.progress div.label Underscore JS div.bar.underscore.pretty-good div.ruler-con.js.pretty-good div.ui.red.progress div.label Angular JS div.bar.angular.pretty-good div.ruler-con.js.this-site.server.scripting div.ui.red.progress div.label Node JS div.bar.node The parent div div.rulers has a CSS rule of position relative. What I am trying to do is find out each div.ruler-con position top relative to div.rulers, from where it is sitting in the layout. Basically, I want to know, if each div.ruler-con was position absolute what would it's position top be relative to div.rulers. I have tried: var top = $(skill).position(); console.log(top); and: var top = $(skill).offset(); console.log(top); Both are returning top:0 and left:0. Does anyone have any suggestions on how I could get this value? For reference, the variable 'skill' is each div.ruler-con as a variable in a loop. I am looping through all of these div.ruler.con Thanks, Edit: Here is my javascript now: var _skills = { each: function(skill_function, other) { $('div.ruler-con').each(function(i, value) { _skill_function(value, other) }); }, set: function(skill) { var top = $(skill).position(); console.log(top); }, filter: function(skill, class) { if ($(skill).hasClass(class)) { $(skill).fadeIn(); } else { $(skill).fadeOut(); } } }
has comment: http://stackoverflow.com/comment/47496455
has answer: http://stackoverflow.com/a/29719988
has title: Get Position on Non-Absolute Element Relative to Parent
type: Question
tagged with: javascript
score: 0

http://stackoverflow.com/q/29670097
answer count: 1
tagged with: jquery
has title: Filter table not working
has comment: http://stackoverflow.com/comment/47478594
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47478500
has comment: http://stackoverflow.com/comment/47478579
has answer: http://stackoverflow.com/a/29670447
type: Question
has comment: http://stackoverflow.com/comment/47478484
has comment: http://stackoverflow.com/comment/47478456
tagged with: javascript
has body: Hello so currently I have this table filter code which you can try on this fiddle. Document Search: Active | Inactive | Banned Name Contact Number Course Status Robert 09054848 BSIT Active Mark 5959547 BSA Inactive Doe 5959547 BSA Banned The table filter is working but I want to add text/s that when I click on it, it will be the value of the textbox and will filter the table. The text/s I added is Active, Inactive and Banned. If you click one of it, it will be the value of the input. The problem is the filter code isn't working with that code. Any help would be much appreciated
score: 0
accepted answer: http://stackoverflow.com/a/29670447
has comment: http://stackoverflow.com/comment/47478535

http://stackoverflow.com/comment/47374618
comment on: http://stackoverflow.com/a/29614295
score: 0
type: Comment
has text: Somehow i can't make it work. Thanks for your help gentleman!
type: AnswerComment

http://stackoverflow.com/comment/47392908
type: QuestionComment
has text: ...what is the question? How to make something like this?
score: 0
comment on: http://stackoverflow.com/q/29624621
type: Comment

http://stackoverflow.com/a/29573542
has comment: http://stackoverflow.com/comment/47301555
accepted answer of: http://stackoverflow.com/q/29568440
has comment: http://stackoverflow.com/comment/47301285
has comment: http://stackoverflow.com/comment/47303493
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47303093
type: Answer
has body: Its very easy, but for a beginner it may be a daunting task to set up so ill write Plenty of Notes and Installation tasks to get you started. Prerequisites for a Home Setup with PHP and EMAIL Capabilities. For Remote Hosting Setup I guess everything is Installed for you but may require some Cost, so for Home use and doing it by yourself the bonus is that its Free. 1) A Spare Computer with at least 1gig of ram and 10gigs of hard disk. if you don't have a spare one or cant afford one at he moment you may be able to Virtualize one on top of your current computer using something like Virtual box which is free. If you want 100% live service the computer must be on all the time and connected to the Internet. 2) A Server OS preferably Linux one. In this example will use UBUNTU Server. Why? Because its Very easy to setup and install extra utilities, frameworks and programs, easy to manage and has all the features you will ever need and its Fast. 3) A Mail Account. GMAIL as an example for sending emails. 4) an Internet Connection. 5) A network Cable to connect the computer to your Router. Even if you choose Wireless over a Network Cable to connect you may need to download additional drivers to get your Wireless card Working and Connecting Most likely you will need a Net Cable first. It is advisable not to use Wireless for Such Setup for a number of Reasons such as Security, Loss of Connection (Weak Signal) etc That's it. Total Installation time About 35 minutes. 25 mins for installing the OS and 10 mins for the rest of setup so you can send emails Via PHP. The Setup 1) Install UBUNTU Server Visit Ubuntu to Download the Latest Version. Server not the Desktop Version as its a bit slower than the Server version. However the downside to using the Server version is that you need to learn some basic commands on how to edit, copy, move, delete, change permissions of files around the server via command line. But its not rocket science. On the good side hosting websites on Linux Serv…
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29568440

http://stackoverflow.com/a/29658329
type: Answer
score: 2
answers question: http://stackoverflow.com/q/29657887
has comment: http://stackoverflow.com/comment/47457161
downvote count: 0
upvote count: 2
has body: Try without ?callback=? at end of url, see jQuery.getJSON() JSONP If the URL includes the string "callback=?" (or similar, as defined by the server-side API), the request is treated as JSONP instead. See the discussion of the jsonp data type in $.ajax() for more details.

http://stackoverflow.com/comment/47391877
has text: What do you mean by a static value?
comment on: http://stackoverflow.com/q/29624135
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/29678709
favorite count: 0
has title: jQuery one('load','selector') with selector not working
has comment: http://stackoverflow.com/comment/47544274
has body: I want to use the following one load after an Ajax load. This is working: j('#slider_small_container .slider-image-small:eq(0)').one('load',function(){ alert('Test'); }); But this is not: j('body').one('load', '#slider_small_container .slider-image-small:eq(0)',function(){ alert('Test'); }); Why is this? As you can see first I start with an accordeon which loads(ajax) content from a child page on click. After that load load I do some other things like a nested accordeon, gallery and so on. After the hole accordeon script at the end I wanted to use an image slider. But the corresponding images comes from the ajax load. If I open the child page directly It works. But if it loads with ajax the event is not triggering. jQuery(function(j){ /** * Accordion Big */ j('.csc-menu-accordion.csc-menu-accordion-big').accordion({ header: ".ui-accordion-header.big", icons: false, collapsible: true, active: false, heightStyle: 'content', activate: function( event, ui ) { uid = (ui.newHeader.data('uid')) ? ui.newHeader.data('uid') : ui.oldHeader.data('uid'); closed_big = (ui.newHeader.data('uid')) ? false : true; // Load if( ui.newPanel.data('loaded') == false ){ ui.newPanel.load(config_baseurl + 'index.php?id=' + uid, function(){ // Set loaded state ui.newPanel.data('loaded',true); // Set Location if unequal // 3D-Modul j.each(ui.newPanel.find('.csc-textpic-imagerow'), function(a){ j(this).addClass('csc-textpic-imagerow'+'-'+a).data('index',a); }); ui.newPanel.find('.csc-textpic-imagerow:first').addClass('active'); ui.newPanel.find('.csc-frame-3d-modul').data('lastactive',0); ui.newPanel.find('.bt-3d-modul').on('click', function(){ lastactive = ui.newPanel.find('.csc-frame-3d-modul').data('lastactive'); next = (ui.newPanel.find('.csc-textpic-imagerow:eq('+lastactive+1+')').length>0) ? ui.newPanel.find('.csc-textpic-imagerow:eq('+lastactive+1+')') : ui.newPanel.find('.csc-textpic-imagerow:eq(0)'); ui.newPanel.find('.csc-textpic-imagerow:eq('+lastactive+')').removeClass('active'); ne…
type: UnansweredQuestion
upvote count: 1
tagged with: jssor
answer count: 0
has comment: http://stackoverflow.com/comment/47494989
score: 1
has comment: http://stackoverflow.com/comment/47549204
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47494937
tagged with: events
has comment: http://stackoverflow.com/comment/47619464

http://stackoverflow.com/comment/47457676
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29658113
has text: I am really glad it helped, @FillipPeyton !

http://stackoverflow.com/comment/47438815
comment on: http://stackoverflow.com/a/29648876
type: AnswerComment
has text: You can see the - type: "post" , so it should be send as POST
score: 0
type: Comment

timer
tag name: timer
tags question: http://stackoverflow.com/q/29679856
tags question: http://stackoverflow.com/q/29649643
tags question: http://stackoverflow.com/q/29600354
tags question: http://stackoverflow.com/q/29568479
type: Tag
tags question: http://stackoverflow.com/q/29622186
tags question: http://stackoverflow.com/q/29613425
tags question: http://stackoverflow.com/q/29656686
tags question: http://stackoverflow.com/q/29610521

http://stackoverflow.com/q/29590767
tagged with: jquery
has comment: http://stackoverflow.com/comment/47328677
score: 0
has comment: http://stackoverflow.com/comment/47328606
has body: I'm using the iTunes API to gather information. To keep my code modular as far as tasks needed, I have my code setup similar to what's presented here. Adding onto this code I'd like to insert the information from the JSON into the DOM using a click event. The problem is that I'm getting undefined whenever the click event is fired despite being able to successfully retrieve the JSON. Why is this so? More importantly is there a better approach to create functions from JSON get requests then what I have now? $(function() { $("button").on("click", function() { var artistName = iTunesSearch(albumInfo); $(".artist-name").text(artistName); }); function iTunesSearch(callback) { $.getJSON("http://itunes.apple.com/search?term=College Dropout&entity=album&callback=?", function(data) { var result = data['results'][0]; callback(result); }); } function albumInfo(data) { console.log(data["artistName"]); // Successfully logs info just doesn't return the data return data["artistName"]; } }); Generate Info Artist Name:
linked to: http://stackoverflow.com/q/14220321
linked to: http://stackoverflow.com/q/23143092
has comment: http://stackoverflow.com/comment/47328521
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/14220321
answer count: 0
has title: Return a value from a callback within a JSON function
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: javascript

http://stackoverflow.com/a/29634062
has comment: http://stackoverflow.com/comment/47410908
type: Answer
has comment: http://stackoverflow.com/comment/47413076
score: 1
has body: Dylan's answer will work, but generally when you find the need for this kind of logic, you should try to wrap it up into a more general component. For example, we'll call it Lense, as it's just a way of viewing one value at a time, given an collection of sequential values. app.factory('Lense', function() { return function(values) { var lense = {}; lense.index = 0; lense.next = function() { lense.index += 1; }; lense.previous = function() { lense.index -= 1; }; lense.value = function() { return values[lense.index]; }; }; }); Now you have a class which can be injected in order to create a lense which contains all of the logic for you. You can inject it and use it anywhere you need: function MyController($scope, Lense) { var data = [ { ... }, { ... }, { ... } ]; $scope.lense = Lense(data); } Then your views become a lot more declarative: {{lense.value().title}} {{lense.value().sub_title}} Previous Next Not only that, but it is a lot easier to write unit tests for factories than it is for directives, as they involve no rendering on HTML. Finally, it will be a lot easier to debug. Say you want to print the value of the current index every time the user clicks next, you can just add it to your lense factory. lense.next = function() { lense.index += 1; console.log(lense); }; If your logic is embedded in an expression, then there's no way to do this, because console isn't a property on the current $scope.
answers question: http://stackoverflow.com/q/29633725
upvote count: 1
has comment: http://stackoverflow.com/comment/47410799
downvote count: 0

http://stackoverflow.com/a/29597451
type: Answer
has body: If you can update your HTML then here is a cleaner approach: Step 1 Your name Step 2 Divider Step 3 Font Step 4 Shapes Step 5 Color Step 6 Export it Then your code can attach to any div with the class stepbox and it can get it's ID from a data attribute (you can see how you can extend this system to non-sequential IDs or even alphanumeric IDs. Your code might look something like this: $(".stepbox").click(function() { var id = $(this).data('box-id'); $("#step"+id).show(); $("#stepswrapper section").not("#step"+id).hide(); $("#stepbox"+id).addClass("stepboxactive"); $("#stepboxmain div").not("#stepbox"+id).removeClass("stepboxactive"); myFunctions[functionName + id](); });
score: 0
answers question: http://stackoverflow.com/q/29597283
has comment: http://stackoverflow.com/comment/47346423

http://stackoverflow.com/q/29607209
tagged with: jquery
tagged with: ajax
has answer: http://stackoverflow.com/a/29607639
upvote count: 1
answer count: 1
has title: Retrieve Data from Ajax Get Type
favorite count: 0
type: UnansweredQuestion
tagged with: php
downvote count: 0
score: 1
has body: my question its "simple". I have this function Ajax : function preencherLinhaProduto(obj) { $.ajax({type: "POST", url: '/pedidoOnline/index.php/Pedidos/pesquisarLinhaProduto', async: false, data: { cd_cpl_tamanho: obj } }); } And I want to take the ID from "cd_cpl_tamanho" that recieves "obj" on this another function: public function pesquisarLinhaProduto(){ $this-&gt;autoRender = false; $this-&gt;loadModel('ProcuraProdutoPedOnline'); // Consultando pelo que o usuÃ¡rio estÃ¡ digitando //$produto = $this-&gt;$_REQUEST['cd_cpl_tamanho']; //$produto = $this-&gt;request-&gt;params['obj']; echo($produto); $linhas = $this-&gt;ProcuraProdutoPedOnline-&gt;find('all', array( 'fields' =&gt; array('cd_linha', 'ds_linha'), 'conditions' =&gt; array( 'cd_cpl_tamanho' =&gt; "$produto" ) )); And I don't know how to do... I want to make a search on DB where cd_cpl_tamanho recieves $produto that contains the ID of function Ajax. Sorry for my Bad English.
type: Question
tagged with: javascript

http://stackoverflow.com/comment/47298655
type: Comment
comment on: http://stackoverflow.com/a/29568929
has text: it work but still the Grade 4 options not working when updating
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47461970
comment on: http://stackoverflow.com/q/29658108
has text: @rom99 Just tried that and still isn't transitioning. :-/
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29679433
accepted answer of: http://stackoverflow.com/q/29679256
answers question: http://stackoverflow.com/q/29679256
downvote count: 0
score: 1
upvote count: 1
has body: If you want to pass the json dataType field, but want to use Promises instead of the anonymous callback, just pass null for the callback. From the docs: A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case Hence all you need is: function getSomeData(phpFile, postData) { return $.post(phpFile, postData, null, 'json'); } Of course if your server is responding with the appropriate Content-type: field then JQuery will happily just guess at the data type anyway.
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/47218964
comment on: http://stackoverflow.com/q/29532905
score: 0
type: Comment
has text: Is this in a browser? What does the Developer Console (F12) tell you?
type: QuestionComment

http://stackoverflow.com/q/29592760
accepted answer: http://stackoverflow.com/a/29595286
score: 0
answer count: 1
tagged with: asp.net
has answer: http://stackoverflow.com/a/29595286
tagged with: ajax
has title: Ajax partial postback not working in firefox
type: AnsweredQuestion
type: Question
has body: &lt;asp:Timer ID="Timer1" OnTick="Timer1_Tick" Interval="5000" runat="server"&gt;&lt;/asp:Timer&gt; &lt;asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"&gt; &lt;ContentTemplate&gt; &lt;input id="Hidden1" type="hidden" name="Data1" value="abc" /&gt; &lt;asp:Label ID="Label2" runat="server" Text="Label"&gt;&lt;/asp:Label&gt; &lt;asp:Label ID="Label1" runat="server" Text="Label"&gt;&lt;/asp:Label&gt; &lt;/ContentTemplate&gt; &lt;Triggers&gt; &lt;asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" /&gt; &lt;/Triggers&gt; &lt;/asp:UpdatePanel&gt; I am making parital postback with ajax toolkit. protected void Timer1_Tick(object sender, EventArgs e) { Label2.Text = "Clicked " + DateTime.Now.ToString(); if (Application["Data"] != null) { string[] s; //We know the type inside Application state so we cast it s = (string[])Application["Data"]; StringBuilder builder = new StringBuilder(); foreach (string value in s) { builder.Append(value); builder.Append('-'); } Label1.Text = builder.ToString(); } } When i use internet explorer there is no problem,after 5 seconds it do postback.However when i use firefox there is no change.I looked inside with developer tools of firefox and i saw there are problems . SyntaxError: missing ) after argument list ScriptResource.axd:5784:50 Error: ASP.NET Ajax client-side framework failed to load. Graph.aspx:42:39 ReferenceError: Type is not defined ScriptResource.axd:10:0 ReferenceError: Type is not defined ScriptResource.axd:10:0 ReferenceError: Sys is not defined Graph.aspx:55:0 ReferenceError: Sys is not defined Graph.aspx:79:0 I tried solutions about adding ScriptResource.axd from web.config but this errors still exists and labels not changing.Why do u think this happens? What is the problem?
tagged with: javascript

http://stackoverflow.com/comment/47383790
has text: the call timings will be relative to your internet connection (distance, speed), so its better to try it yourself and see if the timings are acceptable
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29619325

http://stackoverflow.com/a/29629569
has body: You need to update the cube's scale when the user changes the inputs. One way to do this is to use ng-change on your &lt;input&gt;s: &lt;input type="number" name="height" ng-model="height.value" ng-change="setScale()" min="0.001" required /&gt; and define setScale() in your controller: $scope.setScale = function() { cube.scale.set(length.value, width.value, height.value); }; Depending on how you structured your code, an additional issue might be that you don't have access to cube in your controller. A structured way to solve this would be to place your three.js code in a service, inject the service into your controller, and update the cube's scale through a function on the service.
has comment: http://stackoverflow.com/comment/47405623
type: Answer
score: 0
answers question: http://stackoverflow.com/q/29612507

http://stackoverflow.com/comment/47283378
type: Comment
has text: But it already has a form wrapped around it. Why can't you just use the regex from validate plugin in the validate callback of editable?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29566417

http://stackoverflow.com/a/29565260
answers question: http://stackoverflow.com/q/29562882
score: 0
has body: @model AppointmentModel @for(var i = 10; i < model.PersonsIds.Length; i++) { Line @html.hiddenfor(model => model.PersonsIds[i]) } or for example @for (int i = 0; i < Model.Count; i++) { @Html.HiddenFor(x=>Model[i].Id) @Model[i].Name @Html.TextBoxFor(x => Model[i].Quantity) }
type: Answer

http://stackoverflow.com/comment/47451040
type: AnswerComment
comment on: http://stackoverflow.com/a/29645125
type: Comment
has text: to elaborate, yes it has an npm module as well as composer in php*
score: 0

http://stackoverflow.com/comment/47464747
score: 0
type: AnswerComment
has text: @AbdulAhmad well the OP mentioned the "length" property in the question, so I don't think that's what this is about.
type: Comment
comment on: http://stackoverflow.com/a/29662618

http://stackoverflow.com/a/29651968
has body: For starters, do not use inline handler with jQuery. That separates the handler from the registration for no good reason and leads to maintenance problems. Use classes or IDs to match the elements and use jQuery handlers. The problem is event propagation. To stop the click propagating use e.stopPropagation() in the handler: Foo Bar $('.doSomeFunc').click(function(e){ alert("Foo"); }); $('.doAnotherFunc').click(function(e){ e.stopPropagation(); alert("Bar"); }); If you want to stick with your existing non-jQuery code, just change this: return false from a mouse handler will do the same as e.stopPropagation() and e.preventDefault().
has comment: http://stackoverflow.com/comment/47444502
upvote count: 4
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47444936
downvote count: 0
has comment: http://stackoverflow.com/comment/47443993
score: 4
type: Answer
has comment: http://stackoverflow.com/comment/47444018
answers question: http://stackoverflow.com/q/29651854
has comment: http://stackoverflow.com/comment/47447539
accepted answer of: http://stackoverflow.com/q/29651854

http://stackoverflow.com/comment/47479027
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29669600
score: 0
has text: I have put your like this: function RowClick(row) { popUpObj = window.open("Info.aspx?"+ row +"" , ........ And replaced RowClick with RowClick(row) correct?

http://stackoverflow.com/a/29546987
has body: I think you are referring to old book. Please update your controller as below //controller.js var app = angular.module('myApp', []); app.controller('HelloController', function($scope) { &nbsp;&nbsp;&nbsp;&nbsp;$scope.greeting = { text: 'Hello' }; }); and in HTML ng-app="myApp" Please try and let us know whether it is working or not
answers question: http://stackoverflow.com/q/29544779
type: Answer
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/comment/47470158
type: QuestionComment
has text: The question is around interpolation inside ng-repeat, whereas you repeat ends before the interpolation. See the end ` `
comment on: http://stackoverflow.com/q/29665514
score: 0
type: Comment

will-paginate
tags question: http://stackoverflow.com/q/29603859
type: Tag
tag name: will-paginate

http://stackoverflow.com/a/29596505
has comment: http://stackoverflow.com/comment/47340269
has body: If you'd like to keep the logic of these two methods separate in your constructor function, you could include a third method that performs the task of multiplying the two results. var PreciousMetals = function(metal, weight){ this.metal = metal; this.weight = weight; //weight in ounces this.authentic = function(colorTest){ var metalPurity; var zero = ""; if (this.metal == "silver"){ switch(colorTest){ case "brightred": metalPurity = 1; break; case "darkred": metalPurity = 0.925; break; case "brown": metalPurity = 0.80; break; case "green": metalPurity = 0.50; break; default: metalPurity = 0; } }else if(this.metal == "gold"){ switch(colorTest){ case "green": metalPurity = "base metal or gold plated"; break; case "milk colored": metalPurity = "gold plated sterling silver"; break; case "no color": metalPurity = "real gold"; break; default: metalPurity = "Could be a fake, try different test"; } } return metalPurity; } this.metalValue = function(){ var sum = 0; var spotPrice; if (this.metal == "gold"){ spotPrice = 1000; }else if(this.metal == "silver"){ spotPrice = 15; } sum = spotPrice * this.weight; return sum; } this.netValue = function(colorTest){ return this.authentic(colorTest) * this.metalValue(); } } Here's a working JSFiddle - https://jsfiddle.net/bwj3fv12/
score: 1
answers question: http://stackoverflow.com/q/29596315
upvote count: 1
has comment: http://stackoverflow.com/comment/47339931
has comment: http://stackoverflow.com/comment/47339827
downvote count: 0
has comment: http://stackoverflow.com/comment/47339947
type: Answer

http://stackoverflow.com/a/53333201
answers question: http://stackoverflow.com/q/29673691
has body: To get JavaScript Alert to work on Android WebView add below line of code: mWebView.setWebChromeClient(new WebChromeClient()); After following Line of code: webSettings.setJavaScriptEnabled(true); Finally it Should look like: webSettings.setJavaScriptEnabled(true); mWebView.setWebChromeClient(new WebChromeClient());
upvote count: 4
downvote count: 0
score: 4
type: Answer
has comment: http://stackoverflow.com/comment/131468077

http://stackoverflow.com/comment/47220283
type: QuestionComment
comment on: http://stackoverflow.com/q/29533257
has text: @yergo thank you but my problem not in syntax it's how to send obj after update in .on('ami_data) to res.end(Send)
score: 0
type: Comment

http://stackoverflow.com/q/29672975
has comment: http://stackoverflow.com/comment/47483720
has comment: http://stackoverflow.com/comment/47483750
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery
type: Question
tagged with: ember.js
has comment: http://stackoverflow.com/comment/47499629
has answer: http://stackoverflow.com/a/29707289
has title: Post a variable to json format in Ember.js
score: 0
has body: I apologize if this question seems basic as I am new to both stackoverflow and javascript in general. My goal here is to store the user's dropdown menu selection as well as some other user inputs into variables, then I want to post the json file that contains the variables into a specific route where my serve-side javascript can read from. I have the variable part and user selection part covered, however, I am having trouble posting the variables to the specified route. So in my app.js file in my ember framework, I tried the below code to test out if I can post {12345} to address:port/api/iwantmyjsonhere/ but when I run it and go to that specific page (address:port/api/iwantmyjsonhere/), it says cannot GET. $(document).ready(function() { $.ajax({ url : "/api/iwantmyjsonhere/", type: 'POST', dataType : "json", data: "12345" }); }); I understand that this question is lower level, so if you guys are too busy to answer, point me to any resources that might help me would be greatly appreciated too! Thanks in advance!
has comment: http://stackoverflow.com/comment/47483526
accepted answer: http://stackoverflow.com/a/29707289
answer count: 1

http://stackoverflow.com/q/29605591
has title: jQuery to place a div at a particular position after calculating window height
type: Question
tagged with: window
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29605680
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47356696
tagged with: css
has body: I want to place a div based on calculation of window height using jQuery. Here's my code snippet: var winHeight = document.body.scrollHeight; Now I get the height of the window. I want to place a div at the bottom of window based on the height. This is because the height varies but irrespective of the height, this DIV should be placed at the bottom by giving some styles to this DIV. Note : I am adding the div via jQuery dynamically. So I need to calculate the height of the page and display it. Because the content/height of the page will vary. Thats why I need to add the css style based on window height via jQuery Please Help. Thanks,
has comment: http://stackoverflow.com/comment/47356722

http://stackoverflow.com/comment/47234915
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29541557
has text: That didn't work. I got this error. `TypeError: Object [object Object] has no method 'toThrowError'`
score: 0

http://stackoverflow.com/q/29681849
upvote count: 6
has answer: http://stackoverflow.com/a/29682250
has comment: http://stackoverflow.com/comment/47501361
has title: Javascript to change this.style.backgroundImage
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29682961
has body: Given the following code, how would I finish tileClick() in order to change the clicked image from "tileBack.jpg" to instead show the image that was assigned to that specific div in shuffleDeck() ? What I mean is, the tileClick() function is supposed to take a tile that is currently showing the tileBack image, and, when clicked, show the image that is on the "reverse side" of that tile. So far, you can see how I've tried to target the specific tile being clicked, though I'm uncertain this. is being used correctly here. On the other side of that statement, I've tried to do things like = "../img/tile_"+tiles[i]+".png"; but obviously the issue there is that i does not exist within that function's scope. My problem is that I can't figure out how to restructure my code so that I can access the image that was previously assigned to a given div. For reference, the "other side" of the tiles are named as "tile_##.png" where '##' is a 2-digit number (01-12). I am very new to JS and programming in general, so please keep your answers simple enough for me to understand and implement. var deck = []; var tiles = []; var sources = [ "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12" ]; var images = []; const WIDTH = 100; const HEIGHT = 100; const NUMTILES = 24; loadImages(); buildDeck(); shuffleDeck(7); printDeck(); function loadImages() { for (var i = 0; i &lt; sources.length; i++) { images[i] = "../img/tile_"+sources[i]+".png"; } } function buildDeck() { for (var i = 0; i &lt; 2; i++) { for (var j = 0; j &lt; sources.length; j++) { var tempTile = {}; tempTile.val = sources[j]; tempTile.img = images[j]; deck.push(tempTile); } } } function shuffleDeck (numTimes) { for (var i = 0; i &lt; numTimes; i++) { for (var j = 0; j &lt; deck.length; j++) { var tempTile = deck[j]; var randI = j; while ( randI == j ) { randI = Math.floor(Math.random() * deck.length ); } deck[j] = deck[randI]; deck[randI] = tempTile; } } } function printDeck() { for (var i = 0; i &lt; NUMTIL…
has comment: http://stackoverflow.com/comment/47500907
score: 6
has comment: http://stackoverflow.com/comment/47501407
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/47501172
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47501000
has comment: http://stackoverflow.com/comment/47500829
has answer: http://stackoverflow.com/a/29682961
possible better answer: http://stackoverflow.com/a/29682250

http://stackoverflow.com/comment/47453839
type: AnswerComment
type: Comment
has text: sorry I don't have enough reputation to post comments =(
comment on: http://stackoverflow.com/a/29657067
score: 0

http://stackoverflow.com/a/29666229
downvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/29666029
upvote count: 0
has body: I'm sure it's standard practice to declare new collections in the lib folder so they get created before rest of the code runs Move the idpool line to lib and retry
score: -1

http://stackoverflow.com/comment/47493912
has text: No sorry, this would take too long. All those functions are well documented. Enter jquery + what you want in a search engine and you will get a hit. Same for the bootstrap tabs. If you present a complete JFiddle, with just 1 error then I could correct it maybe. But just putting html tags in there and saying oh there is just one big mistake is not how it works.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29669707

http://stackoverflow.com/a/29787660
has body: I made fiddle by using your code with some modification from my side. It is working fine. I hope it will work for you. Your inputs are welcomed. Code HTML &lt;body&gt; &lt;div id='calendar'&gt;&lt;/div&gt; &lt;/body&gt; SCRIPT &lt;script type='text/javascript'&gt; $(document).ready(function(){ fullCalObj = $('#calendar').fullCalendar({ header: { left: 'prev,next today', center: 'title', right: 'month,agendaWeek,agendaDay' }, allDayDefault: false, selectable: true, selectHelper: true, editable: true, eventLimit: true, // allow "more" link when too many events }); var newEvent = { title : 'mytitle', start : '2015-04-22', allDay: false, id: 1, description: 'my test event' }; fullCalObj.fullCalendar('renderEvent', newEvent, 'stick'); }); &lt;/script&gt;
downvote count: 0
type: Answer
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/29575627

http://stackoverflow.com/comment/47350053
score: 1
has text: That's completely wrong. URIs in JavaScript are always relative to the URL of the execution environment (the page) not the script.
type: Comment
comment on: http://stackoverflow.com/a/29600640
type: AnswerComment

http://stackoverflow.com/comment/47222039
type: Comment
comment on: http://stackoverflow.com/q/29534431
score: 0
has text: I have nothing to check yet because that uploading code is not linked to my code. So what I want is to link it to my angular.
type: QuestionComment

http://stackoverflow.com/q/29656395
has answer: http://stackoverflow.com/a/29656663
has comment: http://stackoverflow.com/comment/47453254
linked to: http://stackoverflow.com/q/1357118
linked to: http://stackoverflow.com/q/1510094
possible better answer: http://stackoverflow.com/a/29656513
answer count: 4
has comment: http://stackoverflow.com/comment/47452760
upvote count: 2
has comment: http://stackoverflow.com/comment/47454061
has comment: http://stackoverflow.com/comment/47452658
accepted answer: http://stackoverflow.com/a/29658926
has comment: http://stackoverflow.com/comment/47453159
downvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47457477
has comment: http://stackoverflow.com/comment/47454253
has comment: http://stackoverflow.com/comment/47454230
score: 1
has comment: http://stackoverflow.com/comment/47453180
has comment: http://stackoverflow.com/comment/47453640
has answer: http://stackoverflow.com/a/29656824
has comment: http://stackoverflow.com/comment/47454663
tagged with: preventdefault
has title: Prevent Default is not working
type: Question
has comment: http://stackoverflow.com/comment/47452928
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47453751
has comment: http://stackoverflow.com/comment/47452452
has comment: http://stackoverflow.com/comment/47452589
favorite count: 0
has answer: http://stackoverflow.com/a/29658926
has answer: http://stackoverflow.com/a/29656513
has body: I have checked around here and none of these solution on here fix my issue. I cannot seem to get the preventDefault() to work. Code below: Jquery: $("#changepassword").submit(function(event) { event.preventDefault(); // stop normal form submission $.ajax({ url: "changePassword.php", type: "POST", data: $(this).serialize(), // you also need to send the form data dataType: "html", success: function(html) { $("#s-window").append(html); } }); }); HTML: &lt;div id="s-window"&gt; &lt;form id="changepassword" action="changePassword.php" method="POST"&gt; &lt;input type="password" name="currentPassword" placeholder="Current Password"/&gt; &lt;input type="password" name="newPassword" placeholder="New Password"/&gt; &lt;input type="password" name="confirmPassword" placeholder="Confirm Password"/&gt; &lt;input class="button" type="submit" value="Change Password" /&gt; &lt;/form&gt; &lt;/div&gt; There are no errors on my conosle. The changePassword.php works as it is supposed to. But rather than updating my #s-window it redirects me to the changePassword.php page How can I recode this to make everything happen on the page?

http://stackoverflow.com/comment/47311953
score: 0
type: QuestionComment
has text: You cannot in an object literal declaration. There is nothing to access yet when `fooAgain` is created.
comment on: http://stackoverflow.com/q/29575250
type: Comment

http://stackoverflow.com/q/29632288
score: 2
has comment: http://stackoverflow.com/comment/47409928
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47410434
has comment: http://stackoverflow.com/comment/47408036
upvote count: 3
tagged with: waterline
downvote count: 1
has comment: http://stackoverflow.com/comment/47412817
type: Question
tagged with: sails.js
has comment: http://stackoverflow.com/comment/47411975
has answer: http://stackoverflow.com/a/29658080
tagged with: javascript
has comment: http://stackoverflow.com/comment/47410867
has title: Sails ReferenceError: Article "Model" is not defined
answer count: 3
accepted answer: http://stackoverflow.com/a/29658080
has body: I try to access to the findOne() through my Article model in my controller, without success. I had this error &gt; error: Sending 500 ("Server Error") response: &gt; ReferenceError: Article is not defined &gt; at Object.module.exports.createArticle (c:\Users\pisix\BizBiz\BizBizBackEnd\api\controllers\ArticleController.js:16:9) &gt; at bound (C:\Users\pisix\AppData\Roaming\npm\node_modules\sails\node_modules\lodash\dist\lodash.js:729:21) &gt; at routeTargetFnWrapper (C:\Users\pisix\AppData\Roaming\npm\node_modules\sails\lib\router\bind.js:179:5) &gt; at callbacks (C:\Users\pisix\AppData\Roaming\npm\node_modules\sails\node_modules\express\lib\router\index.js:164:37) &gt; at param (C:\Users\pisix\AppData\Roaming\npm\node_modules\sails\node_modules\express\lib\router\index.js:138:11) &gt; at param (C:\Users\pisix\AppData\Roaming\npm\node_modules\sails\node_modules\express\lib\router\index.js:135:11) &gt; at pass (C:\Users\pisix\AppData\Roaming\npm\node_modules\sails\node_modules\express\lib\router\index.js:145:5) &gt; at nextRoute (C:\Users\pisix\AppData\Roaming\npm\node_modules\sails\node_modules\express\lib\router\index.js:100:7) &gt; at callbacks (C:\Users\pisix\AppData\Roaming\npm\node_modules\sails\node_modules\express\lib\router\index.js:167:11) &gt; at C:\Users\pisix\AppData\Roaming\npm\node_modules\sails\lib\router\bind.js:187:7 &gt; at alwaysAllow (C:\Users\pisix\AppData\Roaming\npm\node_modules\sails\lib\hooks\policies\index.js:207:11) &gt; at routeTargetFnWrapper (C:\Users\pisix\AppData\Roaming\npm\node_modules\sails\lib\router\bind.js:179:5) &gt; at callbacks (C:\Users\pisix\AppData\Roaming\npm\node_modules\sails\node_modules\express\lib\router\index.js:164:37) &gt; at param (C:\Users\pisix\AppData\Roaming\npm\node_modules\sails\node_modules\express\lib\router\index.js:138:11) &gt; at param (C:\Users\pisix\AppData\Roaming\npm\node_modules\sails\node_modules\express\lib\router\index.js:135:11) &gt; at pass (C:\Users\pisix\AppData\Roaming\npm\node_modules\sail…
has answer: http://stackoverflow.com/a/42623127
favorite count: 0
has comment: http://stackoverflow.com/comment/47414219
possible better answer: http://stackoverflow.com/a/35976043
has answer: http://stackoverflow.com/a/35976043
has comment: http://stackoverflow.com/comment/47418944
tagged with: node.js

http://stackoverflow.com/comment/47289375
type: Comment
type: AnswerComment
has text: after updating, even filter thing is also not working,
score: 0
comment on: http://stackoverflow.com/a/29569835

http://stackoverflow.com/comment/47314918
comment on: http://stackoverflow.com/q/29583308
type: Comment
type: QuestionComment
score: 2
has text: The test doesn't show anything, because it doesn't work properly. You should put the initialisation in the initialisation block, and don't loop the code that should be measured. The test engine does the looping.

http://stackoverflow.com/q/29594629
has title: AngularJS, binding to a model in ng-repeat in a directive
favorite count: 0
has body: So I am trying to bind inside a directive (to access outside) to a model inside of an ng-repeat. So in the outer controller I have a variable I would like to bind in like //in the directive scope filterArray: '=' Inside the directive that would be bound inside the directive to a model in an ng-repeat like so - //inside the directive &lt;li ng-repeat="value in filter.values"&gt; &lt;input type="checkbox" ng-model="filterObject[filter.name][value]" ng-change="filterChange()"&gt;{{value}} &lt;/li&gt; This worked fine until I changed the directive to have an isolate scope, now it is saying cannot set property of undefined. Is there any way to get this working as intended? The idea is the variable would build out when the user clicks the inputs so the outer controller would be able to see the built object. Apologies if this is a bit confusing - I have made a fiddle to clarify : https://jsfiddle.net/vt1uasw7/42/ . I want the outer controller to have access to the object built by binding the model - again this was working before I added the isolate scope. Thanks! Edit: maybe the trick in this case is not to use the isolate scope? This one has me stumped, I've tried every combination of scope attributes :(.
tagged with: angularjs
type: UnansweredQuestion
upvote count: 2
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47337295
has comment: http://stackoverflow.com/comment/47346654
score: 2
downvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/29601186
has comment: http://stackoverflow.com/comment/47336663

http://stackoverflow.com/comment/47381522
type: Comment
comment on: http://stackoverflow.com/a/29610090
type: AnswerComment
has text: What about setting the value to an observable and update it when the button is clicked
score: 0

http://stackoverflow.com/a/29622040
upvote count: 2
has comment: http://stackoverflow.com/comment/47388654
answers question: http://stackoverflow.com/q/29621826
score: 2
downvote count: 0
has body: You can parse the month like the answer here: https://stackoverflow.com/a/1643468/2498251 var monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; so for your case you can make something like this: var d = new Date("2015-04-15 09:00:00"); var day = d.getDay(); var month = monthNames[d.getMonth()]; var year = d.getYear(); var hour = d.getHours(); var min = d.getMinutes(); var fullDatetime = day + ' ' + month + ' ' + hour + ':' + min;
type: Answer

http://stackoverflow.com/q/29608990
has comment: http://stackoverflow.com/comment/47364042
has body: So I have a very simple website in A.html Some text And another site that shows A in an iframe in B.html If I open file B in my google chrome browser, everything is shown as intended. However, If I execute the following line of javascript code in B.html (trying to change the color of p element in the iframe to pink) function onLoadHandler() { var frameElement = document.getElementById('frame'); var frameDocument = frameElement.contentWindow ? frameElement.contentWindow : frameElement.contentDocument.defaultView; var x = frameDocument.getElementsByClassName("text"); x[0].style.backgroundColor = "pink"; } I get the following error at the second line: Uncaught SecurityError: Blocked a frame with origin "null" from accessing a frame with origin "null". Protocols, domains, and ports must match. This was just a dummy test, the real scenario is we have website www.company.com, and in an iframe runs www.verysecurebank.com, and we want to edit the style of some buttons inside that iframe. So yeah, domains will never match. I'm wondering though, why is this considered cross site scripting by browsers, but if you go to developer tools (f12) you can manipulate the dom of any part of the iframe without problems in the browser itself? We could succesfully turn all buttons in the iframe blue using the developer tools, but we can't achieve it with javascript in the parent html that contains the iframe.
type: Question
downvote count: 0
has title: Editing the DOM of an iframe by using javascript in the parent
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/29609348
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/47363965
type: UnansweredQuestion
tagged with: iframe
upvote count: 1
tagged with: css
has comment: http://stackoverflow.com/comment/47363960
linked to: http://stackoverflow.com/q/5660116
score: 1

http://stackoverflow.com/comment/47310437
comment on: http://stackoverflow.com/q/29580921
score: 0
type: QuestionComment
type: Comment
has text: so does that mean i have to change my whole code according to new interpolate symbols?

http://stackoverflow.com/q/29664007
score: 0
has answer: http://stackoverflow.com/a/29664071
accepted answer: http://stackoverflow.com/a/29664057
has body: I have a setInterval and each time through the loop I want to add something to the beginning and end of the text in a div. Lets say I want to add the letter "x". I only know how to add to the end like this... t=setInterval(function(){ document.getElementById('test').innerHTML +='x' },1000) Lets say the loop runs 10 times before I clear the interval, my text would look like, My Textxxxxxxxxxx I want it to look like xxxxxxxxxxMy Textxxxxxxxxxx
tagged with: append
answer count: 4
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29664064
tagged with: innerhtml
has answer: http://stackoverflow.com/a/29664064
has answer: http://stackoverflow.com/a/29664057
has title: javascript adding to beginning and end of innerhtml in a loop
type: Question
has answer: http://stackoverflow.com/a/29664081
tagged with: javascript
has comment: http://stackoverflow.com/comment/47467359

http://stackoverflow.com/q/29638715
has title: Sticky header does not stick
answer count: 2
has comment: http://stackoverflow.com/comment/47419582
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47419581
tagged with: sticky
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47419763
favorite count: 0
has body: I read many topics but I can't solve this. In js fiddle it works..in my browser it does not. fiddle and this is a screen of my browser..the green header won't stick to the top but some lines below.. this is the code in my page title <table.... //from here is identical to the fiddle html thanks
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29638856
tagged with: css
score: 1
has answer: http://stackoverflow.com/a/29642730
upvote count: 1
has comment: http://stackoverflow.com/comment/47420418
type: Question

http://stackoverflow.com/comment/47240844
score: 0
has text: what do you want? the equivalent fo that code but using plain javascript and HTML?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29543495

http://stackoverflow.com/comment/47220915
has text: You look at the Net tab of your browser's developer tools.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29532776
type: QuestionComment

http://stackoverflow.com/comment/47603486
type: AnswerComment
has text: Check the edit and see if that answers your question. Thanks.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29638714

http://stackoverflow.com/comment/47498489
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29678513
has text: Even this jsfiddle example by someone else: http://jsfiddle.net/R9T7y/ doesn't seem to work.
score: 0

http://stackoverflow.com/comment/118771756
type: AnswerComment
comment on: http://stackoverflow.com/a/52382922
type: Comment
score: 1
has text: @AliMertCakar `numberOfLines={1}` doesn't work together `multiline={true}`. Press enter on your keyboard and you'll see it changes the line.

http://stackoverflow.com/a/29666627
answers question: http://stackoverflow.com/q/29666492
type: Answer
score: 0
has body: Set ClientIDMode to static. By default ClientIDMode is Auto, which means, client Id will be generated by concatenating the ID values of each parent naming container with the ID value of the control. See Example: &lt;asp:Label ID="Valid" ClientIDMode="Static" runat="server" Text="Label"&gt;&lt;/asp:Label&gt;

http://stackoverflow.com/q/29686934
has body: I have a function that is called setRooms(input): setRooms:function(input){ $.post( "files/ajax.php?q", { i: input}) .done(function( result ) { return result; }); }, I load the file, where the function is in with requirejs: backend = require('backend'). When I now call the function: saveAllRooms = function(){ backend.setAllRooms(ko.utils.stringifyJson(allRooms)).then(function (results) { _getAllRooms(); }); } I get the error: TypeError: backend.setRooms(...) is undefined Whats wrong?
score: 0
answer count: 1
tagged with: jquery
tagged with: durandal
has answer: http://stackoverflow.com/a/29687059
type: UnansweredQuestion
type: Question
tagged with: javascript
has title: TypeError: backend.setRooms(...) is undefined

http://stackoverflow.com/comment/47276177
type: Comment
score: 11
has text: No, there's no advantage. It's convenient when the *only* thing you've got is already a jQuery object, but making a new jQuery object just so that `.prop()` can be called is silly.
comment on: http://stackoverflow.com/q/29563271
type: QuestionComment

http://stackoverflow.com/a/29645074
score: 0
has comment: http://stackoverflow.com/comment/47430816
has body: Modified using float:left for both divs which is all i needed to override it. Also sent the inputs to a new line as for me this can make it easier to read/edit. Start: End: Oh and a fiddle.. http://jsfiddle.net/xfn244nb/1/ If that fails, which tested for me does not.. You can always use display:inline-block; as this has always been my preferred method. eg Advantages of using display:inline-block vs float:left in CSS
type: Answer
answers question: http://stackoverflow.com/q/29644123

http://stackoverflow.com/comment/47288492
score: 1
comment on: http://stackoverflow.com/q/29569435
type: Comment
type: QuestionComment
has text: `$(this)` might not be what you think it is, since you're calling it inside your `setTimeout` function.

http://stackoverflow.com/a/29607658
has comment: http://stackoverflow.com/comment/47361861
score: 3
answers question: http://stackoverflow.com/q/29606843
has body: You can make use of Array.prototype.filter and Array.prototype.concat to simply it: arr_A = ["a","b","d","f","g"] arr_B = ["a","g","k"] arr_C = ["h"] function getCommonItems(arrayA, arrayB, result) { result = result || []; result = result.concat(arrayA.filter(function(item) { return arrayB.indexOf(item) &gt;= 0; })); return result.sort(); } alert(getCommonItems(arr_A, arr_B, arr_C).join(", ")); alert(getCommonItems(arr_B, arr_A, arr_C).join(", ")); For the first scenario: arr_A = ["a","b","d","f","g"] arr_B = ["a","c","f","h"] function getDifference(arrayA, arrayB, result) { return arrayB.filter(function(item) { return arrayA.indexOf(item) === -1; }).sort(); } alert(getDifference(arr_A, arr_B).join(", ")); alert(getDifference(arr_B, arr_A).join(", "));
downvote count: 0
has comment: http://stackoverflow.com/comment/47361964
type: Answer
has comment: http://stackoverflow.com/comment/47367797
upvote count: 3
has comment: http://stackoverflow.com/comment/47361898
has comment: http://stackoverflow.com/comment/47361844

http://stackoverflow.com/q/29628235
upvote count: 6
tagged with: mousewheel
type: Question
has answer: http://stackoverflow.com/a/34735288
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: macos
favorite count: 0
has body: I need to organise navigation like jquery.fullPage: when I scroll once - I move to next section. I tried to use jquery.mousewheel for it, but it fails in MacOS with touchpad or trackpad or APPLE Magic Mouse: It scrolls multiple slides per one scroll. I tried to use this solution: https://github.com/jquery/jquery-mousewheel/issues/36#issuecomment-67648897 It works fine in Chrome, but it does not in FF and has bugs in Safari. This is simple demonstration of issue: http://jsfiddle.net/ss5LueLx/13/ $slider.on('mousewheel', function(event) { if (event.deltaY&gt;0) { slider.prevSlide(); } else { slider.nextSlide(); } });
type: UnansweredQuestion
has title: How to disable multiple-scroll effect in osx and fire scroll event once per scroll
score: 6

http://stackoverflow.com/comment/47447129
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29653583
has text: Also if there's only one form, you should use `document.forms[0]` to get it because arrays are zero-based in JavaScript.

http://stackoverflow.com/comment/47354104
has text: @skobaljic: thanks. See my edit. Basically I'm looking to get "a" to popup once and "b" once to popup once when I do `alert(a[i]) ` inside within `html2canvas(b[i]).then(function(canvas) { ... }`
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29603957
type: QuestionComment

http://stackoverflow.com/comment/47300076
type: Comment
comment on: http://stackoverflow.com/a/29575782
has text: Oh cool, so it would reference window only if the anonymous function wasn't defined on an object. Thanks.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47400881
comment on: http://stackoverflow.com/q/29628708
score: 1
type: Comment
has text: Moderator tip: Adding any additional information is best done by editing your post rather than adding a comment
type: QuestionComment

http://stackoverflow.com/a/29625149
accepted answer of: http://stackoverflow.com/q/29624924
type: AcceptedAnswer
downvote count: 0
score: 3
type: Answer
upvote count: 3
answers question: http://stackoverflow.com/q/29624924
has comment: http://stackoverflow.com/comment/47393584
has body: You're confusing Javascript literal syntax with JSON syntax. JSON is a restricted subset of Javascript literal syntax. The specification of ECMAScript object initialisers can be found here. It contains the following production: PropertyName : IdentifierName StringLiteral NumericLiteral So a number is allowed as a property name.

http://stackoverflow.com/tag/json
tags question: http://stackoverflow.com/q/29579651
tags question: http://stackoverflow.com/q/29534604
tags question: http://stackoverflow.com/q/29666465
tags question: http://stackoverflow.com/q/29630957
tags question: http://stackoverflow.com/q/29583217
tags question: http://stackoverflow.com/q/29649972
tags question: http://stackoverflow.com/q/29551426
tags question: http://stackoverflow.com/q/29552414
tags question: http://stackoverflow.com/q/29545913
tags question: http://stackoverflow.com/q/29622643
tags question: http://stackoverflow.com/q/29600675
tags question: http://stackoverflow.com/q/29553512
tags question: http://stackoverflow.com/q/29537342
tags question: http://stackoverflow.com/q/29648832
tags question: http://stackoverflow.com/q/29660613
tags question: http://stackoverflow.com/q/29639622
tags question: http://stackoverflow.com/q/29639704
tags question: http://stackoverflow.com/q/29686542
tags question: http://stackoverflow.com/q/29659058
tags question: http://stackoverflow.com/q/29532210
tags question: http://stackoverflow.com/q/29566432
tags question: http://stackoverflow.com/q/29531676
tags question: http://stackoverflow.com/q/29600688
tags question: http://stackoverflow.com/q/29531652
tags question: http://stackoverflow.com/q/29624714
tags question: http://stackoverflow.com/q/29646822
tags question: http://stackoverflow.com/q/29591051
tags question: http://stackoverflow.com/q/29562314
tags question: http://stackoverflow.com/q/29541574
tags question: http://stackoverflow.com/q/29661862
tags question: http://stackoverflow.com/q/29565485
tags question: http://stackoverflow.com/q/29614377
tags question: http://stackoverflow.com/q/29576844
tags question: http://stackoverflow.com/q/29585319
tags question: http://stackoverflow.com/q/29650696
tags question: http://stackoverflow.com/q/29566042
tags question: http://stackoverflow.com/q/29666036
tags question: http://stackoverflow.com/q/29538673
tags question: http://stackoverflow.com/q/29633293
tags question: http://stackoverflow.com/q/29662523
tags question: http://stackoverflow.com/q/29582013
tags question: http://stackoverflow.com/q/29585904
tags question: http://stackoverflow.com/q/29660972
tags question: http://stackoverflow.com/q/29599010
tags question: http://stackoverflow.com/q/29566253
tags question: http://stackoverflow.com/q/29536283
tags question: http://stackoverflow.com/q/29676680
tags question: http://stackoverflow.com/q/29533269
tags question: http://stackoverflow.com/q/29600612
tags question: http://stackoverflow.com/q/29531811
tags question: http://stackoverflow.com/q/29594183
tags question: http://stackoverflow.com/q/29570744
tags question: http://stackoverflow.com/q/29573969
tags question: http://stackoverflow.com/q/29642580
tags question: http://stackoverflow.com/q/29655666
tags question: http://stackoverflow.com/q/29559623
tags question: http://stackoverflow.com/q/29652465
tags question: http://stackoverflow.com/q/29579987
tags question: http://stackoverflow.com/q/29604916
tags question: http://stackoverflow.com/q/29547860
tags question: http://stackoverflow.com/q/29620041
tags question: http://stackoverflow.com/q/29653024
tags question: http://stackoverflow.com/q/29589758
tags question: http://stackoverflow.com/q/29654189
tags question: http://stackoverflow.com/q/29539128
tags question: http://stackoverflow.com/q/29620393
tags question: http://stackoverflow.com/q/29558848
tags question: http://stackoverflow.com/q/29647458
type: Tag
tags question: http://stackoverflow.com/q/29594165
tags question: http://stackoverflow.com/q/29683863
tags question: http://stackoverflow.com/q/29635797
tags question: http://stackoverflow.com/q/29532304
tags question: http://stackoverflow.com/q/29557886
tags question: http://stackoverflow.com/q/29539264
tags question: http://stackoverflow.com/q/29603692
tags question: http://stackoverflow.com/q/29558681
tags question: http://stackoverflow.com/q/29595942
tags question: http://stackoverflow.com/q/29569122
tags question: http://stackoverflow.com/q/29536018

http://stackoverflow.com/a/29619565
downvote count: 0
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/29619420
score: 1
has body: Your div#qa will overlap the button. div#qa has z-index: 50;. change it to -1 will make you button clickable. div#qa { height: 75%; position: relative; top: 25%; z-index: -1; } Check Fiddle here.

http://stackoverflow.com/a/29564750
answers question: http://stackoverflow.com/q/29564232
downvote count: 0
has body: Arrays are numbered starting at zero, so array[] = [0,1,2]. Your code tries to initialize a value to files[2] which is the third place in the array, but your array is only defined as having 2 spaces. So once it sees that it has reached the end of the array, it exits the loop. As for one of the loops being favored over the others I would assume your second loop would be better, because the first one it is essentially trying to assign a value out of bounds in the array and failing, so it exits. I would say that the second one is safer.
upvote count: 2
type: Answer
score: 2

http://stackoverflow.com/q/29651274
has answer: http://stackoverflow.com/a/29651466
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47442446
score: 1
has body: My HTML code is Show Registered User Create registeruser {{usermessage}} ID Name Phone Number gps Location OPERATIONS {{value.id}} {{value.name}} {{value.phoneno}} {{value.gpslocation}} My controller is <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Registration extends CI_Controller { /** * Index Page for this controller. * * Maps to the following URL * http://example.com/index.php/welcome * - or - * http://example.com/index.php/welcome/index * - or - * Since this controller is set as the default controller in * config/routes.php, it's displayed at http://example.com/ * * So any other public methods not prefixed with an underscore will * map to /index.php/welcome/<method_name> * @see http://codeigniter.com/user_guide/general/urls.html */ public function create() { $name=trim($this->input->get_post("username")); $phoneno=trim($this->input->get_post("phoneno")); $gpslocation=trim($this->input->get_post("gpslocation")); if($name=="") { echo "Name is Required"; } else if($phoneno=="") { echo "Phone Number is Required"; } else { $data['json']=$this->registrationmodel->insert($name,$phoneno,$gpslocation); $this->load->view('json',$data); } } public function update() { $id=trim($this->input->get_post("id")); $name=trim($this->input->get_post("name")); $phoneno=trim($this->input->get_post("phoneno")); $gpslocation=trim($this->input->get_post("gpslocation")); if($name=="") { echo "Nmae is Required"; } else if($phoneno=="") { echo "Phone Number is Required"; } else { $data['json']=$this->registrationmodel->update($id,$name,$phoneno,$gpslocation); $this->load->view('json', $data); } } public function find() { $data['json']=$this->registrationmodel->viewall(); $this->load->view('json', $data); } public function findone() { $id=trim($this->input->get_post("id")); $data['json']=$this->registrationmodel->viewone($id); $this->load->view('json', $data); } public function delete() { $id=trim($this->input->get_post("id")); $data['json']=$this->regist…
favorite count: 0
tagged with: angularjs
type: Question
has title: How to get apiurl in angularjs and codeigniter
upvote count: 1
tagged with: php
answer count: 1
tagged with: codeigniter
has comment: http://stackoverflow.com/comment/47442419

http://stackoverflow.com/comment/47424983
type: Comment
comment on: http://stackoverflow.com/a/29640977
has text: Or an API that i need to know for the search and filter
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47375340
has text: @dave please see the updated code. followed the accepted answer in the linked question.
score: 0
comment on: http://stackoverflow.com/q/29614902
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29530223
has answer: http://stackoverflow.com/a/29530273
tagged with: d3.js
downvote count: 1
accepted answer: http://stackoverflow.com/a/29530273
type: AnsweredQuestion
score: -1
has body: I am trying to create a simple list inforamtion using d3js, not works. any one figure-out the wrong what i do here? var obj = { "status": ["GOOD SERVICE"], "name": ["123"], "url": [null], "text": ["..."], "plannedworkheadline": [null], "Time": [" 7:35AM"], "Date": ["12/15/2011"] } function draw(data) { "use strict"; d3.select("body") .append("ul") .selectAll("li") .data(data) .enter() .append("li") .text(function (d) { return d.name + ": " + d.status; }); }; d3.json(obj, draw); &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.4.11/d3.min.js"&gt;&lt;/script&gt;
has comment: http://stackoverflow.com/comment/47214123
has title: d3js - simple rendering not works
type: Question
upvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0

http://stackoverflow.com/q/29563271
has comment: http://stackoverflow.com/comment/47276407
has comment: http://stackoverflow.com/comment/47276177
tagged with: javascript
score: 4
has answer: http://stackoverflow.com/a/29563727
accepted answer: http://stackoverflow.com/a/29563727
has comment: http://stackoverflow.com/comment/47277398
has body: Given jQuery's philosophy of write less, do more, I'm always surprised when I see this: $(this).prop('checked') &hellip; instead of this: this.checked Looking at the latest jQuery source, prop() provides convenience for these two gotchas: $(elem).prop('for') is equivalent to elem.htmlFor. $(elem).prop('class') is equivalent to elem.className. It also normalizes tabIndex to: 0 for tabbable elements without a tab index. -1 for non-tabbable elements. prop() is certainly useful for setting properties for multiple elements at once, and for chaining properties on a single element. But is there any advantage (other than idiomatic) to use prop() to set or retrieve a single property on a single element except when normalizing tabIndex – specifically when you have a reference to the element (such as this in a callback)?
has comment: http://stackoverflow.com/comment/47276798
has comment: http://stackoverflow.com/comment/47276495
answer count: 1
downvote count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/47276536
linked to: http://stackoverflow.com/q/6977049
favorite count: 0
has comment: http://stackoverflow.com/comment/47277035
has comment: http://stackoverflow.com/comment/47276745
has comment: http://stackoverflow.com/comment/47276668
upvote count: 5
has comment: http://stackoverflow.com/comment/47276298
has comment: http://stackoverflow.com/comment/47276401
type: AnsweredQuestion
has title: $(this).prop('property') vs. this.property
has comment: http://stackoverflow.com/comment/47276877
linked to: http://stackoverflow.com/q/5597317
has comment: http://stackoverflow.com/comment/47277817
has comment: http://stackoverflow.com/comment/47276231
type: Question

http://stackoverflow.com/comment/47218746
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29532791
score: 1
has text: Use `e.previousSibling` and `e.parentNode`.

http://stackoverflow.com/comment/47391809
comment on: http://stackoverflow.com/a/29623984
type: Comment
has text: All the more reason :)
type: AnswerComment
score: 0

app-store
tag name: app-store
type: Tag
tags question: http://stackoverflow.com/q/29678003

http://stackoverflow.com/q/29650297
score: 0
has title: High end javascript application and Event
answer count: 1
has comment: http://stackoverflow.com/comment/47441246
tagged with: javascript
has comment: http://stackoverflow.com/comment/47441008
tagged with: jquery
has comment: http://stackoverflow.com/comment/47441230
tagged with: event-delegation
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29650900
has comment: http://stackoverflow.com/comment/47440853
has comment: http://stackoverflow.com/comment/47452253
has comment: http://stackoverflow.com/comment/47441302
has comment: http://stackoverflow.com/comment/47440540
linked to: http://stackoverflow.com/q/12824549
has body: I tried to have a title that match the context I want my answer for. I explain myself. After writting thousand of javascript lines of code (with or without jquery) I finally asked myself if I'm doing it wrong. Mainly thanks to jQuery adding event/delegating to an element is very easy, but all the example are quiet "easy"; meaning it doesn't take into account that you have a page full of list, button, dynamic things... So my questions, is: Once again for a complexe website, with hundred of dynamic pages, ajax navigation, millions of user... Is there any advantage (beside simplicity) to place a global listener (body or whatever) and let all events bubble up ? When I look at angular it seems they listen 'ng-click' globally, but I can missthink. Contexte - Sidenot: I'm using jQuery for presentation/simplicity, but it's global question about js // Standard binding example $('span').on('click', func) vs // Standard delegation example $('ul').on('click', 'span', func) vs // Dispatcher for 'block' $('ul').on('click', localDispatcher) vs // One (and only one) Global Listener for all click $(body).on('click', globalDispatcher) With this example, the 3 first one need to be placed manually, on a dedicated js for this page. Vs The last one is just a simple event listener, that will use click attribute to dispatch and can be set just once and for all. I find the last one very cool, because it remove all the hassle to manage click/selector/dom management. Also I don't have to .off every listener when I change page (ajax navigation). But I wonder about performance or maybe another problems I can think about (that's why I ask the question :D). I really wonder how "big web startup" manage this kind of Javascript. Thanks :)
type: Question

http://stackoverflow.com/q/29639771
has comment: http://stackoverflow.com/comment/47421820
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/47421545
tagged with: jquery
has comment: http://stackoverflow.com/comment/47421549
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47421481
has answer: http://stackoverflow.com/a/29640027
type: Question
has title: Why won't my button delete?
has body: document.getElementById("roster").innerHTML += " + \n" + "" + str + " "; So this goes inside a Javascript function I'm working on. What it's supposed to do is create clickable text regions (spans) that disappear when clicked as well as generate a button right before the clickable text that is supposed to be removed when the text is clicked. I can get the text to disappear just fine, but I can't get the darn button to go away. The code being generated is: + Marneus Calgar Why is it generating ="" at the end of the opening span tag? why is the button not deleting properly? is $(this).prev().remove() not the correct option?
has answer: http://stackoverflow.com/a/29639851
tagged with: javascript

acrobat
type: Tag
tags question: http://stackoverflow.com/q/29629943
tags question: http://stackoverflow.com/q/29620480
tag name: acrobat
tags question: http://stackoverflow.com/q/29637048
tags question: http://stackoverflow.com/q/29675590

http://stackoverflow.com/comment/47330850
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29591805
score: 0
has text: I guess, unless It is some sort of general key (non user specific) and they want t control their API versions or something? What is the API?

http://stackoverflow.com/comment/47319433
comment on: http://stackoverflow.com/q/29582447
type: Comment
has text: Undecidable without seeing some real code. In some languages some IDE-s try very hard to be super magically helpful, for example JetBrains's code inspections for `php` language are simply awesome feature. Some their IDE claims to support `TypeScript` as well → maybe worth taking a look
type: QuestionComment
score: 0

http://stackoverflow.com/a/29579466
type: Answer
answers question: http://stackoverflow.com/q/29579156
has body: You have to set the "enctype" field: &lt;form enctype="multipart/form-data" action="save_file.py" method="post"&gt; in your HTML form. it is unclear whether you did or not, since you only provided partial information. Please have a look at http://webpython.codepoint.net/cgi_file_upload for a detailed explanation on how to proceed.
upvote count: 2
score: 2
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29579156

http://stackoverflow.com/comment/47365748
comment on: http://stackoverflow.com/a/29606069
type: Comment
score: 0
type: AnswerComment
has text: The main reason for not using the ng-switch is that I'm pretty sure that it will create more watchers. So if you are not planning on switching the type of control to be created on the fly then there should be less memory usage doing it via the link function, which is is only run once. But you are right, it does make the html slightly harder to read.

http://stackoverflow.com/comment/48219445
has text: @amir bar. Even I have gone through the code in url https://crosswalk-project.org/documentation/embedding_crosswalk.html and followed the instructions mentioned but when we run android application to android device the message comes as"The applicationName stoped unfortunately" I am not getting what I am missing or doing anything wrong?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29666227

http://stackoverflow.com/comment/47282444
score: 0
comment on: http://stackoverflow.com/q/29566162
type: QuestionComment
type: Comment
has text: @M.AdamKendall you're also right. i should do that. it's messy.

http://stackoverflow.com/a/29633460
has body: Something like this, passing in the selection to nextUntil, or even just p:has(.hdr) would work, instead of $(this) var elems = $('.main p:has(.hdr)'); elems.each(function() { $(this).nextUntil(elems).addBack().wrapAll('&lt;div class="wrapper" /&gt;'); }); FIDDLE
upvote count: 2
accepted answer of: http://stackoverflow.com/q/29633336
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29633336
type: Answer
score: 2

http://stackoverflow.com/comment/47509044
has text: I went to the line where the error happens inside the onRemove() there is a timeout set at 350, i added a second there and tested, get the same error after the transition ends just a second after. Debugging as we speak
score: 0
comment on: http://stackoverflow.com/q/29681613
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29596981
has comment: http://stackoverflow.com/comment/47432142
has comment: http://stackoverflow.com/comment/47436563
has comment: http://stackoverflow.com/comment/47439292
has comment: http://stackoverflow.com/comment/47429781
type: Answer
has body: From the Docs Deep Linking Set deep-linking to true to enable deep linking to sections of content. Deep linking allows visitors to visit a predefined URL with a hash that points to a particular section of the content. Deep linking also requires a matching data-slug on the content section that the hash should point to, without the pound (#) sign. So if you mean you want to disable the hash change you may want to try to set it to false and remove the data-slug for the tabs.. I haven't used foundation before but this may help.. Edit Include properly your Foundation dependencies Now try this, leave your tab sections empty and add an event to load content via AJAX, then call HTML Chủ Hỗ Biến Here perhaps add something because it is the active tab JavaScript $(document).ready(function () { $(document).foundation(); // Init Foundation // When first Tab is clicked get AJAX content $("a[href='#panel2-1']").bind("click", function (e) { e.preventDefault(); $("#panel2-1").load("http://stackoverflow.com/questions/29596655/how-to-disable-hash-change-in-zurb-foundation-5 #answer-29596981", function (data) { $(document).foundation('reflow'); // or $(document).foundation('tab', 'reflow'); }); }); // Second anchor $("a[href='#panel2-2']").bind("click", function (e) { e.preventDefault(); $("#panel2-2").load("http://stackoverflow.com/questions/29596655/how-to-disable-hash-change-in-zurb-foundation-5 #answer-29596981", function (data) { $(document).foundation('reflow'); }); }); // and so on $("a[href='#panel2-3']").bind("click", function (e) { e.preventDefault(); $("#panel2-3").load("http://stackoverflow.com/questions/29596655/how-to-disable-hash-change-in-zurb-foundation-5 #answer-29596981", function (data) { $(document).foundation('reflow'); }); }); }); See the DOCS for more information about $(document).foundation('reflow'); it is useful to call this function after your AJAX is completed and successful. If your first tab is active by default you may want to load the content via AJAX …
has comment: http://stackoverflow.com/comment/47438085
has comment: http://stackoverflow.com/comment/47438177
has comment: http://stackoverflow.com/comment/47438978
has comment: http://stackoverflow.com/comment/47431119
has comment: http://stackoverflow.com/comment/47431084
score: 0
has comment: http://stackoverflow.com/comment/47440108
answers question: http://stackoverflow.com/q/29596655

http://stackoverflow.com/a/29609105
upvote count: 4
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29607749
accepted answer of: http://stackoverflow.com/q/29607749
has body: Is this what you want : http://jsfiddle.net/Paf_Sebastien/cqa7rfu7/ ? (Sorry I'm not giving more details as I had to change a lot of stuff. Basically, your 'cup' had no height so you didn't see the waves. I did more changes anyway.) Here's your new CSS : body { padding: 0; margin: 0 10px; background: black; } #foam { margin-top: 20px; background: white; width: 460px; height: 100px; z-index:1; } #liquid { background: #000; width: 460px; height: 500px; position: relative; clip:auto; overflow:hidden; -webkit-transform: rotate(180deg); -moz-transform: rotate(180deg); -ms-transform: rotate(180deg); -o-transform: rotate(180deg); z-index:2; background-image: -webkit-gradient( linear, left bottom, left top, color-stop(0, rgb(0,50,150)), color-stop(0.50, rgb(0,150,255)) ); } #liquid:before { content: ''; position: absolute; top: 0; left: 0; width: 0; height: 0; border-style: solid; border-width: 500px 80px 0 0; border-color: #000000 transparent transparent transparent; z-index: 10; } #liquid:after { content: ''; position: absolute; top: 0; right: 0; width: 0; height: 0; border-style: solid; border-width: 0 80px 500px 0; border-color: transparent #000000 transparent transparent; z-index: 10; } .wave{ bottom:0; background:#fff; display:inline-block; height:10%; width:10px; position:absolute; -webkit-animation-name: dostuff; -webkit-animation-duration: 3s; -webkit-animation-iteration-count: infinite; -webkit-transition-timing-function: ease-in-out; z-index:3; } @-webkit-keyframes dostuff{ 0%, 100% { height:10%; } 50% { height:20%; } }
score: 4

http://stackoverflow.com/comment/47473841
comment on: http://stackoverflow.com/q/29642681
type: Comment
type: QuestionComment
has text: I was looking for a brief answer. I have read enough before posting this.
score: 0

http://stackoverflow.com/comment/47443508
type: QuestionComment
comment on: http://stackoverflow.com/q/29651815
score: 0
has text: "Hold" yesterday's date as a **date**, and turn it into a formatted string when you need to display it.
type: Comment

http://stackoverflow.com/q/29682088
tagged with: node.js
upvote count: 2
tagged with: cookies
has comment: http://stackoverflow.com/comment/47501463
downvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/29720201
has comment: http://stackoverflow.com/comment/47501403
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47501935
tagged with: hapi.js
score: 1
favorite count: 0
has title: Get loop when check cookie in angularjs
tagged with: angularjs
type: Question
has comment: http://stackoverflow.com/comment/47501321
has body: This is my code at the client side. What I'm trying to achieve is quite clear. If the user has the cookie it is authenticated otherwise it is redirect to an auth endpoint at the server (function() { 'use strict'; angular .module('App', [ 'ui.router', 'ngResource', 'ngCookies' ]) .run(['$window', '$cookies', '$state', function($window, $cookies, $state) { if($cookies['cookie-app']) { console.log('authenticated'); } else { $window.location.href = "http://" + $window.location.host + "/auth/facebook"; } }]); })(); This is the code a the server side made by using Hapijs module.exports = function(request, reply) { if (request.auth.isAuthenticated) { console.log(request.auth.credentials.profile.raw); request.auth.session.set(request.auth.credentials.profile.raw); return reply.redirect('http://localhost:8080'); } reply('Not logged in').code(401); }; The cookie is set correctly but I don't get true in the if then I get an infinite loop. my scenario is the following. nginx serves angularjs file and it acts a reverse proxy for the hapijs server. Do you have any idea why?

http://stackoverflow.com/comment/47296196
comment on: http://stackoverflow.com/q/29571750
has text: Usually when this happens and the map is displayed, the API is being included more than once, once with the key you expect (or no key) and once with a bad key...
type: Comment
type: QuestionComment
score: 2

knockout.js
tags question: http://stackoverflow.com/q/29662929
tags question: http://stackoverflow.com/q/29626778
tags question: http://stackoverflow.com/q/29572088
tags question: http://stackoverflow.com/q/29583225
tags question: http://stackoverflow.com/q/29607214
tags question: http://stackoverflow.com/q/29549407
tags question: http://stackoverflow.com/q/29636647
tags question: http://stackoverflow.com/q/29559143
tags question: http://stackoverflow.com/q/29548277
tags question: http://stackoverflow.com/q/29680806
tags question: http://stackoverflow.com/q/29557938
tags question: http://stackoverflow.com/q/29676485
tags question: http://stackoverflow.com/q/29643016
tags question: http://stackoverflow.com/q/29636711
tags question: http://stackoverflow.com/q/29562927
tags question: http://stackoverflow.com/q/29657606
tag name: knockout.js
tags question: http://stackoverflow.com/q/29595351
tags question: http://stackoverflow.com/q/29547167
tags question: http://stackoverflow.com/q/29681672
tags question: http://stackoverflow.com/q/29672767
tags question: http://stackoverflow.com/q/29680027
tags question: http://stackoverflow.com/q/29589730
tags question: http://stackoverflow.com/q/29681511
tags question: http://stackoverflow.com/q/29631251
tags question: http://stackoverflow.com/q/29605401
tags question: http://stackoverflow.com/q/29664006
tags question: http://stackoverflow.com/q/29544852
tags question: http://stackoverflow.com/q/29674393
tags question: http://stackoverflow.com/q/29655819
tags question: http://stackoverflow.com/q/29551997
tags question: http://stackoverflow.com/q/29667134
tags question: http://stackoverflow.com/q/29534388
type: Tag
tags question: http://stackoverflow.com/q/29660281
tags question: http://stackoverflow.com/q/29608100
tags question: http://stackoverflow.com/q/29555482
tags question: http://stackoverflow.com/q/29597014
tags question: http://stackoverflow.com/q/29600885
tags question: http://stackoverflow.com/q/29562088
tags question: http://stackoverflow.com/q/29554749
tags question: http://stackoverflow.com/q/29542468
tags question: http://stackoverflow.com/q/29624849

http://stackoverflow.com/comment/47395816
has text: Well, have you made sure `dispatchRFQDocument.loadDocumentGroup` exists before you define your `initListener`? And, no, there's no need to declare a JS variable just for the assignment.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29626223
type: AnswerComment

http://stackoverflow.com/q/29615199
favorite count: 0
has title: Projecting lat/long to pixels with float accuracy instead of int
tagged with: mapbox
has body: I'm using mapbox.js to create a voronoi map. However, I'm having issues with the accuracy of my projections from the latitude/longitude to the pixels on my screen as the accuracy is only int instead of float. This causes the points to change slightly when zooming in/out, causing the overall voronoi map to change! Edit: I've updated the code to also include the code that generates the voronoi. You can see that the voronoi code uses the pixels, which is thus problematic as the accuracy can be problematic. var voronoi = d3.geom.voronoi() .x(function (d) { return d.x; }) .y(function (d) { return d.y; }); filteredPoints.forEach(function (d) { var latlng = new L.LatLng(d.latitude, d.longitude); var point = map.latLngToLayerPoint(latlng); d.x = point.x; d.y = point.y; } voronoi(filteredPoints).forEach(function (d) { d.point.cell = d; });
accepted answer: http://stackoverflow.com/a/29725045
type: AnsweredQuestion
tagged with: leaflet
score: 1
has comment: http://stackoverflow.com/comment/47577730
upvote count: 1
has comment: http://stackoverflow.com/comment/47466159
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29725045
has comment: http://stackoverflow.com/comment/47465722
has comment: http://stackoverflow.com/comment/47378008
has comment: http://stackoverflow.com/comment/47377041
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/47485683
comment on: http://stackoverflow.com/a/29672888
score: 0
type: AnswerComment
type: Comment
has text: That doesn't seems to work (aside from the missing `\` before the last parenthesis), it matches also the line with `window`, which I don't want to be matched.

http://stackoverflow.com/a/29661040
answers question: http://stackoverflow.com/q/29659886
has body: I don't seem to find any problem except from Best Practices And the fact that you get the response more than once. (Line 67 it's the console.log(battlefieldData); and Line 58 it's the console.log(treehouseData);) I suggest you check your XAMPP or WAMP or Apache or whatever server you are using and also try jQuery Ajax and/or the shorthand methods $.get() and $.post() EDIT Also there might be a problem with referential integrity as both requests are ASYNC. But i'm no so sure about this. EDIT 2 By referential integrity i meant in the js environment, not in a database referential integrity way, maybe the link may be misleading.
has comment: http://stackoverflow.com/comment/47465198
score: 0
has comment: http://stackoverflow.com/comment/47462910
has comment: http://stackoverflow.com/comment/47461984
type: Answer
has comment: http://stackoverflow.com/comment/47464020

http://stackoverflow.com/q/29687802
tagged with: javascript
score: 1
has comment: http://stackoverflow.com/comment/47512788
favorite count: 0
tagged with: scope
has comment: http://stackoverflow.com/comment/47513038
has comment: http://stackoverflow.com/comment/47517551
type: Question
has comment: http://stackoverflow.com/comment/47514595
has comment: http://stackoverflow.com/comment/47513236
has comment: http://stackoverflow.com/comment/47513559
has comment: http://stackoverflow.com/comment/47513041
has comment: http://stackoverflow.com/comment/47513218
has comment: http://stackoverflow.com/comment/47512799
has comment: http://stackoverflow.com/comment/47512843
accepted answer: http://stackoverflow.com/a/29688760
has comment: http://stackoverflow.com/comment/47512817
has comment: http://stackoverflow.com/comment/47512713
upvote count: 1
has comment: http://stackoverflow.com/comment/47512753
linked to: http://stackoverflow.com/q/1322341
has answer: http://stackoverflow.com/a/29687853
has comment: http://stackoverflow.com/comment/47515563
has title: How to give access in one Javascript file to a variable defined in another
has comment: http://stackoverflow.com/comment/47512888
has comment: http://stackoverflow.com/comment/47512763
has answer: http://stackoverflow.com/a/29688142
has comment: http://stackoverflow.com/comment/47513054
has comment: http://stackoverflow.com/comment/47512837
possible better answer: http://stackoverflow.com/a/29687853
linked to: http://stackoverflow.com/q/950087
has comment: http://stackoverflow.com/comment/47518805
has comment: http://stackoverflow.com/comment/47513116
answer count: 4
has answer: http://stackoverflow.com/a/29688760
has comment: http://stackoverflow.com/comment/47512994
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47514236
has answer: http://stackoverflow.com/a/29687997
has body: What is the simplest way to put a variable in one js file in the scope of another js file. The question has been asked before, and answers given. But I'm unsatisfied because (1) The explanations were not simple to me and (2) The solutions were not simple to me. One answer was "As long as the global variable has been put into global scope before it is called by the external script." The OP asked "how do I put the global variable into global scope?", and there was no direct answer. So, I have: test1.js var a = true; test2.js alert("a is " + a); console.log("a is " + a); and test.html Test No alert appears, and the console logs ReferenceError: a is not defined. What is the simplest way to make the variable a available in test2.js?
downvote count: 0

http://stackoverflow.com/q/29599319
has comment: http://stackoverflow.com/comment/47345180
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/29599990
score: 1
has comment: http://stackoverflow.com/comment/47344895
has comment: http://stackoverflow.com/comment/47345869
has comment: http://stackoverflow.com/comment/47345594
has title: AJAX response text undefined
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
linked to: http://stackoverflow.com/q/4672691
has comment: http://stackoverflow.com/comment/47345954
favorite count: 0
tagged with: ajax
linked to: http://stackoverflow.com/q/10369839
has comment: http://stackoverflow.com/comment/47345337
has comment: http://stackoverflow.com/comment/47345815
has body: I am following below 2 posts: Ajax responseText comes back as undefined Can&#39;t return xmlhttp.responseText? I have implemented the code in same fashion. But I am getting undefined is not a function wherever i am using callback() funtion in my code. CODE: function articleLinkClickAction(guid,callback){ var host = window.location.hostname; var action = 'http://localhost:7070/assets/find'; var url = action + '?listOfGUID=' + guid.nodeValue; console.log("URL "+url); xmlhttp = getAjaxInstance(); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200) { var response = JSON.parse(xmlhttp.responseText); console.log(response); console.log(xmlhttp.responseText); callback(null, xmlhttp.responseText);// this is line causing error } else{ callback(xmlhttp.statusText);// this is line causing error } }; xmlhttp.open("GET", url, true); xmlhttp.send(null); } And I am calling it from this code: var anchors = document.getElementsByTagName("a"); var result = ''; for(var i = 0; i &lt; anchors.length; i++) { var anchor = anchors[i]; var guid = anchor.attributes.getNamedItem('GUID'); if(guid) { articleLinkClickAction(guid,function(err, response) { // pass an anonymous function if (err) { return ""; } else { var res = response; html = new EJS({url:'http://' + host + ':1010/OtherDomain/article-popup.ejs'}).render({price:res.content[i].price}); document.body.innerHTML += html; } }); } }
has comment: http://stackoverflow.com/comment/47344997

http://stackoverflow.com/q/29611299
tagged with: javascript
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/29611341
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29611341
has body: I have a script that shows a notification (HTML5), but after some time I want this notification to hide. Is this possible? How do I hide the notification? My code to do a notification: function notifyMe(data){ if (!("Notification" in window)) { console.log("This browser does not support desktop notification"); }else if (Notification.permission !== 'denied') { Notification.requestPermission(function (permission) { if (permission === "granted"){ var notification = new Notification("FOTÓGENA", data); setTimeout(function(){ #hide the notification }, 3000) } }); }else console.log('Por favor dale en permitir a las notificaciones') }
has answer: http://stackoverflow.com/a/29611330
type: AnsweredQuestion
has title: How to hide a notification
possible better answer: http://stackoverflow.com/a/29611330
type: Question
has comment: http://stackoverflow.com/comment/47368247

http://stackoverflow.com/a/29687630
accepted answer of: http://stackoverflow.com/q/29687491
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/29687491
type: AcceptedAnswer
downvote count: 0
has body: Usually what I have seen is that the client requests a user-specific token from the API and then sends it back over HTTPS on a per request basis. If the secret key is shared across all clients then you have to do more work. One way to handle this would be to create a proxy that generates and accepts user-specific tokens on the frontend and uses the shared key on the backend. The JS would talk to the proxy.

http://stackoverflow.com/comment/47252301
has text: Yes, `jQuery(document).ready`, but not the OP's `jQuery(function($){#...})`
comment on: http://stackoverflow.com/q/29548879
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29666516
tagged with: javascript
has comment: http://stackoverflow.com/comment/47475643
has comment: http://stackoverflow.com/comment/47472109
tagged with: validation
has body: I'm really new to HTML and JavaScript and I'm working on using regex to validate input... I used /^[a-z]+$/i.test (firstName) to make sure the entered first name was all characters. if( /^\d{8}$/.test(idNum)) doesn't seem to be working. I'm trying to make sure they enter an 8 digit number. I've got to validate some other fields like Address, city, state, zip and phone number. Any resources or examples would be great! Thanks!
has comment: http://stackoverflow.com/comment/47472204
has comment: http://stackoverflow.com/comment/47471895
has comment: http://stackoverflow.com/comment/47471834
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47472131
has comment: http://stackoverflow.com/comment/47471858
has comment: http://stackoverflow.com/comment/47471853
tagged with: regex
answer count: 0
has comment: http://stackoverflow.com/comment/47471870
score: 0
type: Question
has title: How to write JavaScript form validation regex

http://stackoverflow.com/comment/47419442
type: AnswerComment
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29637359
has text: @user2120512: Well, it was basically the same solution as mine. What did you need to modify?

http://stackoverflow.com/a/29646735
upvote count: 4
has body: Add word boundaries at both start and end tags: /(#Macro\b[\s\S]+?#EndMacro\b)/gi PS: Also to match any character including newlines it is better to use: [\s\S] rather than: (.|[\r\n])
downvote count: 0
type: AcceptedAnswer
score: 4
accepted answer of: http://stackoverflow.com/q/29646682
type: Answer
answers question: http://stackoverflow.com/q/29646682

http://stackoverflow.com/q/29680614
tagged with: facebook
has comment: http://stackoverflow.com/comment/47498449
tagged with: plugins
has comment: http://stackoverflow.com/comment/47499141
has comment: http://stackoverflow.com/comment/47498528
has comment: http://stackoverflow.com/comment/47501392
has body: I want to display facebook comments on a web page but facebook comment plugin is comes with facebook style. Is it possible to remove everything except the facebook comment text? Or is there some other js/jquery plugins or code that would pull only facebook comments so I can display them. Any help or hint is very appreciated!
score: 0
upvote count: 1
answer count: 1
downvote count: 1
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
has title: Display facebook comments in different style?
has comment: http://stackoverflow.com/comment/47498704
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has answer: http://stackoverflow.com/a/29686828
type: Question

http://stackoverflow.com/a/29637052
has comment: http://stackoverflow.com/comment/47416773
score: 0
has body: You can close multiple divs in a click event like this $(document).ready(function () { $(".x").click(function () { $("#bazinga_content").hide(); $("#tcm_content").hide(); }); }); And you dont need to use multiple document.ready functions. You can actually use one document.ready and put everything into it. Working JsFiddle here https://jsfiddle.net/0t6uqwLm/10/ New JsFiddle for the update made in question https://jsfiddle.net/0t6uqwLm/12/
has comment: http://stackoverflow.com/comment/47417127
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29636989
type: Answer
answers question: http://stackoverflow.com/q/29636989
has comment: http://stackoverflow.com/comment/47416627

http://stackoverflow.com/comment/47478063
has text: what script and css you have used in it . have you used jquery ui css and js ?
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29669854

http://stackoverflow.com/a/29666933
upvote count: 4
has body: It looks like you're trying to use Javascript variables (eventname, eventstartdatae, eventcityname) directly in the HTML. Instead, you could try building the URL with Javascript, and set the (list items) and (links) with jQuery: My Event Name My Event Start Date My Event City Name close Share this Event Show Modal Show Modal From Link Working fiddle
downvote count: 0
score: 4
has comment: http://stackoverflow.com/comment/47479243
type: Answer
answers question: http://stackoverflow.com/q/29666449

http://stackoverflow.com/q/29579615
answer count: 0
has body: My Question Title may not be optimal but I'm having difficulties finding a good one ... Here is what I'm trying to achieve : Using angularjs, I want to load google recpatcha (docs) with correct language. Basic script loads perfectly : But as soon as I want to add my language parameter, its fails : I can figure out at runtime root.$stateParams.locale is not yet defined so I imagine I will have to load this script outside HTML's header section but here is where I get lost ! How do I load this script the angular way ?
has comment: http://stackoverflow.com/comment/47307625
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/19028792
score: 0
tagged with: recaptcha
has title: angularjs load script with params
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47311307
linked to: http://stackoverflow.com/q/8578617

http://stackoverflow.com/a/29675448
downvote count: 0
has comment: http://stackoverflow.com/comment/47587592
has comment: http://stackoverflow.com/comment/47499286
has comment: http://stackoverflow.com/comment/47597929
has body: CSS has a certain scope to it, that is, it only acts on HTML elements. Javascript, on the other hand, has its own variables and can also interact with HTML elements. What you're trying to do is use CSS as variables for javascript, which can't be done. The code sample above represents a piece of javascript which takes an HTML element (in this case a canvas) and performs a set of actions (methods) on it. What you're doing is literally drawing one line at a time to create your image, and this image is outside of the CSS scope as it is only defined by the elements internal properties, while CSS can only define its external (specifically, visual) properties.
has comment: http://stackoverflow.com/comment/47500179
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/47500263
answers question: http://stackoverflow.com/q/29675279
score: 1
has comment: http://stackoverflow.com/comment/47500410

http://stackoverflow.com/q/29583563
has title: How to use two JavaScript (.js) files on one website?
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29583817
accepted answer: http://stackoverflow.com/a/29583601
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29583684
has answer: http://stackoverflow.com/a/29583702
tagged with: http://stackoverflow.com/tag/html
tagged with: web
has body: I created a website for big (Desktop) and small (Mobile) devices. Not only the .css files differ each other but also the .js files in which the animations are saved. My Problem now is, I don't know how to make the browser use the .js file for small devices if the display is small and on the other site the .js file for big devices if the display is big. Is there any possible solution to use only one webspace with two Java Script files automatically choosen by screen size?
favorite count: 0
possible better answer: http://stackoverflow.com/a/29583658
answer count: 5
has answer: http://stackoverflow.com/a/29583658
tagged with: css
has answer: http://stackoverflow.com/a/29583601
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47315231
score: 1
has comment: http://stackoverflow.com/comment/47315216

http://stackoverflow.com/q/29666532
has comment: http://stackoverflow.com/comment/47471963
possible better answer: http://stackoverflow.com/a/29666902
has body: I have an array whose elements are made up of various character (numbers and letters). How could I check whether the first character for a given element is a number? I was trying to use splice/slice but for some reason I was unable to get the solution. I had something like this: if (!isNaN(array[i].substr(0, 1))) { array.slice(0,0); //here I want to remove the element whose first character is a number and not a letter - should I use pop? } Can someone please advise? Thanks in advance. Here is an example: array[0] ="adkfjdkjfdkj" array[1] = "12fjkdjfkd" array[2] = "kcnvmcvn" So for those elements of array[], I would want to check all three and remove array[1] since the first character is an integer; and then array[2] would become array[1]. I would think a method similar to pop() would be useful here
tagged with: node.js
has answer: http://stackoverflow.com/a/29666661
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29666993
type: Question
tagged with: arrays
has answer: http://stackoverflow.com/a/29666902
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29666779
has title: Checking First Character of Array Element
score: 0
has comment: http://stackoverflow.com/comment/47471947
has answer: http://stackoverflow.com/a/29666779
has comment: http://stackoverflow.com/comment/47471859
has answer: http://stackoverflow.com/a/29667089
tagged with: parsing
answer count: 5

http://stackoverflow.com/comment/47376822
comment on: http://stackoverflow.com/q/29615476
score: 0
type: Comment
type: QuestionComment
has text: Well your regex insists on there being a semicolon followed by at most one character of whitespace before each property. What does the actual string look like?

http://stackoverflow.com/comment/47219023
type: QuestionComment
comment on: http://stackoverflow.com/q/29532942
type: Comment
has text: It's not a scope issue, it's a timing issue.
score: 0

http://stackoverflow.com/comment/47418514
type: Comment
type: QuestionComment
has text: possible duplicate of [pack / unpack functions for node.js](http://stackoverflow.com/questions/5605108/pack-unpack-functions-for-node-js)
comment on: http://stackoverflow.com/q/29638016
score: 0

http://stackoverflow.com/comment/97611137
score: 0
type: Comment
type: AnswerComment
has text: if http is already there then url will become http://http://url. So we need to check http and https both. I would recommend function prependProtocol(url) { if (!url.match(/^https?:\/\//i) || !url.match(/^http?:\/\//i)) { url = 'http://' + url; } return url; }
comment on: http://stackoverflow.com/a/29684929

http://stackoverflow.com/comment/47403738
type: Comment
has text: @RoryMcCrossan im trying to copy the value from input 1 to input 2 and to get the script adding +1 to a value in input 3 on button click
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29630265

http://stackoverflow.com/comment/47331397
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29555738
has text: I am learnning the Crawling now. And want to get remainTime in the webPageSource which dynamically generated by JS. In my mind, crawling is one part of web-scraping.

http://stackoverflow.com/q/29573421
downvote count: 0
has comment: http://stackoverflow.com/comment/47296398
tagged with: javascript
tagged with: jquery
favorite count: 0
score: 1
has comment: http://stackoverflow.com/comment/47296029
answer count: 0
has comment: http://stackoverflow.com/comment/47296119
has comment: http://stackoverflow.com/comment/47297329
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47296100
upvote count: 1
tagged with: php
has body: I have: while ($row = $stmt2-&gt;fetch(PDO::FETCH_ASSOC)) { extract($row); echo " &lt;input type='checkbox' name='additional[{$additional_id}]' value='{$additional_id}'/&gt;{$additional_name} - &amp;#36;{$additional_price} &lt;input type='number' name='quantity_additional[{$additional_id}]' value='1' min='1' max='5'/&gt;&lt;br/&gt; "; } And I need to parse all the values of selected checkboxes with their quantities in this loop to this Query String: $(document).ready(function() { $('.add').on('submit', function() { var product_id = $(this).closest('tr').find('.product-id').text(); var product_name = $(this).closest('tr').find('.product-name').text(); var quantity = $(this).closest('tr').find('input').val(); //Here I need to serialize all values and quantities of the selected checkboxes then insert each of them in the Query String below window.location.href = "add_to_cart.php?product_id=" + product_id + "&amp;product_name=" + product_name + "&amp;quantity=" + quantity; return false; }); }); I think the Query String will need be something like: add_to_cart.php?product_id=1&amp;product_name=Pizza&amp;quantity=2&amp;additional_id=1&amp;additional_quantity=2&amp;additional_id=3&amp;additional_quantity=5 The output query will be according to the number of selected additional checkboxes and their quantities. How to do this? Thanks!
has title: How to parse all selected checkboxes values with their quantities to Query String
type: Question
has comment: http://stackoverflow.com/comment/47296166
has comment: http://stackoverflow.com/comment/47297593

http://stackoverflow.com/q/29601293
has body: I am doing the following: load a WKWebView, lets call this view A ask the user to enter some details ask the user to click a button intercept the click on the WKWebView and PUSH a new view on the application, lets call this view B allow the user to compute a result in the new view and then GO BACK to the previously loaded WKWebView Now: I would like to add the information that I computed to the previously loaded webpage (view A). The only way I know how to do it is to load a javascript on the loadView() method. However this method is not being called when you navigate back from view B to view A as view A was already loaded. Also forcing a reload when view A reappears would loose the values in the fields that have been edited by the users. This is the "standard" code I have to call the script: override func loadView() { super.loadView() var contentController = WKUserContentController(); var userScript = WKUserScript( source: "setValue(5)", injectionTime: WKUserScriptInjectionTime.AtDocumentEnd, forMainFrameOnly: true ) contentController.addUserScript(userScript) var config = WKWebViewConfiguration() config.userContentController = contentController self.webView = WKWebView(frame: self.containerView!.bounds, configuration: config) } So now I would need your help to understand how to call the the method "setValue(customparameter)" with a custom value (computed in view B) not in loadView but when the view re-appears. I can store the value in a singleton object so that's ok. However I do not know how to call / inject the javascript at this stage. Any help?
score: 2
has answer: http://stackoverflow.com/a/39218950
type: Question
tagged with: ios
tagged with: javascript
tagged with: wkwebviewconfiguration
answer count: 2
has title: WKWebView: calling javascript after page is loaded
downvote count: 0
tagged with: wkwebview
favorite count: 0
has answer: http://stackoverflow.com/a/32201067
upvote count: 2
type: UnansweredQuestion
tagged with: swift

http://stackoverflow.com/q/29622609
tagged with: ios
tagged with: javascript
has body: I use a video tag in my page. I hope it played without fullscreen. but Safari with iPhone forces it to start playing with fullscreen. How can I avoid fullscreen playing? i have tried .webkitCancelFullScreen() and .webkitDisplayingFullscreen. it seems not work well.
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: web
favorite count: 0
upvote count: 2
has title: how to disable fullscreen playing with html5 video tag in iphone?
has comment: http://stackoverflow.com/comment/47389108
downvote count: 1
type: AnsweredQuestion
tagged with: video
score: 1
type: Question
has answer: http://stackoverflow.com/a/29622731
accepted answer: http://stackoverflow.com/a/29622731

http://stackoverflow.com/comment/47460316
comment on: http://stackoverflow.com/a/29638085
type: AnswerComment
has text: I was yesterday looking at that but desisted to find a css way of doing it with calc(). completely agree with you! thanks for the tip!!!
type: Comment
score: 0

http://stackoverflow.com/q/29684352
has comment: http://stackoverflow.com/comment/49153714
upvote count: 1
has comment: http://stackoverflow.com/comment/47507599
has comment: http://stackoverflow.com/comment/47510999
downvote count: 0
favorite count: 0
type: UnansweredQuestion
tagged with: ruby-on-rails
answer count: 0
score: 1
has title: Google Maps JS API 3 Uncaught Security Error
type: Question
tagged with: google-maps
has comment: http://stackoverflow.com/comment/47511453
has comment: http://stackoverflow.com/comment/47508795
tagged with: javascript
has body: I'm receiving the following error in the console when loading Google Maps asynchronously in a Rails App using Turbolinks (not sure if turobolinks is related to the error). The map loads as expected, but I can't seem to clear this error. Uncaught SecurityError: Blocked a frame with origin "https://www.google.com" from accessing a frame with origin "https://example.com". Protocols, domains, and ports must match. The initialization script is very similar to the vanilla example in the API docs, except that the loadScript function is triggered on the turbolinks page:load event. function initialize() { var lat = $('#map-canvas').data('lat'); var long = $('#map-canvas').data('long'); var mapOptions = { zoom: 14, center: new google.maps.LatLng(lat, long), mapTypeId: google.maps.MapTypeId.SATELLITE, disableDefaultUI: true, zoomControl: true }; var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); } function loadScript() { if ( $( "#map-canvas" ).length ) { //only initialize on map pages if (typeof google == "undefined") { //prevent duplicate loading var script = document.createElement('script'); script.type = 'text/javascript'; script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp' + '&amp;signed_in=true&amp;callback=initialize'; document.body.appendChild(script); }else{ initialize(); } } } $(document).on("ready page:load", loadScript);

http://stackoverflow.com/q/29585484
has body: I am using following code to apply filters on button click Vignette When I click on button the button, I get the alert but the camanJS filter does not do anything. If I put the code of filter outside the button click function it works perfectly. Why is this happening?
answer count: 0
score: 1
has title: CamanJS filters unresponsive to button clicks?
has comment: http://stackoverflow.com/comment/47319710
upvote count: 1
type: Question
tagged with: javascript
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47319800
tagged with: camanjs
type: UnansweredQuestion

http://stackoverflow.com/a/29708918
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29652660
has body: I found that a much simpler solution was to just add the variable in the switch case built into the plugin doing the cropping: switch (size) { case "square": this.options.ratio = 1; orientation = "SQUARE"; break; case "9:16": this.options.ratio = 9 / 16; orientation = "PORTRAIT"; break; case "16:9": this.options.ratio = 16 / 9; orientation = "LANDSCAPE"; break; }
accepted answer of: http://stackoverflow.com/q/29652660
type: AcceptedAnswer

http://stackoverflow.com/comment/47273131
comment on: http://stackoverflow.com/q/29560574
type: QuestionComment
type: Comment
has text: @JoelHernandez so advice him to try something before asking, otherwise he would not improve his programming skills.
score: 1

http://stackoverflow.com/q/29560422
type: Question
has title: node require module passing arg with square brackets? is this a mistake?
upvote count: 2
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47271330
tagged with: node.js
has body: I saw the following nodeJS code on a git hub repo: var env = process.env.NODE_ENV || 'development' , config = require('./config/config')[env] , auth = require('./config/middlewares/authorization') , mongoose = require('mongoose'); I've never seen the square brackets before [env] is this a mistake? I thought args could only be passed in normal brackets ( ). I could not find documentation anywhere about this. repo in question is here https://github.com/diki/nodejs-passport-boilerplate and its on line 17 of server.js.
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29561049
accepted answer: http://stackoverflow.com/a/29561049

http://stackoverflow.com/q/29595593
answer count: 2
downvote count: 0
has title: Javascript Dropdown Menu Addition
favorite count: 0
has comment: http://stackoverflow.com/comment/47338740
accepted answer: http://stackoverflow.com/a/29596688
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/29606390
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29606390
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29596688
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47338488
has body: right now on my page you can select add to basket and it will add them up in the total. I am trying to change it so you can select between 1 and 3 and it will add them together in the total but im unsure h=of how to change my page so it will do this? Current Script: Table to select options and display them: £19.99 £24.99 Basket:

http://stackoverflow.com/q/29650908
tagged with: timeout
tagged with: javascript
upvote count: 2
answer count: 3
has answer: http://stackoverflow.com/a/29651456
favorite count: 0
tagged with: ajax
tagged with: promise
tagged with: angularjs
has answer: http://stackoverflow.com/a/29651410
accepted answer: http://stackoverflow.com/a/29651410
has answer: http://stackoverflow.com/a/32999286
score: 2
type: AnsweredQuestion
has body: In my AjaxPromiseService.js factory, I have been trying to incorporate a timeout mechanism into promise calls (usually $http.get/post calls to remote services). The way I am currently doing is to create a race between a $timeout event and the actual promise calls. Example code as following (code from my AjaxPromiseService.js factory in AngularJS): also available in this plnkr var timeoutObj = {"isTimeout": true}; function timeoutPromise(deferredObj) { $timeout(function() { console.log("promise timeout"); deferredObj.resolve(timeoutObj); }, timeoutLimit); // timeoutLimit is in milisecond } //promise calls (e.g. $http.get()) function getDummyData(milisec) { var data = {"data" : "dummy data from ajax!"}; var deferred = $q.defer(); timeoutPromise(deferred); //start the race to see who resolves first //use $timeout to mimick an AJAX call $timeout(function() { deferred.resolve(data); $timeout.cancel(timeoutPromise(deferred)); //not working, how to cancel the race here? }, milisec); // return deferred.promise; } //getDummyData This seems working, if getDummyData() is not resolved within the specified duration, the timeoutPromise() will return the useful flag so I can let the AJAX calls fail gracefully. Both timeoutPromise() and getDummyData() will resolve eventually in a sequential order, however, I would like to cancel timeoutPromise() if getDummyData() is reslolved first. I was wondering how to do this?
has title: AngularJS: timeout promise calls
downvote count: 0
type: Question
possible better answer: http://stackoverflow.com/a/29651456

http://stackoverflow.com/a/29677160
answers question: http://stackoverflow.com/q/29676680
has comment: http://stackoverflow.com/comment/47496539
has comment: http://stackoverflow.com/comment/47517903
has comment: http://stackoverflow.com/comment/47523062
has body: Here's how you can do it using underscore.js (http://underscorejs.org/) arr = [{"Name":"Define","StartDate":"2015-04-09","EndDate":"2015-04-22"}, {"Name":"Plan","StartDate":"2015-04-22","EndDate":"2015-04-29"}, {"Name":"Plan","StartDate":"2015-04-30","EndDate":"2015-05-14"}]; result = _.chain(arr) .groupBy(function(e){ return e.Name }) .pairs() .map(function(e){ return { Name: e[0], StartDate: _.chain(e[1]).sortBy(function(e){ return new Date(e.StartDate).getTime(); }).first().value().StartDate, EndDate: _.chain(e[1]).sortBy(function(e){ return -1 * new Date(e.EndDate).getTime(); }).first().value().EndDate } }) .value()
has comment: http://stackoverflow.com/comment/47496578
type: AcceptedAnswer
score: 0
accepted answer of: http://stackoverflow.com/q/29676680
has comment: http://stackoverflow.com/comment/47492776
type: Answer

http://stackoverflow.com/a/29586239
upvote count: 1
has comment: http://stackoverflow.com/comment/47320878
answers question: http://stackoverflow.com/q/29586172
has body: I think you want something like this. Forgive me for not testing that it works as is. Hopefully you can extrapolate. HTML <option value="<?php echo $res1['ProjStatus'] ?>"><?php echo $res1['ProjStatus'] ?> Completed Ongoing Pending JavaScript function toggleText(value) { // if the new value of the select element is Pending, show it if("Pending" === value){ document.getElementById('textArea').style.display = "block"; // the return values just lets you know the result if you ever need it return true; } document.getElementById('textArea').style.display = "none"; return false; }
has comment: http://stackoverflow.com/comment/47320553
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29586172
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/47320683

http://stackoverflow.com/comment/47231290
score: 0
type: Comment
has text: I am new to php.. I am migrating from asp.net .. so its a bit tedious for me.. I tried to find .ini file but could not..
comment on: http://stackoverflow.com/a/29539022
type: AnswerComment

http://stackoverflow.com/q/29547033
has comment: http://stackoverflow.com/comment/47247688
type: Question
has title: Getting CSS Calc percentages to update during resize
has comment: http://stackoverflow.com/comment/47246015
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47247892
has comment: http://stackoverflow.com/comment/47247608
has comment: http://stackoverflow.com/comment/47245819
score: 0
has body: I have a series of panels that have CSS calc/percentage based heights and widths. The panels accurately and smoothly resize after the window size has changed. height: calc(50% - 5px); However, I was wondering if there was a way to have the panels resize while the window is being resized instead of after. I don't want to use any kind of JS calculation to do this! If there is a DOM API setting or a way of manually re-firing the calc() function on resize, that is acceptable. EDIT: I don't want to be calculating widths and heights in JS. Everything else is fine. Does anyone know a way of doing this?
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47245733
type: UnansweredQuestion
tagged with: css
has comment: http://stackoverflow.com/comment/47247571
answer count: 0

http://stackoverflow.com/a/29668615
has body: This extension installer is not compatible with the version of spree you are using. To fix just add this line into your vendor/assets/javascripts/spree/backend/all.js: //= require spree/backend/spree_image_cropper and this one into your vendor/assets/stylesheets/spree/backend/all.css: *= require spree/backend/spree_image_cropper
score: 0
has comment: http://stackoverflow.com/comment/47482410
type: Answer
answers question: http://stackoverflow.com/q/29647794

http://stackoverflow.com/comment/47240077
comment on: http://stackoverflow.com/q/29543989
score: 0
has text: @goldeneye `$('#content2').prop('contenteditable', false);` should work as expected then. But you'd have better to provide sample replicating your issue as code snippet/jsFiddle
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29537123
has answer: http://stackoverflow.com/a/48037102
has comment: http://stackoverflow.com/comment/47264067
upvote count: 5
has comment: http://stackoverflow.com/comment/47232190
tagged with: javascript
tagged with: copy
answer count: 2
has body: Before someone suggests it: no, user-select isn't the correct answer. Daniel O'Connor's pure CSS method is close but I can't use it for my use case because of those "Accessibility concerns". I need a better way of doing the same thing. I can't think of how it'd be done; I don't think there's a reliable cross-browser compatible way of copying something to the clipboard with JavaScript. So I think it has to be a HTML &amp; CSS solution. Edit I say "I don't think there's a reliable cross-browser compatible way of copying something to the clipboard with JavaScript" because one solution could've been to catch when the copy event (if that's even supported everywhere). I just realised though even if "there's a reliable cross-browser compatible way of copying something to the clipboard with JavaScript", this probably wouldn't work when a user copies the text on a mobile device. Correct me if I'm wrong. Edit 2 I'm not trying to block people from copying the text in any way. I'm not trying to block access to the text. That's impossible and discouraged anyway. I'm just trying to make it nicer for users who are copying N number of elements' text from my app who end up with unimportant stuff in the clipboard (like timestamp elements' text, etc.)
has comment: http://stackoverflow.com/comment/47226757
favorite count: 0
has comment: http://stackoverflow.com/comment/47236297
has title: How can I prevent a certain element's text being copied to the clipboard?
has comment: http://stackoverflow.com/comment/47227855
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47227136
tagged with: css
tagged with: text
score: 4
has comment: http://stackoverflow.com/comment/47230840
has comment: http://stackoverflow.com/comment/47227056
has comment: http://stackoverflow.com/comment/47226702
linked to: http://stackoverflow.com/q/16926792
has comment: http://stackoverflow.com/comment/47226883
has answer: http://stackoverflow.com/a/29537350
downvote count: 1
type: Question

http://stackoverflow.com/comment/47941921
has text: where did you find `ng-drag-clone`?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29857071

http://stackoverflow.com/q/29682119
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29683347
type: Question
answer count: 1
has comment: http://stackoverflow.com/comment/47501646
tagged with: javascript
tagged with: jquery
has title: how to open print tab when user click button angular js
score: 0
has comment: http://stackoverflow.com/comment/47501282
accepted answer: http://stackoverflow.com/a/29683347
has comment: http://stackoverflow.com/comment/47501515
tagged with: angularjs
has body: I have print view and controller to print result when user click on link: Employee List I want to use ng click to open print preview windows and show the print controller but my problem is view the current page 'http://localhost/#/reception' not http://localhost/#/print/2 $scope.openPrintPreview = function(countyId){ var popupWin = window.open('', '_blank', 'width=800,height=700'); popupWin.print('#/print/' + countyId); };

http://stackoverflow.com/comment/47270370
comment on: http://stackoverflow.com/q/29559482
has text: @AlvaroMontoro I have all of my files running locally. Should I look into exploring running them on a server? if so how hard is it to understand/ learn?
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/47448748
type: Comment
comment on: http://stackoverflow.com/q/29654406
score: 1
type: QuestionComment
has text: For starters your code is outside the function so it never gets executed when you click the button.

http://stackoverflow.com/a/29606067
answers question: http://stackoverflow.com/q/29605929
downvote count: 0
has comment: http://stackoverflow.com/comment/47358026
type: Answer
upvote count: 11
has body: Plunker $scope.remove = function(item) { $scope.cards.splice(0, 1); } Made changes to .. now it will remove from the top
score: 11

http://stackoverflow.com/comment/47305293
has text: @epascarello : No no error messages in console
comment on: http://stackoverflow.com/q/29578258
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29628551
has comment: http://stackoverflow.com/comment/47400258
has comment: http://stackoverflow.com/comment/47400288
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/47400816
type: Answer
answers question: http://stackoverflow.com/q/29628375
has body: Two ways. First, using moment.js: setInterval(function() { document.getElementById('time').innerHTML = moment().format('HH:mm:ss'); },1000); or using your function: function initTime(date){ var today=new Date(date); var h=today.getHours(); var m=today.getMinutes(); var s=today.getSeconds(); m = checkTime(m); s = checkTime(s); document.getElementById('time').innerHTML = h+":"+m+":"+s; } function checkTime(i) { if (i&lt;10) {i = "0" + i}; // add zero in front of numbers &lt; 10 return i; } setInterval(initTime(date),1000);
score: 1

http://stackoverflow.com/comment/47388592
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29622311
has text: You forget to load jQuery. And take care with repeated IDs, an ID should be unique!!
score: 0

http://stackoverflow.com/comment/47363228
type: QuestionComment
type: Comment
has text: You have an extra `});` in your jQuery. Is it just a typing mistake over here?
score: 0
comment on: http://stackoverflow.com/q/29608467

http://stackoverflow.com/a/29687814
has body: you could attach it to the global window object: $(function() { window.foo = function() { console.log("bar"); } }
has comment: http://stackoverflow.com/comment/47512694
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/47512773
answers question: http://stackoverflow.com/q/29687794
has comment: http://stackoverflow.com/comment/47512672
downvote count: 0
score: 1

http://stackoverflow.com/q/29688098
favorite count: 0
has title: Unexpected result from momentjs diff when the compared dates are close
has comment: http://stackoverflow.com/comment/47513821
accepted answer: http://stackoverflow.com/a/29688237
tagged with: momentjs
has comment: http://stackoverflow.com/comment/47513442
has comment: http://stackoverflow.com/comment/47513680
score: 2
upvote count: 2
has body: When today's and tomorrow's date (April 17 and 18) are compared with the current moment (it's April 17 right now, for me) using the momentjs diff function, the number of days calculated are both 0. Why is this, and what's a way to get a more sensible result? function daysRemaining(eventdate) { var eventdatemoment = moment(eventdate); var todaysdate = moment(); return eventdatemoment.diff(todaysdate, 'days'); } console.log(daysRemaining('2015-04-16')); console.log(daysRemaining('2015-04-17')); console.log(daysRemaining('2015-04-18')); console.log(daysRemaining('2015-04-19')); Gives the result: -1 0 0 1 http://jsfiddle.net/ue110atu/1/
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/29688237
answer count: 2
has comment: http://stackoverflow.com/comment/47513362
possible better answer: http://stackoverflow.com/a/29688215
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47513619
has answer: http://stackoverflow.com/a/29688215

list
type: Tag
tag name: list
tags question: http://stackoverflow.com/q/29649361

http://stackoverflow.com/comment/47474688
score: 0
comment on: http://stackoverflow.com/q/29667624
type: Comment
type: QuestionComment
has text: The document write was actually me testing whether the base64 value actually worked - which it does. I guess my two issues are it's not being set into the hidden input and whether or not it will work in the php mailer if I set it as the source for an img ( )

http://stackoverflow.com/a/29534503
score: 3
downvote count: 0
answers question: http://stackoverflow.com/q/29534470
upvote count: 3
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29534470
has body: That's because you're using two-quantifiers side-by-side /^[A-Z]{2}+[0-9A-Z]*$/ // ^ Remove this. It means match the previous token one or more times So, it would be /^[A-Z]{2}[0-9A-Z]*$/
type: Answer

http://stackoverflow.com/a/29649295
answers question: http://stackoverflow.com/q/29648767
type: Answer
has body: Maybe this will help. obj.data.sort(function(a, b) { return a.id.Name &lt; b.id.Name; }); for(var i in obj.data) { console.log(obj.data[i].id.Name); }
score: 1
upvote count: 1
downvote count: 0

http://stackoverflow.com/comment/47286545
has text: Why -1, I edit and give better explanation?
score: 1
type: Comment
comment on: http://stackoverflow.com/q/29568430
type: QuestionComment

http://stackoverflow.com/comment/47286611
type: QuestionComment
comment on: http://stackoverflow.com/q/29568577
has text: Silly question, but are you uploading the images, then manually browsing to http:// .. ../../../controllers/ajax_controller.php to view the dumps?
score: 0
type: Comment

http://stackoverflow.com/comment/47365573
type: Comment
type: QuestionComment
has text: It is also tagged "arrays" and "for-loop", but those are not present either.
comment on: http://stackoverflow.com/q/29609982
score: 0

http://stackoverflow.com/comment/47487599
type: Comment
type: QuestionComment
has text: downvoted because you did't show us what you tried and why you are not satisfied with it. Will upvote if you can edit
comment on: http://stackoverflow.com/q/29674822
score: 0

http://stackoverflow.com/q/29535715
tagged with: folium
favorite count: 0
linked to: http://stackoverflow.com/q/8700636
tagged with: python
has answer: http://stackoverflow.com/a/35907473
type: AnsweredQuestion
tagged with: leaflet
possible better answer: http://stackoverflow.com/a/35907473
has answer: http://stackoverflow.com/a/38152612
type: Question
has answer: http://stackoverflow.com/a/29539518
has title: Python with Folium: How can I embed a webpage in the popup?
tagged with: javascript
score: 4
upvote count: 4
answer count: 3
has body: I'm working on a simple implementation of Python Folium with simple markers based on this page. import folium map_1 = folium.Map(location=[45.372, -121.6972], zoom_start=12, tiles='Stamen Terrain') map_1.simple_marker([45.3288, -121.6625], popup='Mt. Hood Meadows') map_1.simple_marker([45.3311, -121.7113], popup='Timberline Lodge') map_1.create_map(path='mthood.html') I can include HTML in the popup, but I'd like to embed a webpage. Here is my mock-up. Is it possible?
accepted answer: http://stackoverflow.com/a/38152612
tagged with: http://stackoverflow.com/tag/html
downvote count: 0

http://stackoverflow.com/q/29566545
has answer: http://stackoverflow.com/a/29566690
has title: Setting background image baed on number of array or object items
answer count: 4
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29566681
tagged with: arrays
downvote count: 0
possible better answer: http://stackoverflow.com/a/29566690
has body: I am trying to append and set the background image of divs based on the number of array items or object items(both do the same thing so I want to use one or the other). However, when I do this, the divs are being added to the parent div correctly, but only one image is being added to all of them, only three divs should have the same background image but I'm seeing the same for all of them. Can anyone explain why? JS This is the version using an array. var plane_images = ["images/Top.png", "images/ata21.png", "images/ata26.png", "images/Top.png", "images/Top.png"]; for(var img = 0; img < plane_images.length; img++){ $("#menu").append(" "); $(".schematics").css("background-image", "url(" +plane_images[img] +")"); console.log(plane_images[img]); } This is the object oriented version. var Plane_Images = { top: "images/Top.png", structure: "images/ata21.png", electrics: "images/ata26.png", fuel: "images/Top.png", hydraulics: "images/Top.png" } for(var images in Plane_Images){ var image_src = Plane_Images[images]; $("#menu").append(" "); $(".schematics").css("background-image", "url(" +image_src +")"); console.log(image_src); } One thing I should note is that each of the console logs are showing me the correct values being passed. HTML
score: 1
tagged with: jquery
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/47282629
has comment: http://stackoverflow.com/comment/47282664
has comment: http://stackoverflow.com/comment/47282795
tagged with: css
has answer: http://stackoverflow.com/a/29566706
upvote count: 1
has answer: http://stackoverflow.com/a/29566681
tagged with: oop
has answer: http://stackoverflow.com/a/29566708
tagged with: javascript

http://stackoverflow.com/comment/57750227
comment on: http://stackoverflow.com/q/29541069
score: 0
has text: What do you mean by "something" ? Below is the answert for that question.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29652628
tagged with: exchange-server
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has answer: http://stackoverflow.com/a/29652841
has answer: http://stackoverflow.com/a/29652773
score: 0
has comment: http://stackoverflow.com/comment/47445167
has title: JavaScript to PHP data exchange via JSON not working
answer count: 2
has comment: http://stackoverflow.com/comment/47445172
type: UnansweredQuestion
tagged with: php
has body: I created a simple contact us form that would capture the data and send to the server end via JSON and display it on the PHP page. I'm a beginner to this whole JSON thing. Please tell me where I've gone wrong. JavaScript &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function(){ var arr = { firstName : document.getElementById('fName').value, lastName : document.getElementById('lName').value, email : document.getElementById('email').value, comment : document.getElementById('comment').value, rate : document.getElementById('select').value }; $.ajax({ url: 'contact.php', type: "post", data: arr, contentType: 'application/json; charset=utf-8', dataType: "json" success: function(msg) { alert("msg"); } }); }); &lt;/script&gt; PHP &lt;?php $example = $_POST['arr']; echo $example; ?&gt; HTML &lt;body&gt; &lt;h1&gt; Contact Us &lt;/h1&gt; We value your feedback. Send in your questions, suggestions, ideas to help us improve our service. &lt;h2 align="Center"&gt; Search us on Google Maps&lt;/h2&gt; &lt;br&gt; &lt;br&gt; &lt;div id="map-canvas" &gt; &lt;/div&gt; &lt;form action="contact.php" name="form" method="post" &gt; &lt;div id= "result"&gt; &lt;br&gt;Name :&lt;br&gt; &lt;input type="text" name="fName" id="fName" required &gt; &amp;nbsp; &amp;nbsp; &lt;input type="text" name="lName" id="lName" required &gt; &lt;br&gt; &lt;br&gt; Email: &lt;br&gt; &lt;input type="email" name="email" id="email" required &gt; &lt;br&gt; &lt;br&gt; Comment: &lt;br&gt; &lt;textarea name= "comment" rows="8" cols="50" autofocus&gt;&lt;/textarea&gt; &lt;br&gt; &lt;br&gt; Rate our Website &lt;select name="select" id="selected" autofocus&gt; &lt;option value = "1" name= "rate"&gt; 1 &lt;/option&gt; &lt;option value = "2" name= "rate"&gt; 2 &lt;/option&gt; &lt;option value = "3" name= "rate"&gt; 3 &lt;/option&gt; &lt;option value = "4" name= "rate"&gt; 4 &lt;/option&gt; &lt;option value = "5" …
type: Question

http://stackoverflow.com/comment/47442753
score: 0
has text: Sidenote: You have a missing ` ` tag.
type: QuestionComment
comment on: http://stackoverflow.com/q/29651376
type: Comment

http://stackoverflow.com/comment/56287205
has text: Looks very interesting!
comment on: http://stackoverflow.com/a/31513272
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/47450821
has text: I think there is a problem with Fiddle. It works until I save it. You could maybe copy paste it to Fiddle. It should work if you replace `content` with `d3.select("body")`
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29654130
score: 0

http://stackoverflow.com/comment/47501865
type: QuestionComment
comment on: http://stackoverflow.com/q/29682341
score: 1
has text: Is this code not working? What's happening?
type: Comment

http://stackoverflow.com/comment/47450819
type: AnswerComment
score: 0
has text: I'm CLUELESS!!! I just did a quick fiddle and it is working!!! But on the main project it doesn't!!! Any ideas? How to debug this? https://jsfiddle.net/jsantos_pt/vbd4u6bd/3/
type: Comment
comment on: http://stackoverflow.com/a/29654957

http://stackoverflow.com/comment/47405025
has text: I actually left out the tag to set html { height: 100%; } and that fixed it right up.
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29630922
type: Comment

http://stackoverflow.com/comment/47308187
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29579784
has text: Please show us your approach, that fails.

http://stackoverflow.com/q/29682163
accepted answer: http://stackoverflow.com/a/29682436
has comment: http://stackoverflow.com/comment/47502946
linked to: http://stackoverflow.com/q/19739755
favorite count: 0
has comment: http://stackoverflow.com/comment/47501862
tagged with: node.js
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47501450
type: Question
possible better answer: http://stackoverflow.com/a/29682366
has answer: http://stackoverflow.com/a/29682366
tagged with: javascript
has body: function inboxUsers(){ for (var i=0; i&lt;uniqueArray.length; i++){ var getUsername = 'SELECT userName FROM users WHERE userId = ' + uniqueArray[i]; db.query(getUsername, function(err, results) { if (err) { console.log('Error in database'); throw err; } for(var i in results){ console.log('single',results[i].userName); inboxUserList.push(results[i].userName); } }); } sample(); } function sample(){ console.log('same function'); } This is my console output. same function single user1 single user2 single user3 In this code I called the function sample() after for loop, but it called the sample() function before for loop ends. I want to call the sample() function when for loop ends. I am a beginner for stackoverflow, if i have error please apologize me. Thank you
has title: Call function when for loop finished in Node js
upvote count: 3
answer count: 2
tagged with: for-loop
has comment: http://stackoverflow.com/comment/47501394
tagged with: function
downvote count: 1
has answer: http://stackoverflow.com/a/29682436

http://stackoverflow.com/q/29652911
tagged with: jquery
has comment: http://stackoverflow.com/comment/47445766
linked to: http://stackoverflow.com/q/7571370
has answer: http://stackoverflow.com/a/29653082
has comment: http://stackoverflow.com/comment/47451959
favorite count: 0
score: 6
linked to: http://stackoverflow.com/q/8378243
has comment: http://stackoverflow.com/comment/47446079
upvote count: 6
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47452509
possible better answer: http://stackoverflow.com/a/29653082
type: Question
has answer: http://stackoverflow.com/a/29656088
accepted answer: http://stackoverflow.com/a/29656088
answer count: 2
has body: I'm trying to catch whether the mousewheel is triggered and whether it's scrolled up or down without actually scrolling the page (body has an overflow: hidden). Any idea's how I can achieve this using jQuery or pure javascript? $(window).scroll(function(){ if( /* scroll up */){ } else { /* scroll down */ } });
has title: Catch mousewheel up or down with jQuery/JS, without actually scrolling
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/29544442
has comment: http://stackoverflow.com/comment/98005920
has comment: http://stackoverflow.com/comment/100454415
has body: For the second part of your question you can use reduce to good effect here: const grades = [80, 77, 88, 95, 68]; const grades2 = []; function getAvg(grades) { if (grades.length === 0) return 'Empty grades array'; return grades.reduce((acc, c) =&gt; acc + c, 0) / grades.length; } console.log(getAvg(grades)); console.log(getAvg(grades2)); The other answers have given good insight into why you got 68, so I won't repeat it here.
downvote count: 0
answers question: http://stackoverflow.com/q/29544371
type: Answer
upvote count: 44
has comment: http://stackoverflow.com/comment/139240100
score: 44

http://stackoverflow.com/comment/47421164
has text: Are you trying to do a static design (just HTML and CSS)? Or are you adding the element with Javascript and you want to position it with Javascript? Also, does it overlap with other objects (e.g. need to be positioned absolutely) or can it be part of the normal page layout? And, please tell us exactly which element in your HTML you are trying to position relative to which other element. You've included HTML, but not told us which items in it you're asking about.
type: QuestionComment
comment on: http://stackoverflow.com/q/29639443
score: 0
type: Comment

http://stackoverflow.com/comment/47373058
has text: @LinDong I'm telling you it's impossible to stop XSS under these circumstances. In fact, it's a waste of time to try to stop XSS under these circumstances; all user input should be validated and cleansed on the server side.
comment on: http://stackoverflow.com/a/29612983
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47405091
type: Comment
type: QuestionComment
has text: you using express too? have some build:dist? may be .json file is ignored in dist, you may need to put it in assets folder.
comment on: http://stackoverflow.com/q/29630957
score: 0

http://stackoverflow.com/a/46865234
type: Answer
has comment: http://stackoverflow.com/comment/81283426
has comment: http://stackoverflow.com/comment/81282902
upvote count: 65
downvote count: 2
has body: To modify deeply nested objects/variables in React's state, typically three methods are used: vanilla JavaScript's Object.assign, immutability-helper and cloneDeep from Lodash. There are also plenty of other less popular third-party libs to achieve this, but in this answer, I'll cover just these three options. Also, some additional vanilla JavaScript methods exist, like array spreading, (see @mpen's answer for example), but they are not very intuitive, easy to use and capable to handle all state manipulation situations. As was pointed innumerable times in top voted comments to the answers, whose authors propose a direct mutation of state: just don't do that. This is a ubiquitous React anti-pattern, which will inevitably lead to unwanted consequences. Learn the right way. Let's compare three widely used methods. Given this state object structure: state = { outer: { inner: 'initial value' } } You can use the following methods to update the inner-most inner field's value without affecting the rest of the state. 1. Vanilla JavaScript's Object.assign const App = () => { const [outer, setOuter] = React.useState({ inner: 'initial value' }) React.useEffect(() => { console.log('Before the shallow copying:', outer.inner) // initial value const newOuter = Object.assign({}, outer, { inner: 'updated value' }) console.log('After the shallow copy is taken, the value in the state is still:', outer.inner) // initial value setOuter(newOuter) }, []) console.log('In render:', outer.inner) return ( Inner property: {outer.inner} ) } ReactDOM.render( <App />, document.getElementById('react') ) Keep in mind, that Object.assign will not perform a deep cloning, since it only copies property values, and that's why what it does is called a shallow copying (see comments). For this to work, we should only manipulate the properties of primitive types (outer.inner), that is strings, numbers, booleans. In this example, we're creating a new constant (const newOuter...), using Object.assign, which cr…
has comment: http://stackoverflow.com/comment/98357044
has comment: http://stackoverflow.com/comment/84773505
has comment: http://stackoverflow.com/comment/116958330
answers question: http://stackoverflow.com/q/29537299
score: 63
has comment: http://stackoverflow.com/comment/98320999
has comment: http://stackoverflow.com/comment/81308195

http://stackoverflow.com/comment/47341505
type: QuestionComment
score: 2
has text: It looks like you're mixing standard Javascript and jQuery. `append` is a jQuery method, it can't be applied to a DOM element.
type: Comment
comment on: http://stackoverflow.com/q/29597391

http://stackoverflow.com/q/29623169
favorite count: 0
tagged with: backbone.js
has comment: http://stackoverflow.com/comment/47398040
type: UnansweredQuestion
tagged with: casperjs
answer count: 0
upvote count: 2
score: 1
has body: I have a very frontend-heavy application, built in Backbone, and I would like to replace messy dirty unit tests that we wrote to tests view behaviour with CasperJS functional tests. I would like to have a report which shows me how much of my client-side code has been actually covered when running my functional tests. Is there a way to do this? The only thing I found was this stackoverflow question, which points to coverage for server-side code. I am currently using Istanbul for coverage reports on my Jasmine unit-tests, so bonus points for anyone who can come up with a way to combine jasmine unit-test coverage with the CasperJS coverage in istanbul.
linked to: http://stackoverflow.com/q/25229613
downvote count: 1
type: Question
tagged with: testing
has title: Is there a way to get _client-side_ test coverage in CasperJS?
tagged with: javascript
has comment: http://stackoverflow.com/comment/47393108

http://stackoverflow.com/comment/47262320
type: Comment
comment on: http://stackoverflow.com/a/29555850
score: 0
type: AnswerComment
has text: Me too. Something might be wrong in OPs environment. Maybe he ran the experiment without `var` before.

http://stackoverflow.com/a/29666992
has comment: http://stackoverflow.com/comment/47472826
type: Answer
score: 0
has body: So you need to change the hash on the end of the URL? i.e. from #/ to #/otherpage/ ? If so, location.hash = "/otherpage/";
answers question: http://stackoverflow.com/q/29666798

http://stackoverflow.com/q/29658189
has answer: http://stackoverflow.com/a/29658950
tagged with: javascript
has body: While developing web app, I prefer to have performance closer to production quality. At the moment my little project is Requirejs based so I am trying accomplish my goal by using r.js. In one of cases I want to exclude some modules(files) from compilation/minification process, but I do not know how to do that. At the moment I have a next build script: ({ mainConfigFile : "../app/js/main.js", appDir: "../app", baseUrl: "js", optimizeCss: "standard", fileExclusionRegExp: /\.git/, dir: "dist", modules: [ { name: "main", exclude: [ "infrastructure", "modules/app" ] } ] }) So what I should do for excluding some modules(files), for example jquery module, from compilation/minification process ?
favorite count: 0
type: Question
has title: r.js - exclude some modules from compilation/minification process
accepted answer: http://stackoverflow.com/a/29658950
tagged with: requirejs
tagged with: r.js
answer count: 1
score: 4
has comment: http://stackoverflow.com/comment/47461738
upvote count: 4
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/comment/47310134
type: QuestionComment
has text: I want firstDate in calculationDataService to show the same value as dt (the date selected in the popup as the popup date is changed by the user).
comment on: http://stackoverflow.com/q/29573242
score: 0
type: Comment

http://stackoverflow.com/q/29581802
has body: I'm looking for a plugin for a website that checks that status of an online server. No matter how much I searched, I could not find one that uses simple HTML or CSS. I cannot use PHP because Weebly doesn't seem to understand it. I can use CSS, HTML, and Javascript. All I need is something that tells the user if the server is online or offline.
has comment: http://stackoverflow.com/comment/47315170
tagged with: javascript
has comment: http://stackoverflow.com/comment/47315193
has comment: http://stackoverflow.com/comment/47312421
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/47313074
favorite count: 0
has comment: http://stackoverflow.com/comment/47313298
has comment: http://stackoverflow.com/comment/47316146
has comment: http://stackoverflow.com/comment/47312042
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47312864
tagged with: css
has title: HTML Server Status Checker
has comment: http://stackoverflow.com/comment/47311886
downvote count: 0
has comment: http://stackoverflow.com/comment/47314290
has answer: http://stackoverflow.com/a/29582832
linked to: http://stackoverflow.com/q/23997675
score: 1
type: Question

http://stackoverflow.com/comment/47246805
score: 0
comment on: http://stackoverflow.com/q/29547167
has text: Is it making it past `if (data.length > 0)` in step3?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29617674
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47421973
linked to: http://stackoverflow.com/q/28398550
has comment: http://stackoverflow.com/comment/47380624
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47484663
has comment: http://stackoverflow.com/comment/47380757
has title: jquery works in html page but not in chrome extension
tagged with: google-chrome-extension
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has comment: http://stackoverflow.com/comment/47418891
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47421590
has body: I have struggled for some time trying to figure out why my code wont run in a Chrome Browser Action Extension. If I build it all as a single HTML page and run it in a test it works fine. When I try to put the HTML in the "popup.html" file and then add the jquery code to my popup.js (Which contains some javascript that already works) it will not work. Basic action is: When extension icon is clicked, user sees 2 buttons to "add Link" or "Add Doc" When clicked, each button toggles open/closed a different iframe. Button tooltip also displays on hover. I am a novice programmer and fear I am missing something easy. What am I doing wrong? Here is popup.html file My Web Page click the button to get the current tab URL for cut/paste Try it Url displays Here Add Link Add Doc Fill out my Wufoo form! Fill out my Wufoo form! Here is the popup.js file //----Here is jquery script for button tooltip on hover----- $('#link').mouseenter(function(){ $('body').append(" "); $('#linkTooltip').html("Add a Web Link to your Portal"); $('#linkTooltip').css({ "top" : $(this).offset().top + MYTOPOFFSET, "left" : $(this).offset().left + MYLEFTOFFSET }); }); $('#link').mouseleave(function(){ $('#linkTooltip').remove(); }); $('#Doc').mouseenter(function(){ $('body').append(" "); $('#DocTooltip').html("Add a Document or online link to a document"); $('#DocTooltip').css({ "top" : $(this).offset().top + MYTOPOFFSET, "left" : $(this).offset().left + MYLEFTOFFSET }); }); $('#Doc').mouseleave(function(){ $('#DocTooltip').remove(); }); //--------Here is the jquery script to toggle the iframes when button clicked. $(document).ready(function(){ $("#testdiv").hide() $("#link").click(function(){ $("#testdiv").toggle() }); }); $(document).ready(function(){ $("#testdiv2").hide() $("#Doc").click(function(){ $("#testdiv2").toggle() }); }); Manifest file is: "manifest_version": 2, "name": "IT Vendorconnect Sample", "description": "This extension launches Wufoo Form on current page", "version": "1.0", "icons": { …
has comment: http://stackoverflow.com/comment/47413081
answer count: 0
score: 0
upvote count: 1
has comment: http://stackoverflow.com/comment/47439523

http://stackoverflow.com/a/29570671
has comment: http://stackoverflow.com/comment/47359765
has body: This is incorrect: script.src = 'http://maps.google.com/maps/api/js?v=3&amp;libraries=places!callback'; Per the documentation should be: script.src = 'https://maps.googleapis.com/maps/api/js?v=3&amp;libraries=places&amp;callback=initialize'; (not the &amp; instead of the !)
has comment: http://stackoverflow.com/comment/47360523
accepted answer of: http://stackoverflow.com/q/29567434
answers question: http://stackoverflow.com/q/29567434
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/q/29608467
has comment: http://stackoverflow.com/comment/47362800
has comment: http://stackoverflow.com/comment/47363528
has comment: http://stackoverflow.com/comment/47363228
has comment: http://stackoverflow.com/comment/47362830
has comment: http://stackoverflow.com/comment/47363274
has answer: http://stackoverflow.com/a/29608604
has comment: http://stackoverflow.com/comment/47363029
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/47362791
favorite count: 0
has comment: http://stackoverflow.com/comment/47363604
tagged with: ajax
has comment: http://stackoverflow.com/comment/47407121
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/47395487
score: 1
upvote count: 1
linked to: http://stackoverflow.com/q/29601982
type: Question
has body: I am currently using the following code to try and post an array using AJAX, however console shows no Form Data section when checking the Headers. $(document).on("click", "#saveB", function () { var qry_array = []; var qry = query(); var key = $('#save_key').val(); qry_array[key]=qry; console.log(qry_array); $.ajax({ type: "POST", url: "favourites.php", data: { query: qry_array }, success: function (response) { console.log (response); } }); }); favourites.php error_reporting ( E_ALL ); ini_set ( 'display_errors', 1 ); function saveQueries() { if (isset ( $_POST ['query'] )) { $arr = $_POST['query']; var_dump($arr); } else { echo "Key Missing"; } } saveQueries (); The response from console is Key Missing which means my query isn't being posted, why could this be??
tagged with: javascript
tagged with: jquery
has title: No form data when while posting an array using AJAX

http://stackoverflow.com/comment/47508153
comment on: http://stackoverflow.com/a/29684356
score: 0
has text: Absolutely. The array method works well if you have various filenames, but if they're really named 1.jpg, 2.jpg, etc. (with no gaps), then the `num+'.jpg'` method works great.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47238679
score: 0
comment on: http://stackoverflow.com/q/29543386
type: Comment
type: QuestionComment
has text: Is this actually what you were asking? or was there a problem you were trying to solve. Seems kinda silly to have an answer so short.

http://stackoverflow.com/q/29552094
has body: I got the intended behavior, but Im confused why... I have this Meteor method, which returns the value of a document key; the log statement proves such: findUserEmail: function(user_id){ var user = Meteor.users.find({_id: user_id}).fetch(); console.log(user[0].emails[0].address); return user[0].emails[0].address; } But when I call it on the client, the shared_user_email field is null: shared_user_email: Meteor.call('findUserEmail', $(ev.target).find('[name=shared_user]').val()) BUT, when I simulate calling the Meteor method by mimicking the server query on client, it returns the value that the Meteor method above logs: shared_user_email: Meteor.users.find({_id: $(ev.target).find('[name=shared_user]').val()}).fetch()[0].emails[0].address What is lost in translation when the client tries calling the server method? EDIT What happens when I use a Meteor method to insert a document into my collection, whose field relies on a Meteor method? I keep getting undefined for my shared_user_email field here: var newList = { title: $(ev.target).find('[name=title]').val(), description: $(ev.target).find('[name=description]').val(), dateCreated: today.toDateString(), owner: Meteor.userId(), owner_email: Meteor.users.find({_id: Meteor.userId()}).fetch()[0].emails[0].address, shared_user: $(ev.target).find('[name=shared_user]').val(), shared_user_email: Meteor.call('find_shared_user_email', $(ev.target).find('[name=shared_user]').val(), function(err, user_email){ return user_email; }) } Meteor.call('addList', newList, function(err, list){ return list; });
type: Question
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/29552503
score: 0
tagged with: meteor
has title: Meteor method returns null on client, same method run on client returns proper value
accepted answer: http://stackoverflow.com/a/29552503
possible better answer: http://stackoverflow.com/a/30791878
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/30791878

http://stackoverflow.com/q/29572976
type: Question
has body: I came across an Angular.js service named $httpParamSerializer and thought it could be useful for my code. However, when I tried to inject it Angular.js didn't recognize it and threw an "unknown provider" error. Isn't $httpParamSerializer a built-in service (just like $http)? Why is this happening? I have no problem injecting other built-in services such as $http, $httpBackend etc. Thanks.
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/29573879
downvote count: 0
has title: Unknown provider for $httpParamSerializer
favorite count: 0
tagged with: angularjs
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/36041260
accepted answer: http://stackoverflow.com/a/29573879
upvote count: 2
possible better answer: http://stackoverflow.com/a/36041260

http://stackoverflow.com/comment/47318069
has text: sorry the link is http://codepen.io/JustAnotherLostSoul/pen/wBLYLo
comment on: http://stackoverflow.com/q/29584873
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/47416773
has text: Thanks! That's simpler than I thought it would be. Thank you very much, I appreciate your time!
type: Comment
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29637052

http://stackoverflow.com/a/29653237
answers question: http://stackoverflow.com/q/29612014
has body: if you just want to increase the 'id' each time you create a view and and avoid creating any global variables then you can use javascript closures to do it. function counter(){ var count=0; return function (){ return ++count;}; } var increase = counter() var View = Backbone.View.extend({ initialize: function(model,options){ var id = increase(); this.model.set('id',id); } }); now whenever you will create an instance of this view its id will be increased by 1. you can read more on closures here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures .
score: 0
type: Answer

http://stackoverflow.com/q/29623616
type: Question
tagged with: sqlite
has answer: http://stackoverflow.com/a/32139374
upvote count: 6
tagged with: javascript
has body: I have a problem with Cordova SQLite plugin. How can I save BLOB image to SQLite? I have BLOB object in JS: Blob:{ size: 96874 type: "image/jpeg" __proto__: Blob length: 1} And I trying to save it INSERT INTO images (img) VALUES (?); And when i trying to get this image: SELECT img FROM images I get this string: img: "{"type":"image\/jpeg","size":96874}" How can i convert it to BLOB again? Also i trying to save images in base64, but i can't save big images to SQLite, because base64 string is very huge. (It's works with small images) Please, help me and sorry for my English.
has title: Cordova SQLite save BLOB
favorite count: 0
has answer: http://stackoverflow.com/a/72666772
answer count: 5
has answer: http://stackoverflow.com/a/29623760
has answer: http://stackoverflow.com/a/29627201
accepted answer: http://stackoverflow.com/a/29627201
tagged with: cordova
downvote count: 0
score: 6
possible better answer: http://stackoverflow.com/a/29623675
has answer: http://stackoverflow.com/a/29623675
type: AnsweredQuestion
tagged with: blob
tagged with: ionic-framework

http://stackoverflow.com/q/29650918
has answer: http://stackoverflow.com/a/29672089
accepted answer: http://stackoverflow.com/a/29672089
type: AnsweredQuestion
tagged with: reactjs
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has body: I have a slider that i am adding slides to it when the user clicks on a button with setState and then call the jquery plugin to update, i see the new element on the dom but its seems like the jquery slider does not update the change and add the slider. what is the problem? var Posts = React.createClass({ componentDidMount: function() { swiper = new Swiper ('.swiper-container', { nextButton: '.swiper-button-next', prevButton: '.swiper-button-prev' }); }, updateData: function() { this.setState({ posts: [{title:Math.random()}, {title:Math.random()},{title:Math.random()}] }); swiper.update(true); }, getInitialState: function() { return { posts: [{title:1111}, {title:2222}] } }, render: function() { console.log('run'); var postNodes = this.state.posts.map(function( post, i ) { return ( <Post title={post.title} key={i}/> ); }); return ( {postNodes} update Data ); } }); Fiddle: http://jsbin.com/tocujutaro/1/edit?html,js,output
has title: React with jquery does not update the UI on dom change
type: Question

http://stackoverflow.com/comment/47478183
type: AnswerComment
has text: The `$('div').html(value).html()` trick isn't completely reliable: see [this answer](http://stackoverflow.com/a/7124052/440921) for a better solution.
type: Comment
comment on: http://stackoverflow.com/a/29669447
score: 0

http://stackoverflow.com/comment/47508485
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29684219
has text: This _is_ a duplicate he's asking the exact same thing I meant when I asked the question there and is missing the same point. I gave your (good) answer an upvote and you're welcome to add an answer there - but this chaining ability is what both questions are about.
score: 0

http://stackoverflow.com/q/29614936
has comment: http://stackoverflow.com/comment/47375225
type: Question
has answer: http://stackoverflow.com/a/29614968
answer count: 1
tagged with: javascript
score: 4
favorite count: 0
has body: I am very new to JavaScript and could not understand the code below (code source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof) // defining constructors function C(){} function D(){} var o = new C(); // true, because: Object.getPrototypeOf(o) === C.prototype o instanceof C; // false, because D.prototype is nowhere in o's prototype chain o instanceof D; o instanceof Object; // true, because: C.prototype instanceof Object // true C.prototype = {}; var o2 = new C(); o2 instanceof C; // true // false, because C.prototype is nowhere in // o's prototype chain anymore o instanceof C; Why in the last line "o instanceof C" returns false? I don't understand how "C.prototype = {}" removes "C.prototype" from o's prototype chain. thank you!
upvote count: 4
tagged with: instanceof
downvote count: 0
type: UnansweredQuestion
has title: about the instanceof operator in JavaScript

http://stackoverflow.com/q/29662778
has answer: http://stackoverflow.com/a/29662880
type: Question
has answer: http://stackoverflow.com/a/29662846
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47465012
tagged with: jquery
has answer: http://stackoverflow.com/a/29663257
has body: Based on a condition i am assigning a new message to a variable then showing the message using jquery.Now after 2 seconds i want to hide the message and show another new message.The problem is as i am not showing the message into a html div so i am confused how to attain this ? if(newresp == "success") { var newmsg="&lt;img src=\"images/myimg.png\"&gt;&lt;span style='color:#00CCFF;font-size:25px;margin-top:2px'&gt; validated!&lt;/span&gt;"; var newmsg1="redirecting ......"; $("#status").hide().fadeIn('slow').html(newmsg); // i want to hide this newmsg now and then show the newmsg1 }
has title: How to hide this message using jQuery?
favorite count: 0
accepted answer: http://stackoverflow.com/a/29663257
has answer: http://stackoverflow.com/a/29662871
upvote count: 1
answer count: 4
type: AnsweredQuestion
score: 1
possible better answer: http://stackoverflow.com/a/29662880

http://stackoverflow.com/q/29588487
possible better answer: http://stackoverflow.com/a/29588922
has comment: http://stackoverflow.com/comment/47325110
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/29588922
answer count: 2
tagged with: http-post
has answer: http://stackoverflow.com/a/29589211
favorite count: 0
has title: javascript post failing others work fine - form related
tagged with: php
type: AnsweredQuestion
has body: I'm trying to POST some data extracted from a form via onsubmit. The POST fails (firebug shows it as a failure) even though the headers and POST data look fine. I've got plenty a number of other POST's working fine. The code used is a copy of exiting code just with a few changes (the response function and the php function called). I've tried reducing the data to be sent to a minimum, it still fails. I've also tried reducing the called PHP function to just echo a small string, literally just the one line. The only difference that I can see is that this process is invoked from the forms onsubmit. Here's some of the code: First the form (part of it) &lt;form id="jmcase" onsubmit=" return FLWG_editSubmit(18)" method="post"&gt; &lt;input id="jmcasename" type="text" size="150" value="Butler v Time [2015] 234" name="jmcasename"&gt; &lt;input type="submit" value="Submit"&gt;........ &lt;/form&gt; The FLWG_editSubmit function called:- function FLWG_editSubmit($caseid) { // Build variables to be posted var pstv = 'FLWGcaseid='+caseid; // get lists from form pstv = pstv+formToPostVars('jmjudge','r,,sdl,tdl,udl'); pstv = pstv+formToPostVars('jmcat','r,,sdl,tdl,udl'); pstv = pstv+formToPostVars('jmcsl','r,,sdl,tdl'); pstv = pstv+formToPostVars('jmsid','r,,sdl,tdl'); pstv = pstv+formToPostVars('jmauth','r,,sdl,tdl'); pstv = pstv+formToPostVars('jmact','r,,sdl,tdl'); **updateCase**(caseid,pstv); //var obj = newRequestObject(); //obj.onreadystatechange = function() { // if (obj.readyState == 4) { // if (obj.status == 200) { // editCaseReturn(htmlspecialchars_decode(obj.responseText, 'ENT_QUOTES')); // delete obj; // obj = null; // } // } //} //obj.open('POST','include/FLWG_updateCase.php',true); //obj.setRequestHeader('Accept-Charset','utf-8'); //obj.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); //obj.send("TEST=XXX");`enter code here` } Function updateCase is another version of the commented out code, which is itself a copy from working POST's (although the…
accepted answer: http://stackoverflow.com/a/29589211
tagged with: forms
downvote count: 1
tagged with: http
linked to: http://stackoverflow.com/q/3350247
type: Question
upvote count: 0

http://stackoverflow.com/q/29670924
tagged with: javascript
downvote count: 0
tagged with: web
favorite count: 0
has title: how to check active session on dynamic webpage
answer count: 0
type: UnansweredQuestion
score: 1
tagged with: java
has comment: http://stackoverflow.com/comment/47480308
has body: I have been asked previously this and not sure what is supposed to be the answer, the question is suppose you had an online trading page, that allows you to buy and sell stocks whereas all the stocks are constantly changing via ajax, how do you implement to check if the user/session is still active? I had suggested to use javascript, where when the user is not keying or not moving the mouse it will prompt that the session will end, and log out the user Second alternative, would be to put a session-timeout in web.xml whereas once the user has session timed out it will require the user to relogin. But both answers I have provided seemed wrong. What is the proper, standard way to handling session on a dynamic page? (i.e buying airplane tickets or stock trading page?) Can anyone provide example?
upvote count: 1
type: Question
tagged with: session

http://stackoverflow.com/a/29679837
accepted answer of: http://stackoverflow.com/q/29615058
answers question: http://stackoverflow.com/q/29615058
type: AcceptedAnswer
has body: A technique for adding the additional elements without having to create ugly strings of html in the JavaScript is to start with one hidden set of the elements in the html. At page load time, you remove that set, but keep a reference to it. Then when you want to add a set to the page, you clone the set you removed. All of this is easier if you add a container div around the additional inputs. You also need to make sure id attribute values are unique. In the case of the remove buttons, you can replace the id with a class. As for the input id values, if you really need them, you can add an index value to them. Since the remove buttons are dynamically added, I suggest using event delegation when binding the click-handler. HTML: Tilføj endnu et produktnavn X JavaScript: $(function() { var MAX = 10; var $addBtn = $('#add_another_product_name'), $additionalContainer = $('#additional_product_names'); $TEMPLATE = $additionalContainer.children(':first').remove(); function update() { var $additonalDivs = $additionalContainer.children(); // Enable/disable the add button. $addBtn.prop('disabled', $additonalDivs.length >= MAX); // Re-index the "id" attributes. $additonalDivs.find('input').attr('id', function(i) { return 'added_product_name[' + i + ']'; }); } $addBtn.click(function() { $TEMPLATE.clone().appendTo($additionalContainer).show(); update(); }); $('#product_name').on('click', '.remove_product_name', function() { $(this).closest('.add_remove_product_name').remove(); update(); }); }); jsfiddle
score: 0
has comment: http://stackoverflow.com/comment/47506744
type: Answer

http://stackoverflow.com/comment/47226274
has text: Thanks! Have no idea why this didn't occur to me!
comment on: http://stackoverflow.com/a/29536990
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/29540137
type: AnsweredQuestion
duplicate of: http://stackoverflow.com/q/1905289
linked to: http://stackoverflow.com/q/1905289
type: Question
answer count: 1
tagged with: javascript
score: 0
has body: alert("This is a test."); How do I remove "The page at stackoverflow.com says:" part of a popup?
has answer: http://stackoverflow.com/a/29540240
accepted answer: http://stackoverflow.com/a/29540240
favorite count: 0
upvote count: 2
downvote count: 2
has comment: http://stackoverflow.com/comment/47232307
has title: How can I remove the "The page at (some website) says:" part of a popup?
has comment: http://stackoverflow.com/comment/47232642
has comment: http://stackoverflow.com/comment/47232233

http://stackoverflow.com/comment/47232239
type: QuestionComment
comment on: http://stackoverflow.com/q/29539163
has text: now I have tried to explained, please go through it.
score: 0
type: Comment

http://stackoverflow.com/comment/47322058
score: 0
type: Comment
has text: Whoops didn't see the other answers as I was typing mine up.
comment on: http://stackoverflow.com/a/29587232
type: AnswerComment

http://stackoverflow.com/q/29574658
has body: I have a checkbox and I want to detect on a button click event if it's checked or not. I am using ASP MVC 5 and tried several methods but nothing worked for me. Here's the code: $("#btnPrintVoucher").click(function () { if ($('#chkPrintSlip').prop('checked')) { alert("chked"); } else { alert($('#chkPrintSlip').val()); } });
downvote count: 1
has answer: http://stackoverflow.com/a/29574694
accepted answer: http://stackoverflow.com/a/29574680
type: Question
has comment: http://stackoverflow.com/comment/47298324
tagged with: javascript
has comment: http://stackoverflow.com/comment/47298305
possible better answer: http://stackoverflow.com/a/29574717
has comment: http://stackoverflow.com/comment/47298221
has answer: http://stackoverflow.com/a/29574717
tagged with: asp.net-mvc-5
answer count: 3
has title: How to check if a checkbox is checked ASP using JQuery
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/29574680
has comment: http://stackoverflow.com/comment/47298342
type: AnsweredQuestion
upvote count: 2
score: 1

http://stackoverflow.com/comment/47288011
type: AnswerComment
score: 0
has text: Wish it could but we're back to empty now :(
type: Comment
comment on: http://stackoverflow.com/a/29568709

http://stackoverflow.com/a/29581598
answers question: http://stackoverflow.com/q/29581511
score: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29581511
type: Answer
has comment: http://stackoverflow.com/comment/47311502
has body: You have two ways to access a js property: var obj = {prop1: 'p1', prop2: 'p2'}; console.log(obj.prop1); //p1 var propName = 'prop'; var index = 1; console.log(obj[propName + index]); //p1 Simply, use the second way: newsData['pubDate'+$index][0]; JSFIDDLE.
upvote count: 1

http://stackoverflow.com/comment/47341472
type: Comment
type: QuestionComment
score: 3
comment on: http://stackoverflow.com/q/29597391
has text: is there an `append` in javascript ?

http://stackoverflow.com/comment/47371104
comment on: http://stackoverflow.com/a/29612440
has text: @Nikola I of course agree with you, there is just a very verbal/authorative minority that disagrees and prefers the Object.create way. But since ES6 embraces classes it becomes less an issue in the future
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/29683951
has answer: http://stackoverflow.com/a/29684002
score: 0
answer count: 2
tagged with: jquery
possible better answer: http://stackoverflow.com/a/29684002
has comment: http://stackoverflow.com/comment/47504758
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47504813
accepted answer: http://stackoverflow.com/a/29684085
type: Question
has comment: http://stackoverflow.com/comment/47504822
has comment: http://stackoverflow.com/comment/47504934
has body: I have the following code that copies text into a hidden input and submits it to redraw parts of the page. function searchHelp() { // Copy value to hidden input jQuery('input.searchInput').bind('change paste keyup', function() { jQuery('.hide.searchBox').val(jQuery(this).val()); }); // Get the current page name var pageName = window.location.pathname; pageName = pageName.split("/").pop(); if(pageName === 'blu_search') { jQuery(".searchBox input").keypress(function(event) { console.log("Inside keypress"); if (event.which == 13) { event.preventDefault(); jQuery(".hide.searchSubmit").click(); } }); jQuery(".searchSubmit").on("click", function() { jQuery(".hide.searchSubmit").click(); console.log("hidden button clicked"); }); } else { jQuery(".searchBox input").keypress(function(event) { if(event.which === 13) { event.preventDefault(); jQuery(".searchSubmit").click(); } }); } } In the console I get The specific line that causes the error is jQuery(".hide.searchSubmit").click();. When I comment this line the code runs without any errors. Does anyone know why this or how to trouble shoot this type of error? EDIT: Here is the error expanded out. I was not able to get all of in one go. Here is a paste of the entire output, http://pastebin.com/hSYnRskB
has comment: http://stackoverflow.com/comment/47504912
tagged with: javascript
has title: jquery bubbling up unknown error
has answer: http://stackoverflow.com/a/29684085

http://stackoverflow.com/comment/47224192
has text: var LIVERELOAD_PORT = 35729, lrSnippet = require('connect-livereload')({ port: LIVERELOAD_PORT }), mountFolder = function( connect, dir ) { return connect.static(require('path').resolve(dir)); };
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29535678

http://stackoverflow.com/comment/47458413
has text: Good point, though I don't know in advance what keys I will have to deal with. In this case it would work, but if a user requests more than these keys or something completely different it won't work anymore.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29654034
type: AnswerComment

http://stackoverflow.com/comment/47429614
score: 0
comment on: http://stackoverflow.com/q/29643609
type: Comment
type: QuestionComment
has text: @CodeWithCoffee There is some misunderstanding. I want to pass json data dynamically. So that if the json array is changed it should automatically pass right number of name/ data pairs to series.

http://stackoverflow.com/comment/47480528
type: AnswerComment
comment on: http://stackoverflow.com/a/29650669
type: Comment
has text: it was meant like "find the id / index of the element with value "fish"
score: 0

http://stackoverflow.com/q/29589719
has answer: http://stackoverflow.com/a/29604675
tagged with: mobile
answer count: 1
tagged with: javascript
tagged with: user-agent
tagged with: css
has body: This must be very common.... I apologize, but can't find a working solution here... I'm working on a site (retrofit) and it has responsive CSS such as: /* Refecence from responsive.css /* crank up to 5000px to support high res monitors and TV's */ @media only screen and (min-width: 1200px) and (max-width: 5000px) /* Portrait tablet to landscape and desktop - BROWSER SIZE 2 */ @media only screen and (min-width: 991px) and (max-width: 1200px) /* Landscape phone to portrait tablet - BROWSER SIZE 3 */ @media only screen and (min-width: 767px) and (max-width: 991px) /* All Mobile Sizes (devices and browser) - BROWSER SIZE 4 */ @media only screen and (max-width: 767px) /* Landscape phones and down - BROWSER SIZE 5 */ @media (max-width: 480px) /* iphone portrait mode - BROWSER SIZE 6 */ @media (max-width: 320px) I'm new to this, and done quite a bit of research, but I have a couple of questions: I have the plan to have two blocks of HTML, one hidden, and use JS or CSS to hide the appropriate block based on user being on mobile device or not. I wish to avoid useragent, as there are way too many. By default, Android no longer parses numbers as such (as per other posts) without the 'tel:'. I tested on Nexus 5. On the other hand Firefox asks for device to use on a 'tel: 'link. Can I use my current @media CSS blocks? If so what about retina? OR can useragent based JS be ok somehow? Other options, I mean what do most people do??? Help is appreciated.
score: 0
type: UnansweredQuestion
has title: How to stop "tel:number" links from working on desktop / tablets
type: Question

http://stackoverflow.com/comment/47492823
has text: you could use something like cURL to make sure your page is okay and can accept post data. not sure why it wouldn't but one more thing to cross off the list. *curl --data "answers=test_answers" http//example.com/DB_add.php*
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29677161
score: 0

http://stackoverflow.com/a/29599860
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 2
has body: There is no need to use results[0].geometry.location.k + ',' + results[0].geometry.location.D because results[0].geometry.location is itself a LatLng object Here is the complete code that works: &lt;script&gt; function getLatLong(address, callback){ var geo = new google.maps.Geocoder; geo.geocode({'address':address},function(results, status){ if (status == google.maps.GeocoderStatus.OK) { console.log(results[0].geometry.location); callback(results[0].geometry.location);} else{return;} });} $(document).ready(function(){ getLatLong("indore", function(addr){ console.log(addr); var mapOptions = { zoom: 4, center: addr } var map = new google.maps.Map(document.getElementById('map-canvas'),mapOptions); var myLatLng = addr;//new google.maps.LatLng(addr); var beachMarker = new google.maps.Marker({ position: myLatLng, map: map }); console.log('loaded');}) });&lt;/script&gt;&lt;/head&gt; I have removed that "&lt;?= $r['address'] ?&gt;" and marker image, please add it back again
accepted answer of: http://stackoverflow.com/q/29599458
score: 2
answers question: http://stackoverflow.com/q/29599458

http://stackoverflow.com/comment/47329136
comment on: http://stackoverflow.com/q/29590412
score: 0
type: QuestionComment
type: Comment
has text: IE 11 seems to work though...

http://stackoverflow.com/comment/47521915
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29669583
has text: No problem, I understand you'd like to avoid using a 3rd party tool if this is all you want it for. If you haven't tried using AutoHotKey before though I think you'll find it very addictive, not just for this but for all sorts of applications! (It works great for games that require key combinations to perform certain actions!)
score: 0

http://stackoverflow.com/a/68852292
upvote count: 1
has body: function getPin() { let pin = Math.round(Math.random() * 10000); let pinStr = pin + ''; // make sure that number is 4 digit if (pinStr.length == 4) { return pinStr; } else { return getPin(); } } let number = getPin();
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29640432
type: Answer

higher-order-functions
tags question: http://stackoverflow.com/q/29550086
tag name: higher-order-functions
type: Tag

http://stackoverflow.com/a/29647870
type: Answer
upvote count: 0
has comment: http://stackoverflow.com/comment/47436849
downvote count: 1
has comment: http://stackoverflow.com/comment/47435925
score: -1
answers question: http://stackoverflow.com/q/29647440
has body: Here you go with a basic search. Now you only have to loop again and check for same tags. http://jsfiddle.net/8xhnyueo/3/ My search algorithm is: $('#search').on("keyup", function() { $("#res").empty(); for(var i=0;i<data.length;i++){ if(data[i].titre.indexOf($(this).val()) !== -1) { var output = ' '; output += ' '+ data[i].titre + ' '; output += ''+ data[i].description +''; output += ' '+ data[i].tag.tag1 +''+ data[i].tag.tag2 +' '; output += ' '; output += ' '; $("#res").append(output); } } });

http://stackoverflow.com/comment/47391111
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29623322
has text: Can we select and make active `program` one by default on page load? @mplungjan
score: 0

http://stackoverflow.com/a/29571670
upvote count: 0
has body: Made a few changes to your HTML: Select a table: Appointments Services Status Please select a table to work with... Work Order Number Work Status Job Type/Stage Status of New Entry: Type of Maintenance being completed: With a little CSS you can just hide the static elements and populate the Table Rows with the result of your AJAX. .hidden { display: none; } Here is what I did with JQUERY: $(function () { $("select[name='users']").on('change', function () { if ($(this).val() != "") { $.get( "displaySQL.php", { q: $("this").val() }, function (resText) { // Assuming just the table body response $("#resultTable tbody").html(respText); } ); $("#txtHint").hide(); $("#resultTable").show(); $("#newRowForm").show(); } else { $("#txtHint").show(); $("#resultTable").hide(); $("#newRowForm").hide(); } }); }); This is all working here: http://jsfiddle.net/Twisty/43jcg03r/
type: Answer
downvote count: 1
score: -1
answers question: http://stackoverflow.com/q/29570299
has comment: http://stackoverflow.com/comment/47292993
has comment: http://stackoverflow.com/comment/47292884

http://stackoverflow.com/comment/47500416
has text: What i did finally is making a simple action, putting in a string with " " to separate each word and then in the action split them into an array. Thanks all for helping.
comment on: http://stackoverflow.com/a/29678990
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/61911142
score: 0
type: Answer
has body: &lt;?php echo $form-&gt;field($model, 'icon_path')-&gt;widget(FileInput::classname(), [ 'options' =&gt; ['accept' =&gt; 'image/*','multiple'=&gt;false, 'id' =&gt; 'category_icon_image'], 'pluginLoading' =&gt; false, 'pluginOptions' =&gt; [ 'initialPreview' =&gt; (!$model-&gt;isNewRecord) ? [ 'web/filebox/'.$model-&gt;icon_path ] : '', 'initialPreviewAsData' =&gt; true, 'browseIcon' =&gt; '&lt;i class="glyphicon glyphicon-camera"&gt;&lt;/i&gt; ', 'showPreview' =&gt; true, 'showCaption' =&gt; false, 'showRemove' =&gt; false, 'showUpload' =&gt; false, 'showClose' =&gt; false, 'previewTemplates' =&gt; 'object', 'layoutTemplates' =&gt; 'preview', 'uploadUrl' =&gt; 'category-item/category-item/ajax-image-upload', 'uploadAsync' =&gt; false, 'deleteUrl' =&gt; Url::toRoute('category-item/delete-image?id='.$model-&gt;category_item_id) ], 'pluginEvents' =&gt; [ 'filebatchuploadsuccess' =&gt; 'function(event, data, previewId, index) { console.log(data.response) }', 'filebatchselected' =&gt; "function(event,files){ var input = $('#category_icon_image'); input.fileinput('upload'); $('#categoryitem-icon_path_pre').val(files[0].name); }", ], ]) ?&gt;
answers question: http://stackoverflow.com/q/29626410

http://stackoverflow.com/comment/47217524
score: 0
type: Comment
has text: or just `if( this.hovered ){ ... }else{ this.hovered=true; ... }`
comment on: http://stackoverflow.com/a/29532107
type: AnswerComment

http://stackoverflow.com/q/29621077
has comment: http://stackoverflow.com/comment/47386155
has answer: http://stackoverflow.com/a/29621128
type: Question
type: AnsweredQuestion
tagged with: conditional-statements
has answer: http://stackoverflow.com/a/29621125
has comment: http://stackoverflow.com/comment/47386247
tagged with: if-statement
has answer: http://stackoverflow.com/a/29621145
tagged with: javascript
has title: multiple conditions in an if - else in javascript
score: 0
upvote count: 1
downvote count: 1
has body: I'm trying to make a program that only accepts a few values. So, if "e" variable is not 1 or 2 or 3, says that the number is not correct, but if the value is equal to those numbers, then the else part is run. All of this may sound very begginer level and easy to implement, and it is, but I ran the code and EVERY vaule I set to "e" runs the if part. Here is code: var e; e=parseFloat(prompt("Input e","")); if(e!=1 || e!=2 || e!=3) { alert("put again E"); } else { //whatever }
favorite count: 0
possible better answer: http://stackoverflow.com/a/29621128
accepted answer: http://stackoverflow.com/a/29621124
answer count: 5
has answer: http://stackoverflow.com/a/29621124
has answer: http://stackoverflow.com/a/29621161
has comment: http://stackoverflow.com/comment/47386161

http://stackoverflow.com/a/29752543
accepted answer of: http://stackoverflow.com/q/29630192
answers question: http://stackoverflow.com/q/29630192
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47676480
upvote count: 2
type: Answer
score: 2
has body: My solution to this would be have some JavaScript waiting on the form and not allowing it to save until your plugin has passed in a "complete" message in which case the form can be saved. Near the end of your plugin code i would make it update a value on your form which the JavaScript would look at, if this field isn't populated, don't allow the form to save. The JavaScript is the easy part using the onSave method and making sure you pass the execution object as the first parameter and assuming you create the field for your plugin a bool function preventSave(exobj) { var pluginFinished = Xrm.Page.getAttribute("pluginFinished"); if (pluginFinished.getValue() == false || pluginFinished.getValue() == null) { exobj.getEventArgs().preventDefault(); } } if there isn't a value or null the JavaScript will not allow the form to save. You may want to provide a message after the preventDefault (prevent save) to alert the uses no save has occurred. Hope this helps
has comment: http://stackoverflow.com/comment/47762573
has comment: http://stackoverflow.com/comment/47673935
has comment: http://stackoverflow.com/comment/47680158
has comment: http://stackoverflow.com/comment/47679454
downvote count: 0

http://stackoverflow.com/a/29567593
answers question: http://stackoverflow.com/q/29564127
score: 0
type: Answer
has body: So the problem I'm having is that it appears the Webpack log output is a bit misleading. When you have multiple "resolve" locations, it seems webpack only reports the current directory as the location of the missing dependencies despite searching other paths and having root paths defined in the resolve config. If you have a pathing problem that is in, say, your root resolve path, webpack does not indicate that it tried to look there.

http://stackoverflow.com/q/29548601
tagged with: cordova
has comment: http://stackoverflow.com/comment/47279963
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/37251950
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47285852
type: Question
tagged with: ios
tagged with: javascript
has answer: http://stackoverflow.com/a/45794236
has body: I'm developing a Cordova / PhoneGap-based application that has an embedded text editor. To access selected files, I'm having the user browse the mobile device by using the html &lt;input type=file&gt; element: &lt;div class="control-row"&gt; &lt;label for="selFile" class="topcoat-button"&gt;{{t 'view.lblSelect'}}&lt;/label&gt; &lt;input type="file" value="" id="selFile" multiple&gt; &lt;/div&gt; On iOS, however, clicking on the input element brings up Photos instead of allowing me to pick iCloud documents. Is there a way to select iCloud documents from Cordova / PhoneGap?
answer count: 2
downvote count: 0
tagged with: icloud
has title: html input type=file -- Select a file from iCloud
favorite count: 0
has comment: http://stackoverflow.com/comment/47269714

http://stackoverflow.com/q/29553012
tagged with: javascript
tagged with: fabricjs
has title: How to force imageSmoothingEnabled to be false
has comment: http://stackoverflow.com/comment/47276887
tagged with: html5-canvas
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/29564875
accepted answer: http://stackoverflow.com/a/29564875
type: AnsweredQuestion
score: 7
has comment: http://stackoverflow.com/comment/47268809
possible better answer: http://stackoverflow.com/a/29553189
upvote count: 7
has answer: http://stackoverflow.com/a/29553189
type: Question
answer count: 2
tagged with: canvas
has body: I am using several layered canvas plus fabric.js canvas like so: All these canvas context have the property imageSmoothingEnabled set to false but for unknown reason, smoothing is always enabled for all the canvas and querying ctx.imageSmoothingEnabled return true even though it was set to false just before. It seem to be somewhat fabric.js related because imageSmoothingEnabled is false when i do not initialize fabric.js canvas but as soon as i initialize it, all of them are set to true. Smoothing is always enabled under Google Chrome but under Firefox, the smoothing vary (on/off) when i move the fabric.js canvas viewport (panning) or moving the objects. I use this code to turn off image smoothing for standard canvas (and also for the fabric.js one after initialization): ctx.mozImageSmoothingEnabled = false; ctx.oImageSmoothingEnabled = false; ctx.webkitImageSmoothingEnabled = false; ctx.msImageSmoothingEnabled = false; ctx.imageSmoothingEnabled = false; I also use this to set image smoothing off for the fabric.js canvas: c_fabric = new fabric.Canvas("fabric_canvas", { imageSmoothingEnabled: false }); Why does it happen? How to disable image smoothing for good?
has comment: http://stackoverflow.com/comment/107003279

http://stackoverflow.com/a/29643709
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47429029
upvote count: 7
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/29643423
accepted answer of: http://stackoverflow.com/q/29643423
score: 7
has body: Instead of jQuery, you can achieve this by ng-class. 1.5 ? 'price-red' : ''">{{p.price}} CSS .price-red { // apply your code like color: red; }

http://stackoverflow.com/comment/47464578
comment on: http://stackoverflow.com/q/29661904
type: QuestionComment
has text: It works in every browser I can get my hands on, except Chrome.
score: 0
type: Comment

http://stackoverflow.com/comment/47303494
has text: https://www.dropbox.com/sh/eyyow6i8xwvzjac/AABlMK4BC0Q-KozXHtewoSl5a
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29577410
type: Comment

http://stackoverflow.com/comment/47322982
comment on: http://stackoverflow.com/a/29585585
score: 0
type: Comment
type: AnswerComment
has text: Interesting... with more number of items (say 100), Array.sort performance goes down (worse than your approach)... VicF's approach is stil the fastest. http://jsperf.com/specific-sort/3

http://stackoverflow.com/comment/47339785
type: AnswerComment
has text: I updated the code and fixed all the bugs. I commented out the keycode filter just because I wanted to see how it would look if it updated every key you typed.
comment on: http://stackoverflow.com/a/29592769
type: Comment
score: 1

http://stackoverflow.com/a/29635879
upvote count: 1
answers question: http://stackoverflow.com/q/29635835
score: 1
has comment: http://stackoverflow.com/comment/47414430
has comment: http://stackoverflow.com/comment/47414089
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/47414319
has body: Your document.write(' '); will write that exact string, not the value from the array as you intended. You could instead try: document.write(' '); As isherwood and your error noted, you must pass an option or optiongroup element to the add method for it to work.

http://stackoverflow.com/comment/47350641
comment on: http://stackoverflow.com/a/29602272
has text: Yes. You are making the request to your Node server. Your Node server has to give your Apache server permission to access it, not the other way around.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/29577410
has answer: http://stackoverflow.com/a/29581177
has comment: http://stackoverflow.com/comment/47303489
type: Question
has body: I have defined the following function which reads data from a JSON file "on button click" and it should generate multiple d3 graphs, each in its own svg container: //button click function updateData() { var c = $("#select-list option:selected").text(); d3.json("out_graph.json", function(subgraphs, ind) { for (k in ind) { var k_data = ind[k].graphs; if (k_data.values = c) { console.log(k_data.values ); //works var svgSUBS = d3.select("#subgraphs").append("svg") .attr("id","subsID") .attr("width", 300) .attr("height", 300); nodes = []; links = []; nodes = ind[k].nodes; links = ind[k].links; var link = svgSUBS.selectAll(".linkSUB") .data(ind[k].links) .enter().append("g") .attr("class", "linkSUB"); link.append("line") .style("stroke-width", function(d) { return (d.bond * 2 - 1) * 2 + "px"; }); link.filter(function(d) { return d.bond &gt; 1; }).append("line") .attr("class", "separator"); var node = svgSUBS.selectAll(".nodeSUB") .data(ind[k].nodes) .enter().append("g") .attr("class", "nodeSUB") .call(d3.layout.force() .size([width, height]) .charge(-400) .linkDistance(function(d) { return radius + 40;}).drag); node.append("circle") .attr("r", radius) .style("fill", function(d) { return color(d.Node); }); node.append("text") .attr("dy", ".35em") .attr("text-anchor", "middle") .text(function(d) { return d.Node + d.label; }); function tick() { link.selectAll("line") .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("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; }); } d3.layout.force() .size([width, height]) .charge(-400) .linkDistance(function(d) { return radius + 40;}) .nodes(nodes) .links(links) .on("tick", tick) .start(); } } }); } The result I get after execution is as follows: The JSON file contains multiple graph data formatted as follows: [{ "subgraph": "21", "nodes": [ {"Node": "0", "label":…
tagged with: force-layout
has comment: http://stackoverflow.com/comment/47303187
has title: D3.js multiple force layout graphs from json file
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
upvote count: 1
has comment: http://stackoverflow.com/comment/47308937
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47303494
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/svg
downvote count: 0
tagged with: d3.js
score: 1

http://stackoverflow.com/comment/47375287
type: Comment
has text: I am not sure you grasp the idea of asynchrony. So if you want to process events asynchronously then you have **no control** over the order of execution. If you want to process events synchronously then you can do that as well by using some third party library (take a look at [this question](http://stackoverflow.com/questions/6048504/synchronous-request-in-nodejs)).
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29559203

http://stackoverflow.com/q/29629459
tagged with: android
tagged with: cordova
answer count: 0
type: UnansweredQuestion
type: Question
has title: Phonegap File transfer Android error = null, iOS error = 3
has comment: http://stackoverflow.com/comment/48097922
has comment: http://stackoverflow.com/comment/47443716
score: 0
tagged with: file-transfer
tagged with: ios
tagged with: javascript
has body: I want to transfer a image file from a photolibrary (iOS & Android) to php with Phonegap 3.7.0 . I get a code error null with Android and code error 3 on iOS, I have tried multiple solutions but that didn't work for me. The Phonegap Javascript below comes from the official Phonegap documentation so I don't know what I'm doing wrong. I hope someone can help me, Thanks in advance! HTML: Javascript: $scope.onDeviceReady = function() { // Retrieve image file location from specified source navigator.camera.getPicture( uploadPhoto, function(message) { alert('get picture failed'); }, { quality : 50, destinationType : navigator.camera.DestinationType.FILE_URI, sourceType : navigator.camera.PictureSourceType.PHOTOLIBRARY } ); } function uploadPhoto(imageURI) { var options = new FileUploadOptions(); options.fileKey="file"; options.fileName=imageURI.substr(imageURI.lastIndexOf('/')+1); options.mimeType="image/jpeg"; var params = {}; params.value1 = "test"; params.value2 = "param"; options.chunkedMode = false; options.headers = { Connection: "close"}; options.params = params; var ft = new FileTransfer(); ft.upload(imageURI, "photo.php", win, fail, options); console.log(imageURI); console.log(params); console.log(options); } function win(r) { console.log("Code = " + r.responseCode); console.log("Response = " + r.response); console.log("Sent = " + r.bytesSent); } function fail(error) { alert("An error has occurred: Code = " + error.code); console.log("upload error source " + error.source); console.log("upload error target " + error.target); } PHP: function postPhoto(){ print_r($_FILES); $new_image_name = "photo1.jpg"; move_uploaded_file($_FILES["file"]["tmp_name"], "/temp".$new_image_name); } Phonegap xml config file: <gap:plugin name="org.apache.cordova.camera"/> <gap:plugin name="org.apache.cordova.media-capture"/> <gap:plugin name="org.apache.cordova.file"/> <gap:plugin name="org.apache.cordova.file-transfer"/> <gap:plugin name="org.apache.cordova.globalization"/> <gap:plugin …

http://stackoverflow.com/comment/47410656
has text: `$("[title]").attr("title","")`
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29634149

http://stackoverflow.com/q/29635361
upvote count: 1
has comment: http://stackoverflow.com/comment/47413854
has answer: http://stackoverflow.com/a/29635586
answer count: 4
has comment: http://stackoverflow.com/comment/47413780
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47413862
has answer: http://stackoverflow.com/a/29636160
has body: I wrote this function to format a certain string : var desc = document.getElementById('desc'); var parContent = desc.textContent.trim(); var tempPar = ""; var j = 0; var k = 0; var built_val = ""; for (var i = 0; i &lt; parContent.length ; i++) { if (j == 19 || i == parContent.length-1) { tempPar = parContent.substring(k, i); tempPar = tempPar.concat("- \n"); built_val = built_val.concat(tempPar); tempPar = ""; //Restart j j = 0; //update k k = i; continue; } j++; } desc.textContent = built_val; Desc is a dynamic paragraph that is usually empty at first then filled (its data are composed after the page loads), j is the number of characters desired in one line. Though now I have another problem and that is \n doesn't work ; I also tried br . How can I insert a new linebreak within a javascript string such as "built_val" ? please note how it's assigned to an Html after everything.
has comment: http://stackoverflow.com/comment/47414481
has answer: http://stackoverflow.com/a/29635558
has answer: http://stackoverflow.com/a/29635919
type: Question
has comment: http://stackoverflow.com/comment/47413306
has comment: http://stackoverflow.com/comment/47413393
has title: how to add a line break in javascript that works with paragraph
possible better answer: http://stackoverflow.com/a/29635558
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29635586
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has comment: http://stackoverflow.com/comment/47412962
score: 1
has comment: http://stackoverflow.com/comment/47413208
favorite count: 0

http://stackoverflow.com/comment/47330685
type: Comment
type: AnswerComment
has text: Thanks, that was it. The docs/error could probably be more detailed.
score: 0
comment on: http://stackoverflow.com/a/29591728

http://stackoverflow.com/q/29549686
tagged with: javascript
has title: Replace a substring that occurs after a given offset
tagged with: substring
tagged with: replace
accepted answer: http://stackoverflow.com/a/29549745
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29549936
has answer: http://stackoverflow.com/a/29550325
has answer: http://stackoverflow.com/a/29549936
type: Question
has body: I have a string that has following format: 'User ID: 2894, Task ID: 68, Some other text' Let's say I need to convert this string to the following: 'User ID: 2684, Task ID: &lt;replaced&gt;, Some other text' Obviously, the way to do this is to replace string 68 with the string &lt;replaced&gt;. var str = 'User ID: 2894, Task ID: 68, Some other text'; var newStr = str.replace('68', '&lt;replaced&gt;'); alert(newStr); But this could blow up on my face if User ID contained the same sequence of numerals. var str = 'User ID: 2684, Task ID: 68, Some other text'; var newStr = str.replace('68', '&lt;replaced&gt;'); alert(newStr); However, I also have information about the character index of the substring that should be replaced. So I have following code to do this task: var str = 'User ID: 2684, Task ID: 68, Some other text'; var taskId = '68'; var prefix = 'Task ID: '; var index = str.indexOf(prefix) + prefix.length; var newStr = str.substring(0, index) + '&lt;replaced&gt;' + str.substring(index + taskId.length); alert(newStr); As you can see, now I need to call substring twice to get the result. But is there a simpler code which I could use to replace a substring that occurs after a given offset?
has answer: http://stackoverflow.com/a/29549745
score: 0
answer count: 3

http://stackoverflow.com/comment/47424615
has text: what is the reason objects cannot convert to strings and other data types can...as example varible,array,....can convert to string
comment on: http://stackoverflow.com/a/29641552
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/29568581
has body: The first code snippet achieves the desired effect: //in mongodb console: db.collection.update({"username":"name"}, {$pull : { "task" : { "_id" : ObjectId("55280205702c316b6d79c89c")}}}) Yet this second (seemingly equivalent) code snippet written in Mongoose does not: //in Mongoose: var taskID = "55280205702c316b6d79c88c" var pull = { $pull : {}}; var idObj = {}; idObj["_id"] = taskID; pull.$pull["task"] = idObj; collectionModel.update({"username": "name"}, pull) //fails to work since taskID just shows up as a literal string 55280205702c316b6d79c88c instead of ObjectId("55280205702c316b6d79c88c") Other things I've tried: making var taskID equal to the string 'ObjectId(\"55280205702c316b6d79c88c\")' setting var taskID equal to mongoose.Types.ObjectId("55280205702c316b6d79c88c") How can I achieve the effect in the former code snippet in Mongoose?
tagged with: mongoose
tagged with: javascript
has title: Referring to ObjectIDs directly in MongoDB works, but not in Mongoose
has answer: http://stackoverflow.com/a/29572377
has comment: http://stackoverflow.com/comment/47288885
tagged with: node.js
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47286544
has answer: http://stackoverflow.com/a/29569325
type: Question
tagged with: mongodb
score: 0
answer count: 2

http://stackoverflow.com/comment/47357009
has text: As neither angular nor javascript know english, how could they know that 'three' is lower than 'four' ?
comment on: http://stackoverflow.com/q/29605696
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/a/29557621
upvote count: 3
has body: I have created a demo for you: $('.editable').bind('click', function(){ $(this).attr('contentEditable',true); }); $('.editable').bind('focus', function() { var that = $(this); //defaultTxt = that.data('default'); that.html(''); }); $('.editable').bind('blur', function() { var that = $(this); var defaultTxt = that.data('default'); if(that.html() === ''){ that.html(defaultTxt); } }); .editable{ padding: 5px; border: 1px solid black; } Some text I have changed your code, take a look it. Also now it's keeping the old value when lost the focus if you don't type anything.
downvote count: 0
answers question: http://stackoverflow.com/q/29556510
type: Answer
score: 3
has comment: http://stackoverflow.com/comment/47345706

http://stackoverflow.com/comment/47342217
has text: `coordinates.push(geocodeResult)`?
score: 1
comment on: http://stackoverflow.com/q/29597768
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29741115
type: AcceptedAnswer
has body: Just add in a hidden duplicate field of the dropdownlist, in this case, &lt;?php echo $form-&gt;hiddenField($model, 'clientPackagedService_id'); ?&gt; Because disabled dropdownlists won't POST/GET to the PHP server side, therefore, adding in a hidden field will solve the problem
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29668697
accepted answer of: http://stackoverflow.com/q/29668697

http://stackoverflow.com/q/29659507
answer count: 1
downvote count: 0
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
tagged with: nvd3.js
upvote count: 2
has body: I have some data which is used in one place to make a heatmap, and in another place to make a line chart. I want to put a gradient behind the line chart so that points on the line chart appear in front of the color used in the heatmap. If I understand right, all that's needed is to set the fill on the appropriate svg element, but I haven't found any indication that nvd3 will help me find that element. Can I do this with the nvd3 API, or do I have to reverse-engineer the chart to find or insert that element?
accepted answer: http://stackoverflow.com/a/29807357
has title: nvd3: set background fill behind line chart
score: 2
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/25078620
has comment: http://stackoverflow.com/comment/50261034
type: Question
tagged with: charts
tagged with: javascript
has answer: http://stackoverflow.com/a/29807357

http://stackoverflow.com/q/29643479
has comment: http://stackoverflow.com/comment/47429998
has answer: http://stackoverflow.com/a/29643531
type: Question
tagged with: c#
tagged with: asp.net-mvc
tagged with: javascript
has comment: http://stackoverflow.com/comment/47430098
score: 0
accepted answer: http://stackoverflow.com/a/29643531
answer count: 1
has comment: http://stackoverflow.com/comment/47429116
has comment: http://stackoverflow.com/comment/47428454
tagged with: jquery
has comment: http://stackoverflow.com/comment/47429052
has comment: http://stackoverflow.com/comment/47429739
has body: Could someone point me to the right direction here... I have a form on a site, and I've got a controller. What I want to do is to post the form with jQuery via url like this : /localhost:1234/something?FirstLast=Somebody&amp;Mail=something@something.com&amp;Phone=something This is the controller: [System.Web.Http.HttpPost] public HttpResponseMessage PostPodrskaRequest(string ImePrezime, string Mail, string Telefon, int OdabranaUlogaId) { try { var r = new Regex(@"^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$"); if (string.IsNullOrEmpty(ImePrezime) || ImePrezime.Length &gt; 128) return Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Ime i prezime mora biti upisano i ne smije sadržavati više od 128 znakova!"); if (string.IsNullOrEmpty(Mail) || (!r.IsMatch(Mail))) return Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Neispravna mail adresa!"); var cnt = this._podrskaService.GetPodrskaContent().First(x =&gt; x.Uloga.Id == OdabranaUlogaId); this._podrskaService.InsertPodrskaRequest(ImePrezime, Mail, Telefon, cnt.Id, OdabranaUlogaId, this._services.WorkContext.CurrentUser.Id); } catch (Exception ex) { this.Logger.Log(LogLevel.Error, ex, "Handled exception!!!"); _transactionManager.Cancel(); return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message, ex); } return Request.CreateResponse(HttpStatusCode.OK, "Zahtjev uspješno poslan."); } This is my jQuery ajax function: function submitForm() { var params = { ImePrezime: $("#Forma").find('input[name="ImePrezime"]').val(), Mail: $("#Forma").find('input[name="Mail"]').val(), Telefon: $("#Forma").find('input[name="Telefon"]').val() } var str = param(params); greska = 0; $.ajax({ type: 'POST', url: '@postUri', data: str , success: function (response) { alert("Prošlo!"); console.log("[OK] Poruka poslana na @postUri"); console.log("ImePrezime" + ImePrezime); console.log("Mail" + Mail); console.log("Telefon" + Telefon); }, error: function () { alert("Nije prošlo! :'( "); console.…
has title: Build POST url to MVC controller
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47429986
has comment: http://stackoverflow.com/comment/47429519

http://stackoverflow.com/q/29571049
has body: I don't know what I'm missing here. The line chart isn't showing the first x label: Here is my code: new Morris.Line({ element: 'chart_170', data: [ { y: '2015-04-10 04:01', a: -10}, { y: '2015-04-10 10:45', a: -10}, { y: '2015-04-11 05:45', a: -10}, { y: '2015-04-12 05:45', a: -8}, { y: '2015-04-12 03:45', a: -8}], resize: true, xkey: ['y'], ykeys: 'a', labels: 'a', xLabels: ['day'], ymax: 'auto', resize: 'true', hideHover: true, yLabelFormat: function(y) { if (y % 1 === 0) return -y; else return ''; }}); Any help will be appreciated. Thanks!
upvote count: 1
has title: morrisjs line graph not showing the first xLabel
type: Question
accepted answer: http://stackoverflow.com/a/29571432
tagged with: morris.js
tagged with: javascript
answer count: 1
downvote count: 0
favorite count: 0
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29571432
score: 1

http://stackoverflow.com/q/29684049
has title: How do I get the value of an input element using angular.element('#id')
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/61167370
has answer: http://stackoverflow.com/a/29684088
has comment: http://stackoverflow.com/comment/47504937
upvote count: 21
type: Question
score: 21
possible better answer: http://stackoverflow.com/a/41491449
has answer: http://stackoverflow.com/a/38185504
has answer: http://stackoverflow.com/a/41491449
accepted answer: http://stackoverflow.com/a/29684088
has answer: http://stackoverflow.com/a/69267533
downvote count: 0
answer count: 7
has answer: http://stackoverflow.com/a/64619644
tagged with: javascript
tagged with: jquery
has body: When I'm trying to get the value of input element using angular.element, its returning undefined. Here is my code: $scope.registerUser = function() { console.log(angular.element('#username').value); // undefined console.log(document.getElementById('username').value); // sampleName }; How do I get the value using angular.element
favorite count: 0
has answer: http://stackoverflow.com/a/29684086
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47641915

http://stackoverflow.com/comment/103030648
has text: Nice and simple solution, thanks! I needed the same on word level, and wanted to also receive the positions of the added words. If someone else is interested, see: http://jsfiddle.net/409doc37/
type: Comment
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29574724

http://stackoverflow.com/comment/47372348
type: QuestionComment
has text: `switch (true)` should work fine (`"switch (TRUE)` can't work because `TRUE` does not exist in JS, so you get an error. JS is *case-sensitive*). *"Why are the greater than / less than operators not working?"* Because you are comparing a **number** (`ScreenWidth`) against a **boolean** (`ScreenWidth > 799`).
type: Comment
comment on: http://stackoverflow.com/q/29613437
score: 5

http://stackoverflow.com/a/29685072
has body: You need to make a slight modification to your code. If you want foo to be a constructor function then make sure it's an immediate function in the first place, which returns a new constructor function: var foo = function() { var bar = { a: 3, b: {c: 4, d: {e: 5}} }; var f_ = function() {}; f_.prototype = bar; return f_; }(); var obj = new foo(); alert(obj.a + ', ' + obj.b.d.e) Note, () at the end of the foo function, those parentesis make foo execute immediately and assign new function f_ to it.
type: Answer
has comment: http://stackoverflow.com/comment/47507814
has comment: http://stackoverflow.com/comment/47507715
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29684900
answers question: http://stackoverflow.com/q/29684900
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/29651430
answers question: http://stackoverflow.com/q/29651123
has comment: http://stackoverflow.com/comment/47442578
type: Answer
has body: I strongly recommend you to read this article. http://ryanmorr.com/understanding-scope-and-context-in-javascript/ Your problem is explained in 3rd paragraph - What is “this” Context: "Context is most often determined by how a function is invoked. When a function is called as a method of an object, this is set to the object the method is called on: var obj = { foo: function(){ alert(this === obj); } }; obj.foo(); // true The same principle applies when invoking a function with the new operator to create an instance of an object. When invoked in this manner, the value of this within the scope of the function will be set to the newly created instance: function foo(){ alert(this); } foo() // window new foo() // foo When called as an unbound function, this will default to the global context or window object in the browser. However, if the function is executed in strict mode, the context will default to undefined."
score: 1
upvote count: 1
downvote count: 0

http://stackoverflow.com/comment/47270773
score: 0
type: AnswerComment
has text: Hi Brijesh. Delivery is not being added on to total cost still and the update is only working when i change the delivery box. Thanks
type: Comment
comment on: http://stackoverflow.com/a/29558099

http://stackoverflow.com/comment/47456760
score: 0
type: Comment
has text: this worked like charm....thanks Log is for writing it into a file just like console.log
type: AnswerComment
comment on: http://stackoverflow.com/a/29658157

http://stackoverflow.com/a/29570014
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29564445
upvote count: 1
has body: ZingChart might be of interest to you. The y-axis on top is as simple as creating a scale-y-2 object (and you can set the original scale-y axis to visible: 0). The overlapping bars are achieved with a normal multi-series bar chart with bars-overlap set to 100% inside the plot object, and one of the series bar-widths set to 80% (or any percentage you'd like to use). Check out the included snippet for the code and chart. As for using time for your y-axis values, the library provides the transform object that will transform Unix timestamps into various date/time formats. You can read more about it in the docs. I'm on the ZingChart team, so if you have any questions about implementation, just give us a holler! var myChart = { "type":"hbar", "plotarea":{ }, "scale-y-2":{ "values":["3pm","4pm","5pm","6pm","7pm"] }, "scale-y":{ "visible":false }, "plot":{ "bars-overlap":"100%" }, "series":[ { "values":[20,5,3,4] }, { "values":[18,8,4,5], "bar-width":"80%" } ] }; zingchart.render({ data: myChart, id: "myChart", width: "100%" }); #myChart { width: 100%; } &lt;script src="http://cdn.zingchart.com/zingchart.min.js"&gt;&lt;/script&gt; &lt;div id="myChart"&gt;&lt;/div&gt;
score: 1

http://stackoverflow.com/comment/47223716
comment on: http://stackoverflow.com/q/29535400
score: 0
has text: Well, you can't alert an object or log the value to HTML without stringifying it (which is likely what you'll wind up doing). What console are you using that isn't showing you an object inspection?
type: QuestionComment
type: Comment

http://stackoverflow.com/q/29621664
upvote count: 2
accepted answer: http://stackoverflow.com/a/29623836
tagged with: node.js
score: 2
type: AnsweredQuestion
has title: Saving model to the server using Backbone and Node
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29623836
favorite count: 0
tagged with: ajax
has body: I'm new to Backbone / AJAX (and fresh to node, what my server is running on) and I'm trying to "save" my model to the user using the Save method from Backbone. I'm trying to implement a webchat for my university project. At the moment I want to send the provided username and password the user entered. My server-side code: //Module user exports.login = function(req, res) { console.log("login request"); console.log(req.body); res.sendStatus(200); }; //Main Server Script app.post("/user/login", user.login); My client-side code. login: function(self) { self.model.urlRoot = "/user/login"; self.model.save({}, { success: function(model, response) { console.log('SUCCESS:'); console.log(response); }, error: function(model, response) { console.log('FAIL:'); console.log(response); } }); } The function is called by the view that holds the login button and gets the view as an argument. The view has a reference to its model. On the server, I get the entered data as expected, but the response on the client gives me errors: FAIL: Object { readyState: 4, getResponseHeader: .ajax/v.getResponseHeader(), getAllResponseHeaders: .ajax/v.getAllResponseHeaders(), setRequestHeader: .ajax/v.setRequestHeader(), overrideMimeType: .ajax/v.overrideMimeType(), statusCode: .ajax/v.statusCode(), abort: .ajax/v.abort(), state: .Deferred/d.state(), always: .Deferred/d.always(), then: .Deferred/d.then(), // 11 weitere… } I tried to figure it out by myself but I don't get it.
tagged with: backbone.js

http://stackoverflow.com/comment/47346978
score: 0
type: Comment
has text: Absolutely hah. I was low on sleep yesterday, AJAX is precisely not to reload the page. Do you know why the data variable is displaying a PHP page? Is it the expected output?
comment on: http://stackoverflow.com/a/29586956
type: AnswerComment

http://stackoverflow.com/a/29638320
has comment: http://stackoverflow.com/comment/47610519
has comment: http://stackoverflow.com/comment/47419900
answers question: http://stackoverflow.com/q/29637953
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29637953
has body: Is there a way to do this in url "javascript:alert();" style? Yes but I wouldn't recommend it. Since you asked though: javascript:(function(){ var l=document.getElementsByTagName('input'); for(var i=0; i&lt;l.length; i++) if((''+l[i].name).indexOf('_approveChk')) l[i].checked=true })() This is not the recommend way of doing this sort of thing and if you want include this on lots of links bear in mind that it will may significantly increase the size of your webpage.
type: Answer
score: 0

http://stackoverflow.com/comment/47229726
type: Comment
comment on: http://stackoverflow.com/q/29538558
type: QuestionComment
has text: Sidenote, you need to remove the `header` call in your php script. That will not do anything useful in an ajax call. And there is no `.activities` element in the `#newactivity` form so you will not see your output where you expect it to be.
score: 0

http://stackoverflow.com/q/29548559
tagged with: post
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/47249002
has comment: http://stackoverflow.com/comment/47286935
has comment: http://stackoverflow.com/comment/47366985
has title: How to send simple data from javascript to java application
has answer: http://stackoverflow.com/a/29548845
tagged with: xmlhttprequest
has comment: http://stackoverflow.com/comment/47248977
type: UnansweredQuestion
has body: I am trying to send a simple message from javascript. I want to receive the data in a java program (server), but I can't seem to figure out how to obtain the message in java. Here is my javascript: if (window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest(); } else { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.open("POST", ip, true); xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlhttp.send("posX=" + posX + "&amp;posX = " + posX); I have 2 questions regarding this. Is the above the fastest method to send simple string data from javascript to a java program or can you recommend an alternative solution? How can I receive the above POST request from the javascript with java? I really hope someone can help me out. Any help will be greatly appreciated
tagged with: java
has answer: http://stackoverflow.com/a/29548610
type: Question
tagged with: javascript

http://stackoverflow.com/a/29554607
has comment: http://stackoverflow.com/comment/47262535
has comment: http://stackoverflow.com/comment/47262602
has comment: http://stackoverflow.com/comment/47262767
has comment: http://stackoverflow.com/comment/47260781
accepted answer of: http://stackoverflow.com/q/29554481
has comment: http://stackoverflow.com/comment/47261846
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47261783
has comment: http://stackoverflow.com/comment/47261195
has body: This is happening because every time you trigger mouseenter on .item you attach a new event to button. Quick Solution: You have to remove previous events before attaching a new one, you can do this with .unbind(), here is a working example $('#item_element_new').unbind(); $('#item_element_new').hover(function () { $(document).on('mouseenter', '.item', function (event) { var item = $(this); $('#item_add').css({ "left": '5.5em', "top": item.offset().top - 15 }).show(); $('#item_add').hover(function () { var menue = $(this); menue.animate({ "width": '7em', "left": '0.5em' }, 200, function () { $(this).find(".body").stop().slideDown(200); }); }, function () { var menue = $(this); menue.find(".body").stop().slideUp(200, function () { menue.animate({ "width": '2em', "left": '5.5em' }, 200); }); }); $('#item_element_new').unbind(); $('#item_element_new').hover(function () { item.after(' '); }, function () { $('#item_new').remove(); }); }); .item { border: 1px solid #e2e2e2; margin: 6px; padding: 0px 10px 0px 10px; position: relative; height: 40px; } .wrap { margin-left: 8em; } #item_new { border: 1px dashed #C0C0C0 !important; background: none repeat scroll 0% 0% #F7F7F7; display: block; height: 2.2em; margin: 6px; padding: 0px 10px; position: relative; } #item_add { display: none; position: absolute; width: 2em; border: 1px solid #ddd; background-color: #f7f7f7; color: #aaa; padding: 0px 6px; } #item_add .body { display: none; } #item_add .arrow { width: 0px; height: 0px; -webkit-transform:rotate(360deg); border-style: solid; border-width: 5px 0 5px 7px; border-color: transparent transparent transparent #f7f7f7; top: 5px; right: -7px; position: absolute; } #item_add button { background: none repeat scroll 0px center #fff; padding: 0.2em 2em; margin: 3px .2em; } X Example Soulution 2: As @Regent pointed out your code have some problems, you can solve a part of them: Moving event binding outside mouseenter event handler Caching jQuery objects Not using .unbind() anymore var…
type: Answer
upvote count: 3
has comment: http://stackoverflow.com/comment/47265862
has comment: http://stackoverflow.com/comment/47261385
answers question: http://stackoverflow.com/q/29554481
score: 3

http://stackoverflow.com/q/29564033
has comment: http://stackoverflow.com/comment/47278059
tagged with: object-literal
has comment: http://stackoverflow.com/comment/47277876
tagged with: undefined
has comment: http://stackoverflow.com/comment/47277883
has answer: http://stackoverflow.com/a/29564306
has title: JS Object Literals - How to access from outside an object?
type: UnansweredQuestion
upvote count: 1
type: Question
tagged with: object
score: 1
has comment: http://stackoverflow.com/comment/47277900
has answer: http://stackoverflow.com/a/29564285
answer count: 2
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47277755
favorite count: 0
has body: I'm new to JavaScript and having troubles with accessing an object from outside. My method fills an array with Objects before I want to access an property of this object. Reservation = { objArr: [], // stores CalendarDates objects dates: ["test", "foo", "bar"], // some test strings actionMethod: function() { Reservation.objArr[0] = new Reservation.CalendarDate.construct(Reservation.dates[0]); alert(Reservation.dates[0].testVariable); // returns 'undefined' } }; Reservation.CalendarDate = { testVariable: '', construct: function(testVariable) { Reservation.CalendarDate.testVariable = testVariable; } }; How can I access the property (testVariable) from outside the object, which is stored in an array. Thanks for your help!

http://stackoverflow.com/comment/80703428
type: AnswerComment
type: Comment
has text: Thanks for that - so many terrible convoluted answers here, the real answer is "if you want to change a list, use map". That's the whole point of persistent immutable data structures, you don't "update" them, you make a new structure with the updated values in it; and it's cheap to do so because the unmodified list elements are shared.
comment on: http://stackoverflow.com/a/40158234
score: 1

http://stackoverflow.com/comment/47306958
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29578635
has text: @SimonH That would be `querySelectorAll`
score: 0

http://stackoverflow.com/q/29628323
has body: I have a question about, the great function of javascript i.e., XMLHttpRequest() Does this function auto updates any document?If its content changes? Or I have to do it using setInterval() ? Actually, I am creating a chat system, in which file containing messages has to be refreshed. The messages file is loaded into main page using XMLHttpRequest(). So, I want to know can XMLHttpRequest() auto refresh or not. I have also another question..... In the usage of XMLHttpRequest(), the format is: my.open( METHOD, URL, BOOLEAN ); IN THE BOOLEAN WE ALWAYS PUT FALSE. WHY? WHAT IF I USE TRUE?
downvote count: 0
score: 1
has title: Does XMLHttpRequest updates data 'AUTOMATICALLY'?
type: Question
has comment: http://stackoverflow.com/comment/47399710
upvote count: 1
tagged with: javascript
favorite count: 0
answer count: 1
tagged with: xmlhttprequest
has answer: http://stackoverflow.com/a/29628523
has comment: http://stackoverflow.com/comment/47399756
type: UnansweredQuestion

http://stackoverflow.com/comment/47453710
type: QuestionComment
comment on: http://stackoverflow.com/q/29656849
has text: @lonewolf217 can you give me example..
score: 0
type: Comment

http://stackoverflow.com/a/29620857
type: Answer
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/47389947
has comment: http://stackoverflow.com/comment/47385850
answers question: http://stackoverflow.com/q/29620638
downvote count: 0
has body: Merging is probably going to be very difficult, because the 2 accounts have different login mechanisms. You would either need to delete one account and update all references to that user in the database or create your own 'user group' class so each user is associated with a group and that group represents the user. A group can have many users attached (the many logins for the individual e-mail address) and is used in all relationships where you would usually use the user.
has comment: http://stackoverflow.com/comment/47388576

gulp
tags question: http://stackoverflow.com/q/29674822
tags question: http://stackoverflow.com/q/29572259
tags question: http://stackoverflow.com/q/29565176
type: Tag
tag name: gulp
tags question: http://stackoverflow.com/q/29657159
tags question: http://stackoverflow.com/q/29655856
tags question: http://stackoverflow.com/q/29650119
tags question: http://stackoverflow.com/q/29625182
tags question: http://stackoverflow.com/q/29640102
tags question: http://stackoverflow.com/q/29645592
tags question: http://stackoverflow.com/q/29581647
tags question: http://stackoverflow.com/q/29568957
tags question: http://stackoverflow.com/q/29662689
tags question: http://stackoverflow.com/q/29614917
tags question: http://stackoverflow.com/q/29573212
tags question: http://stackoverflow.com/q/29562221
tags question: http://stackoverflow.com/q/29633970
tags question: http://stackoverflow.com/q/29676755

http://stackoverflow.com/q/29534194
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47227583
accepted answer: http://stackoverflow.com/a/29534500
has comment: http://stackoverflow.com/comment/47222667
type: Question
has comment: http://stackoverflow.com/comment/47224601
tagged with: javascript
has title: select drop down on change reload reverts to first option
score: 0
linked to: http://stackoverflow.com/q/1479233
answer count: 2
has comment: http://stackoverflow.com/comment/47221450
has comment: http://stackoverflow.com/comment/47221745
possible better answer: http://stackoverflow.com/a/29534417
has answer: http://stackoverflow.com/a/29534500
tagged with: jquery
has answer: http://stackoverflow.com/a/29534417
has comment: http://stackoverflow.com/comment/47228251
has comment: http://stackoverflow.com/comment/47221991
has body: I have a select drop down and when I select a value I want to refresh the page. The problem is that only firefox keeps the selected value chrome and IE do the reload but they revert to the first option YTD QTD MTD
has comment: http://stackoverflow.com/comment/47221519
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/q/29687486
tagged with: jquery
favorite count: 0
type: Question
has body: The x axis on my flot chart is wrong and I can't for the life of me figure it out, I am multiplying php strtotime*1000 &lt;?php function timegen($time) { $gen = strtotime("$time") * 1000; return $gen; } echo("[".timegen("2014-04-16 09:30AM UTC").",".rand(5,50)."],&lt;br&gt;"); echo("[".timegen("2014-04-16 10:00AM UTC").",".rand(5,50)."],&lt;br&gt;"); echo("[".timegen("2014-04-16 11:00AM UTC").",".rand(5,50)."],&lt;br&gt;"); echo("[".timegen("2014-04-16 12:00PM UTC").",".rand(5,50)."],&lt;br&gt;"); echo("[".timegen("2014-04-16 01:00PM UTC").",".rand(5,50)."],&lt;br&gt;"); echo("[".timegen("2014-04-16 02:00PM UTC").",".rand(5,50)."],&lt;br&gt;"); echo("[".timegen("2014-04-16 03:00PM UTC").",".rand(5,50)."],&lt;br&gt;"); echo("[".timegen("2014-04-16 04:00PM UTC").",".rand(5,50)."],&lt;br&gt;"); ?&gt; Which returns something like: [1397640600000,50], [1397642400000,5], [1397646000000,36], [1397649600000,39], [1397653200000,35], [1397656800000,39], [1397660400000,25], [1397664000000,50] 9:30-4:00 However the chart displays 06:00 7:00 8:00 9:00 10:00 11:00 12:00 My xaxis settings are: tickColor: 'transparent', mode: "time", tickDecimals: 2, timeFormat: "%H", timezone: "America/New York" I'd really appreciate it if someone could help me sort this out, I don't usually ask for help but I really can't seem to figure it out, new to flot
has answer: http://stackoverflow.com/a/29687668
upvote count: 2
has comment: http://stackoverflow.com/comment/95481957
answer count: 1
tagged with: charts
tagged with: javascript
has title: Flot x axis showing wrong time, 3 hours behind it seems
accepted answer: http://stackoverflow.com/a/29687668
score: 2
type: AnsweredQuestion
tagged with: flot
downvote count: 0

http://stackoverflow.com/q/29547553
has answer: http://stackoverflow.com/a/29547760
has answer: http://stackoverflow.com/a/29549333
type: Question
possible better answer: http://stackoverflow.com/a/29547760
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29549333
tagged with: jquery
tagged with: ajax
has title: Not able to execute javascript inside page that's loaded via jQuery's ajax
has answer: http://stackoverflow.com/a/29547849
answer count: 4
has answer: http://stackoverflow.com/a/29548083
type: AnsweredQuestion
has body: Summary... I have a page that is loading other pages with ajax and they contain javascript. The javascript makes use of document.ready which doesn't work right when using code like this... $.ajax({ type: 'get', url: 'layouts/' + layout + '.php', success: function(data){ $('.swap').fadeOut('slow', function(){ // container $(this).delay(100).fadeIn().html(data); }); } }); It doesn't work right in the sense that the javascript is running too fast. What's the best way to load pages that make use of document.ready or code like it?
score: 0

http://stackoverflow.com/q/29610982
type: AnsweredQuestion
score: 0
has answer: http://stackoverflow.com/a/29611328
has answer: http://stackoverflow.com/a/29611144
type: Question
has answer: http://stackoverflow.com/a/29611228
has comment: http://stackoverflow.com/comment/47367562
possible better answer: http://stackoverflow.com/a/29611228
has title: making html table sortable (with headers and data loaded using javascript)
accepted answer: http://stackoverflow.com/a/29611144
tagged with: javascript
tagged with: jquery
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has body: I have the following html in a website: I load the header and rows of the table using javascript. Example of how I fill the headers: $.get( '/getdata',{}, function(mydata) { // Parses JSON Into Array var array = $.parseJSON(mydata); var html = ' '; html+=' # '; html+=' One '; html+='<th">TOTAL '; var available = {}; for (var i = 0; i < array.length; i++) { available_item = array[i]; html+=' '; }; html += ' '; $(html).appendTo('#header'); }); The rows are filled in a similar way: ajax get, for loop, and append to html. Now I need the table columns to be sortable. I was trying to get it work with jquery tablesorter but it is not working. I suppose that it is not working because my data is loaded using javascript. How can I make this table sortable?

http://stackoverflow.com/comment/47486229
comment on: http://stackoverflow.com/q/29674298
score: 1
type: QuestionComment
type: Comment
has text: This is the default browser implementation. You need to listen for 'right click' on your canvas and display your own context menu, which will perform image saving

http://stackoverflow.com/comment/47295139
has text: Thanks a million Mr. Barmar... I have been trying this for the whole day but couldnt figure it out...
comment on: http://stackoverflow.com/a/29572696
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47319132
score: 1
type: AnswerComment
has text: This answer is very inefficient that way - it iterates over all default styles as well which would come down to 200+ for each element. With JavaScript's cssRules you can access the stylesheet directly and copy only the relevant CSS. http://tinyurl.com/oukh4fw
type: Comment
comment on: http://stackoverflow.com/a/29582442

http://stackoverflow.com/q/29554157
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/29560474
answer count: 1
tagged with: jquery
tagged with: cordova
type: UnansweredQuestion
has title: Compress image plugin for ios in phonegap
has body: I am new to ios and building compress image plugin in ios for phonegap.I am not getting how to call the compress image method in my javascript. My code is, Plugin.h file - (void) cordovaCompressimg:(CDVInvokedUrlCommand *)command; Plugin.m file - (void) cordovaCompressimg:(CDVInvokedUrlCommand *)command { UIImage *sourceImage ; NSString *compimg =[self UIImageToBaseSixtyFour]; CDVPluginResult *pluginResult = [ CDVPluginResult resultWithStatus : CDVCommandStatus_OK NSData : compimg ]; [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; } -(NSData *)UIImageToBaseSixtyFour { UIImage *sourceImage ; NSData *imageData = UIImageJPEGRepresentation(sourceImage, 1.0); NSString *base64 = [NSString stringWithFormat:@"%@",[UIImageJPEGRepresentation(sourceImage, 0.95) base64EncodedString]]; return base64; } plugin.js file window.showimg = function(cimg, callback) { cordova.exec(callback, function(err) { callback('Nothing to echo.'); }, "PhonegapPlugin", "cordovaGetCurrentDate", [cimg]); }; my calling function in index.html is, function showCompressimg() { window.showimg("", function(echoValue) { alert(echoValue); }); } The plugin is getting called but with empty image.The out put comes as null.The source image is not getting passed.Can anybody help me please, Thanks in advance
type: Question
tagged with: ios

http://stackoverflow.com/comment/47378818
has text: the question you now ask is out of the scope of the original one, however I see from the code that d3's version is not the latest, there's a check present on d3's [source](https://github.com/mbostock/d3/blob/master/src/layout/force.js#L286-L291) which is not in the source code of the local d3 version you have, this line is missing: `if (!arguments.length) return drag;`
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29611668

http://stackoverflow.com/a/29660697
downvote count: 0
answers question: http://stackoverflow.com/q/29660413
score: 1
type: AcceptedAnswer
upvote count: 1
type: Answer
has body: You could also create a php file and put the header as type javascript. Request this file as a normal javascript file. &lt;script src="config.js.php"&gt;&lt;/script&gt; (considering the filename is config.js.php) You can structure your javascript code and simply assign values dynamically. For security, especially if login is required, this file can only be returned once the user is logged in or something. Otherwise you simply return a blank file.
accepted answer of: http://stackoverflow.com/q/29660413

http://stackoverflow.com/comment/47572675
type: Comment
comment on: http://stackoverflow.com/q/29679441
score: 0
type: QuestionComment
has text: @CookieMan, that is all the javascript I am currently using. These elements are hard coded into the HTML so there shouldn't be any loading issues.

http://stackoverflow.com/a/29560679
score: 0
answers question: http://stackoverflow.com/q/29559792
type: AcceptedAnswer
type: Answer
has body: $("input[type='checkbox'][name='id[]']").on('change',function(){ var isChecked = $("input[type='checkbox'][name='id[]']").prop('checked'); if(isChecked ){ $("input[type='checkbox'][name='title[]']").prop('checked', true); } else{ $("input[type='checkbox'][name='title[]']").prop('checked', false); } }); demo
accepted answer of: http://stackoverflow.com/q/29559792

http://stackoverflow.com/comment/47497139
comment on: http://stackoverflow.com/q/29679363
type: Comment
type: QuestionComment
has text: @Havihavi thanx man, i found it)))
score: 0

http://stackoverflow.com/q/29573754
has comment: http://stackoverflow.com/comment/47296689
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/47296692
score: 1
has title: Could not find element with id maincanvas in jQuery?
favorite count: 0
has body: This is the error I get uncaught exception: Could not find element maincanvas I have included the jQuery file and checked the spelling but error seems to be because of something else Add Blue What is causing this error?
tagged with: camanjs
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/47296731
has answer: http://stackoverflow.com/a/29573917
type: Question
has comment: http://stackoverflow.com/comment/47296556
tagged with: canvas

http://stackoverflow.com/a/29555201
type: Answer
upvote count: 2
score: 2
answers question: http://stackoverflow.com/q/29555155
downvote count: 0
has body: Your Code should be like bg = "http//example.com/img.png"; html = '&lt;div style="background-image:url('+bg+')"&gt;' Quotes missing at last

http://stackoverflow.com/comment/47385164
type: AnswerComment
score: 0
type: Comment
has text: i guess this works too , with radix as parameter is better way to do things , but it will works with parseInt() too .
comment on: http://stackoverflow.com/a/29616112

http://stackoverflow.com/a/29615569
has body: add in file html: $('#total').html("Number of Right Answers: " + "right"); $('#totalw').html("Number of Wrong Answers: " + "wrong"); $("#total").show('slide', {direction: 'right'}, 1000); $("#totalw").show( "slide", {direction: "right" }, 2000 );
upvote count: 1
has comment: http://stackoverflow.com/comment/47376792
accepted answer of: http://stackoverflow.com/q/29615503
answers question: http://stackoverflow.com/q/29615503
type: AcceptedAnswer
downvote count: 0
score: 1
type: Answer
has comment: http://stackoverflow.com/comment/47376851

http://stackoverflow.com/comment/121155796
type: AnswerComment
has text: `map` is superior because it separates the data-structure from the business logic, making it easier to validate and refactor either/both. Any other data structure you use should also implement a `map` function. This will allow you can evolve your data-structure and business logic independently.
type: Comment
comment on: http://stackoverflow.com/a/29640715
score: 0

http://stackoverflow.com/q/29672011
downvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/29672137
favorite count: 0
tagged with: parse-platform
type: AnsweredQuestion
has title: Callback is not called after execution without any errors
score: 1
accepted answer: http://stackoverflow.com/a/29672137
upvote count: 1
type: Question
tagged with: mandrill
has body: I am struggleing with the following code. The request is sent but no callback is called. I also get no error but emails are sent! Do you have any idea? var userPointer = webhook.get("user"); userPointer.fetch().then(function(user){ Parse.Cloud.httpRequest({ method: 'POST', headers: { 'Content-Type': 'application/json; charset=utf-8' }, url: 'https://mandrillapp.com/api/1.0/messages/send-template.json', body: { template_name: webhook.get("mandrillTemplateSlug"), template_content: null, key: user.get("apiKey"), message: { subject: webhook.get("subject"), from_email: "example@mail.com", from_name: "System", to: userData }, async: false } },{ success: function(httpResponse) { console.log(httpResponse); }, error: function(error){ console.log(error); } }); });
tagged with: javascript

http://stackoverflow.com/q/29595963
tagged with: meteor
possible better answer: http://stackoverflow.com/a/29596631
has body: I have this code product.jade a#home(href="{{pathFor 'home'}}") Home input#qty.form-control(type="text", value="1", name="qty") product.coffee Template['product'].events 'click #home': (e, template) -&gt; text = template.find("#qty") ??? return How do I set the value of qty to 5 every time home is click? I tried to used text.value("5") but error occurred Uncaught TypeError: string is not a function. Any ideas?
has answer: http://stackoverflow.com/a/29596062
has comment: http://stackoverflow.com/comment/47338913
tagged with: node.js
type: AnsweredQuestion
tagged with: coffeescript
has answer: http://stackoverflow.com/a/29596631
type: Question
has title: MeteorJS: Change value of input text
tagged with: javascript
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/29596062
tagged with: pug

http://stackoverflow.com/a/29645257
downvote count: 0
has comment: http://stackoverflow.com/comment/47432237
type: Answer
has body: There is a difference: var x = p1 + p2 + p3; var ab = "player: " + player(x); You're calling player with one parameter, x, that contains the sum of your variables. This is valid code, but the other parameters will now be undefined. To illustrate, your function with actually look something like: function player(p1, p2, p3) { var summa = p1 + p2 + p3 //p1 is x, p2 is undefined, p3 is undefined ... else result = "busted"; return result; } Lets say x = 2. When you try to add 2 + undefined + undefined JavaScript will return NaN (Not A Number) and this is what the variable summa will be set to. The only way out from that function is now through "busted" since the other conditions of your if-else are not met (only the else). This can be solved by: var summa = (p1 + p2 + p3) || (p1 + p2) || p1; This basically means that you only add the parameters that were passed to the function, i.e. that exists.
accepted answer of: http://stackoverflow.com/q/29645101
score: 5
type: AcceptedAnswer
upvote count: 5
has comment: http://stackoverflow.com/comment/47432285
answers question: http://stackoverflow.com/q/29645101
has comment: http://stackoverflow.com/comment/47432096

http://stackoverflow.com/q/29647944
accepted answer: http://stackoverflow.com/a/29653289
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I am using the farbric.js for editing images in an app. The image should be able to resize, move/drag, and rotate. The problem is when I rotate the image (by click on the button), it will not in the center of it canvas. So I have to use centerObject() to make it works. However, after I done this, the image cannot be drag any more. this is the function that handling the rotation (it is in a class): rotationset : function(angle, offsetX, offsetY){ // this.obj is the origin object this.Obj.left = offsetX; this.Obj.top = offsetY; this.Obj.angle = angle; this.Obj.center();//center the image //this.canvas also initialized on load. this.canvas.calcOffset(); this.canvas.renderAll(); } So, what is the problem? Any other fix for this?
favorite count: 0
score: 2
has title: Fabric.js - object cannot drag/move after centered
has answer: http://stackoverflow.com/a/29653289
upvote count: 2
type: AnsweredQuestion
tagged with: fabricjs

http://stackoverflow.com/comment/47462515
type: AnswerComment
comment on: http://stackoverflow.com/a/29661436
type: Comment
has text: This is wrong, Node want wrap it in parentheses, but the REPL will wrap all code in parentheses, so there it wouldn't throw, but not really because it's suddenly valid JS.
score: 1

http://stackoverflow.com/comment/47496422
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29679393
has text: Wow! Love the placeholder. gonna favorite that site. +1 very awesome
score: 0

http://stackoverflow.com/q/29538929
has title: Webtc, connect user to the same offer but different answer?
tagged with: javascript
has comment: http://stackoverflow.com/comment/47274464
score: 0
answer count: 1
tagged with: webrtc
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29822468
has body: I have simple webrtc video chat that can support only two users (by extending this serverless implementation https://github.com/cjb/serverless-webrtc/) I am building connection like this: first user opens a page and clicks create button, the offer gets saved to a file on server, and creator starts sending repeated ajax requests to check for an answer. User 2 connects to page and clicks join, he gets the offer from server via ajax, generate an answer and saves it to a file via ajax. User 1 can now pick up the answer from user 2 via his ajax and they are successfully connected. The problem is when user 2 refreshes the page and tries to connect again. User one detects iceConnectionState === 'disconnected' and starts checking for answer again... After user 2 generates the answer nothing happens. I can see that he is creating the answer and that user 1 is accepting it but peer.onopen never gets fired again, and i cant connect users. Is there anything that i should do before trying to reconnect them? Clear the stream somehow, clear connection, reinitialise something etc
has comment: http://stackoverflow.com/comment/47238295
type: Question

http://stackoverflow.com/q/29615180
type: Question
has comment: http://stackoverflow.com/comment/47375626
tagged with: javascript
upvote count: 2
has comment: http://stackoverflow.com/comment/47376706
answer count: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47375824
has comment: http://stackoverflow.com/comment/47376807
accepted answer: http://stackoverflow.com/a/29615778
has comment: http://stackoverflow.com/comment/47376788
score: 2
type: AnsweredQuestion
downvote count: 0
has title: Path of Cookie not working
tagged with: cookies
has answer: http://stackoverflow.com/a/29615778
has body: I want to create a cookie to store a class so I can use this through the whole site. I checked the cookies, and the cookie is created. The problem is when the cookie is set on another page the path is /url-page en not / jQuery(document).ready(function($) { values = $.map($('select option'), function(e) { return e.value; }); $('#color-select').on('change', function() { $("body").removeClass(values.join(" ")).addClass( ("" + $('#color-select').val()) ); var foobar =("" + $('#color-select').val()); document.cookie = "gsscookie=" + foobar, "expires=;domain=;path=/"; }) }); I'm working on a local dev environment with the url plastic.dev.local. What am I doing wrong?

http://stackoverflow.com/q/29634105
score: 0
has answer: http://stackoverflow.com/a/29634359
tagged with: unit-testing
type: Question
has title: How do I spy on methods called from one class that exist in another class using Jasmine?
has body: I have a method thisSvc.asyncOperation: function(id) { return thatSvc.getById(id); Is it possible to create a spy that will tell me if thatSvc.getById has been called, or is this design an anti-pattern? AFAIK, spies can only be created on a single object.
tagged with: javascript
answer count: 2
accepted answer: http://stackoverflow.com/a/29634359
has answer: http://stackoverflow.com/a/29634130
tagged with: jasmine
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/29634130
type: AnsweredQuestion

http://stackoverflow.com/a/29587470
type: Answer
accepted answer of: http://stackoverflow.com/q/29586662
downvote count: 0
score: 1
type: AcceptedAnswer
has body: Use the page visibility api or just window's focus event. I recommend having a backup timer set to a minute or so... these events can be finicky. There's nothing react specific about it other than binding to global events.
upvote count: 1
has comment: http://stackoverflow.com/comment/47334986
answers question: http://stackoverflow.com/q/29586662

http://stackoverflow.com/comment/71134034
type: AnswerComment
comment on: http://stackoverflow.com/a/29535902
score: 0
type: Comment
has text: Should be `data('datepicker')`

http://stackoverflow.com/comment/47338356
type: Comment
has text: I edited my answer, it should work now. If it doesn't work, please edit your post with your updated code so we can look at it again.
comment on: http://stackoverflow.com/a/29595652
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47267801
has text: are you able to put it in a JSFiddle so we can alter the code ?
score: 0
comment on: http://stackoverflow.com/q/29558837
type: Comment
type: QuestionComment

3d-model
type: Tag
tag name: 3d-model
tags question: http://stackoverflow.com/q/29673886

http://stackoverflow.com/comment/47443324
has text: Yeah im not sure how to add it
comment on: http://stackoverflow.com/q/29651712
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47412403
comment on: http://stackoverflow.com/q/29617562
score: 0
type: Comment
type: QuestionComment
has text: @TobiasK. adding `amd: { jQuery: true }` to my webpack config file worked. Thanks!

http://stackoverflow.com/a/29660730
upvote count: 1
has body: Here is the working example of Multi-Select Checkbox functionality implementation in ember. http://alexdiliberto.com/posts/ember-toggle-all-checkbox/ http://emberjs.jsbin.com/coliwiwa/5/edit?html,css,js,output Basically when looping through each item in array, the itemController sends reference of itself to parentController and parentController maintains these references in an array. Here isChecked property is defined inside each itemController instead of attaching to array members. We are using this approach in our production code. Alternative approach could be to use ObjectProxy and attach isChecked property on each array item of new array, and observe it. eg. If colors is array then var newColors = colors.map(function(color){ return Ember.ObjectProxy.create({ isChecked: false, content: color } )}; This way we have create newColors array with isChecked property which we can loop over and we haven't touched the individual items.
downvote count: 0
answers question: http://stackoverflow.com/q/29636032
type: Answer
score: 1

http://stackoverflow.com/comment/47438269
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29648982
has text: I expect relevant markup would be the RENDERED HTML of line 124 to 134 !!! - Please read http://sscce.org

http://stackoverflow.com/comment/47406964
comment on: http://stackoverflow.com/a/29629339
has text: ops, I was gonna use getImageData, changed heart. Doesn't change the point though. Here is a new version, and yes, it seem to be very much related to CORS: https://jsfiddle.net/epistemex/nbfnw4zf/ Let me know if you still don't understand the problem. :)
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47260428
type: AnswerComment
has text: Thanks Mackan. But, the question was with .data() only, and i could not change the implementation.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29554560

http://stackoverflow.com/a/29554476
downvote count: 0
type: Answer
has body: You need to declare your callback as an argument and you can call it directly using the argument name. function doSomething(callback) { // ... // Call the callback callback('stuff', 'goes', 'here'); } function foo(a, b, c) { // your operations alert(a + " " + b + " " + c); } doSomething(foo); like this u will need to call your callback function. Check this answer for more details : https://stackoverflow.com/a/2190872/4763053
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29554151
has comment: http://stackoverflow.com/comment/47260680

http://stackoverflow.com/comment/47527422
comment on: http://stackoverflow.com/a/29679505
has text: This seems very promising I'll be probably unable to invest time into it in the next days, but as soon as I can confirm it fits to our needs I'll accept the answer.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/29677818
answers question: http://stackoverflow.com/q/29677161
downvote count: 0
score: 1
has body: dataType: 'json' requires that what you output in PHP (data accepted in success section) must be valid json. So valid json will be in PHP: if(isset($_POST['answers'])){ echo $_POST['answers']; } No need to decode it, it is json string already. No var_dump, no print_r
upvote count: 1
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/29677161

http://stackoverflow.com/comment/47288049
type: Comment
type: QuestionComment
has text: I think the more appropriate question is "how do I achieve XYZ without having to restart the node instance". as it stands I'm seeing an [XY problem](http://meta.stackexchange.com/a/66378/167434)
comment on: http://stackoverflow.com/q/29568937
score: 0

http://stackoverflow.com/q/29586583
tagged with: javascript
tagged with: google-maps-api-3
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47366557
tagged with: angularjs
type: UnansweredQuestion
has body: So I am calling my api and getting coords of more than 1000 locations. Is there a why to place 20 markers at a time every like 1/2 a second with ng-repeat so that I can speed up the process? It loads all 1000+ at the same time making the markers loading time a lot slower. I am using http://ngmap.github.io/. Here is my Controller: oxford.controller('marker',['$scope', 'companies', function($scope, companies) { companies.success(function(data) { $scope.markers = data; if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function (position) { return $scope.mylocation = (position.coords.latitude + ',' + position.coords.longitude); }); } }) }]); here is my map page: Search: {{ marker.name }} {{ marker.address }}
has title: Load 20 items at a time with Ng-repeat Angularjs or optimize Google Markers
type: Question
tagged with: google-maps
has answer: http://stackoverflow.com/a/29610566

http://stackoverflow.com/comment/47460699
type: AnswerComment
score: 0
type: Comment
has text: True...I got pretty dependent on MomentJS...hard to work without it now.
comment on: http://stackoverflow.com/a/29660459

http://stackoverflow.com/comment/47383931
type: Comment
comment on: http://stackoverflow.com/q/29615993
type: QuestionComment
has text: you can create a new global Date() function that returns whatever you want, including a certain or offset date.
score: 0

http://stackoverflow.com/q/29663808
accepted answer: http://stackoverflow.com/a/29663945
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47467107
score: -3
answer count: 2
has title: Convert an Integer into chunks and get the max and min of each using Javascript
upvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/29663932
has body: I have a system that will process 100 records at a time. The number of records that are available can be 1..n. I need to chunk the data into ranges then get the max and min of those ranges and then process using javascript. I am not sure how to accomplish this. var n = 500; var process_max = 100; var number_of_times_to_process = Math.ceil(n/process_max) // 5 so in this case there will be 5 ranges it would need to process 1 to 100 101 to 200 201 to 300 301 to 400 401 to 500 for( i = 0; i &lt; number_of_times_to_process; i++){ function processranges(max, min) { //do something } } any help would be greatly appreciated.
has comment: http://stackoverflow.com/comment/47467127
possible better answer: http://stackoverflow.com/a/29663932
has answer: http://stackoverflow.com/a/29663945
type: AnsweredQuestion
downvote count: 3

http://stackoverflow.com/a/29532869
has comment: http://stackoverflow.com/comment/47218933
answers question: http://stackoverflow.com/q/29532493
accepted answer of: http://stackoverflow.com/q/29532493
has comment: http://stackoverflow.com/comment/47218988
upvote count: 1
type: AcceptedAnswer
has body: function say( text ){ if('speechSynthesis' in window) { // Chrome only !! var speech = new SpeechSynthesisUtterance( text ); speech.lang = 'en-US'; window.speechSynthesis.speak(speech); } else { // Other browsers !! // Use AJAX (with GET) to a .php to file_get_contents // generate the &lt;100 by &lt;100 charaters audio files, and nest in callbacks } } say("A tattoo of angel wings can handle more than 100 characters"); The else part of the code $("#playButton").click(function(){ var string = encodeURIComponent( $("textarea").val() ); // TODO: split 100+ string into chunks of rightly punctuated sentences. $.ajax({ data: { text: string }, success : function(d) { var audio = new Audio(); audio.src = "data:audio/mpeg;base64,"+d; audio.play(); audio.onended = function() { alert("Ended playing first part"); // TODO : if we have chunks, play the next one! } } }); }); The php goes like: (you can put it inside the same page (at the top)!) &lt;?php if ($_SERVER['REQUEST_METHOD'] === 'GET' &amp;&amp; isset($_GET['text']) &amp;&amp; isset($_GET['lang'])) { $voice = file_get_contents("http://translate.google.com/translate_tts?q=". $_GET['text'] ."&amp;tl=". $_GET['lang'] ."&amp;ie=UTF-8"); echo base64_encode( $voice ); exit; } ?&gt; To properly split the string into parts you can look for questions similar to Split string into sentences in javascript
has comment: http://stackoverflow.com/comment/47219125
type: Answer
has comment: http://stackoverflow.com/comment/47219508
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47220620
has comment: http://stackoverflow.com/comment/47219161

http://stackoverflow.com/a/29619129
has body: Try using: function getUserInput(firstName, lastName) { clientData.setUserName (firstName, lastName); }
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29619045

http://stackoverflow.com/q/29661301
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/29661429
has body: I'm trying to bind scroll for an image so that, based on scroll position, I can change an $scope value. However, something I'm doing is breaking the binding of the value. Here's the JSFiddle: http://jsfiddle.net/h2popz9t/ $scope.testFun = function(a) { if (a.target.scrollLeft &lt; 100) { $scope.something.yes = true; } else if (a.target.scrollLeft &gt; 100) { $scope.something.yes = false; } }; b.bind('scroll', $scope.testFun); When "something.yes" changes (because you've scrolled past 100px) it should trigger the "ng-show" on the div with the text "SOMETHING." It's not. Though, I know they're connected initially because something.yes has the proper value on startup. I'm not sure how I've messed up binding on "$scope.something"
type: AnsweredQuestion
has title: Does .bind break $scope in angularjs?
has comment: http://stackoverflow.com/comment/47462257
type: Question
upvote count: 4
accepted answer: http://stackoverflow.com/a/29661437
downvote count: 0
tagged with: javascript
score: 4
possible better answer: http://stackoverflow.com/a/29661429
answer count: 3
has answer: http://stackoverflow.com/a/29661476
has answer: http://stackoverflow.com/a/29661437

http://stackoverflow.com/q/29621595
favorite count: 0
has answer: http://stackoverflow.com/a/29622055
upvote count: 2
has title: Sails.js, application file not generated
tagged with: node.js
score: 2
type: AnsweredQuestion
has body: I'm new to Sails.js and are now working through some tutorials. I have now created my Sails application and added a User model and controller. The application runs when executing sails lift. I am able the view the users and create more. I cannot find the below referenced file that is supposed to contain basic application settings such as application name, port, environment and log level. config/application.js Am I missing something or did I create the application wrong?
accepted answer: http://stackoverflow.com/a/29622055
type: Question
possible better answer: http://stackoverflow.com/a/29622079
answer count: 2
tagged with: sails.js
has answer: http://stackoverflow.com/a/29622079
downvote count: 0
tagged with: javascript
tagged with: gruntjs

http://stackoverflow.com/q/29667500
tagged with: javascript
has comment: http://stackoverflow.com/comment/47473808
answer count: 2
has answer: http://stackoverflow.com/a/29668061
accepted answer: http://stackoverflow.com/a/29668061
upvote count: 1
has comment: http://stackoverflow.com/comment/47473875
downvote count: 0
has answer: http://stackoverflow.com/a/29667668
favorite count: 0
has comment: http://stackoverflow.com/comment/47473697
has comment: http://stackoverflow.com/comment/47473769
has title: Check if child element already exists
type: AnsweredQuestion
score: 1
possible better answer: http://stackoverflow.com/a/29667668
type: Question
has body: I'm writing some code that appends a hidden form field with my current slide ID attached as a value, this is working to a point. var items = this._core.$stage.children(); for (var i = 0; i &lt; items.length; i++) { if(items[i].classList.contains('active')) { var curr_slide = items[i]; var curr_slide_value = curr_slide.firstElementChild.getAttribute('data-hash'); console.log(curr_slide); console.log(curr_slide_value); if(curr_slide.getElementsByTagName('form').length) { var form = curr_slide.getElementsByTagName('form'); if(form[0].getElementsByName('slide') == null) { var input = document.createElement('input'); input.value = curr_slide_value; input.type = 'hidden'; input.name = 'slide'; form[0].appendChild(input); alert("appended form"); } else { alert("did not append form"); } } } } This line does not work if(form[0].getElementsByName('slide') == null) { At this point I need to check if the input field with name "slide" already exists, and if not, add it. For reference here is my form object [form#gform_1, gform_1: form#gform_1, item: function, namedItem: function] 0: form#gform_1 0: textarea#input_1_1.textarea.medium 1: textarea#input_1_2.textarea.medium 2: textarea#input_1_3.textarea.medium 3: textarea#input_1_4.textarea.medium 4: input#gform_submit_button_1.gform_button.button 5: input 6: input#_gform_submit_nonce_1 7: input 8: input.gform_hidden 9: input.gform_hidden 10: input#gform_save_1.gform_hidden 11: input#gform_resume_token_1.gform_hidden 12: input.gform_hidden 13: input.gform_hidden 14: input#gform_target_page_number_1.gform_hidden 15: input#gform_source_page_number_1.gform_hidden 16: input

http://stackoverflow.com/a/29577625
type: Answer
answers question: http://stackoverflow.com/q/29575869
score: 0
has body: I got it worked and to fetch data by help of this info "$scope is not associated with a scope" finally obtained data with this code : service.js app.service('getData',['$http',function($http){ this.getDataFrom = function(){ return $http.get("http://www.w3schools.com/angular/customers.php") .then(function(response) { return response.data.records; }); };}]); index.html app.controller('customersCtrl', ['$scope', 'getData', function($scope, getData) { getData.getDataFrom().then(function(response){ alert(JSON.stringify(response)); $scope.names=response; }); }]);

http://stackoverflow.com/comment/47415007
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29635884
has text: Hi Bergi, yes that was it - this promise stuff has been driving me mad for the past 3 days. I failed to understand that return d.promise was returning the promise and d.reject and d.resolve were changing state. So irrespective of state, the return should always be d.promise after the state has been set. I'm drinking a double scotch shot tonight in celebration.
score: 0

http://stackoverflow.com/comment/47318844
type: Comment
type: QuestionComment
has text: Use a lookahead. http://www.regular-expressions.info/lookaround.html. Please show what you've tried, we can't help you fix your code if you don't first make an attempt.
comment on: http://stackoverflow.com/q/29585311
score: 0

http://stackoverflow.com/comment/47421210
type: Comment
score: 0
type: AnswerComment
has text: UGH sorry, position:fixed. For some odd reason I have relative in my head xD It SHOULD be position:fixed.
comment on: http://stackoverflow.com/a/29638856

http://stackoverflow.com/q/29656655
has answer: http://stackoverflow.com/a/29709714
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47546369
downvote count: 5
type: UnansweredQuestion
has body: There is already data in a table on the page.The structure of the table looks like some val some val some val some val that is few rows will be displayed from db in above format. In addition to it, based on a button click(Add new row),a new row needs to be be populated.I have implemented the 'add' functionality with this: $('#tbl1'.append( Rows are getting added successfully. But I need to input a value into the above text field(identified by id:'bc') and based on the value enterted, the matching data should be fetched from DB. I thought if I get the id of the innermost element,I will be able to capture that value and send it to DB)Am trying to fetch the ID 'bc' AS $('#bc'.keyup(function(){ alert("key pressed"); }); But,am not getting the alert...I am pretty new to jquery. Please suggest ways of doing it.
tagged with: http://stackoverflow.com/tag/html
upvote count: 0
score: -5
has title: Identify innermost child element using jquery
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47453090
answer count: 1

http://stackoverflow.com/q/29681435
has answer: http://stackoverflow.com/a/29696290
accepted answer: http://stackoverflow.com/a/29696290
answer count: 1
downvote count: 0
linked to: http://stackoverflow.com/q/24830679
tagged with: asp.net
favorite count: 0
has comment: http://stackoverflow.com/comment/47500203
has comment: http://stackoverflow.com/comment/47501379
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47499980
type: AnsweredQuestion
score: 1
upvote count: 1
has title: Issue with AngularJS processing ASP.NET PartialView
type: Question
linked to: http://stackoverflow.com/q/16846210
has body: I have an issue where HTML obtained from a PartialView Ajax call isn't getting processed by AngularJS. The problem I have however, is that some JS is setting the element.html property after page load occurred. I can't really touch this JS as it's filled with more business rules than I know. Here is what appears to be going on. MainPage - Has access to Angular scope &lt;dd class="log"&gt;&lt;/dd&gt; somefile.js - Not in Angular scope (but I can get the MainPage scope via JS if needed) getDataTemplate('.log', 'testid'); function getDataTemplate(placeholder, id) { $.ajax({ type: 'GET', url: '/Get/Data' + id, success: function (data, textStatus, xhr) { var placeHolder = $(placeholder); placeHolder.html(data); } }); }; The data returned from the "Get/Data" can be anything with Angular, say &lt;div&gt;{{1+2}}&lt;/div&gt; Not sure where to go. I tried a few things, but nothing is working. Ideas? Thanks!!!
has comment: http://stackoverflow.com/comment/47528568
tagged with: javascript

http://stackoverflow.com/a/29536000
score: 1
has comment: http://stackoverflow.com/comment/47224580
downvote count: 0
has body: It seems to work with jQuery events: $("#range-input").on("input", function(e) { console.log("change"); rangeInputOutput.innerHTML = this.value; }); ... htmlRange.val(66); htmlRange.trigger("input"); UPDATE: Here is the complete HTML page (without jQuery UI): TODO supply a title Range Slider Range current value N/A
has comment: http://stackoverflow.com/comment/47225129
answers question: http://stackoverflow.com/q/29535467
type: Answer
upvote count: 1

http://stackoverflow.com/q/29531096
favorite count: 0
upvote count: 3
has comment: http://stackoverflow.com/comment/47215643
downvote count: 1
accepted answer: http://stackoverflow.com/a/35014729
type: AnsweredQuestion
has title: why conditional check for define.amd and module.exports and when do the conditions pass ?
type: Question
score: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/35014729
answer count: 1
has body: hey guys i am very new to js and basically i am trying to learn practical js by digging a few js plugins online and also reading good books . now i was digging through the source of a plugin(tinyscroll.js) and saw the following lines of code : if(typeof define == 'function' &amp;&amp; define.amd) { define(function(){ return tinyscrollbar; }); } else if(typeof module === 'object' &amp;&amp; module.exports) { module.exports = tinyscrollbar; } else { window.tinyscrollbar = tinyscrollbar; } i have seem similar lines of code in alot of plugins , as a bigginer these lines of code don't make alot of sense to me , as in i know its a combination of if else statements but , i have no idea as to what use these line are gonna be. my educated guess is(and also after a little bit of testing, that the condition that passes is the last else .) . so why the 2 previos conditions ?. i googled difine.amd and got a bunch of links that said "Asynchronous module definition(AMD)" and the following explanation : Asynchronous module definition (AMD) is a JavaScript specification that defines an API for defining code modules and their dependencies, and loading them asynchronously if desired. but i am still in tangles . can somebody just tell me why the following lines of if and else if ? if(typeof define == 'function' &amp;&amp; define.amd) { define(function(){ return tinyscrollbar; }); } else if(typeof module === 'object' &amp;&amp; module.exports) { module.exports = tinyscrollbar; } Thank you .

http://stackoverflow.com/a/29608602
upvote count: 67
has body: To use tracking with filters, the track by expression has to be added after the filter. {{ contact.name }} Here is the working fiddle
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/90545016
has comment: http://stackoverflow.com/comment/54314446
type: Answer
score: 67
accepted answer of: http://stackoverflow.com/q/29608450
downvote count: 0
has comment: http://stackoverflow.com/comment/47385733
answers question: http://stackoverflow.com/q/29608450

http://stackoverflow.com/q/29533638
has comment: http://stackoverflow.com/comment/47220421
answer count: 0
has comment: http://stackoverflow.com/comment/47225362
type: Question
has comment: http://stackoverflow.com/comment/47224487
tagged with: gwt
has comment: http://stackoverflow.com/comment/47230620
has body: I have a problem with my GWT app. It's much slower when I run it compiled than when I run it on "Super Dev Mode on an external Server"; whatever the browser I use. In the two cases, I run the app on a Tomcat 7.0.59, and the server calls spend nearly the same time. When I timeline the same action on the two versions of the apps with Chrome, I have the following results : Compiled 58.626 ms : Loading 46.69 s : Scripting 198.526 ms : Rendering 1.89 s : Painting 869.991 : Other 4.46 s : Idle Here is a link to the image of memory : https://drive.google.com/uc?/export=view&amp;id=0B0sVNHNdyBWHWXA4aVJFelozc2M Super Dev 65.706 ms : Loading 15.99 s : Scripting 194.724 : Rendering 1.85 : Painting 827.993 ms : Other 6.65 : Idle Here is a link to the image of memory : https://drive.google.com/uc?/export=view&amp;id=0B0sVNHNdyBWHNk0yLWxOM3Z6Nlk There is clearly a problem with the Used JS Heap and the scripting time... But why? Dunno... Am I alone with this problem ? Or did I miss something ? Thanks in advance for your help!
tagged with: javascript
score: 0
has title: My GWT application is slower when compiled than in Super Dev Mode
has comment: http://stackoverflow.com/comment/47221103
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/100114030

http://stackoverflow.com/q/29554361
has body: I have this javascript code that make the div randomly move around web page,but i am not understanding how to make it that it does not flow continuously,its like if user click then it move and then stops there and whenever it clicks again it moves to another random position and after 5 time it shows a message and disappears.I am not getting how to make this animation not like a flow but like a leaf falling from a tree. here is the jsfiddle : JSFIDDLE below is the javascript code : $(document).ready(function(){ animateDiv(); }); function makeNewPosition(){ // Get viewport dimensions (remove the dimension of the div) var h = $(window).height() - 50; var w = $(window).width() - 50; var nh = Math.floor(Math.random() * h); var nw = Math.floor(Math.random() * w); return [nh,nw]; } function animateDiv(){ var newq = makeNewPosition(); var oldq = $('.a').offset(); var speed = calcSpeed([oldq.top, oldq.left], newq); $('.a').animate({ top: newq[0], left: newq[1] }, speed, function(){ animateDiv(); }); }; function calcSpeed(prev, next) { var x = Math.abs(prev[1] - next[1]); var y = Math.abs(prev[0] - next[0]); var greatest = x &gt; y ? x : y; var speedModifier = 0.1; var speed = Math.ceil(greatest/speedModifier); return speed; }
upvote count: 2
answer count: 3
tagged with: javascript
type: UnansweredQuestion
score: 2
downvote count: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/29554473
favorite count: 0
has answer: http://stackoverflow.com/a/29554568
type: Question
has title: Random clickable div move around a webpage
has answer: http://stackoverflow.com/a/29554599
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/comment/47384970
comment on: http://stackoverflow.com/a/29611099
has text: @cleong you are using deprecated version of join that only works due to backward compat, new code should only use the new version
type: Comment
type: AnswerComment
score: 2

http://stackoverflow.com/q/29639176
answer count: 1
score: 0
type: UnansweredQuestion
tagged with: jquery-ui
tagged with: jquery-plugins
type: Question
has body: I have a short piece of jQuery that will automatically insert a '/' character after the 2nd number entered into the date field. This works as expected, but I cannot figure out how to allow the user to edit an incorrect entry by hitting the backspace because the code wants to keep entering the '/' after the second character has been entered, which keeps them from being able to start over. I've tried to solve this on my own, but my skills just aren't up to par yet. Below is my code; any help would be greatly appreciated. Thank you. $(document).ready(function () { $("#cc-exp").keyup(function () { if ($(this).val().length == 2) { $(this).val($(this).val() + "/"); } }); });
has answer: http://stackoverflow.com/a/29639417
tagged with: jquery-mobile
tagged with: javascript
tagged with: jquery
has title: Auto-formatting input fields as user types

http://stackoverflow.com/a/29663929
has body: You can use ajax requests with Redis. You can set a key in redis with a expiration date, and with ajax you are renewing the expiration date, if the user closes the tab, the key will expire and you consider that the user is no longer editing. Hope it helps
answers question: http://stackoverflow.com/q/29663613
score: 0
type: Answer

http://stackoverflow.com/comment/47474716
type: QuestionComment
has text: I could load php file with javascript, but how can I pass in necessary data for unique names and ID's?
comment on: http://stackoverflow.com/q/29667866
score: 0
type: Comment

http://stackoverflow.com/comment/47311677
has text: add to that fiddle what you want your output to really look like, and i might be able to help you.
comment on: http://stackoverflow.com/q/29579651
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29589423
has comment: http://stackoverflow.com/comment/47973580
has comment: http://stackoverflow.com/comment/47693431
has body: Without Changing Animations JSFiddle If you just want to change the background image and shape, you can use pure CSS .button { height:30px; width:60px; -webkit-border-radius:15px; -moz-border-radius:15px; border-radius:15px; background-image:url(...) } .button:hover { -webkit-border-radius:0px; -moz-border-radius:0px; border-radius:0px; background-image:url(...) } If you want to change the text, you need JavaScript. ✓ With Changing Animations JSFiddle To animate the button, use the -webkit-transition:all 0.2s; transition:all 0.2s; functions. Every property that is changed in the :hover css, is automatically animated with a duration of 0.2 seconds. If you also want the text to change (in my example fading in and out) it gets a little more complicated. (Disclaimer: My solution is probably not the most elegant one, but it works.) Add two more classes to your CSS, .fade-out and .fade-in. .fade-out { opacity: 1; animation: fadeOut 0.2s; } .fade-in { opacity: 0; animation: fadeIn 0.2s; } In this case I wanted the text animation to be a little longer than the border animation (I think it looks better), but if they should be the same length, you have to set each of the animations to 0.1s Then add two @keyframes animations, fadeOut and fadeIn like this: @keyframes fadeOut { from {opacity: 1;} to {opacity: 0;} } @keyframes fadeIn { from {opacity: 0;} to {opacity: 1;} } Now the tricky part, the JavaScript: function mouseIsOver() { btn = document.getElementById("button_java"); btn.childNodes[0].className += ' fade-out'; setTimeout(function(){ btn.childNodes[0].innerHTML = "Submit"; btn.childNodes[0].className = btn.childNodes[0].className.replace(' fade-out', ''); btn.childNodes[0].className += ' fade-in'; setTimeout(function(){ btn.childNodes[0].className = btn.childNodes[0].className.replace(' fade-in', ''); }, 200); }, 200); } function mouseIsOut() { btn = document.getElementById("button_java"); btn.childNodes[0].className += ' fade-out'; setTimeout(function(){ btn.childNode…
has comment: http://stackoverflow.com/comment/47373020
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47820145
has comment: http://stackoverflow.com/comment/47957279
score: 0
has comment: http://stackoverflow.com/comment/47373818
type: Answer
accepted answer of: http://stackoverflow.com/q/29588891
has comment: http://stackoverflow.com/comment/47776634
has comment: http://stackoverflow.com/comment/47876873
has comment: http://stackoverflow.com/comment/47374781
has comment: http://stackoverflow.com/comment/47407602
answers question: http://stackoverflow.com/q/29588891
has comment: http://stackoverflow.com/comment/47392288
has comment: http://stackoverflow.com/comment/48004437
has comment: http://stackoverflow.com/comment/47403604
has comment: http://stackoverflow.com/comment/47767937
has comment: http://stackoverflow.com/comment/47623706
has comment: http://stackoverflow.com/comment/47373336
has comment: http://stackoverflow.com/comment/47350708

http://stackoverflow.com/a/29603373
has comment: http://stackoverflow.com/comment/47364812
type: Answer
has comment: http://stackoverflow.com/comment/47353793
has comment: http://stackoverflow.com/comment/47365815
answers question: http://stackoverflow.com/q/29600194
has body: I'm not sure if its quite what you want but you can render HTML without meteor adding the javascript by doing this kind of thing: Router.route('/MyTemplate', function () { this.response.end('&lt;html&gt;&lt;h1&gt; hello world &lt;/h1&gt;&lt;/html&gt;'); }, {where: 'server'}); }); with that code in the server section.
score: 0

http://stackoverflow.com/comment/47387918
type: Comment
type: AnswerComment
has text: Please explain your answer
comment on: http://stackoverflow.com/a/29620576
score: 0

http://stackoverflow.com/q/29638040
favorite count: 0
accepted answer: http://stackoverflow.com/a/29638811
type: AnsweredQuestion
has body: Got multiple combined ifs inside another if. If there is only one if with combined conditions, it works fine. As soon as i add another, it stops working. The js code looks like this var ttl = //dynamic text var curcookie = //dynamicly calculated number if ( ttl.indexOf('something') !== -1 ) //this "if" works in any case { var result1 = "dynamic number" //works fine as well var result2 = "dynamic number" //works fine as well var result3 = "dynamic number" //works fine as well if ( ( curcookie &gt; result1) &amp;&amp; (curcookie &lt; result2) ) { $(".div1").show(); } //works without this one bellow if ( ( curcookie &gt; result2) &amp;&amp; (curcookie &lt; result3) ) { $(".div2").show(); } // works without one above if (curcookie &gt; result3) { $(".div3").show(); } } } as i've already mentioned, it all works fine until i add if ( ( curcookie &gt; result2) &amp;&amp; (curcookie &lt; result3) ) { $(".div2").show();} so, I'm guessing my mistake is somewhere here, but I have no idea what exactly it is. fiddles working https://jsfiddle.net/qxhm2vx9/ not working https://jsfiddle.net/rbhz7Lfj/
has comment: http://stackoverflow.com/comment/47418467
upvote count: 1
has comment: http://stackoverflow.com/comment/47418459
downvote count: 1
type: Question
has title: Multiple combined ifs inside an if
tagged with: javascript
has answer: http://stackoverflow.com/a/29638811
has comment: http://stackoverflow.com/comment/47418448
has answer: http://stackoverflow.com/a/29638872
score: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/29638230
has comment: http://stackoverflow.com/comment/47418415
has answer: http://stackoverflow.com/a/29638230
tagged with: jquery
has comment: http://stackoverflow.com/comment/47418390

http://stackoverflow.com/q/29639177
favorite count: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/29639445
accepted answer: http://stackoverflow.com/a/29640330
upvote count: 1
has answer: http://stackoverflow.com/a/29639445
has body: Using JavaScript, I want to format a number to always display 3 digits, along with it's proper identifier (ex: Million, Thousand). If under 100,000, the number should only show the "thousands" digits All numbers will be integers above zero, and the highest numbers will be in the trillions. A few examples of what I'm looking for: 1 Thousand 13 Thousand 627 Thousand 2.85 Million 67.9 Million 153 Million 9.52 Billion etc... All of the solutions I tried ended up becoming spaghetti code, and I am hoping someone can find a clean, smart solution. I ended up using part of RobG's solution, but worked out the specifics on my own. I added rounding as well function getNumberName(num) { var numNames = ['', 'Thousand', 'Million', 'Billion', 'Trillion']; num = num.toString(); var len = num.length - 1; return numNames[len / 3 | 0]; } function test(num) { var numStr = num.toString(); if (num < 1000) { return numStr; } else if (num < 1000000) { return numStr.slice(0, -3) + "," + numStr.slice(-3); } numStr = Math.round(parseFloat(numStr.slice(0, 3) + "." + numStr[3])).toString() + Array(numStr.slice(3).length + 1).join("0"); var remainder = numStr.length % 3; var before = numStr.slice(0, remainder); var after = numStr.slice(remainder, 3); var sep = ""; if (before.length) { sep = "."; } return before + sep + after + " " + getNumberName(num); } var nums = [0, 1, 12, 123, 1234, 12345, 123456, 1237567, 12325678, 123856789, 123e7, 125e8, 123.6e9, 123e10]; nums.forEach(function(num) { document.write(num + ": $" + test(num) + " "); });
tagged with: formatting
has title: Always display number with 3 digits and descriptor
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29640330
tagged with: number-formatting
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47421049
score: 1

http://stackoverflow.com/comment/47411881
has text: I have revised my question. Hopefully it is clearer now.
comment on: http://stackoverflow.com/a/29617043
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47416198
type: Comment
comment on: http://stackoverflow.com/a/29627787
score: 0
type: AnswerComment
has text: That's true, but the methods in the view model are showModal and closeModal... Given the nature of those methods, I think some dependency on the view is unavoidable. I guess not **all** use cases are going to be easily testable using stuff like jasmine and unit tests... this is probably one of those cases where protractor and regression tests are going to be necessary.

http://stackoverflow.com/comment/47497687
type: AnswerComment
has text: Error: undefined is not a function :/
type: Comment
comment on: http://stackoverflow.com/a/29680043
score: 0

http://stackoverflow.com/q/29573962
has comment: http://stackoverflow.com/comment/47299857
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47296864
type: Question
has comment: http://stackoverflow.com/comment/47297435
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29574039
has title: selector for input with a dynamic value and span with dynamic value jquery
has comment: http://stackoverflow.com/comment/47297669
has comment: http://stackoverflow.com/comment/47297196
has comment: http://stackoverflow.com/comment/47297084
has comment: http://stackoverflow.com/comment/47297610
has comment: http://stackoverflow.com/comment/47297690
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/47300181
has comment: http://stackoverflow.com/comment/47297367
accepted answer: http://stackoverflow.com/a/29574039
has body: In my project i have a table that populate data into. In this table i have a dynamic header with span(x axis) and dynamic value with input(y axis). They are both populated dynamically depending on user insert. In between them are input checkbox. The main goal is to find the value of a certain span and find the value of a certain input then locate the checkbox where they meet then check the checkbox. Here is what i have tried var $td = $('#flooring').find('span:contains('+value.floorno+')').find('input[value='+ value.material +']'); $('#flooringtable tr:not(:eq(0)) td').find(':eq('+$td.index()+')').find('input[type="checkbox"]').prop("checked", true); UPDATE This is the default table since i add the input dynamically it is not here Flooring 1st Floor 2nd Floor 3rd Floor 4th Floor Reinforced Concrete Plain Cement Marble Wood Tiles Here is the adding of row var newRow = $(' '); var i = 0; newRow.append(' Other(Specify) '); for (i; i < numberCheckBox; i++) { newRow.append(' '); //$('.checkboxmatfloor[value="' + value.floorno + " " + value.material + '"]').prop("checked", true); }
tagged with: javascript
has comment: http://stackoverflow.com/comment/47297392

http://stackoverflow.com/q/29647972
upvote count: 1
has answer: http://stackoverflow.com/a/29648045
has title: Is it possible to reload specific browser tabs using JavaScript?
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/47435976
type: Question
downvote count: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/29648045
tagged with: javascript
tagged with: jquery
has body: I have a scenario like ,one main Tab which contains some master data . Once i click on a particular entry in master tab another tab(child tab) will open in same browser with more details of the selected entry. I can perform some update action in the child tab , and it will update the details in DB. What i need to achieve is ,if i perform any action in child tab i need to refresh my Main tab so that whatever changes i have made in child page has to be reflected in main tab. Any help is appreciated.
favorite count: 0
has comment: http://stackoverflow.com/comment/116994218

http://stackoverflow.com/comment/48054951
has text: @acero, Did you use browserify or requirejs in order to make deoxxa canonizer browser compatible? I used browserify but saw the error message - c14n is not defined after runnng `var canonicaliser = c14n.createCanonicaliser("http://www.w3.org/2001/10/xml-exc-c14n#WithComments");`
comment on: http://stackoverflow.com/a/29651480
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47495134
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29678909
has text: `id="test two"` yep! I didn't ever seen
score: 0

http://stackoverflow.com/comment/47219745
comment on: http://stackoverflow.com/q/29533288
score: 0
has text: That's where the wonderful AngularJS and its magical 2-way data binding comes into action :)
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47289052
has text: See the data storage... But I think I understood the idea :) Thanks so much for all
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29569742

http://stackoverflow.com/q/29609925
favorite count: 0
has comment: http://stackoverflow.com/comment/47366051
has title: Totalling and storing previous data numbers (values) in jQuery
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47365515
has answer: http://stackoverflow.com/a/29610174
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47365433
has body: I am using Easy Pie Chart and modifying it out a little to include multiple percentages and rotations to make a complete pie chart. This doesn't really involve anything EPC related but thought I would background it. I have the following HTML: What I'd like to do, with jQuery, is run through each .home-slider-chart and store the value of the current and all the previous data-percent values that came before then I will use it to calculate the rotation number. So, in my example, the data-rotate values in the end would be: I thought this would work, but all it is doing is taking the previous percent rather than totalling all the previous ones. $('.home-slider-chart-container .home-slider-chart').each(function() { var thisPercentage = $(this).data('percent'); var prevPercentage = $(this).prevAll().data('percent'); var percentageTotal = (thisPercentage + prevPercentage); var thisRotation = (percentageTotal / 100 * 360); $(this).data('rotate', thisRotation); }); I have set up a jsFiddle so you can see what I am trying to do and you can use it as a testing environment https://jsfiddle.net/105o7b5m/1/
accepted answer: http://stackoverflow.com/a/29610174
downvote count: 0
answer count: 1
tagged with: javascript
score: 1
tagged with: jquery

http://stackoverflow.com/comment/47415438
has text: @Touffy I did not find any documentation saying so.. can you tell me in which flavor it happens?
comment on: http://stackoverflow.com/a/29636368
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/29566454
answers question: http://stackoverflow.com/q/29566253
has comment: http://stackoverflow.com/comment/47283482
accepted answer of: http://stackoverflow.com/q/29566253
type: Answer
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0
has body: This will permute your array to make it match your specs : var dataBefore = [{ '2015-04-08T17:12:05+00:00': 103.7 },{ '2015-04-08T17:13:05+00:00': 109.5 },{ '2015-04-08T17:14:05+00:00': 106 },{ '2015-04-08T17:15:05+00:00': 112.6 }]; var dataAfter = []; for(var i = 0; i &lt; dataBefore.length; i++) { var item = dataBefore[i]; for(date in item) { dataAfter.push({x: date, y: item[date]}); } } console.log(dataAfter); //added below for display the output $(".results").append(JSON.stringify(dataAfter)); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div class="results"&gt; &lt;/div&gt;

http://stackoverflow.com/comment/47537027
type: AnswerComment
comment on: http://stackoverflow.com/a/29699331
type: Comment
has text: Thanks for the update Ankit, I have updated. FYI SO wants me to wait 20 hours before giving you my bounty....
score: 0

jsdoc3
tags question: http://stackoverflow.com/q/29561573
tag name: jsdoc3
type: Tag
tags question: http://stackoverflow.com/q/29641096

http://stackoverflow.com/q/29610920
has title: Regex To Scrape JavaScript
accepted answer: http://stackoverflow.com/a/29611030
tagged with: web-scraping
type: AnsweredQuestion
tagged with: screen-scraping
type: Question
has answer: http://stackoverflow.com/a/29611030
answer count: 1
tagged with: javascript
score: 0
tagged with: regex
has body: I'm scraping a web page using casperjs, it works great with global JavaScript values, but now I'm stuck at getting out variables form a jQuery closure like this: $(document).ready(function(){ var storeData = { lon: "-5.91829", lat: "54.65583", name: "John Smith" }; SOMEGLOBALVAR.storeFinder.addStore(storeData); }); I can't find a way to to get my hands on lon, lat and name! So I decided to select the script tag, then use regex to get out the code out of the script tag. Here's my ugly regex I built using an online editor: /var storeData = {\n\t*id.*,\n\t.*(\n\t)*\n\t*.*\n\t*.*\n\t*[a-zA-Z: 0- 9,"]*\n\t*[a-zA-Z: 0-9,"]*\n\t*[a-zA-Z: 0-9,"]*\n\t*\};/g So my question has two parts: is there a way to access the lon, lat and name inside that function? (I'm scraping so I can't change the function itself) How can I make my regex better?

http://stackoverflow.com/comment/47475678
type: AnswerComment
type: Comment
has text: Thanks, I had to use .live - the framework that I've been given to work with is so ancient that it Js version doesn't support .on :(
comment on: http://stackoverflow.com/a/29668536
score: 0

http://stackoverflow.com/comment/47464355
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29662345
has text: Learning every day. Great answer, I was hitting my head to the wall. So used to see that things like these attributes are always reflected in the HTML. It gets even more confusing when the attribute "checked" is shown in one item in the HTML and another one is the one that is really checked in the DOM.
score: 0

http://stackoverflow.com/comment/47492812
has text: thanks silly mistake lazy programming copy and paste. :D
comment on: http://stackoverflow.com/a/29676123
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29587566
has comment: http://stackoverflow.com/comment/47322780
answers question: http://stackoverflow.com/q/29587534
has comment: http://stackoverflow.com/comment/47322934
has body: You cannot add multiple onclick statements. You need to add a semicolon ( ; ) between the commands. click me //---------------------------------------------^---------------------------^ However, I would not do it the way you are doing it. I would make a separate function that does whatever you are trying to do. It's not good practice to put everything in the html (inline). I would do it like this:
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47322693
downvote count: 0
has comment: http://stackoverflow.com/comment/47322899
upvote count: 2
type: Answer
accepted answer of: http://stackoverflow.com/q/29587534
score: 2

http://stackoverflow.com/comment/47225375
type: QuestionComment
comment on: http://stackoverflow.com/q/29536220
has text: Yes, you can use a regex
score: 0
type: Comment

http://stackoverflow.com/a/29555805
score: 0
type: AcceptedAnswer
has body: In this line htmlStr += '&lt;a id="searchResult'+i+'" href="javascript:liveSearch('+arrOfSuggestText[i]+')" &gt; '+arrOfSuggestText[i]+'&lt;/a&gt;'; and concrete here '" href="javascript:liveSearch('+arrOfSuggestText[i]+')" &gt; ' you try create calling function, but if you see value of this string, for arrOfSuggestText[i] == 'qwe' you can see something like href="javascript:liveSearch(qwe)" and browser raise error what you get on qwe. So you need just add quotes around like '" href="javascript:liveSearch(\''+arrOfSuggestText[i]+'\')" &gt; '
accepted answer of: http://stackoverflow.com/q/29555599
type: Answer
answers question: http://stackoverflow.com/q/29555599
has comment: http://stackoverflow.com/comment/47262298

http://stackoverflow.com/a/29702769
score: 3
accepted answer of: http://stackoverflow.com/q/29600903
downvote count: 0
answers question: http://stackoverflow.com/q/29600903
upvote count: 3
has body: Handle it externally by checking if the dataset contains records before even rendering the chart. if (data &amp;&amp; data.length){ var chart = AmCharts.makeChart("chartdiv", { "theme": "none", "type": "serial", "dataProvider": data, "valueAxes": [{ "title": "Income in millions, USD" }] } else { // display a message to the user that there is no data available } The AMCharts folks seemed to have neglected handling an empty data set being passed in. Another option is to create a dummy data point that displays a label on the chart. I haven't personally used this approach because I would rather just hide the graph entirely if it contains no data.
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/29652991
has answer: http://stackoverflow.com/a/29653154
score: 0
has answer: http://stackoverflow.com/a/29653053
tagged with: jquery
has comment: http://stackoverflow.com/comment/47446032
accepted answer: http://stackoverflow.com/a/29653053
has answer: http://stackoverflow.com/a/29653869
has comment: http://stackoverflow.com/comment/47446496
answer count: 4
type: AnsweredQuestion
has title: Targeting Button that changes from "Next" to "Submit" on Last Option
type: Question
possible better answer: http://stackoverflow.com/a/29653154
tagged with: javascript
has body: Here is the code for my button...Is is the code give from FeulUX for their Wizard: Next I want to target the button only when it is on the last click (i.e. when it turns to submit). I have this as my code: $('*[button.="Submit"]').click(function(){ console.log('success'); }); But it logs success after each button click (even if the button still reads Next). How do I target the button only when it's text has changed to submit? Any help is appreciated!
has answer: http://stackoverflow.com/a/29653223

http://stackoverflow.com/comment/64591533
has text: Can you share the code please? I'm trying to do the same thing.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29565948
type: QuestionComment

http://stackoverflow.com/q/29660370
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/29660459
accepted answer: http://stackoverflow.com/a/29660459
has comment: http://stackoverflow.com/comment/47460629
has body: Would someone explain why formatting the same dateString differently gives a different date? &gt; new Date("04/08/1984") &lt;· Sun Apr 08 1984 00:00:00 GMT-0600 (Mountain Daylight Time) &gt; new Date("1984-04-08") &lt;· Sat Apr 07 1984 18:00:00 GMT-0600 (Mountain Daylight Time)
upvote count: 8
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29660426
answer count: 2
has title: Javascript new Date(dateString) handling
favorite count: 0
score: 8
possible better answer: http://stackoverflow.com/a/29660426

gzip
tags question: http://stackoverflow.com/q/29632198
tag name: gzip
type: Tag

http://stackoverflow.com/a/29543453
score: 21
answers question: http://stackoverflow.com/q/29542742
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/114053527
upvote count: 21
type: Answer
has comment: http://stackoverflow.com/comment/47239712
downvote count: 0
has body: Yes, there is an option for create: chrome.tabs.create({url: 'http://www.google.com', active: false}); I'm using it in one of my extensions exactly as you described.
accepted answer of: http://stackoverflow.com/q/29542742

http://stackoverflow.com/comment/47360392
comment on: http://stackoverflow.com/q/29607322
has text: Seems very similar to the following topic: http://stackoverflow.com/questions/14810602/how-to-set-mindate-to-current-date-in-jquery-ui-datepicker
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/29607453
downvote count: 1
answer count: 1
tagged with: node.js
has answer: http://stackoverflow.com/a/29607910
has comment: http://stackoverflow.com/comment/47361832
has comment: http://stackoverflow.com/comment/47360872
linked to: http://stackoverflow.com/q/20346097
tagged with: race-condition
tagged with: mean-stack
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47384983
favorite count: 0
has title: MEAN JS DB Race Conditions
type: Question
has comment: http://stackoverflow.com/comment/47362992
score: 1
upvote count: 2
has body: I have updated this question to be more specific based on feedback below Is it possible in a MEAN stack application to have a race condition if two users both make an HTTP request that does the following: read a record, make some changes to the record based on business logic, and then write back to the DB? Or is it impossible due to the single threaded JS execution environment? Based on some comments below it sounds like it is a problem. Is there some way to implement transactions? Or maybe I need to create a job queue or use an actor-based approach. I'm trying to understand how this type of problem is typically solved with the MEAN stack.

http://stackoverflow.com/comment/47506905
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29684914
has text: Note that this is bad practice especially the first example since it's very easy for future maintainers to misconstrue this as a bug and replace `=` with `==`. If you must do this leave a comment. But if you're leaving a comment anyway, might as well do it the more usual way - much less typing
type: AnswerComment

http://stackoverflow.com/comment/47386600
type: Comment
has text: The function 'MyService' is a class that will be instantiated and returned by Angular the first time you inject the 'ZMDataModel'. When you use a service in Angular, Angular returns the return value with 'new' -> return value is 'new MyService () '. The function 'this.load' is a public method in this the class 'MyService'. You could also create an object with the functions and return this instead of a function.
comment on: http://stackoverflow.com/a/29612539
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47405565
has text: Do you need to store timezone?
type: Comment
comment on: http://stackoverflow.com/a/29630681
type: AnswerComment
score: 0

http://stackoverflow.com/q/29670747
downvote count: 1
type: Question
tagged with: google-maps
has title: Google Map is not working as expected
tagged with: javascript
tagged with: google-maps-api-3
answer count: 1
favorite count: 0
upvote count: 2
type: UnansweredQuestion
has body: I know the issue is related to the size but somehow I am not able to solve it. Here is the link on which I am working on. If you go to the Location tab on the top and click on it, then you can see in safari, there is completely grey area and in other browser, if you dont move your mouse after clicking on to the Location tab, then Map would partially grey. For other browser, I am using below code to solve the grey area issue: $("#mega-menu-item-581").mouseover(function(){ $("#menuLocateStore").focus(); google.maps.event.trigger(menuMap, 'resize'); }); But in safari, Dont know How to solve it.Can anyone guide me in this ? Even I tried it to initialize after the mouseover event without any success. Other thing that I have tried is to initialize after timeout, but still It did not give any success to me. The code I am using is added into the snippest. var searchStoreField = document.getElementById('menuLocateStore'); var autocomplete = new google.maps.places.Autocomplete(searchStoreField); //Autocomplete the address var menu_geocoder, menu_map, menu_infoWindow, menu_directionsDisplay, menu_directionsService, menu_geolocationLatlng, menu_markerClusterer, menu_markersArray = [], menu_directionMarkerPosition = {}, menu_mapDefaults = {}, menu_resetMap = false, menu_streetViewAvailable = false, menu_startMarkerData, menu_startAddress, menu_autoLoad = true, menu_startLatLng; function initializeMenuMap() { var menu_myOptions, menu_zoomControlPosition, menu_zoomControlStyle, menu_latLng, menu_zoomLevel, menu_mapType, menu_streetViewVisible; /* If no zoom location is defined, we show the entire world */ menu_startLatLng = new google.maps.LatLng( 57.758665, -101.705156 ); menu_zoomLevel = 12; menu_geocoder = new google.maps.Geocoder(); menu_infoWindow = new google.maps.InfoWindow(); menu_directionsDisplay = new google.maps.DirectionsRenderer(); menu_directionsService = new google.maps.DirectionsService(); /* Set correct the position of the controls */ menu_zoomControlPosition = g…
has answer: http://stackoverflow.com/a/29672475
score: 1

http://stackoverflow.com/comment/47339612
score: 0
type: AnswerComment
type: Comment
has text: That shouldnt cause that
comment on: http://stackoverflow.com/a/29596242

http://stackoverflow.com/comment/47489058
type: AnswerComment
comment on: http://stackoverflow.com/a/29675664
type: Comment
has text: i guess `this != self`
score: 0

http://stackoverflow.com/comment/63349740
type: QuestionComment
comment on: http://stackoverflow.com/q/29600253
has text: Did you manage to fix this?
score: 0
type: Comment

http://stackoverflow.com/q/29581028
tagged with: http://stackoverflow.com/tag/html
upvote count: 6
has comment: http://stackoverflow.com/comment/47372675
has comment: http://stackoverflow.com/comment/47373247
score: 6
linked to: http://stackoverflow.com/q/14093272
type: Question
type: AnsweredQuestion
tagged with: javascript
tagged with: ckeditor
has comment: http://stackoverflow.com/comment/47377367
has title: Problems with a custom self-closing tag in CKEditor
has body: I have a plugin for inserting tag &lt;cut /&gt; in text. It works fine, result is expectable, but in editor window &lt;cut /&gt; transforms into &lt;cut&gt;&lt;/cut&gt;, wraps the paragraphs below and hampers further edits. GIF - http://gyazo.com/dd7c36ba7cb7bc7cb00186cfb83e5fbc Any ideas how to fix it? CKEDITOR.plugins.add('pagecut', { lang: 'de,en,ru', onLoad: function(){ var css = ('display:block;clear:both;width:100%;border-top:#999 1px dotted;padding:0;height:1px;cursor:default;'); var cssBefore = ( 'content:"";' + 'background: url(' + CKEDITOR.getUrl( this.path + 'images/image.png' ) + ') no-repeat right center;' + 'height:14px;width:25px;position:relative;display:block;top:-8px;float:right;' ); CKEDITOR.addCss( 'cut{' + css + '} cut:before{' + cssBefore + '}' ); }, init: function(editor) { CKEDITOR.dtd['cut'] = {}; CKEDITOR.dtd.$empty['cut'] = 1; CKEDITOR.dtd.$nonEditable['cut'] = 1; CKEDITOR.dtd.$object['cut'] = 1; editor.addCommand('insertPagecut', { exec: function(editor) { var element = CKEDITOR.dom.element.createFromHtml('&lt;cut /&gt;'); editor.insertElement(element); } }); editor.ui.addButton('Pagecut', { label: editor.lang.pagecut.toolbar, command: 'insertPagecut', icon: this.path + 'images/icon.png', toolbar: 'links' }); } });
answer count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/47372998
has answer: http://stackoverflow.com/a/29613546
accepted answer: http://stackoverflow.com/a/29613546

http://stackoverflow.com/a/29571747
has body: You need to populate the dropdown ng-options similar to ng-repeat. Please refer to this. https://docs.angularjs.org/api/ng/directive/ngOptions
answers question: http://stackoverflow.com/q/29571689
score: 0
type: Answer

http://stackoverflow.com/comment/47307803
score: 0
has text: I have researched but haven't found a matching result to my need. I am aware of WYSIWYG editors, but digging inside the code may be an overhead.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29579557

http://stackoverflow.com/comment/47374659
comment on: http://stackoverflow.com/q/29614392
score: 0
has text: How many instances of your node app are you running ? you should make sure you're only running one instance. Also , I would log every request to a file using a library like winston https://github.com/winstonjs/winston just to be sure why and when its happening
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47219965
score: 0
type: Comment
type: QuestionComment
has text: is your website in wordpress??
comment on: http://stackoverflow.com/q/29533457

http://stackoverflow.com/q/29576844
tagged with: angularjs
upvote count: 2
answer count: 1
has answer: http://stackoverflow.com/a/29576911
has body: I need to access to the values inside the array "position" of this json file using AngularJS. My problem is that I need to get them as text string values, because I need to add them as css class name inside a tag, basically like this: &lt;div class="europe italy rome"&gt;&lt;/div&gt; &lt;div class="europe france paris&gt;&lt;/div&gt; &lt;div class="america usa atlanta&gt;&lt;/div&gt; This is my Json file: [ { "name": "Rome", "position": ["europe", "italy", "rome"] }, { "name": "Paris", "position": ["europe", "france", "paris"] }, { "name": "Rome", "position": ["america", "usa", "atlanta"] } ] I'm not able to figure it out how to do this. Thank you in advance for your suggestions.
tagged with: http://stackoverflow.com/tag/json
accepted answer: http://stackoverflow.com/a/29576911
score: 2
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
favorite count: 0
type: Question
has title: Parse JSON array values with AngularJs to text strings

http://stackoverflow.com/a/29684213
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29684080
answers question: http://stackoverflow.com/q/29684080
type: Answer
has body: I encourage you to follow these tutorials Aligned Left they cover the basics like setup and such and some simpler forms of charts
score: 1
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/47400225
type: QuestionComment
comment on: http://stackoverflow.com/q/29628664
has text: Where do you call `_doClick`? Where is `submit()` function defined? I don't see how this could submit the form with the code provided.
score: 0
type: Comment

http://stackoverflow.com/comment/47330040
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29591336
has text: does your asp.net home controller has index method?
score: 0

http://stackoverflow.com/comment/47217182
type: Comment
has text: Browsers dont have always the same behavior and that's because each browser is made with a different thinking.
comment on: http://stackoverflow.com/a/29531861
score: 0
type: AnswerComment

calendar
tags question: http://stackoverflow.com/q/29630754
tags question: http://stackoverflow.com/q/29561289
tags question: http://stackoverflow.com/q/29598682
tags question: http://stackoverflow.com/q/29536318
tag name: calendar
tags question: http://stackoverflow.com/q/29585580
type: Tag

http://stackoverflow.com/a/29642808
answers question: http://stackoverflow.com/q/29642567
has comment: http://stackoverflow.com/comment/47426995
has comment: http://stackoverflow.com/comment/47426956
has body: In your original plunkr you used data in the HTML while your variable in the scope is called info. Using ng-repeat instead of ng-options I got it to work like this: {{ option.name }} http://plnkr.co/edit/jp8g65LDtft1ZVvJe8nz Which also gets the result you want if I interpreted your question right. Edit: Oh by the way, selected should be selected='selected' and not by a boolean.
score: 0
has comment: http://stackoverflow.com/comment/47426846
has comment: http://stackoverflow.com/comment/47427082
type: Answer

http://stackoverflow.com/comment/47424773
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29641586
type: Comment
has text: You can add this attribute using javascript/jquery after DOM ready.

http://stackoverflow.com/comment/47395364
comment on: http://stackoverflow.com/q/29626097
type: QuestionComment
has text: Duplicate of http://stackoverflow.com/questions/926916/how-to-get-the-bodys-content-of-an-iframe-in-javascript
score: 0
type: Comment

http://stackoverflow.com/comment/47460305
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29659993
has text: @ChristianJuth I'm not saying it shouldn't be used. I clearly pointed out it's a great time saver. I'm saying for the purpose of learning it's better to learn pure javascript.

http://stackoverflow.com/q/29587391
has answer: http://stackoverflow.com/a/29592526
upvote count: 0
has comment: http://stackoverflow.com/comment/47322564
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/29587596
has answer: http://stackoverflow.com/a/29587455
has comment: http://stackoverflow.com/comment/47322456
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47322392
has answer: http://stackoverflow.com/a/29587549
possible better answer: http://stackoverflow.com/a/29587455
downvote count: 1
has body: I'm trying to display json data in a table when a query is sent. The request works fine and everything gets displayed nicely. BUT: jquery throws an TypeError: a is undefined when I try to display the content. The content is getting displayed correctly the first time the page is loaded, but then refuses to update when another request is sent over the form. I simply want to append table rows to a table within the HTML: &lt;table id="table"&gt;&lt;/table&gt; the JS looks like this: for (var id = 0; id &lt; 150; id++) { showItems(id); } function showItems(){ $.each(json.list.item[id], function(i, val) { var $r = $('&lt;tr&gt;'); var $c = $('&lt;td&gt;').text(i).appendTo($r); $c = $('&lt;td&gt;').text(val).appendTo($r); $("#table").append($r); }); } I'm pretty sure it has something to do with the id passed on from the for loop to the each function, but I don't know how to fix this. Since JS doesn't have block scope within the for loop, the id variable should be accessible within the $.each() right? But I can't work out why jquery throws me the "a is undefined" error and the script won't react until the page is reloaded.I think it could be something with an undefined variable returning Null, but I don't know which. Couldn't figure out the solution from reading tons of answers here and on the web (also about JS variable scope and closures). http://jshint.com/ doesn't show any undefined variables except the jquery $S. Help is greatly appreciated :) Edit: The _id fix didn't help. Here is the whole js code. $(document).ready(function(){ $("#term").focus(function() { var full = $("#table &gt; tbody &gt; tr").length? true : false; if(full == false) { $("#message").empty(); $("#table").empty(); } }); var getFood = function(){ var food = $('#term').val(); if(food ==''){ $('#message').html("Ha! We haven't seen you type, so no request! Type something!&lt;hr&gt;"); } else { $('#message').html("Your information is on its way!&lt;hr&gt;"); $.getJSON("APICALL", function(json){ console.…
type: Question
has comment: http://stackoverflow.com/comment/47322605
has comment: http://stackoverflow.com/comment/47322665
accepted answer: http://stackoverflow.com/a/29587596
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/47322382
has title: Combining for loop with .each() in jquery

http://stackoverflow.com/comment/47347290
has text: @ Kim Carlo have you included `jQuery ui`?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29600253
score: 0

http://stackoverflow.com/comment/47333977
has text: Is something minifying your code? I see no reference to `e` in any of the controllers that you've included. If you are, in fact, minifying your code, you need to use the explicit dependency format rather than allowing Angular to infer your dependencies by name.
comment on: http://stackoverflow.com/q/29593610
type: Comment
type: QuestionComment
score: 1

dc.js
tag name: dc.js
tags question: http://stackoverflow.com/q/29594395
tags question: http://stackoverflow.com/q/29571724
tags question: http://stackoverflow.com/q/29543135
type: Tag
tags question: http://stackoverflow.com/q/29537914
tags question: http://stackoverflow.com/q/29640111
tags question: http://stackoverflow.com/q/29619305

http://stackoverflow.com/comment/134087248
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/44194605
score: 0
has text: And the draw method with false argument i.e. `$('#example').DataTable().row(120).draw(false)` achieves the same.

http://stackoverflow.com/comment/47478445
comment on: http://stackoverflow.com/a/29668826
score: 0
type: Comment
has text: Ok, I'm not happy about it but the only way I made it work was to set ClientIDMode="Static" on the label and on the OnClientClick event do this "return showConfirm('lblGVDeleteMessage');"
type: AnswerComment

http://stackoverflow.com/a/29559605
answers question: http://stackoverflow.com/q/29559279
has body: My workaround is add a binding for mouseover event to the label(or text) $('.highcharts-xaxis-labels text').bind('mouseover',function(e){ alert("You hover on "+$(this).text()) }); Let's try this edited version demo
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29559279

http://stackoverflow.com/comment/47404875
type: QuestionComment
has text: I am not sure if it is a typo or not, but you are missing `'` at the end of the ajax url.
comment on: http://stackoverflow.com/q/29631093
score: 0
type: Comment

http://stackoverflow.com/a/29740197
answers question: http://stackoverflow.com/q/29581316
score: 0
type: AcceptedAnswer
has body: you are gonna have to replicate your common code in few files, like appilcation start and everything, then inlcude these files in each of the unit test html files. Then you can write tests for each individual views/folders. You can use something like Balnket.js for checking your coverage. Remember few ground rules: Test one function at time, stub(with something like sinon.js) external code being called from this function). There should be no server calls initiated from your test page, they should be faked.
type: Answer
accepted answer of: http://stackoverflow.com/q/29581316

http://stackoverflow.com/comment/47386710
score: 0
has text: @Raidri, I have minimized the code
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29609021

http://stackoverflow.com/a/29649336
has comment: http://stackoverflow.com/comment/47439773
has comment: http://stackoverflow.com/comment/47480279
downvote count: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47438906
accepted answer of: http://stackoverflow.com/q/29649010
type: Answer
answers question: http://stackoverflow.com/q/29649010
has comment: http://stackoverflow.com/comment/47477486
has comment: http://stackoverflow.com/comment/47438864
score: 3
has body: Problem In your PVector object you are returning Arrays for x and y, while you use them as values in the step() method. This will cause the entire array to be added as a string. Solution You need something that traverse that array. Here is an example, it may not be the result you're after, but it shows the principle which you need to apply: // first note the return type here: function PVector(x_,y_){ var y = []; var x = [0, Math.PI/6, Math.PI/4, Math.PI/3, Math.PI/2, 2/3*Math.PI, ...snipped--- return { x:x, // x and y are arrays y:y }; } var Point = { location: { x: 0, y: can_height / 2, step: 0 // some counter to keep track of array position }, //initial location velocity: new PVector(x, y), step: function () { this.location.step++; // increase step for arrays // using modulo will keep the step as a valid value within the array length: // if step = 7 and length = 5, index will become 2 (sort of "wrap around") var indexX = this.location.step % this.velocity.x.length; var indexY = this.location.step % this.velocity.y.length this.location.x += this.velocity.x[indexX]; this.location.y += this.velocity.y[indexY]; }, ... Updated fiddle Tip: I would as Robin in his answer, recommend to simplify the sinus calculation. Sinus-tables are good when performance is needed and the browser can't keep up (ie. will thousands of objects), but in simpler scenario, direct calculation will work too.
upvote count: 3

http://stackoverflow.com/a/29555103
has body: $(this) will wrap a single element, there's no need to pass a function into text, as you know it will only loop over one element. You're also not, as far as I can tell, actually making any effort to show or hide anything. I assume clicking a HIDE link should hide its associated div. So (see code comments): $(function() { $('.bhlink').on('click', function () { // Get jQuery wrappers for the link that was clicked, // and the .bhinfo connected to it var $this = $(this), $bhinfo = $this.closest(".nn").next(".bhinfo"); // Are we showing or hiding? if ($this.text() == 'MORE') { // Showing, hide all that are visible and change // their links' associated text to 'MORE' $(".bhinfo:visible") .slideUp() .prev(".nn").find(".bhlink").text('MORE'); // Show our div and change our text $bhinfo.slideDown(); $this.text('HIDE'); } else { // Hiding -- just slide our div up and change our text $bhinfo.slideUp(); $this.text('MORE'); } }); }); .bhinfo { display: none; } .nn { margin: 5px 0 5px 0; font-weight: bold;} David jhon MORE Mobile: 99934 59234 Peter mick MORE Mobile: 88934 59234 Sleek boon MORE Mobile: 76534 59234
answers question: http://stackoverflow.com/q/29554980
score: 2
has comment: http://stackoverflow.com/comment/47264062
downvote count: 0
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/47264003

http://stackoverflow.com/comment/47355323
type: Comment
has text: I'm sure this scope of variable solution will be used throughout my life... :)
comment on: http://stackoverflow.com/a/29604346
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47232093
has text: I'm not aware of any benefits aside from performance. If you have a small number of event handlers, or it's an event that's not going to be triggered often (i.e. not something like click or scroll), then you can generally get away with binding everything to the document.
type: Comment
comment on: http://stackoverflow.com/q/29539947
score: 0
type: QuestionComment

http://stackoverflow.com/comment/47229660
has text: Tried but no effect I get HTML elements in alert but when I assign them to hidden field getting its value null at server side ?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29538681
type: AnswerComment

http://stackoverflow.com/comment/47292603
comment on: http://stackoverflow.com/q/29571393
score: 0
type: QuestionComment
type: Comment
has text: Your question is confusing. "I used an tag instead of an ? " what does that mean?

http://stackoverflow.com/comment/47445146
score: 0
has text: Thanks, i took this out of the Symfony context to at least take that out of the equation, so it's now more down to writing a requireJS config that can wrap the CommonJS thing. I managed to get the actual loading to work but now it's complaining about modules not being loaded. Made a new post here: http://stackoverflow.com/questions/29652716/module-exports-module-is-not-defined
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29631899

http://stackoverflow.com/a/29538751
score: 1
answers question: http://stackoverflow.com/q/29538655
upvote count: 1
has body: how about just having one code block: $("body").on("keypup", "#name, #login, #account_manager, #email", function() { var form = $("#users_form"); var url = form.attr("action"); var formData = form.serialize(); $.get(url, formData, function(data) { $("#reseller_admin_list").html(data); }); }); Much better though, would be to give you elements a class, and bind to the class rather then each id, i.e. $("body").on("keypup", ".someClass", function() { //etc
downvote count: 0
type: Answer

http://stackoverflow.com/a/30418441
answers question: http://stackoverflow.com/q/29547758
type: Answer
score: 0
has body: See if adding "position:absolute" to the CSS helps - .map { position:absolute; width: 100%; height: 100%; }

http://stackoverflow.com/q/29578246
tagged with: jquery
tagged with: search
score: 0
has title: Search using enter key and search button JavaScript
has comment: http://stackoverflow.com/comment/47304894
has answer: http://stackoverflow.com/a/29578267
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47306895
type: Question
has comment: http://stackoverflow.com/comment/47308350
linked to: http://stackoverflow.com/q/155188
answer count: 1
has body: I'm using the following code and it works fine by clicking on the search button. But how can I also search using the enter key? Code: &lt;script&gt; function mySearch() { var text = document.getElementById('strSearchText').value; var url = "privatelink=" + text; window.open(url,'_blank'); } &lt;/script&gt; &lt;style&gt; button:hover {color:red;} .rounded-corners { -moz-border-radius: 20px; -webkit-border-radius: 20px; -khtml-border-radius: 20px; border-radius: 20px; white-space:normal; font-weight:bold; width: 50%; } .smallbutton { -moz-border-radius: 20px; -webkit-border-radius: 20px; -khtml-border-radius: 20px; border-radius: 20px; white-space:normal; font-weight:bold; width: 20%; } &lt;/style&gt; &lt;br&gt; &lt;input type="text" size="25" tabindex="1" value="" id="strSearchText"&gt;&amp;nbsp; &lt;button class="smallbutton" onclick="mySearch();"&gt;&lt;span style="DISPLAY: inline-block"&gt;Search&lt;/span&gt;&lt;/button&gt;
tagged with: javascript

http://stackoverflow.com/comment/47394461
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29625643
has text: Those are standard `for` loops.

http://stackoverflow.com/q/29559133
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47268410
has body: I have some numbers that I need to convert to a currency. I am using this script to do the conversion (https://github.com/CodersPress/jQuery-Currency) which works on one of my numbers but not the other. I can't work out how to target the number in the li (I can't modify the html output in this case). I tried to filter the text to re-position the ':' from the number in the li but still can't get the currency conversion to work on the number in the li. I have a fiddle here: https://jsfiddle.net/dcrr5qxf/5/ Here is my html: &lt;ul class="cfeature"&gt; &lt;li class="purchase_price"&gt;&lt;label&gt;Purchase Price&lt;/label&gt;: 333333&lt;/li&gt; &lt;/ul&gt; &lt;p class="purchase_price"&gt; &lt;label&gt;Purchase Price:&amp;nbsp;&lt;/label&gt; &lt;strong&gt;&lt;span&gt;333333.00&lt;/span&gt;&lt;/strong&gt; &lt;/p&gt; Here is my js: $('.purchase_price').each(function() { $(this).html($(this).html().replace(":", "")); }); $('.purchase_price').each(function() { $(this).html($(this).html().replace("Purchase Price", "Purchase Price:")); }); $(".purchase_price span").currency(); // this one works as the number is in a &lt;span&gt; $(".purchase_price").currency(); // this one doesn't work }); });
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29579424
score: 0
has title: How do I filter text so I can convert part of it to a currency?
answer count: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/29579424
has comment: http://stackoverflow.com/comment/47303038
has comment: http://stackoverflow.com/comment/47308098
type: AnsweredQuestion

http://stackoverflow.com/comment/47395210
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29619034
has text: Yes there is. you can give it a class name then use `Document.getElementsByClassName`. or if you don't want to give the `` tag any thing you can type `document.getElementsByTagName("input")[0];` . you will need to type [0] since `getElementsByTagName` returns the array of all elements.

http://stackoverflow.com/comment/47508157
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29681613
type: Comment
has text: Sorry, typo. Trying alerts/logs now.

http://stackoverflow.com/comment/47488653
has text: i didnt get what you trying to say, can you show by fixing the code?
comment on: http://stackoverflow.com/q/29675057
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29532729
has title: Adding all promises without a tracker option to a global promise tracker in angular
type: Question
score: 0
has comment: http://stackoverflow.com/comment/64282416
has comment: http://stackoverflow.com/comment/47224722
tagged with: angularjs
tagged with: angular-promise
has comment: http://stackoverflow.com/comment/47219103
has comment: http://stackoverflow.com/comment/47219394
has body: I wish to add all promises without a specified tracker property to a global promise-tracker and use that to initialise a spinner if the app is busy for > 200ms. So far I have tried altering the angular-promise-tracker source code to add an else statement and I have tried adding a promise tracker to $rootscope but I seem to be missing something. Edit - I also tried decorating $q but ran into a circular dependency error as the angular-promise-tracker relies on $q. Is there a preferred method to achieve this functionality? Can anyone help me out? I didn't want to raise an issue on the project page (https://github.com/ajoslin/angular-promise-tracker/) as it's more a request for guidance
answer count: 0
type: UnansweredQuestion
tagged with: javascript

http://stackoverflow.com/comment/47297227
type: QuestionComment
comment on: http://stackoverflow.com/q/29574143
score: 0
has text: Are you trying to do something like this http://jsfiddle.net/j4034w5w/ ?
type: Comment

http://stackoverflow.com/comment/47307074
comment on: http://stackoverflow.com/q/29579328
type: Comment
type: QuestionComment
has text: if at all there is some error , you can check in the console and resources
score: 0

http://stackoverflow.com/q/29556887
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29601010
has answer: http://stackoverflow.com/a/29559166
has body: I have a web page where I am playing a series of background videos. Initially I had it so I swap the source of the video file but I found that to be slower than having several video tags and manipulating them with display none/block. It was working fine in all the browsers except Safari, so I started looking in a different way to fire up the videos. Before looking into using video duration and time update I simply had the "ended" event listener. My problem with the current solution is that it doesn't work at all in Safari and stops after a couple of videos across the rest of the browsers. Here is the code: (function ($) { var FIAFE = FIAFE || {}; $.extend(true, FIAFE, { fanboost: { index: 1, randomize: false, playlist: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11'], video: null, videoDuration: null, bgvideo: function () { if (FIAFE.fanboost.video.currentTime < (FIAFE.fanboost.videoDuration - 0.5)) { console.log("currentTime is less than duration - 0.5"); } else { console.log("currentTime reached duration - 0.5"); if (FIAFE.fanboost.randomize) { FIAFE.fanboost.index = Math.floor(Math.random() * (FIAFE.fanboost.playlist.length - 1 + 1) + 1); if (FIAFE.fanboost.index >= FIAFE.fanboost.playlist.length || FIAFE.fanboost.index == 0) { FIAFE.fanboost.index = 1; } } else { FIAFE.fanboost.index++; if (FIAFE.fanboost.index >= FIAFE.fanboost.playlist.length) { FIAFE.fanboost.index = 1; FIAFE.fanboost.randomize = true; } } var currentVid = FIAFE.fanboost.video; var newVid = document.getElementById('bgvid' + (FIAFE.fanboost.index)); newVid.load(); newVid.addEventListener('loadedmetadata', function () { FIAFE.fanboost.videoDuration = newVid.duration; newVid.play(); newVid.style.display = 'block'; console.log("new videoDuration: " + FIAFE.fanboost.videoDuration); newVid.addEventListener('timeupdate', FIAFE.fanboost.bgvideo, false); newVid.removeEventListener('loadedmetadata', FIAFE.fanboost.bgvideo, false); currentVid.style.display = 'none'; currentVid.removeEventListen…
tagged with: html5-video
has title: Cycling through HTMl5 video tags using timeupdate and loadedmetadata events
possible better answer: http://stackoverflow.com/a/29559166
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29601010
type: Question
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/47242512
type: QuestionComment
has text: Good point. For some reason I didn't think that would work, but it does. The only slightly annoying thing is that it goes right over the characters, leaving them half grey-half black, whereas I prefer for the characters to change colour at ones. but I don't know if any other option would fix that. Thanks for this suggestion though!
comment on: http://stackoverflow.com/q/29542572
score: 0
type: Comment

http://stackoverflow.com/comment/47297948
score: 0
type: Comment
has text: Thanks Maverick. Kind of what I was doing. Problem is any time the plugin is applied on the page, it will share the same variable.
type: AnswerComment
comment on: http://stackoverflow.com/a/29574493

http://stackoverflow.com/comment/47365048
comment on: http://stackoverflow.com/a/29601040
type: Comment
has text: that is imo the repetition of my question
score: 0
type: AnswerComment

http://stackoverflow.com/q/29599170
answer count: 1
tagged with: php
has body: <?php if($this->flashMessenger()->hasMessages()):?> <?php $msgs = $this->flashMessenger()->getMessages();?> <?php echo $msgs[0];?> <?php endif;?> <?php $this->flashMessenger()->clearMessages();?> I want to display the alert when hasMessages() return true, so I use the javaScript in if(){}, but it doesn't work like this <?php if($this->flashMessenger()->hasMessages()):?> <?php $msgs = $this->flashMessenger()->getMessages();?> <?php echo $msgs[0];?> <?php endif;?> <?php $this->flashMessenger()->clearMessages();?> is there any way to solve this? Thank u!
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29599736
has title: use js to control the dom style in phtml
tagged with: dom
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29599736
score: 0

http://stackoverflow.com/comment/47313018
comment on: http://stackoverflow.com/a/29574076
score: 0
has text: @CarbonandH20 putting it into the controller makes your binding in the view so you dont have to use the service itself. did you assign a value to $today prior to assigning startDAte. As i see you have to call $scope.today(before calculationDataService.firstDate = $scope.dt;)
type: Comment
type: AnswerComment

http://stackoverflow.com/a/29617327
has body: Could this be done in the css instead is also a question I have? It is far easier and better in CSS than in Javascript! Read this question: Responsive design with media query : screen size? Code to change background image with CSS @media only screen and (min-device-width : 320px) and (max-device-width : 480px) { div { background-image: url("img/icons/logowhite.png"); } } @media only screen and (min-device-width : 768px) { div { background-image: url("img/icons/logodark.png"); } }
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29617177
has comment: http://stackoverflow.com/comment/47379654
score: 1
upvote count: 1

http://stackoverflow.com/comment/47395480
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29626109
has text: No this doesnt work.. i want to get ALL the variants which match the product in the same array like i have explained above
score: 0

http://stackoverflow.com/q/29649972
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/29650785
has answer: http://stackoverflow.com/a/29650279
type: Question
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/29650062
accepted answer: http://stackoverflow.com/a/29650062
has body: I have a JSON object which looks like this: var allDataJson = [{"Researchers":"Laura, Mikael","Year":"2015"}, {"Researchers":"Mikko","Year":"2013",}, {"Researchers":"Harri","Year":"2015"}, .......] //long list I need to create a JSON object as follows: var myjson = [{"Year": 2015, "Total":60}, {"Year": 2014, "Total":68}, {"Year": 2013, "Total":72}] For instance there are 60 allDataJson items with Year 2015. So far I only could get the year values. Any ideas about how to calculate Total? Here is my code: function countPublicationsPerYear(allDataJson){ var lookup = {}; var items = allDataJson; var result = []; for (var item, i = 0; item = items[i++];) { var year = item.Year; count ++; if (!(year in lookup)) { var count = Object.keys(item).length; lookup[year] = 1; result.push({ "Year":year }); } } return result; //returns Year: 2013, 2014, 2015 }
has title: How to count specific elements in JSON
has answer: http://stackoverflow.com/a/29650987
answer count: 4
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/29683863
possible better answer: http://stackoverflow.com/a/29650279

http://stackoverflow.com/q/29533708
has body: I want to use lolapi, so I went with my terminal to folder where project is and did npm install lolapi. My code is a really simple cordova app: HTML: &lt;body&gt; &lt;div class="app"&gt; &lt;h1&gt;&amp;nbsp;&amp;nbsp;Lol App&lt;/h1&gt; &lt;/div&gt; &lt;script type="text/javascript" src="js/index.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="js/lolJ.js"&gt;&lt;/script&gt; &lt;/body&gt; JavaScript (lolJ.js): var options = { useRedis: true, hostname: '127.0.0.1', port: 6379, cacheTTL: 7200 }; var lolapi = require('lolapi')('***-***-***-***-***', 'euw', options); lolapi.setRateLimit(10, 500); var summonerName = 'Wickd'; lolapi.Summoner.getByName(summonerName, function (error, summoner) { if (error) throw error; /* summoner object { Wickd: { id: 71500, name: 'Wickd', profileIconId: 613, summonerLevel: 30, revisionDate: 1408199475000 } } */ console.log(summoner); console.log(summoner[summonerName]); var summonerId = summoner[summonerName].id; lolapi.Summoner.getRunes(summonerId, function (error, runes) { if (error) throw error; // do something with runes }) }); I replaced Wickd with my lol username, but still nothing happens. As you can see I'm really new to this, so please, any guide will be great Thanks
type: Question
has title: Why I get "Uncaught ReferenceError: require is not defined"?
tagged with: node.js
tagged with: cordova
has comment: http://stackoverflow.com/comment/47220412
has answer: http://stackoverflow.com/a/29533737
score: 0
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29533737
type: AnsweredQuestion

http://stackoverflow.com/comment/47422852
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29617659
type: QuestionComment
has text: Ah, great explanation. That really helps me figure out what's going on. Thanks.

http://stackoverflow.com/comment/47354854
has text: Does JS support typing (ex. event:MouseEvent)??
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29602899
type: Comment

http://stackoverflow.com/comment/47219959
score: 1
type: Comment
type: QuestionComment
has text: And if you use `Math` as an example, it seems obvious that the convention is to start with a capital.
comment on: http://stackoverflow.com/q/29533414

http://stackoverflow.com/comment/47425934
comment on: http://stackoverflow.com/q/29640040
has text: I am using chrome but i think is because of the resizing the image and doing the orientation cause the browser unresponsive... Compare with browser scroll bar, the div scroll bar much more obvious.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29556088
type: AnsweredQuestion
tagged with: ajaxcontroltoolkit
tagged with: popupcontrolextender
type: Question
tagged with: c#
accepted answer: http://stackoverflow.com/a/30026538
answer count: 1
tagged with: javascript
has title: ajaxToolkit PopupControlExtender not working. Outdated?
score: 0
tagged with: asp.net
has answer: http://stackoverflow.com/a/30026538
has body: I'm followed this tutorial but I'm getting runtime error when mouseover: Sys.ArgumentUndefinedException: Value cannot be undefined. Parameter name: type The problem is in this lines of code: string OnMouseOverScript = string.Format("$find('{0}').showPopup();", behaviorID); string OnMouseOutScript = string.Format("$find('{0}').hidePopup();", behaviorID); img.Attributes.Add("onmouseover", OnMouseOverScript); img.Attributes.Add("onmouseout", OnMouseOutScript); Any thoughts on this? My goal is to get details of gridview row when mouseover a specific column, like the demo on the referenced linked.

device-width
type: Tag
tag name: device-width
tags question: http://stackoverflow.com/q/29568433

http://stackoverflow.com/a/36923905
answers question: http://stackoverflow.com/q/29678510
score: 2
downvote count: 0
has body: cmft Studio supports conversion/filtering of various HDR/LDR projections to cubemaps. https://github.com/dariomanesku/cmftStudio
upvote count: 2
type: Answer

http://stackoverflow.com/q/29684417
accepted answer: http://stackoverflow.com/a/29690390
has title: AngularJS - UI Router - Unable to use resolve to provide my controller with data
downvote count: 0
favorite count: 0
linked to: http://stackoverflow.com/q/28800644
tagged with: angularjs
type: Question
upvote count: 2
answer count: 1
has comment: http://stackoverflow.com/comment/47505845
has answer: http://stackoverflow.com/a/29690390
tagged with: angular-ui-router
linked to: http://stackoverflow.com/q/12339272
tagged with: javascript
has body: I am trying to inject a resolve object with loaded data into my controller but I get an Unknown Provider error : Unknown provider: configServiceProvider <- configService Here is my code: StateProvider $stateProvider .state('index', { abstract: true, url: "/index", templateUrl: "#", resolve: { configService: function () { return { "helloText": "Welcome in Test Panel" }; } } }) Controller function MainCtrl($scope, configService) { $scope.config = configService; }; angular.module('dot', ['ui.router']) .config(config) .controller('MainCtrl', MainCtrl) Snippet function config($stateProvider, $urlRouterProvider) { $urlRouterProvider.otherwise("#"); $stateProvider .state('index', { abstract: true, url: "/index", templateUrl: "#", resolve: { configService: function() { return { "helloText": "Welcome in Test Panel" }; } } }) }; function MainCtrl($scope, configService) { $scope.config = configService; }; (function() { angular.module('dot', [ 'ui.router', // Routing ]) .config(config) .run(function($rootScope, $state) { $rootScope.$state = $state; }) .controller('MainCtrl', MainCtrl) })(); It's like my resolve object is defined after my controller has loaded... I'm new to angularJS and I feel like I am definitely missing something very obvious. Thanks.
has comment: http://stackoverflow.com/comment/47505924
score: 2
type: AnsweredQuestion

http://stackoverflow.com/comment/47364469
has text: Why do you need to clear the field if you're just going to reload the page?
comment on: http://stackoverflow.com/q/29609321
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/comment/47489472
score: 0
type: QuestionComment
type: Comment
has text: Returns an object but with ``length: 0`` although it is definitely in DOM (checked with Chrome developer tools).
comment on: http://stackoverflow.com/q/29672842

http://stackoverflow.com/comment/47492382
comment on: http://stackoverflow.com/q/29677161
score: 0
type: QuestionComment
type: Comment
has text: try removing dataType: 'json', may it cause error because you already sending a data JSON.stringify(finalResults)

http://stackoverflow.com/comment/47501515
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29682119
has text: Ok that open windows but wont load the http://localhost/#/print/2 the url is blank

http://stackoverflow.com/q/29599596
has answer: http://stackoverflow.com/a/29666522
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
tagged with: checkbox
tagged with: css
has body: I have a GridView displaying employee payslips, and beside each of their names are check boxes. Refer to the picture below: As you can see, I also have a drop-down list. I set it in my jQuery to select the last child of the list which is my case, the April 10, 2015 - April 16, 2015 option. On page load, I can see this page (photo above) with those check boxes. I had a problem with the check boxes since when I click the header check box, it should select all of the check boxes below it. But it's not. Now, when I tried selecting another option in the drop-down list, here's what I get: The style of the check boxes changes. And now, when I check the header check box, it's already working, selecting every check boxes below. Here's how I display the drop-down list: echo Select2::widget([ 'name' =&gt; 'period', 'data' =&gt; $period, 'options' =&gt; [ 'placeholder' =&gt; 'Select period', 'id' =&gt; 'period', 'style' =&gt; 'width: 400px; height: 34px;' ], 'pluginOptions' =&gt; [ 'maximumInputLength' =&gt; 10, ], ]); GridView: &lt;?php \yii\widgets\Pjax::begin(['id' =&gt; 'employee']); ?&gt; &lt;?php echo GridView::widget([ 'dataProvider' =&gt; $dataProvider, //'filterModel' =&gt; $searchModel, 'columns' =&gt; [ ['class' =&gt; 'yii\grid\SerialColumn'], ['class' =&gt; 'yii\grid\CheckboxColumn', 'options' =&gt; ['class' =&gt; 'icheckbox_minimal',] ], 'fname', 'lname', 'totalEarnings', 'totalDeductions', 'netPay', [ 'label' =&gt; 'Action', 'content' =&gt; function ($model, $key, $index, $column) { if ($model-&gt;netPay != null) { return Html::a('View Payslip', ['view' , 'id' =&gt; $model-&gt;payslipID], ['class' =&gt; 'btn btn-success']); }else{ return Html::a('Create Payslip', ['create-new', 'id' =&gt; $model-&gt;user_id], ['class' =&gt; 'btn btn-warning']); } } ] ], ]); ?&gt; &lt;?php \yii\widgets\Pjax::end(); ?&gt; Script: &lt;script&gt; $(document).ready(function(){ $("#period option:last-child").attr('selected', 'selected'); $("#period").change( function() { var period = $(…
score: 1
upvote count: 1
type: Question
tagged with: yii2
tagged with: javascript
has title: Yii2 Checkbox Changes Style
answer count: 1
downvote count: 0

http://stackoverflow.com/q/29614107
tagged with: node.js
has body: I'm a newbie when it comes to AngularJS and KeystoneJS, and I would really appreciate your help. Thank you guys. I have done a serving mechanism for my Angular application which uses Express's express.static. At this point, my application can successfully load regular html-files from different locations to a particular page with the code below. controller.js: .controller('Ctrl', function ($scope, $http) { $scope.html = "testing"; $http({ url: 'content/content1.html', method: 'GET', responseType: 'text' }).success(function(data) { $scope.html = data; }).error() $scope.message = 'Hello'; }); page.html: &lt;div ng-bind="html"&gt;&lt;/div&gt; routing.js app.use(express.static(__dirname + '/content')); Next, I would like to load content from a separate KeystoneJS CMS to this particular page in my own Angular application. Basically, I just want to be able to edit some content with KeystoneJS and publish the content on my separate Angular application automatically after that. 1) How can I get the pages exported from Keystone in a form of a html-page?
score: 1
has comment: http://stackoverflow.com/comment/47440932
has comment: http://stackoverflow.com/comment/47396746
upvote count: 1
type: Question
has title: Generating html files for AngularJS application with KeystoneJS CMS
tagged with: javascript
has comment: http://stackoverflow.com/comment/47434219
tagged with: express
has comment: http://stackoverflow.com/comment/47429945
tagged with: keystonejs
has comment: http://stackoverflow.com/comment/47395462
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47406975
favorite count: 0
has comment: http://stackoverflow.com/comment/47395424
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47382195
has answer: http://stackoverflow.com/a/31734467

http://stackoverflow.com/a/29632051
score: 1
has body: A while loop + a for one : var workshops = [{ name: 'apples', WorkshopId: '19' }, { name: 'oranges', WorkshopId: '3b' }, { name: 'pears', WorkshopId: 'x6' }, { name: 'pineapples', WorkshopId: '55' }, { name: 'watermelons', WorkshopId: '8v' }]; var selectedWorkshops = [{ name: 'oranges', WorkshopId: '3b' }, { name: 'watermelons', WorkshopId: '8v' }, { name: 'pears', WorkshopId: 'x6' }]; var registeredWorkshops = []; var numberOfWorkshops; addRemoveWorkshops = function () { numberOfWorkshops = selectedWorkshops.length; // A single while statment is enough and lighter while (selectedWorkshops.length) { var removedWorkshop; numberOfWorkshops = registeredWorkshops.push(selectedWorkshops[0]); for (var i = 0; i &lt; workshops.length; i++) if (workshops[i].WorkshopId == selectedWorkshops[0].WorkshopId) { workshops.splice(i, 1); break; } selectedWorkshops.splice(0, 1); } }; addRemoveWorkshops(); // Better for viewing the content (in firefox I have just "Object") : console.log("workshops : "); for (var i = 0; i &lt; workshops.length; i++) console.log('- ' + workshops[i].name); console.log("selectedWorkshops : "); for (var i = 0; i &lt; selectedWorkshops.length; i++) console.log('- ' + selectedWorkshops[i].name); console.log("registeredWorkshops : "); for (var i = 0; i &lt; registeredWorkshops.length; i++) console.log('- ' + registeredWorkshops[i].name);
downvote count: 0
has comment: http://stackoverflow.com/comment/47436887
type: Answer
has comment: http://stackoverflow.com/comment/47435818
has comment: http://stackoverflow.com/comment/47477446
upvote count: 1
has comment: http://stackoverflow.com/comment/47417900
answers question: http://stackoverflow.com/q/29631652

http://stackoverflow.com/a/29540347
type: Answer
has body: Not sure what do you mean by refresh, you can attach these events on element and do whatever you want. better provide id to your dropdown Volvo Audi $("#ride").on("click blur", function () { $("#ride").html(''); $("#ride").append(' Audi '); });
has comment: http://stackoverflow.com/comment/47236266
has comment: http://stackoverflow.com/comment/47232648
answers question: http://stackoverflow.com/q/29540058
score: 0

http://stackoverflow.com/a/29568453
upvote count: 1
has comment: http://stackoverflow.com/comment/47290282
answers question: http://stackoverflow.com/q/29564232
has body: Prefer for (var i=0; i &lt; files.length; i++) {} Consider arr = [0,1,2] for (var i = 0; i &lt; arr.length; i++) {} would correctly loop over all elements in the array, but for (var i = 0, item; item = arr[i]; i++) {} would not (and would fail to execute completely). Note that neither construct is good for handling sparse arrays (but then again, you should probably just use and treat it as an object at that point). Consider using Array.prototype.forEach or for( var item in arr ) {} when having to deal with sparse arrays. Be aware that for( var item in arr ) {} will also return Array.prototype values, and that Array.prototype.forEach is not implemented in every browser.
downvote count: 0
has comment: http://stackoverflow.com/comment/47290493
type: Answer
has comment: http://stackoverflow.com/comment/47290452
score: 1

http://stackoverflow.com/comment/47438635
has text: type "my name is amit, add" in search box, you will see the prblem
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29649224

http://stackoverflow.com/comment/47538110
type: Comment
type: QuestionComment
has text: i wouldnt need a global lookup by id. The getAtIndx should correspond to the order in which the nodes were added
comment on: http://stackoverflow.com/q/29570744
score: 0

http://stackoverflow.com/q/29584737
has comment: http://stackoverflow.com/comment/47319273
has comment: http://stackoverflow.com/comment/47319431
answer count: 0
has comment: http://stackoverflow.com/comment/47319462
has title: Backstretch on multiple Divs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47319522
has body: I'm trying to create a single page website that scrolls vertically. My design is image based and it needs to be mobile responsive for my grade. The issue I'm having is with the background images. I can get backstretch to work with just the body, however i need it to work in different divs and not just display one image over the entire height of the container. I'm not that experienced with jquery. Which is definitely my main issue here :( Any suggestions would be greatly appreciated. Here's what I have so far. That applies the image to the divs, however it no longer scales the image at all, instead of centering on the y-axis it just hides a portion of the image.
has comment: http://stackoverflow.com/comment/47319399
type: Question
has comment: http://stackoverflow.com/comment/47320033
has comment: http://stackoverflow.com/comment/47317956
tagged with: jquery-backstretch
has comment: http://stackoverflow.com/comment/47319108
has comment: http://stackoverflow.com/comment/47319613
has comment: http://stackoverflow.com/comment/47319506
has comment: http://stackoverflow.com/comment/47317717
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47317890
has comment: http://stackoverflow.com/comment/47319759
has comment: http://stackoverflow.com/comment/47319847
score: 0
has comment: http://stackoverflow.com/comment/47319201
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47320216
has comment: http://stackoverflow.com/comment/47319421
tagged with: css

http://stackoverflow.com/comment/47368742
comment on: http://stackoverflow.com/a/29611431
type: Comment
type: AnswerComment
has text: @ssube please read the comments, The OP stated that he could also make it work binding the namespace.
score: 0

http://stackoverflow.com/q/29602544
tagged with: jquery-ui
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29602652
accepted answer: http://stackoverflow.com/a/29602652
score: 0
has body: I am facing an issue with the java-script multidimensional array . I want to search a date and month in a given array if present .I mean i want to count dates except saturday and sunday and national holidays I have this array var natDays = [ [1, 1, 'uk'], [1, 19, 'uk'], [2, 16, 'uk'], [4, 23, 'uk'], [7, 03, 'uk'], [7, 04, 'uk'], [9, 07, 'uk'], [8, 12, 'uk'], [11, 11, 'uk'], [11, 26, 'uk'], [12, 25, 'uk'] ]; from reference of this answer Here . I have created my function like this function check_hol(month,date) { var natDays = [ [1, 1, 'uk'], [1, 19, 'uk'], [2, 16, 'uk'], [4, 23, 'uk'], [7, 03, 'uk'], [7, 04, 'uk'], [9, 07, 'uk'], [8, 12, 'uk'], [11, 11, 'uk'], [11, 26, 'uk'], [12, 25, 'uk'] ]; for( var md = 0; md &lt;= natDays.length; md++ ) { alert(natDays[md][0]+'='+month+' and '+natDays[md][1]+'='+date) ; if( natDays[md][0] != month &amp;&amp; natDays[md][1] != date ) { return true; } } return false; } I am using this function to calculate the working days in this function function workingDays(){ var n=0; for(var i=1; i&lt;=dp.datediff; i++){ var d1 = new Date(); d1.setDate(d1.getDate()+i); if(d1.getDay() !== 0&amp;&amp;d1.getDay()!==6 &amp;&amp; check_hol(d1.getMonth()+1,d1.getDate())===true) { n++; } } alert(n); dp.wdiff = n; getShipDays(); getProdDays(); getQuantity(); getShipProdDays(); } but it returns 0 in the output of working days . if i remove &amp;&amp; check_hol(d1.getMonth()+1,d1.getDate())===true from my second function it is working fine . can't understand where i am wrong .
has title: Search in the multi dimension array javascript
tagged with: datepicker
linked to: http://stackoverflow.com/q/8809425
type: AnsweredQuestion

http://stackoverflow.com/a/29679396
type: Answer
score: 2
upvote count: 2
has body: It might be helpful to include a copy of the code you have which is not working. But to answer the question about why if($('ul.mtree').length) can return true at console, but false in the page could depend on timing (e.g. the function executes before the DOM has loaded). By the time you load up the console to check the value, the DOM is loaded and it returns true. Make sure to include your JS at the end of the page, or only call after document load.
has comment: http://stackoverflow.com/comment/47496078
has comment: http://stackoverflow.com/comment/47496397
downvote count: 0
answers question: http://stackoverflow.com/q/29679016

http://stackoverflow.com/a/29677989
answers question: http://stackoverflow.com/q/29676578
score: 0
has body: This should work for you: $(document).ready(function() { $('#emp_id').keyup(function() { var url = "/user/populate_form?emp_id=" + $(this).val(); $.getJSON(url, function (data) { if (typeof(data.emp_first_name) !== 'undefined') $('#emp_first_name').val(data.emp_first_name); if (typedof(data.emp_last_name) !== 'undefined') $('#emp_last_name').val(data.emp_last_name); if (parseInt(data.error) == 404) { alert("The employee ID entered was not found!"); } else { window.confirm("Your employee ID was found please fill in the email(optional) and password fields then click the sign in button to register."); } }); }); });
type: Answer
has comment: http://stackoverflow.com/comment/47493592
has comment: http://stackoverflow.com/comment/47494843

http://stackoverflow.com/comment/47418911
type: QuestionComment
type: Comment
has text: just return `circles` from `draw`
comment on: http://stackoverflow.com/q/29638335
score: 0

http://stackoverflow.com/comment/47502946
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29682163
score: 0
has text: See my answer below. This is a very common asynchronous scenario that can be easily fixed :)

http://stackoverflow.com/q/29620041
type: UnansweredQuestion
tagged with: google-chrome
has title: Is there any memory limit for Google Chrome browser?
has answer: http://stackoverflow.com/a/62729894
tagged with: http://stackoverflow.com/tag/json
tagged with: memory
type: Question
has answer: http://stackoverflow.com/a/50805026
has answer: http://stackoverflow.com/a/34667584
downvote count: 0
has answer: http://stackoverflow.com/a/29620366
tagged with: javascript
favorite count: 0
score: 43
answer count: 5
has answer: http://stackoverflow.com/a/62730551
upvote count: 43
has body: What is the default memory limit for a single tab in chrome ??
tagged with: memory-management

http://stackoverflow.com/comment/118303666
has text: you are mutating the original object. That is a big no no
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29537379

http://stackoverflow.com/q/29659297
has answer: http://stackoverflow.com/a/29659441
tagged with: socket.io
has body: socket = 'what'; //I do this when person clicks connect: if (socket == 'what') { socket = io.connect(); } else if (socket == null) { socket = io.connect(); socket = socket.socket.reconnect(); } //I do other stuff with webrtc and socket. //then when person clicks disconnect, I do: socket.disconnect(); socket = null; I didn't want to write all the code because there's a lot of it, and I tried to keep this as simple as possible. Basically, socket remains disconnected after I click disconnect. But if I click connect again, socket still remains disconnected, because I console.log it and it says that socket disconnected = true and socket connected = false. Why does it remain disconnected? How do I just completely refresh the entire socket (just get a totally new socket) without refreshing the browser page? I just want it to fully disconnect on disconnect, and to fully reconnect on reconnect. And it doesn't work....
type: Question
downvote count: 0
tagged with: javascript
score: 2
answer count: 1
has title: socket.io remains disconnected, even after I try to reconnect it? Why?
favorite count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: sockets
tagged with: client
tagged with: node.js

http://stackoverflow.com/a/29586258
accepted answer of: http://stackoverflow.com/q/29581291
score: 1
has body: Well the easiest way would be to dynamically compute the price when it's presented but as you say your datatables package won't let you do that. One alternative is to make a client-side only collection that gets filled with the products and pricing for that user and then render that with your datatables package. A clever customer would however be able to modify his/her pricing from the console. You'd have to validate the price used at checkout on the server. To create a client-side only collection: myLocalCollection = new Collection(null);
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29581291
type: Answer
upvote count: 1

sidebar
type: Tag
tag name: sidebar
tags question: http://stackoverflow.com/q/29602787

http://stackoverflow.com/comment/48063387
comment on: http://stackoverflow.com/a/29682339
type: AnswerComment
has text: This could work (I didn't test it) but it means to not using the knockoutjs-mapping-plugin. Right now, I add properties to the `response` by going through the `response`-Tree right befor the mapping happens. This works as expected and I don't need some mappingoptions anymore.
score: 0
type: Comment

http://stackoverflow.com/comment/47358107
has text: @kumareloaded You are right, I forgot that `this` no longer points to the element. The most straightforward solution is to assign it to a variable and use that one instead of `this`. I have updated the code.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29604278
type: Comment

http://stackoverflow.com/comment/47421291
type: QuestionComment
comment on: http://stackoverflow.com/q/29639679
has text: [MDN Reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce)
score: 0
type: Comment

http://stackoverflow.com/comment/47389678
type: Comment
comment on: http://stackoverflow.com/a/29622541
score: 0
type: AnswerComment
has text: `XHR uses the HTML` - you, probably meant `HTTP` Ok, thanks a lot! I wish I could voteUp your answer:)

http://stackoverflow.com/q/29661157
tagged with: xmlhttprequest
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47471954
has body: So i wrote this qml app for mobile in which i am trying to pass some data via http POST request to a php page on a webserver. After having done some research, I am assured that I should be able to do this from a qml document using javascript xmlhttprequest. all seems very neat and simple (I found a few variations on the web like this Https POST / GET with Qml/Qt). From which I used the script in the answer. For a test scenario, I have spun up a LAMP (with L = Ubuntu server) on a Virtualbox, I try to POST some data in a param (much like in above link) to a .php page but get only http.status = 0 . The php script is never getting any content in $_POST. So first thing to check is that i can actualy do a http POST request to that same server via a webform in a browser. That works without a hitch. So i am begining to get the idea that doing xmlhttprequest outside of a browser is not the same as within one. And this may mean that i need to do some config voodoo on the Apache side. I am by no means an apache guru So I am at a loss now. Hopefully someone has done something like this or is spotting what I am missing? Thanks.
tagged with: qml
linked to: http://stackoverflow.com/q/8790609
type: Question
has comment: http://stackoverflow.com/comment/47477167
has title: Getting xmlhttprequest to work from javascript inside qml document
answer count: 1
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/29686205

http://stackoverflow.com/comment/47238779
score: 0
type: AnswerComment
type: Comment
has text: I need all rows , just want to hide the toggle button not whole row
comment on: http://stackoverflow.com/a/29543462

http://stackoverflow.com/q/29669407
has comment: http://stackoverflow.com/comment/47477253
favorite count: 0
has body: I would like to know if it's possible in most regex search-and-replace mechanisms to conditionally replace with a literal string based on whether a certain match has occurred. My working example is this pair of regex replaces: ^(\s*([\S]*):.*function.*\((.+)\).*\{.*)$ -> \1 console.info('\2 ::: \3:', \3); ^(\s*([\S]*):.*function.*\(\).*\{.*)$ -> \1 console.info('\2'); The first replaces lines such as: test: function (arg1, arg2) { //pass } with: test: function (arg1, arg2) { console.info('test2 ::: arg1, arg2:', arg1, arg2); //pass } and the second one does the same for functions with no arguments like: test2: function () { //pass } I'm looking for a way to apply only a single search-and-replace to perform both of these tasks. One way, if this is possible, would be to essentially say "if I have \3, replace ::: \3:', \3, else don't. Is this possible? Is there another way?
type: UnansweredQuestion
tagged with: regex
has comment: http://stackoverflow.com/comment/47483707
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/29686368
type: Question
has title: Replacement String Conditional on Match
has comment: http://stackoverflow.com/comment/47477534
tagged with: sublimetext2
has comment: http://stackoverflow.com/comment/47477158
tagged with: javascript
linked to: http://stackoverflow.com/q/15080102
tagged with: replace
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/47479391
tagged with: sublimetext3

http://stackoverflow.com/a/29596628
has comment: http://stackoverflow.com/comment/47340793
has comment: http://stackoverflow.com/comment/47341014
has comment: http://stackoverflow.com/comment/47341084
has comment: http://stackoverflow.com/comment/47340693
type: Answer
has comment: http://stackoverflow.com/comment/47340878
has comment: http://stackoverflow.com/comment/47340767
has comment: http://stackoverflow.com/comment/47340625
has comment: http://stackoverflow.com/comment/47340263
has comment: http://stackoverflow.com/comment/47340951
answers question: http://stackoverflow.com/q/29596493
has body: I'm pretty sure you need to be in a page.evaluate to actually use the injected JS (see example here http://phantomjs.org/page-automation.html). Try: function start() { page.includeJs('https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js', function() { console.log("got here"); page.evaluate(function() { $.get("http://my-wonderful-site.com") .done(function( data ) { console.log("here!"); console.log(data); phantom.exit(); }); }); }); }
score: 0

http://stackoverflow.com/a/29666683
has comment: http://stackoverflow.com/comment/47472191
type: Answer
has body: Use echo $data;exit; Instead of return $data; To display the data (after getting the response) - var data = $.parseJSON(data); $('#your_input_field').val(data.payment_bank_user_name);
answers question: http://stackoverflow.com/q/29666540
score: 0

http://stackoverflow.com/comment/47234195
comment on: http://stackoverflow.com/a/29537902
type: AnswerComment
has text: Yeah, WebRTC will need several things in order to work, since it is a peer-2-peer technology, you may need an intermediate server to do STUN/TURN/ICE in order to initiate communication between peers. It is not a trivial approach, so go through the docs before jumping into decisions :) WebRTC is not "the way" of using UDP in web, but it uses UDP as transport, so it may fit your requirements.
type: Comment
score: 6

http://stackoverflow.com/comment/47240953
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29544495
type: QuestionComment
has text: Can you elaborate on that... didn't get you clearly..

http://stackoverflow.com/comment/47237795
type: Comment
comment on: http://stackoverflow.com/a/29542936
has text: Thanks this helped alot with tidying up my factory.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47342280
has text: I guess I wasn't taking "empty object" as literally as I should have been. ;-)
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29597768

http://stackoverflow.com/comment/47444018
type: Comment
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29651968
has text: @Michael Giovanni Pumo: I noticed, hence the second "hack" solution :)

http://stackoverflow.com/a/29683789
upvote count: 2
has comment: http://stackoverflow.com/comment/47504503
has comment: http://stackoverflow.com/comment/47504460
answers question: http://stackoverflow.com/q/29683488
has comment: http://stackoverflow.com/comment/47504718
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47505512
type: Answer
has body: You should use the new Notification object. It works even when the browser is not focused, and is useful for sending the user important notifications. Example: http://jsfiddle.net/howderek/792km8td/ document.getElementById('notif').onclick = function () { function notify () { var notification = new Notification('Test!'); } if (Notification.permission === "granted") { setTimeout(notify, 5000); } else { Notification.requestPermission(function () { if (Notification.permission === "granted") { setTimeout(notify, 5000); } }); } } https://developer.mozilla.org/en-US/docs/Web/API/notification

http://stackoverflow.com/comment/47456362
type: Comment
type: QuestionComment
score: 2
has text: If you can't find your car keys in the morning, then they're 404...
comment on: http://stackoverflow.com/q/29658375

http://stackoverflow.com/comment/47493296
type: QuestionComment
comment on: http://stackoverflow.com/q/29677931
score: 0
has text: do you have `test` set in your query string?
type: Comment

http://stackoverflow.com/comment/47369668
has text: please take a look at the fiddle, i think that i am doing everything as you suggest. you can try opera on linux or ie on windows for the bug.
type: QuestionComment
comment on: http://stackoverflow.com/q/29611726
type: Comment
score: 0

http://stackoverflow.com/comment/47326428
score: 0
comment on: http://stackoverflow.com/a/29589598
type: AnswerComment
has text: As per the link you have shared I should use something like this <body <?php body_class( 'class-name' ); ?>>
type: Comment

http://stackoverflow.com/comment/47429052
comment on: http://stackoverflow.com/q/29643479
type: Comment
type: QuestionComment
has text: Oh sorry, should I share the new code via comment on your answer?
score: 0

http://stackoverflow.com/q/29677967
accepted answer: http://stackoverflow.com/a/29697134
has comment: http://stackoverflow.com/comment/47518484
has comment: http://stackoverflow.com/comment/47511246
tagged with: javascript
has body: I am using row grouping feature of datatable, here is my drawcallback function: oTable = jQuery_1_11('#example').dataTable({ "searching": false, "processing": true, "serverSide": true, "iDisplayLength": 20, "sPaginationType": "full_numbers", "language": {"infoFiltered": ""}, columnDefs: [{ targets: 0, "visible": false, }], "ajax": { "url": "index.php?entryPoint=getTableData", "dataType": 'json', "pages": "5", "type": "POST", "data": function(d) { d.dbJson = sendJson }, "dataSrc": function(response) { return response.aaData; } }, "drawCallback": function( ) { var api = this.api(); var rows = api.rows({page: 'current'}).nodes(); var last = null; api.column(0, {page: 'current'}).data().each(function(group, i) { if (last !== group) { jQuery_1_11(rows).eq(i).before( '&lt;tr class="group"&gt;&lt;td colspan="5"&gt;' + group + '&lt;/td&gt;&lt;/tr&gt;' ); last = group; } }); } }) I don't know it's stuck on. api.column(0, {page: 'current'}).data().each(function(group, i) { This is giving the error: Uncaught TypeError: Cannot read property 'each' of undefined Please help!
has comment: http://stackoverflow.com/comment/47497680
answer count: 2
has answer: http://stackoverflow.com/a/29697134
upvote count: 1
tagged with: datatables
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/29678606
has comment: http://stackoverflow.com/comment/47530049
has comment: http://stackoverflow.com/comment/47520257
has comment: http://stackoverflow.com/comment/47518569
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47525792
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/29678606
has title: jquery datatables column.data undefined
type: Question

http://stackoverflow.com/q/29687526
tagged with: web-sql
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I have an application that has a page where all id's are selected from the table and specific bits of information are shown in html. What i would like to do next is to make each of these elements as a whole a link to essentially, a 2nd level down. This level down page will reveal all information bound to that row's id, is it possible to build this in a way that is dynamic? I am using jQuery mobile to build pages, and i'd like to use 1 template and append the relevant html elements into it, and populate each with the id bound information. I hope this makes some sense, and any guidance or suggestions would be greatly appreciated. The above mockups represent what i would like to achieve, the left image displays a list of all rows in the table, upon clicking one of them, you are taken to another page, with only information for that particular id. Can i achieve this for each item within the list?
tagged with: local-storage
type: AnsweredQuestion
has title: Dynamically create page in jquery mobile, only to include specific data from websql database
type: Question
has answer: http://stackoverflow.com/a/29695290
accepted answer: http://stackoverflow.com/a/29695290
tagged with: jquery-mobile
tagged with: javascript
score: 0

http://stackoverflow.com/q/29670944
tagged with: javascript
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/47482365
type: Question
favorite count: 0
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/47481082
has answer: http://stackoverflow.com/a/29697388
tagged with: object
has title: Data formatting issue : Array to Object. any easy way?
has comment: http://stackoverflow.com/comment/47481536
has comment: http://stackoverflow.com/comment/47480554
has comment: http://stackoverflow.com/comment/47481135
has body: I tried to format a array to object. it's working fine but I need to know, Is this correct or wrong? any other standard way to do this?. I used underscoreJS for this. //What I get from API "A/a/1" = A -> Category, a -> Subcategory, 1 -> child of subcategory. ["A", "A/a", "A/b", "A/a/1", "A/a/2", "B", "B/a"]; //Which format i need. [ { "name":"A", "parent":"", "children":[ { "name":"a", "parent":"A", "children":[ { "name":"1", "parent":"a", "children":[ ] }, { "name":"2", "parent":"a", "children":[ ] } ] }, { "name":"b", "parent":"A", "children":[ ] } ] }, { "name":"B", "parent":"", "children":[ { "name":"a", "parent":"B", "children":[ ] } ] } ] MY CODE : var dataObj = function(){ this.name = ""; this.parent = ""; this.administrator = ""; this.children = []; }; var d_ = []; _.each(data, function(item, index){ var row = new dataObj(); var item_array = item.split("/"), item_array_length = item_array.length; if(item_array.length == 1){ row.name = item_array[0]; d_.push(row); } else { row.name = item_array[1]; row.parent = item_array[0]; var newC = d_[_.findIndex(d_, {name:item_array[0]})]; if(item_array.length == 2) { newC.children.push(row); } else if(item_array.length == 3) { newC.children[_.findIndex(newC.children, {name: item_array[1]})] .children.push({name : item_array[2], parent : item_array[1]}); } } }); UPDATE The level of subcategory is not limited. "A/a/1/i/n/x/y...."
tagged with: formatting
tagged with: arrays
downvote count: 0

http://stackoverflow.com/q/29585010
answer count: 1
downvote count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47322272
tagged with: php
type: AnsweredQuestion
score: 2
tagged with: phantomjs
has title: Pass Phantomjs console to php file
type: Question
has answer: http://stackoverflow.com/a/29585108
accepted answer: http://stackoverflow.com/a/29585108
has body: I have been trying to pass my phantomjs console output back to the php file that executed it, but I only get and empty array with this code. It also happens immediately, which makes me think its attempting to get the return before the phantomjs script has even run. &lt;?php $user= 'dafjdh@kjsdf.com'; $pass='dumfmh'; $response = exec("/home/jef28/public_html/swipr/phantomjs /home/jef28/public_html/swipr/login.js $user $pass", $output); echo $output; ?&gt; The last lines of my .js file are console.log(document.querySelectorAll('html')[0].outerHTML); return document.querySelectorAll('html')[0].outerHTML; How can I pass the console output back to php?
tagged with: javascript
upvote count: 3

http://stackoverflow.com/q/29664706
score: 0
answer count: 1
tagged with: javascript
tagged with: asp.net
has body: How to display a popup window in C# that tell the user the session has expired? I am thinking about an analogy in JavaScript alert "Your session has expired";. Is there such analogy in C#? Alternative solution is to direct my user to Default.aspx page. I have seen many lines of code using Google, but none of them work in protected void Session_End(object sender, EventArgs e) {} block. I am looking for lines of code that can be inserted into Session_End block. Otherwise, I would have to insert the codes into over 200 .aspx pages. I also know that HTTP is stateless and Response.Redirect() doesn't work when the Session_End() fires.
tagged with: sessionend
has answer: http://stackoverflow.com/a/29664769
has title: Codes to be inserted to Session_End block to notify user timeout or redirect
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29664769
type: Question
tagged with: c#

http://stackoverflow.com/comment/47370449
type: Comment
score: 0
has text: @Barmar I see, i was just curious since this type of getter/setter attribute was new to me. So thought if there's any way we could do so.
type: QuestionComment
comment on: http://stackoverflow.com/q/29612316

http://stackoverflow.com/q/29554575
has answer: http://stackoverflow.com/a/29554703
has answer: http://stackoverflow.com/a/29554667
answer count: 6
has answer: http://stackoverflow.com/a/29554644
type: Question
has answer: http://stackoverflow.com/a/29554654
possible better answer: http://stackoverflow.com/a/29554659
has answer: http://stackoverflow.com/a/29554659
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47259913
score: 0
has body: I can't find out the way to get this. And apply dynamic class to li onclick using js. then select the next li to apply some extra css. ******* Now i want to apply css on *******li. Hope my question is clear. Thanks in advance.
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/29554654
has answer: http://stackoverflow.com/a/29554918
has title: Select next element of any li with the dynamic selector using CSS or js
type: AnsweredQuestion

http://stackoverflow.com/comment/47398241
score: 0
type: AnswerComment
has text: Your first suggestion was smart. The second one however... What if I have 8 `a` elements? Or 20? I'm looking for something less.... rubbish...
type: Comment
comment on: http://stackoverflow.com/a/29627475

http://stackoverflow.com/q/29624113
score: 1
type: Question
tagged with: angular-ui-router
tagged with: javascript
has title: Angular html5 mode with fallback
upvote count: 1
has answer: http://stackoverflow.com/a/29624237
answer count: 1
has body: I'm working on an angular application that has been around for a while. So far I've used the normal # mode, without any prefix. The application has quite some content so some of the customers might have bookmarked them (with the hash url schema). Now I'd like to switch to html5Mode but keep compatibility with the old url schema. I mean, for example if I previously had this url www.mysite.com/#/action/content?param1=A&amp;param2=B in html5mode it will be www.mysite.com/action/content?param1=A&amp;param2=B. What I want is: if any user knows the old url (with the #) and he uses it in his browser I'd want my application to be smart and redirect the user to the correct page using the new html5Mode url or keep on using the the old url if the browser doesn't support the new html5Mode. Is this possible? (I'm using ui-router)
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47392114
downvote count: 0

http://stackoverflow.com/comment/47417203
has text: @TimMcClure yeah, this is a good solution. I'll include this in the answer as an option at least. Thanks!
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29637009
score: 1

http://stackoverflow.com/comment/47304279
comment on: http://stackoverflow.com/q/29577791
type: Comment
type: QuestionComment
has text: i can't see '#first-project' in your given page. where can i find it?
score: 0

http://stackoverflow.com/comment/47425185
score: 0
type: AnswerComment
has text: you just wouldn't give up. Would u? :) I am accepting your answer (second one). IE support is the main aspect of this project and hence I have no other option than raphael. I will consider the other answer for future use.
type: Comment
comment on: http://stackoverflow.com/a/29641293

http://stackoverflow.com/q/29643679
has comment: http://stackoverflow.com/comment/47428372
has title: New version of Bootstrap 3 Datetimepicker
score: 0
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47428595
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/47428415
answer count: 0
has comment: http://stackoverflow.com/comment/47433469
has comment: http://stackoverflow.com/comment/47428490
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/47428627
type: Question
has comment: http://stackoverflow.com/comment/47428321
has body: I will try to use bootstrap 3 datetimepicker in paramquery grid. Please help how can use bootstrap 3 datetimepicker inside paramquery column. I have attached the following js and css files, 1.9.1.jquery.min.js 1.9.2.jquery-ui.min.js pqgrid.min.js pqgrid.min.css pqgrid.css jquery-ui.css bootstrap-datetimepicker.min.css bootstrap.min.css moment.js moment-with-locales.js bootstrap.min.js bootstrap-datetimepicker.min.js The above order only I am using these files.Here Every js and css files are latest version. But Bootstrap calendar is not visible. When I click a picker, on that time calendar is open but it is hiding inside the paramquery grid. Please help me how can Start Bootstrap datetimepicker in pqGrid. Please send me a working jsfiddle. The above image is the exactly correct one. Here the calendar is visible outside the grid also. This is old version and I have faced lot of issues here. So I will try to use latest version. The below image is for latest version. Here calendar is not visible outside the grid. I want exactly shown in first image.
has comment: http://stackoverflow.com/comment/47428506
tagged with: javascript

http://stackoverflow.com/comment/47477366
type: QuestionComment
has text: @Satpal --> Typo, I already edited it. :)
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29669565

visual-studio-2012
tags question: http://stackoverflow.com/q/29684416
type: Tag
tags question: http://stackoverflow.com/q/29678314
tag name: visual-studio-2012

http://stackoverflow.com/comment/47469080
score: 0
type: Comment
type: QuestionComment
has text: When you say you create dynamical equal text you can also assign an `id` to it right???
comment on: http://stackoverflow.com/q/29662987

http://stackoverflow.com/comment/47291947
type: QuestionComment
type: Comment
score: 1
has text: Your access token has expired, you need to get a new one.
comment on: http://stackoverflow.com/q/29571059

http://stackoverflow.com/comment/47450232
type: Comment
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/29655141
has text: It is much more likely that you are doing something wrong than that a JS engine evaluates `"" != ""` incorrectly.

http://stackoverflow.com/comment/47287672
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29568937
has text: Wow, that's massive problem for me thanks @JonathanLonowski. Do I try to use res.locals, instead?

http://stackoverflow.com/a/29578035
score: 2
has comment: http://stackoverflow.com/comment/47304484
has comment: http://stackoverflow.com/comment/47304647
downvote count: 0
has body: You passed the date in ISO form into the constructor "2015-04-11T00:30:00". That means your browser interprets that not as local time but as UTC. Date.toString however uses your local time. If you want to use UTC time call .toUTCString or better yet .toISOString.
has comment: http://stackoverflow.com/comment/47304765
upvote count: 2
answers question: http://stackoverflow.com/q/29577879
type: Answer

http://stackoverflow.com/q/29571827
has comment: http://stackoverflow.com/comment/47293251
duplicate of: http://stackoverflow.com/q/3072307
has comment: http://stackoverflow.com/comment/47293510
favorite count: 0
has comment: http://stackoverflow.com/comment/47293074
has body: In JavaScript, when I do a calculation with very large numbers (example: Math.pow(4,2015)*Math.pow(9,2016)), it returns infinity. Is there anyway to prevent getting infinity and get the actual result?
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/29380861
answer count: 0
downvote count: 0
score: 1
linked to: http://stackoverflow.com/q/3072307
tagged with: math
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47294695
has comment: http://stackoverflow.com/comment/47293589
has title: JavaScript calculating with very large numbers
upvote count: 1

http://stackoverflow.com/comment/47268938
type: QuestionComment
has text: Thanks for the reply cojomojo, I have tried that link which you have given. Also I have tried this "https://github.com/twbs/bootstrap/issues/3361" which didn't work too. Here is my code http://www.codeply.com/go/mP0LwPsHkZ
score: 0
comment on: http://stackoverflow.com/q/29550361
type: Comment

http://stackoverflow.com/a/29581305
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29580511
answers question: http://stackoverflow.com/q/29580511
type: Answer
has body: Since your add to cart button is inside a div element with a class you need to target that specific element instead of all elements with the class as a whole. Using Javascripts this to catch the element that triggered the event and using jquerys .parent or .sibling functions to target the div should work. $("button.addtocart").click(function(){ $(this).siblings(".stock").css( "background-color", "red" ); }); This div needs to be updated a add to cart This div needs to be updated b add to cart This div needs to be updated c add to cart
downvote count: 0
score: 1
type: AcceptedAnswer

http://stackoverflow.com/a/29662737
downvote count: 1
has comment: http://stackoverflow.com/comment/47467973
answers question: http://stackoverflow.com/q/29662686
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/47464940
has body: You could also use calc on the width. Example: div { position: absolute; left: 300px; width: calc(100% - 300px); } It is not available in all browsers according to comment... Here's a fiddle nevertheless.
upvote count: 2
has comment: http://stackoverflow.com/comment/47464925

http://stackoverflow.com/comment/68287356
comment on: http://stackoverflow.com/a/29550988
score: 4
type: Comment
has text: Wouldn't advise using jQuery to handle this when you could either use arrow functions to auto bind to handleKeyDown or set the bind up for handleKeyDown in the constructor.
type: AnswerComment

http://stackoverflow.com/comment/47515620
has text: Not sure why someone downvoted this.. have an upvote 1+.. It mostly works, although there is a slight caveat now that you have removed `position: relative`.. if you compare [your fullscreen example](http://jsfiddle.net/e3f0yLq8/3/show/) VS the [OP's fullscreen example](http://jsfiddle.net/sLf79m5d/14/show/), you will see that the positioning of the text *"Scroll Down and expand menu to see problem"* is now off.. I'm pretty sure the OP wants to maintain that relative positioning.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29688504

http://stackoverflow.com/q/29637206
tagged with: http://stackoverflow.com/tag/svg
has answer: http://stackoverflow.com/a/29637380
type: AnsweredQuestion
has body: When I move deferred.resolve to outside after the all the svg to canvas, I am not getting the entire function to work inside a deferred.resolve. I want the deferred.promise() to execute when all the svgs are converted to canvas and not just the first svg. $(document).ready(function() { $( '#save_dashboard' ).click(function() { // Create a deferred object var dfd = new $.Deferred(); // https://github.com/niklasvh/html2canvas/issues/95#issuecomment-45114424 // First render all SVGs to canvases targetElem = $('#dashboard'); var elements = targetElem.find('svg').map(function() { var svg = $(this); var canvas = $('&lt;canvas&gt;&lt;/canvas&gt;'); svg.replaceWith(canvas); // Get the raw SVG string and curate it var content = svg.wrap('&lt;p&gt;&lt;/p&gt;').parent().html(); content = content.replace(/xlink:title='hide\/show'/g, ''); content = encodeURIComponent(content); svg.unwrap(); // Create an image from the svg var image = new Image(); image.src = 'data:image/svg+xml,' + content; image.onload = function() { canvas[0].width = image.width; canvas[0].height = image.height; // Render the image to the canvas var context = canvas[0].getContext('2d'); dfd.resolve(context.drawImage(image, 0, 0)); }; return dfd.promise(); /* return { svg: svg, canvas: canvas }; */ }); // end of targetElem.find('svg').map(function() {...}); // $.when(dfd).done(function(){ // console.log('dfd done'); dfd.then(function(_canvas){ console.log('dfd done', _canvas); // http://www.kubilayerdogan.net/html2canvas-take-screenshot-of-web-page-and-save-it-to-server-javascript-and-php/ $('#dashboard').html2canvas({ onrendered: function (canvas) { //Set hidden field's value to image data (base-64 string) var dashboardPng = canvas.toDataURL('image/png'); console.log('dashboardPng: ' + dashboardPng); $.ajax({ url:'save_dashboard_image.php', data:{dashboardPngData: dashboardPng}, type:'POST', dataType:'json', success: function(){ console.log('success'); } , error: function(xhr, status, error){ console.log('The …
score: 0
type: Question
answer count: 2
tagged with: canvas
accepted answer: http://stackoverflow.com/a/29637380
linked to: http://stackoverflow.com/q/29635005
tagged with: javascript
tagged with: html2canvas
tagged with: jquery
has comment: http://stackoverflow.com/comment/47421537
possible better answer: http://stackoverflow.com/a/29637359
has answer: http://stackoverflow.com/a/29637359
linked to: http://stackoverflow.com/q/5627284
has title: Move deferred.resolve from an operation inside a function to the entire function completion

http://stackoverflow.com/comment/47494025
comment on: http://stackoverflow.com/q/29678148
score: 0
type: Comment
type: QuestionComment
has text: `x()` takes one argument, why are you calling it with two arguments?

http://stackoverflow.com/comment/47292526
has text: The is dependent on the table, so I'll leave that in the PHP. I'll give this a shot.
comment on: http://stackoverflow.com/q/29570299
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29545689
tagged with: facebook
answer count: 1
tagged with: twitter
upvote count: 0
has body: I'd like to create a page that presents the user with a specific account, let's say Donald Rumsfeld, and allow them to unfollow this person from the site by clicking "unfollow". Is this possible?
has answer: http://stackoverflow.com/a/29546252
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
favorite count: 0
tagged with: instagram
type: Question
has comment: http://stackoverflow.com/comment/47243757
score: -2
has title: Is it possible to add an 'unfollow' button that will work for Twitter, Instagram, Facebook?
downvote count: 2

http://stackoverflow.com/comment/47289201
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29568868
has text: Thanks Mark. I need to use this method because my user can have multiple addresses. Also, there is a property named "address" in my Schemas.User schema - it is right below the profile property.

http://stackoverflow.com/comment/47461119
score: 0
type: Comment
has text: @mason Both my client and server side file are stored on the same local directory. How come I can't just makes those changes on demand?
type: QuestionComment
comment on: http://stackoverflow.com/q/29660561

http://stackoverflow.com/comment/47275065
type: AnswerComment
has text: With a basic ui-routiong settings I can make it to work, BUT my problem is that now it doesn't route me to my itemView :( I think it is due to the root state, which I wrote in because I want my home state to be the default just right after the first pageload, and make it the active menu item.
type: Comment
comment on: http://stackoverflow.com/a/29561066
score: 0

http://stackoverflow.com/q/29565485
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47280968
tagged with: playframework-2.3
score: 1
tagged with: java
tagged with: http://stackoverflow.com/tag/json
downvote count: 1
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/47301112
has answer: http://stackoverflow.com/a/29609747
tagged with: javascript
has body: Play Framework provides a way to access JSON-Data in a request-body via request().body().asJson(). Using form-helpers does not post data in JSON-format. So, what is the best way, in a play-application, to convert the form-data to a json-object before passing it to the controller? Thanks in advance.
has comment: http://stackoverflow.com/comment/47287530
accepted answer: http://stackoverflow.com/a/29609747
tagged with: playframework
has title: Post JSON-Data from PlayFramework form
has comment: http://stackoverflow.com/comment/47281329
favorite count: 0
possible better answer: http://stackoverflow.com/a/29601040
has comment: http://stackoverflow.com/comment/47281388
upvote count: 2
has answer: http://stackoverflow.com/a/29601040
has comment: http://stackoverflow.com/comment/47958873

http://stackoverflow.com/comment/47390763
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29623230
has text: I don't know what you mean by that. This is the jQuery function. You would call it in your `change_XX` functions.

http://stackoverflow.com/comment/47313803
has text: try `console.log(window.views)` and `console.log(window.adresbook)`
type: AnswerComment
comment on: http://stackoverflow.com/a/29582083
score: 0
type: Comment

http://stackoverflow.com/comment/47293608
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29571580
has text: possible duplicate of [How to read individual '-webkit-transform' values in JavaScript?](http://stackoverflow.com/questions/3432446/how-to-read-individual-webkit-transform-values-in-javascript)

http://stackoverflow.com/comment/47278105
score: 0
comment on: http://stackoverflow.com/q/29563925
type: Comment
type: QuestionComment
has text: If you want to refer to the object returned via `new page()` as in your example, you have to use `define()`.

http://stackoverflow.com/q/29626729
has title: How to function call using 'this' inside forEach loop
has answer: http://stackoverflow.com/a/64497934
linked to: http://stackoverflow.com/q/24539521
has comment: http://stackoverflow.com/comment/47396566
downvote count: 0
type: UnansweredQuestion
upvote count: 72
type: Question
tagged with: foreach
has body: In the following object, I have a problem using the 'this' reference: function SampleObject(){ this.addObject = function(object){...} ... // more code here ... this.addNewObjects= function(arr){ arr.forEach( function (obj) { this.addObject(new Obj(obj.prop1, obj.prop2)); }); } } I'm assuming the context is changing and that 'this' refers the iterated 'obj', and not 'SampleObject'. I've solved the problem using a normal for loop however, i'm curuois to why this is not working, and would like to know if there is another way to do this.
has comment: http://stackoverflow.com/comment/47400927
has answer: http://stackoverflow.com/a/29626762
has comment: http://stackoverflow.com/comment/96557831
answer count: 2
tagged with: function
tagged with: this
tagged with: javascript
score: 72
favorite count: 0
has comment: http://stackoverflow.com/comment/47396736

http://stackoverflow.com/q/29644000
has answer: http://stackoverflow.com/a/29644132
has comment: http://stackoverflow.com/comment/47429215
has answer: http://stackoverflow.com/a/29644247
has comment: http://stackoverflow.com/comment/47429392
has answer: http://stackoverflow.com/a/29644228
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29644326
score: 0
has comment: http://stackoverflow.com/comment/47429313
has body: I am trying to make increment decrements through jQuery. jQuery(function() { jQuery("div.inputQty").append('&lt;div class="inc add"&gt;&amp;#43;&lt;/div&gt;&lt;div class="dec add"&gt;&amp;#8722;&lt;/div&gt;'); jQuery(".add").click(function() { var jQueryadd = jQuery(this); var oldValue = jQueryadd.parent().find("input").val(); var newVal = 0; if (jQueryadd.text() == "›") { newVal = parseFloat(oldValue) + 1; // AJAX save would go here } else { // Don't allow decrementing below zero if (oldValue &gt; 1) { newVal = parseFloat(oldValue) - 1; // AJAX save would go here } if(oldValue == 1){ newVal = parseFloat(oldValue); } } jQueryadd.parent().find("input").val(newVal); }); }); &lt;div class="inputQty"&gt; &lt;span class="up"&gt;&amp;#43;&lt;/span&gt; &lt;input type="text" maxlength="6" name="oa_quantity" class="input-quantity" value="1"/&gt; &lt;span class="down"&gt;&amp;#8722;&lt;/span&gt; &lt;/div&gt; But it not working. Please help me to solve this Here is the demo
answer count: 4
has title: jQuery numeric increment decrements
type: UnansweredQuestion
type: Question

http://stackoverflow.com/comment/118008960
has text: This solution can work. Is there any pure CSS solution? Thanks
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29696731
type: AnswerComment

http://stackoverflow.com/q/29583338
type: AnsweredQuestion
has title: CSS Change the Arrows in Fullpage.js to custom images?
type: Question
tagged with: javascript
tagged with: jquery
has body: I am using fullpageJS https://github.com/alvarotrigo/fullPage.js/ to make my website. I wanted to change the arrows to display custom images instead. I found this question asked earlier here CSS: change arrows on fullpage JS? and I attempted to overwrite the jquery.fullPage.css with my own arrows.css style and didn't get the images to display. I'm relatively new to coding so I'm not really sure of the best way to overwrite the original css. The original css for the arrows: .fp-controlArrow { position: absolute; z-index: 4; top: 50%; cursor: pointer; width: 0; height: 0; border-style: solid; margin-top: -38px; -webkit-transform: translate3d(0,0,0); -ms-transform: translate3d(0,0,0); transform: translate3d(0,0,0); } .fp-controlArrow.fp-prev { left: 15px; width: 0; border-width: 38.5px 34px 38.5px 0; border-color: transparent #fff transparent transparent; } .fp-controlArrow.fp-next { right: 15px; border-width: 38.5px 0 38.5px 34px; border-color: transparent transparent transparent #fff; } My code for the arrows.css style: .fp-controlArrow { position: absolute; width:146px !important; height:286px !important; z-index: 4; top: 50%; } .fp-controlArrow.fp-prev { background-image: url(images/leftnavbutton.png) !important; background-repeat: no-repeat; left: 0px; height:286px; width: 146px; z-index: 10; } .fp-controlArrow.fp-next { background-image: url(images/rightnavbutton.png) !important; background-repeat: no-repeat; right: 0px; height:286px; width:146px; z-index: 10; }
has answer: http://stackoverflow.com/a/29583529
score: 2
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
tagged with: fullpage.js
favorite count: 0
upvote count: 2
linked to: http://stackoverflow.com/q/25785914
tagged with: css
accepted answer: http://stackoverflow.com/a/29583529

http://stackoverflow.com/comment/47370480
score: 3
comment on: http://stackoverflow.com/q/29612490
type: Comment
has text: No, `for (var i = 0; i < cars.length; i++) {` works fine. Probably best to avoid w3schools as a primary resource.
type: QuestionComment

http://stackoverflow.com/q/29582824
tagged with: http://stackoverflow.com/tag/html
tagged with: charactercount
has answer: http://stackoverflow.com/a/29583292
has body: I've been working on adding a character counter to a TEXTAREA field. There are many, many solutions available online for this task. "Stop-at-Zero" Solution The problem I'm having is that practically all solutions terminate user input at 0. That's effective, I guess, but it's not optimal in terms of user-friendliness. For example, if a user pastes text into the TEXTAREA, and the text exceeds the field's limitation, this stop-at-zero solution will abruptly truncate the excess text. The user then has to work to find the missing content and then edit their message, submit a second form, or some other burden. "Negative Character Count" Solution Other solutions allow the user to enter all they want. The character counter will go from positive to negative. The problem with these counters is lack of enforcement: They allow users to submit the form even with a negative character count. Twitter Solution I think Twitter has it right. They let users input all they want and highlight the excess text with a negative character count (and a colored background, which I don't need to have). They disable the submit button while the count is negative. My (Incomplete) Solution Working with third-party code I found through Google, I've devised a character counter that works perfectly in terms of the count. But being somewhat new to JS I haven't been able to code the enforcement part. Here's my question: How do I get the code to prevent submission of the form when the counter is a negative number? HTML CSS form div { position: relative; } form .counter { position: absolute; left: 300px; bottom: -25px; font-size: 25px; font-weight: bold; color: #ccc; } form .warning {color: orange;} form .exceeded {color: red;} JavaScript https://jsfiddle.net/nyc212/sk5kfopw/
score: 0
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29582955
tagged with: forms
possible better answer: http://stackoverflow.com/a/29582955
accepted answer: http://stackoverflow.com/a/29583292
type: Question
answer count: 2
has title: Textarea counter / countdown with negative numbers and enforcement
tagged with: textarea
tagged with: javascript

http://stackoverflow.com/q/29654032
score: -3
has comment: http://stackoverflow.com/comment/47448070
type: Question
type: AnsweredQuestion
favorite count: 0
has comment: http://stackoverflow.com/comment/47448089
has comment: http://stackoverflow.com/comment/47447900
answer count: 2
has answer: http://stackoverflow.com/a/29654230
upvote count: 1
has title: Trouble with math in javascript
possible better answer: http://stackoverflow.com/a/29654212
has answer: http://stackoverflow.com/a/29654212
has comment: http://stackoverflow.com/comment/47447987
downvote count: 4
has comment: http://stackoverflow.com/comment/47448193
accepted answer: http://stackoverflow.com/a/29654230
has body: How do I make script that does the following: Grab how much cash is available Grab the product price Tell how much of product can be bought with what i have and how much will be leftover. var valCash = prompt("How much do you have?"); var price = prompt("Whats the product price?"); var buying = valCash / price; console.log(buying); var buyingLeftover = valCash - (buying * price); console.log(buyingLeftover);
tagged with: javascript

http://stackoverflow.com/comment/47256583
has text: What do you mean by pristine vs dirty?
comment on: http://stackoverflow.com/q/29552644
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47335406
type: Comment
has text: Hey there i had a go at editing my code but i dont think i have implemented your logic right, im really sorry quite new to java script but this is what i did http://gyazo.com/cc6194ccca2a90fc27795be87e8851d2
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29591628

http://stackoverflow.com/a/29635944
type: Answer
has body: By its nature, resizing involves resampling the original image and interpolating/convoluting the existing pixels into the resized space. The resulting image is meant to be visually appealing at its new size. But for an image resized by X, the resulting pixels certainly do not have an X:1 relationship anymore. To zoom-in you need a "projection" where each single 1x1 pixel is expanded into a 2x2 pixel group (or a 3x3 pixel group, etc). To zoom-out you need a "projection" where each 2x2 pixel group is condensed into a single 1x1 pixel set. To zoom-out, the source (before scaling) must be made up of pixel groups. This means that you cannot zoom-out an image below its original size without using resampling. There is no projection available to zoom-out below 1X. A workaround is to have the user draw at 2X (or 3X or 4X) projection so you can zoom-out. FabricJS does not do projections natively...You'll have to use a temporary canvas element to do projections. Here's example code to zoom using projections: var zoom=2; var img=new Image(); img.crossOrigin='anonymous'; img.onload=start; //img.src="sun.png"; img.src="https://dl.dropboxusercontent.com/u/139992952/multple/sun.png"; function start(){ var iw=img.width; var ih=img.height; img.width=iw; img.height=ih; // set the "current zoom factor" on the original image to 1x img.zoom=1; // test: resize by 4X var zoom4x=resize(img,4,'canvas4x'); document.body.appendChild(zoom4x); // test: resize the 4X back down to 2X var zoom2x=resize(zoom4x,0.50,'canvas2x'); document.body.appendChild(zoom2x); // test: resize the 2X back down to 1X var zoom1x=resize(zoom2x,0.50,'canvas1x'); document.body.appendChild(zoom1x); // test: resize the 1X down to half-size var zoomHx=resize(zoom1x,0.50,'canvas1x'); if(zoomHx){document.body.appendChild(zoomHx)}; // display the original image document.body.appendChild(img); } var resize = function(img,scale,id){ var zoom=parseInt(img.zoom*scale); if(zoom<1){ console.log('Cannot recale image to less than ori…
upvote count: 2
score: 1
answers question: http://stackoverflow.com/q/29633200
downvote count: 1
accepted answer of: http://stackoverflow.com/q/29633200
type: AcceptedAnswer

http://stackoverflow.com/a/29591878
has comment: http://stackoverflow.com/comment/47331803
upvote count: 3
answers question: http://stackoverflow.com/q/29591769
type: Answer
score: 3
has body: Use the onChange event and move the event handler to the element. Also added a value attribute to the element to make text field identification simpler. And, finally, in the function, pass the select element to the event handler and grab the selected option from the select list. Contact me by: Email JSFiddle Now you can easily add more contact options: Contact me by: Email Phone Mail
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47331024
accepted answer of: http://stackoverflow.com/q/29591769

yeoman-generator
tags question: http://stackoverflow.com/q/29572797
tag name: yeoman-generator
type: Tag

http://stackoverflow.com/comment/47527760
type: Comment
comment on: http://stackoverflow.com/a/29684535
type: AnswerComment
score: 0
has text: I assume you are using WebStorm v10 ... all recent builds have this strange behaviour -- "System Default" and sometimes "UTF-8" got changed to "Windows-1252" ...

http://stackoverflow.com/q/29682494
answer count: 1
downvote count: 0
favorite count: 0
tagged with: ruby
type: UnansweredQuestion
tagged with: mechanize
has comment: http://stackoverflow.com/comment/47503971
has comment: http://stackoverflow.com/comment/47563090
has comment: http://stackoverflow.com/comment/47562469
score: 1
has comment: http://stackoverflow.com/comment/47503266
has title: Get JavaScript variable using Mechanize
has body: I want to get a JavaScript variable from https://admin.booking.com/hotel/hoteladmin in head &gt; script &gt; var token. I don't know how this variable is set by the browser because when I get this page from Mechanize I get: var token = '' || 'empty-token', Here is the code I use to GET this page: login_url = "https://admin.booking.com/hotel/hoteladmin" agent = Mechanize.new agent.verify_mode= OpenSSL::SSL::VERIFY_NONE page = agent.get(login_url)
tagged with: web-scraping
type: Question
linked to: http://stackoverflow.com/q/500431
tagged with: javascript
linked to: http://stackoverflow.com/q/802225
has answer: http://stackoverflow.com/a/29683748
upvote count: 1
has comment: http://stackoverflow.com/comment/47557508

http://stackoverflow.com/q/29598852
accepted answer: http://stackoverflow.com/a/29601004
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29598988
favorite count: 0
has body: I have a Highchart which displays earth and water pressure data (stored in the Database). I want to mark the area between the various points on x-axis with different colors which marks the type of area from where the data was collected. I have the color data (shown on top in a table) but I need to mark it on the chart My chart looks as follows: I want the chart to be viewed so as the background color from 284 to 285 is orange and from 285 to 286 is Pink and so on... How can I do that
possible better answer: http://stackoverflow.com/a/29598988
upvote count: 1
has answer: http://stackoverflow.com/a/29601004
type: AnsweredQuestion
score: 1
has title: Highchart highlight area between points with custom colors
type: Question
answer count: 2
tagged with: highcharts
downvote count: 0

http://stackoverflow.com/comment/47276237
type: Comment
type: QuestionComment
has text: The question is , bars has different "from" and "to" json values but they appears on the same xAxis . it shoul be appeared on diferent xAxis.
comment on: http://stackoverflow.com/q/29550953
score: 0

http://stackoverflow.com/comment/47495080
type: QuestionComment
has text: Hi, thank you for your answer, I corrected what you suggested but it's still not working..
score: 0
comment on: http://stackoverflow.com/q/29678785
type: Comment

lint
tags question: http://stackoverflow.com/q/29551150
tag name: lint
tags question: http://stackoverflow.com/q/29552436
type: Tag

http://stackoverflow.com/comment/47338923
comment on: http://stackoverflow.com/a/29595964
score: 0
type: AnswerComment
has text: @some there is an option, just you have to mess around a bit with the code.
type: Comment

http://stackoverflow.com/a/29569195
type: Answer
answers question: http://stackoverflow.com/q/29567880
has body: {{}} is nothing but you are adding interpolation directive or you can use ng-bind directive for same purpose. While angular do compile the page it fetches all the directive from the page and do sort them on the basis of priority and Do execute them from higher priority to lower priority. The directive which are of the same priority, will executed in on the basis of there alphabetical order.
score: 0

http://stackoverflow.com/a/29538532
type: Answer
has body: Use the mainConfigFile option in your build config so that it points to the file that contains your runtime configuration: mainConfigFile: "js/Main.js"
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/47229816
answers question: http://stackoverflow.com/q/29538462
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29538462

random
tags question: http://stackoverflow.com/q/29649705
tags question: http://stackoverflow.com/q/29634097
tags question: http://stackoverflow.com/q/29638179
tags question: http://stackoverflow.com/q/29628192
tags question: http://stackoverflow.com/q/29574086
tag name: random
tags question: http://stackoverflow.com/q/29669627
tags question: http://stackoverflow.com/q/29590001
type: Tag
tags question: http://stackoverflow.com/q/29552424

http://stackoverflow.com/q/29587488
score: 9
type: Question
tagged with: lodash
has answer: http://stackoverflow.com/a/61622068
has answer: http://stackoverflow.com/a/29589539
tagged with: underscore.js
has comment: http://stackoverflow.com/comment/47322795
has comment: http://stackoverflow.com/comment/47323097
upvote count: 9
answer count: 5
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29589539
has body: I have following object records: { "notes":[ { "id":1, "description":"hey", "userId":2, "replyToId":null, "postId":2, "parentId":null }, { "id":5, "description":"hey test", "userId":3, "replyToId":null, "postId":2, "parentId":null }, { "id":2, "description":"how are you", "userId":null, "replyToId":2, "postId":2, "parentId":null, "user":null } ] } I want to output it as: 2 object with id 1 object with id 2 (because replyToId value is same as userId 3 object with id 5 So basically I want to consider UserId and replyToId value under the same group. I have build my own mixin under lodash, wrapping groupBy method as: mixin({ splitGroupBy: function(list, groupByIter){ if (_.isArray(groupByIter)) { function groupBy(obj) { return _.forEach(groupByIter, function (key){ if ( !!obj[key] ) return obj[key] }); } } else { var groupBy = groupByIter; } debugger; var groups = _.groupBy(list, groupBy); return groups; } }); Call looks like this: _.splitGroupBy(data.notes,['userId', 'replyToId']); The output is coming without group. Even when I have tried with _.map instead _.forEach the split is not happening correctly.
has title: Grouping objects by multiple columns with Lodash or Underscore
has comment: http://stackoverflow.com/comment/47322859
has answer: http://stackoverflow.com/a/29588766
has answer: http://stackoverflow.com/a/29775994
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29588145
downvote count: 0
has answer: http://stackoverflow.com/a/29588145
favorite count: 0

http://stackoverflow.com/comment/47333003
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29592768
has text: you have to user wrappers

http://stackoverflow.com/q/29585331
has answer: http://stackoverflow.com/a/29585390
has comment: http://stackoverflow.com/comment/47318871
has answer: http://stackoverflow.com/a/29585365
has comment: http://stackoverflow.com/comment/47318909
type: Question
tagged with: javascript
tagged with: rating-system
score: 0
has answer: http://stackoverflow.com/a/29585384
has body: I'm working on an online games portal built with Angular js. I want my players to have ratings that increase when they win/lose a game. How do I implement this? If if could get this working in pure JS then I think it could adapt it to my app. To sketch what I want: var players = [ { id: 1, name: "James", rating: 100 }, { id: 2, name: "Matt", rating: 200 }, { id: 3, name: "Tara" rating: 300 ] UpdateRating = function(winnerId, LoserId){ //changes these players ratings }
has answer: http://stackoverflow.com/a/29585406
possible better answer: http://stackoverflow.com/a/29585365
accepted answer: http://stackoverflow.com/a/29585406
answer count: 4
type: AnsweredQuestion
has title: Ratings system for online angular.js game

http://stackoverflow.com/comment/47500303
type: QuestionComment
score: 0
has text: tagInput = tagList.querySelectorAll('[name=tagInput]'); gives you a NodeList array. You can't bind an eventListener to a NodeList. You have to loop to each node.
comment on: http://stackoverflow.com/q/29679919
type: Comment

http://stackoverflow.com/comment/47440883
type: AnswerComment
comment on: http://stackoverflow.com/a/29650543
type: Comment
has text: yes exactly, alone. It's a small function, i don't want to search 10 libraries and their documentation, i mean it is small stuff that i can do alone
score: 0

http://stackoverflow.com/a/29658074
score: 0
type: Answer
has body: The most standard way to do this is with the disabled="disabled" attribute value pair in the HTML element you want to disable. &lt;input type="text" disabled="disabled" /&gt; Is there a reason you're not using this? Perhaps I am misunderstanding the question?
answers question: http://stackoverflow.com/q/29657972

http://stackoverflow.com/q/29674817
has comment: http://stackoverflow.com/comment/47487743
upvote count: 3
answer count: 3
has title: can smooth scroll to a component cause other components to blur in jquery/css?
has comment: http://stackoverflow.com/comment/47487603
has answer: http://stackoverflow.com/a/29675101
has answer: http://stackoverflow.com/a/29675114
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has body: I'm using the solution proposed here jQuery scrollTo - Center Div in Window Vertically and it works, when I hit some link on my webpage, I immediately see smooth scrolling that stops when my header is in the middle of the screen. However, I have several other components above and below, so I thought about bluring them until the user scrolls up or down - is that even possible in jquery or css? I prepared small jsfiddle with the code so far, I just have trouble with attaching jquery library itself, so the smooth scroll might now be visible there... But all in all I'm using the following script: $('#borders a').on('click', function(e) { var el = $( e.target.getAttribute('href') ); var elOffset = el.offset().top; var elHeight = el.height(); var windowHeight = $(window).height(); var offset; if (elHeight &lt; windowHeight) { offset = elOffset - ((windowHeight / 2) - (elHeight / 2)); } else { offset = elOffset; } $.smoothScroll({ speed: 700 }, offset); return false; }); EDIT:: I marked this quesion as solved since the correct answer was given below, however it appeard to me later on that it doesn't work in my case. That's why I've decided to ask another question here
tagged with: css
linked to: http://stackoverflow.com/q/29678607
type: AnsweredQuestion
score: 3
downvote count: 0
possible better answer: http://stackoverflow.com/a/29675101
tagged with: smooth-scrolling
type: Question
linked to: http://stackoverflow.com/q/10889983
has answer: http://stackoverflow.com/a/29675206
accepted answer: http://stackoverflow.com/a/29675206
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/47430526
type: Comment
has text: how to place if else condition to get one of value above i want if keyup than that value other wise dfault (below value)
comment on: http://stackoverflow.com/q/29644416
score: 0
type: QuestionComment

http://stackoverflow.com/comment/47498462
has text: Yes. I marked this answer as the correct one. I did realize what you described, but the behavior seems different than with the callback model - I guess I was just expecting something I shouldn't. Thanks for your help.
type: Comment
comment on: http://stackoverflow.com/a/29679789
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47451477
comment on: http://stackoverflow.com/a/29655400
score: 0
type: AnswerComment
has text: Sam, thanks for also testing. Agreed, they *must* be doing something in JS to keep them in sync, but that (maybe unnecessarily) bothers me that I can't see the same state reflected in the DOM.
type: Comment

http://stackoverflow.com/q/29603692
favorite count: 0
has comment: http://stackoverflow.com/comment/47366405
has answer: http://stackoverflow.com/a/29603851
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47353053
has comment: http://stackoverflow.com/comment/47353603
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47366466
has comment: http://stackoverflow.com/comment/47366359
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/47353687
has comment: http://stackoverflow.com/comment/47355786
has title: Refresh JSON Data Using Angular
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/47355150
type: Question
has answer: http://stackoverflow.com/a/29603838
has body: Just finished a Codeacademy tutorial using angular to loop through some JSON data from a URL and display the data. Would love to know how to implement it so the data would be updated if the JSON data was changing periodically! I know I need to maybe refresh the http get request,but after that I'm not sure. If someone could point me in the right direction I would really appreciate it! Thanks! services/forecast.js app.factory('forecast', ['$http', function($http) { return $http.get('http://json-time.appspot.com/time.json') .success(function(data) { return data; }) .error(function(err) { return err; }); }]); controllers/MinorController.js app.controller('MinorController', ['$scope', 'forecast', function($scope, forecast) { var setTimeOut = setInterval(function () { forecast.success(function(data) { $scope.fiveDay = data; }); }, 5000); $scope.$on('$routeChangeStart', function (scope, next, current) { if (next.$$route.controller != "MinorController") { clearInterval(setTimeOut); // clear interval here } }); }]); test.html (view) Time JSON Example {{ fiveDay.tz }} {{ fiveDay.hour }} {{ fiveDay.datetime }} {{fiveDay.second }}
has comment: http://stackoverflow.com/comment/47353522
tagged with: javascript
has comment: http://stackoverflow.com/comment/47366123
upvote count: 3
answer count: 2
has comment: http://stackoverflow.com/comment/47355317

http://stackoverflow.com/a/29556471
score: 1
has body: This could be achieved using pure css, eliminating the need for js: .wrap img { height: 100%; 100%; position: absolute; left: 0; top: 0; transition: all 1s; } .wrap { position: relative; height: 300px; width: 300px; transition: all 1s; overflow: hidden; } .wrap img:last-child { top: 100%; } .wrap:hover img:first-child { top: -100%; } .wrap:hover img:last-child { top: 0; } .wrap p { position: absolute; bottom: 0; opacity: 0; left: 0; background: rgba(0, 0, 0, 0.2); display: inline-block; width: 100%; height: 30px; color: white; transition: all 1s; z-index: 8; } .wrap:hover p { opacity: 1; } some text too
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/29553772
downvote count: 0

http://stackoverflow.com/a/29662822
has comment: http://stackoverflow.com/comment/47465094
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29662673
has body: Remove the callback=? from the end of the URL you are providing OR remove the 'json' from the .get() method call. jQuery('.convert').click(function(){ jQuery.get("https://rate-exchange.herokuapp.com/fetchRate?from=EUR&amp;to=CAD", function(data){ console.log(data); });}); This is because jQuery assumes that when you pass a "callback" parameter in URL and type 'json' that the response will be JSONP. But in this case the server sends a JSON string. Instead of passing "?" if you pass the name of an existing function the error will not be thrown. The current response by the server is: {"To":"CAD","From":"EUR","Rate":"1.3138"} If the Server was responding with JSONP and if the callback you passed was "test" then the response would have been: test({"To":"CAD","From":"EUR","Rate":"1.3138"}) http://codepen.io/tejzpr/pen/yymQNz?editors=101 explains both cases.

http://stackoverflow.com/q/29538926
has answer: http://stackoverflow.com/a/29724980
tagged with: charts
answer count: 2
score: 8
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47232303
has title: issue while using d3 brush in a line+bar chart (zoom in line+bar chart)
has comment: http://stackoverflow.com/comment/47351936
has comment: http://stackoverflow.com/comment/47352192
favorite count: 0
has comment: http://stackoverflow.com/comment/47351626
has answer: http://stackoverflow.com/a/29705913
tagged with: d3.js
type: UnansweredQuestion
tagged with: data-visualization
has body: I am trying to use brush to zoom my custom chart in d3.js but its not behaving the way it should.Any idea what could be wrong here is js fiddle http://fiddle.jshell.net/saurabh_nitc10/od8gfsd3/9/ like in this fiddle http://fiddle.jshell.net/CjaD3/1/ after brushing the bars are going out of yaxis. any idea what is wrong with the existing fiddle.Its not behaving the way it is supposed to do after zooming.please help.I just updated the fiddle here is the plugin I have created. (function($) { $.dualAxis = {}; var xMapObject=[]; var svg = ''; var focus = ''; var tip = ''; function DualAxis(element, options) { this.$element = $(element); this.options = options; this.margin = {top: 20, right: 80, bottom: 30, left: 40}, width = $(this.$element.selector).width() - this.margin.left - this.margin.right, height = $(this.$element.selector).height() - this.margin.top - this.margin.bottom; this.options.height = (this.options.height == null? height: this.options.height); this.options.width = (this.options.width == null? width: this.options.width); this.rangeMax = this.getMaxX().length*100; if (this.rangeMax > 14000) this.rangeMax = 14000; this.enabled = true; } DualAxis.prototype = { draw: function(){ this.options.data.bar.forEach(function(d) { d.value = +d.value; }); this.options.data.line.forEach(function(d) { d.value = +d.value; }); tip = d3.tip() .attr('class', 'd3-tip') .html(function(d) { var name= xMapObject[d.date];if(name == undefined){name=d.date;} var table = ' ' + ' ' + ' '+name+' ' + ' ' + ' ' + ' Total Sales '+d.value+' ' + ' ' + ' '; return table; }) .style({border: '1px solid #fff', 'box-shadow': '1px 1px 4px rgba(0,0,0,0.5)', 'border-radius': 'none','background':'#fff','color':'#555'}) .offset([-12, 0]); // if(this.options.data.events.length > 1){ // xOffset = (this.options.width/this.options.data.events.length) + 40; // } else { // xOffset = this.options.width/2; // } xOffset = 62; svg = this.getSvg(); svg == null ? svg = d3.select(this.$element.selector).append("…
has comment: http://stackoverflow.com/comment/47229919
upvote count: 9
has comment: http://stackoverflow.com/comment/47352246
has comment: http://stackoverflow.com/comment/47231616
has comment: http://stackoverflow.com/comment/47232103
downvote count: 1
has comment: http://stackoverflow.com/comment/47351408
type: Question

http://stackoverflow.com/a/29823085
has body: I managed to make it working on last chrome/IE11. jsfiddle I moved the At the end of the tag, so the CSS became: .sbMenuTrigger { background-color:#b23445; cursor:pointer; width:100px; position:absolute; right:-100px; top:0; bottom: 0; } The position fixed + transform are not always welcome by all browsers.
has comment: http://stackoverflow.com/comment/47790957
upvote count: 3
downvote count: 1
answers question: http://stackoverflow.com/q/29627672
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/47785667

http://stackoverflow.com/comment/47296622
type: Comment
comment on: http://stackoverflow.com/q/29573847
has text: bind keyup event and fire the $http
score: 0
type: QuestionComment

http://stackoverflow.com/comment/47481868
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29672051
has text: Any console logs you able to see when running second time?
score: 0

http://stackoverflow.com/comment/47478406
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29668451
has text: @zipzit: Yes, basically.
type: AnswerComment

http://stackoverflow.com/comment/127278248
has text: Lodash is great... but if you're going to use lodash, use lodash: `_.mean([4, 2, 8, 6]);` (see also: `_.meanBy` https://lodash.com/docs/4.17.15#meanBy)
type: AnswerComment
comment on: http://stackoverflow.com/a/43974885
type: Comment
score: 2

http://stackoverflow.com/q/29602813
has answer: http://stackoverflow.com/a/29602977
score: 0
type: UnansweredQuestion
tagged with: php
type: Question
has answer: http://stackoverflow.com/a/29605753
answer count: 2
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47353728
tagged with: http://stackoverflow.com/tag/html
has title: Refreshing contents of a Div without refreshing the entire page
tagged with: css
has comment: http://stackoverflow.com/comment/47351769
linked to: http://stackoverflow.com/q/22577457
has body: I have around 90 divisions in my page which can navigated by next and previous buttons. Now these divisions have textboxes which retrieves tables values from the database on page refresh. The thing with this kind of refresh is that if I'm on the 67th division and the page reloads, it goes back to the first divsion. I want that if I press a button inside any div, that div only will refresh with new table values from the database. I have come across several codes, but none of it refreshes the div at realtime, for example if I save two textbox values, it will show the textbox values at that time. If I go then to phpmyadmin and delete one of the rows, come back to the textbox and press the refresh button,it should just update the textbox values with new data, in this case only first row should be present $result = mysql_query("SELECT * FROM du_contacts where DU_no=$du_no"); $row = mysql_fetch_array($result); &lt;td&gt;&lt;input type="Text" name="DU" maxlength="25" value="&lt;?php echo $row[1]; ?&gt;" id="DU_contact_name_0" &gt; This is how i retrieve data in to the textbox.. all i want is when i press a button, the data in the textbox should change to the recent data in table.

http://stackoverflow.com/a/29642031
accepted answer of: http://stackoverflow.com/q/29641290
has body: You can't disable the alert, nor change the style of the alert on onbeforeunload. The main reason is for security problems. From MDN document, WindowEventHandlers.onbeforeunload, it says, When this event returns a non-void value, the user is prompted to confirm the page unload. In most browsers, the return value of the event is displayed in this dialog. In Firefox 4 and later the returned string is not displayed to the user. Instead, Firefox displays the string "This page is asking you to confirm that you want to leave - data you have entered may not be saved." See bug 588292. Since 25 May 2011, the HTML5 specification states that calls to window.alert(), window.confirm(), and window.prompt() methods may be ignored during this event. See the HTML5 specification for more details. Note also that various mobile browsers ignore the result of the event (that is, they do not ask the user for confirmation). Firefox has a hidden preference in about:config to do the same. In essence this means the user always confirms that the document may be unloaded.
score: 11
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29641290
upvote count: 11

http://stackoverflow.com/q/29538632
tagged with: javascript
score: 0
tagged with: slider
tagged with: qualtrics
has answer: http://stackoverflow.com/a/30177912
type: UnansweredQuestion
has body: In Qualtrics, I would like to establish a relationship between two sliders (using the "Draggable Sliders" question type). One slider would dynamically decrease the value of another slider by the same amount. The user should be able to adjust only the first slider, which would automatically adjust the second slider and its associated value (which should be displayed and updated with the dynamic adjustment). Does anyone have a suggestion for the javascript necessary to establish this type of relationship between two sliders in Qualtrics?
type: Question
has title: In Qualtrics, how to dynamically connect two sliders?
answer count: 1

http://stackoverflow.com/comment/47369598
comment on: http://stackoverflow.com/a/29612002
score: 3
has text: @MarcoBonelli yet much more fitting to the problem at hand.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47281870
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29566042
has text: What part do you need help with? How to handle a user selecting an option or how to disable the input field?
score: 0

http://stackoverflow.com/q/29652241
accepted answer: http://stackoverflow.com/a/29653978
tagged with: fancybox-2
type: AnsweredQuestion
tagged with: javascript
type: Question
has comment: http://stackoverflow.com/comment/47446045
has comment: http://stackoverflow.com/comment/47446762
answer count: 1
has title: fancybox undefined in afterShow click event
has answer: http://stackoverflow.com/a/29653978
tagged with: jquery
has comment: http://stackoverflow.com/comment/47446289
has body: I have the following code that I call on page load: $('#postcodes-link').fancybox({ type: 'ajax', minWidth: 800, minHeight: 400, afterShow: function () { $('table.data-table &gt; tbody &gt; tr').on('click', function () { $.fancybox.close(); }); } }); Now this works fine to open the fancybox (fiddle example), but when I click on the row, it doesn't close the fancybox and just throws the following error: Uncaught TypeError: Cannot read property 'close' of undefined yet if I make the above into a jQuery function: (function ($) { $.fn.setUp = function () { return $(this).each(function () { $(this).fancybox({ type: 'ajax', minWidth: 800, minHeight: 400, afterShow: function () { $('table.data-table &gt; tbody &gt; tr').on('click', function () { $.fancybox.close(); }); } }); }); }; })(jQuery); and call the following in the same place as I called the top code $('#postcodes-link').setUp(); The fancybox will now close (fiddle example). My question is why does the first one not work whereas the second one does, and how can I make the first one work? I figure it is something to do with the scope of fancybox but then I would have expected the second one not to work as it is wrapped inside a further function Please note I have tried various version of trying to close the fancybox: $.fn.fancybox.close() jQuery.fancybox.close() parent.$.fn.fancybox.close() $('.fancybox-close').trigger('click') //tried this one as a dirty hack but didn't work either
score: 0

http://stackoverflow.com/a/29648923
has comment: http://stackoverflow.com/comment/47490956
has body: The method is called getElementsByClassName (plural) and returns a collection of HTML elements. For which one of those do you want to change the HTML? For the first one? Additionally, you cannot use a CSS selector like that in standard DOM methods EDIT: Obviously you want to change all occurrences of a elements inside all occurrences of .productitemcell: var pics = document.getElementsByClassName("productitemcell"); for(i=0; i&lt;pics.length; i++) { // loop over all elements with that class var anchors = pics[i].getElementsByTagName("a"); for(j=0; j&lt;anchors.length; j++) { // loop over all anchor elements within the current class element anchors[j].innerHTML = 'Remover'; } }
has comment: http://stackoverflow.com/comment/47491164
type: Answer
upvote count: 3
downvote count: 3
answers question: http://stackoverflow.com/q/29648851
score: 0

http://stackoverflow.com/q/29543588
has body: Im trying to show a ProgressBar when my page is doing an ajax request. I am creating a dialog dynamically with an image inside it and I would like to show it on the ajaxStart event. The problem is that when I make a ajax call then ajax start fires after the return from controller. $(document).on('ajaxStart',function(){ alert('x'); $.OpenLoading(); //method which is creating the dialog and image }); In this case the alert is called immediately. But there is not dialog created But if write the same code like this $(document).on('ajaxStart',function(){ console.log('x'); $.OpenLoading(); //method which is creating the dialog and image }); Then in console x is printed after returning from controller action and still the dialog is not created. If I just run the $.OpenLoading() in console then it works fine as expected. Please let me know where I am doing wrong??
tagged with: javascript
has answer: http://stackoverflow.com/a/29543908
score: 0
answer count: 2
has title: Ajax Start Event Firing after return from Controller
tagged with: jquery
tagged with: ajax
possible better answer: http://stackoverflow.com/a/29543908
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29543855
accepted answer: http://stackoverflow.com/a/29543855
type: Question

http://stackoverflow.com/comment/47325749
type: Comment
comment on: http://stackoverflow.com/a/29589049
type: AnswerComment
has text: Then you should edit posted, others might confuses :)
score: 0

http://stackoverflow.com/a/29564246
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29564232
has comment: http://stackoverflow.com/comment/47289740
has comment: http://stackoverflow.com/comment/47293828
type: Answer
answers question: http://stackoverflow.com/q/29564232
has comment: http://stackoverflow.com/comment/47278328
score: 22
has comment: http://stackoverflow.com/comment/47278296
has body: The loop ends because undefined is a falsey value. The reason why use one over the other is user preference. You have a preference while someone else preferred the other way. Someone else might want to use a while loop. There is no right way.
has comment: http://stackoverflow.com/comment/47280043
upvote count: 22
type: AcceptedAnswer

http://stackoverflow.com/a/48037102
upvote count: 4
downvote count: 0
score: 4
has body: In case someone is still looking for a way to prevent copying unimportant elements (such as line numbers), the answer is to use pseudo elements: .code { white-space: pre; font-family: monospace; padding-left: 40px; } .line-number { position: absolute; left: 0; width: 38px; color: #888; text-align: right; } .line-number::before { content: attr(data-line-number); } const greet = () => { console.log("Hello World!"); };
answers question: http://stackoverflow.com/q/29537123
type: Answer

http://stackoverflow.com/a/29551064
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29550806
has body: as much as I know there is no function in javascript print formated date. Try this: function displayLastMod() { monthArray = new Array(11); monthArray[0] = "January"; monthArray[1] = "February"; monthArray[2] = "March"; monthArray[3] = "April"; monthArray[4] = "May"; monthArray[5] = "June"; monthArray[6] = "July"; monthArray[7] = "August"; monthArray[8] = "September"; monthArray[9] = "October"; monthArray[10] = "November"; monthArray[11] = "December"; theDate = new Date();theDate.setHours(16); var theMonth = theDate.setMonth(03); var theDay = theDate.setDate(09); var theYear = theDate.setYear(2015); var monthName=monthArray[theDate.getMonth()] var day=theDate.getDate(); var year=theDate.getYear()+1900; var hours=theDate.getHours() var minutes=theDate.getMinutes(); var seconds=theDate.getSeconds(); document.getElementById("lastModified").innerHTML = ("Last Modified: " +monthName+' '+day+', '+year+' - '+hours%12+':'+minutes+':'+seconds+' '+((hours&gt;12)?'PM':'AM')); }

http://stackoverflow.com/q/29647998
has title: How to add the plugin to the Ionic Crosswalk project using Ionic CLI?
type: UnansweredQuestion
tagged with: cordova
answer count: 0
upvote count: 3
type: Question
has comment: http://stackoverflow.com/comment/61775109
score: 3
tagged with: javascript
tagged with: ionic-framework
has body: I'm trying to add the plugin to my Ionic Crosswalk project using the following command: plugman install --platform android --project . --plugin https://github.com/Telerik-Verified-Plugins/InAppPurchase --variable BILLING_KEY="aslfhsjkfhalkshfakhgfkhgkjgh" I see that appropriate folder with plugin is created in ./plugin folder, but when I try to build an .apk file by using following command: ionic build android I see that plugin was not included to the package and of course the application says that it cannot find the plugin file. Failed to load resource: net::ERR_FILE_NOT_FOUND file:///android_asset/www/plugins/cc.fovea.cordova.purchase/www/store-android.js I guess that is because the /plugin folder is one level up then /www/plugins folder, which should contain plugins. The structure is like this: .. /cordova /engine /hooks /platforms /plugins &lt;- plugman installs plugins in this folder /res /resources /scss /src /www &lt;- my project is here and app tries to find any plugin in /www/plugins .bowerrc .gitignore bower.json config.xml gulpfile.js ionic.project package.json But the application tries to find the plugin in the folder /www/plugins I don't know how to set the proper path to the plugin folder or how to force plugin installer to install plugins to the /www/plugins folder, and make ionic to include this folder to .apk file. The same problem with any other plugin. Does anybody face the same problem?
tagged with: crosswalk-runtime
has comment: http://stackoverflow.com/comment/51500800
downvote count: 0
tagged with: cordova-plugins
favorite count: 0

http://stackoverflow.com/q/29669627
tagged with: arrays
has comment: http://stackoverflow.com/comment/47477680
tagged with: jquery
possible better answer: http://stackoverflow.com/a/29669914
has answer: http://stackoverflow.com/a/29669995
accepted answer: http://stackoverflow.com/a/29669995
has body: I am building a very simple memory game for a small project. The logic is as follows: click on the input field to choose with how many pairs would you like to play create divs with classes card1, card2 etc. clone divs and randomize their place in the array Here is my script (fork in JSFiddle): $(".button").click(function () { // get the value from the input var numCards = parseInt($('input').val()); for (var i = 1; i &lt;= numCards; i++) { // create the cards $(".container").append("&lt;div class='card" + i + " cards'&gt;&lt;/div&gt;") &amp;&amp; $(".card" + i).clone().appendTo(".container"); } // randomize cards in stack var cards = $(".cards"); for (var i = 0; i &lt; cards.length; i++) { var target = Math.floor(Math.random() * cards.length - 1) + 1; var target2 = Math.floor(Math.random() * cards.length - 1) + 1; var target3 = Math.floor(Math.random() * cards.length - 1) + 1; cards.eq(target).before(cards.eq(target2)).before(cards.eq(target3)); } }); what I need now is to adjust the 3rd step, meaning to dynamically create the target vars, and the last line of the code cards.eq(target).before(cards.eq(target2)).before(cards.eq(target3)); So please make me a suggestion - how would you do it? And bare in mind this is a project for beginners. Thank you!
has comment: http://stackoverflow.com/comment/47477793
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29669914
type: Question
has title: Randomize/shuffle cards in stack with jQuery
has comment: http://stackoverflow.com/comment/47477871
tagged with: javascript
has answer: http://stackoverflow.com/a/29670291
score: 0
tagged with: random
answer count: 3

http://stackoverflow.com/comment/47360173
type: QuestionComment
comment on: http://stackoverflow.com/q/29607221
score: 0
has text: Please turn that into a code snippet so those that want to help can evaluate and see the problem as it stands.
type: Comment

http://stackoverflow.com/comment/47459076
type: QuestionComment
has text: Why can't you sort the records on the back-end before displaying them?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29659738

http://stackoverflow.com/comment/47287486
comment on: http://stackoverflow.com/q/29569056
has text: Loop over the array and stop when you find a match.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/29669563
answers question: http://stackoverflow.com/q/29669479
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47477328
upvote count: 2
has body: You will have the password "in memory" anyway, however briefly. The longer it hangs around, the greater the chances of it being sniffed. But, if someone is in the position to sniff passwords out of your memory to begin with, you're already compromised beyond hope. As such it will make little difference whether you keep it around for longer or not. This may or may not say anything about the security of the rest of your AJAX/REST infrastructure, perhaps you shouldn't be using plaintext passwords there to begin with. E.g., move to a token system in which the plaintext password is not needed after initial authentication. But that's too broad to say from the snippet we see.
has comment: http://stackoverflow.com/comment/47477396
type: Answer

http://stackoverflow.com/comment/47485908
has text: Am asking phonegap framework not native code and thank you very much
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29674000

http://stackoverflow.com/comment/47443613
has text: Make `B` accept a callback or return a promise. B has to explictly tell you when it's done.
score: 4
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29651828

http://stackoverflow.com/a/29555494
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47262136
type: Answer
has comment: http://stackoverflow.com/comment/47262020
has body: The issue is not actually that middlewares is undefined. If you had a full stack trace, you'd see that the line that is throwing is actually inside your call to connect().use(). You can't unshift a call to use() onto the middlewares array. Instead, you should just use the middleware generated by bodyParser, like this: middlewares.unshift( bodyParser.urlencoded({ extended: false }), function(req, res, next) { if (req.url !== '/hello/world') return next(); res.end('Hello, world from port #' + options.port + '!'); } );
accepted answer of: http://stackoverflow.com/q/29555005
answers question: http://stackoverflow.com/q/29555005
has comment: http://stackoverflow.com/comment/47262531

http://stackoverflow.com/q/29617471
type: AnsweredQuestion
has title: CSS3/HTML5/JS - How can I create an animated texture background with slide effect?
has body: You may have seen that in some games there's moving background that goes on diagonal. Take a look at this example of Megaman x Storm Eagle Stage https://youtu.be/Wfm3ZvcxOKQ?t=1m33s, the clouds are moving on from up to bottom, right to left (Diagonal). I need to achieve the same effect using CSS3 or any kind of javascript, with a tile texture. Where can I find a tutorial teaching how to make that? I found some, but they are for creating dynamic objects.
type: Question
has answer: http://stackoverflow.com/a/29617709
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29617709
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: css

http://stackoverflow.com/a/29686467
downvote count: 0
type: Answer
score: 3
upvote count: 3
has body: Looks like you just want to generate an array of perfect squares? Perhaps you can do something like this: var squares = [1]; var numSquares = 100; for (var i=3; i&lt;numSquares*2; i+=2) { squares.push(squares[squares.length - 1] + i); } console.log(squares); For people unclear about this algorithm, basically: 1 4 (1+3) 9 (1+3+5) 16 (1+3+5+7) 25 (1+3+5+7+9) Perfect square is essentially the sum of odd numbers
accepted answer of: http://stackoverflow.com/q/29686304
answers question: http://stackoverflow.com/q/29686304
type: AcceptedAnswer

titanium
type: Tag
tags question: http://stackoverflow.com/q/29650561
tag name: titanium
tags question: http://stackoverflow.com/q/29588293
tags question: http://stackoverflow.com/q/29674435
tags question: http://stackoverflow.com/q/29619179

http://stackoverflow.com/q/29569070
has comment: http://stackoverflow.com/comment/47287754
accepted answer: http://stackoverflow.com/a/29569465
tagged with: css
possible better answer: http://stackoverflow.com/a/79184692
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/79184692
score: 1
upvote count: 1
type: Question
answer count: 2
has title: Open popups on specific places of an image?
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29569465
tagged with: http://stackoverflow.com/tag/html
has body: I have an Image in a HTML page. I want to display different information when the mouse is hovering over different areas of that image. For example, I want to display information-1 when the mouse is over point-1 on the image. And when leaving i want the information-1 to hide and when the mouse is hovering over point-2 i want to popup information-2. Is this possible with JS using any kind of library?
favorite count: 0

http://stackoverflow.com/comment/47363125
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29608666
has text: In that case I would suggest maybe not using that plugin as it is obviously badly written.

instantiation
type: Tag
tag name: instantiation
tags question: http://stackoverflow.com/q/29593544

http://stackoverflow.com/q/29674380
tagged with: css
type: AnsweredQuestion
tagged with: jasmine-jquery
type: Question
score: 5
has title: loadStyleFixtures doesn't load css in jasmine tests
upvote count: 5
downvote count: 0
tagged with: javascript
has body: Background is that I'm trying to create a very basic thermostat in javascript and then test it, using jasmine. I want to be able to test that the page loads with certain css (i.e. that the thermostat is the right colour) and then updates it. Tests which check whether the colour is updated pass fine, but the first test to check whether the initial colour is correct does not pass. After stopping the tests in the console, I realised that the css stylesheet isn't being applied on the tests - though it does work on a normal local server. This makes me think that there is some problem with me using loadStyleFixtures to put the css in jasmine. The test looks like this: describe('Display', function(){ beforeEach(function(){ thermostat = new Thermostat(); jasmine.getFixtures().fixturesPath = '.'; loadFixtures('temperature_change.html'); jasmine.getStyleFixtures().fixturesPath = './public/css'; loadStyleFixtures('stylesheet.css'); }); ... it('can start as yellow', function(){ expect($('#temperature').css('color')).toEqual('rgb(255, 255, 0)'); }); The stylesheet looks like this: body { background-color: navy; color: white; } #temperature { color: yellow; } setStyleFixtures('#temperature { color: yellow; }') also doesn't work if added to the beforeEach function. My patch was to use jquery to add css in the beforeEach block instead of requiring the css stylesheet. Any help much appreciated! Edit: The test passes intermittently - not sure what to make of that apart from that perhaps the problem is with my server setup or something.
has answer: http://stackoverflow.com/a/29699695
accepted answer: http://stackoverflow.com/a/29699695
answer count: 1
tagged with: jasmine
favorite count: 0

http://stackoverflow.com/comment/47409829
has text: Without even looking ar your Javascript I would say start by fixing your HTML if that is what it looks like. Is ` ` inside of ` `? And why are you not closing any of your tags (e.g. ` ` needs a ` `).
score: 0
comment on: http://stackoverflow.com/q/29633650
type: Comment
type: QuestionComment

http://stackoverflow.com/a/60748103
answers question: http://stackoverflow.com/q/29632647
score: 3
downvote count: 1
upvote count: 4
has comment: http://stackoverflow.com/comment/127869815
has comment: http://stackoverflow.com/comment/128082380
has body: I read all MDN docs about Web Audio API but I didn't find any global flag on window that shows audio playing. But I have found a tricky way that shows ANY audio playing, no matter an iframe or video but about Web Audio API: const allAudio = Array.from( document.querySelectorAll('audio') ); const allVideo = Array.from( document.querySelectorAll('video') ); const isPlaying = [...allAudio, ...allVideo].some(item =&gt; !item.paused); Now, by the isPlaying flag we can detect if any audio or video is playing in the browser.
has comment: http://stackoverflow.com/comment/115399679
type: Answer

http://stackoverflow.com/q/29544159
upvote count: 1
has body: I am using a third party API to integrate some services into an HTML form I have. To use the API you have to validate a hash value and timestamp for each request. After 30 minutes your hash and timestamp are no longer valid. To avoid an error from the API I decided to use JavaScript and PHP to dynamically set the value each time the form is submitted. This is the PHP file I'm using to generate my hash and timestamp information. &lt;?php if(isset($_REQUEST['action'])){ switch($_REQUEST['action']){ case 'getHash': //Assign your variables the necessary values. $base_url = "";//base_url value goes here. This is the location the request is sent to. $account_id = "";//You must put your account_id here $api_accesskey = "";//You must put your api_accesskey here $success_url = "";//Your success URL goes here $decline_url = "";//your decline URL goes here. $timestamp = time(); //The $hash_string concatenates your three required parameters that //will be hashed. If you are using transparent redirect you must //also add your success and decline URLs. $hash_string = $account_id.",".$api_accesskey.",".$timestamp.",".$success_url.",".$decline_url; //The $hash_value is the variable you will post. $hash_value = hash("sha256",$hash_string); $hash_data = array( 'base_url' =&gt; $base_url, 'account_id' =&gt; $account_id, 'success_url' =&gt; $success_url, 'decline_url' =&gt; $decline_url, 'timestamp' =&gt; $timestamp, 'hash' =&gt; $hash_value, ); $jsonHash = json_encode(array('success'=&gt; true,'data' =&gt; $hash_data), JSON_FORCE_OBJECT); print_r ($jsonHash); break; } } ?&gt; This is the jQuery/JavaScript I am using to request the information for my HTML form and then subsequently submit that information to the third party API. &lt;script&gt; function getPaymentFormInformation(event) { //this is the query string we send to hash.php to get our hash and config information var post_data = {action: "getHash"}; $.ajax({ url: "hash.php", data: post_data, dataType: 'json', type: "GET", succe…
has answer: http://stackoverflow.com/a/29544960
type: Question
has title: jQuery .ajax() GET request not working from firefox. Works with Chrome
has comment: http://stackoverflow.com/comment/47240071
has comment: http://stackoverflow.com/comment/47241049
has comment: http://stackoverflow.com/comment/47240105
linked to: http://stackoverflow.com/q/23802474
tagged with: javascript
has comment: http://stackoverflow.com/comment/47240253
has answer: http://stackoverflow.com/a/29548300
possible better answer: http://stackoverflow.com/a/29544960
answer count: 2
has comment: http://stackoverflow.com/comment/47240322
has comment: http://stackoverflow.com/comment/47241739
has comment: http://stackoverflow.com/comment/47240356
downvote count: 0
score: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/47239956
favorite count: 0
has comment: http://stackoverflow.com/comment/47240383
tagged with: ajax
has comment: http://stackoverflow.com/comment/47245155
has comment: http://stackoverflow.com/comment/47241157
has comment: http://stackoverflow.com/comment/47240301
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29548300
tagged with: php
has comment: http://stackoverflow.com/comment/47239981
has comment: http://stackoverflow.com/comment/47240360
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47241080
has comment: http://stackoverflow.com/comment/47239926
has comment: http://stackoverflow.com/comment/47240970
has comment: http://stackoverflow.com/comment/47240004
has comment: http://stackoverflow.com/comment/47240634

leaflet
tags question: http://stackoverflow.com/q/29656147
type: Tag
tags question: http://stackoverflow.com/q/29666490
tags question: http://stackoverflow.com/q/29624937
tags question: http://stackoverflow.com/q/29663197
tags question: http://stackoverflow.com/q/29615199
tags question: http://stackoverflow.com/q/29595040
tags question: http://stackoverflow.com/q/29531130
tags question: http://stackoverflow.com/q/29552854
tags question: http://stackoverflow.com/q/29639968
tags question: http://stackoverflow.com/q/29593226
tags question: http://stackoverflow.com/q/29535715
tags question: http://stackoverflow.com/q/29679612
tag name: leaflet

http://stackoverflow.com/q/29532807
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47218759
downvote count: 3
has comment: http://stackoverflow.com/comment/47218885
type: Question
has title: ng-hide and ng-show not working Properly
has answer: http://stackoverflow.com/a/29532986
tagged with: javascript
tagged with: jquery
score: -1
has comment: http://stackoverflow.com/comment/47218766
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/47218750
favorite count: 0
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/29532986
upvote count: 2
has body: I want to hide and show depending upon data values. I do not know what's wrong with my code. When I look for the data value by looking at console logs they print " [ ] " My Controller $http.get('/bill/billByPatientId/'+patientData.id) .success(function (data, status, headers, config) { console.log(data); $scope.bills = data; }); My Html Code ng-hide: No Bills! There is no history of bill for this patient ng-show : Bill No Date {{bill.billNo}} My Problem is showing ng-show contents. Please help.

http://stackoverflow.com/comment/47388201
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29621897
has text: You're right, my bad. I thought you meant add an anon. function to the `then()` call, I didn't see that `ready()` was missing one,

http://stackoverflow.com/a/29676584
has body: You can use regular expressions for this: test.replace(/rgb\([^\)]+\)/g, function(rgb) { return rgb2hex(rgb); }); FIDDLE
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29676268
upvote count: 3
score: 3

http://stackoverflow.com/a/29542502
has comment: http://stackoverflow.com/comment/61648636
upvote count: 216
downvote count: 1
has comment: http://stackoverflow.com/comment/68186289
has comment: http://stackoverflow.com/comment/69035789
has comment: http://stackoverflow.com/comment/64342436
has body: Ok, solved my problem, if anyone is passing by here is the answer: Just had to add left: 0, and top: 0, to the styles, and yes, I'm tired. position: 'absolute', left: 0, top: 0,
type: AcceptedAnswer
score: 215
has comment: http://stackoverflow.com/comment/99365488
has comment: http://stackoverflow.com/comment/48019037
has comment: http://stackoverflow.com/comment/103295273
accepted answer of: http://stackoverflow.com/q/29541971
type: Answer
answers question: http://stackoverflow.com/q/29541971

http://stackoverflow.com/q/29644310
type: Question
tagged with: angularjs-directive
has body: I have created simple custom AngularJs directive for this awesome jquery plugin jQuery-Select2 as follows: Directive app.directive("select2",function($timeout,$parse){ return { restrict: 'AC', link: function(scope, element, attrs) { $timeout(function() { $(element).select2(); },200); } }; }); Usage in HTML templates: Select Country It is working as expected and my normal select element is replaced by select2 plugins. However there is one issue though, sometimes it is showing default value i.e Select Country here although in dropdown proper model value is auto selected. Now if I increase $timeout interval from 200 to some high value say 1500, it is working but delays the the rendering of directive. Also I think this is not proper solution for it, as my data is getting loaded via ajax. I have also tried to update directive as follows, but no luck in that either: app.directive("select2",function($timeout,$parse){ return { restrict: 'AC', require: 'ngModel', link: function(scope, element, attrs) { var modelAccessor = $parse(attrs.ngModel); $timeout(function() { $(element).select2(); }); scope.$watch(modelAccessor, function (val) { if(val) { $(element).select2("val",val); } }); } }; }); PS: I know that there is similar module present ui-select, but it requires some different markup in form of , and my App is already fully developed and I just want to replace normal select box with select2. So can you please guide me how can I resolve this issue and make sure that directive keeps in sync with latest behaviour?
possible better answer: http://stackoverflow.com/a/29907956
score: 18
has comment: http://stackoverflow.com/comment/53002064
has answer: http://stackoverflow.com/a/29907956
upvote count: 18
accepted answer: http://stackoverflow.com/a/29979634
downvote count: 0
has answer: http://stackoverflow.com/a/29991126
has comment: http://stackoverflow.com/comment/47909992
tagged with: javascript
has comment: http://stackoverflow.com/comment/47944284
tagged with: jquery
favorite count: 0
tagged with: jquery-select2
tagged with: angularjs
answer count: 5
has answer: http://stackoverflow.com/a/29977775
has comment: http://stackoverflow.com/comment/47432871
has answer: http://stackoverflow.com/a/29979634
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47435606
has answer: http://stackoverflow.com/a/29977313
has title: Angularjs Custom select2 directive
has comment: http://stackoverflow.com/comment/47920497
has comment: http://stackoverflow.com/comment/47920383
has comment: http://stackoverflow.com/comment/47920949

http://stackoverflow.com/a/29596025
score: 2
has body: My thought is to wrap getJSON in another function which stores the URLS in a hashmap/dictionary and stores up promises for each requester Yes, that's a good idea. It might look like this: var debouncedGet = (function() { var pool = {}; return function get(url) { if (!pool[url]) { pool[url] = $.getJSON(url); setTimeout(function() { pool[url] = null; }, 5000); // you might want to move this into a `pool[url].always(…)` callback // so the timer starts when the request returned } return pool[url]; }; }());
upvote count: 2
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/29595179

http://stackoverflow.com/comment/47341471
type: Comment
score: 0
has text: You are the best! Both work like a charm! Second one is more efficient for my needs. Thank you
type: AnswerComment
comment on: http://stackoverflow.com/a/29597383

http://stackoverflow.com/q/29627177
score: 0
answer count: 1
tagged with: angularjs
has answer: http://stackoverflow.com/a/29627397
type: AnsweredQuestion
has body: So I have an input element that allows me to do the following: Filter on Angular $Scope/Array - Works On using the Enter key it appends/pushes to $Scope/Array - Works Identifies a keyword within the string on the input and alerts - Does Not work 3.1 Works if i only type the keyword, example "bguser" 3.2 Does not work if i type more than the keyword, example "Simon Edwards bguser" The array for the keyword is currently defined inline $scope.checkKeyword = function() { var elem = {name: $scope.addName.name}; if (['bguser', 'bgadmin'].indexOf(elem.name) >= 0) { alert(elem.name); } }; but I would like it injected if possible from $scope.keywordlist $scope.keywordlist = [ {name: 'bguser'}, {name: 'bgadmin'}, ]; I need help getting this (3 & 4) to work. I have the following in Fiddle List & Tag {{title}} Name of Item Tag {{ item.name }} {{ item.tag }} JS var bgapp = angular.module('bgApp', []) .directive('ngEnter', function () { return function (scope, element, attrs) { element.bind("keydown keypress", function (event) { if (event.which === 13) { scope.$apply(function () { scope.$eval(attrs.ngEnter, { 'event': event }); }); event.preventDefault(); } }); }; }); bgapp.controller('listController', ['$scope', '$filter', function($scope, $filter) { $scope.title = 'Recent Activity'; $scope.list = [ {name: 'User 1', tag: 'bgUser'}, {name: 'Admin 1', tag: 'bgAdmin'}, {name: 'Service 1', tag: ''}, {name: 'Project 1', tag: ''}, {name: 'Configuration Item 1', tag: ''}, {name: 'Task 1', tag: ''}, {name: 'Incident 1', tag: ''}, {name: 'Issue 1', tag: ''}, {name: 'Known Issue 1', tag: ''}, {name: 'Problem 1', tag: ''}, {name: 'Knowledge Base 1', tag: ''}, {name: 'Update 1', tag: ''}, {name: 'Document 1', tag: ''}, ]; $scope.keywordlist = [ {name: 'bguser'}, {name: 'bgadmin'}, ]; $scope.addItem = function() { var elem = {name: $scope.addName.name}; if ($filter('filter')($scope.list, {name: elem.name}).length == 0) { $scope.list.push( elem ); //alert(elem.name); } }; $scope.checkKeyword …
type: Question
has title: indexOf() need to find a keyword defined in an array within a string
accepted answer: http://stackoverflow.com/a/29627397
tagged with: javascript

http://stackoverflow.com/comment/47441874
comment on: http://stackoverflow.com/a/29651043
type: AnswerComment
score: 0
has text: Which solution is more efficient? replace or substring?
type: Comment

http://stackoverflow.com/a/29594623
score: 4
has body: [How] I can specify which route should handle multipart data and which should not? All of Express' routing methods allow for providing middleware specific to the route. This includes Router methods. app.METHOD(path, callback [, callback ...]) Depending on the body expected for an individual route, you can use different modules to handle each of them (rather than applying them to the entire application with app.use()). var express = require('express'); var app = express(); var http = require('http').Server(app); var bodyParser = require('body-parser'); var busboy = require('connect-busboy'); app.post("/form_data_no_fileupload", bodyParser.urlencoded(), function(req, res, next) { // check that the request's body was as expected if (!req.body) return next('route'); // or next(new Error('...')); // ... }); app.post("/form_data_AND_fileupload", busboy({ limits: { fileSize: 10 * 1024 * 1024 } }), function(req, res, next) { // check that the request's body was as expected if (!req.busboy) return next('route'); // or next(new Error('...')); // ... }); // ... Furthermore, busboy docs says it does not handle GET. So, I'm even more confused how I would parse params in a GET. Busboy and BodyParser are designed for reading in and parsing the request's body, which GET and HEAD requests aren't expected to have. For such requests, parameters can only be passed within the query-string within the URL, which Express parses itself. They're available via req.query. app.get('/get_something', function () { console.log(req.originalUrl); // "/get_something?id=1 console.log(req.query); // { id: "1" } }); req.params represents any placeholders matched in the path by the route. These are available for any route, regardless of the method. app.get('/thing/:id', function (req, res) { console.log(req.originalUrl); // "/thing/2" console.log(req.params); // { id: "2" } });
upvote count: 4
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29594399
has comment: http://stackoverflow.com/comment/47336548
has comment: http://stackoverflow.com/comment/47336532
answers question: http://stackoverflow.com/q/29594399
type: Answer

http://stackoverflow.com/comment/47411656
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29633441
has text: @LukeOwens that is not how cookies work. Cookies are stored client-side, and the cookies for the page are sent on every request to the web server. To save the values server side, you would need a method to save session state using the infrastructure provided by a server-side framework such as ASP.NET
score: 0

http://stackoverflow.com/comment/47416808
type: QuestionComment
comment on: http://stackoverflow.com/q/29637275
score: 0
type: Comment
has text: It will filter the collection working on an instance of previously created jQuery object instead of creating a new one which is basically the optimisation you're looking for.

http://stackoverflow.com/q/29581707
favorite count: 0
type: Question
accepted answer: http://stackoverflow.com/a/29582311
score: 1
has title: Jquery form submit losing form data
answer count: 2
upvote count: 1
tagged with: php
possible better answer: http://stackoverflow.com/a/29581924
has comment: http://stackoverflow.com/comment/47312037
has answer: http://stackoverflow.com/a/29581924
has body: I have this form which is supposed to send the info to the database for a username search. I'm putting together a search function for private servers in our student dormitory. We have a dude with username <lol> and it seems we can't search him. Other usernames search just fine. I'm I missing something? This is the form.php file: Internal IP: Username <input id="UserName" name="UserName" value="<?php if(!empty ($_POST) && isset($_POST['checkThis'])){echo $_POST['checkThis']; } else{}?>" placeholder="admin" class="form-control optional defaultInvalid required_group" type="text"> Search and this is the file.php beginning: <?php echo " "; var_dump($_POST); echo " "; // .... continues but irrelevant since I'm not getting any post data On clicking the button, I get this in browser console: "IpSearch=&UserName=%3Clol%3E&search=doSearch" on #results I get: IpSearch=&UserName=%3Clol%3E&search=doSearch on #checkResult I get: array(3) { ["IpSearch"]=> string(0) "" ["UserName"]=> string(5) "" ["search"]=> string(8) "doSearch" }
tagged with: forms
has answer: http://stackoverflow.com/a/29582311
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/47283302
comment on: http://stackoverflow.com/a/29564820
type: AnswerComment
has text: Thank you, its drop downs now but none of the tabs are showing because it's been covered by the menu for some reason.
score: 0
type: Comment

http://stackoverflow.com/q/29595159
answer count: 3
has answer: http://stackoverflow.com/a/29747802
has body: I have the below Javascript code with Jquery that runs fine in the console of firefox. How can I add this as a unit test in selenium ide and have it compare the output with the expected truth test output? // Get text from account row and determine if text is Ascending or Descending var tdArray = []; $('.sorting_1').each(function(){ $(this).find('strong').each(function(){ tdArray.push(this.textContent); }); }); // ascending check function isSorted(array){ for (var i = 0; i &lt; array.length-1; i++) { if (array[i] &gt; array[i+1]) { return false; } } return true; } isSorted(tdArray);
favorite count: 0
has answer: http://stackoverflow.com/a/45286578
tagged with: selenium-ide
type: UnansweredQuestion
tagged with: selenium
upvote count: 1
score: 1
has answer: http://stackoverflow.com/a/29606603
type: Question
tagged with: firefox
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: How can I have selenium ide run my custom javascript with jquery as it executes in firefox console?

http://stackoverflow.com/q/29571890
type: Question
tagged with: mobile
has comment: http://stackoverflow.com/comment/47294084
tagged with: javascript
score: 0
has title: Open new link in native browser Webapp - Javascript
linked to: http://stackoverflow.com/q/5141910
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47293262
type: UnansweredQuestion
answer count: 0
linked to: http://stackoverflow.com/q/20099784
has body: I have a webapp function in javascript that should open an external link in safari (iOS). Using: window.location.href = "http://stackoverflow.com"; The page is opening in the same window. I'm trying window.open method but nothing happens. I have tried this: window.open( 'https://support.wwf.org.uk/earth_hour/index.php?type=individual', '_blank' // &lt;- This is what makes it open in a new window. ); But it doesn't work. What am I doing wrong?
duplicate of: http://stackoverflow.com/q/5141910
tagged with: web-applications

http://stackoverflow.com/a/29639321
has comment: http://stackoverflow.com/comment/47420681
has comment: http://stackoverflow.com/comment/47421106
has body: Stripped version. $(document).ready(function () { $("#register").click(function () { var name = $("#name").val(); var email = $("#email").val(); var password = $("#password").val(); $.post("register.php", { name1: name, email1: email, password1: password }, function (data) { // check if registration ok location.href = 'index.html'; }); }); });
score: 0
answers question: http://stackoverflow.com/q/29639226
type: Answer

http://stackoverflow.com/comment/47434601
comment on: http://stackoverflow.com/q/29647004
type: Comment
type: QuestionComment
has text: just escape the string correctly.refer http://jsfiddle.net/769gp0nn/
score: 1

http://stackoverflow.com/q/29656147
type: Question
tagged with: turfjs
answer count: 1
linked to: http://stackoverflow.com/q/28867243
tagged with: javascript
has body: I'm trying to create a map where a marker is draggable and it buffer move along. Very similar (almost the same) than what this question is dealing with, the thing in my case is that I'm not using Mapbox.js only plain leaflet. My current code is: //add marker that is draggable var marker = L.marker(new L.LatLng(39.75621, -104.99404), { draggable: true}); //add marker popup marker.bindPopup('This marker is draggable! Move it around to see what locales are in your "area of walkability".'); marker.addTo(map); //remove old buffers (used when marker is dragged) function removeBuff() { map.removeLayer(buff); }; //create buffer (used when the marker is dragged) function updateBuffer() { //Make the marker a feature var pointMarker = marker.toGeoJSON(); //buffer the marker geoJSON feature var buffered = turf.buffer(pointMarker, 1, 'miles'); //add buffer to the map. Note: no "var" before "buff" makes it a global variable and usable within the removeBuff() function. buff = turf.featurecollection([buffered]); L.geoJson(buff).addTo(map); }; marker.on('drag', function () { removeBuff(), updateBuffer() }); updateBuffer(); This give me a buffer and allow me to drag the point and buffer along, however, the all previous buffers stay in the map. I did a few changes in order to substitute the mapbox.js functions from that question so my guess is that this may be the cause.
type: UnansweredQuestion
score: 0
has answer: http://stackoverflow.com/a/29656948
tagged with: leaflet
has title: Drag marker and update Turf.js buffer

http://stackoverflow.com/comment/47332606
type: QuestionComment
has text: Ah okay. Feel free to let me know another way to do that, as it is not working atm anyways
type: Comment
comment on: http://stackoverflow.com/q/29592833
score: 0

http://stackoverflow.com/a/29687242
downvote count: 0
has comment: http://stackoverflow.com/comment/47511531
score: 3
type: Answer
answers question: http://stackoverflow.com/q/29687211
has body: That's because months are zero indexed. So 5 is actually June ;)
upvote count: 3
has comment: http://stackoverflow.com/comment/47511569

http://stackoverflow.com/q/29627623
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29628283
type: Question
score: 0
answer count: 1
tagged with: javascript
tagged with: double-click
tagged with: keyboard
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29628283
has body: I have create a simple game that need to press keyboard buttons exactly follow the step in order to move character. But I cannot figure out how to do it and all I found on the internet is about pressing multiple keyboard buttons in the same time. (set array and use &amp;&amp;) Picture this: you have to press A then, B, C, and D to move character forward, or D,C,B,andA in-order to move back. All of these are not press at the same time, but follow the set. So can someone tell me or give me some clue how to do that? Also, what about pressing button like double click mouse?- is it possible. Thanks in advance.
tagged with: onkeypress
has title: How to Javascript/html5 Input Keyboard in-order set (not in the same time)

http://stackoverflow.com/comment/47438941
score: 0
has text: You forgot a **';'** before _var url_
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29649409

http://stackoverflow.com/comment/47324505
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29588492
has text: like this?
score: 0

http://stackoverflow.com/comment/47354304
has text: as a side note, there is probably a cleaner way to do what this directive is doing in angular without resorting to jquery....
type: Comment
comment on: http://stackoverflow.com/q/29604112
score: 0
type: QuestionComment

infinite-scroll
tag name: infinite-scroll
type: Tag
tags question: http://stackoverflow.com/q/29571578
tags question: http://stackoverflow.com/q/29669545

http://stackoverflow.com/comment/101502926
type: AnswerComment
has text: A bit of explanations is welcome because your code without comments is not very instructing
type: Comment
comment on: http://stackoverflow.com/a/57517416
score: 0

http://stackoverflow.com/comment/54847943
type: QuestionComment
has text: The question is old but if you still need there is an alternative tracking method here https://developers.google.com/analytics/devguides/collection/analyticsjs/
score: 0
comment on: http://stackoverflow.com/q/29559807
type: Comment

http://stackoverflow.com/comment/47285202
score: 1
comment on: http://stackoverflow.com/q/29566358
has text: The icon is called a "hamburger menu" in the UI world. Mmmm, hamburgers......
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29583454
has comment: http://stackoverflow.com/comment/47315281
has comment: http://stackoverflow.com/comment/47315787
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/29583376
downvote count: 0
has body: You need to parse the resulting JSON: var listResults = JSON.parse(xhr.response); Using your example: function audioResults(){ var search = document.getElementById("search").value; var xhr = new XMLHttpRequest(); xhr.open('GET', "https://api.soundcloud.com/tracks?client_id=1dff55bf515582dc759594dac5ba46e9&q=" + search, false); xhr.addEventListener("load", function() { // parse JSON result var listResults = JSON.parse(xhr.response); var sliceResults = listResults.slice(0,9); document.getElementById("results").innerHTML = sliceResults; }, false); xhr.send(); } Search

http://stackoverflow.com/q/29683533
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47508743
tagged with: html-table
tagged with: javascript
favorite count: 0
has body: Could someone explain to me line by line (or reference a link) to help me understand how to export multiple html tables to excel? My original question was: How do you export multiple tables to excel into separate worksheets (but some grouped together)? Ex. Table A,B,C,D. I would like to have A and B in 1 worksheet and C and D in another worksheet and all the worksheets packed together in 1 excel file. I was looking at the other questions on Stack Overflow and found this one question that was similar to my question ("How do I export multiple html tables to excel?" asked by dotnetN00b) The best answer for the question wrote this and the HTML code. I'm having some trouble understanding what each line is doing. If someone could explain it to me or redirect me to a site to help me learn what I need to understand it that would be greatly appreciated! The source of the Javascript and HTML code: How do I export multiple html tables to excel? The Javscript code: var tablesToExcel = (function () { var uri = 'data:application/vnd.ms-excel;base64,' , template = ' <!--[if gte mso 9]> <x:ExcelWorkbook><x:ExcelWorksheets>' , templateend = '</x:ExcelWorksheets></x:ExcelWorkbook> <![endif]--> ' , body = ' ' , tablevar = ' {table' , tablevarend = '} ' , bodyend = ' ' , worksheet = '<x:ExcelWorksheet><x:Name>' , worksheetend = '</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet>' , worksheetvar = '{worksheet' , worksheetvarend = '}' , base64 = function (s) { return window.btoa(unescape(encodeURIComponent(s))) } , format = function (s, c) { return s.replace(/{(\w+)}/g, function (m, p) { return c[p]; }) } , wstemplate = '' , tabletemplate = ''; return function (table, name, filename) { var tables = table; for (var i = 0; i < tables.length; ++i) { wstemplate += worksheet + worksheetvar + i + worksheetvarend + worksheetend; tabletemplate += tablevar + i + tablevarend; } var allTemplate = template + wstemplate + templateend; var allWorksheet = body + …
type: Question
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29699481
score: 0
linked to: http://stackoverflow.com/q/24636956
upvote count: 1
downvote count: 1
answer count: 1
tagged with: excel
tagged with: export-to-excel
has title: Javascript code explanation - export multiple html tables to excel

http://stackoverflow.com/q/29540489
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29540490
has title: Greater than > Less than < inside thymeleaf javascript... Error: The content of elements must consist of well-formed character data or markup
possible better answer: http://stackoverflow.com/a/29540567
upvote count: 14
has answer: http://stackoverflow.com/a/29540567
downvote count: 2
has comment: http://stackoverflow.com/comment/63229990
tagged with: spring
type: AnsweredQuestion
tagged with: java
score: 12
type: Question
tagged with: thymeleaf
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/47233284
favorite count: 0
has answer: http://stackoverflow.com/a/29540490
has body: I get this error when I try to insert &lt; or &gt; operators inside the thymeleaf javascript. My code &lt;script th:inline="javascript"&gt; $(document).ready(function () { ... if(timeRemain &lt; 0){ ... } ... var result = (hours &lt; 10 ? "0" + hours : hours) + ":" + (minutes &lt; 10 ? "0" + minutes : minutes) + ":" + (seconds &lt; 10 ? "0" + seconds : seconds); ... }); &lt;/script&gt; Error message org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup. How can i solve this?

http://stackoverflow.com/comment/47264655
comment on: http://stackoverflow.com/q/29557118
has text: Can you include some html, or a jsfiddle.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47359936
score: 0
type: AnswerComment
has text: i get this: Warning: Invalid argument supplied for foreach() in /opt/lampp/htdocs/IBI/tcpdf/tcpdf.php on line 19515 Warning: Invalid argument supplied for foreach() in /opt/lampp/htdocs/IBI/tcpdf/tcpdf.php on line 19515 Warning: Invalid argument supplied for foreach() in /opt/lampp/htdocs/IBI/tcpdf/tcpdf.php on line 19515 Warning: Invalid argument supplied for foreach() in /opt/lampp/htdocs/IBI/tcpdf/tcpdf.php on line 19515 TCPDF ERROR: Some data has already been output, can't send PDF file
type: Comment
comment on: http://stackoverflow.com/a/29607128

http://stackoverflow.com/comment/47220830
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29533935
score: 1
has text: You say greater than 20 OR smaller than 3. You dont need && (AND) but || (OR) for that

http://stackoverflow.com/comment/47510122
type: QuestionComment
type: Comment
score: 0
has text: You need to provide some sort of context. What does "getting anything" mean? What is the component with the id `fieldID`?
comment on: http://stackoverflow.com/q/29685541

http://stackoverflow.com/q/29555044
has body: Is there a way to register a global onclick listener that will fire anytime an element is clicked? Need to also get the id of that element.
has answer: http://stackoverflow.com/a/63869387
has title: Javascript global onclick listener
tagged with: javascript
score: 22
upvote count: 22
answer count: 3
has answer: http://stackoverflow.com/a/29555241
linked to: http://stackoverflow.com/q/8054429
downvote count: 0
has answer: http://stackoverflow.com/a/29555143
favorite count: 0
possible better answer: http://stackoverflow.com/a/29555241
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47260735
has comment: http://stackoverflow.com/comment/117562892
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29555143
has comment: http://stackoverflow.com/comment/47260745
type: Question

http://stackoverflow.com/comment/47408886
type: Comment
comment on: http://stackoverflow.com/q/29632839
score: 0
has text: @ryanyuyu I'm not sure it belongs on any SE site. It's about programming style, which is opinion-based, and not a good fit for our Q/A model.
type: QuestionComment

http://stackoverflow.com/q/29649705
tagged with: arrays
linked to: http://stackoverflow.com/q/9870526
has answer: http://stackoverflow.com/a/29650798
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29650798
has title: Create divs dynamically for jQuery based memory game
score: 0
tagged with: random
answer count: 1
has body: I am creating a memory game for a small project and my logic is as follows: click on the input field to choose with how many pairs would you like to play create divs with classes card1, card2 etc. clone divs and randomize their place in the array $(document).ready(function () { $(".button").click(function () { // create the cards $(".container").append("&lt;div class='card1 cards'&gt;&lt;/div&gt;") &amp;&amp; $(".card1").clone().appendTo(".container"); $(".container").append("&lt;div class='card2 cards'&gt;&lt;/div&gt;") &amp;&amp; $(".card2").clone().appendTo(".container"); $(".container").append("&lt;div class='card3 cards'&gt;&lt;/div&gt;") &amp;&amp; $(".card3").clone().appendTo(".container"); // randomize cards in stack var cards = $(".cards"); for (var i = 0; i &lt; cards.length; i++) { var target = Math.floor(Math.random() * cards.length - 1) + 1; var target2 = Math.floor(Math.random() * cards.length - 1) + 1; var target3 = Math.floor(Math.random() * cards.length - 1) + 1; cards.eq(target).before(cards.eq(target2)).before(cards.eq(target3)); } }); }); I've created steps 2 and 3 and they work (see JSFiddle), now I want to hook the input up and set the class name of the div dynamically. I guess I would need an array and some dynamically created vars - I tried to do that following these suggestions: jQuery dynamically increment variable name inside a for-loop and How to create dynamic variables using jquery? but I couldn't make it work. So please make me a suggestion - how would you do it? And bare in mind this is a project for beginners. Thank you!
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/19976886
type: Question

http://stackoverflow.com/q/29560727
score: 3
upvote count: 3
tagged with: nicedit
has title: using nicedit textarea value not saving into database using php
type: Question
tagged with: javascript
answer count: 2
has body: Hi in the below code formatting table I am displaying using the nicedit but textarea data was not saving into a database. I want to save the textarea value into database but it's not saving. Can any one help me form this issue. html Final Diagnosis: script new.php $sql = "INSERT INTO discharge_patientcopy( ipd_reg_no,final_diagnosis)values(?,?)"; $sth = $dbh->prepare($sql); $sth->bindParam(1,$ipd_reg_no); $sth->bindParam(2,$final_diagnosis); ($sth->execute()) ? $token="success" : $token = "fail";
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/33457694
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/34382239
tagged with: php

http://stackoverflow.com/q/29609684
accepted answer: http://stackoverflow.com/a/29609903
has body: I'm using an exif reader to extract geo data from a photograph:data.latitude = Number(exif.getTagDescription('GPSLatitude'));I would like the answer to 6 decimal places, so that the output in the console reads 52.629147 instead of 52.62914722222222. Please tell me how to do this? My question is different to Round to at most 2 decimal places in JavaScript because as a newby this question is not in the context of extracting integers - represented as values - from external media; rather it is just simple numbers.
possible better answer: http://stackoverflow.com/a/29609797
has title: outputted data to 6 decimal places
score: 0
answer count: 2
tagged with: jquery
has comment: http://stackoverflow.com/comment/47364901
duplicate of: http://stackoverflow.com/q/11832914
has answer: http://stackoverflow.com/a/29609797
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/11832914
type: Question
has answer: http://stackoverflow.com/a/29609903
tagged with: javascript

http://stackoverflow.com/comment/47466405
type: Comment
type: QuestionComment
has text: that's right. The function being bound to the event is anonymous in block 1.
comment on: http://stackoverflow.com/q/29663483
score: 1

http://stackoverflow.com/a/29653769
score: 0
has body: Start a fadeOut, then load the new img and call fadeIn, which fires on completion of the fadeOut (bg = your element) bg.fadeOut('slow', function () { bg.load(function () {bg.fadeIn();}); bg.attr("src", newbgdrc); });
answers question: http://stackoverflow.com/q/29653629
type: Answer

http://stackoverflow.com/comment/47222314
score: 0
comment on: http://stackoverflow.com/q/29534725
type: Comment
type: QuestionComment
has text: So write a loop that adds ` ` and ` ` elements to the table as many times as needed. What's the problem?

http://stackoverflow.com/q/29539454
tagged with: javascript
answer count: 1
downvote count: 0
tagged with: facebook-javascript-sdk
tagged with: facebook-graph-api
has body: I have an access token, but how do I login via access token using JavaScript? I want to post on my wall even when I am not logged in, using my access token, so I only click a button to post on wall and not need to login again and again. if (response.status === 'connected') { console.log(response.authResponse.accessToken); } How do I process further and login via access token?
has comment: http://stackoverflow.com/comment/47259338
favorite count: 0
type: UnansweredQuestion
tagged with: facebook
upvote count: 1
score: 1
has title: Facebook Login using acess token and offline post through webapp
has answer: http://stackoverflow.com/a/29539595
type: Question
has comment: http://stackoverflow.com/comment/47232165
tagged with: .net
has comment: http://stackoverflow.com/comment/47262987

http://stackoverflow.com/q/29546756
favorite count: 0
has title: How to get free local storage quota?
linked to: http://stackoverflow.com/q/4391575
tagged with: http://stackoverflow.com/tag/html
score: -3
has answer: http://stackoverflow.com/a/29546757
duplicate of: http://stackoverflow.com/q/4391575
type: AnsweredQuestion
downvote count: 3
tagged with: local-storage
has body: How to get the amount of the free quota in my applications local storage? I need to get the remaining storage amount in bytes, kilobytes, megabytes or in percentage. Also it would be nice to get some visual display of how much free quota I have in local storage. Thanks! Edit: Please note that this was "answer your own guestion" style post and therefore I cannot make better guestion. Focus on the answer because the guestion is in the title and there is not much more into that.
type: Question
tagged with: javascript
tagged with: quota
accepted answer: http://stackoverflow.com/a/29546757
upvote count: 0
answer count: 1
tagged with: jquery

http://stackoverflow.com/a/29645255
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29642311
has body: When you have a &lt;select&gt; you can access to the options easily. document.getElementsByTagName('select')[0].options The "options" is an array of all the options in your select, so you can acces to your value this way: document.getElementsByTagName('select')[0].options[0].value You also have a shortcut by doing this: document.getElementsByTagName('select')[0][0].value
type: Answer
downvote count: 0

http://stackoverflow.com/comment/47383181
type: QuestionComment
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29617688
has text: Sweet. In a perfect world, dates would always be stored as UTC, handled as objects, and transported as ISO8601 or similar standard, with time zones and locale formatting only applied when output to user. So good question

http://stackoverflow.com/q/29639845
upvote count: 2
answer count: 2
possible better answer: http://stackoverflow.com/a/29640103
has title: Updating ng-repeat on changes to scope properties not associated with bound data
favorite count: 0
tagged with: angularjs
has body: I'm working on an Angular (1.2.1) app, and I've got a directive with an ng-repeat in the template like so: Show only red items Show only small items something like this in a directive controller: $scope.list = [ { color: 'red', size: 'large' }, { color: 'blue', size: 'small' } //... ] $scope.colorMode = null; $scope.sizeMode = null; $scope.setColorMode = function(value){$scope.colorMode = value;} $scope.setSizeMode = function(value){$scope.sizeMode = value;} $scope.filterList = function(item){ if ($scope.colorMode){ if ($scope.colorMode != item.color) return false; } if ($scope.sizeMode){ if ($scope.sizeMode != item.size) return false; } return true; } colorMode and sizeMode are initialized to null, meaning that all items of all colors and sizes are displayed in the repeat (because both of the conditionals in the filter function evaluate to false, so true is returned). The UI allows the user to filter the list to show only items of a given size and/or color, in which case the appropriate $scope.___mode variable is set to the value given, causing the filter function to check and return false on items whose field values do not match the value given. My problem is that toggling between modes changes variables on the $scope, but it does not change the data that the ng-repeat is bound to. As a result, the filter function isn't re-executed when the mode changes, and the contents of the ng-repeat remain unchanged until something in the data does change. Intuitively, I had expected that, because those $scope fields are used to determine the results of a filter function explicitly mentioned in the ng-repeat, that angular would $watch those values and update on changes to them. Alas, that does not seem to be the case, so I'm left to ask: What's the cleanest way to do what I'm trying to do? I could hack around this by altering something on the data array in my mode setter functions, but (contrary to my simplified example here), the data doesn't belong to the controller - it's …
score: 2
accepted answer: http://stackoverflow.com/a/29640136
type: AnsweredQuestion
downvote count: 0
type: Question
has answer: http://stackoverflow.com/a/29640136
tagged with: javascript
has answer: http://stackoverflow.com/a/29640103

http://stackoverflow.com/comment/47268282
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29558071
type: Comment
has text: That's not in the number itself that I want to have a comma as a decimal separator, of course, but in the HTML string representations of the JS numbers. In some cases, with the use of some UI controls from some libs, I can't explicitly manage the final string representation of this numbers. So, I was naively looking for a possible way to achieve that without having to manage each case unitarily.

http://stackoverflow.com/q/29630624
tagged with: javascript
has title: parallax.js not working correctly
has body: I am trying to put together parallax section scrolling using parallax.js. I cannot seem to get the sections to work correctly. I am following the tutorial they have at http://pixelcog.github.io/parallax.js/ but for some reason my code is not working correctly. Not sure if i'm missing something or if the code it not responding as it should. Can someone shed some light on this issue? my test code is listed at http://gynxprinting.com/test/
answer count: 1
downvote count: 0
tagged with: parallax
favorite count: 0
type: UnansweredQuestion
score: 1
has answer: http://stackoverflow.com/a/29630922
upvote count: 1
type: Question

http://stackoverflow.com/comment/47488859
type: QuestionComment
has text: can't get it. could you post your code to jsFiddle?
comment on: http://stackoverflow.com/q/29659845
score: 0
type: Comment

http://stackoverflow.com/comment/84208874
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29541959
type: Comment
has text: sorry if I am doing something wrong but using `console.log($('table td:not(:empty)').length)` with the above example does not output anything in console @Pointy

http://stackoverflow.com/comment/47233663
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29540457
score: 0
has text: @OmriAharon, the `::` does a bind-once.

http://stackoverflow.com/comment/47409066
type: QuestionComment
comment on: http://stackoverflow.com/q/29633319
has text: answer is - no, you cannot hide this ip, even if you encrypt it - you still will see ip in network log
score: 0
type: Comment

http://stackoverflow.com/q/29630214
type: UnansweredQuestion
tagged with: asp.net-mvc-4
has answer: http://stackoverflow.com/a/29631257
downvote count: 0
has title: How get ActionLink parameters in jQuery dialog
score: 1
type: Question
tagged with: c#
tagged with: asp.net-mvc
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29630532
answer count: 2
upvote count: 1
has body: I am calling jQuery dialog from @Html.ActionLink But I am confused to pass action parameters to jQuery dialog. How to pass them CommunicationLocation and CommunicationType to jQuery dialog? @Html.ActionLink("Delete", "DeleteEmail", null, new { CommunicationLocation = commemail.CommunicationLocation, CommunicationType = "email" }, new { @class = "modalDialog btn btn-success" }) Dialog Div This item will be deleted. Are you sure? JS Controller [HttpPost] public PartialViewResult DeleteEmail(string CommunicationLocation, string CommunicationType) { //Code here }
favorite count: 0
linked to: http://stackoverflow.com/q/901115

http://stackoverflow.com/a/29554313
has body: Well, you could use dojo/store/JsonRest in stead of dojo/store/Memory. If you really need the information to be up to date, then you should probably call "myurl" each time you want to fetch data, so that you don't have to poll the server for changes. If you don't have a RESTful API, and you're not willing to implement your own dojo/store store (which could be a possibility as well), then you might want to look into WebSockets. The problem about your approach is that it's quite network consuming (certainly if there are many clients). It would make a lot more sense if the server could push messages to the client, saying that the database changed and that they have to change their store. This is a similar approach to how platforms like Meteor work, they sync serverside databases (partly) to clientside stores using WebSockets. However, not all browsers support WebSockets (caniuse.com), but most frameworks provide a server+clientside component that can use the same fallback (long polling for example). Take a look at the Real-time Stores article, which explains it a bit further into detail.
accepted answer of: http://stackoverflow.com/q/29546010
has comment: http://stackoverflow.com/comment/47274233
answers question: http://stackoverflow.com/q/29546010
score: 1
has comment: http://stackoverflow.com/comment/47274336
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47273765
type: Answer
upvote count: 1

http://stackoverflow.com/comment/131218198
has text: Getting this error: Cannot read properties of null (reading '1')
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29696050
type: AnswerComment

http://stackoverflow.com/a/29748744
type: Answer
answers question: http://stackoverflow.com/q/29650561
has body: Try this, var productData = [ {Product_Name: 'Apples',Product_Price :50,Product_qty :5}, {Product_Name: 'Banana',Product_Price :40,Product_qty :5}, {Product_Name: 'Carrots',Product_Price :90,Product_qty :5} ]; var tableData = []; for(var i=0;i&lt;data.length;i++){ var tableRow = Ti.UI.createTableViewRow({ title :"Name :"+data[i].Product_Name+" Price : "+data[i].Product_Price, }); tableData.push(tableRow); } var tableView = Ti.UI.createTableView({ data: tableData }); win.add(tableView);
has comment: http://stackoverflow.com/comment/47805705
score: 0
has comment: http://stackoverflow.com/comment/47811576
has comment: http://stackoverflow.com/comment/47809835

http://stackoverflow.com/comment/47451319
has text: receiving no suspicious activity reports would also probably trigger a sniff, as there should be some false positives coming to the server, during "normal" use. while this in no way prevents tampering the client software, it should make it harder to go undetected.
type: Comment
comment on: http://stackoverflow.com/q/29653623
type: QuestionComment
score: 0

http://stackoverflow.com/comment/47474100
comment on: http://stackoverflow.com/q/29667624
type: Comment
type: QuestionComment
has text: Well the main problem is the Base64 value is not being posted to the php script (which is just a normal php mailer script and works fine for all the other values in the form). So the problem lies with the javascript, although i'm still not entirely sure whether my method is the best anyway.
score: 0

http://stackoverflow.com/comment/47383811
score: 0
has text: There are no errors. Absolutely nothing happens.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29619757

http://stackoverflow.com/a/29574577
type: Answer
has body: if( $('#pos-target').hasClass('pos-fixed') === true ) { $('body').addClass('pos-change'); } Here is a https://jsfiddle.net/5p38Lb57/
score: 5
upvote count: 5
accepted answer of: http://stackoverflow.com/q/29574546
answers question: http://stackoverflow.com/q/29574546
has comment: http://stackoverflow.com/comment/47298195
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/47365810
type: AnswerComment
has text: That will not help. I want the input to be visible all the time. All i want its that the input value should only be updated after the submit button is clicked.
type: Comment
comment on: http://stackoverflow.com/a/29610090
score: 0

http://stackoverflow.com/comment/47308882
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29580211
has text: @T.J.Crowder: a simple match as the OP is trying to do.

http://stackoverflow.com/a/29603270
has body: you have check if Sidebar has been moved to Middle Box, if so just stop the sidebar to animate. like this : $(function() { var offset = $("#sidebar").offset(); var boxOffset = $(".middle-block").offset().top; var sidebarHeight = parseInt($("#sidebar").outerHeight()); var topPadding = 15; $(window).scroll(function() { if ($(window).scrollTop() &gt; offset.top) { if(($(window).scrollTop()+sidebarHeight)&lt;boxOffset){ $("#sidebar").stop().animate({ marginTop: $(window).scrollTop() - offset.top + topPadding }); } } else { $("#sidebar").stop().animate({ marginTop: 0 }); }; }); }); check it live here: jsfiddle
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47352453
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/29602787

http://stackoverflow.com/comment/47487236
type: AnswerComment
score: 0
has text: you've mentioned "you will lose a lot of speed" does that mean it'll consume more memory in processing or similar?
type: Comment
comment on: http://stackoverflow.com/a/29674646

http://stackoverflow.com/comment/47428849
comment on: http://stackoverflow.com/q/29643842
type: Comment
score: 0
has text: @UweAllner yes I know both are different as I think it is possible somehow in CSS3.
type: QuestionComment

http://stackoverflow.com/comment/47251077
score: 0
comment on: http://stackoverflow.com/q/29547786
type: Comment
type: QuestionComment
has text: Not sure what your question is. Doesn't your `accum` function work? Or do you really want to write `accum` pointfree?

http://stackoverflow.com/q/29564450
score: 1
has answer: http://stackoverflow.com/a/30528096
favorite count: 0
has title: Summernote tooltips not appearing in a bootstrap Modal window
tagged with: summernote
tagged with: twitter-bootstrap
type: UnansweredQuestion
has body: I am trying to implement the Summernote WYSIWYG editor in a bootstrap modal window. The problem I am getting is that the tooltips on hover do not appear when I do this in a modal. (works fine without modal). What appears to happen is sometimes you can see just behind the modal window there is the edge of the tooltip border, making me think that they are behind the window. I tried targeting the tooltip and changing its Z-index to 9999 but that did not work. Please could you help me figure out where I am going wrong. &lt;!--################### Bootstrap Modals With Forms DESCRIPTION ##########################--&gt; &lt;!-- &lt;button class="btn-u" data-toggle="modal" data-target="#responsive"&gt;Launch Button&lt;/button&gt; --&gt; &lt;div class="modal fade sky-form blackform" data-backdrop="static" id="descriptionform" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt; &lt;div class="modal-dialog"&gt; &lt;div class="modal-content col-md-12" style="min-width:490px;"&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="myModalLabel"&gt;Project Description&lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body" &gt; &lt;div class="row"&gt; &lt;!-- &lt;div class="modal-body"&gt; --&gt; &lt;!-- ################CONTENT FOR MODAL#################### --&gt; &lt;div class="col-lg-12"&gt; &lt;form action="PR_detailsform.php" method="post" id="projdescription"&gt; &lt;input type="hidden" name="idkey" value="&lt;?php echo $Pkey; ?&gt;"&gt; &lt;input type="hidden" name="catx" value="&lt;?php echo $cat; ?&gt;"&gt; &lt;input type="hidden" name="navx" value="&lt;?php echo $nav; ?&gt;"&gt; &lt;div class="form-group"&gt; &lt;label for=""&gt;Edit&lt;/label&gt; &lt;textarea name="details" id="summernote" rows="10" class="form-control"&gt;&lt;?php echo $projectdetail; ?&gt;&lt;/textarea&gt; &lt;/div&gt; &lt;button style="background:#72c02c;c…
tagged with: css
has answer: http://stackoverflow.com/a/53469263
upvote count: 1
type: Question
tagged with: bootstrap-modal
tagged with: javascript
answer count: 2
downvote count: 0

http://stackoverflow.com/comment/47297638
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29574358
has text: You can store the data in cookies.
score: 0

http://stackoverflow.com/q/29569782
answer count: 1
accepted answer: http://stackoverflow.com/a/29569898
favorite count: 0
has body: I'm making a game in JavaScript and I want to change te text color. This is a part of the code: if (game.active) { this.damageCountry(otherLost, country); } battle.sendMessage("You have failed to " + game.normalizeCountryName(country) + " conquer", "" + game.normalizeCountryName(country) + "'s losses: "+ Math.round(otherLost).commafy() + " your losses: " + Math.round(lost).commafy()); I want to change the text color of battle.sendMessage. this.sendMessage = function(title, message){ $(".battle").show(); $(".battle>h1").first().html(title); $(".battle>p").first().html(message); this.title = title; this.message = message;
score: -4
has comment: http://stackoverflow.com/comment/47289111
has comment: http://stackoverflow.com/comment/47289160
has comment: http://stackoverflow.com/comment/47289057
type: AnsweredQuestion
has title: JS set font color
has comment: http://stackoverflow.com/comment/47289177
has comment: http://stackoverflow.com/comment/47289102
has answer: http://stackoverflow.com/a/29569898
has comment: http://stackoverflow.com/comment/47290062
type: Question
downvote count: 4
upvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47289225

http://stackoverflow.com/a/29552284
has body: A slightly different approach utilizing Date and slice: function msToTime(milliseconds) { var date = new Date(milliseconds); return date.toTimeString().slice(3,8); } msToTime(184213); // outputs: "03:04" A small caveat is this will of course have a limit of "23:59" and will always be the floor value as any milliseconds value over the minutes will not be shown.
score: 1
accepted answer of: http://stackoverflow.com/q/29552177
answers question: http://stackoverflow.com/q/29552177
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1

http://stackoverflow.com/comment/115506350
has text: This is awesome, was looking for this exact answer for a while.
type: Comment
comment on: http://stackoverflow.com/a/29646410
score: 0
type: AnswerComment

http://stackoverflow.com/q/29626471
has body: I'm trying to create web app which communicates via SIP protocol on PBX asterisk. I'm also using jquery library sipjs.com. In all browsers calling via webrtc works, except of safari. Is there a chance that safari doesn't support calling via webrtc? If not, is there a way how to do it possible for safari? Thank you very much for your help.
upvote count: 0
tagged with: webrtc
answer count: 1
has answer: http://stackoverflow.com/a/29663614
tagged with: javascript
favorite count: 0
has title: Calling via webrtc in safari doesn't work
has comment: http://stackoverflow.com/comment/47415560
accepted answer: http://stackoverflow.com/a/29663614
downvote count: 1
tagged with: safari
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47396129
score: -1
type: Question

http://stackoverflow.com/q/29536220
downvote count: 3
upvote count: 1
has body: for(var j=0; j&lt;product.image_groups[0].images.length; j++){ console.log("images in json" + product.image_groups[0].images[j].link) } This product.image_groups[0].images[j].link returns a a URL for example: http://images.domain.com/is/image/domain/hbeu50274296_021_11 http://images.domain.com/is/image/domain/hbeu50274296_021_10 http://images.domain.com/is/image/domain/hbeu50274296_021_21 Within the loop I want to save only the URL that ends in _21 into a variable not sure how I would do this. I guess with a regex but how exactly?
favorite count: 0
has answer: http://stackoverflow.com/a/29536592
has answer: http://stackoverflow.com/a/29536290
has answer: http://stackoverflow.com/a/29536428
tagged with: regex
answer count: 4
type: AnsweredQuestion
has title: loop through json object and check if URL ends in certain value
type: Question
has comment: http://stackoverflow.com/comment/47225375
has answer: http://stackoverflow.com/a/29536282
score: -2
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/29536282
accepted answer: http://stackoverflow.com/a/29536290

http://stackoverflow.com/comment/47549513
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29615324
score: 0
has text: Negative, I have a series of JS files that are "merged" using **grunt-contrib-concat**. Each one of these files is wrapped in it's own `$(document).ready(function(){});` and (in some cases) other events like `$(window).load(function(){});` and `$(window).resize(function(){});`. So, I needed to (at the very beginning of the merged file) have `page = $(body).attr('id');`, and at the very end of the "merged" file, a series of functions that are used in all of these various files. So something at the very beginning, and something at the end. So, is the '**wrap**' option what I should use?

http://stackoverflow.com/q/29655795
tagged with: javascript
has title: Limiting scope of variable within for loop on recursive function
answer count: 1
downvote count: 0
score: 1
favorite count: 0
tagged with: scope
has answer: http://stackoverflow.com/a/29656000
type: AnsweredQuestion
has body: I have a recursive function and I'm trying to create an array which will be different for each "thread" created by a for loop within the recursion. I have an example below. In the initial pass of the function, the variable ids is undefined. I set it to be an empty array, and push the id passed into the function onto that array. In the example, this makes the ids array equal [2]. The for loop in the function recursively calls the function provided id is greater than 0. In the first pass of the for loop, recursiveFunction is called with (2-1,[2]); This call sees that ids is not undefined, and adds 1 to the array making the array [2,1]. This 2nd pass of the function executes the for loop only once calling recursiveFunction(1-1,[2,1]). We now enter the 3rd pass of the function, which appends zero to the array so the array is now [2,1,0]. This ends the first run of the for loop in the first run of the function. We are now back to the second run of the for loop in the original call of the function. When we left it, the array ids was [2], however, when we log it, we can see that the recursion has affected the content of the array. This makes sense as the recursion affects the array as it's hoisted. I am trying to find a way to avoid this, so that when recursing finishes, the first time the ids array is [2,1,0] and the second time it's also [2,1,0]. Currently, it's [2,1,0] then [2,1,0,1,0]. Is what I'm trying to do possible? Perhaps there's a workaround I should be considering. This is the code. outerFunction = function recursiveFunction (id,ids) { if (typeof ids === 'undefined') { ids = []; } ids.push(id); for(var i=0;i&lt;id;i++) { recursiveFunction(id-1,ids); } if (id === 0) { console.log('id is zero and ids is: ' + ids); } } outerFunction(2); This is the fiddle: http://jsfiddle.net/hzLm4rbq/
upvote count: 1
type: Question
tagged with: recursion
accepted answer: http://stackoverflow.com/a/29656000

http://stackoverflow.com/a/29678823
answers question: http://stackoverflow.com/q/29678566
has body: Errors: You have space between the src text 'music/Sleep Away.mp3'; and code be var audioElement = document.createElement('audio'); $('#Next').click(function(){ audioElement.pause(); audioElement.setAttribute('src', 'music/Sleep_Away.mp3'); audioElement.addEventListener("load", function() { audioElement.play(); }, true); });
upvote count: 1
has comment: http://stackoverflow.com/comment/47495868
score: 1
downvote count: 0
type: Answer

http://stackoverflow.com/comment/47382485
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29618827
score: 0
has text: Also, I need to find the elements (the array) INSIDE a form, not inside the document; the user might have more than one form (different ID each) opened. I have not been able to find form methods that will find elements by name; but I am trying as of now. If my SPA were only 1 document, that would work; but any number of identical forms (with different data) can be opened at any one time.

http://stackoverflow.com/a/29565314
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29565196
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29565196
has comment: http://stackoverflow.com/comment/47280347
type: Answer
has body: Why not just check for the property? tempArray[i] = {Name: 'foo', Data: 'bar'} if(tempArray[i].name) { //do stuff }

http://stackoverflow.com/a/29661650
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29661029
has comment: http://stackoverflow.com/comment/47463390
type: Answer
accepted answer of: http://stackoverflow.com/q/29661029
has body: selection is a Selection object. When cast to string, either by appending an empty string ("") or using String.toString(), this object is the text selected. This does not work with inputs or textareas.
score: 0

http://stackoverflow.com/comment/47295338
type: QuestionComment
comment on: http://stackoverflow.com/q/29550019
has text: To finish describing what happened here - In Javascript ES5 and below, variables are scoped to a function, not to a block (ES6 has block scoped variables declared with `let` when it arrives in browsers) so when you assigned to the `socket` variable, you were overwriting the argument of the same name even though you thought you were declaring a new variable with `var socket`. That was not a new variable, but was referring to the same variable as the argument named `socket`.
score: 0
type: Comment

http://stackoverflow.com/comment/47230683
comment on: http://stackoverflow.com/a/29538882
type: Comment
score: 0
type: AnswerComment
has text: That's also possible if you want to call it like that. You can change changeColor to have multiple methods such as toYellow or toBlue. With this, simply initialize it as {} then add functions to the object.

http://stackoverflow.com/a/29564549
upvote count: 1
has comment: http://stackoverflow.com/comment/47278722
downvote count: 1
has comment: http://stackoverflow.com/comment/47279027
has comment: http://stackoverflow.com/comment/47278886
has body: Float your divs div { width: 100px; height: 100px; border: 1px solid black; display: inline-block; float: left; }
score: 0
answers question: http://stackoverflow.com/q/29564476
has comment: http://stackoverflow.com/comment/47278939
type: Answer

http://stackoverflow.com/q/29564383
favorite count: 0
tagged with: angularjs
has title: angularjs Click button to show next / previous div
accepted answer: http://stackoverflow.com/a/29570753
type: AnsweredQuestion
has body: I have a stack of Divs created with ng-repeat. Plunker Quick Image: Is it possible to create this stack of div work like a slider? Like: if I press Next button Top div will slide away and 2nd top will show. pressing Previous button will show previous div if there any. Code: {{value.keys}} Previous Next It will really help me if this is possible.
type: Question
has comment: http://stackoverflow.com/comment/47290118
score: 4
has comment: http://stackoverflow.com/comment/47278857
has comment: http://stackoverflow.com/comment/47290427
upvote count: 4
has answer: http://stackoverflow.com/a/29570753
has comment: http://stackoverflow.com/comment/47287081
answer count: 1
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47286418

http://stackoverflow.com/q/29569878
linked to: http://stackoverflow.com/q/9618504
has comment: http://stackoverflow.com/comment/47289634
accepted answer: http://stackoverflow.com/a/29569915
has body: I can not figure out how to get the value of a radio button. I've tried everything except the right way. Here is an example here OK, the first switch may not be the right way to use the switch stateemnt, although I like doing it this way since it is easy to read and add new options. Alert statements display true or false. So then I tried an if statement. This did not work. Ok, maybe I must type out everything. Nope, this did not work either. Maybe it needs a numeral? Nope. String? Nope. So I tried another switch. Nope again. Can someone give me the proper way to do this please? function commitData() { switch (true) { case document.getElementsByName('StatusOnHeader')[0]: alert('Edit'); break; case document.getElementsByName('StatusOnHeader')[1]: alert('Add'); break; default: alert('XXX'); break; } if (document.getElementsByName('StatusOnHeader')[0]) { alert("TRUE"); } else { alert("FALSE"); } if (document.getElementsByName('StatusOnHeader')[0] == true) { alert("TRUE"); } else { alert("FALSE"); } if (document.getElementsByName('StatusOnHeader')[0] == 1) { alert("TRUE"); } else { alert("FALSE"); } if (document.getElementsByName('StatusOnHeader')[0] == '1') { alert("TRUE"); } else { alert("FALSE"); } switch (document.getElementsByName('StatusOnHeader')[0]) { case true: alert('Edit'); break; case false: alert('Add'); break; default: alert('XXX'); break; } }
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47398588
has comment: http://stackoverflow.com/comment/47289335
has comment: http://stackoverflow.com/comment/47289382
tagged with: javascript
has title: How to get the value of a radio button with javascript
has answer: http://stackoverflow.com/a/29570987
possible better answer: http://stackoverflow.com/a/29569964
has comment: http://stackoverflow.com/comment/47289246
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/29569964
has answer: http://stackoverflow.com/a/29569915
has comment: http://stackoverflow.com/comment/47289887
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/29552832
has answer: http://stackoverflow.com/a/29552909
has comment: http://stackoverflow.com/comment/47256969
downvote count: 1
has comment: http://stackoverflow.com/comment/47257117
has comment: http://stackoverflow.com/comment/47256867
type: UnansweredQuestion
tagged with: global-variables
has comment: http://stackoverflow.com/comment/47257015
has comment: http://stackoverflow.com/comment/47256887
has comment: http://stackoverflow.com/comment/47256921
tagged with: javascript
has comment: http://stackoverflow.com/comment/47256912
favorite count: 0
has comment: http://stackoverflow.com/comment/47257071
has comment: http://stackoverflow.com/comment/47256924
type: Question
has comment: http://stackoverflow.com/comment/47257000
has answer: http://stackoverflow.com/a/29552937
has body: var setAge = function (newAge) { this.age = newAge; }; var bob = new Object(); bob.age = 30; bob.setAge = setAge; bob.setAge(50); Basically, the code starts with a method that changes an age property, then the method is followed by a "bob" object, and finally there's a code that uses the method to change bob's property (age). I have two questions about: bob.setAge = setAge; (the second to last line in the code) By setting setAge equal to bob.setAge, doesn't this set setAge to a global variable, equalling bob.setAge? In bob.setAge, bob is the variable, and setAge is the method. I thought that when writing out something like bob.setAge, the word that comes before the period references the object (susan.age), and the word that comes after the period references a property (susan.age). How does javascript recognize that the setAge in bob.setAge references a method and not a property?
has title: When dealing with methods in Javascript, why is this not setting a global variable?
has comment: http://stackoverflow.com/comment/47257042
has comment: http://stackoverflow.com/comment/47257002
score: 0
has comment: http://stackoverflow.com/comment/47256916
answer count: 2
upvote count: 1

http://stackoverflow.com/comment/47386575
has text: seems to work fine https://jsfiddle.net/slash197/xyv5k4p6/
type: Comment
score: 2
comment on: http://stackoverflow.com/q/29621205
type: QuestionComment

http://stackoverflow.com/comment/47477918
type: QuestionComment
has text: So there is no element with id `HiddenValue` in you document. Do you know about the buildin developer tools of Browsers like Firefox and Chrome? Use them.
comment on: http://stackoverflow.com/q/29669744
score: 0
type: Comment

http://stackoverflow.com/a/29646188
has body: I second herrlocks´s comment. You should include the sap.ui.layout-library and arrange those two elements into a layout object of your choice[1]. Then, you return the single layout object, which is containing your name and password input objects, instead. [1] https://sapui5.netweaver.ondemand.com/sdk/#docs/api/symbols/sap.ui.layout.html
answers question: http://stackoverflow.com/q/29558180
score: 0
type: Answer

http://stackoverflow.com/q/29647247
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I'm facing a problem regarding gracefully resizing a set of buttons on a web page. My problem in detail: I have a set of buttons which are part of a unordered list. Eg: Now the problem is that the right div in each of the buttons has dynamic content, fetched from AJAX and updated on some user action. The content fetched from AJAX is variable in length across the butttons. I want to maintain that ultimately all buttons have the same height and width after the content is loaded. I tried determining the max-height and width and then using jQuery to set that. But its very cumbersome and jittery because for some cases number of buttons is very high and multiple AJAX calls are required to fetch content for all buttons. Then I have to resize after every batch. Can someone suggest a neat way to do it, which would not be too obvious for the user and not degrade the user-experience for the web-page. Should I use animations to resize it?
has comment: http://stackoverflow.com/comment/47437545
type: Question
has answer: http://stackoverflow.com/a/29649007
tagged with: javascript
score: 0
has title: Uniformly Resizing a set of Buttons after they are reloaded with dynamic content
tagged with: user-interface
answer count: 1
tagged with: jquery
type: UnansweredQuestion

http://stackoverflow.com/comment/47462001
has text: Or that. That would be better. :-)
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29661186
type: AnswerComment

http://stackoverflow.com/comment/47487052
comment on: http://stackoverflow.com/a/29667718
score: 0
type: AnswerComment
has text: I wrote it like this, but it still won't work. ` $(document).ready(function isFutureDate(idate) { var today = new Date().getTime(), idate = idate.split("/"); idate = new Date(idate[2], idate[1] - 1, idate[0]).getTime(); return (today - idate) < 0 ? true : false; }); `
type: Comment

http://stackoverflow.com/comment/47437961
score: 0
type: Comment
type: QuestionComment
has text: What do you mean overlap? It is within the #p1 I am trying to hide... Putting it somewhere else does not change anything though...
comment on: http://stackoverflow.com/q/29648982

http://stackoverflow.com/q/29651844
tagged with: rubaxa-sortable
downvote count: 0
answer count: 1
has body: I am using this plugin: https://github.com/RubaXa/Sortable I want to make the list undraggable when the user clicks the button. From the github page, it seems that I can use disable:trueto do so but how do I make it work on button click? I have tried: Sortable.create(simpleList, { $('#button').click(function () { disable: true, }) }); But it makes the undraggable to begin with. Non-working Demo: http://jsfiddle.net/880auLx8/ Working Demo: http://jsfiddle.net/880auLx8/1/
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: Make list undraggable on button click Sortable.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29652187
upvote count: 1
tagged with: draggable
accepted answer: http://stackoverflow.com/a/29652187
type: Question
tagged with: jquery-ui
score: 1

http://stackoverflow.com/comment/47505553
has text: What is the alertbar style? Because top property not affect all display elements.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29684215

http://stackoverflow.com/q/29544371
accepted answer: http://stackoverflow.com/a/29544436
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29544510
has answer: http://stackoverflow.com/a/43261167
has answer: http://stackoverflow.com/a/33470127
linked to: http://stackoverflow.com/q/10359907
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/35350289
possible better answer: http://stackoverflow.com/a/41452260
has answer: http://stackoverflow.com/a/41452260
score: 111
duplicate of: http://stackoverflow.com/q/10359907
tagged with: javascript
has body: I've been looking and haven't found a simple question and answer on stack overflow looking into finding the average of an array. This is the array that I have const grades = [80, 77, 88, 95, 68]; I first thought that the answer to this problem would be something like this: let avg = (grades / grades.length) * grades.length console.log(avg) However, this gave me an output of NaN. So then I tried this: for (let grade of grades) avg = (grade / grades.length) * grades.length console.log(avg) This gave me an output of 68. (I'm not sure why). So with this I have two questions. 1. Why was my output 68? and 2. Could somebody help me out with actually finding the average of an array?
upvote count: 112
has answer: http://stackoverflow.com/a/29544442
tagged with: arrays
has title: Finding the average of an array using JS
has answer: http://stackoverflow.com/a/43974885
favorite count: 0
has answer: http://stackoverflow.com/a/29544436
answer count: 9
has answer: http://stackoverflow.com/a/37506838

http://stackoverflow.com/a/39907661
has body: I too got stuck, the documentation simply says "Define your table in common code" -- all very true, but equally important is that both the server and client must have access to your collection. So I found, define all my collections in a single file creating a 'lib/collections.js' to worked well for me, so I knew were they existed and as I refactored I didn't loose track of when they loades, so I would have something like: export const idpoll = new Mongo.Collection('idpool'); export const otherCollection = new Mongo.Colletionc('myOtherCollectin'); Then anywhere else in my code that if i needed that collection i just imported it: import { idpoll } from './lib/collections.js' //ie. path to collections.js In my project I have multiple tables, thus I decided to create a lib/init-tables.js file export let TabularTables = {}; Meteor.isClient &amp;&amp; Template.registerHelper('TabularTables',TabularTables); Then for each table I have a lib/myNameTable.js file along with initial settings. import { TabularTables } from './init-tables.js'; // Import TabularTables helper import { idpoll } from './collections.js'; TabularTables.Regs = new Tabular.Table({ name: 'IDPOL', collection: idpol, columns: [ {data: 'field', title: 'fieldtitle'},line'}, ... ] });
type: Answer
answers question: http://stackoverflow.com/q/29666029
score: 0

http://stackoverflow.com/comment/47364009
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29608902
score: 0
has text: @JacqueGoupil is it possible to show what needs to be modified or corrected to make it work correctly ?

http://stackoverflow.com/q/29664603
has answer: http://stackoverflow.com/a/29664638
has comment: http://stackoverflow.com/comment/47468578
has comment: http://stackoverflow.com/comment/47468516
linked to: http://stackoverflow.com/q/19590865
possible better answer: http://stackoverflow.com/a/29664638
has answer: http://stackoverflow.com/a/29664648
tagged with: foreach
type: AnsweredQuestion
duplicate of: http://stackoverflow.com/q/19590865
tagged with: http://stackoverflow.com/tag/json
type: Question
has comment: http://stackoverflow.com/comment/47468722
answer count: 2
tagged with: arrays
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29664648
score: 0
has comment: http://stackoverflow.com/comment/47468485
has body: I want to fetch a property list from a json array. below is json array [ { treeName: 'tree_A', prefix: 'prefix' }, { treeName: 'tree_b', prefix: 'prefix1/' } ] After running code, my expectation result is ["tree_A","tree_B"]; Below is my implementation: var treeNames = []; for (var index = 0; index &lt; config.treeSources.length; index++) { treeNames.push(config.treeSources[index].treeName); } I want to find a best implementation to make code beautiful.. any one want to play it?
tagged with: lodash
has title: what is the best way to fetch property list from json array

http://stackoverflow.com/q/29562505
accepted answer: http://stackoverflow.com/a/29582018
type: Question
has body: I'm using jcarousel for loading search results from multiple words in separate sliders. When i click on the next button 6 elements are added to my slider, but the slider doesn't scroll until another click is made. Where is the problem ? var runSearchCarousel = function(){ var carousel = jQuery('.row-wrap').jcarousel({vertical: false, animation: 'fast', visible: 4, wrap: 'last'}); return carousel; }; var searchCarouselMore = function(){ jQuery('.search-row').on('click', '.next-b', function(){ var $this = jQuery(this), id = $this.attr('id').substring('rightArrow-'.length), container = jQuery('#slider_' + id), containerPosition = container.parent().parent().find('#rowPosition-' + id).val(), lastLi = container.find('li.gridWrap').filter(':last'), carousel = container.parent(), lastSku = lastLi.attr('id').substring('product-'.length); $this.jcarouselControl({ carousel : carousel, target : '+=4' }); jQuery.ajax({ type: 'get', url : '/ajax/_fetchMultiSearch.php', data: { toFetch: 6, containerPosition: containerPosition, lastSku: lastSku }, cache: false, success: function(response){ container.append(response); uiResize(); carousel.jcarousel('reload'); } }); });
has title: jCarousel ajax load on next button
downvote count: 0
answer count: 1
tagged with: javascript
score: 1
tagged with: jquery
favorite count: 0
tagged with: ajax
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29582018
tagged with: jcarousel
upvote count: 1

http://stackoverflow.com/q/29640060
type: Question
tagged with: javascript
tagged with: jquery
has body: I have faced problem with tracking click position, when it is over iframe which is cross-domain. My code is right now: &lt;div class="poin"&gt; &lt;iframe width="640" height="360" src="http://cross_domain" frameborder="0" allowfullscreen id="video"&gt;&lt;/iframe&gt; &lt;/div&gt; and JS: $('.poin').bind("mousemove", function(e) { console.log("x:" + e.pageX + ", y:" + e.pageY); }); This one code, doesn't show anything when moving over iframe window, but when moving on window showing everything. And as well I tried on mousedown and mouseup on iframe onmousedown="$(this).addClass(point)" onmouseup="$(this).removeClass(point)" .point{ pointer-events:none; } but pointer-events:none disallows click, so moving over iframe works, but when user clicking nothing happens. Maybe you have some ideas how to do such thing to track mouse click on iframe window?
has answer: http://stackoverflow.com/a/29640252
linked to: http://stackoverflow.com/q/28096880
tagged with: cross-domain
tagged with: http://stackoverflow.com/tag/html
answer count: 1
type: UnansweredQuestion
score: 0
tagged with: iframe
has title: catch click position in iframe cross-domain
has comment: http://stackoverflow.com/comment/47422316

http://stackoverflow.com/comment/47384726
comment on: http://stackoverflow.com/q/29620306
score: 1
has text: Please add something more..
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29686368
score: 1
type: Answer
has body: You can do something like this var code = document.getElementById("code"); code.value = code.value.replace(/\b(function\s*(?:[\w.]+)?)\s+\((.*?)\)\s*{/g,function(match,p1,p2) { if (p2.length) { return match + "console.info('test2 ::: arg1, arg2:', p1, p2);" } else { return match + "console.info('other contents');" } }) If your arguments are simple values*, you can do something like this var code = document.getElementById("code"); code.value = code.value.replace(/\b(function\s*(?:[\w.]+)?)\s+\((.*?)\)\s*{/g,function(match,p1,p2) { if (p2.length) { var ParamsCount = p2.split(",").length; var ParamString = [] for (p=0;p&lt;ParamsCount;p++) { ParamString[p] = "'Arg" + p + ": ' + " + "arguments[" + p +"]" } return match + "console.log(" + ParamString.join(", ") + ")" } else { return match + "console.info('other contents');" } }) Because it does a rudimentary split based on a comma, arguments with nested commas would cause problems.. like function foo(bar(1,2),"sample") { or function foo("hey, that's cool") would each screw up the arguments. Regex Explanation `\b` # Token: \b (word boundary) `(` # Opens CG1 `function` # Literal function `\s*` # Token: \s (white space) # * repeats zero or more times `(?:` # Opens NCG `[\w.]+` # Character class (any of the characters within) # Token: \w (any alpha or numeric character) # Any of: . # + repeats one or more times `)?` # Closes NCG # ? repeats zero or one times `)` # Closes CG1 `\s+` # Token: \s (white space) # + repeats one or more times `\(` # Literal ( `(` # Opens CG2 `.*?` # . denotes any single character, except for newline # * repeats zero or more times # ? as few times as possible `)` # Closes CG2 `\)` # Literal ) `\s*` # Token: \s (white space) # * repeats zero or more times `{` # Literal { JSFiddle (demo of both, just uncomment the single commented return): http://jsfiddle.net/rg23LL0p/
answers question: http://stackoverflow.com/q/29669407
upvote count: 1
downvote count: 0

http://stackoverflow.com/comment/47283611
type: Comment
type: QuestionComment
has text: probably not simple. Both plugins would have there own submit event handlers.
comment on: http://stackoverflow.com/q/29566417
score: 0

http://stackoverflow.com/a/29535653
has comment: http://stackoverflow.com/comment/47224332
has body: Re your update The problem is that in the ajax success callback, this doesn't refer to the element anymore. Two ways to fix that, and a third way that will be available in ES6: Assign this, or more usefully $(this), to a variable that you use in the success handler (and elsewhere, no need to constantly call $() repeatedly on the same element): function UpdateTotals() { var input = $(this); // &lt;========== Save it here // ... $.ajax({ // ... success: function (result) { // ... if (result.Success == 'true') { input.attr("data-id", result.Id); // &lt;========= Use it here alert("Saved! " + result.Id.toString()); } else { alert("Failed"); } } }); // ... } Use Function#bind (an ES5 feature, but it can be shimmed for really old browsers) to make this within the callback the same as this outside it: function UpdateTotals() { // ... $.ajax({ // ... success: function (result) { // ... if (result.Success == 'true') { $(this).attr("data-id", result.Id); alert("Saved! " + result.Id.toString()); } else { alert("Failed"); } }.bind(this) // &lt;=========== Note }); // ... } In ES6, we'll have arrow functions, which unlike normal functions inherit the this of the context in which they're created. So in ES6, you could do this: // **ES6 ONLY** function UpdateTotals() { // ... $.ajax({ // ... success: (result) =&gt; { // &lt;==== Arrow function syntax // ... if (result.Success == 'true') { $(this).attr("data-id", result.Id); alert("Saved! " + result.Id.toString()); } else { alert("Failed"); } } }); // ... } I'd lean toward #1, because you're doing a lot of repeated $(this) anyway, so just as well to do var input = $(this); once and then use input throughout. More about this on my blog: You must remember this Original answer pre-update: Since you're using jQuery, you set an attribute with attr, like this: $(this).attr("data-id", 5); Live Example: var input = $("input"); snippet.log("Before: " + input.attr("data-id")); input.attr("data-id", 5); snippet.log("After (jQuery): " + input.a…
score: 3
has comment: http://stackoverflow.com/comment/47225149
has comment: http://stackoverflow.com/comment/47224275
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47225167
type: Answer
accepted answer of: http://stackoverflow.com/q/29535605
has comment: http://stackoverflow.com/comment/47225067
answers question: http://stackoverflow.com/q/29535605
upvote count: 3

http://stackoverflow.com/comment/47504233
score: 0
has text: There is no color `$orange`, it is `orange`
comment on: http://stackoverflow.com/q/29683227
type: QuestionComment
type: Comment

http://stackoverflow.com/a/29570740
score: 0
type: Answer
has body: You gave your constructor's prototype a .valueOf() function that returns the val property. That function is what's consulted by the operation of the + operator. When neither operand is a string, the innards call an internal "ToNumber" function to get the operand values. That, in turn, will try the valueOf function on object values if it exists. In your case, it does.
answers question: http://stackoverflow.com/q/29570706

http://stackoverflow.com/comment/47442157
has text: Then I'm not really sure. I copied/pasted your code into a userscript and it worked for me (after setting `top` and `left` to `0` in the `style` attribute).
type: QuestionComment
comment on: http://stackoverflow.com/q/29648180
type: Comment
score: 0

http://stackoverflow.com/comment/47494611
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29678489
has text: WordPress is loading it into almost the same area of the page as it was before. It is in the page footer.

http://stackoverflow.com/q/29561441
type: AnsweredQuestion
type: Question
has title: How do I get the Kendo editor to update from angular $scope
has body: I have the following code. html JS angular.module('SplashApp', ['ngRoute', 'kendo.directives', 'ngSanitize']) .controller("MainController", function ($scope, $location, $route, $http, $sce) { $scope.html = " Kendo Editor \n\n" + " Note that 'change' is triggered when the editor loses focus.\n" + " That's when the Angular scope gets updated. "; }); When the page renders it is fine. If the user updates the page it also makes the changes to $scope.html. BUT if I change the $scope.html from javascript the contents of the editor do not change. How do I get this to occur?
accepted answer: http://stackoverflow.com/a/29562336
tagged with: javascript
tagged with: kendo-ui
score: 0
answer count: 1
tagged with: angularjs
has answer: http://stackoverflow.com/a/29562336

http://stackoverflow.com/q/29616170
upvote count: 3
has answer: http://stackoverflow.com/a/29616402
has body: Edit 04/15 The answers I've gotten so far explain the difference between service/factory/ and provider, but that doesn't really get at what I'm confused about. AngularJS documentation asserts that all three are essentially the same code "under the hood". But if that's the case, why can I only pass a "provider" into a configuration block, as opposed to a "factory"? Original Question: According to the documentation for Providers: The most verbose, but also the most comprehensive one is a Provider recipe. The remaining four recipe types — Value, Factory, Service and Constant — are just syntactic sugar on top of a provider recipe. That gives me the impression that all services are also providers. But I'm currently dealing with a problem using the $window service in my app's configuration block, and came across this bit of documentation: Module Loading &amp; Dependencies A module is a collection of configuration and run blocks which get applied to the application during the bootstrap process. In its simplest form the module consist of a collection of two kinds of blocks: Configuration blocks - get executed during the provider registrations and configuration phase. Only providers and constants can be injected into configuration blocks. This is to prevent accidental instantiation of services before they have been fully configured. Which implies there's a distinction between a provider and a service that's more fundamental than a service recipe simply being "syntactic sugar" over the provider recipe. What's the deal?
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/15666048
has comment: http://stackoverflow.com/comment/47377673
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has title: Are services a subset of providers, or no?
score: 3
has answer: http://stackoverflow.com/a/29616320

http://stackoverflow.com/comment/47468398
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29664416
type: Comment
has text: now I placed your previous fiddle version script. It shows big or small checkbox depends on the name of the checkbox as i wanted. But the function is not working. The function suppose to show different background image upon the state of the checkbox.

http://stackoverflow.com/comment/47473695
has text: Thanks for your reply Adarsh. My question was on how to implement functionality to rate a video , can comment, provide share options for embeded video. It should be almost replica of actions provided in YouTube. (https://i.sstatic.net/ZUUpu.png)
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29667181

http://stackoverflow.com/q/29612036
has body: I want to share the div width from an iframe to the parent page. in parent Im using: var mysize = function(size) { console.log(size); } In the iframe, I have this: &lt;div id="loadzone" style="display: inline-block;"&gt; content &lt;/div&gt; $(document).ready(function() { parent.mysize($('#loadzone').width()); }); The problem is that, I'm receiving the size of the iframe width and not real div width from the iframe. Thanks for your help.
has title: How to send the div width from an iframe to the parent page
type: Question
tagged with: width
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29612127
tagged with: iframe

http://stackoverflow.com/comment/47411890
comment on: http://stackoverflow.com/a/29634319
type: Comment
has text: @johndoe: No, it has nothing to do with scope. The value of `this` usually depends on how the function is *called*. `.bind` ensures that `this` will always refer to the passed value, no matter how the function was called. Learn mode about `this`: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this
score: 0
type: AnswerComment

http://stackoverflow.com/a/29668061
downvote count: 0
answers question: http://stackoverflow.com/q/29667500
score: 2
upvote count: 2
type: AcceptedAnswer
has body: getElementsByName is not defined for form-elements. The most compatible way should be: if (!form[0].elements.slite) { // add &lt;input name="slite"&gt; to form[0] }
type: Answer
accepted answer of: http://stackoverflow.com/q/29667500

http://stackoverflow.com/q/29658087
possible better answer: http://stackoverflow.com/a/29658175
has comment: http://stackoverflow.com/comment/47455952
tagged with: javascript
has answer: http://stackoverflow.com/a/29658152
has body: In JavaScript does a function become a method when added as a property on an object, or is it the invocation of a function against an object that makes it a method?
has comment: http://stackoverflow.com/comment/47455944
has answer: http://stackoverflow.com/a/29658319
has comment: http://stackoverflow.com/comment/47455931
type: AnsweredQuestion
favorite count: 0
type: Question
accepted answer: http://stackoverflow.com/a/29658152
has answer: http://stackoverflow.com/a/29658175
score: 0
has title: In JavaScript when does a function become a method?
answer count: 3
has comment: http://stackoverflow.com/comment/47455962
upvote count: 1
tagged with: methods
downvote count: 1

http://stackoverflow.com/comment/47295397
type: AnswerComment
has text: Yup, the DB listens to connections over TCP/IP and this user is authorized to connect from any IP. When I tested locally, the DB was still remote (credentials, table, invocation, all being the same) and it worked. And yeah, my lambda uses max timeout.
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29572188

http://stackoverflow.com/q/29634149
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47410656
has comment: http://stackoverflow.com/comment/47410639
score: -3
has comment: http://stackoverflow.com/comment/47410637
has body: I want to hide the browser popup that shows up when I hover my images that have alt attribute. I need this attribute to still be on the html pages, so it's indexed by Google, but I don't want users to see it when they hover the image. Does anybody know how to do this? Thank you!
type: AnsweredQuestion
upvote count: 0
type: Question
accepted answer: http://stackoverflow.com/a/29634207
has title: Hide img alt tag on image hover in Javascript?
tagged with: javascript
downvote count: 3
has answer: http://stackoverflow.com/a/29634207

http://stackoverflow.com/comment/47365897
comment on: http://stackoverflow.com/q/29609876
has text: To be more clear, I will make them fill an anounymous survey form.. and I just want to know if they filled it or not, if not I will resend the email. No illegal use.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29595533
has comment: http://stackoverflow.com/comment/47337983
type: Question
has comment: http://stackoverflow.com/comment/47337990
has comment: http://stackoverflow.com/comment/47337965
has comment: http://stackoverflow.com/comment/47337922
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/47338092
has body: I have this: $('select').change(function (evt) { checkSelectAllOthers($(this).attr('id'), optionValues); optionValues = $('option:selected', this).map(function () { return this.value; }).get(); }).trigger('change'); function checkSelectAllOthers(select, optionValues) { if ($("#" + select + " option").length == 1) { return; } var allValue = 'All'; var allOption = $("#" + select + " option:not([value])"); var otherOptions = $("#" + select).find("option[value!='0']", " option:not([value])"); var newOptionValues = $('option:selected', $("#" + select)).map(function () { return this.value; }).get(); if ($.inArray(allValue, optionValues) != $.inArray(allValue, newOptionValues)) { //The 'All' option is clicked if ($(allOption).is(":checked")) { $(otherOptions).each(function () { $(this).attr('selected', true); }); $("#" + select).multiselect({ selectedList: 1100 }); $("#" + select).multiselect('refresh'); } else { $(otherOptions).each(function () { $(this).attr('selected', false); }); $("#" + select).multiselect({ selectedList: 1000 }); $("#" + select).multiselect('refresh'); } } else { var selectSize = $("#" + select + " option").length; if (optionValues.length == selectSize &amp;&amp; newOptionValues.length == selectSize - 1) { //deselect 'All' $(allOption).attr('selected', false); $("#" + select).multiselect({ selectedList: 1000 }); $("#" + select).multiselect('refresh'); } else if (newOptionValues.length == selectSize - 1) { //all other options are selected so set 'All' as selected $(allOption).attr('selected', true); $("#" + select).multiselect({ selectedList: 1100 }); $("#" + select).multiselect('refresh'); } } } The above code get all the selects in the page and if "All" checkbox is selected, it will select all checkboxes. It works but when the 'select' variable is null or undefined, there is an error in the console in developer tools which is: Uncaught Syntax error, unrecognized expression: #jquery.js:869 jQuery.extend._Deferred.deferred.resolveWithjquery.js:420 jQu…
answer count: 0
type: UnansweredQuestion
has title: issue with jquery 'select' variable change
has comment: http://stackoverflow.com/comment/47338035

http://stackoverflow.com/q/29637463
accepted answer: http://stackoverflow.com/a/29637485
possible better answer: http://stackoverflow.com/a/29637686
answer count: 2
has answer: http://stackoverflow.com/a/29637686
tagged with: unicode
favorite count: 0
upvote count: 4
has title: Why do web sites replace unicode chars with images?
has comment: http://stackoverflow.com/comment/47417158
type: AnsweredQuestion
downvote count: 0
type: Question
has body: Recently I installed the NoScript plugin in firefox to control the execution of javascript. I noticed that some websites use some fancy unicode charaters as place holders for images, which are replaced with images once I allow javascript. One example site is github.com, see the screenshot which was taken before I enabled javascript. What's the advantage of this instead of simply place the image directly in html or css?
tagged with: javascript
has answer: http://stackoverflow.com/a/29637485
score: 4

binary-tree
tag name: binary-tree
type: Tag
tags question: http://stackoverflow.com/q/29584487

http://stackoverflow.com/comment/47415457
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29636570
has text: Work with `data: { promo : promo}`. Thanks!

http://stackoverflow.com/comment/47308277
type: QuestionComment
has text: Yes, I mistyped. The {async: false} property is not deprecated, but synchronous ajax requests are deprecated in latest versions of both Chrome and Firefox since they generally suck from a UX perspective, so you shouldn't use them.
score: 0
comment on: http://stackoverflow.com/q/29578676
type: Comment

http://stackoverflow.com/a/29558089
has comment: http://stackoverflow.com/comment/47276463
type: Answer
has body: Once force is started, source and target values got replaced with corresponding node objects. So instead of comparing link sources with node index, compare it with the node. if (link.source == nodes[nde] || link.target == nodes[nde]) { newLinks.push(link) } Or if (link.source.index == nde || link.target.index ==nde) { newLinks.push(link) } Updated JSFiddle Note: the values of the source and target attributes may be initially specified as indexes into the nodes array; these will be replaced by references after the call to start. This is the sample structure of a node. { fixed: 0, index: 12, label: "I am an information label", px: 287.64956227452404, py: 83.71383910494417, weight: 7, x: 287.7214898272057, y: 83.59069881862021 } d3.select(".node").data() will return you the data associated with that node, where node is the class name. You can refer more about d3 force layout from here.
has comment: http://stackoverflow.com/comment/47269508
has comment: http://stackoverflow.com/comment/47271022
has comment: http://stackoverflow.com/comment/47273930
score: 0
has comment: http://stackoverflow.com/comment/47267151
has comment: http://stackoverflow.com/comment/47270633
has comment: http://stackoverflow.com/comment/47274358
has comment: http://stackoverflow.com/comment/47279756
has comment: http://stackoverflow.com/comment/47275262
has comment: http://stackoverflow.com/comment/47266704
has comment: http://stackoverflow.com/comment/47276377
has comment: http://stackoverflow.com/comment/47270784
answers question: http://stackoverflow.com/q/29557623
has comment: http://stackoverflow.com/comment/47275784
has comment: http://stackoverflow.com/comment/47270112
has comment: http://stackoverflow.com/comment/47277160
has comment: http://stackoverflow.com/comment/47275199

http://stackoverflow.com/comment/47395634
type: QuestionComment
has text: @ jcubic How to do that? please can you give a hint?
comment on: http://stackoverflow.com/q/29626097
score: 0
type: Comment

http://stackoverflow.com/comment/47500181
has text: There are ways to do this in javascript usings CSS or a canvas. However I'm not sure it compatible with three.js. http://stackoverflow.com/questions/8912917/cutting-an-image-into-pieces-through-javascript
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29678510
type: Comment

http://stackoverflow.com/q/29614547
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29614614
has comment: http://stackoverflow.com/comment/47374565
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/47374581
type: AnsweredQuestion
has body: Here is my html Player: I have tried both of the following methods and the form won't clear on a page refresh. $('searchform')[0].reset(); var form = document.getElementById("searchform"); form.reset();
score: 0
type: Question
has title: Search form is not resetting , what is wrong here?
has answer: http://stackoverflow.com/a/29614614

http://stackoverflow.com/comment/47384791
type: Comment
has text: I include this but not working. , can you tell me library url ?
comment on: http://stackoverflow.com/a/29620135
score: 0
type: AnswerComment

http://stackoverflow.com/q/29554076
has answer: http://stackoverflow.com/a/29554117
accepted answer: http://stackoverflow.com/a/29554109
has comment: http://stackoverflow.com/comment/47259627
tagged with: javascript
answer count: 6
has answer: http://stackoverflow.com/a/29554155
has comment: http://stackoverflow.com/comment/47259427
has body: I have the following html: When I run the following code in jquery: $(function () { var span = $("name"); $("#one").append(span); $("#two").append(span); }); The span is added only to the last div: name I'd expect it to be added to the both divs, why it's not?
linked to: http://stackoverflow.com/q/6605640
linked to: http://stackoverflow.com/q/11673609
has comment: http://stackoverflow.com/comment/47259556
has comment: http://stackoverflow.com/comment/47259469
tagged with: jquery
has title: why doesn't jquery insert created span into two divs?
favorite count: 0
has answer: http://stackoverflow.com/a/29554114
possible better answer: http://stackoverflow.com/a/29554116
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29554116
type: AnsweredQuestion
score: 0
has answer: http://stackoverflow.com/a/29554109
upvote count: 1
has answer: http://stackoverflow.com/a/29554227
downvote count: 1
type: Question

http://stackoverflow.com/a/29609596
has comment: http://stackoverflow.com/comment/47365074
has comment: http://stackoverflow.com/comment/47365130
type: AcceptedAnswer
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/29609490
has body: Try adding a slash at the beggining of the url where you are performing the request in order to make it relative to your script: $(document).ready(function(){ $(".a img").click(function(){ $.get("/text_file.txt", function(x, y){ $(".a").after(x); }); }); });
answers question: http://stackoverflow.com/q/29609490

http://stackoverflow.com/comment/47248333
has text: The best way to do this would be to follow the Ember conventions and let your route provide the markers to a controller and use a component that takes those markers and displays them in the map.
comment on: http://stackoverflow.com/q/29546664
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/29625037
has body: Is it possible to transition the items in an flexbox? When you click I want all items to collapse except the one that is clicked. The one that is clicked should use all available space from the container. // only works once! $(".item").click(function() { $(".item").not(this).each(function() { $(this).addClass("collapse"); }); }); html, body { width: 100%; height: 100%; margin: 0; padding: 0; border: 0; overflow: hidden; } .container { flex-grow: 1; flex-shrink: 0; flex-basis: auto; display: flex; flex-direction: column; height: 100%; } .item { flex-grow: 1; flex-shrink: 1; flex-basis: auto; transition: all 2s; } .collapse { flex-grow: 0; } a b c d JSFiddle: http://jsfiddle.net/clankill3r/L8hktsgn/
tagged with: css-animations
has answer: http://stackoverflow.com/a/29625471
tagged with: flexbox
has comment: http://stackoverflow.com/comment/47393593
answer count: 4
type: UnansweredQuestion
tagged with: css
has title: Can I transition the flex-grow of a flex box to produce an animation?
has answer: http://stackoverflow.com/a/50696424
score: 41
has answer: http://stackoverflow.com/a/29625258
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/134978312
type: Question
upvote count: 41
has answer: http://stackoverflow.com/a/29625177
has comment: http://stackoverflow.com/comment/70775835
tagged with: javascript

http://stackoverflow.com/comment/47259053
comment on: http://stackoverflow.com/a/29554066
type: Comment
has text: how do i know that the user is visiting which page?i want to add this to my ajax request this sound good.
score: 0
type: AnswerComment

http://stackoverflow.com/q/29543985
downvote count: 1
has title: Trim method and .length() Javascript
score: -1
type: Question
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47239597
has body: I'm doing the Magpie Chatbot AP Computer Science Lab, and I'm trying to determine whether the user is typing a message or just putting a space and pressing return using the .trim() method. The code is: String response = ""; statement= statement.trim(); if(statement.length() &lt; 0) { response = "Please say something :)"; } statement is the user inputted statement, response is what the chatbot outputs. Can anyone help me figure this out?
tagged with: javascript
tagged with: string-length
has answer: http://stackoverflow.com/a/29544317
favorite count: 0
tagged with: trim
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47239667

http://stackoverflow.com/comment/107361157
type: AnswerComment
has text: @AlexanderZakusilo: sir above exaple working correctly if i call watchPostion function inside pause event function is not fire,can u tell me sir why function not fire?
type: Comment
score: 0
comment on: http://stackoverflow.com/a/44719041

http://stackoverflow.com/q/29647150
upvote count: 5
tagged with: javascript
has answer: http://stackoverflow.com/a/29647801
has title: How to fetch Input Class value from querySelectorAll
has comment: http://stackoverflow.com/comment/47435544
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has comment: http://stackoverflow.com/comment/47435745
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/29647801
has body: I am new to this want to select following Class value in the querySelectorAll. &lt;input class="btn-primary" type="submit" value="Share" data-li-auto-click-utrki="y=SHARE&amp;u=reShareButton&amp;n=reShareUpdate"&gt; Thanks
type: AnsweredQuestion
type: Question
score: 5
has comment: http://stackoverflow.com/comment/47435420

http://stackoverflow.com/comment/47367319
type: Comment
type: QuestionComment
has text: Click the "eye" icon in the CSS pane, done.
score: 1
comment on: http://stackoverflow.com/q/29610521

http://stackoverflow.com/comment/47396349
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29621959
type: Comment
has text: Thanks buddy ! (now it's time for the jump, struggling to make my character jump and move at the same time, if you have any ideas i'll take) :)

http://stackoverflow.com/comment/47339533
has text: You're welcome. Took me ages to find that code when I first went looking. Funny how the most important and powerful commands are always the hardest to learn about. Just in case you need it, `location.reload()` reloads the page.
comment on: http://stackoverflow.com/a/29595600
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47268477
comment on: http://stackoverflow.com/q/29557911
type: Comment
type: QuestionComment
score: 1
has text: Use `script.addEventListener('load', function () { console.log('Now the script should be loaded and ready to go') })`.

http://stackoverflow.com/q/29626778
has answer: http://stackoverflow.com/a/29627231
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47396669
has title: Basic understanding of functions and declarations in javascript
has body: I lack some fundamental understanding in function and variable declaration in javascript and am struggling to really understand it. I have this function "urlParam" which I place in a general file ('reusable.js') to be reused: (function (ko, $) { var urlParam = function (name, w) { w = w || window; var rx = new RegExp('[\&amp;|\?]' + name + '=([^\&amp;\#]+)'), val = w.location.search.match(rx); return !val ? '' : val[1]; } })(ko,jQuery); Then I have a viewModel where I want to access this function, placed in a file 'viewmodel.js': ViewModel = function(){ var userId = urlParam("UserId"); }; In my view.html I include both files and then, after the html, I bind the view model to the view with: ko.applyBindings(new ViewModel()); This cause an reference error: ReferenceError: urlParam is not defined However if I place the urlParam-function outside the (function (ko, $) {})(ko, jQuery); declaration it works perfectly. What does this (function () {})(); do really?
tagged with: mvvm
favorite count: 0
linked to: http://stackoverflow.com/q/8228281
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/47396727
score: 1
has answer: http://stackoverflow.com/a/29626901
tagged with: knockout.js

http://stackoverflow.com/q/29597580
accepted answer: http://stackoverflow.com/a/29597708
has comment: http://stackoverflow.com/comment/47341805
tagged with: dom
upvote count: 4
has title: Can the root element HTML in the DOM be replaced in javascript
has comment: http://stackoverflow.com/comment/135425924
has comment: http://stackoverflow.com/comment/135425861
downvote count: 0
answer count: 1
tagged with: javascript
score: 4
favorite count: 0
linked to: http://stackoverflow.com/q/8830839
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29597708
has body: I am a beginner in javascript. As mentioned in stack overflow query, I can remove or create elements within the DOM. However, can I replace the root element through javascript e.g. if I want to change an attribute of the HTML element through javascript?
type: Question
type: AnsweredQuestion

http://stackoverflow.com/comment/47404825
score: 0
comment on: http://stackoverflow.com/a/29630443
has text: Seems like the only possible currently.
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/47467001
has text: Your code doesn't "print another table below the original". It just adds a row to the table.
type: Comment
comment on: http://stackoverflow.com/q/29663817
score: 1
type: QuestionComment

http://stackoverflow.com/q/29667493
has comment: http://stackoverflow.com/comment/47473959
has comment: http://stackoverflow.com/comment/47473778
answer count: 3
has answer: http://stackoverflow.com/a/29667617
upvote count: 1
has comment: http://stackoverflow.com/comment/47473731
tagged with: javascript
has answer: http://stackoverflow.com/a/29667826
type: UnansweredQuestion
has body: My code is such: switch(typeof src) { case 'string': case 'boolean': return String(src).toLowerCase().indexOf(value.toLowerCase()) &gt; -1; case 'object': return true; default: return false; } but code checker say that: n unconditional "break" statement shall terminate every non-empty switch-clause will it be right and normal if I will write it so? switch(typeof src) { case 'string': case 'boolean': return String(src).toLowerCase().indexOf(value.toLowerCase()) &gt; -1; break; case 'object': return true; break; default: return false; // in default i need it or not? } or I missed somewhat else?
has comment: http://stackoverflow.com/comment/47473744
has title: JavaScript: right switch-case statement
has comment: http://stackoverflow.com/comment/47474180
downvote count: 0
has answer: http://stackoverflow.com/a/29667786
score: 1
favorite count: 0
type: Question

http://stackoverflow.com/q/29638527
downvote count: 1
type: Question
tagged with: for-loop
tagged with: splice
has title: Splicing Array Based on For Loop Iteration
tagged with: arrays
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/29638625
favorite count: 0
has comment: http://stackoverflow.com/comment/47419351
has body: I am trying to take an array ('selectedWorkshops'), and move objects in it to 'registeredWorkshops'. Then, I also want to remove those objects from both 'selectedWorkshops' and another array simply called 'workshops'. See my codepen here: http://codepen.io/trueScript/pen/wBVqNN Arrays: var workshops = [ { name: 'apples', WorkshopId: '19' }, { name: 'oranges', WorkshopId: '3b' }, { name: 'pears', WorkshopId: 'x6' }, { name: 'pineapples', WorkshopId: '55' }, { name: 'watermelons', WorkshopId: '8v' } ]; var selectedWorkshops = [ { name: 'oranges', WorkshopId: '3b' }, { name: 'watermelons', WorkshopId: '8v' }, { name: 'pears', WorkshopId: 'x6' } ]; var registeredWorkshops = []; Function that is supposed to move workshops to 'registeredWorkshops' and remove them from 'selectedWorkshops' and 'workshops': flipWorkshops = function(){ var numberOfWorkshops = selectedWorkshops.length; var X = 1; for(var i = 0; i &lt; numberOfWorkshops; i++ ){ registeredWorkshops.push(selectedWorkshops[i]); for(var j = 0, arrayLength = workshops.length; j &lt; arrayLength; j++) { var selectedWorkshop = selectedWorkshops[i]; var originalWorkshop = workshops[j]; if(selectedWorkshop == originalWorkshop){ var matchingWorkshop = j; workshops = workshops.splice(j, 1); selectedWorkshops = selectedWorkshops.splice(i, 1); } } } }; flipWorkshops(); Why aren't the objects being properly spliced out of the 'workshop' and 'selectedWorkshops' arrays like they should be? What am I doing wrong?
type: AnsweredQuestion
tagged with: object
upvote count: 1
accepted answer: http://stackoverflow.com/a/29638625

http://stackoverflow.com/q/29597988
tagged with: javascript
has comment: http://stackoverflow.com/comment/47342599
tagged with: jquery
has comment: http://stackoverflow.com/comment/47342716
has comment: http://stackoverflow.com/comment/47342769
tagged with: session-storage
score: 0
has comment: http://stackoverflow.com/comment/58408480
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47343265
linked to: http://stackoverflow.com/q/10929337
answer count: 0
has title: firefox not storing $window.sessionStorage
type: Question
has body: I have firefox 38.0 beta version. everything was working fine. yesterday i updated it standard release which was 37.0.1. Now in my application i am using the following code. $window.sessionStorage.setItem("LoggedInUser", JSON.stringify(data)); it is giving me error that Error: The operation is insecure. i am using angularjs. if i surround it with try catch then the error is gone but var not set in sessionStorage. i debugged it and noticed that sessionStorage is undefined. Anyone can guide me? i tried reverting back to beta version but still same issue. I am using firebug to see the session storage. i also installed FireStoragePlus plugin to watch sessionStorage variables. jsfiddle added. image with error added.
tagged with: firefox

http://stackoverflow.com/q/29684512
has answer: http://stackoverflow.com/a/29684794
answer count: 3
score: 5
has answer: http://stackoverflow.com/a/29690477
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/47507018
upvote count: 5
tagged with: angularjs
has body: We have a directive as part of our large single page app. We use the same directive in multiple places on the page and each time it acts and looks exactly the same. The main issue we are seeing is that this directive has an ng-repeat which creates a few hundred DOM elements. Is it possible to create a directive that acts as a singleton? I.e. only has one watch on the collection rather than a watch every time the directive is used or caches the creation of DOM elements to improve speed. Or is there a better way of using the same DOM elements multiple times in the same page. I've been thinking about using a custom ng-repeat that will cache the html created and reuse it, would this be the best approach?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29685531
type: Question
has title: Is it possible to create a directive that acts as a singleton?
tagged with: javascript

http://stackoverflow.com/a/72008574
answers question: http://stackoverflow.com/q/29549836
downvote count: 0
type: Answer
score: 1
upvote count: 1
has body: The following code will be helpful in a simple way let n = parseInt(readLine()); let sum = n*(n+1)/2; console.log(sum);

http://stackoverflow.com/comment/63152837
score: 1
comment on: http://stackoverflow.com/a/29537379
type: AnswerComment
type: Comment
has text: @EdwardD'Souza You're absolutely correct! My answer is to show how it should be defined and used. The way the askers code is setup does not work for the thing he/she would like to which is why the need for a keyed object is required.

http://stackoverflow.com/comment/47476716
type: QuestionComment
type: Comment
score: 1
has text: Scrollbar is logical but the response on right click in Chrome (alerting before showing menu) seems odd.
comment on: http://stackoverflow.com/q/29667186

http://stackoverflow.com/a/29684085
upvote count: 1
has body: You're dealing with an infinite loop error. jQuery(".searchSubmit").on("click",function(){...}) //Click handler (part1) This callback function will run any time an element with the class searchSubmit is clicked Inside that function (what is run when it is clicked) you do: jQuery(".hide.searchSubmit").click(); //Click trigger (part2) Which then triggers part1, which then fires part2, etc etc etc To fix this you can either restructure how you're handling this functionality, use completely different classes for different states, or just change the .click() line to: if(jQuery(this).hasClass("hide") === false) { jQuery(".hide.searchSubmit").click(); } (or something to that effect)
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29683951
answers question: http://stackoverflow.com/q/29683951
type: Answer
score: 1

http://stackoverflow.com/a/29601659
has comment: http://stackoverflow.com/comment/47350863
type: Answer
answers question: http://stackoverflow.com/q/29601608
has comment: http://stackoverflow.com/comment/47350591
has comment: http://stackoverflow.com/comment/47350649
score: 0
has body: This is not JSON, but Javascript as a text string that you want to evaluate. You will want to use the eval(jsontext) function, but I would highly discourage this as it is a very risky function as it executes the script with the privileges of the caller. It is also a bad idea for performance reasons. If at all possible, define your function in the script itself instead of as a string! See here.

http://stackoverflow.com/comment/47493306
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29677918
has text: What value are you looking to retrieve? The inner divs only have text in them.
score: 0

http://stackoverflow.com/q/29589575
favorite count: 0
downvote count: 0
answer count: 5
has answer: http://stackoverflow.com/a/29589641
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/29589707
possible better answer: http://stackoverflow.com/a/29589616
has answer: http://stackoverflow.com/a/29589627
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/29589669
has body: I have a hidden field with some values, I have to append these values in HTML table.The number of columns in table is fixed. I have appended successfully,but after first row,it should append data in new row,instead it is appending in the same row. This is how I am doing $("#btntbl").click(function () { debugger var tabl = $("#testTable"); var vals = $("#txthidden").val(); for (var i = 0; i &lt; vals.split(";").length; i++) { for (var j = 0; j &lt; vals.split(";")[i].split(",").length; j++) { tabl.append("&lt;td&gt;" + vals.split(";")[i].split(",")[j] + "&lt;/td&gt;"); } } }); Also note that some users dont have value of disabled column JS Fiddle How can I add new row each time clicking the button?
has answer: http://stackoverflow.com/a/29589616
tagged with: javascript
tagged with: jquery
has title: JS Append Row in HTML Table
accepted answer: http://stackoverflow.com/a/29589641

http://stackoverflow.com/q/29542572
downvote count: 0
has comment: http://stackoverflow.com/comment/47242581
tagged with: jquery
favorite count: 0
has title: highlighting characters in text depending on position of page
has answer: http://stackoverflow.com/a/29544808
has body: I have a text on my website that scrolls horizontal through the page. I’m trying to get around 8 characters highlighted in black, while the rest is grey. But those characters are meant to vary as you scroll though, the highlighted bit should remain in place. In case this doesn’t make any sense, if grey was an x, it should look something like this: xxxxx xpsum dolox xxx xxxx xxxx xxsum dolox sxx xxxx xxx xxxum dolox six xxxx x xx xxxxm dolox sit xxxx xx I’m trying to get this done in jQuery, but I can’t get it to work. I also like to say that I’m not at all an expert in webdesign, so I don’t know what I’m doing. Anyway, I’ve tried two different approaches, one is to say “change colour of text when going over an underlying div”. The other approach is to change the colour of the text depending on the scrolling position, but the problem here is that it takes the scrolling position of the whole div, instead of a fixed position on the page. Both don’t work at the moment, examples are here: jsfiddle 9p29tz2f jsfiddle 9p29tz2f/1 If anyone has any ideas how to approach this, or needs some more clarification, please let me know. Many thanks!
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47242512
tagged with: css
type: AnsweredQuestion
score: 2
upvote count: 2
type: Question
accepted answer: http://stackoverflow.com/a/29544808
has answer: http://stackoverflow.com/a/29543041
has answer: http://stackoverflow.com/a/29544020
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29543041
answer count: 3
has comment: http://stackoverflow.com/comment/47237310

http://stackoverflow.com/a/29660634
type: AcceptedAnswer
downvote count: 1
score: 110
type: Answer
has comment: http://stackoverflow.com/comment/93864521
accepted answer of: http://stackoverflow.com/q/29660381
answers question: http://stackoverflow.com/q/29660381
upvote count: 111
has body: It is called Tagged Template in ES-6 more could be read about them Here, funny I found the link in the starred section of the very chat. But the relevant part of the code is below (you can basically create a filtered sort). function tag(strings, ...values) { assert(strings[0] === 'a'); assert(strings[1] === 'b'); assert(values[0] === 42); return 'whatever'; } tag `a${ 42 }b` // "whatever" Basically, its merely tagging the "1" with console.log function, as it would do with any other function. The tagging functions accept parsed values of template strings and the values separately upon which further tasks can be performed. Babel transpiles the above code to var _taggedTemplateLiteralLoose = function (strings, raw) { strings.raw = raw; return strings; }; console.log(_taggedTemplateLiteralLoose(["1"], ["1"])); As you can see it in the example above, after being transpiled by babel, the tagging function (console.log) is being passed the return value of the following es6->5 transpiled code. _taggedTemplateLiteralLoose( ["1"], ["1"] ); The return value of this function is passed to console.log which will then print the array.

pg-query
type: Tag
tag name: pg-query
tags question: http://stackoverflow.com/q/29663883

http://stackoverflow.com/comment/47509622
score: 0
comment on: http://stackoverflow.com/a/29685970
type: AnswerComment
type: Comment
has text: for the moment, clicking on the button should only create a link to another page (book.php)... so clicking doesn't do anything with the date from the DB.

http://stackoverflow.com/comment/47368242
has text: @Nayish I'm trying to do a quiz app, so I want the property of selected to become true when the user selects that radio button.
type: QuestionComment
comment on: http://stackoverflow.com/q/29610746
score: 0
type: Comment

http://stackoverflow.com/q/29625047
type: Question
tagged with: animation
upvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/29625180
has comment: http://stackoverflow.com/comment/47393480
has body: i have a circle animation within a button but i want the animation to stay inside the button and not overlap it. Is this possible? here is my code. and fiddle $(document).ready(function(){ $('button').on("mouseup",function(){ $('#mousemark').removeClass("click"); }); $('button').on('click', function(e){ $('#mousemark').css({ left: e.pageX, top: e.pageY }); $('#mousemark').addClass("click"); }); })
downvote count: 0
accepted answer: http://stackoverflow.com/a/29625180
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47393617
has comment: http://stackoverflow.com/comment/47393495
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47393485
score: 1
tagged with: css
has title: Animation inside the div only
favorite count: 0

http://stackoverflow.com/comment/47435818
type: Comment
has text: My bad, got it... indexOf is working with a strict equality. oranges from workshops and selectedWorkshops are not the same object, but identicals. Sorry for this mistake. I'm writing a quick fix.
comment on: http://stackoverflow.com/a/29632051
score: 1
type: AnswerComment

http://stackoverflow.com/comment/47496578
type: AnswerComment
score: 0
has text: Eg : [{"Id":"1","Name":"Define","StartDate":"2015-04-09","EndDate":"2015-04-22"}, {"Id":"2","Name":"Plan","StartDate":"2015-04-22","EndDate":"2015-04-29"}, {"Id":"2","Name":"Plan","StartDate":"2015-04-30","EndDate":"2015-05-14"]}]
type: Comment
comment on: http://stackoverflow.com/a/29677160

http://stackoverflow.com/q/29599056
has comment: http://stackoverflow.com/comment/47344608
has comment: http://stackoverflow.com/comment/47344847
answer count: 1
has comment: http://stackoverflow.com/comment/47344911
has comment: http://stackoverflow.com/comment/47344572
accepted answer: http://stackoverflow.com/a/29599328
tagged with: javascript
has comment: http://stackoverflow.com/comment/47344794
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47344622
tagged with: jquery
has comment: http://stackoverflow.com/comment/47344557
type: Question
has comment: http://stackoverflow.com/comment/47344699
has comment: http://stackoverflow.com/comment/47344675
has answer: http://stackoverflow.com/a/29599328
has comment: http://stackoverflow.com/comment/47344977
has comment: http://stackoverflow.com/comment/47344515
has body: This function is from CamanJS library. This is the code for tiltshift effect of plugin Caman.Filter.register("tiltShift", function(opts) { var defaults, gradient; defaults = { center: { x: this.dimensions.width / 2, y: this.dimensions.height / 2 }, angle: 45, focusWidth: 200, startRadius: 3, radiusFactor: 1.5, steps: 3 }; opts = Util.extend(defaults, opts); opts.angle *= Math.PI / 180; gradient = getLinearGradientMap(this.dimensions.width, this.dimensions.height, opts.center.x, opts.center.y, opts.angle, opts.focusWidth, true); return this.processPlugin("compoundBlur", [gradient, opts.startRadius, opts.radiusFactor, opts.steps]); }); I supplied the following values as parameters. this.tiltShift(600,400,300,200,0,200,true).render(); But the default angle is still 45. How do I change it?
has title: Set angle to zero in function parameter
tagged with: camanjs
score: 0

http://stackoverflow.com/comment/47246244
has text: `@media screen and ... `OR `@media only screen and ...`
score: 1
comment on: http://stackoverflow.com/q/29547252
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47500335
type: QuestionComment
comment on: http://stackoverflow.com/q/29678607
score: 0
type: Comment
has text: Hey, I used Safari Version 8.0.2 (10600.2.5) (OS X) - scrolling works, but fade in/fade out not. I also use Chrome under OS X currently (Version 42.0.2311.90 (64-bit)), scrolling works, fading in/out randomly. I have no idea what is causing that problem..

http://stackoverflow.com/q/29605696
linked to: http://stackoverflow.com/q/14766951
linked to: http://stackoverflow.com/q/1063007
linked to: http://stackoverflow.com/q/11980087
has comment: http://stackoverflow.com/comment/47357263
favorite count: 0
has comment: http://stackoverflow.com/comment/47357206
has answer: http://stackoverflow.com/a/29605797
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47357116
has comment: http://stackoverflow.com/comment/47356963
type: AnsweredQuestion
score: -5
has answer: http://stackoverflow.com/a/29606196
type: Question
accepted answer: http://stackoverflow.com/a/29605797
answer count: 2
has comment: http://stackoverflow.com/comment/47357186
upvote count: 0
possible better answer: http://stackoverflow.com/a/29606196
has body: How can we Sort numbers in words (one, two, three) in Javascript (Angularjs) My array has some numeric words $scope.Numbers = ["three", "one", "five", "two", ...... "hundred", "four"]; I want the result to be: one two three four ... ... ... hundred I have searched Google for the solution, but I have not found anything Also i have tried array.sort(), but it is sorting alphabetically.
downvote count: 5
tagged with: javascript
has title: How do I sort an array of words that represent numbers?
has comment: http://stackoverflow.com/comment/47357017
has comment: http://stackoverflow.com/comment/47357009

http://stackoverflow.com/q/29621260
has comment: http://stackoverflow.com/comment/47386622
has comment: http://stackoverflow.com/comment/47387141
has title: Change data in selectboxes angularjs
type: Question
tagged with: angularjs-forms
has comment: http://stackoverflow.com/comment/47386643
tagged with: javascript
linked to: http://stackoverflow.com/q/18723399
has comment: http://stackoverflow.com/comment/47386555
possible better answer: http://stackoverflow.com/a/29621422
has answer: http://stackoverflow.com/a/29621609
has answer: http://stackoverflow.com/a/29621422
has answer: http://stackoverflow.com/a/29621469
has comment: http://stackoverflow.com/comment/47386595
tagged with: angularjs
has answer: http://stackoverflow.com/a/29621477
answer count: 4
has body: I have 3 different selectboxes at my page. If I chose an option In the first selectbox, I want the options In the second selectbox to change to options that belongs to the value that you selected in the first selectbox. I want the same thing with the third selectbox. If I chose an option the second selectbox, I want the options in the third selectbox to change to the toptions that belongs to the value in the second. Any suggestions how to do this as simple as possible in AngularJS?
accepted answer: http://stackoverflow.com/a/29621609
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47386574
linked to: http://stackoverflow.com/q/18082609
score: 0

http://stackoverflow.com/q/29634266
tagged with: javascript
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/29649657
has answer: http://stackoverflow.com/a/29670307
tagged with: cordova
has body: I'm new to using plugins with Phonegap, I know how to connect the plugin with the app via config.xml but I can't figure out where I'm supposed to put the js that comes with the plug in. I want to change the status bar appearance so I integrated this: https://github.com/phonegap-build/StatusBarPlugin/tree/0944be5c9f96ca0e39e0079f46ffc37894a586cd but to change the content colour I need to copy that js to somewhere, and where is that? In the index.html, any special js file? And is it the same process for every other plugin too? Thanks in advance.
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29670307
type: Question
has title: PhonegapBuild plugins
has answer: http://stackoverflow.com/a/29649657

http://stackoverflow.com/q/29605480
tagged with: http://stackoverflow.com/tag/html
has body: I'm creating some tiles and it all fits onto one page, so each tile has a fixed height. In this example I'm wanting to create a grid of 3 rows, where the height of each row is always 33%, and each square would just take this 33% to decide its height. So effectively you could say: height: 33%; width: height; I've been looking around and I've seen a few ways at doing this using width, but haven't seen anywhere where you have a fixed height. Any ideas? Update: http://jsfiddle.net/wL68jwxc/ Here is a fiddle showing my current code. So, after some help below, I would like to make sure that these 2 squares are always on the same row...so if I change the width of the screen, they remain squares and on the same row regardless of screen size. I realise this is quite different to the title, but the logic of the question remains the same.
tagged with: css
has title: Equal width and height with a fixed height set
has comment: http://stackoverflow.com/comment/47357356
type: UnansweredQuestion
tagged with: javascript
type: Question
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/29605682
tagged with: jquery
has comment: http://stackoverflow.com/comment/47356766

http://stackoverflow.com/a/29562511
answers question: http://stackoverflow.com/q/29561996
type: Answer
has body: Use the lodash library HTML &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.5.0/lodash.js"&gt;&lt;/script&gt; Your script var array1 = [{username: "user1", id: 11}, {username: "user2", id:12}, {username: "user3", id:13}, {username: "user4", id:14}]; var array2 = [{username: "user4", id:14}, {username: "user43", id:43}]; var result_array = _(array1).union(array2).unique(function(a,b){ return a.id; }).value(); This code puts all the elements together from the arrays and then the callback to unique returns a value that lodash uses to determine what unique means. If you find out you also need username you could return a.id + "somethinguniquehere" + a.username plunker
upvote count: 0
downvote count: 1
score: -1
has comment: http://stackoverflow.com/comment/49666983
has comment: http://stackoverflow.com/comment/47275556

http://stackoverflow.com/comment/47343696
comment on: http://stackoverflow.com/a/29598570
type: AnswerComment
has text: oh okay so my clumsiness was the error.. thanks for your help!
score: 0
type: Comment

http://stackoverflow.com/q/29667027
has title: Making the scrolling keys scroll the proper page element
linked to: http://stackoverflow.com/q/961532
has body: I have a DIV in my page that is scrollable, while no other elements on the page are. (The page layout is fixed with controls above and below the DIV itself.) I would like the arrow keys and page up/page down to scroll the DIV under all circumstances, but I cannot seem to do so unless the DIV actually has the focus. There are other input fields in other DIVs which often have focus. I have tried capturing the arrow keys and page/up down 'keydown' event at the document level and simulating the same event directly (using answers from this question) to the DIV that needs to scroll, but no scrolling occurs. I know the event is being dispatched because if I attach an event handler I see it, but for some reason it doesn't cause any scrolling. I have also tried setting the "tabIndex" attribute of the DIV with no difference. How can I designate a specific element to receive specific keys like this? It is extremely user unfriendly to require a specific element to be focused for certain keys to work, when those keys only make sense for a single element on the page. Having to constantly switch focus from another element to the scrollable area to scroll and back to enter data just isn't acceptable. I have seen suggestions that scrolling can be simulated by other means, but I want to avoid that route because this doesn't always produce identical results, and I also want to generalize it to other kinds of key events and action besides scrolling.
tagged with: keyboard-events
favorite count: 0
score: 4
type: UnansweredQuestion
tagged with: scroll
type: Question
upvote count: 4
has answer: http://stackoverflow.com/a/29667619
answer count: 2
has answer: http://stackoverflow.com/a/29667798
downvote count: 0
tagged with: javascript
tagged with: dom-events

http://stackoverflow.com/comment/47272181
has text: Your return type also should be : IHttpActionResult, not IEnumerable<string>.
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29561180

http://stackoverflow.com/comment/47226640
has text: What is `myObject`? What happens to your event handlers is determined by `on`. The standard is not to override, though, like `addEventListener` does it.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29537063
score: 0

http://stackoverflow.com/q/29659154
has comment: http://stackoverflow.com/comment/47656427
has answer: http://stackoverflow.com/a/29771650
has comment: http://stackoverflow.com/comment/47677059
has comment: http://stackoverflow.com/comment/47748675
has answer: http://stackoverflow.com/a/29661933
has title: What is the best way to upload files in a modern browser
tagged with: http
type: Question
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29869709
has body: I want to upload a (single) file to a server and show the progress of the upload. I know I can upload a file using HTTP POST. I'm not familiar with web-sockets, but as I understand, binary data can also be sent that way and because web sockets are bi-directional I could get the progress of the upload. I'm not worried about older browsers so iframe's and flash solutions aren't very appealing unless there is a significant advantage in going that route. I'm also curious as to the best server-side technology. Are their advantages to using a WSGI server like Django? Or maybe non-blocking I/O technology like Node.js? I'm not asking if web framework x is better than web framework y, or server x is better than server y. But simply what the ideal technology should have in order to facility uploads in the client. Update: It seems like the server side does not have bearing on the technologies/API's available on the client to facilitate uploads.
upvote count: 73
has answer: http://stackoverflow.com/a/29869709
tagged with: websocket
tagged with: file-upload
has answer: http://stackoverflow.com/a/29801304
linked to: http://stackoverflow.com/q/28014386
favorite count: 0
has comment: http://stackoverflow.com/comment/47460408
answer count: 5
downvote count: 5
tagged with: django
has comment: http://stackoverflow.com/comment/95038974
has answer: http://stackoverflow.com/a/29758951
accepted answer: http://stackoverflow.com/a/29758951
type: AnsweredQuestion
score: 68

http://stackoverflow.com/comment/47424565
type: AnswerComment
comment on: http://stackoverflow.com/a/29641184
type: Comment
has text: Thanks! This was exactly it. I wasn't quite sure if what I did here was right and I tried changing what I had in the `$get` to several different things but I must not have tried this.
score: 0

http://stackoverflow.com/q/29604309
has comment: http://stackoverflow.com/comment/47354305
accepted answer: http://stackoverflow.com/a/29604494
linked to: http://stackoverflow.com/q/3504499
has title: Selecting all rows for a give title
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29604494
has body: I have rows like this, Fruitish Fruit 1 Tmm itee Multi Dription 127 M015 I am trying to select all rows of the table and clone them to another table, my goal is to show them, but maybe I need to change ID, however I am having isssue creating select query, I can do, $("#table tr td[1] div") ... not sure what's next I may use this for cloning How to Copy Table Row with clone in jquery and create new Unique Ids for the controls but this is coming after i make a select statement.
type: Question
score: 0
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/29674369
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29674576
has comment: http://stackoverflow.com/comment/47491214
tagged with: angularjs-scope
type: Question
upvote count: 2
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/29674574
accepted answer: http://stackoverflow.com/a/29674574
favorite count: 0
has answer: http://stackoverflow.com/a/29674576
has comment: http://stackoverflow.com/comment/47490036
score: 2
has title: Angular controller's attribute not accessible outside its function
tagged with: angularjs
downvote count: 0
has body: I have a form with two input fields (session.email and session.psw) bound to the LoginController.session attribute. When I click the reset button, I call the LoginController.reset() function. I would like make it clear the session attribute, utilizing the variable sessionDefault (empty). However it works just one time, if I reset two times the form, sessionDefault is undefined. How could I make it as a constant attribute of the controller? app.controller('LoginController', function ($scope) { this.session={}; var sessionDefault= { email : "", psw: "" }; this.reset = function() { this.session = sessionDefault; }; });
has comment: http://stackoverflow.com/comment/47490661

http://stackoverflow.com/comment/47503077
type: Comment
comment on: http://stackoverflow.com/q/29665127
type: QuestionComment
has text: I updated my answer to reflect the changes made to your question.
score: 0

http://stackoverflow.com/comment/47267189
comment on: http://stackoverflow.com/q/29558483
score: 0
type: Comment
type: QuestionComment
has text: Do you want to input total days or a date?

http://stackoverflow.com/a/29557153
type: Answer
has comment: http://stackoverflow.com/comment/47264848
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29556906
has body: function obj() { this.__model = []; } obj.prototype.add = function(key, value) { this[key] = value; this.__model.push({ key: key, value: value }); if(this.__model.length &gt; 10) delete this[this.__model.shift().key]; console.log(this); } http://plnkr.co/edit/dxbiXj5y3e3uiu0Hch7q?p=preview
has comment: http://stackoverflow.com/comment/47264792
downvote count: 0

http://stackoverflow.com/a/29651848
has comment: http://stackoverflow.com/comment/47444772
has comment: http://stackoverflow.com/comment/47444609
has body: Have you tried $getRecord() instead of get()? Noted in the AngularFire docs here. Your code slightly altered for $getRecord() below: myApp.controller('CoursesShowController', function($scope, $firebaseObject, $firebaseArray, $routeParams, FIREBASE_URL) { var ref = new Firebase(FIREBASE_URL+'/courses/'); var courses = $firebaseArray(ref); var key = $routeParams.id.toString(); console.log(courses.$getRecord({shortName: key})); } );
has comment: http://stackoverflow.com/comment/47447706
score: 0
has comment: http://stackoverflow.com/comment/47446722
has comment: http://stackoverflow.com/comment/47448229
answers question: http://stackoverflow.com/q/29651589
type: Answer
has comment: http://stackoverflow.com/comment/47444122

http://stackoverflow.com/comment/47269606
comment on: http://stackoverflow.com/a/29559652
score: 0
has text: is this the solution you are looking for? http://jsfiddle.net/vY39r/391/ @gstackoverflow
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/47279280
comment on: http://stackoverflow.com/q/29561448
has text: @DaveNewton Your comment reminds me of https://xkcd.com/1172/ and https://xkcd.com/378/ . For this specific problem I am the main user of my site. Implementing a page search is MUCH more overhead than applying a tag / including some generic JS (if this is possible)
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29662505
answers question: http://stackoverflow.com/q/29658911
type: Answer
upvote count: 3
accepted answer of: http://stackoverflow.com/q/29658911
score: 3
has body: So I ended up with something like this: var knownFiles = []; // If not already a list, make it a list if (!files.length) { files = [files]; } // Iterate manually to accommodate Array, FileList, DataTransferItemList for (i = 0; i &lt; files.length; i++) { file = files[i]; if (Blob &amp;&amp; file instanceof Blob) { // Safari, Firefox, IE land here knownFiles.push(file); } else if (file.webkitGetAsEntry) { // Chrome wraps Files in DataTransferItems knownFiles.push(file.webkitGetAsEntry()); } } return knownFiles; Most of this came from poking around in browsers (Chrome 41, Safari 8, Firefox 36, and IE 11), but I also had some help from here: https://code.flickr.net/2012/12/10/drag-n-drop/. Apparently, Chrome is the only browser that bothers with the DataTransferItemList interface, and that adds an additional layer around FileLists and Files returned in the dataTransfer property of drag/drop events.
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/29635859
downvote count: 0
has body: You need to pass your id Into the update method don't you? $scope.person.$update({ id: 1 }, function(response) { // });
type: AcceptedAnswer
type: Answer
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/29635797
answers question: http://stackoverflow.com/q/29635797

http://stackoverflow.com/comment/47385690
comment on: http://stackoverflow.com/q/29620603
has text: @SyedQarib I haven't known it. Thanks :)
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29570593
answer count: 3
has title: Clear input after submitting input value
possible better answer: http://stackoverflow.com/a/29570823
tagged with: http://stackoverflow.com/tag/html
has body: I have a webpage that I'm using to update a value remotely. To be more specific, on one side, I have a screen connected to the internet with a little field in it that reads (Now Serving: ##) and on the other side, I have a tablet connected to the internet with a webpage that is used to push the value to the screen and update it. Everything looks good except the following: Getting the input field to clear after it submits the value so I can type another number in it without the need to manually clear it Below is my HTML Code Type the number in the box Now Serving: and here is my JavaScript code $(document).ready(function() { $('.testingHuss').keydown(function(event) { if (event.keyCode == 13) { sendCommand("galaxy.signage.me", "wmt_huss", "husshuss", "3", "nowServing", document.test.msg1.value); document.getElementById('onscreen').innerHTML = document.test.msg1.value; return false; } }); });
upvote count: 1
has comment: http://stackoverflow.com/comment/47290686
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29570742
score: 1
has comment: http://stackoverflow.com/comment/47290580
type: Question
downvote count: 0
has answer: http://stackoverflow.com/a/29570700
has comment: http://stackoverflow.com/comment/47290610
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29570823
favorite count: 0
accepted answer: http://stackoverflow.com/a/29570742

http://stackoverflow.com/comment/79426131
comment on: http://stackoverflow.com/a/29605982
score: 0
type: Comment
has text: the googlecode repository was shut down, all the content was moved to github: [RichMarker on GitHub](https://github.com/googlemaps/v3-utility-library/tree/master/richmarker)
type: AnswerComment

http://stackoverflow.com/a/29642222
answers question: http://stackoverflow.com/q/29641526
type: Answer
has comment: http://stackoverflow.com/comment/123685041
has body: Just add this somewhere in your stylesheet and it will apply to all images on your site. img { display: block; max-width: 100%; height: auto; }
has comment: http://stackoverflow.com/comment/47426348
upvote count: 36
has comment: http://stackoverflow.com/comment/128741281
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29641526
score: 36

http://stackoverflow.com/a/29594050
score: 0
type: Answer
has body: Try initializing this.interval outside of this.start so that $ wrapper.interval is accessible throughout the plugin and not just in this.start : $.fn.pluginName= function(o) { var $wrapper = this; var init = function(o) { $wrapper.start(); return $wrapper; }; this.interval; this.start = function() { $wrapper.interval = setInterval(function() { console.log(1) }, 1000); }; // Stop autoplay this.stop = function() { console.log(2) clearInterval($wrapper.interval); return $wrapper; }; return init(o);
answers question: http://stackoverflow.com/q/29593842

prototype
tags question: http://stackoverflow.com/q/29543386
tags question: http://stackoverflow.com/q/29552174
tags question: http://stackoverflow.com/q/29631158
tags question: http://stackoverflow.com/q/29576515
tags question: http://stackoverflow.com/q/29593544
tag name: prototype
tags question: http://stackoverflow.com/q/29684900
tags question: http://stackoverflow.com/q/29586833
type: Tag
tags question: http://stackoverflow.com/q/29590788
tags question: http://stackoverflow.com/q/29678952
tags question: http://stackoverflow.com/q/29602584
tags question: http://stackoverflow.com/q/29622030
tags question: http://stackoverflow.com/q/29678785
tags question: http://stackoverflow.com/q/29612744

http://stackoverflow.com/comment/47290938
has text: @BenjaminGruenbaum sure you can change it if you'd like. I just gave a random example and used the current time because the current time changes frequently. I know it doesn't really make sense in the context of the original object, but it was just to demonstrate the concept.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29570547

http://stackoverflow.com/comment/47415507
type: Comment
score: 0
type: AnswerComment
has text: @LeeGellie I posted an answer with my comments on this.
comment on: http://stackoverflow.com/a/29636454

http://stackoverflow.com/a/29635757
upvote count: 1
has comment: http://stackoverflow.com/comment/47413940
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47413829
answers question: http://stackoverflow.com/q/29635613
type: Answer
has body: Yes, you need to return JsonResult: [HttpPost] public JsonResult DeleteEvent(string eventId) { diaryEventService.DeleteDiaryEvent(eventId); return Json("{status:"OK"}"); } Since you are changing back-end data, set it to POST: $.ajax({ url: '/ManageSpaces/DeleteEvent', method: 'POST', dataType: 'json', data: { eventId: eventId, }, success: function(response) { if(response.status=="OK"){ var myCalendar = $('#fullcalendar'); myCalendar.fullCalendar(); myCalendar.fullCalendar('removeEvents', eventId); $("#eventDetails").collapse('toggle'); }else{ console.log("Error occured") } } });
accepted answer of: http://stackoverflow.com/q/29635613
score: 1

http://stackoverflow.com/a/29659782
has body: As Aadit M. Shah points out in a comment, the problem is that you cannot return in a jison grammar action before the parse is complete. If a parser rule executes a return, the parser itself will return. You need to assign the semantic value to $$.
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/29655780
score: 3
downvote count: 0
answers question: http://stackoverflow.com/q/29655780
upvote count: 3

http://stackoverflow.com/a/29605085
has comment: http://stackoverflow.com/comment/47355859
has comment: http://stackoverflow.com/comment/47671550
type: Answer
accepted answer of: http://stackoverflow.com/q/29604989
has comment: http://stackoverflow.com/comment/47670765
answers question: http://stackoverflow.com/q/29604989
score: 0
has comment: http://stackoverflow.com/comment/47673200
has comment: http://stackoverflow.com/comment/47673552
has comment: http://stackoverflow.com/comment/47357144
type: AcceptedAnswer
has body: I want the value of the slider multiplied by 2 You can replace onchange="showValue(this.value)" with onchange="showValue(2*this.value)" This way you will always send double the value.
has comment: http://stackoverflow.com/comment/47357220

jscolor
tags question: http://stackoverflow.com/q/29600230
tag name: jscolor
type: Tag

http://stackoverflow.com/comment/47246590
score: 0
has text: What do you mean by network restrictions? Your code produced the same error for me.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29546777

http://stackoverflow.com/a/29541852
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29541819
upvote count: 2
has body: You just need to escape the single quotes: <?php $var =' '; return $var;
type: Answer
has comment: http://stackoverflow.com/comment/47236898
score: 2
has comment: http://stackoverflow.com/comment/47236782
accepted answer of: http://stackoverflow.com/q/29541819

http://stackoverflow.com/q/29532604
score: 0
answer count: 1
tagged with: d3.js
has answer: http://stackoverflow.com/a/29575160
has comment: http://stackoverflow.com/comment/47220757
has comment: http://stackoverflow.com/comment/47221316
type: UnansweredQuestion
has title: Time Parse Error in d3.js?
type: Question
has body: I'm trying to run a basic d3.js line graph but I keep getting an error in the function d3_time_parse. The example I'm attempting to copy is here: http://bl.ocks.org/d3noob/b3ff6ae1c120eea654b5 Specifically, the error is d3.v3.js:2550 Uncaught TypeError: Cannot read property 'length' of undefined corresponding to 2549: function d3_time_parse(date, template, string, j) { 2550: var c, p, t, i = 0, n = template.length, m = string.length; My code: &lt;!DOCTYPE html&gt; &lt;meta charset="utf-8"&gt; &lt;style&gt; /* set the CSS */ body { font: 12px Arial;} path { stroke: steelblue; stroke-width: 2; fill: none; } .axis path, .axis line { fill: none; stroke: grey; stroke-width: 1; shape-rendering: crispEdges; } &lt;/style&gt; &lt;body&gt; &lt;!-- load the d3.js library --&gt; &lt;script src="http://d3js.org/d3.v3.js"&gt;&lt;/script&gt; &lt;script&gt; // Set the dimensions of the canvas / graph var margin = {top: 30, right: 20, bottom: 30, left: 50}, width = 600 - margin.left - margin.right, height = 270 - margin.top - margin.bottom; // Parse the date / time var parseDate = d3.time.format("%d-%b-%y").parse; // Set the ranges var x = d3.time.scale().range([0, width]); var y = d3.scale.linear().range([height, 0]); // Define the axes var xAxis = d3.svg.axis().scale(x) .orient("bottom").ticks(5); var yAxis = d3.svg.axis().scale(y) .orient("left").ticks(5); // Define the line var valueline = d3.svg.line() .x(function(d) { return x(d.date); }) .y(function(d) { return y(d.close); }); // Adds the svg canvas var svg = d3.select("body") .append("svg") .attr("width", width + margin.left + margin.right) .attr("height", height + margin.top + margin.bottom) .append("g") .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); // Get the data d3.csv("data.csv", function(error, data) { data.forEach(function(d) { d.date = parseDate(d.date); d.close = +d.close; }); // Scale the range of the data x.domain(d3.extent(data, function(d) { return d.date; })); y.domain([0, d3.max(data…
has comment: http://stackoverflow.com/comment/47219635
tagged with: javascript

http://stackoverflow.com/comment/47413083
score: 0
type: Comment
type: QuestionComment
has text: possible duplicate of [Improving a Javascript browser detection function](http://stackoverflow.com/questions/13316353/improving-a-javascript-browser-detection-function)
comment on: http://stackoverflow.com/q/29633942

http://stackoverflow.com/a/29597717
has comment: http://stackoverflow.com/comment/47611719
upvote count: 2
has comment: http://stackoverflow.com/comment/47613401
has comment: http://stackoverflow.com/comment/47610137
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47559197
has comment: http://stackoverflow.com/comment/47608168
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47570283
has comment: http://stackoverflow.com/comment/47611370
accepted answer of: http://stackoverflow.com/q/29596199
has comment: http://stackoverflow.com/comment/47607385
answers question: http://stackoverflow.com/q/29596199
has body: When you're positioning your .pin elements, why are you using path in your translate? You don't want to create a path, and the d.latitude and d.longitude values should already be in pixel co-ordinates, since they're projected already, so you should be able to use them directly. Note: you probably also want that part of your code inside the d3.json handler, rather than outside, since it'll run asynchronously before your data is set to anything (this is probably the actual issue with your code, rather than using path incorrectly). It's a little hard to confirm without an example to fork, but try this: var width, height, path, svg; width = 960; height = 600; path = d3.geo.path().projection(null); svg = d3.select('.viz').append('svg') .attr('width', width) .attr('height', height); d3.json("counties.json", function(error, us) { svg.append('path') .datum(topojson.mesh(us)) .attr('d', path); svg.selectAll('.pin') .data(ds) // i.e. ds = {[12.521, 15.312], [616.122, -31.160]} .enter().append('circle', '.pin') .attr('r', 3) .attr('transform', function (d) { return 'translate(' + d.longitude + "," + d.latitude + ')'; }); });
has comment: http://stackoverflow.com/comment/47575111

http://stackoverflow.com/comment/47420119
has text: I've had this a bunch. Using the $_POST variable doesn't work. Has to do with how angular posts the data. Try file_get_contents('php://input'). You may need to json_decode after that.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29638977

http://stackoverflow.com/comment/47458109
score: 0
comment on: http://stackoverflow.com/q/29653725
has text: Thanks for your comment, added to clarify. I expect the first example of the sorted array to be what rolls out every time.
type: Comment
type: QuestionComment

mongodb
tags question: http://stackoverflow.com/q/29583115
tags question: http://stackoverflow.com/q/29581291
tags question: http://stackoverflow.com/q/29650446
tags question: http://stackoverflow.com/q/29622940
tags question: http://stackoverflow.com/q/29567495
tags question: http://stackoverflow.com/q/29612761
tags question: http://stackoverflow.com/q/29536593
tags question: http://stackoverflow.com/q/29611752
tags question: http://stackoverflow.com/q/29678459
tags question: http://stackoverflow.com/q/29615695
tags question: http://stackoverflow.com/q/29648626
tags question: http://stackoverflow.com/q/29578833
tags question: http://stackoverflow.com/q/29677613
tag name: mongodb
tags question: http://stackoverflow.com/q/29612474
tags question: http://stackoverflow.com/q/29569868
tags question: http://stackoverflow.com/q/29631097
tags question: http://stackoverflow.com/q/29638752
tags question: http://stackoverflow.com/q/29617685
tags question: http://stackoverflow.com/q/29645930
tags question: http://stackoverflow.com/q/29591194
tags question: http://stackoverflow.com/q/29669529
type: Tag
tags question: http://stackoverflow.com/q/29617138
tags question: http://stackoverflow.com/q/29570772
tags question: http://stackoverflow.com/q/29559391
tags question: http://stackoverflow.com/q/29589242
tags question: http://stackoverflow.com/q/29613882
tags question: http://stackoverflow.com/q/29590886
tags question: http://stackoverflow.com/q/29571028
tags question: http://stackoverflow.com/q/29551630
tags question: http://stackoverflow.com/q/29615412
tags question: http://stackoverflow.com/q/29655670
tags question: http://stackoverflow.com/q/29603202
tags question: http://stackoverflow.com/q/29568581
tags question: http://stackoverflow.com/q/29557327
tags question: http://stackoverflow.com/q/29599010
tags question: http://stackoverflow.com/q/29535526
tags question: http://stackoverflow.com/q/29574101
tags question: http://stackoverflow.com/q/29581372

http://stackoverflow.com/comment/47431263
type: AnswerComment
score: 0
type: Comment
has text: The problem here is that he has no control over the server
comment on: http://stackoverflow.com/a/29644934

http://stackoverflow.com/q/29643873
upvote count: 4
possible better answer: http://stackoverflow.com/a/29644006
type: AnsweredQuestion
downvote count: 0
accepted answer: http://stackoverflow.com/a/29643960
type: Question
has comment: http://stackoverflow.com/comment/47428921
has title: Replace href on select change
has answer: http://stackoverflow.com/a/29643960
has comment: http://stackoverflow.com/comment/47428705
tagged with: javascript
answer count: 6
tagged with: jquery
has comment: http://stackoverflow.com/comment/47429061
score: 4
has answer: http://stackoverflow.com/a/29644006
has answer: http://stackoverflow.com/a/29644161
has answer: http://stackoverflow.com/a/29644010
has comment: http://stackoverflow.com/comment/47428679
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29645417
has answer: http://stackoverflow.com/a/29644098
favorite count: 0
has body: I have a select element with options with values that are some numbers (some id's). Random Random 2 Random 3 Random 4 Next to it is a submit button that will preform some kind of submit. Click me! I need to add the ?id= to that link, with the id value of the select. I created the code, but the issue is that it just appends the ?id= every time I change the select the option var id; $('#select').on('change', function(){ id = $(this).val(); var new_href = $('.button').attr('href') + '?id=' + id; $('.button').attr('href', new_href); }); So when I click on first option I get, for the href www.random.org?id=21 But if I click on second one (or any for that matter) I get www.random.org?id=21?id=23 It appends the id. How to 'clear' the previous id on change, and replace with the selected one? What am I doing wrong?

http://stackoverflow.com/a/29699623
has body: I totally agree with @Ethan and @MisterNeutron that Player is just a player, Player will only process the video or audio, it won`t merge. it doesn't do anything with the media fed into it, other than play it back. I think You should look for some other solution which helps you to merge the video and audio into one in mp4 format and then play it with jwplayer while searching for solution I found about recordRTC (other link )and ffmpeg, using ffmpeg you can merge video, you need to explore more about this and how it works. Once you have downloaded both video and audio files (‘videoplayback.mp4’ and ‘videoplayback.m4a’ respectively), here’s how you can merge them into a single file: - Download and install ffmpeg. Open a Command Prompt window in your downloads folder and run the following command - ffmpeg -i videoplayback.mp4 -i videoplayback.m4a -c:v copy -c:a copy output.mp4 - Wait until ffmpeg finishes merging audio and video into a single file named "output.mp4". Some more helpful links how to merge mp4 and m4a files (ffmpeg method) how to mix in audio to html5 video? ( This solution is same as suggested by @Ethan and @MisterNeutron, to create two instance of player and use one for audio and other for video) I hope this helps :)
answers question: http://stackoverflow.com/q/29650041
score: 0
type: Answer

http://stackoverflow.com/comment/47500336
type: Comment
has text: Mind pointing out which part of it? I can't really identify/differentiate pure Javascript and jQuery as I am referring tutorials everywhere to make this work. I am still learning hopefully I'll get better next time :)
comment on: http://stackoverflow.com/q/29681245
score: 0
type: QuestionComment

http://stackoverflow.com/q/29532063
has comment: http://stackoverflow.com/comment/47217337
type: Question
tagged with: javascript
favorite count: 0
has body: Can anyone help me to list the JavaScript functions, which are not supported by any browser. Ex: Like map() function,this will supported in IE8 (you would have faced this type of problems in your development phases). i tried googling in documentation of browsers but i can't get it clearly. Any help will be appreciated. Thanks in advance.
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/47217375
has title: javascript functions not supported by any browser
has comment: http://stackoverflow.com/comment/47217779
upvote count: 0
tagged with: google-chrome
tagged with: netscape
type: AnsweredQuestion
tagged with: internet-explorer
tagged with: mozilla
score: -1
has answer: http://stackoverflow.com/a/29534687
accepted answer: http://stackoverflow.com/a/29534687

http://stackoverflow.com/comment/47288944
score: 0
has text: my json file example: http://www.codeshare.io/IzuhJ yes, without link value it works.
type: QuestionComment
comment on: http://stackoverflow.com/q/29569639
type: Comment

http://stackoverflow.com/comment/47441622
type: AnswerComment
score: 0
type: Comment
has text: One last option you have is to use both `ng-class` and `class` on a single element: `ng-class="{xxx: yyy}" class="{{expression returning class string}}"`
comment on: http://stackoverflow.com/a/29648487

http://stackoverflow.com/comment/47495540
type: Comment
comment on: http://stackoverflow.com/a/29676656
has text: That makes sense and actually I think my question is flawed in that the alert wouldn't need to listen for the onload event as its my understanding the onload is basically used to make sure all elements of the DOM are present before beginning. In theory my function runs once already and then is ran again on the onload, would this be correct? So I'm guessing the example would have been more appropriate in conjuction with a getElementById reference than the alert function?
type: AnswerComment
score: 0

http://stackoverflow.com/a/29652786
score: 18
downvote count: 0
has body: From the AngularJS docs, you have 3 options: Html link rewriting (...) In cases like the following, links are not rewritten; instead, the browser will perform a full page reload to the original link. Links that contain target element Example: link Absolute links that go to a different domain Example: link Links starting with '/' that lead to a different base path Example: link What you might be looking for is the first example: users.html
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/29652329
accepted answer of: http://stackoverflow.com/q/29652329
upvote count: 18

video
tags question: http://stackoverflow.com/q/29678327
tags question: http://stackoverflow.com/q/29615740
type: Tag
tags question: http://stackoverflow.com/q/29638824
tags question: http://stackoverflow.com/q/29610210
tags question: http://stackoverflow.com/q/29544063
tags question: http://stackoverflow.com/q/29659605
tags question: http://stackoverflow.com/q/29571274
tags question: http://stackoverflow.com/q/29592906
tags question: http://stackoverflow.com/q/29647427
tags question: http://stackoverflow.com/q/29559760
tags question: http://stackoverflow.com/q/29636740
tag name: video
tags question: http://stackoverflow.com/q/29622609
tags question: http://stackoverflow.com/q/29568621

http://stackoverflow.com/comment/47324330
score: 0
has text: i did it in index.html
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29588434

http://stackoverflow.com/q/29634611
upvote count: 0
has comment: http://stackoverflow.com/comment/47411638
answer count: 1
has body: So I am importing all of my website files onto my server and it is displaying the index.html as plain text and some basic images but no CSS or no JavaScript. I am running linux command line on putty connecting to my web server and I have no clue how to fix this, I have played and changed all permissions on the files also.
has comment: http://stackoverflow.com/comment/47411594
favorite count: 0
has comment: http://stackoverflow.com/comment/47426118
type: UnansweredQuestion
score: -3
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/47411474
has comment: http://stackoverflow.com/comment/47411825
has comment: http://stackoverflow.com/comment/47412142
has comment: http://stackoverflow.com/comment/47411579
downvote count: 3
has comment: http://stackoverflow.com/comment/47411476
type: Question
has title: CSS or Javascript is not showing up on apache web server
has comment: http://stackoverflow.com/comment/47411574
tagged with: javascript
has comment: http://stackoverflow.com/comment/47411484
has answer: http://stackoverflow.com/a/29634794

http://stackoverflow.com/a/29539158
downvote count: 0
has comment: http://stackoverflow.com/comment/47230737
score: 1
has comment: http://stackoverflow.com/comment/47230430
has comment: http://stackoverflow.com/comment/47230679
has comment: http://stackoverflow.com/comment/47230640
accepted answer of: http://stackoverflow.com/q/29538898
upvote count: 1
has body: if you track by .name it will use .name as the identifier, eg if the list changes it will find the ROW by .name If the list will not change, look at one way binding &lt;div ng-repeat="attribute in ::attributes track by $index" &gt; &lt;li&gt; {{attribute.name}} &lt;/li&gt; &lt;/div&gt; -- I am sure that this will give you a DIV around the LI Not related to your Q, but having just done some AngularJS performance tuning. Consider using ng-if instead of ng-show / ng-hide , ng-show/hide will still produce the DOM , ng-if will not. (You may have done this already)
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29538898
has comment: http://stackoverflow.com/comment/47230563
type: Answer

http://stackoverflow.com/q/29584102
has title: Unknown Provider Error on Directive
has comment: http://stackoverflow.com/comment/47316514
has body: I am receiving an unknown provider error on a directive I made. I just began learning about directives so I apologize in advance if I made a very obvious mistake. The directive is supposed to create an element it creates using a factory. The div causing the error: &lt;div annotation-display tree="{{tree}}"&gt;&lt;/div&gt; The directive that angular cannot find: angular.module('trees').directive('annotationDisplay', ['annotationFactory', function(annotationFactory) { return { restrict: 'E', scope: { tree: '=tree' }, transclude: true, compile: function(element, attrs) { var htmlText = annotationFactory.createAnnotationHtml(tree); element.replaceWith(htmlText); } }; }]); The factory: angular.module('trees').factory('annotationFactory', ['', function() { var factory = {}; factory.createAnnotationHtml = function(tree) { console.log("in"); var out = "&lt;p&gt;"; d3.tsv.parseRows(tree.data, function(data) { var previousNERTag = ""; for (var row in data) { var wordData = data[row]; var NERtag = wordData[7].substring(wordData[7].length,3); if (previousNERTag != NERtag) { previousNERTag = NERtag; if (NERtag === "") out+="&lt;/span&gt;"; if (NERtag === "PER") out+='&lt;span class="Person"&gt;'; if (NERtag === "ORG") out+='&lt;span class="Organization"&gt;'; if (NERtag === "LOC") out+='&lt;span class="Location"&gt;'; } } out+='&lt;/p&gt;'; }); return out; }; return factory; }]); I loaded the trees module in the main app and its definitely there because my controller in trees is working fine. Solved, .factory('annotationFactory', ['', function() { to angular.module('trees').factory('annotationFactory', function() {
type: Question
tagged with: angularjs-directive
tagged with: javascript
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47316707
has comment: http://stackoverflow.com/comment/47316464
has comment: http://stackoverflow.com/comment/47317041
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29584157

http://stackoverflow.com/a/29665271
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29665250
accepted answer of: http://stackoverflow.com/q/29665250
has body: It will not create any issue as jQuery library version is same. as per your link both files version is same that means files is same but loads from different server. Main thing is you need to use jQuery library suggested by bootstrap jQuery (necessary for Bootstrap's JavaScript plugins) . you can download that files to your local project folder and use in project it will work fine. jQuery Migrate Plugin &lt;script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"&gt;&lt;/script&gt; jQuery Migrate Plugin simplify the transition from older versions of jQuery. The plugin restores deprecated features and behaviors so that older code will still run properly on jQuery 1.9 and later.
score: 15
upvote count: 15

http://stackoverflow.com/comment/47251643
type: QuestionComment
comment on: http://stackoverflow.com/q/29549883
has text: I thought it would be a good way to dynamically make the accordion so that it can be as big or as small as you want. Is there a better way?
score: 0
type: Comment

http://stackoverflow.com/comment/47217605
type: QuestionComment
has text: How are you passing the created table to the other page? Are you planning to store it locally? Is there any server side code that will do this? How is the other page going to pick up the content? How are you calling the other page? is it a window.open and then you intend to use JavaScript to write contents to it? So many holes... you need to clarify this.
comment on: http://stackoverflow.com/q/29531768
score: 0
type: Comment

http://stackoverflow.com/q/29552060
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/29552135
has answer: http://stackoverflow.com/a/29552162
tagged with: jquery
has comment: http://stackoverflow.com/comment/47255931
possible better answer: http://stackoverflow.com/a/29552162
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29552135
has title: conversion from javascript to jquery
type: Question
has comment: http://stackoverflow.com/comment/47255449
has comment: http://stackoverflow.com/comment/47255482
tagged with: javascript
has body: so i have this javascript code: var a = 7; function addNumber(Number) { document.getElementById("display").value = document.getElementById("display").value + Number; } function calculate() { a = eval(document.getElementById("display").value); document.getElementById("display").value = a; } function erase() { document.getElementById("display").value = ''; } and i made this jquery, but it does not work var $j = jQuery.noConflict(); $j( document ).ready(function() { var a = 7; function addNumber(Number) { $j( "#display").attr( "value", ( $j( "#display").val() + Number )); } function calculate() { a = eval($j( "#display").val()); $j( "#display").attr( "value", a) } function erase() { $j( "#display").attr( "value", ''); } }); the full code on a jsfiddle is here: https://jsfiddle.net/8z6vgnqk/

http://stackoverflow.com/a/29557385
has body: Lets break this down a bit, every time one of your checkboxes changes you create a brand new array $(document).on("change", ".tbl_list", function () { var tbls = []; Then you loop through all the checked checkboxes filling this list $("input:checkbox[name='tbl[]']:checked").each(function () { tbls.push($(this).val()); jquery .each will iterate over all the checkboxes which are checked, it does this in the order they appear in the DOM, not in the order you happen to have checked them in (why would it? how would it know?) If you want to preserrve the order that you checked them in then you need to maintain a persistant list, and push a new item to the end of the list when checked, and remove an item when unchecked.
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/29557118
answers question: http://stackoverflow.com/q/29557118

http://stackoverflow.com/a/29686841
upvote count: 1
has comment: http://stackoverflow.com/comment/47510824
has body: Does your controller also have to have $state as a parameter? Just a guess as everything looks solid to me: controller: function($state) { alert($state.current.name); }
has comment: http://stackoverflow.com/comment/47510865
has comment: http://stackoverflow.com/comment/56143105
downvote count: 0
has comment: http://stackoverflow.com/comment/47510728
answers question: http://stackoverflow.com/q/29686668
type: Answer
has comment: http://stackoverflow.com/comment/47510958
score: 1

http://stackoverflow.com/q/29666843
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
has title: remove file name in IE using JavaScript/jQuery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47472413
tagged with: internet-explorer
has body: I tried executing $('#files').val(''); in IE, but it doesn't clear the file input field. $('#uploadimgdiv').html(''); var fil1 = document.getElementById("files"); $('#fil1').val(''); document.getElementById("files").value =''; document.getElementById("uploadimghid").value ='';
has answer: http://stackoverflow.com/a/29666871
type: Question

http://stackoverflow.com/comment/47569222
type: QuestionComment
comment on: http://stackoverflow.com/q/29662790
score: 0
has text: There is a html option way for sdk i dont know sdk though but its there. The bootstrap way isnt hard if you want to go that way (the one i linked)
type: Comment

http://stackoverflow.com/comment/47496351
has text: exchange the button id with the menu item id, OR get access to the menu and use the down() function. ex: Ext.getCmp("menuItemIdHere").fireEvent('click')
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29657443
type: Comment

http://stackoverflow.com/q/29583062
answer count: 1
downvote count: 1
favorite count: 0
upvote count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29583120
has title: datePicker onSelect function not retrieving classes added before from it-self
type: Question
tagged with: jquery-ui
tagged with: jquery-multidatespicker
tagged with: javascript
tagged with: jquery
score: -1
has body: here is my code onSelect: function (dateText, inst) { inst.inline = false; $(".ui-datepicker-current-day").addClass("markupDate"); } when i inspect html code,class "markupDate" was added to the html element successfully. I select another date,and i check with my onSelect function if the date have already a "markupDate" class.if not i add it. the problem so , that when i click into a date already having class "markupDate" and i ask with jquery if cell have class "markupDate" the result is false. but when inspect element in chrome , $(".ui-datepicker-current-day") have already class "markupDate" !! here is the code onSelect: function (dateText, inst) { //no markupDate class in the result ! console.log(($(".ui-datepicker-current-day").attr("class"))); inst.inline = false; /*result is ever false !*/ if($(".ui-datepicker-current-day").hasClass("markupDate")){ //do something }else{ $(".ui-datepicker-current-day").addClass("markupDate"); } } the code of _selectDay in jquery-ui library is _selectDay: function (a, b, c, d) { var e = $(a); if ($(d).hasClass(this._unselectableClass) || this._isDisabledDatepicker(e[0])) return; /*i put my code here and i return =&gt;my code is working */ var f = this._getInst(e[0]); f.selectedDay = f.currentDay = $("a",d).html(), f.selectedMonth = f.currentMonth = b, f.selectedYear =f.currentYear = c, this._selectDate(a, this._formatDate(f, f.currentDay, f.currentMonth, f.currentYear)) when i add my code directly inside ,and i return before this line: var f = this._getInst(e[0]); onSelect function retrieve if the $(".ui-datepicker-current-day") have class "markupDate" or not. thanks for any help.
tagged with: datepicker

http://stackoverflow.com/comment/47364306
has text: I've found several questions talking about keys/values and strings but nothing getting me on the right track. Appreciate the help. I really didn't want to hardcode this for each column :)
comment on: http://stackoverflow.com/q/29609151
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29540111
score: 1
has body: It is because the submit button is submitting the page, you need to cancel the action. onclick="addPropCall(); return false;"&gt; Ideally you would be using jQuery to attach the events since that is a better practice than inline events. $("[name='addProp']).on("click", addPropCall); and you can use event.preventDefault() function addPropCall (event) { event.preventDefault(); //... }
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29539889
type: Answer
answers question: http://stackoverflow.com/q/29539889
upvote count: 1
has comment: http://stackoverflow.com/comment/47232221

http://stackoverflow.com/q/29620603
has comment: http://stackoverflow.com/comment/47385538
tagged with: javascript
has answer: http://stackoverflow.com/a/29620716
has comment: http://stackoverflow.com/comment/47385690
score: 0
has answer: http://stackoverflow.com/a/29620692
possible better answer: http://stackoverflow.com/a/29620705
has answer: http://stackoverflow.com/a/29620850
has answer: http://stackoverflow.com/a/29620705
answer count: 7
tagged with: jquery
has answer: http://stackoverflow.com/a/29620675
has comment: http://stackoverflow.com/comment/47385322
has title: Click anchor tag with text
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47385275
has answer: http://stackoverflow.com/a/29620683
has body: How do I click an anchor tag with a specific text? Eg I have the following anchors in my page one two three Now, The user enters one. how do I click on the tag whose text is one? I tried this: var uservar='one'; $('a [text=$uservar]').click(); But it doesnt work. Can anyone please help?
accepted answer: http://stackoverflow.com/a/29620692
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29620680
type: Question
has comment: http://stackoverflow.com/comment/47385332

http://stackoverflow.com/comment/47261656
type: Comment
has text: Where is the JavaScript ?
comment on: http://stackoverflow.com/q/29555456
score: 0
type: QuestionComment

http://stackoverflow.com/comment/47506635
type: Comment
type: QuestionComment
has text: No. But you can easily assign the result of the condition to a variable first.
score: 1
comment on: http://stackoverflow.com/q/29684861

http://stackoverflow.com/a/29560238
has body: Try this code it may help you: function myfun() { var a = document.login.user.value; if (a == "" || a == null) { alert("u got it"); return false; } } This is a DEMO fiddle
answers question: http://stackoverflow.com/q/29559669
score: 0
type: Answer

http://stackoverflow.com/q/29581830
tagged with: get
has answer: http://stackoverflow.com/a/29582035
answer count: 2
has title: How to handle a get request with node.js (express)
has answer: http://stackoverflow.com/a/51058123
favorite count: 0
upvote count: 5
tagged with: node.js
type: AnsweredQuestion
downvote count: 0
type: Question
accepted answer: http://stackoverflow.com/a/29582035
score: 5
tagged with: javascript
has body: I'm a node.js newbie and I'm creating my first big app with it (I'm using express). I need to have my webpage perform some javascript canvas-drawing when the user loads an id with a get request, e.g. www.mywebsite.com/page?id=22 I know I can handle this with a simple var express = require("express"); var app = express(); app.get('handle',function(request,response){ //request.id }); but I don't know how to start my webpage with the asked drawing for that id. Every tutorial on the internet on express and get explains how to handle get requests... well this question is about "what happens next?" Rephrased: I'm not sure how should I tell the html page "you need to draw what is associated with this id" from express and then send that page back to the user.
tagged with: express
possible better answer: http://stackoverflow.com/a/51058123

http://stackoverflow.com/comment/47353259
has text: This may not work with complex passwords because the encoding is not set when calling `textToHash.getBytes()`. Therefore on different platforms (Windows, Linux, ..) the result will be different.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29603758

http://stackoverflow.com/comment/47377136
type: Comment
comment on: http://stackoverflow.com/q/29615885
has text: You probably have a good reason to not use jQuery, but note it is going to be a lot harder. The other thing is there are probably jQuery scroll plugins out there that may do what you want. Good luck!
score: 0
type: QuestionComment

http://stackoverflow.com/a/29571685
type: Answer
has body: The element IDs your are trying to match in your code are not the ones in the DOM. // This is what you want to match var domID = "#ctl00_cphMainContent_dlProductList_ct100_ctl00_lnkProofDownload" ^ that is an L // this what your code is trying to match in its first iteration var docID = "#ctl00_cphMainContent_dlProductList_ct10_ctl00_lnkProofDownload";" ^ that is a 1 (one) Also, your code's max variable needs to be a two char numeric string with leading zeros starting at zero, not an integer starting at 10. Personally, I would just: // On DomReady... $(document).ready(function() { // loop through all anchors that have "lnkProofDownload" in their ID attribute $('a[id*="lnkProofDownload"]').each(function() { // and if the text is set to "Download", change it to "View" if ($(this).text() == "Download") { $(this).text("View"); } }); });
downvote count: 1
answers question: http://stackoverflow.com/q/29571350
score: 0
upvote count: 1

http://stackoverflow.com/comment/47233145
has text: Do you refer Highcharts exporting module? In such case remember you can use `chartOptions` and enable that title only for exported chart: http://jsfiddle.net/BETBk/116/ - remember, that exporting doesn't support HTML tags, only SVG.
score: 2
comment on: http://stackoverflow.com/q/29539043
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47350652
type: AnswerComment
has text: If I understand you want to use blank documents as "templates" for you users and then save only the modified version? But then you will have two similar documents in your DB. Maybe it would be better to hard code in your Meteor templates the "default" values, so they are not saved in the database.
comment on: http://stackoverflow.com/a/29591447
type: Comment
score: 0

http://stackoverflow.com/a/29597432
has body: The error: "Error in script ... Error loading the api" typically indicates that there is a syntax issue that needs to be fixed inside the the specified javascript file.
type: Answer
score: 0
answers question: http://stackoverflow.com/q/29596013
accepted answer of: http://stackoverflow.com/q/29596013
type: AcceptedAnswer

http://stackoverflow.com/comment/47491321
comment on: http://stackoverflow.com/q/29656916
type: Comment
type: QuestionComment
score: 0
has text: @user1614080 Thanks a lot. I think I should learn from your example to make the projection correctly. It should be the correct answer. Do you want to "answer the question" and then I can mark it as the answer.

http://stackoverflow.com/q/29556774
has comment: http://stackoverflow.com/comment/47264189
upvote count: 1
has comment: http://stackoverflow.com/comment/47264412
tagged with: jquery-ui
tagged with: javascript
tagged with: jquery
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29717710
downvote count: 0
score: 1
favorite count: 0
has title: JQuery Dialog position beside text box
possible better answer: http://stackoverflow.com/a/29556923
accepted answer: http://stackoverflow.com/a/29717710
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/29556923
has body: I have an html textbox and I want a jquery dialog to show up next to it when I click on a textbox of type "time". For example: What I have so far: HTML: Time &lt;input id="theTime" class="time" name="inputTime" type="text"&gt; JQuery: $(".time").click(function(e) { $( "#dialog-message" ).dialog({ modal: false, buttons: { Ok: function() { $( this ).dialog( "close" ); } }, position: $(this).position() }); $("#dialog-message").dialog("open"); }); The position is wrong with the above code. My dialog is not showing up in the correct position. How do I make it appear right of the textbox like in the picture?

http://stackoverflow.com/q/29593532
has body: How can I globally replace the | (pipe) symbol in a string? When I try to replace it with "so|me|str|ing".replace(/|/g, '-'), I get "-s-o-|-m-e-|-s-t-r-|-i-n-g-"
has answer: http://stackoverflow.com/a/55951625
upvote count: 18
tagged with: regex
has title: How to globally replace pipe symbol "|" in string
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/29593553
type: Question
score: 18
tagged with: javascript
has answer: http://stackoverflow.com/a/63140748
possible better answer: http://stackoverflow.com/a/29593553
has answer: http://stackoverflow.com/a/29593543
accepted answer: http://stackoverflow.com/a/29593543
favorite count: 0
has answer: http://stackoverflow.com/a/29593559
answer count: 5

http://stackoverflow.com/comment/47424755
type: Comment
type: QuestionComment
has text: find the content in this article :http://www.geeksforgeeks.org/check-if-array-elements-are-consecutive/
score: 0
comment on: http://stackoverflow.com/q/29641569

http://stackoverflow.com/comment/47411423
type: Comment
type: QuestionComment
has text: why don't you use `.map()` which iterates over the array. Return the values you want as a object and replace the variable tracks
comment on: http://stackoverflow.com/q/29634531
score: 0

http://stackoverflow.com/comment/47499302
has text: Instead of URL I want to display the page title .
comment on: http://stackoverflow.com/q/29680942
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47325343
comment on: http://stackoverflow.com/a/29588972
type: AnswerComment
score: 0
type: Comment
has text: @Qantas94Heavy moderation isn't close-voting. Close-voting is to be done by all the members of the SO community. What a mod actually does is handle flags and some exceptional cases. Regarding answering this, I'd have used my golden hammer. But the current SO search sucks and when I came across this question, it was *already* answered which according to me was not correct. So answered it.

http://stackoverflow.com/q/29574016
type: Question
has body: I am trying to do a second ajax call when initial ajax post is done, the initial call is a Post and the second call is a get type, on the second call I am able to get the values of url file.php but can't use the returned value as a condition condition parameter. here's a copy of the js: $.ajax({ type: 'POST', url: $(form).attr('action'), data: formData, async: false, cache: false, contentType: false, processData: false, dataType: 'json' }) .done(function() { //SOME UI UPDATES ARE HAPPENNG HERE //SOME OTHER AJAX CALL AFTER INITIAL CALL IS DONE $.ajax({ url: 'progress.php', type: 'GET', data: status, async:false, cache:false }) .done(function(response) { console.log("success"); // GETS STRING VALUE OF PROGRESS.PHP if (response == "success") { //DO SOMETHING ELSE }; }) .fail(function(response) { console.log("error"); }); }) .fail(function() { //console.log("error"); //INITIAL POST ERROR GOES HERE });
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/47296975
has answer: http://stackoverflow.com/a/29574615
type: UnansweredQuestion
has title: Passing Ajax GET response after initial Ajax POST call
tagged with: php

http://stackoverflow.com/comment/84085586
type: AnswerComment
type: Comment
score: 3
has text: I can't see where `newItems` is set.
comment on: http://stackoverflow.com/a/47102075

http://stackoverflow.com/comment/47704311
type: QuestionComment
score: 0
has text: Is there any warning or error in the Browser Console?
comment on: http://stackoverflow.com/q/29685287
type: Comment

http://stackoverflow.com/comment/47442453
score: 0
type: Comment
type: QuestionComment
has text: @isherwood: Thanks for your hint. I was able to improve my code as the following: http://codepen.io/dschu/pen/VYoxjP
comment on: http://stackoverflow.com/q/29651099

http://stackoverflow.com/q/29609379
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47366498
has comment: http://stackoverflow.com/comment/47366343
has title: Android camera doesn't work after cordova compile
type: Question
has comment: http://stackoverflow.com/comment/47373537
tagged with: camera
has comment: http://stackoverflow.com/comment/47373106
has comment: http://stackoverflow.com/comment/47387555
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47374311
favorite count: 0
has body: I just compiled my cordova project to a .apk for android. You can open the (android) camera with a button. When I was debugging my project the camera opened when you clicked on said button, but after compiling the project and installing it on my android smartphone, it wouldn't open the camera anymore. Do you know how to make sure the camera opens, if you need more information, please let me know. The camera opens with this code HTML Capture Photo With Image Data Javascript / JQuery function onPhotoDataSuccess(imageData) { var smallImage = document.getElementById('smallImage'); smallImage.style.display = 'block'; smallImage.src = "data:image/jpeg;base64," + imageData; } function onFail(message) { alert('Failed because: ' + message); } function capturePhotoWithData() { navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 50 }); }
tagged with: android
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47369292
score: 2
tagged with: cordova
answer count: 0
upvote count: 2

http://stackoverflow.com/q/29681415
tagged with: javascript
tagged with: jquery
has title: Run code when click button call source: mutation-summary.js
score: 0
answer count: 1
tagged with: jsp
has body: I write jsp code and run code by tomcat. tag button in tag form . Code JSP like that: 0 ITEM / 0 ITEM / $ 0 VND Mời Bạn Hãy Mua Hàng Của Chúng Tôi Tổng Cộng: $ 0 VND Checkout Add to Cart When i click button have id="addToCart" , then source code in file mutation-summary.js is call return re-load this page. I don't want re-load this page when i click button. I don't no why? And file matation-summary.js is not in my source. Here code when i click button have id="addToCart". $("#addToCart").click(function(event){ $.ajax({ type: "POST", url: "../gioHang", data: dataString, cache: false, success: function (html) { // xử lý lại chỗ này!!! //dataString= 'searchword='+ ''; if(html.indexOf("alert") > 0){ var temp= $(".minicart").children(); $(".minicart").empty(); $(".minicart").append(html); var length= temp.length; var temp2= temp[length-2]; var temp3= temp[length-1]; //$(".minicart").append(temp[1]); $(".minicart").append(temp2); $(".minicart").append(temp3); }else{ $(".minicart").empty(); $(".minicart").append(html); } var dem=1; $(".minicart").click(function(){ if(dem %2 !=0){ $(".cart_drop").css({"display": "block"}); dem=2; }else{ $(".cart_drop").css({"display": "none"}); dem=1; } }); } }); });
has answer: http://stackoverflow.com/a/29682514
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/3314989
tagged with: google-chrome
type: Question

flux
tag name: flux
tags question: http://stackoverflow.com/q/29551775
tags question: http://stackoverflow.com/q/29665414
tags question: http://stackoverflow.com/q/29651329
tags question: http://stackoverflow.com/q/29642758
tags question: http://stackoverflow.com/q/29671827
tags question: http://stackoverflow.com/q/29677779
tags question: http://stackoverflow.com/q/29590050
tags question: http://stackoverflow.com/q/29679096
tags question: http://stackoverflow.com/q/29670112
type: Tag
tags question: http://stackoverflow.com/q/29677551

http://stackoverflow.com/a/29629601
score: 0
has comment: http://stackoverflow.com/comment/47402150
answers question: http://stackoverflow.com/q/29629458
type: Answer
has body: If you perform the following var date = new Date(); window.localStorage.setItem("date", date); var date1 = window.localStorage.getItem("date"); console.log(date1) You will find that date1 is a string. This is because localStorage stores all of its data as strings. You should parse the string by creating a new Date with the returned string.

http://stackoverflow.com/q/29531130
score: 2
has body: I want to change the position of the zoom control to 'topRight'. Following is my code (here coords, zoom, subDomains and attrib are previously defined): var map = L.map('map', {zoomControl: false}).setView([coords.latitude, coords.longitude], zoom); L.control.zoom({ position: 'topRight' }).addTo(map); L.tileLayer(mapquestUrl, { subdomains: subDomains, attribution: attrib, maxZoom: 18 }).addTo(map); This is giving me TypeError: n is undefined in firefox and Uncaught TypeError: Cannot read property 'appendChild' of undefined in chrome. Removing {zoomControl: false} and L.control.zoom({ position: 'topRight'}).addTo(map); is working fine with default control position at top left.
downvote count: 0
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29531994
tagged with: leaflet
accepted answer: http://stackoverflow.com/a/29531994
tagged with: javascript
type: Question
upvote count: 2
answer count: 1
favorite count: 0
has title: Leaflet zoom control position error

http://stackoverflow.com/comment/47316373
score: 0
type: Comment
type: QuestionComment
has text: @FaresM. reordered on the dom in jquery like: `var div = $('#card-box'); var listitems = div.children('div.card').get(); listitems.sort(function (a, b) { return (+$(a).attr('data-id') > +$(b).attr('data-id')) ? -1 : (+$(a).attr('data-id') < +$(b).attr('data-id')) ? 1 : 0; });`
comment on: http://stackoverflow.com/q/29584045

http://stackoverflow.com/comment/48558201
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29542897
has text: I got it to work by using this version http://rawgit.com/metafizzy/isotope-packery/master/packery-mode.pkgd.js also keeping the file structure the same as the download
type: AnswerComment

http://stackoverflow.com/a/29548015
has body: You could use a regular expression to parse the string: /("[^"]+"|[^\s]+)\s*/g With this regular expression, you turn 18.0 8 307.0 130.0 3504. 12.0 70 1 "chevrolet chevelle malibu" into [ "18.0", "8", "307.0", "130.0", "3504.", "12.0", "70", "1", "\"chevrolet chevelle malibu\"" ] You can do this for every line by splitting the contents of the data file by each newline, and then mapping each line to the regular expression: d3.text("http://archive.ics.uci.edu/ml/machine-learning-databases/auto-mpg/auto-mpg.data", function(data) { var lines = data.split('\n'); var results = data.map(function (d) { var match = d.match(regex); return match.slice(1).map(function (d) { return d.trim(); }); }); }); Here is a quick fiddle showing this applied on one row: http://jsfiddle.net/tftdepL4/1/
type: AcceptedAnswer
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/29546997
answers question: http://stackoverflow.com/q/29546997

http://stackoverflow.com/comment/47381959
score: 0
comment on: http://stackoverflow.com/q/29618623
type: QuestionComment
type: Comment
has text: No particular reason for the submit buttons, but they haven't presented any problems on other pages.

http://stackoverflow.com/comment/47382564
comment on: http://stackoverflow.com/q/29618802
has text: there is no php code in the js code. summary is being sent as post no need to add into the button. htmlspecialchars because i need to keep it as html code not filtered text. the " " instead of "" was just a try.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/47495513
score: 0
has text: @GeorgeIrimiciuc please update the question with this information
type: QuestionComment
comment on: http://stackoverflow.com/q/29679016
type: Comment

http://stackoverflow.com/comment/47444257
has text: @user4749485: Why would you want base64 text? And rep is irrelevant. Being helpful is relevant, not rep.
comment on: http://stackoverflow.com/a/29651524
type: AnswerComment
score: 0
type: Comment

ember.js
tags question: http://stackoverflow.com/q/29629173
tags question: http://stackoverflow.com/q/29666048
tags question: http://stackoverflow.com/q/29641274
tags question: http://stackoverflow.com/q/29530831
type: Tag
tags question: http://stackoverflow.com/q/29634920
tag name: ember.js
tags question: http://stackoverflow.com/q/29656111
tags question: http://stackoverflow.com/q/29639943
tags question: http://stackoverflow.com/q/29687656
tags question: http://stackoverflow.com/q/29543803
tags question: http://stackoverflow.com/q/29613054
tags question: http://stackoverflow.com/q/29579399
tags question: http://stackoverflow.com/q/29672404
tags question: http://stackoverflow.com/q/29533031
tags question: http://stackoverflow.com/q/29664891
tags question: http://stackoverflow.com/q/29616889
tags question: http://stackoverflow.com/q/29636032
tags question: http://stackoverflow.com/q/29681466
tags question: http://stackoverflow.com/q/29672975
tags question: http://stackoverflow.com/q/29546664
tags question: http://stackoverflow.com/q/29686809
tags question: http://stackoverflow.com/q/29552226
tags question: http://stackoverflow.com/q/29531782

http://stackoverflow.com/comment/47241294
type: QuestionComment
has text: If you need to understand AngularJS flow , i recommend you [this course] (https://www.codeschool.com/courses/shaping-up-with-angular-js) which is free. Will guide you on the basics and make you do some coding too
score: 0
comment on: http://stackoverflow.com/q/29544779
type: Comment

http://stackoverflow.com/comment/47431881
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29645696
has text: Check `this.tagName`. If it's `INPUT`, check the `type` attribute.

http://stackoverflow.com/q/29667176
has comment: http://stackoverflow.com/comment/47473075
upvote count: 0
tagged with: arrays
tagged with: javascript
has body: I have a JSON code coming from AjaxRequest and I want it to split the object into a string or array in order for me to manipulate the data. Here's my JSON Code [{ "intAccountId": 2733, "strAccountId": "59250-2001", "strDescription": "SOIL TEST &amp; GPS SERVICE-WB", "strNote": null, "intAccountGroupId": 6, "dblOpeningBalance": null, "ysnIsUsed": false, "intConcurrencyId": 1, "intAccountUnitId": null, "strComments": null, "ysnActive": true, "ysnSystem": false, "strCashFlow": null, "intAccountCategoryId": 47 }] The result will something like this. "2733 59250-2001 SOIL TEST &amp; GPS SERVICE-WB"
tagged with: ajax
accepted answer: http://stackoverflow.com/a/29667673
tagged with: extjs
has comment: http://stackoverflow.com/comment/47473174
answer count: 1
favorite count: 0
has title: Splitting JSON into string text
score: -3
linked to: http://stackoverflow.com/q/3593046
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29667673
tagged with: http://stackoverflow.com/tag/json
downvote count: 3
linked to: http://stackoverflow.com/q/45015
has comment: http://stackoverflow.com/comment/47473144
type: Question
has comment: http://stackoverflow.com/comment/47473806

http://stackoverflow.com/comment/124630756
comment on: http://stackoverflow.com/a/70504464
has text: If you think that you want to comment instead of answering then please read https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead and delete this non-answer. If you want to answer instead of commenting please read [answer] and [edit] accordingly.
type: Comment
score: 1
type: AnswerComment

http://stackoverflow.com/comment/47223752
has text: its a static i was created @Mc
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29535391
score: 0

http://stackoverflow.com/a/29594864
type: Answer
accepted answer of: http://stackoverflow.com/q/29594524
answers question: http://stackoverflow.com/q/29594524
upvote count: 2
score: 2
has body: EDIT: The solution i first posted below does not work because of the same-origin-policy regarding iframes, sorry (see here). So - using the solution mentioned in that post - this the a bit more elaborate solution: var overiFrame = false; $('#myCarousel iframe').hover( function() { overiFrame = true; }, function() { overiFrame = false; }); $(window).blur( function() { if(overiFrame){ $('#myCarousel').carousel('pause'); } }); THIS IS NOT WORKING BECAUSE OF THE SAME-ORIGIN-POLICY: $('#myCarousel .item iframe').on('click', function(){ $('#myCarousel').carousel('pause'); }); The best solution, without any hacks like above, would probably be to implement the vimeo JS API and use that to register PLAY and PAUSE events on the video.
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47336857

http://stackoverflow.com/a/29703546
has body: So this is how we can detect the rendering of a page. It's important to wait for the iframe contents to load before setting up the listener. $( "#iframeViewPdf" ).load(function() { // wait for iframe to load var frameDoc = $("#iframeViewPdf").contents()[0]; frameDoc.addEventListener("pagerendered", function (evt) { console.log(evt.detail); }); });
downvote count: 0
answers question: http://stackoverflow.com/q/29663408
score: 1
upvote count: 1
type: Answer

jointjs
tags question: http://stackoverflow.com/q/29676792
type: Tag
tag name: jointjs

geocode
tags question: http://stackoverflow.com/q/29686976
tags question: http://stackoverflow.com/q/29666093
tags question: http://stackoverflow.com/q/29565720
tag name: geocode
type: Tag

http://stackoverflow.com/a/29536097
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/29536018
upvote count: 5
has body: Loop over the array and get the specified property from each element. use them as the keys in an object to get rid of the duplicates, and then return the keys of that object. var arr = [ { "cod": 0, "level": "INF" },{ "cod": 1, "level": "INF" },{ "cod": 2, "level": "INC" },{ "cod": 3, "level": "IND" } ]; function different_values(array, property) { var values_seen = {}; // for removing duplicates for (var i = 0; i &lt; array.length; i++) { values_seen[array[i][property]] = true; } return Object.keys(values_seen); } alert(JSON.stringify(different_values(arr, 'level')));
accepted answer of: http://stackoverflow.com/q/29536018
has comment: http://stackoverflow.com/comment/47224810
downvote count: 0
score: 5

http://stackoverflow.com/comment/47291671
type: Comment
has text: Glad i could help :-) Regarding your last problem, i think setting `max-height: 100%;` would help!
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29568862

http://stackoverflow.com/comment/47363568
score: 0
type: AnswerComment
type: Comment
has text: It works in jsfiddle but for some reason it is giving me the jsfiddle datepicker with another datepicker on top of it. It's behaving very strangely on my code
comment on: http://stackoverflow.com/a/29607622

http://stackoverflow.com/a/29578620
has comment: http://stackoverflow.com/comment/47355228
has comment: http://stackoverflow.com/comment/47354718
score: 0
has comment: http://stackoverflow.com/comment/47352842
answers question: http://stackoverflow.com/q/29578373
has body: You can add a function on your factory which get distinct dish categories : getCategories: function() { var categories = [], o = {}; angular.forEach(factory.dishes, function (value, key) { if (o.hasOwnProperty(value.dishCategory)) { return; } categories.push(value.dishCategory); o[value.dishCategory] = true; }); return categories; } Then inject that factory to your controller, and call that function: wmapp.controller('dishTypeListController', function ($scope, $rootScope, dishesFactory) { "use strict"; $scope.selection = []; $scope.categories = dishesFactory.getCategories(); }) Check this plunker.
type: Answer
has comment: http://stackoverflow.com/comment/47306712

http://stackoverflow.com/q/29531011
has comment: http://stackoverflow.com/comment/47215647
has comment: http://stackoverflow.com/comment/47218443
has body: I am opening a ngDialog. In this dialog, I have a link which will be also opened in same ngDialog with refreshing the content or open another ngDialog by closing first one. My code is as follows: app.controller('Main', ['$scope','$http','$location','ngDialog','$rootScope','$route','applicazioneFactory', function($scope, $http,$location, ngDialog,$rootScope,$route,applicazioneFactory) { $scope.runjs = function(e,pd) { e.preventDefault(); tp = (-1)* jQuery(window).scrollTop(); tp1 = jQuery(window).scrollTop(); //jQuery(e.target).offset().top+300 jQuery('.minDiv').css({position:'fixed',top:tp}) $last = $location.url(); $location.path(pd.slug,false); $scope.slug = pd.slug ; $scope.id = pd.ID ; //ngDialog.closeAll(); $scope.catId = pd.terms.category[0].ID ; var modalInstance = ngDialog.open({ templateUrl: myLocalized.partials + 'content.html', controller: 'Content', scope:$scope, size:'lg' }); $rootScope.$on('ngDialog.closed', function (e, $modalInstance) { if($location.url() != $last) $last = $location.url(); $location.path($last,false); $scope.$apply(); }); return false; } }]) app.controller('Content', ['$scope', '$routeParams', '$http','$sce','$location','ngDialog','$rootScope', function($scope, $routeParams, $http,$sce,$location,ngDialog,$rootScope) { $http.get(theme_url+'show-social-count.php?slug_url='+ url+$scope.slug).success(function(res){ $scope.facebook = res.facebook; $scope.twitter = res.twitter; }) $scope.runjs = function(e,pd) { e.preventDefault(); tp = (-1)* jQuery(window).scrollTop(); tp1 = jQuery(window).scrollTop(); //jQuery(e.target).offset().top jQuery('.minDiv').css({position:'fixed',top:tp}) $last = $location.url(); $location.path(pd.slug,false); $scope.slug = pd.slug ; $scope.id = pd.ID ; //ngDialog.closeAll(); $scope.catId = pd.terms.category[0].ID ; ngDialog.close('ngdialog1'); var modalInstance = ngDialog.open({ templateUrl: myLocalized.partials + 'content.html', controller: 'Content', scope:$scope, size:'lg' }); $rootScope.$on('ngDialog.closed…
type: Question
tagged with: javascript
tagged with: jquery
has title: Opening ngDialog on click a link inside a opened ngDialog in angular js
score: 0
answer count: 0
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/comment/47304350
has text: in a first article in portfolio....family house 1
score: 0
comment on: http://stackoverflow.com/q/29577791
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47431042
type: AnswerComment
has text: Yes. Did I write "like a blog"? :D Sorry.
type: Comment
comment on: http://stackoverflow.com/a/29613546
score: 0

http://stackoverflow.com/q/29608229
has body: Need some help with my code, I can't get my alerts to work with my countdown timer. They should be alerting at 4,3,2 minutes left on the timer. I currently can't get the alerts to fire at all, sometimes they would fire but each second after 4, the alert for "4" would fire. I need it to just go once... Any help would be appreciated Heres my script var running=false var endTime=null var timerID=null function startTimer(){ running=true now=new Date() now=now.getTime() endTime=now+(1000*60*5) showCountDown() } function showCountDown(){ var now=new Date() now=now.getTime() if (endTime-now&lt;=239990 &amp;&amp; endTime-now&gt;240010){alert("4")}; if (endTime-now&lt;=179990 &amp;&amp; endTime-now&gt;180010){alert("3")}; if (endTime-now&lt;=119990 &amp;&amp; endTime-now&gt;120010){alert("2")}; if (endTime-now&lt;=0){ stopTimer() alert("Time is up. Put down pencils") } else { var delta=new Date(endTime-now) var theMin=delta.getMinutes() var theSec=delta.getSeconds() var theTime=theMin theTime+=((theSec&lt;10)?":0" : ":")+theSec document.forms[0].timerDisplay.value=theTime if (running){ timeID=setTimeout("showCountDown()",1000) } } } function stopTimer(){ clearTimeout(timeID) running=false document.forms[0].timerDisplay.value="0.00" } Update, Sorry meant minutes instead of seconds Update 2: Change the ifs, now they fire but keep firing after the 4 second mark if (endTime-now&lt;=240010 &amp;&amp; endTime-now&lt;=239990){alert("4")}; if (endTime-now&lt;=180010 &amp;&amp; endTime-now&lt;=179990){alert("3")}; if (endTime-now&lt;=120010 &amp;&amp; endTime-now&lt;=119990){alert("2")};
has answer: http://stackoverflow.com/a/29612045
has comment: http://stackoverflow.com/comment/47365351
has comment: http://stackoverflow.com/comment/47362147
type: Question
has answer: http://stackoverflow.com/a/29608883
tagged with: javascript
score: 0
has title: JS- Countdown Timer Alerts
answer count: 2
has comment: http://stackoverflow.com/comment/47364688
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47362240
has comment: http://stackoverflow.com/comment/47362125

http://stackoverflow.com/comment/47248851
type: QuestionComment
score: 0
has text: possible duplicate of [Programmatically click a button using jquery](http://stackoverflow.com/questions/19732664/programmatically-click-a-button-using-jquery)
type: Comment
comment on: http://stackoverflow.com/q/29548560

http://stackoverflow.com/comment/47303963
has text: i want that its always hided when #first-project is active.
comment on: http://stackoverflow.com/q/29577791
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/47349698
has text: can you just give me this in normal html form. Not using helpers. I just want to see how would I write remote:true in simple html `<%= link_to 'Bookmark it', bookmark_request_path(request), remote: true %>`
type: Comment
comment on: http://stackoverflow.com/a/29596274
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47507325
score: 0
comment on: http://stackoverflow.com/q/29684416
type: Comment
type: QuestionComment
has text: The way I read those comments from experienced users, they seem to mostly be in favor of using WebStorm with VS. We use them both together.

http://stackoverflow.com/q/29666588
type: Question
has body: I am applying these classes If the drop-down is getting selected. if(elem_to_disable.parent().prop('tagName') != 'SELECT') { //alert("its not a dropdown!"); elem_to_disable.prop("disabled", true) .prop("checked", false) .addClass("a") .closest(".b") .prepend("&lt;div class='c'/&gt;"); } else { //alert("it is a dropdown"); elem_to_disable.prop("disabled", true) .prop("checked", false) .addClass("a") .closest(".b") //.prepend("&lt;div class='c'/&gt;"); } Now on change, I want to remove all these classes for the dropdown options, i.e. the classes which are getting applied for else, remove those classes on change. How do I go about it, Please help..
has answer: http://stackoverflow.com/a/29666638
tagged with: javascript
score: -1
answer count: 3
has comment: http://stackoverflow.com/comment/47472028
downvote count: 1
has answer: http://stackoverflow.com/a/29666788
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47472025
has title: .removeClass() on change for dropdowns
upvote count: 0
has answer: http://stackoverflow.com/a/29666761

http://stackoverflow.com/q/29565918
has body: I'm involved in an OSS project that provides mutation testing for Javascript - basically testing unit test effectiveness by mutating the code that the unit test tests. An inevitable effect of mutating code is that you may run into endless loops: while(var i=0; i&lt;10; i++){...} could become while(var i=0; i&lt;10; i--){...} While some basic mutations (such as this one) can be excluded it is not possible (nor IMO desirable) to exclude every mutation that could possibly cause an infinite loop. Instead I have been focusing on detecting an infinite loop, terminating the current mutation test with a warning and continuing with the next mutation. In Karma, however I run into a problem: a loop like the above will keep the browser occupied and send your CPU to 100%. When I try to shut down the Karma server I get the following error: Fatal error: socket hang up Process finished with exit code 3 This not only kills my parent process, thus leaving all remaining mutations untested, but also leaves child processes (I'm running a small pool of karma server instances) dangling which I then have to kill manually. I've been struggling with this for quite some time now and it feels like I've hit a concrete wall. Any help is very much appreciated. How to reproduce? If you want more information/context, feel free to check out the project at https://github.com/jimivdw/grunt-mutation-testing/tree/kill_looping_karma_servers In that branch I have a file called script_endlessLoop.js which, when mutated, causes an infinite loop on a number of occasions. I have disabled mutations for now by adding @excludeMutations, so that needs to be removed or modified. Then running grunt test:karma should give you the above error. Please be careful! Make sure you clean up all node related processes after running this as it could cause your computer to slow down severely
score: 0
has comment: http://stackoverflow.com/comment/47294367
tagged with: javascript
tagged with: node.js
has comment: http://stackoverflow.com/comment/47301357
tagged with: karma-runner
answer count: 0
type: UnansweredQuestion
has title: Node.js: shutting down Karma server kills parent process
tagged with: unit-testing
tagged with: mutation-testing
type: Question

http://stackoverflow.com/q/29553406
favorite count: 0
tagged with: twitter-bootstrap
has title: How to set a javascript function to onchange action in boostrap dropdown?
upvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29553876
score: 1
has comment: http://stackoverflow.com/comment/47258056
has comment: http://stackoverflow.com/comment/47259285
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
has body: This is my boostrap drop down query. <% try { ResultSet r = DB.JDBC.getConnection().createStatement().executeQuery("select name from item "); while (r.next()) { %> <%=r.getString("name")%> <% } } catch (Exception e) { e.printStackTrace(); } finally { if (DB.JDBC.getConnection() != null) { DB.JDBC.getConnection().close(); } } %> It search item name in db. Now I want to do even when it's value clicked. I tried a code. But no output. I searched boostrap description also. But couldn't find an answer please help me.
accepted answer: http://stackoverflow.com/a/29553876
downvote count: 0
tagged with: drop-down-menu

http://stackoverflow.com/comment/47298764
type: AnswerComment
has text: @saina also you forgot to add the closing bracket `}` at the end of the `for` loop.
comment on: http://stackoverflow.com/a/29574948
type: Comment
score: 0

http://stackoverflow.com/q/29655141
has body: HTML &amp; PHP &lt;?for($i=1;$i&lt;=10;$i++){?&gt; &lt;input type='textbox' style="width:100%" name='name[]' id = 'name&lt;?echo $i;?&gt;'&gt; &lt;?}?&gt; Javascript for(var i=1;i&lt;="?";i++){ if(document.getElementById('name'+i).value != "") { alert("text_if"); }else{ alert("text_else"); } } In the textbox don't have value (mean "") so "" != "" return false alert text_if but it's not working don't alert all. i try "" == "" it's working why != not working please help me Okay it's working now but i have loop but i don't know max of element because i have function add&amp;del textbox (create element)
answer count: 3
downvote count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47450148
type: UnansweredQuestion
has title: javascript if("" != "") not working
upvote count: 0
has comment: http://stackoverflow.com/comment/47450304
has comment: http://stackoverflow.com/comment/47450232
has answer: http://stackoverflow.com/a/29655358
has comment: http://stackoverflow.com/comment/47450149
type: Question
has answer: http://stackoverflow.com/a/29655230
has answer: http://stackoverflow.com/a/29655321
tagged with: javascript
has comment: http://stackoverflow.com/comment/47450828
score: -1

http://stackoverflow.com/a/29685173
answers question: http://stackoverflow.com/q/29683412
has body: Based on the value of size you may set the style(fontSize,width,height etc.) and the labelAnchor { var showOnStartInfoWindows = true; //create locations.. var arrayAll = []; var marker = []; var jax = new google.maps.LatLng(30.318028, -81.674474); var leesburg = new google.maps.LatLng(28.810750, -81.880056); var map = null; arrayAll[0] = { loc: jax, size: 5000, info: "Jacksonville, FL 32204" }; arrayAll[1] = { loc: leesburg, size: 1000, info: "Leesburg, FL" }; //EO create locations.. } function initialize() { //center the map on Jacksonville var mapProp = { center: arrayAll[0].loc, zoom: 6, mapTypeId: google.maps.MapTypeId.ROADMAP }; //set google's API and pass the DIV by ID. map = new google.maps.Map(document.getElementById("googleMap"), mapProp); var bounds = new google.maps.LatLngBounds(leesburg, jax); map.fitBounds(bounds); var maxSize = 0; for (var i = 0; i &lt; arrayAll.length; i++) { if (maxSize &lt; arrayAll[i].size) maxSize = arrayAll[i].size; } for (var i = 0; i &lt; arrayAll.length; i++) { var size = Math.round((arrayAll[i].size / maxSize) * 100); //create MarkerWithLabel marker[i] = new MarkerWithLabel({ labelInBackground:false, position: arrayAll[i].loc, map: map, title: 'Right-Click to zoom all the way in.\nLeft-Click to zoom to a state level.', labelAnchor: new google.maps.Point((size * 1.8) / 2, (size / 3)), labelClass: "googleLabel", // the CSS class for the label labelStyle: { width: (size * 1.8) + 'px', height: (size / 1.5) + 'px', lineHeight: (size / 1.5) + 'px', fontSize: (size / 1.5) + 'px' }, labelContent: arrayAll[i].size, icon: { path: google.maps.SymbolPath.CIRCLE, fillOpacity: 0.6, fillColor: 'gold', strokeOpacity: 1.0, strokeColor: '#0000ff', strokeWeight: 1.0, scale: size, //pixels } }); marker[i].setMap(map); } } { google.maps.event.addDomListener(window, 'load', initialize); } html, body, #googleMap { margin: 0; padding: 0; height: 100%; } .googleLabel { color: #000; font-weight: bold; text-align: center; } &lt;script src="http://maps.…
accepted answer of: http://stackoverflow.com/q/29683412
has comment: http://stackoverflow.com/comment/47508425
has comment: http://stackoverflow.com/comment/47508194
type: AcceptedAnswer
score: 0
has comment: http://stackoverflow.com/comment/47552971
type: Answer

http://stackoverflow.com/a/29543172
type: Answer
has body: Paste it in your index page and run it!!!
answers question: http://stackoverflow.com/q/29540765
score: 0

http://stackoverflow.com/q/29581621
answer count: 1
downvote count: 0
tagged with: javascript-automation
has answer: http://stackoverflow.com/a/29611822
has title: How can I get the frontmost Safari document or tab in JavaScript Automation?
favorite count: 0
type: UnansweredQuestion
tagged with: osx-yosemite
tagged with: macos
tagged with: applescript
score: 2
has body: I would like to access the frontmost tab being displayed in Safari and retrieve the URL using the JavaScript Automation scripting in Yosemite Script Editor. I can get the first window, first tab url using code like: Application('Safari').windows[0].tabs[0].url() I can't figure how to find which window and tab is actually the one being displayed frontmost currently though.
upvote count: 2
type: Question
tagged with: javascript

http://stackoverflow.com/comment/47513328
type: Comment
has text: `$("#callme").maybe()`
comment on: http://stackoverflow.com/a/29688060
score: 0
type: AnswerComment

http://stackoverflow.com/a/29684314
downvote count: 0
has body: You have a parameter shops in ProductsCtrl, but there is nothing that will pass a value for it, so it is going to be null. You set the value of $scope.shopList to it, and then try to iterate over a NULL array, so you get an exception. You can store the values of shops in a service, and then pass them around your app via injection. You can initialize their values within main.js, or within the service itself, and then the values will be available if you inject them into ProductsCtrl, something like angular.module('lightpointTestApp') .controller('ProductsCtrl', ['$scope', '$routeParams', 'shopsService', function ($scope, $routeParams, shopsService) { $scope.shopList = shopService; $scope.shop = {}; $scope.getShop = function (id) { for (var i = 0; i &lt; $scope.shopList.length; i++) { if ($scope.shopList[i].id === id) { return $scope.shopList[i]; } } return null; }; var shopID = $routeParams.shopID; $scope.shop = $scope.getShop(shopID); }]); shopsService could look something like angular.module('lightpointTestApp') .service('shopsService', function() { return [ // add whatever fields you need here from code in main.js { name: 'shop1', address: 'addr1' }, { name: 'shop2', address: 'addr2' } ]; });
has comment: http://stackoverflow.com/comment/47507908
answers question: http://stackoverflow.com/q/29683657
score: 1
accepted answer of: http://stackoverflow.com/q/29683657
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47508051
has comment: http://stackoverflow.com/comment/47508551
has comment: http://stackoverflow.com/comment/47507464
upvote count: 1
has comment: http://stackoverflow.com/comment/47509045
type: Answer
has comment: http://stackoverflow.com/comment/47507689
has comment: http://stackoverflow.com/comment/47507560

http://stackoverflow.com/q/29594778
has comment: http://stackoverflow.com/comment/47337232
has comment: http://stackoverflow.com/comment/47336469
has comment: http://stackoverflow.com/comment/47337296
has comment: http://stackoverflow.com/comment/47336828
has comment: http://stackoverflow.com/comment/47337188
has title: Recursive function to find first alphabetic character
has comment: http://stackoverflow.com/comment/47336483
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47337246
tagged with: javascript
has comment: http://stackoverflow.com/comment/47337382
has comment: http://stackoverflow.com/comment/47336557
type: Question
has answer: http://stackoverflow.com/a/29595009
score: 0
accepted answer: http://stackoverflow.com/a/29595009
has comment: http://stackoverflow.com/comment/47336891
has comment: http://stackoverflow.com/comment/47336526
answer count: 1
has comment: http://stackoverflow.com/comment/47336925
has comment: http://stackoverflow.com/comment/47336518
has body: I have Javascript code where I take a large piece of text, separate it at each period, load it into an array, and remove any html tags using replace(). Then, I need to use a recursive function to find the first alphabetic character in the string because I want to put specific formatting on the first alphabetic character. To me, it should be at substring(0,1)... ...the problem is, I came across this issue where the first alphabetic character is usually substring(2,3) but not always. So I wrote the recursive function below. The problem is the character at 0,1,2, and sometimes 3 is not a blank space but it's not an alphabetic character. If I do eval(), it's 'undefined'. But my recursive function is failing when I eval() after the 'undefined' characters. I'm missing something but not sure what. Any ideas how I can test for those first characters that are 'undefined'? I suppose they are a result of the replace(). function getFirstLetter(text,count){ // If first time calling the function, count will be null so set to 0 if(count == null){ count = 0; } // Get the character at the count index thisChar = eval(text.charAt(count)); // Is this character the first alphabetic character? If so, return // Here's where the problem occurs...I've noticed that the function // will return 'undefined' for the first few non-alphabetic characters // but then it stops at the first alphabetic character, no idea why if(thisChar != 'undefined' &amp;&amp; thisChar != null){ return count; }else{ // If not, call the function again for the next index getFirstLetter(text,count+1); } } Example array text: Here is a line of text, Here is the next line, And the next line But if I check each of the first characters, I don't get an alphabetic character or a blank space. When I do alert(array.charAt(0)) I get an alert with nothing in it. There's no blank space in the alert.

http://stackoverflow.com/comment/47364353
has text: Is the success callback fired?
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29609321
type: Comment

http://stackoverflow.com/q/29650978
has body: I've built a very simply slider with Angular like so: $scope.slider = {}; $scope.slider.pane = 1; $scope.slider.auto = true; var slider = function(){ $timeout(function(){ if ($scope.slider.pane === 4) $scope.slider.pane = 1; else $scope.slider.pane ++; slider(); }, 4000); } slider(); The slider function creates a timeout loop to change the value of slider.pane every 4s. In the HTML I have a link that when clicked sets the value slider.auto to false. Stop slider When this is clicked, it needs to stop the timeout loop. It may be in the middle of a cycle at the time, so I need to clear the timeout, but it's inside a function so not sure how to access it.
possible better answer: http://stackoverflow.com/a/29651204
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/47442018
tagged with: timeout
has answer: http://stackoverflow.com/a/29651341
type: Question
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/29651204
tagged with: angularjs
answer count: 3
has comment: http://stackoverflow.com/comment/47441870
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29651149
has title: Clear Angular timeout inside function
has comment: http://stackoverflow.com/comment/47441662
linked to: http://stackoverflow.com/q/21018796
upvote count: 3
has answer: http://stackoverflow.com/a/29651149

http://stackoverflow.com/a/29651159
type: Answer
has body: Try this https://truongtx.me/2014/06/16/cross-tab-communication-using-html5-dom-storage/ Pretty good explanation for cross-tab communication with local/session storage Every time the Localstorage is changed the Storage event is called.
downvote count: 0
has comment: http://stackoverflow.com/comment/47442042
score: 1
accepted answer of: http://stackoverflow.com/q/29651063
has comment: http://stackoverflow.com/comment/47442191
upvote count: 1
answers question: http://stackoverflow.com/q/29651063
type: AcceptedAnswer

http://stackoverflow.com/q/29659159
has comment: http://stackoverflow.com/comment/47458794
tagged with: apache
tagged with: javascript
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/47458447
score: 0
has answer: http://stackoverflow.com/a/29659283
answer count: 1
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47458919
tagged with: php
has title: Page loading issue. Apache + PHP + AJAX
type: Question
has comment: http://stackoverflow.com/comment/47458518
has body: I have a particularly slow loading web-page: https://uberdice.com/index.php It's quite resource heavy so I expect some wait, but not as bad as this. The content of the page is a script I have bought and developed on. It seems the original developer added in the function below and I think that is what is slowing down the page significantly. Once the page loads the cron works quietly in the background and is useful so I don't really want to get rid of it. I'm thinking that if I edited some sort of Timeout in apache then the page would appear quicker? function imitateCRON() { $.ajax({'url': './content/ajax/getDeposits.php'}); $.ajax({'url': './content/ajax/getDepositsrdd.php'}); $.ajax({'url': './content/ajax/getDepositsbtc.php'}); } You can see the diagnosis of the page here: http://tools.pingdom.com/fpt/#!/d2D10z/https://uberdice.com/index.php Does anyone have any ideas or solutions to make it load quicker? Thanks. EDIT: I've commented all the cron stuff out and it's still taking ages. I guess I'm just going to have to try and find out what's causing it. Thanks for the help.

http://stackoverflow.com/comment/47480308
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29670924
has text: The session is constantly refreshed by those ajax calls. It most probably never times out unless you put in additional checks.

http://stackoverflow.com/comment/72924164
score: 2
comment on: http://stackoverflow.com/a/29640715
type: AnswerComment
has text: `You might see a few milliseconds of difference when it comes to performance speeds`. A few milliseconds by a few thousand or million items adds up pretty fast. In my own tests (when deciding on .map vs for) I found that iterating over large sets of data would take nearly an order of magnitude longer using map. For consistencies sake, I write for loops everywhere else. This is also advantageous, as developers from other languages can jump right in and know what is going on.
type: Comment

http://stackoverflow.com/comment/47300202
score: 3
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29575886
has text: The scrollbar is a native GUI widget. Unless you're myspace2, why would you do this to your users?

http://stackoverflow.com/comment/47394866
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29623887
has text: Because a) you may interfere in the submission by submitting while submitting. b) some browsers will see you disabled the submit button and will then not submit

http://stackoverflow.com/comment/47263655
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29556510
has text: I can use .on('click',...) or mousedown to emulate focus, but how can I detect blur in that way ?
score: 0

http://stackoverflow.com/a/29557515
has comment: http://stackoverflow.com/comment/47384622
has comment: http://stackoverflow.com/comment/47451430
has comment: http://stackoverflow.com/comment/47450860
has comment: http://stackoverflow.com/comment/47414887
has body: You can open a connection via SSH with the "Secure Shell2" PHP module. https://php.net/manual/en/book.ssh2.php // open a SSH connection (hostname = IP or network name of the remote computer) $connection = ssh2_connect('hostname', 22); // authenticate by login / password ssh2_auth_password($connection, 'username', 'password'); and then execute a command : // execute a shell command on the remote computer (eg. 'php -v' to know the PHP version) $stream = ssh2_exec($connection, 'php -v'); // read the result from the remote computer to your local computer stream_set_blocking($stream, true); $stream_out = ssh2_fetch_stream($stream, SSH2_STREAM_STDIO); // print the result in your local computer echo stream_get_contents($stream_out);
type: Answer
has comment: http://stackoverflow.com/comment/47451958
score: 2
has comment: http://stackoverflow.com/comment/47448865
has comment: http://stackoverflow.com/comment/47526847
has comment: http://stackoverflow.com/comment/47272017
has comment: http://stackoverflow.com/comment/47520623
accepted answer of: http://stackoverflow.com/q/29557196
upvote count: 3
has comment: http://stackoverflow.com/comment/47425584
answers question: http://stackoverflow.com/q/29557196
type: AcceptedAnswer
downvote count: 1

http://stackoverflow.com/a/29580236
type: Answer
answers question: http://stackoverflow.com/q/29580190
downvote count: 1
has comment: http://stackoverflow.com/comment/47309259
has body: It's good you're learning regex but this is overkill as you can easily leverage javascript's vast supernatural powers. It will be faster and in most cases readable than the equivalent the regex. Exclude Batman at your own cost :) Here's how you do it, without regex. I'm sure someone will post regex answer too. Okay, enough of bullshit, here's the code: var words = input.split(" ").filter(function(str){ return str.toLowerCase() !== "batman"; });
upvote count: 5
has comment: http://stackoverflow.com/comment/47309273
score: 4

http://stackoverflow.com/comment/47288165
score: 1
comment on: http://stackoverflow.com/a/29569107
type: AnswerComment
type: Comment
has text: My guess I'd because the link may end up 'dead' in future, where as relevant quoted text will always be available?

http://stackoverflow.com/q/29559482
favorite count: 0
has comment: http://stackoverflow.com/comment/47269079
has comment: http://stackoverflow.com/comment/47271388
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47269193
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47270370
has comment: http://stackoverflow.com/comment/47269154
answer count: 0
has comment: http://stackoverflow.com/comment/47342214
has comment: http://stackoverflow.com/comment/47342057
has comment: http://stackoverflow.com/comment/47269275
type: Question
has comment: http://stackoverflow.com/comment/47271075
has comment: http://stackoverflow.com/comment/47269711
tagged with: javascript
has comment: http://stackoverflow.com/comment/47268903
tagged with: substring
has body: I am trying to make a news preview from a separate file (text.html) I want to be able to just display the first 100 characters of a div (id="news"). I don't want to use Ajax or Php. Here is my code, not sure how to make it work, thanks guys.
score: 0
linked to: http://stackoverflow.com/q/17947971
linked to: http://stackoverflow.com/q/21848540
has comment: http://stackoverflow.com/comment/47269033
upvote count: 1
has title: making and appending a substring from getElementById
tagged with: getelementbyid
downvote count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/47269784

http://stackoverflow.com/q/29542798
has comment: http://stackoverflow.com/comment/47237374
has comment: http://stackoverflow.com/comment/47237345
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/29542936
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29542984
has answer: http://stackoverflow.com/a/29542936
has body: Trying to get this factory recognised in my other controllers so i can inject a result object into them. myApp.factory('resultService', function(){ function SampleService() { this.result = []; } }); This the the code in my controller with some removed that isn't purpose to the question. myApp.controller('125Zero', ['$scope','ngAudio', function($scope, ngAudio, SampleService){ $scope.buttonPressed= function() { var tempObj = {}; tempObj.title = $scope.title; tempObj.frequency = $scope.frequency; console.log(tempObj); SampleService.result.push($scope.tempObj); } }]); I keep receiving TypeError: Cannot read property 'result' of undefined. i understand its probably something silly i've missed.
type: Question
has title: Can't get factory or service to be recognized in controller
tagged with: javascript
has answer: http://stackoverflow.com/a/29542901
accepted answer: http://stackoverflow.com/a/29542901
score: 0
answer count: 3
tagged with: single-page-application

http://stackoverflow.com/comment/47250051
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29549006
has text: They do it because it is easy solution to certain problems but in your case, as your website gets more complicated, it might cause positioning problems that will drive you crazy. Anyway please check the second link in the solution. It will help you nest a elements in anyway you want but it uses Jquery

http://stackoverflow.com/comment/47478469
has text: See my last comment in answer... the whole thing is wrong, hence needing to know what you want to happen :)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29670022
type: Comment

http://stackoverflow.com/q/29537801
favorite count: 0
downvote count: 0
type: UnansweredQuestion
has title: JS/DOM optimization: using :after content styling instead of altering innerHTML
score: 3
has answer: http://stackoverflow.com/a/35361171
has comment: http://stackoverflow.com/comment/58192954
tagged with: dom
type: Question
has body: Basically, given that all possible contents of an element are known in advance, you can use a bunch of :after content styles instead of altering the innerHTML of the element. Just change the class to get new content. My profiling in Chrome indicates that this does improve performance a bit, but I'm not entirely sure, as the cost might then be hidden somewhere else? And I'm not sure if it's a bad idea for other browsers besides Chrome. Any thoughts on this? Please note that the context here is for 60 frames per second simulations/visualisations, so in this context 2 vs 4 milliseconds is a big and significant difference, which it might not be in the context of a page load. Example styles for numbering can be seen here: https://github.com/magwo/elevatorsaga/blob/2fa5dc0c0397d0565ce5dcc45c68b19d924a4955/style.css#L290
answer count: 1
tagged with: javascript
tagged with: optimization
upvote count: 3
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/comment/47361008
comment on: http://stackoverflow.com/a/29607351
score: 0
type: AnswerComment
has text: Perhaps creating a function like the following which you call at the start of every click? $( "#button" ).click(function() { $( ".animatedElement" ).stop(); });
type: Comment

http://stackoverflow.com/q/29669376
downvote count: 0
has comment: http://stackoverflow.com/comment/47477065
type: Question
has answer: http://stackoverflow.com/a/29669638
tagged with: javascript
has comment: http://stackoverflow.com/comment/47477299
has answer: http://stackoverflow.com/a/29669476
upvote count: 2
answer count: 3
tagged with: jquery
has body: I have a DIV where I adjust the font size in CSS depending on the viewport size: font-size:1em; @media only screen and (min-width: 300px) { font-size:2em; } @media only screen and (min-width: 600px) { font-size:3em; } However, I also have Javascript that changes the font size depending on whether or not the user scrolls down. $(window).scroll(function () { if ($(this).scrollTop() &gt; 1) { $('#div').css('font-size', '1em'); } else { $('#div').css('font-size', '3em'); } }); The problem is, after the user has scrolled down and up again at least once, the Javascript has set the font-size to 3em, and the @media declarations no longer apply. Is it possible to make it so that in the Javascript else clause, the style reverts back to what is declared in the CSS and @media conditions?
favorite count: 0
has answer: http://stackoverflow.com/a/29669656
accepted answer: http://stackoverflow.com/a/29669656
has title: Is it possible to return to a CSS media query declaration from Javascript?
possible better answer: http://stackoverflow.com/a/29669638
has comment: http://stackoverflow.com/comment/47477332
tagged with: css
score: 2
type: AnsweredQuestion

http://stackoverflow.com/a/29586514
downvote count: 0
has body: You should call the delay before the fadeToggle method and if you want to show the images one by one you can use the index of the element in the set: // using fadeIn() method images.each(function(index) { // since the indices are zero-based // the first element is shown without delay // you can add 1 to the index: 10000 * ++index $(this).hide().delay(10000 * index).fadeIn(5000); A suggestion: function simpleAdvert() { var section = $('.advert'); var images = section.find('img').hide(); images.each(function(index) { $(this).delay(10000 * index).fadeIn(5000); }); }
type: Answer
answers question: http://stackoverflow.com/q/29586320
score: 1
has comment: http://stackoverflow.com/comment/47321136
upvote count: 1
has comment: http://stackoverflow.com/comment/47321258

http://stackoverflow.com/comment/47275503
comment on: http://stackoverflow.com/q/29562830
type: QuestionComment
type: Comment
has text: Probably the way browsers handle input in a different way than terminals - the new line in HTML is achieved using a line break tag (` `), not sure exactly what happens with the backspace, it might be just trying to move the cursor.
score: 0

http://stackoverflow.com/comment/47507662
type: Comment
type: QuestionComment
has text: Thanks Tim! I didn't mean to use an irrelevant term... I know Excel VBA is an entirely different domain from Google Sheets Script. I used the tag on the basis that both are Spreadsheets... My bad!
comment on: http://stackoverflow.com/q/29680988
score: 0

http://stackoverflow.com/comment/47254490
type: Comment
has text: That's true, and the difference is that `textarea` is not a *void* element (needs a closing ` `) therefore the innerHTML shares the same string with it's `value` property.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29551537

http://stackoverflow.com/comment/47484310
score: 0
type: QuestionComment
type: Comment
has text: Why are you changing `$wrapper.css('padding-top')` why not just leave it? Try removing the `$body._reposition` function's contents
comment on: http://stackoverflow.com/q/29670776

http://stackoverflow.com/q/29677973
favorite count: 0
tagged with: ajax
possible better answer: http://stackoverflow.com/a/29678051
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29678072
accepted answer: http://stackoverflow.com/a/29678072
downvote count: 1
type: Question
score: 3
has answer: http://stackoverflow.com/a/29678051
has title: Success callback on .load() complete
tagged with: javascript
upvote count: 4
answer count: 2
has body: How can I run another function based on success of .load I am doing the following to load a PHP file: $( ".sidebar-size" ).load( "&lt;?php bloginfo('stylesheet_directory'); ?&gt;/sidebar-short.php" ); I want to run another javascript function called gaLinks when the above .load is complete, in a similar way to using .success or .complete Is this possible?
tagged with: jquery

http://stackoverflow.com/comment/47430596
score: 0
comment on: http://stackoverflow.com/q/29641619
has text: Could you show how you are calculating the initial ping positions? If the pins are inside `main` (which I assume is a `g` or `svg` element), then you shouldn't need to change `x` and `y` at all when you `scale` the the container. Also, you might want to set the [scaleExtent](https://github.com/mbostock/d3/wiki/Zoom-Behavior#scaleExtent) instead of manually checking for `scale >= 1`. That would give you a better behavior as well (i.e. no hysteresis in zooming if the user zooms out too much).
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/73970759
type: Comment
score: 6
comment on: http://stackoverflow.com/a/29726413
has text: is it just me, or when using this to hit a deep url directly, I always get redirected to the "to" url, instead of the route I'm trying to hit?
type: AnswerComment

http://stackoverflow.com/q/29556203
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/29556413
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29556306
tagged with: javascript
tagged with: jquery
has title: Trigger an event on keydown using a specific key
has body: I'm trying to use the keydown method to trigger an event in a webpage, for this specific example I need it to be triggered by the X key. I have searched for a little bit now and am getting confused on how to get it to recognize the X key is being pressed. I'm looking for the key code of 88. Here was my code any advice? $(document).ready(function() { $('.ryu').mouseenter(function() { $('.ryu-still').hide(); $('.ryu-ready').show(); }) .mouseleave(function() { $('.ryu-ready').hide(); $('.ryu-still').show(); }) .mousedown(function() { console.log('mousedown'); // play hadouken sound playHadouken(); //show hadouken and animate it to the right of the screen $('.ryu-ready').hide(); $('.ryu-throwing').show(); $('.hadouken').finish().show().animate( {'left': '1020px'}, 500, function() { $(this).hide(); $(this).css('left', '625px'); } ); }) .mouseup(function() { console.log('mouseup'); //ryu goes back to his ready position $('.ryu-throwing').hide(); $('.ryu-ready').show(); }) .keydown(function() { if (keyCode = 88) { $('.ryu-ready').hide(); $('.ryu-cool').show(); } }) .keyup(function() { if (keyCode = 88) { $('.ryu-cool').hide(); $('.ryu-still').show(); } }) function playHadouken () { $('#hadouken-sound')[0].volume = 0.5; $('#hadouken-sound')[0].load(); $('#hadouken-sound')[0].play(); } })

http://stackoverflow.com/a/31192753
has comment: http://stackoverflow.com/comment/50390861
has comment: http://stackoverflow.com/comment/50390842
has body: This doesn't really answer the question as I originally asked it, but this is what I ended up doing to solve the problem described above, so whatever. In the end, I abandoned the idea of using chrome.storage (the space restrictions on chrome.storage.sync were untenable) and instead wrote my extension using PouchDB, which is a Javascript implementation of CouchDB. PouchDB uses IndexedDB internally, which does have a per-extension limit by default (I think 5 MB? I didn't bother to test), but can be granted unlimited storage by setting the "unlimitedStorage" permission in the extension manifest. PouchDB's storage model is significantly superior to the chrome.storage storage model in basically every way (free revision tracking, a documented sync protocol rather than whatever voodoo chrome.storage.sync does, etc.), and the downsides (an extra dependency, need for a separate remote server [see below], etc.) were not a huge issue for me. I spun up a free EC2 micro instance and installed a CouchDB server on it. CouchDB is a little bit finicky to configure, but works well once that's taken care of. My EC2 instance stopped being free after a year, so I switched to Cloudant, which offers CouchDB-compatible hosting that's free if you use less than $50 worth of storage + bandwidth per month, which I do. I set my extension to point at my Cloudant instance, have it authenticate using plain old HTTP basic authentication (which is fine here, since I'm the only person using this extension, which means I'm free to put my password in plaintext in the extension), and have it sync with the remote instance when requested by the user. The authentication approach I took here (in conjunction with the deployment strategy [see below], etc.) probably has a bunch of holes, but I don't really care; it seems sufficient to stop casual intrusions, which is good enough (I'm not dealing with important or privileged data). Rather than deploying my extension via the Chrome store, which seems complicated…
has comment: http://stackoverflow.com/comment/50390457
score: 15
answers question: http://stackoverflow.com/q/29567879
upvote count: 15
downvote count: 0
has comment: http://stackoverflow.com/comment/50390489
has comment: http://stackoverflow.com/comment/114232765
type: Answer

http://stackoverflow.com/comment/47487873
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29674646
has text: sorry came up with something while going thru your comments. " The image data itself will be stored twice in memory " --> is there ways to clear the memory when a function is completed?

http://stackoverflow.com/a/29535902
accepted answer of: http://stackoverflow.com/q/29534463
has comment: http://stackoverflow.com/comment/69412523
answers question: http://stackoverflow.com/q/29534463
type: AcceptedAnswer
downvote count: 0
score: 3
type: Answer
has body: $(function () { $('#datepicker').datetimepicker({ pickTime: false, format: 'DD-MM-YYYY', pickTime: false, defaultDate: moment(), minDate: moment(), maxDate: moment().add(10,'y'), showClose: true, autoclose: true, keepOpen: false }); $('.date-setter').click(function() { alert('jj'); $('#datepicker').data("DateTimePicker").setDate('03-05-2016'); }); });
has comment: http://stackoverflow.com/comment/71134034
upvote count: 3

http://stackoverflow.com/comment/47378089
comment on: http://stackoverflow.com/q/29616350
has text: To be clear: None of these click methods works, and the screenshot does not show the modal? Does `casper.exists('[data-js="company-search-view-jobs-button-reg"]')` return true? Note that Casper is (probably) not using the same DOM selector machinery as jQuery, so jQuery giving you the right element doesn't guarantee Casper can find it with the same selector.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29639416
answer count: 2
has body: Ok so I'm working on a restaurant app design and want to be able to stick the tabs with the category names right below the "now serving breakfast" block then as you scroll down to the next category I would like it to replace the category name tab with the current one. Similar to how Instagram have the username tab while scrolling down the newsfeed. http://codeclimb.com/menus2/index2.html Any ideas on what javascript can get this done?
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29639822
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0
score: 2
has answer: http://stackoverflow.com/a/29639750
upvote count: 2
type: UnansweredQuestion
has title: Make Tabs Stick To Top Of Div
type: Question

http://stackoverflow.com/comment/47474698
has text: What's the problem with the code you're using? It seems to work well in the fiddle example.
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29668068

http://stackoverflow.com/comment/47220052
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29533413
type: AnswerComment
has text: As far as I can see `keyup()` is called repetitively too while typing, so I end up generating a bunch of "Lening x" rows don't I? As jQuery documentation states `The keyup event is sent to an element when the user releases a key on the keyboard.`

twitter-bootstrap
tags question: http://stackoverflow.com/q/29631826
tags question: http://stackoverflow.com/q/29608997
tags question: http://stackoverflow.com/q/29555250
tags question: http://stackoverflow.com/q/29621848
tags question: http://stackoverflow.com/q/29662779
tags question: http://stackoverflow.com/q/29653111
tags question: http://stackoverflow.com/q/29654978
tags question: http://stackoverflow.com/q/29610073
tags question: http://stackoverflow.com/q/29643510
tag name: twitter-bootstrap
tags question: http://stackoverflow.com/q/29599661
tags question: http://stackoverflow.com/q/29614887
tags question: http://stackoverflow.com/q/29669347
tags question: http://stackoverflow.com/q/29541526
tags question: http://stackoverflow.com/q/29619644
tags question: http://stackoverflow.com/q/29640578
tags question: http://stackoverflow.com/q/29633157
tags question: http://stackoverflow.com/q/29627031
tags question: http://stackoverflow.com/q/29611899
tags question: http://stackoverflow.com/q/29646745
tags question: http://stackoverflow.com/q/29601953
tags question: http://stackoverflow.com/q/29635076
tags question: http://stackoverflow.com/q/29541908
tags question: http://stackoverflow.com/q/29667289
tags question: http://stackoverflow.com/q/29544473
tags question: http://stackoverflow.com/q/29682493
tags question: http://stackoverflow.com/q/29630174
tags question: http://stackoverflow.com/q/29594236
tags question: http://stackoverflow.com/q/29656153
tags question: http://stackoverflow.com/q/29638832
tags question: http://stackoverflow.com/q/29678828
tags question: http://stackoverflow.com/q/29658850
tags question: http://stackoverflow.com/q/29626410
tags question: http://stackoverflow.com/q/29660559
tags question: http://stackoverflow.com/q/29571439
tags question: http://stackoverflow.com/q/29591025
tags question: http://stackoverflow.com/q/29631251
tags question: http://stackoverflow.com/q/29686357
tags question: http://stackoverflow.com/q/29540046
tags question: http://stackoverflow.com/q/29654108
tags question: http://stackoverflow.com/q/29590975
tags question: http://stackoverflow.com/q/29571578
tags question: http://stackoverflow.com/q/29571232
tags question: http://stackoverflow.com/q/29570386
tags question: http://stackoverflow.com/q/29537132
tags question: http://stackoverflow.com/q/29564450
tags question: http://stackoverflow.com/q/29544307
tags question: http://stackoverflow.com/q/29669879
tags question: http://stackoverflow.com/q/29669497
tags question: http://stackoverflow.com/q/29538561
tags question: http://stackoverflow.com/q/29666449
tags question: http://stackoverflow.com/q/29605316
tags question: http://stackoverflow.com/q/29636505
tags question: http://stackoverflow.com/q/29686269
tags question: http://stackoverflow.com/q/29584974
tags question: http://stackoverflow.com/q/29553268
tags question: http://stackoverflow.com/q/29595243
tags question: http://stackoverflow.com/q/29546366
tags question: http://stackoverflow.com/q/29650227
tags question: http://stackoverflow.com/q/29580249
tags question: http://stackoverflow.com/q/29590513
tags question: http://stackoverflow.com/q/29556183
tags question: http://stackoverflow.com/q/29570807
tags question: http://stackoverflow.com/q/29621725
tags question: http://stackoverflow.com/q/29559901
tags question: http://stackoverflow.com/q/29534455
tags question: http://stackoverflow.com/q/29655237
tags question: http://stackoverflow.com/q/29663380
tags question: http://stackoverflow.com/q/29561346
tags question: http://stackoverflow.com/q/29542634
type: Tag
tags question: http://stackoverflow.com/q/29584353
tags question: http://stackoverflow.com/q/29636931
tags question: http://stackoverflow.com/q/29566358
tags question: http://stackoverflow.com/q/29686425
tags question: http://stackoverflow.com/q/29546363
tags question: http://stackoverflow.com/q/29624245
tags question: http://stackoverflow.com/q/29588698
tags question: http://stackoverflow.com/q/29598682
tags question: http://stackoverflow.com/q/29563691

http://stackoverflow.com/a/29624642
downvote count: 0
has body: The issue is because your CSS rule for .activeMenu is not specific enough to override the colour set on the a element. You need to make the rule more specific: .activeMenu a { color: red; } Or set !important on it. The former is better practice. Example fiddle
answers question: http://stackoverflow.com/q/29624546
type: Answer
upvote count: 3
score: 3
accepted answer of: http://stackoverflow.com/q/29624546
has comment: http://stackoverflow.com/comment/47392828
type: AcceptedAnswer

http://stackoverflow.com/q/29575399
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/29575449
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47299314
has title: How to make div expand width 100% responsively?
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0
accepted answer: http://stackoverflow.com/a/29575449
upvote count: 1
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29575447
score: 1
has answer: http://stackoverflow.com/a/29575447
has body: I have two div's (left, right). The content in the left div will be empty for some pages/requests; and I would like to hide the left div for such requests. When the left div is hidden/ removed, I want the right div to fill the entire page. To achieve this is I'm using table-cell. It works but when I remove the left div the right div width changes from full page (100%) to content width. HTML testjjj test test test test test test test test made in test made in test madein CSS #main{width:100%;border:1px solid red; position:relative } #left { display: table-cell; width:100px; vertical-align:middle; text-align:center; background:red } #right { display: table-cell; width:100%; vertical-align:middle; background:lightblue; text-align:left; } If you remove the left div, right div width is fixed to content width. Is there any other way instead of passing min-width to right div ? Here is a fiddle with 2 divs. Here is a fiddle with only the right div. How to make right DIV width 100% irrespective to content?

http://stackoverflow.com/comment/47444573
comment on: http://stackoverflow.com/a/29652371
type: Comment
has text: thanks i will try and let you know .. thanks for help
score: 0
type: AnswerComment

http://stackoverflow.com/q/29551888
type: UnansweredQuestion
tagged with: highcharts
answer count: 0
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47259076
has comment: http://stackoverflow.com/comment/47263408
type: Question
has body: I'm making a chart with highcharts.js but I find it difficult when the chart is displayed not in accordance with the existing data. I have created a chart on JSFiddle. $(function () { $('#container').highcharts({ chart: { zoomType: 'xy' }, credits: { enabled: false }, title: { text: '' }, colors: ['#ff0000', '#18b55b'], xAxis: [{ categories: ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Agu', 'Sep', 'Okt', 'Nov', 'Des'] }], yAxis: [{ min: 0, labels: { enabled: false }, title: { text: '', } }, { min: 0, title: { text: '', }, labels: { formatter: function () { return this.value + '%'; } } }], plotLines: [{ value: 0, width: 10, color: '#808080' }], tooltip: { shared: true, useHTML: true, formatter: function () { var s = ' '; $.each(this.points, function () { s += '' + this.y + '%' + this.point.value + ' '; }); return s; }, footerFormat: ' ', }, legend: { backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF' }, series: [{"name":"Aktual","type":"column","yAxis":1,"data":[{"y":0,"value":""},{"y":0,"value":""},{"y":12.06 ,"value":" - 122,890,156"},{"y":2.66,"value":" - 27,080,668"},{"y":0,"value":""},{"y":0,"value":""}, {"y":0,"value":""},{"y":0,"value":""},{"y":0,"value":""},{"y":0,"value":""},{"y":0,"value":""},{"y":0 ,"value":""}]},{"name":"Plan","type":"spline","data":[{"y":0,"value":""},{"y":0,"value":""},{"y":2.17 ,"value":""},{"y":2.17,"value":""},{"y":0,"value":""},{"y":0,"value":""},{"y":0,"value":""},{"y":0,"value" :""},{"y":0,"value":""},{"y":0,"value":""},{"y":0,"value":""},{"y":0,"value":""}]}] }); });
has comment: http://stackoverflow.com/comment/47259772
upvote count: 1
has title: data with the chart does not fit in highcharts js
has comment: http://stackoverflow.com/comment/47267639
tagged with: charts

http://stackoverflow.com/a/29636936
answers question: http://stackoverflow.com/q/29533254
upvote count: 5
type: Answer
has body: I think you're misunderstanding how the socket.io works. You would never listen to your CI view. You would always be sending messages to (and receiving messages from) the NodeJS server on port 8000. Codeigniter's views are simply static, and there is no reason to "listen" to it since it will only load once. The key point from that answer you referenced: users will use codeigniter URL and when open the page, i have this script on my CI view page that connects to my Nodejs app Therefore, you load your browser with the CI view, then listen for events from the NodeJS server through the JavaScript in your CI view. You can then also push events to the NodeJS server from the JavaScript in your CI view.
has comment: http://stackoverflow.com/comment/47434958
score: 4
has comment: http://stackoverflow.com/comment/47452734
downvote count: 1

http://stackoverflow.com/comment/47415076
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29636404
has text: Have you inspected the output to make sure that the missing numbers aren't just being cut off in their div?

http://stackoverflow.com/comment/47269231
score: 0
type: Comment
type: QuestionComment
has text: press the '0' button for 3 seconds and release
comment on: http://stackoverflow.com/q/29559529

http://stackoverflow.com/comment/47281249
comment on: http://stackoverflow.com/q/29565740
has text: Should the dog.uber allow to print Charles too?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29631101
score: 0
has body: You must use either onclick attribute or the jquery code at a time, right now using both of them at a time causes this issue. try following code &lt;div id="reviewInfo"&gt; &lt;button type="button" class="close" id="hide"&gt;&amp;times;&lt;/button&gt; &lt;p&gt;Hello&lt;/p&gt; &lt;/div&gt; JS $(document).ready(function(){ $("#hide").click(function(){ if (confirm("Are your sure ?")) { $("#reviewInfo").hide(); } }); });
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29630685
has comment: http://stackoverflow.com/comment/47405211
type: Answer
accepted answer of: http://stackoverflow.com/q/29630685

http://stackoverflow.com/a/29613081
answers question: http://stackoverflow.com/q/29610770
has comment: http://stackoverflow.com/comment/47373613
type: Answer
has body: Step 1: Find center of polygon using average position of points This function will find the center given all the points in the drawing, independent of order: function findCenter(points) { var x = 0, y = 0, i, len = points.length; for (i = 0; i < len; i++) { x += points[i].x; y += points[i].y; } return {x: x / len, y: y / len}; // return average position } Demo showing center point in polygon /** * Created by knguyen on 4/13/2015. */ var pointsArray = []; var canvas = document.getElementById("myCanvas"); var context = canvas.getContext("2d"); function Point(x, y) { this.x = x; this.y = y; } function drawDot(e) { var position = getMousePosition(canvas, e); posx = position.x; posy = position.y; storeCoordinate(posx, posy); context.fillStyle = "#F00"; context.fillRect(posx, posy, 6, 6); } function getMousePosition(c, e) { var rect = canvas.getBoundingClientRect(); return {x: e.clientX - rect.left, y: e.clientY - rect.top} } function storeCoordinate(xVal, yVal) {pointsArray.push(new Point(xVal, yVal))} $("#solve").click( function() { var p = findCenter(pointsArray); context.fillStyle = "green"; context.fillRect(p.x, p.y, 4, 4); } ); function findCenter(points) { var x = 0, y = 0, i, len = points.length; for (i = 0; i < len; i++) { x += points[i].x; y += points[i].y; } return {x: x / len, y: y / len}; // return average position } #myCanvas {border: 1px solid #000} Show center point Step 2: Sort points based on angle Extend the point object to also take an angle argument. Iterate trough the point array Calculate the angle relative to the center point Sort array based on angle To find the angles just calculate the angle relative to the center point. Here is how: function findAngles(c, points) { var i, len = points.length, p, dx, dy; for (i = 0; i < len; i++) { p = points[i]; dx = p.x - c.x; dy = p.y - c.y; p.angle = Math.atan2(dy, dx); } } Then you have to sort the points based on angle using a custom sort function. Just use the standard sort() method on the array and suppl…
has comment: http://stackoverflow.com/comment/47373224
score: 12
has comment: http://stackoverflow.com/comment/47372978
upvote count: 12
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29610770

http://stackoverflow.com/q/29657606
favorite count: 0
has answer: http://stackoverflow.com/a/29658734
type: UnansweredQuestion
tagged with: requirejs
upvote count: 1
has body: tl;dr The issue I am seeing is my initial page (Index.cshtml) has some Knockout code (indexViewModel.js) that is called that initially should be hiding a div on load, but for a few brief seconds the div is indeed not hidden b/c the Knockout code hasn't evaluated yet. Background &amp; Issue I just began refactoring my site to use RequireJS. It is an ASP.NET MVC 5 application which uses KnockoutJS, jQuery, and a few jQuery &amp; JavaScript plugins. Everything worked great prior to the RequireJS refactor. Now when the user loads the Index, the spinner (data-bind="showSpinner" which is false) is shown to the user for about 3 seconds and then the Knockout code is loaded and realizes it should be hidden so then it hides. So I am wondering how to prevent this "flashing" of hidden elements from happening? In Angular you could do ng-cloak, but I haven't found that equivalent for Knockout or Require. I know there are some hacks I could do to initially hide things until all modules are loaded, but I don't want to hack my entire application just so things are hidden by default. My code Here is my basic setup for my site, using RequireJS, Knockout, jQuery, &amp; ASP.NET MVC. Index.cshtml &lt;div data-bind="showSpinner"&gt; &lt;img src="/Content/spinner.gif" /&gt; &lt;/div&gt; &lt;!-- at the bottom of my Index.cshtml I have this section below which renders the script at the very bottom of the entire DOM, via ASP.NET MVC `render scripts`--&gt; @section scripts { &lt;script&gt; var d = @Html.Raw(Json.Encode(Model)); require( [ "/Scripts/app/common.js" ], function() { require( [ "app/offers/index"], function(view) { view.init(d); }); }); &lt;/script&gt; } common.js require.config({ baseUrl: "/Scripts/", paths: { "jquery": "jquery-1.11.2", "underscore": "underscore.min", "knockout": "knockout-3.3.0.debug", "komapping": "knockout.mapping-latest", "noUiSlider": "jquery.nouislider.all", "bootstrap": "bootstrap" }, shim: { "komapping": { deps: ['knockout'], exports: 'komapping' }, "noUiS…
score: 1
tagged with: knockout.js
type: Question
has title: RequireJS not hiding KnockoutJS bindings until loading of everything complete
answer count: 1
tagged with: javascript
downvote count: 0

http://stackoverflow.com/comment/47309463
type: Comment
has text: does it log the data to your console? Maybe try targeting the element you want to update using an id
score: 0
comment on: http://stackoverflow.com/q/29580511
type: QuestionComment

http://stackoverflow.com/q/29640432
has answer: http://stackoverflow.com/a/74906360
downvote count: 1
tagged with: jquery
score: 61
favorite count: 0
upvote count: 62
has answer: http://stackoverflow.com/a/52757901
has title: generate 4 digit random number using substring
has answer: http://stackoverflow.com/a/64485045
has answer: http://stackoverflow.com/a/29640468
has answer: http://stackoverflow.com/a/68852292
answer count: 15
has answer: http://stackoverflow.com/a/57001501
has answer: http://stackoverflow.com/a/71050808
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/45551032
has answer: http://stackoverflow.com/a/45551032
has answer: http://stackoverflow.com/a/29640526
type: Question
accepted answer: http://stackoverflow.com/a/29640472
has body: I am trying to execute below code: var a = Math.floor(100000 + Math.random() * 900000); a = a.substring(-2); I am getting error like undefined is not a function at line 2, but when I try to do alert(a), it has something. What is wrong here?
has comment: http://stackoverflow.com/comment/47422709
has answer: http://stackoverflow.com/a/72010160
tagged with: javascript
has comment: http://stackoverflow.com/comment/47422658
has answer: http://stackoverflow.com/a/29640507
has answer: http://stackoverflow.com/a/29640472
has answer: http://stackoverflow.com/a/73261034
has answer: http://stackoverflow.com/a/68850664
has answer: http://stackoverflow.com/a/29640605

http://stackoverflow.com/a/29574326
has body: xhr.open('POST', './upload.php', true); When you're making a request to ./upload.php, you can process the uploaded file in that PHP script. if you're planning to refresh those uploaded files in your WinSCP ftp software, then PHP script would not help you refresh it automatically. You need to manually refresh. Because the ftp tools doesn't have socket feature to update the files list automatically. you need to refresh them manually.
answers question: http://stackoverflow.com/q/29574288
has comment: http://stackoverflow.com/comment/47298139
has comment: http://stackoverflow.com/comment/47310528
has comment: http://stackoverflow.com/comment/47298429
type: Answer
has comment: http://stackoverflow.com/comment/47298371
score: 0
has comment: http://stackoverflow.com/comment/47298040
has comment: http://stackoverflow.com/comment/47298296

http://stackoverflow.com/a/29602719
has body: Try this code: Untitled 1 Feedback Student Name Goes Here (delete) Student Feedback Goes Here Name Feedback
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29593444
type: Answer
has comment: http://stackoverflow.com/comment/47352302
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29593444

http://stackoverflow.com/q/29666682
type: Question
tagged with: internet-explorer
tagged with: javascript
has comment: http://stackoverflow.com/comment/47472944
tagged with: caching
has comment: http://stackoverflow.com/comment/47472661
has comment: http://stackoverflow.com/comment/47472509
score: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
answer count: 0
has body: Everyone. I'm developing a webpage containing a real-time camera image. So what I've tried is let tag in HTML src keep add a random number like this: setInterval(function () { document.getElementById("IMG").src = "/live_pic/XXX.jpg?time=" + new Date().getTime(); }, 300); It works fine in IE11,Chrome and FireFox on Windows 7. The XXX.jpg resource's content's changing 5 different real-time camera pictures per second. And now here's the thing: It doesn't work in IE10, IE9 and IE8. If I stop the "setInterval" function, displaying a fixed image on HTML are fine. But once I try "setInterval" function, it can't find any resouce. Is it about cache setting in IE? I've tried adding to set no-cache or no-store, like this: &lt;meta http-equiv="Cache-Control" content="no-store" /&gt; &lt;meta http-equiv="Pragma" content="no-store" /&gt; &lt;meta http-equiv="Expires" content="-1" /&gt; It's still not working. Can somebody give me any hint,please? Thanks a lot!
has title: Displaying a Real-time img on HTML in IE10, 9 and 8
tagged with: internet-explorer-10

http://stackoverflow.com/a/29654957
has comment: http://stackoverflow.com/comment/47450870
score: 1
has comment: http://stackoverflow.com/comment/47450819
has comment: http://stackoverflow.com/comment/47450843
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47451080
downvote count: 0
upvote count: 1
has body: use below code. check DEMO. you need to set font-size as attribute. $(document).ready(function(){ $("#text"+x).on('click',function(){ $(this).attr("font-size", "50"); alert('it is I'); }); }); or if you are adding svg element dynamically use below code $(document).ready(function(){ $(document).on('click',"#text"+x,function(){ $(this).attr("font-size", "50"); alert('it is I'); }); });
type: Answer
accepted answer of: http://stackoverflow.com/q/29654775
has comment: http://stackoverflow.com/comment/47450466
answers question: http://stackoverflow.com/q/29654775
has comment: http://stackoverflow.com/comment/47450915
has comment: http://stackoverflow.com/comment/47450953

http://stackoverflow.com/comment/47329884
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29590956
type: Comment
has text: When I entered my code in and tried to run it, it came up with a new error.... {"error": "Please use POST request"}

http://stackoverflow.com/comment/47441345
has text: How about: ` Hello Plunker! `. So use one expression for each element of an array and return a string with class name or empty. I don't think you will be able to use filters that way though.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29648487
type: Comment

http://stackoverflow.com/a/29546300
has comment: http://stackoverflow.com/comment/47246918
has comment: http://stackoverflow.com/comment/47273572
has comment: http://stackoverflow.com/comment/47245992
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47246992
has comment: http://stackoverflow.com/comment/47249515
has comment: http://stackoverflow.com/comment/47246873
type: Answer
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/47247276
accepted answer of: http://stackoverflow.com/q/29544852
has body: Your articleList should be an observableArray in your view model with a binding in the view for that. var viewModel = { articleList: ko.observableArray([]), pins: ko.observableArray([ new mapPin("Alaska Communications", 61.196148, -149.885577, "test11"), new mapPin("Moose's Tooth", 61.190491, -149.868937, "test2") ]), }; First make a little DTO: function article(content, url) { var self = this; self.content = content; self.url = url; } When you get the data back from our ajax call, first clear the array: viewModel.articleList.removeAll(); Then just loop through and do something like this: viewModel.articleList.push(new article(articleStr, url)); Do the formatting in your view with a binding like this: &lt;!-- ko foreach: articleList --&gt; &lt;li&gt;&lt;a data-bind="attr: {href: url}, text: content"&gt;&lt;/a&gt;&lt;/li&gt; &lt;!-- /ko --&gt;
has comment: http://stackoverflow.com/comment/47247296
answers question: http://stackoverflow.com/q/29544852

http://stackoverflow.com/comment/47453791
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29656849
has text: Can you explain first why you are writing the entire modal code in javascript ? Why not write the modal in plain HTML/PHP, that way when the page loads it will have the value of the database call ready to show in the modal

http://stackoverflow.com/a/29602897
has comment: http://stackoverflow.com/comment/47397296
has comment: http://stackoverflow.com/comment/47352451
upvote count: 1
has comment: http://stackoverflow.com/comment/47351616
has body: You might be better off changing your approach. Use a service for the years, and add a 'selected' attribute to the year object you return. Then use ng-repeat to iterate over those objects and display the colour based on the value of that attribute, for each item in the ng-repeat. Then your selectedYear method can live in the service and simply switch which object has selected=true set. The data bindings will take care of the rest. There are lots of ways to do this depending on you code's syntax and structure, but something like the following could work (untested): var module = angular.module('myapp', []); module.service('yearService', function(){ this.years = [ { 'display': '2012', 'selected': false }, { 'display': '2013', 'selected': false }, { 'display': '2014', 'selected': false }, { 'display': '2015', 'selected': true }, { 'display': '2016', 'selected': false }, { 'display': '2017', 'selected': false }, { 'display': '2018', 'selected': false } ]; this.selectYear = function selectYear(year) { // iterate through the years and set only the // selected one to true, others to false }; }); make sure you inject the service into your controller, and assign it to scope (say, as yearService, and {{year.display}} Note I've assumed a base CSS class of .year instead of the style tag, but used your existing .slectedYear class. Your HTML could do with a rewrite too - please get rid of the table! EDIT: I forgot to add the dynamic class - added now.
has comment: http://stackoverflow.com/comment/47351692
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/29602421
has comment: http://stackoverflow.com/comment/47353296
score: 1

http://stackoverflow.com/a/29545903
has body: Try making a function that returns a function: function negate(other) { return function(v) {return !other(v)}; }; Used like this: var result = _.filter(bag, negate(evens)); Or just declare a function when you call it: var result = _.filter(bag, function(v) {return evens(v)});
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29545858
answers question: http://stackoverflow.com/q/29545858
score: 4
has comment: http://stackoverflow.com/comment/47244040
type: AcceptedAnswer
type: Answer
upvote count: 4

http://stackoverflow.com/comment/47515490
has text: @Adrian - getting in the practice of doing that is just not a smart thing to do. If you want to declare something as global from a non-global location, then do the `window.x = xxx` trick rather than leave off `var` and the code will be completely obvious what it intends. Leaving off `var` is just a bad practice and prevents you from using strict mode. It should never be recommended.
type: Comment
comment on: http://stackoverflow.com/a/29687853
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47303943
score: 0
type: Comment
has text: I think the OP talks about the difference between localStorage and sessionStorage. Both are on client. http://stackoverflow.com/a/15166867/1064270
type: AnswerComment
comment on: http://stackoverflow.com/a/29577395

http://stackoverflow.com/comment/47373586
has text: Should that be `distance = events[k].location?`
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29613976

http://stackoverflow.com/q/29569222
has comment: http://stackoverflow.com/comment/47297437
type: Question
tagged with: highcharts
tagged with: javascript
score: 0
has body: Here's the issue: http://jsfiddle.net/w64j0Ld5/1/ for (i; i &lt; data.length; i += 1) { series1.addPoint(data[i], false, true); series2.addPoint(data[i], false, true); } chart.redraw(); Notice that I have 2 data series and I'm adding data dynamically. Watch the 'chart min' change as you add data....makes perfect sense....new data in, old data out. Now hit the 'All' filter (or slide the left handle of the navigator to the left) and watch the chart min revert back to what it was originally....but I don't see the old chart min in the chart... With one data series, it works perfectly: http://jsfiddle.net/w64j0Ld5/3/ (you can't slide the left handle of the navigator to the left as the old data is GONE as it should be!) Any ideas how to fix this?
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47348649
has comment: http://stackoverflow.com/comment/47693267
has title: Highstock navigator minimum acts weird on series.addPoint when 1+ series

http://stackoverflow.com/q/29584287
has body: Over the last few days, I've been working on a script that interacts with a particular site. A page on the site has a table of values that is randomized every reload. I've learned that I can load the page with JQuery's $.get( ) method and then use regex to read the values of the elements, but I can't figure out how to press a button on the page. I'm not sure how I could select an element then call the normal .click( ) method on it, or if that would even work at all. Basically, what I want to accomplish is: Get a new (reloaded) version of the page. Read values from an element on the page. Click a button on the page. Keep repeating previous 3 steps. How can I make this happen (with or without JQuery)? EDIT: So it seems this is difficult/impossible to do from another page, but it works if I'm on the page. Knowing that, is there a way that I can repeating reload the page without disrupting the javascript running on it?
has comment: http://stackoverflow.com/comment/47316993
has title: JS: How to repeatedly reload page, read element values, then click button
has comment: http://stackoverflow.com/comment/47316870
has comment: http://stackoverflow.com/comment/47316890
type: UnansweredQuestion
upvote count: 1
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29584321
tagged with: reload
has comment: http://stackoverflow.com/comment/47316920
answer count: 1
has comment: http://stackoverflow.com/comment/47316945
tagged with: javascript
tagged with: jquery
favorite count: 0
score: 0

http://stackoverflow.com/comment/47425246
score: 0
has text: @夏期劇場 I did not use "X-RequestDigest" so try doing it without first to see if it works. If you are using a SharePoint hosted app then you can try doing `"X-RequestDigest": $("#__REQUESTDIGEST").val()`. As for the url, I think you can remove the /items from the url that you used and that should work. `"https://example.com/_api/web/lists/getbytitle('Announcements')"`
comment on: http://stackoverflow.com/a/29640612
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/47276570
type: QuestionComment
has text: You can create an editortemplate for type of int[] or with a UIHint Attribute.... The thing is that on post back, your customized string will not be able to be parsed again in the array, so you need to create a custom model binder that will get post back values and store them back into an array of int... I don't have any code sample for this... so I can't help you more... but it's definitely the way to do in MVC
type: Comment
comment on: http://stackoverflow.com/q/29562882
score: 0

http://stackoverflow.com/comment/62721848
score: 0
type: AnswerComment
has text: Thanks for pointing this out. This method worked for me. I actually used `$('.input-daterange input[type="text"]').datepicker('clearDates')` because I added an `input-group-btn` to my page and it was pulling that in as an input too.
type: Comment
comment on: http://stackoverflow.com/a/30955088

http://stackoverflow.com/comment/47577730
score: 0
comment on: http://stackoverflow.com/q/29615199
has text: @tmcw, do you want to make a answer that I can accept?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29687082
has answer: http://stackoverflow.com/a/29687229
has comment: http://stackoverflow.com/comment/47511298
has comment: http://stackoverflow.com/comment/47513097
possible better answer: http://stackoverflow.com/a/29687297
has body: We have several landing pages with call-to-action buttons ("Download the report", for example) and need to report through a URL string two variables from the actual button click (report title and report type and whether the visitor who is clicking the button is a new or existing client. The analytics company requires the final URL to be sent like this: https://thisurl.html?assetName=" + assetName + "&amp;assetType=" + assetType + "&amp;custType=" + custType); To gather the assetName and assetType, I've created this function, which has already been in production and works fine for reporting the assetName and assetType. function tracker(assetName,assetType) { var fileref=document.createElement('script'); fileref.setAttribute("type","text/javascript"); fileref.setAttribute("src", "https://thisurl.html?assetName=" + assetName + "&amp;assetType=" + assetType + "&amp;custType=" + custType); if (typeof fileref!="undefined") { document.getElementsByTagName("head")[0].appendChild(fileref); } } Now, we need to also track whether the client is "new" or "current", so I have this function: function cStatus(elem) { var els = []; while (elem) { els.unshift(elem); elem = elem.parentNode; if (elem.id == "new") { break; } else if (elem.id == "current") { break; } } custType = elem.id; } To clarify, the call-to-action button is included on the page twice, once in the "new" div and the other in the "current" div. &lt;div id="new"&gt; ...button code... &lt;/div&gt; and &lt;div id="current"&gt; ...button code... &lt;/div&gt; In order to create that URL string for reporting, my thinking is to use the "cStatus" function to identify the div id ('new' or 'current'), then use the cStatus function to get the info on the button click. The button has an onclick that passes the 'assetName' and 'assetType': onclick="tracker('PDF','document.pdf') The problem I'm having is getting all three of those variables into one function, so I can create the URL string for reporting. I've search and found solu…
tagged with: jquery
has comment: http://stackoverflow.com/comment/47511217
favorite count: 0
has title: How to pass variable from one function to another, both with parameters using JavaScript
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29687229
has comment: http://stackoverflow.com/comment/47511268
has comment: http://stackoverflow.com/comment/47511278
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47511247
tagged with: javascript
has comment: http://stackoverflow.com/comment/47511284
has answer: http://stackoverflow.com/a/29687297
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/47511540

http://stackoverflow.com/q/29566909
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47283413
has title: Using substring length to determine how to splice returning not-a-number
has comment: http://stackoverflow.com/comment/47283430
has body: Im using a substring of a variable to determine how to slice a string. The string itself is four characters long and has a number attached. i.e "doop0"/"doop1" etc. Im trying to use the strings length to determine whether or not to slice more off. Like if the string becomes "doop10" slice off the "10" and parseInt it. but I get NaN returns and I dont know why! the code I have looks like this: var num; var numberCount = -1; var nameCount = 5; socket.on('Balls', function(msg) { console.log("Minus: "+parseInt(msg.Name.Length) - nameCount); if(msg.Name.length == nameCount) { num = parseInt(msg.Name.slice(numberCount)); } if(msg.Name.Length &gt; nameCount) { console.log("Minus: "+msg.Name.Length - nameCount); numberCount- (msg.Name.Length - nameCount); nameCount+ (msg.Name.Length - nameCount); num = parseInt(msg.Name.slice(numberCount)); } The initial if statement will look at the msg and slices off the relevant information. The second if statement will check to see if the length has grown i.e. "doop9" has become "doop10" or if has gone into the 100's numberCount- (msg.Name.Length - nameCount); Will increase the amount cut off the string nameCount+ (msg.Name.Length - nameCount); Will increase the name count so it will be in the first if statement num = parseInt(msg.Name.slice(numberCount)); Gets that instance . Is there any reason im getting a NaN error?
type: Question
has answer: http://stackoverflow.com/a/29566971
tagged with: javascript
tagged with: string-length
tagged with: substring
score: 0
has comment: http://stackoverflow.com/comment/47283818
answer count: 2
has answer: http://stackoverflow.com/a/29566985

http://stackoverflow.com/comment/47482410
type: AnswerComment
has text: I also perform stem you have given. but still problem, because when gem install at that time path set. I have fixed issue. Using gem run local with changing path in spree_image_cropper/lib/generators/spree_image_cropper/install_generator.rb.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29668615

tumblr
tags question: http://stackoverflow.com/q/29539041
tag name: tumblr
type: Tag

http://stackoverflow.com/q/29587639
tagged with: css
has answer: http://stackoverflow.com/a/29587732
accepted answer: http://stackoverflow.com/a/29587732
type: AnsweredQuestion
has title: jquery: toggling the child of a div
has comment: http://stackoverflow.com/comment/47322876
type: Question
upvote count: 2
has body: I want to toggle all the content in a : Dirección Dirección del paciente Número exterior I've tried multiple jQuery's on the forum, but none of the worked for me
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
downvote count: 2
tagged with: parent
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/17074201
favorite count: 0

http://stackoverflow.com/a/29654693
downvote count: 0
answers question: http://stackoverflow.com/q/29654656
has body: Simply use a comma to do that: $(document).on('click', '.SELECTOR1, #SELECTOR2', function(){ // some code }); JSFIDDLE.
type: Answer
score: 5
upvote count: 5

http://stackoverflow.com/comment/47372739
type: Comment
has text: Both IE and Opera will still not let you use the `download` attribute. Here's a link to a cross-browser script to let the user download their canvas content as an image: https://github.com/eligrey/FileSaver.js/
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29611726

http://stackoverflow.com/q/29601303
favorite count: 0
has body: the purpose of this code is to to write a function which increments a string, to create a new string. If the string already ends with a number, the number should be incremented by 1. If the string does not end with a number the number 1 should be appended to the new string. e.g. "foo123" --> "foo124" or "foo" --> "foo1". With my code below, pretty much all my test cases are passed except a corner case for "foo999" did not print out "foo1000". I know that there should be a way to do with regex to fix my problem, but I am not too familiar with it. Can anyone please help? function incrementString (input) { var reg = /[0-9]/; var result = ""; if(reg.test(input[input.length - 1]) === true){ input = input.split(""); for(var i = 0; i &lt; input.length; i++){ if(parseInt(input[i]) === NaN){ result += input[i]; } else if(i === input.length - 1){ result += (parseInt(input[i]) + 1).toString(); } else{ result += input[i]; } } return result; } else if (reg.test(input[input.length - 1]) === false){ return input += 1; } }
tagged with: increment
tagged with: regex
has answer: http://stackoverflow.com/a/65650506
has answer: http://stackoverflow.com/a/47813744
has answer: http://stackoverflow.com/a/57517416
downvote count: 0
has answer: http://stackoverflow.com/a/29601473
has title: String increment: increment the last string by one
has comment: http://stackoverflow.com/comment/47348741
score: 2
type: AnsweredQuestion
tagged with: numbers
possible better answer: http://stackoverflow.com/a/29601371
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/29601630
accepted answer: http://stackoverflow.com/a/29601630
tagged with: javascript
tagged with: string
answer count: 6
has answer: http://stackoverflow.com/a/29601371

http://stackoverflow.com/q/29687746
tagged with: javascript
favorite count: 0
has body: I'm using the JS from http://detectmobilebrowsers.com/ to redirect a client's old site to their mobile version. My question is how do I give users the option of viewing the desktop (full) version of the site From the mobile version? I have the mobile version on it's own subdomain "m.domain.com".
type: UnansweredQuestion
upvote count: 1
has title: How do I link back to desktop version from mobile site using detectmobilebrowsers.com?
answer count: 0
score: 1
type: Question
tagged with: mobile
downvote count: 0

http://stackoverflow.com/comment/47336355
has text: FYI: `return` is not a function, so the parentheses around the return value aren't necessary.
comment on: http://stackoverflow.com/q/29594319
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29684929
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29684740
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29684740
has comment: http://stackoverflow.com/comment/97611137
type: Answer
has comment: http://stackoverflow.com/comment/47507338
has comment: http://stackoverflow.com/comment/97631792
has body: As you suggested, the only way is to add the http protocol to each URL which is missing it. It's a pretty simple and straightforward solution with other benefits to it. Consider this piece of code: function windowOpen(url, name, specs) { if (!url.match(/^https?:\/\//i)) { url = 'http://' + url; } return window.open(url, name, specs); } What I usually do is to also add the functionality of passing specs as an object, which is much more manageable, in my opinion, than a string, even setting specs defaults if needed, and you can also automate the name creation and make the argument optional in case it's redundant to your cause. Here's an example of how the next stage of this function may look like. function windowOpen(url, name, specs) { if (!url.match(/^https?:\/\//i)) { url = 'http://' + url; } // name is optional if (typeof name === 'object') { specs = name; name = null; } if (!name) { name = 'window_' + Math.random(); } if (typeof specs === 'object') { for (var specs_keys = Object.keys(specs), i = 0, specs_array = []; i &lt; specs_keys.length; i++) { specs_array.push(specs_keys[i] + '=' + specs[specs_keys[i]]); } specs = specs_array.join(','); } return window.open(url, name, specs); }
score: 20
upvote count: 20

http://stackoverflow.com/q/29664692
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47468687
downvote count: 1
type: Question
has body: Please help me out i am new to asp.net, wanted to create one simple page with form validation. Login.aspx Page Log In Please enter your username and password. <asp:HyperLink ID="RegisterHyperLink" runat="server" EnableViewState="false">Register</asp:HyperLink> if you don't have an account. <asp:Login ID="LoginUser" runat="server" EnableViewState="false" RenderOuterTable="false"> <asp:Literal ID="FailureText" runat="server"></asp:Literal> Account Information <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">Username:</asp:Label> <asp:TextBox ID="UserName" runat="server" CausesValidation="True" ClientIDMode="Static" ></asp:TextBox> <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label> <asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox> <asp:CheckBox ID="RememberMe" runat="server"/> <asp:Label ID="RememberMeLabel" runat="server" AssociatedControlID="RememberMe" CssClass="inline">Keep me logged in</asp:Label> <asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="Log In"/> </asp:Login> Above shown is partial code i have written on my master page. No error displayed, but unfortunately script is not working.
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47468914
tagged with: javascript
tagged with: jquery
tagged with: jquery-plugins
has title: Jquery Form Validation nor working
has comment: http://stackoverflow.com/comment/47468966
tagged with: validation
has answer: http://stackoverflow.com/a/29665671
score: -1
favorite count: 0
has comment: http://stackoverflow.com/comment/47468903

http://stackoverflow.com/comment/47327185
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/29589247
has text: If the customer wants *all* data, make them download it or have it available as a Google sheet.

http://stackoverflow.com/a/29562990
type: AcceptedAnswer
has body: Use toFixed to convert it to a string with some decimal places shaved off, and then convert it back to a number. +(0.0001 + 0.0001).toFixed(12) // 0.0002 It looks like IE's toFixed has some weird behavior, so if you need to support IE something like this might be better: Math.round((0.0001 + 0.0001) * 1e12) / 1e12
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/29562838
accepted answer of: http://stackoverflow.com/q/29562838
upvote count: 2

http://stackoverflow.com/q/29577256
accepted answer: http://stackoverflow.com/a/29578929
has comment: http://stackoverflow.com/comment/47303068
has comment: http://stackoverflow.com/comment/47303585
tagged with: promise
has body: I'm using Parse Cloud functions for mobile apps, but all of them follow asynchronous nature. Hence to overcome that nature, I started using javascript Promises. But promises also not giving me the desired output. The problem is : second-then is executed after the third-then. And in third-then the parameter of getRecommendedGroup groups is getting [] getRecommendedGroup(request.params.email, groups, function(data){ this is a callback }); Basically groups is an output of 2nd then. So how should I write my code inorder to make 2nd-then execute before 3rd-then. Below is the code snippet Parse.Cloud.define("getGroup", function(request, response) { var grpMember = new Parse.Query("GroupMember"), groupIds = [], groupObj = {}; grpMember.equalTo("user", request.params.email); //from the groupMember we're taking groupId grpMember.find() .then(function(grpMemberResponse) { grpMemberResponse.forEach(function(value, index) { var memberObj = value; groupIds.push(memberObj.get("groupId").id); }); return groupIds; }) //with this groupId we're retriving group and pushing it to an groupArr .then(function(groupIds) { var groupArr = []; var promises = []; groupIds.forEach(function(value, index) { alert("GroupId :: " + value); promises.push(findGroup(value, function(group) { groupArr.push(group); }); }); return Parse.Promise.when(promises); }) .then(function(groups) { alert("GroupArr :: " + JSON.stringify(groups)); getRecommendedGroup(request.params.email, groups, function(data) { groupObj["own"] = groups; groupObj["recommended"] = data; response.success(groupObj); }); }); }); var findGroup = function(objectId, callback) { var groupQuery = new Parse.Query("Group"); groupQuery.get(objectId, { success: function(group) { alert("Group Obj Id ::" + group.id); callback(group); }, error: function(error) { alert("Error while finding Group " + error); } }); };
tagged with: parse-platform
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/22539815
has comment: http://stackoverflow.com/comment/47303241
has title: Javascript promises chaining
type: Question
has comment: http://stackoverflow.com/comment/47303449
answer count: 1
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/29578929

http://stackoverflow.com/q/29542204
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47236239
linked to: http://stackoverflow.com/q/10140699
has comment: http://stackoverflow.com/comment/47236466
type: AnsweredQuestion
has title: Make an hyperlink to an other page without the HTML a-tag, but after an animation finished playing
has comment: http://stackoverflow.com/comment/47236501
has comment: http://stackoverflow.com/comment/47236306
type: Question
accepted answer: http://stackoverflow.com/a/29542485
has comment: http://stackoverflow.com/comment/47236219
possible better answer: http://stackoverflow.com/a/29542478
has answer: http://stackoverflow.com/a/29542478
tagged with: hyperlink
tagged with: javascript
has answer: http://stackoverflow.com/a/29542485
score: 0
answer count: 2
has body: I would like to make a web banner and I want it to have a hyperlink to an other page. Sounds like an easy task? Yes, but I can't use the HTML tag because I don't want to go to an other page started by a click event. I want to link to an other page after an animation finished playing. I'm hoping for a JS solution (if it's possible). so: First: I want to drag and drop an html-element, Second: I want to play an CSS/JS animation, Third: I want to hyperlink to an other page, (this is the part were in need help). I don't have any code an don't ask to write it for me, I just want to know how to make a hyperlink without clicking something. I have found an similar question Here, but it doesn't cover what I'm looking for. I want to link after the user interacted.
has comment: http://stackoverflow.com/comment/47236388

http://stackoverflow.com/q/29683880
type: Question
has comment: http://stackoverflow.com/comment/47505010
has body: I'm trying to pass a variable back to xmlhttp.responseText. I have two separate functions that do this. The first is called when the page loads and is successful. The second gets called on a click and while it executes correctly on the PHP side (it makes changes in my MYSQL database) if I insert an alert into the AJAX function to check the readyState no alert pops up (but it will with the first). It also never receives the variable returned from PHP in the xmlhttp.responseText. What could be preventing the readyState from changing the second time, even though the functions on the PHP side are executing? PHP: function checkNow() { global $usercrypt; global $place; $urow = mysql_query("SELECT Users.User FROM Users WHERE Users.User='" . $usercrypt . "';"); if (mysql_num_rows($urow) > 0) { $favcheck = mysql_query("SELECT Users.Favorites FROM Users WHERE Users.User='" . $usercrypt . "';"); $favcheck = mysql_fetch_array($favcheck); $favcheck = $favcheck[0]; if (strpos($favcheck, $place) !== false) { $answer = 'found'; } else { $answer = 'notfound'; } } else { $answer = 'nouser'; } return array($answer,$favcheck); unset($answer); } if ($perform == "0") { $sendback = checkNow(); echo $sendback[0]; unset($sendback); } if ($perform == "1") { global $usercrypt; mysql_query("INSERT INTO Users (User) VALUES ('" . $usercrypt . "')"); } if ($perform == "2") { $sendback = checkNow(); global $place; global $placeid; global $usercrypt; $currentnum = mysql_query("SELECT Places.Favorites FROM Places WHERE Places.PlaceID=" . $placeid); $currentnum = mysql_fetch_array($currentnum); $currentnum = $currentnum[0]; if ($sendback[0] == 'found') { $currentnum--; $change = str_replace($place,'',$sendback[1]); mysql_query("UPDATE Users SET Favorites='" . $change . "' WHERE User = '" . $usercrypt . "'"); mysql_query("UPDATE Places SET Places.Favorites=" . $currentnum . " WHERE Places.PlaceID =" . $placeid); echo 'subtracted'; } if ($sendback[0] == 'notfound') { $currentnum++; $change = $sendback[…
has comment: http://stackoverflow.com/comment/47505067
tagged with: javascript
has comment: http://stackoverflow.com/comment/47505129
tagged with: ajax
score: 0
has title: AJAX behaving strangely
answer count: 0
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/47504789
tagged with: mysql
has comment: http://stackoverflow.com/comment/47504720

http://stackoverflow.com/q/29544965
has body: Ok, admittedly, my regex skills are fairly wretched (I built this using a regex cheatsheet), and for the most part, this works great, but single characters are bogging me down. If I paste q w e r t y into the textbox, I'm expecting to get q,w,e,r,t,y, returned, but what it does is return is q,ue,rt,y. $("#niftyInput").bind('paste', function(e) { var str = this.value.replace(/(\w)[\s,]+(\w?)/g, '$1,$2').replace(/[^a-zA-Z0-9-,]/g, ''); if (str!=this.value) this.value = str; }); Fiddle: http://jsfiddle.net/crunchfactory/435dc37o/ Thank you very much!
tagged with: regex
answer count: 4
has answer: http://stackoverflow.com/a/29545856
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29545352
type: Question
has answer: http://stackoverflow.com/a/29545347
has answer: http://stackoverflow.com/a/29545334
accepted answer: http://stackoverflow.com/a/29545334
score: 0
has title: Format input with regex to single character comma single character comma, etc
possible better answer: http://stackoverflow.com/a/29545347
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/29610850
linked to: http://stackoverflow.com/q/10470426
answer count: 1
tagged with: utf-8
favorite count: 0
upvote count: 5
has answer: http://stackoverflow.com/a/29611742
linked to: http://stackoverflow.com/q/14095347
accepted answer: http://stackoverflow.com/a/29611742
linked to: http://stackoverflow.com/q/21627106
has comment: http://stackoverflow.com/comment/47367982
tagged with: node.js
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/47368818
has comment: http://stackoverflow.com/comment/47367809
linked to: http://stackoverflow.com/q/22440642
tagged with: character-encoding
has title: What is wrong with node js dealing with cyrillic encoding
type: Question
score: 5
linked to: http://stackoverflow.com/q/10125141
tagged with: javascript
linked to: http://stackoverflow.com/q/3807576
tagged with: express
has body: If you take the very basic, very simple example from the node web page: var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World\n'); }).listen(1337, '127.0.0.1'); console.log('Server running at http://127.0.0.1:1337/'); which works great, but try to print something Cyrillic, like this: var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Здравей Свят\n'); }).listen(1337, '127.0.0.1'); console.log('Server running at http://127.0.0.1:1337/'); You will get only badly decoded characters. I tried all kind of combinations with setting headers with different content-types, content-lengths, employing node-iconv module and other things, but i find my self going in circles. Basically, I have mean-based web app and I just want to display Cyrillic text from my html/jade files to client browser. A few days digging already, with no results. I am sure if someone can tell what should be done in order for the above code to work, I will adapt it to my app (as I already am pretty sure, the issue is coming from some lower level, rather than from express midlewares etc..) As far as I understood correctly - It seems to be an old issue originating somewhere in the way how javascript/v8 deal with utf-8. I saw plenty of other posts complaining about similar problems, but since I have tried to adapt each of them with no luck, I guess I will take the risk to post a duplicate question and have my chances... some of the other posts/threads I visited: Encoding error with node.js node.js Nerve framework unicode response Dealing with the Cyrillic encoding in Node.Js / Express App http://dougal.gunters.org/blog/2012/03/14/dealing-with-utf-in-node-js/ Node.js public static folder to serve js with utf-8 charset Why can&#39;t I write Chinese characters in nodejs HTTP response? Any help will be greatly appreciated!

http://stackoverflow.com/q/29675240
tagged with: javascript
tagged with: ajax
upvote count: 1
answer count: 1
favorite count: 0
tagged with: angularjs
tagged with: angularjs-http
type: AnsweredQuestion
downvote count: 0
score: 1
has title: depends on one ajax call response call another ajax call in angularjs
has answer: http://stackoverflow.com/a/29675542
has body: first I called userSignupSubmit function.Inside this method call another method mobilenocheckingmethod , depends on this ajax call response to call another ajax call but second call it will not work. var crm = angular.module('crm'); crm.controller("userCheckingController", function($scope,service, $http) { var key=""; $scope.mobilenoCheckingSubmit = function() { var dataObject="serialNo="+$scope.mobileno; alert(dataObject); $http({ method:'POST', url:'registerDevice', data:dataObject, headers:{'Content-Type':'application/x-www-form-urlencoded'} }). success(function(data, status, headers, config) { var code=data.code; if(code!=200) { alert("mobileno200"+data.message); key=data.clientKey; this.userSignup(); } else { alert("mobileno201"+data.message); alert("mobileno201"+data.clientKey); key=data.clientKey; this.userSignup(); } }). error(function(data, status, headers, config) { $scope.user_error_status="Inside Error Occur"; return; }). //this.userSignup(); } $scope.userSignupSubmit = function() { this.mobilenoCheckingSubmit(); } $scope.userSignup=function(){ var dataObject="email="+$scope.signupEmail+"&amp;key="+key; alert(dataObject); $http({ method:'POST', url:'signUp', data:dataObject, headers:{'Content-Type':'application/x-www-form-urlencoded'} }). success(function(data, status, headers, config) { var code=data.code; if(code === 201) { alert(data.message); } if(code === 200) { alert(data.message); } if(code === 409) { service.Key(data.Key); $scope.manual_dashboard = true; $scope.userChecking = true; } }). error(function(data, status, headers, config) { $scope.signup_error_status="Inside Error Occur"; }); } });
accepted answer: http://stackoverflow.com/a/29675542
type: Question
has comment: http://stackoverflow.com/comment/47488219

http://stackoverflow.com/q/29597768
has comment: http://stackoverflow.com/comment/47342280
has comment: http://stackoverflow.com/comment/47342309
has body: I am writing a small script that takes an array of locations and geocodes them to add lat long to another object. I have it working so it geocodes and writes to the console flawlessly. How can I take that output and put it into a predefined variable outside of the function? I am not vary familiar with jquery and do not intend on using it anyplace else in the script. Just started learning JavaScript this weekend so don't shoot me if Something else is messed up. Thanks for any help!! Also, I changed my Google API key so it isn't stolen. //test array of locations to geocode var locationsToGeoCode = ["China: Shandong: Jinan", "China: Shandong: Jinan", "United States: Washington: La Conner", "United States: Texas: Dallas", "United States: California: Walnut" ]; //empty object to place geocoded places var coordinates; for (var i = 0; i &lt; locationsToGeoCode.length; i += 1) { $.getJSON("https://maps.googleapis.com/maps/api/geocode/json?address=" + locationsToGeoCode[i] + "&amp;key=MIzaSyCywKsD_50EI9rheDLyqPOUdUzi6s6u-q8", function (geocodeResult) { console.log(geocodeResult); }); }
upvote count: 1
type: Question
has title: using $.getJSON in a loop to append to global variable
accepted answer: http://stackoverflow.com/a/29597859
tagged with: javascript
tagged with: jquery
downvote count: 0
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/29597859
has comment: http://stackoverflow.com/comment/47342264
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47342217
score: 1

http://stackoverflow.com/comment/47514992
type: Comment
type: QuestionComment
has text: if ( 0.11 == .11 ) log('value the same')
comment on: http://stackoverflow.com/q/29674029
score: 0

http://stackoverflow.com/q/29653592
score: 2
type: AnsweredQuestion
upvote count: 2
type: Question
tagged with: recursion
tagged with: parsley.js
tagged with: validation
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/29654223
tagged with: javascript
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/29654223
has title: I'm unable to trigger validations in Parsley when a single field emits a success event without infinite recursion
has body: I have a number of different sections in a form, and the inputs from each section must equal the very first input (in it's own section) for the form to be validated. The validations are working correctly, the only problem is that the UI displays errors in the rest of the section in the case where a user attempts to validate when a section has incorrect figures in it. In that case, there are errors displayed on each input in the section. This is great. However, when a user changes the number in one of the fields, and the total is now correct, parsley only clears the error in that particular field. Here is the code that works fine, except for not clearing the errors: window.ParsleyValidator .addValidator('sumTotal', function (value, group) { // get total enrollment number var totalInput = $('#enrollment-group').find('[data-parsley-sum-total="all"]') var totalEnrollment = parseInt(totalInput.val()) // sum up input values for the section var sectionSum = 0; $('#enrollment-group').find('[data-parsley-sum-total="' + group + '"]').each(function(){ if ($(this).val()) sectionSum += parseInt($(this).val()); }) // if no inputs, don't consider the section if (sectionSum === 0) return true return totalEnrollment === sectionSum; }, 32) .addMessage('en', 'sumTotal', 'The total sum for all %s fields must equal the total enrollment above: ' + $('#enrollment-group').find('[data-parsley-sum-total="all"]').val()); // exclude the 'total enrollment' input from the sum validation $('form').parsley({ excluded: '[data-parsley-sum-total="all"]' }); And here's one example of code that I tried to clear the errors with, but ended up with infinite recursion: $('form').parsley().subscribe('parsley:field:success', function(input){ $.each($('[data-parsley-sum-total]'), function(i, value){ if ($(value).hasClass('parsley-error')){ $(value).parsley().validate() } }) }); So, how do I clear all the errors on the inputs in a section once the section is valid? This is in a django admin template, so I have…

http://stackoverflow.com/a/29624115
type: Answer
answers question: http://stackoverflow.com/q/29624027
accepted answer of: http://stackoverflow.com/q/29624027
type: AcceptedAnswer
score: 0
has body: The assumption taken is that both the arrays are of the same size var date = {"date":[1428912000,1428915600,1428919200,1428922800]} var values = {"values":[4.932,4.934,4.935,4.937]} var obj = {new: []} for(var i=0;i&lt;date.date.length;i++){ obj["new"].push([date.date[i],values.values[i]]) }

http://stackoverflow.com/comment/47245196
score: 1
has text: You'll need to include more code before we can be helpful
type: QuestionComment
comment on: http://stackoverflow.com/q/29546745
type: Comment

http://stackoverflow.com/q/29571613
type: Question
has answer: http://stackoverflow.com/a/29571748
tagged with: javascript
tagged with: jquery
upvote count: 3
answer count: 3
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29571804
has title: Sort html table rows by first date column with jQuery
has answer: http://stackoverflow.com/a/29571778
favorite count: 0
possible better answer: http://stackoverflow.com/a/29571748
has answer: http://stackoverflow.com/a/29571804
linked to: http://stackoverflow.com/q/27022535
type: AnsweredQuestion
score: 3
downvote count: 0
has body: I have table with two date columns in each row start date and end date I want to sort table rows by start date with jQuery Below is the table html code: Number Date Start Date End 1234 01-04-2015 01-04-2015 1352 04-10-2012 23-10-2015 1124 13-05-2014 01-04-2015 1652 07-11-2013 22-10-2015 I made a try with similar solution posted here but without success. JSFiddle

http://stackoverflow.com/a/29563264
answers question: http://stackoverflow.com/q/29563119
has body: code is a phrase tag and does not natively escape the HTML tags. It's not intended to share code using tags inside of it: you have to escape them before. You can easily achieve it by replacing > and &lt; symbols with &amp;gt; and &amp;lt; before inserting them in the code tag. Highlight.js does nothing more than coloring syntax.
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
accepted answer of: http://stackoverflow.com/q/29563119
score: 2

http://stackoverflow.com/q/29628013
favorite count: 0
has comment: http://stackoverflow.com/comment/47399064
upvote count: 2
tagged with: wai-aria
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29629063
has comment: http://stackoverflow.com/comment/47398926
downvote count: 3
has body: I am trying to reorder list items using space+↓ to change the order in list in JavaScript. Please see code below: item one item two item three item four I am able to get through ( CTRL + Down Arrow) $('li').keydown(function(e) { var li= $(this); if(e.ctrlKey) { switch(e.which) { case 38: li.insertBefore(li.prev()); break; //up case 40: li.insertAfter(li.next()); break; //down } li.focus(); } }); $('li').first().focus(); How to do this ?
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/47398927
has title: How to reorder list elements in unordered list using keyboard events ( Space + Down Arrow )?
possible better answer: http://stackoverflow.com/a/29628743
tagged with: javascript
tagged with: jquery
score: -1
has answer: http://stackoverflow.com/a/29628743
accepted answer: http://stackoverflow.com/a/29629063

http://stackoverflow.com/comment/47291194
comment on: http://stackoverflow.com/q/29570349
score: 0
has text: split may contain only one character or it can be more
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29634500
has answer: http://stackoverflow.com/a/29635691
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47411390
tagged with: php
type: Question
has body: Howdie do, I have a form that simply takes a username and email from a user. The input is sanitiazed via client and on the server side. The script is sending the POST with no issue and it's returning the data as it should be as I've checked in the log. However, for some reason, the data isn't being displayed in the browser. Code is below and I feel it's a stupid item I'm overlooking, but I can't find it anywhere <TITLE>Jeremy's Form Submit Test *UserName: *Email: The PHP file is below that returns a json_encoded response and I've confirmed via the console log that the data is being returned properly, but it's not displaying in the div I've set. The log file is showing the correct response, but it's not displaying: {"Type":"Error","Message":"UserName must be at least 3 characters!!!"} <?php if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') //Check apache header to ensure its a json request { $ReturnedData = json_encode(array("Type" => "Error", "Message" => "Naughty naughty. This wasn't an ajax request")); die($ReturnedData); } if(isset($_POST)) //Ensure that POST is set { //Santiaze the post variables to be double sure no one is up to any funky business $SaniUser = filter_var($_POST['user_name'],FILTER_SANITIZE_STRING); $SaniEmail = filter_var($_POST['email'],FILTER_SANITIZE_EMAIL); //Check that username is at least 3 characters and return error if it's not if(strlen($SaniUser) != 3) { $ReturnedData = json_encode(array("Type" => "Error", "Message" => "UserName must be at least 3 characters!!!")); die($ReturnedData); } //Check that email is a valid email if(!filter_var($SaniEmail,FILTER_VALIDATE_EMAIL)) { $ReturnedData = json_encode(array("Type" => "Error", "Message" => "Please supply a valid email address!!!")); die($ReturnedData); } //All variables are good. Return successfully message $ReturnedData = json_encode(array("Type" => "Success", "Message" => "SUCCESS!!!" .$SaniUser. "Has successfully submitt…
score: -1
has comment: http://stackoverflow.com/comment/47413385
answer count: 1
has comment: http://stackoverflow.com/comment/47411896
tagged with: javascript
tagged with: jquery
tagged with: ajax
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
favorite count: 0
has title: JQuery not displaying HTML data from ajax response
upvote count: 0

http://stackoverflow.com/comment/47525673
type: Comment
has text: Ive added the var outside the scope and used .alert within '$("[name='combobox']").change(function () { ' ill update both above, but this alert isnt called so that means its not picking up the onchange of the dropdown?
comment on: http://stackoverflow.com/a/29663784
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47484493
score: 1
comment on: http://stackoverflow.com/q/29673262
type: Comment
type: QuestionComment
has text: @Xeen dont forget about approving right answers!

http://stackoverflow.com/comment/47425967
type: AnswerComment
has text: I like the idea of you putting it in a button. And thank you so much. I didn't put an id to the input. Instead I did this. document.getElementsByName("scienceClub")[0].value = "0"; document.getElementsByName("scienceClub")[0].disabled = false;
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29642117

http://stackoverflow.com/comment/47370811
type: Comment
comment on: http://stackoverflow.com/a/29612484
has text: @RasmusMyhrberg `getElementsByClassName()` If you use it you might want to use a for loop to apply the new styles to each elements of the class you get.
score: 1
type: AnswerComment

http://stackoverflow.com/q/29608118
has answer: http://stackoverflow.com/a/29608189
has comment: http://stackoverflow.com/comment/47361971
has answer: http://stackoverflow.com/a/29608186
answer count: 3
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47363234
accepted answer: http://stackoverflow.com/a/29608186
favorite count: 0
has comment: http://stackoverflow.com/comment/47361849
has comment: http://stackoverflow.com/comment/47361899
tagged with: http://stackoverflow.com/tag/html
has title: Show message when txt file is empty
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29608897
has comment: http://stackoverflow.com/comment/47362063
upvote count: 1
tagged with: php
has body: I can't get this to work, what am I doing wrong? I tried to remove the PHP but that didn't trigger the JS either. &lt;html&gt; &lt;head&gt; &lt;title&gt;Flahultsskolan Fr&amp;aring;nvarande Ram&lt;/title&gt; &lt;script src="//code.jquery.com/jquery-1.11.2.min.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function isEmpty(){ if( $('#content').is(':empty') ) { $('.content').prepend("Hej"); } }); &lt;/script&gt; &lt;/head&gt; &lt;body style="font-family:helvetica;font-size:14px;height:auto;"&gt; &lt;div id="content" class="content" style="margin:0;padding:0;"&gt; &lt;?php include("edit/franvarande.txt"); ?&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt;
type: Question
score: 1
has comment: http://stackoverflow.com/comment/47361864
linked to: http://stackoverflow.com/q/550038
possible better answer: http://stackoverflow.com/a/29608189

http://stackoverflow.com/comment/47363218
has text: What do you want to see exactly ? Here network tab: http://oi62.tinypic.com/2rp32on.jpg
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29608640
type: Comment

http://stackoverflow.com/a/29646180
answers question: http://stackoverflow.com/q/29646113
downvote count: 0
type: Answer
has body: I understand you want it to happen every 10 seconds because you've written "every first element". var timer = window.setInterval(function () { if (myArray.length &gt; 0) myArray.splice(0, 1); else window.clearInterval(timer); }, 10 * 1000); Or an even better solution as @Cerbrus suggested, by using Array.prototype.shift: var timer = window.setInterval(function () { if (myArray.length &gt; 0) myArray.shift(); else window.clearInterval(timer); }, 10 * 1000); If you want it to happen only once, use window.setTimeout instead of window.setInterval: var timer = window.setTimeout(function () { myArray.shift(); }, 10 * 1000);
has comment: http://stackoverflow.com/comment/47433003
has comment: http://stackoverflow.com/comment/47432674
score: 5
upvote count: 5
has comment: http://stackoverflow.com/comment/47432891

http://stackoverflow.com/comment/47489459
score: 0
comment on: http://stackoverflow.com/q/29675606
type: Comment
type: QuestionComment
has text: I know, is there any better way to do for something like this?

http://stackoverflow.com/a/29607930
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29607446
has body: What you are using is the good old vanilla javascript replace function. jQuery has its own replace function: $.replaceWith(). I would also advice the online regeular expression tester, which works like a charm and gives very useful feedback. I think this snippet will work for you: var newValue = $("#test").val().replace(/([\w]?)*car([\w]?)*/gi,""); $("#test").val(newValue); where g searches for more than the first match, and i makes it case insensitive. Hope it helps.

http://stackoverflow.com/comment/61647583
type: Comment
type: QuestionComment
has text: Check this: http://stackoverflow.com/questions/36722361/linear-arrangement-algorithm/36750500 it may help you
score: 0
comment on: http://stackoverflow.com/q/29532147

http://stackoverflow.com/q/29552949
has comment: http://stackoverflow.com/comment/47257176
has comment: http://stackoverflow.com/comment/47257212
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29553327
has comment: http://stackoverflow.com/comment/47257560
accepted answer: http://stackoverflow.com/a/29553327
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47257129
has title: Node.js return a JS file locally
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47257166
score: 0
has body: Inside my html file, I am using this: &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"&gt;&lt;/script&gt; However, I was not allowed to connect to internet during the running. How can I use node js to return this file locally. I already download this file "jquery.min.js" in my local machine. I am trying to use this code, but it does not work. function callback(data) { res.writeHead(200, {"Content-Type": "text/html"}); var str = data+""; res.write(str); res.end(); } HTMLtemplate.load("jquery.min.js", callback);
answer count: 1
tagged with: jquery

http://stackoverflow.com/a/29634207
upvote count: 3
has comment: http://stackoverflow.com/comment/47410709
has body: It's quick and dirty, but it will get rid of all the alt attributes on images. [].forEach.call(document.images, function(img) { img.setAttribute('alt', ''); }); As Scott pointed out, the alt attribute isn't the one responsible for showing text on hover. You can easily change the script to remove either. [].forEach.call(document.images, function(img) { img.title = ''; // this property style syntax works too });
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29634149
has comment: http://stackoverflow.com/comment/47411080
type: Answer
has comment: http://stackoverflow.com/comment/47414432
score: 3
has comment: http://stackoverflow.com/comment/47410835
accepted answer of: http://stackoverflow.com/q/29634149

http://stackoverflow.com/comment/47438139
type: Comment
has text: Thank you for your response. I edited the code and put the new one above at the post, getting an 500 error. I would only like to post the values of the checked boxes in the mail. Is it also possible with this tactic to order the values below eachother? So they don't get placed behind eachother.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29637288

file
type: Tag
tags question: http://stackoverflow.com/q/29539391
tags question: http://stackoverflow.com/q/29545011
tags question: http://stackoverflow.com/q/29591823
tags question: http://stackoverflow.com/q/29581518
tag name: file
tags question: http://stackoverflow.com/q/29557312
tags question: http://stackoverflow.com/q/29620393
tags question: http://stackoverflow.com/q/29658911
tags question: http://stackoverflow.com/q/29632077
tags question: http://stackoverflow.com/q/29601656
tags question: http://stackoverflow.com/q/29595349
tags question: http://stackoverflow.com/q/29601180
tags question: http://stackoverflow.com/q/29633251
tags question: http://stackoverflow.com/q/29539438

http://stackoverflow.com/q/29673886
tagged with: blender
type: Question
answer count: 1
tagged with: javascript
tagged with: 3d-model
has answer: http://stackoverflow.com/a/29674312
score: 0
has title: Three.js - Load a model with material that doesn't require a light source to be seen
linked to: http://stackoverflow.com/q/24020566
has body: I'm currently using Three.js, version 71. I first create my models using blender, and then I export them as a JSON file. I then use THREE.JSONLoader to load the models into my scene using the following: this.jsonLoader.load(pathToModelFile, function(geometry, materials) { //... }); The materials list only contains THREE.MeshPhongMaterial at index 0. This material seems to require a light source (like THREE.SpotLight for example) to be in my scene. Otherwise, my model will be black. I basically just want to be able to load my models and not need to use a light source in order to see them. Therefore, I have the following questions, and answering any one of them would solve my problem: Is there some flag or property in THREE.MeshPhongMaterial I could change that would allow my model to be seen without a light source? If number 1 isn't possible, is there a way to use THREE.JSONLoader to give me a different kind of material that doesn't need a light source? For example, like THREE.MeshBasicMaterial? Is there some way to export my models from blender that will already have the required flags/properties set (if possible)? It sounds like I'm having the same problem that this guy mentions in the following link, but he never received an answer: Switch lighting of THREE.MeshPhongMaterial on / off dynamically
tagged with: three.js
accepted answer: http://stackoverflow.com/a/29674312
type: AnsweredQuestion

http://stackoverflow.com/comment/47257301
type: AnswerComment
type: Comment
has text: @Beki what browser do you use? (Shows for me in Chrome)
comment on: http://stackoverflow.com/a/29553066
score: 0

http://stackoverflow.com/q/29550487
has body: I have a simple code where I make a POST call to URL in Django with CSRF token included. When I paste the javascript code in the template within &lt;script&gt; tags, it works fine, however as soon as I move the code to a static file, I get HTTP 403 response. This is strange! Here is the code: $(document).ready(function() { $(".like-button").click(function(event) { $.ajax({ url: &lt;relative path of URL&gt;, type: "POST", data: { csrfmiddlewaretoken: "{{ csrf_token }}", // other data items }, success: function(data, textStatus, jqXHR) {}, error: function(jqXHR, textStatus, errorThrown) {} }); // other javascript code to toggle like button class }); }); Here's how I include the static file in Django template: {% block javascript %} {% load static %} &lt;script type="text/javascript" src="{% static 'app/app.js' %}"&gt;&lt;/script&gt; {% endblock %} The file is located in static directory: app ├── static │ └── app │ └── app.js and static settings are: STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'static') Note, I do not have STATICFILE_DIRS in the settings yet. I can verify that the file is being loaded and executed, since console.log() statements work perfectly fine. However, I get HTTP 403 request upon POST.
has answer: http://stackoverflow.com/a/29550725
type: Question
has comment: http://stackoverflow.com/comment/47252713
has comment: http://stackoverflow.com/comment/47252687
tagged with: javascript
has answer: http://stackoverflow.com/a/29550663
has comment: http://stackoverflow.com/comment/47252617
score: 0
answer count: 2
tagged with: django-staticfiles
has comment: http://stackoverflow.com/comment/47252792
has comment: http://stackoverflow.com/comment/47252561
tagged with: django
has title: Django: AJAX + CSRF POST gives 403
has comment: http://stackoverflow.com/comment/47252750
has comment: http://stackoverflow.com/comment/47252530
tagged with: django-templates
has comment: http://stackoverflow.com/comment/47252759
type: UnansweredQuestion

http://stackoverflow.com/comment/47330755
score: 1
comment on: http://stackoverflow.com/a/29591747
has text: At this point it's worth remembering that [premature optimization is the root of all evil](http://c2.com/cgi/wiki?PrematureOptimization). If you get bogged down in trying to write performant code, then you'll end up making it harder to maintain. Finish it, then if it runs too slowly, go back and start to profile it.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47226718
type: QuestionComment
comment on: http://stackoverflow.com/q/29534485
has text: This is really weird, I can't reproduce the issue. Code seems correct :/
score: 0
type: Comment

http://stackoverflow.com/comment/84024828
type: AnswerComment
type: Comment
score: 4
comment on: http://stackoverflow.com/a/31908562
has text: It is working with html, but what if I wanna add some js code like so ` `

http://stackoverflow.com/comment/47309551
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29580312
has text: I'm not getting anything into the console even though I've added console.log() to parts of the function
type: AnswerComment

http://stackoverflow.com/q/29654203
accepted answer: http://stackoverflow.com/a/29654376
tagged with: checkbox
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: addclass
tagged with: javascript
has title: checkbox selected addclass to a child
has body: I'm trying to add a new class "ok" to an <a href> when it's checked. I'm using bootstrap, jquery and bootstrap table from http://wenzhixin.net.cn/p/bootstrap-table. the jsfiddle : http://jsfiddle.net/x0wegnhs/1/ Can you help me to release that ? file 1
has answer: http://stackoverflow.com/a/29654376
answer count: 2
has answer: http://stackoverflow.com/a/29655495
downvote count: 0
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/29655495
tagged with: twitter-bootstrap

http://stackoverflow.com/q/29654130
has comment: http://stackoverflow.com/comment/47448852
type: Question
has answer: http://stackoverflow.com/a/29657459
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/47448779
has body: I'm trying to open a new window on button click and draw a simple circle on it. I can open a window but circle won't appear on it with this code. Any ideas on how to solve this.0 Here is my code: function drawBarChart(newWindowRoot){ var sampleSVG = d3.select(newWindowRoot) .append("svg") .attr("width", 100) .attr("height", 100); sampleSVG.append("circle") .style("stroke", "gray") .style("fill", "white") .attr("r", 40) .attr("cx", 50) .attr("cy", 50) .on("mouseover", function(){d3.select(this).style("fill", "aliceblue");}) .on("mouseout", function(){d3.select(this).style("fill", "white");}); } function createNewPage(){ var button = content.append("button") .attr("class", "button") .attr("id", "myButton") .text("Visualize"); document.getElementById("myButton").onclick = function () { var newWindow = window.open(''); newWindowRoot = d3.select(newWindow.document.body) .attr("width","1060px") .attr("margin","50px auto"); drawBarChart(newWindowRoot); } }
answer count: 1
has title: On button click open a new window and draw a circle with D3
has comment: http://stackoverflow.com/comment/47450821
tagged with: d3.js
has comment: http://stackoverflow.com/comment/47448515
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29657459

http://stackoverflow.com/q/29686645
linked to: http://stackoverflow.com/q/12009367
has title: Scroll a div when focused on an internal div
type: Question
has answer: http://stackoverflow.com/a/29892302
has comment: http://stackoverflow.com/comment/47790762
has comment: http://stackoverflow.com/comment/47511860
upvote count: 12
has answer: http://stackoverflow.com/a/29813855
linked to: http://stackoverflow.com/q/2481350
has answer: http://stackoverflow.com/a/29886310
tagged with: javascript
tagged with: jquery
has body: I need to make a scrollable div, scroll even if the mouse is upon the content (inside the scrollable div), and not just beside it (Where it is blank). This is what I have so far: var main = document.getElementById('main-site'); var maxTop = main.parentNode.scrollHeight-main.offsetHeight; main.parentNode.parentNode.onscroll = function() { main.style.top = Math.min(this.scrollTop,maxTop) + "px"; } In Chrome is ok In IE8+ is ok (i know a hack) In Safari the content shakes a lot when i scroll, can i fix that? (I want fix this) Working fiddle -> https://jsfiddle.net/8oj0sge4/6/ var main = document.getElementById('main-site'); var maxTop = main.parentNode.scrollHeight - main.offsetHeight; main.parentNode.parentNode.onscroll = function() { main.style.top = Math.min(this.scrollTop, maxTop) + "px"; } #wrapper { width: 100%; height: 1500px; border: 1px solid red; padding-top: 380px; } #wrapper .container { border: 1px solid green; width: 100%; height: 500px; overflow: scroll; } #wrapper .container-scroll { height: 1500px; width: 100%; border: 1px solid yellow; position: relative; } #wrapper .main { width: 200px; height: 500px; background: black; overflow: scroll; position: absolute; color: white; left: 50%; margin-left: -100px; margin-top: 10px; } &lt;div id="wrapper"&gt; &lt;div class="container"&gt; &lt;div class="container-scroll"&gt; &lt;div id="main-site" class="main"&gt; My goals is to make the div container scroll also when the mouse is hover this div in safari, in Google and IE8 i already know how to make work, but safari is shaking a lot! &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; Thank you guys.
downvote count: 0
answer count: 7
has comment: http://stackoverflow.com/comment/47906484
has comment: http://stackoverflow.com/comment/47909297
favorite count: 0
score: 12
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29793347
tagged with: css
has answer: http://stackoverflow.com/a/29687476
has answer: http://stackoverflow.com/a/29894495
has answer: http://stackoverflow.com/a/29830487

http://stackoverflow.com/q/29643147
accepted answer: http://stackoverflow.com/a/29653084
type: Question
score: 3
tagged with: javascript
answer count: 1
downvote count: 0
favorite count: 0
tagged with: proxy
tagged with: php
has answer: http://stackoverflow.com/a/29653084
type: AnsweredQuestion
has title: How to edit remote images in CamanJS
tagged with: camanjs
has body: The documentation says CamanJS comes with a PHP proxy (you're welcome to add a proxy in the language of your choice) that you can use in the proxies folder. Before you use CamanJS for editing, all you have to do to enable the proxy is: // Will use the PHP proxy in the proxies folder. Caman.remoteProxy = Caman.IO.useProxy('php'); // You can also specify a URL instead of calling useProxy(). // This will call /proxies/proxy.php?camanProxyUrl={url} Caman.remoteProxy = "/proxies/proxy.php"; After reading it I wrote following code &lt;script&gt; Caman.remoteProxy = Caman.IO.useProxy('php'); more javaScript here. &lt;/script&gt; The browser how ever says unable to edit for security reasons. Am I writing it wrong? Do I have to include a php file somewhere. Where is that PHP file?
upvote count: 3

http://stackoverflow.com/q/29665449
has comment: http://stackoverflow.com/comment/47470500
type: Question
answer count: 2
tagged with: javascript
score: 0
tagged with: web
has answer: http://stackoverflow.com/a/29665612
tagged with: angularjs
type: UnansweredQuestion
has body: I use date timpicker to show date time. Then store it to database. But I must in long fomat. I can get value as 2010-10-29 10:40:23 but how I get long value to store to database. Thanks
has answer: http://stackoverflow.com/a/29665793
linked to: http://stackoverflow.com/q/18144142
has title: How get long value in datetimepicker in AngularJs

http://stackoverflow.com/comment/47225267
type: Comment
comment on: http://stackoverflow.com/q/29533325
has text: It'll be hard to say without having the input... (variable `fields`).
score: 0
type: QuestionComment

http://stackoverflow.com/a/29554932
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/29553815
upvote count: 2
type: Answer
has body: try this (work for #2): data-selector e.g: $('[data-testing] , :data(testing)')
has comment: http://stackoverflow.com/comment/47366462

http://stackoverflow.com/q/29575250
answer count: 1
tagged with: nested
tagged with: javascript
has title: How do I access property of fellow nested object?
score: 0
duplicate of: http://stackoverflow.com/q/4616202
tagged with: node.js
has comment: http://stackoverflow.com/comment/47311953
has answer: http://stackoverflow.com/a/29575307
accepted answer: http://stackoverflow.com/a/29575307
tagged with: javascript-objects
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/4616202
has body: So, I tried to initialize a variable using this snippet of code, var foo = {bar: {baz: 3}, qux: {fooAgain: foo.bar.baz + 5}} But I get the error TypeError: Cannot read property 'bar' of undefined How would I access property baz from qux?
type: Question

http://stackoverflow.com/q/29661612
has comment: http://stackoverflow.com/comment/47463569
has answer: http://stackoverflow.com/a/29664131
score: 0
has comment: http://stackoverflow.com/comment/47464696
has comment: http://stackoverflow.com/comment/47465126
type: UnansweredQuestion
tagged with: google-sheets-api
has body: Here is my library code: function simpleEdit(){ var cell = SpreadsheetApp.getActiveSheet().getActiveCell(); cell.setValue('Simple edit made by script'); // Calling a custom script function after doing edit customfunc(); } customfunc() is outside the library in other script but in same project. Here is its code: function customfunc() { SpreadsheetApp.getActiveSheet().getRange('F2').setValue('Hi'); } Script calling library function function s() { Demog.simpleEdit(); } Demog is the library identifier
type: Question
tagged with: google-apps-script
tagged with: google-apps
tagged with: google-sheets
answer count: 1
has title: Can I call a function in a script from a library script made by myself?
tagged with: javascript

http://stackoverflow.com/q/29611972
answer count: 1
accepted answer: http://stackoverflow.com/a/29612242
tagged with: javascript
tagged with: xpages
has body: If I try to set title property by using SSJS formula for readOnly EditBox then it doesn't work. But it works for e.g. disabled EditBox. Is it as designed behaviour? &lt;xp:inputText id="inputText1" value="test value" readonly="true"&gt; &lt;xp:this.title&gt;&lt;![CDATA[#{javascript:if(!!viewScope.TEST_SCOPE_VAR){ return "tooltip 1"; } else { return "tooltip 2"; }}]]&gt;&lt;/xp:this.title&gt;&lt;/xp:inputText&gt;
type: AnsweredQuestion
downvote count: 0
score: 1
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/29612242
has comment: http://stackoverflow.com/comment/47369785
has title: set xPage component title/tooltip doesn't work for readOnly component
upvote count: 1

http://stackoverflow.com/a/29653800
answers question: http://stackoverflow.com/q/29653619
upvote count: 2
accepted answer of: http://stackoverflow.com/q/29653619
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/47447677
score: 2
downvote count: 0
has body: What you are looking for is the \b word boundary special character. Change your regex to this and it will do what you want: var reg = new RegExp('\\b(' + text + ')', 'gi')

http://stackoverflow.com/comment/47245412
type: AnswerComment
type: Comment
has text: @adricar I included jquery, i forgot that. It does work. However, I do have a question about it..... I changed changei(1) to changei(2) and it worked. so is changei() not dependant on the variable e? is this my new variable. I will be binding this variable to a dynamic variable and want to make sure I am attaching the right one. If I changed 'e' from 1 to 0 nothing happens. Thanks for your help
comment on: http://stackoverflow.com/a/29545773
score: 0

http://stackoverflow.com/a/29627372
has comment: http://stackoverflow.com/comment/47412193
has body: I updated the JFiddle. Look at this: http://jsfiddle.net/r9b3ugs5/1/ Instead of alerting the id you can decide which tab has to be saved using the retrieved id. All you need to do is to add an id and a unique class (mytabs here) to all the tabs (on the li tag). $("#save-button").click(function() { alert($(".mytabs.active")[0].id); }); EDIT: Actually you don't really need the class you could select over the parent ("#my-tab-ul li.active"). Several possibilities. EDIT2: Further explanation give the form ids like tab-id-form (tab-id = id of tab belonging to form) replace the alert line with $("#" + $(".mytabs.active")[0].id + "-form").submit(); Complete solution (tested in IE and FF): http://jsfiddle.net/r9b3ugs5/5/ // optional: change the text on the button when the tab is switched $("#tab1").click(function() { $("#save-button").html("Submit 1"); }); $("#tab2").click(function() { $("#save-button").html("Submit 2"); }); $("#save-button").click(function() { var id = $(".mytabs.active")[0].id; if (id == "tab1") { // you can also do the submits here, then there is no need for a // special id, e.g. $("#completely-unrelated-form-id").submit() } else { // other submit if done in here, however with this approach you // always have to modify the code when adding tabs. } $("#" + id + "-form").submit(); // == EDIT2, no more code manipulation needed });
has comment: http://stackoverflow.com/comment/47412769
has comment: http://stackoverflow.com/comment/47413217
answers question: http://stackoverflow.com/q/29627031
has comment: http://stackoverflow.com/comment/47412374
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29627031
score: 1
has comment: http://stackoverflow.com/comment/47414180
has comment: http://stackoverflow.com/comment/47411688
type: Answer
has comment: http://stackoverflow.com/comment/47399586
upvote count: 1
has comment: http://stackoverflow.com/comment/47413905
has comment: http://stackoverflow.com/comment/47412669

http://stackoverflow.com/a/29590142
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29590001
has body: The problem is that you are getting a random value between min and max, and also that you are getting the value lower than the random value. The item that is excluded is actually the first item, but because you get the wrong item all the weights will be wrong, and you will never get the last item. You should get a random value between zero and max, otherwise you will exclude the first item in the array: var randNumber = Math.random() * max; You should then get the item with a value that is higher than the random number: var index = arr.length - 1; while (index &gt; 0 &amp;&amp; arr[index - 1] &gt;= randNumber) index--; Here is a test that shows that the weights are correct: http://jsfiddle.net/Guffa/kgbL4rsc/
upvote count: 2
answers question: http://stackoverflow.com/q/29590001
type: Answer
score: 2

http://stackoverflow.com/a/29563317
has body: Presenting and dismissing with Knockout can be done with the 'if' or 'with' binding. You could create a "ModalLayer" that is responsible for showing modals. You could communicate with this layer using signals/events/subscriptions for example. The HTML for the ModalLayer would look something like. ... Or using components...
answers question: http://stackoverflow.com/q/29549407
score: 0
type: Answer

http://stackoverflow.com/comment/47217830
has text: create array inside the loop?
score: 0
comment on: http://stackoverflow.com/q/29532210
type: QuestionComment
type: Comment

http://stackoverflow.com/a/29621795
has comment: http://stackoverflow.com/comment/47420084
score: 1
has body: Have you tried to evaluate javascript to get actual hrefs? It might be helpful Parsing HTML to get script variable value Or maybe you should check what PageURL function does (Just open the website with a browser and write at it's console PageURL without parentheses. It will show you code of the function) and rewrite it with C#
downvote count: 0
has comment: http://stackoverflow.com/comment/47480116
type: Answer
answers question: http://stackoverflow.com/q/29620091
upvote count: 1

http://stackoverflow.com/comment/47257153
type: AnswerComment
has text: Yep. I didn't think about the "randomness" of the result at all. I was totally focused on just meeting the basic requirement.
type: Comment
comment on: http://stackoverflow.com/a/29552677
score: 0

http://stackoverflow.com/comment/47499617
comment on: http://stackoverflow.com/q/29661977
score: 0
type: Comment
type: QuestionComment
has text: possible duplicate of [Duplicate edges not being removed in Delaunay Triangle construction](http://stackoverflow.com/questions/29639924/duplicate-edges-not-being-removed-in-delaunay-triangle-construction)

http://stackoverflow.com/comment/47289100
comment on: http://stackoverflow.com/a/29561148
has text: @Maxim, thanks for the answer, this seems to be correct, but I think I might have to delete the question since I asked the wrong question. I apologize for that.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47377125
has text: but if i did a addClass() on the post shouldn't that 'theoretically' have worked too? it did not
type: Comment
comment on: http://stackoverflow.com/a/29615843
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47614586
type: AnswerComment
comment on: http://stackoverflow.com/a/29668932
has text: i dont have the devices you are reffering to not working, so i cant test, it works on my iphone and on desktop. Its not related, but line 32 should be fontresize(); with a parenthesis since youre actually calling it, and not passing a reference to it. And also your function variable should have a "var" in front of it, or you can try to declare your function like so on line 27: function fontresize() {
score: 0
type: Comment

http://stackoverflow.com/q/29601940
has answer: http://stackoverflow.com/a/29602261
tagged with: javascript
has answer: http://stackoverflow.com/a/29602262
upvote count: 2
tagged with: canvas
has answer: http://stackoverflow.com/a/29602194
has answer: http://stackoverflow.com/a/29602234
favorite count: 0
has title: Can I create two canvas spaces in a unique html page?
has body: I am trying to create an HTML page which has two canvas spaces, i. e. two rectangles where objects can be displayed. In my HTML code I have this line, that represents a rectangle of dimensions 540x600 dp on the left side of the page: &lt;canvas id="canvas" width="540" height="600"&gt;&lt;/canvas&gt; But apart from that, I want to generate another canvas space on the right side. Is it possible? How could I do it?
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 4
type: AnsweredQuestion
score: 2
downvote count: 0
accepted answer: http://stackoverflow.com/a/29602261
possible better answer: http://stackoverflow.com/a/29602194
has comment: http://stackoverflow.com/comment/47350831
type: Question

http://stackoverflow.com/q/29627903
has title: Jquery clone div breaking events
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29628061
has body: I am cloning a div and changing all of the child element id's and appending it below the original div. Now within that div I have several buttons that trigger events when clicked. Each one of these buttons have a class name that I am using to fire the event opposed to using the id. However when I try to click on any buttons within my cloned div none of my events are firing. Here is how I am cloning my div, changing the id's and appending it: $(function() { var $section = $("#facility_section_info").clone(); var $cloneID = 1; $( ".addSection" ).click(function() { var $sectionClone = $section.clone(true).find("*[id]").andSelf().each(function() { $(this).attr("id", $(this).attr("id") + $cloneID); }); $('#facility_section_info').append($sectionClone); $cloneID++; }); }); here is an original uncloned button within the div that fires an event. And here is what the cloned button looks like: The only thing that has changed is that I have added a 1 at the end of the id. Here is the event that gets fired when this button gets clicked: $(function() { var $componentTB = $("#component_tb"), $firstTRCopy = $("#row0").clone(); $idVal = 1; $(".addRows").click(function() { var copy = $firstTRCopy.clone(); var newId = 'row' +$idVal; copy.attr('id', newId); $idVal += 1; copy.children('td').last().append("Remove"); $componentTB.append(copy); }); }); All this function does is clone a table row in its original form and append it to the end of a table with an added remove link. This function works exactly how I need it to other than not firing when I click on my cloned button. Why do my cloned buttons not fire any of my events that are called by class name and not id?
has comment: http://stackoverflow.com/comment/47399365
upvote count: 1
has comment: http://stackoverflow.com/comment/47399047
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47398932
tagged with: javascript
has answer: http://stackoverflow.com/a/29627971
accepted answer: http://stackoverflow.com/a/29628061
score: 0
possible better answer: http://stackoverflow.com/a/29627993
has comment: http://stackoverflow.com/comment/47399794
answer count: 3
linked to: http://stackoverflow.com/q/9122078
has comment: http://stackoverflow.com/comment/47398889
has answer: http://stackoverflow.com/a/29627993
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47399524
has comment: http://stackoverflow.com/comment/47398823
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47399199

http://stackoverflow.com/q/29617177
tagged with: width
tagged with: resize
has answer: http://stackoverflow.com/a/29617336
tagged with: image
answer count: 3
downvote count: 0
tagged with: javascript
favorite count: 0
linked to: http://stackoverflow.com/q/5284878
has title: Change image with page width resize
accepted answer: http://stackoverflow.com/a/29617336
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29617420
has body: I need some help with this JavaScript code, I'm all new to using javascript so when I get stuck it gets annoying. What I'm trying to do is change the image displayed on my nav bar when on small screens (mobiles) because the nav bar color changes. What I have come up with so far by searching online and some playing only works when the screen size is manually reduced and then the image changes like it should. However I want it to load in this state as well and thats where I am stuck. $(window).on('resize', function(){ var win = $(this); if (win.width() &lt; 768) { $(".navbar-brand img").attr('src', 'img/icons/logowhite.png'); } else { $(".navbar-brand img").attr('src', 'img/icons/logodark.png'); }}); Could this be done in the css instead is also a question I have?
has answer: http://stackoverflow.com/a/29617327
score: 2
type: AnsweredQuestion
upvote count: 2
possible better answer: http://stackoverflow.com/a/29617327
linked to: http://stackoverflow.com/q/21574881
type: Question

http://stackoverflow.com/comment/47282664
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29566545
score: 0
has text: @Andreas so do I need to add an `each(function(){})` in there?

http://stackoverflow.com/a/29538680
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/29532349
answers question: http://stackoverflow.com/q/29532349
has body: As it turns out, the element will have two scopes: child scope created by ng-repeat directive angular.element(el).scope(); isolate scope created by makeIsolateScope directive: angular.element(el).isolateScope(); The order is the following: 1) ng-repeat's compile function is called and all other directives with priority less then 2000 (ng-repeat's priority) are not compiled as part of compiling the node. It means that right now makeIsolateDirective is not compiled. 2) since ng-repeat is defined as transclude:element, the entire node is compiled as part of transclusion compilation process and now makeIsolateDirective is compiled and its compile function is executed. 3) ng-repeat's linking function is executed which receives $transcludeFn function. This $transcludeFn function is executed n times receiving cloned dom compiled against the child scope (created by transclusion mechanism) of the parent node: $transclude(function ngRepeatTransclude(clonedDom, scope) { // here clonedDom is the clone of the original &lt;li&gt; node 4) makeIsolateBindings's linking function is executed with isolated scope, created by this directive. The parent of the scope is a rootScope. Linking function of other directives, that do not create isolate scope, are executed with child scope, which was used with $transcludeFn inside ng-repeat's linking function. The directives, that create isolate scope and request $$isolateBindings from the parent, are evaluated against child scope created by ng-repeat's transclusion mechanism. Here is extract from source code: forEach(isolateScope.$$isolateBindings = newIsolateScopeDirective.$$isolateBindings, function(definition, scopeName) { ... case '=': ... lastValue = isolateBindingContext[scopeName] = parentGet(scope); // the scope here is the child's scope created by transclusion This article is very useful to understand how $transcludeFn works.
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/q/29674198
downvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: promise
has answer: http://stackoverflow.com/a/29674273
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47486743
has title: How to receive async function response from another function? using promises.
score: 1
upvote count: 1
has body: How to receive async function response from another function? using promises. Here is an example, lets say i have two function, when one of them responsible to greet people and other responsible to send a request. How to organize my code to be able to hold all the request logic inside askGoogle function? function greetings(lang) { var response; if(lang == 'en') response "Hello"; else response = askGoogle(lang); return response } askGoogle = function(lang) { $.getJSON('http://somelinkhere').then(function(data) {///}) return ...// something here.. }
type: Question
has comment: http://stackoverflow.com/comment/47486146
has comment: http://stackoverflow.com/comment/47486249
tagged with: javascript

http://stackoverflow.com/comment/47400783
type: AnswerComment
has text: @JustusRomijn Please put important information like that in the question next time. Its still not an issue though, just make a new directive called `activatableMozzerlla` or something and wrap it around `Mozzerella`
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29628874

http://stackoverflow.com/a/29596229
upvote count: 1
answers question: http://stackoverflow.com/q/29585062
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29585062
type: Answer
score: 1
has body: I've managed to figure it out myself. Here's the solution below. Create an array and store all of the layer names inside layerArray = [layer, layer2, layer3, layer4] Create a function that will be called when the click event is triggered, passing in the layer object and the layer index callFunc = (layer, index) -&gt; print index Loop over each layer in the array and pass the clicked layer to the function for layer, index in layerArray layer.on(Events.Click, callFunc)

http://stackoverflow.com/comment/47491214
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29674369
has text: oh.. ok, never mind :)

http://stackoverflow.com/comment/47509256
has text: It's best to start out with basic HTML and perhaps move onto JavaScript. PHP is a backend technology and will require a PHP server. Again, I really recommend learning HTML and at least -some- JavaScript before you try to PHP.
comment on: http://stackoverflow.com/q/29685843
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47223463
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29535391
has text: Where is your code that's generating this output?
score: 0

http://stackoverflow.com/q/29559980
type: AnsweredQuestion
has body: I am trying to pass the pageIndex variable to my code behind from javascript. The code works if I pass any hardcoded value. However, I can't get it to work using var values. pageIndex++; var sPageIndex = pageIndex.toString; document.getElementById('&lt;%= Label1.ClientID %&gt;').innerHTML = '&lt;%= xDoSomething(sPageIndex)%&gt;'; This works: document.getElementById('&lt;%= Label1.ClientID %&gt;').innerHTML = '&lt;%= xDoSomething(123456)%&gt;'; This is my simple code behind function: Public Shared Function xDoSomething(sPageIndex As String) As String Dim ss As String = sPageIndex Try If ss.Length &lt; 1 Then ss = "smaller than one" Else ss = ss End If Return "from code behind [" &amp; ss &amp; "]" Catch ex As Exception Return ex.ToString End Try End Function It looks like the value I'm trying to pass does not have permissions to be accessed! Any ideas how to fix this?
tagged with: asp.net
type: Question
has comment: http://stackoverflow.com/comment/47275377
has title: Passing a value to code behind function from var
has answer: http://stackoverflow.com/a/29562986
has answer: http://stackoverflow.com/a/29562876
score: 0
has answer: http://stackoverflow.com/a/29560018
answer count: 4
accepted answer: http://stackoverflow.com/a/29562986
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29560018
tagged with: jquery
has answer: http://stackoverflow.com/a/29560071
linked to: http://stackoverflow.com/q/26988957

http://stackoverflow.com/q/29581065
has answer: http://stackoverflow.com/a/29581196
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/19491336
has answer: http://stackoverflow.com/a/29581194
has title: Get query parameter from URL through Javascript
type: Question
tagged with: javascript
score: 0
answer count: 3
has body: I have an application need to parse the parameter from URL. But the URL got special character '#'. URL: http://localhost:8080/test.html?parms=PESTL4#2 I printed the windows.location, and the result is "http://localhost:8080/test.html?parms=PESTL4#2". I used the following sample code to get parms, and it returns PESTL4. How does it work? function getQueryVariable(variable) { var query = window.location.search.substring(1); var vars = query.split("&amp;"); for (var i=0;i&lt;vars.length;i++) { var pair = vars[i].split("="); if(pair[0] == variable){return pair[1];} } return(false); }
has answer: http://stackoverflow.com/a/29581471
has comment: http://stackoverflow.com/comment/47311171

http://stackoverflow.com/comment/47301433
type: QuestionComment
type: Comment
has text: There is no secure way to do this. IP certainly is not an option, since multiple users can use the same IP address. Cookies or other means of identification can be suppressed, faked or manipulated. In general it is a bad habit of programmers to decide for the user. Let the user decide what he wants to do.
comment on: http://stackoverflow.com/q/29576463
score: 0

http://stackoverflow.com/q/29660281
downvote count: 0
answer count: 1
score: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/29660818
type: AnsweredQuestion
has body: I'm using knockout-validation and am having a problem with the error messages not showing correctly after changing what observable an input field is bound to. I have the following html First Name Last Name 0'> First Name Last Name Edit And JavaScript var lineViewModel = function(first, last) { this.FirstName = ko.observable(first).extend({required:true}); this.LastName = ko.observable(last).extend({required: true}); this.errors = ko.validation.group(this); } var mainViewModel = function() { this.gridItems = ko.observableArray(); this.gridItems([new lineViewModel('first1'), new lineViewModel(null,'last2')]); this.selectedItem = ko.observable(); this.editItem = function(item){ if (this.selectedItem()) { if (this.selectedItem().errors().length) { alert('setting error messages') this.selectedItem().errors.showAllMessages(true); } else{ this.selectedItem(item) } } else this.selectedItem(item) }.bind(this) } ko.applyBindings(new mainViewModel()); Reproduce Use this JSFiddle Click Edit on the first line Click Edit on the second line - You will be alerted of validation message being shown and then it will show Fill out required field Click Edit on the second line again - You will see "First Name" go blank and "Last Name" change to "last2" Click Edit on the first line - You will be alerted of validation message being shown, BUT it's not show (BUG) Should I take another approach to this or should I do something different with the way that I am using ko.validation.group?
upvote count: 1
tagged with: knockout.js
type: Question
tagged with: javascript
has title: Knockout Validation - Validation not binding to correct instance of object
tagged with: knockout-validation
has answer: http://stackoverflow.com/a/29660818

http://stackoverflow.com/a/40684910
has comment: http://stackoverflow.com/comment/74461152
has body: <DefaultRoute handler={DashboardExplain} /> <Redirect from="/*" to="/" />
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/72984042
answers question: http://stackoverflow.com/q/29552601
downvote count: 0
type: Answer

http://stackoverflow.com/comment/47370685
type: QuestionComment
comment on: http://stackoverflow.com/q/29612538
score: 0
type: Comment
has text: @Barmar scope is confusing me

variables
tags question: http://stackoverflow.com/q/29601203
tag name: variables
tags question: http://stackoverflow.com/q/29549010
tags question: http://stackoverflow.com/q/29622198
tags question: http://stackoverflow.com/q/29653583
tags question: http://stackoverflow.com/q/29539448
tags question: http://stackoverflow.com/q/29608723
type: Tag
tags question: http://stackoverflow.com/q/29570690
tags question: http://stackoverflow.com/q/29610652
tags question: http://stackoverflow.com/q/29678469
tags question: http://stackoverflow.com/q/29548681
tags question: http://stackoverflow.com/q/29654738
tags question: http://stackoverflow.com/q/29541576
tags question: http://stackoverflow.com/q/29679317
tags question: http://stackoverflow.com/q/29541519

http://stackoverflow.com/a/29554703
score: 1
has body: .next can only return the immediate next sibling $('li.test').on('click', function() { $('li.test').next('li').css("color", "red"); }); and to change the color of ******* you need to put them in li tag, as follows: &lt;li class=""&gt;*******&lt;/li&gt; Also you can use $(this) instead of $('li.test') as said by @empiric
upvote count: 1
answers question: http://stackoverflow.com/q/29554575
type: Answer
has comment: http://stackoverflow.com/comment/47260134
downvote count: 0

http://stackoverflow.com/comment/47504245
type: Comment
comment on: http://stackoverflow.com/a/29682810
has text: Yeah the site didnt allow me to comment when I wanted to. So I put it up as an answer. Sorry about that!
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47263362
type: Comment
comment on: http://stackoverflow.com/a/29555748
type: AnswerComment
has text: Oh thank you, helped me really a lot :) just one question.. after I got returned the $scope.selectedWork.. how can I access to it in my view? Is {{ selectedWork.Title }} should be enough? Just because it didn't get me anything in that way right now.
score: 0

http://stackoverflow.com/q/29641290
tagged with: sweetalert
tagged with: javascript
score: 9
linked to: http://stackoverflow.com/q/276660
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47424548
has body: I am trying to display a message to the user before he closes the window. I am using SweetAlert (http://tristanedwards.me/sweetalert) which is running fine. The problem is with the JavaScript/jQuery to let me know when the user is trying to close the window/tab and then to display something preventing him from closing the page unless he clicks again. &lt;script language="JavaScript"&gt; window.onbeforeunload = confirmExit; function confirmExit() { swal("Here's a message!"); return "You have attempted to leave this page. Are you sure?"; } &lt;/script&gt; I have tried this, but it displays the ugly usual message on top of my SweetAlert, any ideas? Without the return part it closes the window anyway, I tried :/
has answer: http://stackoverflow.com/a/29642031
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47424635
has title: Launching SweetAlert to prevent user from closing window
accepted answer: http://stackoverflow.com/a/29642031
has comment: http://stackoverflow.com/comment/47424164
type: Question
upvote count: 9

http://stackoverflow.com/q/29530367
upvote count: 2
has title: How to Enable Submit Button After API Call and Within if Statement
type: Question
has comment: http://stackoverflow.com/comment/47214293
has answer: http://stackoverflow.com/a/29530412
tagged with: javascript
has answer: http://stackoverflow.com/a/29530448
answer count: 3
has comment: http://stackoverflow.com/comment/47214706
has comment: http://stackoverflow.com/comment/47215145
downvote count: 0
has body: I am disabling the submit button #myButton after i execute an api call doAjax(); $("#myButton").click(function (e) { doAjax(); $('input:submit').attr("disabled", true); }); But it wont enable after the callback .. i want to enable it if the call back meets a certain criteria i.e. $.ajax({ type: "GET", url: "api5.php", data: dataString, dataType: "json", //if received a response from the server success: function (response) { var status = response.status; enter code here if ((status == 'READY' &amp;&amp; response.endpoints[0].statusMessage == 'Ready')) { $('input:submit').attr("disabled", false); doesn't seem to work though.. button stays disabled.
tagged with: jquery
has answer: http://stackoverflow.com/a/29530462
possible better answer: http://stackoverflow.com/a/29530448
favorite count: 0
has comment: http://stackoverflow.com/comment/47215214
accepted answer: http://stackoverflow.com/a/29530412
tagged with: ajax
score: 2
type: AnsweredQuestion

http://stackoverflow.com/a/29663073
has body: You can use the inline mode of CKEditor. A simple example: http://jsfiddle.net/jhvtz6pb/ Load the CKEditor script and CSS styles: Then, just add a contenteditable="true" attribute to the elements that you want to edit.
type: Answer
answers question: http://stackoverflow.com/q/29662439
has comment: http://stackoverflow.com/comment/47476981
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29662439

http://stackoverflow.com/a/29658963
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29658839
downvote count: 0
has body: Try this: if (typeof food == "number") { console.log("I can't eat " + food + " because it's a number"); } else { console.log("I want to eat " + food); }

http://stackoverflow.com/a/29598497
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
has body: Works mostly as expected I think, just an incorrect selector for div2. Best to use $(window).scrollTop() or if you must $('html, body').scrollTop() by the way. Update - adjustment for when toggling triggers : http://jsfiddle.net/ydbev5rq/7/ div2FromTop = $(window).scrollTop()+$(window).height(); Of course, using a $(this) when you can never hurts... div2FromTop = $(this).scrollTop()+$(this).height();
accepted answer of: http://stackoverflow.com/q/29598194
upvote count: 2
answers question: http://stackoverflow.com/q/29598194

http://stackoverflow.com/q/29642295
type: Question
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47431165
score: 4
answer count: 2
has comment: http://stackoverflow.com/comment/47431474
accepted answer: http://stackoverflow.com/a/29646043
has comment: http://stackoverflow.com/comment/47425962
possible better answer: http://stackoverflow.com/a/50946414
has comment: http://stackoverflow.com/comment/47427158
has title: Sorting HTML table by two columns
has answer: http://stackoverflow.com/a/50946414
upvote count: 4
has comment: http://stackoverflow.com/comment/47426057
has comment: http://stackoverflow.com/comment/47426080
type: AnsweredQuestion
has body: I have several columns in a table such as column A,B,C,D and E which I need to show in my HTML page. In some pages I need to show sorted results based on only one column of page, such as for Column "C" which is 3rd column of table. I am able to do this using the below code: function Ascending(a, b) { if (a &lt; b) return -1; if (a &gt; b) return 1; return 0; } var rows = $('#table tr').not(':first').get(); $('#table tr').slice(1).remove(); rows.sort(function(rowA, rowB) { var keyA = $(rowA).children('td').eq(2).text().toUpperCase(); var keyB = $(rowB).children('td').eq(2).text().toUpperCase(); return Ascending(keyA, keyB); }); But I have another requirement wherein I need to show the sorted results based on two columns i.e. based on the sorting of Column C in above case, results of column E should also get sorted. For example: Before sorting: Column C Column E 2 Fish 1 Box 7 Cat 2 Dog 1 Apple 2 Box 2 Axe 7 Box 2 Answer 7 Apple 6 Year 2 Goat After sorting Column C only: Column C Column E 1 Box 1 Apple 2 Dog 2 Fish 2 Box 2 Axe 2 Goat 2 Answer 6 Year 7 Box 7 Apple 7 Cat After sorting Column C then Column E: Column C Column E 1 Apple 1 Box 2 Answer 2 Axe 2 Box 2 Dog 2 Fish 2 Goat 6 Year 7 Apple 7 Box 7 Cat Which I am unable to implement. How can I do it?
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: sorting
favorite count: 0
has answer: http://stackoverflow.com/a/29646043

http://stackoverflow.com/q/29585815
has title: How can I include carriage return within content using opentips.js?
tagged with: javascript
has answer: http://stackoverflow.com/a/29586111
has comment: http://stackoverflow.com/comment/47319691
accepted answer: http://stackoverflow.com/a/29586111
score: 0
answer count: 1
has body: I'm using opentips.js and trying to include a carriage return in the content. I tried using ascii and \n but both don't work. I feel like there should be an easy answer for this. This is the trigger.
has comment: http://stackoverflow.com/comment/47319796
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/47495610
score: 0
type: Comment
type: QuestionComment
has text: Same as @GaurangTandon, your fiddle works perfectly.
comment on: http://stackoverflow.com/q/29678607

http://stackoverflow.com/comment/47422658
has text: What does `alert(a)` have?
comment on: http://stackoverflow.com/q/29640432
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/a/29664071
downvote count: 0
score: 1
has body: Should just be able to save off the innerHTML: t = setInterval(function(){ var el = document.getElementById('test'); var text = el.innerHTML; el.innerHTML = 'x' + text + 'x'; },1000) Incidentally . . . this seems like a weird thing to want to do.
answers question: http://stackoverflow.com/q/29664007
upvote count: 1
type: Answer

http://stackoverflow.com/comment/47232545
type: Comment
comment on: http://stackoverflow.com/a/29539162
score: 0
type: AnswerComment
has text: Thanks for this @AdamBoduch . Let's rename it to partitionToGroups

http://stackoverflow.com/comment/47296337
type: Comment
has text: Have you come up with a solution?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29550661

http://stackoverflow.com/a/29669638
score: 3
type: Answer
has comment: http://stackoverflow.com/comment/47516847
has body: As I already commented, instead of using .css() which defines inline styles for an element has highest precedence hence you can reset it with nothing but jQuery again which is dirty or might get dirty if you have more than couple of properties to reset/change in if else. So instead of using .css() you should be using .addClass() and .removeClass() methods and will accomplish well of what you are looking for.
upvote count: 3
answers question: http://stackoverflow.com/q/29669376
downvote count: 0

http://stackoverflow.com/comment/47473534
comment on: http://stackoverflow.com/a/29667355
type: AnswerComment
type: Comment
has text: @mhkyazd simply do not write `var x` anywhere in the function if `x` comes from an outer scope so it is not overriden.
score: 2

http://stackoverflow.com/comment/47472144
score: 0
comment on: http://stackoverflow.com/q/29666449
type: Comment
type: QuestionComment
has text: no error but i cn"t dig where is issue (modal is opening).

http://stackoverflow.com/q/29610346
tagged with: angular-ui-bootstrap
score: 0
has comment: http://stackoverflow.com/comment/47366631
has answer: http://stackoverflow.com/a/29610587
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/29610587
has comment: http://stackoverflow.com/comment/47366618
has body: I am trying to open a bootstrap modal with the $timeout function, however the modal keeps opening as timeout fires more than once. Any help will be much appreciated. Thanks SessionModalInstCtrl = ($scope, $modal, $timeout) -&gt; $timeout (-&gt; $modal.open( templateUrl: 'session-timeout.html' controller: 'MmmSessionModalInstCtrl') ), 1000 Heres what my view looks like %div{'data-ng-controller' =&gt; 'SessionModalInstCtrl'} %script{id: "session-timeout.html", type: "text/ng-template"} // modal content
tagged with: ruby-on-rails
type: AnsweredQuestion
tagged with: coffeescript
has comment: http://stackoverflow.com/comment/47366473
type: Question
has title: Angular js bootstrap ui modal timeout
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/29575224
tagged with: css
type: AnsweredQuestion
has body: I found that for files in my subfolders, I have to reference my CSS file as /1.css (otherwise it won't work) whereas in my main folder I can simply reference it as 1.css (no slash needed). This saves a small amount of space, but is it bad practice to reference it this way?
type: Question
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/29575279
accepted answer: http://stackoverflow.com/a/29575279
has title: CSS/JS Reference Difference, Main Folder Vs Subfolder

http://stackoverflow.com/a/29602899
downvote count: 0
type: Answer
upvote count: 1
has body: If you can capture the event object, you can use the preventDefault() to stop it function catchMouseEvent(e){ e.preventDefault(); }
answers question: http://stackoverflow.com/q/29602841
score: 1
has comment: http://stackoverflow.com/comment/47354854

http://stackoverflow.com/comment/47229628
type: Comment
comment on: http://stackoverflow.com/q/29538251
has text: did you tried something like ```"change .js-star-rating input": function(e){}```?
score: 1
type: QuestionComment

http://stackoverflow.com/q/29686236
type: AnsweredQuestion
tagged with: javascript
type: Question
has body: I have two directives, a parent and a child, I'd like a way to get information from the parent to the child such that the child has that information during its compile phase. Specifically, I have "tree" (parent) and "tree node" (child) directives and I want to modify the template for the tree node (child) based on attributes attached to the tree itself (parent). For anyone interested, you can see the code on GitHub: Tree Tree Node I'll also point out that the tree node itself is effectively deferring it's compilation until post link, so perhaps that opens some doors. I'd like to avoid doing any dom traversal in the node (i.e. recursively inspecting parent elements to find an attribute on the tree directive). Also, keep in mind that there may be multiple tree directives on the page and they may need to create new nodes on the fly later on so I don't think I can really get away with e.g. flashing the info temporarily to a service.
has answer: http://stackoverflow.com/a/29799735
tagged with: angularjs
score: 0
tagged with: treeview
answer count: 2
has title: Angular directive communication in compile phase
tagged with: angularjs-directive
possible better answer: http://stackoverflow.com/a/29687069
has answer: http://stackoverflow.com/a/29687069
accepted answer: http://stackoverflow.com/a/29799735

http://stackoverflow.com/comment/47234610
comment on: http://stackoverflow.com/a/29540703
type: AnswerComment
has text: @SweatCoder What @Gael said. If your iframe contains 3rd party content, there is no way for you to know if that content has loaded due to cross-domain scripting rules. If it's hosted on your server and the library provides a reaction to the iframe loading, you can use that. You can also try to add a `[src]` attribute selector, like in [this example](https://jsfiddle.net/qLqo6spv/). This won't add the border until after a source is specified, but it will add it before the content is entirely loaded.
score: 0
type: Comment

http://stackoverflow.com/q/29630579
type: Question
has title: angular-translate - multiple languages on the same page
has answer: http://stackoverflow.com/a/46588146
tagged with: javascript
score: 4
has body: I'm building a questionnaire type app where you have the first person language on top and you have the exact same question on the bottom in a different language. right now i'm data binding all question to one big object like this. lanOneQuestion lanTwoQuestion and each question has like lanOneQuestion.one that corresponds to the each question. I get the string of data from a big json document. I'm wondering if I could use angular-translate, but I didn't see a way to use multiple language's at the same time?
has comment: http://stackoverflow.com/comment/47410288
answer count: 1
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
upvote count: 4
tagged with: internationalization
downvote count: 0
has comment: http://stackoverflow.com/comment/47403890

http://stackoverflow.com/comment/47388598
has text: You have not included jquery in jsfiddle, i have updated it
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29622311
score: 0

http://stackoverflow.com/q/29646879
score: 2
downvote count: 1
type: Question
tagged with: google-maps
has body: I am using jQuery with a Google Maps Listener. I have boxes in my map and I need to make changes on them when they are too close. The problem is the next one: I check if the boxes are close and then make them red (for example). I know the condition is OK because I have a "console.log" and everything is nice. Here is my code: Little explanation: A marker is an element in the map. Every marker has his own infobox (the boxes in the map I want to change). A cluster is a group of markers. clusterListener2 = google.maps.event.addListener(markerCluster, 'click', function (clusterer) { zoomLimit=12; var myzoom = map.getZoom(); var olderPosk=1000000; var olderPosD=1000000; if (myzoom&gt;zoomLimit) { clusterClickController=1; $.each(clusterer.getMarkers(), (function (index, marker) { var restak=olderPosk-marker.position.k; var restaD=olderPosD-marker.position.D; if (restak&lt;0) restak=restak*(-1); if (restaD&lt;0) restaD=restaD*(-1); if ((restak&lt;0.0001)&amp;&amp;(restaD&lt;0.0001)) { console.log("Close elements"); console.log($(this.infobox)); currentInfobox=$(this.infobox); currentInfobox.css({"background" : "red"}); } olderPosk=marker.position.k; olderPosD=marker.position.D; marker.marker.open(map, this); marker.infobox.open(map,this); marker.marker.isHidden = false; })); } else { clusterClickController=0; } }); So, the "Close elements" console.log is appearing in console and the $(this.infobox) prints a jQuery element but when I do the "background red" statement it does not work. Any help? Thanks
tagged with: javascript
tagged with: jquery
tagged with: google-maps-api-3
upvote count: 3
has title: Accessing a jQuery element Google Maps Listener
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/29658297
type: UnansweredQuestion

http://stackoverflow.com/comment/47477695
comment on: http://stackoverflow.com/a/29614359
type: AnswerComment
score: 0
type: Comment
has text: Can you tell me it is working for Primefaces? I've faced some problem to do this in Primefaces. Function is not called from the <p:inputText id="mobileNo" required="true" label="" requiredMessage="Mobile number is required"> <p:watermark value="+91-9000000000" for="mobileNo" /> </p:inputText>

http://stackoverflow.com/q/29619144
type: AnsweredQuestion
score: 1
linked to: http://stackoverflow.com/q/1916584
possible better answer: http://stackoverflow.com/a/29619262
type: Question
downvote count: 0
has title: Updating interval dynamically - jQuery or Javascript
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29619268
tagged with: jquery
has body: I have two "stopwatches" in my code (and I may be adding more). This is the code I currently use below - and it works fine. But I'd really like to put the bulk of that code into a function so I'm not repeating the same code over and over. When I tried doing it though, I could get it working - I think it was because I was passing stopwatchTimerId and stopwatch2TimerId into the function and it may have been passing by reference? How can I reduce the amount of code repetition here? var stopwatchTimerId = 0; var stopwatch2TimerId = 0; $('#stopwatch').click(function () { if ($(this).hasClass('active')) { $(this).removeClass('active'); clearInterval(stopwatchTimerId); } else { $(this).addClass('active'); stopwatchTimerId = setInterval(function () { var currentValue = parseInt($('#stopwatch-seconds').val()) || 0; $('#stopwatch-seconds').val(currentValue + 1).change(); }, 1000); } }); $('#stopwatch2').click(function () { if ($(this).hasClass('active')) { $(this).removeClass('active'); clearInterval(stopwatch2TimerId); } else { $(this).addClass('active'); stopwatch2TimerId = setInterval(function () { var currentValue = parseInt($('#stopwatch2-seconds').val()) || 0; $('#stopwatch2-seconds').val(currentValue + 1).change(); }, 1000); } }); As you can see, it's basically the same code in each except for stopwatchTimerId and $('#stopwatch-seconds') (and the same vars with 2 on it for the other one).
has answer: http://stackoverflow.com/a/29619268
answer count: 4
favorite count: 0
has answer: http://stackoverflow.com/a/29619262
has answer: http://stackoverflow.com/a/29619241
upvote count: 1
has answer: http://stackoverflow.com/a/29619621

http://stackoverflow.com/q/29584453
has comment: http://stackoverflow.com/comment/47317348
favorite count: 0
has body: I have the following page: http://jsfiddle.net/ybv4jd9d/ HTML: This is Image One This is a description or a start to the image one article... If the output pane is made smaller in the jsfiddle link, the text shows up and doesn't stay hidden. How can I use z-index to make it go under the image so it doesn't show up and stays hidden.
possible better answer: http://stackoverflow.com/a/29584669
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
upvote count: 1
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29584669
has answer: http://stackoverflow.com/a/29584672
accepted answer: http://stackoverflow.com/a/29584672
tagged with: javascript
score: 0
has title: How to ensure the slider text stays under the image
answer count: 2
tagged with: jquery

http://stackoverflow.com/q/29590110
downvote count: 0
answer count: 1
score: 1
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: spring-mvc
has comment: http://stackoverflow.com/comment/47327322
upvote count: 1
type: Question
has title: How to make IE not to cache my page?
has answer: http://stackoverflow.com/a/29590155
has comment: http://stackoverflow.com/comment/47327274
tagged with: javascript
linked to: http://stackoverflow.com/q/49547
has body: I am using spring MVC for angular JS for front end, when I login to my application with the first user credentials I am able to view the correct details. When I login with the next user again I am seeing the details of the first user. This happens only in IE. I need to clear the cookies manually to see the right details before i login with different usernames. I browsed and added some code in HTML but it didnt work out. &lt;meta http-equiv='cache-control' content='no-cache'/&gt; &lt;meta http-equiv='expires' content='-1'/&gt; But, there is no change when I used the above code also.

http://stackoverflow.com/comment/47305175
type: Comment
type: QuestionComment
has text: many of your escapes are not needed or missing.
comment on: http://stackoverflow.com/q/29575888
score: 1

http://stackoverflow.com/a/29630054
score: 3
type: AcceptedAnswer
upvote count: 3
type: Answer
answers question: http://stackoverflow.com/q/29629815
has body: jQuery animate() adds overflow: hidden by default during all animations. A simple way to get round this is to set overflow: visible !important; on the element that is being animated. In your case its the .mbox class. .mbox { /* other css */ overflow: visible !important; } JSFiddle Demo
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29629815

http://stackoverflow.com/comment/47471186
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29666130
has text: anecdotally: yes, officially: no, it depends on workload. if you just need it to within 1000ms, you're probably fine, but if people will die because it's 1500ms off, use something better.
score: 0

http://stackoverflow.com/comment/109080940
type: AnswerComment
score: 0
type: Comment
has text: My previous plugins were added with `require`, so in my case it looked like `plugins: [ ... require('karma-junit-reporter'), ..... ],`
comment on: http://stackoverflow.com/a/29666131

http://stackoverflow.com/comment/47329436
score: 0
has text: Are you able to find the line of the error in the console?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29591200

http://stackoverflow.com/comment/47291983
type: AnswerComment
score: 0
type: Comment
has text: Gotcha. Thanks for the insight.
comment on: http://stackoverflow.com/a/29571032

http://stackoverflow.com/comment/47220352
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29531777
has text: Haha no worries, I need to learn more myself so helping people on here helps a lot :))

http://stackoverflow.com/comment/47457266
comment on: http://stackoverflow.com/a/29658186
has text: I would prefer the 2nd solution, but it doesn't work: Instead of combining the 2 main.scss files, it just repeats the first file twice in the final output (assuming you meant `.pipe(concat('app.css')`).
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/29623430
type: Answer
score: 1
upvote count: 1
has body: You are adding the same reference to each item in errs, so when you add an item to that array, every reference to that array is seeing the item. An easy way to do a deep copy of the value: Array.prototype.arrayRepeat = function(value, times) { for (var x=0;x&lt;times;x++) this[x]=JSON.parse(JSON.stringify(value)) }
downvote count: 0
answers question: http://stackoverflow.com/q/29623141

http://stackoverflow.com/q/29621017
type: Question
has title: Select dropdown value not posted PHP
tagged with: javascript
tagged with: jquery
favorite count: 0
answer count: 3
has comment: http://stackoverflow.com/comment/47386450
has answer: http://stackoverflow.com/a/29621113
upvote count: 2
type: UnansweredQuestion
has body: I am making a new mobile form that is used as a pop-up on button click. I have this PHP and Javascript where I'm posting values to another page via JQuery: Please select Make: Samsung iPhone Sony Ericsson Please specify Model and version: newMobile.PHP <?php $model = $_POST['model']; $make = $_POST['comboA']; echo $make.$model; ?> The problem is I only get $model value but not that of $make. Can anyone help?
tagged with: php
downvote count: 1
has answer: http://stackoverflow.com/a/29621051
score: 1
has answer: http://stackoverflow.com/a/29621093

http://stackoverflow.com/q/29559369
tagged with: geocoding
tagged with: google-maps-api-3
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29561484
type: Question
has title: Accesing input element with javascript
tagged with: http://stackoverflow.com/tag/html
score: 0
accepted answer: http://stackoverflow.com/a/29561484
answer count: 1
tagged with: perl
has body: I'm not experienced with Javascript so any help would be very appriciated. For you guys this should be very easy. I posted a lot of code but my problem is just to copy 3 input fields values into a string/variable and use it for geocoding. I have this inputs in a table: &lt;table width="580px" cellpadding="0" cellspacing="0"&gt; &lt;tr&gt; &lt;td width="290"&gt;&lt;label for="street"&gt;Street:&lt;/label&gt;&lt;/td&gt; &lt;td width="278"&gt;&lt;INPUT type="text" name="obj_object_description_street" id="obj_object_description_street" class="inputField" autocomplete="off" /&gt;&lt;/td&gt; &lt;td width="12"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="290"&gt;&lt;label for="streetno"&gt;House number:&lt;/label&gt;&lt;/td&gt; &lt;td width="290"&gt;&lt;INPUT type="text" name="obj_object_description_streetno" id="obj_object_description_streetno" class="inputField" autocomplete="off" /&gt;&lt;/td&gt; &lt;td width="12"&gt;&amp;nbsp;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="290"&gt;&lt;label for="zipcode"&gt;Post number:* &lt;/label&gt;&lt;/td&gt; &lt;td width="290"&gt;&lt;INPUT type="text" name="obj_object_description_zipcode" id="obj_object_description_zipcode" class="inputField" autocomplete="off" /&gt;&lt;INPUT TYPE="hidden" name="sys_area_node_id" /&gt;&lt;/td&gt; &lt;td width="12"&gt;&lt;img src="/img/info.gif" alt="info" width="12" height="11" border="0" onclick="show_info(this,8);" onmouseover="make_pointer();" onmouseout="del_pointer();" /&gt;&lt;/td&gt; &lt;/tr&gt; And this code to display a google map with dragable pin: &lt;script type="text/javascript"&gt; var geox='&lt;%obj_object_description_geox%&gt;'; //Location from DB var geoy='&lt;%obj_object_description_geoy%&gt;'; //Location from DB var sgeox='&lt;%sys_area_geox%&gt;'; var sgeoy='&lt;%sys_area_geoy%&gt;'; var telefon = "&lt;%adv_advertiser_phone%&gt;"; var slika = "&lt;%main_media_web_url%&gt;"; var povrsina = "&lt;%area%&gt;"; var cijena = "&lt;%price_str%&gt;"; var naslov = '&lt;%headline%…
tagged with: javascript

http://stackoverflow.com/a/29617577
type: Answer
has body: Did you try overflow:hidden; Also depending on how you are declaring the page, IE will either render it in standard or quirks mode. &lt;!DOCTYPE html&gt; Should remove the scrollbar.
has comment: http://stackoverflow.com/comment/47380119
answers question: http://stackoverflow.com/q/29617259
has comment: http://stackoverflow.com/comment/47380024
score: 0

http://stackoverflow.com/q/29677898
answer count: 3
upvote count: 6
has answer: http://stackoverflow.com/a/29678140
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29678140
has title: JQuery datepicker return weeknumber and day of week
type: Question
tagged with: jquery-ui
has answer: http://stackoverflow.com/a/29678783
tagged with: jquery-ui-datepicker
score: 6
has body: Im trying to get the weeknumber and the name/shortcut of the weekday according to the chosen date through a JQuery calendar. Im not really proficient in JQuery so i can get the weeknumber, but i cant seem to get the name of the day with it. Could anyone help me out? $('#datepicker').datepicker({ onSelect: function (dateText, inst) { $('#weekNumber').val($.datepicker.iso8601Week(new Date(dateText))); } });
downvote count: 0
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/29678298
favorite count: 0
has answer: http://stackoverflow.com/a/29678298

http://stackoverflow.com/comment/47406641
score: 0
type: AnswerComment
type: Comment
has text: @Maximus: Yes, it would just reject the returned promise with it. Which might or might not be unnoticed (only in the end of a promise chain).
comment on: http://stackoverflow.com/a/29631413

http://stackoverflow.com/comment/47301054
has text: Why are you doing it from scratch when there are some great packages available for internationlisation ?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29576247

internationalization
tags question: http://stackoverflow.com/q/29630579
tags question: http://stackoverflow.com/q/29632022
type: Tag
tags question: http://stackoverflow.com/q/29558071
tag name: internationalization
tags question: http://stackoverflow.com/q/29587888

http://stackoverflow.com/q/29674441
favorite count: 0
tagged with: oauth
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/34606618
has body: Ok so i've been pulling my hair out for 2 days over this no doubt simple problem. I'm using their JS SDK, I have created an app, hosted the callback html file, both redirect_uri fields are correctly populated. When I then call the SC.connect the popup loads, I accept permission... then nothing happens. The popup never closes and my authentication is not returned to the original page. I have done everything as they have said in their developer docs. I have checked out their demo pages which work, I have analysed the code, I have even copied to code exactly and run it on my site, same damn problem. Only thing I can think is that it has something to do with the callback.html file. Am I supposed to put code in there to return back to my site after auth? (if so they kept quiet about this in the docs) I checked out the soundcloud version of the callback.html file, there's contains nothing but a link to the sdk.js file? Which I even tried but no matter what I do I can't seem to get the popup to close after auth. Any ideas guys? And yes, I'm fairly new to using apis
score: 1
has comment: http://stackoverflow.com/comment/47490767
type: Question
tagged with: soundcloud
upvote count: 1
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: callback
has title: SoundCloud JS Authentication

http://stackoverflow.com/a/29626943
downvote count: 0
has comment: http://stackoverflow.com/comment/47397404
answers question: http://stackoverflow.com/q/29626397
score: 10
has body: You can achieve what you want with the following: // I would cache these vars outside the scroll for better performance var navWrap = $('#navWrap'), nav = $('nav'), startPosition = navWrap.offset().top, stopPosition = $('#stopHere').offset().top - nav.outerHeight(); $(document).scroll(function () { //stick nav to top of page var y = $(this).scrollTop(); if (y &gt; startPosition) { nav.addClass('sticky'); if (y &gt; stopPosition) { nav.css('top', stopPosition - y); } else { nav.css('top', 0); } } else { nav.removeClass('sticky'); } }); Example
upvote count: 10
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/29626397

http://stackoverflow.com/a/29666872
has comment: http://stackoverflow.com/comment/47517667
score: 0
has body: Try below, &lt;li&gt; &lt;span id="register_notification_row"&gt; &lt;?php $terms_url=Mage::getUrl('terms-of-use'); $privacy_policy_url=Mage::getUrl('privacy-policy-cookie-restriction-mode'); ?&gt; By clicking "Submit", I agree to your website's &lt;a href="&lt;?php echo $terms_url;?&gt;"&gt;Terms of Use&lt;/a&gt; and &lt;a href="&lt;?php echo $privacy_policy_url;?&gt;"&gt;Privacy Notice&lt;/a&gt;. &lt;/span&gt; &lt;/li&gt; {{store url=""} is used in wysiwyg editor only.
type: Answer
has comment: http://stackoverflow.com/comment/47501809
answers question: http://stackoverflow.com/q/29665421

http://stackoverflow.com/a/29568137
downvote count: 0
answers question: http://stackoverflow.com/q/29568036
type: Answer
accepted answer of: http://stackoverflow.com/q/29568036
score: 2
upvote count: 2
has body: You are probably looking for window.history.replaceState Usage: window.history.replaceState( {} , 'foo', '/foo' ); From w3.org: history . replaceState(data, title [, url ] ) Updates the current entry in the session history to have the given data, title, and, if provided and not null, URL. or you can use localStorage like this: if (!localStorage.getItem("visited")) { //yourmessage localStorage.setItem("visited", "true"); } //clear the localStorage when the tab is closed window.onbeforeunload = function() { localStorage.removeItem("visited"); };
type: AcceptedAnswer

http://stackoverflow.com/comment/47474187
has text: @JohnatanM I think my question can help you as I had a similar [problem](http://stackoverflow.com/questions/26835394/select-dropdownlist-is-not-displaying)
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29667124

http://stackoverflow.com/a/29627553
downvote count: 0
has comment: http://stackoverflow.com/comment/47398507
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/29624849
score: 1
has body: You can use custom binding, as described in the http://www.knockmeout.net/2011/07/another-look-at-custom-bindings-for.html article in order to wrap HTML/JS elements with Knockout, e.g. jquery button binding: ko.bindingHandlers.jqButton = { init: function(element, valueAccessor) { var options = valueAccessor() || {}; $(element).button(options); } }; usage: data-bind="jqButton: { ...some options... }" In the custom binding you can access the element the binding is applied to.

http://stackoverflow.com/a/29600428
has body: var date1 = new Date("6 Apr, 2015 14:45").getTime() / 1000; var date2 = new Date("7 May, 2015 02:45").getTime() / 1000; var difference = (date2 - date1)/60/60; console.log(difference); //732 hours or 30.5 days
type: Answer
score: 0
answers question: http://stackoverflow.com/q/29600147

http://stackoverflow.com/q/29670297
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/47478662
has body: I have JS code which reloads my div every 2 seconds: var auto_refresh = setInterval(function() { $('#indexRefresh').load('/includes/index_refresh_include.php?_=' + Math.random()); }, 2000); Then I make an AJAX request which loads more content when a 'load more' button is pressed, but since it's reloading the loaded content disappears. $(function() { $(document).on("click", ".loadmore", function() { var ID = $(this).attr("id"); var split = ID.split("-"); if (ID) { $("#more" + ID).html(' '); $.ajax({ type: "POST", url: "loadmore.php", data: "rowstart=" + ID, cache: false, success: function(html){ $("#updates").append(html); $("#more" + ID).remove(); } }); } else { $(".morebox").html('The End'); } return false; }); }); What should I do so the loaded content won't disappear? EDIT: this is the html echo" "; include INC.'index_include.php'; echo" "; this is the index_refresh_include.php file $result1 = dbquery("SELECT DISTINCT model_id, model_username FROM models LEFT JOIN `show` ON models.model_id=show.show_model_id ORDER BY show_ended=0 DESC, model_id ASC LIMIT 6"); $rowstart = 0; echo" "; echo" "; echo" "; while($data = dbarray($result1)){ $modelID = $data['model_id']; $result = dbquery("SELECT * FROM `show` WHERE show_model_id='$modelID'"); if(dbrows($result) >= 5){ echo" "; } else { echo" "; } echo" "; echo" "; echo" "; echo" "; $rowstart++; } echo" "; $blockstart = 0; $large = dbquery("SELECT * FROM largeblocks WHERE large_status=1 ORDER BY large_pos ASC LIMIT 1 OFFSET $blockstart"); if(dbrows($large) != 0){ while($block = dbarray($large)){ echo" "; echo" "; echo" "; echo" "; echo" "; echo" "; echo" "; $blockstart++; } } else { $model = dbquery("SELECT * FROM models ORDER BY model_credits DESC LIMIT 1 OFFSET $blockstart"); while($block = dbarray($model)){ echo" "; echo" "; echo" "; echo" "; echo" "; echo" "; echo" "; $blockstart++; } } echo" "; $large = dbquery("SELECT * FROM largeblocks WHERE large_status=1 ORDER BY large_pos ASC LIMIT 1 OFFSET $blockstart"); if(db…
upvote count: 2
tagged with: http://stackoverflow.com/tag/html
has title: After reloading div content via AJAX, updated html disappears
score: -1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47479067
downvote count: 3
has comment: http://stackoverflow.com/comment/47478622
accepted answer: http://stackoverflow.com/a/29670401
has comment: http://stackoverflow.com/comment/47478991
type: Question
has comment: http://stackoverflow.com/comment/47479354
has comment: http://stackoverflow.com/comment/47478744
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47478716
answer count: 1
has answer: http://stackoverflow.com/a/29670401

http://stackoverflow.com/a/29612045
has body: I actually spent some time working on this. I have no idea if this is what you wanted, but I created a timer library. I have a working demo for you. I had fun making this. Let me know what you think: JS: (function () { var t = function (o) { if (!(this instanceof t)) { return new t(o); } this.target = o.target || null; this.message = o.message; this.endMessage = o.endMessage; //setInterval id this.si = -1; //Initial start and end this.startTime = null; this.endTime = null; this.interTime = null; this.duration = o.duration || 1000 * 60 * 5; //looping speed miliseconds it is best to put the loop at a faster speed so it doesn't miss out on something this.loop = o.loop || 300; //showing results miliseconds this.show = o.show || 1000; }; t.fn = t.prototype = { init: function () {} }; //exporting window.t = t; })(); //Timer Functions --- t.fn.start = function () { this.startTime = new Date(); this.interTime = this.startTime.getTime(); this.endTime = new Date().setMilliseconds(this.startTime.getMilliseconds() + this.duration); //returns undefined... for some reason. console.log(this.endTime); var $this = this; this.writeMessage(this.duration); this.si = setInterval(function () { var current = new Date(), milli = current.getTime(); if (milli - $this.interTime >= $this.show) { var left = $this.endTime- milli; if (left <= 0) { $this.stop(); } else { $this.interTime = milli; $this.writeMessage(left); } } }, this.loop); return this; }; t.fn.writeMessage = function(left){ this.target.innerHTML = this.message + ' ' + Math.floor(left / 1000); return this; }; t.fn.stop = function () { //stopping the timer clearInterval(this.si); this.target.innerHTML = this.endMessage; return this; }; //Not chainable t.fn.isRunning = function () { return this.timer > -1; }; var timer = t({ target: document.getElementById('results'), loop: 50, duration: 10000, show: 1000, //default is at 1000 miliseconds message: 'Time left: ', //If this is ommited then only the time left will be shown endMessage: '…
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29608229

http://stackoverflow.com/q/29674388
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/29676419
has comment: http://stackoverflow.com/comment/47487450
type: Question
has comment: http://stackoverflow.com/comment/47489373
has comment: http://stackoverflow.com/comment/47487584
has body: I have passed an array tree from controller to view and I am using a helper for recurssion to display it in the form of unordered lists. I have a button with each list item to move one step up. My view div is like this: <?php $ordering = count($trees[$grp->id]); ?> <a href="javascript:Swapit('swapper-first','swap')" onClick="showIFrame('<?php echo site_url('service_group_services/edit/0_' . $ordering . '_' . $grp->id); ?>');"> <?php display_tree($trees[$grp->id], $grp->id); ?> <?php endforeach; ?> here, display_tree is a helper: <?php function display_tree($array, $grp) { foreach ($array as $value): { $ordering = 0; if (isset($value->childs[0])) { $val = $value->childs; $ordering = count($val); } echo "\n "; echo "\n "; if($value->type != 'SERVICE') { echo 'service.'_' . $ordering . '_'.$grp ."'" .')"> '; } if($value->ordering != 0) { echo 'service_parent. ',' . $value->ordering . ',' . $value->service_group . ',' . $value->service . ')"> '; } echo 'service_parent. '_' . $value->service . '_' . $value->service_group . '_'. $value->ordering .'"> '. $value->name .' '; if (isset($value->childs[0])){ $val = $value->childs; display_tree($val, $grp); } echo ' '; } endforeach; } ?>` controller function: function move_up(){ $parent = $this->input->post('service_parent'); $ordering = $this->input->post('ordering'); $group = $this->input->post('service_group'); $service = $this->input->post('service'); $s_p = $this->session->userdata('service_provider'); $this->Mdl_service_group_services->up($s_p, $parent, $group, $ordering); $this->Mdl_service_group_services->up1($s_p, $service, $parent, $group, $ordering); } n model is: function up($s_p, $parent, $group, $ordering) { $data = array( 'ordering' => $ordering ); $this->db->where('service_provider =', $s_p); $this->db->where('service_group =', $group); $this->db->where('service_parent =', $parent); $this->db->where('ordering =', --$ordering); $this->db->set($data); $this->db->update($this->_table_name); } function up1($s_p, $ser…
has comment: http://stackoverflow.com/comment/47487952
tagged with: php
score: 4
has comment: http://stackoverflow.com/comment/47487885
tagged with: codeigniter
has title: Unable to update database with ajax in codeigniter
has comment: http://stackoverflow.com/comment/47488077
answer count: 1
accepted answer: http://stackoverflow.com/a/29676419
has comment: http://stackoverflow.com/comment/47487651
tagged with: javascript
upvote count: 4
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/47487755
tagged with: jquery

wikipedia-api
tag name: wikipedia-api
type: Tag
tags question: http://stackoverflow.com/q/29544852

http://stackoverflow.com/a/29663055
score: -1
answers question: http://stackoverflow.com/q/29661183
type: Answer
upvote count: 0
downvote count: 1
has body: See the docs of gapi on how to show the intial permission dialog configured with the drive scope. That does the oauth2 flow and gives you an access token which you set in the picker before showing it. once you get the folder id back, call the gapi function you show that lists files. Gapi at that pont will be already authenticated. You already have all the code Except the part where you set scopes and start the auth and permiasion fllow.

http://stackoverflow.com/q/29558162
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/47266924
possible better answer: http://stackoverflow.com/a/29558873
has body: I'm new to nodejs and i need to know how to pass the parameter to callback function. function scheduler(key, cron, callback){ //cron-job-manager manager.add('key', '* 30 * * * *', callback) } function callback(key,cron){ console.log(cron); } schdeduler("key", " * * * * *", callback); Thanks in advance.
has answer: http://stackoverflow.com/a/29558671
tagged with: node.js
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/3458553
accepted answer: http://stackoverflow.com/a/29558671
has title: Pass a paramerter to call back function in nodejs
type: Question
has comment: http://stackoverflow.com/comment/47266578
tagged with: javascript
has answer: http://stackoverflow.com/a/29558873

http://stackoverflow.com/a/29578303
accepted answer of: http://stackoverflow.com/q/29578081
answers question: http://stackoverflow.com/q/29578081
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47319032
has body: Only if the browser does not support async. If it does not, it will block execution wherever it finds the &lt;script&gt; tag. I would put it at the bottom just in case.
type: Answer
upvote count: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/47321986
has comment: http://stackoverflow.com/comment/47317988
score: 4

http://stackoverflow.com/a/29669625
type: Answer
score: 2
has body: Every point where an attacker might get access to the plain text password is a problem. On the other hand scenarios where this will be attackable, whilst alternatives are not are extremely rare (though I can think of a few). Either way, what it seems you wish to do is allow the user to log in after registration, possibly whilst waiting for the confirmation mail to be validated? In that case it would be a better idea to store the username and password in server side memory, as it still gives you all the same advantages without the danger of it being found suddenly. And ideally you do not store the password in server side memory, just the username and a flag/timestamp that the password was correct.
downvote count: 0
answers question: http://stackoverflow.com/q/29669479
upvote count: 2

http://stackoverflow.com/q/29610765
has title: Getting data from json file for D3 bubble chart
has answer: http://stackoverflow.com/a/29632878
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29632878
has comment: http://stackoverflow.com/comment/47402620
has comment: http://stackoverflow.com/comment/47369679
type: Question
tagged with: d3.js
has comment: http://stackoverflow.com/comment/47369625
has comment: http://stackoverflow.com/comment/47369632
has comment: http://stackoverflow.com/comment/47370273
score: 0
has comment: http://stackoverflow.com/comment/47372745
has comment: http://stackoverflow.com/comment/47371011
answer count: 1
has body: I'm trying to create a bubble chart based on the example from the d3 wiki. http://bl.ocks.org/mbostock/4063269 Unfortunately I'm still at the beginner level of javascript and don't understand some of the code. The layout of json is here: http://pastebin.com/QAMBfLjr I want to create circles and name them after the value and have their size be based on count. It seems the piece of code I need to modify is this: function recurse(name, node) { if (node.children) node.children.forEach(function(child) { recurse(node.name, child); }); else classes.push({packageName: name, className: node.name, value: node.size}); } So I'm substituting instances of children for the path to what I want to iterate over in the json. Then I change the name of the keys I want. facet_counts.facet_pivot["category_level0,category_level1,category_level2,category_level3"] So that piece of code looks like: function recurse(name, node) { if (node.facet_counts.facet_pivot["category_level0,category_level1,category_level2,category_level3"]) node.facet_counts.facet_pivot["category_level0,category_level1,category_level2,category_level3"].forEach(function(child) { recurse(node.value, child); }); else classes.push({packageName: value, className: node.value, value: node.count}); } But that's not working. I don't see anything on the page and the console output says: Uncaught TypeError: Cannot read property 'facet_pivot' of undefined Can someone help point me in the right direction? Thanks! Adding jsfiddle: http://jsfiddle.net/jwhite/4o6tbe0w/
has comment: http://stackoverflow.com/comment/47372753
tagged with: javascript

http://stackoverflow.com/comment/47285128
comment on: http://stackoverflow.com/q/29566338
score: 0
type: Comment
type: QuestionComment
has text: Awesome it perfectly fits now thanks so much ;) you helped a lot

http://stackoverflow.com/comment/49767673
has text: @oelna Did you test this?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29681646

facebook-like
tags question: http://stackoverflow.com/q/29667665
type: Tag
tags question: http://stackoverflow.com/q/29552814
tags question: http://stackoverflow.com/q/29672026
tag name: facebook-like
tags question: http://stackoverflow.com/q/29665790

http://stackoverflow.com/q/29669615
possible better answer: http://stackoverflow.com/a/29669673
answer count: 4
type: AnsweredQuestion
has title: How to keep one row inside a list active (once)? - Javascript
has answer: http://stackoverflow.com/a/29669686
type: Question
has body: The problem I am encountering is that I want the user only to be able to click on a spesific row, without having the oppertuinity to activate multiple rows. If the user clicks on row1 then I want this row to be active. If he then clicks on row2, then the active state changes from row1 to row2. $(function () { $('body').on('click', '.list-group .list-group-item', function () { $(this).toggleClass('active'); }); $('[name="SearchDualList"]').keyup(function (e) { var code = e.keyCode || e.which; if (code == '9') return; if (code == '27') $(this).val(null); var $rows = $(this).closest('.dual-list').find('.list-group li'); var val = $.trim($(this).val()).replace(/ +/g, ' ').toLowerCase(); $rows.show().filter(function () { var text = $(this).text().replace(/\s+/g, ' ').toLowerCase(); return !~text.indexOf(val); }).hide(); }); });
has answer: http://stackoverflow.com/a/29669718
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/29669706
accepted answer: http://stackoverflow.com/a/29669718
has answer: http://stackoverflow.com/a/29669673

http://stackoverflow.com/q/29584353
downvote count: 0
has comment: http://stackoverflow.com/comment/47319755
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47317176
has comment: http://stackoverflow.com/comment/47317595
answer count: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/47317518
upvote count: 1
has title: understanding usage of Constructor in bootstrap plugins
has comment: http://stackoverflow.com/comment/47317680
has comment: http://stackoverflow.com/comment/47319715
tagged with: javascript
has body: hey guys was just going through the source code of dropdown.js and came across the following line of code , i see this line of code in all bootstrap plugins : $.fn.dropdown.Constructor = Dropdown can somebody explain what this line of code is doing , scanning through the js file i also see . $(document) .on('click.bs.dropdown.data-api', clearMenus) .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle) .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown) .on('keydown.bs.dropdown.data-api', '[role="menu"]', Dropdown.prototype.keydown) .on('keydown.bs.dropdown.data-api', '[role="listbox"]', Dropdown.prototype.keydown) where i guess that line of code is probably being used , but i am still not sure , can somebody please explain ? the line of code can be found on git too. thank you. Tenali.
has comment: http://stackoverflow.com/comment/47342959
type: Question
has comment: http://stackoverflow.com/comment/47319391

http://stackoverflow.com/a/29538777
score: 0
has comment: http://stackoverflow.com/comment/47230162
type: Answer
answers question: http://stackoverflow.com/q/29538625
has body: I would concatenate both files, remove whitespaces for simplicity, and then use a regular expression to look behind of "results" and capture it. This is how you would do it from bash, I guess you could do it similar with javascript in case you need it. cat FileA.json FileB.json &gt; concatenated.json sed -r 's/\s+//g' cat concatenated.json | grep -oE '"results":{[.*]}' And then use that output for whatever it fits to your needs. PS: you can test your regular expression in here. EDIT: Is there any reason you couldn't just use extend if you are using JQuery?
has comment: http://stackoverflow.com/comment/47230814

http://stackoverflow.com/a/29591038
type: Answer
has body: Just add it to the selector $('a[href*=#]:not([href=#]):not([href=#carousel])')
has comment: http://stackoverflow.com/comment/47329155
has comment: http://stackoverflow.com/comment/47329338
upvote count: 3
score: 3
accepted answer of: http://stackoverflow.com/q/29591025
answers question: http://stackoverflow.com/q/29591025
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/47418931
comment on: http://stackoverflow.com/q/29638335
type: QuestionComment
type: Comment
score: 2
has text: This might help explain things: http://bost.ocks.org/mike/chart/

http://stackoverflow.com/a/29672922
accepted answer of: http://stackoverflow.com/q/29672404
type: Answer
answers question: http://stackoverflow.com/q/29672404
has comment: http://stackoverflow.com/comment/47496773
has body: Assuming you are using ember-cli: npm install --save-dev ember-browserify then you can import like this: import foldToAscii from "npm:fold-to-ascii"
score: 5
has comment: http://stackoverflow.com/comment/47483779
upvote count: 5
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/47322405
type: QuestionComment
has text: Do you know which call to setRequestHeader is failing/the line number of your console error?
comment on: http://stackoverflow.com/q/29586931
score: 0
type: Comment

http://stackoverflow.com/comment/47356921
type: QuestionComment
has text: I'll need to see the rest of the fullcalendar code you are using. You must have some setting turned on that's causing this, since it's not the default behaviour. Make a JSFiddle or post your code here.
comment on: http://stackoverflow.com/q/29585580
score: 0
type: Comment

http://stackoverflow.com/comment/47463223
type: Comment
comment on: http://stackoverflow.com/q/29661376
score: 0
type: QuestionComment
has text: Thanks @FelixKling for the clarification. I had never really reflected on the fact that "bare" blocks existed in js since the are pretty much useless.

http://stackoverflow.com/comment/47430369
type: QuestionComment
has text: @jbutler483 Oh you're right. I didn't notice that the example text was an image on the page I linked...
type: Comment
comment on: http://stackoverflow.com/q/29643842
score: 0

http://stackoverflow.com/comment/47500899
comment on: http://stackoverflow.com/a/29681857
score: 0
type: Comment
has text: Are you including the jQueryUI library?
type: AnswerComment

http://stackoverflow.com/comment/47319224
score: 0
comment on: http://stackoverflow.com/q/29585475
type: Comment
type: QuestionComment
has text: Thanks, but from what I understand, I can only compare according to some sort of order, right? The sort order I want is arbitrary, there isn't a criteria other than the order of the items in the `sort` array.

http://stackoverflow.com/q/29655760
type: Question
has comment: http://stackoverflow.com/comment/47451463
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29656103
tagged with: bash
accepted answer: http://stackoverflow.com/a/29656458
has comment: http://stackoverflow.com/comment/47451394
answer count: 2
upvote count: 7
tagged with: shell
favorite count: 0
has answer: http://stackoverflow.com/a/29656458
has title: Convert a string into shell arguments
tagged with: regex
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29656103
downvote count: 0
has comment: http://stackoverflow.com/comment/47451214
score: 7
has comment: http://stackoverflow.com/comment/47451665
has comment: http://stackoverflow.com/comment/47451313
has body: I'm interested how is parsed the bash input into arguments. For example, by using process.argv we get an array of strings in NodeJS (but this is language agnostic). My question is how can I parse an input like "node foo.js --foo "bar baz" -b foo" into an array like process.argv (or the equivalent in other languages) returns (e.g. ["node", "foo.js", "--foo", "\"bar baz\"", "-b", "foo"]? Splitting by space is not enough (because of the quotes). Is it possible with some more complicated regex to handle the quotes and getting such an array?

http://stackoverflow.com/comment/47292674
has text: Don't take it personal Raphael. This site is full of people who don't know how to professionally communicate.
type: Comment
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/29571512

http://stackoverflow.com/q/29534463
has comment: http://stackoverflow.com/comment/47222306
favorite count: 0
possible better answer: http://stackoverflow.com/a/44490319
has body: I'm trying to update the value of a datepicker for bootstrap when clicking a div, however it just does nothing (no errors). The datepicker itself works perfectly fine. Here's the javascript with the options: $('#datepicker').datetimepicker({ format: 'DD-MM-YYYY', pickTime: false, defaultDate: moment(), minDate: moment(), maxDate: moment().add(10,'y'), showClose: true, autoclose: true, keepOpen: false, }); The javascript I am trying to change the date with: $('.someDiv').click(function() { $("#datepicker").datetimepicker('setDate', '2016-03-05'); }); And finally the HTML: &lt;div class='input-group date' id='datepicker'&gt; &lt;input type='text' class="form-control" id="date"/&gt; &lt;span class="input-group-addon"&gt; &lt;span class="glyphicon glyphicon-calendar"&gt;&lt;/span&gt; &lt;/span&gt; &lt;/div&gt; Docs can be found under following link, however the provided method doesn't work: https://bootstrap-datepicker.readthedocs.org/en/latest/
type: Question
score: 3
tagged with: datepicker
has title: bootstrap-datepicker update value doesn't work
accepted answer: http://stackoverflow.com/a/29535902
tagged with: twitter-bootstrap
upvote count: 3
answer count: 2
has comment: http://stackoverflow.com/comment/47223063
has comment: http://stackoverflow.com/comment/47223977
has comment: http://stackoverflow.com/comment/47223379
has answer: http://stackoverflow.com/a/29535902
has answer: http://stackoverflow.com/a/44490319
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/29557196
has body: I want to make a GUI for automation testing tool, currently that was in CLI and we need to convert it ig GUI, now the problem i am facing is that I have selected HTML,CSS,JS for front end and PHP for backend, so can any 1 of u suggest me how to login to the server, which is having some IP? or simply how to login to linux server using PHP code?
type: Question
has answer: http://stackoverflow.com/a/29686478
tagged with: javascript
has comment: http://stackoverflow.com/comment/47510388
has answer: http://stackoverflow.com/a/29557515
possible better answer: http://stackoverflow.com/a/29686478
downvote count: 0
linked to: http://stackoverflow.com/q/15134421
favorite count: 0
tagged with: linux
upvote count: 2
answer count: 5
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29557515
tagged with: php
tagged with: login-page
has title: How to login to linux server using PHP code?
has answer: http://stackoverflow.com/a/39075302
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/29557969
has answer: http://stackoverflow.com/a/29557339

http://stackoverflow.com/comment/47294499
type: Comment
has text: @PHPglue `count($row)` does the comparison, and there's a different value in the div each time it makes a new request(unless there are no more messages), so the duplication shouldn't matter.
type: QuestionComment
comment on: http://stackoverflow.com/q/29572143
score: 0

http://stackoverflow.com/comment/47405292
type: QuestionComment
comment on: http://stackoverflow.com/q/29631141
type: Comment
has text: @OmriAharon never thought of that. With this I could cut out the ng-style and just use two way data binding in the style tag. Thanks.
score: 0

http://stackoverflow.com/a/29575668
accepted answer of: http://stackoverflow.com/q/29575589
type: Answer
has body: change it to something like this indexed array <?php $all_letters = array(array('33' ,"SonG Name"),array('35', "Song Name")); for($i=0;$i<count($all_letters);$i++){ echo " ".$all_letters[$i][1]." "; } ?>
answers question: http://stackoverflow.com/q/29575589
score: 0
has comment: http://stackoverflow.com/comment/47301276
type: AcceptedAnswer

http://stackoverflow.com/a/29654846
answers question: http://stackoverflow.com/q/29653656
has body: You can use $compile service. var html = '{{restaurant.name}} have been removed.Undo'; var linkFn = $compile(html); var content = linkFn(scope); $('body').append(content); Still as noted by Harish it's wrong. All manipulations with DOM must be done in directives. You can create directive that will be responsible for showing some message (or custom html template) on button click.
score: 0
type: Answer

http://stackoverflow.com/q/29532059
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29532857
type: Question
has title: AngularJS ui-router html5 mode breaks routing
tagged with: javascript
score: 0
answer count: 1
has body: I have a WebApp which is routing correctly using the standard # EX) http://localhost:8080/#/about.html When adding $locationProvider.html5Mode(true); to my angular 'app.js' file it breaks the app (views are not shown, links not clickable)... I have been through several tutorials/examples but cannot figure out where the problem is. Any help would be appreciated. APP.JS var routerApp = angular.module('routerApp', ['ui.router']); .config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider) { $locationProvider.html5Mode(true); $urlRouterProvider.otherwise('/'); $stateProvider .state('home', { url: '/', templateUrl: '/home-partial.html' }) .state('about', { url: '/about', templateUrl: 'about.html' }); }]); INDEX.HTML Home About SERVER.JS // Call main packages //=============================================== var express = require('express'); var app = express(); var mongoose = require('mongoose'); var morgan = require('morgan'); var bodyParser = require('body-parser') var path = require('path'); // APP GLOBAL CONFIG //=============================================== /* connect to the database */ mongoose.connect('mongodb://127.0.0.1:27017:/DB'); /* set location for static files */ app.use(express.static(__dirname + '/public')); /* log all HTTP requests to console */ app.use(morgan('dev')); /* set listen port for conn(s) */ app.listen(6070); // catch all route app.get('*', function (req, res) { res.sendFile(path.join(__dirname + '/public/index.html')); });

http://stackoverflow.com/a/29587812
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29587721
has body: You first have to instantiate a new object of the Foo class. This JS bin further illustrates that point: http://jsbin.com/zaredowive/2/edit?js,console,output As you can see the constructor is only called when you instantiate a new object of class Foo which in this case is a variable called bar. You are calling the hasOwnProperty on the function Foo. This function holds no properties.
type: Answer
downvote count: 0

http://stackoverflow.com/comment/47303149
type: Comment
type: QuestionComment
has text: Why don't you chain `user` instead? `user.then(function() {}, function() {})`. You also may return a scalar value from the promise.
score: 0
comment on: http://stackoverflow.com/q/29577341

http://stackoverflow.com/comment/47464443
type: Comment
comment on: http://stackoverflow.com/a/29662335
type: AnswerComment
has text: You could try using an `animate` and setting the time lapse to 0
score: 0

http://stackoverflow.com/comment/47322665
comment on: http://stackoverflow.com/q/29587391
has text: @Drazisil The loop works so far. I'm passing the showItems() the id variable in the for-loop. I'm really new to all this, I don't quite understand what you are suggesting to fix. Can you specifiy a little more please?
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/47477762
type: QuestionComment
has text: @TrueBlueAussie Unfortunately not helpful in this case - see below.
score: 0
comment on: http://stackoverflow.com/q/29669248
type: Comment

http://stackoverflow.com/a/47673606
type: Answer
has body: Based on the accepted answer above here is the web.config configuration needed if you are working with the Visual Studio 2015 ASP.NET 4.5 WebForms Application project template: &lt;location path="bundles"&gt; &lt;system.web&gt; &lt;authorization&gt; &lt;allow users="*"/&gt; &lt;/authorization&gt; &lt;/system.web&gt; &lt;/location&gt; The bundles folder does not physically exist but is the virtual path for the bundled scripts. See App_Start\BundleConfig.cs for more information. Please note that allowing access to ScriptResource.axd and/or WebResource.axd in web.config as suggested over and over again in so many other threads just will not work with the bundling setup of the Visual Studio 2015 ASP.NET 4.5 WebForms Application project template.
answers question: http://stackoverflow.com/q/29680163
score: 0

http://stackoverflow.com/a/29600041
downvote count: 0
has comment: http://stackoverflow.com/comment/47346370
accepted answer of: http://stackoverflow.com/q/29599984
has comment: http://stackoverflow.com/comment/47346282
answers question: http://stackoverflow.com/q/29599984
upvote count: 2
has body: You can try something like this form { transform: translateX(1000px); -webkit-animation: move 2s forwards; } @-webkit-keyframes move { 100% { transform: translateX(0) } } &lt;form action='gi.php' method='post' id='form1'&gt; &lt;input type="button" value="button"&gt; &lt;input type="button" value="button"&gt; &lt;input type="button" value="button"&gt; &lt;input type="button" value="button"&gt; &lt;input type="button" value="button"&gt; &lt;input type="button" value="button"&gt; &lt;/form&gt;
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47346318
type: Answer
score: 2

http://stackoverflow.com/q/29646290
tagged with: download
score: 0
type: AnsweredQuestion
tagged with: hyperlink
has answer: http://stackoverflow.com/a/29647560
has answer: http://stackoverflow.com/a/29646340
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/29646340
tagged with: javascript
has title: IS it possible to specify where to download a file in hyperlink
accepted answer: http://stackoverflow.com/a/29647560
has body: I am trying to download a file via an hyperlink after converting a html table to csv, here is my code: function exportTableToCSV($table, filename) { var $rows = $table.find('tr'), ... csv = '"' + $rows.map(function (i, row) { ... // Data URI csvData = 'data:application/csv;charset=utf-8,' + encodeURIComponent(csv); $(this) .attr({ 'download': filename, 'href': csvData, 'target': '_blank' }); } It works fine , onclick the hyperlink a "save as" pop up window is opened to save the file and download it.I don't want to pop up the "save as" but automatically download the file to the default download location set in the browser. Is there any idea to get the download location and set it appropriately. Any help will be appreciated.
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/47282455
score: 0
comment on: http://stackoverflow.com/q/29565576
type: Comment
type: QuestionComment
has text: Ok, maybe you could go into a little detail by what you mean by 'side effects' how can I use the side effects?

http://stackoverflow.com/comment/47382711
has text: No worries, at least you can "accept" the answer by clicking the tick outline next to it.
type: AnswerComment
comment on: http://stackoverflow.com/a/29618827
score: 0
type: Comment

http://stackoverflow.com/comment/47492542
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29677452
has text: Does your existing code break going from 1.6.2 to 1.7? If not, just drop 1.6.2 and only use 1.7.
score: 0

http://stackoverflow.com/comment/47224086
comment on: http://stackoverflow.com/a/29535615
score: 0
type: AnswerComment
type: Comment
has text: This gives me all the objects at the next level down and their values but I only want to log the object with the key "http:__purl.org_rss_1.0_title" - how would I modify it to do that?

http://stackoverflow.com/comment/47395579
comment on: http://stackoverflow.com/q/29626097
type: QuestionComment
has text: You an use read the content of url from the server and use ajax to fetch the movie name.
score: 0
type: Comment

http://stackoverflow.com/q/29561437
favorite count: 0
score: -3
tagged with: css
type: AnsweredQuestion
downvote count: 3
has comment: http://stackoverflow.com/comment/47273281
has answer: http://stackoverflow.com/a/29626414
has comment: http://stackoverflow.com/comment/47272992
type: Question
has comment: http://stackoverflow.com/comment/47272954
tagged with: javascript
has title: Works on codepen not on site, why?
tagged with: jquery
upvote count: 0
has body: Hey guys my code is working fine on codepen but not on my site. Can you tell me why? I have Jquery 1.11.1 included. It behaves like the jquery was not recognized... Here's my codepen, site and the function: http://codepen.io/Nikolaus91/pen/azgLJG http://178.62.215.130/LAMBRE/NewApp/subpages/kosmetykaPielegnacyjna/3.ProductPage.html# jQuery(document).ready(function ($) { var topis = $('.trigger_opis'); var opis = $('#opis'); var tskl = $('.trigger_skl'); var skl = $('#sklaktywne'); var tcos = $('.trigger_dzial'); var cos = $('#dzialanie'); var tbadania = $('.trigger_badania'); var badania = $('#badania'); var all = $('.describ'); var all3 = $('.marker'); all3.slideUp(10); console.log(all3); topis.click(function (e) { all.fadeOut(500); e.preventDefault(); opis.delay(100).fadeIn(2000); console.log(opis) }); tskl.click(function (e) { all.fadeOut(200); e.preventDefault(); skl.delay(100).fadeIn(2000); }); tcos.click(function (e) { all.fadeOut(200); e.preventDefault(); cos.delay(100).fadeIn(2000); }); tbadania.click(function (e) { all.fadeOut(200); e.preventDefault(); badania.delay(100).fadeIn(2000); }); });
tagged with: http://stackoverflow.com/tag/html
answer count: 1
accepted answer: http://stackoverflow.com/a/29626414

http://stackoverflow.com/comment/47321229
type: AnswerComment
comment on: http://stackoverflow.com/a/29586723
score: 0
type: Comment
has text: React: I do currently update state when local storage changes, it works just on the current page though. I'll look into it, I might be doing it the wrong way. JQuery: If I can't get React to work, I will add JQuery to the app (not currently using it), and try that out.

http://stackoverflow.com/comment/47289057
type: Comment
type: QuestionComment
has text: almost everything in the if.
score: 0
comment on: http://stackoverflow.com/q/29569782

http://stackoverflow.com/a/29644452
score: 2
downvote count: 0
type: Answer
upvote count: 2
answers question: http://stackoverflow.com/q/29638956
has body: Try something like: $value = 4544545; //the item number echo " Cart "; And in index.php you get the value with: $valueFromAddCart = $_GET['add_cart'];

http://stackoverflow.com/q/29616449
has answer: http://stackoverflow.com/a/29616874
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47378213
has comment: http://stackoverflow.com/comment/47378088
answer count: 4
has answer: http://stackoverflow.com/a/29616762
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47378069
upvote count: 1
has body: I'm trying to update a set of elements in my doc using jQuery. I can't pass the i index to the $.post callback function. here is the code function updateValues(){ val=document.getElementsByName('valueAN'); for ( i=0; i &lt; val.length; i++ ){ $.post('',{func:'updateAN',index:i}, (function(data,status){ val[i].value = data; })(i)); } }
has comment: http://stackoverflow.com/comment/47378199
has answer: http://stackoverflow.com/a/29616700
has title: Passing index to jQuery
has answer: http://stackoverflow.com/a/29616683
score: 1
type: Question

http://stackoverflow.com/q/29679685
tagged with: string
favorite count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/47497051
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29680031
type: Question
has body: How to extract a particular value form a textbox (string) and put it into another text box using j-query with condition in click event of a button? I have two text box: Button : Search I have use code for button [submit] on click event: $('#code-name').val($('#full-name').val().split("[")[1].split("]")[0]); Up to this it work fine. Now I want to add a condition like, if full-name value contains with [...] then code-name value as above and full-name value not contains [....] then code-name value will same as full-name. Like: AND Note that - code-name value will to convert to upper string if user type in lower case in full-name in both case. Sorry for bad english. How to I do this?
has answer: http://stackoverflow.com/a/29679870
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47496630
answer count: 2
possible better answer: http://stackoverflow.com/a/29679870
accepted answer: http://stackoverflow.com/a/29680031
downvote count: 0
has title: How to extract a particular text form a string with condition in jquery?

http://stackoverflow.com/a/29551253
answers question: http://stackoverflow.com/q/29551093
score: 0
type: Answer
has body: Here's a fiddle http://jsfiddle.net/cga65pLh/1/ $(".analyze").click(function() { //on click of element with class "analyze" $(".required").removeClass("redClass"); //remove redClass from all elements //remove redClass from all elements with class required x=true; //turn x to true so that we know a pop up hasn't occurred yet $(".required").each(function() { // loop through each element with the class required if ($(this).val() === "") { // if the value is empty $(this).addClass("redClass"); //add redClass to the element, turning the background of the element red. (x) ? //check if x is true (this is a ternary statement) // if x is true do the following: (alert("Looks like some of the fields aren't filled out correctly. They're highlighted in red."), x=false) : // if x is false simply return false and don't do anything false; } }); }); What this does is, on click, it removes redClass from any element with class "required" this is so that it starts fresh each time the button is pressed. It then turns the value x to true. This way we can keep track of if there's an alert message or not. a.e if it's true there's been no alert. For each element with class "required" we check if value is "". If it is, we apply the class "redClass" which turns the current box red and we check if x is true. If x is true we display an alert and turn x to false so that no other pop ups occur.

http://stackoverflow.com/comment/47438819
comment on: http://stackoverflow.com/a/29649251
score: 0
type: AnswerComment
has text: Thanks, can't believe I missed that. Also can you see any reason why its not updating the div?
type: Comment

http://stackoverflow.com/a/29607103
downvote count: 0
has body: What you are looking for is an "Observer Pattern", as described eg. here. But as you are interested in jQuery, you don't need to go the trouble of writing an observer pattern for yourself. jQuery already implements an observer in the guise of its .on() method, which can be invoked on a jQuery collection to cause callback function(s) to fire every time a native or custom event is dispatched. Here's an example : $(function() { //attach a custom event handler to the document $(document).on('valueChange', function (evt) { $(this).find("#s0").text(evt.type); $(this).find("#s1").text(evt.value); $(this).find("#s2").text(evt.change); $(this).find("#s3").text(evt.timestamp.toLocaleString()); }); //customEvent(): a utility function that returns a jQuery Event, with custom type and data properties //This is necessary for the dispatch an event with data function customEvent(type, data) { return $.extend($.Event(type||''), data||{}); }; //randomUpdate(): fetches data and broadcasts it in the form of a 'changeValue' custom event //(for demo purposes, the data is randomly generated) function randomUpdate() { var event = customEvent('valueChange', { value: (10 + Math.random() * 20).toFixed(2), change: (-3 + Math.random() * 6).toFixed(2), timestamp: new Date() }); $(document).trigger(event);//broadcast the event to the document } }); Here's a demo, complete with "start" and "stop" buttons for a regular "interval" dispatch of the custom event. Notes Under certain circumstances, it might be more appropriate to broadcast the event to the four data spans individually. On the web, you will find mention of a more convenient jQuery.event.trigger({...}) syntax. Unfortunately this was an undocumented feature of jQuery, which disappeared at v1.9 or thereabouts.
type: Answer
upvote count: 7
accepted answer of: http://stackoverflow.com/q/29586046
answers question: http://stackoverflow.com/q/29586046
score: 7
has comment: http://stackoverflow.com/comment/110857171
type: AcceptedAnswer

clipboard
tags question: http://stackoverflow.com/q/29648741
tag name: clipboard
type: Tag

http://stackoverflow.com/comment/139747571
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/68554859
has text: It's an important point about internal and external consumers of the api. But when we look at our team mates, they almost always faceroll the slower variant and never consider what a composition variant of the approach might be. In a feature factory environment, this is almost always going to be the case unless you're in a team of high functioning and super experienced people. tl;dr most situations are going to be owners of the structure and therefore should opt for the for loop imo.

http://stackoverflow.com/comment/47321748
has text: http://stackoverflow.com/questions/28655684/open-css-popup-when-page-loads-completed
type: QuestionComment
comment on: http://stackoverflow.com/q/29586432
score: 0
type: Comment

http://stackoverflow.com/q/29613146
tagged with: javascript
has answer: http://stackoverflow.com/a/29613360
upvote count: 2
answer count: 3
tagged with: this
has title: Losing Explicit Binding of the `this` Keyword
possible better answer: http://stackoverflow.com/a/29613360
has comment: http://stackoverflow.com/comment/47373339
has comment: http://stackoverflow.com/comment/47373440
accepted answer: http://stackoverflow.com/a/29613175
has answer: http://stackoverflow.com/a/29613755
favorite count: 0
has comment: http://stackoverflow.com/comment/47372222
has comment: http://stackoverflow.com/comment/47373674
has body: What is an example/scenario of how the this keyword can lose its explicit binding and be paved over with the default binding? Here's an example code snippet which explicitly binds the this keyword to an object by using the call method. What theoretical additions to this code can change the value of this? What specific concerns are we protecting our code from when hard binding the this keyword? function foo(){ console.log(this.bar); // outputs: 9 } var obj = { bar: 9 }; foo.call(obj);
has comment: http://stackoverflow.com/comment/47371977
has answer: http://stackoverflow.com/a/29613175
score: 2
has comment: http://stackoverflow.com/comment/47372160
type: AnsweredQuestion
downvote count: 0
type: Question

http://stackoverflow.com/comment/47407190
type: AnswerComment
has text: [Don't use `for in` enumerations on array-like objects!](http://stackoverflow.com/q/500504/1048572)
type: Comment
score: 2
comment on: http://stackoverflow.com/a/29632193

http://stackoverflow.com/comment/47464991
type: Comment
comment on: http://stackoverflow.com/a/29662705
score: 0
type: AnswerComment
has text: testing this code the layout doesnt start 300px to the left, am I missing something?

http://stackoverflow.com/comment/110814614
comment on: http://stackoverflow.com/a/29549874
has text: I absolutely love it when programmers use their math skills to cut out a for loop. +1 from me!
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47508758
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29685843
has text: We need your action_page.php code to see what's going on there. Also, what method are you intending on using? POST or GET?

http://stackoverflow.com/comment/47323311
comment on: http://stackoverflow.com/q/29587825
type: QuestionComment
has text: @jcubic Sorry, I don't understand well. I got a error when not used escape. `SyntaxError: unterminated string literal`
score: 0
type: Comment

http://stackoverflow.com/q/29561701
upvote count: 1
has answer: http://stackoverflow.com/a/29563517
type: AnsweredQuestion
has title: Accessing and updating controller model within $animate .then() method - using 'this'
score: 1
tagged with: angularjs-animation
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/29563594
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29563517
favorite count: 0
possible better answer: http://stackoverflow.com/a/29563594
has body: I have a controller (below). I am wanting to update parts of newsCtrl from within the $animate's .then() method. But I am unable to access its variables. As you can see from the code, my issue is when currentPage is "undefined" So I am wondering, how can I update currentPage from within the .then() method? AngularJS docs advise that I should use $scope.$apply (https://docs.angularjs.org/error/$rootScope/inprog?p0=$apply) But I am not using $scope on my controller, I am using "this". (function(angular, $) { angular.module('app-news', ['ngAnimate']); function newsCtrl($animate) { this.currentPage = 0; this.cycleNews = function(bool) { // this.currentPage = 0 $animate.leave(myElem).then(function() { // this.currentPage = undefined // $scope.currentPage = undefined // newsCtrl.currentPage = undefined $scope.$apply(function(){ // this.currentPage = undefined // $scope.currentPage = undefined // newsCtrl.currentPage = undefined }); }); } } angular .module('app-news') .controller('newsCtrl', ['$animate', newsCtrl]); }(window.angular, window.jQuery));
tagged with: angularjs
tagged with: animation

http://stackoverflow.com/comment/47427764
comment on: http://stackoverflow.com/q/29643069
has text: I just tried it, but it doesn't seem to change the result
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/47383304
has text: Can you add the js function. Also a jsfiddle would help.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29619420
type: Comment

marionette
tags question: http://stackoverflow.com/q/29667282
tags question: http://stackoverflow.com/q/29646956
tags question: http://stackoverflow.com/q/29620798
tags question: http://stackoverflow.com/q/29642157
tags question: http://stackoverflow.com/q/29659208
tags question: http://stackoverflow.com/q/29664650
type: Tag
tag name: marionette

http://stackoverflow.com/a/29583823
type: Answer
has body: If you want to filter the results using javascript, you have to first JSON.parse the results, then you can can slice it and finally JSON.stringify it to get a string as a result. but, I would recommand you to filter the results at the API request level. take a look at the soundcloud Pagination API you can add a limit=10 parameter to the request URL (eg: https://api.soundcloud.com/tracks?client_id=1dff55bf515582dc759594dac5ba46e9&amp;q=Einsteins&amp;limit=10 ) and if you want to access the following pages, there is the linked_partitioning parameters. if this parameter is 1, the response array will be wrapped into on an object containing the collection (the tracks for the first page) and next_href (the link to the next page results) eg: https://api.soundcloud.com/tracks?client_id=1dff55bf515582dc759594dac5ba46e9&amp;q=Einsteins&amp;limit=1&amp;linked_partitioning=1
answers question: http://stackoverflow.com/q/29583376
score: 0

http://stackoverflow.com/a/29584437
type: AcceptedAnswer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47394778
accepted answer of: http://stackoverflow.com/q/29584002
type: Answer
answers question: http://stackoverflow.com/q/29584002
upvote count: 1
has comment: http://stackoverflow.com/comment/47393288
has body: Your SQL query "SELECT first_name, last_name FROM user_profile" without any WHERE clause may return one or two dimensional array. When you use the json_encode to encode your result, the JSON string format will be different for one and two dimensional array. It will cause headache in the Javascript Part. So if this is for a Single Profile- Dont use JSON PHP $qry = "SELECT first_name, last_name FROM user_profile WHERE id = $id"; $result = mysql_query($qry); if (mysql_num_rows($results) == 1) { while($row = mysql_fetch_array($result)) { $name = $row['first_name']; } } If this is for Multiple Profile PHP $qry = "SELECT first_name, last_name FROM user_profile"; $result = mysql_query($qry); if (mysql_num_rows($results) &gt; 0) { $jsonData = []; $jsonData['profiles'] = mysql_fetch_array($result) json_encode($jsonData, JSON_FORCE_OBJECT); } HTML, JAVASCRIPT AND JQUERY &lt;div id="profile"&gt;&lt;/div&gt; &lt;script&gt; $(document).ready(function() { var data = &lt;?php echo $jsonData;?&gt;; $.each(data.profiles, function() { $('#profile').append( '&lt;div id="photo-frame"&gt;' + '&lt;img class="circle" src="images/photo.jpg"&gt;' + '&lt;/div&gt;' + '&lt;h3 id="name"&gt;' + this.first_name + '&amp;nbsp;' + this.last_name + '&lt;/h3&gt;' + '&lt;hr/&gt;' ); } } &lt;/script&gt;

http://stackoverflow.com/comment/47538242
type: AnswerComment
has text: You can disable mouse over events on drag if needed. See commented code for doing that.
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29693884

http://stackoverflow.com/comment/47316808
has text: Definitely makes the code tidier, but my images are still not showing up in place of the original arrows. Is there a better way to override the css?
type: Comment
comment on: http://stackoverflow.com/a/29583529
score: 0
type: AnswerComment

http://stackoverflow.com/q/29605698
has answer: http://stackoverflow.com/a/30495808
tagged with: jquery-ui
has body: The datepicker usually works on the PC, but not in iPad's browser. In beforeShow, I add the button to close: var headerPane = $("#ui-datepicker-div"); headerPane.append("&lt;a href='javascript:void(0);' class='close-datepicker'&gt;"); Close: closeDatePicker: function(){ $.datepicker._hideDatepicker(); } ... In events have the click: Events: function(){ $('body').on('click', '.close-datepicker' this.closeDatePicker) } I've tried with .datepicker("hide") and also nothing.
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29605924
score: 2
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47357141
type: Question
linked to: http://stackoverflow.com/q/28006056
answer count: 2
tagged with: datepicker
upvote count: 2
has title: jQuery UI datepicker doesn't close on the iPad

http://stackoverflow.com/comment/47443236
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29651123
score: 0
has text: @thefourtheye You are seriously going to complain about the question because I take the time to explain it in plain English? if it bothers you, move on. There are tons of people on here willing to help who aren't bothered by it, so find a question which suits your own preferences. I'm verbose because I want to be clear what I'm asking about.

hudson
type: Tag
tag name: hudson
tags question: http://stackoverflow.com/q/29673180

d3.js
tags question: http://stackoverflow.com/q/29594395
tags question: http://stackoverflow.com/q/29530223
tags question: http://stackoverflow.com/q/29650034
tags question: http://stackoverflow.com/q/29684080
tags question: http://stackoverflow.com/q/29678967
tags question: http://stackoverflow.com/q/29678996
tags question: http://stackoverflow.com/q/29685326
tags question: http://stackoverflow.com/q/29537419
tags question: http://stackoverflow.com/q/29618805
tags question: http://stackoverflow.com/q/29659864
tags question: http://stackoverflow.com/q/29596199
tags question: http://stackoverflow.com/q/29578258
tags question: http://stackoverflow.com/q/29534508
tags question: http://stackoverflow.com/q/29554890
tags question: http://stackoverflow.com/q/29595761
tags question: http://stackoverflow.com/q/29661158
tags question: http://stackoverflow.com/q/29668506
tags question: http://stackoverflow.com/q/29578847
tags question: http://stackoverflow.com/q/29574113
tags question: http://stackoverflow.com/q/29656916
tags question: http://stackoverflow.com/q/29640110
tags question: http://stackoverflow.com/q/29594504
tags question: http://stackoverflow.com/q/29604538
tags question: http://stackoverflow.com/q/29571724
tags question: http://stackoverflow.com/q/29531777
tags question: http://stackoverflow.com/q/29632269
tags question: http://stackoverflow.com/q/29593883
tags question: http://stackoverflow.com/q/29567514
tags question: http://stackoverflow.com/q/29543135
tags question: http://stackoverflow.com/q/29539532
tags question: http://stackoverflow.com/q/29559269
tags question: http://stackoverflow.com/q/29654130
tags question: http://stackoverflow.com/q/29532604
tags question: http://stackoverflow.com/q/29673901
type: Tag
tags question: http://stackoverflow.com/q/29549883
tags question: http://stackoverflow.com/q/29616529
tags question: http://stackoverflow.com/q/29658204
tags question: http://stackoverflow.com/q/29633478
tags question: http://stackoverflow.com/q/29581794
tags question: http://stackoverflow.com/q/29540538
tags question: http://stackoverflow.com/q/29582014
tags question: http://stackoverflow.com/q/29658108
tags question: http://stackoverflow.com/q/29619305
tags question: http://stackoverflow.com/q/29530540
tags question: http://stackoverflow.com/q/29543511
tags question: http://stackoverflow.com/q/29539075
tags question: http://stackoverflow.com/q/29610765
tags question: http://stackoverflow.com/q/29592770
tags question: http://stackoverflow.com/q/29624177
tags question: http://stackoverflow.com/q/29640551
tags question: http://stackoverflow.com/q/29631611
tags question: http://stackoverflow.com/q/29599894
tags question: http://stackoverflow.com/q/29583946
tags question: http://stackoverflow.com/q/29613935
tags question: http://stackoverflow.com/q/29549702
tags question: http://stackoverflow.com/q/29553617
tags question: http://stackoverflow.com/q/29620177
tags question: http://stackoverflow.com/q/29633075
tags question: http://stackoverflow.com/q/29607323
tag name: d3.js
tags question: http://stackoverflow.com/q/29573481
tags question: http://stackoverflow.com/q/29638335
tags question: http://stackoverflow.com/q/29609257
tags question: http://stackoverflow.com/q/29654605
tags question: http://stackoverflow.com/q/29658660
tags question: http://stackoverflow.com/q/29632287
tags question: http://stackoverflow.com/q/29609273
tags question: http://stackoverflow.com/q/29538926
tags question: http://stackoverflow.com/q/29639270
tags question: http://stackoverflow.com/q/29671786
tags question: http://stackoverflow.com/q/29557623
tags question: http://stackoverflow.com/q/29624745
tags question: http://stackoverflow.com/q/29546230
tags question: http://stackoverflow.com/q/29541342
tags question: http://stackoverflow.com/q/29556265
tags question: http://stackoverflow.com/q/29638615
tags question: http://stackoverflow.com/q/29558837
tags question: http://stackoverflow.com/q/29641619
tags question: http://stackoverflow.com/q/29570403

http://stackoverflow.com/a/29577025
score: 4
has comment: http://stackoverflow.com/comment/47303929
has body: Here in StackOverflow, the form is already present, but hidden initially (to save valuable space). (StackOverflow uses a .dno class to hide elements.) The click on the add a comment button does simply: hide the clicked add a comment button show the DIV holding the form A simple way to do it: $(function(){ $(".comments-link").on("click", function( event ){ event.preventDefault(); // Prevents browser following #hash $(this).hide(); // hide the button $(".comment-form-container").show(); // Show the form parent }); $(".comment-form-container form").on("submit", function( event ){ event.preventDefault(); // Don't send headers alert( $(this).serialize() +"\nWILL BE SENT TO PHP" ); // $.ajax stuff }); }); .dno{display:none;} add a comment Regarding the $.ajax since by submitting the form we don't want the page to refresh, AJAX is used to POST data to a PHP (let'ssay: saveComment.php page) which than stores to database. AJAX returns than a message response from the PHP code: $.ajax({ type : "POST", url : "saveComment.php", data : $(this).serialize(), // `this` is our form success : function( response ) { // Response is the PHP echo alert("PHP says: "+ response); // Using jQuery append the message to } }); The PHP stuff in the code above AJAX will POST a serialized data to PHP like: comment=Please, show what you tried! The saveComment.php than might look like: <?php if ($_SERVER['REQUEST_METHOD'] != 'POST') exit; // Don't allow anything but POST $response = ""; if ( isset($_POST["comment"]) ) { $commment = htmlspecialchars( $_POST["comment"] ); // TODO: $userId = retrieve here the user ID from the session; // Sanitize(!!!!!) and save to database $comment and $userId $response = $commment; } else { $response = "Please, enter a comment"; } echo $response; // This will be sent/returned to AJAX exit; above, whatever you put in the echo, it will be returned by AJAX into the response argument.
has comment: http://stackoverflow.com/comment/47325298
type: Answer
upvote count: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/47304252
answers question: http://stackoverflow.com/q/29576841

http://stackoverflow.com/comment/47222850
type: AnswerComment
type: Comment
has text: Absolute paths make it difficult to relocate your project.
comment on: http://stackoverflow.com/a/29535076
score: 0

http://stackoverflow.com/comment/47482070
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29672178
has text: I don't understand the problem, what's stopping you from just changing the code?
score: 0

http://stackoverflow.com/comment/47494660
type: QuestionComment
comment on: http://stackoverflow.com/q/29677810
has text: I wanted to say that you must have other dependancy like `$anchorScrollProvider` in your code, please add you whole config in you question
score: 0
type: Comment

http://stackoverflow.com/comment/47455023
type: Comment
score: 0
type: QuestionComment
has text: Looks like `$this->log->write()` is calling `htmlentities()` on the data before storing. What is `$this->log` an instance of?
comment on: http://stackoverflow.com/q/29657678

http://stackoverflow.com/comment/47426926
score: 0
has text: @afk What do you mean by parallelize in the context of Javascript?
comment on: http://stackoverflow.com/q/29622710
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47297315
score: 0
has text: I dont think what you are asking makes sense, how would you represent a foreach in json? and an injected service?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29573969

http://stackoverflow.com/a/29590967
score: 1
accepted answer of: http://stackoverflow.com/q/29590015
answers question: http://stackoverflow.com/q/29590015
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1
has body: As we deduced in the comments, the code works, but the submit handler was bound before the &lt;form&gt; was fully loaded. One way to solve this is to put the code inside a listener for the DOMContentLoaded event. Support for DOMContentLoaded is rather good, with only IE8 having problems with it (although it doesn't support addEventListener either anyway). document.addEventListener("DOMContentLoaded", function(event) { // ... }); Another way is to put the &lt;script&gt; below the &lt;form&gt;&lt;/form&gt; tag. There is also the inline onsubmit=..., but inline JavaScript is considered bad practice nowadays for various reasons (mostly maintainability). You should only really use this if you need to support very old browsers that can't bind events otherwise. As for submitting the form in the "background" you can use AJAX. There are a lot of great resources/tutorials for this.

http://stackoverflow.com/comment/47338936
comment on: http://stackoverflow.com/q/29595942
score: 0
type: Comment
has text: @dopatraman: I am not sure this question is entirely clear. Could you perhaps add a JS Fiddle to illustrate what you are trying to do, or add more code to the question? As it stands, the `this` value will vary depending on where this code is executed.
type: QuestionComment

http://stackoverflow.com/q/29657910
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47455936
duplicate of: http://stackoverflow.com/q/3934570
has comment: http://stackoverflow.com/comment/47456068
has comment: http://stackoverflow.com/comment/47456356
favorite count: 0
has comment: http://stackoverflow.com/comment/47455518
has body: I always get confused by this when I'm working on large websites and am including a bunch of alien JS files and am trying to debug stuff. If I have &lt;script type="text/javascript"&gt; $(document).ready(function(){ console.log("foo"); }); $(document).ready(function(){ console.log("bar"); }); &lt;/script&gt; then does that guarantee console.log("bar") is triggered immediately after console.log("foo") ??? Is it the same if I have &lt;script type="text/javascript" src="script1.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="script2.js"&gt;&lt;/script&gt; where script1.js consists of $(document).ready(function(){ console.log("foo"); }); and script2.js consists of $(document).ready(function(){ console.log("foo"); }); What happens when I add window.onload and document.onload into the mix, e.g. &lt;script type="text/javascript"&gt; $(document).ready(function(){ console.log("foo"); }); window.onload = function() { console.log("John Skeet"); }; $(document).ready(function(){ console.log("bar"); }); window.onload = function() { console.log("Bjarne Stroustrup"); }; &lt;/script&gt; ????? Can someone here explain, or lead me to the documentation that explains, the rule for how these "fire after everything else" functions get stacked?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47457013
has answer: http://stackoverflow.com/a/29658072
score: 3
linked to: http://stackoverflow.com/q/3698200
linked to: http://stackoverflow.com/q/3934570
upvote count: 3
has title: How is the call stack for $(document).ready(...) assembled?
type: Question
has answer: http://stackoverflow.com/a/29658009
answer count: 2
downvote count: 0

http://stackoverflow.com/comment/47220489
comment on: http://stackoverflow.com/q/29533743
type: Comment
type: QuestionComment
score: 3
has text: `_2nd_ch.each(function(i, el){ $(el).parent() })`

http://stackoverflow.com/a/29572315
has body: There are two problems: You're using the g modifier. This makes .match() return an array of all the matches of the regexp. This only contains matches of the entire regexp, not the capture groups. Element 0 of the match result is the match of the entire regexp. You want to get capture group 1, so you should use [1], not [0]. Use this instead: var due_min = homework.input.match(/(?:due|by) (.{2})(?:(?:.+?)?)\b/i)[1].trim().toLowerCase(); However, if the input doesn't match the regexp, .match() will return null, not an array, and trying to access [1] will get an error. It would be best to assign the result to another variable, test whether it's not null, then do the rest: var match = homework.input.match(/(?:due|by) (.{2})(?:(?:.+?)?)\b/i); if (match) { var due_min = match[1].trim().toLowerCase(); ... } else { ... }
score: 0
answers question: http://stackoverflow.com/q/29572186
type: Answer

http://stackoverflow.com/q/29581647
type: AnsweredQuestion
score: 1
possible better answer: http://stackoverflow.com/a/29581959
answer count: 2
has answer: http://stackoverflow.com/a/29581959
upvote count: 1
tagged with: javascript
tagged with: gulp
favorite count: 0
tagged with: angularjs
tagged with: browserify
has title: Require controller, factory, service and directive files with Browserify
tagged with: node.js
accepted answer: http://stackoverflow.com/a/29583213
downvote count: 0
has body: In my gulp-browserify setup I'm writing a new AngularJS application. Because I know it's gonna be a very big application I want my base structure as clean and clear as possible. In my main entry javascript file for browserify I setup my main angular module and define the routes with ui-router in my app.config event. Now I don't want a single require() statement for every single controller/factory/directive in my application. I was hoping I could require all the files in a directory like this: require('./dashboard/*.js'); require('./users/*.js'); require('./settings/*.js') But apperantly you can't. What would be the cleanest way to require all my app files in my app's main entry point?
type: Question
has answer: http://stackoverflow.com/a/29583213

http://stackoverflow.com/comment/47503491
type: QuestionComment
has text: `name = function (name) { if (angular.isDefined(name)) { this.name = name; } return this.name;` };
comment on: http://stackoverflow.com/q/29682922
score: 0
type: Comment

http://stackoverflow.com/comment/47230108
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29538540
score: 0
has text: @Andy, I just need to place references to prototype's methods in object. This object is a map of strings (text representation of events' type) and corresponding actions (functions). This object used as default and could be overrided in inherited object.

http://stackoverflow.com/a/29624867
type: Answer
has body: You can use the javascript split function. Following code may be taken as example : "/parameterOne/parameterTwo/parameterThree/parameterFour/ParameterFive".split("/")[2]
answers question: http://stackoverflow.com/q/29624675
score: 0
upvote count: 1
downvote count: 1

http://stackoverflow.com/q/29542899
has body: Using AngularJS (1.3.15), is there a way to redirect a user to a PHP page with form POST data? And if so, can you convert JSON (from $scope.formData) to be sent as POST? $http has a method for this, though it appears to be done asynchronously. On success, you can redirect, though when you hit the page, the POST variable will be empty. Thoughts? Thanks!
has title: AngularJS, redirect user with POST information from $scope to a PHP script
downvote count: 0
score: 1
tagged with: angularjs-scope
tagged with: post
type: Question
upvote count: 1
tagged with: javascript
favorite count: 0
answer count: 0
tagged with: angularjs
type: UnansweredQuestion
tagged with: php

http://stackoverflow.com/a/29603851
answers question: http://stackoverflow.com/q/29603692
score: 0
type: Answer
has body: You can do it on several ways: You can make http request in loop every few seconds setInterval(function(){ alert("Hello"); }, 3000); If you develop server data source you can setup real time connection, using i.e. SignalR or Socket

http://stackoverflow.com/q/29628819
tagged with: angularjs-ng-repeat
has answer: http://stackoverflow.com/a/29629230
has comment: http://stackoverflow.com/comment/47401534
score: 1
upvote count: 1
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
has title: ng-repeat with optional attribute based on repeated item
has answer: http://stackoverflow.com/a/29628874
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47401462
has body: What is the best way to get around this problem of having an optional attribute on an ng-repeat node: {{slice.name}} I only want the mozzarella attribute to be there at specific slices. I suspect there is no easy fix for this. Maybe there is a plugin that has a nifty way of solving the issue? The implementation that I am looking for would possibly look similar to the ng-class directive: {{slice.name}}

http://stackoverflow.com/q/29612175
tagged with: css
downvote count: 2
type: Question
score: -2
has answer: http://stackoverflow.com/a/29612263
tagged with: javascript
has comment: http://stackoverflow.com/comment/47370963
answer count: 3
upvote count: 0
has body: I have looked through many of the tutorials and stack issues, but none of them give an explanation that helps. I think I am missing something small. I have tried other hello world sites for this that use controller.js and app.js but I found this, and I think it should work, and the site said it should. When I type in the data, it doesn't change as it should. Note: at first I downloaded angularjs, but then I read I can just use the src = cnd in instead. Is this true? Do I need to have angular.js in the root folder? The angular portions of the sites never follow through for example the {{}}. Thank you Hello World, AngularJS Write some text in textbox: Hello {{ sometext }}
favorite count: 0
has answer: http://stackoverflow.com/a/29612225
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47383337
tagged with: http://stackoverflow.com/tag/html
has title: AngularJS not loading into simple hello world
has answer: http://stackoverflow.com/a/29612325

http://stackoverflow.com/comment/47456420
score: 0
has text: Note this isnt specific about apps script. Its a basic question about programming functions Thus i lowered its score
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29656904

http://stackoverflow.com/q/29657652
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
accepted answer: http://stackoverflow.com/a/29657694
has body: I know that synchronous Ajax is deprecated. But I have some code that is using it anyway, and my question is this: Suppose a method A makes a normal (asynchronous) Ajax request that is pending with the server. Meanwhile, some other event triggers method B which makes a synchronous Ajax request. Now, suppose the response from A comes in before the response from B. Is it possible that the onreadystatechange callback from A will run first? Or does async = false guarantee that the synchronous method (B) will be the very next piece of Javascript code to run no matter what? I'm using jQuery's Ajax methods if that matters.
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/29657694
has title: Synchronous Ajax: Guaranteed sequential?
answer count: 1

http://stackoverflow.com/a/29594307
type: Answer
has body: I fixed the problem, I had this two functions: $scope.generateRandom = function() { var temp = ''; Words.getWords($scope.number) .then(function(response) { for (var i = 0; i &lt; response.data.length; i++) { temp += ' ' + response.data[i].word } $scope.camel = temp; $scope.kebab = temp; $scope.snake = temp; }); }; $scope.clear = function() { $scope.camel = ''; $scope.kebab = ''; $scope.snake = ''; }; All I had to do was add $scope.clear() at the end of the $scope.generateRandom function and it does the trick.
has comment: http://stackoverflow.com/comment/47347805
score: 1
answers question: http://stackoverflow.com/q/29585313
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29585313
downvote count: 0

http://stackoverflow.com/a/29639737
type: Answer
downvote count: 0
score: 1
has body: It's not valid syntax at SE: and LE: since it is an array and not an object. Change the outermost [] to {} or change : to ,
upvote count: 1
answers question: http://stackoverflow.com/q/29639704

http://stackoverflow.com/a/29593644
answers question: http://stackoverflow.com/q/29592849
accepted answer of: http://stackoverflow.com/q/29592849
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1
has body: On the onEnd callback you can get the dragged list item with event.item and use textContent to get the inner text: var el = document.getElementById('items'); Sortable.create(el, { group: "localStorage-example", onEnd: function (event) { var draggedItemText = event.item.textContent; alert(draggedItemText); }, store: { get: function (sortable) { var order = localStorage.getItem(sortable.options.group); console.log(sortable.toArray()); return order ? order.split('|') : []; }, set: function (sortable) { var order = sortable.toArray(); localStorage.setItem(sortable.options.group, order.join('|')); } } }) item 1 item 2 item 3 item 4 item 5
score: 1

http://stackoverflow.com/q/29660605
has comment: http://stackoverflow.com/comment/47462188
has answer: http://stackoverflow.com/a/29660805
has comment: http://stackoverflow.com/comment/47460681
tagged with: javascript
has body: I am new to angular and might be missing some baselines. I am trying to bind my view to controller data as said here. If it is angular's all rage shouldn't be a complex situation. Here i have my app.js: var app = angular.module('nwMetrics', []); app.controller('MetricsController', ['$scope', function($scope){ $scope.beanstalks = [{ time: "12:00", type: "beanstalk-stable" }]; $.eventsource({ label: "json-event-source", url: "/data/beanstalk", dataType: "json", open: function() { console.log( "opened connection" ); }, message: function( data ) { $scope.beanstalks.push(data); console.log( $scope.beanstalks ); // $.eventsource("close", "json-event-source"); } }) }]); And there's my view: &lt;html lang="en" ng-app="nwMetrics"&gt; ... &lt;div ng-controller="MetricsController"&gt; &lt;div class="env row" ng-repeat="beanstalk in beanstalks"&gt; &lt;h3&gt; {{beanstalk.time}} &lt;em class="pull-right"&gt;{{beanstalk.type}}&lt;/em&gt; &lt;/h3&gt; &lt;/div&gt; &lt;/div&gt; Event source will receive SSE events and should push a new obj to $scope.beanstalks every second. The log on console shows what expected, a growing array printed every second, but the view is not - it shows only the initial value of $scope.beanstalks it stays static. Also i've tried to move $.eventsource outside controller, but how would i call controller on js? app.controller('MetricsController').beanstalks or app.MetricsController.beanstalks are not helping. (This also might have a simple answer, but i can only find how to access it through html.) Thanks in advance
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29660805
possible better answer: http://stackoverflow.com/a/29660757
tagged with: angularjs
has answer: http://stackoverflow.com/a/29660757
type: Question
has title: Bind AngularJS controller data to view
score: 0
answer count: 2

http://stackoverflow.com/a/29549966
has comment: http://stackoverflow.com/comment/47259395
answers question: http://stackoverflow.com/q/29543495
type: Answer
has body: Is there a reason you cannot use and Asp:Button element? My first suggestion would be to use an Asp:Button element rather than your current set up but if, for whatever reason, you can't then I'd suggest giving the button a name and then with jQuery you can do: $('#submitbuttonid').click(function(){$('#_searchLinkButton').click();}); Or in vanilla JavaScript: var submitBtn = document.getElementById('submit buttonid'); submitBtn.addEventListener("click", function(){ var linkBtn = document.getElementById('_searchLinkButton'); linkBtn.onClick(); });
has comment: http://stackoverflow.com/comment/47255390
score: 0

http://stackoverflow.com/comment/49247240
type: Comment
comment on: http://stackoverflow.com/a/29592750
has text: Would I be able to declare "wait" as a variable and still have this code work? I've used similar languages to javascript so the way this is layed out doesn't make sense to me. I feel like this is on the right track but it isn't working for me and I need to finish this website ASAP, thank you in advance.
score: 0
type: AnswerComment

http://stackoverflow.com/q/29663559
tagged with: asp.net-mvc
tagged with: http://stackoverflow.com/tag/json
linked to: http://stackoverflow.com/q/5766726
type: Question
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has title: Pass Dropdown combobox value with Json auto filling userform
accepted answer: http://stackoverflow.com/a/29663784
tagged with: combobox
has body: I have a dropdown/combo box, this is how its made @Html.DropDownList("combobox", Model.Sizes, "--select--") It uses a jquery ui widget which is, &lt;script&gt; (function ($) { $.widget("custom.combobox", { _create: function () { this.wrapper = $("&lt;span&gt;") .addClass("custom-combobox") .insertAfter(this.element); this.element.hide(); this._createAutocomplete(); this._createShowAllButton(); }, _createAutocomplete: function () { var selected = this.element.children(":selected"), value = selected.val() ? selected.text() : ""; this.input = $("&lt;input&gt;") .appendTo(this.wrapper) .val(value) .attr("title", "") .addClass("custom-combobox-input ui-widget ui-widget-content ui-state-default ui-corner-left") .autocomplete({ delay: 0, minLength: 0, source: $.proxy(this, "_source"), //ADDED HERE select: function(event, ui) { sizeID=ui.item.id; } }) .tooltip({ tooltipClass: "ui-state-highlight" }); this._on(this.input, { autocompleteselect: function (event, ui) { ui.item.option.selected = true; this._trigger("select", event, { item: ui.item.option }); }, autocompletechange: "_removeIfInvalid" }); }, _createShowAllButton: function () { var input = this.input, wasOpen = false; $("&lt;a&gt;") .attr("tabIndex", -1) .attr("title", "Show All Items") .tooltip() .appendTo(this.wrapper) .button({ icons: { primary: "ui-icon-triangle-1-s" }, text: false }) .removeClass("ui-corner-all") .addClass("custom-combobox-toggle ui-corner-right") .mousedown(function () { wasOpen = input.autocomplete("widget").is(":visible"); }) .click(function () { input.focus(); // Close if already visible if (wasOpen) { return; } // Pass empty string as value to search for, displaying all results input.autocomplete("search", ""); }); }, _source: function (request, response) { var matcher = new RegExp($.ui.autocomplete.escapeRegex(request.term), "i"); response(this.element.children("option").map(function () { var text = $(this).text(); if (this.value &amp;&amp; (!request.term || matcher.test(text))) return {…
has answer: http://stackoverflow.com/a/29663784
type: AnsweredQuestion

http://stackoverflow.com/q/29546938
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29547028
has title: SharePoint - URL link with user name and password
type: Question
answer count: 1
tagged with: hyperlink
tagged with: javascript
tagged with: sharepoint
score: 0
has body: My requirement is that I have a link to site that uses a read-only user name and password. I tried using https://username:password@server.domain.net:8097/db_id=360&amp;action=1&amp;pm=P&amp;device_id=&amp;bc=0/ but I still get prompted to enter the password. I also tired these two scripts and neither one worked. Does anyone have any suggestions? &lt;asp:HyperLink ID="Server_Resources" runat="server" NavigateUrl="https://server.domain.net:8097/db_id=360&amp;action=1&amp;pm=P&amp;device_id=&amp;bc=0"&gt;Server Resources &lt;input type="hidden" id="UserID" name="UserID" value="username"/&gt; &lt;input type="hidden" id="PWD" name="PWD" value="password"/&gt; &lt;/asp:HyperLink&gt; &lt;script&gt; &lt;form id="NADALI" name="NADALI" runat="server" action="https://server.domain.net:8097/db_id=360&amp;action=1&amp;pm=P&amp;device_id=&amp;bc=0" method="post" &gt; &lt;input type="hidden" id="UserID" name="UserID" value="username" /&gt; &lt;input type="hidden" id="PWD" name="PWD" value="password" /&gt; &lt;input type="submit" class="Button" id="GONADA" name="GONADA" value="Click here to access OHLEWDBP0262 Ignite" /&gt; &lt;/form&gt; &lt;/script&gt;

http://stackoverflow.com/a/29623836
has body: Your server does not send anything back (or an OK string), the response can't be interpreted as valid JSON and jQuery then considers that the query failed. In your user module, try exports.login = function(req, res) { console.log("login request"); console.log(req.body); // send back an empty object res.json({}); };
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/29621664
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29621664
type: Answer

http://stackoverflow.com/comment/47283019
has text: Have you renamed the file? `export-csv.js` => `highcharts-export-csv.js`
comment on: http://stackoverflow.com/q/29566736
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47430230
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29644672
has text: @swenzel typo , it should be 5 at the end
score: 0

http://stackoverflow.com/q/29662289
type: Question
linked to: http://stackoverflow.com/q/30173359
answer count: 2
has answer: http://stackoverflow.com/a/29662577
has comment: http://stackoverflow.com/comment/47464245
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29662466
tagged with: kendo-ui
score: 0
has body: I would like to draw two dataset (stats and stats2). I could able to draw one series (stats), dataSource: { data: stats}, http://jsfiddle.net/1sgt4810 but when I add the second one, it does not draw. dataSource: { data: stats, stats2 }, http://jsfiddle.net/1sgt4810/2/ I know there is an option of doing it as follows series: [{ type: "line", field: "y", categoryField: "x", name: "Path1", style: "smooth", data: stats, markers: { visible: false } }, { type: "line", field: "y", categoryField: "x", name: "Path2", style: "smooth", data: stats2, markers: { visible: false } }], Because in the future, I will have many of the lines, I need to know how to handle with multiple lines in a modular way.
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has title: Multiple Series of Line in Kendo-UI
has comment: http://stackoverflow.com/comment/47464305
upvote count: 1
downvote count: 1
linked to: http://stackoverflow.com/q/29687368
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29662466
possible better answer: http://stackoverflow.com/a/29662577

http://stackoverflow.com/comment/47286567
type: Comment
type: QuestionComment
has text: Your demo has a mountain of code non related to problem
score: 1
comment on: http://stackoverflow.com/q/29567722

http://stackoverflow.com/a/29999705
answers question: http://stackoverflow.com/q/29571750
downvote count: 0
has body: After struggling a lot with this issue I've found 1 solution for me. It might help people who are searching for a proper and exact solution but not the comments, downvotes and links. (Map was not displayed in my case.) If suppose,the link of page where you are loading map is http://example.com/abc/def/ghi/kpn.php then give thesame(exactly the same) under Edit allowed references If you try loading the same page using: www.example.com/abc/def/ghi/kpn.php or http://www.example.com/abc/def/ghi/kpn.php then your page is loaded but not your map, and this alert is generated. CONCLUSION Use the same path(Url address) at these 2 places. While loading the page which has map. Under Edit allowed references. After following this I've got rid from this alert.
upvote count: 9
type: Answer
score: 9

http://stackoverflow.com/q/29619631
has comment: http://stackoverflow.com/comment/72088838
has comment: http://stackoverflow.com/comment/47384145
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: express
tagged with: busboy
has comment: http://stackoverflow.com/comment/47385204
tagged with: sequelize.js
has comment: http://stackoverflow.com/comment/47402333
has title: Handling user file uploads with form text fields together with Node and connect-busboy?
tagged with: node.js
answer count: 0
type: UnansweredQuestion
upvote count: 1
score: 1
type: Question
has body: What is the standard practice of handling file uploads and validating text fields/insert to db in Nodejs, sequelize, and connect-busboy? For example, if we have a user profile form where an enduser has to input a name, email, and upload few files. When the user submits the form, would the steps on the server be, (1) validate text fields (2) save to User table in db (3) save files to disk (4) update user row with filepaths In semi-pseudo-code, I am imagining something like: router.post('/formSubmit', function(req, res) { var name = ....; var email = ...; var files = []; // Sequelize will validate for us when creating a new row in User table User.create({ name: name, email: email}).success(function(user_row) { // save each files to disk ... // update user_row with the filepaths on disk. ... }); }); But, I'm not sure how to adapt this logic flow into connect-busboy: router.post('/formSubmit', busboy, function(req, res) { if (req.busboy) { busboy.on('file', function(fieldname, file, filename, encoding, mimetype) { var saveTo = path.join(os.tmpDir(), path.basename(fieldname)); file.pipe(fs.createWriteStream(saveTo)); }); busboy.on('field', function(key, value, keyTruncated, valueTruncated) { // ... }); busboy.on('finish', function() { res.writeHead(200, { 'Connection': 'close' }); res.end("That's all folks!"); }); return req.pipe(busboy); } res.writeHead(404); res.end(); }); Do I have the right idea? If so, how can I adapt the validations, user creation/update into connect-busboy? If I'm way off, what's the standard practice of doing db validations, create/update of user fields, and also including the user uploads?

http://stackoverflow.com/a/29551350
type: Answer
has body: Several points: First, if @davidchambers' solution does what you need, that's great. It will be even better when the next version of Ramda is released and lensProp is added, which will make this just var fooLens = R.lensProp('foo'); fooLens.map(R.inc, {foo: 1, bar: 2}); // =&gt; {foo: 2, bar: 2} Second, there is a difference between your original function and either lens version: accum('foo', {bar: 1}); //=&gt; {"bar":1,"foo":1} fooLens.map(R.inc, {bar: 1}); //=&gt; {"bar":1,"foo":null} Third, regardless of all this, if you are interested in determining how to wrap your function up in a points-free manner, Ramda has several functions that will help. There is one helper function nthArg which does nothing but return a function that return the nth argument of the outer function in which it's called. Then there are several functions that act as extended versions of compose including useWith and converge. You can use them like this: var accum = R.converge(R.assoc, R.nthArg(0), countProp, R.nthArg(1)); accum('foo', {foo: 1, bar: 2}); // =&gt; {foo: 2, bar: 2} accum('foo', {bar: 2}); // =&gt; {foo: 1, bar: 2} In this code, converge passes the arguments (key and obj) to each of the functions passed as parameters, except for the first one, then passes the results of each of those to the that first function. Finally, although this shows a way to write this code points-free, and it's not in the end too horrible, it's arguably less clear than your earlier version that isn't points-free. I love points-free code. But sometimes we make a fetish of it, making code points-free for no good reason. If you can't in the end use a lens version, you might want to think carefully whether a points-free solution is actually clearer than the alternative.
answers question: http://stackoverflow.com/q/29547786
score: 5
upvote count: 5
downvote count: 0
has comment: http://stackoverflow.com/comment/47254562

http://stackoverflow.com/q/29636593
has comment: http://stackoverflow.com/comment/47418062
tagged with: validation
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47416281
type: Question
has comment: http://stackoverflow.com/comment/47415483
accepted answer: http://stackoverflow.com/a/29637186
score: 0
has comment: http://stackoverflow.com/comment/47415905
answer count: 1
has title: jQuery get numeric input from all browsers
tagged with: jquery-mobile
tagged with: javascript
has body: I want the user to press on a number key while focus is on an input item, and the browser should go to foo.com/[number] this is the code I am using: function isNumberKey(evt){ var charCode = (evt.which) ? evt.which : event.keyCode; if (charCode != 46 &amp;&amp; charCode &gt; 31 &amp;&amp; (charCode &lt; 48 || charCode &gt; 57)) return false; return true; } $(document).ready(function(){ $('.my_input').keypress(function(event){ if(isNumberKey(event)){ window.location='foo.com/'+(event.keyCode-48); } }); }); It works on Google Chrome, but Firefox users are getting errors. I also want to implement a mobile version where the user can input the number, and press the "enter" key of the mobile device. How can I ensure that this will work on all browsers that support javascript? Thanks for any help!
tagged with: jquery
has answer: http://stackoverflow.com/a/29637186
type: AnsweredQuestion

http://stackoverflow.com/a/29567264
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/47289489
accepted answer of: http://stackoverflow.com/q/29567151
score: 1
answers question: http://stackoverflow.com/q/29567151
has body: you can try this: $.ajax({ url: pluginUrl, dataType: "script", success: initializePlugin }); or just $.getScript()
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/47373168
has text: You're welcome, I don't want to spell everything out because I'd hate for you to just copy paste this into your work and not understand it. It's rewarding to understand how this stuff works, it'll help you answer your own questions in the future.
type: Comment
comment on: http://stackoverflow.com/a/29606134
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47235125
score: 0
comment on: http://stackoverflow.com/q/29541409
has text: @jwatts1980 I did try on http://www.w3schools.com/jsref/prop_style_width.asp and it working pretty well with other HTML code.
type: QuestionComment
type: Comment

http://stackoverflow.com/q/29569459
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47290605
type: UnansweredQuestion
has body: I am a newbie to angular. I am trying to populate the map.markers array existing in a controller from a controller of a directive(from a promise inside it).. and having hard time figuring out. any help is appreciated var locationController = function ($scope, $http, AppModesService, limitToFilter, uiGmapGoogleMapApi) { // var latestMasterYear = AppModesService.getLatestMasterYear(); uiGmapGoogleMapApi.then(function (maps) { $scope.googleVersion = maps.version; }); $scope.map = { center: { latitude: 40.0000, longitude: -98.0000, }, zoom: 7, bounds: {}, markers : [] }; Directive code: app.directive('referencePoints', function () { return { restrict: 'E', scope: { routeID: '@routeID', road: '=', openStatus: '=', markers: '=' }, template: "{{routeID}}&lt;div ng-repeat='point in refResults'&gt;{{point.RoadName}}&lt;/div&gt;", controller: function ($scope, $http, AppModesService) { $scope.refResults; $scope.isItOpen = true; $scope.refResults = $http.get(AppModesService.getRisApiUrlPrefix() + 'GetReferencePoints?routesID=' + $scope.road + '&amp;limited=true').then( function (response) { $scope.refResults = response.data; // This is where the problem starts .. Should I inject $scope.markers here or not? $scope.generateMarkers(response.data, $scope.markers) //return response.data; }); var generateMarkers = function (data, markers) { for (i = 0; i &lt; data.length; i++) { var record = data[i]; var marker = { latitude: record.Lat, longitude: record.Long, title: record.RoadName, id: record.ID }; markers.push(marker); } return markers; }; $scope.generateMarkers = function(data, scope){ generateMarkers(data, scope); }; //$scope.refPoints = $scope.referencePoints(routeID); } } }); ... &lt;reference-points ng-if="isItOpen" markers="markers" road=road.id route-ID="{{road.text}}"/&gt; .... Another directive : &lt;ui-gmap-google-map center="map.center" zoom="map.zoom"&gt; &lt;ui-gmap-markers models="map.markers" coords="'self'" icon="'icon'"&gt; &lt;/ui-gmap-markers&gt; &lt;/ui-gmap-g…
upvote count: 2
type: Question
tagged with: angularjs-directive
tagged with: angular-google-maps
has title: update scope variable from a promise inside a directive controller
tagged with: javascript
has comment: http://stackoverflow.com/comment/47291229
has answer: http://stackoverflow.com/a/29570972
tagged with: angularjs-scope
score: 2
has comment: http://stackoverflow.com/comment/47289373
answer count: 1
downvote count: 0
favorite count: 0

http://stackoverflow.com/comment/47367833
type: Comment
has text: duplicate of [How do JavaScript closures work?](http://stackoverflow.com/q/111102/1048572) and many other similar questions.
comment on: http://stackoverflow.com/q/29610810
score: 0
type: QuestionComment

http://stackoverflow.com/a/29644406
type: Answer
has comment: http://stackoverflow.com/comment/47429639
answers question: http://stackoverflow.com/q/29644251
upvote count: 1
has body: In Chrome's Developer Console: $('#name_btn').invoke Or (assuming these are jquery functions in $.fn): $.fn.invoke Type the function without calling it and hit enter, and it will print the source of the function as it saw it as well as which file it read the definition from on the right hand side of the console. http://i.imgur.com/YlBi8QA.png
score: 1
has comment: http://stackoverflow.com/comment/47429609
downvote count: 0

http://stackoverflow.com/comment/47306975
score: 0
type: AnswerComment
has text: with this solution i have to apply this to all the columns i want to change. if i also want to apply to 4th and 6 th columns, i have to apply separately to them.
type: Comment
comment on: http://stackoverflow.com/a/29579256

http://stackoverflow.com/a/29538879
type: Answer
answers question: http://stackoverflow.com/q/29538809
score: 0
has body: the jquery selector will return an array of items, so $('div') returns an array var myDivs = $('div'); // gives you an array Make sure you run your code after the div's have been rendered in the dom i.e. inside a $(function () {});

http://stackoverflow.com/a/29661016
has body: I think you are having a scope problem. Because you did not declare table as a var, it is not visible inside the for loop. Try var table = document.getElementById('personsTab');
has comment: http://stackoverflow.com/comment/47461639
score: 0
answers question: http://stackoverflow.com/q/29660964
type: Answer
upvote count: 1
downvote count: 1

http://stackoverflow.com/comment/47421641
has text: I think probably the best answer posted so far is Jared's. Web workers might be the best means of gaining higher accuracy, but like I said in my answer, there is technically still no probable way to get accuracy down to every 10th of a second. I ran another experiment and even with my fastest computer I could only get to 40% over a tenth of a second on average. Moreover, that's without anything else running that could block the timer.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29552344

http://stackoverflow.com/comment/47403840
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29630534
has text: Hi @shaunak shukla thanks but i need to start the input 3 from 1 and than onclick add 1.
score: 0

http://stackoverflow.com/comment/47382403
has text: `document.createElement("MyImg");` wrong syntax use `document.createElement("img");`
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29618880

http://stackoverflow.com/comment/47513116
score: 0
has text: @jdphenix, I'll be danged if those files don't look identical to my old eyes, and [yet, this](http://arielbalter.com/jdphenix/).
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29687802

http://stackoverflow.com/comment/47400184
type: AnswerComment
score: 0
type: Comment
has text: As stated before I'm sure this isn't the cleanest implementation and I could have gotten access to all the data inside the changeInfo however when I tried to implement it using that I kept getting an error so I just reverted to using something that worked.
comment on: http://stackoverflow.com/a/29628446

http://stackoverflow.com/q/29564376
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
type: UnansweredQuestion
tagged with: php
has body: I've tried this code. My Php File The output will be Are you sure want to leave this page? *Leave on this page * Stay on this page There are two options on above. Now, if I choose the Leave on page, how can I execute my php file? I mean, I want to update my table when I choose "Leave on this page".
has title: Updating table when browser is closed in PHP
type: Question
has answer: http://stackoverflow.com/a/29564439
answer count: 1

http://stackoverflow.com/comment/47241573
type: AnswerComment
type: Comment
score: 1
has text: Thanks T.J ! i appreciate the help! thanks for explaining stopImmediatePropagation as well
comment on: http://stackoverflow.com/a/29544451

http://stackoverflow.com/q/29628840
score: 0
answer count: 1
tagged with: css
has body: I'm inside an iFrame. I control the inner/outer/parent/child contents and it's all within the same domain. There are no security exceptions. If I run this in Chrome console, the border is applied exactly like I want: $("[name='PPDGFrame']").css("border", "2px solid #334930"); Yet when I do the same exact thing programmatically, it never works: $(document).ready(function() { $("[name='PPDGFrame'], window.parent.document").css("border", "2px solid #334930"); }); Or even this: $(document).ready(function() { setTimeout(function(){ $("[name='PPDGFrame'], window.parent.document").css("border", "2px solid #334930"); }, 3000); }); When executed in the code, no errors exist, and in Console I clearly get a handle to the object. Still no border. What am I doing wrong?
has answer: http://stackoverflow.com/a/29629242
tagged with: iframe
has title: Cannot apply border to iframe from inside iframe
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/29629242
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/29539161
accepted answer of: http://stackoverflow.com/q/29539017
answers question: http://stackoverflow.com/q/29539017
upvote count: 2
type: AcceptedAnswer
has body: You are adding the same event listener each second. I do not think that is what you want. You have also to clearInterval when mouse is not on the div. var num = 1; $("div").mouseover( function(){ incInterval= setInterval(function(){ document.getElementById("myID").innerHTML = num; num++; },1000); } ); $("div").mouseout( function(){ clearInterval(incInterval); });
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/a/29738460
has comment: http://stackoverflow.com/comment/47927873
has comment: http://stackoverflow.com/comment/48055724
accepted answer of: http://stackoverflow.com/q/29685953
type: AcceptedAnswer
has body: Yes, you can use JavaScript. Basically, what you need to do is check whether the captcha field do exists or not. Maybe something like this one. function isCaptchaExists() { var macro = "TAG POS=1 TYPE=IMG ATTR=HREF:*captcha* EXTRACT=HTM"; var retcode = iimPlayCode(macro); return retcode &lt; 0; }
answers question: http://stackoverflow.com/q/29685953
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/47987924

http://stackoverflow.com/comment/47461465
has text: If you're not open to editing the existing source code then how can you be open to other methods? **it doesn't neccesery have to be even my code.. all I want is to work so if someone gives me a better alternative it's fine.** and `explode()` is the same as using `split();` in javascript. Also 1000's of images makes no difference as the php isn't loading the images, it's nothing but a string/text.
score: 0
comment on: http://stackoverflow.com/q/29659076
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47237039
comment on: http://stackoverflow.com/q/29542657
type: Comment
type: QuestionComment
has text: Should it be `subIdSeries.push(subId)` instead of `push.subIdSeries(subId)`?
score: 0

http://stackoverflow.com/a/29568944
type: Answer
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/47287451
answers question: http://stackoverflow.com/q/29568783
type: AcceptedAnswer
score: 1
accepted answer of: http://stackoverflow.com/q/29568783
has body: According to the Documentation the popstate event is only triggered by doing a browser action such as a click on the back button So I do not believe it will get triggered when user clicks 'forward' (and it varies in some browsers) For reference, here's the full text: The popstate event is fired when the active history entry changes. If the history entry being activated was created by a call to history.pushState() or was affected by a call to history.replaceState(), the popstate event's state property contains a copy of the history entry's state object. Note that just calling history.pushState() or history.replaceState() won't trigger a popstate event. The popstate event is only triggered by doing a browser action such as a click on the back button (or calling history.back() in JavaScript). Browsers tend to handle the popstate event differently on page load. Chrome (prior to v34) and Safari always emit a popstate event on page load, but Firefox doesn't. UPDATED ANSWER ABOVE Your code works. (see below) - I added an element to trigger the event (you can see the results in the console) Make sure you include the jQuery library on your HTML prior to using it though. $(window).on('popstate', function(e) { console.log('fired instantly!'); var timer = setTimeout(function() { console.log('delayed popstate!'); clearTimeout(timer); }, 1000); }); $(window).trigger( 'popstate') ; &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
has comment: http://stackoverflow.com/comment/47287589

http://stackoverflow.com/a/29619526
answers question: http://stackoverflow.com/q/29616033
has comment: http://stackoverflow.com/comment/47383615
has comment: http://stackoverflow.com/comment/47383521
has comment: http://stackoverflow.com/comment/47383509
score: 0
type: Answer
has body: Rails.application.config.assets.precompile += %w( search.js ) By looking above line of code. I guess you have search.js file. Whenever you want to use external js file(manually added) then you have to inform application.js file to include such file. So your application.js file should be( If you wanted to add search.js which is not under app/assets/javascript/ and placed under vendor/assets/javascript/) //= require jquery //= require jquery_ujs //= require turbolinks //= require search #js file will be added like this without it's extension //= require_tree . Note: //= require_tree will include all js files which are under app/assets/javascript/ folder.

http://stackoverflow.com/comment/47215779
comment on: http://stackoverflow.com/a/29531003
score: 1
type: AnswerComment
has text: Yes. Please take a look [here](http://stackoverflow.com/questions/21317476/how-to-use-jquery-in-chrome-extension). You can also take a look at replaceChild which is a JavaScript function
type: Comment

http://stackoverflow.com/a/29643533
answers question: http://stackoverflow.com/q/29641444
has comment: http://stackoverflow.com/comment/47445808
has comment: http://stackoverflow.com/comment/47446305
type: Answer
has body: The Flux way would be to update your data store and trigger a render of your app, f.ex: var deleter = function(id) { data.items.splice(id,1) React.render(&lt;TodoApp /&gt;, document.getElementById('container')); } [...] handleClick: function(e) { deleter(this.props.id) } Demo: http://jsfiddle.net/s01f1a4a/
score: 0
accepted answer of: http://stackoverflow.com/q/29641444
type: AcceptedAnswer

http://stackoverflow.com/q/29572385
score: 0
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29572446
has title: Array wont iterate properly and check values - Javascript
tagged with: web-applications
has answer: http://stackoverflow.com/a/29572446
type: AnsweredQuestion
type: Question
tagged with: for-loop
has body: I am using JavaScript to make a little application where the user inputs some numbers and it stores it in an array. The application then prints out 1 to 40 on the screen in green. If any number that is stored in the array is equal to 1 to 40 then when it comes on the screen it will be red not green. var nums = document.getElementById('numbers').value; var numArray = []; numArray = nums.split(" "); for (n = 1; n &lt; 41; n++) { if (n === numArray[n]) { document.write('&lt;p&gt;' + n + '&lt;/p}&gt;&lt;br&gt;'); } else { document.write('&lt;p&gt;' + n + ' not in array&lt;/p}&gt;&lt;br&gt;'); } } The code above is just one attempt. I have also tried nested forloops, but that will print 1-40 check if it exists. and then print it out again. until it is done. So, how can I make it just iterate 1-40 and if it exists in the array print something different on screen? Ive been stuck on this for ages! Thanks in advance.
tagged with: arrays
answer count: 1
tagged with: javascript

google-chrome
tags question: http://stackoverflow.com/q/29676911
tags question: http://stackoverflow.com/q/29681775
tags question: http://stackoverflow.com/q/29681415
tags question: http://stackoverflow.com/q/29583639
tags question: http://stackoverflow.com/q/29665203
tags question: http://stackoverflow.com/q/29622822
tags question: http://stackoverflow.com/q/29591020
tags question: http://stackoverflow.com/q/29572935
tags question: http://stackoverflow.com/q/29666656
tags question: http://stackoverflow.com/q/29559111
tags question: http://stackoverflow.com/q/29596876
tags question: http://stackoverflow.com/q/29636255
tags question: http://stackoverflow.com/q/29630755
tags question: http://stackoverflow.com/q/29620530
tags question: http://stackoverflow.com/q/29658975
tags question: http://stackoverflow.com/q/29655160
tags question: http://stackoverflow.com/q/29550358
tags question: http://stackoverflow.com/q/29555703
tags question: http://stackoverflow.com/q/29681477
tags question: http://stackoverflow.com/q/29678566
tags question: http://stackoverflow.com/q/29534460
tags question: http://stackoverflow.com/q/29657479
tags question: http://stackoverflow.com/q/29555798
tags question: http://stackoverflow.com/q/29560441
tags question: http://stackoverflow.com/q/29532697
tags question: http://stackoverflow.com/q/29589618
tags question: http://stackoverflow.com/q/29687952
tags question: http://stackoverflow.com/q/29667186
tags question: http://stackoverflow.com/q/29686625
tags question: http://stackoverflow.com/q/29599346
tags question: http://stackoverflow.com/q/29661904
tags question: http://stackoverflow.com/q/29638234
tags question: http://stackoverflow.com/q/29600535
tags question: http://stackoverflow.com/q/29601844
type: Tag
tags question: http://stackoverflow.com/q/29583766
tags question: http://stackoverflow.com/q/29532934
tags question: http://stackoverflow.com/q/29628936
tag name: google-chrome
tags question: http://stackoverflow.com/q/29539135
tags question: http://stackoverflow.com/q/29596656
tags question: http://stackoverflow.com/q/29562476
tags question: http://stackoverflow.com/q/29548297
tags question: http://stackoverflow.com/q/29665127
tags question: http://stackoverflow.com/q/29567008
tags question: http://stackoverflow.com/q/29582208
tags question: http://stackoverflow.com/q/29592542
tags question: http://stackoverflow.com/q/29595609
tags question: http://stackoverflow.com/q/29532063
tags question: http://stackoverflow.com/q/29542731
tags question: http://stackoverflow.com/q/29627672
tags question: http://stackoverflow.com/q/29567879
tags question: http://stackoverflow.com/q/29541246
tags question: http://stackoverflow.com/q/29620041

http://stackoverflow.com/comment/47320467
has text: Where did the input string come from?
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29585319

http://stackoverflow.com/a/29651780
downvote count: 0
upvote count: 2
accepted answer of: http://stackoverflow.com/q/29651712
type: AcceptedAnswer
has body: You are looking for the animate method. Note that hover method takes two parameters, the second parameter is for onmouseout (when you are done hovering). $(document).ready(function() { $(".container").hover(function() { $(this).animate({ top: '20px' }) }, function() { $(this).animate({ top: '0px' }) }); }); .container { width: 500px; height: 100px; border: 1px solid #00c; position: relative; top: 0px; }
answers question: http://stackoverflow.com/q/29651712
type: Answer
score: 2

http://stackoverflow.com/comment/47477713
type: AnswerComment
comment on: http://stackoverflow.com/a/29669294
has text: Works like a charm thank you, i tried a lot of different methods to find the right one couldnt think of $("#name").val.
type: Comment
score: 0

http://stackoverflow.com/comment/47389108
comment on: http://stackoverflow.com/q/29622609
score: 0
type: QuestionComment
type: Comment
has text: Have you tried to apply css properties `max-height/width` to the video element ?

http://stackoverflow.com/q/29662790
score: 2
has comment: http://stackoverflow.com/comment/47550996
upvote count: 2
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/9195774
has title: Firefox extension open an HTML options page
has answer: http://stackoverflow.com/a/34161407
has body: I have an options page for my extension that is made with HTML and javascript tio be activated when options are selected. The extension is a window that hovers over the web page, and it has an "Options" button in it already. I need to have the options page be opened in a separate tab in the browser when the button is clicked. What I have so far is: mainPanel.port.on("options", function () { currentUser=null; mainPanel.hide(); var url = serverURL+"/options.html"; tabs.open(url); }); options.html is stored in the main file for the extension, and serverURL refers to the main server that the extension contacts for information.
has comment: http://stackoverflow.com/comment/47569222
type: Question
tagged with: add-on
tagged with: firefox
answer count: 1
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47469301
favorite count: 0
tagged with: firefox-addon
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/47613356
type: Comment
has text: I am new to angular JS and do not understand how this works. Can you please give me an answer that is specific to my problem?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29680746

wamp
tag name: wamp
type: Tag
tags question: http://stackoverflow.com/q/29640954

http://stackoverflow.com/q/29611910
has comment: http://stackoverflow.com/comment/47369419
linked to: http://stackoverflow.com/q/750486
type: Question
has title: Javascript issue - getJSON inside getJSON inside forEach Loop - JSON Parsing Error
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
score: 0
has body: While I do understand that these questions are very similar, I'd like to see how I can solve my JSON issue, since this question deals with 3 functions, rather than two. I was directed to this question: JavaScript closure inside loops – simple practical example However, their situation is a lot more simple, and I've tried both answers to no avail. It might be possible that my implementation of their solutions was incorrect. I've gotten myself in a bit of a bad situation here; I'm trying to use a getJSON method inside a getJSON method inside a forEach loop. My main issue, is that certain portions of the loop are executing faster than others, switching around variables and therefore messing up the second part of getJSON. In the end, it'll crash with errors of the API not having such an object for certain JSON, even though I can check for it and it'll be there. I think this issue would mean that I need these methods to work synchronously. I'm using NodeJS, Require, and some various APIs. Both of my getJSONs, as seen, have callbacks that are being used. I think it's just that the first one is executing a lot faster than the second. I also tried fooling around with wait and setTimeout methods to no avail :( offer.items_to_receive.forEach(function(item){ function wait(callback, delay){ var startTime = new Date().getTime(); while (new Date().getTime() &lt; startTime + delay); callback(); } getJSON(firstjsonlink, function(json){ var name = json.result[item.classid].name; var qualityString = json.result[item.classid].tags[0].internal_name; var qualityInt = json.result[item.classid].app_data.quality; var tradableString = "Untradable"; var craftableString = "Craftable"; if(json.result[item.classid].tradable == 1){ tradableString = "Tradable"; } getJSON(secondjsonlink, function(jsonNew){ var value = jsonNew.response.items[name].prices[qualityInt][tradableString][craftableString][0].value_raw; } total += value; // total is in fact defined right before the top of the paste }); });…
has comment: http://stackoverflow.com/comment/47369476
duplicate of: http://stackoverflow.com/q/750486
tagged with: node.js
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/a/29648548
score: 28
has body: I assume this is session storage in html5, in which case you can use sessionStorage.clear(); to remove all items in the session storage or sessionStorage.removeItem('itemName'); to remove a specific item.
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29648424
answers question: http://stackoverflow.com/q/29648424
upvote count: 28
type: AcceptedAnswer

http://stackoverflow.com/a/29629339
has comment: http://stackoverflow.com/comment/47402414
has comment: http://stackoverflow.com/comment/47402516
has comment: http://stackoverflow.com/comment/47401979
has comment: http://stackoverflow.com/comment/47403019
has body: Put the srcs in an array and iterate over them working fiddle https://jsfiddle.net/ps50po4z/ This allows you to use multiple images from different sources and display them. use this function as a template to iterate through all the cors src images
has comment: http://stackoverflow.com/comment/47401792
has comment: http://stackoverflow.com/comment/47406964
has comment: http://stackoverflow.com/comment/47401828
type: Answer
answers question: http://stackoverflow.com/q/29629219
upvote count: 0
has comment: http://stackoverflow.com/comment/47402579
score: -2
downvote count: 2

http://stackoverflow.com/comment/47504925
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29683647
has text: Typically, what I've seen is there is no formal submit button tied to the , then this type of a change and the actual submission of the form are $.ajax ...
score: 0

http://stackoverflow.com/comment/65653110
type: AnswerComment
has text: here: http://plnkr.co/edit/PoPSqXDTBWrrS6Gqur5a?p=preview I think that link will work? Basically, I've replaced the $scope.data with this.data and it doesn't seem to work.
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29677242

http://stackoverflow.com/comment/47650252
has text: Thanks for all of your replies
type: AnswerComment
comment on: http://stackoverflow.com/a/29653324
score: 0
type: Comment

http://stackoverflow.com/tag/csv
type: Tag
tag name: csv
tags question: http://stackoverflow.com/q/29544495
tags question: http://stackoverflow.com/q/29650034
tags question: http://stackoverflow.com/q/29596964
tags question: http://stackoverflow.com/q/29539532
tags question: http://stackoverflow.com/q/29570587
tags question: http://stackoverflow.com/q/29659728
tags question: http://stackoverflow.com/q/29654605

http://stackoverflow.com/comment/47338222
comment on: http://stackoverflow.com/a/29595600
type: Comment
has text: Worked... my mistake was that for URL i was not using http://
score: 0
type: AnswerComment

http://stackoverflow.com/comment/63951787
type: AnswerComment
comment on: http://stackoverflow.com/a/29555212
score: 0
has text: depends on your version of fullcalendar. do u get an js-error?
type: Comment

http://stackoverflow.com/q/29539017
upvote count: 2
answer count: 3
tagged with: jquery
favorite count: 0
tagged with: mouseover
has answer: http://stackoverflow.com/a/29539242
accepted answer: http://stackoverflow.com/a/29539161
tagged with: increment
has body: So here is a thing. I want number to be incremented by one each second while mouse pointer is on div element, but somehow it doesn't and I don't know where the problem is. JS: var num = 1; var count = setInterval( function(){ $("div").mouseover( function(){ document.getElementById("myID").innerHTML = num; num++; } ); } ,1000); HTML:
score: 2
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/29539161
has answer: http://stackoverflow.com/a/29539429
type: Question
possible better answer: http://stackoverflow.com/a/29539242
has title: Increment number every second as long as the mouse is on div
tagged with: javascript

http://stackoverflow.com/q/29539802
score: 0
has body: I'm trying to pull the value of an enum I have on the server in javascript. Right now I'm trying to use razor inside of the javascript to pull the value. var test = '@Enum.Parse(typeof(Enums.OrganizationEntityTypes), ' + currentValue + ')' currentValue being a javascript parameter. Compiler doesn't like me adding the currentValue in there... Is there a way to do something like this?
has comment: http://stackoverflow.com/comment/47232910
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/18011016
tagged with: razor
answer count: 0
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/47232806
tagged with: asp.net-mvc
tagged with: javascript
has title: Parse server side enum with javascript
linked to: http://stackoverflow.com/q/18011016

http://stackoverflow.com/comment/47414481
score: 0
has text: @yts Rikudo's answer work with divs, which is another good approach : ) but accurately enough for my case, yours do fine ; Now it's chosen as the answer ^^
type: QuestionComment
comment on: http://stackoverflow.com/q/29635361
type: Comment

http://stackoverflow.com/q/29555964
type: Question
has comment: http://stackoverflow.com/comment/47262618
accepted answer: http://stackoverflow.com/a/29556139
has title: How to put var with text type value into a jQuery Function
score: 0
answer count: 3
upvote count: 1
downvote count: 1
possible better answer: http://stackoverflow.com/a/29556163
has answer: http://stackoverflow.com/a/29556163
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/47262565
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29556225
has answer: http://stackoverflow.com/a/29556139
tagged with: javascript
tagged with: jquery
has body: I have a function to get some json array data from php file (getdata.php). This function require a string data type variable from select option element that in the next step will be used in getdata.php. I use var text = $('#element option:selected').text(); to create my variable. I'm sure this var text contain the right text value (I tried to show it using alert and it showed up). But, when i pass it into my function, this text value seems like dont match the data type that should be used. I don't know the structure of doing it. In getdata.php, i use this var to complete a mysql query. I use $_GET to fetch that variable. I tried it with var number=$('#element option:selected').val(); and it worked, but .text() it didn't run well. I'll really appreciate any advice to solve this problem. Thank you. Below is my script function code. $("#element1").change(function(){ var text = $('#element option:selected').text(); getAjaxData(text); }); function getAjaxData(text){ $.getJSON("getdata.php",{text:text} ,function(json){ //some operations here }
favorite count: 0

http://stackoverflow.com/q/29551630
answer count: 1
tagged with: mongoose
tagged with: node.js
tagged with: geojson
has comment: http://stackoverflow.com/comment/47278595
type: Question
type: AnsweredQuestion
has body: Using MongoDB v2.6.5 When I attempt to save a geojson document into the db I receive the following error: name: 'MongoError', code: 16755, err: 'insertDocument :: caused by :: 16755 Can\'t extract geo keys from object, malformed geometry?: { _id: ObjectId(\'55271b90d075728028d4c9e1\'), ..., location: [ { _id: ObjectId(\'55271b90d075728028d4c9e3\'), loc: { type: "Point", coordinates: [ -105.01621, 39.57422 ] } } ] } ], status: [ "lead" ], created: new Date(1428626320406), lastName: "Doe", firstName: "John", __v: 0 }' } I'm attempting to insert a Point into the table with a 2dsphere index, all managed through MongooseJS as shown below. var GeoAddressSchema = new Schema({ // Only holds points. loc: { type: { type: String }, coordinates: [] } }); var Lead = new Schema({ // Other fields ... location: [GeoAddressSchema], // ... }); LeadAddressSchema.index({ location: '2dsphere' }); The geojson that is being saved: { type: "Point", coordinates: [ -111.855211, 33.58513 ] } The geojson is valid according to: http://geojsonlint.com/ if I wrap the fields in quotes, but I should not need to do that (and cannot for Mongo afaik). Anyone have any idea why this would fail? It looks correct. Reference links MongoDB GeoJSON: http://docs.mongodb.org/manual/reference/geojson/ MongoDB 2dSphere: http://docs.mongodb.org/manual/core/2dsphere/
tagged with: javascript
has title: MongoDB Malformed Geometry with geojson
score: 0
tagged with: mongodb
has answer: http://stackoverflow.com/a/29554673
accepted answer: http://stackoverflow.com/a/29554673

http://stackoverflow.com/comment/47350417
type: Comment
has text: Yes, the cod_modelo has to be sorted ascending (a,b,c,d,e,f,g...) but the cod_nivel has to be sorted in a specific way ( 1. INC1 2. INC2 3. PRIM1 4. PRIM2 5. BAC1 6. BAC2)...note that it is not ascening...it's a fixed order. Maybe I haven't explained myself well...I appreciate a lot your help by the way.
comment on: http://stackoverflow.com/a/29601828
score: 0
type: AnswerComment

http://stackoverflow.com/a/29569103
has body: for(var i = 0; i &lt; players.length; i++){ if(players[i].userId === 'someId'){ //doSomething(player[i]); players[i].userScore = 'abc_123'; } }
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29569056
score: 2
upvote count: 2

http://stackoverflow.com/comment/47443661
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29649191
has text: Tried it, and yes - it does contain the correct date.
score: 0

http://stackoverflow.com/comment/47322795
type: Comment
comment on: http://stackoverflow.com/q/29587488
type: QuestionComment
score: 0
has text: Can you redo the "JSON" portion of your question?

http://stackoverflow.com/q/29562756
answer count: 1
has title: Add a search in html Select
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47275419
tagged with: http://stackoverflow.com/tag/html
type: Question
tagged with: css
has body: I am using the DDSlick plugin in my website. Everything is fine, I just want to add a filter type of thing in which there is a textbox on top. On entering text it will filter the results. My current list box: After using DDSlick plugin it becomes: Please Select From List test test
has comment: http://stackoverflow.com/comment/47275712
score: 0
has answer: http://stackoverflow.com/a/29563396

http://stackoverflow.com/comment/47273808
type: AnswerComment
has text: I already have a callback function. The weird thing is that the callback is executed when i open the popup, not after its closed. So method: feed is kinda buggy on facebook mobile app.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29557630

http://stackoverflow.com/comment/86604238
comment on: http://stackoverflow.com/q/29685716
type: Comment
type: QuestionComment
has text: yeah i found this problem too i have created a series of fiddles to demonstarte it too attached in this post, seems the two libraries dont play together very nicely anymore, did you find a way to resolve it with later versions of threejs? here is my post.... https://stackoverflow.com/questions/49784101/javascript-games-threejs-and-box2d-conflicts
score: 0

http://stackoverflow.com/comment/47266427
type: Comment
type: QuestionComment
has text: first line assigns var to i and the second line uses i as var to initialize the test variable to 21;
comment on: http://stackoverflow.com/q/29558069
score: 0

http://stackoverflow.com/q/29642672
type: UnansweredQuestion
tagged with: iframe
has body: I have embedded a YouTube Video in my html code IFrame tag..I want to track its play button click in Mixpanel Analytic. Embedding adds a new HTML with the iframe. I am not able to get some unique id to put my tracking point. My code is:
downvote count: 1
tagged with: youtube
type: Question
score: 1
answer count: 2
has answer: http://stackoverflow.com/a/30398655
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: How to track play button click of youtube embedded video in Mixpanel?
has comment: http://stackoverflow.com/comment/47426556
has comment: http://stackoverflow.com/comment/47428494
has answer: http://stackoverflow.com/a/29794447
tagged with: http://stackoverflow.com/tag/html
upvote count: 2

http://stackoverflow.com/q/29548763
upvote count: 1
has answer: http://stackoverflow.com/a/29549135
type: Question
tagged with: javascript
tagged with: jquery
has title: Chain together multiple jQuery animations to progressively animate color
tagged with: progress-bar
has body: Background I am creating a progress bar with steps that animates as more steps are completed (wizard style where after each successive ajax request finishes it goes to the next step). A good example of the look I'm going for is Amazon's shipping tracking, pictured below. I looked for plugins to do this, but I couldn't find one where I could add in the little circle steps like the image above, so I am creating my own with jQuery. Issue & Question Currently the "best" way I can think to accomplish this is by chaining together multiple .animate() methods which apply a background-color to one after another DIVs in a row. My jQuery code looks like this: $(function () { $(".progress-square:lt(1)").animate({ backgroundColor: "#FABF03" }, 500, function () { $(".progress-square:lt(2)").animate({ backgroundColor: "#FABF03" }, 500, function () { $(".progress-square:lt(3)").animate({ backgroundColor: "#FABF03" }, 500); }); }); }); and my HTML is rather simple: I am wondering if this is the correct way to "chain together" multiple animate() methods to successively animate one DIV after another? I seem to be having issues with my 4th animate() call using :lt(4) because the 4th div does not animate. I did not include this bit in the fiddle. Or is there possibly a "shortcut" provided by jQuery or another plugin that helps with a case like this? Currently in my fiddle i am using jQuery and jQuery Color as well as Bootstrap is included to stay consistent with the project I am working on. Here is a fiddle.
answer count: 1
downvote count: 0
score: 1
accepted answer: http://stackoverflow.com/a/29549135
favorite count: 0
tagged with: animation
type: AnsweredQuestion
tagged with: jquery-color

http://stackoverflow.com/comment/47467384
comment on: http://stackoverflow.com/a/29640608
has text: Anyway you could briefly explain in general terms what you are doing with this function? I'm trying to wrap my head around it.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47301917
comment on: http://stackoverflow.com/q/29576517
score: 0
type: Comment
type: QuestionComment
has text: I think its not possible with textarea, because textarea is simply a multiline text box, instead try select tag with multiple attribute.

openlayers
tags question: http://stackoverflow.com/q/29655662
type: Tag
tags question: http://stackoverflow.com/q/29552703
tag name: openlayers

http://stackoverflow.com/q/29575395
score: 3
tagged with: javascript
answer count: 2
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/29731580
linked to: http://stackoverflow.com/q/18782324
has title: JavaScript function not working after minification
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47299338
tagged with: minify
has answer: http://stackoverflow.com/a/29575531
has comment: http://stackoverflow.com/comment/47303460
upvote count: 3
has body: I am using a function to trigger a modal windows. The link: &lt;a ng-click="toggleModal()" href&gt;complexity&lt;/a&gt; toggles a boolean: $scope.showModal = false; $scope.toggleModal = function(){ $scope.showModal = !$scope.showModal; }; that triggers the modal window: .directive('modal', function () { return { template: '&lt;div class="modal fade"&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-hidden="true"&gt;&amp;times;&lt;/button&gt;' + '&lt;h4 class="modal-title"&gt;{{ title }}&lt;/h4&gt;' + '&lt;/div&gt;' + '&lt;div class="modal-body" ng-transclude&gt;&lt;/div&gt;' + '&lt;/div&gt;' + '&lt;/div&gt;' + '&lt;/div&gt;', restrict: 'E', transclude: true, replace:true, scope:true, link: function postLink(scope, element, attrs) { scope.title = attrs.title; scope.$watch(attrs.visible, function(value){ if(value === true) { $(element).modal('show'); } else { $(element).modal('hide'); } }); $(element).on('shown.bs.modal', function(){ scope.$apply(function(){ scope.$parent[attrs.visible] = true; }); }); $(element).on('hidden.bs.modal', function(){ scope.$apply(function(){ scope.$parent[attrs.visible] = false; }); }); } }; }) Everything works fine as long as I don't minify the code. No errors from the console: using some breakpoints I noticed that clicking on the link the value doesn't become true . Any idea about why that's happening? UPDATE 1: this is the minified bit of the directive above: .directive("modal",function(){return{template:'&lt;div class="modal fade"&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-hidden="true"&gt;&amp;times;&lt;/button&gt;&lt;h4 class="modal-title"&gt;{{ title }}&lt;/h4&gt;&lt;/div&gt;&lt;div class="modal-body" ng-transclude&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;',restrict:"E"…
has comment: http://stackoverflow.com/comment/47299356
type: UnansweredQuestion
type: Question

http://stackoverflow.com/a/29652946
type: Answer
has body: Not sure it would help but here is what is working for me: onPrepare: function () { require("jasmine-reporters"); // junit reporter var capsPromise = browser.getCapabilities(); capsPromise.then(function (caps) { var browserName = caps.caps_.browserName.toUpperCase(); var browserVersion = caps.caps_.version; var prePendStr = browserName + "-" + browserVersion + "-"; jasmine.getEnv().addReporter(new jasmine.JUnitXmlReporter("test-results", true, true, prePendStr)); }); }, Using jasmine 1.3, jasmine-reporters 1.0.1, protractor 2.0.
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29652810
answers question: http://stackoverflow.com/q/29652810

http://stackoverflow.com/comment/47256256
comment on: http://stackoverflow.com/q/29552436
has text: `window.promp()` for that first error, I think.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47550064
comment on: http://stackoverflow.com/q/29686324
has text: Excel - I am using Google sheets to download web data and transferring this data to excell for processing - excell is not as efficient as Google getting data from websites and Google spreadsheet size limitations prevent me from using it as it is very slow - but getting the data across is a bit cumbersome so I want to streamline the process
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29558930
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47270270
favorite count: 0
has comment: http://stackoverflow.com/comment/47270825
has comment: http://stackoverflow.com/comment/47270237
tagged with: css
has comment: http://stackoverflow.com/comment/47270572
has comment: http://stackoverflow.com/comment/47271344
has answer: http://stackoverflow.com/a/40349642
score: 8
has comment: http://stackoverflow.com/comment/47270656
downvote count: 0
has comment: http://stackoverflow.com/comment/47271923
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29559224
has body: I want to make the case for showing and hiding menu like the picture. You can see in the following image there is a tree part. First part when you open the page the right bottom side menu will still showing. When you scroll down then the menu will fadeIn, and when you sroll up then the menu will fadeOut. The facebook and tumblr doing like this. I want to learn how can they do this. Anyone can tell me little example or something. I created this DEMO from codepen.io but it is only header think and also there is a problem when scroll up. var previousScroll = 0, // previous scroll position menuOffset = 54, // height of menu (once scroll passed it, menu is hidden) detachPoint = 650, // point of detach (after scroll passed it, menu is fixed) hideShowOffset = 6; // scrolling value after which triggers hide/show menu // on scroll hide/show menu $(window).scroll(function() { if (!$('nav').hasClass('expanded')) { var currentScroll = $(this).scrollTop(), // gets current scroll position scrollDifference = Math.abs(currentScroll - previousScroll); // calculates how fast user is scrolling // if scrolled past menu if (currentScroll &gt; menuOffset) { // if scrolled past detach point add class to fix menu if (currentScroll &gt; detachPoint) { if (!$('nav').hasClass('detached')) $('nav').addClass('detached'); } // if scrolling faster than hideShowOffset hide/show menu if (scrollDifference &gt;= hideShowOffset) { if (currentScroll &gt; previousScroll) { // scrolling down; hide menu if (!$('nav').hasClass('invisible')) $('nav').addClass('invisible'); } else { // scrolling up; show menu if ($('nav').hasClass('invisible')) $('nav').removeClass('invisible'); } } } else { // only remove “detached” class if user is at the top of document (menu jump fix) if (currentScroll &lt;= 0){ $('nav').removeClass(); } } // if user is at the bottom of document show menu if ((window.innerHeight + window.scrollY) &gt;= document.body.offsetHeight) { $('nav').removeClass('invisible'); } // replace previous…
upvote count: 8
possible better answer: http://stackoverflow.com/a/40349642
type: Question
has answer: http://stackoverflow.com/a/29559224
answer count: 2
has comment: http://stackoverflow.com/comment/47271674
has title: How to hide div when scrolling down and then show scroll up

http://stackoverflow.com/comment/63270837
score: 0
type: AnswerComment
type: Comment
has text: thanks a lot for adding your solution, this was inspirational for finding mine
comment on: http://stackoverflow.com/a/29629175

http://stackoverflow.com/q/29621678
favorite count: 0
has title: How to mock dojo.data.ItemFileReadStore for the specific url in DOJO?
tagged with: qunit
type: UnansweredQuestion
upvote count: 1
tagged with: unit-testing
tagged with: dojo
score: 1
has body: I'm looking for a way to mock the dojo.data.ItemFileReadStore which retrieves json by provided url. I want to write unit tests for Dojo code without running application server, so the D.O.H. framework is not suitable here as far as I understood. I'm just looking a possibility to interfere in dojo initialization flow from an other js file in order to put mock for the dojo.data. Could anyone suggest something, or a better way for doing automated testing to cover dojo code? Finally I've found a way to do it: In the js file you want to interfere from, I've added the following: require(['dojo/data/ItemFileReadStore'], function (item) { dojo.data = { ItemFileReadStore: function (options) { return { your implementation here ... }; } }; }); Better decisions are much appreciated!
type: Question
has answer: http://stackoverflow.com/a/29628175
answer count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/47367771
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29610966
has text: John, it doesn't. I'm new to AngularJS - can you throw some light on how to use route resolve to load the data and only then load this view? Sounds like what I am looking for

http://stackoverflow.com/comment/47488657
type: Comment
comment on: http://stackoverflow.com/a/29675326
type: AnswerComment
has text: The story of quotation marks is different. What if you want to assign a numeric value to a JavaScript variable? After all, this is not the culprit of the compile-time error you got (JSP 2.3.3 does not issue any compiler error with the code snippets you posted).
score: 0

http://stackoverflow.com/q/29532318
tagged with: php
has answer: http://stackoverflow.com/a/66858759
tagged with: laravel
has answer: http://stackoverflow.com/a/29535464
downvote count: 0
score: 7
has body: I am using Stripe's API (v2) - https://stripe.com/docs/stripe.js This is being implemented using Laravel's cashier, a package that ships with Laravel, with docs. I have a very basic form at the moment, collecting the user's card info, which is then passed over to Stripe who will validate it and return a token. This token is placed in my form and is what I store and use in my system (again, all handled cleanly by Laravel). I need to use coupons as part of this checkout process. I assumed it would be a simple case of adding the coupon field and Stripe would do the rest, but unfortunately that isn't the case - there is no validation taking place of the coupon when it is entered and the form is submitted. Processing the coupon after submit is fine, as Laravel handles that. My question: How can I get Stripe to validate an entered coupon using their JavaScript API? Below is my form and the accompanying JS: Form: Error: Credit card number Expiration date January February March April May June July August September October November December 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 CVC number Coupon Sign Up JavaScript:
type: Question
tagged with: javascript
answer count: 2
tagged with: validation
upvote count: 7
has title: How to validate coupon using Stripe's JavaScript API?
tagged with: stripe-payments
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/47346170
type: AnswerComment
type: Comment
has text: ah ha! If you change the branch, the faculty and course set the default(empty) in client side;
comment on: http://stackoverflow.com/a/29598990
score: 0

http://stackoverflow.com/q/29637120
tagged with: javascript
has comment: http://stackoverflow.com/comment/47416623
has comment: http://stackoverflow.com/comment/47417154
score: 3
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/29637300
favorite count: 0
tagged with: angularjs
type: AnsweredQuestion
tagged with: angularjs-ng-click
has comment: http://stackoverflow.com/comment/47417056
upvote count: 3
has body: I'm using predicate to easily sort items in my data model. Now I've working on adding in an up and down arrow icons to show which state the sort is currently in. Example of predicate orderBy in action: http://plnkr.co/edit/?p=preview Not sure how to toggle those values however within predicate: Recently added Controller $scope.recentAdded = 'up' I'm not using a function here, which is why it's a bit hard for me to see how to toggle it now. Is there a way to hook into this and change the recentAdded var? Which will inturn change the ng-class: ng-click="predicate = 'added_epoch'; reverse=!reverse;" Then based on the predicate, toggle the ng-class: ng-class="recentAdded == 'up' ? 'iconUpBig' : 'iconDownBig'"
accepted answer: http://stackoverflow.com/a/29637300
tagged with: angularjs-ng-class
has title: How to use ng-toggle and ng-class to change icon while using ng-click:predicate
type: Question
has comment: http://stackoverflow.com/comment/47416590

http://stackoverflow.com/comment/47347390
type: Comment
type: QuestionComment
has text: yes.. i have the libraries included..
comment on: http://stackoverflow.com/q/29600253
score: 0

http://stackoverflow.com/comment/47500829
comment on: http://stackoverflow.com/q/29681849
score: 0
has text: `I am very new to JS and programming in general` and you've written that neat piece of code? Way to go!
type: Comment
type: QuestionComment

scrollbar
tags question: http://stackoverflow.com/q/29588875
type: Tag
tag name: scrollbar

http://stackoverflow.com/a/29656713
type: Answer
has comment: http://stackoverflow.com/comment/47456157
score: 3
has comment: http://stackoverflow.com/comment/47453194
downvote count: 0
has comment: http://stackoverflow.com/comment/47454121
has comment: http://stackoverflow.com/comment/47455604
answers question: http://stackoverflow.com/q/29656679
has body: Create a javascript function: &lt;script type="text/javascript"&gt; function submitForm(form){ if(confirm("Are you sure?")){ form.submit() } else{ location.reload() } } &lt;/script&gt; And then adjust your HTML to be: &lt;select name='&lt;?php echo "sel".$a; ?&gt;' onchange='submitForm(this.form)' style='width: 150px'&gt;
upvote count: 3

http://stackoverflow.com/q/29658079
has comment: http://stackoverflow.com/comment/47455947
has comment: http://stackoverflow.com/comment/47455998
type: Question
has comment: http://stackoverflow.com/comment/47455934
tagged with: function
has body: This is my html code: &lt;td width="15%" align="center"&gt;&lt;input name="submit" type="submit" class="button" value="Basic" tabindex="13" onclick="return submit_Click('bxbas','bxsht');" /&gt;&lt;/td&gt; And this is my javascript code: &lt;script type="text/javascript"&gt; function submit_Click(aclass,bclass) { var elementsa = document.getElementsByClassName(aclass); for(i in elementsa) { elementsa[i].style.display = "block"; } var elementsb = document.getElementsByClassName(bclass); for(j in elementsb) { elementsb[j].style.display = "none"; } } &lt;/script&gt; Unfortunately this is not working. Apparently, only the first part of the function is working, the one that makes the first class (aclass) to be shown. The second one remains visible. Thank you
tagged with: javascript
has answer: http://stackoverflow.com/a/29658907
tagged with: class
has title: Onclick action: two functions; only first working. Quite desperate
has comment: http://stackoverflow.com/comment/47456189
answer count: 1
has comment: http://stackoverflow.com/comment/47455854
type: UnansweredQuestion
score: 0
tagged with: styles

http://stackoverflow.com/comment/47238481
has text: if dom elements are dynamically created and destroyed you will want to use bind method http://api.jquery.com/bind/
comment on: http://stackoverflow.com/q/29543224
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/47313374
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29580748
type: QuestionComment
has text: It's simple text, sorry for not be more clear.

http://stackoverflow.com/comment/47396755
type: AnswerComment
has text: Since I am using Microsoft Razor, the variable needed to be passed as "@recID". The code is working now.
type: Comment
comment on: http://stackoverflow.com/a/29596804
score: 0

openlayers-3
type: Tag
tags question: http://stackoverflow.com/q/29670384
tags question: http://stackoverflow.com/q/29655662
tags question: http://stackoverflow.com/q/29654865
tag name: openlayers-3
tags question: http://stackoverflow.com/q/29648596

http://stackoverflow.com/comment/47413081
has text: I downloaded jquery-2.1.3.min.js and refer to that file in my HTML doc instead of the CDN. I have no reference to it in manifest file -not sure if I need to. When running extension get "Uncaught ReferenceError: $ is not defined" at first jquery line.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29617674
type: Comment

http://stackoverflow.com/q/29536618
tagged with: meteor-autoform
tagged with: javascript
has title: Meteor Autoform linked inputs?
has comment: http://stackoverflow.com/comment/47230137
upvote count: 2
tagged with: meteor
favorite count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/28685163
tagged with: meteor-collection2
score: 2
answer count: 0
downvote count: 0
has body: I'm just trying to figure out what would be the most elegant way to solve following problem with meteor autoform and collection2: I created a signup form which allows to select countries and states. Of course the selectable states should change according to the country selected. Is there a 'native' autoform approach to this or do i have to do it with events and conditional rendering? Kind Regards and thanks!
type: Question

http://stackoverflow.com/comment/47497401
score: 0
has text: Add something like `` before the script and change compare(...) to `document.getElementById('res').innerHTML=compare(...)`
comment on: http://stackoverflow.com/q/29679929
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29649449
score: 2
accepted answer of: http://stackoverflow.com/q/29637026
has body: localstorage can't know how was the original object. You need to explicitly call JSON.parse(). userObject = JSON.parse(localStorage.getItem('userObject')); UPDATE: Note that functions are never serialized or supported in JSON. This is because it would not be reliable to reconstruct functions or prototypes from a generated "source code", because a) prototypes aren't captured in JSON and b) functions may have access to closures. In order to have methods on rehydrated object prototype, proceed thisway: // User constructor function function User() { } User.prototype.isValid = function () { return true; }; User.prototype.isAdmin = function () { return this.name === "admin"; }; // create and serialize an object var userA = new User(); userA.name = "admin"; var copy = JSON.parse(JSON.stringify(userA)); // rehydrate with functions on prototype var userB = new User(); for (var prop in copy) { if (Object.prototype.hasOwnProperty.call(copy, prop)) { userB[prop] = copy[prop]; } } console.log(userB.isAdmin());
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47450477
has comment: http://stackoverflow.com/comment/47447636
has comment: http://stackoverflow.com/comment/47450419
type: Answer
answers question: http://stackoverflow.com/q/29637026
upvote count: 2

http://stackoverflow.com/comment/47377950
score: 0
type: Comment
has text: App Cache (or manifest) is a list of files you want to make available for offline. It usually isn't related to being logged in or not. I suppose, there's nothing to stop you dynamically generating the file after the user is logged in, with all files related to that user. For example, if you have a website where a user uploads art, you could generate a manifest for their collection. However, when you change the manifest file, the browser will try to redownload everything which may not be the desired effect. Does this help? For logins, store a randomly generated cookie.
type: QuestionComment
comment on: http://stackoverflow.com/q/29616101

http://stackoverflow.com/comment/47307138
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29578885
has text: simple yet working solution, just nice.

http://stackoverflow.com/q/29608184
has comment: http://stackoverflow.com/comment/47362138
has answer: http://stackoverflow.com/a/29608228
accepted answer: http://stackoverflow.com/a/29608228
linked to: http://stackoverflow.com/q/70579
type: AnsweredQuestion
type: Question
has body: I try to append a new element with an increasing id. This is my attempt, but it always sets the id 1: JSFiddle: http://jsfiddle.net/z0qwcuq9/ &lt;div id="main"&gt;&lt;/div&gt; for (i = 0; i &lt; 5; i++) { var maxId = 0; $("#main .element *[id]").each(function() { if(maxId &lt; $(this).attr("id")){ maxId = $(this).attr("id")} }); maxId = maxId + 1; $('#main').append('&lt;div class="element" id="'+maxId+'"&gt;'); } By the way: Is this the correct way to append an element or do I have to set the class and id seperatly?
has title: Adding a new element with increasing id-number
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29608215
has answer: http://stackoverflow.com/a/29608215
score: 0
answer count: 2
tagged with: jquery

http://stackoverflow.com/q/29668955
has body: I use a sample calculator in the excel to create a new one using JavaScript. when i calculating the Cost(dirty) the answers i got is different from the answer. in the excel. So i tried in these in excel First i use the cell for the calculations it give the same answer as in the excel (EG:=C13/100*C20). i got 960,918.00 Then i tried the values it gives different answer but same as i get from the JavaScript (EG: =96.09*(1000000/100)). i got 960900. Excel calculations Last coupon date: =COUPPCD(C2,C4,2,1) Next coupon date: =COUPNCD(C2,C4,2,1) Clean price: =ROUND((PRICE(C2,C4,C5,C7,100,2,1)),4) Accrued interest: =ROUND(ACCRINT(C9,C11,C2,C5,100,2,1),4) Dirty Price: =C15+C18 Cost(dirty): =C13/100*C20 I am unable to include a screenshot so i mention like this C2: 24-Aug-2008, C4: 01-Apr-2018, C5: 16.00%, C7: 18.29%, C9:Last coupon date. C11: Next coupon date, C13: 1000000, C15: Clean price, C18: Accrued interest, C20: Dirty Price, C23: Cost(dirty). Please help me, i don't know why the two answers are different FYI: I tried whether the value in the C20 and 96.09 are same, i get FALSE as result and they don't have any different also. I really confused with this and i get stuck please give some solutions if you can. Thanks in advance
type: AnsweredQuestion
tagged with: javascript
type: Question
has answer: http://stackoverflow.com/a/29669251
accepted answer: http://stackoverflow.com/a/29669251
score: 0
answer count: 1
tagged with: excel
has title: Excel 2013 giving different answer for the same value and formula in different cell

http://stackoverflow.com/comment/47397305
score: 0
type: AnswerComment
has text: Add url field inside point and then use reference (in formatter) like this.point.options.url
type: Comment
comment on: http://stackoverflow.com/a/29624590

http://stackoverflow.com/a/29629942
answers question: http://stackoverflow.com/q/29629732
score: 1
upvote count: 1
has body: You have result in jsfiddle in addition: var completeRow = []; for( var i = 1; i &lt; rows.length; i++){ if( completeRow[i-1] == undefined ){ completeRow[i-1] = ''; } for( var j = 0; j&lt; rows[i].length; j++ ){ completeRow[i-1] = completeRow[i-1] + ' '+ rows[i][j]; } } alert(completeRow[0]); UPDATE link to jsFiddle
type: Answer
downvote count: 0

http://stackoverflow.com/comment/47293305
score: 0
type: Comment
type: QuestionComment
has text: @slebetman: Okay, that makes sense. I think that will be a little faster. But in my opinion there are still two performance problems with my react.js code: **#1** All users have to call `getUserById()`. I don't know if there is another possibility to pass the users directly as _props_ to the feeds instead of the `getUserById` function. **#2** The two-way-binding: on each change react calls `this.setState({users: newUsers})` to update the whole users object. Is there a way to update just one property like `this.setState({users[2].name: newUserName})`.
comment on: http://stackoverflow.com/q/29570032

http://stackoverflow.com/q/29545411
tagged with: client-server
has comment: http://stackoverflow.com/comment/110745843
tagged with: audio-streaming
downvote count: 0
tagged with: javascript
has title: How can I "play" a sound from its PCM data in JavaScript
tagged with: getusermedia
favorite count: 0
answer count: 0
type: UnansweredQuestion
has body: I'm building a videochat application. I used "getUserMedia" to get access to the microphone. I get and send the PCM data to the server with the following code: var bufferSize = 4096; audioContext = new (window.AudioContext || window.webkitAudioContext || window.mozAudioContext)(); //Crear conteto de audio volume = audioContext.createGain(); audioInput = audioContext.createMediaStreamSource( e ); audioInput.connect( volume ); processor = audioContext.createScriptProcessor( bufferSize, 1, 1 ); processor.onaudioprocess = function ( e ){ if( e === undefined ) return; var left = e.inputBuffer.getChannelData( 0 ); if( (left.buffer instanceof ArrayBuffer) &amp;&amp; (left.length &gt; 0) &amp;&amp; (left.buffer !== undefined) &amp;&amp; (left[0] != 0)){ if( ws ){ if( ws.readyState == WebSocket.OPEN ){ ws.send( left.buffer ); }//Fin if }//Fin ws }//Fin if }//Fin function volume.connect( processor ); processor.connect( audioContext.destination ); It works perfectly. But, I cannot play the audio received on the server. The client sends to the server a Float32Array containing the PCM audio-data captured from the local microphone. This is my code to play the audio when the server receives the PCM data: function PlayAudio( param ){ // creates the audio context var audioCtx = new (window.AudioContext || window.webkitAudioContext)(); // Create an empty two second stereo buffer at the // sample rate of the AudioContext var frameCount = audioCtx.sampleRate * 2.0; var bufferSize = 4096; var myArrayBuffer = audioCtx.createBuffer( 1, bufferSize, audioCtx.sampleRate); var nowBuffering = myArrayBuffer.getChannelData(0); for (var i = 0 , len = param.length ; i &lt; len ; i++) { nowBuffering[i] = param[i]; }//fin for //create a buffer source to play the audio var source = audioCtx.createBufferSource(); //Copy the buffer source.buffer = myArrayBuffer; //Connect the audio input source.connect(audioCtx.destination); //Start playing source.start(); } I'm testing the server with only one client.…
upvote count: 1
tagged with: audio
score: 1
type: Question

http://stackoverflow.com/a/29590575
answers question: http://stackoverflow.com/q/29590535
type: Answer
has body: Try something like this $('.basediv').each(function(i, val) { randomNumber = Math.round(Math.random() * (viewclasses - 1)) + 1; $(this).addClass('view' + randomNumber); }); $(document).ready(function () { viewclasses = 3; $('.basediv').each(function(i, val) { randomNumber = Math.round(Math.random() * (viewclasses - 1)) + 1; $(this).addClass('view' + randomNumber); }); }); .basediv{ width:100px; height:100px; } .view1{ background:orange; } .view2{ background:green; } .view3{ background:blue; }
score: 0

http://stackoverflow.com/comment/47399756
score: 0
type: QuestionComment
has text: The boolean is false to indicate a synchronous download, true would enable asynchronous behaviour (i.e. non-blocking).
comment on: http://stackoverflow.com/q/29628323
type: Comment

http://stackoverflow.com/a/29551593
answers question: http://stackoverflow.com/q/29551528
type: Answer
downvote count: 0
score: 1
has body: You were close on your javascript. Try changing your script to the following: $("#but1").hover(function() { $(this).css("background-color", "blue"); }, function() { $(this).css("background-color", "red"); });
has comment: http://stackoverflow.com/comment/47254789
upvote count: 1

http://stackoverflow.com/a/29576854
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47312076
type: Answer
downvote count: 0
has body: If I understand your question correctly you'd like to visualize an FFT but you don't want it to display any frequencies above 8kHz. There are 2 options: 1) You can try setting the sample rate to 16kHz which would give you 8kHz audio bandwidth. I'm not sure of browser support for this. Refer to https://github.com/WebAudio/web-audio-api/issues/300 for more details. 2) Disregard any of the frequency bins beyond your desired frequency. The bin starting frequency can be found by multiplying the bin index by 1/2 the sample rate over the the total number of bins. For example, for a 512 point FFT at 48000: bin 0: 0 * 48000.0/2/512 = 0 Hz bin 511: 511 * 48000.0/2/512 = 23953.125 Hz With a little algebra you can solve for the bin # containing any desired frequency: startFreq = binNum * sr/2/numBins therefore: binNum = startFreq * numBins / (sr/2) 8000 * 512 / (48000/2) = 170.67 So 8kHz would be present in _analyzer.getFloatFrequencyData()[170] of the 512 point FFT at 48kHz. You can determine the sample rate from _context.sampleRate
accepted answer of: http://stackoverflow.com/q/29576431
score: 1
has comment: http://stackoverflow.com/comment/47302857
answers question: http://stackoverflow.com/q/29576431

http://stackoverflow.com/q/29554927
tagged with: angularjs
answer count: 3
upvote count: 1
has title: Can't fill in a text input in angularJS
has comment: http://stackoverflow.com/comment/47260598
type: UnansweredQuestion
downvote count: 0
tagged with: javascript
score: 1
has answer: http://stackoverflow.com/a/29555002
has answer: http://stackoverflow.com/a/29556188
favorite count: 0
has comment: http://stackoverflow.com/comment/47260734
has comment: http://stackoverflow.com/comment/47260677
type: Question
has answer: http://stackoverflow.com/a/29559498
has body: I have a text input that I want to fill in with the output of a function, however I don't know why It doesn't work ? Here is my html code: &lt;input type="text" min="0" ng-model="Resqty" size="10" required &gt; In angularJS I do: $scope.Resqty = $scope.total($scope.out); $scope.total = function total(out) { return data.convert($scope.qty, $scope.in, out); }; I also tried to put function directly as follows but it doesn't work neither: $scope.Resqty = data.convert($scope.qty, $scope.in, $scope.out); However, in the html code when I put {{total(out)}} it works ! I also tried to put a value directly to verify and it worked !! $scope.Resqty = 1; Does anyone know why the text input doesn't get the value correctly ? Here is a link for a Demo Thank you in advance !
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/29583225
has answer: http://stackoverflow.com/a/29583281
has comment: http://stackoverflow.com/comment/47314973
favorite count: 0
has comment: http://stackoverflow.com/comment/47314888
downvote count: 0
answer count: 5
accepted answer: http://stackoverflow.com/a/29583260
has title: Check if an item exists in an observableArray
has body: Why is the check for duplicate Artist always returning false? See this JSFiddle for a runnable demo. Knockout Code $(function() { function Artist(name) { this.name = name; } function ViewModel() { var self = this; self.favoriteArtists = ko.observableArray([]); self.artistToAdd = ko.observableArray(""); self.addArtist = function () { var newFavoriteArtist = new Artist(self.artistToAdd()); console.log("New Favorite Artist: " + newFavoriteArtist.name); var artistExists = self.favoriteArtists.indexOf(newFavoriteArtist) > 0; console.log("Artist Exists: " + artistExists); if(!artistExists) { self.favoriteArtists.push(newFavoriteArtist); console.log("A new artist has been added:" + self.artistToAdd()); } else { console.log("Artist already in favorites."); } }; } ko.applyBindings(new ViewModel()); }); HTML Favorite Artists Currently, your favorite artists include: Enter the name of a new artist: Add
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29583260
has comment: http://stackoverflow.com/comment/47314948
tagged with: knockout.js
type: Question
has answer: http://stackoverflow.com/a/35466343
score: 5
tagged with: javascript
has comment: http://stackoverflow.com/comment/47315020
has answer: http://stackoverflow.com/a/29583872
upvote count: 5
has answer: http://stackoverflow.com/a/43093768
possible better answer: http://stackoverflow.com/a/29583281

http://stackoverflow.com/comment/47282306
has text: Sry. Just updated the actual implementation. Thanks for your input. I've resolved using **return**, but wanted to make sure that I didn't go wrong anywhere
type: AnswerComment
comment on: http://stackoverflow.com/a/29566201
score: 0
type: Comment

http://stackoverflow.com/q/29558837
type: Question
has title: Obtaining data bound to dom elements
tagged with: javascript
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/29560459
has answer: http://stackoverflow.com/a/29560405
accepted answer: http://stackoverflow.com/a/29560459
has body: I am currently learning data visualizations with d3.js. I am using the tutorial on the d3.js site. I am at the part where the data bound to DOM elements have to retrieved. I did it exactly as they have shown, but I am not able to get the data from it. Here is the code from the beginning: var theData=[1,2,3] var p= d3.select("body") .selectAll("p") .data(theData) .enter() .append("p") .text("hello") This displays: hello hello hello Now, on the site, it tells me to enter the following code to obtain the data bound i.e. 1,2 &amp; 3. var theData=[1,2,3] var p= d3.select("body") .selectAll("p") .data(theData) .enter() .append("p") .text(function (d) { return d; } ) Even after doing this, the page does not change,like it should to: 1 2 3 It remains the same(it keeps showing the three hello's). How do I get the data back?
has answer: http://stackoverflow.com/a/29562011
has comment: http://stackoverflow.com/comment/47268592
has comment: http://stackoverflow.com/comment/47267801
type: AnsweredQuestion
tagged with: d3.js
possible better answer: http://stackoverflow.com/a/29560405

http://stackoverflow.com/comment/47421106
score: 0
type: AnswerComment
has text: Not sure if you're a PHP guy, but what should i change in the PHP file? ... This is all new ground for me, as im a C and Python Developer, so JS and PHP im still trying to learn. Here is the PHP file: http://pastebin.com/MXXebb8C
type: Comment
comment on: http://stackoverflow.com/a/29639321

http://stackoverflow.com/q/29666084
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/47471228
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/29666619
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has title: JQuery Animation Issue on Drawing Multiple Arcs in Canvas
has comment: http://stackoverflow.com/comment/47471183
accepted answer: http://stackoverflow.com/a/29666619
type: Question
has body: I'm trying to create a clock application. I want to animate and draw the arcs on the canvas as they start, but it only draws one of the two arcs I've made. How can I ensure that during the animation both arcs are drawn? I want one mark drawn after another. JSFiddle HTML &lt;canvas id="clock" width="1000" height="500"&gt;&lt;/canvas&gt; CSS body { background: #1A4978; } JS/JQuery var canvas = document.getElementById('clock'); var context = canvas.getContext('2d'); var x = canvas.width/4; var y = canvas.height/2; var radius = 150; var startAngle = 0; var endAngle = 2*Math.PI; var startAnimationDone = false; if (startAnimationDone == true) { var date = new Date(); var year = date.getFullYear(); var month = date.getMonth(); var day = date.getDay(); var hour = date.getHours(); var minute = date.getMinutes(); var second = date.getSeconds(); } function update(start, end) { context.clearRect(0, 0, canvas.width, canvas.height); context.beginPath(); context.strokeStyle = "#FF7519"; context.arc(x , y, radius, start, end); context.lineWidth = 10; context.stroke(); context.closePath(); context.beginPath(); context.strokeStyle = "#FFA319"; radius = 160; context.arc(x , y, radius, start, end); context.lineWidth = 10; context.stroke(); context.closePath(); } $(document).ready(function() { var time = 0; var count = 0; function startAnimation() { if (count &lt;= 2) { time += 0.02; update(0, time*Math.PI); count += 0.02; } } setInterval(startAnimation, 10); startAnimationDone = true; });

http://stackoverflow.com/a/29595660
has body: You can add/remove a custom attribute using jquery to your image to indicate it's active: $(..).attr('c-active', true); will result: &lt;img src=".." c-active/&gt; Setting it to false will remove that attribute. Since the attribute isn't a standard html syntax, some framework / browser might not be happy about it. You can also use jquery data: $(..).data('c-active',true); $(..).data('c-active',false); Or just keep a simple javascript variable to indicate which image id is active (but you will have to update this everytime the image slides) var activeId = 5;
answers question: http://stackoverflow.com/q/29595597
score: 0
type: Answer

http://stackoverflow.com/q/29620471
has answer: http://stackoverflow.com/a/29621868
score: 1
has comment: http://stackoverflow.com/comment/47386884
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29621522
tagged with: jquery
favorite count: 0
has title: How to get original position of an element (DIV) after it's been rotated?
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: For a DIV which has been rotated using CSS transform. I need get original position of an DIV (top, left, bottom, right, width, height) before rotation was applied (look at gray div for an example). http://jsfiddle.net/akycc4t1/7/ I know that I can remove CSS rotation and use Element.getBoundingClientRect(); to get the value, but I was wondering if there is a better approach using math/geometry. My needs is to re-create programmatically a DIV positioned exactly on top of the original one using coordinates relative to the top-left of the viewport. Other methods or idea area also welcome. rotate get coordinate x,y get coordinate as target was not rotated document.getElementById('btn-rotate').addEventListener('click', function (event) { document.getElementById('target').classList.add('rotation'); document.getElementById('example').style.display = ''; }.bind(this)); document.getElementById('btn-coordinate').addEventListener('click', function (event) { alert(JSON.stringify(document.getElementById('target').getBoundingClientRect())); }.bind(this)); document.getElementById('btn-coordinate').addEventListener('click', function (event) { alert(JSON.stringify(document.getElementById('target').getBoundingClientRect())); }.bind(this)); document.getElementById('btn-coordinate-notrotated').addEventListener('click', function (event) { // solution here alert('{top: xxxx,left: xxxx, right: xxxpx, width: 200, height: 200}'); }.bind(this)); #target { position:absolute; top:100px; left:100px; width:200px; height:200px; background-color: cyan; transform-origin: 50% 50% 0; } #trace { position:absolute; top:100px; left:100px; width:200px; height:200px; border: 1px solid darkgray; opacity: 0.1; } #example { position:absolute; top:100px; left:100px; width:5px; height:5px; background-color: red; z-index: 100; } .rotation { -ms-transform: rotate(10deg); -webkit-transform: rotate(10deg); transform: rotate(10deg); }
upvote count: 1
has answer: http://stackoverflow.com/a/29621522
possible better answer: http://stackoverflow.com/a/29621868
type: AnsweredQuestion

http://stackoverflow.com/a/29637749
has body: The problem is that you are binding click event inside the delC function. So the first time you click you just bind events (and then you bind more and more event handlers).. Instead remove delC function and just delegate delete events in the first place: $(document).ready(function () { $(".add").click(function () { var aaa = $(this).parent("div").attr('id') $(this).parent().children(".add").siblings(".name,.detail,.price").clone().appendTo(".CART").wrapAll(' ') $(this).removeClass("add").addClass("added"); $(".dump:last-child").append('x'); $(".dump").removeClass("dump"); }); }) $(document).on('click', '.delC', function () { var xx = $(this).parent("div").attr('class') $("." + xx + "").remove() }); USB USB type1 1500 20 Gr add RAM RAM type1 2000 50 Gr add
downvote count: 0
answers question: http://stackoverflow.com/q/29637645
upvote count: 2
type: Answer
score: 2

http://stackoverflow.com/q/29643749
has title: Visual studio 2015 javascript universal app error
tagged with: javascript
upvote count: 3
answer count: 1
has comment: http://stackoverflow.com/comment/47446485
favorite count: 0
has comment: http://stackoverflow.com/comment/47440850
has body: I have been working on a universal app with JavaScript on visual studio 2015. the application is running fine on Google chrome but when I try to run the .html file from visual studio it gives me this error. Anyone knows how to fix this? Unable to activate Windows Store app 'd12772bf-106e-4601-82de-32ac905cfdda_8wf2pzj3zhqadApp'. The wwahost.exe process started, but the activation request failed with error 'Windows was unable to communicate with the target application. This usually indicates that the target application's process aborted. More information may be available in the Debug pane of the Output window (Debug->Windows->Output)'. See help for advice on troubleshooting the issue.
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/31787718
score: 3
downvote count: 0
tagged with: win-universal-app
tagged with: visual-studio-2015
type: Question

http://stackoverflow.com/comment/47239489
type: QuestionComment
comment on: http://stackoverflow.com/q/29543820
score: 0
has text: You need to define share. Where does this value originate?
type: Comment

iphone
tags question: http://stackoverflow.com/q/29650561
tags question: http://stackoverflow.com/q/29531718
tags question: http://stackoverflow.com/q/29564751
tags question: http://stackoverflow.com/q/29616643
tag name: iphone
tags question: http://stackoverflow.com/q/29567298
type: Tag

http://stackoverflow.com/q/29673199
has body: I'm trying to get Karma to Jamine's ajax.js https://github.com/IDCubed/karma-jasmine-ajax My karma config has: module.exports = function(config) { config.set({ ... frameworks: ['jasmine-ajax', 'jasmine'], }); }; My package.json has: "devDependencies": { "bower": "^1.4.1", "del": "^1.1.1", "gulp": "^3.8.11", "gulp-concat": "^2.5.2", "gulp-karma": "0.0.4", "jasmine-ajax": "^3.1.0", "jasmine-core": "^2.2.0", "karma": "0.12.31", "karma-chrome-launcher": "0.1.7", "karma-cli": "0.0.4", "karma-jasmine": "0.3.5", "karma-jasmine-ajax": "^0.1.12", "karma-junit-reporter": "^0.2.2", "yargs": "^3.7.1" } and my spec is like so: describe("mocking ajax", function() { describe("suite wide usage", function() { beforeEach(function() { jasmine.Ajax.install(); }); afterEach(function() { jasmine.Ajax.uninstall(); }); it('does something', function() { }); }); }); But I have this error: /node_modules/karma/node_modules/di/lib/injector.js:9 throw error('No provider for "' + name + '"!'); ^ Error: No provider for "framework:jasmine-ajax"! (Resolving: framework:jasmine-ajax) I'm obviously missing some plugin or something... but what?
score: 3
has answer: http://stackoverflow.com/a/52842032
type: Question
answer count: 2
tagged with: karma-jasmine-ajax
tagged with: javascript
has title: Karma - Jasmine: Error: No provider for framework:jasmine-ajax
favorite count: 0
upvote count: 3
tagged with: karma-jasmine
tagged with: jasmine
tagged with: karma-runner
has answer: http://stackoverflow.com/a/29929471
downvote count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/29568479
tagged with: timer
has comment: http://stackoverflow.com/comment/47286703
type: Question
has title: JQuery buttons lock for some time
has body: I have some buttons on an HTML webpage. After one being clicked I need the rest to be disabled for 1 min. How can I do this? I also need to show a timer for the minute. How can I do it?
score: 0
accepted answer: http://stackoverflow.com/a/29568716
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47286460
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47286433
has answer: http://stackoverflow.com/a/29568716
tagged with: ajax

http://stackoverflow.com/comment/47421481
has text: First thing `$(this).prev().remove()` are all jQuery functionality. If you're not using jQuery (You haven't tagged your answer or mentioned it) then these functions will not work and the button won't be removed. As for the extra `;=""` try moving the single quote and the semicolon in this line here `"frDelete(\"" + str + "\")\';>"`. You want it to be `"frDelete(\"" + str + "\");'>"`
comment on: http://stackoverflow.com/q/29639771
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/29629815
has title: How to prevent this H2-tag from half disappearing?
answer count: 3
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
tagged with: css
has answer: http://stackoverflow.com/a/29630054
has answer: http://stackoverflow.com/a/29630046
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/3363035
score: 1
has comment: http://stackoverflow.com/comment/47402562
upvote count: 1
possible better answer: http://stackoverflow.com/a/29630046
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29630054
tagged with: jquery
has answer: http://stackoverflow.com/a/29630184
has body: I recently tried to make a smooth front page. You may see what I did in this fiddle. If you click on it, it will open by unfolding. But whenever the animation comes, the tag with BUSINESS PC in it disappears, where it is not covered by . How can I prevent it from doing that? HTML: BUSINESS PC Lorem ipsum dolor sit amet, consetetur sadipscing elitr! sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam Erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. CSS: @import url(http://fonts.googleapis.com/css?family=Open+Sans); body, html { height:100%; padding:0; margin:0; background:#5cafff; font-family:'Open Sans', sans-serif; } .mbox { z-index: 1; margin: 2em; position:relative; background: #ff1a00; background: linear-gradient(to right, #ffffff 33%, #ff1a00 100%); border: 1px solid #fff; height:200px; clear:both; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=90)"; filter: alpha(opacity=90); -moz-opacity: 0.9; -khtml-opacity: 0.9; opacity: 0.9; } .mbox_closed:hover { -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; filter: alpha(opacity=100); -moz-opacity: 1.0; -khtml-opacity: 1.0; opacity: 1.0; -moz-box-shadow: 0px 0px 12px 8px rgb(128,128,128); -webkit-box-shadow: 0px 0px 12px 8px rgb(128,128,128); box-shadow: 0px 0px 12px 8px rgb(128,128,128); } .mbox_active { z-index: 1; margin: 2em; position:relative; background: #ff1a00; background: linear-gradient(to right, #ffffff 33%, #ff1a00 100%); border: 1px solid #fff; height:200px; clear:both; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; filter: alpha(opacity=100); -moz-opacity: 1.0; -khtml-opacity: 1.0; opacity: 1.0; } .mbox * { padding:0; margin:0; } .mbox_content { z-index: 2; float:left; padding: 20px; background: #ffffff; width:60%; height:160px; overflow: hidden; overflow-y: hidden; } .mbox img { z-index:-1; position:absolute; right…

http://stackoverflow.com/comment/47241790
type: Comment
type: QuestionComment
score: 7
has text: In your second example, you're setting `window.onload` to the return value of `my_func()`. Since `my_func` doesn't return anything, `window.onload` is `undefined`.
comment on: http://stackoverflow.com/q/29545130

http://stackoverflow.com/comment/47515632
comment on: http://stackoverflow.com/q/29685610
score: 0
has text: what error's do you get?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47480362
score: 0
comment on: http://stackoverflow.com/q/29671211
type: QuestionComment
type: Comment
has text: How can someone help if you don't post the JS code?

http://stackoverflow.com/a/29682910
upvote count: 1
score: 1
downvote count: 0
type: Answer
has body: Change this $('.fa-star-o').RemoveClass... to this $(this).find('i').RemoveClass...
answers question: http://stackoverflow.com/q/29682790

http://stackoverflow.com/a/29726413
has comment: http://stackoverflow.com/comment/124875831
has comment: http://stackoverflow.com/comment/76404779
has comment: http://stackoverflow.com/comment/73970759
type: AcceptedAnswer
has body: You can use Redirect instead of DefaultRoute <Redirect from="/" to="searchDashboard" /> Update 2019-08-09 to avoid problem with refresh use this instead, thanks to Ogglas <Redirect exact from="/" to="searchDashboard" /> Source: https://stackoverflow.com/a/43958016/3850405
upvote count: 197
score: 195
has comment: http://stackoverflow.com/comment/98426542
type: Answer
accepted answer of: http://stackoverflow.com/q/29552601
has comment: http://stackoverflow.com/comment/75324416
answers question: http://stackoverflow.com/q/29552601
downvote count: 2
has comment: http://stackoverflow.com/comment/98925936
has comment: http://stackoverflow.com/comment/138174175

http://stackoverflow.com/a/29563602
has body: The problem is caused by negative "top" position of .news-list that busts the position of the opened element. -> I update your fiddle: http://jsfiddle.net/pbunz5ue/3/ &lt;- What I've changed the main error: when you calculate the position you've not considered the negative top offset of the news container .news-list when it slide up: I've changed this two lines: var pos = n.position(); $('.news-slider-wrapper').scrollTop(pos.top); in: var pos = n.position().top + parseInt($(".news-list").css("top")) || n.position().top; $('.news-slider-wrapper').scrollTop(pos); If $(".news-list") has top position I add It to the calculation of position (if the result is auto there is a fallback that prevent NaN result || n.position().top) You had duplicated the handler $('.news-read-more').on('click') and $('.news-read-less').on('click'); I deleted those within the function because they seems useless. EDIT:: .on click issue Try this two way to solve your problem: 1. If you have some problem when new item was added into your list try to bind the event to the "items" container .news-list and filter the selector every time it will fire: $('.news-read-more').on('click', function() { //... $('.news-read-less').on('click', function() { //... becomes: $('.news-list').on('click','.news-read-more', function() { //... $('.news-list').on('click','.news-read-less', function() { //... the container .news-list never change during your animation, and DOM manipulation. 2. An other way is to change this rows, in your code: var slide = $('.news-list li:first'); $('.news-list').children('li:first').remove(); $('.news-list ').append(slide); becomes: var slide = $('.news-list li:first'); $('.news-list ').append(slide); or: $('.news-list ').append('.news-list li:first'); if you .remove the element, (I think) you unbind all event because you remove the element from DOM, but you not need to remove you need to move it from top to bottom. This way prevent the unbind of click event. I hope to had understand t…
answers question: http://stackoverflow.com/q/29561999
has comment: http://stackoverflow.com/comment/47346506
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/47298082
score: 1
upvote count: 1

http://stackoverflow.com/comment/47235009
comment on: http://stackoverflow.com/q/29541596
type: Comment
type: QuestionComment
score: 2
has text: Can you use javascripts `.getDay()` function against the dates just before returning them (0 to 6 based); Sunday is 0, Monday is 1, and so on?

http://stackoverflow.com/a/29671104
has comment: http://stackoverflow.com/comment/47480574
accepted answer of: http://stackoverflow.com/q/29670925
type: Answer
answers question: http://stackoverflow.com/q/29670925
has comment: http://stackoverflow.com/comment/47480082
downvote count: 0
score: 1
has body: You are checking the value of (keyCode + 0) against (keyCode >= ASC_ZERO) &amp;&amp; ( keyCode &lt;= ASC_NINE) like in if( (keyCode + 0) == (keyCode &gt;= ASC_ZERO) &amp;&amp; ( keyCode &lt;= ASC_NINE) ) so that's the error.
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/q/29581499
score: 1
has comment: http://stackoverflow.com/comment/47311508
has comment: http://stackoverflow.com/comment/47311653
has comment: http://stackoverflow.com/comment/47311591
has body: I am using mediaelement player and I want to dynamically set current time (from where the song to start from). If I do it like this it works perfectly: mediaElement.setCurrentTime(22); (so the song will start from second 22th). If I want to dynamically set the start from, like: var cur_time = new Date().getTime(); var songToStartFrom = (cur_time - song.startTime) / (1000); mediaElement.setCurrentTime(songToStartFrom ); its going into an infinite loop. (I am very sure that songToStartFrom is fine in seconds) I simply don't understand why it works for static values but for dynamic not? UPDATE: entire code here player = new MediaElementPlayer('#ui_audio', { features: ['playpause'], audioWidth: 30, audioHeight: 30, success: function (mediaElement, domObject) { // Player is ready mediaElement.addEventListener('canplay', function () { var cur_time = new Date().getTime(); console.log("--current time: " + cur_time); console.log("--song time: " + song.startTime); console.log("--media elem time: " + (cur_time - song.startTime) / (1000)); var songToStartFrom = (cur_time - song.startTime) / (1000); console.log("DURATION: " + mediaElement.duration); mediaElement.setCurrentTime(22); mediaElement.play(); }, false); mediaElement.addEventListener('playing', function () { //pushListenerInfo(); }); mediaElement.addEventListener('pause', function () { //removeListenerInfo(); }); mediaElement.addEventListener('ended', function () { //removeListenerInfo(); }); } }); Example of infinite output: listen-moment.js:31 --current time: 1428777176774 listen-moment.js:32 --song time: 1428777166000 listen-moment.js:33 --media elem time: 10.774 listen-moment.js:35 DURATION: 29.875625 listen-moment.js:31 --current time: 1428777176779 listen-moment.js:32 --song time: 1428777166000 listen-moment.js:33 --media elem time: 10.779 listen-moment.js:35 DURATION: 29.875625 listen-moment.js:31 --current time: 1428777176784 listen-moment.js:32 --song time: 1428777166000 listen-moment.js:33 --media elem time: 1…
has comment: http://stackoverflow.com/comment/47311356
has comment: http://stackoverflow.com/comment/47311587
answer count: 1
has comment: http://stackoverflow.com/comment/47311520
tagged with: javascript
has comment: http://stackoverflow.com/comment/47311264
favorite count: 0
has comment: http://stackoverflow.com/comment/47311485
has comment: http://stackoverflow.com/comment/47311656
has comment: http://stackoverflow.com/comment/47311538
has comment: http://stackoverflow.com/comment/47311546
has comment: http://stackoverflow.com/comment/47311380
has title: Why I receive an infinite loop for this code?
upvote count: 3
type: UnansweredQuestion
downvote count: 2
has comment: http://stackoverflow.com/comment/47311437
has answer: http://stackoverflow.com/a/29600155
type: Question
has comment: http://stackoverflow.com/comment/47311295

http://stackoverflow.com/a/29615559
answers question: http://stackoverflow.com/q/29615476
type: Answer
has body: You could accumulate an object to hold the rules you find: var myArray, rules = {}; while ((myArray = styleRe.exec(styleAsDashedStr)) !== null) { console.log(myArray); if (myArray[1] &amp;&amp; myArray[2]) rules[myArray[1]] = myArray[2]; } That way you'd end up with an object that contained all the matched properties. You could simplify your regex too (as in the answer Barmar just gave while I was editing :). edit &mdash; a problem with your pattern is that your "stanzas" both begin and end with a ;. When you match something, the match will involve both the starting semicolon and the one that comes after it. The next match will start after the matched semicolon, so the parts of the patterns that require a leading semicolon will fail.
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29615476

http://stackoverflow.com/comment/47350464
has text: I assume I need an array with the fixed order of "cod_nivel" and use it while ordring but I don't know how to use it so I did not include in my approach.
comment on: http://stackoverflow.com/a/29601828
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/29657067
has comment: http://stackoverflow.com/comment/47454660
has body: Try using stopPropagation: $('.main-navigation-menu').on('click', '.sub-menu-selection', function(e){ var index; e.stopPropagation(); $('.min-navigation-menu .active').removeClass('active'); $(e.currentTarget).addClass('active'); }); More info here
downvote count: 0
has comment: http://stackoverflow.com/comment/47455007
score: 1
has comment: http://stackoverflow.com/comment/47453816
answers question: http://stackoverflow.com/q/29656888
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/47453839

http://stackoverflow.com/a/29614968
score: 3
has body: When an object is created, a link to the prototype is placed on the object itself. When the "prototype" property of the constructor is updated, then subsequently-constructed objects will reference that new object, while the old ones still reference the old prototype object. Since that object is no longer associated with the constructor function, the instanceof test fails. The prototype object on the constructor can be changed internally as desired without breaking the instanceof relationship. That is, properties can be added or removed, and property values can be changed. In modern JavaScript environments, the Object.getPrototypeOf() method can be used to retrieve the prototype object of an instantiated object.
downvote count: 0
answers question: http://stackoverflow.com/q/29614936
type: Answer
upvote count: 3

http://stackoverflow.com/comment/47364161
has text: It has everything to do with it. The OP can use `.txt` `.html` etc. I use it all the time. Sorry, but I don't agree fully with that statement.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29608186

http://stackoverflow.com/q/29571475
upvote count: 1
has comment: http://stackoverflow.com/comment/47292397
type: Question
accepted answer: http://stackoverflow.com/a/29571723
tagged with: arrays
tagged with: javascript
has title: array length returns to 0 in javascript
answer count: 2
has comment: http://stackoverflow.com/comment/47292797
downvote count: 0
possible better answer: http://stackoverflow.com/a/29571660
favorite count: 0
has answer: http://stackoverflow.com/a/29571660
has answer: http://stackoverflow.com/a/29571723
has comment: http://stackoverflow.com/comment/47292753
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47292565
has body: I'm facing really weird behavior of javascript here, so I want to share it with you and maybe someone can explain this. I have xml file that looks something like this (it has 15 elements, but ill paste just 2): 1. row "/images/back.jpg" "/images/back1.jpg" "/images/bg.jpg" Lorem ipsum dolor sit amet, consectetur adipiscing elit. 2. row "/images/back.jpg" "/images/back1.jpg" "/images/bg.jpg" Fusce quam eros, imperdiet a purus id, ullamcorper iaculis est. Maecenas mi nisl, elementum sed ligula et and im parsing it with jquery like this (ill write all source code.): ` var activities=[]; $.ajax({ type: "GET", url: "activities.xml",dataType: "xml", success: function(xml){ $(xml).find('activity').each(function(){ var title = $(this).find('title').text(); var paragraph = $(this).find('paragraph').text(); var images = []; $(this).find('image').each(function(){ images.push($(this).text()); }); activities.push({ "title": title, "paragraph": paragraph, "images": images }); alert(activities.length); // this is where i want to alert size of array (for debugging purposes) }); }, error: function() { alert("Error."); } }); alert(activities.length); // this line prints out size of same array at the end of each loop ` so the output i have is: 1,2,3,4, ..... 14,15,0 ! How the size of array is increasing in the loop and when the loop finish it its 0 ? EDIT: I validated code on jsfiddle and its OK.
score: 1

http://stackoverflow.com/a/29630168
type: Answer
upvote count: 1
score: 1
has body: URL array To load several images enabling CORS request, you can use an array which is practical for this purpose. One thing to be aware of is that requesting CORS can be denied by server. The browser may fail loading the image in those cases so you will need to know in advance if CORS need to be requested or not. Example loader var urls = [url1, url2, url3, ...]; // etc. replace with actual URLs var images = []; // store the loaded images var i = 0, len = urls.length; var count = len; // for load and error handlers for(; i &lt; len; i++) { var img = new Image(); img.onload = loadHandler; img.onerror = img.onabort = errorHandler; img.crossOrigin = ""; // enable CORS request img.src = urls[i]; // set src last images.push(img); // store in array } function loadHandler() { if (!--count) callback(); // loading done } function errorHandler() { // handle errors here loadHandler(); // make sure to update counter/callback } function callback() { // ... ready, continue from here } Demo var urls = [ "http://i.imgur.com/0LINzxs.jpg", // random urls from imgur.. "http://i.imgur.com/6ksiMgS.jpg", "http://i.imgur.com/aGQSLi9.jpg" ]; var images = []; // store the loaded images var i = 0, len = urls.length; var count = len; // for load and error handlers for(; i &lt; len; i++) { var img = new Image(); img.onload = loadHandler; img.onerror = img.onabort = errorHandler; img.crossOrigin = ""; // enable CORS request img.src = urls[i]; // set src last images.push(img); // store in array } function loadHandler() { if (!--count) callback(); // loading done } function errorHandler() { // handle errors here loadHandler(); // make sure to update } function callback() { // ... ready, continue from here console.log(images); var ctx = document.querySelector("canvas").getContext("2d"); ctx.drawImage(images[0], 0, 0); ctx.drawImage(images[1], 0, 0); ctx.drawImage(images[2], 0, 0); console.log(ctx.canvas.toDataURL()); // OK if CORS is OK! } &lt;canvas&gt;&lt;/canvas&gt;
downvote count: 0
answers question: http://stackoverflow.com/q/29629219
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29629219

http://stackoverflow.com/a/29629242
upvote count: 1
score: 1
type: AcceptedAnswer
has body: To specify window.parent.document as the context for the selector to search within, it should be passed as a separate argument after the string. $("[name='PPDGFrame']", window.parent.document) // ^^ Currently, being in the selector, the , is understood as a multiple selector and window.parent.document as an element selector with class selectors searching for: &lt;window class="parent document"&gt; It's a valid selector, which is why you don't receive any errors. It just isn't matching anything either as you probably don't have such an element in your document.
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29628840
answers question: http://stackoverflow.com/q/29628840
type: Answer

http://stackoverflow.com/q/29545130
upvote count: 3
linked to: http://stackoverflow.com/q/20729371
answer count: 1
downvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/29545282
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47241790
has title: JavaScript anonymous function behaviour
linked to: http://stackoverflow.com/q/8227251
has comment: http://stackoverflow.com/comment/47242049
score: 2
has comment: http://stackoverflow.com/comment/47242158
duplicate of: http://stackoverflow.com/q/20729371
type: Question
has body: What is the difference between the following two JavaScript snippet code. They behave differently. window.onload = function() { mainForm.onsubmit = function(e) { alert("Submit"); } } and window.onload = my_func(); function my_func() { mainForm.onsubmit = function (e) { alert("Submit"); } } when the following HTML code is used. Once submit button is pressed I get a message 'Submit' from the first snippet but nothing from the second one. JS Test Thank you in advance.
tagged with: javascript

http://stackoverflow.com/q/29551183
has body: I am pretty new to coding php and javascript but have manged to scrape my way through so far. However, I have hit a wall. I'm not 100% sure that what I'm trying to do can be done, or that I'm even attempting it in an effective way. I have a dynamically filled table, made of rows from a SQL statement using php. On each row is a radio button, each one given a unique value based on the row number (a unique value in one of the database columns). I am attempting to program a button that enables the user to pass a selected radio button value to a separate php enabled page that will allow the user to edit the row information using the unique row value. Also, i used the confirm option, because I would also like to add an if else statement that allows the user to cancel, if the wrong row was selected (I haven't attempted that yet because I haven't been able to get the value to pass). Page button &lt;input type="button" id="edit_order_button" value="Edit Order"&gt;&lt;/input&gt; JQuery page $(document).ready(function(){ $("#edit_order_button").click(function(){ var selected = $("input[name ='order_edit_select']:checked").val(); var r = confirm("Confirm Order Number to edit: " + selected); $.post("php/editOrder.php", { selected1: selected }, function(data,status) { //alert("Data: " + data + "\nStatus: " + status); window.open("php/editOrder.php","Edit Order","menubar=1,resizable=1,width=750,height=600, left=250, top=50"); }); }); }); PHP end destination &lt;?php //Login to database (usually this is stored in a separate php file and included in each file where required) require('config.php'); $selected2= isset($_POST['selected1']) ? $_POST['selected1'] : ''; // Fetching Values from URL echo "Selected Row number is ".$selected2."."; mysqli_close($connection); // Connection Closed. ?&gt; I have tried a few things but have so far been unsuccessful in getting the new window to load with the value of the radio button passed. Currently, the window loads, but the new window only displ…
has comment: http://stackoverflow.com/comment/47253895
tagged with: php
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29551338
tagged with: post
type: Question
has answer: http://stackoverflow.com/a/29551338
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/47253978
tagged with: radio-button
has title: Pass Selected Radio Value to PHP using onclick, then opening php file to use value in SQL query

cors-anywhere
tags question: http://stackoverflow.com/q/29670703
tag name: cors-anywhere
type: Tag

http://stackoverflow.com/a/29679161
has body: Html id must star with a letter http://www.electrictoolbox.com/valid-characters-html-id-attribute/ so you can't do it id='1'
answers question: http://stackoverflow.com/q/29678956
score: 0
type: Answer

http://stackoverflow.com/comment/47497233
type: QuestionComment
comment on: http://stackoverflow.com/q/29679814
has text: You can always just have your controllers inherit directly from the base controller if you so desire.
score: 0
type: Comment

http://stackoverflow.com/a/61902407
type: Answer
downvote count: 1
score: -1
answers question: http://stackoverflow.com/q/29572466
upvote count: 0
has body: functionName() { return new Error().stack.match(/ at (\S+)/g)[1].get(/ at (.+)/); } // Get - extract regex String.prototype.get = function(pattern, defaultValue = "") { if(pattern.test(this)) { var match = this.match(pattern); return match[1] || match[0]; } return defaultValue; // if nothing is found, the answer is known, so it's not null }

postback
tag name: postback
tags question: http://stackoverflow.com/q/29543495
type: Tag

http://stackoverflow.com/comment/47417900
comment on: http://stackoverflow.com/a/29632051
score: 0
type: AnswerComment
type: Comment
has text: When I run this, it successfully removed objects in the 'selectedWorkshops' array. However, it didn't successfully remove the correct items from the 'workshops array'. Instead, the remaining array items are 'apples' and 'oranges', despite oranges also being found in the registered workshops array. Please edit your question to fix this, if you can. Except for it not working, it's the closest thing to a direct answer to my question.

http://stackoverflow.com/comment/47399248
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29627872
has text: Have you considered that this may not be considered a feature by your users? I know it'd irritate me (if I were in the habit of printing things out any more).
score: 0

http://stackoverflow.com/comment/47302857
has text: Are you sure about the bin 511 being 47kHz? I mean, Nyquist theorem should apply here so last bin is half the frequency?
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29576854
type: Comment

http://stackoverflow.com/comment/47215643
comment on: http://stackoverflow.com/q/29531096
score: 0
type: Comment
type: QuestionComment
has text: @downvoter ? why did you downvote me ? did u have a very good reason to do so ??

http://stackoverflow.com/a/29551953
has body: You can use something along the lines of this: $(function() { $("p#timedisp").on('click', function() { //$("a#start").hide(); alert('do hide'); }); }); 120 Sec
score: 0
answers question: http://stackoverflow.com/q/29551904
type: Answer

http://stackoverflow.com/comment/47319263
comment on: http://stackoverflow.com/q/29585401
type: Comment
type: QuestionComment
has text: @zerkms: i wouldn't, the recursive version would be a lot neater...
score: 0

qualtrics
tags question: http://stackoverflow.com/q/29538632
tags question: http://stackoverflow.com/q/29661158
type: Tag
tag name: qualtrics

http://stackoverflow.com/comment/47430321
type: AnswerComment
has text: it's a pleasure, Please mark as answer if it works for you :-)
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29643740

http://stackoverflow.com/comment/47398588
type: QuestionComment
comment on: http://stackoverflow.com/q/29569878
has text: @Amessihel if you look at the code you will see the loop does NOT reference genderS. It references radios which is additional memory, additional CPU, additional code. While it is true that this is trivial it is also true that in my case it is unnecessary. The solution DOES reference the **checked** property but I missed it due to all the other stuff it was doing.
score: 0
type: Comment

http://stackoverflow.com/q/29661862
type: Question
score: 3
has comment: http://stackoverflow.com/comment/47463603
tagged with: http://stackoverflow.com/tag/json
has body: I have a list of json objects, $scope.phones, and a folder full of json files with additional data about each phone. I am trying to iterate through the files to grab additional information to put in my list about each phone: phonecatControllers.controller('PhoneListCtrl', ['$scope', 'Phone', function($scope, Phone) { $scope.phones = Phone.query(); var myTimer = window.setTimeout(function() { for (var i = 0; i &lt; $scope.phones.length; i++){ var weight = 0; Phone.get({phoneId: $scope.phones[i].id}, function( phone) { weight = phone.sizeAndWeight.weight; $scope.phones[i].weight = weight; }); }; } , 1000 ); $scope.orderProp = 'age'; }]); The timer is so that the function doesn't run until after scope.phones is set, (I realize its a bit of a hack but its not causing issues.) I get an error cannot set property of undefined on: $scope.phones[i].weight = weight; If i try to access this outside of the .get method there isn't a problem, however the new value of weight does not exist outside of the get method.
has title: cannot set property of undefined angular js
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: web
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/29669207
tagged with: asynchronous
upvote count: 3
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/750486

http://stackoverflow.com/a/29583817
type: Answer
answers question: http://stackoverflow.com/q/29583563
score: 0
has body: Testing the user agent is more robust than testing the window width. Here's a library than can help you: WURFL.io Just grab the lib to your page and add: if (WURFL.is_mobile) { //add mobiles scripts }

http://stackoverflow.com/comment/47462284
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29661026
has text: When you say it doesn't work, do you have examples that fail the second example? Have you tried replacing `<>` with `!==`? Works in this [fiddle](http://jsfiddle.net/xe0a57n6/2/). You'll want to change the || to an && too. I had to remove the `.value` from `x.value.match()` as I'm using a string in place of the element.

http://stackoverflow.com/q/29666835
answer count: 1
tagged with: angularjs
has body: I'm trying to pass data from an external js file to a directive angular file. Here is what I'm doing. On my external js file: var formatData = { id: 1, state: 'moving' } angular.element(document).scope().$broadcast('sendData', formatData); In my directive: scope.$on('API.sendData', function(formatData) { console.dir(formatData); }); What get's logged: Help?
accepted answer: http://stackoverflow.com/a/29667030
type: AnsweredQuestion
has title: angular broadcast data to directive from external file
type: Question
tagged with: angularjs-directive
tagged with: javascript
has answer: http://stackoverflow.com/a/29667030
has comment: http://stackoverflow.com/comment/47472452
score: 0

http://stackoverflow.com/q/29604673
type: AnsweredQuestion
has title: JavaScript with WebBrowser control C#
has answer: http://stackoverflow.com/a/29708097
type: Question
tagged with: c#
tagged with: javascript
has body: Recently I've been running into issues with the Web-browser control in C#. Navigating to web pages with JavaScript implemented in them makes the WebBrowser crash - It claims there is a syntax error in JS code that is in that webpage. ( It provides the line and what char is the error in so i went to see what caused the error ). example for an error : function validate_fen(fen) { var errors = { 0: 'No errors.', 1: 'FEN string must contain six space-delimited fields.', 2: '6th field (move number) must be a positive integer.', 3: '5th field (half move counter) must be a non-negative integer.', 4: '4th field (en-passant square) is invalid.', 5: '3rd field (castling availability) is invalid.', 6: '2nd field (side to move) is invalid.', 7: '1st field (piece positions) does not contain 8 \'/\'-delimited rows.', 8: '1st field (piece positions) is invalid [consecutive numbers].', 9: '1st field (piece positions) is invalid [invalid piece].', 10: '1st field (piece positions) is invalid [row too large].', }; the line the error is in is 3977 char number 5 or more specifically last line in this code in char 5 ( Which means its probably the last comma , Correct me if I'm wrong ). more specific code for the error: 10: '1st field (piece positions) is invalid [row too large].', }; Given the fact that other browsers do load the website properly including IE ( I'm aware of the fact that the webBrowser and IE aren't the same ) How will I approach to solving these problems? My thoughts were: Fix the script while running ( if possible ) Somehow load the script anyway. I'm not sure but I think the webBrowser control doesn't load the script if there is an error which causes more errors later on. How will I approach on making loading a specific webpage successful? Is it possible to edit the script while in running (The script isn't in the head scetion of the HTML , its on the server)? And if possible , how?
accepted answer: http://stackoverflow.com/a/29708097
score: 0
answer count: 1
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/29552752
tagged with: c#
has body: My JavascriptCode //insert the employee and department record this.insertEmployeeDepartment = function (Employee) { var request = $http({ method: "post", url: "/Employee/InsertEmployeeDepartment", contentType: "application/json", data: JSON.stringify(Employee) }); return request; } EmployeesAPIController.cs using System.Web.Http; namespace EmployeeService { [RoutePrefix("Employee")] public class EmployeesAPIController : ApiController { [HttpPost] [Route("InsertEmployeeDepartment")] public EmployeeDepartment InsertEmployeeAndDepartment([FromBody]EmployeeDepartment emp) { var xx = emp; } } } EmployeeDepartment.cs using System.Collections.Generic; namespace Test { public class EmployeeDepartment { public IEnumerable&lt;Employee&gt; Employees { get; set; } public IEnumerable&lt;Department&gt; Departments { get; set; } } } Models - Employee.cs public class Employee { public int EmployeeId { get; set; } public string EmployeeName { get; set; } public int Age { get; set; } public int Salary { get; set; } public int DepartmentId { get; set; } } Department.cs public class Department { public int Deptid { get; set; } public string Deptname { get; set; } } The array that I am passing from Javascript is as under In the controller method, the value is coming as null? What wrong I am making?
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29552769
score: 0
answer count: 2
tagged with: asp.net-web-api
accepted answer: http://stackoverflow.com/a/29552820
has answer: http://stackoverflow.com/a/29552769
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29552820
has title: How to pass a composite array from Javascript to WEB API controller HttpPOST?
type: Question

http://stackoverflow.com/comment/47336407
type: QuestionComment
has text: When you `return body`, you are returning it to the `function (error, response, body)` callback and not actually to the `getJSON` function
comment on: http://stackoverflow.com/q/29594731
score: 0
type: Comment

http://stackoverflow.com/q/29552588
has answer: http://stackoverflow.com/a/29634436
answer count: 1
has body: This is in reference of the question "reorder list elements - jQuery?" already asked here Now I want to move a little further. What I am wanting to do, I am just wanting to build up a Comparison Product items for an ecommerce. So, here I find the reordering a list item. But I want to add two button in each list item named "Left" and "Right", though here I have shown only one i.e "Right". On clicking the the "Right" button the "data-sortby" value will update to +1 and the list will move right i.e. in the next position and the next positioned list item will reorder to it's previous position. In short side by side movement of li items. So the HTML is below:[just added the buttons] three Right oneRight twoRight fourRight And the script is: $(document).ready(function() { var ul = $('ul#ulName'), li = ul.children('li'); li.detach().sort(function(a,b) { return $(a).data('sortby') - $(b).data('sortby'); }); ul.append(li); $('.rGth').each(function(){ var thisli = $(this); var parent = thisli.parent('li'); var right = parent.data('sortby') + 1; var left = parent.data('sortby') - 1; thisli.click(function(){ //alert(parent.data('sortby')+1); alert(right); alert(left); parent.data('sortby', right); parent.next().data('sortby',left); }); }); }); But what I find that the "data-" attribute is not updating. Can anyone please help me what I am going wrong? I have edited my code. It is giving an alert of the data attribute values but what I see it is not changing. I know I am doing a silly mess. Can anyone please help? Here is the Fiddle
has title: Move a list item from left to right or right to left updating data-attribute
score: 0
has comment: http://stackoverflow.com/comment/47256582
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/3050830
has comment: http://stackoverflow.com/comment/47256561
type: Question
has comment: http://stackoverflow.com/comment/47285423

http://stackoverflow.com/a/29684724
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/29582208
has body: What is the problem? The Chrome and other browsers (not Firefox) problem is: position:absolute; left:0; right:0; top:0; bottom:0; margin:auto; with above CSS the div will shows in center of its parent, and if you see in above code we have left:0 and right:0 and chrome see this code and get one of this and start from left or right with 0 value. so, What is the solution: in jquery there is a function to getting position of an element, just use bellow code: var search_div_top=($("#search-div").offset().top); var search_div_left=($("#search-div").offset().left);
accepted answer of: http://stackoverflow.com/q/29582208
score: 0

http://stackoverflow.com/comment/47365684
has text: The JavaScript syntax is incorrect on your `codeAddress` function.
score: 0
comment on: http://stackoverflow.com/q/29610026
type: QuestionComment
type: Comment

http://stackoverflow.com/a/29614741
has comment: http://stackoverflow.com/comment/47375723
has comment: http://stackoverflow.com/comment/47378351
type: Answer
downvote count: 0
score: 1
has body: I think this should do the trick: function customAlert( content ) { var loaderAlert = $alert({ animation: 'fx-bounce-right', content: content, container: '.alerts-container', type: 'info', show: true }); return loaderAlert; } Еdit: var content = 'loading something else', // choose one of the three choices here loaderAlert = customAlert(content);
has comment: http://stackoverflow.com/comment/47378398
answers question: http://stackoverflow.com/q/29614664
has comment: http://stackoverflow.com/comment/47378430
has comment: http://stackoverflow.com/comment/47378373
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29614664
type: AcceptedAnswer

http://stackoverflow.com/a/29689325
has body: The code is fine. If you are using that code as it is, make sure it's inside the btnHome parent movieclip. That code Will not work if it's on the main timeline or elsewhere. btnHome.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_3); function fl_MouseClickHandler_3(event:MouseEvent):void{ MovieClip(this.parent).gotoAndStop("Menu"); };
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29685610

http://stackoverflow.com/comment/47469906
type: QuestionComment
comment on: http://stackoverflow.com/q/29665387
score: 0
has text: can you provide it in fiddle or plunkr ?
type: Comment

http://stackoverflow.com/comment/47227151
type: QuestionComment
comment on: http://stackoverflow.com/q/29537419
score: 0
has text: why dont you just call a zoom function on each individual rectangle ?
type: Comment

http://stackoverflow.com/a/29623675
has comment: http://stackoverflow.com/comment/47391589
downvote count: 0
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/29623616
has body: You could use blob literals and the hex function to treat blob values as hex strings at the interface between SQL and JavaScript, that works fine.

http://stackoverflow.com/a/30849892
downvote count: 0
has body: The simplest way you can do this is by using the below code: while(blockSetLength--){ //this will change the class of n-1 dom object blockSet[blockSetLength].className='block-selected'; }
answers question: http://stackoverflow.com/q/29587769
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/q/29554509
has comment: http://stackoverflow.com/comment/47260462
score: 0
answer count: 2
upvote count: 1
downvote count: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47260266
has body: I'm new to web development. I've google'd the question and found no result. To begin, consider the following code: Hello World If you have PHP set-up, the following is valid: <?php echo "Hello World";?> Both produces the same result, but what I recall is that PHP codes are executed in the server, thus the following question arise concerning the execution of the code: Is element first retrieved from server, while some background ajax process waits for the "Hello World"? I'd really like to know so I can make a more predictable code. Another possible scenario that bothers me is when using javascript and/or jQuery: $(document).load(function(){ $("#foo").width($("#par").width()); }); which raises the question, does it wait for PHP server requests to finnish or does it just load the page therefore, some code that will need to react to the size of the element above will be a bug? Again, pardon the beginner question.
has comment: http://stackoverflow.com/comment/47260437
has comment: http://stackoverflow.com/comment/47259907
has comment: http://stackoverflow.com/comment/47262755
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has comment: http://stackoverflow.com/comment/47261542
accepted answer: http://stackoverflow.com/a/29554764
has title: What happens when PHP is inlined in html (or other web files)?
has comment: http://stackoverflow.com/comment/47260330
has answer: http://stackoverflow.com/a/29554764
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47260623
possible better answer: http://stackoverflow.com/a/29554791
tagged with: javascript
has answer: http://stackoverflow.com/a/29554791
tagged with: dom
has comment: http://stackoverflow.com/comment/47259838
type: Question

http://stackoverflow.com/comment/82017903
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29652474
score: 0
has text: Work's like a charm!

http://stackoverflow.com/comment/47293384
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29569433
has text: @TobyAllen your guess is true, it's a string. when I tried to set the q to a number, it worked well. I couldn't solve the problem till now, do you have a solution?

http://stackoverflow.com/comment/47490284
type: Comment
has text: Yes, which is exactly the code I've provided. I expect that you've not implemented it correctly, and can't tell me what is borked. In fact, the only solution that is really close to what you want is mine. StopPropagation and preventDefault are fine, aren't going to do much for you here... the issue is an addressing one.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29674728

http://stackoverflow.com/comment/47370545
comment on: http://stackoverflow.com/q/29612368
type: Comment
type: QuestionComment
has text: Your rating table doesn't have a field for which item is being rated?
score: 0

http://stackoverflow.com/a/29673110
has comment: http://stackoverflow.com/comment/47483902
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47484216
answers question: http://stackoverflow.com/q/29672954
has body: 100 items should not be a problem for ng-repeat, but that depends on how your page completely looks. ng-repeat creates lot's of watches which make angular's dirty check (digest process) longer. Usually, you use ng-repeat in order to show data and not to create inputs and therefore you don't really need a two way binding (A one way will be enough). So bindonce is a nice library that can help cut the not-needed watches. Instead of doing something like this: You should do something like this:
has comment: http://stackoverflow.com/comment/47484022
has comment: http://stackoverflow.com/comment/47531107
downvote count: 0

http://stackoverflow.com/comment/47449180
has text: I can, but you need to update your question with your HTML form that is providing the data. Then I will be able to update the answer.
type: AnswerComment
comment on: http://stackoverflow.com/a/29652773
score: 0
type: Comment

http://stackoverflow.com/a/29658936
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/29658839
type: Answer
has body: The purpose of the isNaN function is to check if a value is exactly equal to the built-in NaN constant value. It shouldn't be used to check if something is a number or not, even if that might seem counter-intuitive. It only exists because NaN === NaN returns false, so it's the only way to check if a function involving numbers failed.
score: 1

http://stackoverflow.com/q/29606294
answer count: 1
has comment: http://stackoverflow.com/comment/47358421
has title: jQuery help for slideshow: adding a div for box-shadow effects has jQuery selecting the div
tagged with: jquery
has comment: http://stackoverflow.com/comment/47358855
has body: So I used this place to help me create a slideshow, however, thanks to certain limits of CSS, you can't set a box-shadow property to IMG. However, the issue is thanks to the nature of the script, once it's done running through the IMGs, it encounters the div. The script is not supposed to encounter the div as the div is only used for decoration (again, since box-shadow can't be used for IMG). I was hoping someone would be able to help me with the formating of the code so as to ignore the #slideshadow div. HTML (edited with replacement pictures, thanks to CSS, the dimensions were necessary): &lt;div id="slideshow"&gt; &lt;img class="active" src="http://i.imgur.com/pPPkQDZ.jpg" alt="" /&gt; &lt;img src="http://i.imgur.com/Axp8aGT.jpg" alt="" /&gt; &lt;img src="http://i.imgur.com/UMpQ9eh.jpg" alt="" /&gt; &lt;div id="slideshadow"&gt;&amp;nbsp;&lt;/div&gt; &lt;/div&gt; CSS: #slideshadow { position: absolute; height:455px; width: 750px; box-shadow: inset 0px 0px 80px 0px rgba(0,0,0,0.75); border-top-left-radius: 25px; border-bottom-left-radius: 25px; border-left: 5px groove #990000; z-index: 15; } #slideshow { position:relative; height:455px; width: 750px; float: left; } #slideshow IMG { position:absolute; top:0; left:0; z-index:8; opacity:0.0; border-top-left-radius: 25px; border-bottom-left-radius: 25px; border-left: 5px groove #990000; } #slideshow IMG.active { z-index:10; opacity:1.0; } #slideshow IMG.last-active { z-index:9; } SCRIPT: function slideSwitch() { var $active = $('#slideshow IMG.active'); if ( $active.length == 0 ) $active = $('#slideshow IMG:last'); var $next = $active.next().length ? $active.next() : $('#slideshow IMG:first'); $active.addClass('last-active'); $next.css({opacity: 0.0}) .addClass('active') .animate({opacity: 1.0}, 1000, function() { $active.removeClass('active last-active'); }); } $(function() { setInterval(slideSwitch, 3000 ); });
tagged with: box-shadow
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29606781
accepted answer: http://stackoverflow.com/a/29606781
has comment: http://stackoverflow.com/comment/47358320
type: Question
tagged with: addclass
tagged with: javascript
score: 0

http://stackoverflow.com/a/29551403
has comment: http://stackoverflow.com/comment/47254296
type: Answer
upvote count: 2
has comment: http://stackoverflow.com/comment/47254282
score: 2
has comment: http://stackoverflow.com/comment/47254213
downvote count: 0
answers question: http://stackoverflow.com/q/29551073
has body: If you are trying to run it every 10th of a second, could your problem be that your initial speed is set to 10? 1000 ms = 1 second, so 10 / 1000 = 1 / 100th of a second. Also, the getTime function returns a Unix time stamp. Dividing that by speed doesn't make much sense unless you record the previous time stamp, subtract the current time stamp and adjust speed for any offset in execution time.

http://stackoverflow.com/comment/47338436
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29595302
has text: @SamarpanDas: Here is the documentation: https://developer.mozilla.org/en-US/docs/Web/API/Console/log and searching for [browser console](https://www.google.se/search?q=browser+console) gives you descriptions for different browsers and other tips.
type: AnswerComment

http://stackoverflow.com/q/29611319
type: UnansweredQuestion
score: 3
answer count: 0
downvote count: 0
tagged with: unit-testing
type: Question
tagged with: javascript
upvote count: 3
has title: JS Unit Testing with
has body: I'm using Jasmine and have run into a scenario which requires me to interact with: &lt;input type='file'/&gt; Most of my interaction lies within the 'onChange' event. This app does some pre-processing of a CSV file before I upload to the server. I'm able to mock / stub out most things (file size, file extension, headers, etc.), however I'd love to be able to actually stub out an actual file and run a test against that. Is this possible / makes sense for js unit testing? I realize that this can be done within integration testing (cucumber / selenium tests) however if I could do it within jasmine, that would give me a bit more piece of mind.
tagged with: jasmine
favorite count: 0

http://stackoverflow.com/q/29673121
type: Question
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47490801
tagged with: asp.net
favorite count: 0
linked to: http://stackoverflow.com/q/6873973
has comment: http://stackoverflow.com/comment/47490892
has comment: http://stackoverflow.com/comment/47484292
answer count: 0
has body: In my website, once an application is submitted. The complete application gets disabled, but when i click on Delete link button in gridview, it is firing onClientClick() event, even it is also disabled. I want to stop/disable onclientclick() event of linkbutton in gridview when gridview is disabled?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47619612
upvote count: 1
has comment: http://stackoverflow.com/comment/47484220
has comment: http://stackoverflow.com/comment/47490691
tagged with: c#
duplicate of: http://stackoverflow.com/q/9682833
has title: how to stop/disable onclientclick() event of linkbutton in gridview when gridview is disabled?(Its not normal link button, it is in gridview)
score: 1
linked to: http://stackoverflow.com/q/9682833

http://stackoverflow.com/comment/47272624
type: Comment
has text: Try asp.net webform. I have given both options read it carefully
comment on: http://stackoverflow.com/a/29560826
score: 1
type: AnswerComment

http://stackoverflow.com/comment/47484292
comment on: http://stackoverflow.com/q/29673121
has text: @ Anil Kumar- we are disabling it from server side.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/29672205
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29672038
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29672038
type: Answer
has body: you can do this: $('#openModal').keydown(function(e) { if(e.which == 13 || e.keyCode == 13) { var text = $('#tb1').val(); $('.close').trigger('click'); $('#tb2').val(text); } });

security
tags question: http://stackoverflow.com/q/29587768
tags question: http://stackoverflow.com/q/29598160
tags question: http://stackoverflow.com/q/29653623
tags question: http://stackoverflow.com/q/29561911
tags question: http://stackoverflow.com/q/29591805
tags question: http://stackoverflow.com/q/29669479
tags question: http://stackoverflow.com/q/29595474
tags question: http://stackoverflow.com/q/29687491
type: Tag
tag name: security

http://stackoverflow.com/comment/47402674
type: QuestionComment
has text: The question doesn't show any work on the part of the OP, it doesn't ask a specific question about a specific problem and any answers would be purely opinion based, hence the downvotes.
comment on: http://stackoverflow.com/q/29629771
score: 4
type: Comment

http://stackoverflow.com/comment/47343637
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29594786
has text: How if you call this function again after successful ajax call?

http://stackoverflow.com/comment/47246671
type: AnswerComment
has text: that's the point, that's why the title says "as is", this validation is defined by power users, and has to be pure JS-compliant
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29546208

http://stackoverflow.com/a/29535300
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/29532147
downvote count: 0
has body: var val = [5, 41, 96, 101, 103, 158, 201, 214, 216, 217, 320, 1201, 1213, 1214, 1216, 1217, 1320], delta = Array.apply(null, { length: val.length }).map(function () { return 0 }), result, threshold = 5, converged = false; document.write('val: ' + val + '&lt;br&gt;'); while (!converged) { converged = true; delta = delta.map(function (d, i) { if (i &lt; delta.length - 1 &amp;&amp; delta.length &gt; 1) { if (val[i + 1] + delta[i + 1] - val[i] - d &lt; threshold) { converged = false; delta[i + 1] += 1; return d - 1; } } return d; }); document.write('delta: ' + delta + '&lt;br&gt;'); } result = val.map(function (v, i) { return v + delta[i]; }); document.write('result: ' + result + '&lt;br&gt;'); // try to minimise difference converged = false; while (!converged) { converged = true; delta = delta.map(function (d, i) { if (i &lt; delta.length - 2) { var space = val[i + 1] + delta[i + 1] - val[i] - d; if (d &lt; 0 &amp;&amp; space &gt; threshold) { converged = false; return d + space - threshold; } } return d; }); document.write('delta min: ' + delta + '&lt;br&gt;'); } result = val.map(function (v, i) { return v + delta[i]; }); document.write('result: ' + result + '&lt;br&gt;'); the code pushes two too close couples appart with one on each side. this is symetrically and results in sometimes to far pushed values, which can be corrected. [not implemented!] if the space of your values is not sufficient, [0..360[ or by more then 72 elements with a difference of 5 the the while loop may not come to an end. edit: the minimise block should iterate until all values are correted.
type: Answer

http://stackoverflow.com/comment/47410807
type: QuestionComment
has text: Where do you suppose the information to do something like that might come from? Does any website you're familiar with publish a complete map of available URLs?
type: Comment
comment on: http://stackoverflow.com/q/29634157
score: 0

http://stackoverflow.com/comment/134241360
type: Comment
has text: Thanks @Graham. if anyone is using this for a specific project, install library to the project and add this line to package.json scripts, `"cors": "node node_modules/cors-anywhere/server.js"`. Then execute `npm run cors` command
comment on: http://stackoverflow.com/a/41137337
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47289111
comment on: http://stackoverflow.com/q/29569782
type: Comment
type: QuestionComment
has text: you mean this? this.sendMessage = function(title, message){ $(".top-message").show(); $(".top-message>h1").first().html(title); $(".top-message>p").first().html(message); this.title = title; this.message = message;
score: 0

http://stackoverflow.com/a/29540733
score: 0
type: Answer
has body: If you want to add file to assembly, you should add it to resource file. But is it real need to embed script to the resource of assembly? Since your application uses asp.net you can just copy this script to specified folder and configure your script manager to handle it.
answers question: http://stackoverflow.com/q/29540534
has comment: http://stackoverflow.com/comment/47236604

http://stackoverflow.com/comment/47399047
comment on: http://stackoverflow.com/q/29627903
has text: I can't see you are using .on to bind the events!!
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47403309
type: QuestionComment
has text: thanks for the comments. accidentally submitted.. editing.. casper.exists('[data-js="company-search-view-jobs-button-reg"]') returns true. adding those event listeners, i see "error: TypeError: 'undefined' is not a function (evaluating 'this.hideOnClickAway.bind(this)')", which looks promising. i don't see an error like that in the chrome console, and i'm not sure why that's happening when the page loads.
comment on: http://stackoverflow.com/q/29616350
score: 0
type: Comment

http://stackoverflow.com/q/29613743
has title: BackboneJS: Avoid calling _.bind()
has body: I am using the BackboneJS framework and run into a situation whereby I have to constantly wrap my functions into _.bind() to keep this in the right scope. An example would be a simple AJAX call. JQuery by default changes this to the AJAX Request object, but I want to keep my view as this: var AwesomeView = BackboneView.extend({ firstFunction : function() { $.getJSON( "/test", {}, _.bind(function(aData) { this.secondFunction(aData); }, this) ) } , secondFunction : function(aData) { console.log(aData) } }); I have plenty of examples throughout my codebase of this occuring and it works, but seems kind of hacked. So my question is, is there a more elegant way of solving this?
tagged with: javascript
tagged with: scope
score: 0
has answer: http://stackoverflow.com/a/29614049
accepted answer: http://stackoverflow.com/a/29614049
answer count: 1
tagged with: backbone.js
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/47453476
comment on: http://stackoverflow.com/a/29656749
type: Comment
has text: I mean, I see your point. Is `addListener` even guaranteed to run before a message is sent?
type: AnswerComment
score: 0

http://stackoverflow.com/a/29631144
type: Answer
answers question: http://stackoverflow.com/q/29599954
score: 0
has body: I have basically created a diagram where it stores temperature values. Everything works great, the only problem is that the x-axis does not go out from the frame. I want the x-axis to move with the data. Like the link below. Here is the example! This is the code, I have hidden the IP for security reasons. What shall I implement in order to make the x-axis move with the data? &lt;script type="text/javascript"&gt; window.onload = function () { var dps = []; // dataPoints // Connect to the server. var server_url = "ws://"; var ip = 'xxx.xxx.x.xx'; server_url = server_url.concat(ip,":8081/osc") ws = new WebSocket(server_url); var chart = new CanvasJS.Chart("chartContainer",{ title :{ text: "Temp Bank Sensor 1 - (TBS1)" }, data: [{ type: "splineArea", color: "rgba(255, 0, 29, 0.79)", dataPoints: dps }] }); var xVal = 0; var yVal = 100; var updateInterval = 20; var dataLength = 500; // number of dataPoints visible at any point ws.onmessage = function(evt) { var point = evt.data.split(","); dps.push({ x: xVal, y: parseInt( point[1] ) }); xVal++; if (dps.length &gt; dataLength){ dps.shift(); } chart.render(); } // end method ws.onmessage // generates first set of dataPoints updateChart(dataLength); // update chart after specified time. setInterval(function(){updateChart()}, updateInterval); }; // end method window.onload &lt;/script&gt;

http://stackoverflow.com/a/34909676
answers question: http://stackoverflow.com/q/29655780
upvote count: 2
downvote count: 0
has body: Try: %start program %% /* language grammar */ program : EOF { return []; } | statements EOF { return $1; } ; statements : statement { $$ = [$1]; } | statements statement { $1.push($2); $$ = $1; } ; Also, replace the returns with "$$ = " statement : assign NL { $$ = $1; } ; assign : IDENTIFIER ASSIGN expression { $$ = ['assign', $1, $3]; } | IDENTIFIER REACT expression { $$ = ['react', $1, $2, $3]; } ; expression : NUMBER { $$ = $1; } | IDENTIFIER {/*add something here like $$ = $1 to keep the original value*/} ;
type: Answer
score: 2

http://stackoverflow.com/comment/47389199
comment on: http://stackoverflow.com/q/29622517
type: QuestionComment
type: Comment
score: 1
has text: If you are going to use jQuery, then please also use it for event registration. Inline `onclick` handlers separate the handler from the code for no good reason. jQuery handlers provide additional features as well. For dynamically created elements, use a delegated event handler (e.g. using `on` with a jQuery selector).

http://stackoverflow.com/comment/47476433
type: Comment
has text: Did the "alert" on the value, you right, it returned the element, after your change returned nothing, what could be a reason ?
comment on: http://stackoverflow.com/a/29668995
type: AnswerComment
score: 0

http://stackoverflow.com/comment/137114458
has text: Is it ok that `similar( [1,1,2,3], [1,2,2,3] );` returns `true`? If the expectation is that the elements can be different orders, but otherwise match one-for-one, then this would be an unexpected result.
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/69613841

http://stackoverflow.com/comment/47479615
score: 0
type: AnswerComment
has text: Can you update your demo, so I can try more things on it with firebug/ Chrome inspector ?
type: Comment
comment on: http://stackoverflow.com/a/29670699

http://stackoverflow.com/a/29544045
has body: I assume you have table element in html code. Lets say its id is chatTable. add following before for loop document.getElementById("chatTable").innerHTML = ""; I think this should work.
upvote count: 1
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/29543563
score: 1

http://stackoverflow.com/a/29667718
has body: So I am glad to tell you that your script is just working fine. I tested it and here are the results. Now the issue, as per my thinking is that you might have kept the script on the top section of your page. Meaning it is kept somewhere before the TextBox code is declared. Try putting the script at the bottom of your page. After body or anywhere you like, but it should be near the ending. That might help. Hope this helps.
score: 0
answers question: http://stackoverflow.com/q/29666492
type: Answer
has comment: http://stackoverflow.com/comment/47490827
has comment: http://stackoverflow.com/comment/47479920
has comment: http://stackoverflow.com/comment/47487052
has comment: http://stackoverflow.com/comment/47479658

http://stackoverflow.com/q/29639665
score: 0
has title: Passing variable into named callback
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29639689
has body: OK, let's keep it simple, I have the following : function loopDaLoop(){ for (var i = 0; i &lt; tempItemsLength; i++) { var product = tempItems[i]; dust.render('product', product, addProductOrFinish); } } and i'd like to get the current value of i inside my callback function function addProductOrFinish(err, out) { console.log(i); // undefined } I do know it's simple, really I do... Help? Edit : I know I'm supposed to use a closure so I tried and failed with this : (function(i){ dust.render('product', product, addProductOrFinish); };(i)
answer count: 1
tagged with: callback
accepted answer: http://stackoverflow.com/a/29639689
has comment: http://stackoverflow.com/comment/47421263
type: AnsweredQuestion

http://stackoverflow.com/a/29619533
score: 1
has comment: http://stackoverflow.com/comment/47383460
downvote count: 0
has body: You should pass this as function parameter Aaj Tak ................... function CheckSiteAvailabilty(website, message, element) { alert(element); //$(this) change the current element ie li css }
answers question: http://stackoverflow.com/q/29619473
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/47383450

http://stackoverflow.com/comment/47353586
comment on: http://stackoverflow.com/q/29603804
type: QuestionComment
type: Comment
has text: @BoltClock ah I see now.. is there any solution that could you provide about this ?
score: 0

http://stackoverflow.com/a/29609669
has comment: http://stackoverflow.com/comment/47365802
has comment: http://stackoverflow.com/comment/47367055
has comment: http://stackoverflow.com/comment/47365918
has comment: http://stackoverflow.com/comment/47365866
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/47365686
accepted answer of: http://stackoverflow.com/q/29608902
answers question: http://stackoverflow.com/q/29608902
has comment: http://stackoverflow.com/comment/47366136
has comment: http://stackoverflow.com/comment/47367003
type: AcceptedAnswer
has body: $(document).ready(function() { /* $("ul.nav#menu li ").click(function() { $(this).toggleClass("toggle-button-on").find(".fa-3x").removeClass("fa-3x").addClass("fa-lg"); }); */ $(".nav#menu ").on("click", ".toggle-button-on", function() { $(".toggle-button-on").toggleClass("toggle-button-on toggle-button-off"); $(".nav .fa-3x").toggleClass("fa-3x fa-lg"); $(".nav#menu .toggle-button").toggleClass("nav-slim"); $(".nav#menu li a i").css({ 'font-size': '16px', 'line-height': '100px' }); $(".nav#menu span").hide(); $("#menu .navbar-side").css("width", "64px"); $("#menu").css("width", "64px"); $("#content-panel ").css("margin-left", "100px"); $(this).removeAttr("data-original-title"); // }); }); $(".nav#menu").on("click", ".toggle-button-off", function() { $(".toggle-button-off").toggleClass("toggle-button-off toggle-button-on"); $(".nav .fa-lg").toggleClass("fa-lg fa-3x"); $(".nav#menu span").show(); $(".nav#menu li a i").css({ 'font-size': '3em', 'line-height': '' }); $("#menu .navbar-side").css("width", ""); $("#menu").css("width", ""); $("#content-panel ").css("margin-left", ""); }); }) toggle-button-on Home Work Music Faq
score: 0
type: Answer

http://stackoverflow.com/comment/47283262
comment on: http://stackoverflow.com/a/29566856
type: AnswerComment
has text: @robertklep Right -- this accomplishes what OP wanted in terms of not having to involve the view class in the test.
score: 0
type: Comment

http://stackoverflow.com/comment/47405155
has text: note that `return this.constructor.parent` isn't a statement on it's own, instead `this.constructor.parent` is the condition in the [ternary (`?:`) operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator).
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29631158
type: Comment

http://stackoverflow.com/a/29664416
upvote count: 1
has comment: http://stackoverflow.com/comment/47468877
has comment: http://stackoverflow.com/comment/47468398
has comment: http://stackoverflow.com/comment/47468602
has comment: http://stackoverflow.com/comment/47468340
answers question: http://stackoverflow.com/q/29664182
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47468194
type: Answer
has comment: http://stackoverflow.com/comment/47468921
has comment: http://stackoverflow.com/comment/47468838
has comment: http://stackoverflow.com/comment/47468732
has body: You can use the "each" jQuery function, which will check every inputs of the checkbox type on the page. So, you simple get it's name, if it's "room[]", add the custom-checkbox-big-size class to the span wrap, if it's name is "request[]", add the custom-checkbox-small-size class to the span wrap (I changed your CSS to make the things simple). JS: var wrapSpan = $('&lt;span class="custom-checkbox-span"&lt;/span&gt;'); $('input:checkbox').each(function() { if ($(this).is(':checked')) { wrapSpanspan.addClass('checked'); } if($(this).attr("name") == "room[]") { wrapSpan.addClass("custom-checkbox-big-size"); } if($(this).attr("name") == "request[]") { wrapSpan.addClass("custom-checkbox-small-size"); } $(this).wrap(wrapSpan).hide(); }); $(".custom-checkbox-span").on("mouseup",function(){ checkSpan($(this)); }); function checkSpan(el) { if(el.hasClass("selected")) { el.removeClass("selected"); el.children().prop("checked",false); } else { el.addClass("selected"); el.children().prop("checked",true); } } CSS: .custom-checkbox-big-size { background:red; width: 50px; height: 50px; display: inline-block; } .custom-checkbox-big-size:hover, .custom-checkbox-big-size.selected { background:yellow; } .custom-checkbox-small-size { background:blue; width: 20px; height: 20px; display: inline-block; } .custom-checkbox-small-size:hover, .custom-checkbox-small-size.selected { background:green; } Check the jsFiddle. I did it with colors, because I don't have your original images, you have to change the background: color; rules.
score: 1
accepted answer of: http://stackoverflow.com/q/29664182
has comment: http://stackoverflow.com/comment/47468563

http://stackoverflow.com/a/29675896
score: 4
upvote count: 4
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29675312
has comment: http://stackoverflow.com/comment/47489522
has body: Javascript objects like this do not support order, this is expected behavior. You can use some simple methods to extract the keys list from this and sort that. Then use the sorted list to do what you need. var keys = Object.keys(obj3).sort(); for (var i = 0; i &lt; keys.length; i++) { console.log(keys[i]); $("#code_list1").append(obj3[keys[i]]); } http://jsfiddle.net/rmvoz6av/3/ As Robert suggested I changed this to Object.keys(), although some older IE browsers won't support this.
has comment: http://stackoverflow.com/comment/47518904

http://stackoverflow.com/comment/47222306
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29534463
has text: Can you create a http://jsfiddle.net/ ?
score: 0

http://stackoverflow.com/comment/65753589
type: AnswerComment
has text: Doesn't seem to work with Select2 v4. The input added to the end of the DOM when the dropdown opens
type: Comment
comment on: http://stackoverflow.com/a/29573865
score: 0

macos
tags question: http://stackoverflow.com/q/29581621
tags question: http://stackoverflow.com/q/29628235
type: Tag
tags question: http://stackoverflow.com/q/29659974
tag name: macos

http://stackoverflow.com/comment/47343449
type: QuestionComment
comment on: http://stackoverflow.com/q/29598229
score: 0
has text: And, I am also spending effort to help educate you on how this site works so you can more successfully use it in the future by both asking questions and by hopefully answering questions too. This should help you get the most out of this site and help contribute to making StackOverflow a more valuable resource.
type: Comment

http://stackoverflow.com/comment/47436862
type: Comment
type: QuestionComment
score: 2
has text: JSON.parse(localstorage.key)?
comment on: http://stackoverflow.com/q/29637026

http://stackoverflow.com/q/29549353
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/30568798
has body: I am loading a html page having kaltura player embed code in jquery using the jquery.load(). The idea is to load the video in the div tag through javascript on the page. Code in aspx page <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %> <asp:LinkButton ID="lb" runat="server" ClientIDMode="AutoID" Text="test" ></asp:LinkButton> Test.html file Calling function test() from aspx.cs file protected void Page_Load(object sender, EventArgs e) { lb.OnClientClick = "return test()"; } Error when i click on button to load the kaltura video in the div(id='light') Microsoft JScript runtime error: 'kWidget' is undefined Please let me know if we need to include any file or api to overcome this error. Thanks.
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
tagged with: kaltura
has title: jquery load function with kwidget (kaltura player)

android
tags question: http://stackoverflow.com/q/29558435
tags question: http://stackoverflow.com/q/29604454
tags question: http://stackoverflow.com/q/29642019
tags question: http://stackoverflow.com/q/29568433
tags question: http://stackoverflow.com/q/29686831
tags question: http://stackoverflow.com/q/29621402
tags question: http://stackoverflow.com/q/29676769
tags question: http://stackoverflow.com/q/29674435
tags question: http://stackoverflow.com/q/29629459
tags question: http://stackoverflow.com/q/29609379
tags question: http://stackoverflow.com/q/29673545
tags question: http://stackoverflow.com/q/29598220
tags question: http://stackoverflow.com/q/29603629
tags question: http://stackoverflow.com/q/29565724
tags question: http://stackoverflow.com/q/29605865
tags question: http://stackoverflow.com/q/29550746
tags question: http://stackoverflow.com/q/29606003
tags question: http://stackoverflow.com/q/29664948
tags question: http://stackoverflow.com/q/29611821
tags question: http://stackoverflow.com/q/29666227
tags question: http://stackoverflow.com/q/29673691
tags question: http://stackoverflow.com/q/29609941
tags question: http://stackoverflow.com/q/29664254
tags question: http://stackoverflow.com/q/29653288
tags question: http://stackoverflow.com/q/29660098
tags question: http://stackoverflow.com/q/29538175
tags question: http://stackoverflow.com/q/29624801
tags question: http://stackoverflow.com/q/29670156
tags question: http://stackoverflow.com/q/29632141
tags question: http://stackoverflow.com/q/29580172
tags question: http://stackoverflow.com/q/29600192
tags question: http://stackoverflow.com/q/29670700
tags question: http://stackoverflow.com/q/29564751
tags question: http://stackoverflow.com/q/29656179
tags question: http://stackoverflow.com/q/29616643
tags question: http://stackoverflow.com/q/29671065
tags question: http://stackoverflow.com/q/29642573
tags question: http://stackoverflow.com/q/29531676
tags question: http://stackoverflow.com/q/29626232
tags question: http://stackoverflow.com/q/29608527
tags question: http://stackoverflow.com/q/29535200
tags question: http://stackoverflow.com/q/29559393
tag name: android
tags question: http://stackoverflow.com/q/29596982
type: Tag
tags question: http://stackoverflow.com/q/29682574
tags question: http://stackoverflow.com/q/29646366
tags question: http://stackoverflow.com/q/29579584
tags question: http://stackoverflow.com/q/29672772

http://stackoverflow.com/a/29535464
has comment: http://stackoverflow.com/comment/49438927
has comment: http://stackoverflow.com/comment/49409487
downvote count: 0
has body: I'm pretty sure you can't. I'm validating the coupon via ajax, and make a server side call to Stripe. You can then apply the coupon to any purchase transactions on the server side when you accept the POST.
type: Answer
score: 2
answers question: http://stackoverflow.com/q/29532318
upvote count: 2

http://stackoverflow.com/comment/47453184
score: 0
has text: I really think I'll go with this solution. I also took a look at your Rangy lib and it's really impressive, so props to you and thank you!
type: AnswerComment
comment on: http://stackoverflow.com/a/29646011
type: Comment

http://stackoverflow.com/a/29558099
has comment: http://stackoverflow.com/comment/47266647
downvote count: 0
has comment: http://stackoverflow.com/comment/47270773
score: 1
accepted answer of: http://stackoverflow.com/q/29557236
has comment: http://stackoverflow.com/comment/47269747
has comment: http://stackoverflow.com/comment/47357781
has comment: http://stackoverflow.com/comment/47357007
upvote count: 1
has comment: http://stackoverflow.com/comment/47269435
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47358847
type: Answer
answers question: http://stackoverflow.com/q/29557236
has body: Using jquery 1.7 version i have implemented what you require using .live() function and on the change event of unitcost text box: $("input[name^=delivery],input[name^=quantity], input[name^=unitcost]").live("input change", function(){ $("input[name^=unitcost]").trigger("keyup"); }); $("input[name^=unitcost]").live("keyup", function(){ var unitcost = $(this).val()=="" ? 0 : $(this).val(); var delivery = $(this).closest("td").siblings().find("input[name^=delivery]").val(); var quantity = $(this).closest("td").siblings().find("input[name^=quantity]").val(); var total = eval(quantity * unitcost) +parseInt(delivery); $(this).closest("td").siblings().find("input[name^=totalcost]").attr("disabled",false); $(this).closest("td").siblings().find("input[name^=totalcost]").val(total.toFixed(2)); $(this).closest("td").siblings().find("input[name^=totalcost]").attr("disabled",true); }); }); Updated Fiddle If you have any doubts please ask.

opencv
type: Tag
tags question: http://stackoverflow.com/q/29537155
tag name: opencv

http://stackoverflow.com/q/29626548
has title: Push data into a certain position in an array
favorite count: 0
has answer: http://stackoverflow.com/a/29626578
upvote count: 6
linked to: http://stackoverflow.com/q/586182
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/8754508
duplicate of: http://stackoverflow.com/q/586182
downvote count: 2
type: Question
accepted answer: http://stackoverflow.com/a/29626578
tagged with: javascript
tagged with: jquery
score: 4
duplicate of: http://stackoverflow.com/q/8754508
has body: How do I push some data into a certain place in an array? I am trying the code below: Keys[1].push({ Keys: "Test" }); But it doesn't seem to work as expected
answer count: 1

http://stackoverflow.com/comment/47262181
type: Comment
comment on: http://stackoverflow.com/q/29553196
score: 1
has text: That's not a good question for StackOverflow, because your question doesn't contain everything to help you and I doubt it is possible to edit your question into shape.
type: QuestionComment

http://stackoverflow.com/a/29541569
type: Answer
answers question: http://stackoverflow.com/q/29541506
accepted answer of: http://stackoverflow.com/q/29541506
type: AcceptedAnswer
downvote count: 0
has body: What's happening here is that you're binding a function to the 'resize' and 'load' events of the window, though you're trying to log the value of ww before either of those events have been fired. Know that the window.onload event is only called once the entire page has been loaded and ready to be manipulated with Javascript. Doing anything before this event is fired means that you're executing it as soon as the script itself is loaded(when the script tag or file is reached), though any elements you might try to access might not themselves have been loaded. Since neither of the events have been fired, ww will have no value since you don't initialize it to anything when you do var ww;. What you need to do is log the value of ww inside the event handler, like this: var ww; $(window).on('resize load', function() { ww = $(window).width(); console.log(ww); }); This causes the event handler to be called once the page has loaded and also every time the page is resized, meaning that ww will be set to $(window).width();.
score: 2
upvote count: 2

http://stackoverflow.com/a/29680161
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29676578
has body: Well I figured it out... all I had to do was change this $('#emp_id').change(function () { to this $('#emp_id').blur(function () { a

http://stackoverflow.com/a/72420204
has body: It's can happen if : Element not found DOM is loading (check first with document.readyState see this https://stackoverflow.com/a/39993724/14809952). Other, comment if you know, it will help to improve this answer :)
answers question: http://stackoverflow.com/q/29606787
score: 0
type: Answer

http://stackoverflow.com/comment/47324421
comment on: http://stackoverflow.com/a/29588506
type: Comment
has text: Well, actually its not an array but a HTMLCollection. See more at http://stackoverflow.com/questions/15763358/difference-between-htmlcollection-nodelists-and-arrays-of-objects
score: 0
type: AnswerComment

http://stackoverflow.com/q/29637043
score: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47417280
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47418339
has title: Hide keystrokes from window-wide listeners
tagged with: google-chrome-extension
has comment: http://stackoverflow.com/comment/47416952
has body: I'm making an extension for Chrome to be used on Youtube. The extension adds an overlay on top of the video with a text input. However, typing into the extension triggers Youtube's various keystroke listeners (e.g. space -&gt; pause). event.stopPropagation() does nothing, neither does return false at the end of the Angular event callback. My current (successfully prototyped but not yet implemented) solution is to wrap the input in an iframe, which will pass messages back to the parent window: iframe.contentWindow.document.querySelector("#wrapped-input").addEventListener("input", function(){ result.innerHTML = this.value; }); I feel that this solution is a bit of a hack, and I'm hoping to find something more elegant. As an aside, I am using AngularJS for the app, so if there are any Angular-specific workarounds, I'd love to know those too. Thoughts? EDIT Current solution: &lt;iframe id="wrapper-frame"&gt;&lt;/iframe&gt; ... link: { var input = '&lt;input id="inner-input" /&gt;'; var wrap = $window.document.querySelector('#wrapper-iframe').contentWindow.document; $scope.commentInput = wrap.querySelector('#inner-input'); wrap.open(); wrap.write(input); wrap.close(); $scope.commentInput.addEventListener('input', function(){ var val = this.value; $scope.$applyAsync(function(){ $scope.inputContent = val; }); }); } It works, but still -- iframe. Bleh, hack. I will leave the question open in case if someone has a better idea.
answer count: 0
type: UnansweredQuestion
tagged with: youtube
linked to: http://stackoverflow.com/q/25296808
has comment: http://stackoverflow.com/comment/47416760
type: Question

http://stackoverflow.com/q/29667998
answer count: 0
score: 0
tagged with: socket.io
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47474596
has comment: http://stackoverflow.com/comment/47474727
tagged with: web-audio-api
has body: I am trying to develop DJ web application. Here i am playing audio using web audio api. I am adding effect to the audio while playing. I want to share this updated audio live to other users. I am planning to use nodejs and socket io. How can i send this updated audio to server in realtime?
has title: Send audio to server in realtime
type: UnansweredQuestion
tagged with: node.js

http://stackoverflow.com/comment/47422660
has text: It does not solve the problem. Thanks to your answer anyway :)
type: Comment
comment on: http://stackoverflow.com/a/29640402
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47538513
type: Comment
score: 0
has text: This approach will work even if you use async:false. I just removed it because the code all fit into the success handler function.
comment on: http://stackoverflow.com/a/29678035
type: AnswerComment

http://stackoverflow.com/q/29628708
has comment: http://stackoverflow.com/comment/47400486
type: Question
score: 2
has comment: http://stackoverflow.com/comment/47400881
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I'm trying to disable booked dates on datepicker. My code simply posts an ID to ajax.php file and i run a mysql query based on that id and get start and end dates. then i make an array that contains these dates and the ones in between. Finally I get this json_encoded array and it basically defines dates to be disabled on my bootstrap datepicker. I have recently found out that nothing is wrong with $.post method and changed the title. The problem was beforeShowday, it doesn't rerun after changes. Here is the jQuery code: $.ajaxSetup({ cache: false }); var date = new Date(); date.setDate(date.getDate()); function getJsonRes(urlid){ var tarihler = []; var url="ajax.php"; $.post( url, {"id":urlid}, function(data) { //this is the post request $.each( data, function(key, val) { //to retrieve json encoded data var tarih=val; tarihler.push(tarih); }); var disabledDays = tarihler; function daysDisabled(date) { for (var i = 0; i &lt; disabledDays.length; i++) { if (new Date(disabledDays[i]).toString() == date.toString()) { return false; } } return true; } $('#grs').datepicker({ //this is start date language:'tr', todayHighlight:true, weekStart: 1, startDate:date, autoclose: true, format: 'dd-mm-yyyy', beforeShowDay: daysDisabled }) .on('changeDate', function (selected) { startDate = new Date(selected.date.valueOf()); startDate.setDate(startDate.getDate(new Date(selected.date.valueOf()))+1); $('#cks').datepicker('setStartDate', startDate); }); $('#cks').datepicker({ //this is end date todayHighlight:true, weekStart: 1, language:'tr', autoclose: true, format: 'dd-mm-yyyy', beforeShowDay: daysDisabled }) .on('changeDate', function (selected) { FromEndDate = new Date(selected.date.valueOf()); FromEndDate.setDate(FromEndDate.getDate(new Date(selected.date.valueOf()))); $('#grs').datepicker('setEndDate', FromEndDate); }); }, "json"); } $('#choice').change(function(){ var idvalue=$(this).val(); getJsonRes(idvalue); });
tagged with: getjson
tagged with: php
has title: Bootstrap datepicker beforeShowday works only on first change
answer count: 0
upvote count: 2
type: UnansweredQuestion

http://stackoverflow.com/comment/47376930
comment on: http://stackoverflow.com/q/29615696
has text: If those are objects, just `a == b`, if those are of value type - then one cannot affect the other.
type: Comment
score: 1
type: QuestionComment

http://stackoverflow.com/q/29662394
has comment: http://stackoverflow.com/comment/47466167
tagged with: express
score: 12
linked to: http://stackoverflow.com/q/35612226
has answer: http://stackoverflow.com/a/29664267
has comment: http://stackoverflow.com/comment/47466048
accepted answer: http://stackoverflow.com/a/29664267
has comment: http://stackoverflow.com/comment/47464586
answer count: 1
favorite count: 0
upvote count: 12
has title: Difficulty sending cookies with fetch requests in JavaScript
type: AnsweredQuestion
downvote count: 0
tagged with: cookies
type: Question
has comment: http://stackoverflow.com/comment/47464752
has body: I have two separate services, a React single page application and an express API and I'm trying to communicate from the SPA to the API using the new fetch feature. Since the two services lie on different domains, I'm using a CORS middleware inside of the express application in order to make requests from the SPA to the API. I'm trying to make any fetch requests also include cookies so that way I can verify the cookies in my express application, for example On the client side: fetch('http://localhost:8000/hello', { credentials: 'include', mode: 'cors' }).then(/* ... */) On the server side: var app = express(); app.use(cors({ credentials: true }); app.use(cookieParser()); app.get('/hello', function (req, res) { // Try and find the cookies sent with the request console.log(req.cookies); res.status(200).json({ message: 'cookies received!' }); }); However, no matter what I try I still cannot access any cookies on the request object even though I can access them through using document.cookies. An example cookie: name: token value: TOKEN_VALUE domain: localhost path: / http: false secure: false Does anyone have suggestions on how to approach this? Any help would be greatly appreciated!
tagged with: javascript

http://stackoverflow.com/comment/47251188
has text: Is there a way I can make it go to a div that's not in the form but is in the page the form is in?
comment on: http://stackoverflow.com/q/29549744
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29687575
type: Question
has answer: http://stackoverflow.com/a/29687629
tagged with: javascript
has body: The following code produces the following output. But is it possible to keep the value "8888" for "index"? In other words, how do I make the for-each variable a local one? CODE: var index = 8888; console.log(index); for ( index in a) { // by the way a.length = 5 console.log(index); } console.log(index); OUTPUT: 8888 0 1 2 3 4 4
has answer: http://stackoverflow.com/a/29687636
has comment: http://stackoverflow.com/comment/47512178
has title: javascript variables in for each
favorite count: 0
has answer: http://stackoverflow.com/a/29687602
answer count: 5
type: UnansweredQuestion
tagged with: foreach
has answer: http://stackoverflow.com/a/29687585
upvote count: 2
has answer: http://stackoverflow.com/a/29687637
score: 1
downvote count: 1

http://stackoverflow.com/a/29684086
has body: The same way as in jQuery, for which angular.element is a wrapper/sub: angular.element('#username').val();
score: 0
answers question: http://stackoverflow.com/q/29684049
has comment: http://stackoverflow.com/comment/108209125
type: Answer

http://stackoverflow.com/a/29633052
has comment: http://stackoverflow.com/comment/47412439
has body: Taken from http://ricostacruz.com/nprogress/ NProgress.set(0.4) — sets a percentage If you want to go to the middle, set 0.5 o 50 or something... If this is not what you are looking for, please excuse me, i have a very bad english... Also, if it has only four functions exposed, and none of them can do the work you want, i think that the only solution is adding it to Nprogress code :P
type: Answer
has comment: http://stackoverflow.com/comment/47408942
has comment: http://stackoverflow.com/comment/47410224
has comment: http://stackoverflow.com/comment/47409224
has comment: http://stackoverflow.com/comment/47410166
score: 0
answers question: http://stackoverflow.com/q/29632876

http://stackoverflow.com/comment/48518644
type: QuestionComment
has text: I think `.on('preRedraw', function() { ...})` should work. https://github.com/dc-js/dc.js/blob/master/web/docs/api-latest.md#listeners
score: 0
comment on: http://stackoverflow.com/q/29594395
type: Comment

http://stackoverflow.com/comment/47475521
type: Comment
comment on: http://stackoverflow.com/q/29668533
has text: The react tutorial covers this behaviour with a demonstration of a simple chat room.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/47265917
score: 0
type: Comment
type: QuestionComment
has text: The log in is working fine. But I'm not getting the alert and is not redirecting to the about page.
comment on: http://stackoverflow.com/q/29556938

http://stackoverflow.com/q/29568382
has comment: http://stackoverflow.com/comment/47289820
has comment: http://stackoverflow.com/comment/47468070
tagged with: google-maps-api-3
has comment: http://stackoverflow.com/comment/47297228
has title: google map marker crashes when adding event click in loop
answer count: 1
has comment: http://stackoverflow.com/comment/47297158
favorite count: 0
has comment: http://stackoverflow.com/comment/47478692
type: UnansweredQuestion
score: 0
upvote count: 1
downvote count: 1
has body: I have this code when I add event Listener for click event to marker after few minuets, my browser will not responding or crashes.but if I remove the event Listener my browser will not crush, I already use the closure method in adding event but still it crashes.can someone help me on this. Thank you in advance. var map; var marker; var markerarray =[]; var car = "M17.402,0H5.643C2.526,0,0,3.467,0,6.584v34.804c0,3.116,2.526,5.644,5.643,5.644h11.759c3.116,0,5.644-2.527,5.644-5.644 V6.584C23.044,3.467,20.518,0,17.402,0z M22.057,14.188v11.665l-2.729,0.351v-4.806L22.057,14.188z M20.625,10.773 c-1.016,3.9-2.219,8.51-2.219,8.51H4.638l-2.222-8.51C2.417,10.773,11.3,7.755,20.625,10.773z M3.748,21.713v4.492l-2.73-0.349 V14.502L3.748,21.713z M1.018,37.938V27.579l2.73,0.343v8.196L1.018,37.938z M2.575,40.882l2.218-3.336h13.771l2.219,3.336H2.575z M19.328,35.805v-7.872l2.729-0.355v10.048L19.328,35.805z"; setInterval(function(){ $.ajax({ type: "post", url: "vehiclecordinates.php", success: function(data){ coordinates = data.latlng; vehiclename = data.vehiclename; heading = data.heading; devname = data.vehiclename; thedate = data.trackdate; for (var i = 0; i < coordinates.length; i++) { newcoordinate = new google.maps.LatLng(coordinates[i].split(",")[0],coordinates[i].split(",")[1]); if (markerarray[vehiclename[i]] && markerarray[vehiclename[i]].setPosition){ markerarray[vehiclename[i]].icon.rotation = parseInt(heading[i]); markerarray[vehiclename[i]].setPosition(newcoordinate); var con = ' Vehicle Name:' + devname + ' ' +'Date='+thedate+' '; }else { marker = new MarkerWithLabel({ map:map, labelClass: "mylabels", labelStyle: {opacity: 1.0}, labelContent: ' '+ vehiclename[i]+' ', icon:{ path: car scale:.7, strokeColor: 'white', strokeWeight: .10, fillOpacity: 1, fillColor: '#404040', offset: '5%', rotation: parseInt(heading[i]), anchor: new google.maps.Point(10, 50) } }); marker.setPosition(newcoordinate); markerarray[vehiclename[i]] = marker; var con = ' Vehicle Name:' + devname + ' …
type: Question
tagged with: google-maps
has answer: http://stackoverflow.com/a/29576970
tagged with: javascript

http://stackoverflow.com/q/29538624
tagged with: function
upvote count: 0
score: -2
tagged with: javascript
has body: hello this is the test case and i have to pass n number of arguments in function('you should be able to use arguments', function () { var a = Math.random(), b = Math.random(), c = Math.random(), d = Math.random(); expect(answers.useArguments(a)).to.eql(a); expect(answers.useArguments(a, b)).to.eql(a + b); expect(answers.useArguments(a, b, c)).to.eql(a + b + c); expect(answers.useArguments(a, b, c, d)).to.eql(a + b + c + d); }); so in function what i have to write asi i write this return Array.prototype.call(arguments,function(a,b) { for(var i=0;i&lt;arguments.length;i++) { return a+b; } });
has answer: http://stackoverflow.com/a/29538975
answer count: 1
favorite count: 0
type: UnansweredQuestion
downvote count: 2
has title: hello this is the test case and i have to pass n number of arguments in function
type: Question

http://stackoverflow.com/comment/47477174
score: 1
type: Comment
type: QuestionComment
has text: i see nothing can you share how you reproduced it ?
comment on: http://stackoverflow.com/q/29667134

http://stackoverflow.com/comment/47396849
comment on: http://stackoverflow.com/q/29626676
score: 0
has text: inside the service, the method does not find this.online.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29555648
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/203198
tagged with: jquery
has comment: http://stackoverflow.com/comment/47262448
type: Question
has title: JQuery Select on Dynamically Created Object
tagged with: dynamic
has comment: http://stackoverflow.com/comment/47262259
score: 0
has comment: http://stackoverflow.com/comment/47262368
has answer: http://stackoverflow.com/a/29555723
answer count: 1
has body: Hi I am creating some dynamic elements here function loadApiData(){ var url, jqxhr, url2, jqxhr2, status; for (i = 0; i &lt; 11; i++) { url2 = document.URL + 'status/' + i; jqxhr2 = $.getJSON(url2, function(data) { console.log('API response received'); //console.log(url2); console.log(data); status = data['status']; //console.log(status); if (status == false) { //$('#false').append('&lt;p class="p2" id="' + data['phone'] + 'on"&gt;' + data['phone'] + ' phone Status: ' + status + '&lt;p&gt;'); $('#false').append('&lt;p class="p2" id="' + data['phone'] + 'on"&gt;' + data['phone'] + ' phone Status: &lt;input type="button" id="' + data['phone'] + 'off" value="' + status + '" /&gt;&lt;p&gt;'); } else { $('#true').append('&lt;p id="' + data['phone'] + 'off"&gt;' + data['phone'] + ' phone Status: ' + status + '&lt;p&gt;'); } }); } }; However when I then try loading them later function loadWindowSystem() { $('#Nimoff').click(function() { alert('hi'); }); }; I find that it doesn't actually register the click event. My document.ready() looks like this. $(document).ready(function(){ loadApiData(); loadWindowSystem(); }); Any help would be greatly appreciated. Thanks Resolved by using $( document ).on( 'click', '#Nimoff', function () { // you code });
linked to: http://stackoverflow.com/q/203198
has comment: http://stackoverflow.com/comment/47262001
tagged with: javascript

http://stackoverflow.com/a/29551409
has body: You cannot "wait for the code in the block to complete execution before releasing execution back to the main event loop" in Javascript. That simply cannot be done. Done right, you could insert the script tags with onload handlers so you would be notified (via a callback) when those scripts had finished loading and finished their synchronous execution (but not their async execution). If you wanted to know when async execution in those scripts would be done, you would have to build something into those scripts to notify you when they were done. If you're going to use jQuery's .html() to do script tag injection you lose a lot of control over this process and it becomes a hacking project to try to figure out what you can do from outside the process. In all cases, you cannot prevent the continuing execution of the main event loop of javascript while waiting for this all to finish.
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/29551258
answers question: http://stackoverflow.com/q/29551258
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/q/29673081
favorite count: 0
tagged with: http://stackoverflow.com/tag/xml
has answer: http://stackoverflow.com/a/60653998
tagged with: php
type: AnsweredQuestion
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/29673194
has comment: http://stackoverflow.com/comment/47483812
type: Question
possible better answer: http://stackoverflow.com/a/52570183
tagged with: javascript
has answer: http://stackoverflow.com/a/52570183
tagged with: ajax
has body: I was watching the New Boston tutorial on Ajax training and I wrote the same code as the tutor of the course did. But the code doesn't work in my computer. In Google chrome Uncaught TypeError: Cannot read property 'documentElement' of null message = xmlHttp.responseXML.documentElement.firstChild.data; In Firefox not-well formed bookname.php:5:8 echo ' '; index.html Users information Enter user_name you would want to know about: bookname.php <?php header('Content-Type: text/xml'); echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>'; echo ' '; $name = $_GET['userName']; $nameArray = array('Mehrshad', 'Alex', 'Tom', 'Aydin'); if(in_array($name, $nameArray) { echo 'I do know '. $name . '!'; } else if($name == '') { echo 'Enter a name you want to know about'; } else { echo 'Sorry we don\'t have user "'. $name . '" ' } echo ' '; ?> bookname.js var xmlHttp = createXmlHttpRequestObject(); function createXmlHttpRequestObject() { var xmlHttp; if(window.ActiveXObject) { try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { xmlHttp = false; } } else { try{ xmlHttp = new XMLHttpRequest(); } catch(e) { xmlHttp = false; } } if(!xmlHttp) { alert('can\'t create that object hoss!') } else { return xmlHttp; } } function process() { if(xmlHttp.readyState == 4 || xmlHttp.readyState == 0) { username = encodeURIComponent(document.getElementById('userInput').value); xmlHttp.open("GET", "bookname.php?userName=" + username, true); xmlHttp.onreadystatechange = handleServerResponse; xmlHttp.send(null); } else { setTimeout('process()', 1000); } } function handleServerResponse() { if(xmlHttp.readyState == 4) { if(xmlHttp.status == 200) { message = xmlHttp.responseXML.documentElement.firstChild.data; document.getElementById("underInput").innerHTML = '<span style="color: blue"' + message + ''; setTimeout('process()', 1000); } else { alert('Something went wrong!'); } } }
answer count: 3
has title: Ajax , Cannot read property 'documentElement' of null
accepted answer: http://stackoverflow.com/a/29673194
downvote count: 0

http://stackoverflow.com/a/29650521
answers question: http://stackoverflow.com/q/29650350
score: 4
has comment: http://stackoverflow.com/comment/47442833
has comment: http://stackoverflow.com/comment/47441608
type: Answer
has body: In order to perform specific animation for specific submit button: $(document).on('click', 'input[type="submit"]', function() { var that = $(this); var name = that.attr('name'); if (name == 'a_name') { // perform animation for 'a_name' } else if (name == 'b_name') { // ... } }) If there is actually a name attribute, it will be caught. Check the code bellow (name = test): $(document).on('click', 'input[type="submit"]', function(e) { var that = $(this); var name = that.attr('name'); e.preventDefault(); alert(name); if (name == 'test') { // perform animation for 'a_name' } else if (name == 'b_name') { // ... } }) <input type="hidden" name="test" value="<?php echo $product->getProductId() ?>"/>
upvote count: 4
has comment: http://stackoverflow.com/comment/47440956
has comment: http://stackoverflow.com/comment/47441118
downvote count: 0
has comment: http://stackoverflow.com/comment/47441544
has comment: http://stackoverflow.com/comment/47441623

http://stackoverflow.com/q/29563890
has body: As a follow up to this question: Hover starts a simple slideshow Firefox behaves strange on if using the setInteval function: Here is the JSFiddle and the script: $('.fadein img:gt(0)').hide(); $(".fadein").hover(function() { timer = setInterval(function() { $('.fadein :first-child').fadeOut() .next('img').fadeIn() .end().appendTo('.fadein'); }, 1000); }, function() { clearInterval(timer); }); This functions beautifully in Chrome, but when I open the fiddle in Firefox and hover over the image for a bit, events start bubbling up and don't stop on mouse leave. EDIT: Funny story - I changed some parameters and it works in Firefox, but not in Chrome. I changed the setInterval function with setTimeout. See JSFiddle: $('.fadein img:gt(0)').hide(); $('.fadein').mouseenter(function(){ timer = setTimeout(function(){ $('.fadein :first-child').fadeOut().next('img').fadeIn() .end().appendTo('.fadein'); }, 1000); }) .mouseleave(function() { clearTimeout(timer); }); So the bottom line is - it still doesn't work as it should.
score: -1
has comment: http://stackoverflow.com/comment/47277902
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/19104115
has answer: http://stackoverflow.com/a/29563977
downvote count: 1
type: Question
has title: setInteval vs setTimeout
upvote count: 0
tagged with: firefox
answer count: 1
tagged with: slideshow
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47277475

http://stackoverflow.com/q/29652150
score: 1
has answer: http://stackoverflow.com/a/29653156
upvote count: 1
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: http://stackoverflow.com/tag/svg
downvote count: 0
has title: SVG pattern units of random size
has body: I’ve got a flowery pattern (http://pages.bangor.ac.uk/~abp4d9/) where user moves sliders (for inner circles and petals) and flowers change. There are 2 big problems now that I can’t manage to sort out: 1) Flower petals get cut off. I’ve tried changing width and height of SVG, pattern itself, element. Tried changing x and y. Nothing makes any difference 2) I want to randomize pattern units. My 1st stop is circles. I want the pattern to stay the same apart from circles being of random different sizes. I’ve searched everywhere and now I’m not sure if this idea is even possible? I’ve got a button ready to use and a function for taking random number from an array. The pattern would look something like this picture (this one has got randomized petals) Here is my HTML with SVG: Create your own pattern Cicle size: Random Circle size: Length of petals: Width of petals: <path d="M 0 106 156 106" stroke="black" stroke-width="2" /> <g width="140" height="140"> <ellipse id="petal" cx=60 cy=40 rx=60 ry=10 stroke="black" stroke-width="2" fill="white"/> <ellipse id="petal1" cx=60 cy=40 rx=60 ry=10 stroke="black" stroke-width="2" fill="white" transform="rotate(35, 60, 40)"/> <ellipse id="petal2" cx=60 cy=40 rx=60 ry=10 stroke="black" stroke-width="2" fill="white" transform="rotate(70, 60, 40)"/> <ellipse id="petal3" cx=60 cy=40 rx=60 ry=10 stroke="black" stroke-width="2" fill="white" transform="rotate(105, 60, 40)"/> <ellipse id="petal4" cx=60 cy=40 rx=60 ry=10 stroke="black" stroke-width="2" fill="white" transform="rotate(140, 60, 40)"/> </g> <circle id="circleP" cx="60" cy="40" r="10" stroke="black" stroke-width="2" fill="white"/> <rect x="10" y="10" width="500" height="500" stroke="black" stroke-width="4" fill="url(#pattern)"/> And JS: function refresh(){ var slider1 = parseInt(document.getElementById("slider1").value); document.getElementById("circleP").setAttribute("r", slider1) } function refreshPetals(){ var slider2 = parseInt(document.getElementById("slider2").value); docume…
accepted answer: http://stackoverflow.com/a/29653156
type: Question
type: AnsweredQuestion

http://stackoverflow.com/comment/47330154
comment on: http://stackoverflow.com/q/29539135
score: 0
type: Comment
has text: That Firefox addon uses the addon-only canvas [`drawWindow`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawWindow) API. Most-likely that site uses a headless browser. I don't think you will find a cross-browser solution, short of computing the offsets for each browser.
type: QuestionComment

http://stackoverflow.com/comment/47327659
has text: This is the correct answer, after checking upload without ajax I found the image I was uploading was too large!
type: Comment
comment on: http://stackoverflow.com/a/29569343
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47383849
type: QuestionComment
comment on: http://stackoverflow.com/q/29619774
score: 0
has text: @Harry thnx for ur help..its working..one more question plz..all li is dynamically generated if in ul all li is marked as a green then that ul will be green automatically ..how to do that?
type: Comment

http://stackoverflow.com/a/29685970
answers question: http://stackoverflow.com/q/29685704
has comment: http://stackoverflow.com/comment/47509696
has body: Try this instead: var btn = document.getElementById('dat'); btn.addEventListener('click', function() { document.location.href = 'book.php'; }); UPDATE Based on your comments: 1 - You'll need to build a form, example: &lt;html&gt; &lt;body&gt; &lt;form action="book.php" method="post"&gt; voornaam: &lt;input type="text" name="voornaam" value="&lt;?php echo $row["gids_voornaam"]?&gt;"&gt;&lt;?php echo $row["gids_voornaam"]?&gt;&lt;br&gt; etc.. &lt;input type="submit"&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; 2 - After the user clicks the submit button, you'll need to get the POST values on book.php, example: voornaam IS &lt;?php echo $_POST["voornaam"]; ?&gt;&lt;br&gt; You don't need javascript for this, just simple html and php on backend.
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/47509328
has comment: http://stackoverflow.com/comment/47509622
has comment: http://stackoverflow.com/comment/47510159

http://stackoverflow.com/a/32938721
type: Answer
score: 0
has body: I ran into this question because I'm currently working on my own Angular + PHP contact form. Something glaring in your code to me is the total lack of ng declarations. Where is ng-app, ng-controller and ng-model in your html? You won't be able to get the data if there's no data binding going on. Also, instead of a form action, you should call the "add" function defined in your controller using ng-submit. Write Us As for the PHP stuff, I'm not really sure. But your Angular code is definitely messed up.
answers question: http://stackoverflow.com/q/29638977

http://stackoverflow.com/a/29550895
type: Answer
score: 0
has body: Using nth-child won't work because your links aren't all children of the same element, and using nth-of-type won't work because each new generation (child, grandchild of a node) gets it's own "-of-type" ... that is n is reset. You can use javascript or jQuery to attach arbitrary classes to each link within a container — a subtree of any given DOM element — including every link in the body. Given some set of &lt;a&gt; nodes and some set of classes to loop through and attach, it doesn't matter what depth the nodes are at as long as you have some way to select them. In jQuery, $('#aRandomDivforThisQuestion a') will select all the links within your div and not any other links. You could use $('body a') or just $(a) to get all links on the page, or $('.linkmap a') to get all links within a class but no others. It's then a matter of traversing the list of nodes and assigning a class to each one, re-starting your classes every other, or every third, etc. node, depending on how many variations you want. You could do just ['odd', 'even'] (every other link) or ['red', 'blue', 'green'] (every third link) Here's a function to take an arbitrary list of links and apply an arbitrary set of classes to it. It's more verbose than necessary (lines could be combined) but is clearer this way. It expects a jQuery list of elements and a plain javascript array of class names. function stripe(elems, classes) { var which = 0; $(elems).each(function(i, elem) { var addit = classes[which]; which = (which + 1) % classes.length; $(elem).addClass(addit); }); } See it in action in my test fiddle where I apply two different sets of classes to the same set of nodes, setting every other link to red/green and every third link to bold/italic/underline, by calling the function twice. stripe( $('#aRandomDivforThisQuestion a'), [ 'odd', 'even' ] ); stripe( $('#aRandomDivforThisQuestion a'), [ 'bld', 'ital', 'undrln' ] );
answers question: http://stackoverflow.com/q/29548814

http://stackoverflow.com/comment/47316392
type: Comment
type: QuestionComment
has text: as long as your server can handle gobblygook instead of normal post data, then you can just send the blob over and echo it out later un-impeded.
comment on: http://stackoverflow.com/q/29584051
score: 0

http://stackoverflow.com/a/29661179
accepted answer of: http://stackoverflow.com/q/29661030
answers question: http://stackoverflow.com/q/29661030
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
has body: Take a look at D3J or Dojo. They are both JavaScript libraries for data-driven and data-centric front-end applications.
upvote count: 1

http://stackoverflow.com/q/29615650
has title: Replacing checkboxes with images?
has answer: http://stackoverflow.com/a/29615721
accepted answer: http://stackoverflow.com/a/29616038
tagged with: javascript
linked to: http://stackoverflow.com/q/16352864
has comment: http://stackoverflow.com/comment/47376647
answer count: 3
has comment: http://stackoverflow.com/comment/47376746
tagged with: http://stackoverflow.com/tag/html
tagged with: checkbox
has comment: http://stackoverflow.com/comment/47376696
has answer: http://stackoverflow.com/a/29616148
score: 0
has answer: http://stackoverflow.com/a/29616038
possible better answer: http://stackoverflow.com/a/29616148
type: AnsweredQuestion
has body: I am trying to replace three check boxes within an html form with three different images. The idea being that the user can select the pictures by clicking on them rather than clicking on a check box. I've been putting togther some code but can't figure out how to make all the checkboxes selectable. At the moment only the first images works when it is clicked on. Can anyone help me? I'm a real novice with javascript I'm afraid. See fiddle here The form &lt;form id="form1" action="" method="GET" name="form1"&gt; &lt;div class="col-md-3"&gt; &lt;img src="https://cdn2.iconfinder.com/data/icons/windows-8-metro-style/128/unchecked_checkbox.png" title="blr" id="blr"&gt;&lt;input type="checkbox" id="imgCheck" name="pic1" value=9&gt;&lt;/div&gt;&lt;div class="col-md-3"&gt; &lt;img src="https://cdn2.iconfinder.com/data/icons/windows-8-metro-style/128/unchecked_checkbox.png" title="blr" id="blr"&gt;&lt;input type="checkbox" id="imgCheck" name="pic2" value=12&gt;&lt;/div&gt;&lt;div class="col-md-3"&gt; &lt;img src="https://cdn2.iconfinder.com/data/icons/windows-8-metro-style/128/unchecked_checkbox.png" title="blr" id="blr"&gt;&lt;input type="checkbox" id="imgCheck" name="pic3" value=7&gt;&lt;/div&gt; &lt;input type="submit" name="submit" value="Add" /&gt; &lt;/div&gt; &lt;/form&gt; The javascript $('#blr').on('click', function(){ var $$ = $(this) if( !$$.is('.checked')){ $$.addClass('checked'); $('#imgCheck').prop('checked', true); } else { $$.removeClass('checked'); $('#imgCheck').prop('checked', false); } })
type: Question

http://stackoverflow.com/comment/47309054
comment on: http://stackoverflow.com/a/29579043
score: 0
type: AnswerComment
has text: This is not a good answer. The problem has nothing to do with asynchronicity and you can definitely "make a truly custom asynchronous functionin Js" - $.getJSON() is truly asynchronous, I don't know what "truly custom" means.
type: Comment

http://stackoverflow.com/q/29592768
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/47333026
tagged with: asp.net
favorite count: 0
has comment: http://stackoverflow.com/comment/47333047
has comment: http://stackoverflow.com/comment/47333003
has body: I have my values stored in javascript variables now,i want to assign those values to javascript array. Here i am posting the image for same I want my array to be intialized with these variables values,since values in variables are generated dynamicaly, the are not static values.values in given variables are generated at run time, so i cant pre-intialze the array with the values, like i have done in the picture.
has comment: http://stackoverflow.com/comment/47332476
has answer: http://stackoverflow.com/a/29593172
score: 1
has comment: http://stackoverflow.com/comment/47332618
has comment: http://stackoverflow.com/comment/47332463
has comment: http://stackoverflow.com/comment/47334212
has comment: http://stackoverflow.com/comment/47333182
upvote count: 1
has comment: http://stackoverflow.com/comment/47332525
has comment: http://stackoverflow.com/comment/47333932
accepted answer: http://stackoverflow.com/a/29593172
type: AnsweredQuestion
tagged with: c#
has title: How to assign javascript variables value to javascript array?
has comment: http://stackoverflow.com/comment/47333454
has comment: http://stackoverflow.com/comment/47332958
tagged with: javascript
has comment: http://stackoverflow.com/comment/47332623
type: Question
has comment: http://stackoverflow.com/comment/47333605
has comment: http://stackoverflow.com/comment/47332840

http://stackoverflow.com/comment/47225231
has text: you are assigning `'21'` to `finalPart`, there are one or two `=` missing in the `if`
type: AnswerComment
comment on: http://stackoverflow.com/a/29536282
type: Comment
score: 1

http://stackoverflow.com/comment/132876857
comment on: http://stackoverflow.com/a/29642032
type: AnswerComment
has text: Note, for the visitors in the future: you don't need all of those multiple CSS declarations with the `-webkit / -moz / -o` prefixes. Just use the `transition` property directly.
score: 0
type: Comment

http://stackoverflow.com/comment/47368985
score: 0
type: Comment
type: QuestionComment
has text: HOLY WOW, YOU HAVE A PROMISE IMPLEMENTATION THERE? You __really__ think it's __that__ simple to create a working promise implementation and this is all promises do?
comment on: http://stackoverflow.com/q/29608891

http://stackoverflow.com/comment/47522058
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29641746
has text: yea that is fine.. but see they are displaying image and button above overlay// that is what i want to have

http://stackoverflow.com/comment/47352308
type: Comment
type: QuestionComment
score: 0
has text: http://stickyjs.com/ here, have a play!
comment on: http://stackoverflow.com/q/29603109

http://stackoverflow.com/a/29533292
answers question: http://stackoverflow.com/q/29533103
score: 0
type: Answer
has body: try this: function (data) { var htmlString = ''; for(var i = 0; i &lt; data.length; i++){ // store the current data item to a temp variable. htmlString += data[i].name + "&lt;br&gt;"; } $("#resultados").html(htmlString); }

orm
tags question: http://stackoverflow.com/q/29577235
tag name: orm
type: Tag

http://stackoverflow.com/comment/47363647
type: Comment
has text: What web server are you running?
comment on: http://stackoverflow.com/q/29608640
score: 0
type: QuestionComment

http://stackoverflow.com/q/29618680
accepted answer: http://stackoverflow.com/a/29618735
answer count: 1
tagged with: javascript
tagged with: jquery
has title: How to insert before previous element using jquery?
favorite count: 0
upvote count: 3
tagged with: http://stackoverflow.com/tag/html
has body: I have select with some hidden options and two buttons: up and down. To hide options I have to wrap them into invisible span, because in some browsers just doesn't work. When I press up or down button I have to move selected option in select list up or down. Recently I've done it like this: function moveOption(option, up) { if (up) { option.insertBefore(option.prev()); } else { option.insertAfter(option.next()); } } But the problem is - If I have hidden options I have to press button several times to switch it with visible option, because each time button is pressed I've got option switched with invisible one. To fix this I've already tried: option.insertBefore(option.prev(':not(.hidden)')); option.insertBefore(option.prev('option')); option.insertBefore(option.prev(':is(visible)')); But none of it seams to work. Here's the js fiddle. $('#up').click(function() { var option = $('select').children('option:selected'); moveOption(option, true); }); $('#down').click(function() { var option = $('select').children('option:selected'); moveOption(option, false); }); function moveOption(option, up) { if (up) { option.insertBefore(option.prev()); } else { option.insertAfter(option.next()); } } .hidden { display: none; } One Two Three Four Five Six Seven Eight Nine Ten
downvote count: 0
type: AnsweredQuestion
score: 3
type: Question
has answer: http://stackoverflow.com/a/29618735

http://stackoverflow.com/q/29538002
tagged with: dom
has comment: http://stackoverflow.com/comment/47228460
type: Question
has answer: http://stackoverflow.com/a/29538248
tagged with: javascript
has comment: http://stackoverflow.com/comment/47228062
answer count: 2
has answer: http://stackoverflow.com/a/29538313
has comment: http://stackoverflow.com/comment/47228079
downvote count: 0
favorite count: 0
has body: My json file, named as "subject.json" contains: [ { "subject":"ProgApps", "codeNo":"9594", "courseNo":"IT 312L", "instructor":"Maria Clemente Concepcion" }, { "subject":"ITCR", "codeNo":"9615", "courseNo":"IT 014", "instructor":"Jonathan Ramirez" }, { "subject":"ITP2", "codeNo":"9602", "courseNo":"IT 421", "instructor":"Jonathan Ramirez" } ] This is my function to get data from my json file. But I don't know how load it into my table. I just want to make it more simple because I already search some answers here but they're too complicated for me as a beginner. function ajaxGetJson() { var hr = new XMLHttpRequest(); hr.open("GET", "scripts/subject.json", true); hr.setRequestHeader("Content-type", "application/json", true); hr.onreadystatechange = function() { if (hr.readyState == 4 && hr.status == 200) { var data = JSON.parse(hr.responseText); } } hr.send(null); } I tried several times and all failed. I only know how to use JavaScript but I also tried using jQuery because of their example (answers). But I can't learn jQuery yet because I'm trying to solve this JavaScript so my knowledge about jQuery is very limited. Sorry RIP English. This is my html file. It only includes table tag since many people create table just using JavaScript. I attempt to add the headers inside the table so that only data will be loaded. Is that valid? Schedule
has title: How To Load JSON file to a HTML Table? Using JavaScript
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
score: 2
upvote count: 2
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/comment/47366012
has text: I've added a code example.
comment on: http://stackoverflow.com/a/29609923
score: 0
type: AnswerComment
type: Comment

web-services
type: Tag
tags question: http://stackoverflow.com/q/29550746
tags question: http://stackoverflow.com/q/29598518
tags question: http://stackoverflow.com/q/29545913
tags question: http://stackoverflow.com/q/29646738
tags question: http://stackoverflow.com/q/29534291
tag name: web-services

http://stackoverflow.com/a/29610090
score: 0
has body: Try using virtual elements. Look at the end of: http://knockoutjs.com/documentation/if-binding.html Set a flag on summit button pressed. This item always appears I want to make this item present/absent dynamically
answers question: http://stackoverflow.com/q/29608100
has comment: http://stackoverflow.com/comment/47381522
has comment: http://stackoverflow.com/comment/47365810
type: Answer

http://stackoverflow.com/comment/47522127
score: 0
comment on: http://stackoverflow.com/a/29641746
type: Comment
type: AnswerComment
has text: @Gags You can use a div of same size as the image with transparent background so it looks like that. ;)

http://stackoverflow.com/comment/47489592
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29675927
has text: I'd call it a bug. The code is essentially nonsense *with* the `+`.

http://stackoverflow.com/q/29623790
type: Question
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/29625243
answer count: 1
has title: RequireJS and window.define() conflict
tagged with: requirejs
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29625243
has comment: http://stackoverflow.com/comment/47391465
has body: I'm developing a chatbox plugin (part of a live chat application), which is to be injected on my users websites. I use RequireJS for loading and running the plugin. Currently, I met a problem with one of my new user. Among libraries on its website, one of them defines "window.define" as a specific function (nothing to do with my purpose). Problem is : on load, RequireJS defines three names in the global scope, including "define". So when I load my plugin (using RequireJS, with my main module as value of the data-main attribute), my code is actually not loaded, because of the conflict about "define". Is there a proper way to have a control on these three names declared, to avoid such conflicts ? I know I could change code in RequireJS module to define something like "requirejsMyApp" / "defineMyAppy" and be quiet... but it's not really a proper way. Thanks for your help.

http://stackoverflow.com/comment/47343759
has text: Thanks! This seems like a very practical solution and I'll keep the logic of it in mind. I think I'll opt to just sort the array and work with the resultant order of elements for this challenge though since I'm not worrying about memory usage (is this what you meant by 'performance'?). That's true the [1,1] case can't be solved by the guidelines of the challenge.. maybe I'll ignore that one? Thanks again for your help.. is there a way I can rep you and the other answerers? I tried the 'upvote' but I need 15 rep before I can do that.. I really appreciate the help though.
comment on: http://stackoverflow.com/a/29598537
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/a/43087889
downvote count: 0
type: Answer
score: 7
upvote count: 7
has body: Since the correct answer did not work for me with multiple series, I had to do it more similar to this: First update the names since it's a quicker operation without animation. // Pass false to skip redraw (since there are multiple operations, for better performance) chart.series[0].update({name:'new title 0'}, false); chart.series[1].update({name:'new title 1'}, false); chart.series[2].update({name:'new title 2'}, false); chart.series[3].update({name:'new title 3'}, false); // Redraw the name changes before updating the data. chart.redraw(); // Update the series data with animation, passing false to redraw here as well. chart.series[0].setData(newData, false); chart.series[1].setData(newData1, false); chart.series[2].setData(newData2, false); chart.series[3].setData(newData3, false); // Now we redraw the series data chart.redraw();
answers question: http://stackoverflow.com/q/29549969

http://stackoverflow.com/q/29666777
has comment: http://stackoverflow.com/comment/47472363
has comment: http://stackoverflow.com/comment/47473357
tagged with: php
type: AnsweredQuestion
has title: What are the drawbacks in my form design logic?
type: Question
score: 0
has comment: http://stackoverflow.com/comment/47473320
has comment: http://stackoverflow.com/comment/47473463
has comment: http://stackoverflow.com/comment/47473548
has comment: http://stackoverflow.com/comment/47473407
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29668495
has body: $('.login_links_register').click( function () { $("body").addClass("removeScroll"); $(".login_form_container").show(); $("#registerForm").show(); $(".login_form_container").css('top', '0px'); /*$('.overlay').addClass('visible');*/ }); $(document).on('click', ".close_button", function (event) { var negativeHeight = -1 * ($('.login_form_container').offset().top + $(this).parents('.login_form_container').height()); $(".login_form_container").css('top', negativeHeight); //$(".login_form_container").slideUp(); /*$('.overlay').removeClass('visible');*/ setTimeout(function () { $('.overlay').addClass('displayNone'); $(".login_links").removeClass("popup_opened"); $("#loginForm").hide(); $("#registerForm").hide(); $("body").removeClass("removeScroll"); }, 500); /*Execute a set of statements after a statement completion. To make it faster reduce the milliseconds*/ }); input[type="text"], input[type="password"] { border: 1px solid #aaa; } .header2 { background-color:#E1E3E5; /*have to change */ /*padding: 15px 0;*/ } .right { float: right; clear:both; /*To avoid problems caused by float - but check it may cause some problems check for it*/ } /*Instead overflow:auto(or) hidden*/ .clearboth::after { clear: both; content:""; display: block; visibility: hidden; } .displayNone { display: none; } .emailField, .passwordField { width: 200px; padding: 5px; } /*to remove unnecessary margin caused by ul element */ .login_links_list { /*margin:10px 0;*/ padding: 0px; margin: 0; } .login_links.right { margin-right: 70px; /*Same as Login container*/ } /*login_link ul li element*/ .login_links_list_ele, .login_links_list_label /*can apply al these properties to anchor tag instead li */ { float: left; list-style: outside none none; transition: all 0.5s ease 0s; } .login_links_list_label { padding: 15px; } .login_links_register, .login_links_login { /*border-right:1px solid #ccc; border-left: 1px solid #ccc;*/ float:left; padding:15px; } .login_form_container.right { border: 1px solid #aaa; ma…
accepted answer: http://stackoverflow.com/a/29668495
tagged with: css
has comment: http://stackoverflow.com/comment/47472629
has comment: http://stackoverflow.com/comment/47473493

http://stackoverflow.com/comment/47447710
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29653812
has text: Are you expecting [this](https://jsfiddle.net/ugpg3gk3/3/)
type: Comment

http://stackoverflow.com/q/29687593
tagged with: referrer
type: Question
has comment: http://stackoverflow.com/comment/47527734
score: 0
has body: I wrote a script that's running from ebay listing iframe. It's working fine, it runs on $(document).ready(), sends an AJAX request to a remote server, gets some info, manipulate the DOM on 'success' callback, everything working perfect... However, I added a piece of code, which should get the document.referrer, and extract some keywords from it, if they exist. Specifically, if a user searches ebay for a product, and clicks on my product from the results, the function extracts the keywords he entered. Now, the problem is, that function is not running on page load at all. It seems like it blocks the script when it comes to that part. This is the function: function getKeywords(){ var index = window.parent.document.referrer.indexOf('_nkw'); if (index &gt;= 0){ var currentIndex = index + 5; var keywords = ''; while (window.parent.document.referrer[currentIndex] !== '&amp;'){ keywords += window.parent.document.referrer[currentIndex++]; } keywords = keywords.split('+'); return keywords; } } And I tried calling two logs right after it: console.log('referrer: ' + window.parent.document.referrer); console.log(getKeywords()); None of them is working. It's like when it comes to that 'window.parent.document.referrer' part, it stops completely. But, when I put this all in a console, and run it, it works perfectly. It logs the right referrer, and the right keywords. Does anybody know what might be the issue here?
answer count: 1
tagged with: javascript
tagged with: console
has title: Script not working on page load, but working from console
has comment: http://stackoverflow.com/comment/47512339
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29694448

http://stackoverflow.com/comment/47370845
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29612622
has text: @Suo6613 yes. Each call to `setInterval()` establishes a distinct, independent timer.
type: AnswerComment

http://stackoverflow.com/comment/47340295
type: Comment
comment on: http://stackoverflow.com/q/29595474
type: QuestionComment
has text: That's bad because your scheme would require the mobile app to have the shared secret, hash or no hash. You might want to rephrase your question to be clearer/more specific.
score: 0

http://stackoverflow.com/comment/47289160
has text: @vihan1086 I want to change the color of battle.sendMessage
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29569782

http://stackoverflow.com/comment/47259093
score: 0
type: QuestionComment
type: Comment
has text: Like gating is not allowed
comment on: http://stackoverflow.com/q/29552814

http://stackoverflow.com/a/29582673
has body: set data type to json in ajax's settings object: $.ajax({ dataType :'json', url: "form.php", type: "get", success: function(data){ console.log(data); }, error:function(e){ console.log(e); } }); });
answers question: http://stackoverflow.com/q/29581510
type: Answer
score: 0

http://stackoverflow.com/comment/47268965
type: Comment
score: 0
type: AnswerComment
has text: can you make a rule where if image is already displaying then display the other image instead?
comment on: http://stackoverflow.com/a/29559268

http://stackoverflow.com/comment/47303402
comment on: http://stackoverflow.com/a/29577468
type: AnswerComment
type: Comment
has text: @Bergi Ah yes, I was momentarily confused and should have thought more first. So `Q.nfcall()` immediately executes `User.findOne()` and returns a promise for `user`. It all makes sense now, thanks!
score: 1

http://stackoverflow.com/comment/76437514
type: QuestionComment
comment on: http://stackoverflow.com/q/29620686
score: 0
has text: See my answer below for a two line solution without `Object.assign`
type: Comment

http://stackoverflow.com/q/29615688
type: Question
has body: I want to set hidden input value(username) based on client other input(email) in a form, then submit to server. (to make sure username equal to email) However, the assignment to the hidden input is processed AFTER the form submitted. So 'username' is already None on server side. &lt;form id="altForm" action="" method="post"&gt; &lt;input type="hidden" name="username" id="id_username" maxlength="40" &gt; &lt;input type="email" name="email" id="id_email" maxlength="40"&gt; &lt;input class="btn btn-primary pull-right" type="submit" value="Register" /&gt; &lt;/form&gt; &lt;script&gt; $("#altForm").submit(function(e){ e.preventDefault(); var username = $("#id_email").val(); $("#id_username").val(username); }); &lt;/script&gt;
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29615775
has title: change input value before submit form using jQuery
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47376784
answer count: 1
has comment: http://stackoverflow.com/comment/47420753
favorite count: 0
upvote count: 2
accepted answer: http://stackoverflow.com/a/29615775
type: AnsweredQuestion
score: 2
tagged with: forms

http://stackoverflow.com/comment/47439993
type: Comment
has text: @JonSurrell I just added some information. Check it out.
type: AnswerComment
comment on: http://stackoverflow.com/a/29649940
score: 0

http://stackoverflow.com/q/29613987
has answer: http://stackoverflow.com/a/29614114
has body: I have a HTML page like that : &lt;html&gt; &lt;body&gt; &lt;h3&gt; Hello Stackoverflow &lt;/h3&gt; &lt;iframe src="test.pdf"&gt;&lt;/iframe&gt; &lt;/body&gt; &lt;/html&gt; I want to print the entire HTML page (CTRL + P in the browser), so that I can get my Hello Stackoverflow and the contents of my pdf file on the same page, like it was rendered on the browser Notes : Files can be pdf, doc or xls By priority solution must work fine on Internet Explorer >= 10 Thank you for your help
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29614227
tagged with: iframe
has title: Print HTML with IFRAME content
score: 1
type: Question
upvote count: 2
answer count: 2
tagged with: printing
downvote count: 1
tagged with: javascript

http://stackoverflow.com/comment/47459589
comment on: http://stackoverflow.com/q/29659968
has text: Instead of positioning the submenu's top at the same height as its parent element, align it with the top of the parent's menu. Or if that's too high, position the submenu's bottom with the bottom of the parent element.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47289853
has text: The value can't be used in `exports.query` if `Promise` is used. You may, though, use the value in the callback supplied to `Promise.prototype.then`. For example `Promise.resolve(42).then((val) => val * 2)` would create a Promise resolved with the value 42 and then create a new Promise resolved with the value 84. You can chain multiple callbacks with `Promise.prototype.then` and `Promise.prototype.catch`, but you can't get the value out of the `Promise` (as far as I know.)
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29569996

http://stackoverflow.com/comment/47499492
type: Comment
comment on: http://stackoverflow.com/q/29681145
has text: The class in your HTML is `twitter-timeline` but in your CSS it's just `timeline`. Aside from that, the Twitter & Facebook widgets are just horrendous and incredibly difficult to style. I'm currently in the process of writing my own to allow me full control over the styling of every single element within them.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/47488044
comment on: http://stackoverflow.com/a/29666104
type: Comment
has text: I'm not going to use this solution simply because it requires me to add yet another buffering canvas to my app for only one shape type, but it's a very clever solution. Bonus points for making the path functions chainable.
score: 1
type: AnswerComment

archive
tags question: http://stackoverflow.com/q/29655752
type: Tag
tag name: archive

http://stackoverflow.com/comment/47409256
score: 0
type: Comment
type: QuestionComment
has text: When it comes to front end development, there are two aspects you should be aware of: the Core JavaScript language and then the Document Object Model (or DOM). The DOM (which isn't specifically tied to JS - but generally accessed by it) is all the browser related "stuff" - like interacting with HTML elements, or opening/closing the window. `window.prompt` is another example. It's provided by the browser, but beware - not all browsers provide the same support.
comment on: http://stackoverflow.com/q/29631785

http://stackoverflow.com/q/29538006
favorite count: 0
accepted answer: http://stackoverflow.com/a/29540653
has comment: http://stackoverflow.com/comment/47228825
upvote count: 1
tagged with: momentjs
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47229340
score: 1
type: Question
has comment: http://stackoverflow.com/comment/47228701
has title: Moment object with just time information (no date)
answer count: 1
has answer: http://stackoverflow.com/a/29540653
tagged with: javascript
has comment: http://stackoverflow.com/comment/47229499
has body: Is there a way to construct a moment object with just hour and minute information? I tried var d = moment({day: 0, month: 0, year: 0, hour: 10, minute: 30}) but calling d.day() returns 6. By the way, if that's possible, is there an easier way to do this without passing the date components as showed above?
downvote count: 0

http://stackoverflow.com/comment/47331135
comment on: http://stackoverflow.com/q/29562688
score: 0
has text: It just says "1428684567492 Looking for connected device."
type: QuestionComment
type: Comment

form-submit
tags question: http://stackoverflow.com/q/29590822
tag name: form-submit
tags question: http://stackoverflow.com/q/29590015
type: Tag
tags question: http://stackoverflow.com/q/29569350

http://stackoverflow.com/a/29589303
type: AcceptedAnswer
has body: You can switch the background image to .bg-home itself. Then, the class which is added on hover will only need to affect the opacity and you'll have a smooth ease-out. See this fiddle : https://jsfiddle.net/Ltv58jmh/2/ .bg-home { position:absolute; left:0; top:0; z-index: -1; width: 100%; height: 100%; background: url("http://static.guim.co.uk/sys-images/Guardian/Pix/pictures/2013/1/11/1357921737290/Masterclass-in-HTML5-and--006.jpg"); background-size: cover; background-repeat: no-repeat; background-position: center; opacity:0; } .home-main-menu { opacity: 1; }
answers question: http://stackoverflow.com/q/29589223
downvote count: 0
has comment: http://stackoverflow.com/comment/47428731
type: Answer
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/29589223

http://stackoverflow.com/comment/47356747
has text: Where did you declare test in controller?? Can u share your code in plunker
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29605557

http://stackoverflow.com/comment/47390284
type: Comment
type: QuestionComment
has text: @RGraham : You got me :) Please post an answer.
comment on: http://stackoverflow.com/q/29621402
score: 0

http://stackoverflow.com/a/29627475
has comment: http://stackoverflow.com/comment/47398820
answers question: http://stackoverflow.com/q/29627324
downvote count: 0
has body: How about this: $( "&lt;i&gt;" ).insertAfter( "a:first" , my_dom_element); UPDATE: For two a tags, i think you can do this: $("&lt;i&gt;").insertAfter('a:eq(0),a:gt(0)', my_dom_element);
has comment: http://stackoverflow.com/comment/47398686
type: Answer
upvote count: 2
has comment: http://stackoverflow.com/comment/47398241
has comment: http://stackoverflow.com/comment/47398074
score: 2

http://stackoverflow.com/a/51539796
downvote count: 0
has comment: http://stackoverflow.com/comment/125395456
has body: How about var isLastChild = element === element.parentNode.lastChild?
score: 1
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/29611933

http://stackoverflow.com/q/29625379
has comment: http://stackoverflow.com/comment/47394085
has comment: http://stackoverflow.com/comment/47394381
tagged with: forms
type: Question
has answer: http://stackoverflow.com/a/29625538
has comment: http://stackoverflow.com/comment/47394074
has answer: http://stackoverflow.com/a/29625999
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/832059
has comment: http://stackoverflow.com/comment/47394539
score: 0
has comment: http://stackoverflow.com/comment/47394021
answer count: 3
tagged with: submit
tagged with: button
has comment: http://stackoverflow.com/comment/47394195
linked to: http://stackoverflow.com/q/5631589
has body: When my submit Button in the form is clicked, I need to simulate that the "Enter button" is pressed. so: clicking on the submit form is equal to pressing Enter on the keyboard. Because I want to have the same method for both... Here is what I have, but until now it doesnt works.. $(document).on('click', '#send', function(){ $("#chatMessageTextarea").focus(); var e = jQuery.Event("keypress"); e.which = 13; e.keyCode = 13; });
has answer: http://stackoverflow.com/a/29625579
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47394127
has title: SImulate "Enter pressing" when submit button is clicked

http://stackoverflow.com/comment/47219742
score: 0
comment on: http://stackoverflow.com/a/29531364
has text: Um.. can you please show me how to implement the necessarry part in my code? I kind of don't get it I think..
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47499925
has text: @vgoklani Explained in the EDIT.
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29680474
type: Comment

http://stackoverflow.com/q/29539704
favorite count: 0
has title: Get Click Coordinates on canvas inside DIV
has comment: http://stackoverflow.com/comment/47232498
has comment: http://stackoverflow.com/comment/47232422
tagged with: css
has comment: http://stackoverflow.com/comment/47233326
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/29655524
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47233239
tagged with: javascript
has comment: http://stackoverflow.com/comment/47233547
has comment: http://stackoverflow.com/comment/47242136
linked to: http://stackoverflow.com/q/29501447
has body: I have a canvas inside a div which makes it scrollable to the right/left if its to large. I need to get the click coordinates on the canvas. I have tried so many different things I have seen but nothing is giving me the right coordinates. I have a rectangle in the canvas and when i click on the rectangle which is at a set coordinate.The "clicked" coordinates are not what they should be the x coordinate is 100px short. Could anyone point me in the right direction ? HTML: &lt;div id="cv"&gt; &lt;canvas id="canvas" width="30000" height="600"&gt;&lt;/canvas&gt; &lt;/div&gt; CSS: &lt;style&gt; #cv{ display: block; width: 1500px; height: 500px; overflow: auto; } &lt;script&gt; canvas.addEventListener("mousedown", doMouseDown, false); function doMouseDown(event){ var totalOffsetX = 0; var totalOffsetY = 0; var canvasX = 0; var canvasY = 0; var currentElement = this; do{ totalOffsetX += currentElement.offsetLeft - currentElement.scrollLeft; totalOffsetY += currentElement.offsetTop - currentElement.scrollTop; } while(currentElement = currentElement.offsetParent) canvasX = event.pageX - totalOffsetX; canvasY = event.pageY - totalOffsetY; } &lt;/script&gt;
tagged with: canvas
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/29655524
has comment: http://stackoverflow.com/comment/47257140

http://stackoverflow.com/comment/47342531
type: Comment
has text: I wrote this code because there are no other ways. Do you know how to display a thumbnail on img tag?
type: AnswerComment
comment on: http://stackoverflow.com/a/29571196
score: 0

http://stackoverflow.com/q/29613882
tagged with: mongodb
answer count: 2
has answer: http://stackoverflow.com/a/29614052
has title: How can I update an email address in meteor?
tagged with: javascript
score: 0
possible better answer: http://stackoverflow.com/a/29614266
has answer: http://stackoverflow.com/a/29614266
tagged with: email
tagged with: meteor
has body: Hi I am building an app using Meteor and need to update my email address. I am using the Meteor accounts package. My form passes an email value into an accountDetails object, which I will pass into a method to update my profile (including my email): Meteor.users.update({_id: this.userId}, { $set: { 'emails.$.address': accountsDetail.email } }); This gives me the error: Exception while invoking method 'saveAccountInfo' MongoError: The positional operator did not find the match needed from the query. Unexpanded update: emails.$.address Here is my user schema: { "_id" : "12345", "emails" : [ { "address" : "abc123@gmail.com", "verified" : false } Can someone help? Thank you in advance!
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29614052
has comment: http://stackoverflow.com/comment/47373456
has comment: http://stackoverflow.com/comment/47373364
has comment: http://stackoverflow.com/comment/47373435
type: Question

http://stackoverflow.com/comment/47824669
type: Comment
has text: I see. It might be intended - note similar behavior here https://material.angularjs.org/#/demo/material.components.autocomplete
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29627380

http://stackoverflow.com/comment/47526661
score: 0
has text: @Gags This should be posted as another question here on StackOverflow and give me the link to it here.
type: AnswerComment
comment on: http://stackoverflow.com/a/29641746
type: Comment

http://stackoverflow.com/q/29532104
answer count: 2
accepted answer: http://stackoverflow.com/a/29532588
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29532357
has answer: http://stackoverflow.com/a/29532357
has comment: http://stackoverflow.com/comment/47217416
favorite count: 0
score: 2
upvote count: 2
has title: javascript can not redifine global object inside function
has answer: http://stackoverflow.com/a/29532588
has body: Here is the code,when the function change the attribute of the object,it works,but redefine the object, nothing happened, why? I have found some answers,but I still don't know what's happened when the object as a parameter inside a function. var person = {name: "tom"}; function changeName(person) { person.name = "new tom"; person = {}; } changeName(person); console.log(person); //{name: "new tom"}
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47217955
type: Question

http://stackoverflow.com/q/29542101
has comment: http://stackoverflow.com/comment/47236002
answer count: 2
has answer: http://stackoverflow.com/a/29542156
tagged with: javascript
has title: Can setTimeout be used with a function inside a closure?
has answer: http://stackoverflow.com/a/29542774
has comment: http://stackoverflow.com/comment/47235901
score: 0
type: AnsweredQuestion
has body: Can JavaScript's setTimeout function be used with functions that are inside a closure? What if the call to setTimeout is made from within that same closure? With my attempts, it appears that you cannot. I'm not sure if I'm missing anything, though. Basically, I would like to do this: var ButtonCycler = (function() { var ButtonCycler = {}; var autoCycle; var idx = 0; var buttonIds = []; buttonIds[0] = "id1"; buttonIds[1] = "id2"; //"Public" methods ButtonCycler.startAutoCycle = function() { autoCycle = true; cycleButtons(); } ButtonCycler.stopAutoCycle = function() { autoCycle = false; } //Worker function (effectively private because it's in the closure) function cycleButtons() { var radioButton; if(autoCycle) { radioButton = document.getElementById(buttonIds[idx]); radioButton.checked = true; idx++; if(idx &gt;= buttonIds.length) { idx = 0; //Start over at first button } setTimeout('cycleButtons()',2500); //Delay for 2.5 seconds } } return ButtonCycler; })(); //IIFE Then in onload for the page, I can do this: ButtonCycler.startAutoCycle(); And when the user manually clicks one of the radio buttons, I can do this: ButtonCycler.stopAutoCycle(); And the mechanism for performing the cycling can be nicely encapsulated in the closure. When I try this, I get an error that cycleButtons does not exist. The initial call to cycleButtons succeeds, though. It is the call initiated by the call to setTimeout that is failing.
possible better answer: http://stackoverflow.com/a/29542774
type: Question
accepted answer: http://stackoverflow.com/a/29542156

http://stackoverflow.com/comment/47250023
score: 0
type: AnswerComment
has text: I corrected all your syntax errors. If `.tallarrowsright` exists on document ready the function should execute. Check if you have the class name right, it should be the same as the one you use in the jQuery selector.
type: Comment
comment on: http://stackoverflow.com/a/29548989

http://stackoverflow.com/a/29540332
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29538866
has body: Yet another approach would be updating the counter of hidden items whenever a single item is hidden. Of course this would require the hiding code to be placed within your controller, like this: $scope.allHidden = false; // if items can have hide = true property set already from the start var hiddenItems = $scope.items.filter(function (item) { return item.hide; }).length; // or if they are all initially visible, a straightforward approach: // var hiddenItems = 0; $scope.hideItem = function (item) { item.hide = true; hiddenItems++; if (hiddenItems === $scope.items.length) { $scope.allHidden = true; } } and the hiding would need to be done like this: {{ item.name }} hide jsfiddle: https://jsfiddle.net/723kmyou/1/ Pros for this approach no need to iterate over the full items array when doing the "should main div be hidden?" check -> possibly better performance Cons for this approach you need to place the hideItem function inside your controller
upvote count: 1
score: 1

http://stackoverflow.com/comment/47460681
has text: What is `$.eventsource`? jQuery plugin?
comment on: http://stackoverflow.com/q/29660605
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/q/29655237
tagged with: checkbox
score: 11
downvote count: 0
tagged with: twitter-bootstrap
tagged with: buttongroup
type: Question
has answer: http://stackoverflow.com/a/29655400
accepted answer: http://stackoverflow.com/a/29655400
type: AnsweredQuestion
upvote count: 11
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: Twitter Bootstrap getting state of checkbox button group
has body: There are several questions related to Twitter Bootstrap's button radio/checkbox groups, but none seem to be of the new Bootstrap convention (I'm using v3.3.4) or my addressing my question. The old convention was to declare a that surrounded a number of 's, and the surrounding div also had a data-toggle attribute of either buttons-checkbox or buttons-radio to look something like this: Btn 1 Btn 2 Btn 3 However, the convention for creating these kinds of groups has changed, as can be seen on the Bootstrap Javascript page for buttons (http://getbootstrap.com/javascript/#buttons-checkbox-radio): Checkbox 1 (pre-checked) Checkbox 2 Checkbox 3 As you can see, the buttons are now actually labels with child input fields of type checkbox or radio that are styled to look like buttons. I would like to set up a .on('click') event that captures the state of the button that has just been clicked, however the logic that follows is oddly backwards (and Javascript implementation of this is seemingly incomplete, at least in my eyes -- explanation to follow). Say, I'd like to set up a listener for the second label/checkbox/button and determine whether or not the label/checkbox/button is active/checked - I'd set up the following code: $('#label2').on('click', function(){ console.log($(this).hasClass('active')); }); I would expect the above code to, when the button has been pressed to "activate" the label/checkbox/button, to print true to the console. It prints false. This is because the .on('click') listener gets fired before the button state changes, and therefore I would have to invert the logic for any actions I would want to take based on the button state. Seems backwards to me. (jsFiddle illustration: http://jsfiddle.net/mmuelle4/qq816po7/) There are some other libraries out there that catch this the "sensible" way, such as the Bootstrap Switch library (http://www.bootstrap-switch.org/). The Bootstrap Switch library has a switchChanged event that catches a switch change after a c…

http://stackoverflow.com/comment/47454646
comment on: http://stackoverflow.com/q/29657165
score: 0
type: QuestionComment
has text: @jfriend00 Thank you for the advise, of using feature detection, and I'm sure I'll be using that link later on, but for this web application, I would rather look at the user agent.
type: Comment

http://stackoverflow.com/a/29654900
score: 4
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29654822
type: Answer
answers question: http://stackoverflow.com/q/29654822
has comment: http://stackoverflow.com/comment/47450818
has body: You can do this using jquery: $(document).ready(function() { $('a').click(function(e) { e.preventDefault(); var text = $(this).text(); $('input[type=text]').val(text); }); });
upvote count: 4
has comment: http://stackoverflow.com/comment/47449600

http://stackoverflow.com/q/29608660
score: 1
has title: Retrieving the top value or marginTop value of dynamically created elements when clicking
type: Question
tagged with: javascript
tagged with: jquery
upvote count: 1
has comment: http://stackoverflow.com/comment/47362915
answer count: 1
accepted answer: http://stackoverflow.com/a/29608749
favorite count: 0
has body: I am trying to find to top of an element when I click on it. How do I do this? When I do the following, it returns 0px for each element I click on, $(".schematics").on("click touchstart", function(ev){ var top = $(this).css("marginTop"); console.log(top, $(this).height()); ev.preventDefault(); }) When I change it to the following, I get the value of auto, $(".schematics").on("click touchstart", function(ev){ var top = $(this).css("top"); console.log(top, $(this).height()); ev.preventDefault(); }) These elements are being appended to a parent div with Javascript, I don't know if that has anything to do with it or not. If it'll help to add the script that's appending them, let me know and I'll add it.
has answer: http://stackoverflow.com/a/29608749
tagged with: css
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/comment/47377942
type: Comment
type: QuestionComment
has text: _"The JS function handling this is running on **click**."_ ? Appear only `change` event at `js` at OP `$(document).on('change','.security_sub_type',function() {//do stuff}).change()` ? Tried adding `$(document).on('change click, function(){//do stuff}).trigger("click")` ?
comment on: http://stackoverflow.com/q/29616302
score: 0

http://stackoverflow.com/comment/47453137
comment on: http://stackoverflow.com/a/29656650
score: 0
type: AnswerComment
type: Comment
has text: Thanks @lonesomeday! I have accepted that the question is silly with this constraints. I just read about passing mixins to your LESS css definition. Let me explore for this solution if it provides me the solutions. And again thanks all for your valuable suggestions. **#less** needs to be checked here.

http://stackoverflow.com/q/29595149
has title: Only the last menu is working
score: -2
has body: The value of u and v are coming correctly as 1 and 0... but the values are not being used in the statement "t[i].children[v].onclick=function(){}" ..!! This works perfectly when I used 1 in the place of u and 0 in the place of v!!! Here is the code : Menu First Part Second Part Menu First Part Second Part thank you in advance... :)
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/29595302
has comment: http://stackoverflow.com/comment/47337475
has comment: http://stackoverflow.com/comment/47337231
downvote count: 2
has answer: http://stackoverflow.com/a/29595302
type: AnsweredQuestion
upvote count: 0
type: Question

http://stackoverflow.com/comment/47342769
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29597988
has text: @Kaiido: it should the same as the ordinary `window` global, if the docs are correct.

http://stackoverflow.com/q/29580065
tagged with: javascript
has body: I want to replace sometext by defined text with the help of angular JS. My html is Directive sometext and JS is var app = angular.module('myApp', []); app.directive('helloWorld', function() { return { restrict: 'AE', replace: 'true', template: ' {{headline}}' }; }); My browser says that, Error: [$compile:tplrt] Template for directive 'helloWorld' must have exactly one root element.... How to solve this. Thank you.
favorite count: 0
accepted answer: http://stackoverflow.com/a/29580139
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47308510
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29580139
type: Question
has title: What's wrong with my Angular JS
score: 0
upvote count: 1
answer count: 1
downvote count: 1

http://stackoverflow.com/comment/47465180
has text: This is not scrollable, absolute elements are out of flow. Make it relative and I'll give you a thumbs up, but that has to work a bit differently.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29662705
type: AnswerComment

http://stackoverflow.com/comment/47491987
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29677177
type: Comment
has text: I've corrected everything but all i'm getting is Notice: Undefined index: firstName in C:\xampp\htdocs\contact.php on line 5 NULL

http://stackoverflow.com/comment/47286460
type: QuestionComment
comment on: http://stackoverflow.com/q/29568479
has text: I know the algorythm but I need to see the code of it
score: 0
type: Comment

http://stackoverflow.com/comment/47438084
type: QuestionComment
score: 3
has text: *"I have a task to implement jQuery on Javascript."* Er....jQuery ***is*** implemented "on" (in) JavaScript.
comment on: http://stackoverflow.com/q/29649030
type: Comment

http://stackoverflow.com/comment/47456770
score: 0
has text: Here is an updated fiddle. Time is a pain in the ass to deal with. I cant spend any more time on this..... I suggest trying a little more, and posting another post once you get closer. Also, your last comment is possible. https://jsfiddle.net/cwqxzm6o/7/
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29657454

http://stackoverflow.com/comment/47356643
has text: What is the difference here betwen writing the selector as you've done and this `$(".iconteiner > li > span")`?
type: Comment
comment on: http://stackoverflow.com/a/29605274
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47314912
type: AnswerComment
score: 0
has text: Ok Finally It worked. Would It be Possible to explain your java code to me. the table is straight forward but I would like to know about javascript that you provide me, because I havent use such functions in lesson. and I dont know how this all java code of yours work. I just want to understand so I can exaplain to totor what it does.
type: Comment
comment on: http://stackoverflow.com/a/29556977

http://stackoverflow.com/comment/47408229
has text: content-type is application/javascript
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29632198

http://stackoverflow.com/q/29570744
has title: Tree-like data structure in JS that allows for fastest node lookup?
has comment: http://stackoverflow.com/comment/47516079
has comment: http://stackoverflow.com/comment/47290953
favorite count: 0
has comment: http://stackoverflow.com/comment/47510763
has answer: http://stackoverflow.com/a/29667338
score: 16
downvote count: 1
type: AnsweredQuestion
tagged with: oop
tagged with: http://stackoverflow.com/tag/json
possible better answer: http://stackoverflow.com/a/29618216
has answer: http://stackoverflow.com/a/29618216
upvote count: 17
type: Question
accepted answer: http://stackoverflow.com/a/29667338
answer count: 2
has comment: http://stackoverflow.com/comment/47291354
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/47290885
tagged with: data-structures
has body: How would I go about creating a tree-like data structure in JS, where, I can have access to things like reference to parent node, id based node lookup, having access to length (number) of children nodes, index based lookup etc? this is basically the API I am envisioning: var rootNode = DataStructure.getRoot(); var child1 = rootNode.addNode('child1'); //added a node with id 'child1' child1.addNode('innerChild1'); child1.addNode('innerChild2'); rootNode.getChildById('child1') //should be same node as var child1 rootNode.getAtIndex(0) //should be same node as var child1 child1.parent() //should be rootNode child1.getAtIndex(0) // should be node with id 'innerChild1' child1.getAtIndex(1) // should be node with id 'innerChild2' child1.length() //should be 2 etc.. I understand its a broad question, but I wonder if anyone could recommend a way to approach this and/or any libraries that might be doing it already? Should i just dynamically create an XML and work with its native methods? Would that be the fastest ?
linked to: http://stackoverflow.com/q/3858411
has comment: http://stackoverflow.com/comment/47538110

meteor-helper
tag name: meteor-helper
tags question: http://stackoverflow.com/q/29600194
tags question: http://stackoverflow.com/q/29641220
tags question: http://stackoverflow.com/q/29596408
tags question: http://stackoverflow.com/q/29534485
tags question: http://stackoverflow.com/q/29670651
tags question: http://stackoverflow.com/q/29617844
type: Tag

http://stackoverflow.com/comment/47487654
type: QuestionComment
has text: using css `overflow` property maybe?
comment on: http://stackoverflow.com/q/29673342
score: 0
type: Comment

http://stackoverflow.com/comment/47466442
type: AnswerComment
comment on: http://stackoverflow.com/a/29653289
score: 0
type: Comment
has text: When to call `setCoords` is also documented altough it is in the [wiki](https://github.com/kangax/fabric.js/wiki/When-to-call-setCoords)

http://stackoverflow.com/q/29609953
has answer: http://stackoverflow.com/a/29612059
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/10434001
possible better answer: http://stackoverflow.com/a/29612059
score: 2
downvote count: 0
has title: Javascript file not loading in MEAN stack application
type: Question
type: AnsweredQuestion
tagged with: mean-stack
has body: I am playing around and trying to learn the MEAN stack to create a single page application. I was able to get my back-end routes to work correctly. I've tested it using Postman and get the results I expect, however I cannot get my front-end to talk to the back-end correctly. I reduced my front-end to very basic html and javascript, but still get a syntax error "Unexpected token <". When I inspect my coreTest.js file in the browser, I see that it's just a copy of my html file, rather than javascript code. When I run index.html by itself (without server.js) coreTest.js runs just fine. I'm not sure why, when running my server.js file, my coreTest.js file doesn't work properly. server.js // Setup var express = require('express'); var app = express(); // create app w/ express var mongoose = require('mongoose'); // used for MongoDB connection var morgan = require('morgan'); // log requests to the console var bodyParser = require('body-parser'); // pull information from HTML POST var methodOverride = require('method-override'); // simulate DELETE and PUT requests // Configure mongoose.connect('localhost:27017/test'); // connect to localhost db "test" // varify connection var db = mongoose.connection; db.on('error', console.error.bind(console, 'connection error: ')); app.use(express.static(__dirname + '/public')); // set static files location app.use(morgan('dev')); // log every request to console app.use(bodyParser.urlencoded({'extended':'true'})); // parse application/x-www-form-url app.use(bodyParser.json()); app.use(bodyParser.json({ type: 'application/vnd.api+json' })); // parse vnd.api+json as json app.use(methodOverride()); // define db model var Todo = mongoose.model('Todo', { text: String }); var router = express.Router(); router.route("/todos") .get(function(req, res) { Todo.find(function(err, todos) { if (err) res.send(err); res.json(todos); }); }) .post(function(req, res) { var todo = new Todo(); todo.text = req.body.text; todo.save(function(err) { if (err) res.…
tagged with: javascript
has answer: http://stackoverflow.com/a/29610096
accepted answer: http://stackoverflow.com/a/29610096
upvote count: 2
answer count: 2
favorite count: 0

http://stackoverflow.com/q/29541526
has comment: http://stackoverflow.com/comment/47235108
has answer: http://stackoverflow.com/a/29541816
possible better answer: http://stackoverflow.com/a/29541722
upvote count: 0
has comment: http://stackoverflow.com/comment/47235096
has comment: http://stackoverflow.com/comment/47234959
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47235066
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29542165
has title: How to implement this layout
has comment: http://stackoverflow.com/comment/47235025
tagged with: css
answer count: 4
has comment: http://stackoverflow.com/comment/47234939
favorite count: 0
has body: I found a web page which shows only 3 events in a grid and when the screen is re-sized less a certain width, it not only relocates the 3 events into a list but also changes the layout inside each event. I have tried many ways to make it look like that web page, but have not got any luck. this is the web page And this is what I have done: CodePen /* -- DEFAULTS -- */ div, ul, li { margin: 0; padding: 0; list-style-type: none; } /* -- FLUID GRID STYLES -- */ #Grid { margin-bottom: 40px; text-align: justify; font-size: 0.1px; } #Grid li { display: inline-block; background: #eee; width: 23%; padding-top: 23%; /* Used instead of height to give elements fluid, width-based height */ margin-bottom: 2.5%; } #Grid:after { content: 'haha'; display: inline-block; width: 100%; border-top: 10px dashed #922d8d; /* Border added to make element visible for demonstration purposes */ } ul li .icon { width: 100%; display: table; min-height: 300px; height: 300px; padding: 0; background: #545454 url(https://www.nike.com/events-registration/client-dist/assets/images/multi-card-bg.png) no-repeat center center; } #Grid .placeholder { padding: 0; border-top: 10px solid #922d8d; /* Border added to make element visible for demonstration purposes */ } /* -- MEDIA QUERIES DEFINING RESPONSIVE LAYOUTS -- */ /* 3 COL */ @media (max-width: 800px) { #Grid li { width: 31%; padding-top: 31%; margin-bottom: 3%; } } /* 2 COL */ @media (max-width: 600px) { #Grid li { width: 48%; padding-top: 48%; margin-bottom: 4%; } } /* SINGLE COL */ @media (max-width: 400px) { #Grid li { width: 100%; padding-top: 100%; margin-bottom: 5%; } } /* -- LEGEND STYLES (NOT PART OF GRID FRAMEWORK) -- */ h1 { font: 600 20px"Helvetica Neue"; text-align: right; text-transform: uppercase; } label { padding: 8px 15px; margin-bottom: 20px; display: block; font: 100 22px"Helvetica Neue"; border-left: 10px solid #922d8d; } label:last-of-type { border-left: 10px dotted #922d8d; } p { font: 200 15px/1.5em"Helvetica Neue"; max-width: 400…
tagged with: twitter-bootstrap
downvote count: 1
has comment: http://stackoverflow.com/comment/47234906
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29541722
accepted answer: http://stackoverflow.com/a/29542165
has answer: http://stackoverflow.com/a/29541669
has comment: http://stackoverflow.com/comment/105280486
score: -1
has comment: http://stackoverflow.com/comment/105284111

http://stackoverflow.com/a/29682276
has comment: http://stackoverflow.com/comment/47502441
answers question: http://stackoverflow.com/q/29681752
downvote count: 0
type: Answer
score: 1
upvote count: 1
has body: I know that the jQuery methods are attractive, but one of the easiest ways to do this is to put your animation into a CSS class, and then use jQuery to add that class to your element. All of the magic happens within transition. In this case, we tell the element that any changes to transform will take 1 second. Likewise, any changes to opacity will wait 1 second before beginning, and then will take half a second to execute. .menuButton { transition: transform 1s, opacity 500ms 1s; } .menuButton.hideMe { transform: rotate(90deg); opacity: 0; } Now, your jquery call will be: $('.menuButton').click(function() { $(this).addClass('hideMe'); });//end click Try it yourself with the following example: http://jsfiddle.net/dancingplatypus/qgnmk6s3/

http://stackoverflow.com/comment/47309769
type: QuestionComment
comment on: http://stackoverflow.com/q/29579706
has text: @AstroCB , haha ok but the 1st line needs to be what originally was ! ;)
score: 0
type: Comment

http://stackoverflow.com/q/29605134
tagged with: api
tagged with: single-page-application
answer count: 1
has answer: http://stackoverflow.com/a/29605205
tagged with: angularjs
type: UnansweredQuestion
type: Question
linked to: http://stackoverflow.com/q/12617103
has comment: http://stackoverflow.com/comment/47355993
tagged with: javascript
has title: Single page application store store user data
has body: I am developing a single page application with angularjs. I am cerating a simple login form to get user data and use it during session. But, if client refreshes the page, user info is removing and user routing to login page again. I can not use cookie because user validate operation is done by a rest service. How can I store user data on browser during session. user data should be delete on browser close. &lt;script&gt; var app = angular.module("MyApp", ["ui.router"]); app.factory("AuthService", ["$rootScope",function($rootScope){ return { setUserCredentials: function(user){ $rootScope.user = { isAuthenticated: true, username: user.username }; $rootScope.$emit('handleLogin', { user: user }); }, removeUserCreadentials: function(){ $rootScope.user = undefined; }, isAuthenticated: function(){ return $rootScope.user != null; }, getUser: function(){ return $rootScope.user; } } }]); app.run(function($rootScope, $state, AuthService){ $rootScope.$on("$stateChangeStart", function(event, toState, toParams, fromState, fromParams){ if(toState.authenticate &amp;&amp; !AuthService.isAuthenticated()){ $state.transitionTo("login"); event.preventDefault(); } }); $rootScope.$on("handleLogin",function(e, args){ console.log(e); console.log(args); $state.transitionTo("home"); }); $rootScope.$on("handleLogout",function(e, args){ console.log(e); console.log(args); }); }); app.config(function($stateProvider, $urlRouterProvider){ $urlRouterProvider.otherwise('/home'); $stateProvider. state('home',{ url: '/home', templateUrl: 'templates/home.html', authenticate: true }). state('login',{ url: '/login', templateUrl: 'templates/login.html', controller: 'LoginController', authenticate: false }); $urlRouterProvider.otherwise("/login"); }); app.controller('LoginController', ["$scope", "AuthService", function($scope, AuthService){ $scope.login = function(){ if($scope.username == "myuser" &amp;&amp; $scope.password == "123456"){ AuthService.setUserCredentials({ "username": "myuser" }); } } }]); app.…
tagged with: browser
score: 0

http://stackoverflow.com/q/29668533
tagged with: prototyping
type: Question
has comment: http://stackoverflow.com/comment/47475521
has body: I want to make a live prototype to demonstrate transactions between two users in different browsers. It should keep the state of the UI in sync between two sessions when each user performs an action. For instance: when one user presses purchase in one browser window, the other user should see that the item is marked as sold in another. There's nothing new about this, except that I need the absolute minimum solution to fake this behaviour in order to be able to iterate quickly to optimize the flow before starting the actual implementation. I was thinking Flux and React, or maybe node, but I'm completely new to these frameworks. Does anyone here have a good suggestion to the best way of approaching this without ending up building a full application? Or maybe to direct me to good starting points?
tagged with: asynchronous
tagged with: node.js
has comment: http://stackoverflow.com/comment/47476835
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47476197
has comment: http://stackoverflow.com/comment/47476849
has title: Simple push server for prototyping
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29669426
tagged with: reactjs-flux

http://stackoverflow.com/q/29596357
downvote count: 17
tagged with: javascript
linked to: http://stackoverflow.com/q/157260
has comment: http://stackoverflow.com/comment/47340025
accepted answer: http://stackoverflow.com/a/29596358
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47339803
has comment: http://stackoverflow.com/comment/47339716
has body: I am used to using jQuery for manipulating the DOM, for example: var mything = $("#mything"); mything.on("click", function() { mything.addClass("red"); mything.html("I have sinned."); }); But now I want to do the same things with Vanilla JavaScript. Is this possible? How can I do it? Notice: This question is intended to be a comprehensive resource on Vanilla JavaScript DOM manipulation.
has comment: http://stackoverflow.com/comment/47340293
has comment: http://stackoverflow.com/comment/47340239
score: -1
favorite count: 0
type: Question
linked to: http://stackoverflow.com/q/3934826
answer count: 1
upvote count: 16
has comment: http://stackoverflow.com/comment/47340004
has title: How can I manipulate the DOM without a library like jQuery?
has answer: http://stackoverflow.com/a/29596358
has comment: http://stackoverflow.com/comment/47375586
has comment: http://stackoverflow.com/comment/47339767
tagged with: dom
linked to: http://stackoverflow.com/q/4616694

http://stackoverflow.com/comment/47238607
type: AnswerComment
score: 0
type: Comment
has text: As it was a added library on jsFiddle I assumed that this would be acceptable
comment on: http://stackoverflow.com/a/29543330

http://stackoverflow.com/a/29637067
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29636989
has body: $(document).ready(function () { $(".x").click(function () { $("#tcm_content").hide(); $("#bazinga_content").hide(); }); }); //thumbnails $("#tcm").click(function () { $("#tcm_content").show("slow"); }); $("#bazinga").click(function () { $("#bazinga_content").show("slow"); });

http://stackoverflow.com/a/29679348
type: Answer
score: 2
answers question: http://stackoverflow.com/q/29679263
accepted answer of: http://stackoverflow.com/q/29679263
has body: your iife is not correct, you are missing invoking part of iife(Immediately-invoked function expression), you are not invoking it (function () { var myApp = angular.module('myApp', []); myApp.controller('ProductController', ['$scope', function ($scope) { $scope.Message = "Hello World"; } ]); })(); Working Demo: (function () { var myApp = angular.module('myApp', []); myApp.controller('ProductController', ['$scope', function ($scope) { $scope.Message = "Hello World"; } ]); })(); {{Message}}
type: AcceptedAnswer
downvote count: 0
upvote count: 2

http://stackoverflow.com/comment/129773185
type: Comment
has text: Thank you for this. I had the same problem. The request works fine but I kept receiving a 500 and I didn't know why.
comment on: http://stackoverflow.com/a/29580792
score: 0
type: AnswerComment

http://stackoverflow.com/q/29579088
type: Question
has body: I am close to where I want to be on this. Javascript Regex: I need to match words that only start with numbers, aren't certain reserved words ('in','between','and','or') and aren't contained in quotes. I am almost there I just can't seem to figure out how to negate my reserved words. It is probably obvious this is part of a SQL validation and I'm picking out fields names to validate them in a separate routine. I could easily strip them using multiple expressions but thought I'd make an academic effort and try it this way. Here's where I'm at. Help, suggestions, improvements and explanations all appreciated. \(?=([^\']*\'[^\']*\')*[^\']*$)+([A-z][0-9A-z][^\s\=\&gt;\&lt;\)\(]*)\gi Here are some test cases: (THIS &gt;= CURRENTBORROWERBALANCE) [match CURRENTBORROWERBALANCE] (THIS = 'anything') [match THIS] (THIS BETWEEN '2007-01-01' and '2010-01-01') [match THIS] and a link to test cases and update regex: http://regexr.com/3aq57
upvote count: 0
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/29580409
tagged with: regex
has comment: http://stackoverflow.com/comment/47311132
favorite count: 0
has comment: http://stackoverflow.com/comment/47320252
accepted answer: http://stackoverflow.com/a/29580409
downvote count: 1
has comment: http://stackoverflow.com/comment/47306593
type: AnsweredQuestion
score: -1
has comment: http://stackoverflow.com/comment/47309419
has title: Regex Multiple Lookaheads and Word Exclusion

http://stackoverflow.com/q/29626420
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47396533
score: 1
tagged with: scroll
upvote count: 1
has comment: http://stackoverflow.com/comment/47396484
type: Question
accepted answer: http://stackoverflow.com/a/29626845
linked to: http://stackoverflow.com/q/16204318
tagged with: javascript
tagged with: jquery
has title: Changing text content on scroll position
answer count: 1
downvote count: 0
has body: I found a solution that didn't work mainly that I want. Here it is: topic url and this solution works for me: if(pos.top &gt;= $(this).offset().top &amp;&amp; pos.top &lt;= $(this).next().offset().top) { $('#date').html($(this).find('.description').text()); return; } jsfiddle but I want to change content description in gray box more smooth. I've tried to give animation in CSS for it, but it didn't work.
favorite count: 0
has answer: http://stackoverflow.com/a/29626845
has comment: http://stackoverflow.com/comment/47396640
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/47425139
has text: Thanq i corrected it but, what i want is displaying percentage
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29634460
type: Comment

http://stackoverflow.com/q/29560863
answer count: 2
has comment: http://stackoverflow.com/comment/47271664
has answer: http://stackoverflow.com/a/29562757
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/29564797
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47271668
has title: Hide DIV using cookies by user action, in case click on close buttom or popup image
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47272330
linked to: http://stackoverflow.com/q/4825683
upvote count: 1
has comment: http://stackoverflow.com/comment/47271854
tagged with: popup
tagged with: cookies
has body: I have a popup that is in the lower right corner and came together to scroll the page down, however to close the popup or by clicking on the popup, I wish the browser remembers the User click action and did not show more popup at least to the same exit the browser, through cookies, please someone help me? see my code below: teste
has comment: http://stackoverflow.com/comment/47272790
type: Question

http://stackoverflow.com/q/29569591
tagged with: jquery
has comment: http://stackoverflow.com/comment/47288848
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/20035101
has comment: http://stackoverflow.com/comment/47289077
answer count: 0
has title: GET request failing with No access control allow origin. Google DHC extension retrieves the data just fine. Am I doing anything wrong?
type: Question
has body: I am trying to access financial statements from edgar-online. This is my GET request: var edgarresults = new Array(); edgardata = ['aapl','msft'] for(j=0; j&lt;edgardata.length; j++){ var url1='http://benalman.com/code/projects/php-simple-proxy/ba-simple-proxy.php?url=edgaronline.api.mashery.com%2Fv1%2Fcorefinancials%3Fprimarysymbols%3D'; edgarresults.push( $.getJSON(url1, edgardata[j] +'%26conceptGroups%3DBalanceSheetConsolidated%26debug%3Dfalse%26sortby%3Dprimarysymbol%2Basc%26appkey%3Dh9f7er3s78ypqyytqebrjeys') .done(function (results1) { edgarresults.push(results1); console.log (results1); }) .fail(function (jqxhr, textStatus, error) { var err = textStatus + ", " + error; }) ); } when you paste the url in the chrome address bar or test it on DHC client (google chrome extension), the output is nicely formatted json data. Here is the url: http://benalman.com/code/projects/php-simple-proxy/ba-simple-proxy.php?url=edgaronline.api.mashery.com%2Fv1%2Fcorefinancials%3Fprimarysymbols%3Dmsft%26conceptGroups%3DBalanceSheetConsolidated%26debug%3Dfalse%26sortby%3Dprimarysymbol%2Basc%26appkey%3Dh9f7er3s78ypqyytqebrjeys/ I am not sure how the get request is not being processed. I keep getting the no access control allow origin error.
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has comment: http://stackoverflow.com/comment/47288994
score: 0
linked to: http://stackoverflow.com/q/10143093

http://stackoverflow.com/comment/47436734
comment on: http://stackoverflow.com/a/29648236
has text: That's disable that input field, I don't want disable this input, I want to add alert when someone checked a specified checkbox, and when he click submit form then he got alert "you must fill Optional field".
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47503392
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29683227
has text: `$(".bio-input").focus();`
score: 5

http://stackoverflow.com/comment/47462257
has text: why are you setting `this` to a string? or the first argument to a function? or, is `b` not a function?
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29661301

http://stackoverflow.com/comment/47457323
type: Comment
has text: Bingo. Accepted. I'm still going to look into generating this as a simple draw to the canvas via D3, but this is exactly what I'm looking for. Thanks!
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29658113

http://stackoverflow.com/comment/47300983
comment on: http://stackoverflow.com/q/29576218
score: 0
has text: https://forum.jquery.com/topic/jquery-validate-of-2-dependant-input-fields
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47493007
type: Comment
has text: The javascript is set up to identify the images by Id. Due to using a repeater, the Id's are all going to be the same(therefore, they can't be identified by Id). So yes the problem is definitely in the Javascript but, I don't know enough to even know where to begin. Also, onload the first preview isn't rendering. So I am wondering if the javascript is unable to identify my img src when it is binded like it is. Perhaps there is away to do all of this from the back and catch the images, create temporary id's and absolute paths for the Javascript to read?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29677246

http://stackoverflow.com/a/29585960
score: 1
upvote count: 1
has body: Soundcloud has an API which lets you get information on a user. Documentation can be found here: https://developers.soundcloud.com/docs/api/reference#users
answers question: http://stackoverflow.com/q/29585904
type: Answer
downvote count: 0

http://stackoverflow.com/q/29614887
tagged with: asp.net
has comment: http://stackoverflow.com/comment/47375485
type: Question
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/29615182
has comment: http://stackoverflow.com/comment/47375547
tagged with: css
score: 0
answer count: 1
linked to: http://stackoverflow.com/q/29681835
has comment: http://stackoverflow.com/comment/47375620
accepted answer: http://stackoverflow.com/a/29615182
has body: I am using asp.net webform and trying to make my checkbox look like this: http://bootsnipp.com/snippets/featured/jquery-checkbox-buttons I trying to copy the html and js code from above link to my page but it is not working, probably missing CSS and such... What do I need to add to my page to have the check-boxes look like the pic above, can someone give a full example (included html, css and script)? This is the code from the link above: it is even working on here: http://jsfiddle.net/DcYhf/65/ But I copy it to my page it is not working anymore... HTML Primary JS $(function () { $('.button-checkbox').each(function () { // Settings var $widget = $(this), $button = $widget.find('button'), $checkbox = $widget.find('input:checkbox'), color = $button.data('color'), settings = { on: { icon: 'glyphicon glyphicon-check' }, off: { icon: 'glyphicon glyphicon-unchecked' } }; // Event Handlers $button.on('click', function () { $checkbox.prop('checked', !$checkbox.is(':checked')); $checkbox.triggerHandler('change'); updateDisplay(); }); $checkbox.on('change', function () { updateDisplay(); }); // Actions function updateDisplay() { var isChecked = $checkbox.is(':checked'); // Set the button's state $button.data('state', (isChecked) ? "on" : "off"); // Set the button's icon $button.find('.state-icon') .removeClass() .addClass('state-icon ' + settings[$button.data('state')].icon); // Update the button's color if (isChecked) { $button .removeClass('btn-default') .addClass('btn-' + color + ' active'); } else { $button .removeClass('btn-' + color + ' active') .addClass('btn-default'); } } // Initialization function init() { updateDisplay(); // Inject the icon if applicable if ($button.find('.state-icon').length == 0) { $button.prepend(' '); } } init(); }); }); This is what I have now:
has title: Styling Checkbox Buttons using jQuery and Boostrap
tagged with: javascript
tagged with: jquery
type: AnsweredQuestion

http://stackoverflow.com/q/29568577
score: 0
has answer: http://stackoverflow.com/a/29568628
has comment: http://stackoverflow.com/comment/47286592
possible better answer: http://stackoverflow.com/a/29568709
tagged with: php
has answer: http://stackoverflow.com/a/29568709
type: Question
has body: I am trying to create an image upload field in my application based on this question: Send FormData and String Data Together Through JQuery AJAX? and this tutorial: http://www.formget.com/ajax-image-upload-php/ I have heard it is quite difficult, this is what i have tried. HTML &lt;form method="POST" action="" id="logo_upload"&gt; &lt;input type="file" name="logo_location" id="logo_location" enctype="multipart/form-data"&gt; &lt;button type="submit" name="file_test" id="file_test"&gt;Test Upload&lt;/button&gt; &lt;/form&gt; JQuery $('#logo_upload').submit(function(e) { e.preventDefault(); var formData = new FormData(); var file_data = $('#logo_location')[0].files[0]; formData.append("file", file_data[0]); $.ajax({ url: "../../../controllers/ajax_controller.php?action=image_upload", type: 'POST', data: formData , cache: false, contentType: false, processData: false, id: id }); }); PHP var_dump($_FILES); var_dump($_POST); As you can see, I haven't got to the uploading side of things yet. Result &lt;pre class='xdebug-var-dump' dir='ltr'&gt; &lt;b&gt;array&lt;/b&gt; &lt;i&gt;(size=0)&lt;/i&gt; &lt;i&gt;&lt;font color='#888a85'&gt;empty&lt;/font&gt;&lt;/i&gt; &lt;/pre&gt; &lt;pre class='xdebug-var-dump' dir='ltr'&gt; &lt;b&gt;array&lt;/b&gt; &lt;i&gt;(size=0)&lt;/i&gt; &lt;i&gt;&lt;font color='#888a85'&gt;empty&lt;/font&gt;&lt;/i&gt; &lt;/pre&gt; I can't see what i am doing wrong, I am getting a result so it is getting to the right place, can anyone point me in the right direction? EDIT: added #logo_upload in form var file_data = $('#logo_location')[0].files[0]; EDIT: replaced data with formData variable EDIT: added attribute: enctype="multipart/form-data" New Result: &lt;pre class='xdebug-var-dump' dir='ltr'&gt; &lt;b&gt;array&lt;/b&gt; &lt;i&gt;(size=1)&lt;/i&gt; 'file' &lt;font color='#888a85'&gt;=&amp;gt;&lt;/font&gt; &lt;small&gt;string&lt;/small&gt; &lt;font color='#cc0000'&gt;'undefined'&lt;/font&gt; &lt;i&gt;(length=9)&lt;/i&gt; &lt;/pre&gt;
has comment: http://stackoverflow.com/comment/47286621
accepted answer: http://stackoverflow.com/a/29569343
answer count: 3
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47286611
tagged with: ajax
has title: Image Upload to PHP Via Ajax
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29569343
linked to: http://stackoverflow.com/q/21060247

http://stackoverflow.com/a/29551441
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29550981
has comment: http://stackoverflow.com/comment/47257807
has body: Try this instead: $(document).ready(function(){ function checkForFloat() { setTimeout(checkForFloat, 100); if($("#contact").css("float") === "none") { $("#headerbg2").sticky({topSpacing:180}); } else if ($("#contact").css("float") !== "none") { $("#headerbg2").sticky({topSpacing:120}); } } }); Changed the "!" position.

http://stackoverflow.com/a/29675484
score: 3
upvote count: 3
has body: The $.proxy method will just return a function, but not call it. You can use: self.functionOne.call(self); self.functionTwo.call(self); The call function calls the function, and you get to pass in the 'context' ie. what gets used as 'this' within the function, much like in $.proxy.
downvote count: 0
answers question: http://stackoverflow.com/q/29675434
type: Answer

http://stackoverflow.com/comment/47320075
comment on: http://stackoverflow.com/a/29585956
score: 0
type: AnswerComment
type: Comment
has text: In your setInterval whcih you have at the bottom. I've included that in my answer as well.

http://stackoverflow.com/comment/47359056
type: Comment
has text: And when the text has a `"` in it? Same issue.
comment on: http://stackoverflow.com/a/29605544
type: AnswerComment
score: 0

http://stackoverflow.com/comment/85972217
type: AnswerComment
type: Comment
score: 1
has text: @DhruvPrakash - Imagine script A contains a variable named `numConnections` that is global and is used by script B. If you minify each script separately, then the variable `numConnections` in script A becomes something short like `Ab`. But script B has no idea what the name of that variable has become. If you then minify script B, there's no way for the minifier to know how to fix the reference to `numConnections` in script B. If you minify them both together, then all references to `numConnections` in both scripts get changed to the same shortened name and everything still works fine.
comment on: http://stackoverflow.com/a/29657832

http://stackoverflow.com/q/29532579
has body: I want read a function return value into a div. I don't know how to achieve this in order to print text on UI. Let say, I have these things below in one jsp var textread = somejavascriptfunction(){ retrun somestring;} Now, i want to pass this text to another jsp where i require this returned string. In another Jsp, textread Can anyone help me? Thanks.
upvote count: 2
type: UnansweredQuestion
score: 2
type: Question
has answer: http://stackoverflow.com/a/29532634
downvote count: 0
tagged with: jsp
tagged with: javascript
tagged with: jquery
has title: Calling a javascript/jquery function inside div tag
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0

http://stackoverflow.com/comment/47269154
has text: RGraham, both files (text.html) and (test.html) are in the same folder test.html is where i want to load text.html
comment on: http://stackoverflow.com/q/29559482
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47321519
comment on: http://stackoverflow.com/q/29586615
type: QuestionComment
type: Comment
has text: Correct, I have just created a little demo to see if border-radius would work. Unfortunately it doesn't. Lucky I only posted as a comment/idea.
score: 0

http://stackoverflow.com/comment/47282841
score: 0
comment on: http://stackoverflow.com/a/29566645
type: AnswerComment
has text: Sorry, broken as in all in 1 column. Will image loaded work when it HTML coming back and not images...probably a dumb question. Would I put it in my getJSON() function($data)?
type: Comment

http://stackoverflow.com/comment/47306895
type: Comment
comment on: http://stackoverflow.com/q/29578246
type: QuestionComment
score: 0
has text: please check the tags before using them, hover your mouse on [box], it's not what you think. Please remove that.

http://stackoverflow.com/comment/48206073
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29660149
has text: I am Using REST API.

http://stackoverflow.com/comment/47500315
type: AnswerComment
has text: In my actual code I'm doing something like this - I have some object representing my high-level drawing objects and I have my style-related properties somewhere there, but I hope to find a way to separate the styling from the logic and more important - to keep all my colors, fonts and stuff in one place. I like you last suggestion, though - I just need to find a way to get all the actual values for a certain class - the DOM should have such an API.
type: Comment
comment on: http://stackoverflow.com/a/29676404
score: 0

http://stackoverflow.com/comment/47380932
type: QuestionComment
type: Comment
has text: I have done this before, but I cannot remember how. I was able to use Javascript (not jQuery, CSS, XPath, etc) to search for the inner HTML "Next" and click if found. The only portion of the site that is needed is exactly what I listed above
comment on: http://stackoverflow.com/q/29605771
score: 0

http://stackoverflow.com/a/29619241
type: Answer
score: 0
has body: You could do something like this (code is not very nice, you can improve it): var stopwatchTimerId; $('#stopwatch').click(function () { doStopWatch(1); }); $('#stopwatch2').click(function () { doStopWatch(2); }); var doStopWatch = function(option){ var stopWatch = option===1?$('#stopwatch'):$('#stopwatch2'); if (stopWatch.hasClass('active')) { stopWatch.removeClass('active'); clearInterval(stopwatchTimerId); } else { stopWatch.addClass('active'); stopwatchTimerId = setInterval(function () { var currentValue = option===1?(parseInt($('#stopwatch-seconds').val()) || 0):(parseInt($('#stopwatch2-seconds').val()) || 0); if(option===1) $('#stopwatch-seconds').val(currentValue + 1).change(); else $('#stopwatch2-seconds').val(currentValue + 1).change(); }, 1000); } }
answers question: http://stackoverflow.com/q/29619144

http://stackoverflow.com/comment/47367568
score: 0
type: Comment
type: QuestionComment
has text: @Zlatko The template is just some HTML for the body of the email. That is working fine. The email sends with the subject and body. As soon as I tried adding an attachment is where it all went wrong.
comment on: http://stackoverflow.com/q/29592585

http://stackoverflow.com/q/29628752
tagged with: parsing
has body: I have converted some XML into an object, and used JSON.stringify to convert that into a string. The output looks something like this: ['{"plist"', '{"$"', '{"version"', '"1.0"},"dict"', '[{"key"', '["telemetryParserTest"],"dict"', '[{"key"', '["compilerRevision","minimumVersion","name","peel","peelParams","revision","scenes"],"string"', '["BBP', '1.62.10","11","telemetryParserTest","yes","orient=portrait,scale=70,type=fit,dy=0,dx=0","13-04-2015 05', '22', '02"],"array"', '[{"dict"', '[{"key"', '["animation_store","classes","functions","models","name","variables"],"array"', '[{"dict"', '[{"key"', '["name","speed","start","stop","type"],"string"', '["FadeInFast","0.002","0","1","fade"]},{"key"', '["name","speed","start","stop","type"],"string"', '["FadeIn","0.001","0","1","fade"]},{"key"', '["name","speed","start","stop","type"],"string"', '["FadeOut","0.001","1","0","fade"]}]},{"dict"', '[{"key"', '["alpha","clickable","location","name","orientation","scale","scaleFactor","transformMode","type"],"string"', '["0","no","0,0,0","Mesh_3D","0,0,1,0","1","1,1,1","enhanced","phantom"]},{"key"', '["base","clickable","name"],"string"', '["Mesh_3D","yes","Sensor"]},{"key"', '["alpha","attachment","clickable","model","name","orientation","scale","transformMode","type"],"string"', '["0","screen","no","system.plane","SS","0,0,1,0","1","enhanced","phantom"]},{"key"', '["base","hidden","name"],"string"', '["SS","yes","SS_hide"]},{"key"', '["base","clickable","hidden","name"],"string"', '["SS","yes","yes","SS_hs"]},{"key"', '["base","clickable","name"],"string"', '["SS","yes","SS_sensor"]}]},{"dict"', '[{"key"', '["commands","name"],"array"', '[{"dict"', '[{"key"', '["arg1","arg2","arg3","function"],"string"', '["\'54555\'","\'test blipp has started\'","\'user={{user}}\'","telemetry"]}]}],"string"', '["onShow"]},{"key"', '["commands","name"],"array"', '[{"dict"', '[{"key"', '["arg1","arg2","arg3","function"],"string"', '["\'54555\'","\'Fake button was clicked\'","\'user={{user}}\'"…
type: UnansweredQuestion
answer count: 0
has title: Best method to parse out and store sections of string with Javascript
tagged with: http://stackoverflow.com/tag/json
type: Question
has comment: http://stackoverflow.com/comment/47403256
has comment: http://stackoverflow.com/comment/47401024
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/47400599
tagged with: string
has comment: http://stackoverflow.com/comment/47403375

http://stackoverflow.com/comment/79419313
type: AnswerComment
type: Comment
has text: @Flo - Sure thing, you can use this to upload into Qualtrics. https://drive.google.com/open?id=0BzOOXvB_6Ft5M3ZhbV9ZTUhubWM
score: 1
comment on: http://stackoverflow.com/a/30177912

http://stackoverflow.com/a/29565249
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29565176
has comment: http://stackoverflow.com/comment/47282685
has comment: http://stackoverflow.com/comment/47283485
upvote count: 2
type: Answer
score: 2
has body: Have a look at gulp-prompt which appears to be what your looking for: https://www.npmjs.com/package/gulp-prompt I haven't tested this, but something like this should work: Install gulp-prompt npm install gulp-prompt Then edit your gulp task. gulp.task('commit', function(){ var message; gulp.src('./*', {buffer:false}) .pipe(prompt.prompt({ type: 'input', name: 'commit', message: 'Please enter commit message...' }, function(res){ message = res.commit; })) .pipe(git.commit(message)); });
downvote count: 0
has comment: http://stackoverflow.com/comment/47286871
answers question: http://stackoverflow.com/q/29565176

http://stackoverflow.com/comment/47464716
type: Comment
has text: I see... needs to be a bit more explicit don't you think?
comment on: http://stackoverflow.com/a/29662618
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47402154
type: AnswerComment
comment on: http://stackoverflow.com/a/29614049
type: Comment
score: 0
has text: I believe this is the best practice, not just per Backbone's docs but when binding methods in general.

http://stackoverflow.com/comment/47274177
type: AnswerComment
comment on: http://stackoverflow.com/a/29562198
type: Comment
has text: Yeah, I know I can do it by jQuery, but I rather would like to use Knockout
score: 0

http://stackoverflow.com/q/29677931
tagged with: php
has title: Div reloading jquery and passing PHP variables with it
has comment: http://stackoverflow.com/comment/47493353
has body: For some strange reason this doesn't seem to work, I tried to use static vars like this but would work until I moved it out of the isset 'test'. I think this has to do with it not being able to pass on get data like this? <?php if(isset($_GET['test'])) { ?>Hey<?php $count='1'; echo $count; } ?> Click to continue
has comment: http://stackoverflow.com/comment/47496149
has comment: http://stackoverflow.com/comment/47493628
score: 1
has comment: http://stackoverflow.com/comment/47493296
type: Question
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/29679798
tagged with: jquery
has comment: http://stackoverflow.com/comment/47493684
has comment: http://stackoverflow.com/comment/47493371
has comment: http://stackoverflow.com/comment/47493391
upvote count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47493364
downvote count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47493454
has comment: http://stackoverflow.com/comment/47493989

http://stackoverflow.com/q/29684772
possible better answer: http://stackoverflow.com/a/29684827
answer count: 3
has comment: http://stackoverflow.com/comment/47506415
has comment: http://stackoverflow.com/comment/47506462
tagged with: syntax-error
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29684834
tagged with: javascript
has answer: http://stackoverflow.com/a/29684833
type: Question
has title: Javascript function not defined and SyntaxError?
has body: HTML: CHANGE BACKGROUND JavaScript: function bgTime() { var d = new Date(); if (d getHours() >= 21) { document.body.style.backgroundImage = "url('bg/H.png')" } else if (d getHours() >= 18) { document.body.style.backgroundImage = "url('bg/G.png')" } else if (d getHours() >= 15) { document.body.style.backgroundImage = "url('bg/F.png')" } else if (d getHours() >= 12) { document.body.style.backgroundImage = "url('bg/E.png')" } else if (d getHours() >= 9) { document.body.style.backgroundImage = "url('bg/D.png')" } else if (d getHours() >= 6) { document.body.style.backgroundImage = "url('bg/C.png')" } else if (d getHours() >= 3) { document.body.style.backgroundImage = "url('bg/B.png')" } else { document.body.style.backgroundImage = "url('bg/A.png')" }; }; Okay so I am probably just being an idiot somehow, but I cannot find what I am doing wrong. I get two errors: 1. "script.js:3 | Uncaught SyntaxError: Unexpected identifier" 2. "(index):3 | onclick | Uncaught ReferenceError: bgTime is not defined " Can someone please tell me what I am doing wrong? Thank you in advance! P.S. This is just a project for learning JS, don't judge lol.
accepted answer: http://stackoverflow.com/a/29684833
has comment: http://stackoverflow.com/comment/47506593
score: 0
has answer: http://stackoverflow.com/a/29684827

http://stackoverflow.com/a/29623897
score: 0
type: Answer
has body: Your method works fine for an array of numbers, strings or boolean values, but it is only creating one array for all the indexes. Check for an object before you repeat. Array.repeater= function(val, len){ var A= [], check=typeof val== 'object' &amp;&amp; val.constructor; while(len--){ if(check){ val= new val.constructor(val); } A.push(val); } return A; } //test object var B= Array.repeater(new Date(2015, 3, 14), 10); B[3].setDate(16); B.join('\n') /* returned value: (String) Tue Apr 14 2015 00: 00: 00 GMT-0400(Eastern Standard Time) Tue Apr 14 2015 00: 00: 00 GMT-0400(Eastern Standard Time) Tue Apr 14 2015 00: 00: 00 GMT-0400(Eastern Standard Time) Thu Apr 16 2015 00: 00: 00 GMT-0400(Eastern Standard Time) Tue Apr 14 2015 00: 00: 00 GMT-0400(Eastern Standard Time) Tue Apr 14 2015 00: 00: 00 GMT-0400(Eastern Standard Time) Tue Apr 14 2015 00: 00: 00 GMT-0400(Eastern Standard Time) Tue Apr 14 2015 00: 00: 00 GMT-0400(Eastern Standard Time) Tue Apr 14 2015 00: 00: 00 GMT-0400(Eastern Standard Time) Tue Apr 14 2015 00: 00: 00 GMT-0400(Eastern Standard Time) */ without the object check, every item would mirror the changed date
answers question: http://stackoverflow.com/q/29623141

http://stackoverflow.com/comment/47442544
type: QuestionComment
has text: @jayjay that's a different question, but just this once: `importScripts("myscriptfile.js");`
comment on: http://stackoverflow.com/q/29651072
score: 1
type: Comment

http://stackoverflow.com/comment/47293510
comment on: http://stackoverflow.com/q/29571827
type: Comment
type: QuestionComment
score: 2
has text: Well, short of re-writing a bignum library, you can't do it with "pure JS." Numbers in JavaScript are IEEE-754 double-precision floating-point numbers. It's the same in most languages (except most other languages have an integer type), so this isn't a limitation of JS per se.

http://stackoverflow.com/comment/71415313
type: Comment
has text: @RoryMcCrossan Bad downvote! Even in its original form, this question was about _how_ to create a slider. Yes, the OP mentioned specific frameworks, but nobody asked for plugins.
score: 0
comment on: http://stackoverflow.com/q/29680213
type: QuestionComment

jquery-svg
tag name: jquery-svg
type: Tag
tags question: http://stackoverflow.com/q/29681949

dialog
tag name: dialog
tags question: http://stackoverflow.com/q/29553249
tags question: http://stackoverflow.com/q/29578712
tags question: http://stackoverflow.com/q/29570956
type: Tag
tags question: http://stackoverflow.com/q/29649823

http://stackoverflow.com/q/29601492
tagged with: storage
tagged with: firefox-os
has title: how to store audio file in Sdcard captured using getUserMedia in fire fox os
tagged with: audio-recording
type: Question
score: 0
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/29656263
type: UnansweredQuestion
has body: i am creating one app where when i will press save button it will store given blob audion data in to SDcard in firefox os here i am presenting code for it. var audioURL = window.URL.createObjectURL(e.data); audio.src = audioURL; audio.type="video/ogg"; deleteButton.onclick = function(e) { evtTgt = e.target; evtTgt.parentNode.parentNode.removeChild(evtTgt.parentNode); } saveButton.onclick = function(e) { evtTgt = e.target; var sdcard = navigator.getDeviceStorage("sdcard"); var file = new Blob([audioURL], {type: "video/ogg"}); var request = sdcard.addNamed(file, "my-file.ogg"); request.onsuccess = function () { var name = this.result; console.log('File "' + name + '" successfully wrote on the sdcard storage area'); } here i have written the code but it is not working.so plz any one can help??

http://stackoverflow.com/q/29661549
has answer: http://stackoverflow.com/a/29770984
tagged with: angularfire
type: UnansweredQuestion
tagged with: firebase
has answer: http://stackoverflow.com/a/29675942
type: Question
tagged with: javascript
has title: Remove an item from Firebase with AngularFire $remove method
has body: I have the following data array in my Firebase app. I want to delete Account3 using AngularFire's $remove method but I can't get it to work [MY-FIREBASE-URL] users simplelogin:1 accounts 0 title: "Account1" 1 title: "Account2" 2 title: "Account3" 3 title: "Account4" 4 title: "Account5" This is the code I'm using var fbURL = [MY-FIREBASE-URL]; var ref = new Firebase(fbURL); var authData = ref.getAuth(); if (authData) { console.log("User " + authData.uid + " is logged in with " + authData.provider); var accountPath = fbURL + "/users/" + authData.uid + "/accounts/" + account.title; //alert(accountPath); var accountRef = new Firebase(accountPath); accountRef.remove(); } else { console.log("User is logged out"); } In the console.log I see the correct user in the authData but nothing happens. What am I doing wrong?
score: 0
answer count: 2

http://stackoverflow.com/comment/47429459
score: 0
type: QuestionComment
has text: can you provide a fiddle??
type: Comment
comment on: http://stackoverflow.com/q/29644305

http://stackoverflow.com/comment/47245938
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29547135
has text: more code please. a fiddle would be helpful as well. what you have is vague.
type: QuestionComment

http://stackoverflow.com/q/29572528
score: 0
has title: How can I prevent an element to load until such time when the user clicks a button in javascript/jquery?
tagged with: jquery-events
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/47294352
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47294329
has answer: http://stackoverflow.com/a/29572594
accepted answer: http://stackoverflow.com/a/29572594
type: Question
has body: I've searched Google for quite a while now but can't find a suitable answer. I have a website project that needs a popup gallery but that gallery should load on top of all other elements after a user clicks a link. Just like in Facebook when you open a video it creates a fixed div in front of all others and then loads the video. In CSS I've tried "display: none" but it slows down the loading of all other elements on page load. I should make it load only when needed so that the initial loading time won't suffer.
tagged with: javascript

http://stackoverflow.com/q/29562882
type: Question
has body: In one view i create an array in javascript that contains ids of elements and now i want to pass them into model field in my MVC Model does anybody already meet ith this kind of problem this is my model: public class AppointmentModel { public int Id { get; set; } public string Title { get; set; } public int[] PersonsIds { get; set; } public int[] CompaniesIds { get; set; } } and in view i keep both arrays as hidden fields @html.hiddenfor(model =&gt; model.PersonsIds) @html.hiddenfor(model =&gt; model.CompaniesIds) so the schema looks like this: javascript-&gt;model-&gt;submit model-&gt;controller Please any help would be appreciate
has title: How to put javascript array into MVC Model View array?
tagged with: razor
has comment: http://stackoverflow.com/comment/47275611
answer count: 2
upvote count: 1
tagged with: c#
has comment: http://stackoverflow.com/comment/47276570
tagged with: asp.net-mvc
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47275934
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/29565260
tagged with: asp.net
favorite count: 0
has answer: http://stackoverflow.com/a/29565997

http://stackoverflow.com/a/29543191
has comment: http://stackoverflow.com/comment/47238712
answers question: http://stackoverflow.com/q/29543086
has comment: http://stackoverflow.com/comment/47238312
has comment: http://stackoverflow.com/comment/47238943
type: Answer
has comment: http://stackoverflow.com/comment/47238272
has comment: http://stackoverflow.com/comment/47238870
score: 2
downvote count: 0
has body: This is a security feature. jQuery allows &lt;script&gt; elements in HTML code but it won't execute them (at least not the src="..." part; inline scripts work). This is because jQuery has no way to make sure the script isn't malicious or from a safe source (an error in your code might allow people to enter scripts in a form element). Use jQuery.getScript(url, successCallack) instead. See also: jQuery - script tags in the HTML are parsed out by jQuery and not executed
has comment: http://stackoverflow.com/comment/47238185
upvote count: 2

http://stackoverflow.com/comment/47465493
comment on: http://stackoverflow.com/a/29662714
type: AnswerComment
score: 1
has text: No reason to use JavaScript for something you can easily achieve in CSS alone.
type: Comment

http://stackoverflow.com/comment/47398505
has text: I know that there is no such tool available. But i have posted this to know the reason behind.
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29626046

http://stackoverflow.com/q/29545484
accepted answer: http://stackoverflow.com/a/29545773
type: AnsweredQuestion
score: 1
type: Question
answer count: 2
has body: I have an html page that has one image object. I am trying to write some JavaScript but something isn't working in the script. I have a piece of script that reads a variable and if the variable 'e' is equal to 1, then one image appears. If 'e' is anything other number then image 2 appears. For now, 'e' is static, but it will be dynamic. How do you change an image dynamically based off a variable? Any help is most appreciated. Title of the document hello
downvote count: 0
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/29545764
favorite count: 0
has answer: http://stackoverflow.com/a/29545764
tagged with: jquery-events
has comment: http://stackoverflow.com/comment/47242608
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29545773
has title: Image swapping when a variable changes
upvote count: 1

http://stackoverflow.com/comment/47497549
has text: Sorry, I was wrong. The GET works, but not the POST. I did this on my controller `$sort = $request->query->get('sortSelect');`
score: 0
comment on: http://stackoverflow.com/q/29669976
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29554704
type: AcceptedAnswer
type: Answer
has body: Figured it out by removing my config and re-adding it a part at a time. The very first line was fullPage: true, I had copied this from another source which used fullpage. I don't need it so I removed it. According to the documentation, having fullPage on will stop contentsCss being implemented. From the ckeditor documentation: Note: This configuration value is ignored by inline editor as it uses the styles that come directly from the page that CKEditor is rendered on. It is also ignored in the full page mode in which developer has a full control over the HTML. However, what they fail to mention is that having fullPage set to true will also stop any changes to editor.css from being loaded. Once it was removed my custom styles shined through Handy tip: contentsCSS does not have to point to a css file. You can put straight css in there instead of a url, like so contentsCss: '.cke_editable { color: #fff; font-family: Calibri; font-size: 14px; } ', This will apply these styles directly to the editor. This appears to be undocumented as the documentation only mentions stylesheet urls.
accepted answer of: http://stackoverflow.com/q/29540405
answers question: http://stackoverflow.com/q/29540405
score: 2
downvote count: 0
upvote count: 2

http://stackoverflow.com/comment/47424643
score: 0
comment on: http://stackoverflow.com/q/29641569
type: Comment
type: QuestionComment
has text: What have you tried? My approach to this would be something along the lines of: iterate through the array, store the current value, if the next value is the same as the current, increment a counter. If they are different, set the counter back to 0.

http://stackoverflow.com/q/29543303
has comment: http://stackoverflow.com/comment/47239237
has comment: http://stackoverflow.com/comment/47238882
answer count: 4
has answer: http://stackoverflow.com/a/29543570
has comment: http://stackoverflow.com/comment/47238578
has answer: http://stackoverflow.com/a/29543463
has body: How can I make this work in a single HTML file? I have tried to add it to the header and it doesn't work. Please can someone teach me. $("#mytextbox").on("keypress", function(event) { // Disallow anything not matching the regex pattern (A to Z uppercase, a to z lowercase and white space) // For more on JavaScript Regular Expressions, look here: https://developer.mozilla.org/en-US/docs/JavaScript/Guide/Regular_Expressions var englishAlphabetAndWhiteSpace = /[A-Za-z ]/g; // Retrieving the key from the char code passed in event.which // For more info on even.which, look here: http://stackoverflow.com/q/3050984/114029 var key = String.fromCharCode(event.which); //alert(event.keyCode); // For the keyCodes, look here: http://stackoverflow.com/a/3781360/114029 // keyCode == 8 is backspace // keyCode == 37 is left arrow // keyCode == 39 is right arrow // englishAlphabetAndWhiteSpace.test(key) does the matching, that is, test the key just typed against the regex pattern if (event.keyCode == 8 || event.keyCode == 37 || event.keyCode == 39 || englishAlphabetAndWhiteSpace.test(key)) { return true; } // If we got this far, just return false because a disallowed key was typed. return false; }); $('#mytextbox').on("paste",function(e) { e.preventDefault(); }); &lt;input id="mytextbox" style="width:300px" placeholder="Only English letters are allowed here..."&gt;
has comment: http://stackoverflow.com/comment/47239067
has comment: http://stackoverflow.com/comment/47238588
type: Question
linked to: http://stackoverflow.com/q/3050984
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47238344
has title: Allow certain characters in textbox
has answer: http://stackoverflow.com/a/29543506
accepted answer: http://stackoverflow.com/a/29543506
has comment: http://stackoverflow.com/comment/47238435
score: 0
has comment: http://stackoverflow.com/comment/47239005
linked to: http://stackoverflow.com/q/3781142
possible better answer: http://stackoverflow.com/a/29543463
has comment: http://stackoverflow.com/comment/47239124
has comment: http://stackoverflow.com/comment/47238343
tagged with: javascript
has comment: http://stackoverflow.com/comment/47238476
has answer: http://stackoverflow.com/a/29543533
has comment: http://stackoverflow.com/comment/47240381
has comment: http://stackoverflow.com/comment/47238490

http://stackoverflow.com/a/29661735
type: Answer
answers question: http://stackoverflow.com/q/29661458
score: 0
has body: I would use cdn to save on speed and resources, and also be sure that you have a working copy. The order was probably your issue, however, as people mentioned above.

http://stackoverflow.com/q/29553781
type: Question
has title: File Upload Preview in AngularJS
has comment: http://stackoverflow.com/comment/47258476
has comment: http://stackoverflow.com/comment/47258904
tagged with: javascript
score: 0
tagged with: angularjs
tagged with: file-upload
answer count: 0
has comment: http://stackoverflow.com/comment/47258393
type: UnansweredQuestion
has body: How can I implement file upload preview(http://opoloo.github.io/jquery_upload_preview/). I am using the this file upload. https://github.com/danialfarid/angular-file-upload If i add this preview script, angular script is not working in my page. Here is my controller structure. var app = angular.module('nomunoli.controllers', []); app.controller('NMNL012Ctrl', ['$scope', '$routeParams', 'NMNL012Service', '$location', function ($scope, $routeParams, NMNL012Service, $location) { var request = {'groupId': $routeParams.id}; $scope.group = NMNL012Service.nmnl012FUN14.query(request); $scope.talentList = NMNL012Service.nmnl012FUN01.query(request); }] ); This is input div in page. &lt;div class="form-group col-md-12"&gt; &lt;div class="col-md-4"&gt; &lt;input id="talentUpload" type="file" ng-file-select ng-model="talentFile" accept="image/*" /&gt; &lt;/div&gt; &lt;/div&gt;

http://stackoverflow.com/comment/47265551
has text: True, but that was not specified in his question
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29549639
type: Comment

http://stackoverflow.com/q/29633726
type: Question
has answer: http://stackoverflow.com/a/29649895
tagged with: frameworks
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
has title: Radiobutton within the Popover not be checked via javascript
tagged with: twitter-bootstrap-3
tagged with: twitter-bootstrap
type: UnansweredQuestion
has body: I have a query where fill an html table with the records from the database. In one of the columns of each row, there are some options how to edit, delete, add photos and another option that opens the Popover. This Popover is Bootstrap 3, when I open the popover any line shows 3 radiobuttons and their onclick run a script in the database without refreshing the page. I want the selected radio be checked without having to refresh the page, but I'm not getting. Follow the code: Anúncio: <%=rsAnuncios("id")%> <input <%=checkNone%> type="radio" name="vendidoAlugado" id="none<%=rsAnuncios("id")%>" onclick="alugadoVendido('src/rotinas/rotinas.asp?acao=Vendido&id=<%=rsAnuncios("id")%>&tipo=none&idInput=none<%=rsAnuncios("id")%>', 'none<%=rsAnuncios("id")%>');" /> NENHUM <input <%=checkVendido%> type="radio" name="vendidoAlugado" id="marcarComoVendido<%=rsAnuncios("id")%>" onclick="alugadoVendido('src/rotinas/rotinas.asp?acao=Vendido&id=<%=rsAnuncios("id")%>&tipo=vendido&idInput=marcarComoVendido<%=rsAnuncios("id")%>', 'marcarComoVendido<%=rsAnuncios("id")%>');" /> Marcar anúncio como VENDIDO <input <%=checkAlugado%> type="radio" name="vendidoAlugado" id="marcarComoAlugado<%=rsAnuncios("id")%>" onclick="alugadoVendido('src/rotinas/rotinas.asp?acao=Vendido&id=<%=rsAnuncios("id")%>&tipo=alugado&idInput=marcarComoAlugado<%=rsAnuncios("id")%>', 'marcarComoAlugado<%=rsAnuncios("id")%>');" /> Marcar anúncio como ALUGADO And here javascript: function alugadoVendido(url, obj1){ //$(".marcarComoVendidoAlugado").attr("checked", false); $(".marcarComoVendidoAlugado").prop("checked", false); $("#"+obj1).prop("checked", true); window.rotinas.location.href = url; }

http://stackoverflow.com/a/29537888
type: Answer
answers question: http://stackoverflow.com/q/29536283
has comment: http://stackoverflow.com/comment/47230016
has comment: http://stackoverflow.com/comment/47230384
has comment: http://stackoverflow.com/comment/47228923
has comment: http://stackoverflow.com/comment/47228144
has body: You can't have an expression as a property name. UPDATE: Try something like this: var mappings = []; ["#"+id+"2","#"+id+"3","#"+id+"4","#"+id+"5"].forEach(function(e,i) { var o = {}; o[e] = i; mappings.push(o); });
score: 0

http://stackoverflow.com/tag/svg
tags question: http://stackoverflow.com/q/29591772
tags question: http://stackoverflow.com/q/29620936
tags question: http://stackoverflow.com/q/29601841
tags question: http://stackoverflow.com/q/29633478
tags question: http://stackoverflow.com/q/29628381
tags question: http://stackoverflow.com/q/29656883
tags question: http://stackoverflow.com/q/29595747
tags question: http://stackoverflow.com/q/29663196
tags question: http://stackoverflow.com/q/29540255
tags question: http://stackoverflow.com/q/29624177
tags question: http://stackoverflow.com/q/29537862
tags question: http://stackoverflow.com/q/29673901
tags question: http://stackoverflow.com/q/29553617
tags question: http://stackoverflow.com/q/29539271
tags question: http://stackoverflow.com/q/29652150
tags question: http://stackoverflow.com/q/29573481
tags question: http://stackoverflow.com/q/29632287
tag name: svg
tags question: http://stackoverflow.com/q/29615607
tags question: http://stackoverflow.com/q/29554059
tags question: http://stackoverflow.com/q/29639270
tags question: http://stackoverflow.com/q/29592770
tags question: http://stackoverflow.com/q/29654775
tags question: http://stackoverflow.com/q/29563119
tags question: http://stackoverflow.com/q/29546230
tags question: http://stackoverflow.com/q/29633075
tags question: http://stackoverflow.com/q/29659507
tags question: http://stackoverflow.com/q/29671272
tags question: http://stackoverflow.com/q/29577410
tags question: http://stackoverflow.com/q/29656430
tags question: http://stackoverflow.com/q/29632651
tags question: http://stackoverflow.com/q/29670264
tags question: http://stackoverflow.com/q/29681949
tags question: http://stackoverflow.com/q/29594906
tags question: http://stackoverflow.com/q/29678967
tags question: http://stackoverflow.com/q/29678996
tags question: http://stackoverflow.com/q/29587836
tags question: http://stackoverflow.com/q/29685326
tags question: http://stackoverflow.com/q/29596199
tags question: http://stackoverflow.com/q/29552854
tags question: http://stackoverflow.com/q/29667004
tags question: http://stackoverflow.com/q/29635005
tags question: http://stackoverflow.com/q/29637206
tags question: http://stackoverflow.com/q/29670722
tags question: http://stackoverflow.com/q/29578847
tags question: http://stackoverflow.com/q/29597242
tags question: http://stackoverflow.com/q/29530557
tags question: http://stackoverflow.com/q/29577320
tags question: http://stackoverflow.com/q/29531777
tags question: http://stackoverflow.com/q/29563370
tags question: http://stackoverflow.com/q/29679092
tags question: http://stackoverflow.com/q/29585714
tags question: http://stackoverflow.com/q/29557497
tags question: http://stackoverflow.com/q/29539532
tags question: http://stackoverflow.com/q/29614691
type: Tag

http://stackoverflow.com/a/29555430
score: -1
has body: &lt;script type="text/javascript"&gt; jQuery(document).ready(function($) { $('.bhlink').on('click', function () { $(this).parent('.nn').find('.bhinfo').slideToggle(); }); }); }); &lt;/script&gt; hope this script helps. please try and let me know.
downvote count: 1
type: Answer
upvote count: 0
answers question: http://stackoverflow.com/q/29554980

http://stackoverflow.com/q/29605288
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29606153
score: 0
type: Question
has title: Jquery ui slider range between times
accepted answer: http://stackoverflow.com/a/29606170
tagged with: javascript
tagged with: jquery
has body: How can I make a jQuery UI slider in the gaps and to? For example: from 00:00:00 to 00:30:31 Example here , in Track filter -&gt; Length
answer count: 3
has answer: http://stackoverflow.com/a/29606089
has comment: http://stackoverflow.com/comment/47356210
possible better answer: http://stackoverflow.com/a/29606089
has answer: http://stackoverflow.com/a/29606170

http://stackoverflow.com/a/33384555
downvote count: 0
type: Answer
score: 3
answers question: http://stackoverflow.com/q/29571750
has comment: http://stackoverflow.com/comment/54949851
has body: After a lot of trial and error this worked for me (by Eduardo. Thanks !) The URL that needs to be authorized is the one in the Referrer header for the requests the browser sends to Google to load the API. Under Browser Credentials &gt; REFERERS Add these .example.org/ www.example.org/* http://www.example.org http://example.org
upvote count: 3

http://stackoverflow.com/comment/47402701
type: Comment
has text: Correct, tapping with touchpad only triggers "click" for me. Running version 41.0.2272.118 m.
comment on: http://stackoverflow.com/q/29628936
score: 0
type: QuestionComment

http://stackoverflow.com/q/29584563
type: Question
has answer: http://stackoverflow.com/a/29597070
tagged with: javascript
has comment: http://stackoverflow.com/comment/47318118
has body: I can't get the js file to execute. I created a js file and added the js file my bundle. bundles.Add(new ScriptBundle("~/bundles/cban").Include( "~/Scripts/jquery-{version}.js", "~/Scripts/jquery-ui-{version}.js", "~/Scripts/jquery-unobtrusive*", "~/Scripts/jquery.validate*", "~/Scripts/cban.js" )); This logic is currently working. The logic will display a new dropdownlist. @if (Model.Answers != null) { foreach (AnswerVM answer in Model.Answers) { answer.AllAnswers = Model.AllAnswers; Html.RenderPartial("_AnswerEntryEditor", answer); } } This link will allow the user to click calling the javascript. Add another I changed the code to work like this on the view. Add another The js file looks like this. $(function() { var insertRow = function () { var $a = $(this); var options = { url: $a.attr("action"), type: $a.attr("method") }; $.ajax(options).done(function (data) { var $target = $($a.attr("data-cban-target")); $target.append(data); }); return false }; $(document).ready() { $("a[data-cban-ajax='true']").click(insertRow); } }); When I click the link the js file is not executing.
score: 0
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/47321392
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47318382
tagged with: model-view-controller
has title: How to reuse javascript in a js file using

http://stackoverflow.com/q/29672026
downvote count: 1
type: AnsweredQuestion
has body: I want to get total number of posts done by admin , here is a ptv sports page id , i tried my page id even , it is returning Data:array[object] = length 25, i have displayed it but if posts are 400 then what should i do do manage uninformed posts and show all of them function p_post() { FB.api("/209652442394600?fields=posts{admin_creator}", function (response) { var t = response.posts.data.length; }); } the answer by default is 25, manage it
has comment: http://stackoverflow.com/comment/47483862
accepted answer: http://stackoverflow.com/a/29692033
type: Question
has title: total number of posts using facebook graph api
answer count: 1
tagged with: javascript
tagged with: facebook-like
favorite count: 0
tagged with: facebook-javascript-sdk
tagged with: facebook-graph-api
has answer: http://stackoverflow.com/a/29692033
score: 0
tagged with: facebook
upvote count: 1

http://stackoverflow.com/comment/50390842
comment on: http://stackoverflow.com/a/31192753
score: 0
type: AnswerComment
has text: @Xan _It suffices to have a stable ID_ - is that so? Well, in that case, I guess I'll give CWS a second look. I admit, I didn't look too deeply into CWS publishing; the documentation I read was a bit unclear on how syncing works, and I didn't get around to delving deeper before discovering PouchDB. (That said, for my particular case, while switching to CWS publishing would probably be better than syncing stuff around via Dropbox, I still wouldn't switch to using chrome.storage.sync, since the 100 KB quota is too small for what I'm trying to do.)
type: Comment

http://stackoverflow.com/comment/47223225
has text: The existence of a `Views` directory implies that you are using a server side framework which is going to change the URLs to something that is much harder to imply from looking at your file system. You need to look at the URLs you are using, not your directory structure.
type: Comment
comment on: http://stackoverflow.com/q/29534983
type: QuestionComment
score: 0

http://stackoverflow.com/comment/47235351
has text: $( document ).ready will make sure the Dom is ready before accessing any data in it. if it helps you please mark the answer.
comment on: http://stackoverflow.com/a/29541642
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47230155
type: Comment
comment on: http://stackoverflow.com/a/29532983
has text: Ah, ok. I see the problem. ng-bind does not work on input tags. I've updated my answer.
score: 0
type: AnswerComment

http://stackoverflow.com/a/29583346
accepted answer of: http://stackoverflow.com/q/29582288
answers question: http://stackoverflow.com/q/29582288
type: Answer
upvote count: 1
type: AcceptedAnswer
downvote count: 0
score: 1
has body: You need to define a reader: reader: { type: 'json', rootProperty: 'result', totalProperty: 'totalcount' } Your example working: https://fiddle.sencha.com/#fiddle/l3u

http://stackoverflow.com/a/29667206
has body: To update the value of obj after clearing the scope; you will have to either manually update the obj as suggested by @Joshua Arvin Lat or you may like to convert the fn and ln to functions: var myApp = angular.module("myApp", []); myApp.controller("myCtrl",function($scope){ $scope.fname = "sandeep"; $scope.lname = "nayak"; $scope.createObj = function(){ var obj = {fn:function() {return $scope.fname;} , ln: function() {return $scope.lname;} }; console.log(obj.fn()); console.log(obj.ln()); $scope.fname = ""; $scope.lname = ""; console.log(obj.fn()); console.log(obj.ln()); } }); Working Example: http://jsfiddle.net/7eo4zcvq/2/
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29666964

http://stackoverflow.com/a/29654065
has body: You can use template for column definition: { field: "ColumName", template: '&lt;input type="checkbox" #= Column? checked="checked" : "" # disabled="disabled" &gt;&lt;/input&gt;' } EDIT: Try to define data source model (http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-schema.model) like below, but according to your data types in source: schema: { model: { id: "ProductID", fields: { type: { type: "string" }, UnitPrice: { type: "number" } } } }
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/29640986
downvote count: 0
type: Answer

http://stackoverflow.com/comment/47420411
score: 0
has text: With img[0].innerHTML it just return:img[0] is undefined
comment on: http://stackoverflow.com/q/29639002
type: QuestionComment
type: Comment

http://stackoverflow.com/q/29550981
score: 0
answer count: 2
tagged with: jquery
has title: jQuery Sticky Plugin Variable Top Spacing
possible better answer: http://stackoverflow.com/a/29551441
has comment: http://stackoverflow.com/comment/47282009
has comment: http://stackoverflow.com/comment/47254549
has comment: http://stackoverflow.com/comment/47257784
has answer: http://stackoverflow.com/a/29551441
has body: I'm using the jQuery sticky plugin to stick the menu and contact information to the top. The site is responsive, so spacing from the top for the menu changes. I'm trying to do different spacing based on the CSS value of the contact info, but it's not working. I was pretty sure my jQuery was correct... $(document).ready(function(){ function checkForFloat() { setTimeout(checkForFloat, 100); if($("#contact").css("float") === "none") { $("#headerbg2").sticky({topSpacing:180}); } else if (!$("#contact").css("float") === "none") { $("#headerbg2").sticky({topSpacing:120}); } } }); http://jsfiddle.net/1j9cdsro/
has comment: http://stackoverflow.com/comment/47284835
tagged with: sticky
has comment: http://stackoverflow.com/comment/47283549
tagged with: css
has comment: http://stackoverflow.com/comment/47284143
accepted answer: http://stackoverflow.com/a/29567528
type: AnsweredQuestion
tagged with: settimeout
has comment: http://stackoverflow.com/comment/47284067
has comment: http://stackoverflow.com/comment/47283384
type: Question
has answer: http://stackoverflow.com/a/29567528
has comment: http://stackoverflow.com/comment/47253537
has comment: http://stackoverflow.com/comment/47283634
has comment: http://stackoverflow.com/comment/47270287
tagged with: javascript
has comment: http://stackoverflow.com/comment/47253867
has comment: http://stackoverflow.com/comment/47283769

http://stackoverflow.com/q/29545919
score: 0
has title: Firefox Extension port to emit from main.js
has comment: http://stackoverflow.com/comment/47367729
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47282378
answer count: 0
has body: I am building a firefox extension and trying to communicate between main.js and contentScriptFile. Basically what i want in when a tab is closed call a function in contentScriptFile injected in all other open tabs. The code i am currently using with port doesn't seems to work Main.js var tabs = require("sdk/tabs"); tabs.on('close', function(tab){ if(tab.url.indexOf('example.com/url2') &gt; -1) { for (let tab of tabs) { tab.attach({}).port.emit("doCORN", 'eg1'); } } else if(tab.url.indexOf('example.com/url1') &gt; -1) { for (let tab of tabs) { tab.attach({}).port.emit("doCORN", 'eg2'); } } }); Contentscriptfile self.port.on("doCORN", function(msg) { console.log(msg) }); But it doesn't seem to work. So, anybody have an idea?
type: Question
has comment: http://stackoverflow.com/comment/47297851
tagged with: firefox-addon-sdk

http://stackoverflow.com/comment/47228718
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29538339
type: Comment
has text: It's because console is outside of angular you need to call $scope.$apply.

http://stackoverflow.com/comment/47245447
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/74870/discussion-between-engr024-and-adricadar).
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29545773
type: Comment

mongoose
tags question: http://stackoverflow.com/q/29551630
tags question: http://stackoverflow.com/q/29568581
tags question: http://stackoverflow.com/q/29552928
tags question: http://stackoverflow.com/q/29653322
type: Tag
tags question: http://stackoverflow.com/q/29543901
tags question: http://stackoverflow.com/q/29625511
tags question: http://stackoverflow.com/q/29603202
tag name: mongoose
tags question: http://stackoverflow.com/q/29611752
tags question: http://stackoverflow.com/q/29578042
tags question: http://stackoverflow.com/q/29615695
tags question: http://stackoverflow.com/q/29648626
tags question: http://stackoverflow.com/q/29685986
tags question: http://stackoverflow.com/q/29677613
tags question: http://stackoverflow.com/q/29569868
tags question: http://stackoverflow.com/q/29631097
tags question: http://stackoverflow.com/q/29638752
tags question: http://stackoverflow.com/q/29661053
tags question: http://stackoverflow.com/q/29571028

http://stackoverflow.com/q/29551001
has answer: http://stackoverflow.com/a/29551443
upvote count: 1
has answer: http://stackoverflow.com/a/29551262
has answer: http://stackoverflow.com/a/29551368
has comment: http://stackoverflow.com/comment/47254303
type: Question
has answer: http://stackoverflow.com/a/29551266
possible better answer: http://stackoverflow.com/a/29551368
downvote count: 0
tagged with: javascript
tagged with: web
score: 1
has body: I have an odd issue. I created a standard dropdown menu but I am having an issue where the menu is dissapearing when I get right between the menu and the drop down. I cant find any css that would stop the hover state but maybe your eyes are better than mine. Here is a gif of what is happening: http://imgur.com/axF6skK My js code: //------- NAV MENU --------// $('nav li').hover( function () { $('ul', this).stop(true,true).fadeIn({ duration: 300, queue: false }).slideDown(300); }, function () { $('ul', this).stop(true,true).fadeOut({ duration: 300, queue: false }).slideUp(300); }); Relevant HTML: Home Get Started Start Making Your CCR How CCR Writer Works Why Choose CCR Writer Access My Previous CCRs Relevant CSS: nav > ul { margin: 0 auto; padding: 0; list-style-type: none; height: 100px; float: right; padding-right: 30px; } li.menu { display: inline-block; padding:0; margin: 0; padding-left: 15px; padding-right: 15px; height: 100px; position: relative; } li.menu:hover { background-color: #FFFFFF; } li.menu a { font-size: 12pt; padding-top: 33px; display: table-cell; vertical-align: middle; position: relative; } li.menu:hover a { color: #232323; } li.dropitem { padding: 0; margin: 0; } li.dropitem:hover { background-color: #DADADA; } li.dropitem a { color: #232323; margin: 0; padding: 10px; padding-left: 15px; padding-right: 15px; font-size: 13pt; } ul.dropdown { position: absolute; white-space: nowrap; width: auto; min-width: 100%; top: 100px; left: 0; padding-top: 0; margin: 0; padding-bottom: 10px; z-index: -1; border: none; border-radius: 0px 0px 2px 2px; box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.176); background-color: #FFF; height: auto; }
tagged with: jquery
accepted answer: http://stackoverflow.com/a/29551266
favorite count: 0
has comment: http://stackoverflow.com/comment/47253902
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: Drop down menu is Glitchy at the edge of menu button
answer count: 4
type: AnsweredQuestion

http://stackoverflow.com/q/29659605
tagged with: youtube
type: Question
has title: Pre-roll VAST on YouTube Video using Video.js
score: 1
tagged with: video-player
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/34623302
has answer: http://stackoverflow.com/a/29681767
tagged with: video
has body: I try to make a pre-roll ads (VAST) on youtube video using video.js. I have use plugin on github https://github.com/eXon/videojs-youtube , while for the ADs part I'm using this videojs-vast-plugin (https://github.com/theonion/videojs-vast-plugin ). When i use mp4 video format. the pre-roll ads work perfectly. But, if i use youtube video. The pre-roll ads not working. How fix it? i want to use pre-roll ads (VAST) on youtube video with video.js? this ismy code : Video.js VAST Example <!--[if lt IE 9]> <![endif]--> Video.js VAST plugin with videojs-youtube.
tagged with: video.js
type: UnansweredQuestion
upvote count: 1

http://stackoverflow.com/comment/47356156
has text: check my edited code above ,I am able to read file from servlet ,Facing problem in passing it to ajax
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29601338

http://stackoverflow.com/q/29569316
has answer: http://stackoverflow.com/a/29569354
tagged with: node.js
favorite count: 0
type: AnsweredQuestion
score: 3
upvote count: 3
has body: I'm trying to fetch a .txt file from a webserver on a different domain which has no CORS or webservices. I think I need to do it on server side with Node.js and JQuery, but I'm not sure where to start. I am currently Node and JQuery challenged. The file resides here http://epec.saw.usace.army.mil/dsskerr.txt
accepted answer: http://stackoverflow.com/a/29569354
type: Question
has comment: http://stackoverflow.com/comment/47288978
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: How to fetch a .txt file from a different domain from server side javascript and get it client side
has comment: http://stackoverflow.com/comment/47288305
answer count: 1

http://stackoverflow.com/comment/47350242
score: 0
type: AnswerComment
has text: Thank youuuuuuuuuuuu sooo much Sir! U saved my time and effort. Thank you very muchh sir.
type: Comment
comment on: http://stackoverflow.com/a/29601497

http://stackoverflow.com/comment/47469548
type: Comment
has text: @hochas The library in use adds it via JavaScript.
type: AnswerComment
comment on: http://stackoverflow.com/a/29599619
score: 0

http://stackoverflow.com/q/29556538
tagged with: audio-recording
has title: How to prevent automatic starting function after webpage is loaded?
has body: I used this simple recorder for recording my voice: A plugin for recording/exporting the output of Web Audio API nodes I want to implement it to my webpage. This recording example is set to ask user for allowing microphone immediatelly when page is loaded, but I want to show this message after clicking on button record, so when user want to use this service. Also there are shown "logs", they are shown also when page is loaded. I want also to show logs after clicking on button. I think it is logical, so when user want to use recorder he is informed about this service.
has comment: http://stackoverflow.com/comment/47264087
type: Question
answer count: 1
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29556779

http://stackoverflow.com/a/29637249
type: Answer
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29636931
upvote count: 2
answers question: http://stackoverflow.com/q/29636931
type: AcceptedAnswer
has body: It's because you have them in a modal - in a .container. Try removing the .container class from the modal. .container has static widths and not percentages. This is why it's overflowing.

http://stackoverflow.com/a/29682598
has comment: http://stackoverflow.com/comment/47502880
has comment: http://stackoverflow.com/comment/47502719
has comment: http://stackoverflow.com/comment/47502367
has body: var isVisible = new Array(); isVisible[0] = false; isVisible[1] = false; function revealAnswer(answerId, answer, indexNum){ if(isVisible[indexNum]==false){ var spanAnswer = document.querySelectorAll(".answers"); for(i=0;i < spanAnswer.length ; i++){ spanAnswer[i].innerHTML = ''; isVisible[i] = false; } document.getElementById(answerId).innerHTML = answer; isVisible[indexNum]=true; console.log(answerId); } else{ document.getElementById(answerId).innerHTML = ""; isVisible[indexNum]=false; } } Question 1 When is homework not homework? Question 2 What goes up when rain comes down? Here you go document.querySelectorAll will not work in IE here is the traditional code which will work in IE as well function revealAnswer(answerId, answer, indexNum){ if(isVisible[indexNum]==false){ var spanAnswer = document.getElementsByTagName("span"); for(i=0;i < spanAnswer.length ; i++){ if(spanAnswer[i].id == "answer"+(i+1)){ spanAnswer[i].innerHTML = ''; } } document.getElementById(answerId).innerHTML = answer; isVisible[indexNum]=true; console.log(answerId); } else{ document.getElementById(answerId).innerHTML = ""; isVisible[indexNum]=false; } }
downvote count: 0
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/29682341

http://stackoverflow.com/comment/47648739
type: QuestionComment
has text: Thank you! Unfortunately, I don't quite get the instructions on the geojson validator for "programmatic access," which seems to be what I need. Sigh, I wish Mapbox would just include instructions on how to do this! In case it's helpful, what's "going on here" is that I'm cycling through all of my productions, each of which has a longitude and a latitude, and storing all of those points in an array called geojson. Then what I want to do is to call that array and create a feature layer for my mapbox map. I'm pretty sure it's the second batch of code that's not working, but not 100%.
score: 0
comment on: http://stackoverflow.com/q/29686246
type: Comment

http://stackoverflow.com/a/29598546
upvote count: 0
answers question: http://stackoverflow.com/q/29596723
score: -1
has body: Yes,your code is working now. But I 'm describing here a simple way for adding this code in our theme and it will remove the hover effect in admin section. Follow the steps. Step-1: add this code in functions.php file of your theme. function theme_name_scripts() { wp_enqueue_style( 'admin-hovermenu', get_template_directory_uri() ."/admin.css" ); }add_action( 'admin_enqueue_scripts', 'theme_name_scripts' ); Step:2 Create a file named admin.css and add this line in that file. .js #adminmenu .opensub .wp-submenu { display:none !important; } Now it will works.If need anything else then please let me know.
type: Answer
downvote count: 1

http://stackoverflow.com/comment/47506744
type: Comment
score: 0
has text: Hi John, Thank you so much for your js code. Now it work just as it should. you're the Best!
comment on: http://stackoverflow.com/a/29679837
type: AnswerComment

http://stackoverflow.com/comment/47461418
score: 0
has text: Yes they are. Only way to keep items I need seperated.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29660933

http://stackoverflow.com/comment/47305900
type: Comment
comment on: http://stackoverflow.com/a/29578275
type: AnswerComment
has text: I presume you're using something that reads `data-src` if JS enabled? Just add both. `data-src` will be ignored if no JS, and if there is JS, whatever you're using `data-src` for will find it.
score: 0

http://stackoverflow.com/q/29647939
type: AnsweredQuestion
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/47436284
has body: I have razor view which takes some ul list items which process further into js function. Those ul list items are used to store into object array which will be sent over the wire to the mvc controller. This object is casted to my model as parameter on mvc controller. public class MyModel { .... public List&lt;Prize&gt; Prizes { get; set; } } public class Prize { public int Name {get; set;} public int LastName {get; set;} public int Age {get; set;} } on controller side [HttpPost] public ActionResult Edit(MyModel dataToEdit) { data.ToEdit other properties are populated correctly ... ... dataToEdit.Prizes are empty }); script inside view function editGame() { var items = $("#myValues &gt; ul &gt; li"); var prizeArr = []; items.each(function () { prizeArr.push({ Name:"test", LastName: "5", Age: "8" }); }); var myObj = { someData: $('#someCombo').val().toString(), Prizes: prizeArr }; $.ajax({ type: 'POST', traditional: true, contentType: 'application/json', url: '/MyController/Edit', data: JSON.stringify({ dataToEdit: myObj }), success: function () { alert("complete"); } }); }; How can I successfully receive Prizes in the MVC controller? Right now using this code Prizes list is empty, even though I'm sending non empty array (prizeArr). update: tried with data: { dataToEdit: myObj }, traditional: true, but still doesn't work.
has title: accepting data on mvc controller passed from js function
type: Question
has answer: http://stackoverflow.com/a/29650068
answer count: 1
has comment: http://stackoverflow.com/comment/47435904
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47435979
score: 0
has comment: http://stackoverflow.com/comment/47436586
accepted answer: http://stackoverflow.com/a/29650068
has comment: http://stackoverflow.com/comment/47436805
has comment: http://stackoverflow.com/comment/47436501

http://stackoverflow.com/comment/47513527
type: Comment
comment on: http://stackoverflow.com/q/29688189
type: QuestionComment
has text: @Miura-shi it's not "an object/array" it's an object.
score: 0

http://stackoverflow.com/comment/47475373
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29668369
has text: @GrishmaOswal Are you sure `#data` exists. Does `#data` *have any* HTML? Can you show the markup you're running this against?
type: Comment

http://stackoverflow.com/a/50440319
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/29648924
score: 2
has body: for edge use: /*Edge - works to 41.16299.402.0*/ @supports (-ms-ime-align:auto) { html{ overflow: hidden; height: 100%; } body{ overflow: auto; height: 100%; position: relative; } } /*Ie 10/11*/ @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { html{ overflow: hidden; height: 100%; } body{ overflow: auto; height: 100%; position: relative } }
upvote count: 2

http://stackoverflow.com/q/29586046
has answer: http://stackoverflow.com/a/29607103
has title: Delegating a function call in Javascript
favorite count: 0
linked to: http://stackoverflow.com/q/8228281
has body: Is there a way in Javascript to have a delegate like the ones in c# ? Example in c# Object.onFunctionCall = delegate (vars v) { Console.WriteLine("I can do something in this private delegate function"); }; I would like with my Javascript to have my main object do something over a long time, and shot a delegate once in a while to give a little update. All that without having to change the code itself of my class to adjust for the webpage. function mainObject() { this.onUpdate = function() { //Potentially the delegate function here } } var a = new mainObject(); a.onUpdate = Delegate { $(".myText").text("Just got a delegate update"); } I dunno if it's clear enough.. havent found ressources on this so I suppose there is just no way to do so ? NOTE: I am not looking into jquery Click delegates event here, but into delegating a function call like how it works in c# Let me know
score: 9
has comment: http://stackoverflow.com/comment/47329777
has comment: http://stackoverflow.com/comment/47320094
accepted answer: http://stackoverflow.com/a/29607103
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47320137
upvote count: 9
has comment: http://stackoverflow.com/comment/47321517
has comment: http://stackoverflow.com/comment/47321430
has comment: http://stackoverflow.com/comment/47320209
type: Question
has comment: http://stackoverflow.com/comment/47320219
tagged with: delegates
answer count: 2
possible better answer: http://stackoverflow.com/a/54036260
downvote count: 0
has answer: http://stackoverflow.com/a/54036260
tagged with: javascript

http://stackoverflow.com/comment/47414443
score: 1
type: Comment
has text: That's not at all a general case. E.g a string can be iterated over with for… in so a function that takes a string or an Array might have to have extra logic, which may or may not be worth it.
comment on: http://stackoverflow.com/a/29636067
type: AnswerComment

http://stackoverflow.com/a/29587624
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29587577
downvote count: 0
has body: Javascript's objects have hashmap like behaviour, so you can use them kind of like a set. If you iterate over all the values and set them to be keys within an object, you can use the Object.keys method to get an array of unique values out. function uniqueValues() { var unique = {}; [].forEach.call(arguments, function(array) { array.forEach(function(value) { unique[value] = true; }); }); return Object.keys(unique); }; This function will return the unique elements in any number of arrays, passed as arguments. uniqueValues([1, 2, 3], [ 1, 1, 1], [2, 2, 2], [3, 3, 3]); // [ 1, 2 3 ] One drawback to this method is that Javascript coerces all keys to strings, you can turn them back into numbers by changing the return statement to: return Object.keys(unique).map(Number);
type: Answer

http://stackoverflow.com/comment/61678094
has text: It could be that I've set a constructor, but other than that my example is the same and doesn't compile. The bind method works though.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/34050078

http://stackoverflow.com/q/29667097
downvote count: 2
tagged with: google-maps
score: -2
answer count: 1
tagged with: javascript
favorite count: 0
has body: I am drawing Real Time path on google map data are comming continuous manner. But after some time browser have been crashed. I am trying to remove data from array but problem is that all path get removed and I have to redraw it again. My Requirement is that remove data load on browser without temperig current path, offcourse old path get removed (means till some distance from start point coulld be removed after removing data from array). Similar like pagination. load only viewble area data and draw on map.Any guidence is very appreciable.thanks.
upvote count: 0
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/29667348
has title: Browser got crashed, with continuous drawing path on google map?
tagged with: browser

http://stackoverflow.com/comment/47283355
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29566823
has text: you should try something like conn.query("select * from groups").then(function (ans) {rows = ans;})
type: Comment

http://stackoverflow.com/a/29610683
type: Answer
answers question: http://stackoverflow.com/q/29581823
has comment: http://stackoverflow.com/comment/47374412
has body: Hm, I don't know what kind of textbox you are talking about, but if you want to obtain zip code via auto complete, here's your answer: Link
has comment: http://stackoverflow.com/comment/47374271
score: 0

http://stackoverflow.com/comment/47471632
has text: I'm very confused... what is the scope of `$j` inside of `$(document).ready()`? Is it different from `$`?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29641131

http://stackoverflow.com/comment/47315316
score: 0
type: AnswerComment
type: Comment
has text: I was actually asking for an example that's not XMLHttpRequest, sorry for confusing you.
comment on: http://stackoverflow.com/a/29581607

http://stackoverflow.com/comment/47305479
type: Comment
type: QuestionComment
has text: if you're willing to use jQuery there is a nice(if not a bit bloated) library https://select2.github.io/
comment on: http://stackoverflow.com/q/29578487
score: 0

http://stackoverflow.com/q/29684219
tagged with: promise
tagged with: node.js
type: AnsweredQuestion
score: 4
has body: I'm trying to chain a series of GET requests together. They're a series of API calls which depend on data from previous calls. My understanding of promises is that I should be able to make a flat .then() chain, but when I was trying to do this, my functions/console.logs were not executing in the proper order, so I presently have a growing pyramid of doom: var request = require('request'); var deferredGet = Q.nfbind(request); deferredGet(*params*) .then(function(response){ // process data from body and add it to the userAccount object which I am modifying. return userAccount; }) .then(function(userAccount){ deferredGet(*params*) .then(function(response){ //process data from body and add to userAccount return userAccount; }) .then(function..... // There's a total of 7 API calls I need to chain, and it's already getting unwieldy. I understand that you are supposed to return a promise, se perhaps I should be returning deferredGet, but when I tried to do that I was not returning anything. Also, the parameter passed into the first then is the response, not a promise. So I don't know where to go from here, but I feel like I'm doing it wrong. Thanks in advance!
linked to: http://stackoverflow.com/q/22539815
type: Question
has comment: http://stackoverflow.com/comment/47508485
tagged with: javascript
tagged with: http://stackoverflow.com/tag/q
upvote count: 4
has comment: http://stackoverflow.com/comment/47505529
has answer: http://stackoverflow.com/a/29684302
has comment: http://stackoverflow.com/comment/47508709
answer count: 1
downvote count: 0
has title: Using Q Promises to chain GET requests in node.js
has comment: http://stackoverflow.com/comment/47510052
favorite count: 0
accepted answer: http://stackoverflow.com/a/29684302

http://stackoverflow.com/comment/47327783
type: QuestionComment
has text: Probably has to do something with styles - probably this div is loading after i attach the event to the click... so how to deal with that?
comment on: http://stackoverflow.com/q/29590015
score: 0
type: Comment

http://stackoverflow.com/q/29656111
type: Question
has comment: http://stackoverflow.com/comment/47452187
tagged with: javascript
has comment: http://stackoverflow.com/comment/47454336
score: 0
has answer: http://stackoverflow.com/a/29683723
tagged with: ember.js
answer count: 1
tagged with: ember-cli
has title: How to create a helper with bounded property in Ember?
type: UnansweredQuestion
tagged with: handlebars.js
tagged with: htmlbars
has body: I am using Ember-CLI (0.2.0) recently and am testing a simple Helper built from the generator. The Helper does its job but the problem is that the variable used is not bounded and when its value changes not reflected in the UI. The helper is a get property to which you pass a property name (that is variable and can take any of the names of the item) and an object and returns the value of that property, this the code: // unbounded-get-property.js import Ember from 'ember'; export function unboundedGetProperty(params) { var data = params[0]; var name = params[1]; return data.get(name); } export default Ember.HTMLBars.makeBoundHelper(unboundedGetProperty); And this is the use //some hbs {{#each item in filteredList}} {{unbounded-get-property item propertyName}} {{/each}} This same fact with a component is easy to do: //bounded-get-property import Ember from 'ember'; import layout from '../templates/components/bound-get-property'; export default Ember.Component.extend({ layout: layout, valueDefinition: function() { Ember.defineProperty(this, 'value', Ember.computed.alias('item.' + this.get('propertyName'))); }.on('init') }); //bounded-get-property.hbs {{value}} //some hbs {{#each item in filteredList}} {{bounded-get-property item=item propertyName=propertyName}} {{/each}} The question is, we have to create a component like this if we need bound the property?? can't be resolv with a helper?? I hope someone can give me some direction where investigate or learn. Note: filteredList is a filtered version of the model which is setted in route via ember-data find method propertyName is the name of the property of the item object, its value can be variable. Thanks in advance

http://stackoverflow.com/q/29577289
type: Question
has comment: http://stackoverflow.com/comment/47303542
tagged with: javascript
tagged with: jquery
tagged with: replace
has body: I have this working incrementer for echoed rows from a sql database thanks to users from stackoverflow &lt;script type="text/javascript"&gt; $(document).on("click", ".button", function() { var selectedId = $(this).attr('id'); var $id = selectedId; $.post( "incrementer.php", { 'id':$id, }).done(function( data ) { // alert( "Server response: " + data ); window.location.replace("http://refresh_to_reflect_change.com"); }); }); &lt;/script&gt; As you can see, I commented out the "Server response: " + data line For one reason it is empty, and another I'm not sure what to do with it. Can I get data from the server "on the way back" so for example in this case, I incremented a "likes" and I'd like to reflect that change by increasing the displayed number by 1, can this .done(function... be used to get data from the server and send it back sequentially after incrementing?
type: UnansweredQuestion
has title: Can I use .done(function... to reflect changes?
has comment: http://stackoverflow.com/comment/47323060
answer count: 0
score: 0
tagged with: live

http://stackoverflow.com/q/29592828
tagged with: graphics
tagged with: canvas
has title: HTML5 Canvas Pathfinding for an object within a drawn polygon
tagged with: javascript
type: UnansweredQuestion
has body: Good afternoon all, I come to you with yet another request for a lesson/example/answers. While messing around with a canvas in HTML5, I have learned how to manipulate Depth(Z-Buffer) and several other neat things. However, now I am trying to find a way to perform Pathfinding with the canvas. Most of the examples on the Internet are a little difficult to comprehend for me due to the fact that they are handling pathfinding far differently than I am trying to achieve(Which is that they use tile based pathfinding). Most other examples seem to deal in boxes or rectangles as well. This is my code that I used as an example to draw a Polygon: var canvas = document.getElementById('CanvasPath'); var context = canvas.getContext('2d'); // begin custom shape context.beginPath(); context.moveTo(170, 80); context.bezierCurveTo(1, 200, 125, 230, 230, 150); context.bezierCurveTo(250, 180, 320, 200, 340, 200); context.bezierCurveTo(420, 150, 420, 120, 390, 100); context.bezierCurveTo(430, 40, 370, 30, 340, 50); context.bezierCurveTo(320, 5, 250, 20, 250, 50); context.bezierCurveTo(200, 5, 150, 20, 170, 80); context.closePath(); context.lineWidth = 2; context.strokeStyle = 'gray'; context.stroke(); Lets say I have a small box that I want to move around in that Polygon(I really will be creating the polygon with line points rather than Bezier curvers. I just wantd to show an example here) when I click at the goal position I want it to be at... How can I create a pathfinding algorithm that will find its way around and yet not have the bottom points of the box touch outside the polygon? I am assuming I would need to get all the pixels that are in that polygon to create a path from? I am thinking that the Bezier Curves and points may need to be created and pushed from an Array instead and then find the path??? Any suggestions on approach and can you provide an example for how to go about this? Please be gentle... While I have been an experienced scripter and programmer, I have not been one…
has answer: http://stackoverflow.com/a/29596431
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
score: 1
favorite count: 0
type: Question
upvote count: 1
answer count: 1

http://stackoverflow.com/q/29615132
has comment: http://stackoverflow.com/comment/47381209
tagged with: animation
upvote count: 1
has comment: http://stackoverflow.com/comment/47404824
type: AnsweredQuestion
has title: Animating multiple items in Paper.js while anchored to a path
has answer: http://stackoverflow.com/a/29633611
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29633611
has body: I have five rectangles placed at different points along a circle like this - https://i.sstatic.net/tiwCt.jpg. Upon clicking any rectangle i want the circle to move to the left of the screen, gradually scaling down it's radius until the circle's center reaches x=0. I'd like the five rectangles to move along with the circle while its being scaled down and also adjust their own positions and scale on the circle so that they are within the view's bounds, like this - https://i.sstatic.net/0rZHN.jpg I'd appreciate any help on how to go about doing this. Heres my code for getting to the 1st image and animating the circle: var radius = 300; var center = view.center; var circle = new Path.Circle({ center: view.center, radius: radius, strokeColor: 'black', name: 'circle' }); var path = new Path.Rectangle({ size: [230, 100], fillColor: '#1565C0' }); var rectText = ['Text 1', 'Text 2', 'Text 3', 'Text 4', 'Text 5' ]; var symbol = new Symbol(path); var corners = [ new Point(center.x, center.y - radius), new Point(center.x - radius, center.y - radius / 2), new Point(center.x + radius, center.y - radius / 2), new Point(center.x - radius, center.y + radius / 2), new Point(center.x + radius, center.y + radius / 2) ]; var rectClicked = false; var clickedRect = null; var rectClick = function(event) { rectClicked = true; clickedRect = this; }; function onFrame(event) { // Your animation code goes in here if (rectClicked) { for (var i = 0; i &lt; 1; i++) { var item = project.activeLayer.children[i]; if (item.name == 'circle') { if (item.position.x &lt; 0) { rectClicked = false; } else { item.position.x -= 10; item.scale(1/1.01); } } } } } // Place the instances of the symbol: for (var i = 0; i &lt; corners.length; i++) { var placedSymbol = symbol.place(corners[i]); placedSymbol.onMouseDown = rectClick; var rText = new PointText({ point: placedSymbol.bounds.topLeft + 20, content: rectText[i], fontSize: '20', fillColor: 'white' }); }
downvote count: 0
answer count: 1
score: 1
tagged with: paperjs
favorite count: 0

http://stackoverflow.com/comment/47247555
type: QuestionComment
type: Comment
has text: did you remember to replace "id" in the parentheses with the actual element's ID? Surely you don't have an id named "id"?
comment on: http://stackoverflow.com/q/29547940
score: 0

http://stackoverflow.com/a/29644877
downvote count: 0
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/47430830
has comment: http://stackoverflow.com/comment/47430673
score: 2
has comment: http://stackoverflow.com/comment/47431059
has body: I think this should suffice your requirements... var regx = /^[0-9]{1,6}(\.[0-9]{1,5})?$/; console.log(regx.test('123456.12345')); //returns true console.log(regx.test('1234567.12345')); //returns false Start with a number, accepts minimum of one digit before and after the ., allows maximum of six before . after maximum of five after . Also note that . is optional Demo (borders will change accordingly)
has comment: http://stackoverflow.com/comment/47430727
answers question: http://stackoverflow.com/q/29644672
has comment: http://stackoverflow.com/comment/47430959

http://stackoverflow.com/comment/47517460
has text: It did somewhat, but I decided now its best to move the ad code closer to the top. Thanks for your help tho.
comment on: http://stackoverflow.com/a/29680579
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47466211
has text: He's using classes already. I'm guessing that's because there might be more than one tree on the page.
comment on: http://stackoverflow.com/a/29663387
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/29612002
has comment: http://stackoverflow.com/comment/47369827
has body: You can use the node.lastChild Property The Node.lastChild read-only property returns the last child of the node. > If its parent is an element, then the child is generally an element node, > a text node, or a comment node. It returns null if there are no child elements.. var tr = document.getElementById("row1"); var corner_td = tr.lastChild;
answers question: http://stackoverflow.com/q/29611933
has comment: http://stackoverflow.com/comment/47369598
type: Answer
has comment: http://stackoverflow.com/comment/90047094
upvote count: 4
has comment: http://stackoverflow.com/comment/47369669
downvote count: 0
score: 4

http://stackoverflow.com/comment/47444421
type: Comment
type: QuestionComment
score: 0
has text: @RishiPrakash edited the question to clarify
comment on: http://stackoverflow.com/q/29651492

http://stackoverflow.com/q/29624135
has body: I have DIV's which I pass data into based on different selections on my page. I append these values in an array to create a MYSQL query. When the page loads a few MySQL clauses are set SELECT FROM JOIN ON LIMIT 1000 and more values can be appended in between these pre-loaded clauses to achieve something like: SELECT * FROM abop_stats JOIN call_outcome ON abop_stats.outcome_idfk = call_outcome.id ORDER BY outcome_idfk ASC LIMIT 1000 Before the page was loading with 2 sets of JOIN &amp; ON clauses so I tried to write an if statement to check the length of the query and if it exceeded a certain amount add the second set of clauses. This didn't work so I tried to console.log my array length and it prints a fixed value of 16 on load and the same value whenever options are added into the DIV's so the displayed Query (html) isn't the same as the one on the console (because the second set of MySQL clauses aren't being being added). My Code: function query() { var qry = []; qry.push($('#select').html()); qry.push($('#selection').html()); qry.push($('#from').html()); qry.push($('#table').html()); qry.push($('#join').html()); qry.push($('#table2').html()); qry.push($('#on').html()); qry.push($('#tablejoin').html()); if (qry.length &gt; 10) { qry.push($('#join2').html()); qry.push($('#table3').html()); qry.push($('#on2').html()); qry.push($('#tablejoin2').html()); } qry.push($('#precondition').html()); qry.push($('#column').html()); qry.push($('#condition').html()); qry.push($('#input').html()); qry.push($('#precondition2').html()); qry.push($('#column2').html()); qry.push($('#condition2').html()); qry.push($('#limiter').html()); var fullqry = qry.join(" "); var length = qry.length; console.log(qry.length); console.log(fullqry); return fullqry; } Why is my array.length giving a static value?
answer count: 1
has comment: http://stackoverflow.com/comment/47392235
has answer: http://stackoverflow.com/a/29624378
favorite count: 0
has comment: http://stackoverflow.com/comment/47392134
has title: Array.length returns fixed value
downvote count: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47391877
has comment: http://stackoverflow.com/comment/47392204
upvote count: 1
has comment: http://stackoverflow.com/comment/47391899
type: Question
has comment: http://stackoverflow.com/comment/47392197
has comment: http://stackoverflow.com/comment/47394322
tagged with: arrays
tagged with: javascript
tagged with: jquery
score: -1
accepted answer: http://stackoverflow.com/a/29624378

http://stackoverflow.com/a/29664302
has comment: http://stackoverflow.com/comment/47467959
has comment: http://stackoverflow.com/comment/47467899
has comment: http://stackoverflow.com/comment/47468018
score: 0
answers question: http://stackoverflow.com/q/29664182
has body: This is handled in the selector, assuming you are using CSS3,like so... input[type*='checkbox'][name*='room'] { ... styles here }
type: Answer

http://stackoverflow.com/a/29686629
type: Answer
has body: Look at this (single-line solution): function multiplyBy(x,y,n) { return Array.apply(null, new Array(n)).map(function(v, i) { return x * Math.pow(y, i + 1); }); } DEMO
score: 0
answers question: http://stackoverflow.com/q/29686319

http://stackoverflow.com/comment/47281186
has text: I have no idea why you would want the header to be wider than the page but simply set it wider in the CSS: http://jsfiddle.net/8ym110v0/
comment on: http://stackoverflow.com/q/29565550
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/29585085
answers question: http://stackoverflow.com/q/29585021
score: 1
upvote count: 2
has comment: http://stackoverflow.com/comment/47319198
downvote count: 1
type: Answer
has body: This function is called whenever something on the document changes, and it sets the height of div2 to the value for the height of div1
has comment: http://stackoverflow.com/comment/47318870

http://stackoverflow.com/q/29579140
tagged with: javascript
has comment: http://stackoverflow.com/comment/47306790
answer count: 2
downvote count: 0
tagged with: jquery
score: 1
has comment: http://stackoverflow.com/comment/47307052
favorite count: 0
has title: apply column style to table body element
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29579313
tagged with: css
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29579256
has comment: http://stackoverflow.com/comment/47307820
has body: I have created the following table in html. I want to apply a style to table body elements in column which i have added a css class. But the style should not apply to header column. only to body column. Here for a example i have add CSS class called "body-right". The result what i want is all the table body elements in column "Value" should "right align" except header column. How to achieve this in css. Thanks a lot. Criteria Description Value ABC GGGGGG 35.63 XYZ HHHHH 68.26 MNP KKKKK 45.26

http://stackoverflow.com/a/29652629
upvote count: 2
type: Answer
has body: I don't have experience with add-ons for Thunderbird, but do with add-ons for Firefox. However, I believe the same mechanisms apply to Thunderbird. You have two options (or perhaps more, that I am unaware of): Include the needed extra javascript file in the xul file, before the main javascript file (or did you try this already?): &lt;script type="application/javascript" src="chrome://path/to/extra.js"/&gt; &lt;script type="application/javascript" src="chrome://path/to/main.js"/&gt; Load the needed extra javascript file from inside the main javascript file, as a subscript, with the subscript loader service, through loadSubScript(): var mozIJSSubScriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"] .getService(Components.interfaces.mozIJSSubScriptLoader); mozIJSSubScriptLoader.loadSubScript( 'chrome://path/to/extra.js', optionalScope, 'UTF-8' ); The optionalScope lets you load the scripts variables into a designated object. If omitted, the scripts variables will be loaded into the current scope of the loadSubScript() caller. The charset argument is optional as well, by the way.
has comment: http://stackoverflow.com/comment/47447810
answers question: http://stackoverflow.com/q/29651738
score: 2
has comment: http://stackoverflow.com/comment/47447251
downvote count: 0
has comment: http://stackoverflow.com/comment/47447653
accepted answer of: http://stackoverflow.com/q/29651738
type: AcceptedAnswer

http://stackoverflow.com/a/29607964
score: 0
answers question: http://stackoverflow.com/q/29580230
type: Answer
has body: So the solution was to delete return false; from the function.

http://stackoverflow.com/a/29674728
score: 7
has comment: http://stackoverflow.com/comment/47490284
accepted answer of: http://stackoverflow.com/q/29674656
upvote count: 7
has comment: http://stackoverflow.com/comment/47488675
answers question: http://stackoverflow.com/q/29674656
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47489104
type: Answer
has body: You're specifying that you want everything in dropdown to trigger the event. If you only want the top level A, it looks more like this: jQuery(document).ready(function($) { $('.dropdown&gt;a').click(function(e) { $(this).parent().toggleClass('shown'); e.preventDefault(); }) })
has comment: http://stackoverflow.com/comment/47491543

http://stackoverflow.com/comment/47378576
score: 0
type: Comment
has text: I saw what you said. the input type should be 'text', not 'date'. Updated jsfiddle.
type: AnswerComment
comment on: http://stackoverflow.com/a/29607622

http://stackoverflow.com/comment/47483514
score: 0
has text: try $('.swiper-'+ pageId) (and check - is it get you needs element, like $('.swiper-13') @thedom
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29672842

http://stackoverflow.com/comment/47762700
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29789371
has text: Ah good solution! I ended up sticking with recursion througout.. I'll post what I came up with

http://stackoverflow.com/comment/122459316
score: 0
type: Comment
comment on: http://stackoverflow.com/a/31908562
type: AnswerComment
has text: @Jie you'll need to [allow](https://stackoverflow.com/a/39850969/2518317) them

http://stackoverflow.com/q/29612832
has body: I am using Angular DataTables within my app. So far everything works well, except when I try to add custom sorting. I have a set of data that returns a hyphen, "-" if there is no data. Here is my sorting function:: $.fn.dataTableExt.oSort['nullable-asc'] = function(a,b) { if (a == '-') return 1; else if (b == '-') return -1; else { var ia = parseInt(a); var ib = parseInt(b); return (ia&lt;ib) ? -1 : ((ia &gt; ib) ? 1 : 0); } } $.fn.dataTableExt.oSort['nullable-desc'] = function(a,b) { console.log(a,b) if (a == '-') return 1; else if (b == '-') return -1; else { var ia = parseInt(a); var ib = parseInt(b); return (ia&gt;ib) ? -1 : ((ia &lt; ib) ? 1 : 0); } } ..start controller... vm.dtColumnDefs = [ DTColumnDefBuilder.newColumnDef(0).notSortable().withClass('hidden-print') DTColumnDefBuilder.newColumnDef(1).withClass('td-fieldname'), //name DTColumnDefBuilder.newColumnDef(2), //fieldType DTColumnDefBuilder.newColumnDef(3).withOption('type', 'html-num-fmt'), DTColumnDefBuilder.newColumnDef(4).notSortable(), //distribution DTColumnDefBuilder.newColumnDef(5).withOption('type', 'html-num-fmt'), //cardinality DTColumnDefBuilder.newColumnDef(6).withOption('type', 'nullable'), //Min DTColumnDefBuilder.newColumnDef(7).withOption('type', 'nullable') //Max ]; ...other angular code..... This works just fine when tried on a standard table, but it doesn't play nice with the Angular app. When I click on the heading of the table to sort - nothing happens. console.log above yields blank values. Is there a way to use custom sorting with the Angular directive?
type: UnansweredQuestion
upvote count: 9
score: 9
type: Question
downvote count: 0
tagged with: javascript
tagged with: sorting
favorite count: 0
tagged with: angular-datatables
has title: Custom sorting with Angular DataTables directive
tagged with: datatable
answer count: 0
tagged with: angularjs

http://stackoverflow.com/a/29731580
score: 1
answers question: http://stackoverflow.com/q/29575395
has comment: http://stackoverflow.com/comment/61434560
has body: Had the same issue with the same pattern. In my case, the 'visible' attribute assignment on the modal element was being replaced in the html during the build/minification process so there was no 'visible' attribute being passed in to the directive. Before build/minification: &lt;modal title="my title here" visible="showModal"&gt;&lt;/modal&gt; After build/minification: &lt;modal title="my title here" visible&gt;&lt;/modal&gt; To fix I just changed the 'visible' attribute name in the element and the link function to something else and it behaved as expected.
upvote count: 1
type: Answer
downvote count: 0

http://stackoverflow.com/comment/47463661
score: 0
comment on: http://stackoverflow.com/q/29661720
type: Comment
type: QuestionComment
has text: Tried removing the "./" to no avail...

http://stackoverflow.com/comment/47447408
has text: @BenBlack No not at all. Just stops like there is a breakpoint there even if there isn't.
comment on: http://stackoverflow.com/q/29653490
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29624992
answers question: http://stackoverflow.com/q/29624924
type: Answer
has body: you can use numeric names as strings, e.g. {"123":"ABC"} is a valid JSON while {123:"ABC"} is a valid Javascript expression
score: 0

http://stackoverflow.com/q/29556689
has comment: http://stackoverflow.com/comment/47267182
accepted answer: http://stackoverflow.com/a/29558854
has comment: http://stackoverflow.com/comment/47264282
tagged with: javascript
has comment: http://stackoverflow.com/comment/47264845
has comment: http://stackoverflow.com/comment/47264233
has comment: http://stackoverflow.com/comment/47263821
has body: I have the following HTML I can see when inspecting element on google chrome. 2015-03-08 2015-03-08 10:30:00 11:30:00 01:00:00 John Doe Jane Doe n/a 2015-03-08 2015-03-08 10:30:00 11:30:00 01:00:00 John Doe Jane Doe n/a ... and so on I previously was using document.getElementById('id').innerHTML but now I have to call the function inside my $(document).ready(function() so I need to use jQuery to get the values. I have the following loop: for (i=0; i < 10; i++){ var aptDate = $('#table_id #aptDate'+i).textContent; //textContent returns undefined var aptDate = $('#table_id #aptDate'+i).text(); //.text() returns an empty string var aptDate = $('#table_id #aptDate'+i).val(); //.val() returns undefined var aptDate = $('#table_id #aptDate'+i).html; //.html retturns function (e){return x.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!x.support.htmlSerialize&&mt.test(e)||!x.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(x.cleanData(Ft(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)} console.log(aptDate); } My datatable initialisation is as follows: $('#table_id').dataTable({ bProcessing: true, bServerSide: true, "sAjaxSource": "script.php", "rowCallback": function( row, data, index ) { if ( data[9] == "0" ) { $('td:eq(9)', row).html('Not scanned'); $('td:eq(9)', row).css("color", "red"); } else if (data[9] !== data[12]){ $('td:eq(9)', row).html('Incorrect QR Scanned'); $('td:eq(9)', row).css("color", "red"); } else{ $('td:eq(9)', row).html('Scanned'); } $('td:eq(1)', row).css("display", "none"); $('td:eq(12)', row).css("display", "none"); $('td:eq(13)', row).css("display", "none"); $('td:eq(0)', row).attr("id", "aptDate"+index); $('td:eq(1)', row).attr("id", "aptDateEnd"+index); $('td:eq(2)', row).attr("id", "Star…
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29556942
possible better answer: http://stackoverflow.com/a/29557064
tagged with: jquery
has answer: http://stackoverflow.com/a/29557064
type: Question
has comment: http://stackoverflow.com/comment/47263836
has answer: http://stackoverflow.com/a/29557046
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29556861
has title: getting value of my td cells by id in jQuery
tagged with: datatable
answer count: 6
has comment: http://stackoverflow.com/comment/47266756
has comment: http://stackoverflow.com/comment/47266680
has answer: http://stackoverflow.com/a/29558854
score: 0
has answer: http://stackoverflow.com/a/29557288

http://stackoverflow.com/q/29655752
tagged with: archive
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/47451383
possible better answer: http://stackoverflow.com/a/29656056
has answer: http://stackoverflow.com/a/29659739
tagged with: javascript
has answer: http://stackoverflow.com/a/29656056
has body: Is it possible to essentially archive the state of a JS object, beyond what would be serialised if you were to produce a JSON string from it? Thinking in terms of saving state in a game, and loading it back into window on a separate occasion.
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29659739
tagged with: save
has title: Storing JS objects along with prototypes, instance types etc
type: Question
tagged with: object
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/47451260

http://stackoverflow.com/a/29684243
downvote count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/47505572
type: AcceptedAnswer
type: Answer
score: 2
has body: One way is to make the wrapping div and a tags also have a border radius... .blackground &gt; div, .blackground &gt; div a { border-radius: 100%; } .blackground &gt; div a { display:block; }
has comment: http://stackoverflow.com/comment/47505389
accepted answer of: http://stackoverflow.com/q/29684100
answers question: http://stackoverflow.com/q/29684100

http://stackoverflow.com/q/29531896
has comment: http://stackoverflow.com/comment/112016325
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: How to build client server app using node js and html?
type: UnansweredQuestion
tagged with: node.js
tagged with: mysql
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29538663
has body: I have html file called temp.html I want to display select query result in that html page. This is my select query. SELECT cs_name FROM course_master where cs_id = 4 This query will return following result. [ { cs_name: 'JAVA programming' } ] I want to display this result in html page. Basically I want to use the "GET" request and response using node js. This is my node js file structure. var mysql = require('mysql'); var connection = mysql.createConnection({ host : '127.0.0.1', user : 'root', password : '', database : 'eduportal' }); connection.connect(); connection.query('SELECT cs_name FROM course_master where cs_id = 4', function(err, rows, fields) { if (!err) console.log('The solution is: ', rows); else console.log('Error while performing Query.'); }); connection.end(); This is my HTML file. &lt;!doctype html&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;/head&gt; &lt;body&gt; &lt;div id="course_name"&gt; Course Name:&lt;input type="text" id="cname"&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; I want to display course name in text box which I defined in HTML file. Can anyone help to bind this text box with mysql using node js?
score: 0

http://stackoverflow.com/a/29578508
accepted answer of: http://stackoverflow.com/q/29578389
answers question: http://stackoverflow.com/q/29578389
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1
score: 1
has body: Use forEach (instead of for (var i in urls)), which creates a new scope: urls.forEach(function(nextUrl, i) { http.get(nextUrl, function(response) { ... }); });

http://stackoverflow.com/q/29687885
type: Question
answer count: 2
tagged with: react-native
has title: React Native: renderRow not executed
has answer: http://stackoverflow.com/a/35627217
upvote count: 4
tagged with: reactjs
has body: In the following code, when setState is called from campaignsUpdated, render gets logged to the console, but not renderRow: var React = require('react-native'), Bus = require('../Bus'), styles = require('../Styles'), CampaignsStore = require('../stores/Campaigns'), CampaignItem = require('./CampaignItem'), { Component, Text, TextInput, ListView, View, NavigatorIOS, ActivityIndicatorIOS } = React class CampaignList extends Component { constructor(props) { super(props) this.state = { dataSource: new ListView.DataSource({rowHasChanged: (r1, r2) =&gt; r1 !== r2}) } } componentDidMount() { this.addListeners() Bus.emit('campaigns:search', '') } componentWillUnmount() { this.removeListeners() } render() { console.log('render') return ( &lt;View style={styles.container}&gt; &lt;TextInput style={styles.searchInput} placeholder='Campaign Name' value={this.state.campaignName} onChange={this.campaignSearchChanged.bind(this)}/&gt; &lt;ListView dataSource = {this.state.dataSource} renderRow = {this.renderRow.bind(this)}/&gt; &lt;/View&gt; ) } renderRow(campaign) { console.log('renderRow') return &lt;CampaignItem campaign={campaign}/&gt; } addListeners() { Bus.on({ 'campaigns:updated': this.campaignsUpdated.bind(this) }) } removeListeners() { Bus.off({ 'campaigns:updated': this.campaignsUpdated.bind(this) }) } campaignsUpdated(event) { var campaigns = event.data this.setState({ dataSource: this.state.dataSource.cloneWithRows(campaigns) }) } campaignSearchChanged(event) { var campaignName = event.nativeEvent.text Bus.emit('campaigns:search', campaignName) } } module.exports = CampaignList What am I doing wrong here?
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29690073
favorite count: 0
score: 4

http://stackoverflow.com/comment/47316587
score: 0
has text: well, you can't use the submit button anymore. at least, not with out totally re-implementing it anyway...
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29584051

http://stackoverflow.com/q/29603811
tagged with: javascript
tagged with: drop-down-menu
favorite count: 0
has title: From select dropdown to boxes
has comment: http://stackoverflow.com/comment/47353398
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47353365
has comment: http://stackoverflow.com/comment/47353607
has comment: http://stackoverflow.com/comment/47354497
answer count: 0
upvote count: 2
tagged with: wordpress
downvote count: 1
type: Question
tagged with: woocommerce
score: 1
has body: Is there a way I could make from a drop-down to a simple box without changing the tags? Or it there a simpler way to transform it into a radio-button but still keeping the back-end functionality? This is what I have: And this is what I want to do: It is a website built using wordpress and woocommerce plugin.

http://stackoverflow.com/comment/47235331
type: QuestionComment
has text: I think you can pass a scope parameter to your $model.open function. Try adding scope: $scope to your obejct.
score: 1
comment on: http://stackoverflow.com/q/29541705
type: Comment

http://stackoverflow.com/q/29579706
type: AnsweredQuestion
has title: Complex calculation in JavaScript
has comment: http://stackoverflow.com/comment/47307824
has comment: http://stackoverflow.com/comment/47309769
has answer: http://stackoverflow.com/a/29579810
has answer: http://stackoverflow.com/a/29579783
has comment: http://stackoverflow.com/comment/47309754
type: Question
has body: I'm having trouble understanding this code: y -= (1 - (1770 - pencilY) / 225) * 140; The way I understand calculation in JS: y += 10; is equal to y = y + 10; and if I say y = 1 - (1770 - pencilY); What happens is (1770 - pencilY) gets calculated 1st before the resulting value is calculated against 1 , something like y = 1 - resulting value of 1770 - pencilY , but still I am unable to figure out that complex equation , its too nested for my understanding , can somebody expalin it to me?
tagged with: javascript
has comment: http://stackoverflow.com/comment/47307855
has comment: http://stackoverflow.com/comment/47307890
score: 0
has answer: http://stackoverflow.com/a/29579813
accepted answer: http://stackoverflow.com/a/29579813
answer count: 4
has comment: http://stackoverflow.com/comment/47309737
has answer: http://stackoverflow.com/a/29579786
possible better answer: http://stackoverflow.com/a/29579810
has comment: http://stackoverflow.com/comment/47307859

junit
type: Tag
tag name: junit
tags question: http://stackoverflow.com/q/29664547

http://stackoverflow.com/comment/47325269
has text: and check this: http://stackoverflow.com/questions/500504/why-is-using-for-in-with-array-iteration-such-a-bad-idea
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29588963

http://stackoverflow.com/q/29549513
has comment: http://stackoverflow.com/comment/47250985
score: 1
tagged with: java
accepted answer: http://stackoverflow.com/a/29549726
has comment: http://stackoverflow.com/comment/47250629
type: Question
has comment: http://stackoverflow.com/comment/47250615
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/47250649
linked to: http://stackoverflow.com/q/8488833
has comment: http://stackoverflow.com/comment/47250651
answer count: 1
favorite count: 0
has body: In JavaScript we can do: function foo() { ... return { attr1 : ... , attr2 : ..., }; } But what is its equivalent in Java? Because I want to return a custom Json object from my controller after an ajax call and I want to create a new bean.
has answer: http://stackoverflow.com/a/29549726
has title: Return anonymous object in java
upvote count: 1
has comment: http://stackoverflow.com/comment/47250616
type: AnsweredQuestion

http://stackoverflow.com/q/29625725
upvote count: 3
answer count: 1
linked to: http://stackoverflow.com/q/38120478
has body: I have been trying to use AVSpeechSynthesizer to read text from UIWebView. The way I want to do it is: Using JS to get the top visible element on screen (i.e. p, h1, h2, h3 etc.) Splitting the element into an array of words using JS. One by one, each Word is highlighted(JS) and spoken using AVSpeechSynthesizer. Now the problem is, since each word is spoken one at a time, it speaks very abruptly, like individual words and not a sentence. What I want is that if would make the entire element speak with AVSpeechSynthesizer and getting to know how for how long is being spoken so as to synchronise the highlighting or to somehow make individuals words being spoken right now maintain as a sentence.
tagged with: uiwebview
favorite count: 0
tagged with: avspeechsynthesizer
type: UnansweredQuestion
score: 3
has answer: http://stackoverflow.com/a/29626058
downvote count: 0
type: Question
has comment: http://stackoverflow.com/comment/50819185
tagged with: ios
has title: AVSpeechSynthesizer with word by word sync
tagged with: javascript

http://stackoverflow.com/a/29634409
has comment: http://stackoverflow.com/comment/47423501
score: 0
has body: Here is another option, scaled down from some development I've done. A bit more flexible but also more complex. Pay attention to how the items are tagged with data-* attributes to decide what is hidden and shown. http://jsbin.com/siyexumulu/1/
type: Answer
answers question: http://stackoverflow.com/q/29633699

http://stackoverflow.com/comment/47440081
has text: @WashingtonGuedes — That's a style matter. Semi-colon insertion rules mean it isn't a problem.
comment on: http://stackoverflow.com/q/29649409
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47420840
type: Comment
comment on: http://stackoverflow.com/a/29639468
type: AnswerComment
has text: This solution currently uses about 3 extra lines of code than I would like to so edits very welcome.
score: 0

http://stackoverflow.com/comment/47505845
score: 0
type: Comment
type: QuestionComment
has text: http://stackoverflow.com/questions/12339272/angular-js-unknown-provider
comment on: http://stackoverflow.com/q/29684417

http://stackoverflow.com/a/29541068
score: 0
accepted answer of: http://stackoverflow.com/q/29540792
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47247027
has body: This is a complete example with both HTML, JavaScript, and jQuery. You basically have a textarea and a hidden (and disabled) button. The JavaScript code simply adds a click event to the textarea and enables the button inside the form. CLICK ME Resources: http://www.w3schools.com/jquery/ http://www.tutorialspoint.com/jquery/ https://learn.jquery.com/about-jquery/how-jquery-works/
type: Answer
answers question: http://stackoverflow.com/q/29540792
has comment: http://stackoverflow.com/comment/47234850
has comment: http://stackoverflow.com/comment/47235223

http://stackoverflow.com/comment/47283368
has text: Thanks for the help and suggestions. I just discovered _.mapObject in a newer version of underscore that I didn't have in my underscore 1.7. The update made the difficult simple! Thank you underscore!!!
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29565576
type: QuestionComment

http://stackoverflow.com/q/29550829
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29551470
tagged with: http://stackoverflow.com/tag/json
type: Question
has comment: http://stackoverflow.com/comment/47253229
tagged with: function
has body: So this will be a lot of code, but what matter is on line 22-25, and line 87-91. The rest of the code works. I have a nested function and want to return the JSON string. Using console.log I can tell it is running properly but will not return the JSON string. Look for the part that says //---------this part-------. There are two parts that I am asking about. exports.post = function(request, response) { var mssql = request.service.mssql; //var data = '{"userID":"ryan3030@vt.edu1"}'; var inputJSON = request.body.JSONtext; var json = JSON.parse(inputJSON); var userID = json.userID; mssql.query("EXEC getMeetingInfo ?", [userID], { success: function(results3) { var meetingsToday = results3.length; var meetingID = results3[0].meetingID; var meetingName = results3[0].meetingName; var meetingDescription = results3[0].meetingDescription; var meetingLength = results3[0].meetingLength; var meetingNotes = results3[0].meetingNotes; var hostUserID = results3[0].hostUserID; //--------------------------------------THIS PART------------------------------ var JSONfinal = allInfoFunction(mssql, meetingID, userID, meetingName, meetingDescription, meetingLength, meetingNotes, hostUserID, meetingsToday); console.log(JSONfinal);//DOES NOT WORk response.send(statusCodes.OK, JSONfinal);//DOES NOT WORK //---------------------------------BETWEEN THESE---------------------------------- }, error: function(err) { console.log("error is: " + err); response.send(statusCodes.OK, { message : err }); } }); }; function allInfoFunction(mssql, meetingID, userID, meetingName, meetingDescription, meetingLength, meetingNotes, hostUserID, meetingsToday){ mssql.query("EXEC getLocation ?", [meetingID], { success: function(results2) { var meetingLocation = results2[0].meetingLocation; var JSONlocation = {"meetingLocation": meetingLocation}; mssql.query("EXEC getDateTime ?", [meetingID], { success: function(results1) { var length = results1.length; var dateTime = []; dateTime[0] = results1[0].meetingDateTime; for…
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/29551470
answer count: 1
has title: Getting JSON from a Function in javascript
tagged with: return

http://stackoverflow.com/comment/47330638
comment on: http://stackoverflow.com/q/29591823
has text: take a look at https://github.com/futurepress/epub.js/
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47346632
type: AnswerComment
has text: Look at this fiddle. Here it is working. But calendar is open in left corner. How to fix in a correct position.
comment on: http://stackoverflow.com/a/29599619
type: Comment
score: 0

http://stackoverflow.com/comment/47373435
has text: hi - i just updated my question to include the error
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29613882
type: Comment

http://stackoverflow.com/comment/47444509
type: Comment
has text: your method is similar to @DontVoteMeDown and works fine in regular example, but what I said and explain that is not happening.
comment on: http://stackoverflow.com/a/29649663
score: 0
type: AnswerComment

http://stackoverflow.com/q/29534814
has body: I apologize if this question has already asked. I tried a lot. but won't works. If i have the .div1 its working fine. but i removed .div1. Console through error like below. How can solve this. Uncaught TypeError: Cannot read property 'top' of undefined JS Fiddle HTML Console error 2 JQuery function resize() { var position= $('.div1').offset(); var top= position.top; var newtop = top + 60 + "px"; $('.div2').css( { 'top': newtop }); } $(window).resize(function(){ resize(); }); window.onload = resize(); CSS .div1 { position:fixed; top: 40px; } .div2 { position:fixed; } JS Fiddle
has comment: http://stackoverflow.com/comment/47222417
has comment: http://stackoverflow.com/comment/47222525
has comment: http://stackoverflow.com/comment/47222369
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29534924
downvote count: 3
upvote count: 1
type: Question
score: -2
tagged with: javascript
has comment: http://stackoverflow.com/comment/47222493
has comment: http://stackoverflow.com/comment/47222449
has title: Uncaught TypeError: Cannot read property 'top' of undefined - Jquery
has comment: http://stackoverflow.com/comment/47222504
answer count: 3
has answer: http://stackoverflow.com/a/29534924
has comment: http://stackoverflow.com/comment/47222394
tagged with: jquery
possible better answer: http://stackoverflow.com/a/29534920
favorite count: 0
has answer: http://stackoverflow.com/a/29534920
has answer: http://stackoverflow.com/a/29534967

http://stackoverflow.com/q/29603652
has answer: http://stackoverflow.com/a/29604502
has body: I've used Google Maps Engine to embed customized maps with layers and shapes into my web page, but it is going to be discontinued, and the replacement is Google My Maps, which is lightweight, but seems to serve my needs. Now to my question. I am using Google Maps API to display a map on my web page, and I also have the embed code for a map from My Maps, and I want to combine them. So I want to load Google Maps API and display whatever area I like, adding markers and everything, and then on top of that (or under that) display the layers and shapes from a specific map in My Maps. Like I said, I have the embed code, which works on its own, and the mapId is in the format "abcdefgh.abcdefgh". Now, looking in the Google Maps API, there is a (deprecated) "MapsEngineLayer" function to load a specific Maps Engine Layer by ID, but there is no way to find out a specific layer ID in My Maps that I have found, plus I want all the layers of one mapID, but that function requires a layerId or LayerKey. So, is there a way to include a map from "my maps" into the normal display from the Google Maps API?
favorite count: 0
has title: Google Maps API + Google Maps Engine / My Maps
downvote count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29604502
upvote count: 5
type: Question
answer count: 1
tagged with: javascript
score: 4
tagged with: google-maps-api-3

http://stackoverflow.com/comment/47262027
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29555627
score: 0
has text: 2 = between yellow and green, its a color range, not hard set colors, if i had 20 values, the color's would be evenly spread from green - red in each cell.

http://stackoverflow.com/a/29592856
score: 4
has comment: http://stackoverflow.com/comment/47332936
upvote count: 4
has comment: http://stackoverflow.com/comment/47332613
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29592833
downvote count: 0
answers question: http://stackoverflow.com/q/29592833
has comment: http://stackoverflow.com/comment/47332981
has body: Following a hyperlink is the browser's default action for an a element with a href attribute. You need to tell the browser not to do that by calling preventDefault: $(document).on( "click", "a[data-toggle='confirmation']", function( event ) { event.preventDefault(); $(this).confirmation() }); It appears that that library expects you to provide a data-href attribute, which is the URI to browse to if the user accepts the confirmation: Click me
has comment: http://stackoverflow.com/comment/47332952
type: Answer
has comment: http://stackoverflow.com/comment/47332633
has comment: http://stackoverflow.com/comment/47332871
has comment: http://stackoverflow.com/comment/47333195
has comment: http://stackoverflow.com/comment/47332554
has comment: http://stackoverflow.com/comment/47333576

http://stackoverflow.com/q/29651021
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/23309841
has answer: http://stackoverflow.com/a/29651107
tagged with: .net
answer count: 1
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has body: I want to download large files in ( GB) using JavaScript or jquery library. Anyone having idea about any third party library which will download files in chunk. Thanks.
tagged with: http://stackoverflow.com/tag/html
tagged with: chunks
has title: Download Files in chunk using JavaScript
score: 0
upvote count: 1
downvote count: 1

http://stackoverflow.com/a/29554918
score: 1
answers question: http://stackoverflow.com/q/29554575
has body: I think no need for jquery use the css tag that will do the same thing it will Select &lt;li&gt; elements that are placed immediately after .test class ex:http://jsfiddle.net/Muthukumaru/q64tLhf5/ li.test + li{ **Your css styles ** }
downvote count: 0
type: Answer
upvote count: 1

http://stackoverflow.com/a/31197831
has body: For your question #2: To set the column width, use data-width="10" in the &lt;th&gt; tag (where 10 is your desired width in pixels, I think it also works with %)
upvote count: 1
answers question: http://stackoverflow.com/q/29643510
downvote count: 0
type: Answer
score: 1

http://stackoverflow.com/comment/47514073
type: AnswerComment
has text: @Roamer-1888 not really, JQLite doesn't behave exactly the same and an empty selector returns `null` if I'm correct. Try to open an empty tab in the Chrome browser and write `$('.nothing');`, it should give you null. However I am not certain that Chrome defaults to JQLite or yet another jQuery subset.
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29687995

http://stackoverflow.com/comment/47490142
has text: If I do, I get his error: "The name 'content' does not exist in the current context." Might it be because I'm using a master page (where the javascript code is) and I call the method from a content page?
type: AnswerComment
comment on: http://stackoverflow.com/a/29676249
type: Comment
score: 0

http://stackoverflow.com/comment/47448242
score: 0
type: AnswerComment
type: Comment
has text: But `Template.index.helpers({ userid: Meteor.userId() });` seems to work
comment on: http://stackoverflow.com/a/29654087

http://stackoverflow.com/q/29669479
has comment: http://stackoverflow.com/comment/47477229
has title: Are passwords stored in memory safe?
score: 13
has answer: http://stackoverflow.com/a/29678443
accepted answer: http://stackoverflow.com/a/29678443
type: AnsweredQuestion
downvote count: 0
has body: I tend to store users password in memory for later uses. var credentials = {}; function register(username,password){ //when users click sign up credentials.username = username; creadentials.password = password; } function login(){ //Users can click login at anytime. Or they just don't. ajax('/User/login',credentials).then(function(){ credentials = {}; }); } Should I worry about the security task with this approach? If this is a bad idea, how will attackers retrieve the password?
has comment: http://stackoverflow.com/comment/47477239
has comment: http://stackoverflow.com/comment/47477214
type: Question
has answer: http://stackoverflow.com/a/29669563
tagged with: javascript
upvote count: 13
has comment: http://stackoverflow.com/comment/47477245
has answer: http://stackoverflow.com/a/29669625
tagged with: security
possible better answer: http://stackoverflow.com/a/29669563
answer count: 3
has comment: http://stackoverflow.com/comment/47477163
tagged with: password-encryption
has comment: http://stackoverflow.com/comment/47477244
has comment: http://stackoverflow.com/comment/47477888
has comment: http://stackoverflow.com/comment/47477130
favorite count: 0

http://stackoverflow.com/comment/47520537
has text: thanks. I'll fix my globals. my problem is I dont know what 'Eric' is going to be, it might be MapEric or some other sub class I have cooked up. I will read this name in from the HTML, i.e. it's an attribute value in a div tag. I can just build a switch table, but I like being able to go "run the function of this name". I've looked at window[] and it doesnt seem to have my "required" stuff.
comment on: http://stackoverflow.com/a/29687316
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47279867
comment on: http://stackoverflow.com/q/29557946
has text: I'll add it, after you posted that I took a look and figured that out, didn't know yet when I asked the question :p
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47371609
score: 0
type: Comment
type: QuestionComment
has text: you should be able to do `alert(#{ j @r.search(+ p +) });`
comment on: http://stackoverflow.com/q/29612811

http://stackoverflow.com/a/29567843
type: Answer
upvote count: 1
downvote count: 1
answers question: http://stackoverflow.com/q/29567703
has body: In pure javascript : var requestFile = new XMLHttpRequest(); requestFile.open('GET', 'http://www.xxxx.com/data.txt'); requestFile.onload = function() { // Here's your text file content ie. requestFile.responseText console.log(requestFile.responseText); }; // Retrieve the text file requestFile.send(); Or with jQuery $.get('http://www.xxxx.com/data.txt', function(data) { console.log(data); });
has comment: http://stackoverflow.com/comment/47290980
has comment: http://stackoverflow.com/comment/47285625
has comment: http://stackoverflow.com/comment/47285201
has comment: http://stackoverflow.com/comment/47291109
has comment: http://stackoverflow.com/comment/47285342
score: 0
has comment: http://stackoverflow.com/comment/47290910
has comment: http://stackoverflow.com/comment/47286020
has comment: http://stackoverflow.com/comment/47285478

http://stackoverflow.com/a/29673990
score: 7
has body: Here is a solution that works for primitive values. It uses an object as a primitive map and counts the number of occurrences of each value. However, it also considers the data type of each value. It checks the length of the arrays first, as shortcut: function equals(a, b) { if (a.length !== b.length) { return false; } var seen = {}; a.forEach(function(v) { var key = (typeof v) + v; if (!seen[key]) { seen[key] = 0; } seen[key] += 1; }); return b.every(function(v) { var key = (typeof v) + v; if (seen[key]) { seen[key] -= 1; return true; } // not (anymore) in the map? Wrong count, we can stop here }); }
type: Answer
upvote count: 7
has comment: http://stackoverflow.com/comment/119899048
answers question: http://stackoverflow.com/q/29672847
downvote count: 0

http://stackoverflow.com/q/29543989
accepted answer: http://stackoverflow.com/a/29544451
has comment: http://stackoverflow.com/comment/47239664
upvote count: 1
has comment: http://stackoverflow.com/comment/47239633
downvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47239873
has answer: http://stackoverflow.com/a/29544719
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/47239662
has comment: http://stackoverflow.com/comment/47240313
has body: I've been trying for a good while to try and disable a click on a div. The reason behind this is to stop unauthorised users from triggering events etc which are activated when a user clicks on a div. From my attempt below i tried a click false but it doesnt seem to work, maybe im not using the correct syntax to disable the div? $('#content2').on('click', false); update: here is the complete code involved View Notifications & Updates Save Changes @*Scripts go at end for the contenteditable div to load correctly*@ @if (User.Identity.Name == "WORKER") { } SecurityEditHide.JS window.onload = function () { $('textarea').prop('disabled', true); $('#content2').on('click', false); $('#content2').prop('contenteditable', false); $('#save').hide(); }; EditContentHome.JS $("#content2").click(function () { $("#save").show(1000); }); $("#save").click(function () { $("#save").hide(1000); });
has comment: http://stackoverflow.com/comment/47240064
possible better answer: http://stackoverflow.com/a/29544719
has comment: http://stackoverflow.com/comment/47240077
has answer: http://stackoverflow.com/a/29544451
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47240130
has comment: http://stackoverflow.com/comment/47240103
linked to: http://stackoverflow.com/q/5259191
score: 0
has comment: http://stackoverflow.com/comment/47239968
tagged with: http://stackoverflow.com/tag/html
has title: disable click on div element
favorite count: 0

http://stackoverflow.com/comment/47317912
score: 0
type: AnswerComment
type: Comment
has text: This isn't gonna work. Scroll fires 20-60 times a second so the three images will be shown in about 50ms.
comment on: http://stackoverflow.com/a/29583226

http://stackoverflow.com/q/29681489
has body: I have an add-on which is button-activated. The code is as follows: function handleClick(state) { activeTab = tabs.activeTab; console.log('readystate: ' + activeTab.readyState); if(activeTab.readyState != 'complete') { activeTab.on('load', function(){ activeTab.removeListener(this); start(); }); } else start(); } However, somehow the above code always returns "complete" whenever I ask the tab for its current readystate. I'm absolutely sure the page is still loading, the spinner is still running and I actually have PHP breakpoint enabled with XDebug to make sure my page will never finish loading until I want it to. According to the Mozilla tabs docs the readystate should be "loading", because the PHP is not even finished so the server has not sent back any HTML so there isn't even a DOM. Update: What i've found out so far is that the readystate returns 'complete' until you get the first server response. Once the initial server response gets back to the browser the readystate changes to "loading". Not sure how to go on from there.
tagged with: firefox-addon-sdk
favorite count: 0
type: UnansweredQuestion
upvote count: 1
score: 1
has answer: http://stackoverflow.com/a/29681582
tagged with: mozilla
type: Question
has title: Tab readystate returns 'complete' before first server response
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: firefox-addon

function
tags question: http://stackoverflow.com/q/29651006
tags question: http://stackoverflow.com/q/29558768
tags question: http://stackoverflow.com/q/29647467
tag name: function
tags question: http://stackoverflow.com/q/29618211
tags question: http://stackoverflow.com/q/29590788
tags question: http://stackoverflow.com/q/29679364
tags question: http://stackoverflow.com/q/29654738
tags question: http://stackoverflow.com/q/29645101
tags question: http://stackoverflow.com/q/29661185
tags question: http://stackoverflow.com/q/29671449
tags question: http://stackoverflow.com/q/29663483
tags question: http://stackoverflow.com/q/29658079
tags question: http://stackoverflow.com/q/29585069
tags question: http://stackoverflow.com/q/29640245
tags question: http://stackoverflow.com/q/29550829
tags question: http://stackoverflow.com/q/29682163
tags question: http://stackoverflow.com/q/29581577
tags question: http://stackoverflow.com/q/29626729
tags question: http://stackoverflow.com/q/29597653
tags question: http://stackoverflow.com/q/29655182
tags question: http://stackoverflow.com/q/29530916
tags question: http://stackoverflow.com/q/29619370
tags question: http://stackoverflow.com/q/29679919
tags question: http://stackoverflow.com/q/29553034
tags question: http://stackoverflow.com/q/29539448
tags question: http://stackoverflow.com/q/29597283
type: Tag
tags question: http://stackoverflow.com/q/29636808
tags question: http://stackoverflow.com/q/29592849
tags question: http://stackoverflow.com/q/29584520
tags question: http://stackoverflow.com/q/29639255
tags question: http://stackoverflow.com/q/29577320
tags question: http://stackoverflow.com/q/29535147
tags question: http://stackoverflow.com/q/29653583
tags question: http://stackoverflow.com/q/29610810
tags question: http://stackoverflow.com/q/29532800
tags question: http://stackoverflow.com/q/29549162
tags question: http://stackoverflow.com/q/29659993
tags question: http://stackoverflow.com/q/29647962
tags question: http://stackoverflow.com/q/29632120
tags question: http://stackoverflow.com/q/29573752
tags question: http://stackoverflow.com/q/29552177
tags question: http://stackoverflow.com/q/29682341
tags question: http://stackoverflow.com/q/29573541
tags question: http://stackoverflow.com/q/29589758
tags question: http://stackoverflow.com/q/29538624
tags question: http://stackoverflow.com/q/29594165

http://stackoverflow.com/comment/47510087
comment on: http://stackoverflow.com/a/29686384
has text: How about `while(--n >= 0)`? That for loop looks quite ugly, IMO ;) Anyway, have an upvote
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/29679929
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47497401
has title: Javascript inside an html file
has comment: http://stackoverflow.com/comment/47497490
downvote count: 2
type: Question
score: -2
has body: So I have an .html file that displays a webpage and i would like to tabs to be able to go to another .html file I have. how can i make a link on my page go to another file I have? And another question, in the file I want to link, i have a javascript script that i would like to give an output. (Its an advanced version of Rock paper Scissors and i want it to say if i won or not.) what can i use to get an output. return(bla bla bla) doesn't do anything. Home Page Name Browse Sign Up Log In Help Your Claculations Fast and Easy Than Ever Before! Choose between 4 different calculators! Learn More Calculators We have four calculaotors that you can choose from: Codecademy Learn to code at codecademy.com Other Sources Find Other Homework-Helpers here Contact us Contact us at example@example.com lol Th page i want to link: Rock Paper Scissor Lizard Spock so in the second page, how do i get the return function to work?
tagged with: javascript
answer count: 2
upvote count: 0
has answer: http://stackoverflow.com/a/29680563
favorite count: 0
has answer: http://stackoverflow.com/a/29680186
type: UnansweredQuestion

http://stackoverflow.com/q/29544473
has answer: http://stackoverflow.com/a/29544861
tagged with: javascript
has title: Manipulating the DOM on browser resize without refreshing the page
answer count: 1
tagged with: jquery
has body: I'm building a bootstrap based wordpress theme, and to manipulate the DOM of the layout on smaller screen sizes I'm using this script to append new rows and hr elements between large size row items: //insert-row var $mainElem = $('.latest-posts'), $parent = $mainElem.parent(), $nav=$('.before-navigation') if ($(window).width() < 768){ var $items = $mainElem.children(':gt(0)').detach() if ($items.length) { for (var i = 0; i < $items.length; i = i + 1) { var $row = $(' ').append($items.slice(i, i + 1)); $nav.before(' ').before($row); } } }else if ($(window).width() >= 768 && $(window).width() <= 970){ var $items = $mainElem.children(':gt(1)').detach() if ($items.length) { for (var i = 0; i < $items.length; i = i + 2) { var $row = $(' ').append($items.slice(i, i + 2)); $nav.before(' ').before($row); } } }else if($(window).width() > 970){ var $items = $mainElem.children(':gt(3)').detach() if ($items.length) { for (var i = 0; i < $items.length; i = i + 4) { var $row = $(' ').append($items.slice(i, i + 4)); $nav.before(' ').before($row); } } } However, this only works after the page is refreshed. How do I make this work when the browser window is resized without refreshing the page? This is the query I'm using in my template: <?php get_header(); ?> <?php //latest posts $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $ID = get_query_var('cat'); $args= array( 'cat' => $ID, 'paged' => $paged ); $custom_query = new WP_Query($args); ?> <?php if ($custom_query->have_posts()) : while ($custom_query->have_posts()) : $custom_query->the_post(); ?> <?php include (TEMPLATEPATH . '/inc/meta.php' ); ?> <?php if ( has_post_thumbnail() ) : ?> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"> <?php the_post_thumbnail('thumbnail', array( 'class' => "img-responsive attachment-post-thumbnail")); ?> <?php endif; ?> <?php the_title(); ?> <?php $limit = 40; ?> <?php echo wpse_custom_excerpts($limit); ?> <a href="<?php the_permalink(); ?>" class="btn bt…
linked to: http://stackoverflow.com/q/10750603
type: UnansweredQuestion
tagged with: twitter-bootstrap
score: 0
tagged with: wordpress
type: Question

http://stackoverflow.com/q/29683302
tagged with: javascript
has comment: http://stackoverflow.com/comment/47503731
upvote count: 2
tagged with: browser
answer count: 1
tagged with: url
favorite count: 0
has comment: http://stackoverflow.com/comment/47503606
has comment: http://stackoverflow.com/comment/47503966
accepted answer: http://stackoverflow.com/a/29683364
tagged with: cross-browser
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47504003
downvote count: 0
linked to: http://stackoverflow.com/q/824349
has body: I want to visually (not affecting real address) change URL in browser address bar, like this: Real: http://www.example.com/example_a_b_c.html Shown: http://www.example.com/e_a_b_c (I may also want to change domain name, if I could) It would be much nicer if there is an option to use any simple Javascript code or function. I don't actually know the language, so I'm only looking for a little code that would fit into an HTML &lt;script&gt; tag, just for myself.
has answer: http://stackoverflow.com/a/29683364
has title: Visually changing URL in browser
type: Question

http://stackoverflow.com/comment/47497591
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29608891
has text: As abrasive as Bejanmin may have been, he is right. Promises are not simply beasts, and the popular libraries have grown to many hundreds of lines of code to deal with that complexity. Rolling your own implementation is a tall order, one that StackOverflow is unlikely to be able to help you complete. I recommend checking out Bluebird or Q.js
score: 0

http://stackoverflow.com/a/29536342
has comment: http://stackoverflow.com/comment/47289717
answers question: http://stackoverflow.com/q/29534613
has body: It does matter if you hit the object from the inside. Usually a ray will pass through an "inverted" surface due to backface culling which happens on the pipeline level. Inverted/flipped surfaces are usually ignored in both rendering and raycasting. In your case, however, i'd go ahead and try setting sphere.doubleSided = false; to sphere.doubleSided = true;. This should make the raycast return the intersection point with your sphere. [shouldn't work with negative scale] You can also enter the "dirty vertices" mode, and flip the normals manually: mesh.geometry.dynamic = true mesh.geometry.__dirtyVertices = true; mesh.geometry.__dirtyNormals = true; mesh.flipSided = true; //flip every vertex normal in mesh by multiplying normal by -1 for(var i = 0; i&lt;mesh.geometry.faces.length; i++) { mesh.geometry.faces[i].normal.x = -1*mesh.geometry.faces[i].normal.x; mesh.geometry.faces[i].normal.y = -1*mesh.geometry.faces[i].normal.y; mesh.geometry.faces[i].normal.z = -1*mesh.geometry.faces[i].normal.z; } mesh.geometry.computeVertexNormals(); mesh.geometry.computeFaceNormals(); I also suggest you set scale back to 1.0 instead of -1.0. Let me know if it worked!
type: Answer
has comment: http://stackoverflow.com/comment/47245319
has comment: http://stackoverflow.com/comment/47228710
has comment: http://stackoverflow.com/comment/47230915
score: 0
has comment: http://stackoverflow.com/comment/47227554

http://stackoverflow.com/comment/47269651
type: Comment
has text: in this case you can delete both `end()`
comment on: http://stackoverflow.com/a/29559800
type: AnswerComment
score: 0

http://stackoverflow.com/comment/47503121
type: AnswerComment
type: Comment
has text: I am thankful for the input on using JQuery. Maybe our instructor may touch base with it, but I enjoy learning what each little thing can do. Even if the code may be tedious at times where a short string of JQuery code can do what one long string of JavaScript can do as well.
comment on: http://stackoverflow.com/a/29682835
score: 0

http://stackoverflow.com/comment/47715743
type: QuestionComment
comment on: http://stackoverflow.com/q/29685287
score: 0
has text: no, I believe that the font is correctly loaded but the result is really not good...
type: Comment

http://stackoverflow.com/a/30255547
accepted answer of: http://stackoverflow.com/q/29535387
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0
has body: To populate a model and its associations from JSON data you need to have it go through a reader class (e.g. Ext.data.JsonReader) where it will move down the 'tree' creating the associations. If you are loading through a proxy this should happen automatically (as it uses a reader by default). If your JSON is coming from an AJAX call and you are creating the model instance with an Ext.create call then you need to do the reader bit yourself. Something like: var data = [...]; var reader = Ext.create('Ext.data.JsonReader', { model: 'MyModel' }); var resultset = reader.readRecords(data); console.log(resultset.getRecords()[0]); // logs first read record
type: Answer
answers question: http://stackoverflow.com/q/29535387

http://stackoverflow.com/comment/47310600
has text: Do you mean I have to assign in the controller that is inside the datepicker Directive or in the Holidays controller? When I try to put it inside the datepicker Directive, it still doesn't update the values: http://plnkr.co/edit/fkSqcJ4RgYWFdaws9b7L?p=preview Do I need two-way databinding to automatically update it?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29574076

http://stackoverflow.com/comment/47415969
type: Comment
comment on: http://stackoverflow.com/a/29636543
type: AnswerComment
has text: can you View Source, and paste in 2-3 of the tags that appear inside your ?
score: 0

http://stackoverflow.com/comment/47269413
type: Comment
has text: Then test a) valid number b) above 0 and empty the box if not, don't just -1 the length
type: QuestionComment
comment on: http://stackoverflow.com/q/29559529
score: 0

http://stackoverflow.com/comment/47435827
score: 0
has text: Isn't this the same question as - http://stackoverflow.com/questions/29629780/owl-carousel-100-height
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29647802

http://stackoverflow.com/q/29583678
has title: creating multiple button using while loop but only first button is responsive when using .onclick function
favorite count: 0
has comment: http://stackoverflow.com/comment/47315527
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has body: hi guys i ran in too small issue where i am creating like and dislike function so i created an while loop that created like and dislike for every tag but only the first button are responsive when using .onlick = function if (mysql_num_rows($res) > 0){ while ($row = mysql_fetch_assoc($res)) { //blah blah blah $categories .= "".$title." - ".$description." ".$rating." "; //blah blah blah } } which does this and the my javascript code is ajax.js function likemsg(){ var temp_rating = 1; var cid = encodeURIComponent(document.getElementById('cid').value); var url = "category_like_parse.php?temp_rating="+temp_rating+"&cid="+cid; alert(); HTTP.onreadystatechange=function() { if (HTTP.readyState==4 && HTTP.status==200) { document.getElementById("temp_rating").innerHTML=HTTP.responseText; } } HTTP.open("POST", url ,true); HTTP.send(); } and goes to category_like_parse.php saves +1 to database and echo it and it displays it but only for first like button the rest are unresponsive i got to this conclusion because i used alert(); which only worked for the first one and the rest dint. am i doing anything wrong.
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47316604
has answer: http://stackoverflow.com/a/29583746
upvote count: 1
has comment: http://stackoverflow.com/comment/47316535
downvote count: 1
linked to: http://stackoverflow.com/q/750486
type: Question
tagged with: javascript
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/29583746
possible better answer: http://stackoverflow.com/a/29583723
has comment: http://stackoverflow.com/comment/47315444
has comment: http://stackoverflow.com/comment/47315473
has answer: http://stackoverflow.com/a/29583723
tagged with: jquery

http://stackoverflow.com/comment/47494636
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29678537
type: Comment
has text: what i actually need is a multidimensional array, saving in 00,01,02,03, then another person would be 10,11,12,12, another person, 20,21,22,23, so i need a multidimensional array passing to my function, i can't go with a simple array because that would make me do some foreach array i get and would make the page go really slow

http://stackoverflow.com/comment/47236864
type: Comment
has text: Thank you so much, jwatts and Scott Kaye. I'm very appreciated your help.
comment on: http://stackoverflow.com/a/29541606
type: AnswerComment
score: 0

http://stackoverflow.com/q/29610155
type: UnansweredQuestion
score: 2
downvote count: 0
has answer: http://stackoverflow.com/a/29675565
tagged with: ionic-framework
type: Question
has title: Ionic Scroll to a negative position
tagged with: javascript
upvote count: 2
answer count: 1
favorite count: 0
has body: I have an ion scroll that scrolls accourding other component. To do that i use the function scroll1.scrollTo(left, top, false); However, this function doesn't allow to scroll to a negative position like scroll1.scrollTo(left, -50, false); So is it possible to achieve this ? My scroll must do scrolling without any user interaction (this is why i use the scrollTo function), and my main goal with the negative top position is to simulate a bouncing effect.
tagged with: angularjs

http://stackoverflow.com/q/29542657
favorite count: 0
type: Question
accepted answer: http://stackoverflow.com/a/29542715
has body: I its basic but I am new to javascript. I am trying to loop through the array and match the objects that == my key. this is what i am using right now, it works but i am only matching the first object that matches, sometimes there will be multiple objects that match. Here is what i have now var chartSeries = chartService.getSeries(); var marker.options.subdivision.id = 1345 var matchingSeries = Enumerable.From(chartSeries).Where('x =&gt; x.id == "' + marker.options.subdivision.id + '"').ToArray(); var series = { id: matchingSeries[0].id, name: matchingSeries[0].name, data: matchingSeries[0].data, lineWidth: 5 }; I need to include a for loop to match all objects. var subIdSeries = []; var subId = marker.options.subdivision.id; var series = { id: matchingSeries[0].id, name: matchingSeries[0].name, data: matchingSeries[0].data, lineWidth: 5 }; for (var i = 0; i &lt; chartSeries.length; i++) { if (subId == chartSeries.id) { push.subIdSeries(subId) } }
answer count: 2
upvote count: 1
has title: how to loop through array with javascript
has comment: http://stackoverflow.com/comment/47237133
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29542729
has answer: http://stackoverflow.com/a/29542729
has answer: http://stackoverflow.com/a/29542715
type: AnsweredQuestion
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47237039

cloudant
tags question: http://stackoverflow.com/q/29660149
type: Tag
tag name: cloudant
tags question: http://stackoverflow.com/q/29600024

http://stackoverflow.com/comment/47418448
score: 0
comment on: http://stackoverflow.com/q/29638040
type: Comment
type: QuestionComment
has text: It looks like it's supposed to show one of the 3 divs depending on where the cookie value is in relation to `result1`, `result2`, and `result3`.

http://stackoverflow.com/a/29545117
has comment: http://stackoverflow.com/comment/47242346
has body: Quoting MDN: The toTimeString() method is especially useful because compliant engines implementing ECMA-262 may differ in the string obtained from toString() for Date objects, as the format is implementation-dependent; simple string slicing approaches may not produce consistent results across multiple engines. I suggest you try using .toTimeString(): (new Date()).toTimeString().match(/\(([^\)]+)\)/)[1] I believe that should give you what you want.
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/47242336
has comment: http://stackoverflow.com/comment/47242273
has comment: http://stackoverflow.com/comment/47242442
answers question: http://stackoverflow.com/q/29544763

http://stackoverflow.com/comment/47366105
type: AnswerComment
has text: One more quick question. How do I add a variable into my ajax data? I need to add var src = $('#sitesFrame').attr('src'); to be passed along with the form in data: $('#myForm').serialize(), because I need the url from the iframe as well...
type: Comment
comment on: http://stackoverflow.com/a/29591117
score: 0

http://stackoverflow.com/comment/56120536
score: 3
has text: The function referenced is now in module [RouteUtils](https://github.com/rackt/react-router/blob/master/modules/RouteUtils.js)
comment on: http://stackoverflow.com/q/29670173
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29543086
has comment: http://stackoverflow.com/comment/47238571
tagged with: javascript
has comment: http://stackoverflow.com/comment/47238316
score: 0
has comment: http://stackoverflow.com/comment/47238692
has body: I've been given some great tips on how to inject HTML into HTML that I can't edit. The trouble is now that the snippet contains JS it won't render to the page. The Jquery looks lke this: $(document).ready(function() { var $body = $(document.body); if ($body.is(".ly_productdetails.ProductDetails.en.en_GB")) { $('.info_section').prepend(' '); } }); I tried putting backslashes in before the quotations but this didn't work. How else can you write this to the page so that the JS is included? Many thanks, Adam JSfiddle : https://jsfiddle.net/fs6qgzrj/
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47238283
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47237884
has comment: http://stackoverflow.com/comment/47238008
has answer: http://stackoverflow.com/a/29543191
has comment: http://stackoverflow.com/comment/47238430
type: Question
has title: Injecting HTML that contains JS
has answer: http://stackoverflow.com/a/29543795
linked to: http://stackoverflow.com/q/2699320
has comment: http://stackoverflow.com/comment/47238038
answer count: 2
linked to: http://stackoverflow.com/q/610995
has comment: http://stackoverflow.com/comment/47238166

http://stackoverflow.com/q/29589455
type: UnansweredQuestion
has title: how to write to database after javascript client side photo resize and upload
tagged with: php
tagged with: mysql
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29592709
score: 0
has body: I have found a script online which resizes an image client side and then uploads the image to server. This works fine but what I need is to write the image name to mysql database. I know how to do it, but its not working and I think it has something to do with the fact that the script runs client side. Can anyone look at the following and see where to put the mysql statement. Or if there is a better way of doing it altogether. upload-form.php Select Files to Upload upload-resized-photo.php <?php if ($_POST) { define('UPLOAD_DIR', 'uploads/'); $img = $_POST['image']; $img = str_replace('data:image/jpeg;base64,', '', $img); $img = str_replace(' ', '+', $img); $data = base64_decode($img); $file = UPLOAD_DIR . uniqid() . '.jpg'; $success = file_put_contents($file, $data); // I did have the mysql insert here but it didnt even execute. Think it is due to xhr.open post method. } ?>
answer count: 2
has answer: http://stackoverflow.com/a/29593810
tagged with: upload
tagged with: jquery

http://stackoverflow.com/comment/47493213
has text: How can I used the $elemMatch in case of ObjectId? I tried : db.groups.find('admins' : { $elemMatch : {'54b932c7ac3ec34a85e6246c'} } ) but it didn't work as well
type: Comment
comment on: http://stackoverflow.com/a/29677750
type: AnswerComment
score: 0

http://stackoverflow.com/a/29569150
type: Answer
has body: Assuming the array items are objects, you can use the filter function: var player = players.filter(function(p) { return p.userID == "something"; }).forEach(function(p) { p.userScore = "something"; });
score: 1
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/29569056

http://stackoverflow.com/comment/47477003
type: QuestionComment
has text: No in the JSFiddle that is wrong. I just forget to turn it off. I do not use jQuery, but could be a possibility in case it makes my life easier.
score: 0
comment on: http://stackoverflow.com/q/29669158
type: Comment

http://stackoverflow.com/q/29545820
has answer: http://stackoverflow.com/a/29546175
has body: I'm trying to build a custom responsive navigation that changes to a 100% width pulldown menu for mobile. I have some javascript that hides any sub menu items that may be open if the window is resized to a new breakpoint (it changes at 768px). However, if I open the sub menu at the mobile size (less than 768px) and then resize the window suddenly the hover effect doesn't work and the sub menu items do not show up on the larger screen size. Here is a JSFiddle of the stripped down version of my navigation https://jsfiddle.net/5h5bhwu4/2/ The only part that I think might be causing the problem is this javascript: if (w &gt; 768) { $("#nav &gt; li &gt; ul").hide(); } If click on the first menu item at low screen size, then resize the window it will not show the same sub menu when you hover over the parent item. But if you start at a larger screen size (or if you don't open the sub menu in the low screen size) it will work fine. I think the problem is in the javascript but I can't see anything that would stop this sub menu from showing.
tagged with: responsive-design
has title: Sub-menu not showing up after screen resize
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29546310
type: UnansweredQuestion
tagged with: css

http://stackoverflow.com/q/29665035
has answer: http://stackoverflow.com/a/29665622
tagged with: geography
type: Question
has title: Why won't Malaysia's regions get colored?
has body: I want to create a colored map for Malaysia but the colors don't display. I've used the names from the file my.js which works for other countries with google geochart. Why won't it work? function drawMap() { var data = google.visualization.arrayToDataTable([ ['Province'], ['MY-SK'], ['MY-K'], ['MY-M'], ['wilayah persekutuan labuan'], ['wilayah persekutuan putrajaya'], ['negeri sembilan'] ]); //var results = {"sarawak": "MY-SK", "melaka": "MY-M", "kedah": "MY-K", "wilayah persekutuan labuan": "MY-L", "wilayah persekutuan putrajaya": "MY-16", "negeri sembilan": "MY-N", "johor": "MY-J", "kelantan": "MY-D", "perlis": "MY-R", "sabah": "MY-SA", "wilayah persekutuan kuala lumpur": "MY-W", "pulau pinang": "MY-P", "terengganu": "MY-T", "pahang": "MY-C", "perak": "MY-A", "selangor": "MY-B"}; var options = { region: 'MY', backgroundColor: '#81d4fa', datalessRegionColor: '#ffc801', width: 468, height: 278, resolution: 'provinces', }; var container = document.getElementById('mapcontainer'); var chart = new google.visualization.GeoChart(container); function myClickHandler() { var selection = chart.getSelection(); var message = ''; for (var i = 0; i &lt; selection.length; i++) { var item = selection[i]; // if (item.row != null &amp;&amp; item.column != null) { message += '{row:' + item.row + ',column:' + item.column + '}'; //} else if (item.row != null) { message += '{row:' + item.row + '}'; //} else if (item.column != null) { // message += '{column:' + item.column + '}'; } } if (message == '') { message = 'nothing'; } //alert('You selected ' + message); } google.visualization.events.addListener(chart, 'select', myClickHandler); chart.draw(data, options); } google.load('visualization', '1', { packages: ['geochart'], callback: drawMap }); The regions that belong to Malaysia should get colored green as they do for other countries. Why don't they?
accepted answer: http://stackoverflow.com/a/29665622
score: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47469419
type: AnsweredQuestion

http://stackoverflow.com/q/29626028
favorite count: 0
tagged with: hammer.js
has title: How to set different velocity to recognise swipes with hammer.js jQuery plugin?
accepted answer: http://stackoverflow.com/a/29626205
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29662145
has answer: http://stackoverflow.com/a/29626205
type: Question
upvote count: 4
tagged with: touch
answer count: 2
possible better answer: http://stackoverflow.com/a/29662145
has body: I'm having issues finding / figuring out how to add options to hammer.js when using it's jQuery plugin. This is how I initiate hammer: /* Create Hammer object for swipable game cards */ $('.game-card-mobile') .hammer() .bind('swiperight swipeleft press', function(ev) { console.log(ev.type); }); I find it that in order for swipe action to be performed a relatively fast swipe needs to occur, I want to decrease speed of swipe required to fire the event. After reading through the docs: http://hammerjs.github.io/recognizer-swipe/ There seems to be a velocity option that defaults to 0.65, so I assume this can be changed somehow to lets say 0.5 in order to fire event on slower swipes? EDIT: if this would be of any help here are some examples of tests for swipe written in javascript: https://github.com/hammerjs/hammer.js/blob/master/tests/unit/gestures/test_swipe.js this shows example of how {threshold: 1} is set, I'm trying to achieve this while using jQuery plugin.
downvote count: 0
tagged with: javascript
tagged with: jquery
score: 4

http://stackoverflow.com/a/29598089
score: 2
accepted answer of: http://stackoverflow.com/q/29597694
has comment: http://stackoverflow.com/comment/47345924
has comment: http://stackoverflow.com/comment/47344888
answers question: http://stackoverflow.com/q/29597694
has comment: http://stackoverflow.com/comment/47344939
has comment: http://stackoverflow.com/comment/47346308
has comment: http://stackoverflow.com/comment/47345371
has comment: http://stackoverflow.com/comment/47343746
has body: Call the JavaScript function from all of the CheckBoxes as shown below, <asp:GridView ID="Gv1" runat="server" AutoGenerateColumns="False" OnRowDataBound="Gv1_RowDataBound"> <asp:BoundField DataField="datedif" HeaderText="Day/Hour" SortExpression="datedif" /> <asp:TemplateField HeaderText="Hour1"> <asp:CheckBox ID="chkColumn1" runat="server" onclick="Check_Click(this)" /> <asp:CheckBox ID="chkHour1" runat="server" Enabled='<%# Eval("hour1").ToString().Equals("False") %>' OnCheckedChanged="CheckBox1_CheckedChanged" onclick="Check_Click(this)" /> </asp:TemplateField> <asp:TemplateField HeaderText="Hour2"> <asp:CheckBox ID="ChkColumn2" runat="server" onclick="Check_Click(this)" /> <asp:CheckBox ID="chkHour2" runat="server" Enabled='<%# Eval("hour2").ToString().Equals("False") %>' OnCheckedChanged="CheckBox6_CheckedChanged" onclick="Check_Click(this)" /> </asp:TemplateField> <asp:TemplateField HeaderText="Hour3"> <asp:CheckBox ID="chkColumn3" runat="server" onclick="Check_Click(this)" /> <asp:CheckBox ID="chkHour3" runat="server" Enabled='<%# Eval("hour3").ToString().Equals("False") %>' OnCheckedChanged="CheckBox3_CheckedChanged" onclick="Check_Click(this)" /> </asp:TemplateField> <asp:TemplateField HeaderText="Hour4"> <asp:CheckBox ID="chkColumn4" runat="server" onclick="Check_Click(this)" /> <asp:CheckBox ID="chkHour4" runat="server" Enabled='<%# Eval("hour4").ToString().Equals("False") %>' OnCheckedChanged="CheckBox4_CheckedChanged" onclick="Check_Click(this)" /> </asp:TemplateField> <asp:TemplateField HeaderText="Hour5"> <asp:CheckBox ID="chkColumn5" runat="server" onclick="Check_Click(this)" /> <asp:CheckBox ID="chkHour5" runat="server" Enabled='<%# Eval("hour5").ToString().Equals("False") %>' OnCheckedChanged="CheckBox5_CheckedChanged" onclick="Check_Click(this)" /> </asp:TemplateField> </asp:GridView> And in the JavaScript, validate the selected CheckBox with its Row and then validate the number of items selected. function IdExists(elements, id) { for (var i = 0; …
upvote count: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47345448
has comment: http://stackoverflow.com/comment/47344585
has comment: http://stackoverflow.com/comment/47344229
has comment: http://stackoverflow.com/comment/47345605
type: Answer
has comment: http://stackoverflow.com/comment/47344035
has comment: http://stackoverflow.com/comment/47345984

http://stackoverflow.com/q/29541630
has comment: http://stackoverflow.com/comment/47235452
has comment: http://stackoverflow.com/comment/47235137
answer count: 0
has comment: http://stackoverflow.com/comment/47235144
upvote count: 1
downvote count: 1
has body: I'm working on a project for work, and I apologize as this is only my second question to this site, but when I run my program in Visual Studio, everything works fine. But once it's live on the production side, the JS Date Picker is not fully working. By that I mean you can click on the date box and the date picker shows up, but only as the dates and next/previous plus the drop down box for which month you want. However, this is all overlaid overtop of the website so the background or window background is not showing. For the life of me, I cannot figure this out, and I can't even figure out how to pose it as a question to search for an answer. A sample of the code would be: &lt;link rel="stylesheet" href="styles/jquery-ui.css"&gt; &lt;/link&gt; &lt;script src="scripts/jquery-1.10.2.ui.js"&gt; &lt;/script&gt; &lt;script src="scripts/jquery-1.11.0.ui.js"&gt; &lt;/script&gt; The full directory would be: \\chprdapp02\Badge\Scripts This is the correct directory for the file, and I've tried typing in even the level above, and even the full directory for the live version but to no avail. I just simply do not know what differentiates between the pre and post versions. If I've screwed up the question somehow, let me know and I'll correct it immediately. Thanks ahead of time for any and all help.
type: Question
has comment: http://stackoverflow.com/comment/47234988
tagged with: javascript
tagged with: jquery-ui-datepicker
has title: js date picker not fully functional
score: 0
has comment: http://stackoverflow.com/comment/47235094
favorite count: 0
has comment: http://stackoverflow.com/comment/47235092
type: UnansweredQuestion
tagged with: datepicker

http://stackoverflow.com/a/29583281
has body: Your check should be one of these: self.favoriteArtists.indexOf(newFavoriteArtist) &gt;= 0 self.favoriteArtists.indexOf(newFavoriteArtist) != -1 self.favoriteArtists.indexOf(newFavoriteArtist) &gt; -1 You're checking whether it's greater than zero. That means that if it's in position 0, artistExists will be set to false because zero is not greater than zero. That still doesn't work, though. The array is filled with Artist objects, which can't be searched for normally, because the object you search for is different from the object in the array, even if they have the same name value.
upvote count: 8
type: Answer
answers question: http://stackoverflow.com/q/29583225
score: 8
downvote count: 0

http://stackoverflow.com/a/29612310
has comment: http://stackoverflow.com/comment/47370205
has comment: http://stackoverflow.com/comment/47371387
has body: Call the function that places the markers. function initialize() { var mapOptions = { center: { lat: 38.989260, lng: -77.076198}, zoom: 13 }; var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); load_markers(map); } Edit: I'm seeing very weird behavior on your linked demo. Try this: var mapOptions = { ... center: new google.maps.LatLng({38.989260, -77.076198}), ... } edit2: nevermind, the docs say the literal objects are fine here...
has comment: http://stackoverflow.com/comment/47371369
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47373281
score: 0
has comment: http://stackoverflow.com/comment/47370112
type: Answer
has comment: http://stackoverflow.com/comment/47372755
accepted answer of: http://stackoverflow.com/q/29612244
has comment: http://stackoverflow.com/comment/47371562
answers question: http://stackoverflow.com/q/29612244

http://stackoverflow.com/q/29595864
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/47339374
favorite count: 0
has title: jQuery Difference Between .eq(count) and [count]
has answer: http://stackoverflow.com/a/29595884
upvote count: 1
tagged with: css
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/29595884
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47339392
has body: In my further understanding of jQuery, what is the difference between: var allDivs = jQuery('div'); for( var count = allDivs.length - 1; count &gt;= 0; count-- ) { var elem = allDivs.eq(count); if( elem.css('margin-left') == '-15px' ) { elem.css({'margin-left':'0'}); } } And: var allDivs = jQuery('div'); for( var count = allDivs.length - 1; count &gt;= 0; count-- ) { var elem = allDivs[count]; if( elem.css('margin-left') == '-15px' ) { elem.css({'margin-left':'0'}); } }

http://stackoverflow.com/q/29585270
possible better answer: http://stackoverflow.com/a/29585504
accepted answer: http://stackoverflow.com/a/29585942
type: AnsweredQuestion
tagged with: wordpress
has body: Thanks for reading, How would I load my JS files after the footer instead of being in the header example: Changed to I've tried wp_register_script( 'cycle', 'http://malsup.github.com/jquery.cycle2.js', '', '', true); wp_enqueue_script( 'cycle' ); wp_register_script( 'site', get_template_directory_uri().'/js/site.js', '', '', true); wp_enqueue_script( 'site' );
type: Question
has comment: http://stackoverflow.com/comment/47318878
tagged with: javascript
has comment: http://stackoverflow.com/comment/47319313
has comment: http://stackoverflow.com/comment/47319040
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29585942
has title: Wordpress - Loading JS files after footer
has comment: http://stackoverflow.com/comment/47318802
has comment: http://stackoverflow.com/comment/47319265
has answer: http://stackoverflow.com/a/29585504
has comment: http://stackoverflow.com/comment/47318874

http://stackoverflow.com/q/29600675
has answer: http://stackoverflow.com/a/29600879
answer count: 4
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/29600778
type: Question
has answer: http://stackoverflow.com/a/29600752
has answer: http://stackoverflow.com/a/29600769
has title: JSON Display just one data using javascript
tagged with: javascript
has body: I have this json, and i want to display just "cat_news" in my html5 using javascript, [ { "id_news": "3", "cat_news": "Category Three", "title": "News Content next", "content": "testingg\nThis is some content\nwith long post\n", "media": "7e3e9-komodo.jpg", "message": "Broadcast message news 3" } { "id_news": "4", "cat_news": "Category Three", "title": "News Content next", "content": "testingg\nThis is some content\nwith long post\n", "media": "7e3e9-komodo.jpg", "message": "Broadcast message news 3" } ] but when i use my script : $(data).each(function() { var title = "&lt;h3 class='title-a'&gt;"+ this.cat_news + "&lt;/h3&gt;"; $('#title').append(title); }); it display repeated (more than one result). Can you help me to display it just one result? Thanks
score: 0
possible better answer: http://stackoverflow.com/a/29600769
accepted answer: http://stackoverflow.com/a/29600778
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/29638395
accepted answer of: http://stackoverflow.com/q/29638306
type: Answer
upvote count: 3
answers question: http://stackoverflow.com/q/29638306
score: 3
has body: There are a couple of spaces between $ObjectType. and Service_Order_Activity__cLineItem try to change this var selectedRecords = {GETRECORDIDS( $ObjectType. Service_Order_Activity__cLineItem )}; to var selectedRecords = {GETRECORDIDS($ObjectType.Service_Order_Activity__cLineItem)};
has comment: http://stackoverflow.com/comment/47430915
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/47413862
score: 0
comment on: http://stackoverflow.com/q/29635361
type: Comment
type: QuestionComment
has text: @MohammedBaashar you're welcome. If you feel that way, I'm a little confused by your actual correct answer choice :) Nothing against Rikudo..

http://stackoverflow.com/a/29678648
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47613144
answers question: http://stackoverflow.com/q/29678075
upvote count: 1
type: Answer
has body: To get the Hang Out OnAir button you need to use the following code please refer the jsfiddle https://jsfiddle.net/zk755cr9/42/

http://stackoverflow.com/a/29684020
has comment: http://stackoverflow.com/comment/47506069
type: Answer
has comment: http://stackoverflow.com/comment/47506098
has body: The simplest thing would be to use $scope.tags object to store selected tags and add/remove them with the scope method similar to this: $scope.tags = {}; $scope.toggleTag = function(tag) { if (!$scope.tags[tag]) { $scope.tags[tag] = true; } else { delete $scope.tags[tag]; } }; Demo: http://plnkr.co/edit/FrifyCrl0yP0T8l8XO4K?p=info
upvote count: 1
answers question: http://stackoverflow.com/q/29683780
has comment: http://stackoverflow.com/comment/47506309
score: 1
accepted answer of: http://stackoverflow.com/q/29683780
has comment: http://stackoverflow.com/comment/47505022
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47505089
downvote count: 0
has comment: http://stackoverflow.com/comment/47505973
has comment: http://stackoverflow.com/comment/47510039

http://stackoverflow.com/comment/47263440
comment on: http://stackoverflow.com/q/29556341
type: QuestionComment
type: Comment
score: 2
has text: @RoryMcCrossan, he's not using `.` for concatenation.

http://stackoverflow.com/comment/47451214
type: QuestionComment
score: 0
has text: You'd have to write a parser that mimics shell syntax. What is the problem that you're trying to solve?
comment on: http://stackoverflow.com/q/29655760
type: Comment

http://stackoverflow.com/comment/47344098
comment on: http://stackoverflow.com/a/29598644
type: AnswerComment
score: 0
type: Comment
has text: What second option? all your examples use `\b` except the one at the top with `\S`s. It's going to count "Éléonore" as two words.

http://stackoverflow.com/comment/47454597
has text: @Sam Battat html code added
score: 0
comment on: http://stackoverflow.com/q/29656888
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29616099
answers question: http://stackoverflow.com/q/29616033
has body: Working javascript that is in applications.js will work. So I'm guessing your problem isn't the application.js part of it, it's your function isn't working. Add a console.log 'clicked' to your click function to see if fires on click. I think your javascript problem could be tied to your click function not in a document.ready() function.
score: 0
type: Answer

http://stackoverflow.com/comment/47350863
score: 0
type: AnswerComment
type: Comment
has text: Can't you just pass the `path` variable to the next function and create the function within the next function, so you don't have to pass through code? If you can post these two functions I will try to find a solution for you.
comment on: http://stackoverflow.com/a/29601659

http://stackoverflow.com/a/29541844
has body: Change this block of code to suit... while (currentDate &lt;= end) { if (currentDate.getDay() % 6 &gt; 0) { between.push(new Date(currentDate)); } currentDate.setDate(currentDate.getDate() + 1); } It checks the day of the week and ignores days that are 0 or 6 (Sunday is 0, Saturday is 6).
accepted answer of: http://stackoverflow.com/q/29541596
answers question: http://stackoverflow.com/q/29541596
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/q/29627023
has title: How to Select Row in ASP Datagrid on clicking it?
has comment: http://stackoverflow.com/comment/47397136
tagged with: javascript
type: UnansweredQuestion
type: Question
tagged with: asp.net
has answer: http://stackoverflow.com/a/29627156
has body: whenever i click on any cell on that respective row.I need to be able to select a Row in my asp: Datagrid &lt;asp:DataGrid ID="dgDocument" SelectionMode="Single" runat="server" Localizable="True" Width="100%" UpdateAfterCallBack="False" AutoGenerateColumns="False" CssClass="Grid" OnSelectedIndexChanged="dgproposal_SelectedIndexChanged"&gt; &lt;AlternatingItemStyle CssClass="GridAlternativeItem"&gt;&lt;/AlternatingItemStyle&gt; &lt;ItemStyle CssClass="GridItem"&gt;&lt;/ItemStyle&gt; &lt;Columns&gt; &lt;asp:BoundColumn Visible="False" DataField="DOCUMENT_NUMBER" HeaderText="Document Number"&gt; &lt;/asp:BoundColumn&gt; &lt;asp:TemplateColumn HeaderText="Document Title"&gt; &lt;ItemTemplate&gt; &lt;asp:Label runat="server" Text='&lt;%# DataBinder.Eval(Container, "DataItem.DOCUMENT_NAME") %&gt;' ID="Label3" NAME="Label3"&gt; &lt;/asp:Label&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateColumn&gt; ...
answer count: 1
score: 0
tagged with: c#
tagged with: datagrid

http://stackoverflow.com/comment/47280275
type: QuestionComment
has text: Well I agree with @amura.cxg . The link he posted should give you the answer.
score: 0
comment on: http://stackoverflow.com/q/29565170
type: Comment

http://stackoverflow.com/q/29624870
score: 0
type: UnansweredQuestion
tagged with: angularjs-ng-options
type: Question
has title: ng-options selects element at index 0, when ng-model is null (only after digest loop)
has answer: http://stackoverflow.com/a/29704394
has comment: http://stackoverflow.com/comment/47393243
tagged with: ng-options
has body: I have a &lt;select&gt; for which I use ng-options to fill the options. The model of the select is a string. I fill the string with a route parameter, before the options are asynchronously loaded. In the controller: $scope.selection = $routeParams.id; // optional, so defaults to undefined $scope.items = [{id: "uuid1", name: "item 1"}, {id: "uuid2", name: "item2"}]; In the template: &lt;select ng-model="selection" ng-options="item.id as item.name for item in items"&gt; &lt;option value="" disabled&gt;-- please select --&lt;/options&gt; &lt;/select&gt; The rendered html looks like this: &lt;select ng-model="selection" ng-options="item.id as item.name for item in items"&gt; &lt;option value="" disabled&gt;-- please select --&lt;/options&gt; &lt;option value="0"&gt;Item 1&lt;/options&gt; &lt;option value="1"&gt;Item 2&lt;/options&gt; &lt;/select&gt; When I go to the page without the id route param, "-- please select --" is correctly selected. When I do something else on the page, the select-box suddenly selects "Item 1" but $scope.selection is still undefined. I suspect that angular checks if the undefined value equals the value of the option "0", so it selects it. How can I prevent this? I use angular 1.2.17 (for backwards compatibility reasons), but I'v also tested this with 1.3.0.
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47408283
has comment: http://stackoverflow.com/comment/47393197
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47403903

http://stackoverflow.com/comment/47367647
has text: Adding a minimal example of your code that expresses your issue will help others determine what is wrong.
comment on: http://stackoverflow.com/q/29610818
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/q/29580853
has comment: http://stackoverflow.com/comment/47310369
linked to: http://stackoverflow.com/q/12878353
has comment: http://stackoverflow.com/comment/47310272
type: Question
tagged with: caret
has body: I made this function to prevent the caret from going into the first 8 characters https://. The idea is to allow users to input a YouTube URL, since all youtube.com urls are https, I am ensuring that it is always there, so far I have made it so none of the characters can be deleted. Here is what I have so far: $( "#main-entry-box" ).val("").focus().val("https://").on("keydown", function() { // This keydown is the relevant code for the question, // The rest was included in case it was interfering with this. if (this.selectionStart == this.selectionEnd) { if (this.selectionStart &lt; 9) { this.selectionStart = 9; this.selectionEnd = 9; } } }).on("keyup propertychange input paste", function() { if (this.value == "https:/") { this.value = "https://"; } else if (this.value.substring(0,8) != "https://") { this.value = "https://" + this.value.substring(7).replace(/^https?:\/\//gi, ""); } else { this.value = "https://" + this.value.substring(8).replace(/^https?:\/\//g, ""); } }); #main-entry-box is the relevant input. The idea is to keep the caret after the https:// characters, but it currently only keeps it after the first /. It is in a fiddle here too.
has comment: http://stackoverflow.com/comment/47310251
has comment: http://stackoverflow.com/comment/47310233
has comment: http://stackoverflow.com/comment/47310486
tagged with: javascript
tagged with: jquery
favorite count: 0
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47310535
has title: Snippet to keep caret at 8th character is "always" 1 character off
answer count: 0
upvote count: 2
type: UnansweredQuestion
downvote count: 2

http://stackoverflow.com/comment/47377482
comment on: http://stackoverflow.com/a/29606134
score: 0
type: AnswerComment
has text: Hi, thanks! What you say works, I accepted the answer. It would be nice though if I didn't have to define a separate component for any type I want to use withing the side-menu-view. Let me know if you come up with a better idea, but this would work for now :) thanks
type: Comment

http://stackoverflow.com/a/29663993
upvote count: 4
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47467399
answers question: http://stackoverflow.com/q/29663958
type: Answer
accepted answer of: http://stackoverflow.com/q/29663958
has body: Use ng-src instead of src in your img tags. &lt;img ng-src="{{social.img}} ...&gt;
score: 4

http://stackoverflow.com/q/29579198
has answer: http://stackoverflow.com/a/29581238
type: UnansweredQuestion
tagged with: css
tagged with: margin
has body: I decided to edit the question, because I realized that is unclear and wouldn't solve my problem. Then I will make a different question. To my project I need of a layout customized by the own user, so the user can move, resize, add or remove each box. Look the Example: if I just add some margin in the .square or a padding in the main it desconfigure the layout. How can I do it, and continue without desconfigure the layout. JS: $main_h = $("main").height(); $main_w = $("main").width(); $margin = parseFloat($("main").css("margin-right")); $(".square").each(function(x) { $(eval("square"+x)).height(parseFloat(($main_h*$(this).attr("data-height"))-($margin*3))); $(eval("square"+x)).width(parseFloat(($main_w*$(this).attr("data-width"))-($margin*3))); }); HTML: I use data-width and data-height cause I intend that use salve this information, to after can load and then get the same layout again. I hope I have been clearer now, and thanks for the suport!
has title: Better way to do a customized layout
type: Question
tagged with: layout
tagged with: javascript
has comment: http://stackoverflow.com/comment/47306877
has comment: http://stackoverflow.com/comment/47307286
score: 0
answer count: 1
tagged with: jquery

slick.js
tag name: slick.js
type: Tag
tags question: http://stackoverflow.com/q/29544055

http://stackoverflow.com/q/29675174
has answer: http://stackoverflow.com/a/29678535
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/29678535
tagged with: jsp
has comment: http://stackoverflow.com/comment/47488868
tagged with: javascript
has comment: http://stackoverflow.com/comment/47488729
has title: Executing javascript returned from a database inside a JSP
has comment: http://stackoverflow.com/comment/47488419
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47488965
type: Question
has body: I have a database table in which a field holds limited html marked-up data for a CMS. Many of the records contain, in this field, JavaScript references. I am trying to write a JSP which receives data from the database and displays the content of this field, including running any JavaScript within it. The following entry in the field works fine, displaying the alert as the page loads: However when the reference in the field is to a js file the code never gets executed: The Client specifically wants this functionality (taking on board the risks). Is there any way I can implement it? I'm new to JSP so this may be a simple issue (and maybe even a simple "Can't be done"). Thanks in advance.

http://stackoverflow.com/comment/47323109
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29587721
has text: @Douglas can you please elaborate? Why does this require a prototype at all? The method is checking up the property...
score: 0

flash
tags question: http://stackoverflow.com/q/29643760
tags question: http://stackoverflow.com/q/29626046
tags question: http://stackoverflow.com/q/29602841
tag name: flash
type: Tag
tags question: http://stackoverflow.com/q/29685610

http://stackoverflow.com/q/29570687
has title: Cyclomatic complexity error in my code
tagged with: jshint
type: Question
answer count: 1
tagged with: javascript
tagged with: cyclomatic-complexity
tagged with: gruntjs
score: 0
accepted answer: http://stackoverflow.com/a/29659040
has comment: http://stackoverflow.com/comment/47291715
has body: I am getting 2 errors in my grunt file line 61 col 25 This function's cyclomatic complexity is too high. (10) line 101 col 22 This function's cyclomatic complexity is too high. (10) how could I reduce the Cyclomatic complexity in this case ? my functions aren't that complex first error remove: function(line, row, type) { var spreadSelected = (row.spreadSelected &amp;&amp; type === 'spread'), totalSelected = (row.totalSelected &amp;&amp; type === 'total'), moneyLineSelected = (row.moneyLineSelected &amp;&amp; type === 'moneyline'), lineValue; if (spreadSelected || totalSelected || moneyLineSelected) { switch (type) { case 'spread': lineValue = row.spread.line; break; case 'total': lineValue = row.total.line; break; case 'moneyline': lineValue = row.moneyLineId; break; default: break; } AuthFactory.getCustomer().then(function(credentials) { betSlipSelectionRequest('/betSlip/removeSelection', { customerId: credentials.customer, game: row.game, pair: row.pair, line: lineValue }); }); if (spreadSelected) { row.spreadSelected = false; } if (totalSelected) { row.totalSelected = false; } if (moneyLineSelected) { row.moneyLineSelected = false; } } }... and then the 2nd error function add: function(line, row, type) { var spreadSelected = (row.spreadSelected &amp;&amp; type === 'spread'), totalSelected = (row.totalSelected &amp;&amp; type === 'total'), moneyLineSelected = (row.moneyLineSelected &amp;&amp; type === 'moneyline'), lineValue; if (!(spreadSelected || totalSelected || moneyLineSelected)) { switch (type) { case 'spread': lineValue = row.spread.line; break; case 'total': lineValue = row.total.line; break; case 'moneyline': lineValue = row.moneyLineId; break; default: break; } AuthFactory.getCustomer().then(function(credentials) { betSlipSelectionRequest('/betSlip/addSelection', { customerId: credentials.customer, game: row.game, pair: row.pair, line: lineValue }); }); switch (type) { case 'spread': row.spreadSelected = true; break; case 'total': row.totalSelected = tr…
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29659040

http://stackoverflow.com/comment/47437457
has text: I have updated my answer as per your requirement. You can tailor it further to suite your HTML.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29648236

http://stackoverflow.com/a/29651135
type: Answer
has body: Your guess is correct. If you're willing to work with Hapi and AngularJS, the recommended way would be make your Hapi app as an RESTful web service using JSON to transmit data, and your AngularJS app would be your web interface. This way you can leverage the best of both sides. AngularJS would use its services ($http, $resource) to get data from your web service, and present it through the correct views for your application routes. All of this is basically the MEAN stack, but you'll use Hapi instead of Express.
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/29650364
upvote count: 2

http://stackoverflow.com/q/29678956
has comment: http://stackoverflow.com/comment/47496170
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29679161
has comment: http://stackoverflow.com/comment/47495261
has answer: http://stackoverflow.com/a/29679078
type: UnansweredQuestion
has title: Javascript Event Binding does not work correctly?
type: Question
score: 0
answer count: 2
has body: I have created a list (navigation menu) with 2 different rows. Each of this row is connected to a diagram. For instance row 1 (Temperature) is connected to Temperature diagram (table1 and table2). I want the user to decide which table to view by clicking on the navigation menu, and if the person wish to view another table the first diagram has to be closed before the next one comes up. So what do I have to do in javascript (JQuery) in order to do this link up the row1 with the table1 and row2 with table2? The problem is that when I click on the next row, nothing happens. This index.html: This is javascript inside another file where I have included in index.html. Exhaust Temperature Cylinder Pressure $(function(){ $('#1').on('click',function(){ $('#table1').toggle(); }); $('#2').on('click',function(){ $('#table2').toggle(); }); }); Kind regards Dler H.
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47495322

http://stackoverflow.com/comment/47375888
type: Comment
comment on: http://stackoverflow.com/a/29615219
score: 0
type: AnswerComment
has text: I guess I'm going to select this as the answer since it's makes sense. Still weird it changed all the sudden.

http://stackoverflow.com/comment/47424722
type: Comment
has text: can you show the html?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29641584

http://stackoverflow.com/q/29653024
score: 0
has body: I am a beginner in Javascript. I hope to get some help. I built a local server using MAMP, and all my files are local. I want to read a value from a json file. This json file(data.json) has only one item {"type":2}, and I only want to use the value(2 in this case). But the value of "type" changes, so Javascript should read it constantly and maybe save it into a var in Javascript. Can I listen for changes to that file so that I can be sure I always have the most up to date value for type? I am still not familiar with Javascript. I would really appreciate it if you could give me some specific codes or examples.
answer count: 2
has comment: http://stackoverflow.com/comment/47445965
has comment: http://stackoverflow.com/comment/47445869
has comment: http://stackoverflow.com/comment/47446037
tagged with: jquery
has comment: http://stackoverflow.com/comment/47445994
type: AnsweredQuestion
has title: Javascript: how to read a value from a json file?
possible better answer: http://stackoverflow.com/a/29653238
has answer: http://stackoverflow.com/a/29653238
type: Question
has answer: http://stackoverflow.com/a/29653165
accepted answer: http://stackoverflow.com/a/29653165
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has comment: http://stackoverflow.com/comment/47446200
has comment: http://stackoverflow.com/comment/47445923

http://stackoverflow.com/a/29592772
has body: You are almost there but there are still some smalls issues happening. First you need to place the directive inside a form in order to test the validicity. Also check that the last jh-equals value binding it miss a " . Second the jqlite find function it only works with elements selectors. So is not possible to select an element like dirElement.find('#testpassword') but yes as dirElement.find('input'). The reason why they have take off this functionality from the jqlite is to make it much more light. Instead you can make a dirElement.find('input') and select the desired input by index. It may seems a grunt task but anyway most of the times that you need to select an element in jqlite it would be in a small set inside the dom tree, like in a test enviroment or in the inner doom from some directive. Finally the jqlite trigger is called as triggerHandler not a trigger. The final picture should be something like this: var scope, dirElement; beforeEach(function() { module('jhApp'); module('templates'); inject(function($rootScope, $compile) { scope = $rootScope; scope.user = {}; dirElement = $compile([ '&lt;form name="form"&gt;', '&lt;input id="password" type="password" name="password"', ' ng-model="user.password" jh-equals="{{user.passwordconfirm}}" /&gt;', '&lt;input id="newpasswordconfirm" type="password"', ' name="newpasswordconfirm" ng-model="user.passwordconfirm"', ' jh-equals="{{user.password}}" /&gt;', '&lt;/form&gt;', ].join(''))(scope); scope.$digest(); }); }); it('invalid if the values are not equal', function() { var passwordInput = dirElement.find('input'); var confirmPasswordInput = dirElement.find('input')[1]; angular.element(passwordInput) .val('testpassword') .triggerHandler('input'); angular.element(confirmPasswordInput) .val('nottestpassword') .triggerHandler('input'); expect(scope.form.password.$invalid).toBe(true); expect(scope.form.password.$valid).toBe(false); expect(scope.form.password.$dirty).toBe(true); expect(scope.form.newpasswordconfirm.$invali…
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29591058

http://stackoverflow.com/q/29581316
has body: I have big Web app (Backbone.js, Marionette, Require.js ...). Now, I need to make unit tests for my app. I've learned QUnit library yesterday. I was very easy with simple functions. But now, if I want to test my real app, I meet a lot of troubles and questions. 1. How organize file's structure 2. Do I sholud test only events or functions? 3. Can you give me examples of unit test for Backbone, Require js code with QUnit. Thank you very much.
score: -3
tagged with: qunit
type: AnsweredQuestion
upvote count: 0
tagged with: unit-testing
type: Question
accepted answer: http://stackoverflow.com/a/29740197
tagged with: javascript
has answer: http://stackoverflow.com/a/29740197
downvote count: 3
has title: How I should organize QUnit testing?
answer count: 1
favorite count: 0

http://stackoverflow.com/a/29685516
has body: You can give this a try $( "#mychoice" ).submit(function( event ) { event.preventDefault(); window.location = $('input[type="radio"]:checked').val(); });
has comment: http://stackoverflow.com/comment/47508584
answers question: http://stackoverflow.com/q/29685406
score: 0
has comment: http://stackoverflow.com/comment/47508519
has comment: http://stackoverflow.com/comment/47508383
type: Answer

http://stackoverflow.com/comment/61204212
score: 0
type: AnswerComment
has text: @CarsonMoore The link to MeteorPad no longer works (since MeteorPad is down). Are you able to post the source for the "delete text fields" fix that you mention? I am getting the issue mentioned where removing happens but it retains the previous data. I'm stuck and not sure how to "keep track of the values in the text fields and repopulate them every time you delete an element". Any guidance would be GREATLY appreciated.
comment on: http://stackoverflow.com/a/29653016
type: Comment

http://stackoverflow.com/comment/47314059
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29582646
score: 0
has text: Styles are the same. but firefox somehow ignores the whole thing. anyway the @Danko's solution did the job.

http://stackoverflow.com/comment/47225219
comment on: http://stackoverflow.com/q/29534388
type: Comment
has text: FYI, knockout only changes DOM elements when the observable they are bound to changes. So unless *you* throw away and rebuild the entire list in the view model, knockout won't throw away and rebuild the entire list in the view. Key to successful partial page updates (and therefore optimum rendering performance) is to make partial updates in the viewmodel. For example, the mapping plugin does that [when you supply a `key` function](http://knockoutjs.com/documentation/plugins-mapping.html#advanced-usage).
score: 0
type: QuestionComment

http://stackoverflow.com/comment/47472685
has text: Ok, so you have any link to the old question?
comment on: http://stackoverflow.com/q/29650696
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29582145
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29582412
accepted answer: http://stackoverflow.com/a/29582412
tagged with: php
has comment: http://stackoverflow.com/comment/47312849
has title: How to make a post request processed in the background
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29582263
type: Question
tagged with: dom
has body: I've currently got the following button: &lt;input class="submitbutton" name="start" type="button" value="start" onClick="window.location='vservermanage.php?_v=&lt;?=$this-&gt;vid;?&gt;'"&gt; This button starts the current state of the 'service' - Either offline/online etc. The page then loads &amp; using if statements I can read whether it's offline or online. (PHP) How do I make this post in the background instead - and once the result is returned process a javascript code, The following code also occurs when the page refreshes. &lt;?php if($this-&gt;msgsessuccess) { ?&gt; &lt;div id="successbox"&gt;&lt;?=$_lang[$this-&gt;msgsessuccess];?&gt;&lt;/div&gt; &lt;?php } ?&gt; &lt;?php if($this-&gt;msgseserror) { ?&gt; &lt;div id="errorbox"&gt;&lt;?=$_lang[$this-&gt;msgseserror];?&gt;&lt;/div&gt; &lt;?php } ?&gt; I also have the following code which I want to do the same with HOWEVER I want to make this one automatic instead (every 2 seconds) &lt;input class="submitbutton" name="refresh" type="button" value="refresh" onClick=" window.location='vservermanage.php?_v=&lt;?=$this-&gt;vid;?&gt;'"&gt; The above code refreshes the state of the service.
score: 0
has answer: http://stackoverflow.com/a/29582263
answer count: 2
linked to: http://stackoverflow.com/q/8567114

http://stackoverflow.com/q/29563806
accepted answer: http://stackoverflow.com/a/29564820
has comment: http://stackoverflow.com/comment/47278495
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/29564820
type: AnsweredQuestion
tagged with: wordpress
type: Question
has title: HTML/CSS Navigation dropdown and sub dropdown not showing up when the site goes responsive
has body: I am having trouble with the navigation bar when the site goes responsive. when clicking the drop-down menu the div seems to vanish. not sure if this is something to do with the CSS or jQuery. Demo Here: https://jsfiddle.net/0nxfys9s/ HTMl (all the li classes are generated by WordPress, sorry) Home other tab other tab other sub tab other sub tab other sub tab other sub tab other sub tab other sub tab other sub tab other sub tab other tab other tab other tab other tab Menu CSS nav { height: 40px; width: 100%; color: #fff; background: #86c024; font-size: 11pt; position: relative; } nav a { color: #fff; display: inline-block; width: auto; text-align: center; text-decoration: none; line-height: 40px; } nav ul { padding: 0; margin: 0 auto; max-width:1000px; width: 100%; } nav li { display: inline; float: left; height: 40px; /* this should be the same as your #main-nav height */ position: relative; /* this is needed in order to position sub menus */ } nav li a { padding: 0 15px; border-right: 1px solid #fff; box-sizing:border-box; -moz-box-sizing:border-box; -webkit-box-sizing:border-box; } nav a:hover { background: #2098d1; color: white; width: 100%; } nav ul ul { /* this targets all sub menus */ display: none; /* hide all sub menus from view */ position: absolute; top: 40px; /* this should be the same height as the top level menu -- height + padding + borders */ } nav li li a { border:none; font-size: 10pt; } nav ul ul li { /* this targets all submenu items */ float: none; /* overwriting our float up above */ width: 100px; /* set to the width you want your sub menus to be. This needs to match the value we set below */ } nav ul ul li a { /* target all sub menu item links */ padding: 5px 10px; /* give our sub menu links a nice button feel */ } nav ul li:hover > ul { display: inline-block; /* show sub menus when hovering over a parent */ background: gray; text-align: center; border: 0; z-index: 100; } nav li a:link, a:visited { color: white; } nav li:last-child a { border-…
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1

http://stackoverflow.com/a/29642184
accepted answer of: http://stackoverflow.com/q/29642141
answers question: http://stackoverflow.com/q/29642141
score: 0
type: AcceptedAnswer
type: Answer
has body: I think the problem may be that the document it is not fully loaded when you add those event listeners. Try to use: $(function() { $("div").click(function(){ alert("test1"); }); $(".btn-green").click(function(){ alert("test2"); }); }); Which is a shortcut for $(document).ready(function() { ... });

http://stackoverflow.com/q/29604545
type: Question
has body: I am using the SQLite plugin for my data needs. In my database, I stored tables containing base64 imagedata and other characteristics (such as album name etc.). Now I want to optimize my data retrieval using SQLite Indexes, as I noticed that retrieving large amounts of imagedata can take some time. I am however unsure on which columns to use the Indexes, which type (e.g. do I need Unique Indexes or Composite Indexes) and how the queries are processed? See also description. My setup is as follows: Table (Columns) Masterdata: (id, albumName, favoriteBoolean, dateCreated) ImagesData: (id, data) ThumbnailsData: (id, data) My questions: Which type of Index do I have to create to optimize the performance in this example? Do I have to create the index only once (when table is created)? On which Columns and Tables do I need to apply the CREATE INDEX command? Perhaps an explanation of how it works Anex: Data retrieval When I for instance want to retrieve all the ImagesData with albumName = "foo", I use the following syntax: SELECT Masterdata.id, ImagesData.data FROM Masterdata, ImagesData WHERE Masterdata.id = (?) AND ImagesData.id = Masterdata.id An alternative would be INNER JOIN, but I think that the above does the same (true or not?).
tagged with: database
tagged with: javascript
has comment: http://stackoverflow.com/comment/47359974
score: 0
tagged with: sqlite
type: UnansweredQuestion
has title: How to use SQLite Create Index?
has comment: http://stackoverflow.com/comment/47358841
answer count: 0

http://stackoverflow.com/comment/47250339
score: 0
type: AnswerComment
type: Comment
has text: It worked even without adding https. The jquery library was the key. Thanks. This menu is included in page A and B. It is great that it changes to the correct tab on click but I also want to redirect to that Particular page. How do I fix that?
comment on: http://stackoverflow.com/a/29546690

http://stackoverflow.com/comment/47444590
comment on: http://stackoverflow.com/q/29652334
type: Comment
type: QuestionComment
score: 1
has text: The ` ` element isn't supported by IE8 - http://caniuse.com/#feat=video

http://stackoverflow.com/comment/47511923
has text: @dengar81 that looks like an unrelated error. Perhaps your error is referring to a function that doesn't exist on the local object. By the way it seems unrelated, you should ask another question for that.
comment on: http://stackoverflow.com/a/29681410
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29669686
type: Answer
answers question: http://stackoverflow.com/q/29669615
score: 0
has body: You can add something clearing all other lines $('.list-group .list-group-item').removeClass('active'); More efficient code might be available if you reveal your HTML structure.

http://stackoverflow.com/q/29685951
score: 0
has comment: http://stackoverflow.com/comment/47513920
has body: I am new to javascript, and I would like to use it to validate a user control in a gridview (radgrid listview). This is what I had done so far, but the javascript is not firing. I don't want to use the Range validator as the validator error message takes some space even when not displayed and it does not look good in my gridview. Thank you in advance for your help Anne HTML Code: <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="sks_Creation.ascx.cs" Inherits="Sapphire.Control.Assessment.sks_Creation" %> <asp:UpdatePanel ID="updPnl" runat="server"> <tlk:RadListView ID="LV" runat="server" Width="99%" OnNeedDataSource="LV_NeedDataSource" OnItemDataBound="LV_ItemDataBound" AllowPaging="true" ItemPlaceholderID="QuestionContainer"> <asp:Label ID="lblQuestion" CssClass="CQPanelQuestion" runat="server" Text='<%# Eval("Question") %>' visible="false"/> <hrz:TextBox ID="txtMark" Text='<%# Eval("Mark") %>' runat="server" LabelText="Mark" /> <asp:Label ID="lblValMark" runat="server" ForeColor="Red" /> <tlk:RadButton ID="btnSave" runat="server" ToolTip="Save this question" Text="Save" Visible='<%# Boolean.Parse(Eval("IsEnabled").ToString()) %>' CommandName="SaveGVQuestion" CommandArgument='<%# Eval("QID")%>' OnCommand="btn_ClickEvent" OnClientClick="validate()" skin="Metro" Height="25px" Width="80px"> </tlk:RadButton> </tlk:RadListView> </asp:UpdatePanel>
tagged with: asp.net
tagged with: gridview
answer count: 0
type: UnansweredQuestion
has title: Using javascript to validate a user control in a gridview
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/47589251

http://stackoverflow.com/a/29556184
downvote count: 0
has body: This is a bug or rather a "lack of feature" in the lineutils plugin used by the widgets system to implement drag and drop. You can report it on http://dev.ckeditor.com BTW. Accidentally, just a few minutes ago I wrote an answer regarding editing layouts in CKEditor https://stackoverflow.com/a/29555872/1464696.
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/29538222
score: 1

http://stackoverflow.com/a/29660915
type: Answer
has body: In the off chance you are not expecting nested objects, this can easily work as well: var key = "key"; var obj={}; obj[key] = "value"; var s = "{\r\n"; for (var p in obj) s+= ' "'+p+'": "' + obj[p] + '"\r\n'; s += "}\r\n"; Also, it's var, not Var (no capital first letter).
score: 0
answers question: http://stackoverflow.com/q/29660819

linechart
tag name: linechart
tags question: http://stackoverflow.com/q/29613935
type: Tag

http://stackoverflow.com/q/29624518
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I want to reset my dragdealer image slider by scroll down. When I scroll down - I want to reset slider to first slide. new Dragdealer('image-carousel', { steps: 3, speed: 0.3, loose: true }); I have multiple sliders and I want to reset them when scroll to next slider, so when I scroll back to that slider - I arrive at first slide instead of last slide where I've been. See demo Thank you!
tagged with: slider
favorite count: 0
tagged with: dragdealer-js
type: UnansweredQuestion
upvote count: 1
answer count: 0
score: 1
has title: Dragdealer reset to first slide

http://stackoverflow.com/q/29593137
has answer: http://stackoverflow.com/a/55122610
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has title: Ajax with select box in codeigniter
has answer: http://stackoverflow.com/a/29593382
tagged with: codeigniter
tagged with: php
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29593382
has body: i have a form with two select box. one is for the city and the other one for the area. My requirement. When some one selects a city,The areas in the city must be captured from database and displayed in another select box. i tried but, i have problem with my ajax. here is my code below. view Location select <?php foreach ($city as $cty) : ?> <option value="<?php echo $cty->city_id; ?>"><?php echo $cty->name; ?> <?php endforeach ?> Area Any <?php foreach ($area as $ara) : ?> <option value="<?php echo $ara->ara_id; ?>"><?php echo $ara->name; ?> <?php endforeach ?> controller function __construct() { parent::__construct(); //session, url, satabase is set in auto load in the config $this->load->model('Home_model', 'home'); $this->load->library('pagination'); } function index(){ $data['city'] = $this->home->get_city_list(); $data['type'] = $this->home->get_property_type_list(); $this->load->view('home', $data); } function get_area(){ $area_id = $this->uri->segment(3); $areas = $this->home->get_area_list($area_id); echo json_encode($areas); } Model function get_area_list($id){ $array = array('city_id' => $id, 'status' => 1); $this->db->select('area_id, city_id, name'); $this->db->where($array); $this->db->order_by("name", "asc"); $this->db->from('area'); $query = $this->db->get(); $result = $query->result(); return $result; } Ajax once i select a city, it must get all the areas in the city from database and display it in the area_select select box. can any one please help me. Thanks.
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/55122610

http://stackoverflow.com/a/29680293
type: AcceptedAnswer
downvote count: 0
score: 1
type: Answer
has body: According to MDN this is a bug in ECMAScript, should be null. In the first implementation of JavaScript, JavaScript values were represented as a type tag and a value. The type tag for objects was 0. null was represented as the NULL pointer (0x00 in most platforms). Consequently, null had 0 as type tag, hence the bogus typeof return value. ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29680249
answers question: http://stackoverflow.com/q/29680249
has comment: http://stackoverflow.com/comment/47499819

http://stackoverflow.com/comment/47312893
score: 0
type: Comment
has text: Tnx Scott. Tried this, didn't work. i get "undefined" for console.log(window.alldata) and console.log(windows.alldata).
type: AnswerComment
comment on: http://stackoverflow.com/a/29582083

http://stackoverflow.com/a/29553622
answers question: http://stackoverflow.com/q/29553512
has comment: http://stackoverflow.com/comment/47298933
upvote count: 0
type: Answer
score: -1
has body: &lt;script&gt; json_text = '{ "residents":[ { "name" : "Jacob", "title" : "King", "gender" : "Male", }, { "name" : "Luthor", "title" : "Prince", "gender" : "Male" }, { "name" : "Mileena", "title" : "Princess", "gender" : "Female" }, ]}'; var obj = JSON.parse(json_text); alert(obj.residents[2].name); &lt;/script&gt; This code will bring up an alert dialog box in the browser with the value of name attribute of the second object in the array residents.
downvote count: 1
has comment: http://stackoverflow.com/comment/47258175

http://stackoverflow.com/comment/47417784
score: 0
type: AnswerComment
has text: OK. I Just rewrote the code to pass a string again and now it is working fine. There must have been some invisible encoded character or something before. When I changed to return the integer instead of the string it worked also, but then upon rewriting server side if condition to return 'exists' or 'new' it now returns the string without a line break. Not sure what was going on there, but I spend hours trying to figure it out. Ugg.
type: Comment
comment on: http://stackoverflow.com/a/29637254

http://stackoverflow.com/q/29578224
has title: Web Chat with a particular user through websocket in java
tagged with: java
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
score: 2
type: AnsweredQuestion
downvote count: 0
accepted answer: http://stackoverflow.com/a/29605219
has body: I dont know enough about websocket programming but somehow by watching youtube i made a chat application which is basically a group chat but now i want to chat with a particular user not with the whole group. I know i have to generate a unique id of every person but how can i now connect to another please help and tell me about the api too which i have to download?? Here is my code ChatroomServerEndPoint.java package websocket; import java.io.IOException; import java.io.StringWriter; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.Set; import javax.json.Json; import javax.json.JsonArrayBuilder; import javax.json.JsonObject; import javax.json.JsonWriter; import javax.websocket.OnClose; import javax.websocket.OnMessage; import javax.websocket.OnOpen; import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; import org.json.JSONException; @ServerEndpoint("/chatroomServerEndPoint") public class ChatroomServerEndPoint { static Set&lt;Session&gt; chatroomUsers= Collections.synchronizedSet(new HashSet&lt;Session&gt;()); private final static HashMap&lt;String, ChatroomServerEndPoint&gt; sockets = new HashMap&lt;&gt;(); private String myUniqueId; private String getMyUniqueId() { // unique ID from this class' hash code return Integer.toHexString(this.hashCode()); } @OnOpen public void handleOpen(Session userSession) throws IOException { chatroomUsers.add(userSession); System.out.println("user added"); //user added this.myUniqueId = this.getMyUniqueId(); System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"+ myUniqueId); ChatroomServerEndPoint.sockets.put(this.myUniqueId, this); System.out.println("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"+sockets); } @OnMessage public void handleMessage(String message, Session userSession) throws IOException, JSONException{ String username= (String) userSession.getUserProperties().get("username"); Iterator&lt;Session&gt; itr=chatroomUsers.iterato…
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: css
upvote count: 2
answer count: 1
has answer: http://stackoverflow.com/a/29605219

http://stackoverflow.com/q/29608450
score: 27
has body: I have this code. http://jsfiddle.net/0tgL7u6e/ JavaScript var myApp = angular.module('myApp',[]); function MyCtrl($scope) { $scope.nameFilter = ''; $scope.contacts = [ {name: 'GHI'}, {name: 'DEF'}, {name: 'ABC'}, {name: 'JKL'} ]; } View &lt;div ng-controller="MyCtrl"&gt; &lt;div&gt;&lt;input type="text" ng-model="nameFilter" placeholder="Search..." /&gt;&lt;/div&gt; &lt;p ng-repeat="contact in contacts track by $index | filter: nameFilter | orderBy: name"&gt;{{ contact.name }}&lt;/p&gt; &lt;/div&gt; I don't know why the order is not working and why the filter is not working. At another question, I've read about something that objects can't be filtered or ordered. But I have an array of the objects above. Also, it should work!? What's the problem?
has answer: http://stackoverflow.com/a/29608602
accepted answer: http://stackoverflow.com/a/29608602
has title: ng-repeat with track by and filter and orderBy not working
tagged with: angularjs-ng-repeat
favorite count: 0
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/29608669
has answer: http://stackoverflow.com/a/29608669
type: AnsweredQuestion
tagged with: angularjs-scope
type: Question
upvote count: 27
answer count: 2
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/47390850
score: 1
has text: It would be useful if you added the ` ` tags so it was more obvious what you were doing here
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29623511

http://stackoverflow.com/q/29655858
has comment: http://stackoverflow.com/comment/47451760
type: Question
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29655958
has body: I'm trying to adapt the angular-pickdate (https://github.com/jimibi/angular-pickadate) module to fit my needs, and I've reached a standstill, due to the impossibility of making a GET request the way I'm used to. My code is : ... .directive('pickadate', ['$locale', 'pickadateUtils', 'pickadateI18n', 'dateFilter', function($locale, dateUtils, i18n, dateFilter) { return { require: 'ngModel', scope: { date: '=ngModel', defaultDate: '=', minDate: '=', maxDate: '=', disabledDates: '=' }, template: ..., link: function(scope, element, attrs, ngModel,$http) { var minDate = scope.minDate &amp;&amp; dateUtils.stringToDate(scope.minDate), maxDate = scope.maxDate &amp;&amp; dateUtils.stringToDate(scope.maxDate), disabledDates = scope.disabledDates || [], currentDate = (scope.defaultDate &amp;&amp; dateUtils.stringToDate(scope.defaultDate)) || new Date(); scope.dayNames = $locale.DATETIME_FORMATS['SHORTDAY']; scope.currentDate = currentDate; scope.t = i18n.t; scope.render = function(initialDate,$http) { initialDate = new Date(initialDate.getFullYear(), initialDate.getMonth(), 1, 3); $http({url: 'myplace/script_lotacoes.php', method: 'GET'}).success(function(){alert("hheheh");}).error(function(){alert("oops");}); ... the error that this code gives me is : TypeError: undefined is not a function at Scope.angular.module.provider.factory.directive.link.scope.render (angular-pickadate.js:122) at angular.module.provider.factory.directive.link.ngModel.$render (angular-pickadate.js:191) at Object.ngModelWatch (ionic.bundle.js:31576) at Scope.$get.Scope.$digest (ionic.bundle.js:22518) at Scope.$get.Scope.$apply (ionic.bundle.js:22789) at done (ionic.bundle.js:17942) at completeRequest (ionic.bundle.js:18132) at XMLHttpRequest.requestLoaded (ionic.bundle.js:18073) This error is related to the $http request. Does anyone have a clue why I get this error, and how can I fix it? Thanks in advance
tagged with: ionic-framework
tagged with: httprequest
accepted answer: http://stackoverflow.com/a/29655974
score: 0
has comment: http://stackoverflow.com/comment/47451445
answer count: 2
has answer: http://stackoverflow.com/a/29655974
has title: Making a get request in directive - Ionic Framework
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47451494
has comment: http://stackoverflow.com/comment/47451576
has answer: http://stackoverflow.com/a/29655958
has comment: http://stackoverflow.com/comment/47451746
has comment: http://stackoverflow.com/comment/47451671
has comment: http://stackoverflow.com/comment/47451612
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47451800
has comment: http://stackoverflow.com/comment/47451406

http://stackoverflow.com/q/29600354
has answer: http://stackoverflow.com/a/29601083
upvote count: 1
tagged with: php
answer count: 1
accepted answer: http://stackoverflow.com/a/29601083
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: How to run php code in javascript timer/loop
favorite count: 0
tagged with: ajax
type: Question
score: 1
has comment: http://stackoverflow.com/comment/47346906
has body: I made simple page with slides and wanted to load it every 5 sec when JS timer looping. I add comments which describe where the problem is. PHP scan dir only when page loads and does not notice changes in the folder in timer. here's the code: &lt;script type="text/javascript"&gt; ...... var main_timer = setInterval(function(){slideTimer()}, 5000); ...... function slideTimer() { ...... &lt;?php //This PHP code need to be looped inside the timer $array = array(); $array = array_slice(scandir('strony'), 2); $js_array = json_encode($array); ?&gt; ........ pages = &lt;?php echo $js_array; ?&gt;; ........ ........ } &lt;/script&gt;
tagged with: timer

http://stackoverflow.com/q/29565422
has comment: http://stackoverflow.com/comment/47283445
type: Question
has comment: http://stackoverflow.com/comment/47283510
has comment: http://stackoverflow.com/comment/47280489
tagged with: javascript
score: -1
tagged with: sorting
linked to: http://stackoverflow.com/q/3052775
has comment: http://stackoverflow.com/comment/47283372
answer count: 1
downvote count: 1
has body: I have this sample XML data <?xml version="1.0" encoding="ISO-8859-1"?> <TITLE>Empire Burlesque Bob Dylan USA Columbia 10.90 1985 <TITLE>Hide your heart Bonnie Tyler UK CBS Records 9.90 1988 <TITLE>Greatest Hits Dolly Parton USA RCA 9.90 1982 which i want sort in ascending order by the YEAR after this ajax call function handleResponse () { "use strict"; var ajax = new XMLHttpRequest();; if ( ajax ) { ajax.onreadystatechange = function () { if ( ajax.readyState == 4 ) { if ( ajax.status == 200 || ajax.status == 304 ) { // console.log( ajax.responseXML ); var returnedData = handleXML( ajax.responseXML ); var collection = document.getElementById( "collection" ); collection.innerHTML = returnedData; } } }; ajax.open("GET", "catalog.xml", true); ajax.send(null); } } function handleXML ( response ) { "use strict"; var data = response; var cd = data.getElementsByTagName("CD"); var table = " "; table += " "; table += " "; table += " Title "; table += " Artist "; table += " Country "; table += " Year "; table += " Price "; table += " "; table += " "; table += " "; for ( var i = 0, len = cd.length; i < len; i++ ) { table += " "; table += " "+ cd[i].getElementsByTagName("TITLE")[0].firstChild.nodeValue +" "; table += " "+ cd[i].getElementsByTagName("ARTIST")[0].firstChild.nodeValue +" "; table += " "+ cd[i].getElementsByTagName("COUNTRY")[0].firstChild.nodeValue +" "; table += " "+ cd[i].getElementsByTagName("YEAR")[0].firstChild.nodeValue +" "; table += " $"+ cd[i].getElementsByTagName("PRICE")[0].firstChild.nodeValue +" "; table += " "; } table += " "; table += " "; return table; } window.onload = function() { "use strict"; var button = document.getElementById("button"); button.onclick = handleResponse; }; So that when the data appears in the browser it starts with the row of data showing the record from 1982 first, 1985 second and then lastly 1988 last. How can this be solved?
has comment: http://stackoverflow.com/comment/47281210
favorite count: 0
has comment: http://stackoverflow.com/comment/47281759
has title: Sorting data returned from XML file after an ajax
tagged with: ajax
has answer: http://stackoverflow.com/a/29566122
has comment: http://stackoverflow.com/comment/47284635
has comment: http://stackoverflow.com/comment/47280970
upvote count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/29639622
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/29639687
answer count: 2
tagged with: arrays
downvote count: 0
accepted answer: http://stackoverflow.com/a/29639687
has body: I am currently learning code while working at the same time here so I am new to this all. I am attempting to make charts using AMcharts. I need to make different data sets based on orientation and possibly more in the future. Below I show my current JSON and my code. The problem I'm having is I am getting data, but only the last 2 Test Results. I'm wondering what I need to adjust to get every set of data. Thank you for any help. JSON: "{"TestSets":{"#text":["\n ","\n ","\n"],"TestSet":[{"#text":["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n "],"TestSetID":{"#text":"TestSet_iOS1"},"Hardware":{"#text":"iPad Air 2"},"Version":{"#text":"iOS 8.1.3"},"Build":{"#text":"2.7.0.920"},"Orientation":{"#text":"PORTRAIT"},"NumTestCases":{"#text":"76"},"NumTestScripts":{"#text":"17"},"TotalTime":{"#text":"33823.411"},"TestResults":{"#text":["\n ","\n ","\n ","\n "],"TestRun":[{"#text":["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n "],"Date":{"#text":"24 Mar 2015"},"Hardware":{"#text":"iPad Air 2"},"Version":{"#text":"iOS 8.1.3"},"Build":{"#text":"2.7.0.907"},"Orientation":{"#text":"PORTRAIT"},"NumPassed":{"#text":"37"},"NumFailed":{"#text":"31"}},{"#text":["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n "],"Date":{"#text":"27 Mar 2015"},"Hardware":{"#text":"iPad Air 2"},"Version":{"#text":"iOS 8.1.3"},"Build":{"#text":"Pro 2.7.0.915"},"Orientation":{"#text":"PORTRAIT"},"NumPassed":{"#text":"100"},"NumFailed":{"#text":"25"}},{"#text":["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n "],"Date":{"#text":"29 Mar 2015"},"Hardware":{"#text":"iPad Air 2"},"Version":{"#text":"iOS 8.1.3"},"Build":{"#text":"2.7.0.920"},"Orientation":{"#text":"PORTRAIT"},"NumPassed":{"#text":"66"},"NumFailed":{"#text":"10"}}]}},{"#text":["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n "],"TestSetID":{"#text":"TestSet_iOS2"},"Hardware":{"#text":"iPad Air 2"},"Version":{"#text":"iOS 8.1.3"},"Build":{"#text":"Pro 2.7.0.920"},"Orientation":{"#text":"LANDSCAPE"},"NumTestCases":{"#text":"29"},"Num…
favorite count: 0
has title: Iterate through a JSON with Javascript
possible better answer: http://stackoverflow.com/a/29639784
has answer: http://stackoverflow.com/a/29639784
type: AnsweredQuestion
tagged with: amcharts
score: 1

http://stackoverflow.com/comment/47443957
comment on: http://stackoverflow.com/q/29610281
type: Comment
type: QuestionComment
has text: Strange, Chrome too.
score: 0

http://stackoverflow.com/q/29603390
has title: Creating a multiple y-axis combo chart
score: 1
linked to: http://stackoverflow.com/q/7256672
type: Question
upvote count: 1
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/29731162
has body: I'm looking at further improving a combo chart I created here by making it first a dual y axis combo chart then a multiple axis combo chart. As seen here I've figured out how to create a basic combo chart using the tutorial. google.load("visualization", "1", { packages: [ "corechart", "bar" ] }); google.setOnLoadCallback(drawVisualization); function drawVisualization() { // Some raw data (not necessarily accurate) var data = google.visualization.arrayToDataTable([ [ 'Month', 'Col1', 'Col2', 'Col3', 'Col4', 'Col5', 'Col6' ], [ 'Set 1', 165, 938, 522, 998, 450, 614.6 ], [ 'Set 2', 135, 1120, 599, 1268, 288, 682 ], [ 'Set 3', 157, 1167, 587, 807, 397, 623 ], [ 'Set 4', 139, 1110, 615, 968, 215, 609.4 ], [ 'Set 5', 136, 691, 629, 1026, 366, 569.6 ] ]); var options = { title: 'Chart title', width: 1001, height: 500, vAxis: { title: "VAxis title" }, hAxis: { title: "HAxis title" }, seriesType: "bars", series: { 5: { type: "line" } } }; var chart = new google.visualization.ComboChart(document.getElementById('number_format_chart')); chart.draw(data, options); } .chartwrapper { margin: 20px 0 12px 0; } #number_format_chart { width: 100% } &lt;script src="https://www.google.com/jsapi"&gt;&lt;/script&gt; &lt;div class="chartwrapper"&gt; &lt;!--Div that will hold the bar charts --&gt; &lt;div id="number_format_chart"&gt;&lt;/div&gt; &lt;/div&gt; Now moving on to changing the plain combo chart to a dual y version this is what I'm trying to achieve. I thought adding the code below would help but no luck as the 2nd y axis isn't displayed series: { 0: { axis: 'Col1' }, // Bind series 0 to an axis named 'distance'. 1: { axis: 'Col2' } // Bind series 1 to an axis named 'brightness'. }, axes: { y: { Col1: { label: 'leftyaxis' }, // Left y-axis. Col2: { side: 'right', label: 'rightyaxis' } // Right y-axis. } } Any help is appreciated
has comment: http://stackoverflow.com/comment/47404473
type: UnansweredQuestion
tagged with: charts

http://stackoverflow.com/a/29639354
has body: If you plan to use angular, better express all of this in a model structure, and use ng-click and ng-disabled to achieve what you need. Template: &lt;ul&gt; &lt;li ng-repeat="item in checkboxes"&gt; &lt;input type="checkbox" ng-disabled="item.disabled" ng-click="disableOthers(item)"&gt; {{item.name}} &lt;/li&gt; &lt;/ul&gt; Controller: $scope.disableOthers = function (item) { // iterate over parents and childs and mark disabled to true };
answers question: http://stackoverflow.com/q/29632386
score: 0
type: Answer

http://stackoverflow.com/a/29857071
has comment: http://stackoverflow.com/comment/47941921
score: 13
has comment: http://stackoverflow.com/comment/47969176
has comment: http://stackoverflow.com/comment/47845407
has comment: http://stackoverflow.com/comment/48161855
upvote count: 13
has comment: http://stackoverflow.com/comment/47963379
answers question: http://stackoverflow.com/q/29638225
has comment: http://stackoverflow.com/comment/47969093
has comment: http://stackoverflow.com/comment/47943236
has comment: http://stackoverflow.com/comment/48156564
accepted answer of: http://stackoverflow.com/q/29638225
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47943802
has body: To drag objects between zones with scrolled or hidden overflows, you need a to create clone div between the drag div and the drop div using the ng-drag-clone check my Fiddle I've tried to update your code, but quickly to demonstrate the point: I noticed you did not create any way for the drop zone to render or store the data being passed. I created a cards array and a cardsDrop array to store the data. I also implemented onDropComplete function to push the card object into cardsDrop $scope.onDropComplete = function (data, evt) { var index = $scope.cards.indexOf(data); if (index == -1) $scope.cardsDrop.push(data); } and a onDragComplete function to remove a card from the original deck (for some applications, this is optional... sometimes you want a list to drag from that does not remove options): $scope.onDragComplete = function (data, evt) { console.log("133", "$scope", "onDragSuccess1", "", evt); var index = $scope.cards.indexOf(data); if (index > -1) { $scope.cards.splice(index, 1); } and I used ng-repeat to render each deck in the drag zone and drop zones: Drop Area In addition, I have added some styling to the ng-drag and ng-drop.
has comment: http://stackoverflow.com/comment/48157176
has comment: http://stackoverflow.com/comment/48160021
has comment: http://stackoverflow.com/comment/48180485
type: Answer
has comment: http://stackoverflow.com/comment/47968743
downvote count: 0
has comment: http://stackoverflow.com/comment/47840201

http://stackoverflow.com/comment/134364469
has text: FYI Three.js now supports rendering equirectangular images directly via WebGL: https://threejs.org/examples/#webgl_panorama_equirectangular
comment on: http://stackoverflow.com/q/29678510
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/comment/47433246
has text: Why nested event handlers? Bad idea!
type: QuestionComment
comment on: http://stackoverflow.com/q/29646427
type: Comment
score: 0

http://stackoverflow.com/q/29635012
has body: I am working to get a deeper understanding of factories and constructors. I am a bit confused however about where to put the instances and how to print them out. I am getting back Plate is not defined. Here is how I have configured my js file var app = angular.module('dinerApp', ['ngRoute']); app.config(function($routeProvider){ $routeProvider.when('/basque',{ templateUrl:"./client/app.html", controller: 'AppCtrl' }) .when('/menu',{ templateUrl:"./client/menu.html", controller:'MenuCtrl' }) .otherwise({ redirectTo: '/basque' }); }); Here is my factory I have placed the constructor and its prototype in the factory. I am working to make a basic restaurant menu. app.factory('diner', function($q,$http){ var Plate = function(name, description, price, ingredients){ this.name = name; this.description =description; this.price = price; this.ingredients = ingredients; }; Plate.prototype.toString= function(){ var returnString='' ; returnString += "name" + this.name + "\n" + "description: " + this.description + "\n" + "price: " + this.price + "\n"; return returnString; }; return Plate; }) Below is my controller. I have created a few instances. app.controller('MenuCtrl',function($scope,diner){ var steakSandwich= new diner.Plate('Steak Sandwich', 'Something nice and tasty', 11.75); var lambShoulderSteak = new Plate('Lamb Shoulder Steak','Something Different', 11.75); var lambChops = new Plate('Lamb Chops', 'why not', 14.75); var chickenSandwich = new Plate('chicken Breast Sandwich', 'basque chicken on a bun',9.75); var basqueBurger = new Plate('Basco Burger', 'a better burger', 9.75); $scope.plates = diner.Plate; }); In my html I would ideally be calling ng-repeat &lt;ul ng-repeat="plate in plates"&gt; &lt;li&gt;{{plate.name}} &lt;/li&gt; &lt;li&gt;{{plate.description}}&lt;/li&gt; &lt;li&gt;{{plate.price}}&lt;/li&gt; &lt;/ul&gt;
downvote count: 1
tagged with: oop
has title: Injecting factories into controllers with angular js
possible better answer: http://stackoverflow.com/a/29635068
upvote count: 0
has answer: http://stackoverflow.com/a/29635068
tagged with: javascript
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29635651
favorite count: 0
score: -1
tagged with: angularjs
type: Question
accepted answer: http://stackoverflow.com/a/29635651
answer count: 2

http://stackoverflow.com/q/29530579
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47217317
downvote count: 3
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29530605
has title: How to Provide a tick symbol in the "dropdown select box" field on selecting the dropdown values using JQuery?
score: -2
tagged with: javascript
has body: Here is my code. <c:set var="acquirer" value="<%= session.getAttribute(\" acquirer\ ")%>" scope="page" /> <c:choose> <c:when test='${acquirer == null}'> All </c:when> <c:otherwise> All </c:otherwise> </c:choose> <c:forEach items="${model.acquirer}" var="acqlist"> <c:if test='${acqlist == acquirer}'> <c:out value="${acqlist}" /> </c:if> <c:if test='${acqlist != acquirer}'> <c:out value="${acqlist}" /> </c:if> </c:forEach> somebody please help. I am trying to iterate the values in the dropdown. However, I want the tick mark symbol to be present there on selecting the values which are in the dropdown.
answer count: 1
tagged with: jquery
favorite count: 0

http://stackoverflow.com/q/29573617
tagged with: php
has comment: http://stackoverflow.com/comment/47296621
has comment: http://stackoverflow.com/comment/47298769
has answer: http://stackoverflow.com/a/29573682
type: Question
tagged with: javascript
score: 0
answer count: 1
has title: Pulling "Now Playing" data from html page
tagged with: jquery
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: So I have a shoutcast server that displays info on this page: http://soundstreamradio.serverroom.net:7424/ I am trying to pull the "Now Playing" data from this page and display it on my website that is playing the stream through a player. Clicking on the song title and following this link: http://soundstreamradio.serverroom.net:7424/currentsong?sid=1 Shows the current song in plain text... So I'm wondering if there is a javascript or php script I can use to scrape this data to display it in my player? I've tried AJAX but got cross domain errors and YQL gives me an error of "Invalid URL http://soundstreamradio.serverroom.net:7424/currentsong?sid=1: Invalid HTTP destination port" I was wondering if there was anyone out there with a better idea to solve this issue? Thank you so much in advance!

http://stackoverflow.com/comment/47387643
type: Comment
has text: Ok I know that only the handshake need the server. But Can I use the IPs or Id etc and how?
comment on: http://stackoverflow.com/a/29604351
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47371951
type: Comment
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/29613175
has text: @shmuli just that - unlike in languages like Java, C++, or C#, there is no intrinsic relation ship between any particular function and any particular object.

http://stackoverflow.com/a/29647459
has comment: http://stackoverflow.com/comment/47434898
type: Answer
has comment: http://stackoverflow.com/comment/47436145
answers question: http://stackoverflow.com/q/29647004
downvote count: 1
has body: Its really easy to fix. You need to escape the elementValue. just do: elementValue = htmlEntities(elementValue); function htmlEntities(str) { return String(str).replace(/&amp;/g, '&amp;amp;').replace(/&lt;/g, '&amp;lt;').replace(/&gt;/g, '&amp;gt;').replace(/"/g, '&amp;quot;').replace('ü', '&amp;uuml;').replace('ö', '&amp;ouml;'); } And it should work. https://jsfiddle.net/8pf9vooc/
score: -1
upvote count: 0

http://stackoverflow.com/a/29615751
score: 0
answers question: http://stackoverflow.com/q/29553777
has body: case 1: // Try chrome.notifications? Or use console for debugging. frames_per_demo.TC1_Result = msg.frames; //alert("tc1 " + JSON.stringify(frames_per_demo)); test = 2; chrome.tabs.update(sender.tab.id, { url: URL_2 }, function(tab) { **setTimeout(function(){ chrome.tabs.executeScript(tab.id, {file: "content.js"});},10000);** }); break;
type: Answer

http://stackoverflow.com/comment/47346288
score: 0
type: AnswerComment
has text: yea I too tried using onbeforeunload function but it executes not only for close event also it executes for refresh button.
type: Comment
comment on: http://stackoverflow.com/a/29600021

http://stackoverflow.com/comment/47416045
score: 1
has text: damn, that's fine coding. Sorted my problem out perfectly. A million upvotes if I could ;)
type: AnswerComment
comment on: http://stackoverflow.com/a/29624618
type: Comment

apache
tag name: apache
type: Tag
tags question: http://stackoverflow.com/q/29632198
tags question: http://stackoverflow.com/q/29659159

http://stackoverflow.com/comment/47430324
has text: @GuruprasadRao i have added the fiddle. kindly check
comment on: http://stackoverflow.com/q/29644305
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/29645101
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47431091
accepted answer: http://stackoverflow.com/a/29645257
type: Question
answer count: 2
tagged with: if-statement
tagged with: function
upvote count: 0
has answer: http://stackoverflow.com/a/29645245
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29645245
has comment: http://stackoverflow.com/comment/47430932
has title: function with if/else statement
has body: I am creating a function that should add the sum of three cards for both the dealer and the player. The values should then be evaluated and what is given back from the function should be a recommendation, "safe", "stop", "black jack" or "busted". There will be two different functions evaluating the player´s cards and the dealer´s. Please look at the code I have written. I think I have figured it out codewise, I just have one question. function printResult(p1, p2, p3, d1, d2, d3) { var x = p1 + p2 + p3; var ab = "player:" + " " + player(x); var y = d1 + d2 + d3; var de = "dealer:" + " " + dealer(y); return ab + ", " + de; }; function player(p1, p2, p3) { var summa = p1 + p2 + p3 var result; if (summa &lt; 21) result = "safe"; else if (summa = 21) result = "black jack"; else result = "busted"; return result; } function dealer(d1, d2, d3) { var summa = d1 + d2 + d3; var dealer; if (summa &lt; 17) dealer = "safe"; else if (summa &gt;= 17 &amp;&amp; summa &lt;= 20) dealer = "stop"; else if (summa == 21) dealer = "black jack"; else dealer = "busted"; return dealer; } When I print printResult(4, 8, 1, 3, 8, 4) it gives me a faulty recommendation (the player gets busted when it should get safe). However, if I change the code to the following, then it works. function printResult(p1, p2, p3, d1, d2, d3) { var x = p1 + p2 + p3; var ab = "player:" + " " + player(p1, p2, p3); var y = d1 + d2 + d3; var de = "dealer:" + " " + dealer(d1, d2, d3); return ab + ", " + de; }; I don´t understand why there is a difference in the result? Ps, in the latter piece of code I understand that I do not have to have x and y as variables, they can be removed. Thanks in advance!
score: -1
favorite count: 0
has comment: http://stackoverflow.com/comment/47430992
has answer: http://stackoverflow.com/a/29645257
downvote count: 1

http://stackoverflow.com/comment/47311337
type: Comment
has text: Not working even I put the alert inside the condition or below the url = 'works well!';
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29581370

http://stackoverflow.com/comment/47276406
has text: UPDATE: I just managed to make cache work on me url that generate images using ETag Header. https://css-tricks.com/snippets/php/intelligent-php-cache-control/
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29560923

http://stackoverflow.com/comment/47294688
comment on: http://stackoverflow.com/q/29569394
type: Comment
type: QuestionComment
has text: @Sparky Also, clarification of intent. I define some jQuery Validator rules but only want to do so in one location to keep consistent. First then are used on a traditional form. Perfect. Then wish to use the same rules with inline editing. Thanks again!!!
score: 0

http://stackoverflow.com/q/29641815
upvote count: 1
answer count: 1
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29641882
downvote count: 0
tagged with: javascript
tagged with: drop-down-menu
score: 1
has title: How to change hover effect to onclick only for a drop down menu
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
has body: I've tried everything I can possibly think of and I can't get my test site to act similar to the example site button menu that moves upward on click (right now mine only works on hover). I've tried multiple drop down menus, javascript, css, accordion menus, fake on-click tutorials, etc... nothing works for my site. I got everything to work correctly, except the onclick function. How can I get the current hover effect on my site to trigger only when I click the button first? Also, when I click another button, the previous one collapses back down to its normal state and the new clicked button opens like the hover state? I think the hover effect is just to annoying/busy and I will need to make it responsive for mobile devices, so onclick seems the best route. I've attached pictures of the buttons I'm referring to, Links to my site and the example site I'm trying to get to work like, and my css and html. If anyone can help, you'd be the most amazing person in the world!!! &lt;div class="wrapper clearfix" id="insurance-buttons"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#"&gt;Auto&lt;/a&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#"&gt;Auto&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Motorcycle&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Boat&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;ATV&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Home&lt;/a&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#"&gt;Homeowners&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Condo / Co-op&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Flood Insurance&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Life &amp;amp; Health&lt;/a&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#"&gt;Umbrella&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Life&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Health&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Business&lt;/a&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#"&gt;Business Owners&lt;/a&gt;&lt;/li…
tagged with: css
has comment: http://stackoverflow.com/comment/47425110
has comment: http://stackoverflow.com/comment/47452494
tagged with: onclick

http://stackoverflow.com/a/29580262
upvote count: 1
score: 1
has body: Using thecss and the text jquery's attributes will do the work: $(document).ready(function() { $('#button_id').click(function(){ $(this).text('another text') $(this).css('height', '100px') }) }) Here's a demo
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29580144

http://stackoverflow.com/a/29658159
upvote count: 1
has body: You are not returning your recursive results. if(arr[currentIndex].length) getValueFromArray(arr[currentIndex], indexes); Should be: if(arr[currentIndex].length) return getValueFromArray(arr[currentIndex], indexes);
score: 1
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29658039

http://stackoverflow.com/comment/47343794
type: AnswerComment
has text: I meant the required result for this question. How would the dynamically created string have to differ?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29593172

http://stackoverflow.com/comment/48763527
comment on: http://stackoverflow.com/a/29735418
has text: Are you using the Visual Studio Tools for Cordova? Is this VS 2013 or 2015 RC?
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47478952
has text: you are great man. the way you explain every point. i think i need to learn from you +1 :) perfect answer
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29668966
type: Comment

http://stackoverflow.com/q/29584002
tagged with: mysql
type: Question
upvote count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/29584053
has answer: http://stackoverflow.com/a/29584160
answer count: 3
has title: Pass Mysql result into JSON
favorite count: 0
possible better answer: http://stackoverflow.com/a/29584053
tagged with: php
has answer: http://stackoverflow.com/a/29584437
score: 2
accepted answer: http://stackoverflow.com/a/29584437
type: AnsweredQuestion
downvote count: 0
has body: Could someone help me out with a small problem and an explantaion on what would be wrong? What i would like to do is return a result from a MySQL query, and pass it through JSON and display the value. What i have got so far is as follows: $qry = "SELECT first_name, last_name FROM user_profile"; $result = mysql_query($qry); while($row = mysql_fetch_array($result)) { $name = $row['first_name']; } I am currently getting the error. JSON.parse: unexpected character at line 1 column 1 of the JSON data &lt;div id="profile"&gt; &lt;div id="photo-frame"&gt; &lt;img class="circle" src="images/photo.jpg"&gt; &lt;/div&gt; &lt;h3 id="name"&gt;&lt;/h3&gt; &lt;/div&gt; &lt;script type="text/javascript"&gt; var text = &lt;?php echo json_encode($name)?&gt;; var obj = JSON.parse(text); $('#name').text(obj.name); &lt;/script&gt;
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/comment/47505916
type: Comment
has text: Since those are vertices I need, what do I do with them once they have been removed? Do I add them back later?
comment on: http://stackoverflow.com/a/29683213
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47285978
score: 0
has text: That really depends on your requirements, models should represent real world data: `Product`, `Employee` ... not something abstract and non-descriptive like `Data`... you can get up and running quickly using an [ActiveRecord model generator](http://guides.rubyonrails.org/active_record_migrations.html#model-generators)
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29566618

http://stackoverflow.com/a/29643319
has body: Your query is not correctly written. In order to sort you should write it in third argument of find: Event.findOne( { users: { $elemMatch: { user: someUserId, going: 1 }} }, null, { sort: {createTime: -1} }, function(err, event) { //your event here });
answers question: http://stackoverflow.com/q/29638752
score: 0
has comment: http://stackoverflow.com/comment/47449093
type: Answer
has comment: http://stackoverflow.com/comment/47444758

http://stackoverflow.com/q/29536725
downvote count: 4
tagged with: for-loop
upvote count: 0
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/29554963
has body: There is a list of 78 items: 1 2 . . . 78 which I want to divide into blocks of 10 - 10 each. Each block will have 10 items. Result will be 7 blocks with 10 items and the 8th block with 8 items. 1 2 . . . 10 11 12 . . . 20 . . . 71 72 . . . 78 Suggest a logic
has comment: http://stackoverflow.com/comment/47225938
favorite count: 0
has comment: http://stackoverflow.com/comment/47225820
type: UnansweredQuestion
score: -4
has answer: http://stackoverflow.com/a/29536979
has comment: http://stackoverflow.com/comment/47225953
has title: for loop with divided list
has comment: http://stackoverflow.com/comment/47226252
type: Question

http://stackoverflow.com/comment/47589144
has text: Yes that is option 2 in my answer. I think new blender json exporter dont support basic or lambert materials, or i dont find them. Im start using wawefront objects http://threejs.org/examples/webgl_loader_obj_mtl.html
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29674312

http://stackoverflow.com/a/37829099
has body: s-patchamatla You need to downgrade version of Jasmine to jasmine-reporters@1.0.0 Newer versions of jasmine reporters does no longer attaches to the Jasmine object so, in case you tried to use jasmine-reporters with Protractor, you need to use a 1.x version of jasmine-reporters. npm install jasmine-reporters@~1.0.0 onPrepare: function () { require("jasmine-reporters"); // junit reporter var capsPromise = browser.getCapabilities(); capsPromise.then(function (caps) { var browserName = caps.caps_.browserName.toUpperCase(); var browserVersion = caps.caps_.version; var prePendStr = browserName + "-" + browserVersion + "-"; jasmine.getEnv().addReporter(new jasmine.JUnitXmlReporter(&lt;report path&gt;, true, true, prePendStr)); }); } i guess this should work for you.
answers question: http://stackoverflow.com/q/29652810
has comment: http://stackoverflow.com/comment/63120980
score: 0
type: Answer

http://stackoverflow.com/comment/47383826
type: Comment
type: QuestionComment
has text: @gvmani I tried clicking. Nothing happens. No errors. I will post more code.
comment on: http://stackoverflow.com/q/29619757
score: 0

http://stackoverflow.com/q/29626410
has title: Krajee Bootstrap File Input, catching AJAX success response
upvote count: 11
tagged with: twitter-bootstrap
answer count: 5
has answer: http://stackoverflow.com/a/30414801
score: 11
tagged with: php
has answer: http://stackoverflow.com/a/29693125
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/51397051
possible better answer: http://stackoverflow.com/a/30414801
has body: I'm using Krajee the Bootstrap File Input plugin to perform an upload via AJAX call. Here is the link to the Krajee plugin AJAX section: Krajee plugin AJAX The JS and PHP (codeigniter) codes I'm using are as following: JS: &lt;script&gt; $("#file-upload").fileinput({ 'allowedFileExtensions' : ['csv'], 'maxFileSize': 5120, 'maxFileCount': 1, 'uploadUrl': 'dashboard/uploader', 'elErrorContainer': '#errorBlock', 'uploadAsync': true, 'msgInvalidFileExtension': 'Invalid extension for file "{name}". Only "{extensions}" files are supported.', 'uploadExtraData': {csrf_token_name: $("input[name=csrf_token_name]").val()} }); &lt;/script&gt; PHP: public function uploader(){ $config['upload_path'] = './csv_uploads/'; $config['allowed_types'] = 'csv'; $config['max_size'] = '5120'; $this-&gt;upload-&gt;initialize($config); if (!$this-&gt;upload-&gt;do_upload("file-upload")){ $data['error'] = 'The following error occured : '.$this-&gt;upload-&gt;display_errors().'Click on "Remove" and try again!'; echo json_encode($data); } else { echo json_encode("success"); } } Right now I get a response from PHP whatever it is an error or a success as JSON, I have went through the plugin documentation and I still can't find how to catch the AJAX response and act according to that response as we do in jQuery with the ajax success function : success: function (response) { //Deal with the server side "response" data. }, How can I do this?
type: Question
has answer: http://stackoverflow.com/a/41138676
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29693125
tagged with: jquery
has answer: http://stackoverflow.com/a/61911142
favorite count: 0
tagged with: ajax

http://stackoverflow.com/comment/47452199
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29655819
has text: Build a component with all that you need... Not only button. It will be easier (i guess) to maintain and would be less hacky (anyway, you are using Client Arrays, try to protect them it's difficult). Don't use global arrays (just use it on their private scope)
type: QuestionComment

http://stackoverflow.com/a/29666904
downvote count: 0
has body: forEach is part of Array. Use each instead. You can use the function callback to increment the top property of the current element. var percent = 50; $('div').each(function() { $(this).css('top', function(_, top){ return parseInt(top, 10) + percent; }); }); But it doesn't work as you intended. Perhaps you should try something like the other answer, which uses $.fn.prev
has comment: http://stackoverflow.com/comment/47472752
answers question: http://stackoverflow.com/q/29666859
has comment: http://stackoverflow.com/comment/47472603
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/47472703
score: 2

http://stackoverflow.com/q/29558938
tagged with: javascript
has answer: http://stackoverflow.com/a/29559426
answer count: 1
favorite count: 0
linked to: http://stackoverflow.com/q/14365318
has comment: http://stackoverflow.com/comment/47270993
type: AnsweredQuestion
score: 2
accepted answer: http://stackoverflow.com/a/29559426
tagged with: settimeout
upvote count: 3
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47268067
has title: Add a sleep method in a object method chain(JS)
tagged with: method-chaining
has body: I'm trying to add a sleep method in a object, which can be called in the middle of a method chain. I considered to use the setTimeout(), but the javascript thread could not be blocked, and it can not output the correct order I want. function hello(str){ var text = document.getElementById("text"); this.eat = function(kind){ text.innerHTML += " Eat "+ kind + " "; return this; } this.sleep = function(delay){ setTimeout(function(){ text.innerHTML += " Sleep "+delay + " "; }, delay); return this; } text.innerHTML += " Hello, "+ str + " "; return this; } var test = hello("guy").sleep(3000).eat("dinner"); /* I want an output as: Hello, guy -> (wait 3 secs) Sleep 3000 -> Eat dinner But actually the output is: Hello, guy -> Eat dinner -> (wait 3 secs) Sleep 3000 */ Does anyone have any ideas on it? Shoud I use the prototype, or some other ways to deal with it? What's more, if I want to add another method, named sleepFirst in this object. When I call it like this: var test2 = hello("boys").sleepFirst(2000).eat("lanch") it outputs: (wait 2 secs) sleepFirst 2000 -> Hello, boys -> Eat lanch What should I do? (Postscript: I am a beginner in Web Development, maybe someone has asked a similar question before but I had searched for a long time and can't find it out T^T I am a Chinese guy and sorry that my English may seem not so good. Thanks ~~)

http://stackoverflow.com/comment/47470544
type: QuestionComment
type: Comment
has text: re: "I'm worried it's sending the complete file in the first chunk", use the network tab to see what was uploaded, no need to worry or guess. also, i wouldn't be surprised if some remote hosts take 20 seconds to catch a meg...
comment on: http://stackoverflow.com/q/29665203
score: 0

http://stackoverflow.com/q/29533741
score: -1
type: Question
upvote count: 0
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/29534835
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has title: Effective way to create transposing table from three objects
tagged with: angularjs
tagged with: transpose
accepted answer: http://stackoverflow.com/a/29534835
downvote count: 1
type: AnsweredQuestion
has body: I have three objects: Users [ { id: 1, name: 'User' }, { id:2, name: 'User2' } ] Pages [ { id: 1, name: 'Page' }, { id:2, name: 'Page2' } ] Rights [ { user_id: 1, page_id: 1, access: 'rw' }, { user_id: 1, page_id: 2, access: 'ro' }, { user_id: 2, page_id: 1, access: 'rw' }, ] What I need to do is display single table combining the data BUT the table has to be able to transpose AND I need to be able to edit values of each cell (rights) and the change should be reflected everywhere. Here is current prototype so you see how it should look like: At the moment I create two separate objects with data that fill each table and then simply show/hide the tables (transposing). This is rather complicated and not easy to wok with since I need to be able to edit values in cells and need the change to reflect in transposing. I will appreciate any suggestion how to make this better.

http://stackoverflow.com/comment/47499352
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29679699
has text: Small detail - the `if` statement in the answer needed one more increment for it to not miss the last step. Just being thorough...

http://stackoverflow.com/comment/47355937
has text: @X.L.Ant Because an assignment of a global object to a local var would not mean that changes to the local var (which is a reference) would in effect be changes to the global object. They would then be changes to the local clone of the global object. So there would be a clear separation between local and global.
comment on: http://stackoverflow.com/q/29605055
score: 0
type: Comment
type: QuestionComment

filtering
tags question: http://stackoverflow.com/q/29613976
tags question: http://stackoverflow.com/q/29614377
tag name: filtering
type: Tag

http://stackoverflow.com/q/29589713
tagged with: javascript
tagged with: jquery
has title: Why I got wrong output in on this Javascript code?
has answer: http://stackoverflow.com/a/29589839
favorite count: 0
has comment: http://stackoverflow.com/comment/47326559
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47326582
downvote count: 2
accepted answer: http://stackoverflow.com/a/29589839
upvote count: 1
tagged with: onkeypress
type: Question
score: -1
has comment: http://stackoverflow.com/comment/47326661
has body: I have 3 HTML input text and when I tried to type on paid input text I got correct answer only from 100 to 999 but when the total payable amount reach 1000+ it got wrong output. Example: Amount Payable: 500 (above 1000 has wrong output) Paid: 600 <-- when I put 600 it has correct output to change, as long as it from 0 to 999 amount payable. Change: 100 <-- Correct. ..but when the amount payable is higher than 999 it has wrong output. Example: Amount Payable: 1100 Paid: 1200 Change: 1199 <-- now I got wrong output. because the amount payable is above 1000. This is my script: $("#payable_form input").each(function(){ $(this).keyup(function(){ var payable_amount; var paid; payable_amount = parseFloat( $('#payable_amount').val() ); paid = parseFloat( $('#paid').val() ); payable_amount = $.isNumeric( payable_amount ) ? payable_amount : 0; paid = $.isNumeric(paid) ? paid : 0; var change = paid - payable_amount; $('#change').val(change.toFixed(2)); }); }); FULL CODE: Customers: <?php $result = mysqli_query($connection, "SELECT * FROM customers"); echo " "; while($row = mysqli_fetch_assoc($result)) { echo " ".$row[name]." "; } echo " "; ?> Total Payable Amount: <input type="text" class="form-control" id="payable_amount" name="payable_amount" value="<?php echo number_format($total_sales,2); ?>"readonly> Total Purchase Items: <?php echo $count; ?> Paid by: Cash Cheque Paid: Return Change: Close
has comment: http://stackoverflow.com/comment/47326643
has comment: http://stackoverflow.com/comment/47326612
has comment: http://stackoverflow.com/comment/47326512
answer count: 1

http://stackoverflow.com/comment/47278331
comment on: http://stackoverflow.com/a/29560018
type: AnswerComment
score: 0
type: Comment
has text: @freefaller : Thanks for correction, i am pretty much aware of Inline Code Blocks but wasn't aware that i have made such kind of mistake while commenting. May be due to stressful day :( . Thanks for acknowledging my mistake :)

http://stackoverflow.com/q/29607961
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47362355
tagged with: css
has body: Any tips on how I can make it possible to drag the div .handle across the div .slider and get a value when doing so? Thanks in advance. HTML Drag to see price CSS .slider{ background-color: black; width: 500px; height: 15px; } .handle{ background-color: red; position:absolute; left: 12px; top: -0px; width: 56px; margin-left: -10px; height: 32px; z-index: 3; cursor: pointer; }
has comment: http://stackoverflow.com/comment/47362265
has answer: http://stackoverflow.com/a/29608529
tagged with: drag
type: Question
tagged with: javascript
score: -1
downvote count: 2
upvote count: 1
has title: Drag to change value
answer count: 1
has comment: http://stackoverflow.com/comment/47361514
favorite count: 0

http://stackoverflow.com/a/29531540
has body: You should avoid loading the Google Maps API more than once. If possible you should consider leaving out that script tag and instead add it through JavaScript once the dropdown (region) selection has been made. EDIT: Let's say you have a dropdown like this: Select region to use Google Maps: Denmark Sweden Adding the script would be something like: function loadGoogleMaps() { var selectedRegion = document.getElementById("regionSelector").value; if(selectedRegion === '') { return; } var head= document.getElementsByTagName('head')[0]; var script= document.createElement('script'); script.type= 'text/javascript'; script.src= 'https://maps.googleapis.com/maps/api/js?region=' + selectedRegion; head.appendChild(script); } More info on async loading of the Google Maps API: https://developers.google.com/maps/documentation/javascript/examples/map-simple-async
upvote count: 1
has comment: http://stackoverflow.com/comment/47216988
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29531097
type: Answer

http://stackoverflow.com/a/29624618
upvote count: 3
has comment: http://stackoverflow.com/comment/47416045
score: 3
has body: This is where strong concurrency primitives shine. Promises let you do this very easily: // with bluebird this is var getItem = Promise.promisify(db.getitem); var getItem = function(itemid){ return new Promise(function(resolve, reject){ db.getitem(itemid, function(err, data){ if(err) reject(err); else resolve(data); }); }); }; Which would let you do: var getItems = function(itemid) { return getItem(itemid).then(function(item){ // get the first return Promise.all(item.items.forEach(function(subItem){ return getItems(subitem.id); }); }).then(function(subItems){ var obj = {}; obj[itemid] = subItems; // set the reference to subItems return obj; // return an object containing the relationship }); }; getItems(1).then(function(obj){ // obj now contains the map as you describe in your problem description }); Here is how it would look with async: var getItems = function(itemid, callback){ db.getitem(itemid, function(err, item){ if(err) return callback(err, null); async.map(item.items, function(subitem, cb){ getItems(subitem.id, cb); }, function(err, results){ if(err) return callback(err, null); var obj = {}; obj[itemid] = result; return callback(null, obj); }); }); }; It gets pretty close but I think it's a lot less nice than the promise version.
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29623847
answers question: http://stackoverflow.com/q/29623847
type: Answer

http://stackoverflow.com/comment/47394204
score: 0
has text: didnt hide on clicked from outside :(
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29625404

http://stackoverflow.com/q/29685822
type: AnsweredQuestion
has body: Right now im creating a commenting system for the experience. I am making it so all you have to do is implement an iframe and the comments are there. Provided you are hosting the comment page/ Database. I have the user signin/signup using a popup window using javascript. When they signin/signup a cookie is made with a generated session ID so I can let them stay logged in. Now, I have buttons on the bottom of this comments page in a responsive footer. I want the buttons css property "display" property change depending if they are logged in or not using javascript. I dont want the page/iframe to reload to just update the buttons. Right now I am try'ed to update the button when the user hits the signin button in the signin popup (same for signin), but since its a different page I cant seem to run a script on the comments page. I tried using a [System.Web.Services.WebMethod()] along with a ClientScript.RegisterStartupScript. But as you may now, I cant do that with a static method. Any ideas how to accomplish what I need? Recap: Update css property in buttons on different page of than what the javascript is on. (I do have the same javascript file linked into the signin, signup and comments page)
has title: how to run Javascript method on different page on same domain?
upvote count: 1
type: Question
tagged with: c#
tagged with: javascript
has answer: http://stackoverflow.com/a/29686436
answer count: 1
downvote count: 0
score: 1
tagged with: jquery
tagged with: asp.net
favorite count: 0
has comment: http://stackoverflow.com/comment/47509151
accepted answer: http://stackoverflow.com/a/29686436

http://stackoverflow.com/comment/47296611
type: Comment
comment on: http://stackoverflow.com/a/29573757
type: AnswerComment
score: 0
has text: Cool :) But in case you find any issues. Do remmeber to wrap it inside IIFE

http://stackoverflow.com/q/29640686
tagged with: radio-button
tagged with: javascript
score: 0
answer count: 1
has title: Add value from radio button to existing link url use javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29641223
has body: i have javascript script : radio button : Book i want form click radio button the value from radio button has place on the link url, so that can be : link : Book add value &o=p1 can anyone help me? thank you before
type: Question

http://stackoverflow.com/comment/47382849
type: Comment
comment on: http://stackoverflow.com/a/29605557
type: AnswerComment
has text: There is no date and no server name in your json file, then from where you are fetching these, you are fetching your data only from json file wright????
score: 0

http://stackoverflow.com/comment/47262618
comment on: http://stackoverflow.com/q/29555964
type: Comment
type: QuestionComment
has text: can you add your 'element' in question. is it text box or else ?
score: 0

http://stackoverflow.com/comment/47339374
type: Comment
score: 0
has text: You'd see by trying them out that the second doesn't work… And the error message would be quite helpful.
type: QuestionComment
comment on: http://stackoverflow.com/q/29595864

http://stackoverflow.com/a/29620905
has comment: http://stackoverflow.com/comment/47386001
has body: You should be able to receive the splats as second argument var RouterController = Marionette.Controller.extend({ waiting: function(id, queryParam) { console.log(id); // How to access "queryParam" over here ? } });
has comment: http://stackoverflow.com/comment/47387953
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29620798

http://stackoverflow.com/comment/47444023
type: Comment
type: QuestionComment
has text: I don't know why, but after couple of reloads it start working. I will try your solution in my app. Thanks.
score: 0
comment on: http://stackoverflow.com/q/29610281

http://stackoverflow.com/comment/47429529
comment on: http://stackoverflow.com/q/29644378
type: Comment
score: 0
has text: If you get a status back, the request has to go somewhere. What does the server side see?
type: QuestionComment

http://stackoverflow.com/a/29669953
answers question: http://stackoverflow.com/q/29647608
has body: Sorry if the answer is a bit confusing but I solved the problem I was having: I realised that the problem was that it was giving errors while parsing the data.I think the reason for this was that I was saving the array triplog in which each piece of data stored was new google.maps.LatLng(x.coords.latitude,x.coords.longitude). So i created a new array triplogsave which stored only x.coords.latitude,x.coords.longitude and saved that to localStorage and when I called that and parsed it, it worked without any errors. the edited code is: var triplog =[]; var triplogsave = []; var refreshIntervalId = setInterval(recordtrip, 5000); function recordtrip(){ if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position){ x = position; triplog.push(new google.maps.LatLng(x.coords.latitude,x.coords.longitude)); triplogsave.push(x.coords.latitude,x.coords.longitude); $('#stoptrip').click(function(){ clearInterval(refreshIntervalId); }); }); $('#showtrip').click(function(){ var lenoftrip = triplog.length - 1 ; var mapProp = { center:triplog[lenoftrip], zoom:20, mapTypeId:google.maps.MapTypeId.ROADMAP }; var map=new google.maps.Map(document.getElementById("googleMap"),mapProp); var marker=new google.maps.Marker({ position:triplog[lenoftrip], }); marker.setMap(map); var flightPath=new google.maps.Polyline({ path:triplog, strokeColor:"#0000FF", strokeOpacity:0.8, strokeWeight:2 }); flightPath.setMap(map); }); $('#savetrip').click(function(){ localStorage.setItem(titleoftrip,JSON.stringify(triplog)); alert("Saved!"); triplog = []; } so after saving and loading,it loads triologsave instead of triplog,parses it and loads that array into a google map.
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29647608
type: Answer

http://stackoverflow.com/q/29684380
score: 0
has answer: http://stackoverflow.com/a/29684489
type: Question
has comment: http://stackoverflow.com/comment/47505673
has body: I have a table which includes a checkbox and mutliple input boxes in its each row. I want to change the value of all input boxes of that row when I check the checkbox. Currently I only access the first input box. My codes are. and JS $('body').on('click','.isActive',function(){ if ($(this).is(':checked')) { $(this).parent().next().find('.name').val('Demian'); } }); how to solve this. JS fiddle link is http://jsfiddle.net/Iftakharul_alam/txpg8mhf/1/
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29684489
possible better answer: http://stackoverflow.com/a/29684434
answer count: 3
has answer: http://stackoverflow.com/a/29684434
tagged with: jquery
has title: How to catch DOM on individual row of a table
has comment: http://stackoverflow.com/comment/47505683
has answer: http://stackoverflow.com/a/29684473
type: AnsweredQuestion

http://stackoverflow.com/comment/47471864
type: QuestionComment
has text: You need to update last change field??
comment on: http://stackoverflow.com/q/29666409
score: 0
type: Comment

http://stackoverflow.com/a/29656635
answers question: http://stackoverflow.com/q/29656411
score: 0
type: Answer
has body: Try something like this: $(document).ready(function(){ for(i = 0; i &lt; 10; i++){ var names = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"] document.write('&lt;tr&gt;'); document.write('&lt;td&gt;'); document.write('Enter name '+ names[i]); document.write('&lt;/td&gt;'); document.write('&lt;td&gt;'); document.write('&lt;select id=' + names[i] + '&gt;&lt;/select&gt;'); var textFile = "/names.txt"; jQuery.get(textFile, function(textFileData) { var EachName= textFileData.split("\n"); for (q = 0; q &lt; 10; q++) { var select = document.getElementById(names[q]); for (var j = 0, len = EachName.length; j &lt; len; j++) { var option = document.createElement('option'); option.text = option.value = EachName[j]; select.add(option, 0); } } }); document.write('&lt;/td&gt;'); document.write('&lt;/tr&gt;'); } document.getElementById("1").selectedIndex = 0; document.getElementById("1").focus(); }); Put your logic for populating the selects in the document.ready function...

http://stackoverflow.com/comment/47392840
type: Comment
has text: Do you have jquery included into your page?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29624701

http://stackoverflow.com/comment/47608382
comment on: http://stackoverflow.com/a/29668413
has text: I'm not 100% sure if I follow. Does @include designate which sites the script should be active on?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/29644048
tagged with: javascript
tagged with: express
type: AnsweredQuestion
tagged with: pug
has answer: http://stackoverflow.com/a/29644199
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29693637
possible better answer: http://stackoverflow.com/a/29644199
type: Question
has body: I am looking for a template that uses HTML as is , it should be somthing like Jade but without modifying HTML language . The purpose of this question is that: I find HTML clear and easy enough I want to view my pages "or part of it" in MS-Expression or other simple web design softwares
has answer: http://stackoverflow.com/a/29644182
tagged with: node.js
has answer: http://stackoverflow.com/a/29644204
score: 0
answer count: 4
accepted answer: http://stackoverflow.com/a/29644182
has title: What Express.js template uses HTML as is?

http://stackoverflow.com/comment/47457494
type: Comment
type: QuestionComment
has text: @FelixKling interestingly that post also provides examples using only `Array`, `apply` and `map`. But I take your point
comment on: http://stackoverflow.com/q/29658732
score: 0

http://stackoverflow.com/a/29604804
has body: Ok I could fix the problem thanks to this: Can&#39;t get javascriptRoutes to work with Play Framework 2 The problem was the order in my routes document. As soon as I switched the assets declaration before the javascript routes it worked: # Javascript Router GET /assets/javascripts/routes controllers.Application.javascriptRoutes() # Map static resources from the /public folder to the /assets URL path GET /assets/*file controllers.Assets.at(path="/public", file)
type: Answer
answers question: http://stackoverflow.com/q/29591249
accepted answer of: http://stackoverflow.com/q/29591249
score: 0
type: AcceptedAnswer

http://stackoverflow.com/q/29535873
has body: I am using Eonasdan Bootstrap 3 datetimepicker. When I click picker, the glyphicon calendar is open, but it is visible partially. The calendar is hiding inside the grid. If I give "overflow:visible", calendar is visible fine but at that time the grid data's are also visible outside. If I click picker Icon, I want to visible calendar clearly, and at the same the the grid data's don't overflow outside the grid. How can I do this? http://jsfiddle.net/rtzxsa3e/3/ $(function () { var data = [ { rank: 1, company: 'Exxon Mobil', DatePicker: '04/04/1990 00:00', revenues: '339938.0', profits: '36130.0' }, { rank: 2, company: 'Wal-Mart Stores', DatePicker: '05/03/2014 00:00', revenues: '315654.0', profits: '11231.0' }, { rank: 1, company: 'Exxon Mobil', DatePicker: '04/04/1990 00:00', revenues: '339938.0', profits: '36130.0' }, { rank: 2, company: 'Wal-Mart Stores', DatePicker: '05/03/2014 00:00', revenues: '315654.0', profits: '11231.0' }, { rank: 1, company: 'Exxon Mobil', DatePicker: '04/04/1990 00:00', revenues: '339938.0', profits: '36130.0' }, { rank: 2, company: 'Wal-Mart Stores', DatePicker: '05/03/2014 00:00', revenues: '315654.0', profits: '11231.0' }, ]; var obj = { height:300, title: "ParamQuery Grid with JSON Data", scrollModel:{autoFit:true, theme:true} }; obj.colModel = [ { title: "Rank", width: 100, dataType: "integer", dataIndx: "rank" }, { title: "Company", width: 200, dataType: "string", dataIndx: "company" }, { title: "DatePicker", width: 200, dataType: "string", dataIndx: "date",editable:false, render : function(){ var date = ' '; return date; } }, { title: "Revenues ($ millions)", width: 150, dataType: "float", align: "right", dataIndx: "revenues" }, ]; $('body').on('mouseover','.input-group',function() { $(".input-group.date").datetimepicker(); }); obj.dataModel = { data: data }; $("#grid_json").pqGrid(obj); }); td.pq-grid-cell{ overflow:visible !important; } span.input-group-addon { width: 27px; } .pq-grid, .pq-grid-center, div.pq-grid-cont, .pq-grid-c…
tagged with: css
has comment: http://stackoverflow.com/comment/63278869
has answer: http://stackoverflow.com/a/29541354
has title: Eonasdan Bootstrap Datetimepicker calendar is not visible
type: Question
linked to: http://stackoverflow.com/q/29555624
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: twitter-bootstrap
type: UnansweredQuestion

http://stackoverflow.com/q/29640911
has answer: http://stackoverflow.com/a/29641829
has comment: http://stackoverflow.com/comment/47423621
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/12371159
has answer: http://stackoverflow.com/a/29640967
upvote count: 6
tagged with: angularjs
score: 5
possible better answer: http://stackoverflow.com/a/29640967
downvote count: 1
accepted answer: http://stackoverflow.com/a/29641829
type: AnsweredQuestion
type: Question
has body: I am brand new to AngularJS and while doing the Codecademy course I got stuck. I was trying to repeat a directive using the following syntax. I played around a bit and figured out I needed to remove the curly braces. But if I was not using a directive I think I would access the information like this. AngularJS documentation. {{ app }} Could someone explain why I do not need the curly braces to help me better understand AungularJS. Thanks!
answer count: 2
has title: Angular repeat directive syntax
tagged with: javascript
favorite count: 0

http://stackoverflow.com/comment/47364256
type: Comment
has text: Done. Was the order of my library that my script was running before jQuery
score: 0
comment on: http://stackoverflow.com/q/29609032
type: QuestionComment

http://stackoverflow.com/comment/47241397
type: QuestionComment
type: Comment
has text: Maybe it was just an uninformed statement, though if you had called me silly personally I'd have to agree :)
comment on: http://stackoverflow.com/q/29544779
score: 0

http://stackoverflow.com/a/29556923
type: Answer
has body: Make the dialog-message absolutely positioned, $("#dialog-message").css("position","absolute")
answers question: http://stackoverflow.com/q/29556774
score: 0

http://stackoverflow.com/q/29637013
duplicate of: http://stackoverflow.com/q/13925845
type: AnsweredQuestion
has title: Hide and show div in a form using java script
has body: I have two fields in a form, the first field is a drop down menu as shown below. The second is a date picker. Requires FPC? : Yes No Internal Ship Date: when the user selects option value "NO" I would like the internal_ship_date to hide. If the user selects "Yes", I would like the internal_ship_date to show. I would like to do this in JavaScript as I am trying to learn! Any help is appreciated!!
has comment: http://stackoverflow.com/comment/47416315
type: Question
has answer: http://stackoverflow.com/a/29637062
tagged with: javascript
linked to: http://stackoverflow.com/q/13925845
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/29637062
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/a/29622729
has body: u have forget to close the class, so element of DOM struture will change due to missing quotes, try use below line this may help u ** Back **
type: Answer
answers question: http://stackoverflow.com/q/29622517
score: 0

http://stackoverflow.com/comment/47227214
comment on: http://stackoverflow.com/a/29537379
type: AnswerComment
score: 0
type: Comment
has text: Added more code to the post to get a better context. Please have a look.

http://stackoverflow.com/a/29550451
downvote count: 0
has body: You need to use the multiple and attribute equals selectors: if($('input[type="hidden"][name="data[' + $(this).val() + '"][value="' + $(this).val() + '"]').length)
has comment: http://stackoverflow.com/comment/47252541
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/29550387

http://stackoverflow.com/comment/47295711
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29573193
has text: any idea how to remove it from even inside an REPL?
type: AnswerComment

http://stackoverflow.com/q/29646471
has comment: http://stackoverflow.com/comment/47436600
has comment: http://stackoverflow.com/comment/47433528
has comment: http://stackoverflow.com/comment/47436924
has title: Angular Object key value not showing
answer count: 0
has body: I have an array with objects each of these Objects contains information for my menu. In the Image u can see that one of these Objects contains: id, lang, link, modul_id,shrtModul, sort. Now my problem is that when I console.log($scope.usrModules) and click on the 3rd Object I see the key sort with the value 1. but when i console.log($scope.usrModules[2]); there is all information, however the sort key and value are missing somehow. and when i console.log($scope.usrModules[2].sort); the log returns undefined. I am not really sure why this is happening, but maybe someone can help me there. Since i cant post Images here a link myProblem My Controller $scope.usrModules = ParameterService.setMenu(Ls.getObject('mandants'), Ls.getObject('mandantId')); console.log($scope.usrModules); console.log($scope.usrModules[2]); console.log($scope.usrModules[2].sort); This is my Service where i build the array of Objects at the end i return arrModules which is the $scope.usrModules. .factory('ParameterService', function ($http, Ls, $location, $filter, CommonService) { var arrModules; var modulesOrder = []; var unique = {}; return { getAllDamage: function (callback) { $http.get(Ls.get('persist_ipAddress') + "ExternalParameter/GetAllParameters?businessUnitId=" + Ls.getObject("mandantId")) .success(callback); }, // does load the specific modules the user is allowed to use setMenu: function (mandants, mandantId) { // array of language keys which are used in this view !IMPORTANT -&gt; needs to be in the ascending order as in the language object var arrLang = ['btnDatenLadenML', 'btnDatenSendenML', 'btnMenuABML', 'btnMenuALML', 'btnMenuBLML', 'btnMenuELML', 'btnMenuGUML', 'btnMenuHMML', 'btnMenuIVML', 'btnMenuKOML', 'btnMenuMAML', 'btnMenuMIML', 'btnMenuSTML', 'btnMenuULML', 'btnMenuVEML', 'btnMenuVPML', 'btnMenuVSML', 'btnMenuWEML', 'btnTourStartML']; var lang = CommonService.setLang(arrLang); arrModules = []; // arr for nested modules 'versand' and ablieferung arrInnerModules = []; arrInn…
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47437319
has comment: http://stackoverflow.com/comment/47436512
has comment: http://stackoverflow.com/comment/47434332
type: Question
has comment: http://stackoverflow.com/comment/47433704
has comment: http://stackoverflow.com/comment/47433941
has comment: http://stackoverflow.com/comment/47436655
has comment: http://stackoverflow.com/comment/47436540
has comment: http://stackoverflow.com/comment/47436651
linked to: http://stackoverflow.com/q/23392111
has comment: http://stackoverflow.com/comment/47434831
has comment: http://stackoverflow.com/comment/47436084
tagged with: javascript
has comment: http://stackoverflow.com/comment/47433551
has comment: http://stackoverflow.com/comment/47434409
score: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47435564
has comment: http://stackoverflow.com/comment/47434237

http://stackoverflow.com/q/29566101
possible better answer: http://stackoverflow.com/a/29566469
has answer: http://stackoverflow.com/a/29566469
tagged with: node.js
accepted answer: http://stackoverflow.com/a/29566201
has body: I've been developing an application using node.js and in rare cases Callback doesn't halt the execution when got it and the execution continues Method 1 utilityMethod(arg1, arg2, arg2,function(err,result){ if(err){ callback(err); } if(result){ callback(null,result); } else{ callback('an error'); } }); function utilityMethod(arg1, arg2, arg3, callback){ //some logic if(err){ return callback(err); } else{ return callback(null,'success'); } } So I'm using the below code (Method 2)to halt the execution Method 2 utilityMethod(arg1, arg2, arg2,function(err,result){ if(err){ return callback(err); } if(result){ return callback(null,result); } else{ return callback('an error'); } }); I'm not sure why the method 1 fails. Which one is the right way to use? Also why the method 1 fails? **Note: I'm using the above methods inside the async.each(). **
has title: Node.js - Callback don't halt the execution when got hit
tagged with: javascript
tagged with: callback
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29566201
type: Question
score: 0
answer count: 2

http://stackoverflow.com/q/29627150
linked to: http://stackoverflow.com/q/386281
possible better answer: http://stackoverflow.com/a/29627256
downvote count: 0
tagged with: javascript
has body: I've got some trouble building a select all checkbox inside a table. Originally the table has several rows and the first checkbox should be used to select all options. I built a small example, but still could not figure out my mistake. Select All During debugging the div with id="all-AP" is retrieved but appears to be empty. I expected it to have three td-elements in it. Is a div separating the td's valid? What should I fix?
has comment: http://stackoverflow.com/comment/47399134
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29628062
has answer: http://stackoverflow.com/a/29627761
answer count: 4
favorite count: 0
has title: Is using inside a valid? Select all option inside a table row
upvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47398468
accepted answer: http://stackoverflow.com/a/29627761
has comment: http://stackoverflow.com/comment/47397527
score: 1
has answer: http://stackoverflow.com/a/29629956
has answer: http://stackoverflow.com/a/29627256
has comment: http://stackoverflow.com/comment/47397889
has comment: http://stackoverflow.com/comment/47397330
has comment: http://stackoverflow.com/comment/47397627
has comment: http://stackoverflow.com/comment/47398226
type: Question

ng-init
type: Tag
tag name: ng-init
tags question: http://stackoverflow.com/q/29630268

http://stackoverflow.com/q/29634839
has answer: http://stackoverflow.com/a/29638714
tagged with: angularjs-scope
possible better answer: http://stackoverflow.com/a/29636196
has answer: http://stackoverflow.com/a/29636196
has title: Angular custom directive - two way binding which always sets attribute to true or false
has answer: http://stackoverflow.com/a/29636448
tagged with: angularjs
answer count: 3
accepted answer: http://stackoverflow.com/a/29638714
has body: I'm creating a custom Angular directive for a slide in menu which needs to watch a couple of attributes and one of those attributes needs to be two way bound to the main controller scope (sometimes). However, sometimes the attribute will not be added by the developer so it needs to be added automatically and set to the default (false). So, the directive can be used like this. &lt;slide-menu position="right" is-open="menuIsOpen"&gt;&lt;/slide-menu&gt; or like this: &lt;slide-menu&gt;&lt;/slide-menu&gt; When used the first way the main controller will be able to open and close the menu by changing the value of the boolean $scope.menuIsOpen. When used without supplying the is-open attribute it should default to false and is obviously used internally and by a child toggle directive. An additional complication is that whether the attribute is supplied by the developer or not it should exist in the DOM. so in the second example above the directive would set itself to false by default and add the attribute is-open="false" to the DOM? The reason for requiring is-open="false/true" in the DOM at all times is that the menu is actually operated using CSS tansitions which use the following selector: slide-menu[is-active="true"]{ // Slide the menu in using transforms/transitions } There is a jsfiddle here which shows how far I have got. http://jsfiddle.net/jonhobbs/gEPvE/ Obviously it doesn't work, but it shows how I have tried to set a default and how I have tried to use @ and &amp; on the isolated scope for a one time binding (the menu position) and a 2 way bound expression for the is-open variable. I'm clearly a long way from achieving what I need but any advice would really be appreciated.
type: AnsweredQuestion
score: 0
type: Question
tagged with: angularjs-directive
tagged with: javascript

http://stackoverflow.com/a/29634647
has comment: http://stackoverflow.com/comment/47429349
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47426242
answers question: http://stackoverflow.com/q/29634504
has body: One problem is that allexp.length evaluates to undefined in this line: for (var i = 0; i < allexp.length; i++) { You're assuming that length is an attribute of allexp, as though it were an array. However, you defined allexp as an addition or concatenation: var allexp = (balancetotal + powertotal + staminatotal + agilitytotal + controltotal); To make an array of strings, do this instead: var names = ['balancetotal', 'powertotal', 'staminatotal', 'agilitytotal', 'controltotal']; Another problem is that you're treating the strings as though they had value attributes. Each string is actually the ID of an HTML element. Therefore, you should look up the element using getElementById and then get its value. for (var i = 0; i < names.length; i++) { var value = document.getElementById(names[i]).value, // Get value from element. x = parseInt(value, 10) || 0; // Parse in base 10. Default to 0. tot += x; } A final problem is that you aren't calling findTotal() anywhere. When do you want it to run? If you want it to run after the balance total has been updated, for example, you should insert a call to findTotal() as the last line of the balanceexp() function definition. To summarize, replace the current findTotal() function with this: function findTotal() { var names = ['balancetotal', 'powertotal', 'staminatotal', 'agilitytotal', 'controltotal']; var total = 0; for (var i = 0; i < names.length; i++) { var value = document.getElementById(names[i]).value, x = parseInt(value, 10) || 0; total += x; } document.getElementById('total').value = total; } And then make sure you call findTotal() when you want it to run. Below is a live demonstration incorporating the changes I have described. To try it out, click on the "Run code snippet" button and then on the "Full page" button that shows up inside the box. function findTotal() { var names = ['balancetotal', 'powertotal', 'staminatotal', 'agilitytotal', 'controltotal']; var total = 0; for (var i = 0; i < names.length; i++) { var value = …
accepted answer of: http://stackoverflow.com/q/29634504
has comment: http://stackoverflow.com/comment/47458739
upvote count: 2
has comment: http://stackoverflow.com/comment/47459120
has comment: http://stackoverflow.com/comment/47458249
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47457539
has comment: http://stackoverflow.com/comment/47457783
has comment: http://stackoverflow.com/comment/47424157
has comment: http://stackoverflow.com/comment/47433359
type: Answer
has comment: http://stackoverflow.com/comment/47457897

http://stackoverflow.com/a/29561617
has body: You can add date picker with following link. It's works fine with Twitter bootstrap. http://www.eyecon.ro/bootstrap-datepicker/ There are few demos are there and you need to reference to bootstrap-datepicker.js file. Then you can write code like below. $('.StartDate').datepicker()
score: 0
answers question: http://stackoverflow.com/q/29561346
has comment: http://stackoverflow.com/comment/47273460
type: Answer
has comment: http://stackoverflow.com/comment/47273289

http://stackoverflow.com/q/29578984
has answer: http://stackoverflow.com/a/42337609
has title: Jssor scale height of slider
score: 1
answer count: 2
upvote count: 1
has body: Hello I'm trying to set dynamic width (100% of container) and static height(550px) of slider on PC. On mobile it should be responsive. There is my code: <img u="image" src='<?php echo get_template_directory_uri(); ?>/images/grey.gif' data-original="<?php echo get_template_directory_uri(); ?>/images/w1.jpg" /> <img u="image" src='<?php echo get_template_directory_uri(); ?>/images/grey.gif' data-original="<?php echo get_template_directory_uri(); ?>/images/w2.jpg" /> <img u="image" src='<?php echo get_template_directory_uri(); ?>/images/grey.gif' data-original="<?php echo get_template_directory_uri(); ?>/images/w3.jpg" /> Here is what I've tried with scaleWidth and height but it didnt goes with 100% width.. function ScaleSlider() { var parentWidth = jssor_slider1.$Elmt.parentNode.clientWidth; console.log(parentWidth); if(parentWidth > 798){ jssor_slider1.$ScaleWidth(Math.min(parentWidth, 954)); }else if (parentWidth > 720 && parentWidth >= 797){ jssor_slider1.$ScaleWidth(816); jssor_slider1.$ScaleHeight(550); } else window.setTimeout(ScaleSlider, 30); } How can I make that my slider have always 100% width of container and static 550px of height on PC?
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29583037
tagged with: css
downvote count: 0
type: UnansweredQuestion
tagged with: jssor
type: Question

http://stackoverflow.com/q/29584125
score: -3
has comment: http://stackoverflow.com/comment/47316441
has comment: http://stackoverflow.com/comment/47316611
has body: Above is the HTML that I want to apply the script to. function newDate() { var _date = new Date("April 10"); document.getElementById("date").innerHTML = _date; } Essentially, what I'm trying to do is write a script that will show the date in the format "Friday, April 10th" and when I go to the next div and do the script it will produce "Saturday, April 11th". But right now I can't even get it to post the date. Could someone point me in a direction that would simplify and help me out?
has title: JavaScript Date Increment from a certain date
has comment: http://stackoverflow.com/comment/47316632
downvote count: 3
has answer: http://stackoverflow.com/a/29584241
type: Question
answer count: 2
upvote count: 0
linked to: http://stackoverflow.com/q/13571700
has comment: http://stackoverflow.com/comment/47316454
tagged with: javascript
has answer: http://stackoverflow.com/a/29584246
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47316640
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/a/29549874
accepted answer of: http://stackoverflow.com/q/29549836
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47260846
has body: Your code is fine. Keep it simple: var res = (n * (n+1)) / 2; Wiki.
answers question: http://stackoverflow.com/q/29549836
has comment: http://stackoverflow.com/comment/47251478
has comment: http://stackoverflow.com/comment/47251717
has comment: http://stackoverflow.com/comment/47251742
has comment: http://stackoverflow.com/comment/47251543
has comment: http://stackoverflow.com/comment/47251594
has comment: http://stackoverflow.com/comment/47257080
score: 54
has comment: http://stackoverflow.com/comment/47251383
downvote count: 2
type: Answer
upvote count: 56
has comment: http://stackoverflow.com/comment/47251346
has comment: http://stackoverflow.com/comment/96677423
has comment: http://stackoverflow.com/comment/47251689
has comment: http://stackoverflow.com/comment/47252095
has comment: http://stackoverflow.com/comment/110814614
has comment: http://stackoverflow.com/comment/47251508

http://stackoverflow.com/a/29648381
type: Answer
answers question: http://stackoverflow.com/q/29648234
upvote count: 1
score: 1
downvote count: 0
has body: Well there is an Array.sort() method in JavaScript, and for comparing the (sorted) arrays, I think it's best to check out this question, as it is has a really good answer. Especially note that comparing arrays as strings (e.g. by JSON.stringify) is a very bad idea, as values like "2,3" might break such a check.
has comment: http://stackoverflow.com/comment/47436672

http://stackoverflow.com/a/29680913
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29680859
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29680859
has body: You can do it like this, you don't need moment.js or something else, it's native js: var date = new Date("Thu Apr 23 2015 00:00:00 GMT+0200 (CEST)") date.getTime() Be aware, the timestamp is in miliseconds.. To get it in seconds, divide it by 1000.
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/47499042

http://stackoverflow.com/q/29672527
has comment: http://stackoverflow.com/comment/47485478
tagged with: anonymous-function
has body: I am working on a regular expression substitution that automatically names anonymous functions in a Javascript file. Until now I've come up with this regex: /^(\s*)(?!window\.)(\w+\.)?(\w+)(\s*)([:=])(\s*)function(\s*)\(/gm that correctly names functions (and preservers spacing) except the ones that are on the window object or that are referenced in an array (this.foo[i] : function() {}). The problem is that this regex doesn't match functions specified as vars, like this: var foo = function() {} This is a regex online tester with my regex so far https://regex101.com/r/gI3dH5/3 Any help?
tagged with: javascript
favorite count: 0
possible better answer: http://stackoverflow.com/a/29672888
tagged with: regex
upvote count: 2
downvote count: 1
has answer: http://stackoverflow.com/a/29672888
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/47483929
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/29674934
accepted answer: http://stackoverflow.com/a/29674934
has title: Automatically name anonymous functions with regex

http://stackoverflow.com/comment/47246434
comment on: http://stackoverflow.com/a/29546818
has text: Thanks. The document is sadly just hardcoded text (not an ASP.NET page), and it will be too high of a risk to change this now. So I'm guessing option 1 won't be very easy, since the page is created by documentContent.Text = " etc. The page is created by adding <a href>, no buttons. Any suggestions without using buttons? Or am I able adding a button within documentContent.Text = <some code>? Thanks!
type: AnswerComment
score: 0
type: Comment

hover
tags question: http://stackoverflow.com/q/29549511
tags question: http://stackoverflow.com/q/29581060
tags question: http://stackoverflow.com/q/29601841
tags question: http://stackoverflow.com/q/29551528
type: Tag
tags question: http://stackoverflow.com/q/29552289
tag name: hover

http://stackoverflow.com/comment/86772335
type: Comment
comment on: http://stackoverflow.com/a/29603165
has text: It does not matter if you give text or not, it won't users submit junk, only what is allowed.
type: AnswerComment
score: 0

http://stackoverflow.com/a/29662335
has comment: http://stackoverflow.com/comment/47464927
upvote count: 6
has comment: http://stackoverflow.com/comment/47464610
has comment: http://stackoverflow.com/comment/47464443
has comment: http://stackoverflow.com/comment/47464401
score: 5
downvote count: 1
has comment: http://stackoverflow.com/comment/47465158
answers question: http://stackoverflow.com/q/29662295
type: Answer
has body: window.scrollTo(x-coord, y-coord);
has comment: http://stackoverflow.com/comment/47464435

http://stackoverflow.com/q/29607448
possible better answer: http://stackoverflow.com/a/29608247
score: 0
has answer: http://stackoverflow.com/a/29608247
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47360483
has comment: http://stackoverflow.com/comment/47362059
tagged with: css
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/4770025
has answer: http://stackoverflow.com/a/29607510
accepted answer: http://stackoverflow.com/a/29607510
tagged with: scroll
has title: Enable/disable scrolling on button click
type: Question
has body: Is there a simple way to do this? I have a website with a flip animation(on buttonclick), wich has two sides. The frontpage has to cover the viewport height and width. The backpage is a little longer, especially on mobile devices. Unfortunately the length of the backpage causes the frontpage to be the same height. So i have a grey background color area underneath the cover of the frontpage.. My idea was to make the flip button also enable and disable scrolling. I've tried some things but javascript and jquery are not my specialty(at all). So can somebody provide me a little piece of code to add to the flipbutton?
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/47215488
score: 0
has text: Use timestamp to use instead of date
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29530859

http://stackoverflow.com/a/29582031
type: AcceptedAnswer
has body: Ascending order of specificity The following list of selectors is by increasing specificity: Universal selectors Type selectors Class selectors Attributes selectors Pseudo-classes ID selectors Inline style You can overwrite it using inline-styling document.getElementById('myFavoriteDIVever').style.display = 'block'; #myFavoriteDIVever { display: none; width: 300px; height: 400px; background: red } Stuff
has comment: http://stackoverflow.com/comment/47312429
upvote count: 3
answers question: http://stackoverflow.com/q/29581925
type: Answer
accepted answer of: http://stackoverflow.com/q/29581925
downvote count: 0
has comment: http://stackoverflow.com/comment/47312580
score: 3

http://stackoverflow.com/comment/47370481
has text: No, it's not required. The particular reason is probably *"because w3schools"*
type: QuestionComment
type: Comment
score: 3
comment on: http://stackoverflow.com/q/29612490

http://stackoverflow.com/q/29555509
has answer: http://stackoverflow.com/a/29556531
favorite count: 0
has body: How we can get particular isolated scope of the directive while calling link function from controller(parent)? I am having a directive and repeating it using ng-repeat. Whenever a button in the directive template is clicked it will call a function- Stop() in directive controller which in-turn calls function test() in parent controller, inside test() it will call a method dirSample () in directive's link function. When I print the scope inside dirSample(), it prints the scope of the last created directive not the one which called it. How can I get the scope of the directive which called it? Find the pluker here .directive('stopwatch', function() { return { restrict: 'AE', scope: { meri : '&amp;', control: '=' }, templateUrl: 'text.html', link: function(scope, element, attrs, ctrl) { scope.internalControl = scope.control || {}; scope.internalControl.dirSample = function(){ console.log(scope) console.log(element) console.log(attrs) console.log(ctrl) } }, controllerAs: 'swctrl', controller: function($scope, $interval) { var self = this; self.stop = function() { console.log($scope) $scope.meri(1) }; } }}); full code in plunker
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/29556531
upvote count: 1
has title: How to get isolated scope of a directive with ngrepeat and two way bind?
tagged with: angularjs-directive
type: AnsweredQuestion
tagged with: angularjs-controller
tagged with: angularjs-scope
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
score: 1

http://stackoverflow.com/comment/47380973
comment on: http://stackoverflow.com/q/29618075
has text: You can put username- password pair into an array. `var myArray = [{username: "user1", password:"p1"}, {username: "user2", password:"p2"}];`
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/47453798
type: AnswerComment
type: Comment
has text: I once did some tests that logged times in the console from background pages and content scripts. From what I recall, content scripts were injected *after* the background page finished loading, so the addListener call would have run in your example. I think the scenario becomes less clear in the type of example I gave, where a callback in the background page has to run (I suppose there is no guarantee for such cases, so I'll keep my code that checks that everything is ready).
score: 0
comment on: http://stackoverflow.com/a/29656749

http://stackoverflow.com/comment/47359658
comment on: http://stackoverflow.com/a/29601905
score: 0
type: AnswerComment
type: Comment
has text: OddDev - Sure...Saw your message now...Pls add me - gopal.rao.sln@gmail.com. thanks!

http://stackoverflow.com/a/29652715
has comment: http://stackoverflow.com/comment/47445789
has comment: http://stackoverflow.com/comment/47445550
has comment: http://stackoverflow.com/comment/47445261
has body: You need to do return sum(…); to make a proper tail call. In your example, the + operation is still executed after the recursive call, which makes this not work. The typical approach is to use a helper function with an accumulator parameter: function sum(...values) { function sumTo(acc, values) { if (!values.length) return acc; else return sumTo(acc+values.shift(), values); // tail-recursive call } return sumTo(0, values); } When recursing over lists, you can also (ab)use the list itself: function sum(...values) { switch (values.length) { case 0: return 0; case 1: return values[0]; default: values.unshift(values.shift()+values.shift()); return sum(...values); } } // or alternatively: function sum(acc, ...values) { switch (arguments.length) { case 0: return 0; case 1: return acc; default: values[0] += acc; return sum(...values); } }
has comment: http://stackoverflow.com/comment/47445590
accepted answer of: http://stackoverflow.com/q/29652586
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29652586
type: Answer
score: 6
upvote count: 6
has comment: http://stackoverflow.com/comment/47445194
has comment: http://stackoverflow.com/comment/47445221

http://stackoverflow.com/q/29650990
accepted answer: http://stackoverflow.com/a/29676976
has comment: http://stackoverflow.com/comment/47499319
has title: Backbone JS Single Page Application file upload?
type: AnsweredQuestion
has body: I'm looking for some design patterns or best practices around uploading files from a form to a REST end point. The REST endpoint is already working and I can POST files to it. Any thoughts would really be appreciated.
type: Question
answer count: 1
tagged with: javascript
score: 0
linked to: http://stackoverflow.com/q/25161524
tagged with: rest
has answer: http://stackoverflow.com/a/29676976
tagged with: single-page-application
tagged with: backbone.js
tagged with: mustache

http://stackoverflow.com/q/29636590
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29636962
score: 7
upvote count: 7
accepted answer: http://stackoverflow.com/a/29636962
type: Question
has title: Reload page on browser back/forward button in AngularJS with ui router
has comment: http://stackoverflow.com/comment/47416007
tagged with: angular-ui-router
has body: I have the following config for ui router state in my angularjs app. $locationProvider.html5Mode(true); $stateProvider .state('index', { url: '/index?zoom&amp;center', views: { 'map': { controller: 'MapCtrl', templateUrl: 'map.html' } }, reloadOnSearch:false }); However, the back forward button in the browser go to different url, but I need to reload the page with the urls as stateParams. For example: User1 go to page http://www.example.com/index?zoom=2&amp;center=1,2. then he does bunch operation in the page, the url becomes http://www.example.com/index?zoom=12&amp;center=3,4 Then he presses the back button, the url changes to the previous one, but I need to reload my page to let the controller read the query parameters to do the right thing... Any way to let it work with browser back/forward?
tagged with: javascript
downvote count: 0
answer count: 1
favorite count: 0
tagged with: angularjs
linked to: http://stackoverflow.com/q/19137504
has comment: http://stackoverflow.com/comment/47416133
tagged with: html5-history

http://stackoverflow.com/q/29666409
type: UnansweredQuestion
tagged with: php
score: 1
tagged with: codeigniter
linked to: http://stackoverflow.com/q/29672200
has comment: http://stackoverflow.com/comment/47471864
tagged with: mysql
upvote count: 1
has comment: http://stackoverflow.com/comment/47472006
type: Question
duplicate of: http://stackoverflow.com/q/29672200
has comment: http://stackoverflow.com/comment/47471827
tagged with: javascript
has answer: http://stackoverflow.com/a/29666539
has body: I build an app but I found new problem, I want to insert multiple data using javascript to add more form dynamically (then insert into table). Okay in my FIGURE, number 1,2,3 that's clear. But when I insert into the table , it can't succesfully. (number 4 is my function to insert data, but all of may form cannot insert (number 5) , only 1 data can insert ). what's wrong ? thanks FIGURE
downvote count: 0
answer count: 1
favorite count: 0
has title: insert into database with dynamic form with javascript (codeigniter)

http://stackoverflow.com/comment/47511649
comment on: http://stackoverflow.com/q/29687195
score: 0
type: QuestionComment
type: Comment
has text: So only leaf nodes can be modified?

http://stackoverflow.com/q/29683474
tagged with: meteor
favorite count: 0
type: AnsweredQuestion
tagged with: roles
has answer: http://stackoverflow.com/a/29683555
score: 1
upvote count: 1
type: Question
has body: Im using the alanning-roles package, and a Meteor.method to create an account with roles, but the accounts gets created witout any roles. The browser console throws Internal 505 error and the server console throws invalid createUser Method. This is my method. Meteor.methods({ createUser:function(password,email,username){ //Normal Account var rol = "Normal", account = Accounts.createUser({ email:email, password:password, username:username }); console.log(account) //returns id wich i need to add the user to the rol Roles.addUsersToRoles(account, rol); return account; } }) And calling it like i.e on an event handler. Meteor.call('createUser',"example123","example@gmail.com","example",function(error,account){ if(error){ console.log(error.reason) }else{ console.log("user created") } })
tagged with: javascript
has title: Accounts With roles MeteorJS
accepted answer: http://stackoverflow.com/a/29683555
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/47534720
comment on: http://stackoverflow.com/q/29679111
score: 0
has text: UPDATE: I tried again to delay the printing of $rootScope.pushToken in the 'MenuCtrl' and it does show up in console within the timer in the 'MenuCtrl'. How can I make it so that I can access the $rootScope.pushToken to pass around my function outside of the $timer? Do I have call $scope.$apply(); or something like that in order to update the scope variable or do something with the digest cycle? In other works how can I sync up the $rootScope.pushToken with all of the other application variables? Thank you very much for your initial response. I have gotten much further!
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29678785
tagged with: prototype
has comment: http://stackoverflow.com/comment/47523173
has comment: http://stackoverflow.com/comment/47496533
has comment: http://stackoverflow.com/comment/47495346
tagged with: click
has body: I have some issue with prototypeJS today which I am using for a new project so here's my code : var div = $('addcontact'); Event.observe(div, 'click', respondToClick); function respondToClick(event) { var form = $('contactForm'); form.setStyle( {display : initial} ); } I don't understand why it is not working, $('contactForm') has a display : none as a css property, so what I want to do is display it when clicking on $('addcontact').
type: Question
has title: Need help using prototypeJS
tagged with: events
has comment: http://stackoverflow.com/comment/47494842
score: 0
has comment: http://stackoverflow.com/comment/47495080
has answer: http://stackoverflow.com/a/33173466
answer count: 1
has comment: http://stackoverflow.com/comment/47495644
has comment: http://stackoverflow.com/comment/47495494
tagged with: javascript
type: UnansweredQuestion
tagged with: forms

http://stackoverflow.com/q/29649817
has answer: http://stackoverflow.com/a/29653161
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47442340
score: 3
upvote count: 3
type: Question
has body: I'm building an app at http://creditcardairlinepoints.com and I want the user to be able to filter an array of credit cards by clicking a filter on the side of the interface e.g. only Amex cards, cards with no fee. I'm able to bind the filter function to the user clicking the filter, but the function itself doesn't work as planned. There are two problems: I can't seem to get the filter to default to null. One of the links is to display 'all cards' which works on click, by setting the filter to null but I can't get this to on page load. I need to dynamically generate the filter e.g. cardFee:0, minSpend:0, bonusCurrency:amex and I'm not able to do this. I'm wondering if I'm going about this the wrong way and rather than generate the filter based on variables passed in from the array via the front end I should setup a loop e.g. if filterId = 0, do nothing if filterId = 1, show amex cards Filter list The list of filter links generated from an array using ng-repeat. I've bound this successfully to the function below and can successfully pass values to it. &lt;ul class="nav nav-sidebar"&gt; &lt;li ng-repeat="filter in filters" ng-click="selectFilter($index);setFilter(filter.property, filter.value)" ng-class="{active: $index===selectedIndex}"&gt; &lt;a href="#"&gt;{{ filter.anchor }}&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; Card Output Cards output to table cells in a given row, this is what I'd like to filter on click. &lt;tr ng-repeat="card in cards | orderBy:predicate:reverse | filter:cardFilter"&gt; Filter array The card array works fine and if I code up any of these filters statically it works. $scope.filters = [ { 'filterId': 0, 'anchor': 'All cards', 'property': '', 'value': '' }, { 'filterId': 1, 'anchor': 'American Express cards', 'property': 'bonusCurrency', 'value': 'amex' }, { 'filterId': 2, 'anchor': 'Avios cards', 'property': 'bonusCurrency', 'value': 'avios' }, { 'filterId': 3, 'anchor': 'No fee', 'property': 'cardFee', 'value': '0' }, { 'filterId': 4, 'anchor': 'N…
downvote count: 0
tagged with: javascript
has title: Dynamically filter ng-repeat on ng-click
tagged with: jquery
tagged with: filter
has comment: http://stackoverflow.com/comment/47439482
has comment: http://stackoverflow.com/comment/47440860
answer count: 1

server
tags question: http://stackoverflow.com/q/29604970
tags question: http://stackoverflow.com/q/29659823
tags question: http://stackoverflow.com/q/29655039
type: Tag
tags question: http://stackoverflow.com/q/29591805
tag name: server
tags question: http://stackoverflow.com/q/29567116
tags question: http://stackoverflow.com/q/29576768
tags question: http://stackoverflow.com/q/29640697

http://stackoverflow.com/a/29640330
type: Answer
accepted answer of: http://stackoverflow.com/q/29639177
answers question: http://stackoverflow.com/q/29639177
type: AcceptedAnswer
score: 0
has body: For integers, you can try shortening the number to the required number of places, then adding a name, e.g. // For integers function getNumberName(num) { var numNames = ['','Thousand','Million','Billion']; var num = num.toString() var len = num.length - 1; var pow = numNames[len/3 | 0]; return pow; } // For integers function abbreviateNumber(num, places) { places = places || 0; var len = num.toString().length - 1; var pow = len/3 | 0 return (num &lt; 1000? num : num/Math.pow(10, pow*3)).toFixed(places); } function getNumberAbbr(num, places) { return abbreviateNumber(num, places) + ' ' + getNumberName(num); } var nums = [0,1,12,123,1234,12345,123456,1234567,12345678,123456789,123e7] nums.forEach(function(num) { console.log(num + ' : ' + getNumberAbbr(num,1)); }); The above is not complete. There should be a limit applied so that beyond, say 1 trillion, it stops shortening the number.

http://stackoverflow.com/a/29631135
downvote count: 0
answers question: http://stackoverflow.com/q/29630174
type: Answer
accepted answer of: http://stackoverflow.com/q/29630174
has body: I updated the code to work with radio buttons. The problem was, when using this with checkboxes it will work because you can modify a single checkbox without having to worry about the siblings, but with radio buttons you have to run through all the siblings, checking/unchecking each one, which requires looping over the set every time you make a change. jsFiddle example (note that in the fiddle I exposed the radio buttons so you could see whether each was checked or not.) $(function () { $('.button-checkbox').each(function () { // Settings var $widget = $(this), $button = $widget.find('button'), $checkbox = $widget.find('input:radio'), color = $button.data('color'), settings = { on: { icon: 'glyphicon glyphicon-check' }, off: { icon: 'glyphicon glyphicon-unchecked' } }; // Event Handlers $button.on('click', function () { $checkbox.triggerHandler('change'); if ($(this).hasClass('btn-default')) { $checkbox.prop('checked', !$checkbox.is(':checked')); updateDisplay(); } }); // Actions function updateDisplay() { $('.button-checkbox').each(function () { var isChecked = $(this).find('input:radio').is(':checked'); // Set the button's state $(this).find('button').data('state', (isChecked) ? "on" : "off"); // Set the button's icon $(this).find('button').find('.state-icon') .removeClass() .addClass('state-icon ' + settings[$(this).find('button').data('state')].icon); // Update the button's color if (isChecked) { $(this).find('button') .removeClass('btn-default') .addClass('btn-' + color + ' active'); } else { $(this).find('button') .removeClass('btn-' + color + ' active') .addClass('btn-default'); } }) } // Initialization function init() { updateDisplay(); // Inject the icon if applicable if ($button.find('.state-icon').length == 0) { $button.prepend('&lt;i class="state-icon ' + settings[$button.data('state')].icon + '"&gt;&lt;/i&gt; '); } } init(); }); });
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47405203
type: AcceptedAnswer

http://stackoverflow.com/q/29576735
type: AnsweredQuestion
score: 2
upvote count: 2
type: Question
has answer: http://stackoverflow.com/a/77064061
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29576910
answer count: 3
possible better answer: http://stackoverflow.com/a/29576796
downvote count: 0
has answer: http://stackoverflow.com/a/29576796
has body: Consider a parent which is position:relative; width:100%. It contains a and a . I want them to have together a 100% width. The ideally should be fixed (it's a custom button) and the should fill the rest of the width (think about window resizing). Is it possible doing it without involving JS code? Also, it's not a "must-have" but I wish to support as for as I can with IE7+. CODE: Click CLARIFICATION: I am able to use javascript of course. If there isn't an elegant solution, then JS it is. Let me know please.
accepted answer: http://stackoverflow.com/a/29576910
favorite count: 0
has title: Make a div and a input width to be 100% of the parent
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/a/29548116
upvote count: 15
accepted answer of: http://stackoverflow.com/q/29547940
downvote count: 0
has comment: http://stackoverflow.com/comment/47248018
score: 15
has body: function outerWidth(el) { var width = el.offsetWidth; var style = getComputedStyle(el); width += parseInt(style.marginLeft) + parseInt(style.marginRight); return width; } this does exactly what jquery's outerwidth is doing, scratched from ::http://youmightnotneedjquery.com/ might be interteresting for further develpoment EDIT: in ie8 you have to use el.currentStyle[prop] instead of getComputedStyle(el);
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29547940
type: Answer

http://stackoverflow.com/a/29948101
answers question: http://stackoverflow.com/q/29680473
type: Answer
has body: I like providing an additional point of view to what Bergi already did mention, also encouraged by this answer within the OP's question. For what purpose? – user3749178 Apr 16 at 16:18 . @user3749178 Curiosity. – Ben Aston Apr 16 at 16:19 besides var obj = Object.assign(Object.create(Object.getPrototypeOf(fn)), fn);, that depends on ES6, there is an ES3 compatible approach that does wrap function objects into callable objects. Thus those objects are not callable anymore by the call operator (), but such objects do still expose two call methods call and apply. Since this approach prevents on one hand function objects being invoked by () (methods/functions) or by the new operator (instantiation), on the other hand it still supports delegation (function based mixins/traits). the gist hosted code of Function.toApplicator
score: 0

http://stackoverflow.com/comment/47394011
type: AnswerComment
has text: @Andrus: I recommend you to read [the wiki article](https://github.com/free-jqgrid/jqGrid/wiki/New-style-of-usage-options-of-internal-methods). You can use `formEditing` option of jqGrid to specify any common form editing options for the grid and `inlineEditing` option for common inline editing options. To set defaults *for all grids on the page* you can use `$.jgrid.inlineEdit` for inline editing and `$.jgrid.edit` for form editing. I recommend you to use new `inlineEditing`, `formDeleting`, `formViewing`, `searching`, `formEditing`, `actionsNavOptions`, `navOptions` options of jqGrid.
comment on: http://stackoverflow.com/a/29614381
score: 0
type: Comment

http://stackoverflow.com/q/29675217
possible better answer: http://stackoverflow.com/a/29676070
has title: loading php page with class in javascript
has answer: http://stackoverflow.com/a/29675373
type: Question
tagged with: javascript
tagged with: jquery
score: 4
answer count: 3
has answer: http://stackoverflow.com/a/29676070
has answer: http://stackoverflow.com/a/29693805
accepted answer: http://stackoverflow.com/a/29693805
favorite count: 0
tagged with: ajax
tagged with: http://stackoverflow.com/tag/html
tagged with: php
upvote count: 4
type: AnsweredQuestion
has body: I have popup class in javascript and added all scripts in my html page that are required to display that popup. I am trying to load PHP page in that popup on submit button click of my form. Popup is working fine for button like below (text from select.php is showing on popup box): Activate Now I have a form and on submit I have to redirect to PHP page depending on condition. And result should be display in popup. I tried to load page with my popup class as below but its not showing the popup. markup like below: Javasript: I think I am using wrong syntax of this $(".popup").load("correct.php"); I am not getting how to use that/how do I call a class(e.g .popup) in javascript with loading php page or other way of doing this. or How to use ajax in this case? Can ajax will help in such situation?
downvote count: 0

http://stackoverflow.com/a/29650235
accepted answer of: http://stackoverflow.com/q/29649989
answers question: http://stackoverflow.com/q/29649989
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/47440430
has body: You could write a simple handler prototype for this: function LinkMouseHandler(linkElement, ref) { this.mouseDownTimeStamp = 0; linkElement.onmousedown = function(e) { this.mouseDownTimeStamp = e.timeStamp; } linkElement.onmouseup = function(e) { if (e.timeStamp - this.mouseDownTimeStamp < 2000) window.location.href = ref; else alert("test"); } } var mouseHandler = new LinkMouseHandler(document.getElementById("test"), "http://www.google.de"); bla
score: 2
upvote count: 2

http://stackoverflow.com/q/29680379
tagged with: http://stackoverflow.com/tag/html
tagged with: web
favorite count: 0
tagged with: whatsapp
has body: I am looking for a way to open whatsapp chat through a webpage opened in mobile browser. Like if a user opens my webpage using a smart device and clicks on a link, it should open the whatsapp chat application on the smart device. I did some research and found that using &lt;a href="whatsapp://send?abid=&amp;text="&gt;&lt;/a&gt; does exactly that, but I am unclear about abid. Its an address book ID, but how to get that id, like if the user has my number in its contact list, how to get the id? And I also want to give an option to the user to add my number to its contact list if its not already there, how can I do that?
has title: How can I open a whatsapp chat from mobile webpage?
has answer: http://stackoverflow.com/a/63647645
type: UnansweredQuestion
downvote count: 2
upvote count: 3
score: 1
has answer: http://stackoverflow.com/a/33914310
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47498347
answer count: 2

http://stackoverflow.com/comment/47512725
has text: I agree. I don't know why the user would want iterate through div elements in this way. If you had more than 3 elements, what if you wanted to jump from, say, sixth to second. Personally I would go for an accordion approach.
type: Comment
comment on: http://stackoverflow.com/a/29687199
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47364911
comment on: http://stackoverflow.com/q/29609574
score: 0
has text: you assign the values to variables, mail & text. Later you use some_mail & some_text. Do you know if jquery will even make the call with those undefined vars?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47823784
comment on: http://stackoverflow.com/a/29848667
score: 0
type: AnswerComment
type: Comment
has text: checkDuplicatesHons() is not executing correctly.@avi

http://stackoverflow.com/comment/47666840
comment on: http://stackoverflow.com/a/29766327
has text: @VinitSharma: You are welcome! I'm glad that I could help you.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/29553031
has comment: http://stackoverflow.com/comment/47258156
has title: How data is filling when user start typing in search field
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47258178
has body: I want to make a search box like Google for my web page: I came across this question: Google-like search box with an AngularJS directive In the accepted solution, I'm not able to understand how (from where) data is populating as soon as user start typing in search text box. also where the on-change event is handled for textbox. Can please anyone help me with this?
has answer: http://stackoverflow.com/a/29553699
score: 0
has comment: http://stackoverflow.com/comment/47257851
has comment: http://stackoverflow.com/comment/47258002
type: Question
has comment: http://stackoverflow.com/comment/47257617
tagged with: javascript
has comment: http://stackoverflow.com/comment/47257958
has comment: http://stackoverflow.com/comment/47258044
answer count: 1
has comment: http://stackoverflow.com/comment/47258106
linked to: http://stackoverflow.com/q/28505183
has comment: http://stackoverflow.com/comment/47258203

http://stackoverflow.com/comment/76700040
type: AnswerComment
score: 0
type: Comment
has text: Thank you. Need to change `var userLong = results["geometry"]["location"]["lng"];` to the following to make it work `var userLong = results[0]["geometry"]["location"]["lng"];`. You need to point to the first element of the "result" array
comment on: http://stackoverflow.com/a/29666201

http://stackoverflow.com/comment/47288615
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29561148
has text: @Maxim, my problem with this is that I need every panel to be a separate directive, the way you propose it, it is only one that shows different templates.

http://stackoverflow.com/a/29569354
downvote count: 0
type: Answer
score: 2
has body: To do this you will need to write a little Node app server side. var express = require("express"), app = express(), request = require("request"); var port = process.env.VCAP_APP_PORT || 8080; app.use(express.static(__dirname + '/public')); app.listen(port); app.get("/data", function (req, res) { request.get("http://epec.saw.usace.army.mil/dsskerr.txt").pipe(res); }); On the client side you could do the following. Simple app to fetch a txt file simple app to fetch a txt file through a node server to get around CORS Here is a full git repo with the solution. https://github.com/jsloyer/node-fetch-txt-file. Additionally you can deploy the solution to Bluemix by clicking the button below.
answers question: http://stackoverflow.com/q/29569316
accepted answer of: http://stackoverflow.com/q/29569316
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/q/29670412
downvote count: 0
has title: Underscore uniq not working in Parse
favorite count: 0
tagged with: parse-platform
upvote count: 2
has comment: http://stackoverflow.com/comment/47480154
has answer: http://stackoverflow.com/a/29670653
score: 2
type: AnsweredQuestion
tagged with: underscore.js
possible better answer: http://stackoverflow.com/a/29670646
has answer: http://stackoverflow.com/a/29670646
type: Question
has body: I've got a simple array cars of Parse models of class Cars When I do var uniqCars = _.uniq(cars); it doesn't work. uniqCars is exact same as cars. The length of cars is 5 and length of uniqCars is 5 (when it should be 2). However, when I do: var uniqCars = _.uniq(cars, function (c) { return c.id; }); It works. My question is, why doesn't it work with the former and works with the latter? Why do I have to be so verbose? Is this an issue with Parse or underscore?
accepted answer: http://stackoverflow.com/a/29670653
tagged with: javascript
answer count: 2

http://stackoverflow.com/a/29559268
type: Answer
score: 1
answers question: http://stackoverflow.com/q/29558856
upvote count: 1
has comment: http://stackoverflow.com/comment/47268965
downvote count: 0
has body: Use jQuery hover to run code when hovering in or out of an element. Also use setTimeout to run code after a delay. var logo1 = "//cdn.shopify.com/s/files/1/0816/3411/t/3/assets/logo_2x.png"; var logo2 = "//cdn.shopify.com/s/files/1/0816/3411/t/3/assets/logo_hover_2x.png"; $(function() { $('.logoimage').hover(function() { setTimeout(function() { $('.logoimage').attr('src', logo2); }, 1000); }, function() { setTimeout(function() { $('.logoimage').attr('src', logo1); }, 1000); }); }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;img class="logoimage" src="//cdn.shopify.com/s/files/1/0816/3411/t/3/assets/logo_2x.png"&gt;

http://stackoverflow.com/comment/47317238
type: QuestionComment
has text: I just tried that, same issue comes up.
comment on: http://stackoverflow.com/q/29584388
score: 0
type: Comment

http://stackoverflow.com/q/29579844
has comment: http://stackoverflow.com/comment/47309582
has comment: http://stackoverflow.com/comment/47308766
tagged with: javascript
score: 0
favorite count: 0
answer count: 0
type: UnansweredQuestion
has title: Need help installing node-dev
upvote count: 1
downvote count: 1
tagged with: node.js
has comment: http://stackoverflow.com/comment/47308185
type: Question
has body: I am new to node.js and I am trying to install node-dev. Everytime I try to install I get his following error message: npm WARN deprecated object-keys@0.2.0: Please update to the latest object-keys /usr/local/bin/node-dev -&gt; /usr/local/lib/node_modules/node-dev/bin/node-dev node-dev@2.6.1 /usr/local/lib/node_modules/node-dev ├── filewatcher@1.1.2 ├── resolve@1.1.6 ├── node-notifier@4.1.2 (which@1.0.9, shellwords@0.1.0, clone@0.1.19, growly@1.2.0, semver@4.3.3) ├── dynamic-dedupe@0.2.0 (xtend@2.0.6) └── dateformat@1.0.11 (get-stdin@4.0.1, meow@3.1.0) I know it didn't install because when I run a script, it brings me back to the command prompt, instead of waiting for a change in file for it to restart automatically. Any help would be really appreciated. Thanks!

http://stackoverflow.com/comment/47485912
type: AnswerComment
has text: @FelixKling simple just replace `>` with `-`
comment on: http://stackoverflow.com/a/29672947
type: Comment
score: 0

http://stackoverflow.com/q/29642019
has body: I have wrote a plugin to open an Android native activity page from phonegap and its working fine. In the native activity page, I have a button. I would like to call a JavaScript function in my phonegap when that button is clicked.
favorite count: 0
tagged with: cordova
type: Question
score: 0
tagged with: android
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/29644344
has answer: http://stackoverflow.com/a/29642180
has answer: http://stackoverflow.com/a/33474873
answer count: 4
has answer: http://stackoverflow.com/a/29642523
tagged with: javascript
tagged with: phonegap-plugins
type: UnansweredQuestion
has title: How to send data to phonegap/cordova app from plugin
tagged with: android-activity

http://stackoverflow.com/q/29554749
has body: In my view I have file input: &lt;input type="file" class="file-input" name="file_source" size="40" onchange=''&gt; And span, in which I am showing the uploaded filename: &lt;span class='label label-info' id="upload-file-info" data-bind="text: image"&gt;&lt;/span&gt; $(".file-input").change(function() { var elem = $("#upload-file-info"); elem.html = $(this).val(); }); This span is binded with knockoutjs: viewModel = { image: ko.observable() } ko.applyBindings(viewModel); The problem is that the observable do not updates when I update the span text. Althought I have the filename in the span, the observable is empty. How can I make the observable to update itself when the span text changes ?
has answer: http://stackoverflow.com/a/29555124
has comment: http://stackoverflow.com/comment/47260651
tagged with: javascript
has comment: http://stackoverflow.com/comment/47260376
type: Question
score: 0
has title: Knockoutjs does not update viewmodel
answer count: 1
has comment: http://stackoverflow.com/comment/47260670
accepted answer: http://stackoverflow.com/a/29555124
tagged with: knockout.js
type: AnsweredQuestion

http://stackoverflow.com/comment/47479724
has text: You are welcome. I basically minified your JS code, so I think it works exactly as before, but in a little more efficient way.
comment on: http://stackoverflow.com/q/29670032
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29552904
upvote count: 1
type: AnsweredQuestion
score: 1
has body: Below is my code: function ConfirmYesNo(title, msg) { var $confirm = $("#myModal"); $confirm.modal('show'); $("#myModalLabel").html(title); $("#myModalText").html(msg); $("#btnYes").off('click').click(function () { $confirm.modal("hide"); return 1; }); $("#btnNo").off('click').click(function () { $confirm.modal("hide"); return 0; }); } function ValidationWarning(WarningMsg) { var a = ConfirmYesNo(Warning", WarningMsg); } I want to know whether the user had pressed Yes or No button before proceeding. Using return 1 or return 0 does not work for me. Any ideas?
accepted answer: http://stackoverflow.com/a/29553274
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: css
favorite count: 0
has title: Return a value from bootstrap's modal box yes or no option
has answer: http://stackoverflow.com/a/29553274
tagged with: twitter-bootstrap

http://stackoverflow.com/comment/47391574
type: Comment
comment on: http://stackoverflow.com/a/29622295
has text: This will make a request on `http://localhost:3000/admin/users?_id=552bb687ee568414260b4ff8` but I need `http://localhost:3000/admin/users/552bb687ee568414260b4ff8`. How to do that?
score: 0
type: AnswerComment

http://stackoverflow.com/a/29612127
has comment: http://stackoverflow.com/comment/47370096
answers question: http://stackoverflow.com/q/29612036
type: Answer
has comment: http://stackoverflow.com/comment/47370446
has comment: http://stackoverflow.com/comment/47370410
upvote count: 1
score: 1
has body: Send the first (0th) element from jQuery selector: parent.mysize($('#loadzone')[0]);
downvote count: 0

http://stackoverflow.com/q/29636988
answer count: 1
type: UnansweredQuestion
has body: how i can create a search, with an autocomplete from json file, and after submit value show resultes in new page with data of value selected here is the html file: &lt;form action="/dosomething"&gt; &lt;input/&gt; &lt;button type="submit"&gt;&lt;/button&gt; &lt;/form&gt; my json file : [ { "title": "Stackoverflowsite1", "link": "www.stackoverflow.com" }, { "title": "Stackoverflowsite2", "link": "www.stackoverflow2.com" }, { "title": "Stackoverflowsite3", "link": "www.stackoverflow3.com" } ] how i can parse data for autocomplete and showing results after do that's ? help please, and thank !
has answer: http://stackoverflow.com/a/29638470
has comment: http://stackoverflow.com/comment/47416543
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: autocomplete
tagged with: javascript
tagged with: jquery
has title: Autocomplete Jquery, and show results
score: 0

http://stackoverflow.com/q/29622307
type: AnsweredQuestion
downvote count: 2
type: Question
has title: TinyMCE - How to insert content at specific position
score: -2
has answer: http://stackoverflow.com/a/29624704
tagged with: tinymce-4
answer count: 2
upvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/49527985
favorite count: 0
has body: This is my try. tinymce.init({ ... }); var frame2 = ' some text '; tinymce.execCommand('mceInsertContent',false,frame2); out put view on preview some text As you can see the output is wrong. The desired output is below, which is p tag wraps div which wraps the text. some text What am I missing here?
tagged with: tinymce
possible better answer: http://stackoverflow.com/a/29623137
accepted answer: http://stackoverflow.com/a/29624704
has answer: http://stackoverflow.com/a/29623137

http://stackoverflow.com/a/30414801
answers question: http://stackoverflow.com/q/29626410
type: Answer
score: 8
has comment: http://stackoverflow.com/comment/65333181
downvote count: 0
has body: You can read the events section on the plugin documentation page to understand the various events provided by the plugin. It depends on how you have setup the ajax upload in the plugin. The plugin offers two ajax upload modes - synchronous and asynchronous as described in the documentation. Its asynchronous if you have uploadAsync property set to true. FOR AJAX SUCCESS TRAP: you can use the filebatchuploadsuccess event for synchronous uploads you can use fileuploaded event for asynchronous uploads FOR AJAX ERROR TRAP: you can use the filebatchuploaderror event for synchronous uploads you can use fileuploaderror event for asynchronous uploads In your case you have set uploadAsync set to true - so use the asynchronous settings/events.
upvote count: 8

http://stackoverflow.com/comment/47320964
type: AnswerComment
has text: isn't this method quite 'heavy', as this will be firing non-stop when the user is using the page?
comment on: http://stackoverflow.com/a/29586527
type: Comment
score: 0

http://stackoverflow.com/comment/47422405
comment on: http://stackoverflow.com/q/29640040
has text: Is it possible for us to see this? Can you show the code running somewhere?
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/29569311
tagged with: javascript
tagged with: jquery
has body: Basically I had a static page using many jQuery dom manipulation for creating UI and initiating few plugins. But now Im moving with AngularJs. orignally I had main.js (function($){ var somedom = $('#someid'); somedom.callingManyJquery() plugins ...some other jquery dom code })(jQuery); And now I have my controller, which takes care of rendering HTML content main.html into index.html. But I want to load the above main.js into a Directive or as a service so DOM manipulations should happen only after controller loads then HTML and jQuery will be able to find my HTML tags to catch the DOM. inside index.html I have &lt;div ng-view&gt;&lt;/div&gt; in app.js I have routes and config. .when('/', { templateUrl: 'views/main.html', controller: 'MainController' }) What should be the best way to load my jQuery files into my AngularJs controllers.
has answer: http://stackoverflow.com/a/30278546
accepted answer: http://stackoverflow.com/a/30278546
score: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47288043
type: AnsweredQuestion
has title: What is the Best way to load jQuery custom JS file in AngularJs
possible better answer: http://stackoverflow.com/a/29569389
type: Question
has answer: http://stackoverflow.com/a/29569389
has comment: http://stackoverflow.com/comment/47288685
has comment: http://stackoverflow.com/comment/47288715
answer count: 2

http://stackoverflow.com/q/29537985
has comment: http://stackoverflow.com/comment/47233766
has comment: http://stackoverflow.com/comment/47228573
tagged with: css
has comment: http://stackoverflow.com/comment/47228187
has answer: http://stackoverflow.com/a/29538197
score: 1
has answer: http://stackoverflow.com/a/29538280
upvote count: 1
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/47228095
has comment: http://stackoverflow.com/comment/47228786
downvote count: 0
has comment: http://stackoverflow.com/comment/47229613
has body: I'm trying to make a fixed box with 980px width and 500px height scrolling inside a div with 100% width and 1500px height, but it is not working at all. That's what I did: https://jsfiddle.net/zjuyuhmz/2/embedded/result/ The box is moving when the page scrolls, and I want to make scroll only if the mouse is inside of the div. Is this possible?? Html: Css: #wrapper { position: relative; width: 100%; height: 100%; color: #a3265e; font-family: 'GillSans-SemiBold'; } .main { border: 1px solid red; position: relative; width: 100%; height: 100%; margin: 0 auto; padding-top: 380px; } .container { border: 1px solid green; position: relative; width: 100%; height: 500px; margin: 0 auto; overflow: scroll; } .container2 { height: 1500px; margin: 0 auto; } .test { width: 940px; height: 500px; position: fixed; left: 50%; margin-left: -480px; background: black; }
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47228313
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has title: How can i make a box with 940px width fixed inside a scrollable div?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47229158

http://stackoverflow.com/q/29627834
tagged with: summernote
type: Question
has answer: http://stackoverflow.com/a/29629774
answer count: 1
has body: I am using a text editor called summernote with codeigniter. I also have my own image manager I would like to use. On my java script code I have set it so my image manager should OVERRIDE the image pop up in summernote editor. It does not each time I click on the summernote editor button insert image it still shows the default insert image. I am not sure why the default insert image pop up is still showing? I am pretty sure because not adding data-toggle="image" This part here not working $('button[data-event=\'showImageDialog\']').attr('data-toggle', 'image').removeAttr('data-event'); What is the best practice of making sure My image manager overrides it. filename common.js $(document).ready(function() { // Override summernotes image manager $('button[data-event=\'showImageDialog\']').attr('data-toggle', 'image').removeAttr('data-event'); $(document).delegate('button[data-toggle=\'image\']', 'click', function() { $('#modal-image').remove(); $(this).parents('.note-editor').find('.note-editable').focus(); $.ajax({ url: 'admin/filemanager', dataType: 'html', beforeSend: function() { $('#button-image i').replaceWith(''); $('#button-image').prop('disabled', true); }, complete: function() { $('#button-image i').replaceWith(''); $('#button-image').prop('disabled', false); }, success: function(html) { $('body').append(' ' + html + ' '); $('#modal-image').modal('show'); } }); }); // Image Manager $(document).delegate('a[data-toggle=\'image\']', 'click', function(e) { $('#modal-image').remove(); e.preventDefault(); var element = this; $(element).popover({ html: true, placement: 'right', trigger: 'manual', content: function() { return ' '; } }); $(element).popover('toggle'); $('#button-image').on('click', function() { $.ajax({ url: 'admin/filemanager/?input=' + $(element).parent().find('input').attr('id') + '&element='+ $(element).attr('id'), dataType: 'html', beforeSend: function() { $('#button-image i').replaceWith(''); $('#button-image').prop('disabled', true); }, complete…
score: 0
tagged with: codeigniter
accepted answer: http://stackoverflow.com/a/29629774
tagged with: javascript
type: AnsweredQuestion
has title: override summernote image pop up not working

http://stackoverflow.com/comment/47271953
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29560947
type: Comment
has text: Yes. every panel-content is different, and I want to chose it depending on the `panel.id` or are you asking scope wise?

http://stackoverflow.com/q/29650402
tagged with: javascript
has answer: http://stackoverflow.com/a/51488381
possible better answer: http://stackoverflow.com/a/61075025
has answer: http://stackoverflow.com/a/61075025
has comment: http://stackoverflow.com/comment/47441855
favorite count: 0
score: 41
has answer: http://stackoverflow.com/a/29651490
upvote count: 41
tagged with: interface
accepted answer: http://stackoverflow.com/a/51488381
answer count: 4
tagged with: typescript
type: AnsweredQuestion
has title: typescript extend an interface as not required
has body: I have two interfaces; interface ISuccessResponse { Success: boolean; Message: string; } and interface IAppVersion extends ISuccessResponse { OSVersionStatus: number; LatestVersion: string; } I would like to extend ISuccessResponse interface as Not Required; I can do it as overwrite it but is there an other option? interface IAppVersion { OSVersionStatus: number; LatestVersion: string; Success?: boolean; Message?: string; } I don't want to do this.
type: Question
has answer: http://stackoverflow.com/a/29704315
downvote count: 0

http://stackoverflow.com/comment/47468286
has text: What do you see in the error console? And where do you declare `position`? When I run this code, it fails because `position` is not defined. As it is the first command inside `sendToPhp()`, the execution stops and the PHP file is not called. If I harcode the value of `lat`, the call is done
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29662567

http://stackoverflow.com/comment/47479365
has text: Yes, you have to run that proxy on a node server.
comment on: http://stackoverflow.com/q/29670703
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/q/29666063
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/47471089
score: 0
tagged with: angularjs-http
has body: Is it possible to make use of $http without mocking? The service from which the call is made: // Make the request we are interested in testing ViewingRepositoryService.getThumbnail(obj, "urn:adsk.wipdata:versionedFile:BQLHHmlCRd-bqnr8rxF2xA?version=1", "medium") .then(function (data) { // On success (this is what we are expecting) console.log('success'); expect(data).to.deep.equal(mockData); //Validate the data is correct done(); }, function (err) { console.log('error'); done(); } ); Is not displaying 'success' or 'error'.
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47471103
type: UnansweredQuestion
has title: AngularJS $http testing
linked to: http://stackoverflow.com/q/29539880
has answer: http://stackoverflow.com/a/29669122
has comment: http://stackoverflow.com/comment/47485242
type: Question

http://stackoverflow.com/comment/47311022
type: Comment
comment on: http://stackoverflow.com/a/29580870
score: 0
has text: the `id` is used mainly for javascript purposes, and the `name` attribute is submitted to the server and available for the php code
type: AnswerComment

http://stackoverflow.com/a/29690073
type: Answer
has comment: http://stackoverflow.com/comment/47519291
has comment: http://stackoverflow.com/comment/47516914
score: 0
has body: You are passing ListView a function renderRow that returns a component. You would have to call that function within ListView once it is passed, presumably during a map over campaigns.
has comment: http://stackoverflow.com/comment/47520487
answers question: http://stackoverflow.com/q/29687885

http://stackoverflow.com/comment/47237559
type: AnswerComment
score: 0
type: Comment
has text: Thanks, due to my stupidity i got it working now, totally missing the simple problem :)
comment on: http://stackoverflow.com/a/29542901

http://stackoverflow.com/comment/47410673
type: Comment
comment on: http://stackoverflow.com/q/29633511
score: 0
type: QuestionComment
has text: Really really strange, I ran a new WP install and the script disapears... Thank you all for your time (I stay frustrated because still don't know why)

http://stackoverflow.com/a/29548108
score: 0
has body: As stated... This replaced everything except numbers (the ^\d part), colon (the ^: part) and AM/PM (the ^AMP part). selectedTime = selectedTime.replace(/[^\d:AMP]/g,""); You might also test using https://regex101.com
type: Answer
answers question: http://stackoverflow.com/q/29547928

http://stackoverflow.com/a/37050766
type: Answer
has body: The first step would be to add position: 'absolute', then if you want the element full width, add left: 0, right: 0, then, if you want to put the element in the bottom, add bottom: 0, // don't need set top: 0 if you want to position the element at the top, replace bottom: 0 by top: 0
answers question: http://stackoverflow.com/q/29541971
downvote count: 1
score: 73
upvote count: 74

http://stackoverflow.com/comment/126296942
type: Comment
comment on: http://stackoverflow.com/a/29557561
type: AnswerComment
score: 0
has text: Is there a cdn for this?

drop-down-menu
tags question: http://stackoverflow.com/q/29614902
tags question: http://stackoverflow.com/q/29567048
tags question: http://stackoverflow.com/q/29625809
tags question: http://stackoverflow.com/q/29633699
tags question: http://stackoverflow.com/q/29622180
tags question: http://stackoverflow.com/q/29644193
type: Tag
tags question: http://stackoverflow.com/q/29597769
tags question: http://stackoverflow.com/q/29540127
tags question: http://stackoverflow.com/q/29553406
tag name: drop-down-menu
tags question: http://stackoverflow.com/q/29554840
tags question: http://stackoverflow.com/q/29641815
tags question: http://stackoverflow.com/q/29603811
tags question: http://stackoverflow.com/q/29595939

http://stackoverflow.com/a/29610013
type: Answer
upvote count: 5
has body: See this fiddle. Your callback needs to be a function, like this: var tour = { init: function () { $("#tour").on("click", "button", function(e){alert("clicked")}); } };
score: 5
downvote count: 0
answers question: http://stackoverflow.com/q/29609979

http://stackoverflow.com/comment/47456221
type: AnswerComment
comment on: http://stackoverflow.com/a/29657555
type: Comment
has text: Ok, so to clarify, it is a button once click, will open an Ext.menu.Menu, i need to click an item off that menu.
score: 0

http://stackoverflow.com/a/29667751
score: 0
answers question: http://stackoverflow.com/q/29666982
type: Answer
has body: In my personal experience, i cant do it simultaneous log in with two system. what i do is the user first have to select what system the user what to log in using your app. to do this, first create two php files; copy the log-in form of two website you wish to log(in each file). Using javascript and iframe you will change the login form depending on what the user will select and then that. the user can now login with different website using your app.

http://stackoverflow.com/comment/47491408
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29676680
has text: check this out, fits exactly you'r question http://stackoverflow.com/questions/22954066/group-by-and-aggregation-on-json-array-using-underscore-js

http://stackoverflow.com/comment/47494434
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29677551
has text: #1) Maybe Flux isn't the best choice? #2) Where is the "payload" you mentioned fetched? I don't understand what you mean by "listen to a dispatched action (like a store)"? If you edit the question to include a few more details (some specifics), it may be easier to provide help.
score: 0

http://stackoverflow.com/q/29607749
has body: I must admit I'm less than a genius in CSS... To practice, I'm creating an animation that simulates a beer glass. For the moment, looking at some examples, I've achieved the desired animation: http://jsfiddle.net/yfb1fo8c/1/ And the shape I want: #liquid { background: black; border-bottom: 500px solid #e39700; border-left: 80px solid transparent; border-right: 80px solid transparent; width: 300px; color: #fff8eb; position: absolute; clip:auto; overflow:hidden; -webkit-transform: rotate(180deg); -moz-transform: rotate(180deg); -ms-transform: rotate(180deg); -o-transform: rotate(180deg); } But when I try to merge both ideas my shape totally crashes, or is not animated: http://jsfiddle.net/ogpqj2kr/2/ Any ideas?
upvote count: 4
tagged with: css
tagged with: animation
has title: Insert animation into shaped div
type: AnsweredQuestion
downvote count: 0
possible better answer: http://stackoverflow.com/a/29608949
has answer: http://stackoverflow.com/a/29609105
has answer: http://stackoverflow.com/a/29608949
accepted answer: http://stackoverflow.com/a/29609105
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
score: 4
favorite count: 0
has comment: http://stackoverflow.com/comment/47363418

http://stackoverflow.com/a/29541557
has body: You need to pass a function as parameter to expect in conjunction with toThrow or toThrowError. var invalidInput = ['Service1: ', 'Service2:stuff'] expect(function () { manager.parse(invalidInput); }).toThrow(); or var invalidInput = ['Service1: ', 'Service2:stuff'] expect(function () { manager.parse(invalidInput); }).toThrowError(Error);
upvote count: 7
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47235100
type: Answer
accepted answer of: http://stackoverflow.com/q/29541046
downvote count: 0
answers question: http://stackoverflow.com/q/29541046
has comment: http://stackoverflow.com/comment/47234915
score: 7
has comment: http://stackoverflow.com/comment/47235078

http://stackoverflow.com/comment/47269711
has text: @DanPaull Use a [local web server](http://www.maketecheasier.com/setup-local-web-server-all-platforms/), then you'll be able to use AJAX. As Rory says, this is the way to go
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29559482

http://stackoverflow.com/comment/47502588
comment on: http://stackoverflow.com/q/29682794
score: 1
has text: You're missing `=` signs for the parameters other than "newName" in the URL.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29657707
has comment: http://stackoverflow.com/comment/47455251
has comment: http://stackoverflow.com/comment/47455285
accepted answer of: http://stackoverflow.com/q/29655983
score: 0
answers question: http://stackoverflow.com/q/29655983
type: AcceptedAnswer
type: Answer
has body: Do not rely on your variable being defined even if it is in your tests. In general, due to normal timing, your var should be set by the time it receives the message, but to be sure you should check so in your background onMessage. I've dealt with this by remembering in a global whether I've already initialized the extension and do so if needed from onMessage. The answer by xan shows how to use "return true" in that case to process the message once your async init finishes. See an example of this on my chrome extension (search for bCalled) There you can see I have a sendResponse method that takes care of detecting if the callback was already called and if not, return true (assumes an async operation is in progress and will call the callback later) You can also experiment and test this by faking a delay in the background code that loads that var.

http://stackoverflow.com/comment/47221991
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29534194
has text: @tripleb there could be any number of reasons to refresh the page and there are more than a few ways to reset the selected value
score: 0

http://stackoverflow.com/q/29602302
tagged with: javascript
tagged with: hogan.js
score: 0
answer count: 1
type: UnansweredQuestion
has title: Populate a .js file with moustache js
type: Question
has answer: http://stackoverflow.com/a/29602577
has body: I have some javascript code which requires few fields from server side. I would like to store this code in a separate .js file but, moustache will not be able to populate it with server side information. This is what I have: &lt;body&gt; &lt;script type="text/javascript" src="/js/test.js"&gt;&lt;/script&gt; &lt;/body&gt; My .js file: var testField = '{{someValue}}'; alert(testField); // is null Thank you

http://stackoverflow.com/q/29624546
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29624642
possible better answer: http://stackoverflow.com/a/29624578
has comment: http://stackoverflow.com/comment/47392713
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/47392565
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: I have been searching for an answer for this question but still, my problem exists. I tried all the answers from here (StackOverflow) and from other websites but it still didn't solved my problem. Additional Information: There's no error on DevTools. HTML: Test About Work Contact CSS: /*Nav Styles*/ .nav li { text-transform: uppercase; list-style-type: none; display: inline; } .nav a { text-decoration: none; color: black; } /*Active Menu*/ .activeMenu { color: red; } JS: var x = function(){ $('.nav li').click(function(){ //alert($(this).text()); <-- It's working $(this).addClass('activeMenu'); return false; }); }; $(document).ready(x); Thanks a lot!
tagged with: css
favorite count: 0
has comment: http://stackoverflow.com/comment/47392586
has title: addClass in jQuery is not adding a class
has answer: http://stackoverflow.com/a/29624642
has answer: http://stackoverflow.com/a/29624578
upvote count: 1
downvote count: 1

http://stackoverflow.com/q/29664636
favorite count: 0
has body: I have two pages, one is pageone, which slides to orderpage (order form), when order is completed, a "Thank you for your order" displays, user can slide back to pageone, the problem is when the user slides to orderpage again, the blank order form doesn't show, instead the leftover "Thank you..." still there. <?php include 's_include'; ?> THIS IS MAIN PAGE GO TO PAGE TWO Enter your comment Back I tried to add rel="external" like this, but no help: GO TO PAGE TWO I don't want to use timer. Wonder if it's possible to have a blank clean order form every time I slideb to orderpage.
type: UnansweredQuestion
upvote count: 1
tagged with: php
score: 1
has title: Jquery mobile transition slide page content not refresh to original the second time
type: Question
tagged with: jquery-mobile
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29676215
tagged with: http://stackoverflow.com/tag/html
downvote count: 0

http://stackoverflow.com/comment/47217738
score: 0
type: Comment
has text: Damn, I didn't know about the jQuery data function.
comment on: http://stackoverflow.com/a/29532108
type: AnswerComment

ubuntu-14.04
tags question: http://stackoverflow.com/q/29612474
type: Tag
tag name: ubuntu-14.04

http://stackoverflow.com/comment/47300282
comment on: http://stackoverflow.com/q/29575886
score: 0
has text: [link](http://websitetips.com/articles/css/scrollbars/) I got this from the link.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29580150
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/29578423
has body: The issue is that you never actually hook your script up to the form's submit event, and so the form is submitted by the browser. However, since you don't specify an action attribute, so the form submits itself to the URL it's currently on (/login) resulting in the 405 you are seeing now. Hook up your loginAndRedirect to the form's submit event, and you will no longer POST to the /login endpoint: &lt;script&gt; $(".form-signin").on("submit", function(e) { e.preventDefault(); loginAndRedirect(); }); &lt;/script&gt; Some tips: Add an action pointing at the /loginAndRedirect endpoint so even if your JavaScript fails the user can still log in (unless you are planning on building a Single-Page App) Rather than looking up all of the users and walking through them in the application, add a WHERE clause to your SQL lookup and look the user up by username and password. Don't concatenate the user-provided values with your SQL, but instead use a parameterized query. You need to return a response, not assign to the response object (Flask doesn't provide one, so it's something local to your project).
type: Answer
has comment: http://stackoverflow.com/comment/47310194
has comment: http://stackoverflow.com/comment/47312639
score: 1

http://stackoverflow.com/comment/47497892
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29679289
has text: What type of element is `tbCity`? Is it a ` `, ` `, ` `, or something else? It would really help our understanding if you simply showed the associated HTML markup.
score: 0

http://stackoverflow.com/a/29839193
answers question: http://stackoverflow.com/q/29664435
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29664435
type: Answer
score: 2
upvote count: 2
has body: The answer of Merrily somehow correct, ZingChart looks good and have such functionality out of the box, but jqPlot is free and open source. I rewrote jqPlot Pie Chart plugins and now the Pie chart from your example will work. Here is my blog post with explanation what I changed. Download these 2 files: extendedPieRenderer.js (it replaces jqplot.pieRenderer.js) enhancedPieLegendRenderer.js (it replaces jqplot.enhancedLegendRenderer.js) And use them like this code: I also created this jsFiddle which you can open and verify that showing and hiding works: http://jsfiddle.net/19vzL5h2/1/

http://stackoverflow.com/comment/47343123
has text: Do you get a valid image back if you request the GetBpChart action directly?
comment on: http://stackoverflow.com/q/29598213
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/54084821
score: 3
has text: Nice. Just need to decode the string: res = decodeURIComponent(sParameterName[1].replace(/\+/g, " "));
type: AnswerComment
comment on: http://stackoverflow.com/a/29534771
type: Comment

http://stackoverflow.com/q/29541246
has body: I wanted to try and use the chrome.notifications api on Chrome (using Windows and Chrome 40+, so the API is supported). The only problem is that the object simply does not exist when trying to use. The type of chrome.notifications is undefined, and obviously if I try to use chrome.notifications.create, I get an error "cannot read property create of undefined". The thing is, I have activated notifications, and I'm using pushbullet with my android phone, which uses this rich notifications feature, and it works perfectly. So is chrome.notifications reserved for chrome apps? Thanks you very much.
answer count: 1
favorite count: 0
type: UnansweredQuestion
has title: Activate chrome.notifications object on Chrome
downvote count: 0
tagged with: google-chrome
type: Question
has answer: http://stackoverflow.com/a/29541357
score: 3
tagged with: javascript
upvote count: 3
tagged with: notifications
tagged with: api

http://stackoverflow.com/comment/47430251
type: Comment
score: 1
has text: I know that. That is __the__ problem. Whether the promise was canceled by `timeout` or by call to `cancel` by someone else than the timeout promise, is not possible to know.
type: AnswerComment
comment on: http://stackoverflow.com/a/29641800

http://stackoverflow.com/a/29539484
answers question: http://stackoverflow.com/q/29539448
type: Answer
upvote count: 1
score: 0
downvote count: 1
has comment: http://stackoverflow.com/comment/47234233
has body: var x = newFunction(); should do it.

http://stackoverflow.com/q/29687800
answer count: 2
tagged with: validation
downvote count: 0
tagged with: javascript
favorite count: 0
has body: I would like to have my code check if one or more check boxes have been selected in a list of check boxes. If no check boxes have been selected then I would like a window.alert to pop up saying "please select at least one interest". Currently all it does is alert that nothing has been checked even if you check a box. My code is as follows: Web Site Registration Form Web Site Registration Form Personal Information Select areas of interest (select at least one) Entertainment Business Music Shopping Travel Note: The extra code in the header is there to submit all data entered to a page which shows what has been submitted. This is my first post so feel free to let me know what other information may help. Thanks!
has answer: http://stackoverflow.com/a/29688180
upvote count: 3
tagged with: checkbox
has answer: http://stackoverflow.com/a/29688002
type: AnsweredQuestion
score: 3
accepted answer: http://stackoverflow.com/a/29688002
possible better answer: http://stackoverflow.com/a/29688180
tagged with: alert
has title: Checking to see if atleast one item has been selected in a checkbox list using javascript
linked to: http://stackoverflow.com/q/29710319
type: Question

http://stackoverflow.com/a/29708345
score: 2
answers question: http://stackoverflow.com/q/29654330
has comment: http://stackoverflow.com/comment/47634747
has comment: http://stackoverflow.com/comment/47638092
accepted answer of: http://stackoverflow.com/q/29654330
type: AcceptedAnswer
has body: Capturing only double clicks is not enough, since a user may further enter edit-mode using the Enter or F1 keys. One solution to the lack of onEdit callback is to register a custom editor. This way it fits nicely into all the edit-save-exit lifecycle (for example the the Esc key closes the editor and loses all changes). Here's a very simplified editor which extends the built-in and default TextEditor: var LoggingEditor = Handsontable.editors.TextEditor.prototype.extend(); LoggingEditor.prototype.getValue = function() { console.log('User finished editing the cell, the value will be set to: ' + this.TEXTAREA.value); return this.TEXTAREA.value; }; LoggingEditor.prototype.setValue = function(newValue){ console.log('User started editing the cell, value shown in cell is: ' + newValue); this.TEXTAREA.value = newValue; }; This solution, however, is not generic, since if there is more than one editor used, it will have to get replaced too. It should work in simple cases, though. The complete example can be found in this fiddle.
downvote count: 0
upvote count: 2
type: Answer

http://stackoverflow.com/comment/47403766
comment on: http://stackoverflow.com/q/29630503
has text: Why not use `mouseleave`-event ...?
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/132956609
has text: Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer).
type: Comment
comment on: http://stackoverflow.com/a/75333082
score: 1
type: AnswerComment

http://stackoverflow.com/comment/47391861
comment on: http://stackoverflow.com/q/29623225
score: 0
has text: Frogmouth, is it possible that it will show 2 subcategories?
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29557146
downvote count: 0
has comment: http://stackoverflow.com/comment/47285996
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/29556846
has body: Well, I don't know ASP, but you tagged JavaScript, so I'm assuming you're also up to doing this client side. (And it's also probably a good idea, since you'll be using the client's time, and not your server's) Here's what I'd do: function loadStyleSheet(url) { var styleSheet = document.createElement('link'); styleSheet.href = url; styleSheet.type = 'text/css'; styleSheet.rel = 'stylesheet'; document.getElementsByTagName('head')[0].appendChild(styleSheet); } var today = new Date().getDay(); if (today === 6 || today === 0) { loadStyleSheet('/style/weekendSheet.css'); } else { loadStyleSheet('/style/weekdaySheet.css'); } Notice that getDay returns the day as a number, so you can further expand the script if you want to get more specific. You should also have a 'default' stylesheet, though, for those users that have JavaScript disabled, and just override the default styles with the appended style sheet.

http://stackoverflow.com/q/29622044
tagged with: ionic-framework
score: 0
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/29622631
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/71404222
tagged with: tabs
has body: I want to display some common content in all the ionic tabs and on tabs switch, i want to switch part of content and not the whole content. Basically i have an image on which user does operations. That image must be included only once in the template. There are many tools divided on the basis of category. When a user selects a particular category, its tools are displayed. So, i chose tabs-interface of ionic to display different set of tools. But the problem is that i am not able to find a common place where i can place that image and it should show in all tabs. How to achieve that? This is what i am doing. Dynamic Content Of Tab One Dynamic Content Of Tab Two Dynamic Content Of Tab Three
type: Question
tagged with: javascript
has title: Show Common Content In All Tabs - Ionic

http://stackoverflow.com/a/29671563
has comment: http://stackoverflow.com/comment/47482544
downvote count: 1
has comment: http://stackoverflow.com/comment/47480945
type: Answer
has body: Using return 0, will return zero, which is a number. Using return false says that there is nothing to return, or don't return.
answers question: http://stackoverflow.com/q/29671319
upvote count: 0
score: -1
has comment: http://stackoverflow.com/comment/47481004

http://stackoverflow.com/a/29662858
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29662782
answers question: http://stackoverflow.com/q/29662782
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/47465646
downvote count: 0
has comment: http://stackoverflow.com/comment/47465754
has body: Every &lt;div className="input-group"&gt; must have a unique key &lt;div className="input-group" key={index}&gt; That's how React distinguishes between collection of rendered nodes. References: https://facebook.github.io/react/docs/multiple-components.html#dynamic-children UPD: As @WiredPrairie mentioned below in the comments - the suggested solution is far from ideal, since the index is not unique enough. And instead you need to create another array with some unique identifiers (a monotonously growing sequence would be enough) and maintain it in parallel with this.state.inputs and use its values as keys. So, on adding an element you: this.keys.push(++this.counter); on removing - remove from both by the same index. And in the .map you &lt;div className="input-group" key={this.keys[index]}&gt;
upvote count: 2
has comment: http://stackoverflow.com/comment/47465586
has comment: http://stackoverflow.com/comment/75515831

http://stackoverflow.com/comment/47412724
has text: When you are calling Var selected core list, is this where id specify the id of dropdown i want it to select?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29635167

http://stackoverflow.com/q/29658732
has comment: http://stackoverflow.com/comment/47457542
has comment: http://stackoverflow.com/comment/47457249
favorite count: 0
tagged with: sequences
has comment: http://stackoverflow.com/comment/47457406
upvote count: 2
has comment: http://stackoverflow.com/comment/47457130
type: UnansweredQuestion
score: -4
has comment: http://stackoverflow.com/comment/47457309
has comment: http://stackoverflow.com/comment/47457494
has title: In versions of JS upto and including ES6 are there any mechanisms available for the generation of sequences without loops or recursion?
downvote count: 6
has body: In versions of JS upto and including ES6 are there any mechanisms available for the generation of sequences without loops or recursion? For example: [n, n*2...] // Hypothetical syntax that I know to be invalid JavaScript
has comment: http://stackoverflow.com/comment/47457289
has answer: http://stackoverflow.com/a/29659414
has comment: http://stackoverflow.com/comment/47457421
type: Question
answer count: 1
has comment: http://stackoverflow.com/comment/47457385
tagged with: javascript
has comment: http://stackoverflow.com/comment/47457450
has comment: http://stackoverflow.com/comment/47457142

http://stackoverflow.com/a/29571279
score: -1
downvote count: 1
has comment: http://stackoverflow.com/comment/47292097
has comment: http://stackoverflow.com/comment/47295521
has comment: http://stackoverflow.com/comment/47291977
has body: Can you change the id to each specific popover instead of having the same function for all of them? Maybe #popover1 #popover2 etc? Just an idea.. Edit: For example i had a Bootstrap Modal which only pop up the first one until i changed the id to Modal1, Modal2 etc.. This then worked.
upvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29571232

http://stackoverflow.com/a/29619234
upvote count: 1
type: Answer
downvote count: 0
score: 1
has body: This will get you a moment in the same timezone as the moment string, but toDate is always in the local timezone. d = "2016-11-20T08:00:00+10:00" m = moment(d).utcOffset(d) m.format() m.toDate()
has comment: http://stackoverflow.com/comment/47382935
answers question: http://stackoverflow.com/q/29618728

http://stackoverflow.com/comment/47352624
has text: no... i am just using Jquery
score: 0
comment on: http://stackoverflow.com/q/29603227
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47425908
comment on: http://stackoverflow.com/a/29628581
type: Comment
has text: See here: http://stackoverflow.com/questions/8018760/jquery-difference-between-click-and-onclick#answer-8018832 so the answer is, it depends on your matter
type: AnswerComment
score: 0

http://stackoverflow.com/q/29680811
accepted answer: http://stackoverflow.com/a/29680866
has title: Javascript regex optional on left or right
has answer: http://stackoverflow.com/a/29684793
has answer: http://stackoverflow.com/a/29680948
type: Question
possible better answer: http://stackoverflow.com/a/29680948
answer count: 3
tagged with: javascript
has answer: http://stackoverflow.com/a/29680866
has body: Hi I can't get my pattern to work correctly. I want to detect if a specific word has any word/letter either in left or right side or both. For example: a{placeholder} = found {placeholder}b = found a{placeholder}b = found {placeholder} = not found This is my pattern so far (\w)?\{LINK_TO_WEB_VERSION\}(\w)? https://regex101.com/r/hX4lM0/1
tagged with: regex
type: AnsweredQuestion
score: 0

http://stackoverflow.com/comment/47322564
score: 0
has text: Yes, that's the structure. `{ "list": { "item : [ { "Offset" : 0, "Group" : "xx", "Name" : "y"} ]}`
comment on: http://stackoverflow.com/q/29587391
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47327274
type: QuestionComment
has text: You are probably fetching the details with AJAX, just add a random parameter with a random value, and IE should stop caching it.
comment on: http://stackoverflow.com/q/29590110
score: 0
type: Comment

http://stackoverflow.com/a/29622594
downvote count: 0
has body: I would do something like below, which gives your array of regions you can use in Form::select items list. If you see that the $regions is empty in the view then you can try debugging with dd($regions) or with dd(view('auth.register')-&gt;with('regions', $regions)) . These dd() calls will show if the values are correct and $regions is set. btw if Regions is a Model then convention says you should use singular form, Region instead of Regions public function getRegister() { $regions = Region::lists("name", "id"); return view('auth.register')-&gt;with('regions', $regions); }
type: Answer
answers question: http://stackoverflow.com/q/29622180
upvote count: 1
score: 1

http://stackoverflow.com/a/33611577
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29636505
has body: on - Sets the toggle to 'On' state off - Sets the toggle to 'Off' state componentDidMount: function() { $( this.refs.toggleInput.getDOMNode() ).bootstrapToggle('on'); }

http://stackoverflow.com/comment/47262934
has text: @oleq's answer mentions an alternative way of setting keystrokes, but [`config.keystrokes`](http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-keystrokes) exists as well. You might forgot about clearing your cache - otherwise I see no reason why it wouldn't work. (Edit: actually, you can also try to set the `config.keystrokes` on the fly, while it will only work before editor creation.)
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29541123

http://stackoverflow.com/a/29630965
upvote count: 3
answers question: http://stackoverflow.com/q/29630600
score: 3
downvote count: 0
type: Answer
has body: To me it seems that second function is quicker with full array because you don't have to do the var length = array ? array.length : 0; like in the first function, which saves you an extra trinary condition. With an empty array however, the second function is slower since you are forced to do an arr[-1] (because empty array still provides true inside if) which is a getter function and in the first function the condition is if (0) which is false and you simply return undefined. As for your second question - how to fix it - I assume this will do the trick since it will save you the getter function: function second(array) { return array &amp;&amp; array.length ? array[array.length - 1] : undefined; }

http://stackoverflow.com/comment/47255996
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29549531
has text: @Alexsmander I've added a working example. Maybe that will be useful for you.

http://stackoverflow.com/comment/47427751
type: QuestionComment
has text: How are you calling this code? As it's shown, its only ever called once when the page is first rendered.
comment on: http://stackoverflow.com/q/29643363
score: 3
type: Comment

http://stackoverflow.com/comment/47440179
comment on: http://stackoverflow.com/q/29649409
score: 0
has text: @Ras4U — [yes](https://www.google.co.uk/webhp?sourceid=chrome-instant&ion=1&espv=2&es_th=1&ie=UTF-8#q=site%3Astackoverflow.com%20make%20get%20request%20from%20php&es_th=1)
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47319488
comment on: http://stackoverflow.com/q/29584623
score: 0
type: Comment
type: QuestionComment
has text: I think your `window.onload` handler is never executed because it is set after the onload event occurs (the ajax call happens after the load event, I believe). Also, use `console.log` to troubleshoot results within your `onreadystatechange` xhr handler.

http://stackoverflow.com/q/29613820
downvote count: 3
has comment: http://stackoverflow.com/comment/47373516
type: Question
possible better answer: http://stackoverflow.com/a/29614017
has answer: http://stackoverflow.com/a/29614017
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/47373223
accepted answer: http://stackoverflow.com/a/29613969
answer count: 2
has comment: http://stackoverflow.com/comment/47373270
upvote count: 0
favorite count: 0
has title: replace Array items with it's positions
has comment: http://stackoverflow.com/comment/47373173
has comment: http://stackoverflow.com/comment/47373387
score: -3
tagged with: regex
has body: i want to replace each item in array with it's position . simple example: var items = 'ABCDefgh'; //how to replace items with its position to be [0][1][2][3][4][5][6][7] i use that but it replace the last item only. for(var i=0;i&lt;items.length;i++){ var items_positions = items.replace(items[i],'['+items.indexOf(items[i])+']'); alert(items_positions); } // it returns ABCDefg[7] and try with RegExp for(var i=0;i&lt;items.length;i++){ var items_positions = items.replace(new RegExp(items[i],"g"),'['+items.indexOf(items[i])+']'); alert(items_positions); } // it returns no thing
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29613969

http://stackoverflow.com/comment/47446037
has text: Hi! I was looking up the jQuery.getJSON( ) function. But I'm not sure if I can use it. I am not familiar with jQuery either.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29653024

http://stackoverflow.com/a/29596715
has comment: http://stackoverflow.com/comment/52682792
answers question: http://stackoverflow.com/q/29596714
downvote count: 1
score: 19
has comment: http://stackoverflow.com/comment/132059982
upvote count: 20
has comment: http://stackoverflow.com/comment/95701864
has body: The corresponding syntax for ES6 module syntax is: import * as foo from 'foo'; Basically import everything from the foo module into a local variable by the name of foo.
has comment: http://stackoverflow.com/comment/67248531
type: Answer

http://stackoverflow.com/q/29563509
score: 3
downvote count: 0
favorite count: 0
tagged with: angularjs
upvote count: 3
type: UnansweredQuestion
type: Question
has title: Using angular-chart.js as a dependency in a custom mean.io package
has answer: http://stackoverflow.com/a/34500821
tagged with: charts
has body: First of all, I installed angular-chart.js as suggested. http://jtblin.github.io/angular-chart.js/ From the directory of my custom mean package I typed: $ bower install angular-chart.js --save That created several folders in the public/assets folder of my custom module. /packages/custom/report/public/assets/lib/angular-chart.js/... and /packages/custom/report/public/assets/lib/Chart.js/... I followed the instructions from learn.mean.io on how to add an angular dependency to a custom mean package. http://learn.mean.io/#mean-stack-packages-angular-modules-and-dependencies In my module's app.js: // Aggregate CSS assets Report.aggregateAsset('css', 'report.css'); Report.aggregateAsset('css', '../lib/angular-chart.js/dist/angular-chart.css'); // Aggregate JS assets Report.aggregateAsset('js','../lib/Chart.js/Chart.js'); Report.aggregateAsset('js','../lib/angular-chart.js/dist/angular-chart.js'); // Add dependency to modules in the custom package Report.angularDependencies(['chart.js']); In theory, that would be equal to defining my module like this, including the dependency: angular.module('mean.report', ['chart.js']); Which I also tried by the way. When I run the application I can see that the JS and CSS files are downloaded, the CSS styles can be used, but I can not see any charts. Trying many different ways of configuration at mean.io files I've been able to see a pie chart, but every time I try to feed it with real data I get some errors like Chart is not defined, etc. It's crazy that I change a line in a view of my app and the chart dissappears. I can't get it working in a consistent way. So, either chart.js doesn't get injected in my module or the dependencies between angular-chart.js and Chart.js are not resolved. I discussed for long with a guy from mean.io support team and he said everything was ok on the mean side, and that I probably should check angular-chart.js
tagged with: javascript
has answer: http://stackoverflow.com/a/29631742
has answer: http://stackoverflow.com/a/29769330
answer count: 3

http://stackoverflow.com/a/72527073
type: Answer
upvote count: 0
answers question: http://stackoverflow.com/q/29563712
score: -1
has comment: http://stackoverflow.com/comment/128126215
downvote count: 1
has body: var secectedNode=$('[aria-selected="true"]') if(secectedNode.length==0) return; secectedNode[0].focus();

http://stackoverflow.com/q/29662712
answer count: 1
has comment: http://stackoverflow.com/comment/47508243
has answer: http://stackoverflow.com/a/29694606
accepted answer: http://stackoverflow.com/a/29694606
has comment: http://stackoverflow.com/comment/47496544
has title: Connect limit's series in Highcharts
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/47484439
tagged with: highcharts
has body: Updated :I'm trying to make a radar chart with hightcharts, but I can't connect this values(the ones which has asterisks for example): $('#container').highcharts({ plotOptions: { series: { enableMouseTracking: false } }, chart: { polar: true, type: 'line' }, title: { text: 'Graph', x: -80 }, pane: { size: '80%' }, xAxis: { categories: ["Sponsor / Developer","Banks","SPV","Bank Legal DD","Services Legal contracts","Environmental license","Grid connection license","Construction License","Generation License","Site Studies\/License","Property\/terrain","Technical studies","EPC","Financial model"], tickmarkPlacement: 'on', lineWidth: 0 }, yAxis: { gridLineInterpolation: 'polygon', lineWidth: 0, min: 0 }, tooltip: { shared: true, pointFormat: '{series.name}: \${point.y:,.0f} ' }, legend: { align: 'right', verticalAlign: 'top', y: 70, layout: 'vertical' }, series: [{"name":"Legal","data":[4,3,4,4,4,4,4,null,null,null,null,null,null,4],"color":"#206ef0"},{"name":"Licenses and Permits","data":[null,3,null,null,null,4,4,4,4,4,4,null,null,null],"color":"#f07820"},{"name":"Technical","data":[null,null,null,null,null,null,null,null,null,null,4,4,4,null],"color":"#ff0000"},{"name":"Financial","data":[null,null,null,null,null,null,null,null,null,null,null,null,null,null]}]}); The goal is to connect the series'limit of any series. I mean, if in excel I have the same series, financial model and Sponsor/Developer will be connected by a blue line. Look : excel graph How can I do it? Thank you.
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/comment/47409827
score: 0
type: Comment
type: QuestionComment
has text: It looks like an attack but I'm running with mamp
comment on: http://stackoverflow.com/q/29633511

http://stackoverflow.com/comment/47781966
comment on: http://stackoverflow.com/a/29817925
score: 0
has text: I'm curious--why do you use angular.extend($scope ...); rather than just assign values directly to $scope?
type: Comment
type: AnswerComment

http://stackoverflow.com/q/29609273
has comment: http://stackoverflow.com/comment/47364389
has comment: http://stackoverflow.com/comment/47364235
answer count: 0
score: 0
has comment: http://stackoverflow.com/comment/47364346
type: Question
tagged with: javascript
has body: I have a simple force layout that calculates nodes and links when certain buttons are clicked. The first time the nodes are calculated and displayed everything is correctly positioned. However, when nodes are recalculated after another click, the position of the circles I have appended to the nodes are way off yet the text I added remains in the right place. Here's my JS: //Compute Nodes and Links var data = this.computePreviewNodes($(e.currentTarget).data("id"), $(e.currentTarget).data("type")); var canvas = d3.select(".body").append("svg") .attr("width", width) .attr("height", screen.height/2) .append("g"); canvas.append("text") .text(compObj.name) .attr("text-anchor", "middle") .attr("font-size", "2em") .attr("x", width/2) .attr("y", 40); var force = d3.layout.force() .nodes(data.nodes) .links(data.links) .gravity(.05) .distance(100) .charge(-10) .size([width, screen.height/2]); var links = canvas.selectAll(".links") .data(data.links) .enter().append("line") .attr("class", "links") .attr("fill", "none") .attr("stroke", "blue"); var nodes = canvas.selectAll(".nodes") .data(data.nodes) .enter() .append("g") .attr("class", "nodes") .call(force.drag); nodes.append("circle") .attr("cx", function(d) {return d.x;}) .attr("cy", function(d) {return d.y;}) .attr("r", 10) .attr("fill", "green"); nodes.append("text") .text(function(d) {return d.name}) .attr("text-anchor", "right") .attr("font-size", "1.8em") .attr("y", 5); force.on("tick", function(e) { nodes .attr("transform", function(d, i){ return "translate(" + d.x + ", " + d.y + ")"; }); links .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;}) }) force.start(); My computePreviewNodes() function simply comes up with what nodes need to be displayed based on which button is clicked. My thoughts are that maybe I'm not updating my node positions correctly after the second rendering of my nodes.…
has title: Wrong positioning of D3 nodes
tagged with: d3.js
type: UnansweredQuestion

http://stackoverflow.com/q/29675813
favorite count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: node.js
score: 2
answer count: 0
tagged with: cookies
type: Question
tagged with: javascript
tagged with: cookie-session
tagged with: express
has body: I'm using express.js cookie-session in order to store my logged user session. Each time I'm signing in new user I'm putting a userId on his current session and assigning this userId to a user._id I created for him on my DB: req.session.userId = user._id; Eventually when a new user will submit my login form, a get request will be sent to my /user restful service containing my user data and if that data (identifier) isn't store on my DB a new user will be registered on my DB and a new session cookie will be created for him. req.session.userId = user._id; res.status(200).send({'userId': user._id}); I tested the above functionality on chrome, firefox and IE11 When using chrome/firefox the response code after login is 200 and the submitted user is being greeted by the UI. However when using IE11 The first submitted user will be greeted by the UI but when another user is submitted he won't be greeted, apparently IE11 caches the first logged in session-cookie (response code 304), unless turning on a flag in dev console which is always refresh from server, but this is not the browser's default option.
has title: How to overcome IE11 caching express.js cookie-session?
downvote count: 0

http://stackoverflow.com/a/29568807
answers question: http://stackoverflow.com/q/29568240
accepted answer of: http://stackoverflow.com/q/29568240
score: 0
type: AcceptedAnswer
has body: I assume you want to highlight an menu item based on the actual url? It could be done with javascript's location object. You can get each part of the actual url as follow. For this link http://example.com/index.php it would be: location.protocol = http: location.host = example.com location.pathname = /index.php For the OP example, you could simply use location.pathname: // get the actual pathname: var path = location.pathname; // filter menu items to find one that has anchor tag with matching href: $('.sidebar-menu li').filter(function(){ return '/' + $('a', this).attr('href') === path; // add class active to the item: }).addClass('active');
type: Answer

http://stackoverflow.com/q/29541173
tagged with: onclick
tagged with: http://stackoverflow.com/tag/xhtml
has body: I am not so into JavaScript and I have the following problem. Into a JSP page I have the following "link": Tabella Anagrafica So, when the user click on the tr element it is performed the changeLocationTo() JavaScript function passing to it the String 'edi.do?serv=4.U'. Into this page I have defined the script section: My problem is that when I click on the previous tr link it don't perform the changeLocationTo() function and into the FireBug console is is shown this error message every time that I click on the tr: ReferenceError: changeLocationTo is not defined Why? what could be the problem? How can I try to fix it? What am I missing?
answer count: 1
tagged with: javascript
tagged with: dom-events
has answer: http://stackoverflow.com/a/29541195
score: 0
tagged with: http://stackoverflow.com/tag/html
has title: Why I can't perform this simple JavaScript function using the onclick event?
accepted answer: http://stackoverflow.com/a/29541195
type: Question
type: AnsweredQuestion

http://stackoverflow.com/a/29533875
answers question: http://stackoverflow.com/q/29533288
downvote count: 0
has comment: http://stackoverflow.com/comment/47221340
has comment: http://stackoverflow.com/comment/47221206
has body: AngularJS is the framework you want to use for 2-way data binding. I used AngularJS for multiple projects now, combined with nodeJS, and I never looked back at jQuery, you keep your code clean with the MVC pattern and manipulating the DOM is made easy and clear. Example for 2 way data binding: HTML &lt;p&gt;{{elementText}}&lt;/p&gt; &lt;input type="text" ng-model="item.value" /&gt; JavaScript/Controller $scope.item = { value: '' }; $scope.elementText = "The text you want to display"; console.log($scope.item.value); //Directly get your values from the scope. Want to assign values to &lt;select&gt; boxes or fill &lt;table&gt;'s using JSON data? No problem, AngularJS got you covered. Interesting AngularJS features: ng-model ng-repeat Animations Custom directives I hope this will help you!
has comment: http://stackoverflow.com/comment/47226289
type: AcceptedAnswer
upvote count: 3
has comment: http://stackoverflow.com/comment/47226451
type: Answer
has comment: http://stackoverflow.com/comment/47221637
accepted answer of: http://stackoverflow.com/q/29533288
score: 3

http://stackoverflow.com/q/29608064
favorite count: 0
has body: I want to replace the words "red" and "td" with "blue" in the content below, but I don't want the color attribute of the last and all the tag to be messed. Code name td A001 Madam Red do your job This is what I want: Code name blue A001 Madam blue do your job But I got this result when I use / .*(red|td).*<\/td>/gi to replace the content. Code name blue A001 Madam blue do your job Are there any regex to solve this problem? Thanks.
has answer: http://stackoverflow.com/a/29609360
has comment: http://stackoverflow.com/comment/47361784
possible better answer: http://stackoverflow.com/a/29611343
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/47362186
has answer: http://stackoverflow.com/a/29609314
downvote count: 1
type: Question
upvote count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/29611343
linked to: http://stackoverflow.com/q/1732348
answer count: 3
accepted answer: http://stackoverflow.com/a/29609360
has comment: http://stackoverflow.com/comment/47361778
has title: How to replace specific substrings that are not html tags
tagged with: regex

http://stackoverflow.com/q/29680213
has comment: http://stackoverflow.com/comment/47497699
accepted answer: http://stackoverflow.com/a/29683122
has comment: http://stackoverflow.com/comment/47497785
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/29680507
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29680507
score: 1
has comment: http://stackoverflow.com/comment/71415313
has title: input slider with 'tick marks'
favorite count: 0
tagged with: angularjs
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/29683122
tagged with: input
has body: I am looking to be pointed in the right direction with creating this input slider. I have done a little bit of research and I believe the appropriate route to take would be using the html range input type. My question is what would be the best way to approach having 'tick marks' and not allowing users to land in between these options? Does html range input have an attribute to limit the slider position / options? I am assuming this cannot be done purely with the input type / attibutes, and I would need to use JS/Jquery. I am using Angular with Bootstrap for the UI. Please see image for mock-up. Thank you
has comment: http://stackoverflow.com/comment/47497999
downvote count: 3
upvote count: 4

http://stackoverflow.com/q/29623541
tagged with: phantomjs
tagged with: testing
score: 1
has comment: http://stackoverflow.com/comment/47443112
has comment: http://stackoverflow.com/comment/47520153
upvote count: 1
has comment: http://stackoverflow.com/comment/47515735
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/47515597
has comment: http://stackoverflow.com/comment/47392952
tagged with: node.js
has title: CasperJS tests fail from some machines, succeed on others
tagged with: casperjs
downvote count: 0
answer count: 0
type: UnansweredQuestion
has body: Having a strange problem where certain CasperJS tests fail on some machines (all different versions of OS X) and not others, even though the version of CasperJS, PhantomJS, Node and NPM are all the same. What am I missing? Simplified version of the code follows: var userAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:36.0) Gecko/20100101 Firefox/36.0', url = 'https://www.google.com/search?q=apple&amp;ie=utf-8&amp;oe=utf-8', selector = '#tads.c', timeoutMs = 10000; casper.test.begin("test1", 1, function(test) { casper.userAgent(userAgent); casper.start(url) .waitForSelector(selector, function() { test.assertExists(selector, 'selector: ' + selector); }, function timeout() { test.fail(selector + ' timed out after ' + timeoutMs + ' ms'); }, timeoutMs) .run(function() { test.done(); }); });
has comment: http://stackoverflow.com/comment/47418510
type: Question

http://stackoverflow.com/a/29576598
has comment: http://stackoverflow.com/comment/47301588
type: Answer
downvote count: 0
score: 1
has body: It depends on how you define "viewport scroll progress". If you mean scroll progress as in the proportion of scrollable height that has been scrolled past, you can simply divide the scrollTop of the viewport by the scrollable height. Scrollable height, in turn, is simply the difference between the document height and the viewport height. With this ratio in mind, you can simply multiply it by the duration of the video, accessed using .duration property, in order to navigate to the correct timestamp that is to the ratio of the scrollable height of the page. In my fiddle example, I have set the document height to 500% that of the viewport, and positioned the video fixed relative to the viewport, in order to demonstrate how this works (otherwise the video will scroll out of view). $(function() { $(window) .on('scroll', vidProgress) .load(vidProgress); function vidProgress() { // Get video properties var $v = $('video'), duration = $v[0].duration; // Get window properties var $w = $(window), scrollable = $(document).height() - $w.height(); // Do seeking var scrollRatio = $(document).scrollTop()/scrollable; if(isNaN(scrollRatio)) scrollRatio = 0; $v[0].currentTime = scrollRatio*duration; }; }); View working demo here: http://jsfiddle.net/teddyrised/kr9jmudu/ Note: If the video is extremely huge, it doesn't make sense to listen to the window's load event. Instead, listen to the loadedmetadata event of the video, so you can already start calculating the ratio.
has comment: http://stackoverflow.com/comment/47301656
answers question: http://stackoverflow.com/q/29576388
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/104098784
accepted answer of: http://stackoverflow.com/q/29576388

http://stackoverflow.com/a/29681733
answers question: http://stackoverflow.com/q/29681361
has body: How about feature detection? That would tell you at least whether the browser has the function. As to the behaviour of the browser I'm not sure it's possible to truly determine what the behaviour is going to be if it differs from the standard. It is a well established living standard. var supportsclose = ("close" in window) &amp;&amp; typeof window["close"] === "function"; console.log(supportsclose); https://developer.mozilla.org/en-US/docs/Web/API/Window/close
score: 0
type: Answer

http://stackoverflow.com/a/29556569
has comment: http://stackoverflow.com/comment/47272804
downvote count: 0
has comment: http://stackoverflow.com/comment/47266905
has body: You can set the styles in CSS and add a class and target the sibling using + $(document).ready(function() { $("span").click(function() { $("span").removeClass('clicked'); $(this).addClass('clicked') }); }); div, span { display: block; width: 80px; height: 80px; margin: 5px; background: #bfa; float: left; font-size: 14px; } div#small { width: 60px; height: 25px; font-size: 12px; background: #fab; } .clicked + div { border: 3px groove blue } span#prev div sibling span#prev div sibling
answers question: http://stackoverflow.com/q/29556399
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/47268049
score: 2

http://stackoverflow.com/comment/47495256
has text: Thanks, a lot, this has taken me so much time, and it was so simple :)
comment on: http://stackoverflow.com/a/29675673
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47227216
type: Comment
comment on: http://stackoverflow.com/a/29537371
has text: No problem. As a side note I'm pretty sure you have to put the css property `left` in double or single quotes inside the `ng-style`. At least that's the way I've always seen it written.
type: AnswerComment
score: 0

http://stackoverflow.com/q/29569596
score: 0
has body: If I look at the network log of the websockets, the socket.io client connects to an URL like this: ws://domain:port/socket.io/1/websocket/SESSION_ID But how is the SESSION_ID generated by the client, at the end of the URL?
answer count: 1
tagged with: websocket
accepted answer: http://stackoverflow.com/a/29569910
type: AnsweredQuestion
has title: How are socket.io session ids generated?
tagged with: socket.io
type: Question
has answer: http://stackoverflow.com/a/29569910
tagged with: javascript

http://stackoverflow.com/comment/47281759
has text: Any chance you could get the data as json rather than xml. It would make your task much easier.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29565422
type: Comment

http://stackoverflow.com/comment/47618317
comment on: http://stackoverflow.com/a/29653156
type: Comment
has text: Just wanted to say thanks for your correct and full answer ; ) @squeamish
type: AnswerComment
score: 0

http://stackoverflow.com/a/29613546
has comment: http://stackoverflow.com/comment/47427405
type: Answer
accepted answer of: http://stackoverflow.com/q/29581028
score: 4
has body: Uh, I'm sure that I explained this thoroughly in some question, but I can't find it, so here goes another explanation :D. There are two important facts that one must understand before trying to edit non-HTML tags in CKEditor: CKEditor is an HTML editor. Of course custom tags start to be more and more popular in HTML. You can also say that XML is some kind of generalisation of HTML (although not precisely, because it has other rules), so if CKEditor handles HTML why doesn't it handle other tags equally well. Well - the answer is simple - because HTML tags have a meaning and CKEditor knows it. But it does not know meaning of your custom tags. And the meaning of tags (what a list is, that it has items, that they are block elements, etc.) is crucial to implement editing algorithms. Fair enough, you could say. But why wasn't CKEditor's configuration (e.g. the CKEDITOR.dtd object) generalised so meaning of every possible tag can be configured? Because every generalisation increases complexity and HTML editing is already complex enough. So why does the CKEDITOR.dtd object exist at all? Because some components of CKEditor are configurable to some extent. The DTD has the biggest impact on CKEditor's HTML parser (which is used mostly during data processing) so this is the most configurable component. Other algorithms, like the enter key handling, backspace/delete, lists editing (which is a very complex task) are only slightly configurable and there is no guarantee given that they will work with your custom tags. The editing happens in the browsers and is partially handled by the browsers. This fact is important because it means that browsers' capabilities are affecting CKEditor's limits too. Browser must be able to parse and render your tags (fortunately, this part works rather well in modern browsers - IE8 is the last one with a huge problems) and must be able to edit it. This means - render caret, handle selection, handle backspace, enter, etc. Since browsers are not easily…
answers question: http://stackoverflow.com/q/29581028
has comment: http://stackoverflow.com/comment/48068999
has comment: http://stackoverflow.com/comment/47431042
upvote count: 4
type: AcceptedAnswer
downvote count: 0

safari
tags question: http://stackoverflow.com/q/29578187
tags question: http://stackoverflow.com/q/29669816
tags question: http://stackoverflow.com/q/29565714
tags question: http://stackoverflow.com/q/29566730
tags question: http://stackoverflow.com/q/29539126
tags question: http://stackoverflow.com/q/29567008
tags question: http://stackoverflow.com/q/29535943
type: Tag
tags question: http://stackoverflow.com/q/29626471
tags question: http://stackoverflow.com/q/29647971
tags question: http://stackoverflow.com/q/29648447
tag name: safari

http://stackoverflow.com/comment/47223902
comment on: http://stackoverflow.com/q/29535200
score: 0
type: Comment
type: QuestionComment
has text: @Satpal : yes.it's jQueryMobile and I use your line but nothing change

http://stackoverflow.com/comment/47321617
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29586989
has text: see, Employee does not have CorelationId, neither Department. That has been created on the fly.

http://stackoverflow.com/q/29657953
favorite count: 0
has comment: http://stackoverflow.com/comment/47455583
has comment: http://stackoverflow.com/comment/47455814
has answer: http://stackoverflow.com/a/29658014
has body: SCENARIO: I am taking over management of a website where the former web developer has unfortunately spread out many relevant functions over many long JS files. It is hard for me to find where an inline CSS style is coming from in the JS or what function is applying this style directly to the element. QUESTION: Is there a method of reverse engineering an element's inline styles to see where they are coming from?
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47455672
tagged with: css
type: AnsweredQuestion
has title: Finding Javascript-Applied Inline Styles to Debug Javascript
has comment: http://stackoverflow.com/comment/47455593
type: Question
accepted answer: http://stackoverflow.com/a/29658014
tagged with: debugging
upvote count: 20
has comment: http://stackoverflow.com/comment/47455550
tagged with: google-chrome-devtools
score: 20
has comment: http://stackoverflow.com/comment/47455555
has comment: http://stackoverflow.com/comment/47455584
answer count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/47440470
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29618802
has text: If you don't know what you are talking about, then please don't post. I have debugged PHP using NetBeans, CodeLobster and PHPstorm. Yes, you can debug PHP and I would recommend you to look into it. It will make you a far more productive developer.

http://stackoverflow.com/q/29653318
has body: So this is a question following on from the awesome work @Drakes has done on this question previously: Highlighting words with Javascript, what am I missing?. The solution is to highlight words by finding "#cat" or "#dog" and replacing them with #CAT or #DOG Then we can control the background colour of the span tag with CSS. This works perfectly, however the background colour only remains for a brief moment before disappearing. Upon a closer look, it seems the span tags are applied correctly and then removed again suddenly. Here is the actual working example for you to have a look at, plus log in details to run any tests and to view the chat. [Removed, no longer exists] Below is the updated code from the previous question that is currently running on the working example. Once again, any further help is hugely appreciated. Please let me know if you require any additional information! Javascript: // NOTE: I needed to define these variables to make the demo work var ajaxurl = "http://ip.jsontest.com/"; var chatroom_slug = "1"; var last_update_id = "1"; var last_update_received = 0; function chatroom_check_updates() { jQuery.post( ajaxurl, { action: 'check_updates', chatroom_slug: chatroom_slug, last_update_id: last_update_id }, function (response) { // NOTE: the response is bad, an exception will be thrown, not NULL chats = null; try { chats = jQuery.parseJSON( response ); } catch(e) {} // NOTE: In this test, I don't know your URL, so I just commented out the bit below if (1 || chats !== null ) { for ( i = 0; i < chats.length; i++ ) { if ( jQuery('div.chat-container div.chat-message-'+chats[i].id).length ) continue; jQuery('div.chat-container').html( jQuery('div.chat-container').html() + chatroom_strip_slashes(chats[i].html) ); last_update_id = chats[i].id; jQuery('div.chat-container').animate({ scrollTop: jQuery('div.chat-container')[0].scrollHeight - jQuery('div.chat-container').height() }, 100); } jQuery('.chat').each(function(){ var hashtag = jQuery(this).text() .r…
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
favorite count: 0
linked to: http://stackoverflow.com/q/29616790
upvote count: 1
tagged with: php
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29653520
score: 1
accepted answer: http://stackoverflow.com/a/29653520
type: Question
tagged with: javascript
tagged with: jquery
has title: Highlighting words in Javascript - Why won't they stay highlighted after the page fully loads?

http://stackoverflow.com/a/29542478
score: 0
type: Answer
has body: After the animation has finished playing, you can run a script that would redirect the user to another page: window.location.href = 'your_page.html';
answers question: http://stackoverflow.com/q/29542204

http://stackoverflow.com/a/29583555
score: 0
answers question: http://stackoverflow.com/q/29581794
type: Answer
has body: If you really need specific labels, you should mention them in .tickValues([...]) method. var xAxis = d3.svg.axis() .scale(x) .orient('bottom') .ticks(tickTime, tickSkips) .tickFormat(d3.time.format('%a %d')) .tickSize(0) .tickPadding(10) .tickValues([new Date('2015-4-6'), new Date('2015-4-9'), new Date('2015-4-12')]);

tail-call-optimization
tags question: http://stackoverflow.com/q/29652586
tag name: tail-call-optimization
type: Tag

http://stackoverflow.com/comment/113335939
type: Comment
type: QuestionComment
has text: No, I don't want to use any extensions, because my target is writing something like this. Sorry for my English
score: 0
comment on: http://stackoverflow.com/q/29639448

http://stackoverflow.com/a/67449531
upvote count: 9
has body: This year is 2021, it is possible to post a runnable code that not only answers the question, but also demonstrates all the steps that lead to the coordinate transformation results. function utmzone_from_lon(lon_deg) { //get utm-zone from longitude degrees return parseInt(((lon_deg+180)/6)%60)+1; } function proj4_setdef(lon_deg) { //get UTM projection definition from longitude const utm_zone = utmzone_from_lon(lon_deg); const zdef = `+proj=utm +zone=${utm_zone} +datum=WGS84 +units=m +no_defs`; return zdef; } // computation test let lon_input = 95.99; let lat_input = 15.15; console.log("Input (long,lat):", lon_input, lat_input); const azone = utmzone_from_lon(lon_input); console.log(`UTM zone from longitude: ${azone}`); console.log("AUTO projection definition:", proj4_setdef(lon_input)); // define proj4_defs for easy uses // "EPSG:4326" for long/lat degrees, no projection // "EPSG:AUTO" for UTM 'auto zone' projection proj4.defs([ [ "EPSG:4326", "+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees" ], ["EPSG:AUTO", proj4_setdef(lon_input)]]); // usage: // conversion from (long/lat) to UTM (E/N) const en_m = proj4("EPSG:4326", "EPSG:AUTO", [lon_input, lat_input]); const e4digits = en_m[0].toFixed(4); //easting const n4digits = en_m[1].toFixed(4); //northing console.log(`Zone ${azone}, (E,N) m: ${e4digits}, ${n4digits}`); // inversion from (E,N) to (long,lat) const lonlat_chk = proj4("EPSG:AUTO", "EPSG:4326", en_m); console.log("Inverse check:", lonlat_chk); &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.6.2/proj4.js"&gt;&lt;/script&gt;
answers question: http://stackoverflow.com/q/29655256
downvote count: 0
score: 9
type: Answer

http://stackoverflow.com/q/29625643
has body: i have 2 arrays these arrays hold object values in them: -VariantArry which has 26 arrays in there. -ProductArray which has 6 arrays in there Now each have a id which will match so for example ProductArray[1].Id = 10029 now this be able to match within the VariantArray so for example within the VariantArray there is something in there called VariantArray[1].Product.Id. Now if they match i want to push it in a array having the ProductArray and VariantArray in there. Now that all works fine my problem is i end up with a array length of 23.. i want all the ids which match to be in the same array so i should end up with 6 arrays all having all the variants which match the product ID.. at the moment its creating a new array for each. i.e NewArray[1].Product (holds my product data) NewArray[1].Variant[6] (holds all my variants in another array) Javascript code: var NewArray = []; var p; var va; for (va = 0; va &lt; VariantArray.length; va++) { for (p = 0; p &lt; ProductArray.length; p++) { if (ProductArray[p].Id == VariantArray[va].Product.Id) { NewArray.push({ Product: ProductArray[p], Variants: VariantArray[va] }); } } } Any help in a better way for this to work properly? Thanks Dom
has comment: http://stackoverflow.com/comment/47394725
type: Question
has comment: http://stackoverflow.com/comment/47394890
score: 0
has answer: http://stackoverflow.com/a/29626109
tagged with: arrays
has answer: http://stackoverflow.com/a/29627366
tagged with: javascript
tagged with: jquery
answer count: 3
has comment: http://stackoverflow.com/comment/47394542
has title: for loop in a for loop not applying properly
has answer: http://stackoverflow.com/a/29625709
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47394461

http://stackoverflow.com/a/29616402
has comment: http://stackoverflow.com/comment/50765136
has comment: http://stackoverflow.com/comment/47411909
has body: A provider is a factory that instantiates a service via its $get method. Providers are used to configure a service before the application gets going by being available in a module's config phase. A service is simply an injected singleton. You can define a service by: Calling myModule.service('serviceName', ServiceConstructor), where ServiceConstructor is a constructor you would normally use new with. Calling myModule.factory('serviceName', factoryFunction), where factoryFunction is a function that returns the service instance. Calling myModule.value('serviceName', serviceInstance), where serviceInstance is the actual thing that will be injected Calling myModule.provider('serviceName', serviceProvider), where serviceProvider is some object with a $get method that returns the service instance.
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29616170
type: Answer
upvote count: 1

http://stackoverflow.com/comment/47309580
type: Comment
has text: @torazaburo didn't know that you can do this way. always learning something new.
type: AnswerComment
comment on: http://stackoverflow.com/a/29579468
score: 0

http://stackoverflow.com/a/29688266
answers question: http://stackoverflow.com/q/29687794
score: 0
type: Answer
has body: Try window.onerror = function(e) { console.log(e) } $(function() { function foo() { console.log("bar"); } (function _foo() { return $(this).queue("foo", [function(next) { foo(); return next()}, _foo]) }).call(this); }); Call foo

http://stackoverflow.com/a/29636885
score: 1
has comment: http://stackoverflow.com/comment/47416025
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/29636817
type: Answer

http://stackoverflow.com/comment/47315722
has text: There's no response, just a blank page when I refresh the page
type: Comment
comment on: http://stackoverflow.com/a/29576530
score: 0
type: AnswerComment

http://stackoverflow.com/a/29658297
answers question: http://stackoverflow.com/q/29646879
downvote count: 0
type: Answer
upvote count: 1
score: 1
has body: I think you should use infobox.content_.style.cssText to set the new style instead. As it is shown in line 44 of this jsfiddle.

http://stackoverflow.com/comment/47239777
comment on: http://stackoverflow.com/q/29543820
score: 0
type: Comment
has text: At what point and how does `app.js` get executed? How does it related to `index.html`?
type: QuestionComment

http://stackoverflow.com/a/50696424
answers question: http://stackoverflow.com/q/29625037
downvote count: 0
upvote count: 2
has body: If you want only one row this could work https://codepen.io/balvin/pen/gKrXdM but if you want to wrap them you could use https://codepen.io/balvin/pen/wXGyYw Seems that it's a hack, but setting width:0;flex-grow:1 it's the solution, but in order to wrap the elements, you need to explicity tell width to the browser, because it does not know at which width you want the elemements to wrap, and with that in mind you just play with setTimeout. Check the codes
type: Answer
score: 2

http://stackoverflow.com/a/29536102
type: Answer
has body: If you don't mind changing "addEventListener" to "onInput = function" then check this link $("#slider").slider({ min: 0, max: 100, slide: function(event, ui) { currentValue.html(ui.value); htmlRange.val(ui.value); htmlRange[0].onInput(); } }); .... rangeInputRaw.onInput = function(event) { console.log("change"); rangeInputOutput.innerHTML = this.value; };
score: 3
upvote count: 3
downvote count: 0
answers question: http://stackoverflow.com/q/29535467
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29535467

http://stackoverflow.com/comment/47407044
comment on: http://stackoverflow.com/a/29632064
has text: Ah yes I got this working now thanks! I have no idea how to implement @SLaks answer :( it's just the CSS part and I already have that, it's the JavaScript part I was missing... also I needed to add !important `.clearNone { clear: none !important; }`
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47500603
score: 0
type: QuestionComment
type: Comment
has text: Can you post what you've tried so far and what's not working in your attempts?
comment on: http://stackoverflow.com/q/29681763

http://stackoverflow.com/q/29599353
answer count: 2
downvote count: 2
has comment: http://stackoverflow.com/comment/47345036
upvote count: 1
has body: This is what I am trying to do, // declare an array with 16 items, each with intial value = 0 var countMe = [ ["00", 0], ["01", 0], ["02", 0], ["03", 0], ["10", 0], ["11", 0], ["12", 0], ["13", 0], ["20", 0], ["21", 0], ["22", 0], ["23", 0], ["30", 0], ["31", 0], ["32", 0], ["33", 0] ]; // calculate number of items for each array item by adding +1 to its previous value $.each(dataFruits, function (index, item) { if (item.weight &gt; -1 &amp;&amp; item.quantity &gt; -1) { countMe["" + item.weight + item.quantity, 1][1] = countMe["" + item.weight + item.quantity, 1][1] + 1; } }); // go through array and call method for each array item whose value is more then zero for (var i = 0; i &lt; 3; i++) { for (var j = 0; j &lt; 3; j++) { if (countMe["" + i + j, 1][1] &gt; 0) { CreateText(countMe["" + i + j, 1][1], "black", 33, countMe["" + i + j, 0][0]); } } } Issues I am not able to get value of array I am able to update its value It doesn't throw any errors, just doesn't give me any value.
has answer: http://stackoverflow.com/a/29599436
accepted answer: http://stackoverflow.com/a/29599436
favorite count: 0
has title: Array having issues in JS
possible better answer: http://stackoverflow.com/a/29599443
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47345032
type: Question
tagged with: arrays
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/29599443
has comment: http://stackoverflow.com/comment/47345006

http://stackoverflow.com/a/29617420
has comment: http://stackoverflow.com/comment/47379933
has body: You are talking about mobile devices. Are you maybe trying this code in a mobile or a simulator?? You said the code works when resizing the screen manually. If you refer to the resize event on mobiles, maybe it will not work if you dont look at the orientation change event. Check if this answer helps you
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29617177
has comment: http://stackoverflow.com/comment/47379882

http://stackoverflow.com/a/29632878
has body: So I figured this out. I didn't see that the json file I'm using is in a different format from the one that is supplied with the example. After playing around a bit in the dev console I figured out I had to edit the processData function to the following: function processData(data) { var obj = data.facet_counts.facet_pivot["category_level0,category_level1,category_level2,category_level3"]; var newDataSet = []; for(var prop in obj) { newDataSet.push({name: obj[prop].value, className: obj[prop].value.toLowerCase(), size: obj[prop].count}); } return {children: newDataSet}; }
accepted answer of: http://stackoverflow.com/q/29610765
score: 0
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/29610765

http://stackoverflow.com/q/29564555
has answer: http://stackoverflow.com/a/29599472
has title: Watching function return from service not working but a scope function works
tagged with: angularjs-scope
type: Question
upvote count: 0
score: -2
tagged with: javascript
has comment: http://stackoverflow.com/comment/47278989
accepted answer: http://stackoverflow.com/a/29599472
answer count: 1
has body: i have a problem with a service function. If i use a function in a view through a service it wouldnt updated if the return changes. But if i use a function which is declared in controller it works. Why? First example, not working, service function: https://jsfiddle.net/xrzr457v/ var myApp = angular.module('myApp', []), test = null; myApp.factory('myService', function() { return { checkLoggedIn: function() { return test == null; } } }); function MyCtrl($scope, myService) { $scope.name = 'Superhero'; $scope.service = myService; $scope.LoginTxt = 'Login'; $scope.login = function() { $scope.LoginTxt = 'You should be logged in and the texts should be moved!'; test = true; }; } Second example, working, controller function: https://jsfiddle.net/t3nyejLy/ var myApp = angular.module('myApp', []), test = null; function MyCtrl($scope) { $scope.name = 'Superhero'; $scope.checkLoggedIn = function() { return test == null; }; $scope.LoginTxt = 'Login'; $scope.login = function() { $scope.LoginTxt = 'You should be logged out and the texts should be moved!'; test = true; }; } Thanks for any idea!
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47345049
downvote count: 2
type: AnsweredQuestion

http://stackoverflow.com/q/29638666
tagged with: userscripts
tagged with: javascript
has comment: http://stackoverflow.com/comment/47419607
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47419710
has body: I am fairly new with javascript and I need a script to obtain the value of an input text and check that value if it is equal to 0 (zero). If it does then I need an alert message notifying me that the text input is 0. Thanks. &lt;input id="txtVal" type="text" name="txtVal" value="0" maxlength="10"&gt;
has answer: http://stackoverflow.com/a/29638859
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29638859
downvote count: 3
upvote count: 1
has title: Obtain and check the value of an input text with javascript
has comment: http://stackoverflow.com/comment/47419504
type: Question
has comment: http://stackoverflow.com/comment/47419473
score: -2

http://stackoverflow.com/comment/47336220
has text: "reuploading all the medias again": No, web browsers are smart enough and would just reload the HTML content.
comment on: http://stackoverflow.com/q/29594585
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47397367
has text: I get this Notice: Undefined variable: vrm in C:\xampp\htdocs\vrmlookup.php on line 22 An error has occurred.
type: AnswerComment
comment on: http://stackoverflow.com/a/29626917
score: 0
type: Comment

http://stackoverflow.com/comment/47271388
has text: @DanPaull, maybe. I think the issue might be there. When you load the file do you use a relative path (i.e.: ./filename.html) or do you use its local path (c:/mydir/filename.html)?
type: Comment
comment on: http://stackoverflow.com/q/29559482
score: 1
type: QuestionComment

http://stackoverflow.com/q/29672517
downvote count: 2
has title: how to remove specifc key(;) word from string inside div
type: Question
tagged with: c#
accepted answer: http://stackoverflow.com/a/29672694
score: -2
tagged with: javascript
answer count: 3
has comment: http://stackoverflow.com/comment/47482874
has comment: http://stackoverflow.com/comment/47483569
upvote count: 0
has body: &lt;p&gt;hello how are u&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;div class="fbphotobox"&gt;&lt;img id="img__kw_field_id" fbphotobox-src=" Uploads/Images/OriginalImages/developer_635647972105434266.jpg;" src="Uploads/Images/ResizedImages/developer_635647972105434266.jpg" alt="" /&gt;&lt;/div&gt; This is my string i need to remove the ; from .fbphotobox src i am trying filter() but I am not getting this in my code var text = $("#&lt;%=hdnDescription.ClientID%&gt;").val(); var found = text.filter(".fbphotobox");
has answer: http://stackoverflow.com/a/29672593
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47482718
has answer: http://stackoverflow.com/a/29672694
possible better answer: http://stackoverflow.com/a/29672593
has answer: http://stackoverflow.com/a/29672599
has comment: http://stackoverflow.com/comment/47482952
type: AnsweredQuestion

http://stackoverflow.com/q/29602561
type: Question
has body: I am trying to render a model under multiple light sources using multiple drawElement calls with different light sources. The gist of the code is as follows. this.setUniform("u_matrix", "Matrix4fv", false, matrix); this.setUniform("u_nMatrix", "Matrix3fv", false, nMatrix); this.setUniform("u_kSpecular", "3fv", material.specular); this.setUniform("u_kDiffuse", "3fv", material.diffuse); this.setUniform("u_kAmbient", "3fv", material.ambient); this.setUniform("u_shininess", "1f", material.shininess); this.setVertexAttribArray("a_position", new Float32Array(mesh.vertices), 3); this.setVertexAttribArray("a_normal", new Float32Array(mesh.vertexNormals), 3); this.setElementArray(new Uint16Array(mesh.indices)); for(var i = 0;i &lt; lights.length;i++) { if(i == 1) { gl.enable(gl.BLEND); gl.blendFunc(gl.ONE, gl.ONE); gl.blendEquation(gl.FUNC_ADD); } var light = lights[i]; console.dir(light); this.setUniform("u_lightType", "1i", light.type); this.setUniform("u_lightVector", "3fv", light.vector); this.setUniform("u_lightColor", "3fv", light.color); gl.drawElements(gl.TRIANGLES, mesh.indices.length, gl.UNSIGNED_SHORT, 0); } gl.disable(gl.BLEND); The issue here is that only the first lighting is rendered. Subsequent drawElements do not render anything. I do not think the issue is with my shader code, because the issue persists even if I strip the shader down to just set fragment color equal to the light type or some such parameter. setUniform setVertexAttribArray and setElementArray are some helpers that i have written. They basically look like this: setElementArray: function(array) { var gl = this.gl; var buffer = this._arrBuffers.__indexBuffer; if(_.isUndefined(buffer)) { buffer = gl.createBuffer(); this._arrBuffers.__indexBuffer = buffer; } gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffer); gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, array, gl.STATIC_DRAW); } setVertexAttribArray: function(name, array, size, type, normalized, stride, offset) { var gl = this.gl; size = size || 2; type =…
tagged with: graphics
has title: Only first call works in multiple drawElements calls with same vertex buffers
has comment: http://stackoverflow.com/comment/47405781
tagged with: javascript
tagged with: webgl
upvote count: 1
tagged with: 3d
answer count: 1
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47582631
has answer: http://stackoverflow.com/a/29608764
downvote count: 0
tagged with: shader
score: 1

http://stackoverflow.com/comment/137725787
has text: Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. 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/78121732
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29558071
tagged with: internationalization
tagged with: tostring
has comment: http://stackoverflow.com/comment/47266630
type: AnsweredQuestion
tagged with: culture
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/29561120
has comment: http://stackoverflow.com/comment/47267058
type: Question
has comment: http://stackoverflow.com/comment/47267592
tagged with: javascript
has comment: http://stackoverflow.com/comment/47267683
has comment: http://stackoverflow.com/comment/47267048
has comment: http://stackoverflow.com/comment/47266396
has comment: http://stackoverflow.com/comment/47266360
upvote count: 1
has body: in my ASP.NET MVC project, I need to make the JavaScript implicite string representation to be current culture aware, in particular with decimal separators. For example: var nbr = 12.25; console.log(nbr); Here, the console.log(nbr) must display "12.25" in EN-US and "12,25" in fr-FR, without having to explicitly call the toString() method. Does anyone know a way to accomplish this please?
has comment: http://stackoverflow.com/comment/47267360
has title: How to make Javascript "toString" implicite method culture aware
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/47268282
linked to: http://stackoverflow.com/q/12004808
accepted answer: http://stackoverflow.com/a/29561120

http://stackoverflow.com/a/29658085
has comment: http://stackoverflow.com/comment/47456471
has comment: http://stackoverflow.com/comment/47456372
answers question: http://stackoverflow.com/q/29657937
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/47456805
score: 1
has comment: http://stackoverflow.com/comment/47456279
has body: You need to use ^ (Start anchor) to match the first word and simply use \w+ to match the word also i think you don't need the main group : "([^"]*)"|(^\w+) Demo
has comment: http://stackoverflow.com/comment/47456695
upvote count: 1

http://stackoverflow.com/q/29608153
answer count: 1
tagged with: jquery
tagged with: ajax
has answer: http://stackoverflow.com/a/29608378
tagged with: django
type: AnsweredQuestion
has body: After ajax added new containers it killed methods initialized for them, what can I do to make django-endless-pagination add some JQuery to its generated containers? For example i have: $(".fact").each(function() { $(this).css('border-top', '5px solid ' + colors[Math.floor(Math.random() * colors.length)]); }); and i want to add this to each .fact generated after ajax call.
type: Question
accepted answer: http://stackoverflow.com/a/29608378
tagged with: javascript
has title: How to get killed methods back in django-endless-pagination?
score: 0
tagged with: django-endless-pagination

http://stackoverflow.com/a/29615341
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29608551
has body: are you trying this on protractor 2.0 because I got a similar issue and the resolve for this issue was below. I do not know why it worked for me but it did. var firstName = element(by.css('#cust04')); firstName.click().clear().sendKeys('John'); expect(firstName.getAttribute("value")).toEqual("John"); if you have issues with the expect happening before the text gets entered then you can do this before the expect. I've only had a few instances where I've had to do the extra wait before the expect. var usernameHasText = EC.textToBePresentInElementValue(firstName, 'John'); browser.wait(usernameHasText, 5000, "Failed to type in the username");
score: 2
upvote count: 2

http://stackoverflow.com/comment/47428076
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29642032
score: 0
has text: Thanks Álvaro, that really helped! And thanks for the tip @powerbuoy, I'm going to create fadeIn and fadeOut classes and just add them to the class list instead of altering styling within the JS.

http://stackoverflow.com/comment/47503914
comment on: http://stackoverflow.com/q/29683446
type: Comment
type: QuestionComment
has text: @Banana it is okey.code is working but it is working on current tab of browser,I want it open the link on a blank page
score: 0

http://stackoverflow.com/comment/47343869
score: 0
type: Comment
type: QuestionComment
has text: There was bug in rest code, but now it is fixed.
comment on: http://stackoverflow.com/q/29598582

http://stackoverflow.com/q/29533414
tagged with: jsdoc
has comment: http://stackoverflow.com/comment/47220544
has answer: http://stackoverflow.com/a/29533876
accepted answer: http://stackoverflow.com/a/29533876
downvote count: 2
has comment: http://stackoverflow.com/comment/47219950
has comment: http://stackoverflow.com/comment/47219959
type: AnsweredQuestion
tagged with: naming-conventions
has body: According to Google's JavaScript style guide, classes should begin with a capital letter. However JSDoc supports the use of the @static tag, which asserts that you don't need to instantiate the class to use a member. I have a class/module that is entirely comprised of static functions and properties. Should it be named namespaceBar.MyFooClass, or namespaceBar.myFooClass?
score: -1
has comment: http://stackoverflow.com/comment/47234924
type: Question
answer count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/47219921
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29536437
favorite count: 0
has comment: http://stackoverflow.com/comment/47233362
has title: JavaScript naming convention for a "static" class, or module?
has comment: http://stackoverflow.com/comment/47219860
has comment: http://stackoverflow.com/comment/47220507
has comment: http://stackoverflow.com/comment/47220554
has answer: http://stackoverflow.com/a/29536437
tagged with: coding-style
has comment: http://stackoverflow.com/comment/47220216

http://stackoverflow.com/a/29566317
score: 0
type: Answer
has body: try this: var counter = 1; var limit = 65; function addInput(divName){ if (counter == limit) { alert("You have reached the limit of adding " + counter + " inputs"); } else { var newdiv = document.createElement('div'); newdiv.innerHTML = "Nimi " + (counter + 1) + " Remove "; document.getElementById(divName).appendChild(newdiv); counter++; } } function removeInput(){ event.target.parentNode.parentNode.removeChild(event.target.parentNode); counter--; }
answers question: http://stackoverflow.com/q/29566020

http://stackoverflow.com/comment/47440006
score: 1
comment on: http://stackoverflow.com/q/29647440
has text: @ Redai made some changes [demo](http://jsfiddle.net/u7dqe4ak/)
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47238588
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29543303
has text: @Moogs, i don't know how to place it in a single HTML file.
score: 0

http://stackoverflow.com/comment/47363190
has text: It is plain javascript.
comment on: http://stackoverflow.com/q/29608168
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/47386126
type: QuestionComment
has text: I know what it was now. The browser I tested on had a extension installed to remove things like facebook...
score: 1
comment on: http://stackoverflow.com/q/29536081
type: Comment

http://stackoverflow.com/comment/47452776
type: Comment
score: 2
has text: Furthermore, when you `return` from a production rule then parsing stops. Hence, you should only return when you encounter the end of file. Otherwise you should assign to the special variable `$$` instead.
comment on: http://stackoverflow.com/q/29655780
type: QuestionComment

http://stackoverflow.com/q/29624801
answer count: 1
tagged with: javascript
has body: I'm building an app using the ionic framework (which is built on top of Cordova) and I now want to catch the deviceready event. Around the internet I've found various methods of doing this. I've tried the following three ways: document.addEventListener('deviceready', function () {console.log('IT IS READY!');}); $ionicPlatform.ready(function () {console.log('IT IS READY!');}); window.ionic.Platform.ready(function() {console.log('IT IS READY!');}); but none of these work. I surrounded these lines with log statements, and all code before AND after it is executed, so it doesn't halt there. I'm trying this on a physical Android device (haven't tried iOS yet). I don't get any error messages. The only possibly relevant log I get in my terminal is one referring to the keyboard which cannot be read: I/chromium(25678): [INFO:CONSOLE(20)] "Uncaught TypeError: Cannot read property 'Keyboard' of undefined", source: file:///android_asset/www/js/app.js (20) Does anybody know why this doesn't work and how I can solve it? All tips are welcome!
type: UnansweredQuestion
tagged with: android
tagged with: cordova
has answer: http://stackoverflow.com/a/31877494
type: Question
linked to: http://stackoverflow.com/q/27300583
linked to: http://stackoverflow.com/q/22081180
tagged with: ionic-framework
linked to: http://stackoverflow.com/q/21556090
score: 0
has title: How to get deviceready event in Cordova/ionic?

http://stackoverflow.com/q/29594524
score: 1
answer count: 2
has comment: http://stackoverflow.com/comment/47336489
has answer: http://stackoverflow.com/a/29594864
downvote count: 0
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/29609672
has title: Pause Bootstrap Carousel when playing Vimeo video
linked to: http://stackoverflow.com/q/2381336
favorite count: 0
has comment: http://stackoverflow.com/comment/47336413
has answer: http://stackoverflow.com/a/29609672
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I have a simple Bootstrap Carousel which includes a video. Here is my Demo: http://jsfiddle.net/Q2TYv/2053/ Is it possible I can pause the slider when I click 'Play' on the video? Currently when I click Play it still autoplays through the rest of the carousel items.** Thanks for any advice. // invoke the carousel $('#myCarousel').carousel({ interval: 3000 }); /* SLIDE ON CLICK */ $('.carousel-linked-nav &gt; li &gt; a').click(function() { // grab href, remove pound sign, convert to number var item = Number($(this).attr('href').substring(1)); // slide to number -1 (account for zero indexing) $('#myCarousel').carousel(item - 1); // remove current active class $('.carousel-linked-nav .active').removeClass('active'); // add active class to just clicked on item $(this).parent().addClass('active'); // don't follow the link return false; }); /* AUTOPLAY NAV HIGHLIGHT */ // bind 'slid' function $('#myCarousel').bind('slid', function() { // remove active class $('.carousel-linked-nav .active').removeClass('active'); // get index of currently active item var idx = $('#myCarousel .item.active').index(); // select currently active item and add active class $('.carousel-linked-nav li:eq(' + idx + ')').addClass('active'); }); @import url('//netdna.bootstrapcdn.com/twitter-bootstrap/2.0.4/css/bootstrap-combined.min.css'); #myCarousel { margin-top: 40px; } .carousel-linked-nav, .item img { display: block; margin: 0 auto; } .carousel-linked-nav { width: 120px; margin-bottom: 20px; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.0.4/js/bootstrap.min.js"&gt;&lt;/script&gt; &lt;div id="myCarousel" class="carousel slide"&gt; &lt;!-- Carousel items --&gt; &lt;div class="carousel-inner"&gt; &lt;div class="active item"&gt; &lt;img src="http://placehold.it/300x200/444&amp;text=Item 1" /&gt; &lt;/div&gt; &lt;div class="item"&gt; &lt;iframe src="https://player.vimeo.com/vi…
has comment: http://stackoverflow.com/comment/47336653
accepted answer: http://stackoverflow.com/a/29594864
tagged with: twitter-bootstrap
upvote count: 1
type: Question
type: AnsweredQuestion

http://stackoverflow.com/a/29672695
has body: In your case you need to consider Java Servlet technology. You will need to have a servlet on the server (servlet-container), and an HTML page, with JavaScript code, that makes a GET request with parameters to this servlet. Note, that you need to encode the search string, before passing it to the server. This servlet receives request from the client (HTML page), does the search, and prints results to the output stream. Your JavaScript code receives server response and modifies HTML page to show the search results. To implement client/server interaction via asynchronous requests (AJAX) consider jQuery. Here is an example, how to make a GET request to the server: https://api.jquery.com/jquery.get/ plain sample: $.get( "ajax/test.html", function( data ) { $( ".result" ).html( data ); alert( "Load was performed." ); }); And there is an example, how to read GET request params in the servlet: protected void doGet( HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String param1 = request.getParameter("param1"); String param2 = request.getParameter("param2"); }
score: 0
answers question: http://stackoverflow.com/q/29672299
type: Answer

http://stackoverflow.com/comment/47289420
has text: @charlietfl By this way I can store each additional with their name, price and quantity in the SESSION array and then display each of them in the cart page?
comment on: http://stackoverflow.com/q/29569739
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47218271
type: QuestionComment
has text: So basically if the second field is pristine, it should display the value of the first field?
score: 0
comment on: http://stackoverflow.com/q/29532539
type: Comment

http://stackoverflow.com/q/29630059
score: -1
has comment: http://stackoverflow.com/comment/47403386
upvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has body: I have a created a time capture view in MVC project. when ever the fields are filled and submit is clicked, it should send an email confirmation of the screen with the data filled or the summary of the data to the user's email address. How can i do it?
tagged with: c#-4.0
tagged with: asp.net-mvc-4
has title: Sending Email confirmation after in ASP.Net MVC
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29630782
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47403266

http://stackoverflow.com/comment/47380375
has text: @jsve to get the element object? Am i wrong?
comment on: http://stackoverflow.com/q/29617770
type: Comment
score: 1
type: QuestionComment

http://stackoverflow.com/a/29603003
has comment: http://stackoverflow.com/comment/53233430
score: 3
upvote count: 3
has body: Most likely you might have missed to include the controller js file (ex: ) in your layout page. If this is fine, then please double check if you have multiple ng-app in your html.
answers question: http://stackoverflow.com/q/29602797
downvote count: 0
type: Answer

http://stackoverflow.com/comment/47404445
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29630600
has text: @eithedog Hm... okay, JavaScript and PHP seem to handle this different. In PHP an empty array is false.

http://stackoverflow.com/q/29595040
has body: First off, I'm trying to create something like this using Angular.js: https://foursquare.com/explore?mode=url&amp;near=San%20Francisco%2C%20CA&amp;q=comedy In summary, here are the tools I've tried: Mapbox.js Leaflet.js Angular-Leaflet directive For each, I've attempted to create a directive that would manage a list of locations that is associated with a map displaying those locations such that, when the user hovers over a list item, a tooltip appears above the location's marker on the map, and when they hover atop the location's marker on the map, a tooltip appears above that marker. (If this isn't clear, just visit the link above.) Hyperlinks, image, etc. should be able to appear within the tooltip. None of the above seem to give me the map portion of this functionality straight out of the box. Also, in order to even get markers to appear on the map, I have to essentially break away from idiomatic Angular, since the markers are vector items that are generated via the Leaflet/Mapbox toolkit. Writing this code feels wrong. Yes, I'm able to see the marker, but I can't really associate them with anything in the DOM. I'm confused. I'm just at a loss for how to create a smart, interactive map that is associated with other elements on my page. Libraries like Angular-leaflet allow you to get a map on your page pretty easily, but customization is PAINFUL (or so it seems). Is Angular.js, in combination with any of the above three tools, the way to go? Is there something I'm simply failing to understand?
tagged with: mapbox
tagged with: angularjs
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/29834354
has answer: http://stackoverflow.com/a/29817925
tagged with: leaflet
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47804355
has comment: http://stackoverflow.com/comment/47804490
has comment: http://stackoverflow.com/comment/47337252
linked to: http://stackoverflow.com/q/13004226
tagged with: angular-leaflet-directive
type: Question
linked to: http://stackoverflow.com/q/9912145
tagged with: javascript
has comment: http://stackoverflow.com/comment/47337197
upvote count: 1
answer count: 1
has title: Create a smart, interactive map like the ones used on the FourSquare site
favorite count: 0

http://stackoverflow.com/comment/47336980
type: QuestionComment
has text: Perhaps you should show what you have tried
comment on: http://stackoverflow.com/q/29595025
score: 0
type: Comment

http://stackoverflow.com/q/29600192
upvote count: 4
has body: PreloadJS stuck at a specific step when loading files on Android devices while everything works fine on a desktop browser and iPhone. The loading process stopped at the final GIF file (as shown in the code). Why this GIF file could not be loaded? This happened before with desktop browser, but with no error, But at that time it was caused by some non-standard mp3 files. How to deal with this kind of exception when failed to load/init a file? Here is the code I used to load files. var preload = new createjs.LoadQueue(); createjs.Sound.alternateExtensions = ["ogg"]; preload.installPlugin(createjs.Sound) preload.installPlugin(createjs.SpriteSheet) preload.addEventListener("fileload", updateLoadingProcess); // show loading process showWelcomeText(); var resources = { change: "assets/sound/change.mp3", click: "assets/sound/click.mp3", collide: "assets/sound/collide.mp3", game_over: "assets/sound/gameover.mp3", reset: "assets/sound/reset.mp3", win: "assets/sound/win.mp3", interface_assets: "assets/interface.png", raining_serial: "assets/raining-serial.gif", background: "assets/background.jpg", text: "assets/text-" + LANG + ".gif", }; var loadedResource = 0; var manifest = []; for(var i in resources){ manifest.push({id: i, src: resources[i] + _VER_ }); //add version to update cache } preload.loadManifest(manifest); update I found that some Android devices stopped at another point, the first image(interface.png), and I really don't know why because these browsers don't have a developer tool. update The problem is solved by not using XHR for these image files, although I still don't know why. var preload = new createjs.LoadQueue(false); could make it work.
downvote count: 0
type: UnansweredQuestion
tagged with: android-browser
has answer: http://stackoverflow.com/a/29827837
score: 4
has title: `Preload.js` failed to load some files on Android devices
type: Question
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: createjs
tagged with: android
tagged with: preloadjs

http://stackoverflow.com/a/29991126
answers question: http://stackoverflow.com/q/29644310
downvote count: 0
has body: Angular is not going to like have model data modified by a third party plugin. My guess based on the fact that your using $timeout is there is a race condition between Angular updating the options or the model and the select2 plugin. The solution I came up with is to take the updating mostly out of Angular's hands and do it manually from the directive, that way you can ensure everything is matching no matter who is modifying. Here's the directive I came up with: app.directive("select2",function($timeout,$parse){ return { restrict: 'AC', link: function(scope, element, attrs) { var options = [], el = $(element), angularTriggeredChange = false, selectOptions = attrs["selectOptions"].split(" in "), property = selectOptions[0], optionsObject = selectOptions[1]; // watch for changes to the defining data model scope.$watch(optionsObject, function(n, o){ var data = []; // format the options for select2 data interface for(var i in n) { var obj = {id: i, text: n[i][property]}; data.push(obj); } el.select2({data: data}); // keep local copy of given options options = n; }, true); // watch for changes to the selection data model scope.$watch(attrs["selectSelection"], function(n, o) { // select2 is indexed by the array position, // so we iterate to find the right index for(var i in options) { if(options[i][property] === n) { angularTriggeredChange = true; el.val(i).trigger("change"); } } }, true); // Watch for changes to the select UI el.select2().on("change", function(e){ // if the user triggered the change, let angular know if(!angularTriggeredChange) { scope.$eval(attrs["selectSelection"]+"='"+options[e.target.value][property]+"'"); scope.$digest(); } // if angular triggered the change, then nothing to update angularTriggeredChange = false; }); } }; }); I've added to attributes select-options and select-model. These will be used to populate and update the data using select2's interface. Here is a sample html: Select Country Selected: {{client.primary_address.country}} Please n…
type: Answer
score: 3
upvote count: 3

http://stackoverflow.com/a/29640820
has body: The console tells you where your problem is: Uncaught TypeError: Cannot set property 'onchange' of undefined on line: formStyles.color.onchange=updatePreview; change to: formStyles.fontcolor.onchange=updatePreview; then we get: Uncaught TypeError: Cannot read property 'value' of undefined on line: previewobject.style.color=formStyles.color.value; change to: previewobject.style.color=formStyles.fontcolor.value; function updatePreview() { formStyles=document.forms[0]; inputtext=formStyles.sampletext.value; previewobject=document.getElementById("output"); previewobject.innerHTML=inputtext.replace(/\n/g," "); ffi=formStyles.fontfamily.selectedIndex; previewobject.style.fontFamily=formStyles.fontfamily.options[ffi].text; fsi=formStyles.fontstyle.selectedIndex; previewobject.style.fontStyle=formStyles.fontstyle.options[fsi].text; fwi=formStyles.fontweight.selectedIndex; previewobject.style.fontWeight=formStyles.fontweight.options[fwi].text; tdi=formStyles.textdecoration.selectedIndex; previewobject.style.textDecoration=formStyles.textdecoration.options[tdi].text; tti=formStyles.texttransform.selectedIndex; previewobject.style.textTransform=formStyles.texttransform.options[tti].text; fvi=formStyles.fontvariant.selectedIndex; previewobject.style.fontVariant=formStyles.fontvariant.options[fvi].text; previewobject.style.color=formStyles.fontcolor.value; previewobject.style.backgroundColor=formStyles.backgroundcolor.value; previewobject.style.fontSize=formStyles.fontsize.value + "px"; previewobject.style.letterSpacing=formStyles.letterspacing.value+"px"; previewobject.style.wordSpacing=formStyles.wordspacing.value+"px"; previewobject.style.lineHeight=formStyles.lineheight.value+"em"; previewobject.style.textIndent=formStyles.textindent.value+"px"; } window.onload=function() { formStyles=document.forms[0]; formStyles.fontfamily.onchange=updatePreview; formStyles.fontstyle.onchange=updatePreview; formStyles.fontweight.onchange=updatePreview; formStyles.textdecoration.onchange=up…
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29640373
answers question: http://stackoverflow.com/q/29640373
score: 1
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/q/29566482
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/29567546
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/49030473
score: 2
tagged with: jsf
downvote count: 0
tagged with: primefaces
has body: I have the following p:messages component: &lt;p:messages id="messageId" autoUpdate="true" closable="true" redisplay="false" /&gt; I need to show a message in it using jQuery like this: jQuery(#messageId).val("Error message"); Is this possible?
type: Question
upvote count: 2
has title: How to set a message to a p:messages component through jQuery?
answer count: 2

http://stackoverflow.com/a/29569952
type: AcceptedAnswer
downvote count: 1
answers question: http://stackoverflow.com/q/29569508
type: Answer
accepted answer of: http://stackoverflow.com/q/29569508
upvote count: 0
has body: You just need to make an array of unique items before your $.each(). This can be done many different ways. Here is one way to do it. Edit (11-24-2019) New Zealand //New Zealand is selected option No it's not. The markup does not show the selected attribute on the option. It might have appeared to be selected because it was the first entry in the list and no option elements were selected. Perhaps you want "New Zealand" to show up after "India". You either place the option in that order, mark it selected, and it will be displayed in the select while appearing in the list after "India", OR you can allow nothing to be selected and insert the "New Zealand" option after "India", but it will not be displayed in the select (just in the drop down list, the first option would be displayed in the select (but not actually selected)). In most scenarios, one wants a particular sort order, with a default selection. The most common alternative being nothing selected and adding a disabled option as the first entry in the list (with empty text or a placeholder, e.g. "Please select a country"). The latter is pretty straightforward, but I think the original question is best solved with the behavior of the former. So, you need a way to tell $.each()'s callback function which option to mark selected when it is appending them. My original answer was the correct way to deal with the root of the problem (duplicate entries in the list). There is no need to clean them up if they are never added. Make a distinct list of countries, then call the $.each(). Here would be my new favorite way to make an array distinct: arr = [...new Set(arr)] So, rewriting this in 2019... // If you want to specify a default selection, modify `toOption` as such... //const defaultSelection = 'NZ'; //const toOption = c => // new Option(c.name, c.code, c.code === defaultSelection, c.code === selected); const toOption = c => new Option(c.name, c.code, false, c.code === selected); const country= document.querySelector('#…
score: -1

http://stackoverflow.com/comment/47227075
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29537111
has text: var express= require('express'); var app = express();
score: 2

http://stackoverflow.com/comment/47400015
comment on: http://stackoverflow.com/q/29625809
score: 0
type: Comment
type: QuestionComment
has text: @Kano Thanks, I'll be interested in what you come up with. The handler was just meant to be a generic class so that I could attach it to any particular menu without worrying about its contents.

http://stackoverflow.com/a/29547216
has body: You'll need to use a javascript equalizer library, for example: http://www.wavesurfer.fm/example/equalizer/ Aside from actually equalizing, you'll need to get the audio. You may be able to utilize a service such as youtube-mp3 or you could strip the audio from the videos directly.
has comment: http://stackoverflow.com/comment/47245996
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29547106

http://stackoverflow.com/q/29670722
has body: I am using highmaps to display data segmented by countries. It works nice but I have an issue I'm not sure how to approach. I need to group some countries of Central America and Venezuela together in the world-map and show them as one single country. This grouping could change in time so it would be nice to be able to do it programmatically. I tried passing an array in the joinBy field of that concrete point but it does not work and neither the documentation or examples mention anything about what I'm trying to accomplish. How would you guys do it?
has comment: http://stackoverflow.com/comment/47620341
score: 3
has comment: http://stackoverflow.com/comment/47484596
downvote count: 0
favorite count: 0
has title: Grouping countries in Highmaps
tagged with: http://stackoverflow.com/tag/svg
type: UnansweredQuestion
answer count: 0
upvote count: 3
has comment: http://stackoverflow.com/comment/47485866
type: Question
tagged with: highmaps
tagged with: highcharts
tagged with: javascript
has comment: http://stackoverflow.com/comment/48445864

http://stackoverflow.com/q/29575888
type: Question
accepted answer: http://stackoverflow.com/a/29575946
score: -2
has comment: http://stackoverflow.com/comment/47305175
has answer: http://stackoverflow.com/a/29576028
has comment: http://stackoverflow.com/comment/47300345
tagged with: javascript
has answer: http://stackoverflow.com/a/29575939
favorite count: 0
possible better answer: http://stackoverflow.com/a/29575939
tagged with: regex
answer count: 4
has title: What is the meaning of the returend array of exec()
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29575946
downvote count: 3
has body: For instance one has the simple regular expression: var regex = /([^\\^\{^\}]+)|(\\[A-Za-z]+(\{[^}^{]*})*)|($[.]+$)|($$[.]+$$)/g; and a string to check: var text = '\\a{b}{c}{d}'; on witch the function var matched = regex.exec(text) is runned. The returned Array machted looks now like: matched =['\\a{b}{c}{d}', undefined, '\\a{b}{c}{d}', '{d}', undefined, undefined]; What do the single entries mean? And how to control them? Thanks in advance!
upvote count: 1
has answer: http://stackoverflow.com/a/29575953

http://stackoverflow.com/comment/47473135
type: Comment
score: 0
type: AnswerComment
has text: I am calling this in a child scope does that have to do with anything?
comment on: http://stackoverflow.com/a/29666990

http://stackoverflow.com/a/29598930
answers question: http://stackoverflow.com/q/29596493
type: AcceptedAnswer
downvote count: 0
has body: PhantomJS has two contexts. The inner context or page context is defined by page.evaluate(). It is sandboxed and has no access to variables defined outside. So, it doesn't know what phantom is. In the same way the outer context doesn't know what $ is, because jQuery is a DOM library and was injected into the page. You need to wrap your jQuery request in page.evaluate(). The other thing is that now, phantom.exit() doesn't mean anything. You need to tell PhantomJS to exit from inside of the page context, because the request is asynchronous. That's where the page.onCallback and window.callPhantom() pair comes in. page.onCallback = function(data){ if (data.type === "exit") { phantom.exit(); } }; function start(){ page.includeJs('https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js', function() { console.log("got here"); page.evaluate(function(){ $.get("http://my-wonderful-site.com") .done(function( data ) { console.log("here!"); console.log(data); window.callPhantom({type: "exit"}); }); }); }); } console.log() is defined inside of the page context, but you can't see it there, because PhantomJS doesn't pass them out by default. You have to register to the page.onConsoleMessage event. You can also send the data to the outer context with the help of callPhantom() instead of logging it. Note that not everything can be passed between the contexts: Note: The arguments and the return value to the evaluate function must be a simple primitive object. The rule of thumb: if it can be serialized via JSON, then it is fine. Closures, functions, DOM nodes, etc. will not work! The other helpful event handlers are onError, onResourceError, onResourceTimeout in case there are still problems.
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/47353201
score: 2
has comment: http://stackoverflow.com/comment/47353314
accepted answer of: http://stackoverflow.com/q/29596493

http://stackoverflow.com/q/29584706
linked to: http://stackoverflow.com/q/29582771
type: Question
tagged with: google-maps
accepted answer: http://stackoverflow.com/a/29584747
answer count: 1
tagged with: javascript
has title: Google maps does not zoom in past a certain point
score: 0
has answer: http://stackoverflow.com/a/29584747
has body: Here is the project var map = new google.maps.Map(document.getElementById('map-canvas'), { disableDoubleClickZoom: true, scrollwheel: false, navigationControl: false, mapTypeControl: false, scaleControl: false, draggable: false, zoom: 15, center: new google.maps.LatLng(34.239415, -118.529339), mapTypeId: google.maps.MapTypeId.TERRAIN }); https://jsfiddle.net/yxg7spbp/2/ the problem is i want to zoom in closer to see the buildings outlines of the campus however if i change the zoom value past 15 it does not have any effect, how can i zoom in closer.
type: AnsweredQuestion

http://stackoverflow.com/comment/47255485
type: QuestionComment
type: Comment
has text: Please show your code. We're not mind readers, we can't tell what you're doing wrong or how to fix it.
score: 0
comment on: http://stackoverflow.com/q/29552071

http://stackoverflow.com/q/29533269
has comment: http://stackoverflow.com/comment/47224811
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/47223762
answer count: 0
has comment: http://stackoverflow.com/comment/47224882
has comment: http://stackoverflow.com/comment/47223841
has comment: http://stackoverflow.com/comment/47225194
type: Question
has comment: http://stackoverflow.com/comment/47224699
has comment: http://stackoverflow.com/comment/47223528
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has body: I'm trying to log some stuff in a JSON file. An entry looks like this: { "bookindId":"30779265", "timestamp":"1428447744", "plate":"D-GO9872", "cityId":"RLD", "zoneId":"759", "highDemandZones":[ "402", "429", "714", "715", "721", "728", "732", "734", "742", "756", "758", "763" ], "accountId":"151426", "date":"20150408", "formattedDate":"08.04.2015, 01:02 Uhr" }, But sometimes, highDemandZones is just missing: { "bookindId":"30779279", "timestamp":"1428447762", "plate":"D-GO120", "cityId":"RLD", "zoneId":"759", "accountId":"151426", "date":"20150408", "formattedDate":"08.04.2015, 01:02 Uhr" }, My problem is that even if there aren't any highDemandZones, it should at least be in there as an empty array. Also I can defenitely say that it shouldn't be empty either. Which leads me to the conclusion that my php code is flawed. This is the javascript function App.prototype.trackBooking = function() { var self = this; // [... stripped out other code for clarity] // get high demand zones var highDemandZones = []; $.each(this.model.zoneDemands, function(id, details) { if(details.demand == 'HIGH') { highDemandZones.push(id); } }); // [... stripped out other code for clarity] var obj = { bookindId: this.model.user.booking.bookingId, timestamp: Math.round(Date.now() / 1000), plate: this.model.user.booking.vehicle.numberPlate, cityId: this.model.city.id, zoneId: car.zoneId, highDemandZones: highDemandZones, accountId: this.model.user.accountId, date: todayFormatted, formattedDate: day + '.' + month + '.' + year + ', ' + hours + ':' + minutes + ' Uhr' }; return $.ajax({ type: "POST", dataType: 'json', url: 'php/ajax.php', data: { booking: obj, action: 'trackBooking' } }).success(function(data) { console.log('TRACKED'); console.log(data); }).fail(function(a, b, c) { console.log(a); console.log(b); console.log(c); }); }; This is php function that'll save this obj to a JSON file function saveBooking($booking) { // get current bookings $json = file_get_contents("../reporting/bookings.…
score: 0
has comment: http://stackoverflow.com/comment/47224777
tagged with: arrays
has title: PHP strips out JSON node (array)?
tagged with: jquery
has comment: http://stackoverflow.com/comment/47220336
linked to: http://stackoverflow.com/q/14234646

http://stackoverflow.com/q/29554986
type: Question
score: 0
answer count: 2
tagged with: angular-ui
tagged with: javascript
has body: I have an issue where almost all URLs parts are optional but the controller is the same. I have a URL with dynamic url-parts which depends from filter when user select some filter parameters URL changes for example: /search, /search/min-1000, /search/max-10000 and so on. And also I have details URL almost the same as search but has id url-part, for example: /search/{id}/min-1000, /search/{id}/min-1000/max-10000, /search/{manufacture-name}/{id}/min-1000/max-10000 and so on. How can I build such dynamic URLs with angular-router or angular-ui? Here is example: http://plnkr.co/edit/70Ihz0nqRjiDOKoEJzRI
favorite count: 0
accepted answer: http://stackoverflow.com/a/30116650
tagged with: angularjs
has title: Manage dynamic URLs in angular
has comment: http://stackoverflow.com/comment/47261797
has comment: http://stackoverflow.com/comment/47263189
upvote count: 1
downvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/30116650
tagged with: angular-ui-router
possible better answer: http://stackoverflow.com/a/29556720
has comment: http://stackoverflow.com/comment/47261748
has answer: http://stackoverflow.com/a/29556720
has comment: http://stackoverflow.com/comment/47263097

http://stackoverflow.com/comment/47284914
type: Comment
comment on: http://stackoverflow.com/q/29567525
type: QuestionComment
has text: @Xufox it has both name and id `<select name="BSN" size="1" id="BSN"`
score: 0

http://stackoverflow.com/a/44727502
has comment: http://stackoverflow.com/comment/85818238
answers question: http://stackoverflow.com/q/29620686
upvote count: 61
type: Answer
downvote count: 1
has comment: http://stackoverflow.com/comment/86283869
has body: IMO, this is the easiest way to accomplish what you're looking for: let { prop1, prop2, prop3 } = someObject; let data = { prop1, prop2, prop3 }; // data === { prop1: someObject.prop1, ... } Basically, destructure into variables and then use the initializer shorthand to make a new object. There isn't any need for Object.assign. I think this is the most readable way, anyway. You can hereby select the exact props out of someObject that you want. If you have an existing object you just want to merge the props into, do something like this: let { prop1, prop2, prop3 } = someObject; let data = Object.assign(otherObject, { prop1, prop2, prop3 }); // Makes a new copy, or... Object.assign(otherObject, { prop1, prop2, prop3 }); // Merges into otherObject Another, arguably cleaner, way to write it is: let { prop1, prop2, prop3 } = someObject; let newObject = { prop1, prop2, prop3 }; // Merges your selected props into otherObject Object.assign(otherObject, newObject); I use this for POST requests a lot where I only need a few pieces of discrete data. But, I agree there should be a one liner for doing this. P.S.: I recently learned you can use ultra destructuring in the first step to pull nested values out of complex objects! For instance... let { prop1, prop2: { somethingDeeper }, prop3: { nested1: { nested2 } } = someObject; let data = { prop1, somethingDeeper, nested2 }; Plus, you could use the spread operator instead of Object.assign when making a new object: const { prop1, prop2, prop3 } = someObject; let finalObject = {...otherObject, prop1, prop2, prop3 }; Or... const { prop1, prop2, prop3 } = someObject; const intermediateObject = { prop1, prop2, prop3 }; const finalObject = {...otherObject, ...intermediateObject };
has comment: http://stackoverflow.com/comment/84387230
score: 60

http://stackoverflow.com/q/29537213
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/29537328
tagged with: dataset
has body: I've got a piece of code like this: $('&lt;button/&gt;', { text: 'Send', dataUrl: pageUrl, dataTitle: pageTitle, class: 'cannedSend' }).appendTo('#btnSpan'); } Usually when there is a hyphen in the attribute you can camel case it (marginRight for example) and on the HTML side it shows as margin-right. Nevertheless, for the dataset attributes it simply writes dataurl with no hyphen. Concatenating .attr('data-url', pageUrl).attr('data-title', pageTitle) just looks ugly, and using an object to pass them both in the same .attr() results in the same issue as above. Any ideas?
tagged with: jquery
has answer: http://stackoverflow.com/a/29537328
has title: How to use dataset attributes when creating an element in jQuery?
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29537301
type: Question
has answer: http://stackoverflow.com/a/29537301
tagged with: javascript

source-maps
type: Tag
tags question: http://stackoverflow.com/q/29564765
tag name: source-maps

http://stackoverflow.com/comment/47224694
type: Comment
type: QuestionComment
has text: you need to make recursive calls actually, try to find the most inner element first and then bubble outside and check for each siblings at same time, it is not easy as it looks
comment on: http://stackoverflow.com/q/29535939
score: 0

http://stackoverflow.com/q/29681775
type: Question
tagged with: javascript
answer count: 3
has answer: http://stackoverflow.com/a/57833415
tagged with: console.log
favorite count: 0
score: 39
has title: How to create hyperlinks linked to javascript functions in Chrome's console.log?
tagged with: google-chrome
upvote count: 39
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/46731967
downvote count: 0
has answer: http://stackoverflow.com/a/29681947
accepted answer: http://stackoverflow.com/a/29681947
has body: I'm trying to write entries to the console that would contain links to trigger javascript functions upon clicking on them: console.log("javascript:alert('Hello World');"); console.log("test"); console.log("[DisplayObject 'Hello World' reveal]"); All these attempts fail. Is there any way to print it similarly to an "http://..." link, like so... ... only, have the text linked to a javascript statement or function instead? The reason I'm doing this is to be able to quickly reveal which items on the screen are tied to a specific log entry (example: Making a CreateJS sprite scale-up when the log entry is clicked on).
tagged with: hyperlink
possible better answer: http://stackoverflow.com/a/57833415

http://stackoverflow.com/q/29567858
has answer: http://stackoverflow.com/a/29568083
score: 0
tagged with: scroll
has comment: http://stackoverflow.com/comment/47285622
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47285932
has body: There are many stackoverflow questions regarding this but I couldn't find my answer. I have this javascript code: $(function() { $('a[href*=#]:not([href=#])').click(function() { $('html,body, .main').animate({ scrollTop: $(this.hash).offset().top - 10 }, 1000); }); }); And this is my HTML code: test <!--[if gt IE 8]><!--> <!--<![endif]--> Inicio Equipo Sistemas Desarrollo Menu So I am using a template I found online. It has a fancy menu on the left and then a main content on the middle. Everything is inside: I want that when a link on the menu is clicked, it scrolls to the particular sections (#section1, #section2, #section3, #section4). Right now it works the first time I click on one of the links but the second time it goes to a random place. Any clues why this might be happening? --- UPDATE ---- I tried all of the solutions mentioned and it is not working. I think it has to do with the CSS that I have for the main container (class .main). Take a look at the code (I took this code from the library I am using): .main { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; -webkit-overflow-scrolling: touch; padding: 3em 4em; position: fixed; overflow: hidden; overflow-y: scroll; border-top-left-radius: 5px; box-shadow: 0 0 15px rgba(0,0,0, .6); top: .8em; right: 0; bottom: 0; width: 76%; background: #fff; } .main::-webkit-scrollbar { -webkit-appearance: none; background-color: rgba(0,0,0, .15); width: 8px; height: 8px; } .main::-webkit-scrollbar-thumb { border-radius: 0; background-color: rgba(0,0,0, .4); } I tried removing the CSS code above and using this and it works: $(function() { $('a[href*=#]:not([href=#])').click(function() { $('html,body, .main').animate({ scrollTop: $(this.hash).offset().top - 10 }, 1000); }); }); But I need that CSS. Any clue how I can fix it?
accepted answer: http://stackoverflow.com/a/29568083
has comment: http://stackoverflow.com/comment/47285493
has comment: http://stackoverflow.com/comment/47285522
has title: jquery scroll to element not working - scrolls to random places
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/47428517
has text: Put yourself in our shoes. You give us 4 words of code. We don't even know what "external" js file means ("external" to what? To another js file? To the HTML document as it should be?) We have no code sample, no variable, no context, and you _want_ a general answer, for like all cases in the universe. Come on.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29643447
type: QuestionComment

http://stackoverflow.com/comment/47286399
type: Comment
type: QuestionComment
has text: Shouldn't it be `malls[i].brands[j].id`?
score: 7
comment on: http://stackoverflow.com/q/29568486

http://stackoverflow.com/comment/47321136
has text: yeh it works but what if i would like to make it loop over and over ? i tryied to call it from inside the function but it just roll so quickly that you can't even see when it changes.
comment on: http://stackoverflow.com/a/29586514
type: AnswerComment
score: 0
type: Comment

eclipse
tag name: eclipse
tags question: http://stackoverflow.com/q/29675927
tags question: http://stackoverflow.com/q/29536593
type: Tag

http://stackoverflow.com/comment/47312806
score: 0
comment on: http://stackoverflow.com/q/29581566
has text: Actually if you do not use the 'var' before the declaration it is a global variable.
type: Comment
type: QuestionComment

communication
tag name: communication
tags question: http://stackoverflow.com/q/29592264
tags question: http://stackoverflow.com/q/29681477
type: Tag
tags question: http://stackoverflow.com/q/29676173

http://stackoverflow.com/comment/47453738
comment on: http://stackoverflow.com/q/29657060
type: Comment
has text: where is $value calculated ? its hard to tell from the link example exactly what the value of $value is supposed to be. i dont know whether the single and double quotes are coming from the variable or elsewhere
type: QuestionComment
score: 0

http://stackoverflow.com/comment/47375296
score: 0
type: AnswerComment
type: Comment
has text: I think that the error happens because the page is trying to render my partial before there's even been an AJAX call. I just don't know how to make rails "wait" to evaluate/load the partial until after the variable has been set in the controller. I did get this working with just javascript, but I couldn't replicate just using Ruby.
comment on: http://stackoverflow.com/a/29614447

http://stackoverflow.com/comment/47251304
has text: @Saagar No result and no errors in the console either :(
comment on: http://stackoverflow.com/q/29549836
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/55246164
has body: I encountered a similar issue for iOS. After a lot of hair was pulled out, I found a solution that worked for me: response by Wes R The idea is that you listen for a touchstart event, capture the touch's Y position, listen for the touchmove, capture that touch's Y position, to work out the touch direction. If at the top already, and the direction is 'up' then event.preventDefault() to stop the browser attempting to scroll up, do same for scrolling down at the bottom of the page. It was for a similar issue with same direction scrolling while at scroll boundary, sorry if it's irrelevant for your use case, I might've misunderstood OP :P
upvote count: 1
answers question: http://stackoverflow.com/q/29531718
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/q/29646427
downvote count: 1
has comment: http://stackoverflow.com/comment/47433174
type: Question
has comment: http://stackoverflow.com/comment/47433190
has comment: http://stackoverflow.com/comment/47433337
has comment: http://stackoverflow.com/comment/47434007
tagged with: javascript
has body: I'm using bind() for multiple functions. My problem is how do I unbind them using a $(document).mouseup(function(e)? $('#aaa').mousedown(function(e) { $(document).bind('mousemove.rImg', function(e2) { rotateOnMouse(e2, '#lt_'); }); }); $('#bbb').mousedown(function(e3) { $(document).bind('mousemove.rTxt', function(e2) { rotateOnMoust(e2, '#fW_'); }); }); How can I do the unbind for the above? $(document).mouseup(function(e) { $(document).unbind('mousemove.rImg'); $(document).unbind('mousemove.rTxt'); });
has comment: http://stackoverflow.com/comment/47433676
has comment: http://stackoverflow.com/comment/47433571
score: 0
has comment: http://stackoverflow.com/comment/47433599
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47434090
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47433140
has comment: http://stackoverflow.com/comment/47441645
has comment: http://stackoverflow.com/comment/47433246
answer count: 0
has title: Unbind multiple functions
has comment: http://stackoverflow.com/comment/47433292
has comment: http://stackoverflow.com/comment/47433520
upvote count: 1

http://stackoverflow.com/a/29639851
has body: If we cast aside best practice, this is the working code. document.getElementById("roster").innerHTML += " + \n" + "" + str + " "; The reason why your code doesn't work is because you are removing the span which has onclick function on the fly. It means it can't reach the $(this).prev().remove() bit. I hope it makes sense. If you want to go an extra mile, you should put $(this).remove(); after the frDelete() function. Otherwise those 4 functions that you call will never be called.
score: 2
has comment: http://stackoverflow.com/comment/47421764
downvote count: 0
has comment: http://stackoverflow.com/comment/47421630
upvote count: 2
has comment: http://stackoverflow.com/comment/47421562
has comment: http://stackoverflow.com/comment/47421594
answers question: http://stackoverflow.com/q/29639771
has comment: http://stackoverflow.com/comment/47421626
type: Answer

http://stackoverflow.com/q/29609321
has body: I have this chat room on my website, where the user types their message into a textbox and when they press enter (or the send button), jQuery takes the data from the textbox, disables the textbox, sends the data to the file send.php where it is then processed and put into the database, and then it should clear and undisable the textbox once it successfully runs through the PHP script. What is happening is the data is being submitted and it runs through the script (sends the data to the database successfully) but the jQuery is not clearing and undisabling the textbox. Can someone explain to me what is wrong? jQuery: $('#formSend').on('submit', function (e) { e.preventDefault(); var textArea = document.getElementById('styled'); if( textArea.value != "" ) { var formData = $('form').serialize(); $('.expand').prop("disabled", true) $.ajax({ type: 'post', url: 'send.php', data: formData, dataType: "json", success: function (formData) { //put data in parentheses when coming back alert("Success"); $(".expand").val(''); $('.expand').prop("disabled", false); if( formData["banned"] == 1 ) { var rel = confirm("You have been banned."); if (rel) { location.reload(); } else { location.reload(); } } } }); } else { alert("Your message must be longer than 1 (one) character."); $('#styled').focus(); } }); send.php: &lt;?php include("../config.php"); session_start(); $msg = strip_tags( $_POST['msg'], '&lt;b&gt;&lt;/b&gt;' ); if( $msg == "" ) { exit("There is no message."); } $username = $_SESSION['USER']; $date = new DateTime(); $formattedDate = $date-&gt;format('Y-m-d H:i:s'); $stmt = $db-&gt;prepare("SELECT id, username FROM users WHERE username = :username"); $stmt-&gt;execute(array(":username" =&gt; $username)); $row = $stmt-&gt;fetch(); $userID = $row['id']; $checkBanned = $db-&gt;prepare('SELECT banned FROM users WHERE username = :username'); $checkBanned-&gt;execute(array( ':username' =&gt; $username )); $banned = $checkBanned-&gt;fetch(); if( $banned['banned'] == "yes" ) { $ret…
tagged with: jquery
favorite count: 0
tagged with: ajax
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47364803
tagged with: php
has comment: http://stackoverflow.com/comment/47364655
answer count: 4
has comment: http://stackoverflow.com/comment/47364469
has answer: http://stackoverflow.com/a/29609549
has comment: http://stackoverflow.com/comment/47364565
has comment: http://stackoverflow.com/comment/47364353
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/29609437
has title: Textbox not clearing after ajax call
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/29609730
has comment: http://stackoverflow.com/comment/47364518
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/47364709
upvote count: 0
has answer: http://stackoverflow.com/a/29609446
has comment: http://stackoverflow.com/comment/47364463

http://stackoverflow.com/a/29616024
type: Answer
has comment: http://stackoverflow.com/comment/47399082
has body: Is Angular expecting JSON or HTML/text back? I've experienced issues in the past returning text/javascript or application/json instead of text/html. It looks like Angular is expecting JSON or JSONP in that instance, hence the Unexpected Token R (which is the first letter of your response string). I could give a more precise answer, but I'd need to also know if you're using JSONP vs JSON, etc.
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29615606
has comment: http://stackoverflow.com/comment/47379699
downvote count: 0
has comment: http://stackoverflow.com/comment/47379770
has comment: http://stackoverflow.com/comment/47377431

http://stackoverflow.com/a/29603980
score: 1
has body: Since, you are using ExpressJS with NodeJS on your server, you can send a error status code with the server when the HTTP request is not correct: res.status(400).send('Bad Request') In your client script which use the jQuery Deferred Object: deferred.done() is triggered when your HTTP request is a success; deferred.fail() is triggered if there is a client or server error; So you should use as your code: $.post('/post', $("#submitform").serialize()) .done(function(res) { // Receive the successful server response console.log('success'); }) .fail(function(res) { // Receive the error server response alert("Error: " + res.status + " " + res.statusText); });
upvote count: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29595770
answers question: http://stackoverflow.com/q/29595770
type: Answer

http://stackoverflow.com/q/29638488
upvote count: 6
has title: Embed API Third party visualization > Uncaught TypeError: Cannot set property 'innerHTML' of null (cb=gapi.loaded_0:139)
type: AnsweredQuestion
has body: First of all, I would like to apologize about my poor web programming skill. I'm still new to Javascript. Here is my problem : I get an Uncaught TypeError while trying to reproduce the [Embed Api guide for Google Analytics] The exact error I get : Uncaught TypeError: Cannot set property 'innerHTML' of null (cb=gapi.loaded_0:139) I looked for an answer but didn't find any that was working. Here is my full code : I'm sorry about this question, I'm sure the answer is pretty dumb... Thank you for taking some time to help me.
has answer: http://stackoverflow.com/a/29638793
has comment: http://stackoverflow.com/comment/47419523
score: 6
type: Question
accepted answer: http://stackoverflow.com/a/29638793
tagged with: analytics
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0

http://stackoverflow.com/comment/47321094
type: QuestionComment
has text: Are the images all circular like that? And maybe more importantly, what is the end purpose of the dragging?
type: Comment
comment on: http://stackoverflow.com/q/29586615
score: 0

http://stackoverflow.com/comment/47453534
type: QuestionComment
has text: i want show.. count/result from my database in my website example : http://pastebin.com/6SXVHqpY
comment on: http://stackoverflow.com/q/29656849
score: 0
type: Comment

tcp
type: Tag
tag name: tcp
tags question: http://stackoverflow.com/q/29622427

http://stackoverflow.com/a/29594570
type: AcceptedAnswer
type: Answer
has body: Angular only updates things bound to the scope when a digest cycle runs. Most of the time a digest is triggered automatically by Angular in response to some event. When that's not the case, you need to do it yourself. That's precisely what's happening here. When you listen to DOM events by using jqLite/jQuery you need to tell Angular to trigger a digest after you have changed something in the scope. To do that, just call the $apply() method: angular.element( document.body ).bind('keydown keypress', function (event) { if(event.which === 27) // 27 = esc key { $scope.$apply(function() { $scope.toggleSize(); }); console.log('scope', $scope.fullscreen); event.preventDefault(); } else if(event.which === 37) { $scope.$apply(function() { $scope.goToNextSection('currentSection', $scope.slides); }); console.log('next'); } else if(event.which === 39) { $scope.$apply(function() { $scope.goToPreviousSection('currentSection', $scope.slides); }); console.log('prev'); } }); I suggest that you read more about scopes and the digest cycle. Angular documentation itself is a good start. Finally, I'm not sure whether you're listening to DOM events in your controller. If you are, you probably should use a directive instead.
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/29593715
accepted answer of: http://stackoverflow.com/q/29593715
upvote count: 2

http://stackoverflow.com/comment/47290931
type: Comment
comment on: http://stackoverflow.com/a/29570547
score: 0
has text: @BenjaminGruenbaum not quite. DateTime.Now is a property, not a static method. It's the difference between defining a get on a property that invokes a method, as opposed to defining a property that is a method that has to be invoked.
type: AnswerComment

http://stackoverflow.com/q/29598746
has comment: http://stackoverflow.com/comment/47344191
has comment: http://stackoverflow.com/comment/47343992
has comment: http://stackoverflow.com/comment/47343937
type: Question
answer count: 1
has body: I have a jQuery function which autofills an input field using the Google autocomplete API. Basically, an AJAX request is made to an PHP file which uses file_get_contents() to return JSON back to the application, and then upon success the results are displayed. Easy enough. However, I seem to be having a problem displaying the results with both Chrome and Safari. The results is just blank, though behaves as if it has been successful in that it follows through with the callback function sans the JSON data. If I replace file_get_contents() with something simple, like printing "Hello", then the text come backs successfully. I have tries adding a header to the offending PHP file, and I have tried adjusting the url from relative to absolute. Nothing seems to work, and it is starting to drive me crazy. My ajax request looks like this: $.ajax({ type: 'GET', headers: {'cache-control': 'no-cache'}, cache: false, url: 'http://www.example.com/ajax/locations.php', data: {data: input}, async: false, dataType: 'text', success: function(a){ - do something with a - } }); Any ideas or suggestions would be very much appreciated.
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/47343958
has comment: http://stackoverflow.com/comment/47343982
has comment: http://stackoverflow.com/comment/47344079
has comment: http://stackoverflow.com/comment/47344088
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47344278
has title: Empty AJAX response Chrome / Safari
has answer: http://stackoverflow.com/a/29599022

http://stackoverflow.com/comment/47447152
has text: Anyway, where i wrote "target" you can write "data-last" and it will work the same way with data-last attribute. Then you will not change your data-model.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29653223
type: Comment

http://stackoverflow.com/comment/47613401
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29597717
has text: I think it'd be best to mark your solution as correct. I did come to the correct solution by building it on top of the changes you proposed. Thanks Ben. I posted the code of the solution I previously posted in the bottom of the question.

http://stackoverflow.com/q/29635835
has title: JavaScript keeps throwing "Uncaught TypeError" on addition to a select form
tagged with: select
possible better answer: http://stackoverflow.com/a/29635879
has answer: http://stackoverflow.com/a/29635879
linked to: http://stackoverflow.com/q/802854
type: Question
accepted answer: http://stackoverflow.com/a/29636122
score: 0
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/47413961
has body: I keep getting the error "Uncaught TypeError: Cannot read property 'add' of null", which happens on the line select.add("HI!", 0);. I thought it was because of a name mismatch, which is why the list exists, but that did not solve the problem. Any guidance would be awesome! &lt;script type="text/javascript"&gt; for(i = 0; i &lt; 10; i++){ var names = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"] //window.alert(names[i]) document.write('&lt;tr&gt;'); document.write('&lt;td&gt;'); document.write('&lt;select id=names[i]&gt;&lt;/select&gt;'); var select = document.getElementById(names[i]); select.add("HI!", 0); document.write('&lt;/td&gt;'); document.write('&lt;/tr&gt;'); } &lt;/script&gt; Thank you
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29636122
type: AnsweredQuestion

sass
tags question: http://stackoverflow.com/q/29576359
tag name: sass
type: Tag
tags question: http://stackoverflow.com/q/29607239

http://stackoverflow.com/comment/57021393
score: 1
has text: I was trying to use the _Google Places API Web Service_ so it never occured to me that _Google Maps JavaScript API_ also had to be enabled.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/33632111

http://stackoverflow.com/a/29558114
type: AcceptedAnswer
downvote count: 0
has body: No, JavaScript doesn't provide anyway to create your own keywords / operators / etc.
answers question: http://stackoverflow.com/q/29558069
has comment: http://stackoverflow.com/comment/47266797
type: Answer
accepted answer of: http://stackoverflow.com/q/29558069
upvote count: 3
has comment: http://stackoverflow.com/comment/47266901
has comment: http://stackoverflow.com/comment/47266701
has comment: http://stackoverflow.com/comment/47266484
has comment: http://stackoverflow.com/comment/47266736
score: 3
has comment: http://stackoverflow.com/comment/47266525
has comment: http://stackoverflow.com/comment/47266855

http://stackoverflow.com/q/29673604
type: Question
possible better answer: http://stackoverflow.com/a/29673674
tagged with: javascript
tagged with: jquery
score: 0
has title: Option selected value onchange
has comment: http://stackoverflow.com/comment/47485066
has body: Hello this is my current code: Select Course ALL BSIT BSA BSBA BSHRTM If you click any of those options, for example BSBA, it will go to home.php?course=BSBA, and also you can see that the selected attribute is on the option BSIT. What I wanted to do is whenever I click another link, for example BSHRTM, the selected attribute will go to BSHRTM like it would be BSHRTM . Any thoughts?
answer count: 4
has answer: http://stackoverflow.com/a/29673692
has answer: http://stackoverflow.com/a/29673674
has answer: http://stackoverflow.com/a/29673919
accepted answer: http://stackoverflow.com/a/29673919
linked to: http://stackoverflow.com/q/19491336
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47485108
has answer: http://stackoverflow.com/a/29673753
has comment: http://stackoverflow.com/comment/47484936
linked to: http://stackoverflow.com/q/2090551
has comment: http://stackoverflow.com/comment/47484920

http://stackoverflow.com/q/29592542
linked to: http://stackoverflow.com/q/20077487
has body: I have a simple content script that is trying to ask the background script for some data. However it seems if the response takes any time at all the callback won't be triggered. Is this just how chrome extensions work? I suppose I could send a message back to the tab manually This works # CONTENT_SCRIPT chrome.runtime.sendMessage { greeting: 'hello' }, (response) -&gt; console.log 'RECEIVED MESSAGE FROM BACKROUND' console.log JSON.stringify(response.action, null, 3) #successfully outputs panda here return # BACKROUND_SCRIPT chrome.runtime.onMessage.addListener (request, sender, sendResponse) -&gt; console.log 'RECEIVED MESSAGE FROM CONTENT' sendResponse {action: 'panda'} This does not work # CONTENT_SCRIPT chrome.runtime.sendMessage { greeting: 'hello' }, (response) -&gt; # this code is never triggered console.log 'RECEIVED MESSAGE FROM BACKROUND' console.log JSON.stringify(response.action, null, 3) return # BACKROUND_SCRIPT chrome.runtime.onMessage.addListener (request, sender, sendResponse) -&gt; console.log 'RECEIVED MESSAGE FROM CONTENT' setTimeout (-&gt; # I see the response in my logs console.log 'response' sendResponse {action: 'panda'} ), 3000
tagged with: coffeescript
duplicate of: http://stackoverflow.com/q/20077487
type: Question
has comment: http://stackoverflow.com/comment/47332055
tagged with: javascript
tagged with: jquery
score: 0
tagged with: google-chrome-extension
has title: how come a delayed callback from a background script won't fire (chrome extension)
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47332047
tagged with: google-chrome

http://stackoverflow.com/comment/47344632
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29598376
has text: did you consider SQLite as an alternative ?

http://stackoverflow.com/a/29680948
downvote count: 0
has body: You can use this negative lookahead based regex: /^(?!\B{LINK_TO_WEB_VERSION}\B).+$/gim RegEx Demo
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/47525972
type: Answer
answers question: http://stackoverflow.com/q/29680811

http://stackoverflow.com/comment/47355677
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29605003
type: Comment
has text: That tells me how to see what background image is associated with which clicked element, not how to change the `#plane_image` div to match it.

http://stackoverflow.com/comment/47250015
comment on: http://stackoverflow.com/q/29549026
type: Comment
has text: 1) "*Why is it necessary to OR with false [...]*" It isn't. Best guess is that it's out of a habit of needing a boolean value for the `if` condition, which JavaScript doesn't require. 2) "*[...] and use NOT twice?*" [The operators convert the value to a boolean](http://stackoverflow.com/questions/2174297/how-to-use-the-double-not-operator-in-javascript), same as `Boolean(document.documentMode)`. Though, after removing the `false ||`, the `if` will do the boolean conversion itself, so they're also unnecessary.
type: QuestionComment
score: 1

http://stackoverflow.com/comment/47248264
has text: @idioteque `document.ready` doesn't help in ajax loaded page, the event occured a long time ago so it will fire immediately
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29547760
type: Comment

http://stackoverflow.com/a/29649995
upvote count: 2
answers question: http://stackoverflow.com/q/29649846
has body: You can animate the li's as follows: $("ul li").on("click", function(){ $(this).animate({"opacity": "1"}); $(this).siblings().animate({"opacity": "0.3"}); }); li { margin: 2px; padding: 5px; background-color: #aaf; } textA textB textC textD textE
score: 2
downvote count: 0
type: Answer

http://stackoverflow.com/comment/47414480
has text: @Touffy Firstly of course the function will have extra logic, the goal is to to make it easier for the *caller*, not the implementor. This is true in all modern programming and software engineering. Secondly of course it's not a general case: my answer details the specific case in which this is good practice. It's not good practice in general but I don't think I need to go into that.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29636067
type: Comment

http://stackoverflow.com/a/29661923
score: 2
has comment: http://stackoverflow.com/comment/47508030
answers question: http://stackoverflow.com/q/29659706
downvote count: 0
has comment: http://stackoverflow.com/comment/47503785
has body: Two methods i know using Hammer Js to handle the Double Taps. One is to add an overlay on the map and change its z-index value as required. The bonus with the overlay is that no additional code is needed to disable any interaction on the map if needed, e.g markers click and controls. Two is to use the in-build Gmaps .setOptions({draggable: true/false} function. Method one Demo Note. Adjust CSS width, height, position for your Map(s) http://jsfiddle.net/gmqctmkd/ CSS .overlay { position:absolute; height:300px; width:100%; background:transparent; z-index:99; top:0; left:0; } Code mc.on("doubbletap", function(ev) { $(".overlay").css("z-index", "1"); }) Method Two Demo Using .setOptions({draggable: true/false} http://jsfiddle.net/oom5uevt/ Code // set map Options to disable drag. map.setOptions({draggable: false}); // enable drag mc.on("doubbletap", function(ev) { map.setOptions({draggable: true}); })
has comment: http://stackoverflow.com/comment/47472816
upvote count: 2
type: Answer

http://stackoverflow.com/comment/47496002
score: 0
comment on: http://stackoverflow.com/q/29678566
type: QuestionComment
type: Comment
has text: Console clear. Trouble just in this song 'Sleep Away.mp3', but only in Chrome :D Who knows which one songs have the same.

http://stackoverflow.com/comment/47506797
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/29684735
type: Comment
has text: My first instinct is wondering if you could use a `$watch` and do validation there instead of binding to a hidden field? If you could provide your `custom-validation` directive that could help

http://stackoverflow.com/q/29596162
favorite count: 0
upvote count: 1
tagged with: node.js
type: AnsweredQuestion
score: 1
tagged with: twitter
has answer: http://stackoverflow.com/a/29596270
type: Question
has body: I've installed node-twitter via npm and have created an index.js file with the code below. When I run node index.js in the console I'm not getting any response. I've included my own keys and secrets so that doesn't appear to be the issue. var Twitter = require('twitter'); var client = new Twitter({ consumer_key: process.env.TWITTER_CONSUMER_KEY, consumer_secret: process.env.TWITTER_CONSUMER_SECRET, access_token_key: process.env.TWITTER_ACCESS_TOKEN_KEY, access_token_secret: process.env.TWITTER_ACCESS_TOKEN_SECRET, }); client.stream('statuses/filter', {track: 'nyc'}, function(stream){ stream.on('data', function(tweet) { console.log(tweet.text); }); stream.on('error', function(error) { console.log(error); }); });
tagged with: javascript
has title: node twitter npm package
answer count: 1
accepted answer: http://stackoverflow.com/a/29596270
downvote count: 0

http://stackoverflow.com/comment/47342299
comment on: http://stackoverflow.com/q/29587231
has text: I have this problem in ie9
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29664891
has title: In Ember can I pass markup to a component?
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29674430
answer count: 1
downvote count: 0
has body: I'm trying to create a dropdown type component that can have some markup for the title, and then upon hovering reveal more markup. Something like this: {{#dropdown-menu}} {{#dropdown-header}} My Custom Title markup {{/dropdown-header}} {{#dropdown-body}} list of menu items {{/dropdown-body}} {{/dropdown-menu}} The body should only show while some property like isExpanded is true. But if the body is clicked, isExpanded would become false. I can make a working component that accepts a title property (string), but I can't figure out how to make the title include custom markup.
favorite count: 0
tagged with: ember.js
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/29674430
upvote count: 1

http://stackoverflow.com/a/29604287
has comment: http://stackoverflow.com/comment/47355646
type: Answer
score: 3
answers question: http://stackoverflow.com/q/29604121
downvote count: 0
has body: If you want to know what they do, the spec is fairly clear and can pretty reasonably be turned into JavaScript code (in fact, that's been done on MDN). Some differences between yours and JavaScript's: JavaScript's forEach and filter don't use for-in, which is the fundamental difference between yours and JavaScript's. They just work with the object and array indexes, expecting the object to be a array-like (e.g., have a length and properties with keys like "0", "1", and so on [and yes, all keys are strings, even the keys in standard arrays, which aren't really arrays at all). JavaScript's version doesn't call the callback for entries that don't exist (e.g., in the case of sparse arrays). To add that to yours, you'd add hasOwnProperty(index) at some stage. JavaScript's version passes more arguments to the callbacks. JavaScript's version lets you specify a value to use as this when calling the callbacks. JavaScript's version grabs the length before starting, so if the collection is modified, the old length is used. Depending on where the changes are made, entries might be skipped. So for instance, your take on forEach might look more like this: function myForEach(collection, callback, thisArg) { var l = +collection.length; for (var i = 0; i &lt; l; i++) { if (collection.hasOwnProperty(i)) { callback.call(thisArg, collection[i], i, collection); } } } Again, that's not (remotely) an accurate implementation of the algorithm in the spec, just a slight modification to yours to address the specific points I raised above.
upvote count: 3

http://stackoverflow.com/comment/47415256
has text: Sorry, I am setting the styles with the javascript so it is finding and editing the styles in that step. However. It is not even giving me the printed part of the return "Your estimated total is: $"
score: 0
comment on: http://stackoverflow.com/q/29636356
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47436687
has text: There's a typo in your `for` loop: `snapshotResults.snaphotLength`.
comment on: http://stackoverflow.com/q/29648180
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/47389610
type: Comment
has text: yes! it helps) thank you very much, i don't even know, how i allowed such a mistake
type: AnswerComment
comment on: http://stackoverflow.com/a/29622772
score: 0

http://stackoverflow.com/comment/47466300
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29562213
has text: Just wanted to mention that if I use your latest Plunkr ng-model works fine for me in all my browsers: Safari, Chrome, Firefox. The only things I changed were to replace ng-model2 with ng-model and commented out the set-if-not-set bit for ng-model2. You might want to test it again.

http://stackoverflow.com/comment/47476861
has text: Sorry for the wrong terms. Edited the question.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29668787
score: 0

http://stackoverflow.com/a/29612922
score: 2
has body: The input element is a child of the table cell. And you have to use .value to get the value of an input, not .innerHTML. console.log(table.rows[i].cells[1].childNodes[0].value)
answers question: http://stackoverflow.com/q/29612861
downvote count: 0
upvote count: 2
type: Answer

http://stackoverflow.com/q/29538214
answer count: 1
tagged with: arrays
has title: Is there a simpler or cleaner way to find an object in an object array in Javascript?
has answer: http://stackoverflow.com/a/29538279
accepted answer: http://stackoverflow.com/a/29538279
type: Question
type: AnsweredQuestion
tagged with: javascript
has body: Say we have one object called "myDroid" and a list of objects called "droids", and I am looking for a particular droid called Alfred. If Alfred is in the list I want a boolean value to be set to true. This is my solutions to find it: for(i in droids) { if(droids[i].name === myDroid.name) { foundIt = true; } } Is there a simpler or cleaner way to do this in Javascript? Or is this the simplest one?
tagged with: search
score: 0

http://stackoverflow.com/comment/47501407
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29681849
has text: It's okay, I think I figured it out without it.
type: Comment

http://stackoverflow.com/comment/47322032
comment on: http://stackoverflow.com/a/29575093
type: AnswerComment
type: Comment
has text: 'it breaks'. It works, but does not have a special behavior on word boundaries. I didn't consider this as a requirement. If you change `(.*)` to `(.*?)`, it will work for your example, but you'd find other cases where it doesn't.
score: 0

http://stackoverflow.com/q/29596197
tagged with: javascript
has title: Timed FadeOut not working
has answer: http://stackoverflow.com/a/29596483
score: 0
answer count: 2
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/29596313
type: UnansweredQuestion
tagged with: fadeout
has body: I've been wanting to make an image fadeout after a period of time. I've looked through the same topics found here in Stackoverflow but mine doesn't want to work. If anyone could take a quick peek at my code I would be very grateful please? The image I would like to fade is: My code: ACC BIC - Business Industry Description
type: Question

http://stackoverflow.com/q/29572889
has body: I am performing an api call back in a loop to get the latest status of a value.. The api call and loop is working but its not showing me the data of the first object returned.. instead it is showing me the data of the last object. The reason for the loop is because there could be multiple objects returned but i want the output to go through them in order from object 0 then object 1 and so on.. Here is a screenshot from firebug showing you two objects with there respective data points. As you can see object 0 is shown first then object 1. Here is my code to output the data on the page. This code is within a if statement where status = "RESULT" - you can't tell from the below code but both of these objects match that criteria for (var i = 0; i < response.endpoints.length; i++) { var endpoint = response.endpoints[i]; //console.log(endpoint); $pending0.html(" Server Name: " + endpoint.serverName + " Status: " + endpoint.statusMessage + " Progress: " + endpoint.statusDetailsMessage); My issue with the above code is with the order of the output. It shows data for the second object where as I need it to give me the output for the first object. -- UPDATE -- seems to be working per Barmer's suggestion to add an IF within the loop for (var i = 0; i < response.endpoints.length; i++) { var endpoint = response.endpoints[i]; if (endpoint.statusMessage == "In progress") { //console.log(endpoint); $pending0.html(" Server Name: " + endpoint.serverName + " Status: " + endpoint.statusMessage + " Progress: " + endpoint.statusDetailsMessage); } }
type: AnsweredQuestion
has title: output of api callback to show data of the first object
accepted answer: http://stackoverflow.com/a/29572910
type: Question
score: 0
tagged with: api
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29572910
has comment: http://stackoverflow.com/comment/47295065

http://stackoverflow.com/comment/47393253
type: Comment
type: QuestionComment
has text: No. All the nodes are connected. However, I need to have the nodes show up with their links (i.e. not all the nodes at once and then the links gradually).
comment on: http://stackoverflow.com/q/29624177
score: 0

http://stackoverflow.com/q/29663180
has comment: http://stackoverflow.com/comment/47466741
tagged with: return
linked to: http://stackoverflow.com/q/15023560
has comment: http://stackoverflow.com/comment/47465871
has comment: http://stackoverflow.com/comment/47466169
possible better answer: http://stackoverflow.com/a/29663957
has comment: http://stackoverflow.com/comment/47465806
has answer: http://stackoverflow.com/a/29663957
accepted answer: http://stackoverflow.com/a/29663623
type: AnsweredQuestion
has body: function fibonacci(n) { return (function(a, b, i) { return (i &lt; n) ? arguments.callee(b, a + b, i + 1) : a; })(1, 1, 1); } Hey, I am a rookie, I could understand the math logical part of this function, what I did not understand is the parameter passing progress, it passes (1,1,1) to the function(a b i), which seems not very normal. function fibonacci(n) { return (function(a, b, i) { return (i &lt; n) ? arguments.callee(b, a + b, i + 1) : a; }) regular function pass a parameter like the way function(1 1 1) } I can not understand this, I tried to abstract it into finally the function fibonacci(n){ return()() } format, but how could this pass the parameter, I guess it is something about the return call could not handle a function call after it which also works in it. So, is there some basic stuff I havent learnt? Like some default format like the entries in MDN? Thnx a lot.
has title: Javascript: About Return()() format tail recursion in Fibonacci function
has answer: http://stackoverflow.com/a/29663623
type: Question
score: 0
answer count: 2
tagged with: javascript
linked to: http://stackoverflow.com/q/29663125
has comment: http://stackoverflow.com/comment/47465786
tagged with: tail-recursion

http://stackoverflow.com/comment/118767908
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/52382922
type: Comment
has text: @Georgios set numberOfLines to 1?

http://stackoverflow.com/a/29682785
answers question: http://stackoverflow.com/q/29682277
score: 0
has comment: http://stackoverflow.com/comment/47513807
type: Answer
has comment: http://stackoverflow.com/comment/47503269
has body: One simple way is breaking down the big if block of the search in one if per condition. For each condition, increment a variable indicating the number of matches (matches). The contract is good if matches > 0 and the percentage is 100 * matches / total_number_of_conditions. Something like this: ... var matches = 0; var total_number_of_conditions = 9; if (brandCheck == contract[p].brand) matches += 1; if (model.value == contract[p].model) matches += 1; if (networkCheck == contract[p].network) matches += 1; if (minutes &gt;= contract[p].minutes) matches += 1; if (e.value == contract[p].texts) matches += 1; if (f.value == contract[p].data) matches += 1; if (g.value == contract[p].upcost) matches += 1; if (h.value == contract[p].monthlycost) matches += 1; if (i.value == contract[p].length) matches += 1; if (matches &gt; 0) { var percentage_matched = 100 * (matches / total_number_of_conditions); document.write(contract[p].brand + " " + contract[p].model + " " + contract[p].network + " " + contract[p].minutes + " " + contract[p].texts + " " + contract[p].data + " " + contract[p].upcost + " " + contract[p].monthlycost + " " + contract[p].length + " " + percentage_matched + "% &lt;/br&gt;"); } ... There are, of course, many other more configurable and complex solutions for separating and applying the conditions, such as a list of "matcher" objects, one for each condition, etc.

http://stackoverflow.com/a/29634953
downvote count: 0
answers question: http://stackoverflow.com/q/29634893
type: Answer
has comment: http://stackoverflow.com/comment/47412924
has body: You need to send the argument pass (that you are retrieving in the server side) as a query string value in the URL that you are calling in the JS code: '/pedidoOnline/index.php/Pedidos/search?pass=' + $('#codigo_fabricante').val() JS $("#produto").autocomplete({ source: '/pedidoOnline/index.php/Pedidos/search?pass=' + $('#codigo_fabricante').val(), minLength: 2, focus: function(event, ui) { $("#produto").val(ui.item.label); return false; }, select: function(event, ui) { $('#procura_produto').val(ui.item.id); preencherLinhaProduto(ui.item.id); } });
score: 1
upvote count: 1

http://stackoverflow.com/a/29558964
answers question: http://stackoverflow.com/q/29558856
upvote count: 1
has comment: http://stackoverflow.com/comment/47268489
has comment: http://stackoverflow.com/comment/47268089
has body: you can change the src of the img tag using JavaScript as below, function hover(element) { element.setAttribute('src', '//cdn.shopify.com/s/files/1/0816/3411/t/3/assets/logo_2x.png'); } function unhover(element) { element.setAttribute('src', '//cdn.shopify.com/s/files/1/0816/3411/t/3/assets/logo_hover_2x.png'); } and the html be &lt;img id="my-img" src="http://dummyimage.com/100x100/000/fff" onmouseover="hover(this);" onmouseout="unhover(this);" /&gt; After Edit : If you want to change it on some timeout, You need to put your below code inside window.onload = function() {} var images = new Array(); images[0] = "logo_1.png"; images[1] = "logo_2.png"; var images = new Array(); for (var i = 0; i &lt; 2; i++) { images.push("logo_" + i + ".png"); } var x = 0; function changeImage() { document.getElementById('ad').src = images[x]; if (x &lt; 8) { x += 1; } else { x = 0; } if (window.addEventListener) { window.addEventListener('load', changeImg, false); } function changeImg() { var x = 0; setInterval(function() { changeImage() },5000); } HTML: &lt;img id="ad" src="//cdn.shopify.com/s/files/1/0816/3411/t/3/assets/logo_2x.png" /&gt;
has comment: http://stackoverflow.com/comment/47270063
type: AcceptedAnswer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47268645
has comment: http://stackoverflow.com/comment/47268920
type: Answer
has comment: http://stackoverflow.com/comment/47268810
has comment: http://stackoverflow.com/comment/47268075
has comment: http://stackoverflow.com/comment/47268567
has comment: http://stackoverflow.com/comment/47269296
accepted answer of: http://stackoverflow.com/q/29558856

http://stackoverflow.com/comment/47500552
comment on: http://stackoverflow.com/q/29681743
has text: instead of 'pop-up' swap that keyword out for 'modal', 'overlay' or 'lightbox' when searching google. To get started with a simple modal, you can create a div with whatever elements you want and hide it initially by giving it display:none; then in jquery, when someone clicks on that button, change display:block; You can then start getting more technical with adding bg-overlay, ajax etc.
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/comment/47489127
score: 3
has text: Yes, it would be great if you could replicate the problem in a JSFiddle
comment on: http://stackoverflow.com/q/29675712
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47420394
score: 0
has text: it just don't return any errors... it was working, but i though it was ugly too, thanks for the tip ! About the question, i just don't get nothing in the console, i think i should get the parameter using the url but i actully have no idea how to do this...
comment on: http://stackoverflow.com/q/29639002
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47253190
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29549006
type: Comment
has text: @RainbowDasher let me know if you can not get it to work

http://stackoverflow.com/comment/47394057
comment on: http://stackoverflow.com/q/29625335
has text: replace the `document.write(signature)` with the snippet in the comment here above ( from Marimuthu)
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29575093
has comment: http://stackoverflow.com/comment/47309358
has comment: http://stackoverflow.com/comment/47300003
has comment: http://stackoverflow.com/comment/47298873
upvote count: 2
has comment: http://stackoverflow.com/comment/47299348
has comment: http://stackoverflow.com/comment/47320932
has comment: http://stackoverflow.com/comment/47308157
answers question: http://stackoverflow.com/q/29573700
has comment: http://stackoverflow.com/comment/47322032
type: Answer
downvote count: 1
has comment: http://stackoverflow.com/comment/47306264
has comment: http://stackoverflow.com/comment/47321248
has comment: http://stackoverflow.com/comment/47299439
has comment: http://stackoverflow.com/comment/47302163
has body: I find this question really interesting. Even though I'm a little late, I would like to share my solution on how to accomplish this with regex. The solution is concise but not very readable. While I like it for its conciseness, I probably would not use it my code, because it's opacity reduces the maintainability. var str1 = "test xyz", str2 = "test ab xyz" replacement = ''; var regex = new RegExp(str1.split('').map(function(char){ return char.replace(/[.(){}+*?[|\]\\^$]/, '\\$&amp;'); }).join('(.*)')); if(regex.test(str2)){ for(i=1; i&lt;str1.length; i++) replacement = replacement.concat('$' + i); var difference = str2.replace(regex, replacement); } else { alert ('str2 does not contain str1'); } The regular expression for "test xyz" is /t(.*)e(.*)s(.*)t(.*) (.*)x(.*)y(.*)z/ and replacement is "$1$2$3$4$5$6$7". The code is no longer concise, but it works now even if str1 contains special characters.
has comment: http://stackoverflow.com/comment/47322071
has comment: http://stackoverflow.com/comment/47299200
score: 1

http://stackoverflow.com/q/29638928
tagged with: tedious
tagged with: node.js
type: AnsweredQuestion
downvote count: 1
has comment: http://stackoverflow.com/comment/47428739
type: Question
has comment: http://stackoverflow.com/comment/47424346
has answer: http://stackoverflow.com/a/29693228
upvote count: 0
tagged with: javascript
score: -1
has body: I am not able to capture this node.js tedious error ConnectionError: Failed to connect to sqlserverip:1433 which making my express server crash unexpectedly. Can anyone please suggest me what I should do to avoid such crashes? tedious@1.2.2 tedious-connection-pool@0.3.2 node --version v0.10.33 my tedious program is here: // mssql.js // mssql.js "use strict"; // Import modules var path = require('path'); var async = require('async'); var fs = require('fs'); var ConnectionPool = require('tedious-connection-pool'); var Request = require('tedious').Request; var TYPES = require('tedious').TYPES; // Export module with Namespace var swmssqlc = exports; // Constants var DEFAULT_CONNLIMIT_MAX = 30; var DEFAULT_CONNLIMIT_MIN = 0; var DEFAULT_USEUTC = true; var DEFAULT_REQUESTTIMEOUT = 15000; var DEFAULT_CONNTIMEOUT = 15000; /** * MSSQL Class Wrapper for SolarWinds * @param {object} connProp: this contains all the following connection properties * @param {string} connProp.user: user of database account * @param {string} connProp.password: password for database account * @param {string} connProp.database: database name * @param {string} connProp.instanceName: instance name * @param {string} connProp.host: hostname of server * @return {object} object */ swmssqlc.SWDBClient = function SWDBClient(connProp) { this.user = connProp.user; this.password = connProp.password; this.database = connProp.database; this.instanceName = connProp.instanceName; this.connectTimeout = connProp.connectTimeout || DEFAULT_CONNTIMEOUT; this.requestTimeout = connProp.requestTimeout || DEFAULT_REQUESTTIMEOUT; this.useUTC = connProp.useUTC || DEFAULT_USEUTC; this.host = connProp.host; this.connectionLimitMax = connProp.connectionLimitMax || DEFAULT_CONNLIMIT_MAX this.connectionLimitMin = connProp.connectionLimitMin || DEFAULT_CONNLIMIT_MIN this.pool = null; this.connProp = { server : this.host, userName : this.user, password : this.password, options : { database : this.database, instanceName : this.instan…
has title: node.js tedious ConnectionError: Failed to connect to sqlserverip:1433 crashing express server
tagged with: express
tagged with: sql-server
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/29693228
has comment: http://stackoverflow.com/comment/47445887

http://stackoverflow.com/comment/47506844
score: 0
type: Comment
type: QuestionComment
has text: Probably this sign -> ®
comment on: http://stackoverflow.com/q/29684982

http://stackoverflow.com/comment/47259205
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29554109
type: Comment
has text: Thanks, "it's pass by reference" doesn't make much sense to me without specifying that each DOM node can have only one parent, like [this answer](http://stackoverflow.com/a/11673746/2545680) does. Please, expand you answer with this bit of information from the linked answer and I'll accept your answer.

http://stackoverflow.com/comment/47304156
type: QuestionComment
comment on: http://stackoverflow.com/q/29577791
has text: can you please show me your all anchors? with design?
score: 0
type: Comment

http://stackoverflow.com/comment/47572723
comment on: http://stackoverflow.com/a/29651480
score: 0
type: Comment
has text: I went with different strategy, I pulled cert file from server over https to local storage and access it from there, user will have to type in cert password, although I am not sure about all security implications here. Someone might get cert from localstorage but will not know the password.
type: AnswerComment

drupal
type: Tag
tags question: http://stackoverflow.com/q/29535273
tags question: http://stackoverflow.com/q/29678003
tag name: drupal

http://stackoverflow.com/comment/47271399
has text: Why you want to do this? Ng-click does exaclty what you want. Why to directive a directive?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29560750
score: 2

http://stackoverflow.com/a/29603146
has comment: http://stackoverflow.com/comment/47352211
has body: If you use jQuery you could do this: $('#side_menu li:not(:first)').remove();
score: -1
answers question: http://stackoverflow.com/q/29603059
upvote count: 0
has comment: http://stackoverflow.com/comment/47352876
has comment: http://stackoverflow.com/comment/47352298
has comment: http://stackoverflow.com/comment/47352454
has comment: http://stackoverflow.com/comment/47352399
has comment: http://stackoverflow.com/comment/47353123
type: Answer
downvote count: 1

http://stackoverflow.com/a/29599141
answers question: http://stackoverflow.com/q/29599111
upvote count: 7
has comment: http://stackoverflow.com/comment/47344922
score: 7
has body: Try like this: $(document).ready(function() { $.ajaxSetup({ cache: false }); }); i.e, you need to call the jQuery.ajaxSetup() method and pass the value false to the cache property which will causes jQuery to disable caching on ajax calls. As answered here by Jitesh you can try this: $.ajaxSetup({ cache: true}); $.getJSON("/MyQueryUrl",function(data,item) { // do stuff with callback data $.ajaxSetup({ cache: false}); });
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/29599111

http://stackoverflow.com/comment/47375404
has text: Glad to be of service! To make the answer more visible to other viewers could you mark as answer and upvote? To answer your question, I'm probably referencing require.js in the same way you are, via a script tag that looks something like this: ` `
type: AnswerComment
score: 1
comment on: http://stackoverflow.com/a/29585065
type: Comment

http://stackoverflow.com/a/29596121
type: Answer
answers question: http://stackoverflow.com/q/29596077
upvote count: 1
downvote count: 0
score: 1
has body: you should write: document.write(' Tableau des ventes '); Fventes(mois, ventes); document.write(' ');

http://stackoverflow.com/comment/47338754
comment on: http://stackoverflow.com/q/29595942
has text: If `obj = {foo: 'bar',data: {}}; obj.data.hello = obj.foo;` isn't an option, I'm not aware of any way to do that in object declaration.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29647685
has title: Accessing variable in an each loop javascript/jquery
has answer: http://stackoverflow.com/a/29647741
has body: I appreciate this is a common issue, but I'm new to JavaScript/JQuery and I can't work it out. I'm in a .each loop creating a new polygon in a google map and while I'm correctly able to access my polygon data as I iterate the model I get the same value for the colour. Polygon colour is always green. This is kind of expected as I know there is an issue with scoping/loops/closures in JavaScript but I don't understand why I get one here and not the other. var model = { crags: [{ name: "Stanage", cragColor: "'#FF0000'", coords: [new google.maps.LatLng(53.360470, -1.646050), new google.maps.LatLng(53.359523, -1.647895), new google.maps.LatLng(53.351006, -1.637123), new google.maps.LatLng(53.351364, -1.627167)] }, { name: "Burbage", cragColor: "'#00AA00'", coords: [new google.maps.LatLng(53.341489, -1.606224), new google.maps.LatLng(53.338148, -1.605190), new google.maps.LatLng(53.338145, -1.600849), new google.maps.LatLng(53.341501, -1.604020)] }, { name: "Higgar", cragColor: "'#0000BB'", coords: [new google.maps.LatLng(53.340912, -1.611288), new google.maps.LatLng(53.338048, -1.612833), new google.maps.LatLng(53.339762, -1.608670)] }] } getCragName: function (index) { return model.crags[index].name; } $.each(controller.getCrags(), function (index, value) { var polygon = new google.maps.Polygon({ paths: value.coords, strokeColor: value.cragColor, strokeOpacity: 0.8, strokeWeight: 3, fillColor: value.cragColor, fillOpacity: 0.35 }); polygons.push(polygon); polygon.setMap(map); }); The full code can be found in this jsfiddle http://jsfiddle.net/erskmcha/
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29647830
score: -1
has answer: http://stackoverflow.com/a/29647830
type: Question
answer count: 2
downvote count: 2
tagged with: google-maps
upvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/29647741
has comment: http://stackoverflow.com/comment/47435391

http://stackoverflow.com/a/29558375
score: 2
has comment: http://stackoverflow.com/comment/47268448
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47267485
type: Answer
has body: Giving it a chance to render works in Chrome: In the script I have script.js: x=1, script2.js: y=1 and script3.js:z=1 Result: 4 Scripts after 3 1 1 1
accepted answer of: http://stackoverflow.com/q/29557911
downvote count: 0
answers question: http://stackoverflow.com/q/29557911

http://stackoverflow.com/comment/47588433
comment on: http://stackoverflow.com/q/29539135
has text: How do I toggle fullscreen mode from the outside? I don't think every browser supports a parameter on every OS causing the browser to start in full screen.. :/
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47259627
type: Comment
type: QuestionComment
has text: you're missing the point of the question, sorry... and again, in JS it's always pass by value, although the value can be either a primitive or a reference
comment on: http://stackoverflow.com/q/29554076
score: 0

http://stackoverflow.com/comment/47451247
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29653522
has text: What kind of TIFF files? Color, bitonal, single or multi-page? The answer to these questions will determine what software you should use to view them.

http://stackoverflow.com/comment/47317185
comment on: http://stackoverflow.com/a/29584400
score: 0
type: AnswerComment
type: Comment
has text: Would you please explain your code a bit? It works as I wanted but I can't understand how it works, and this ~ confuses me most.

http://stackoverflow.com/comment/47217531
type: Comment
comment on: http://stackoverflow.com/a/29532107
has text: Thanks - thats really good. I see how i will be able to check if it already has been hovered, but how can I identify which popup is to open afterwards. For example I''ll call openToolTip() if it already has been hovered isntead of createToolTIp. How will the open function be able to identify which popup is to open?
score: 0
type: AnswerComment

http://stackoverflow.com/q/29642528
has answer: http://stackoverflow.com/a/29643788
has title: jQuery mouseout effect failed
possible better answer: http://stackoverflow.com/a/29642606
has answer: http://stackoverflow.com/a/29642606
tagged with: mouseout
has answer: http://stackoverflow.com/a/29644015
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47426353
type: Question
tagged with: javascript
tagged with: jquery
score: 0
accepted answer: http://stackoverflow.com/a/29643788
has answer: http://stackoverflow.com/a/29643140
has body: I made a nav effect demo by jQuery, and i want the effect: when mouseover, the name of the mobile phone show, the mobile phone hide; and when mouseout, the mobile phone show and the name of the mobile phone hide; But the mouse out effect don't work. Anyone has any idea? Thanks very much! here is the jQuery Code. $(document).ready(function(){ //initial $("#active").css("left", $("#a1").offset().left); $("#navul").on("mouseover","a" ,function(){ $(this).html('&lt;li&gt;&lt;img src="img/00'+$(this).attr('num')+'a.png"&gt;&lt;/li&gt;'); //$("#active").stop().animate({left: $(this).offset().left},400); }); $("#navul").on("mouseout","a" ,function(){ $(this).html('&lt;li&gt;&lt;img src="img/00'+$(this).attr('num')+'.png"&gt;&lt;/li&gt;'); }); }); and here is the demo http://54.69.15.179/autemp
answer count: 4

http://stackoverflow.com/q/29650446
has body: (It's my first app in meteor) I have problem I can't get data from collection. I'm going to make calendar. I have collection with names of days and have array with this month days and mondey is 0 etc. In collection i have name and index and I'd like to display name of day if index is equal to number of day in array I don't know if I do it good. It's note all my app code and it's sorted in folders but i just copied code where I need help {{#each months}} {{name}} {{/each}} {{days}} {{#each daysofweek}} {{index}} {{/each}} {{#each generateCalendar}} {{#each this}} {{day}}: {{dayOfWeek}} {{/each}} {{/each}} db = new Array; db['dayoftheweek'] = new Mongo.Collection('dayoftheweek'); db['months'] = new Mongo.Collection('months'); Template.calendar.helpers({ 'daysofweek': function () { return db['dayoftheweek'].find(); }, 'generateCalendar': function () { var tab = []; var daysInMonth = Session.get('currentMonthDays'); var fDay = Session.get('currentMonthFDay'); for (var i = 1; i <= daysInMonth; i++) { tab[i] = {day: i, dayOfWeek: fDay}; if (fDay === 6) { fDay = 0; } else { fDay++; } } var weeks = []; var i = 0; while (tab.length > 0) { if (i === 0) { weeks[i] = tab.splice(0, (8 - Session.get('currentMonthFDay'))); i++; } else { weeks[i] = tab.splice(0, 7); i++; } } return weeks; } }); Meteor.methods({ 'removeFromDb': function(selected, dbname){ db[dbname].remove(selected); } });
type: UnansweredQuestion
score: 1
has title: Meteor : getting data from collection
upvote count: 1
has answer: http://stackoverflow.com/a/29650731
type: Question
tagged with: javascript
tagged with: mongodb
answer count: 1
downvote count: 0
tagged with: meteor
favorite count: 0

http://stackoverflow.com/a/29662902
downvote count: 0
has body: First remove the "=" . for a string display in the console you can use the methode stringify of the JSON object jQuery('.convert').click(function(){ jQuery.get("https://rate-exchange.herokuapp.com/fetchRate?from=EUR&amp;to=CAD&amp;callback", function(data){ console.log("Data: " +JSON.stringify(data) ); }, 'json'); }); or for display an object in the console you can juste write : jQuery('.convert').click(function(){ jQuery.get("https://rate-exchange.herokuapp.com/fetchRate?from=EUR&amp;to=CAD&amp;callback", function(data){ console.log(data ); }, 'json'); }); the result : Object {To: "CAD", From: "EUR", Rate: "1.3138"}
upvote count: 2
has comment: http://stackoverflow.com/comment/47466922
has comment: http://stackoverflow.com/comment/47466986
answers question: http://stackoverflow.com/q/29662673
has comment: http://stackoverflow.com/comment/47465589
type: Answer
score: 2

http://stackoverflow.com/comment/47315797
type: Comment
score: 0
type: AnswerComment
has text: Stack Overflow is not about 'asking the question that was asked'. You should be more concerned if other people viewing this question will benefit from it, and not only the question author.
comment on: http://stackoverflow.com/a/29583345

http://stackoverflow.com/comment/47530069
score: 0
type: Comment
type: QuestionComment
has text: @aergistal I tried to make a MPD parser with JS, but this is expensive in terms of time. I believe that if I can use a mpd parser already done from another source(for example dashif), and use that to parse mpd file, i'll spend less work instead of to make it from zero.
comment on: http://stackoverflow.com/q/29652373

http://stackoverflow.com/comment/47440108
type: AnswerComment
has text: No need to be sorry, I am just trying to help you. I recommend you add the full JavaScript code and HTML, then we can see where the error :)
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29596981

http://stackoverflow.com/a/29537109
has body: It is because .html() returns a string which does not have the not method. $(document).ready(function() { $("p.mod-articles-category-readmore a").each(function() { var str = $(this).contents().filter(function(){return this.nodeType==3}).text(); $(this).html(str) }); }); Instead you can just remove the svg element so $(document).ready(function() { $("p.mod-articles-category-readmore a svg").remove(); });
score: 0
answers question: http://stackoverflow.com/q/29536892
type: Answer
has comment: http://stackoverflow.com/comment/47227893
has comment: http://stackoverflow.com/comment/47226740

http://stackoverflow.com/comment/47275430
score: 0
type: Comment
type: QuestionComment
has text: No it's not a seperate page, I have only one page in my app with header, content and footer and glue RSS links to the content with jQuery('#result').html(html); . RSS liks are external links that I intend to open them inside my app (not in a brower) with the same header and footer, but they disappeared when I click on them.
comment on: http://stackoverflow.com/q/29541441

pseudocode
tags question: http://stackoverflow.com/q/29634292
tag name: pseudocode
type: Tag

http://stackoverflow.com/comment/47409487
has text: And the script could come from anywhere, it's probably included by the theme or a plugin etc ?
type: QuestionComment
comment on: http://stackoverflow.com/q/29633511
type: Comment
score: 0

http://stackoverflow.com/a/29567730
has comment: http://stackoverflow.com/comment/47440678
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/47451468
has body: For your first problem, I am guessing you want to know how to get the button to change the slider? Is that what you are asking? The following should do what you want: document.getElementById("slider1").value = &lt;some random value&gt;; refresh(); function randomString() { document.getElementById("slider1").value = getRandomInt(5,28); refresh(); } function getRandomInt(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; } function refresh(){ console.log("a"); var slider1 = parseInt(document.getElementById("slider1").value); document.getElementById("circleP").setAttribute("r", slider1) } &lt;div&gt; &lt;input id="slider1" type="range" min="5" max="28" onchange="refresh()" value="5"/&gt; &lt;input id="randomCicle" type="button" value="Press here to activate" onclick="randomString();"/&gt; &lt;/div&gt; &lt;svg width="200" height="200px" viewBox="0 0 60 60"&gt; &lt;circle id="circleP" cx="30" cy="30" r="5"/&gt; &lt;/svg&gt; As to your second question. The flower is being cut off because you are drawing off the edge (specifically the top) of the pattern area. If you change your patternTransform to "rotate(0)", you will be able to see exactly what is happening.
has comment: http://stackoverflow.com/comment/47444271
has comment: http://stackoverflow.com/comment/47440594
answers question: http://stackoverflow.com/q/29563370

http://stackoverflow.com/comment/47351566
comment on: http://stackoverflow.com/q/29602140
has text: `\n` does not exists under HTML, only in Javascript.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29549839
has comment: http://stackoverflow.com/comment/47251364
score: 3
answer count: 0
has comment: http://stackoverflow.com/comment/59326527
upvote count: 3
linked to: http://stackoverflow.com/q/29453829
has comment: http://stackoverflow.com/comment/47257871
type: Question
has body: Meteor Accounts auto-resumes your login session by default, which is pretty handy for most applications. However, in my case, I need to disable this functionality. What is the best/proper way to remove this feature so that if the browser window is closed and reopened, the login session does not persist? Thanks in advance.
has comment: http://stackoverflow.com/comment/47297093
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/55880901
has comment: http://stackoverflow.com/comment/47257810
has comment: http://stackoverflow.com/comment/47257982
has comment: http://stackoverflow.com/comment/47257949
tagged with: meteor
has comment: http://stackoverflow.com/comment/47257928
favorite count: 0
has title: How to Disable "Auto-resume Login" / "Remember Me" functionality for Meteor Accounts
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47257995
tagged with: meteor-accounts

http://stackoverflow.com/q/29612612
tagged with: javascript
has answer: http://stackoverflow.com/a/29613224
score: 0
answer count: 2
has body: I am a javascript noob. I am currently learning how to check if the checkboxes are checked. This is the code: Javascript form - input text Field Click on your favourite fruits Strawberry banana apple kiwi What I am trying to do is when the user clicks on the 'validate' button, the output function gets called which passes the form as a reference. in the function, it takes the checkboxes as arrays and then loops through each of the checkboxes checking if they are ticked. If any of the boxes are ticked, then the value is concatinated to the outputt string. EDIT: I managed to fix the problem although I don't quite understand the solution. So in the below code, the function ouput() takes a parameter of checkBoxArray and this reference comes from the button 'validate'. What if there were 2 checkbox inputs in my form (i.e. one for favourite drinks and one for favourite fruits). How would the browser know which checkbox to check? Javascript form - input text Field Click on your favourite fruits Strawberry banana apple kiwi
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/6058420
has comment: http://stackoverflow.com/comment/47371712
has comment: http://stackoverflow.com/comment/47373088
has answer: http://stackoverflow.com/a/29613115
has title: How to get values of checked boxes by passing form as a reference?
type: Question

http://stackoverflow.com/comment/47410663
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29634157
has text: You'd have to interpret the content of the initial page, find URLs there, and repeat with those pages etc.
score: 1

http://stackoverflow.com/a/32098983
type: Answer
answers question: http://stackoverflow.com/q/29683182
has body: After a lot of research i found that TableSaw was the closest to the goal of responsive tables, allowing to stack tabular data when in small screens: https://github.com/filamentgroup/tablesaw Honorable mentions: FooTable: Seems like TableSaw but more customizable, as well as a little harder to set up. https://github.com/fooplugins/FooTable FancyTree: Overkill, it's too op (Over Powered), use only if complex apps, simple responsive ones will reach bottleneck faster if not setup with care as it has large amount of features. https://github.com/mar10/fancytree
score: 0

http://stackoverflow.com/a/29684490
has body: Is there a reason you're using javascript to show woodenPickaxePopup div? You can achieve the same thing without javascript. Here's a working update: http://jsfiddle.net/RBJ9R/1600/ The parts that changed: #woodenPickaxePopup{ height: 50px; width: 158px; background: white; display: none; position: absolute; // changed to absolute top: 50px; } // added this .craftWoodenPickaxe { position: relative; } // added this .craftWoodenPickaxe:hover #woodenPickaxePopup { display: block; }
has comment: http://stackoverflow.com/comment/47506627
accepted answer of: http://stackoverflow.com/q/29684218
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29684218
type: Answer
has comment: http://stackoverflow.com/comment/47511820
has comment: http://stackoverflow.com/comment/47512044
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47507610

http://stackoverflow.com/comment/47465327
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29657813
has text: Yes, thanks. What about that `sync` method?

http://stackoverflow.com/comment/75907002
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29587682
has text: did you find a solution?

http://stackoverflow.com/q/29653796
has comment: http://stackoverflow.com/comment/47497942
score: 1
upvote count: 1
has body: I am using JQuery to manipulate text on a HTML document and I need to test drive this process. However, I can't find anywhere syntax that would enable me to do this? My code is: $("#temperature").css({ 'color' : 'orange', 'font-size' : '200%' });
type: Question
has comment: http://stackoverflow.com/comment/47447393
tagged with: javascript
tagged with: jquery
answer count: 2
has answer: http://stackoverflow.com/a/29653985
downvote count: 0
has title: How can I test text colour with Jasmine when working in Jquery?
has answer: http://stackoverflow.com/a/29653893
tagged with: jasmine
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/47288701
has text: I just tried `ng-src` but unfortunately no change but I will take a look at that question
type: Comment
comment on: http://stackoverflow.com/q/29569123
type: QuestionComment
score: 0

http://stackoverflow.com/q/29618123
tagged with: angularjs
has title: AngularJS - How to validate an element directive?
has answer: http://stackoverflow.com/a/29619949
type: AnsweredQuestion
score: 1
tagged with: forms
upvote count: 1
has comment: http://stackoverflow.com/comment/47381792
type: Question
has body: I have created a numberDirective function numberInputDirective() { return { restrict: 'E', scope: { model: '=', disabled: '=?', decimals: '=?', form: '=', name: '=' }, require: '^form', replace: true, templateUrl: 'directives/pxNumberInput.html', link: function (scope, element, attrs, form) { scope.inError = function () { return form.control.$valid; //I need to do something like this } } } I need to check in the isError function if the value in the control is valid or not The template is: The HTML is: While the form variable tells me if the form (form.$valid) is valid or not, I need to know this particular directive has a valid value or not when the form is submitted. something like this form.control.$valid. I do not know the name of the control in this directive as it will be set in the html. I tried: var elem = ctrl.$name + '.' + element.attr('name') + '.$valid'; This returns the string "SampleControlsForm.numericExample.$valid" and if I add a watch on it, it doesn't help nor does scope.$eval. I'm sure I'm not using it right.
accepted answer: http://stackoverflow.com/a/29619949
tagged with: javascript
has comment: http://stackoverflow.com/comment/47381611
tagged with: validation
answer count: 1
downvote count: 0
favorite count: 0

http://stackoverflow.com/q/29579277
has body: I have an HTML table on this site The header of the table is fixed with JavaScript. Now I also want the possibility to sort each column. Therefore I used jQuery's tablesorter plugin. The problem is that the JavaScript on codepen.io copys the header of the table. In the DOM there are now two table headers. TableSorter accesses the first table, which was copied, but this table has no tbody so the table won't be sorted by TableSorter. Is there a posibility to have both (table header fixed and sorting by clicking on columns)?
tagged with: css
has comment: http://stackoverflow.com/comment/47318114
tagged with: tablesorter
score: 1
downvote count: 1
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29585973
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
upvote count: 2
type: UnansweredQuestion
has title: jQuery - Make a table with fixed header sortable

http://stackoverflow.com/q/29585729
tagged with: angular-ui-grid
upvote count: 2
linked to: http://stackoverflow.com/q/26621598
has title: ng-click not working from ui-grid checkbox cellTemplate
type: Question
has body: I searched a lot around this problem but didn't get any solution which is actually working out to fulfill my needs. Problem: I wanted to select the row entity on clicking of the checkbox having a columnDef as [{name: 'field01', displayName: '', field: 'field01', cellTemplate: "&lt;input type='checkbox' ng-model='row.entity.field01' ng-click='grid.appScope.myhello()' /&gt;"}]. I am building this columnDef dynamically based on another JSON [Updating Working Code] $scope.columnDef = function(){ var column = [{name: 'field01', displayName: '', field: 'field01', cellTemplate: "&lt;input type='checkbox' ng-model='row.entity.field01' ng-click='grid.appScope.myhello(\"row.entity.field01\")' /&gt;"}], coltype = []; angular.forEach($scope.columns, function(value, index){ coltype = []; switch(value.type){ case "Number": coltype.push({type: "number"}); break; case "String": break; case "Boolean": coltype.push({editableCellTemplate: "ui-grid/dropdownEditor", cellFilter: "mapBool", editDropdownValueLabel: "bool", editDropdownOptionsArray: [{ id: 1, bool: 'Yes' },{ id: 2, bool: 'No' }] }); break; case "Date": coltype.push({type: 'date', cellFilter: 'date:"MM/dd/yyyy"'}); break; } column.push(angular.extend({name: value.name, displayName: value.name, enableCellEdit: (value.edit.indexOf("No") != -1) ? false : true}, coltype[0])); }); return column; }; $scope.gridOptions.data = $scope.datagrid; $scope.gridOptions.columnDefs = $scope.columnDef(); $scope.myhello = function(value){ console.log("It works!!! :-) " + value); }; The above code updates the datagrid JSON of the field01 but it don't call the ng-click function. I referenced two Plunkr one with external-scope in ui-grid Plunkr and another one with defining a method in gridoptions and call it locally Plunkr (In this plunker the ng-click is getting called but when I tried checking the value inside the editUser function it was not working as expected).
tagged with: javascript
has answer: http://stackoverflow.com/a/29586637
score: 2
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/47321118
has comment: http://stackoverflow.com/comment/47320895
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47320071
has comment: http://stackoverflow.com/comment/62691422
type: UnansweredQuestion

http://stackoverflow.com/comment/47400603
type: Comment
comment on: http://stackoverflow.com/a/29628832
score: 0
type: AnswerComment
has text: @DanBeaulieu: Or one could set it to transparent....

http://stackoverflow.com/comment/47491660
score: 0
has text: what does your groovy code look like?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29676842

http://stackoverflow.com/q/29583766
has comment: http://stackoverflow.com/comment/47315923
upvote count: 6
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29946889
score: 6
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/47315666
type: Question
has body: I have a parent &lt;div&gt; with one child &lt;div&gt; in memory - not attached to the current document. I want to trigger a CustomEvent on the child but listen to that event from the parent. Here is my code: var parent = document.createElement('div'); var child = document.createElement('div'); parent.appendChild(child); parent.addEventListener('boom', function(event) { console.log('parent listener', event); // &lt;~ This never runs! }); var event = new CustomEvent('boom', { bubbles: true }); child.dispatchEvent(event); This code doesn't work as expected. The event listener on the parent never fires. This seems to be a contradiction of the JavaScript event system whereby events bubble up from the target. However, if I modify the final two lines of this snippet to the following, the callback fires as I would expect it to: document.body.appendChild(parent); child.dispatchEvent(event); In other words, if I append my fragment as a subtree of the document before dispatching the event, then the parent event listener fires exactly as expected. Why? Is there a way to allow bubbling when using detached DOM elements?
has comment: http://stackoverflow.com/comment/47315783
has title: Why doesn't event bubbling work in detached DOM elements?
has comment: http://stackoverflow.com/comment/58117408
tagged with: dom
has comment: http://stackoverflow.com/comment/47315939
answer count: 1
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29946889
tagged with: dom-events
has comment: http://stackoverflow.com/comment/48015180
favorite count: 0
has comment: http://stackoverflow.com/comment/48136378
has comment: http://stackoverflow.com/comment/47315915
has comment: http://stackoverflow.com/comment/48141935
has comment: http://stackoverflow.com/comment/47315803

http://stackoverflow.com/a/29593275
answers question: http://stackoverflow.com/q/29592689
has body: You can use the following regex: ^[1-9a-wA-WyzYZ][0-9A-Wa-wyz]{5}$ The anchors - ^ and $ - ensure that a whole string should match. Leading zeros are not allowed due to range of [1-9].
score: 0
type: Answer

http://stackoverflow.com/a/29605139
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29605055
has comment: http://stackoverflow.com/comment/47355888
type: Answer
has comment: http://stackoverflow.com/comment/47355972
has body: What are we passing by? JavaScript does not pass objects by reference. It passes objects by reference values like C# and Java. JavaScript is always pass by value - that value might just happen to be a reference to an object. function foo(obj){ obj = {}; } var o = {x: 5}; foo(o); console.log(o.x); // 5, proof that JavaScript is pass-by-value For example, in C++: void foo(int&amp; i){ i = 5; } int j = 10; foo(j); std::cout &lt;&lt; j; // logs 5, this is what pass-by-reference is Primitives in JavaScript are values, passing them by reference would be meaningless since by being values they're immutable anyway (you can't change the number 5). But values have much better! I agree, values have much nicer semantics. You can't return value that will be modified from an unknown location by mistake. It's a lot clearer and it turns out it's very easy to optimize. Immutability in general is gaining a lot of momentum in JavaScript and a lot of people (me included) are using immutable-collections (like ImmutableJS). Note that non-primitive value types are planned but are currently under specification and won't arrive before ES7. This is the only reference I could find about it, I haven't seen it discussed in the discussion mailing list but I hope it's on the way :) Basically, the understanding that we can do this efficiently is much newer than JavaScript. JavaScript is a really fun language but remember it was designed in 10 days by a single guy in urgency. The good stuff like value objects is on its way but we'll have to do with what we have right now. If it makes you feel any better a lot of other languages do this too (like Scala, Java and C#).
upvote count: 3
score: 3
has comment: http://stackoverflow.com/comment/47357919
accepted answer of: http://stackoverflow.com/q/29605055

http://stackoverflow.com/q/29666515
accepted answer: http://stackoverflow.com/a/29680695
score: 0
tagged with: http://stackoverflow.com/tag/json
answer count: 1
has comment: http://stackoverflow.com/comment/47478960
tagged with: javascript
tagged with: jquery
tagged with: ajax
type: AnsweredQuestion
has title: Jquery cannot skipped evaluation of first json result
type: Question
has answer: http://stackoverflow.com/a/29680695
has body: I want to evaluate a set of JSON results but somehow the first result is always skipped. My Jquery code is as follows: function check_product_cash_discount(total_id){ //check for cash discount $.ajax({ url:siteurl+"checkout/get_cash_discount_ajax/", type:"POST", success:function(res){ var parsed = JSON.parse(res); var this_product_total = $(total_id).text(); $.each(parsed,function(k,v){ var amount = v.cash_discount_amount; //console.log(v); if(this_product_total &gt;= amount){ $(total_id).text(v.cash_discount_percentage); console.log(amount); } }); } }); } The result from the AJAX call is "res" and I parsed it with JSON.parse and place in "parsed". The value(v) of the result is as follows when console.log(v) with $.each: Object {cash_discount_id: "4", cash_discount_amount: "1000", cash_discount_percentage: "10"} Object {cash_discount_id: "3", cash_discount_amount: "800", cash_discount_percentage: "8"} Object {cash_discount_id: "2", cash_discount_amount: "300", cash_discount_percentage: "7"} My question is this: how come the variable "this_product_total" skips the first JSON result object when it is smaller that the variable "amount" in the "if" statement? when I console.log(amount), the log shows 1000, 300 and 200 when the text, in variable "this_product_total" is 512.89? The values in "amount" and "thid_product_total" are true when I evaluated them with $.isNumeric(); Please help.
has comment: http://stackoverflow.com/comment/47472083

http://stackoverflow.com/a/29589539
has comment: http://stackoverflow.com/comment/110699516
type: Answer
has comment: http://stackoverflow.com/comment/47338820
answers question: http://stackoverflow.com/q/29587488
score: 11
accepted answer of: http://stackoverflow.com/q/29587488
downvote count: 1
upvote count: 12
type: AcceptedAnswer
has body: A solution using underscore: var props = ['userId', 'replyToId']; var notNull = _.negate(_.isNull); var groups = _.groupBy(record.notes, function(note){ return _.find(_.pick(note, props), notNull); });

http://stackoverflow.com/a/29667263
answers question: http://stackoverflow.com/q/29666449
upvote count: 5
score: 5
downvote count: 0
has body: Bootstrap comes with methods for showing & hiding modals. With bootstrap 3 you can do: $("#pop").on("click", function() { $('#imagemodal').modal('show'); $('#imagemodal').on('shown.bs.modal', function() { $('#imagemodal').find('.modal-body').append(' append some html here '); }); });
type: Answer

http://stackoverflow.com/comment/47274258
type: Comment
has text: tried with jqury+="" but no use.
score: 0
comment on: http://stackoverflow.com/q/29561850
type: QuestionComment

http://stackoverflow.com/comment/47235700
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29541959
has text: I agree, the OP is confusing. It's one or the other :)

http://stackoverflow.com/comment/47304647
has text: Here is the MDN documentation on Date. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date and something about ISO time http://en.wikipedia.org/wiki/ISO_8601
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29578035

http://stackoverflow.com/comment/47333530
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29592872
has text: @webduvet i got the response from my Firefox who gave this error: [error](http://puu.sh/hbltA/fed87a3ef4.png)

http://stackoverflow.com/comment/47281298
type: Comment
has text: Yes, I have control, and they are on the same domain.
type: QuestionComment
comment on: http://stackoverflow.com/q/29565189
score: 0

http://stackoverflow.com/comment/47360161
score: 1
comment on: http://stackoverflow.com/q/29607221
has text: would you mind making a jsfilddle so we can better identify the problem with a working example?
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47251319
comment on: http://stackoverflow.com/q/29549836
score: 0
type: QuestionComment
has text: You may get an error somewhere else in your js and the function may not get called because of that. Or maybe you call the function before it is defined. Anyway... there is no problem in the code you posted. Or... after reading your comment... do you call the function at all?
type: Comment

http://stackoverflow.com/q/29621015
favorite count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/4015613
answer count: 0
tagged with: back
has title: The meaning of History object (pushState, popState, ReplaceState) in JavaScript
upvote count: 1
type: Question
tagged with: history
tagged with: pushstate
tagged with: javascript
has comment: http://stackoverflow.com/comment/47386110
has body: I want to get knowledge about History object in JavaScript(also History.pushState, History.PopState , ...) . but except the following link, https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history Also this link: http://diveintohtml5.info/history.html I couldnt find anything comprehensive specially in examples and usages. Could any one help me about that? Thanks for any help
downvote count: 0
tagged with: popstate
score: 1

http://stackoverflow.com/comment/47287794
has text: Can't really get it to work $( window ).resize(function() { this line also completly messes up the animation
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29569194
type: AnswerComment

http://stackoverflow.com/comment/47432614
type: Comment
type: QuestionComment
has text: @VisualBean Use `Array.prototype.filter` instead of `forEach` and pushing to a `newArray` - e.g. `return array.filter(function (entry) { return entry.description !== undefined })`. I don't think your problem is related to the comparison, that's why I asked for a sample array of data to try out.
score: 0
comment on: http://stackoverflow.com/q/29644870

http://stackoverflow.com/q/29668915
has answer: http://stackoverflow.com/a/29669154
tagged with: javascript
has comment: http://stackoverflow.com/comment/47476347
type: Question
has title: HTML select onChange doesnt work
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47476250
has comment: http://stackoverflow.com/comment/47476435
has answer: http://stackoverflow.com/a/29669270
score: 0
has answer: http://stackoverflow.com/a/29668995
has body: I am not any kind of proficient in JavaScript. So I wrote a simple function to use on HTML SELECT, but it doesn't work. JavaScript: HTML: ... Any help will be highly appreciated
has comment: http://stackoverflow.com/comment/47476538
possible better answer: http://stackoverflow.com/a/29669071
answer count: 4
accepted answer: http://stackoverflow.com/a/29668995
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29669071

http://stackoverflow.com/comment/47307194
type: QuestionComment
has text: I've checked the console and resources, and I'm not seeing any errors
score: 0
comment on: http://stackoverflow.com/q/29579328
type: Comment

http://stackoverflow.com/comment/47475659
score: 0
has text: Formatting and grammar.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29668358

http://stackoverflow.com/a/29555179
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/29555155
upvote count: 2
answers question: http://stackoverflow.com/q/29555155
score: 2
has body: close your quotes html = '&lt;div style="background-image:url('+bg+')"&gt;'

http://stackoverflow.com/q/29597298
accepted answer: http://stackoverflow.com/a/29597383
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/47341393
has body: I have a bunch of letters on each line which is being outputted by the var current. I want to split them into an array and my desired output is shown below my code. current prints out: I T and so on... each letter on a new line. JS: function check(event) { var current = event.target.innerText; var letters = current.split(); for (i=0; i&lt;letters.length; i++) { letters[i] = letters[i].replace(/\s/g,"").split(""); console.log(letters); } } current output = [ [ 'I', 'T', 'U', 'M', 'A', 'R', 'B', 'R', 'D', 'I', 'U', 'T', 'E', 'L', 'N' ] ] desired output = [ 'I', 'T', 'U', 'I', 'M', 'A', 'R', 'B', 'R', 'D', 'U', 'T', 'E', 'L', 'N' ] My problem is that I have two square brackets on my current output. I just want one, as shown in the desired output.
linked to: http://stackoverflow.com/q/10865025
has answer: http://stackoverflow.com/a/29597383
possible better answer: http://stackoverflow.com/a/29597359
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29597359
has title: Letters into split array
type: Question
has comment: http://stackoverflow.com/comment/47341390
tagged with: split
answer count: 2
has comment: http://stackoverflow.com/comment/47341385
tagged with: arrays

http://stackoverflow.com/q/29566376
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29566618
favorite count: 0
type: AnsweredQuestion
has body: I am trying to pass the data from controller to javascript. This is how you do it, respond_to do |format| format.html format.json { render json: {data: @data} } end And then in your view file, you should do this: &lt;%= javascript_tag do%&gt; window.data = &lt;%= raw @data.to_json %&gt; &lt;%end%&gt; &lt;script&gt; for( i = 0; i &lt; data.length; i++ ) { alert(data[i]); } &lt;/script&gt; Make sense. Right? However, above code is when you are passing only one variable in json code i.e. data variable. What I need to do is to pass multiple variables to my javascript code. It should be done as: respond_to do |format| format.html format.json { render json: {data: @data, data1: @data1, data2: @data2} } end Now, - How should I access the data1 &amp; data2 variables in my view file? - Do I need to modify window.data? I tried the below code though and it did not work out. Gave me argument error. &lt;%= javascript_tag do%&gt; window.data = &lt;%= raw @data.to_json, @data1.to_json %&gt; &lt;%end%&gt; Any leads would be appreciated. Cheers!
tagged with: ruby-on-rails
type: Question
upvote count: 5
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/29566618
score: 5
tagged with: ruby-on-rails-4
downvote count: 0
answer count: 1
has title: Pass multiple variables to render json in rails cotroller

http://stackoverflow.com/q/29638179
has title: Javascript background changing based on function
tagged with: button
tagged with: javascript
tagged with: click
score: 0
has answer: http://stackoverflow.com/a/29638283
has answer: http://stackoverflow.com/a/29638297
tagged with: random
has comment: http://stackoverflow.com/comment/47420231
has body: I have to simulate a function that chooses random numbers between 0 and 37 when I click a button. If it's even, the background is red. If it's odd, the background is black. The initial background is light blue. This is what I have so far, and it is not working. Wheel
type: UnansweredQuestion
tagged with: background
type: Question
answer count: 2

http://stackoverflow.com/q/29576059
tagged with: javascript
has comment: http://stackoverflow.com/comment/47300641
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/47300688
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47300743
has answer: http://stackoverflow.com/a/29576348
has answer: http://stackoverflow.com/a/29576175
has comment: http://stackoverflow.com/comment/47300620
has body: I’m trying to make sense of what’s happening in the following code: var dataset = [ {source: "Microsoft", target: "Amazon", type: "licensing"}, {source: "Microsoft", target: "HTC", type: "licensing"}, {source: "Samsung", target: "Apple", type: "suit"}, {source: "Motorola", target: "Apple", type: "suit"}, {source: "Nokia", target: "Apple", type: "resolved"}, {source: "HTC", target: "Apple", type: "suit"}, {source: "Kodak", target: "Apple", type: "suit"}, {source: "Microsoft", target: "Barnes &amp; Noble", type: "suit"}, {source: "Microsoft", target: "Foxconn", type: "suit"}, {source: "Oracle", target: "Google", type: "suit"}, {source: "Apple", target: "HTC", type: "suit"}, {source: "Microsoft", target: "Inventec", type: "suit"}, {source: "Samsung", target: "Kodak", type: "resolved"}, {source: "LG", target: "Kodak", type: "resolved"}, {source: "RIM", target: "Kodak", type: "suit"}, {source: "Sony", target: "LG", type: "suit"}, {source: "Kodak", target: "LG", type: "resolved"}, {source: "Apple", target: "Nokia", type: "resolved"}, {source: "Qualcomm", target: "Nokia", type: "resolved"}, {source: "Apple", target: "Motorola", type: "suit"}, {source: "Microsoft", target: "Motorola", type: "suit"}, {source: "Motorola", target: "Microsoft", type: "suit"}, {source: "Huawei", target: "ZTE", type: "suit"}, {source: "Ericsson", target: "ZTE", type: "suit"}, {source: "Kodak", target: "Samsung", type: "resolved"}, {source: "Apple", target: "Samsung", type: "suit"}, {source: "Kodak", target: "RIM", type: "suit"}, {source: "Nokia", target: "Qualcomm", type: "suit"} ]; var nodes = {}; update(dataset); function update(links){ var i = 1; links.forEach(function(link){ // Pre iteration checks console.log(i); console.log(link.source); console.log(nodes[link.source]); // Observations – initial dataset is being overwritten? // Should the following be read as “if one evaluates to true, do both?” link.source = nodes[link.source] || (nodes[link.source] = {name: link.source, linkCount:0}); // …
has title: Associative array manipulation struggles
type: Question
has comment: http://stackoverflow.com/comment/47300615
tagged with: arrays

http://stackoverflow.com/comment/47283367
comment on: http://stackoverflow.com/q/29566238
score: 0
type: Comment
type: QuestionComment
has text: Perhaps a more sensible solution for this could look like this: http://jsfiddle.net/ad67284f/ …? (Add polyfill of choice for older browsers.)

http://stackoverflow.com/q/29565815
tagged with: javascript
has title: Angular animate from controller
has comment: http://stackoverflow.com/comment/47284370
score: 0
has comment: http://stackoverflow.com/comment/47286658
answer count: 1
has comment: http://stackoverflow.com/comment/47286119
tagged with: angularjs
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/30958218
type: Question
has body: Hi I am trying to animate my object from my controller. Basically, the html contains a image and when I change that from the controller I want to be able to animate it off the screen to the left or to the right. I have some basic things down but they don't seem to work. CSS .img-slide { position: absolute; left: 0; top: 0; width: 100%; height: 350px; } .img-slide.ng-enter, .img-slide.ng-leave { -webkit-transition: all 1s ease; transition: all 1s ease; } .img-slide.ng-enter { left: 100%; } .img-slide.ng-enter-active { left: 0; } .img-slide.ng-leave { left: 0; } .img-slide.ng-leave-active { left: -100%; } HTML &lt;div class='row images'&gt; &lt;div class='col img-slide'&gt; &lt;img src="{{imgSlide}}"/&gt; &lt;/div&gt; &lt;/div&gt; JS $scope.changeImg = function () { //This is where the scope var is update $scope.imgSlide = newImgSlide; //Code to add my animation here };

http://stackoverflow.com/a/29545776
upvote count: 1
has body: You'll want to use a Typed Array to access the buffer. You can directly put that array literal you have into its constructor, it will construct a buffer or the appropriate size. like body=53 54 41 52 54 45 44 3a 31 34 32 38 36 30 32 30 38 37 37 38 36 which I interpret as hex encoded bytes. For that, you can use TypedArray.from with a map function: var msg = "body=53 54 41 52 54 45 44 3a 31 34 32 38 36 30 32 30 38 37 37 38 36"; var arr = Uint8Array.from(msg.slice(5).split(" "), function(byte) { return parseInt(byte, 16); }); var buffer = arr.buffer; // not sure you actually need this
has comment: http://stackoverflow.com/comment/47243703
accepted answer of: http://stackoverflow.com/q/29545531
has comment: http://stackoverflow.com/comment/47244213
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/47244026
type: Answer
has comment: http://stackoverflow.com/comment/47243432
answers question: http://stackoverflow.com/q/29545531
has comment: http://stackoverflow.com/comment/47245087
score: 1

http://stackoverflow.com/comment/60334301
has text: Have a look at Records. They allow some similarity with a more traditional JS object in terms of exposing first class members and extensibility. But they have their own insecurities, see my response below.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/34366357
type: Comment

http://stackoverflow.com/a/29642215
answers question: http://stackoverflow.com/q/29642076
score: 0
type: Answer
has body: The below snippet demonstrates how to change the value and disable the input using strictly JavaScript. document.getElementById("input").value = "0"; document.getElementById("input").disabled = true; &lt;div class="club_member"&gt; &lt;input type="text" size="5" onclick="this.value=''" name="scienceClub" value="2" id="input"&gt; &lt;/div&gt;

http://stackoverflow.com/a/29570329
score: 0
has body: demo $(document).on("pagebeforeshow", "#page", function(){ $.getJSON("res/veri/content.json", function(data){ console.log(data); $.each(data, function (index, value) { $('#list').append(' '+value.title+' ' ); }); }); });
answers question: http://stackoverflow.com/q/29569639
type: Answer
has comment: http://stackoverflow.com/comment/47291980

http://stackoverflow.com/q/29609627
answer count: 3
duplicate of: http://stackoverflow.com/q/13885256
tagged with: javascript
tagged with: show-hide
has title: Hide 4 divs; swap out separately on click
has answer: http://stackoverflow.com/a/29609664
score: 0
has answer: http://stackoverflow.com/a/29610027
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/13885256
type: UnansweredQuestion
type: Question
has body: I have 4 hidden divs on my page each with a "button div" at the top of the page so when I click div1 button, the hidden div1 will show. Then when I click div2 button the div1 hides and div2 appears. I know you can do: function showDiv() { document.getElementById('Div1').style.display = "block"; } INFO But this will only make the div appear and will stay there when the div2 button is pressed. How can I get them to change out as the different buttons are pressed?
has answer: http://stackoverflow.com/a/29609809

http://stackoverflow.com/q/29586411
answer count: 7
favorite count: 0
has body: I'm working on a map-based app that uses Google Map API to create markers and its info window in React.js. The infowindow.setContent() only accepts either a String or HTML. It's impossible for me to pass in String as I have a button that links to a specific method in another react component (something like: _this.props.addList(place) ). Thus I must fill the argument as HTML DOM as the following lines of code: var div = document.createElement('div'); var title = document.createElement('h4'); title.innerHTML = place.name; var btn = document.createElement('button'); btn.className = 'btn btn-danger btn-block'; btn.appendChild(document.createTextNode('I want to go here !!')); div.appendChild(title).appendChild(btn); google.maps.event.addListener(marker, 'click', function() { infowindow.setContent( div ); infowindow.open(map, this); }); btn.addEventListener('click', function() { _this.props.addList(place); }); The codes work for me but I don't wanna create elements one by one. I've also tried to pass the argument with a React component but it seems not working: createMarker: function() { /** Some other lines of code */ var _this = this; google.maps.event.addListener(marker, 'click', function() { infowindow.setContent( _this._renderInfoWindow(place) ); infowindow.open(map, _this); }); }, // my infowindow rendering method _renderInfoWindow: function(place) { return( {place.name} {place.cost} I want to go here !! ) }, so is there another way to at least convert a react component to HTML so that I don't have to write document.createElement() one by one? Thanks
has answer: http://stackoverflow.com/a/29587553
has title: React.js: Is it possible to convert a react component to HTML DOM's?
possible better answer: http://stackoverflow.com/a/30654169
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/76083553
has answer: http://stackoverflow.com/a/30654169
has answer: http://stackoverflow.com/a/41855892
type: Question
has answer: http://stackoverflow.com/a/51319293
tagged with: reactjs
accepted answer: http://stackoverflow.com/a/29587553
downvote count: 0
has answer: http://stackoverflow.com/a/74395369
tagged with: javascript
has answer: http://stackoverflow.com/a/58262535
score: 35
upvote count: 35

http://stackoverflow.com/comment/47411936
type: Comment
has text: You are mixing closure, scope and `this` and while there is some relation, `.bind` has nothing to do with closures or scope.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29634319

http://stackoverflow.com/comment/47431474
score: 0
comment on: http://stackoverflow.com/q/29642295
type: Comment
type: QuestionComment
has text: thanks @Salman A for your comment.I am clear about the logic but implementing it is an issue for me.It will be great if you can help me with the code, in the same way which I have given for two elements above.

http://stackoverflow.com/comment/47377534
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29615182
has text: I need help, how do I make this work with RADIO http://stackoverflow.com/questions/29616129

kendo-ui
tags question: http://stackoverflow.com/q/29550257
tags question: http://stackoverflow.com/q/29686432
tags question: http://stackoverflow.com/q/29656279
tags question: http://stackoverflow.com/q/29679944
tags question: http://stackoverflow.com/q/29628655
type: Tag
tags question: http://stackoverflow.com/q/29635175
tags question: http://stackoverflow.com/q/29624054
tags question: http://stackoverflow.com/q/29679460
tag name: kendo-ui
tags question: http://stackoverflow.com/q/29561441
tags question: http://stackoverflow.com/q/29687368
tags question: http://stackoverflow.com/q/29549385
tags question: http://stackoverflow.com/q/29662289
tags question: http://stackoverflow.com/q/29611085
tags question: http://stackoverflow.com/q/29640986
tags question: http://stackoverflow.com/q/29550060
tags question: http://stackoverflow.com/q/29632386
tags question: http://stackoverflow.com/q/29680036

http://stackoverflow.com/comment/47253697
has text: It seems very unlikely that `socket` is undefined in the places you are using it in the code you disclosed. For that to be the case, it would have to be undefined at the point that `io.on('connection', ....)` is triggered which is not supposed to be possible. Can you say exactly where you've seen `socket` undefined by putting a `console.log(socket)` line in the code in your question?
type: Comment
score: 1
comment on: http://stackoverflow.com/q/29550019
type: QuestionComment

http://stackoverflow.com/comment/47286976
score: 0
type: Comment
type: QuestionComment
has text: And why wouldn't that work, assuming the popstate event was fired by changing the history, and not a real pageload
comment on: http://stackoverflow.com/q/29568783

http://stackoverflow.com/comment/47476656
type: Comment
comment on: http://stackoverflow.com/q/29668787
score: 0
type: QuestionComment
has text: @joews: irrelevant to the question, the OP is just using the wrong term. But it's time to relearn JavaScript: it's seems like order guaranteed in the next ECMAScript version.

http://stackoverflow.com/comment/47392091
type: QuestionComment
type: Comment
has text: put $scope.newFeed inside timeout function..
score: 0
comment on: http://stackoverflow.com/q/29624217

http://stackoverflow.com/a/32687020
has body: Here you can use jquery to get your html like as var allContent = $('.page-content').clone(); Remove extra tag by this way //remove all angular class allContent.find("div[class^='ng-'],div[class*='ng-']").each(function () { //check and remove class }); //remove all ng-model attribute ans so no allContent.find('*[ng-model]').removeAttr('ng-model'); Clean your html and get all html allContent.htmlClean(); var customPageContent = allContent.html(); and finally save this by using https://github.com/eligrey/FileSaver.js var blob = new Blob([customPageContent], { type: "application/xhtml+xml;charset=charset=utf-8" }); saveAs(blob, fileName + ".html"); Extra function //clear your html $.fn.htmlClean = function () { this.contents().filter(function () { if (this.nodeType != 3) { $(this).htmlClean(); return false; } else { this.textContent = $.trim(this.textContent); return !/\S/.test(this.nodeValue); } }).remove(); return this; }; I think this will help you.
downvote count: 0
answers question: http://stackoverflow.com/q/29589369
type: Answer
upvote count: 1
score: 1

websocket
tags question: http://stackoverflow.com/q/29550019
tags question: http://stackoverflow.com/q/29590412
tags question: http://stackoverflow.com/q/29543719
tags question: http://stackoverflow.com/q/29614365
tags question: http://stackoverflow.com/q/29659154
tags question: http://stackoverflow.com/q/29569596
tags question: http://stackoverflow.com/q/29637556
tags question: http://stackoverflow.com/q/29655292
type: Tag
tags question: http://stackoverflow.com/q/29588323
tags question: http://stackoverflow.com/q/29646971
tags question: http://stackoverflow.com/q/29663613
tags question: http://stackoverflow.com/q/29633319
tag name: websocket
tags question: http://stackoverflow.com/q/29579208
tags question: http://stackoverflow.com/q/29532157

http://stackoverflow.com/q/29630265
possible better answer: http://stackoverflow.com/a/29630534
has comment: http://stackoverflow.com/comment/47403640
has answer: http://stackoverflow.com/a/29630534
score: 2
type: AnsweredQuestion
has title: Copy value from input 1 to input 2 onclick
has answer: http://stackoverflow.com/a/29630622
has comment: http://stackoverflow.com/comment/47403506
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
type: Question
has body: Looking for a script that copies input value 1 to input 2 on button click and add +1 to sets text box. b = document.getElementById('tussenstand').value; var theTotal1 = b; $(document).on("click", "#button1", function(){ theTotal1 = Number(theTotal2) $('#eindstand').val(theTotal2); }); $('#eindstand').val(theTotal2); click Thanks in advance.
accepted answer: http://stackoverflow.com/a/29630516
has comment: http://stackoverflow.com/comment/47403738
upvote count: 2
has answer: http://stackoverflow.com/a/29630680
has comment: http://stackoverflow.com/comment/47403501
linked to: http://stackoverflow.com/q/8827430
has comment: http://stackoverflow.com/comment/47403862
has answer: http://stackoverflow.com/a/29631324
answer count: 5
has answer: http://stackoverflow.com/a/29630516

web
tags question: http://stackoverflow.com/q/29680379
tags question: http://stackoverflow.com/q/29633942
tags question: http://stackoverflow.com/q/29585226
tags question: http://stackoverflow.com/q/29551001
tags question: http://stackoverflow.com/q/29548805
tags question: http://stackoverflow.com/q/29531298
type: Tag
tags question: http://stackoverflow.com/q/29672620
tags question: http://stackoverflow.com/q/29581566
tags question: http://stackoverflow.com/q/29652392
tags question: http://stackoverflow.com/q/29666465
tags question: http://stackoverflow.com/q/29553512
tags question: http://stackoverflow.com/q/29583563
tags question: http://stackoverflow.com/q/29547135
tags question: http://stackoverflow.com/q/29661862
tag name: web
tags question: http://stackoverflow.com/q/29622609
tags question: http://stackoverflow.com/q/29606123
tags question: http://stackoverflow.com/q/29663746
tags question: http://stackoverflow.com/q/29543820
tags question: http://stackoverflow.com/q/29551111
tags question: http://stackoverflow.com/q/29670924
tags question: http://stackoverflow.com/q/29539863
tags question: http://stackoverflow.com/q/29665449
tags question: http://stackoverflow.com/q/29584070
tags question: http://stackoverflow.com/q/29591508

http://stackoverflow.com/comment/47307502
score: 0
type: Comment
type: QuestionComment
has text: It's also worth describing what your infrastructure is for the server (hosting facility, proxies, etc...) because some do not allow long running, inactive sockets.
comment on: http://stackoverflow.com/q/29579208

http://stackoverflow.com/q/29546950
has comment: http://stackoverflow.com/comment/47245502
favorite count: 0
has answer: http://stackoverflow.com/a/29546999
upvote count: 2
tagged with: http://stackoverflow.com/tag/html
score: 2
type: AnsweredQuestion
has title: How to clone select options without cloning the select
has answer: http://stackoverflow.com/a/29547349
accepted answer: http://stackoverflow.com/a/29546999
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29547007
answer count: 3
has body: Say I have a select: First Second Third I would like to clone all the options without having to clone the select. Is this possible? Cloning the select is not possible in my situation. I thought of doing something like this: $('#mySelect').html().clone(); but that did not work. Update: I have a select that will change over time. I have a second select in a modal. When the modal is called, I need to update the modal's select with the same options as the first modal. Both selects have different attributes, thus I can't clone the select.
has comment: http://stackoverflow.com/comment/47245500
downvote count: 0
has comment: http://stackoverflow.com/comment/47245480
possible better answer: http://stackoverflow.com/a/29547007

http://stackoverflow.com/q/29553375
has comment: http://stackoverflow.com/comment/47257802
has answer: http://stackoverflow.com/a/29553547
accepted answer: http://stackoverflow.com/a/29553595
answer count: 5
possible better answer: http://stackoverflow.com/a/29553547
has body: The below html & javascript needs to take the text entered into the input field and capitalize the first letter of every word upon hitting submit. It's not working properly and I'm wondering where I've gone wrong? Book Title Try it I'm looking for a pure Javascript solution.
type: AnsweredQuestion
tagged with: join
has answer: http://stackoverflow.com/a/29553620
has comment: http://stackoverflow.com/comment/47257777
has answer: http://stackoverflow.com/a/29553567
type: Question
tagged with: split
has title: JS: Capitalize first letter of every word entered into input
has answer: http://stackoverflow.com/a/29553595
tagged with: javascript
has answer: http://stackoverflow.com/a/29553572
score: 0

http://stackoverflow.com/comment/47331291
comment on: http://stackoverflow.com/q/29592064
score: 0
type: QuestionComment
has text: Are you trying to filter the data ?
type: Comment

http://stackoverflow.com/comment/47241528
comment on: http://stackoverflow.com/q/29544561
type: Comment
type: QuestionComment
has text: What problems are you having?
score: 2

http://stackoverflow.com/a/29549440
type: AcceptedAnswer
downvote count: 0
has body: {menuItems.map(function(item) { return {item.text} ; })} Because your code is in strict mode (modules are always in strict mode), this is undefined inside the function you pass to .map. You either have to explicitly set the context by passing a second argument to .map: {menuItems.map(function(item) { // ... }, this)} Or use an arrow function: {menuItems.map( item => {item.text} )}
answers question: http://stackoverflow.com/q/29549375
type: Answer
has comment: http://stackoverflow.com/comment/47250809
accepted answer of: http://stackoverflow.com/q/29549375
has comment: http://stackoverflow.com/comment/47250673
score: 12
upvote count: 12

http://stackoverflow.com/comment/128136447
has text: @JayWilsonJr. Can you please share your solution
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29600136
type: Comment

http://stackoverflow.com/a/29589044
has comment: http://stackoverflow.com/comment/47657391
score: 12
type: AcceptedAnswer
type: Answer
upvote count: 13
has comment: http://stackoverflow.com/comment/55347681
accepted answer of: http://stackoverflow.com/q/29584790
has comment: http://stackoverflow.com/comment/131713815
answers question: http://stackoverflow.com/q/29584790
downvote count: 1
has body: Problem occurs because of one of the old watched expressions. I just deleted them all and now debugger works again.

http://stackoverflow.com/a/29535271
type: Answer
answers question: http://stackoverflow.com/q/29535200
score: 0
has body: document.getElementById('dir_list').innerHTML = txt+"&lt;/ul&gt;";

http://stackoverflow.com/comment/47423116
score: 0
type: AnswerComment
has text: I am still unable to pass data from a link in one view 1 to the controller function and then to view 2
type: Comment
comment on: http://stackoverflow.com/a/29593220

http://stackoverflow.com/comment/47519301
comment on: http://stackoverflow.com/a/29675574
score: 0
type: AnswerComment
has text: Thanks for the MeteorPad! Got it!
type: Comment

http://stackoverflow.com/comment/47426867
comment on: http://stackoverflow.com/a/29642481
type: Comment
score: 0
type: AnswerComment
has text: Okay thanks.. in jsfiddle works good.. but in my page, lists are showed by default.. but i used .showMenus { display:none;} but nothing happen,.. thanks

http://stackoverflow.com/q/29534457
tagged with: report
upvote count: 2
tagged with: birt
has body: I have 3 levels categories in which many items are divided. Like in level 1 i have a pie chart.. if i click on any slice of that chart it should go to level 2 of that particular slice category and then again to the third level. Everything should happen on same pie chart. eg.. I have a pie chart which shows number of animals in 2 categories.. i.e. mammals and birds. If i click on mammals it should change pie chart to show number of mammals in herbivorous and carnivorous category. I my real scenario i made a data set which has all the data through a query. Then i made a data cube having 3 dimensions and a measuring count. I displayed the 1st level on pie chart but i am unable to move to next level. New to BIRT i am. And I don't need to jump from one report to other using hyperlinks to other report.. Everything is happening in same report. I am using: Actuate BIRT Designer Professional Version: 4.4.0
type: AnsweredQuestion
tagged with: charts
has answer: http://stackoverflow.com/a/29595198
accepted answer: http://stackoverflow.com/a/29595198
linked to: http://stackoverflow.com/q/29057454
has title: Interactive BIRT Pie Chart with Drill down using Data Cube
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
score: 2

http://stackoverflow.com/a/29598404
has comment: http://stackoverflow.com/comment/54637660
accepted answer of: http://stackoverflow.com/q/29596714
has comment: http://stackoverflow.com/comment/47343350
has comment: http://stackoverflow.com/comment/54680471
score: 112
answers question: http://stackoverflow.com/q/29596714
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/57574033
has comment: http://stackoverflow.com/comment/57020877
type: Answer
upvote count: 112
downvote count: 0
has comment: http://stackoverflow.com/comment/54796158
has comment: http://stackoverflow.com/comment/74844083
has body: The correct way is to continue using the old import syntax. The new import syntax is for ES modules only, the old import syntax is for pre-ES6 modules. The two are distinct, intentionally so. import * as foo from 'foo' imports all the properties of the module 'foo', it does not import the default value as foo. From the designer of the feature: An export default declaration always declares an exported member named default and is always emitted as an assignment to exports.default. In other words, export default consistently has ES module semantics. For compatibility with Babel we could optionally emit an __esModule marker when a module has a default export, but we wouldn't actually use that marker for anything. An export = declaration, which substitutes a different entity to be exported in place of the module itself, is always emitted as an assignment to module.exports. It is an error to have other exports in a module that uses export =. This is the existing TypeScript behavior. A module that uses export = to export another module (be that an internal or external module) can be imported using the new ES6 constructs. In particular, the convenient destructuring imports can be used with such modules. The pattern of using export = to export another module is common in .d.ts files that provide a CommonJS/AMD view of an internal module (e.g. angular.d.ts). A module that uses export = to export a non-module entity in place of the module itself must be imported using the existing import x = require("foo") syntax as is the case today. 2016 update: The TypeScript compiler at some point started allowing import * as foo from 'legacy-module-foo' to get the default import of a legacy module in certain circumstances. This is a violation of the ES6 specification (§15.2.1.16, “The value "*" indicates that the import request is for the target module’s namespace object.”). When legacy modules you import in this manner are updated to ES6 modules, the “default” imports for those modules w…

http://stackoverflow.com/comment/47435163
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29627185
has text: You probably need to `$scope.$apply()` after `$location.path`.

http://stackoverflow.com/comment/47249471
type: AnswerComment
comment on: http://stackoverflow.com/a/29546309
score: 0
type: Comment
has text: Solved the Problem - I've added a _reference.ts with the right Order for the Files - http://stackoverflow.com/questions/23902107/visual-studio-2013-typescript-compiler-isnt-respecting-references-ts-file

http://stackoverflow.com/q/29661029
has comment: http://stackoverflow.com/comment/47463654
answer count: 2
tagged with: getselection
has comment: http://stackoverflow.com/comment/47461898
downvote count: 0
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29679998
has comment: http://stackoverflow.com/comment/47461933
has comment: http://stackoverflow.com/comment/47462015
favorite count: 0
has answer: http://stackoverflow.com/a/29661650
has comment: http://stackoverflow.com/comment/47462127
possible better answer: http://stackoverflow.com/a/29679998
has comment: http://stackoverflow.com/comment/47462292
upvote count: 1
type: AnsweredQuestion
has title: Get SelectedText in Javascript
has comment: http://stackoverflow.com/comment/47462079
has body: I would like to understand how the getSelection function works. Therefore I want to do a little test. I want to display my selected text on a button. My code: This is a test test test test Template.seltext.events({ 'click .new': function(){ var text = ""; if (window.getSelection) { text = window.getSelection().toString(); } else if (document.selection && document.selection.type != "Control") { text = document.selection.createRange().text; } return text; value = "text"; }}); I don't know why it doesn't work though, anyone any idea?
score: 1
accepted answer: http://stackoverflow.com/a/29661650
type: Question

http://stackoverflow.com/comment/47372117
comment on: http://stackoverflow.com/q/29612811
score: 0
type: Comment
type: QuestionComment
has text: @ViannyMolero don't know what exactly you want to do but you can make an ajax call and send over your js parameter in params for further processing.

http://stackoverflow.com/comment/47367440
type: QuestionComment
comment on: http://stackoverflow.com/q/29610770
score: 0
has text: just to clarify, so the lines are not really drawn on basis of user click sequence, right?
type: Comment

http://stackoverflow.com/a/29595764
score: 0
answers question: http://stackoverflow.com/q/29595679
type: Answer
has body: please try and use this method of getElementById For example: Image 2
has comment: http://stackoverflow.com/comment/47338395

http://stackoverflow.com/comment/47408397
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29632839
score: 1
has text: For what it's worth, that's not a very good way of doing the problem, function or no function. It won't work when the number of hours is greater than 9, for example.

http://stackoverflow.com/comment/47372135
has text: Can you explain why `.map(function(key) { return key; }) is not a no-op?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29612599
type: Comment

http://stackoverflow.com/comment/47270075
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29560053
has text: stand by let me check I think you are right. I did this before but could not remember

http://stackoverflow.com/a/29609923
has comment: http://stackoverflow.com/comment/47365333
score: 3
has body: If you send them the email, you can put something in the URL that identifies them. You can put a hash code parameter in the URL, and then look that up in a database to get the corresponding email. You should have a database table like: CREATE TABLE customer_emails ( hash CHAR(32) PRIMARY KEY, email VARCHAR(64) ); When you send the emails, you add a row for each customer with a random hash code and their email. The email will contain a URL like: http://yourdomain.com/somescript.php?hash=XYZ123ABC... When they click on the link, the script does: $stmt = $pdo-&gt;prepare("SELECT email FROM customer_emails WHERE hash = :hash"); $stmt-&gt;bind_param(':hash', $_REQUEST['hash']); $stmt-&gt;execute(); $row = $stmt-&gt;fetch(PDO::FETCH_ASSOC); if ($row) { $email = $row['email']; } else { // Resport that email is not found }
downvote count: 1
upvote count: 4
answers question: http://stackoverflow.com/q/29609876
has comment: http://stackoverflow.com/comment/47366012
has comment: http://stackoverflow.com/comment/47365628
has comment: http://stackoverflow.com/comment/47365438
type: Answer

http://stackoverflow.com/comment/47465336
score: 0
type: AnswerComment
has text: Yup, that fiddle is exactly what I wanted. Had to make some minor changes but its perfect now!
type: Comment
comment on: http://stackoverflow.com/a/29662476

http://stackoverflow.com/a/29588766
has comment: http://stackoverflow.com/comment/60213496
downvote count: 0
has body: You could map your list of attributes to their respective values and pick the first non falsy value as your group key: _.mixin({ splitGroupBy: function(list, groupByIter){ if (!_.isArray(groupByIter)) return _.groupBy(list, groupByIter); return _.groupBy(list, function(o) { var values = _.map(groupByIter, function(k) { return o[k]; }); return _.find(values); }); } }); var data = { "notes":[ { "id":1, "userId":2, "replyToId":null }, { "id":5, "userId":3, "replyToId":null }, { "id":2, "userId":null, "replyToId":2 } ] }; _.mixin({ splitGroupBy: function(list, groupByIter){ if (!_.isArray(groupByIter)) return _.groupBy(list, groupByIter); return _.groupBy(list, function(o) { var values = _.map(groupByIter, function(k) { return o[k]; }); return _.find(values); }); } }); snippet.log(JSON.stringify(_.splitGroupBy(data.notes,['userId', 'replyToId']))); &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"&gt;&lt;/script&gt; &lt;!-- Provides the `snippet` object, see http://meta.stackexchange.com/a/242144/134069 --&gt; &lt;script src="http://tjcrowder.github.io/simple-snippets-console/snippet.js"&gt;&lt;/script&gt;
score: 1
type: Answer
answers question: http://stackoverflow.com/q/29587488
upvote count: 1

http://stackoverflow.com/comment/47287832
has text: @jl90 Then you need too set a `value`.
comment on: http://stackoverflow.com/a/29569183
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47392715
has text: IN your demo I see only single link, could you replicate this scenario which is incorrect?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29565695

http://stackoverflow.com/comment/47459579
type: Comment
has text: Thanks for referencing the sources! However sources are naturally subject to change and with more than 100 lines of code the `eq` function is not particularly descriptive. Isn't there something like the [Javascript spec for `==`](http://www.ecma-international.org/ecma-262/5.1/#sec-11.9.3) for Jasmines `toEqual()` - or maybe for a related function like Underscores `isEqual()`?
comment on: http://stackoverflow.com/a/29647556
type: AnswerComment
score: 0

http://stackoverflow.com/a/29638793
downvote count: 0
score: 6
upvote count: 6
has body: There are possibly more cases of this error in that block of code but this is the first one I came across: var title = document.getElementById('view-name'); title.innerHTML = data.property.name + ' (' + data.view.name + ')'; This will cause the "Cannot set property 'innerHTML' of null" error because you don't have an element on the page with the id of 'view-name', therefore title = null when you are calling innerHTML on it.
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29638488
has comment: http://stackoverflow.com/comment/47419988
accepted answer of: http://stackoverflow.com/q/29638488
type: Answer

http://stackoverflow.com/comment/47432752
type: Comment
comment on: http://stackoverflow.com/q/29644358
has text: @Crowder thank you! I am going to follow your advise
score: 0
type: QuestionComment

http://stackoverflow.com/q/29667922
tagged with: internet-explorer
linked to: http://stackoverflow.com/q/20364237
downvote count: 0
type: Question
has title: set a Blob as the "src" of an iframe
has answer: http://stackoverflow.com/a/32594800
tagged with: blob
linked to: http://stackoverflow.com/q/1659749
score: 18
tagged with: javascript
has body: The following code work perfectly in Chrome But it is not working with IE. Can some one please tell me what is wrong here. The iframe "src" also set to the blob as shown below. Note: I went on the window.navigator.msSaveOrOpenBlob(newBlob) path as well but no luck so far.
has answer: http://stackoverflow.com/a/32622855
accepted answer: http://stackoverflow.com/a/32622855
favorite count: 0
answer count: 3
linked to: http://stackoverflow.com/q/19327749
upvote count: 18
possible better answer: http://stackoverflow.com/a/46165963
has answer: http://stackoverflow.com/a/46165963
tagged with: iframe
type: AnsweredQuestion

http://stackoverflow.com/comment/47478497
has text: `if (validateForm() == true)` will not fire as `validateForm()` does not return a value
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29670022

http://stackoverflow.com/comment/79819004
type: AnswerComment
comment on: http://stackoverflow.com/a/41075944
has text: I feel this is a hack though, and dont know how waiting for empty candidate indicate that it's right time to start adding ice candidates.
type: Comment
score: 1

sequelize.js
type: Tag
tags question: http://stackoverflow.com/q/29619631
tags question: http://stackoverflow.com/q/29535031
tags question: http://stackoverflow.com/q/29615889
tags question: http://stackoverflow.com/q/29624277
tag name: sequelize.js
tags question: http://stackoverflow.com/q/29680359

http://stackoverflow.com/a/29672045
type: Answer
upvote count: 3
answers question: http://stackoverflow.com/q/29671862
score: 3
has comment: http://stackoverflow.com/comment/47482145
has comment: http://stackoverflow.com/comment/47481841
type: AcceptedAnswer
downvote count: 0
has body: According to your question, you want to target the anchor tag and set the class there, so: var parent = document.getElementById('one'); var anchor = parent.getElementsByTagName("A")[0]; anchor.classList.add('myClass'); That should do it. If you have multiple anchor tags you can loop through them. var parent = document.getElementById('one'); var anchorList = parent.getElementsByTagName("A"); for(i = 0; i &lt; anchorList.length; i++) { anchorList[i].classList.add('myClass'); }
accepted answer of: http://stackoverflow.com/q/29671862
has comment: http://stackoverflow.com/comment/47482267

http://stackoverflow.com/q/29554630
has title: AngularJS design guide
type: Question
has comment: http://stackoverflow.com/comment/50125305
answer count: 2
has comment: http://stackoverflow.com/comment/47260868
has comment: http://stackoverflow.com/comment/47260838
downvote count: 0
has comment: http://stackoverflow.com/comment/47261961
tagged with: javascript
has comment: http://stackoverflow.com/comment/47260701
has comment: http://stackoverflow.com/comment/47260891
has body: Previously when I was writing angular apps, I used to do angular.module('ngApp', ['all', 'required', 'ng*', 'dependencies']) in my app.js and then inside services/ and controllers, I could simply do: angular.module('ngApp') I have a repo to demonstrate that. But then I saw the angular-seed/, the way implemented was, in controllers/ angular.module('appControllers', ['dependencies'])... in services/ angular.module('appServices', ['dependencies']).. in app.js angular.module('ngApp', ['ng*', 'appControllers', 'appSrvices']).. I had no issue with design, infact I thought it was good, since evrything was dependency injected as well as modular. I have a situation where I have a services/movie.js that has angular.module('myAppServices', ['ngResource']).factory(..) and services/config.js angular.module('myAppServices').factory(..) But while writing tests with karma and jasmine. In the karma.conf.js, I had files: ['usual', 'bower_components/angular-*.js', 'app/services/**/*.js', '..'] but the problem was config.js got loaded before movie.js and there were errors, myAppServices is not loaded or mis-spelt. The way I fixed it was I did: files: ['..', 'app/services/movie.js', 'app/services/config.js'] I have set up a github repo for this too. Here is the controller test file and here is the karma.conf. I want to know what can be the possible approaches to take such modular approach, without having to specify the order in which the files are to be loaded for my tests. And this is my first unit test, and its failing: Error: Unexpected request: GET https://api.themoviedb.org/3/configuration?api_key=2e329c92227ed8be07944ae447c9426f Expected GET https://api.themoviedb.org/3/movie/top_rated?api_key=2e329c92227ed8be07944ae447c9426f It would be helpful if I could get some help in fixing that too. The test describe('Controllers', function() { beforeEach(module('myApp')); beforeEach(module('myAppServices')); describe("MoviesCtrl", function() { var scope, ctrl, httpBackend; beforeEach(injec…
has comment: http://stackoverflow.com/comment/47260643
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/47260963
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47260940
score: 16
linked to: http://stackoverflow.com/q/29069261
has comment: http://stackoverflow.com/comment/50051378
upvote count: 16
has answer: http://stackoverflow.com/a/31052157
has comment: http://stackoverflow.com/comment/50046000
has answer: http://stackoverflow.com/a/29598877
has comment: http://stackoverflow.com/comment/47261910
has comment: http://stackoverflow.com/comment/50128851
has comment: http://stackoverflow.com/comment/47261722

http://stackoverflow.com/q/29648767
has answer: http://stackoverflow.com/a/29649295
type: Question
has comment: http://stackoverflow.com/comment/47437929
score: 1
has answer: http://stackoverflow.com/a/29651565
accepted answer: http://stackoverflow.com/a/29649513
has title: How can I sort the summed up number from JSON
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I have the JSON look like below. I'm finding the way to sort the numberOfPoint after I summed up. { "data": [ { "id": { "year": 2015, "Name": "A" }, "numberOfPoint": 2 }, { "id": { "year": 2014, "Name": "C" }, "numberOfPoint": 2 }, { "id": { "year": 2014, "Name": "B" }, "numberOfPoint": 2 }, { "id": { "year": 2014, "Name": "B" }, "numberOfPoint": 2 }, { "id": { "year": 2013, "Name": "C" }, "numberOfPoint": 2 }] } obj is my JSON. var result = {}; obj.data.forEach(function (a) { result[a["id"]["Name"]] = (result[a["id"]["Name"]] || 0) + a["numberOfPoint"]; }); result is look like below { "A": 2, "C": 4, "B": 4 } How can I sort this from largest to lowest numberOfPoint? I want the result like this. { "B": 4, "C": 4, "A": 2 } Thank you in advance.
favorite count: 0
has comment: http://stackoverflow.com/comment/47437405
has answer: http://stackoverflow.com/a/29649513
answer count: 3
possible better answer: http://stackoverflow.com/a/29649295
type: AnsweredQuestion
upvote count: 1

http://stackoverflow.com/comment/47230951
type: Comment
type: AnswerComment
has text: the value is within json data so I have to reference it but i get Nan/Nan/Nan var notbefore = response.endpoints[0].details.cert.notBefore var date = new Date(notBefore) var formattedDate = (date.getMonth() + 1) + '/' + date.getDate() + '/' + date.getFullYear()
score: 0
comment on: http://stackoverflow.com/a/29538724

http://stackoverflow.com/q/29647114
upvote count: 1
type: Question
downvote count: 0
has comment: http://stackoverflow.com/comment/47434415
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47434446
has title: Clone a element with events not working, if the cloned element is inside different container
has comment: http://stackoverflow.com/comment/47434374
favorite count: 0
has body: I have cloned a element using jQuery clone function oldEle = $( "#BVRRSummaryContainer .bv-submission-button.bv-write-review" ); newEle = $( "#BVRRSummaryContainer .bv-submission-button.bv-write-review").clone(true, true); newEle.appendTo( "#BVRRSummaryContainer" ); Not Working Case: I'm cloning oldEle to newEle with events. when the new element is appended to a different container which the oldEle does not belong click event is not happening. Working Case: If I append the newly created element in the same container which oldEle belong, click event works But I need to place the newEle in a different container.
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47434666
tagged with: clone
answer count: 0
has comment: http://stackoverflow.com/comment/47434425
score: 1
has comment: http://stackoverflow.com/comment/47434709

http://stackoverflow.com/q/29610026
has comment: http://stackoverflow.com/comment/47365722
possible better answer: http://stackoverflow.com/a/29610169
has answer: http://stackoverflow.com/a/29610169
accepted answer: http://stackoverflow.com/a/29610227
answer count: 3
tagged with: http://stackoverflow.com/tag/html
score: 1
has comment: http://stackoverflow.com/comment/47365684
favorite count: 0
has answer: http://stackoverflow.com/a/29610175
has body: The form in this html has an onsubmit attribute which executes the codeAddress() function however in the Google Chrome Dev console it says that it cannot find it. The function is supposed to change the value of the "lat" and "lng" form inputs which have the display property set to "none" in a seperate css file. Then the values are to be sent to a php file for processing. Ievadiet notikumu Notikuma veids Viens Divi Tris Cetri Send Close
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29610227
has comment: http://stackoverflow.com/comment/47365675
upvote count: 1
tagged with: forms
type: Question
has title: Cannot find a javascript function in HTML
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/47460857
comment on: http://stackoverflow.com/a/29659714
has text: @DrewLandgrave Tried stacksnippets, above ? Not return `true` at `console` ? String "Wizards" was not utilized at `js` , only `begin`, `end` properties of `data` object . String "Wizards" does not appear _"at position 258"_ within string `.some` should not return `false` ; `text` was first node within return value from `$.parseHTML` , `a` elements was second node; `.some` only requires a single item to return `true` . See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47414369
type: Comment
type: QuestionComment
score: 0
has text: Showing a dialog (modal or non-modal) is asynchronous. `$("#other").modal()` just modfiies the DOM so that the dialog appears, it doesn't wait for the user to close it before returning.
comment on: http://stackoverflow.com/q/29633044

datamapper
tag name: datamapper
tags question: http://stackoverflow.com/q/29577235
type: Tag

http://stackoverflow.com/q/29615058
accepted answer: http://stackoverflow.com/a/29679837
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29615205
has comment: http://stackoverflow.com/comment/47375507
has title: How do I repeat the piece of html code 10 times by clicking on the same button using JS/Jquery?
has body: I want to be able to display the same piece of html code 10 times under the div called: By clicking on the button called: . I think I need some kind of a for loop for the job but are not sure. Any suggestion will be helpful, thanks. My HTML code: Tilføj endnu et produktnavn X
type: Question
linked to: http://stackoverflow.com/q/203198
tagged with: javascript
has comment: http://stackoverflow.com/comment/47375482
has answer: http://stackoverflow.com/a/29615325
has comment: http://stackoverflow.com/comment/47375438
score: 0
answer count: 3
tagged with: jquery
has comment: http://stackoverflow.com/comment/47461897
has answer: http://stackoverflow.com/a/29679837
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47416912
possible better answer: http://stackoverflow.com/a/29615205

http://stackoverflow.com/a/29589020
score: 0
has body: Per the documentation there are two ways to set the style of the map: To modify the styles of the default map type (changes to labels and roads will also affect terrain and satellite maps), set the style array in the map's MapOptions either at time of construction or by calling setOptions. set the style array in the map's MapOptions at time of construction: var map = new google.maps.Map(document.getElementById('map-canvas'), { disableDoubleClickZoom: true, scrollwheel: false, navigationControl: false, mapTypeControl: false, scaleControl: false, draggable: false, zoom: 17, center: new google.maps.LatLng(34.239415, -118.529339), mapTypeId: google.maps.MapTypeId.ROADMAP, styles: [{ "featureType": "poi", "stylers": [{ "visibility": "off" }] }, { "featureType": "landscape", "stylers": [{ "visibility": "off" }] }, { "featureType": "transit", "stylers": [{ "visibility": "off" }] }] }); updated fiddle by calling setOptions var styles = [{ "featureType": "poi", "stylers": [{ "visibility": "off" }] }, { "featureType": "landscape", "stylers": [{ "visibility": "off" }] }, { "featureType": "transit", "stylers": [{ "visibility": "off" }] }]; map.setOptions({styles: styles}); updated fiddle
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/29585432
answers question: http://stackoverflow.com/q/29585432

http://stackoverflow.com/a/32151528
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29678510
has body: I wrote a script to cut the generated cubemap into individual files (posx.png, negx.png, posy.png, negy.png, posz.png and negz.png). It will also pack the 6 files into a .zip file. The source is here: https://github.com/dankex/compv/blob/master/3d-graphics/skybox/cubemap-cut.py You can modify the array to set the image files: name_map = [ \ ["", "", "posy", ""], ["negz", "negx", "posz", "posx"], ["", "", "negy", ""]] The converted files are:
score: 10
upvote count: 10

http://stackoverflow.com/comment/47332924
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29592780
has text: So aggregate the tokens.
type: AnswerComment

cookies
tags question: http://stackoverflow.com/q/29638629
tags question: http://stackoverflow.com/q/29642543
tags question: http://stackoverflow.com/q/29615709
tags question: http://stackoverflow.com/q/29579784
type: Tag
tags question: http://stackoverflow.com/q/29662966
tags question: http://stackoverflow.com/q/29675813
tags question: http://stackoverflow.com/q/29536135
tags question: http://stackoverflow.com/q/29574954
tag name: cookies
tags question: http://stackoverflow.com/q/29560863
tags question: http://stackoverflow.com/q/29567366
tags question: http://stackoverflow.com/q/29664585
tags question: http://stackoverflow.com/q/29682088
tags question: http://stackoverflow.com/q/29662394
tags question: http://stackoverflow.com/q/29631917
tags question: http://stackoverflow.com/q/29615180

http://stackoverflow.com/a/29643573
accepted answer of: http://stackoverflow.com/q/29643368
type: AcceptedAnswer
score: 43
type: Answer
has body: You can't append document nodes (the result of parseFromString). Instead take the child of the document object and append it: var parser = new DOMParser(); var newNode = parser.parseFromString(newCategory, &quot;text/xml&quot;); stack.appendChild(newNode.documentElement); Note, that your HTML is not XML-compliant so you might get errors parsing it. In this case make sure you fix them (like duplicated alt attribute, &amp;nbsp; entities). However, in your case I doubt you need to parse XML at all. You can just append entire HTML string in the first place. For example like this: var stack = document.getElementById('newCategories'); stack.insertAdjacentHTML('beforeend', newCategory);
upvote count: 43
answers question: http://stackoverflow.com/q/29643368
downvote count: 0

http://stackoverflow.com/comment/47504975
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29676129
type: Comment
has text: Thank you very much - Yeah I tried "start: moment(date)" and was amazed that the date was behind a day, and ToString worked (as in the docs (which i used for reference)) Great work @slicedtoad you are a man amongst men.

http://stackoverflow.com/comment/47507130
has text: okay, i see what you are doing, where do i put the form though? with my forms in the form file? @AAB
score: 0
comment on: http://stackoverflow.com/a/29684820
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47366343
type: Comment
type: QuestionComment
has text: is your `onFail` callback firing? If so, what is the error? If not, are you seeing anything from logcat `adb logcat CordovaLog *:S`?
comment on: http://stackoverflow.com/q/29609379
score: 0

http://stackoverflow.com/comment/47299591
type: Comment
type: QuestionComment
has text: well the html is too big so i have posted only the checkbox part
comment on: http://stackoverflow.com/q/29575501
score: 0

http://stackoverflow.com/q/29651376
has answer: http://stackoverflow.com/a/29651516
has body: I've quickly made a page that shows the current items in the database. I've created the function to adjust stocks levels but I am now trying to add the function to delete items. For some reason all it does is reduce the stock level to 0 but doesn't delete the item from the database. Also would it be possible/better to put the code the generates the table into another file and load it here? As I need it to auto update when you run either the stock update or deletion function. AJAX/HTML CODE Update Stock Levels Product ID: New Stock Amount: Delete Items Product ID: <?php echo " "; echo " Id Product Name Product Description Product Price Product Stock Amount "; class TableRows extends RecursiveIteratorIterator { function __construct($it) { parent::__construct($it, self::LEAVES_ONLY); } function current() { return " " . parent::current(). " "; } function beginChildren() { echo " "; } function endChildren() { echo " " . "\n"; } } $servername = "localhost"; $username = "root"; $password = ""; $dbname = "cms"; try { $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $stmt = $conn->prepare("SELECT Product_ID, Product_Name, Product_Desc, Product_Price, Product_Stock FROM Products"); $stmt->execute(); // set the resulting array to associative $result = $stmt->setFetchMode(PDO::FETCH_ASSOC); foreach(new TableRows(new RecursiveArrayIterator($stmt->fetchAll())) as $k=>$v) { echo $v; } } catch(PDOException $e) { echo "Error: " . $e->getMessage(); } $conn = null; echo " "; ?> PHP CODE <?php $dsn = 'mysql:host=localhost;dbname=cms'; $user = 'root'; $password = ''; try { $pdo = new PDO($dsn, $user, $password); $pdo ->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch (PDOException $e) { echo 'Connection failed: ' . $e->getMessage(); } $sql = "DELETE FROM Products WHERE Product_ID = :Product_ID"; $stmt = $pdo->prepare($sql); $stmt->bindParam(':Product_ID', $_POST['Product_ID'], …
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/47442584
favorite count: 0
tagged with: ajax
type: UnansweredQuestion
tagged with: php
tagged with: pdo
downvote count: 2
tagged with: mysql
has comment: http://stackoverflow.com/comment/47442753
type: Question
has comment: http://stackoverflow.com/comment/47442415
score: -2
tagged with: javascript
has title: Why is php script not deleting the table?
has comment: http://stackoverflow.com/comment/47442506

http://stackoverflow.com/a/29610227
downvote count: 1
accepted answer of: http://stackoverflow.com/q/29610026
score: -1
upvote count: 0
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/29610026
has body: After fixing a few basic JavaScript syntaxic errors, you can call your codeAdress function. Ievadiet notikumu Notikuma veids Viens Divi Tris Cetri Send Close
has comment: http://stackoverflow.com/comment/112160159

http://stackoverflow.com/comment/47238813
has text: i think use value not Value
score: 1
comment on: http://stackoverflow.com/q/29543437
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47428576
type: QuestionComment
comment on: http://stackoverflow.com/q/29643738
score: 0
has text: I think you need this action on page refresh not on refresh button click right? as i know for that you need server side code.
type: Comment

http://stackoverflow.com/comment/47419243
score: 0
type: Comment
has text: @BenjyKessler: That's because line 2 wasn't in the code block, so line 3 looked like line 1.
type: QuestionComment
comment on: http://stackoverflow.com/q/29638481

http://stackoverflow.com/comment/47280977
has text: just providing a regex doesn't really answer the question without showing how to implement it
comment on: http://stackoverflow.com/a/29565690
type: AnswerComment
score: 2
type: Comment

http://stackoverflow.com/q/29594594
tagged with: date
type: Question
has comment: http://stackoverflow.com/comment/47337228
has comment: http://stackoverflow.com/comment/47338541
answer count: 1
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/47336238
has answer: http://stackoverflow.com/a/29595535
accepted answer: http://stackoverflow.com/a/29595535
has body: I am trying to use a small portion of JavaScript in order to show how many days are left until New Year's Eve. However, I can't get any of it to show up on the webpage. I'll include the HTML and the library I am trying to use, if anybody can point me in the right direction I would appreciate it. I was under the impression that HTML was able to understand Date() functions, but my teacher told me I would have to remove them in order to get the code working? &lt;!-- Days until New Year's Eve --&gt; &lt;td id="daycell"&gt; &lt;!-- Add script tag and declare variables and assign values --&gt; &lt;script&gt; var Today = new(Date); var ThisDay = Today.getDate(); var ThisMonth = Today.getMonth(); var ThisYear = Today.getFullYear(); var DaysLeft = NYEdays(Today); var MonthTxt = new Array("", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); &lt;!-- Add date output statement --&gt; document.write("Today is" + MonthTxt[ThisMonth] + " " + ThisDay + ", " + ThisYear + "."); &lt;!-- Add decision statement for number of days --&gt; &lt;script type = "text/javascript"&gt; if (DaysLeft == 0) { document.write("Today is New Years Eve!"); } else { document.write("Only" + DaysLeft "days until New Years Eve!"); } &lt;/script&gt; Here is the library.js code: function NYEDays(CheckDay) { var XYear=CheckDay.getFullYear(); var XDay=new Date("December, 31, 2015"); XDay.setFullYear(XYear); var DayCount=(XDay-CheckDay)/(1000*60*60*24); DayCount=Math.round(DayCount); return DayCount; } I have to use the variables Today, ThisDay, ThisMonth, ThisYear, DaysLeft, and MonthTxt as an array.
has comment: http://stackoverflow.com/comment/47336364
type: AnsweredQuestion
has title: JavaScript Not Showing Date Functions

http://stackoverflow.com/comment/63278869
type: Comment
score: 0
type: QuestionComment
has text: Question (& answers) refined here http://stackoverflow.com/q/29555624/525788
comment on: http://stackoverflow.com/q/29535873

http://stackoverflow.com/comment/47417955
score: 0
type: Comment
type: QuestionComment
has text: sorry - by center I mean the vertical line in the diagram (for simplicity treat that as X=0)
comment on: http://stackoverflow.com/q/29637775

http://stackoverflow.com/comment/47300688
comment on: http://stackoverflow.com/q/29576059
score: 0
type: Comment
type: QuestionComment
has text: I don't see how that would be confusing. If next line begins with a comma it would be very clear that it's supposed to continue the previous line. the only confusing case for semicolon insertion is when a line begins with a `(` as that can be a legitimate first character, but also tries to call the previous line's value as a function.

http://stackoverflow.com/a/29664049
type: Answer
accepted answer of: http://stackoverflow.com/q/29663847
has body: Since you're using Javascript without prototype or jQuery, have you tried replacing your while statement with something like this: leaderboardarray.sort(function(a, b){return b-a}); There is a great write-up of the Javascript sort function at w3schools. <TITLE>The Foundation Page The Foundation Page Few things about your code that needed to be addressed. You had two head tags. You were sorting your array, then showing the output with a decrementing for statement. On this I'm sorting the array in descending order and then showing ascending output. I also have started arrays at 0 (where they want to be), this allows for less math in the for statements. I've replaced the bgcolor HTML tag with CSS Updated the script tag to use type instead of language. Rather than using document.write which can cause problems, I'm replacing the content of a placeholder div. Here is a fiddle.
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29663847

shell
tags question: http://stackoverflow.com/q/29655760
tag name: shell
type: Tag
tags question: http://stackoverflow.com/q/29593592

http://stackoverflow.com/comment/47454347
comment on: http://stackoverflow.com/a/29657241
type: Comment
has text: What is the g standing for, and what is it used for in your example?
score: 1
type: AnswerComment

http://stackoverflow.com/a/29614295
has comment: http://stackoverflow.com/comment/47374618
type: Answer
has body: I have prepared an example where show how to use the $interpolateProvider: http://plnkr.co/edit/0lotZRHhvv2bIKc96RVi?p=preview Here is the code: &lt;script&gt; var customInterpolationApp = angular.module('customInterpolationApp', []); customInterpolationApp.config(function($interpolateProvider) { $interpolateProvider.startSymbol(''); $interpolateProvider.endSymbol(''); }); customInterpolationApp.controller('DemoController', function() { this.label = "This binding is brought you by [[ ]] interpolation symbols."; }); &lt;/script&gt; &lt;div ng-app="App" ng-controller="DemoController as demo"&gt; demo.label &lt;/div&gt;
score: 1
has comment: http://stackoverflow.com/comment/47374253
upvote count: 1
has comment: http://stackoverflow.com/comment/47374173
answers question: http://stackoverflow.com/q/29614183
has comment: http://stackoverflow.com/comment/47374813
downvote count: 0
has comment: http://stackoverflow.com/comment/47374670

http://stackoverflow.com/a/29576175
answers question: http://stackoverflow.com/q/29576059
has comment: http://stackoverflow.com/comment/47300800
has comment: http://stackoverflow.com/comment/47301048
has comment: http://stackoverflow.com/comment/47304372
has body: The binary logical operator || is also called the "default" operator. It does not generally return a boolean, but instead returns the first value unless it is falsy, and the second value in that case. In other words, a || b literally returns a or b. e.g. null || 4 returns 4. And yes, the right-hand-side expression is completely ignored (parsed but not evaluated) if the left-hand-side is true. As for link.source, by attempting to assign a property to that string, the code is implicitly boxing the string into an object. Both strings and numbers can be boxed in that way, either to use inherited methods and properties (e.g. link.source.length to get the length of the string) or to assign them new ones. They retain their type by doing so, unlike what happens if you did new String(link.source): that creates a true object that behaves like one in every respect.
has comment: http://stackoverflow.com/comment/47300816
has comment: http://stackoverflow.com/comment/47301360
score: 0
has comment: http://stackoverflow.com/comment/47306806
type: Answer
has comment: http://stackoverflow.com/comment/47302551
has comment: http://stackoverflow.com/comment/47306657

http://stackoverflow.com/a/29638134
accepted answer of: http://stackoverflow.com/q/29638093
has comment: http://stackoverflow.com/comment/47418698
upvote count: 1
has comment: http://stackoverflow.com/comment/47418600
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/47419247
answers question: http://stackoverflow.com/q/29638093
downvote count: 0
score: 1
has body: you can redirect to another page in php or js after submitting successfully to clear the $_POST. in php header('Location: http://your_page.php');
has comment: http://stackoverflow.com/comment/47418644

http://stackoverflow.com/a/29659828
type: Answer
has comment: http://stackoverflow.com/comment/47460083
score: 7
upvote count: 7
accepted answer of: http://stackoverflow.com/q/29659697
has body: I would create another function to handle the redundancies: function createCreature (creatureName, user, callback) { console.log('Creature created'); var creature = new Creature({ name: creatureName, id_user: user._id }); creature.save(function (err, creature) { if (err) callback(err, null); else callback(null, creature); }); } And then in your other functions: exports.postCreature = function (req, res) { createCreature(req.body.name, req.user, function (err, creature) { if (err) res.status(400).send(Error.setError('impossible to save the your creature', err)); else res.status(201).send(); }; }; exports.createCreature = function(user, callback) { console.log('Creature created'); createCreature (user.username, user, callback); }
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29659697

http://stackoverflow.com/q/29566823
has comment: http://stackoverflow.com/comment/47283295
has answer: http://stackoverflow.com/a/29566984
has comment: http://stackoverflow.com/comment/47283328
has comment: http://stackoverflow.com/comment/47283355
tagged with: javascript
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/65381309
has body: I am trying to create a wrapper for this mysql library so I can do Synchronous queries. I am using a Promise, and for some reason I am getting {} when I do the console.log() (see code). var myq = require("mysql"); var conn; exports.connect = function(params){ this.conn = myq.createConnection(params); return this; }; exports.query = function(sql, values){ return new Promise(function(resolve, reject){ if(typeof values === "undefined"){ this.conn.query(sql, function(err, r){ if(err){ reject(r); }else{ resolve(r); } }); } }); }; Using a Promise: require("./mysql.js"); // Create connection var conn = ....; // Make query var rows = conn.query("select * from groups"); // Dump the results console.log(rows); Now if I take my wrapper out of the equation, and do it the way that they show, I get results back: require("mysql"); // Create connection var conn = ....; // Make query var rows = conn.query("select * from groups", function(err, rows){ // Dump the results console.log(rows); }); So, am I using the Promise correctly?
favorite count: 0
has title: JavaScript Promise Not Returning Data
has comment: http://stackoverflow.com/comment/47283577
has comment: http://stackoverflow.com/comment/47283307
tagged with: node.js
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29566984
score: 1
possible better answer: http://stackoverflow.com/a/65381309
upvote count: 1
type: Question

http://stackoverflow.com/comment/47217989
has text: Make sure you add a check else array will be recreated
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29532421
type: AnswerComment

http://stackoverflow.com/comment/47392358
score: 1
comment on: http://stackoverflow.com/q/29624217
type: Comment
has text: what's this doing? `data-ui-wizard-form` if it's a directive it may be creating a new child scope. Try `ng-model="$parent.newFeed.url"` see if that works. Otherwise check your scope settings in the directive.
type: QuestionComment

http://stackoverflow.com/q/29593544
downvote count: 1
tagged with: instantiation
type: AnsweredQuestion
score: 21
has body: Why do these 2 implementations behave differently? What exactly sets them apart when it comes to evaluating their prototypes? Creating an object with the prototype specified: function Foo() {} // creates an object with a specified prototype var bar = Object.create(Foo); console.log(Object.getPrototypeOf(bar)); // returns: function Foo(){} console.log(Foo.isPrototypeOf(bar)); // returns: true Creating an object with the constructor method: function Foo() {} // creates an object with the constructor method var bar = new Foo(); console.log(Object.getPrototypeOf(bar)); // returns: Foo {} console.log(Foo.isPrototypeOf(bar)); // returns: false Also, why does the second implementation return both Foo {} and false?
linked to: http://stackoverflow.com/q/4166616
has comment: http://stackoverflow.com/comment/47337170
tagged with: prototype
type: Question
upvote count: 22
answer count: 2
has answer: http://stackoverflow.com/a/29593595
tagged with: javascript
favorite count: 0
has title: Why do Object.create() and new Object() evaluate to different prototypes?
possible better answer: http://stackoverflow.com/a/29593761
has comment: http://stackoverflow.com/comment/47334091
has answer: http://stackoverflow.com/a/29593761
accepted answer: http://stackoverflow.com/a/29593595
has comment: http://stackoverflow.com/comment/47339091

http://stackoverflow.com/a/29684820
downvote count: 0
has comment: http://stackoverflow.com/comment/47506749
has comment: http://stackoverflow.com/comment/47506628
type: Answer
answers question: http://stackoverflow.com/q/29684678
score: 2
upvote count: 2
has body: You could use a hidden input field change it value attribute and submit along with rest of the form. &lt;input type="hidden" name="calc" id="calc" value=""&gt; Use Jquery to set its value $('#calc').val(someval); Update Javascript document.getElementById("calc").value="Your Value";
has comment: http://stackoverflow.com/comment/47507130
has comment: http://stackoverflow.com/comment/47507164

http://stackoverflow.com/a/29671941
answers question: http://stackoverflow.com/q/29671862
type: Answer
has comment: http://stackoverflow.com/comment/47484297
has body: to add class name you use document.getElementById('myId').className="Your class name";
has comment: http://stackoverflow.com/comment/47481795
score: -1
upvote count: 2
downvote count: 3

http://stackoverflow.com/comment/47484375
type: AnswerComment
comment on: http://stackoverflow.com/a/29673256
score: 0
type: Comment
has text: You're a boss mate! Many thanks for it, it's working now. I've tried a lot of changes but I didn't know it won't work with visible overflow. Do you know if is there any possibility to make it always fit the screen? (I mean, the area makes itself bigger when the window does, and the same for smaller)

http://stackoverflow.com/q/29530882
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47215289
has comment: http://stackoverflow.com/comment/47215301
possible better answer: http://stackoverflow.com/a/29530979
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29530936
type: Question
has comment: http://stackoverflow.com/comment/47215348
has comment: http://stackoverflow.com/comment/47215309
has comment: http://stackoverflow.com/comment/47215352
tagged with: javascript
has comment: http://stackoverflow.com/comment/47215281
has comment: http://stackoverflow.com/comment/47215243
has answer: http://stackoverflow.com/a/29530979
score: 0
answer count: 2
has body: Is there anyway to run a script in an alert box? My current code : I've tried : users."); And my current code's alert box shows up as Hello document.write(c1) users. Any help on this? c1 is supposed to call out their country taken from a script at my tag Thanks
has title: Calling variables in an alertbox
accepted answer: http://stackoverflow.com/a/29530936
has comment: http://stackoverflow.com/comment/47215383

http://stackoverflow.com/comment/47506167
comment on: http://stackoverflow.com/a/29684444
score: 0
has text: A fair point. Stuiterbal posted a better solution for what you want to accomplish :-)
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29613826
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/29613571
has comment: http://stackoverflow.com/comment/47373930
has body: Here is your code working. you have 2 issues, first you are inserting the script tags outside the body, that causes a parse error i think, and the main issue is that you are loading first the angular-ui-router library, load first angularjs
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29613571
type: Answer

http://stackoverflow.com/a/29564405
downvote count: 0
score: 7
has comment: http://stackoverflow.com/comment/47279078
has comment: http://stackoverflow.com/comment/47282631
answers question: http://stackoverflow.com/q/29564353
has comment: http://stackoverflow.com/comment/47279209
upvote count: 7
has body: Instead of hooking up event handlers to each input you have, you could instead hook up an event to all inputs. $('form input[type="text"]').on('change', function() { EnableButtons(); }); This works as the selector form input[type="text"] selects all input elements (of type text) within a form, and then binds a change event handler to them. One other option is to assign all of the inputs you want to monitor a class such as change-monitored and then you can change your selector to $('.change-monitored').on(...) Demo $('.changable').on('change', function(e) { $('#log').append(e.target.id + ' changed to ' + $(e.target).val() + '&lt;br/&gt;'); }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;form&gt; &lt;input type="text" class="changable" id="input1" /&gt; &lt;input type="text" class="changable" id="input2" /&gt; &lt;input type="text" class="changable" id="input3" /&gt; &lt;input type="text" class="changable" id="input4" /&gt; &lt;input type="text" class="changable" id="input5" /&gt; &lt;/form&gt; &lt;div id="log"&gt;&lt;/div&gt;
type: Answer

http://stackoverflow.com/comment/47462626
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29661436
has text: Yeah, I see what you mean. I just assumed he did it this way since he was able to get it to work as he stated.
score: 0

http://stackoverflow.com/comment/47417493
comment on: http://stackoverflow.com/q/29636255
score: 0
type: QuestionComment
has text: @dandavis Did you read the whole question? I'm not using a sleep.
type: Comment

gruntjs
tags question: http://stackoverflow.com/q/29656946
tags question: http://stackoverflow.com/q/29591818
tags question: http://stackoverflow.com/q/29544715
tags question: http://stackoverflow.com/q/29679008
tags question: http://stackoverflow.com/q/29603813
tags question: http://stackoverflow.com/q/29624104
tags question: http://stackoverflow.com/q/29621595
tags question: http://stackoverflow.com/q/29640872
tags question: http://stackoverflow.com/q/29676897
tags question: http://stackoverflow.com/q/29656368
tags question: http://stackoverflow.com/q/29570687
type: Tag
tags question: http://stackoverflow.com/q/29639118
tags question: http://stackoverflow.com/q/29555005
tags question: http://stackoverflow.com/q/29615324
tags question: http://stackoverflow.com/q/29574992
tags question: http://stackoverflow.com/q/29565890
tags question: http://stackoverflow.com/q/29543116
tags question: http://stackoverflow.com/q/29685408
tags question: http://stackoverflow.com/q/29590219
tags question: http://stackoverflow.com/q/29604916
tags question: http://stackoverflow.com/q/29662804
tag name: gruntjs
tags question: http://stackoverflow.com/q/29608291
tags question: http://stackoverflow.com/q/29535678

http://stackoverflow.com/a/29551732
answers question: http://stackoverflow.com/q/29551391
type: Answer
has comment: http://stackoverflow.com/comment/47254958
score: 0
has body: You're mixing cows with ballet. If you only need to operate over inputs and textareas, let's make it short: use yourElement.value = "some value". (You cannot operate using innerHTML over an input element in any case.)
has comment: http://stackoverflow.com/comment/47254941

http://stackoverflow.com/a/68253242
answers question: http://stackoverflow.com/q/29552601
downvote count: 0
type: Answer
upvote count: 1
score: 1
has body: Here is how I do it- <Navbar /> <TabBar /> //Imp <DefStuff /> <Otherstuff /> <Redirect to="/defult" /> //Imp

http://stackoverflow.com/a/29546150
type: AcceptedAnswer
has body: Have you tried parent.location? <?php $ErrorUrl = 'http://propertytaxdfw.com/CurrentWebsite/error.php'; ?>
type: Answer
accepted answer of: http://stackoverflow.com/q/29544468
score: 0
answers question: http://stackoverflow.com/q/29544468

http://stackoverflow.com/a/29591950
has body: For the first time you can initialize a flag to true and once the watch is triggered it can be set to false. So that watch does not get triggered. var firstTime = true and then when the first $watch fires, do $scope.$watch('testValue', function() { if (firstTime) { $timeout(function() { firstTime = false; }); } else { //perform operation. } Second method which is recommended by the angular doc The first time watch listener is called, the old value and the new value are identical. so check for not equal condition as given below $scope.$watch('testValue', function(newValue, oldValue) { if (newValue !== oldValue) { // perform your operation } });
score: 0
answers question: http://stackoverflow.com/q/29591881
type: Answer

http://stackoverflow.com/q/29566223
type: Question
has comment: http://stackoverflow.com/comment/47282903
accepted answer: http://stackoverflow.com/a/29567349
tagged with: javascript
score: -1
answer count: 2
has comment: http://stackoverflow.com/comment/47282485
favorite count: 0
has comment: http://stackoverflow.com/comment/47282960
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has answer: http://stackoverflow.com/a/29567349
has title: Cordova/PhoneGap rendering local PHP?
has comment: http://stackoverflow.com/comment/47283016
has body: I'm making a web using PhoneGap. I need to use a PHP page, but I want a real fluid website, so I opted for replacing a div with some PHP using JavaScript when loaded. When I launch the page "mypage.html" I check the user connection with this function: &lt;script&gt; function checkConnection(){ var online, speed; /* condizione di controllo per determinare se l'app viene correntemente testata in un simulatore o dispositivo mobile (quindi utilizzando PhoneGap) o in un normale browser che supporta l'HTML5 */ if(typeof cordova != "undefined"){ /* si tratta di un dispositivo vero e proprio o di un simulatore, quindi utilizziamo il plugin "Connection" messo a disposizione da Phonegap */ var networkState = navigator.connection.type; var states = {}; states[Connection.UNKNOWN] = 'Unknown'; states[Connection.ETHERNET] = 'Ethernet'; states[Connection.WIFI] = 'WiFi'; states[Connection.CELL_2G] = 'Cell_2G'; states[Connection.CELL_3G] = 'Cell_3G'; states[Connection.CELL_4G] = 'Cell_4G'; states[Connection.CELL] = 'Cell_generic'; states[Connection.NONE] = 'None'; //determino il tipo di connessione in base all'oggetto "states" appena definito grazie al plugin Phonegap var connType = states[networkState]; if(connType=='None') online = false; else{ online = true; if(connType=="Cell_2g" || connType=="Cell_generic") speed="slow"; else speed="fast"; } }else{ /* si tratta di un normale browser desktop o mobile, quindi utilizziamo la funzionalità HTML5 */ online = navigator.onLine; if(online){ var conn = navigator.connection || {'bandwidth':'0'}; //utilizziamo il metodo "bandwidth" per determinare la velocità di connessione, il quale restituisce un valore numerico che indica la larghezza di banda della connessione corrente if(conn.bandwidth&gt;2) speed="fast"; else speed="slow"; } } return online?speed:false; } var deviceConnection = checkConnection(); if(deviceConnection){ if(deviceConnection == "slow"){ //gestione connnessione lenta }else{ //gestione connnessione veloce } }else{ /* gesti…
type: AnsweredQuestion
tagged with: cordova
possible better answer: http://stackoverflow.com/a/29567337
has answer: http://stackoverflow.com/a/29567337
downvote count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/47283160

http://stackoverflow.com/comment/47361654
type: AnswerComment
comment on: http://stackoverflow.com/a/29602723
has text: Not happy of that and it is quite unrealistic to roll back to the browser-default button style as each browser is unique. Thanks to your insight I have managed to do it by few unbinds of jquery event handlers and redefinition of jquery prototypes. It's far from perfect but have nothing better on hand.
score: 0
type: Comment

http://stackoverflow.com/comment/85262671
has text: `!min-.153479`?????? Also this iterates over the array multiple times and super unreadable.
comment on: http://stackoverflow.com/a/29585826
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47436783
comment on: http://stackoverflow.com/q/29647888
type: Comment
type: QuestionComment
score: 0
has text: you can use the pageload event like in this question http://stackoverflow.com/questions/16552560/load-google-tag-manager-synchronously

http://stackoverflow.com/a/29667056
accepted answer of: http://stackoverflow.com/q/29649520
upvote count: 1
type: AcceptedAnswer
has body: Updated the Onsen UI to 1.3.0 Solved my problem. Same thing is working very fine. I think there was some sort of bug in previous version of Onsen UI.
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29649520

http://stackoverflow.com/q/29636102
tagged with: visual-studio-2013
tagged with: cordova
has body: In Visual Studio Professional 2013 when I created a new Apache Cordova project, get this warning: Warning 1 The TypeScript Compiler was given no files for compilation, so it will skip compiling. Few weeks before it is working fine but now I am getting this error. I re-install VS and Tool for Apache Cordova, but still getting this error. How to solve this error? Any solution?
type: UnansweredQuestion
has title: Warning 1 The TypeScript Compiler was given no files for compilation, so it will skip compiling
has answer: http://stackoverflow.com/a/33990595
upvote count: 4
answer count: 4
tagged with: typescript
downvote count: 0
tagged with: cordova-3
type: Question
has answer: http://stackoverflow.com/a/29636707
has answer: http://stackoverflow.com/a/29636827
tagged with: javascript
score: 4
has answer: http://stackoverflow.com/a/30740078
favorite count: 0

http://stackoverflow.com/comment/47296975
type: QuestionComment
type: Comment
has text: what is the value of `response`?
score: 1
comment on: http://stackoverflow.com/q/29574016

http://stackoverflow.com/q/29615420
upvote count: 3
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/41055276
answer count: 2
score: 3
tagged with: public-key-encryption
downvote count: 0
has answer: http://stackoverflow.com/a/29672559
favorite count: 0
tagged with: webcrypto-api
has body: I've been rather busy trying to get a secure exchange established between a browserclient, using the webcrypto api and PHP server using openssl. I've broken down things as much as I can. I wrote some javascript to generate a keypair, print out the values private and public, encrypt a simple string and print it out as well. I've copied the values straight to a simple php script. Trying to decode it with the values from the javascipt. Encoding and decoding works properly in the javascript (as posted below), decoding in php does not (also posted beneath the javascript). I also can't seem to find where to set the SHA-512 declaration in PHP. Does anyone have experience with this kind of exchange and perhaps point me in the right direction. RSA-OAEP was chosen because it's supported by chrome, mozilla, IE11 and Safari as well as PHP. Kind regards, Gideon // JavaScript Document var keyPair; var pemPublicKey; var pemPrivateKey; var _spki; var _pkcs8; window.crypto.subtle.generateKey({ name: "RSA-OAEP", modulusLength: 2048, publicExponent: new Uint8Array([1, 0, 1]), // 24 bit representation of 65537 hash: {name: "SHA-512"} }, true, ["encrypt", "decrypt"]) .then(function(newKeyPair) { keyPair = newKeyPair; return keyPair; }) .then(function(keyPair) { window.crypto.subtle.exportKey('spki', keyPair.publicKey) .then(function(spki) { _spki = spki; var pemPublicKey = convertBinaryToPem(spki, "PUBLIC KEY"); document.writeln(pemPublicKey); sendToPhp(); }); window.crypto.subtle.exportKey('pkcs8', keyPair.privateKey) .then(function(pkcs8) { _pkcs8 = pkcs8; var pemPrivateKey = convertBinaryToPem(pkcs8, "PRIVATE KEY"); document.writeln(pemPrivateKey); }) }); function sendToPhp() { window.crypto.subtle.importKey('spki', _spki, {name:"RSA-OAEP", hash: {name: "SHA-512"}}, false, ["encrypt"]) .then(function(cryptokey) { window.crypto.subtle.encrypt({ name: "RSA-OAEP"}, cryptokey, str2ab('mijn geheimpje') ) .then(function(encrypted){ //returns an ArrayBuffer containing the encrypted data doc…
has title: RSA-OAEP SHA-512 Encrypt / Decrypt from Javascriptwebcrypt api to PHP openssl?
type: UnansweredQuestion
tagged with: encryption
tagged with: php

http://stackoverflow.com/q/29570349
answer count: 1
tagged with: string
has body: Im learning JS OOP from Stoyan Stefanov's book. I got problem with exercise 4 in chapter 4: Imagine the String()constructor didn't exist. Create a constructor function MyString()that acts like String()as closely as possible. You're not allowed to use any built-in string methods or properties, and remember that String()doesn't exist. You can use this code to test your constructor: Below is my attempt for creating String split() like method. Could you guide me how to make it work ? function MineString(string){ this.lengthS = string.length; //this[1] = "test"; for(var i = 0; i &lt; string.length;i++){ this[i] = string.charAt(i); } this.toString = function(){ return string; } this.split = function(char){ var splitedArray = []; var foundedChar = []; var string2 = []; for (var i = 0; i &lt; this.lengthS ; i++){ foundedChar.push(string[i].indexOf(char)); } for (var j = 0; j &lt; foundedChar.length; j++){ if(foundedChar[j] === -1){ //splitedArray[0] += string.charAt(j); //splitedArray[j] = string.charAt(j); string2 += string.charAt(j); //splitedArray.push(string2); splitedArray[foundedChar.length] = string2; }else if (foundedChar[j] === 0){ //splitedArray.push(string.charAt(j)); } } return splitedArray; } } var text = new MineString("hello"); text.split("e"); So text.split("e"); should display something like this: var text = new MineString("hello"); text.split("e"); ["h","llo"]
has comment: http://stackoverflow.com/comment/47291044
has title: Emulate string split() from Javascript Object Oriented Programing Stoyan Stefanov book
type: AnsweredQuestion
tagged with: oop
type: Question
has answer: http://stackoverflow.com/a/29571698
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/47292020
has comment: http://stackoverflow.com/comment/47291194
accepted answer: http://stackoverflow.com/a/29571698
score: 0

http://stackoverflow.com/comment/47418644
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29638134
has text: @developer, A.B is saying when someone submits a form, do your processing, validating, store in session...whatever you would normally do and then perform a header redirect to the next page. This will stop the resubmit page from showing at all.

http://stackoverflow.com/q/29533820
score: 1
has answer: http://stackoverflow.com/a/29533985
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29533973
has body: I have a list of checkboxes which generate tables when checked. Each table has an All checkbox which when clicked selects all the options of the table. The all checkboxes are all referred to by the same class but have different IDs depending on the table. I am trying to write a code to get the ID of the generated table and use this ID in my select_all function which would allow the ALL checkbox to only affect its respective table's options. What I currently have ALL Checkbox <input type="checkbox" name="tbl" class="tblall" id="all<?php echo $tables_index;?>" value="" /> <p >ALL ALL Function $(function () { $(document).on("click", (".tblall"), function () { var className = $("input:checkbox[name='tbl2']").attr('class'); if (this.checked) { // Iterate each checkbox $('.' + className).each(function () { this.checked = true; }); } else { $('.' + className).each(function () { this.checked = false; }); } }); }); What I have tried I tried to store the ALL checkbox ID in a variable and the use this variable to refer to the checkbox in my function like below: some function (){ var allID = $(".tball").attr('id'); store allID; } $(function () { var allID = window.sessionStorage.getItem("allID"); $(document).on("click", ("#"+ allID), function () { This was not successful as it didn't even select all options of any table. I also thought if writing a function that fetches the ID and calling the function when the DOM is loaded : function all_Id() { var allID; if ($("input:checkbox[name='tbl[]']:checked")) { allID = $("input:checkbox[name='tbl']").attr('id'); } return allID; } $(document).ready(function () { all_Id(); }); $(document).ajaxComplete(function () { all_Id(); }); What's the best way to achieve what I want?
accepted answer: http://stackoverflow.com/a/29533985
downvote count: 0
has answer: http://stackoverflow.com/a/29533950
favorite count: 0
has answer: http://stackoverflow.com/a/29533997
upvote count: 1
tagged with: checkbox
possible better answer: http://stackoverflow.com/a/29533997
answer count: 4
has title: Jquery click function using a dynamic value
type: AnsweredQuestion

http://stackoverflow.com/comment/47234877
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29540478
has text: How about `$.each($('#id1, #id2'), function(){ $(this).dialog('open'); });` ? Was that one of your attempts?

http://stackoverflow.com/q/29557911
tagged with: javascript
possible better answer: http://stackoverflow.com/a/29558866
has answer: http://stackoverflow.com/a/29558866
has comment: http://stackoverflow.com/comment/47266628
tagged with: http://stackoverflow.com/tag/html
has body: Consider the following: What would you expect the console.log to contain? I hope you come to one of the two outcomes that I would expect: 4 Scripts and either the two existing or all four script tags shown in the head's innerHTML (document.write could as well write to the body, so one could expect the script tags to be injected as children of the body). The thing is that, in Chrome and IE11, the first script tag added via document.write is shown in the head's innerHTML, but the second isn't, and the DOM query result is 3 Scripts. Could anyone please elaborate?
has comment: http://stackoverflow.com/comment/47268477
has answer: http://stackoverflow.com/a/29558375
favorite count: 0
score: 6
accepted answer: http://stackoverflow.com/a/29558375
upvote count: 6
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47266826
has answer: http://stackoverflow.com/a/29559589
linked to: http://stackoverflow.com/q/802854
type: Question
has title: What exactly is innerHTML, and how does document.write work?
has answer: http://stackoverflow.com/a/29558161
has comment: http://stackoverflow.com/comment/47266563
has comment: http://stackoverflow.com/comment/47266957
downvote count: 0

http://stackoverflow.com/q/29558556
answer count: 1
linked to: http://stackoverflow.com/q/7759605
has body: I was intending to prompt my users to hold Alt+Shift for a particular aspect of my website. Having written the script, I discovered that in Windows where multiple languages are enabled, this toggles between them, which would not be desirable for the user. Ideally, I would like to prevent this default toggle whilst on this particular web page or perhaps alternatively check first to see if multiple languages are enabled on windows. As far as I can tell it’s not possible to do either? The following does not prevent the toggle: e.preventDefault ? e.preventDefault() : event.returnValue = false; This only detects the languages in the browser, not the OS: navigator.languages ? navigator.languages[0] : (navigator.language || navigator.userLanguage)
accepted answer: http://stackoverflow.com/a/29558646
has comment: http://stackoverflow.com/comment/47267785
upvote count: 1
has comment: http://stackoverflow.com/comment/47267744
has title: Javascript to prevent Alt+Shift default action or to detect multiple OS languages
type: AnsweredQuestion
score: 1
tagged with: preventdefault
type: Question
has answer: http://stackoverflow.com/a/29558646
downvote count: 0
tagged with: javascript
favorite count: 0

http://stackoverflow.com/comment/47310490
type: QuestionComment
comment on: http://stackoverflow.com/q/29580670
score: 0
type: Comment
has text: try this : http://xqib.org

http://stackoverflow.com/comment/47245935
type: Comment
type: QuestionComment
score: 1
has text: https://jsfiddle.net/ttggepyu/
comment on: http://stackoverflow.com/q/29547135

http://stackoverflow.com/a/29609747
has comment: http://stackoverflow.com/comment/47365199
upvote count: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47365121
type: Answer
score: -1
answers question: http://stackoverflow.com/q/29565485
downvote count: 1
accepted answer of: http://stackoverflow.com/q/29565485
has body: 1.Serialize the form to a JSON-Object $.fn.serializeObject = function(){ var o = {}; var a = this.serializeArray(); $.each(a, function() { if (o[this.name] !== undefined) { 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; }; 2.Define an AJAX request with content type application/json $.ajaxSetup({ contentType: "application/json; charset=utf-8" }); function request(path, params, method) { method = method || "POST"; $.ajax({ url: path, type: method, data: params, dataType: "json", contentType: "application/json; charset=utf-8", success: function (result) { //do something }, error: function (xhr, ajaxOptions, thrownError) { //do something } }); } 3.Send data after form submission $(function() { var url = "/api/route"; $('form').submit(function() { var json = JSON.stringify($('form').serializeObject()); request(url, json); return false; }); });

azure
tags question: http://stackoverflow.com/q/29587241
type: Tag
tags question: http://stackoverflow.com/q/29583583
tag name: azure

http://stackoverflow.com/a/29710135
has body: Ok, so you need to put a transparent div in front of the chartist chart that captures the mousedown/touchstart, mousemove/touchmove, and mouseup/touchend events. working example: http://jsfiddle.net/higginsrob/jwhbzgrb/ // updated event functions: onTouchStart: function (evt) { evt.preventDefault(); this.is_touch = (evt.touches); var node = evt.currentTarget.previousSibling; var grid = node.querySelector('.ct-grids'); var bbox = grid.getBBox(); this.columnwidth = bbox.width / this.props.data.length; this.offset = this.getScrollLeftOffset(node) + bbox.x + (this.columnwidth / 2); this.istouching = true; this.onTouchMove(evt); } onTouchMove: function (evt) { if(this.istouching){ var x; if (this.is_touch) { if(evt.touches &amp;&amp; evt.touches[0]){ x = evt.touches[0].clientX - this.offset; } } else { x = evt.clientX - this.offset; } this.setState({ index: Math.round(x / this.columnwidth) }); } } onTouchEnd: function(evt){ this.istouching = false; } // updated render function: render: function () { return React.DOM.div( { style: { position: "relative" } }, ReactChartist({ ... your chartist chart here .... }), // this div sits in front of the chart and captures events React.DOM.div({ onMouseDown: this.onTouchStart, onTouchStart: this.onTouchStart, onMouseMove: this.onTouchMove, onTouchMove: this.onTouchMove, onMouseUp: this.onTouchEnd, onTouchEnd: this.onTouchEnd, style: { position: "absolute", top: 0, left: 0, right: 0, bottom: 0 } }) ); }
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/29617552
upvote count: 2

http://stackoverflow.com/comment/47430937
type: QuestionComment
has text: It seems OK to me. Pause/Play and Stop/Play both increment the seconds and show the alert at 10 seconds.
comment on: http://stackoverflow.com/q/29644689
score: 0
type: Comment

http://stackoverflow.com/q/29668879
has answer: http://stackoverflow.com/a/29668965
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29668899
possible better answer: http://stackoverflow.com/a/29668965
has answer: http://stackoverflow.com/a/29668959
tagged with: css
has title: How to get CSS left property value on second element of anchor
type: AnsweredQuestion
score: 3
upvote count: 3
has body: I have this HTML Structure: And I am trying to find second anchor inline left value and I have tried with this jQuery code but everytime I am getting undefined from console. console.log($("#sqm-id").find("a:eq(2)").css("left")); JSFiddle: Sample Demo Any ideas?
accepted answer: http://stackoverflow.com/a/29668899
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
answer count: 3

jaydata
tag name: jaydata
tags question: http://stackoverflow.com/q/29535174
type: Tag
tags question: http://stackoverflow.com/q/29589242

http://stackoverflow.com/a/29668266
has body: For the moment I'm working around this issue by juggling the internal values rather than the control: (function (angular) { var module = angular.module('test', []); module.controller('TestCtrl', ['$scope', function ($scope) { $scope.profile = [ { key: 'Prop1', inheritedValue: 'test', localValue: 'test2', local: true }, { key: 'Prop2', inheritedValue: 'hello', localValue: 'world', local: false }, ]; $scope.initValue = function (prop) { prop.value = prop.local ? prop.localValue : prop.inheritedValue; } $scope.localise = function (prop) { if (!prop.local) { // save last local value when switching local -> inherited prop.localValue = prop.value; } $scope.initValue(prop); } }]); })(angular); angular.element(document).ready(function () { angular.bootstrap(document, ['test']); }); {{prop.key}} (inherited) It's a bit messier but it seems to work better. Still curious if there are any better solutions.
type: Answer
score: 0
answers question: http://stackoverflow.com/q/29666016

http://stackoverflow.com/q/29639924
has title: Duplicate edges not being removed in Delaunay Triangle construction
type: AnsweredQuestion
has body: I'm trying to implement Delaunay Triangulation. However, I seem to be having a problem with edges creating overlapping triangles: I'm basing my implementation as described on this site. I'm just using a brute force loop to check whether or not an edge already exists in the set. v = vertex to be added edgeBuffer = []; for each triangle if v is in the triangle's circumscribed circle for each edge in the triangle check if it's already in edgeBuffer if not, add it remove triangle I suspect that it's another part of my algorithm that's going wrong and causing this to happen, but I have implemented everything in a pretty straightforward manner. What is wrong with this code? Fiddle
favorite count: 0
type: Question
upvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/29642811
score: 0
accepted answer: http://stackoverflow.com/a/29642811
downvote count: 1
tagged with: delaunay
tagged with: javascript

http://stackoverflow.com/comment/47275305
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29562838
has text: What did you try so far in javascript as for this equivalent?
score: 0

http://stackoverflow.com/comment/47296869
has text: Could you give us an example of output you are expecting?
comment on: http://stackoverflow.com/q/29573894
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/29550960
has body: Use the :visible selector. container .find("input,select,textarea,button,object,[tabindex],a") .filter(":visible");
type: Answer
accepted answer of: http://stackoverflow.com/q/29550945
score: 3
answers question: http://stackoverflow.com/q/29550945
upvote count: 3
downvote count: 0
type: AcceptedAnswer

http://stackoverflow.com/q/29646822
tagged with: javascript
type: UnansweredQuestion
has title: Json webservice values are not loading in datatables. Showing error of "TypeError: c is undefined"?
tagged with: datatables
tagged with: jquery
type: Question
tagged with: datatable
has body: I am retrieving json values from java server and loading it in the datables.While parsing it shows the error of TypeError: c is undefined. Html coding: Employee Id. Division Name Mobile number JS Coding $('#employeeTable').dataTable( { "bProcessing": true, "bStateSave": true, "bServerSide": true, "sAjaxSource": "http://192.168.1.3:8080/alpharithm/employee/employeeDetails", "aoColumns": [ { "sName": "division", "sTitle": "Employee Id.", "sWidth": "20%", "bSortable": "true" }, { "sName": "employee_id", "sTitle": "Division", "sWidth": "40%", "bSortable": "true" }, { "sName": "last_name", "sTitle": "Name", "sWidth": "40%", "bSortable": "true" }, { "sName": "first_name", "sTitle": "Mobile number", "sWidth": "20%", "bSortable": "true" } ], "sPaginationType": "full_numbers", "aaSorting": 1,'asc', "oLanguage": { "sLengthMenu": "Page length: _MENU_", "sSearch": "Filter:", "sZeroRecords": "No matching records found" }, }); JSON Response {"employee_details":[{"division":"Android","employee_id":"EFF100568","last_name":"lastname","first_name":"name"}],"status":"1"} Help me to solve this?
score: 0
tagged with: http://stackoverflow.com/tag/json
answer count: 1
has answer: http://stackoverflow.com/a/29647104

http://stackoverflow.com/a/29539542
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29539471
answers question: http://stackoverflow.com/q/29539471
type: Answer
has comment: http://stackoverflow.com/comment/47232212
has comment: http://stackoverflow.com/comment/47232080
has body: This is how I would do it: var anchors = document.querySelectorAll("a"), i; for (i=0; i<anchors.length; i+=1) { anchors[i].addEventListener("click", function() { alert("triggered!"); }); } test1 test2
has comment: http://stackoverflow.com/comment/47231188
score: 4
has comment: http://stackoverflow.com/comment/47231261
upvote count: 4

http://stackoverflow.com/q/29605055
has comment: http://stackoverflow.com/comment/47356549
has body: I'm wondering if there is a rationale behind this, since it seems to me like it would be more object-oriented if objects were passed as values. Effectively it would be a function scope for Objects, like with primitives. Is just for optimisation purposes that objects are passed by reference? ref: http://snook.ca/archives/javascript/javascript_pass
upvote count: 2
has comment: http://stackoverflow.com/comment/47355828
linked to: http://stackoverflow.com/q/40480
has comment: http://stackoverflow.com/comment/47356606
downvote count: 1
has title: Why does javascript pass objects by reference?
has comment: http://stackoverflow.com/comment/47356380
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47356132
has answer: http://stackoverflow.com/a/29605139
score: 1
type: Question
has comment: http://stackoverflow.com/comment/47355777
linked to: http://stackoverflow.com/q/518000
has comment: http://stackoverflow.com/comment/47356005
answer count: 1
tagged with: javascript
linked to: http://stackoverflow.com/q/10881072
has comment: http://stackoverflow.com/comment/47355937
favorite count: 0
has comment: http://stackoverflow.com/comment/47356186
tagged with: scope
accepted answer: http://stackoverflow.com/a/29605139
has comment: http://stackoverflow.com/comment/47355896
has comment: http://stackoverflow.com/comment/47355840

http://stackoverflow.com/a/29648915
has body: The problem here is that you're assigning a jQuery object to your variable, and not the content of the element. To extract the text inside the &lt;span&gt;, you should use either .html() or .text(), and do this instead: var availableCodes = $("#codesQuantity").text();
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/29648760
type: Answer
upvote count: 2
downvote count: 1
accepted answer of: http://stackoverflow.com/q/29648760
score: 1

http://stackoverflow.com/q/29606890
tagged with: combobox
type: UnansweredQuestion
score: 0
has body: I wanted to ask if it was possible to run a javascript when mouseover on single options in Chosen JQuery Combobox For example: $('#comboCMBGROUP').bind(' onMouseOver, function () { var Value1 = $(this).val(); alert(Value1); }); I have use this but the javascript don’t run. There is a solution? In a normal combobox html i have use this code but a want run it on Chosen Combobox: Example: 1 2 3
has comment: http://stackoverflow.com/comment/47360067
has answer: http://stackoverflow.com/a/29609505
has title: Execute Javascript function when muoseover on option in Chosen JQuery Combobox
tagged with: jquery-chosen
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/29607681
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47359898

http://stackoverflow.com/comment/47372338
score: 2
has text: Where's the CountDownTimer function?
comment on: http://stackoverflow.com/q/29613425
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47444084
comment on: http://stackoverflow.com/q/29651931
type: Comment
type: QuestionComment
has text: You can do like this ` $scope.form.fieldName.$dirty = true;`
score: 1

http://stackoverflow.com/a/29653082
score: 1
downvote count: 0
has body: This disables the scrolling. NOTE: Notice it only stops scrolling if you hover over the element. $('#container').hover(function() { $(document).bind('mousewheel DOMMouseScroll',function(){ console.log('Scroll!'); stopWheel(); }); }, function() { $(document).unbind('mousewheel DOMMouseScroll'); }); function stopWheel(e){ if(!e){ /* IE7, IE8, Chrome, Safari */ e = window.event; } if(e.preventDefault) { /* Chrome, Safari, Firefox */ e.preventDefault(); } e.returnValue = false; /* IE7, IE8 */ } Quoted from amosrivera's answer EDIT: To check which way it is scrolling. var lastScrollTop = 0; $(window).scroll(function(event){ var st = $(this).scrollTop(); if (st &gt; lastScrollTop){ // downscroll code } else { // upscroll code } lastScrollTop = st; });
answers question: http://stackoverflow.com/q/29652911
type: Answer
has comment: http://stackoverflow.com/comment/47453038
has comment: http://stackoverflow.com/comment/47452924
upvote count: 1

http://stackoverflow.com/comment/47536625
score: 0
comment on: http://stackoverflow.com/a/29679287
type: Comment
type: AnswerComment
has text: That's true; but they accomplish different goals. Your second approach sets up the prototype chain for instances of the function object, whereas I want to set up the prototype chain of the function object itself. Seems like the Javascript writers didn't intend for programmers to do this.

http://stackoverflow.com/a/66387426
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29658088
has body: This is a bug https://issuetracker.google.com/issues/177046274 There seems to be a few workarounds there for people using it as part of an Apps Script Add-on, making reference to this stack question: Google Picker API Invalid origin value error Though this doesn't work for the official quickstart using JavaScript. I have tested this with Chrome and Firefox and both give the same results. If this is affecting you please be sure to go and star the issue linked above.
upvote count: 1

http://stackoverflow.com/a/29640363
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/29640270
upvote count: 1
score: 1
has body: jsve's answer gives you the 'what'. The 'why' is: to use the base Object.toString() on the input object, even if that object's own prototype has a more specialized toString() in place.

http://stackoverflow.com/comment/47252095
has text: @AndrewLyndem - Maybe your function is wrapped by another function or something. Anyway read about javascript scopes.
type: Comment
comment on: http://stackoverflow.com/a/29549874
score: 1
type: AnswerComment

import
type: Tag
tag name: import
tags question: http://stackoverflow.com/q/29657935

http://stackoverflow.com/q/29534440
answer count: 3
accepted answer: http://stackoverflow.com/a/29534515
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has title: Convert multiple tables to one table inside same DIV using jQuery
favorite count: 0
has body: I have multiple tables inside div with same columns and I want them to convert to one table with all records from that tables. Can it be done with jQuery? My HTML looks like this: Column 1 Column 2 Record 1 Record 2 Column 1 Column 2 Record 3 Record 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47221884
score: 1
has answer: http://stackoverflow.com/a/29534720
has answer: http://stackoverflow.com/a/29534515
upvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/29534695
has answer: http://stackoverflow.com/a/29534695
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/47552375
type: Comment
comment on: http://stackoverflow.com/a/29685754
score: 0
has text: I hosted it on my site and it didn't work, but then I added a .htaccess and it worked!
type: AnswerComment

http://stackoverflow.com/q/29545913
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/47243329
type: Question
downvote count: 0
tagged with: javascript
has body: I need to call a RESTful web service using SSIS. The web service accepts a JSON object as a parameter - I can call this service by constructing the JSON object using JavaScript: data = { CustomerKey: "Demo", ApiKey: " 9999AA99-999A-9A9A-99A9-99999999A999", RegistrationNo: "REG N02", InsuranceRef: "Ins Ref", VehicleType: "Lorry", CarMake: "Car Make", CarModel: "Car Model", ChassisNo: "ChassisNo", GrossPlatedWeight: "GP weight", ManufactureYear: 1999, VehicleStatus: "Hired", DeliveryDate: null, TransferDate: new Date(2004, 4, 1, 0, 0, 0).toMSDate(), LastMotDate: new Date(2013, 12, 1, 0, 0, 0).toMSDate(), LastInspectionDate: new Date(2013, 1, 11, 0, 0, 0).toMSDate(), LastServiceDate: new Date(2014, 2, 2, 0, 0, 0).toMSDate(), InformationLog: "information log and more information", VehicleNotes: "Vehicle Notes", EntityReference: "reference", UseRootOrgUnit: "true", AddDictionaryItemIfMissing: "true"}; and posting the object to the web service. The web service also returns a JSON object. However, javascript is not available to me in SSIS - is it possible to call such a web service using SSIS? If so, can anyone help me with a link to show the steps necessary? (I have no experience with SSIS). Thanks.
tagged with: rest
has title: Calling a RESTful web service using SSIS
favorite count: 0
tagged with: ssis
answer count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: web-services
score: 1

http://stackoverflow.com/a/29666214
type: Answer
score: 2
answers question: http://stackoverflow.com/q/29665537
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29665537
has body: I've checked Angular source code and it simply doesn't use the data returned by the rejected promise. But you can do that yourself by calling $setValidity: .then(function(results) { scope.postcodetowns = results; ctrl.$setValidity('postcode', results.length === 0); ctrl.$setValidity('postcode_multiple', results.length > 1); def.resolve(); } return def.promise; And now you can use form.postcode.$error.postcode_multiple with ngShow: This post code has multiple suburbs assigned to it! Or even better, with ngMessages: That post code does not exist! This post code has multiple suburbs assigned to it!
upvote count: 2

http://stackoverflow.com/comment/47281143
has text: You dont. Just pass the values array to the client. You build the data table on the client then.
comment on: http://stackoverflow.com/a/29564705
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29587811
has comment: http://stackoverflow.com/comment/47323509
has comment: http://stackoverflow.com/comment/47323426
upvote count: 1
has body: How can I run this script https://code.google.com/p/jqueryrotate/ when Joomla starts? I tried to make a code like : <script src="<?php echo JURI::base().'templates/'.$this->template.'/js/jQueryRotate.js'; ?>"> i got in inspecting element this message : Failed to load resource: the server responded with a status of 403 (Forbidden) What that mean and what i have to do to add this lib. into index of my joomla
has comment: http://stackoverflow.com/comment/47323217
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
has title: Running a script on starting Joomla
answer count: 0
downvote count: 0
score: 1
favorite count: 0
tagged with: joomla
has comment: http://stackoverflow.com/comment/47323708
has comment: http://stackoverflow.com/comment/47323302
type: Question
has comment: http://stackoverflow.com/comment/47323349

http://stackoverflow.com/comment/47336469
type: QuestionComment
score: 2
has text: Is the idea behind using `eval` that "if it's not a letter, it must be a number"? You may be better off with a short and simple regex. Consider adding an example to this question, both a good match and a failing one.
comment on: http://stackoverflow.com/q/29594778
type: Comment

http://stackoverflow.com/q/29557327
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/6048504
has body: My application is built on Nodejs + Mongodb + amqp. The core module is receiving the the message from amqp, then wrap it into the corresponding message transaction. In the message transaction, save the message information into mongodb and some other logic. function messageReceiverCallback(msg) { try { messageHandler(decode(msg)); } catch (ex) { } } function messageHandler(msg) { function defaultTransaction() { } var dispatch = { 'default': defaultTransaction } dispatch[MSG.TYPE1] = Msg1Transaction; // other message transaction here return (dispatch[msg.type] || dispatch['default'])(msg); } function Msg1Transaction(msg) { // some mongodb operation here... } However, when there are several same type messages with different message field value in the queue of amqp, then the messageReceiverCallback will be called, and the Msg1Transaction also be invoked multiple times. As a result, the data saved in the mongodb will be incorrect, because of the asynchronous operation on mongodb which I have ignored. How can I handle it in this case?? I have one idea, add one new transaction queue wrapped with Promise maybe. So the transaction can be processed asynchronously. But I do not how to implement it? could one can help me or some other better solution to solve it?
tagged with: node.js
type: Question
has title: How to handle the asynchronous transaction in Nodejs
tagged with: javascript
score: 0
tagged with: mongodb
has answer: http://stackoverflow.com/a/29559203
answer count: 1
tagged with: asynchronous
tagged with: promise

http://stackoverflow.com/q/29541216
has body: I developing a web app using to AngularJs and REST API. The REST APIs are hosted on some different servers.When I calling to this REST APIs, I have this problem called CROS: XMLHttpRequest cannot load https://api.getevents.co/event?&amp;lat=41.904196&amp;lng=12.465974. The 'Access-Control-Allow-Origin' header has a value 'https://dev.getevents.co' that is not equal to the supplied origin. Origin 'http://localhost:8383' is therefore not allowed access. My code is this: modulo.controller('listaController', function ($scope, $http) { $http.get('https://api.getevents.co/event?&amp;lat=41.904196&amp;lng=12.465974').success(function(data) { $scope.names = data; }); });*/ How can i resolve this problem
type: Question
tagged with: cors
tagged with: api
has title: The 'Access-Control-Allow-Origin' header has a value 'https://dev.getevents.co' that is not equal to the supplied origin
downvote count: 0
tagged with: javascript
tagged with: rest
has comment: http://stackoverflow.com/comment/47234297
favorite count: 0
tagged with: angularjs
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47237736
score: 2
has comment: http://stackoverflow.com/comment/47234669
answer count: 0

http://stackoverflow.com/a/29534361
upvote count: 2
has comment: http://stackoverflow.com/comment/47221901
score: 2
type: AcceptedAnswer
downvote count: 0
has body: Here is some code. I am appending to show both behaviour. Here is DEMO test("20:02:55", "21:02:55"); test("13:02:55", "15:02:55"); function test(start_time, end_time) { var dt = new Date(); //convert both time into timestamp var stt = new Date((dt.getMonth() + 1) + "/" + dt.getDate() + "/" + dt.getFullYear() + " " + start_time); stt = stt.getTime(); var endt = new Date((dt.getMonth() + 1) + "/" + dt.getDate() + "/" + dt.getFullYear() + " " + end_time); endt = endt.getTime(); var time = dt.getTime(); if (time &gt; stt &amp;&amp; time &lt; endt) { $("#a").append("&lt;br&gt; show Box "); } else { $("#a").append("&lt;br&gt; Expire BOx "); } }
accepted answer of: http://stackoverflow.com/q/29532112
answers question: http://stackoverflow.com/q/29532112
type: Answer

http://stackoverflow.com/comment/47264649
type: Comment
comment on: http://stackoverflow.com/q/29556237
score: 0
has text: @Cristian F [this](http://stackoverflow.com/questions/1986896/what-is-the-difference-between-call-and-apply) might be helpful
type: QuestionComment

http://stackoverflow.com/a/29579575
score: 1
type: Answer
answers question: http://stackoverflow.com/q/29574909
has comment: http://stackoverflow.com/comment/47370641
upvote count: 1
has body: You can try with something like : var bytes = "00:15:04:00:00:81:00:01:81:51:81".split(":"); var buffer = new Buffer(bytes); function getNextBlock(buffer, pos) { if (pos &gt;= buffer.length) return false; var block = []; while (pos &lt; buffer.length &amp;&amp; buffer[pos] != "81") block.push(buffer[pos++]); return block.length ? block : false; } var block; var pos = 0; while(block = getNextBlock(buffer, pos)) { console.log(block); pos += 1 + block.length; }
downvote count: 0

cryptography
tag name: cryptography
tags question: http://stackoverflow.com/q/29632352
type: Tag

http://stackoverflow.com/q/29547268
has answer: http://stackoverflow.com/a/29547515
has comment: http://stackoverflow.com/comment/47250749
has body: In my angular application, I want to invoke a function from a nested controller. For example, below I want in this current view of container, which has its own containerCtrl lets say, to be able to press this button but invoke a function called 'buttonPress' that is defined in the Ctrl1 controller. Right now, I can't do that since, well its just not defined within the containerCtrl scope. HTML: I WANT TO PRESS THIS Is there some way to invoke that function?
has comment: http://stackoverflow.com/comment/47254082
linked to: http://stackoverflow.com/q/14502006
type: Question
tagged with: javascript
has title: How to invoke functions from nested controllers in Angular?
tagged with: controller
score: 0
has comment: http://stackoverflow.com/comment/47250516
answer count: 1
tagged with: nested
has comment: http://stackoverflow.com/comment/47250457
has comment: http://stackoverflow.com/comment/47246206
tagged with: angularjs
type: UnansweredQuestion
tagged with: directive
has comment: http://stackoverflow.com/comment/47250820

http://stackoverflow.com/comment/47539905
type: AnswerComment
comment on: http://stackoverflow.com/a/29564867
type: Comment
has text: Hello, Thank for your answer. I know that a DIV element within a P element is invalid. But my question was why ckeditor automatically inserts the div within a p element when I insert the fakeElement in the editor ? When I try to insert directly the real element, everything is ok, only my div is inserted. The problem occurs when I try to insert an element created through the createFakeElement() function.
score: 0

http://stackoverflow.com/comment/47245155
type: QuestionComment
has text: @jeroen noted. I'll make sure not to change it further. Thanks for the help.
comment on: http://stackoverflow.com/q/29544159
score: 0
type: Comment

http://stackoverflow.com/comment/47315023
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29581016
has text: `evaluate()` is not a step function, so it must be inside of a `then*` or `wait*` function like in the first snippet

http://stackoverflow.com/q/29602421
has comment: http://stackoverflow.com/comment/47350674
possible better answer: http://stackoverflow.com/a/29602897
has comment: http://stackoverflow.com/comment/47350705
tagged with: angularjs
has answer: http://stackoverflow.com/a/29602925
tagged with: css
accepted answer: http://stackoverflow.com/a/29602925
type: AnsweredQuestion
has title: Highlight the selected anchor tag in Angularjs (using ng-repeat)
has answer: http://stackoverflow.com/a/29602897
type: Question
has comment: http://stackoverflow.com/comment/47351205
answer count: 2
tagged with: javascript
tagged with: jquery
has body: I have some data and i have bind the data in anchor tag using ng-repeat {{displayyears}} Here is my css code Now i want to change the selected anchor tag background color. I have tried the below code. Js code //Controller $scope.StyleOfYear = "loadYear"; $scope.selectedYear = function (value, context) { context.$parent.StyleOfYear = "slectedYear"; $scope.selectedYearValue = value; } But am going wrong, because my code helps to change all anchor tag's background color, But i want to change the selected anchor tag background color. Now my code is select all anchor tags when i click 2015 But i want to change the background color of 2015 anchor tag only, if i click 2015. And all other anchor tag's bg-color should be non. look like the below image Simply Am trying to change the color of active menu concepts, but i don't know how can i do with ng-repeat
score: 0
has comment: http://stackoverflow.com/comment/47351286
has comment: http://stackoverflow.com/comment/47351009
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47350709

http://stackoverflow.com/q/29620012
downvote count: 0
has comment: http://stackoverflow.com/comment/47384292
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/47384280
tagged with: http://stackoverflow.com/tag/html
has body: The jquery file doesn't seem to be linking with my html code. The jquery file is suppose to validate the inputs and add the respective glyphicons depending on the validation. I have tried searching for errors, closing tags but can't find any problem. Could anyone please check and point me in the right direction. Thanks in advance. //validate.js function validateText(id) { if ($("#" + id).val() == null || $("#" + id).val() == "") { var div = $("#" + id).closest("div"); div.removeClass("has-success"); $("#glypcn" + id).remove(); div.addClass("has-error has-feedback"); div.append('&lt;span id="glypcn' + id + '" class="glyphicon glyphicon-ok form-control-feedback"&gt;&lt;/span&gt;'); return false; } else { var div = $("#" + id).closest("div"); div.removeClass("has-error"); div.addClass("has-success has-feedback"); $("#glypcn" + id).remove(); div.append('&lt;span id="glypcn' + id + '" class="glyphicon glyphicon-ok form-control-feedback"&gt;&lt;/span&gt;'); return true; } } $(document).ready(function() { $("#loginbtn2").click(function() { if (!validateText("#USN")) { return false; } if (!validateText("#Password2")) { return false; } $("form#students_form").submit(); }); }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;!DOCTYPE html&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;link rel="icon" type="/WP Project/image/png" href="/bmsce.png"&gt; &lt;title&gt;BMS Login Page&lt;/title&gt; &lt;link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet"&gt; &lt;style&gt; .one:hover { color: red; } .modal-backdrop { z-index: -1; } h4 { cursor: pointer; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;h4 data-toggle="modal" data-target="#modal"&gt; LOGIN &lt;/h4&gt; &lt;div class="modal fade" id="modal" tabindex="-1" aria-labelledby="Modal" aria-hidden="true"&gt; &lt;div class="modal-dialog modal-sm"&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"…
has comment: http://stackoverflow.com/comment/47384398
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29620170
upvote count: 1
has title: jquery file not linking with html file
has comment: http://stackoverflow.com/comment/47384277
score: 1
has answer: http://stackoverflow.com/a/29620385
has comment: http://stackoverflow.com/comment/47384831
type: Question
answer count: 2

http://stackoverflow.com/comment/47452011
type: AnswerComment
comment on: http://stackoverflow.com/a/29618712
has text: Your plunkr does not work. I can select a date using the datepicker alright, but I cannot use textual input. Firefox will just refuse to accept any inputs in the date2 field and chrome immediatly converts and display a toString() date representation as soon as I start typing a date.
type: Comment
score: 0

http://stackoverflow.com/comment/47415133
comment on: http://stackoverflow.com/q/29636344
score: 0
type: Comment
type: QuestionComment
has text: Any length.. I guess :P

http://stackoverflow.com/a/29601868
has body: You have been trying to inject your content script into the page with a &lt;script&gt; tag. When you do it, your script ceases to be a content script: it executes in the context of the page, and loses all elevated access to Chrome API, including sendMessage. You should read up on isolated world concept and this question about page-level scripts. To use jQuery, you should not rely on the copy provided by the page - it's in another context and therefore unusable. You need to include a local copy of jQuery with your files and load it before your script: If you're using the manifest to inject scripts, you can add jQuery to the list before your script: "content_scripts": [ { matches: ["http://*.example.com/*"], js: ["jquery.js", "content.js"] } ], If you are using programmatic injection, chain-load your scripts to ensure the load order: chrome.tabs.executeScript(tabId, {file: "jquery.js"}, function() { chrome.tabs.executeScript(tabId, {file: "content.js"}); });
type: AcceptedAnswer
downvote count: 0
upvote count: 8
type: Answer
score: 8
answers question: http://stackoverflow.com/q/29600535
has comment: http://stackoverflow.com/comment/47349943
accepted answer of: http://stackoverflow.com/q/29600535

http://stackoverflow.com/a/29567240
type: Answer
downvote count: 0
has body: Sukima wrote an excellent answer but it only works for 2 sub-arrays. You can use his combiner as a helper to achieve your goal: function combiner(base, subject) { return base.reduce(function(memo, baseValue) { subject.forEach(function(subjectValue) { memo.push(baseValue + subjectValue); }); return memo; }, []); } function combine(array){ var first = array[0]; var others = array.slice(1); if (others.length == 1) return combiner(array[0],others[0]); return combiner(array[0],combine(others)); } var arrayOfArrays = [['apple', 'banana'], ['carrot', 'leek'], ['orange', 'pineapple']]; var combined = combine(arrayOfArrays); document.getElementById('output').innerHTML = combined; &lt;div id="output"&gt;&lt;/div&gt;
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29561460

http://stackoverflow.com/q/29624532
downvote count: 0
score: 1
has title: jQuery load a script after an action has happened
type: Question
has body: I am creating an intro page to my site, the first 5 seconds shows &lt;div class="splash_container"&gt; then after 5 seconds I want to show &lt;div class="canvas_container"&gt; I have managed to do this by hiding the second div with css then showing them using the following jquery jQuery(document).ready(function(){ jQuery('.splash_container').delay(5000).fadeOut(); jQuery('.canvas_container').delay(5500).fadeIn(); }); The problem I have is that .canvas_container contains a html5 canvas animation that I created which needs to start when the div is visible - at the minute, it starts on page load, so by the time it shows it is 5500ms into the animation. Is there a way to delay the loading of the script for my canvas animation? Here is the script for my canvas: var canvas = document.getElementById('myCanvas'); var context = canvas.getContext('2d'); var counter = 0; var completeCycle = [0]; var leftColumn = ["word1", "word2", "word3", "word4", "word5", "word6", "word7"]; var rightColumn = ["word1", "word2", "word3", "word4", "word5", "word6", "word7"]; var a = [1,2,3,4,5,6]; var b = [0,1,2,3,4,5,6]; newOrder(); loop(); function loop() { if (counter &gt; completeCycle.length) { counter = 1; newOrder(); //console.log(completeCycle); setTimeout(function() { context.clearRect(50, 0, 180, 400); // clears the animation setTimeout(loop, 200); // start it up again }, 5000); // but wait a second } else { drawLine(counter,context); counter++; setTimeout(loop, 100); } } // start the loop immediately function newOrder() { a = shuffleUp(a); b = shuffleUp(b); //complete array, just because I can: completeCycle = [0]; for (var i = 0; i &lt; a.length; i++) { completeCycle.push((b[i] * 2)+1); completeCycle.push(a[i]*2); } completeCycle.push((b[6]* 2)+1); //console.log(b); console.log(completeCycle); } //This function uses the "Fisher-Yates shuffle" //More information about this: http://bost.ocks.org/mike/shuffle/ function shuffleUp(array) { var m = array.length, t, i; // While there remai…
tagged with: javascript
tagged with: canvas
accepted answer: http://stackoverflow.com/a/29624670
upvote count: 1
answer count: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/29624670
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/47392589
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47392597

http://stackoverflow.com/comment/47505414
has text: If you want to stick to strictly JavaScript, you could use something like this // document.getElementById("searchTxt").value; // See here: http://stackoverflow.com/questions/11563638/javascript-get-input-text-value // Also you should state jQuery in your question if you are using that instead of JavaScript if you want your answers to reflect your question. And it doesn't hurt to add those tags either.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29683604

http://stackoverflow.com/comment/47341161
comment on: http://stackoverflow.com/a/29574755
has text: Yes it did. Thanks for the follow up.
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/q/29549836
has comment: http://stackoverflow.com/comment/47251257
has comment: http://stackoverflow.com/comment/47251319
accepted answer: http://stackoverflow.com/a/29549874
answer count: 9
has body: I'm trying to find a way to calculate the sum of all numbers between 1 to N using JavaScript. The following is the code I have tried so far but it doesn't seem to work. function numberSum(N) { var total = 0; for(var i = 1; i &lt;= N; i++){ total += i; } return total; } I have tried using jslint and other validators online to check if I might have missed something but that doesn't seem to help me find the reason for the code not working either. Is there something that I'm missing above that's preventing the script from executing the addition??
tagged with: javascript
has answer: http://stackoverflow.com/a/37850805
has comment: http://stackoverflow.com/comment/47251304
upvote count: 15
has comment: http://stackoverflow.com/comment/47251236
has answer: http://stackoverflow.com/a/72008574
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47251282
downvote count: 0
has comment: http://stackoverflow.com/comment/47251342
favorite count: 0
has answer: http://stackoverflow.com/a/40072255
has comment: http://stackoverflow.com/comment/47251679
has title: How to find the sum of all numbers between 1 and N using JavaScript
type: Question
has answer: http://stackoverflow.com/a/71597269
has answer: http://stackoverflow.com/a/60033179
possible better answer: http://stackoverflow.com/a/29549887
has comment: http://stackoverflow.com/comment/47251235
has answer: http://stackoverflow.com/a/29549874
has answer: http://stackoverflow.com/a/29549887
has answer: http://stackoverflow.com/a/49107618
score: 15
has answer: http://stackoverflow.com/a/58086583

http://stackoverflow.com/q/29660189
has comment: http://stackoverflow.com/comment/47459918
has comment: http://stackoverflow.com/comment/47460072
tagged with: javascript
has title: Setting an AJAX response as a Javascript variable
tagged with: ajax
has body: I’m developing a Javascript game and I’m currently trying to get it to load a randomly chosen image from my database before the game is fully initiated. I’m using an ajax call which uses a php script that selects a random image address from a table in my database and then echos this image address back to the Javascript. I want to place this image address into the space after img.src = To do this I’m trying to turn the ajax response into a variable that I can then place after img.src =, so that every time the game is reloaded, a new ajax call will be made, and a randomly chosen image link will be placed after img.src = (the img.src = is then used by the game). Here is the code I’m trying along with comments: //declaring a variable called “ajaxResponse” – this is what the ajax response will be attached to: var ajaxResponse; //a function containing the ajax call which returns the image address as its response: function getRandomPicture() { $.ajax({ url: 'picturerandomizer.php', data: "", dataType: 'json', success: function(response){ //attaching the response to the variable created at the start: ajaxResponse = response; }}); }; //this is where game code is, including the definition of ``img.src``, which I’m trying to define here as the ajaxResponse variable. img.src = ajaxResponse; This isn't currently loading an image into the game (the game initiates but there's a blank space where the image should be located). I think I'm doing things in the wrong order? I think I need to initiate the ajax call, and then place the game's code inside the ajax call's success function. That way a random image will always be defined before the game gets loaded, but I'm not sure exactly how to do that. If the ajax call happens to fail then I'd still like to initiate the game but with a statically defined img src instead, for example: img.src = 'image001.jpg'; I'd really appreciate anyone's advice on the correct way to implement this code. Thanks so much in advance!
linked to: http://stackoverflow.com/q/14220321
answer count: 0
score: 0
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/14220321
tagged with: php
type: Question

http://stackoverflow.com/a/29681658
has body: Try checking for existence before you push an entry onto the array: for (var i = 0; data.length; i++) { if (vModel.uDTableDesc.indexOf(data[i]) === -1) { vModel.UDTableDesc.push(data[i]); } }
downvote count: 1
answers question: http://stackoverflow.com/q/29681511
score: -1
upvote count: 0
type: Answer

http://stackoverflow.com/comment/47258832
type: AnswerComment
comment on: http://stackoverflow.com/a/29553667
type: Comment
has text: It might be because of the API events are still not binded to the youtube video and when you refresh the page the events are binded. I faced the same problem. I use AJAX to post content on page which includes the youtube videos but the events are not automatically binded to the videos as I was doing it inside the post loop. **If you have similar problem**, try invoking the method with the target id after you post it.
score: 0

http://stackoverflow.com/a/29624971
answers question: http://stackoverflow.com/q/29624774
has body: Use screen width http://www.w3schools.com/jsref/prop_screen_width.asp on that function use an if and check the width of screen. Example $(window).scroll(function() { if(screen.width&lt;=768){ if ($(".navbar").offset().top &gt; 50) { $(".navbar-brand img").attr('src', 'img/icons/logowhite.png'); } else { $(".navbar-brand img").attr('src', 'img/icons/logodark.png'); } }});
score: 0
type: Answer

http://stackoverflow.com/a/29548259
has comment: http://stackoverflow.com/comment/47248473
has comment: http://stackoverflow.com/comment/47248672
has body: Leave formData falsey (null/undefined works) until the data loads and use an ng-if. The directive only will compile once ng-if is true.
score: 5
type: Answer
has comment: http://stackoverflow.com/comment/47248218
upvote count: 6
has comment: http://stackoverflow.com/comment/47248957
has comment: http://stackoverflow.com/comment/47248301
answers question: http://stackoverflow.com/q/29547738
downvote count: 1
accepted answer of: http://stackoverflow.com/q/29547738
has comment: http://stackoverflow.com/comment/47248183
has comment: http://stackoverflow.com/comment/47248303
has comment: http://stackoverflow.com/comment/47248265
type: AcceptedAnswer

http://stackoverflow.com/comment/47507375
has text: If a key is down at the time your function is supposed to run (after 500ms), do you want to cancel it entirely, or do you want to wait until no keys are pressed and execute it then?
comment on: http://stackoverflow.com/q/29684919
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47446496
has text: The code was create by FeulUX and was used in other things in my form. It would be easier to target what they have then modify their UI.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29652991

http://stackoverflow.com/q/29650959
has answer: http://stackoverflow.com/a/29651092
has title: rails-jquery-autocomplete Uncaught TypeError
has body: I'm trying to use the rails-jquery-autocomplete gem but can't seem to get it working. At first I thought it was the order that I was requiring it in the application.js but based on other posts on SO, I don't think this is the case. Here is that code anyway: //= require jquery //= require jquery_ujs //= require autocomplete-rails // require turbolinks //= require bootstrap-sprockets //= require bootstrap //= require ckeditor/init //= require social-share-button //= require questions // require_tree . The error I am getting for it at the moment is: Uncaught TypeError: undefined is not a function autocomplete-rails-81b10cb822d78b60a1415bace9e9714b.js?body=1:1 t.railsAutocomplete.fn.extend.initautocomplete-rails-81b10cb822d78b60a1415bace9e9714b.js?body=1:1 t.railsAutocompleteautocomplete-rails-81b10cb822d78b60a1415bace9e9714b.js?body=1:1 t.fn.railsAutocomplete.ejquery-87424c3c19e96d4fb033c10ebe21ec40.js?body=1:4666 jQuery.event.dispatchjquery-87424c3c19e96d4fb033c10ebe21ec40.js?body=1:4334 jQuery.event.add.elemData.handlejquery-87424c3c19e96d4fb033c10ebe21ec40.js?body=1:4575 jQuery.event.triggerjquery-87424c3c19e96d4fb033c10ebe21ec40.js?body=1:4902 jQuery.event.simulatejquery-87424c3c19e96d4fb033c10ebe21ec40.js?body=1:5165 jQuery.each.handler Any ideas why it's not recognising it? Thanks
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery
type: Question
accepted answer: http://stackoverflow.com/a/29651092
score: 0
tagged with: ruby-on-rails
answer count: 1

http://stackoverflow.com/a/29755240
has body: Give this a try: function setToStart(element) { if(!element) { return; } element.focus(); var range = document.createRange(); range.setStart(element, 0); range.setEnd(element, 0); range.collapse(true); var sel = window.getSelection(); sel.removeAllRanges(); try { sel.addRange(range); } catch (e) { } } function setToEnd(element) { element.focus(); var nodeStack = [element]; var node = null; var lastNode = element; var charIndex = 0; while ((node = nodeStack.pop())) { if (node.nodeType === 3) { lastNode = node; charIndex = node.length; } else { var i = node.childNodes.length; while (i--) { nodeStack.push(node.childNodes[i]); } } } var range = document.createRange(); range.setStart(lastNode, charIndex); range.setEnd(lastNode, charIndex); range.collapse(true); var sel = window.getSelection(); sel.removeAllRanges(); try { sel.addRange(range); } catch (e) { } } document.getElementById('setStart').addEventListener('click', function() { setToStart(document.getElementById('first')); }); document.getElementById('setEnd').addEventListener('click', function() { setToEnd(document.getElementById('first')); }); Title Vestibulum id ligula porta felis euismod semper. Curabitur blandit tempus porttitor. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Nulla vitae elit libero, a pharetra augue. Aenean lacinia bibendum nulla sed consectetur. Set to START of first paragraph Set to END of first paragraph
score: 0
answers question: http://stackoverflow.com/q/29588686
type: Answer
has comment: http://stackoverflow.com/comment/47739984

http://stackoverflow.com/a/29608811
type: Answer
has comment: http://stackoverflow.com/comment/47363287
has comment: http://stackoverflow.com/comment/47363997
has comment: http://stackoverflow.com/comment/47364534
upvote count: 5
answers question: http://stackoverflow.com/q/29608723
score: 5
has comment: http://stackoverflow.com/comment/47363384
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29608723
has comment: http://stackoverflow.com/comment/47364870
has body: Should be as simple as this (thanks to the dynamic nature of JS): currentFields = field[currentType].propertyInfo In case you didn't know, it works like this. If you have an object: var foo = { bar: "42" } value "42" is accessible as either foo.bar or foo['bar'].

http://stackoverflow.com/q/29680221
has title: NodeJS with Express Framework - relative path to js script
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/24397379
tagged with: express
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/29680585
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29680585
type: Question
has body: I used Express generator to create node application. Directory structure looks like the following: . ├── app.js ├── bin │ └── www ├── package.json ├── public │ ├── images │ ├── javascripts │ └── stylesheets │ └── style.css ├── node_modules │ └── jquery │ └── dist | |___jquery.min.js ├── routes │ ├── index.js │ └── users.js └── views ├── error.jade ├── index.jade └── layout.jade In my index.jade file i try to reuse jquery.min.js from node_modules, instead use url to web source: doctype html html head link(rel='stylesheet', href= '/stylesheets/style_monit.css') body #container .row .col-sm-4(style='background-color:lavender;') .col-sm-4 .col-sm-4(style='background-color:lavenderblush;') .col-sm-4 .col-sm-4(style='background-color:lavender;') .col-sm-4 .col-md-4 textarea#inData.form-control(style='background:#222; color:#00ff00;', rows='8') script(type='text/javascript' src='../node_modules/jquery/dist/jquery.min.js') css file loads great, but in Chrome console i have error that GET http://localhost:3000/node_modules/jquery/dist/jquery.min.js NOT FOUND

http://stackoverflow.com/comment/47319487
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29585637
has text: I want to save the URL in the object.

http://stackoverflow.com/a/57833415
type: Answer
has comment: http://stackoverflow.com/comment/104293362
upvote count: 22
score: 22
downvote count: 0
has body: It's been four years since OP asked this, but they can accomplish their stated goal as follows: Create a getter that has a side-effect. (The side effect can be to directly animate your thing.) class YourThing { get __doAnythingYouWant() { // ...like console.log('my thing:', this); } } Alternatively: var yourObject = { get __doAnythingYouWant() { // ...like an animation in DOM... this.myDomElement.style... } }; How to use it: console.log(yourObject); > { get __doAnythingYouWant: (...) <-- click here! } > "you clicked the dots!" The downside is you can only invoke the getter once. You could maybe get around this by deleting it and redefining it from within itself, with every invocation. You could make that less hackish by creating some kind of getter-defining function with Object.defineProperties, and some wrapper that takes a regular function and returns a function that does what it normally does, then redefines the getter. Clicking on it once was good enough for me, but if you wanted to you'd do it like this: function addDebuggerButton(obj, f) { var buttonName = `__${f.name}`; Object.defineProperty(obj, buttonName, { get: function() { f.apply(this, arguments); delete this[buttonName]; addDebuggerButton(obj, f); }, configurable: true }); return obj; } It's important to set the configurable property, which just lets you redefine it after defining it. It works: let numTimesPressed = 0; addDebuggerButton({a:1,b:2}, function myButton() { this.c = Math.random(); console.log(`you pressed the button ${++numTimesPressed} times!`, this); }); > {a: 1, b: 2} a: 1 b: 2 __myButton: (...) <-- click here! get __myButton: ƒ () __proto__: Object > you pressed the button! {a: 1, b: 2, c: 0.27574428165568676} a: 1 b: 2 c: 0.27574428165568676 __myButton: (...) <-- click here again get __myButton: ƒ () __proto__: Object > you pressed the button! {a: 1, b: 2, c: 0.43171172657344337} You can modify this as appropriate to work with classes. If you wanted clicking on different links to have …
has comment: http://stackoverflow.com/comment/126296090
answers question: http://stackoverflow.com/q/29681775

http://stackoverflow.com/comment/47505529
type: QuestionComment
has text: This is definitely **not** a duplicate of the question linked by Benjamin Gruenbaum, though it is relevant and might be helpful.
comment on: http://stackoverflow.com/q/29684219
score: 0
type: Comment

http://stackoverflow.com/a/29656720
has body: app.listen by default listens on localhost, you can pass in a different bind address as the second argument as described in docs. as I understand it: 0.0.0.0 represents 'all available interfaces' and localhost represents 'only loopback interface' var server = app.listen(_config.port, '0.0.0.0', function() { logger.log('Bower server started on port ' + _config.port); });
score: 0
type: Answer
answers question: http://stackoverflow.com/q/29653562
has comment: http://stackoverflow.com/comment/47454680

http://stackoverflow.com/a/29596269
answers question: http://stackoverflow.com/q/29596191
has comment: http://stackoverflow.com/comment/47366623
has comment: http://stackoverflow.com/comment/47377960
upvote count: 2
has comment: http://stackoverflow.com/comment/47368370
has body: You get the default all the time because you do not have any break statements. If you do not include break the code will execute all the other cases below it. case 'X': console.log('X IR'); client .after(1000, function() { this.clockwise(0.1); }) .after(1000, function() { this.front(0.05); }); break; //You are missing this on every case Other issue is the fact that the code is inline JavaScript that has thre swicth it is only going to run when the JavaScript is loaded and the default value for var latestData = 0; will be read and that will hit the default case. You need to set that in some sort of function and trigger it.
type: Answer
has comment: http://stackoverflow.com/comment/47379076
has comment: http://stackoverflow.com/comment/47339802
score: 2
downvote count: 0

http://stackoverflow.com/q/29652067
has answer: http://stackoverflow.com/a/29652183
score: 1
has comment: http://stackoverflow.com/comment/47443982
has body: What is difference between these two codes ? $(document).on('click', '.close_modal_window', function(){ alert("window closed"); }); and $('.close_modal_window').on('click', function(){ alert("window closed"); }); It took me long time to find out why I want able to close a modal window. When I use code shown in the first example it works, the second one doesn't but I don't understand why.
has answer: http://stackoverflow.com/a/29652649
type: Question
possible better answer: http://stackoverflow.com/a/29652183
has comment: http://stackoverflow.com/comment/47443988
tagged with: javascript
downvote count: 5
has answer: http://stackoverflow.com/a/29652580
accepted answer: http://stackoverflow.com/a/29652649
has comment: http://stackoverflow.com/comment/47443974
tagged with: jquery
has comment: http://stackoverflow.com/comment/47443945
has answer: http://stackoverflow.com/a/29652365
favorite count: 0
has title: Javascript - Difference between $(document).on("click", "selector", function ...); and $("selector").on("click", function ....);
upvote count: 6
answer count: 4
has comment: http://stackoverflow.com/comment/47444100
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/29502646

http://stackoverflow.com/comment/47393108
type: QuestionComment
has text: Probably not or at least not easily and not for any situation.
comment on: http://stackoverflow.com/q/29623169
score: 0
type: Comment

http://stackoverflow.com/comment/47263651
score: 0
type: AnswerComment
type: Comment
has text: I am using css ResourceBundle. in this case userresult in a variable
comment on: http://stackoverflow.com/a/29556557

http://stackoverflow.com/comment/47428922
comment on: http://stackoverflow.com/q/29643928
type: Comment
type: QuestionComment
score: 0
has text: Seems to be iOS only

http://stackoverflow.com/q/29608546
has comment: http://stackoverflow.com/comment/47362755
has comment: http://stackoverflow.com/comment/47362832
possible better answer: http://stackoverflow.com/a/29608702
has title: Is there a clever way to use a picture as a list bullet and then draw something on it?
tagged with: css
has answer: http://stackoverflow.com/a/29608702
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29609532
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/47362895
tagged with: javascript
has comment: http://stackoverflow.com/comment/47362695
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29609532
has comment: http://stackoverflow.com/comment/47362900
has body: Because I basically want to use a profile picture as a list bullet (which I already accomplished by using list-style-image :url("myURL"); in my css file). However, I would like to draw a circle in the picture, which represents the online state of a user. Is there a clever way to do this? Or would I have to take the long run and remove the list-bullet and then add a div I can paint onto and move it to the point where usually the list-bullet is sitting around? Thanks in advance

http://stackoverflow.com/a/29770214
score: 0
has comment: http://stackoverflow.com/comment/47712473
has body: You question is weird! You talk about a selection (There's nothing selected, hover is not the same as select!), and some kind of length? (Do you mean width?) Anyway, you can position anything as you like with js: Inside your hover function you can find all postion of the current ".myTarget", change this with "#rightPanel" and you have all positions of the rightPanel: var Top = $(this).offset().top; var Left = $(this).offset().left; var Width = $(this).outerHeight(); var Height = $(this).outerHeight(); var Bottom = Top + Height; var Right = Left + Width; Note: if you want it to change when resizing the window, you need to tab into the resize event: $(window).resize(function(){ //do stufff })
answers question: http://stackoverflow.com/q/29639443
type: Answer
has comment: http://stackoverflow.com/comment/47802341
has comment: http://stackoverflow.com/comment/47807597

http://stackoverflow.com/comment/47492773
comment on: http://stackoverflow.com/q/29677612
has text: `this.resizeAd(this)` is a **function call** - you're not passing the function, you're passing the result of calling the function.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29574916
tagged with: arrays
answer count: 1
downvote count: 0
tagged with: javascript
has body: i am writing a chrome app, and i want to send some strings over UDP to some server. i'm new to javascript and i'm kinda stuck. this is a snippet of the code: var wholeString = "what is the meaning of life"; chrome.sockets.udp.create({}, function (socketInfo) { // The socket is created, now we can send some data var socketId = socketInfo['socketId']; var arrayBuffer = stringToArrayBuffer("hello"); chrome.sockets.udp.bind(socketId, "127.0.0.1", 0, function (result) { chrome.sockets.udp.send(socketId, stringToArrayBuffer(wholeString), "127.0.0.1", 3050, function (sendInfo) { console.log("sent " + sendInfo.bytesSent); if (sendInfo.resultCode &lt; 0) { console.log("Error listening: " + chrome.runtime.lastError.message); } }); }); }); the problem lies when i try to send(), and the argument stringToArrayBuffer(wholeString) is problematic. the stringToArrayBuffer() is here: function stringToArrayBuffer(string) { var arrayBuffer = new ArrayBuffer(string.length * 2); var buffer = new Uint8Array(arrayBuffer); for (var i = 0, stringLength = string.length; i &lt; stringLength; i++) { buffer = string.charCodeAt(i); } return buffer; } The error message i get is: Error in response to sockets.udp.bind: Error: Invocation of form sockets.udp.send(integer, integer, string, integer, function) doesn't match definition sockets.udp.send(integer socketId, binary data, string address, integer port, function callback) at Object.callback (chrome-extension://pmkjeflkfhfekliappbhemngaejmnbec/helper.js:45:24) at Object.callback (chrome-extension://pmkjeflkfhfekliappbhemngaejmnbec/helper.js:42:23) i thought the function will change my string to a byte array? whats wrong??
favorite count: 0
tagged with: google-chrome-app
tagged with: udp
has answer: http://stackoverflow.com/a/29576879
accepted answer: http://stackoverflow.com/a/29576879
type: AnsweredQuestion
score: 1
type: Question
has title: How to send string over UDP using Javascript on Chrome app
upvote count: 1

http://stackoverflow.com/a/64497934
upvote count: 2
downvote count: 1
has body: const array1 = [ {name : "john", age: 20}, {name : "sarah", age: 70} ]; array1.forEach(element => this.print(element)); print = (data) => { console.log(data.name); } // expected output: "john" // expected output: "sarah" There is a better way to do this array.forEach(obj => this.functionName(params));
has comment: http://stackoverflow.com/comment/136909950
type: Answer
score: 1
answers question: http://stackoverflow.com/q/29626729

http://stackoverflow.com/comment/57291606
comment on: http://stackoverflow.com/a/34711523
has text: @YPCrumble thanks for the feedback, I've updated the answer. I hope it's better now?
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/a/29558289
score: 0
has body: $(".checkbox").change(function() { if(this.checked) { //push into array else { //remove from array } }); Cant you just check which checkbox has been selected and add its value to an array this way you can keep the order.
type: Answer
has comment: http://stackoverflow.com/comment/47267732
answers question: http://stackoverflow.com/q/29557118

http://stackoverflow.com/q/29586071
tagged with: node.js
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47594547
type: Question
has title: How to Pipe Response to a File in Co-Request module & NodeJs?
score: 18
tagged with: es6-promise
has comment: http://stackoverflow.com/comment/47443134
has answer: http://stackoverflow.com/a/29768492
tagged with: javascript
upvote count: 18
tagged with: co
tagged with: ecmascript-6
answer count: 1
downvote count: 0
favorite count: 0
has body: I am using Co-Request to read Zip file from http url, and i have below code to read from server.. The code works already. But I dont know how to write the response Zip to a file. var co = require( "co" ); var request = require( "co-request" ); var options = { url: "http://www.example.com/sample.zip", headers: { 'Token': Appconfig.Affiliate_Token, 'Affiliate-Id' : Appconfig.Affiliate_Id } } console.log( "Downloading : zip file" ); var j = yield request( options ); Co-Request is actually wrapper for Request and I have found below code to pipe file to stream. But not sure how to write the same using Co-Request with yield. request.get('http://example.com/img.png').pipe(request.put('http://example.com/img.png')) Please help how to write response zip to a file using yield and co-request

http://stackoverflow.com/comment/47340162
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/29596551
has text: For these types of questions, you usually get a better response if you start off with what you've tried and ask a more specific question about the issue you've run into. At the very least, explain why existing solutions (of which there are many) aren't working in your case. A specification document for the code you want isn't quite in the spirit of SO.
type: Comment

http://stackoverflow.com/q/29538251
accepted answer: http://stackoverflow.com/a/29539774
tagged with: meteor
has answer: http://stackoverflow.com/a/29539774
has comment: http://stackoverflow.com/comment/47229628
type: AnsweredQuestion
has body: How to achive on event in meteor template. Ordinary Jquery code $('.js-star-rating').on('change','input', function() { //Some codes }); Meteor Template Template.myTemplate.events({ // How to achieve above js code here });
type: Question
answer count: 1
has title: JQuery on event in meteor template
tagged with: javascript
tagged with: jquery
tagged with: meteor-blaze
score: 0

http://stackoverflow.com/q/29609428
tagged with: c#
answer count: 1
tagged with: javascript
score: 0
has body: Is that possible to get all resource URLs loaded by a page including the resource loaded through JavaScript programmatically by C# webbrowser. Just the URLs like chrome "NetWork"
linked to: http://stackoverflow.com/q/17691889
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has title: C# webbrowser get loaded resource(image/mp3) just like chrome NetWork
has answer: http://stackoverflow.com/a/29609704
type: Question

http://stackoverflow.com/comment/48180485
type: Comment
score: 1
comment on: http://stackoverflow.com/a/29857071
type: AnswerComment
has text: @Imray I found this bug reported on the **fatlinesofcode/ngDraggable** github: https://github.com/fatlinesofcode/ngDraggable/pull/143. mattgoldspink did exactly what I was suggesting, forked the repo and adjusted ngDragClone directive to account for scrolling offsets. If you check the ngDraggable reference on my new Fiddle, it now points to **mattgoldspink/ngDraggable**. Make that change to your own code.

http://stackoverflow.com/q/29569027
type: Question
answer count: 2
tagged with: etherpad
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47287447
score: 0
upvote count: 1
downvote count: 1
has title: How to load multiple javascript libraries only once in the browser?
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29569281
has answer: http://stackoverflow.com/a/29569768
has body: I have multiple Etherpad instances as iFrames on the web page.Etherpad' ep_tables plugin uses YUI libraries(nearly 12 different JS files). This causes a lot of time for the site to load because these YUI files get loaded for every etherpad instance. So here is the situation - I want to load these YUI files only once for the first etherpad instance while remaining instances should not load YUI files and somehow use the already loaded YUI files.How do I achieve this? PS: Every etherpad instance is an iFrame and YUI libraries are part of the html inside that iFrame.
tagged with: iframe

recaptcha
tag name: recaptcha
tags question: http://stackoverflow.com/q/29578250
tags question: http://stackoverflow.com/q/29563822
tags question: http://stackoverflow.com/q/29579615
tags question: http://stackoverflow.com/q/29530471
type: Tag

http://stackoverflow.com/q/29649119
has answer: http://stackoverflow.com/a/29649826
has comment: http://stackoverflow.com/comment/47438033
has comment: http://stackoverflow.com/comment/47438121
type: Question
tagged with: google-apps-script
linked to: http://stackoverflow.com/q/15633374
has comment: http://stackoverflow.com/comment/47442709
has title: Automatically refresh Google Apps Script after set period of time
has comment: http://stackoverflow.com/comment/47439487
answer count: 1
tagged with: javascript
score: 0
tagged with: page-refresh
has body: I'm working on a portal which has a set of forms that can be accessed from the main screen and then a page which has reporting based on a users submissions to said forms. The forms write to a singular Google spreadsheet where data is manipulated and a "Status" is thrown out. I have got this status, among other data onto my reporting screen and at the minute it is static until the users physically refreshes the page. I am wanting to make it so that this report refreshes automatically, say every 60 seconds, so any changes are reflected to the user. I've spent time researching, and have managed to get two options which seem to be in the beginning stages of working, but I am unable to work out how to solve the issues I'm still having. One choice was to do a meta refresh. The code for this is: This version works, but only in the first instance. i.e the page successfully reloads the first time, but when the second instance comes around all I get is a blank white screen. The second choice I have been using is with JS. The code is: However, this simply returns a blank white screen every time. Further information: I am using HTMLService in Apps Script. The page on which the Log/report appears has the full script URL + "?page=pagename" Does anybody have any ideas how to change the code so that the page refreshes properly every time? Updated below with HTML content: Change Log: Change Request Date Change Request Status Completed By Date Completed
type: UnansweredQuestion
tagged with: meta

http://stackoverflow.com/comment/47495141
comment on: http://stackoverflow.com/q/29678559
score: 1
type: QuestionComment
has text: I don't know what you're doing wrong either. What is happening or not happening? How are you passing the offer and its answer?
type: Comment

http://stackoverflow.com/comment/126989551
has text: Just used this to implement search. So slick. I returned the original object if search was null: self.filteremployeeUsers = ko.computed(function () { var search = this.query().toLowerCase(); if (search) { return ko.utils.arrayFilter(self.employeeUsers(), function (employee) { return (employee.firstName().toLowerCase().indexOf(search) || employee.lastName().toLowerCase().indexOf(search))>= 0; }); } else { return self.employeeUsers(); } });
comment on: http://stackoverflow.com/a/29552173
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/47387221
comment on: http://stackoverflow.com/a/29609505
has text: I would hover over the options to run a javascript that according to the parameters set as the value of the option to show thumbnails
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47652082
type: AnswerComment
has text: sure, please check it out.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29593220

http://stackoverflow.com/comment/47351649
type: Comment
has text: BTW the output to that regex should be ' 261 '.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29602913

http://stackoverflow.com/a/29628034
downvote count: 0
has body: Click here function click_on() { $('#myElement').on("click", function () { alert('Hello world'); }); } click_on(); When you want to off: $('#myElement').off() When you want to on: click_on();
has comment: http://stackoverflow.com/comment/47399017
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29627888
type: Answer

http://stackoverflow.com/q/29632651
tagged with: javascript
has body: I'm working in a game in js. it's a war game. if I hover on an country/select is gives an border and a color but I want, if I own the country it has his own color. You can see it if you select a country and click on "selecteren" on the left. Select a country other than USA, brazil, russia, china, canada and india. Then it had a green border but I want the country colered. http://w0w.eu HTML code of a country: &lt;g data-name="indonesia"&gt; &lt;path id="kalimantan" d="M781.68,324.4l-2.31,8.68l-12.53,4.23l-3.75-4.4l-1.82,0.5l3.4,13.12l5.09,0.57l6.79,2.57v2.57l3.11-0.57l4.53-6.27v-5.13l2.55-5.13l2.83,0.57l-3.4-7.13l-0.52-4.59L781.68,324.4L781.68,324.4z"/&gt; &lt;path id="sumatra" d="M722.48,317.57l-0.28,2.28l6.79,11.41h1.98l14.15,23.67l5.66,0.57l2.83-8.27l-4.53-2.85l-0.85-4.56L722.48,317.57L722.48,317.57z"/&gt; &lt;path id="java" d="M753.17,358.32l-2.75,1.88l0.59,1.58l8.75,1.98l4.42,0.79l1.87,1.98l5.01,0.4l2.36,1.98l2.16-0.5l1.97-1.78l-3.64-1.68l-3.14-2.67l-8.16-1.98L753.17,358.32L753.17,358.32z"/&gt; &lt;path id="bali" d="M781.77,366.93l-2.16,1.19l1.28,1.39l3.14-1.19L781.77,366.93L781.77,366.93z"/&gt; &lt;path id="lombok" d="M785.5,366.04l0.39,1.88l2.26,0.59l0.88-1.09l-0.98-1.49L785.5,366.04L785.5,366.04z"/&gt; &lt;path id="sumba" d="M790.91,370.99l-2.75,0.4l2.46,2.08h1.96L790.91,370.99L790.91,370.99z"/&gt; &lt;path id="flores" d="M791.69,367.72l-0.59,1.19l4.42,0.69l3.44-1.98l-1.96-0.59l-3.14,0.89l-1.18-0.99L791.69,367.72L791.69,367.72z"/&gt; &lt;path id="timor" d="M806.14,368.42l-5.11,4.26l0.49,1.09l2.16-0.4l2.55-2.38l5.01-0.69l-0.98-1.68L806.14,368.42L806.14,368.42z"/&gt; &lt;path id="sulawesi" d="M789.53,349.11l2.26,2.77l-1.47,4.16v0.79h3.34l1.18-10.4l1.08,0.3l1.96,9.5l1.87,0.5l1.77-4.06l-1.77-6.14l-1.47-2.67l4.62-3.37l-1.08-1.49l-4.42,2.87h-1.18l-2.16-3.17l0.69-1.39l3.64-1.78l5.5,1.68l1.67-0.1l4.13-3.86l-1.67-1.68l-3.83,2.97h-2.46l-3.73-1.78l-2.65,0.1l-2.95,4.75l-1.87,8.22L789.53,349.11L789.53,349.11z"/&gt; &lt;path id="maluku" d="M814.19,330.5l-1.87,4.55l2.95,3.…
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: http://stackoverflow.com/tag/svg
type: UnansweredQuestion
tagged with: css
type: Question
has title: SVG Select color map
has answer: http://stackoverflow.com/a/29634633

http://stackoverflow.com/comment/47481581
comment on: http://stackoverflow.com/a/29668601
type: Comment
has text: What does this code have to do with your question? Nothing.
score: 0
type: AnswerComment

http://stackoverflow.com/a/29656319
type: AcceptedAnswer
upvote count: 3
has comment: http://stackoverflow.com/comment/63735198
type: Answer
has body: It can take time to log the user out. You need a template to display during this. A route cannot exist without a template with iron router. Or at least iron router is not designed to work without one. Your html: &lt;template name="logout"&gt; Logging you out. Please wait... &lt;/template&gt; Your route: Router.route('/logout', function(){ Meteor.logout(function(err) { if (err) console.log('Error loggin out!'); Router.go("/") }); this.render("logout"): });
accepted answer of: http://stackoverflow.com/q/29655251
answers question: http://stackoverflow.com/q/29655251
score: 3
downvote count: 0

http://stackoverflow.com/q/29551944
tagged with: javascript
type: UnansweredQuestion
tagged with: google-maps-api-3
has comment: http://stackoverflow.com/comment/47255699
has title: To get x,y coordinate of event on Google Map
favorite count: 0
has body: I want to find out the x and y coordinates of a click event on Google Map. This X and Y coordinates should be with respect to screen or page.
type: Question
linked to: http://stackoverflow.com/q/55677
score: -2
has answer: http://stackoverflow.com/a/29552119
downvote count: 2
has comment: http://stackoverflow.com/comment/47255643
has comment: http://stackoverflow.com/comment/47255352
answer count: 1
tagged with: google-maps
has comment: http://stackoverflow.com/comment/47255466
upvote count: 0

http://stackoverflow.com/comment/47433591
score: 2
comment on: http://stackoverflow.com/q/29646210
has text: It seems like you are missing bootstrap.js ? So it works on only layout (e.g active class with "display:block" but "display:none" for others without active)
type: QuestionComment
type: Comment

http://stackoverflow.com/a/29587000
downvote count: 0
has body: You have syntax errors in your if statements. When you're setting if, you should enclose the statement in braces: instead of if something : do if(something): and then end it with endif; (when using colons :) // Display product I clicked on the other frame if (isset($GET['variable1'])): $query = "SELECT * FROM $tableName WHERE product_id = " . $_GET['variable1']; $result = mysqli_query($conn, $query); if ($result): echo ' '; while ($row = $result->fetch_assoc()) { echo ' '; echo ' ', $row['product_id'], ' '; // and others echo ' '; } echo ' '; endif; endif; Or, use {} braces instead of colons : // Display product I clicked on the other frame if (isset($GET['variable1'])){ $query = "SELECT * FROM $tableName WHERE product_id = " . $_GET['variable1']; $result = mysqli_query($conn, $query); if ($result){ echo ' '; while ($row = $result->fetch_assoc()) { echo ' '; echo ' ', $row['product_id'], ' '; // and others echo ' '; } echo ' '; } }
has comment: http://stackoverflow.com/comment/47321833
type: Answer
has comment: http://stackoverflow.com/comment/47321900
has comment: http://stackoverflow.com/comment/47321666
has comment: http://stackoverflow.com/comment/47321756
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/29586916
has comment: http://stackoverflow.com/comment/47321693

http://stackoverflow.com/a/29553363
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/29553287
has body: Because the property name has to be a string, it is type cast into one using the toString() method. The reason that your third example is undefined is that ['a', 'b'].toString() equals 'a,b', which is not a property in your object. Property names Property names must be strings. This means that non-string objects cannot be used as keys in the object. Any non-string object, including a number, is typecasted into a string via the toString method. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_Accessors Worth noting is that in ECMAScript 6, there is a new collection type called Map, which allows you to use any object as a key without type coercion. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map
upvote count: 7
score: 7
answers question: http://stackoverflow.com/q/29553287
type: AcceptedAnswer

http://stackoverflow.com/comment/47426918
comment on: http://stackoverflow.com/q/29642590
score: 0
type: Comment
type: QuestionComment
has text: yes.. i can use QTcpsocket in qt app, but, i want to write the logic in js file(java script file), and java script does not support qt classes

http://stackoverflow.com/comment/47438114
type: Comment
comment on: http://stackoverflow.com/a/29646929
score: 0
type: AnswerComment
has text: I have added your code in my `htaccess` file. Now when I click on links, url addres does not change.

http://stackoverflow.com/q/29591145
has comment: http://stackoverflow.com/comment/47369616
tagged with: ckfinder
type: Question
tagged with: c#
has title: MVC CkFinder "System.Web.HttpException: Failed to Execute URL" Error
downvote count: 0
tagged with: javascript
tagged with: ckeditor
favorite count: 0
score: 1
has body: I'm using CkFinder in CkEditor image search and upload in my ASP.NET MVC 5 project. In my local IIS does not any problem but in the remote server has System.Web.HttpException: Failed to Execute URL error when I browse images with CkFinder in CkEditor. Error details as follows: Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Web.HttpException: Failed to Execute URL. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [HttpException (0x80004005): Failed to Execute URL.] System.Web.Hosting.ISAPIWorkerRequestInProcForIIS6.BeginExecuteUrl(String url, String method, String childHeaders, Boolean sendHeaders, Boolean addUserIndo, IntPtr token, String name, String authType, Byte[] entity, AsyncCallback cb, Object state) +2582829 System.Web.HttpResponse.BeginExecuteUrlForEntireResponse(String pathOverride, NameValueCollection requestHeaders, AsyncCallback cb, Object state) +412 System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext context, AsyncCallback callback, Object state) +192 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +301 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +155 Edit: I click Image Add button in CkEditor. Nextly I click "Browse to the server" At the moment to be calling "CkFinder6/config.ascx" file and the getting error.
has comment: http://stackoverflow.com/comment/47371598
answer count: 0
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/47383560
has comment: http://stackoverflow.com/comment/47371290
tagged with: asp.net-mvc

http://stackoverflow.com/comment/47529038
comment on: http://stackoverflow.com/q/29646971
has text: Firewall is disabled and port is open and listening. tested it with netstat cmd. If the issue was with port/firewall then shouldn't http requests also fail? thanks!!
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29677317
score: 0
type: Question
tagged with: backbone.js-collections
has comment: http://stackoverflow.com/comment/47492316
has answer: http://stackoverflow.com/a/29694934
tagged with: underscore.js
tagged with: javascript
has body: I am trying to search a collection using 2 search parameters. Currently I am only managing to search via 1 search paramater, here is my working single parameter search. search: function(filterValue) { var filterValue = filterValue.toLowerCase(); var matcher = new RegExp(filterValue); var found_models = this.filter(function(model) { return matcher.test(model.get('name').toLowerCase()); }); return found_models; }, is there way to also search another attribute other than the name, I thought maybe something like this, search: function(filterValue) { var filterValue = filterValue.toLowerCase(); var matcher = new RegExp(filterValue); var found_models = this.filter(function(model) { return matcher.test(model.get('name').toLowerCase()); }); var found_models = this.filter(function(model) { return matcher.test(model.get('clients').get('name').toLowerCase()); }); return found_models; }, but these to just overwrite any results that match the name parameter.
has title: Filter/Search a collection based on 2 attributes
answer count: 2
tagged with: backbone.js
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29677444

http://stackoverflow.com/comment/47454863
comment on: http://stackoverflow.com/a/29657241
score: 1
type: AnswerComment
has text: There's also no purpose to using a capture group if you're going to use `.test`.
type: Comment

http://stackoverflow.com/a/45794236
score: 2
has body: It's 2017 August Even I was facing the same problem after some research I found an exact solution for this. Go to Xcode ->Select your project -> Capabilities -> iCloud and enable it. Now it will work.
downvote count: 0
has comment: http://stackoverflow.com/comment/101603080
type: Answer
has comment: http://stackoverflow.com/comment/101637091
upvote count: 2
answers question: http://stackoverflow.com/q/29548601
has comment: http://stackoverflow.com/comment/101643770
has comment: http://stackoverflow.com/comment/101628928

http://stackoverflow.com/comment/47246498
comment on: http://stackoverflow.com/q/29543135
score: 3
has text: I see. That's because your empty groups have values of 0, which are larger than your negative values. I'd suggest re-scaling your temperatures so that they are always positive values. There are a few other ways of dealing with this by using a special value like -Infinity as your default value, keeping track of counts, and then handling the 0-count case specially in your aggregation functions, but they are more complicated.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47400360
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29628319
has text: Good to know thanks. Going back to my original code I wonder. Does having and `.each()` method inside a `for-loop` redundant in any situation?
score: 0

http://stackoverflow.com/a/29603228
type: Answer
has comment: http://stackoverflow.com/comment/47352557
has comment: http://stackoverflow.com/comment/47353031
upvote count: 1
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/47353089
has comment: http://stackoverflow.com/comment/47352623
has comment: http://stackoverflow.com/comment/47354501
has body: my understanding is that specificObject.sections is pointing to its' prototype which is defaults and it is frozen object. You define a new object {} but you try to assign it to defaults.sections. SpecificObject.sections is pointing exactly there. If you create new ownProperty on specificObject it will work: 'use strict' //This object will be prototype of next objects var defaults = { name: 'def name', sections: { 1: { secName: 'def sec name' } } }; //!!!!!!!!!!!! Object.freeze(defaults); //So we have an empty object with prototype set to our default object. var specificObject = Object.create(defaults); // this will create new property Object.defineProperty(specificObject, 'sections',{ enumerable: true, writable: true, configurable: true, value: {} }); console.log(specificObject.hasOwnProperty('sections')); //true specificObject.sections['1'] = Object.create(defaults.sections['1']); explanation: if you try to access obj.prop = val then javascript looks into obj's own properties, if not found then it looks into obj's prototype own properties. if found there then it /tries to assign val to/ lookup that property. if not found there then it tries to look into obj's prototype's prototype and so on. If prop is not found in the prototype tree then it creates new own property on obj and assigns val. Therefore if prop is find on prototype and it is frozen you will get type error. Hope it brings some light.:) EDIT: as correctly pointed out by @KubaWyrostek specificObj.sections = {} will create new own property of specific Object, does not assign new value to the prototype's property, but it probably does the lookup for the property to check the writability, in that case it will run into frozen object. I didn't know about this before.
answers question: http://stackoverflow.com/q/29602584

http://stackoverflow.com/comment/47463111
comment on: http://stackoverflow.com/q/29661661
score: 0
type: Comment
type: QuestionComment
has text: Can you provide a bit more detail? What does that script tag look like when you view source in the browser?

http://stackoverflow.com/comment/47230539
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29539112
has text: Select your code, hit the `{}` button in the toolbar to **indent it by 4 spaces**. That's how you mark code as code here. Read the rest of the editing help while you're at it. It'd do it for you, but I'm not going to clean all those s out.

http://stackoverflow.com/q/29530390
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47259895
tagged with: http://stackoverflow.com/tag/html
tagged with: sqlite
answer count: 1
has body: I am developing application in php using sqlite database. I have integrated tinymce 4.1.9 for textarea. When I saved data in database proper html script gets saved, but while displaying data from database on reports all html tags does not reflects. e.g H1 or list or bold does not show its effect. Even tags gets saved in database. Script is as follows : &lt;script language="javascript" type="text/javascript" src="tinymce/js/tinymce/tinymce.min.js"&gt;&lt;/script&gt; &lt;script language="javascript" type="text/javascript"&gt; tinymce.init({ selector: "textarea", theme: "modern", plugins: [ "advlist autolink lists link image charmap print preview hr anchor pagebreak", "searchreplace wordcount visualblocks visualchars code fullscreen", "insertdatetime media nonbreaking save table contextmenu directionality", "emoticons template paste textcolor colorpicker textpattern" ], toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image", toolbar2: "print preview media | forecolor backcolor emoticons", image_advtab: true, templates: [ {title: 'Test template 1', content: 'Test 1'}, {title: 'Test template 2', content: 'Test 2'} ] }); &lt;/script&gt; Html : &lt;textarea name="txtAboutComp" class="form-control" rows="5" &gt;&lt;/textarea&gt; Displaying data on reports: &lt;?php try { $sqlite = new PDO('sqlite:DigitalStorageBox.sqlite'); } catch (PDOException $e) { echo 'Connection failed: ' . $e-&gt;getMessage(); } $statement = $sqlite-&gt;prepare('SELECT distinct ID, Name, LogoPath,CompanyName,AboutCompany from Company '); try { $statement-&gt;execute(); } catch (PDOException $e) { echo "Statement failed: " . $e-&gt;getMessage(); return false; } $result = $statement-&gt;fetchAll(); $cnt=0; foreach ($result as $row) { echo $row['AboutCompany'];} ?&gt; Please suggest how to display formatted data on reports?
has title: PHP :Displaying html formatted data from sqlite database, saved using tinymce
score: 1
favorite count: 0
tagged with: tinymce
has comment: http://stackoverflow.com/comment/47214382
type: Question
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/47214349
has comment: http://stackoverflow.com/comment/47214572
has answer: http://stackoverflow.com/a/29530971

http://stackoverflow.com/q/29619774
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: onclick of particular li set property only to it
possible better answer: http://stackoverflow.com/a/29619814
has answer: http://stackoverflow.com/a/29619798
accepted answer: http://stackoverflow.com/a/29619798
has comment: http://stackoverflow.com/comment/47383849
has comment: http://stackoverflow.com/comment/47383930
favorite count: 0
has answer: http://stackoverflow.com/a/29619814
upvote count: 2
tagged with: css
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47383801
has body: var li = document.createElement('li'); var a = document.createElement('a'); a.setAttribute('class', 'dropdown-toggle clickme'); a.setAttribute('href', '#'); a.innerHTML = name[n] // Group Name var span = document.createElement('span'); // Tick sign on li span.setAttribute('class', 'fa fa-check pull-right'); span.setAttribute('style', 'padding:5px;border: 1px solid rgba(120,120,120,0.9);border-radius:3px;color:pink;'); // span.setAttribute('id', name[n]); a.appendChild(span); Here in ul, I am dynamically adding li and also adding a tick sign to it when user clicks on it (it will have a green tick sign). $('span').on('click', function (e) { $('span').css('color', 'green'); }); but it adds the CSS color property to all li whereas I want it applied only for the particular li on which user clicked. Any idea please?
type: Question

http://stackoverflow.com/q/29635005
tagged with: javascript
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29658362
tagged with: canvas
tagged with: html2canvas
tagged with: jquery
tagged with: http://stackoverflow.com/tag/svg
accepted answer: http://stackoverflow.com/a/29635937
has title: How to post immediately after svg to canvas conversion is done?
has comment: http://stackoverflow.com/comment/47412435
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47413512
has answer: http://stackoverflow.com/a/29635937
possible better answer: http://stackoverflow.com/a/29658362
has body: I am attempting post with html2canvas after converting all the svgs in a html element to canvas, but the post executes immediately before the svg to canvas conversion finishes, since it takes a few seconds. I have tried using deferred and promises, but I am still having the same issue. // https://github.com/niklasvh/html2canvas/issues/95#issuecomment-45114424 // First render all SVGs to canvases targetElem = $('#dashboard'); var elements = targetElem.find('svg').map(function() { var svg = $(this); var canvas = $('&lt;canvas&gt;&lt;/canvas&gt;'); svg.replaceWith(canvas); // Get the raw SVG string and curate it var content = svg.wrap('&lt;p&gt;&lt;/p&gt;').parent().html(); content = content.replace(/xlink:title='hide\/show'/g, ''); content = encodeURIComponent(content); svg.unwrap(); // Create an image from the svg var image = new Image(); image.src = 'data:image/svg+xml,' + content; image.onload = function() { canvas[0].width = image.width; canvas[0].height = image.height; // Render the image to the canvas var context = canvas[0].getContext('2d'); context.drawImage(image, 0, 0); }; return { svg: svg, canvas: canvas }; }); // end of targetElem.find('svg').map(function() {...}); EDITED: Here is the deferred and promise I have been attempting to implement to create two operations that run in sequential order. $(document).ready(function() { $( '#save_dashboard' ).click(function() { // Create a deferred object var dfd = $.Deferred(); // https://github.com/niklasvh/html2canvas/issues/95#issuecomment-45114424 // First render all SVGs to canvases targetElem = $('#dashboard'); var elements = targetElem.find('svg').map(function() { var svg = $(this); var canvas = $('&lt;canvas&gt;&lt;/canvas&gt;'); svg.replaceWith(canvas); // Get the raw SVG string and curate it var content = svg.wrap('&lt;p&gt;&lt;/p&gt;').parent().html(); content = content.replace(/xlink:title='hide\/show'/g, ''); content = encodeURIComponent(content); svg.unwrap(); // Create an image from the svg var image …
type: Question
has comment: http://stackoverflow.com/comment/47412876

http://stackoverflow.com/a/29602113
has comment: http://stackoverflow.com/comment/47350437
upvote count: 1
has body: May be it is because you are not declaring content type. Change your script as follows. $(document).ready(function(){ $("#qryBtn").click(function(){ // post qry // var qry = query(); $.ajax({ type: "POST", url: "favourites.php", data: { qry: qry }, contentType: 'application/json', success: function (html) { console.log (qry); } }); }); }); Default jquery ajax content type is application/x-www-form-urlencoded; charset=UTF-8 while your are posting your data in json format so that you have to explicitly tell ajax that your are sending json content by declaring content type as application/json EDIT Then send data as string content. Try following script. (please note I have removed contentType option. $(document).ready(function(){ $("#qryBtn").click(function(){ // post qry // var _data= JSON.stringify({qry:query()}); $.ajax({ type: "POST", url: "favourites.php", data: _data, success: function (html) { console.log (qry); } }); }); });
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/29601982
accepted answer of: http://stackoverflow.com/q/29601982
downvote count: 0
score: 1

http://stackoverflow.com/a/29639687
answers question: http://stackoverflow.com/q/29639622
has body: var chartData = []; for (var i = 0; i &lt; testJson["TestSets"]["TestSet"].length; i++) { var testResults = []; var runs = testJson["TestSets"]["TestSet"][i]["TestResults"]["TestRun"]; for (var j = 0; j &lt; runs.length; j++) { var run = runs[j]; testResults.push({"date": run["Date"]["#text"], "NumPassed": run["NumPassed"]["#text"], "NumFailed": run["NumFailed"]["#text"], "Orientation": run["Orientation"]["#text"]}); } } chartData.push(testResults); console.log(chartData); should be: var chartData = []; var testResults = []; for (var i = 0; i &lt; testJson["TestSets"]["TestSet"].length; i++) { var runs = testJson["TestSets"]["TestSet"][i]["TestResults"]["TestRun"]; for (var j = 0; j &lt; runs.length; j++) { var run = runs[j]; testResults.push({"date": run["Date"]["#text"], "NumPassed": run["NumPassed"]["#text"], "NumFailed": run["NumFailed"]["#text"], "Orientation": run["Orientation"]["#text"]}); } } chartData.push(testResults); console.log(chartData);
type: AcceptedAnswer
score: 0
has comment: http://stackoverflow.com/comment/47421213
type: Answer
accepted answer of: http://stackoverflow.com/q/29639622

http://stackoverflow.com/a/29892302
type: Answer
answers question: http://stackoverflow.com/q/29686645
has body: The reason why your #main-site is "jiggling" is because the browser keep "repaint" the position of this element. One Trick to solve this is called Debounce Function, (you may also google it to see other variations.) The basic idea is to delay the scroll event handler to clear out those untriggered callbacks. In your case, you may do something like this: main.parentNode.parentNode.onscroll = function(event) { debounce(offsetting, 10); } function offsetting() { main.style.top = Math.min(main.parentNode.parentNode.scrollTop,maxTop) + "px"; } function debounce(method, delay) { clearTimeout(method._tId); method._tId= setTimeout(function(){ method(); }, delay); } If you keep seeing the jiggling issue, you can simply edit the delay parameter (i.e, change 10 to 50). The downside for that is your #main-site element will be 'cut off the top` for a while, depending on your delay settings.
score: 1
upvote count: 1
downvote count: 0

http://stackoverflow.com/a/29643199
upvote count: 3
has body: Try the input event: $(document).on('input', 'input.your_input', function() { var that = $(this); that.attr('value', that.val()); }); Inspect the input element and try type something: $(document).on('input', '#textInp', function() { var that = $(this); that.attr('value', that.val()); });
accepted answer of: http://stackoverflow.com/q/29643113
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/29643113
type: Answer
score: 3

http://stackoverflow.com/a/29569247
downvote count: 0
answers question: http://stackoverflow.com/q/29569115
type: Answer
score: 1
upvote count: 1
has body: If you're not including jQuery, it's to be expected that $ (and $.fn) are undefined. sinon.stub() only works on existing functions, so you need to at least set up a scaffold for it to be able to work: var $ = { fn : { ready : function() {} } }; ... sinon.stub($.fn, 'ready')

http://stackoverflow.com/q/29637026
accepted answer: http://stackoverflow.com/a/29649449
has body: I have a javascript object (userObject) that i populate on one page, then i add the object into the localstorage using the JSON.stringify Now on the next page, i would like to rehydrate a userObject with the values from the localStorage on the first page. the userObject global variable is declared once, in the shared/common javascript. but using the current logic, the login page stores username and userid in the userObject, then a window.location.href does the page redirection. This is where the data in the userObject is being cleared (assuming the old object is being washed away, in favor of a new object on the new page). the question is, how do i rehydrate the new userObject on the main page with the values from the localStorage. Here is how an i loading the locastorage localStorage.setItem('userObject', JSON.stringify(userObject)); this is what i was thinking on rehydrating the userObject userObject = localStorage.getItem('userObject'); but upon viewing the userObject... it is just a string or values, it doesn't recreate the object and fill the values, its just a long string...
type: AnsweredQuestion
tagged with: javascript
has answer: http://stackoverflow.com/a/29649449
has title: how to hydrate a javascript object
type: Question
favorite count: 0
has comment: http://stackoverflow.com/comment/47436862
score: 0
upvote count: 1
tagged with: local-storage
answer count: 1
downvote count: 1

http://stackoverflow.com/q/29611503
favorite count: 0
has title: Emphasizing multiple keywords in a string with regex and replace
has body: I have an array of objects with string properties that I search through with multiple keywords using regex. For example if the collection looks like this collection = [ {searchString: 'Troarn Lower Normandy France'}, {searchString: 'Tröbitz Brandenburg Germany'}, {searchString: 'Tröbnitz Thuringia Germany'}, {searchString: 'Tröchtelborn Thuringia Germany'}, {searchString: 'Trochtelfingen Baden-Württemberg Germany'}, {searchString: 'Trockenborn-Wolfersdorf Thuringia Germany'}, {searchString: 'Trodena Trentino-Alto Adige Italy'}, {searchString: 'Trodica The Marches Italy'}, {searchString: 'Trofaiach Styria Austria'}, {searchString: 'Trofarello Piedmont Italy'} ]; and I have a text string to search with like this text = 'tro france'; I get the keywords by splitting the text keywords = text.split(' '); and then build a regex from those keywords regex = ''; for (i = 0; i < keywords.length; i++ ) { if (keywords[i] !== "" && keywords[i] !== undefined) { regex += "(?=(^|.*\\s)" + keywords[i] + ")"; } } regex = new RegExp(regex, "i"); so the text 'tro france' would give this regex /(?=(^|.*\s)tro)(?=(^|.*\s)france)/i and would match the first item in the collection. I would search through the collection like this for (i = 0; i < collection.length; i++) { if (collection[i].searchString.search(regex) !== -1) { // ... do stuff here } } But now I would like to emphasize the keywords in the search string. For example if the text was 'tro france' I would like the words 'tro' and 'france' to be underlined where I display the result. I can do this in a simple way but I'm not sure how to do multiple matches and replacements. I have one already but it only works as long as I don't do a space and jump to other keywords. For example if the text is simple and "non jumping" but straight forward match like 'Troarn Lo' then I can replace it like this emphasized = new RegExp('('+text+'.*?)', 'i'); emphasized = collection[i]searchString.replace(emphasized, '$1'); But I'm completely blank on t…
tagged with: regex
possible better answer: http://stackoverflow.com/a/29612087
has answer: http://stackoverflow.com/a/29614941
has answer: http://stackoverflow.com/a/29612087
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29611961
accepted answer: http://stackoverflow.com/a/29611961
downvote count: 0
type: Question
upvote count: 2
answer count: 3
tagged with: javascript

http://stackoverflow.com/a/29652266
type: Answer
has comment: http://stackoverflow.com/comment/47445233
answers question: http://stackoverflow.com/q/29651900
score: 0
has body: I think the problem might lie in the line: $("form").data("validator", null); I usually use this little snippet (found ofc on StackOverflow, but I do not remember the person to give credit to :( ) (function ($) { $.validator.unobtrusive.parseDynamicContent = function (selector) { //use the normal unobstrusive.parse method $.validator.unobtrusive.parse(selector); //get the relevant form var form = $(selector).first().closest('form'); //get the collections of unobstrusive validators, and jquery validators //and compare the two var unobtrusiveValidation = form.data('unobtrusiveValidation'); var validator = form.validate(); $.each(unobtrusiveValidation.options.rules, function (elname, elrules) { if (validator.settings.rules[elname] == undefined) { var args = {}; $.extend(args, elrules); args.messages = unobtrusiveValidation.options.messages[elname]; //edit:use quoted strings for the name selector $("[name='" + elname + "']").rules("add", args); } else { $.each(elrules, function (rulename, data) { if (validator.settings.rules[elname][rulename] == undefined) { var args = {}; args[rulename] = data; args.messages = unobtrusiveValidation.options.messages[elname][rulename]; //edit:use quoted strings for the name selector $("[name='" + elname + "']").rules("add", args); } }); } }); } })($); Then just delete the null on form validator and change the parse call to: $.validator.unobtrusive.parseDynamicContent('form'); Hope this helps.

http://stackoverflow.com/comment/47397182
score: 0
has text: Can't it be achieved with AngularJS? I doubt it is a good idea to mix jQuery with AngularJS for this.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/29627024

http://stackoverflow.com/comment/47375277
type: Comment
has text: hide? change the show property to false and use something like `ng-show="loaderAlert.show"`
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29614757

http://stackoverflow.com/q/29560065
has comment: http://stackoverflow.com/comment/47270247
has answer: http://stackoverflow.com/a/60340257
has answer: http://stackoverflow.com/a/65538417
has answer: http://stackoverflow.com/a/77535290
score: 131
upvote count: 132
has answer: http://stackoverflow.com/a/52382922
favorite count: 0
has answer: http://stackoverflow.com/a/56893400
has answer: http://stackoverflow.com/a/36020519
has answer: http://stackoverflow.com/a/75809583
has body: The Text input is center aligned, how to fix this text input so that it takes input from top left corner Here is my css for text input: /* The Text input is center aligned, how to fix this text input so that it takes input from top left corner */ input: { flex: 1, padding: 4, marginRight: 1, marginTop: 5, fontSize: 18, borderWidth: 1, borderRadius: 4, borderColor: '#E6E5ED', backgroundColor: '#F8F8F9', justifyContent: 'flex-start', height: 150 }
has comment: http://stackoverflow.com/comment/47270105
downvote count: 1
type: AnsweredQuestion
tagged with: react-native
has answer: http://stackoverflow.com/a/29560615
has answer: http://stackoverflow.com/a/55259772
has answer: http://stackoverflow.com/a/64372721
has answer: http://stackoverflow.com/a/59488212
has answer: http://stackoverflow.com/a/65139246
accepted answer: http://stackoverflow.com/a/36020519
has answer: http://stackoverflow.com/a/52813131
has answer: http://stackoverflow.com/a/51821342
type: Question
tagged with: reactjs
has answer: http://stackoverflow.com/a/61590603
possible better answer: http://stackoverflow.com/a/55259772
has title: How to align text input correctly in react native?
has answer: http://stackoverflow.com/a/67108027
tagged with: ios
tagged with: javascript
answer count: 16

http://stackoverflow.com/comment/47277876
has text: `Reservation.CalendarDate.testVariable`
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/29564033

http://stackoverflow.com/a/29596483
type: Answer
has body: try $(window).on('load', function () { setTimeout(function () { $("#image").fadeOut("slow", function () { // Instead of Slow you could add 5000 (5s) // fade out complete if you need to run another event }); }, 5000); // fade out starts after 5s });
answers question: http://stackoverflow.com/q/29596197
score: 0

http://stackoverflow.com/comment/47256720
has text: @AlvinMagalona can you give me more details?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29552712

http://stackoverflow.com/comment/47490099
comment on: http://stackoverflow.com/a/29675953
type: AnswerComment
has text: Good answer. This is the only one so far that actually answers the entire question.
score: 0
type: Comment

http://stackoverflow.com/q/29662686
has answer: http://stackoverflow.com/a/29662705
score: 1
type: Question
has answer: http://stackoverflow.com/a/29662714
accepted answer: http://stackoverflow.com/a/29662714
has title: HTML and CSS: How to lay out a div tag with width:100% and left:300px
has answer: http://stackoverflow.com/a/29662741
has answer: http://stackoverflow.com/a/29662863
has answer: http://stackoverflow.com/a/29662737
tagged with: javascript
has answer: http://stackoverflow.com/a/29663084
upvote count: 1
answer count: 7
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has body: I have a problem setting the style of a div tag. I wanted to have a div tag starting at left:300px and span across till the end of the browser screen. But if I put width:100%, the div tag will go outside of the browser screen.
tagged with: css
has answer: http://stackoverflow.com/a/29662879
possible better answer: http://stackoverflow.com/a/29662705
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/q/29684858
has answer: http://stackoverflow.com/a/29685088
accepted answer: http://stackoverflow.com/a/29685088
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47506671
possible better answer: http://stackoverflow.com/a/29685042
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has body: I try to show current the width and height of a div in another div. I use the resize: both on the div I am trying to measure. The problem I have now is that the numbers do not update when I resize the div. $(function () { var divheight = $("#resizediv").height(); var divwidth = $("#resizediv").width(); document.getElementById("divheightdisplay").innerHTML = divheight; document.getElementById("divwidthdisplay").innerHTML = divwidth; }); Fiddle I also tried CSS Element Queries. But have some problems with overflow: hidden
has comment: http://stackoverflow.com/comment/47508524
has answer: http://stackoverflow.com/a/29685042
type: Question
has title: Show current div size in html text
has comment: http://stackoverflow.com/comment/47506743
has answer: http://stackoverflow.com/a/29685132

http://stackoverflow.com/comment/47441538
score: 1
type: AnswerComment
type: Comment
has text: it should be `str.substring(str.indexOf("\n")+1)`
comment on: http://stackoverflow.com/a/29650896

http://stackoverflow.com/comment/47325453
has text: Ok, can you debug pastebin? If you want help make it easy for users to just copy paste your code to test what's wrong, i.e. using snippets or jsFiddle
type: Comment
score: 0
comment on: http://stackoverflow.com/q/29588875
type: QuestionComment

http://stackoverflow.com/comment/47256867
has text: use `{}` instead of `new Object()`
comment on: http://stackoverflow.com/q/29552832
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47382773
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/29617030
type: Comment
has text: I just woke up to test your code and it doesn't work with me. Maybe I'm too sleepy... Anyway thank you very much for your help, I'll try it again once I wake up.

http://stackoverflow.com/a/29634348
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29634205
downvote count: 0
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/29634205
has body: try $("#shippingAddressForm").css('border','solid 1px red');

http://stackoverflow.com/a/29553667
type: Answer
has body: Try the following code, it works for me - function loadYouTube(targetId){ ytplayer = new YT.Player(targetId, { events: { 'onStateChange': function(event){ /** YouTube API -1 (unstarted) 0 (ended) 1 (playing) 2 (paused) 3 (buffering) 5 (video cued) **/ if (event.data == 1) { //do your work here } console.log(event.data) } } }); }
upvote count: 1
has comment: http://stackoverflow.com/comment/76169619
has comment: http://stackoverflow.com/comment/47258832
score: 1
answers question: http://stackoverflow.com/q/29553570
downvote count: 0
has comment: http://stackoverflow.com/comment/47258674

http://stackoverflow.com/comment/47433625
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/29628903
has text: 1. Today's SVG 1.1 spec leaves it to the user agent whether or not the rootmost svg may be the target of mouse events. Future versions may explicitely permit or deny targeting mouse events to the rootmost svg. This *might* break your code in future implementations of user agents. 2. Elements in svg are rendered in document order. If the circles are inserted before the `<rect>` they are rendered beneath it. Thus, the rectangle above them will be the first target of the mouse event.

http://stackoverflow.com/comment/72645665
type: Comment
score: 3
type: AnswerComment
comment on: http://stackoverflow.com/a/42741234
has text: Sever will talk to html client over http or websockets , Both are TCP based. It would defeat my purpose.

http://stackoverflow.com/comment/47290651
type: Comment
comment on: http://stackoverflow.com/q/29570587
score: 0
type: QuestionComment
has text: @Pointy (I'm a software engineer on IE's Chakra JS engine) - I disagree. In ECMAScript every `Object` type can be considered a hashtable (with their "properties" as keys). The main gotcha is that you can't use `Number` values as keys (or `Strings` that could be coerced to `Numbers`).

http://stackoverflow.com/comment/47367577
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29605771
has text: You need to use more of the page's structure (which you have not shown us) to construct a selector (jQuery or CSS or XPath, in that order of preference) that gets just the right kind of "Next" link. If this is for a webcomic, they range from really easy to a right PITA. (Hint, people have already written hotkey scripts for many web comics.)

http://stackoverflow.com/comment/47513147
comment on: http://stackoverflow.com/a/29687853
type: AnswerComment
has text: @Adrian obviously only the order of execution matters, that's why I said the code in `test1.js` needs to **run** before the code in `test2.js` :)
score: 0
type: Comment

http://stackoverflow.com/q/29590730
has title: Add JQuery functionality to dynamically created radio buttons
tagged with: javascript
upvote count: 1
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/29590915
accepted answer: http://stackoverflow.com/a/29590915
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question
has body: I'm currently trying to add a jQuery function to a row of radio buttons. The problem is that I need to add dynamically many rows. Now For this example I only added 2 elements into the array of newNodes, but in my application newNodes can potentially have many different sizes. So basically I want to add the Query function something like this: $('#rowID input').on('change', function() { alert($('input[name=i]:checked', '#rowID').val()); }); Where it exists inside the forloop and is added for each new row. "rowID" is a variable assigned to the unique row identifier and then use the loop iterator "i" as a way to distinguish the radio buttons for each row. Here is the HTML: Modify the graph! And Here is the Javascript: newNodes = []; newNodes.push(0); newNodes.push(1); //get HTML Table to add rows in var edgeTable = document.getElementById("createEdgesTable"); //Create a table row for each node for (var i in newNodes) { var row = edgeTable.insertRow(); row.id = "node" + i; //Show name of the node var td = document.createElement('td'); var text = document.createTextNode(newNodes[i]); td.appendChild(text); row.appendChild(td); //Choice for showing node var td2 = document.createElement('td'); var radioButton1 = document.createElement('input'); radioButton1.type = "radio"; radioButton1.name = i; radioButton1.value = "showNode"; td2.appendChild(radioButton1); row.appendChild(td2); //Choice for creating edge var td3 = document.createElement('td'); var radioButton2 = document.createElement('input'); radioButton2.type = "radio"; radioButton2.name = i; radioButton2.value = "createEdge"; td3.appendChild(radioButton2); row.appendChild(td3); //Choice for deleting node var td4 = document.createElement('td'); var radioButton3 = document.createElement('input'); radioButton3.type = "radio"; radioButton3.name = i; radioButton3.value = "removeNode"; td4.appendChild(radioButton3); row.appendChild(td4); var rowID = row.id; } $('#node0 input').on('change', function() { alert($('input[name=0]…

http://stackoverflow.com/q/29678996
has answer: http://stackoverflow.com/a/29679094
has title: Is there any possibility to cut to a shape an image that can be moved with d3 (jquery)
possible better answer: http://stackoverflow.com/a/29679094
tagged with: javascript
has answer: http://stackoverflow.com/a/29693884
has body: I am creating a bubble graph, the problem is that I wish to add some images inside the bubbles. I am using this code: http://bl.ocks.org/mbostock/4062045 I bigger circle (around 20px radius) and I would like to have an image as filling of the circle and a black stroke (circle). By now what I have is a Filter with inside a feImage that filter the circle. The problem is that the image move correctly but is still a square. I tried adding a with a circle inside, but when I apply the clipping the area of the svg clipped is fixed (I can see the image moving behind it). How can I fix this? This is what result out from the d3 code, then is used with filter="url(#Myriel)" for example Now I am using this, but is not working:
type: AnsweredQuestion
type: Question
tagged with: d3.js
accepted answer: http://stackoverflow.com/a/29693884
tagged with: css
tagged with: http://stackoverflow.com/tag/svg
score: 0
answer count: 2
tagged with: svg-filters

http://stackoverflow.com/comment/47417946
has text: This `'TP53' in input.ModelVariables ` doesn't work since `input.ModelVariables` is a list. And `condition="'TP53' in unlist(input.ModelVariables)"` makes condtitionalPanel permanent.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29637285
type: Comment

http://stackoverflow.com/q/29541590
has title: CSS based div sliding up and down - Can not appear or disappear and work
answer count: 1
tagged with: javascript
linked to: http://stackoverflow.com/q/8101284
has body: I found an awesome solution on these forums How to create sliding DIV on click? However what I wanted was to have the content appear and disappear at a click of the button. Following is my code: CSS - Slider Test Formats Culture English (United States) English (United Kingdom) French (Canada) English (Canada) Number Currency Some other content Now the above code works on click as intended. What I am failing to achieve is to set its visibility to none by default and when I click on button, first its visibility is changed to visible and then the animation happens and on second click it disappears as well after the animation is completed..Can some one pls guide? Thanks
has comment: http://stackoverflow.com/comment/47235995
score: 0
has answer: http://stackoverflow.com/a/29542309
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/29542309
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47236076
has comment: http://stackoverflow.com/comment/47235547
type: Question
has comment: http://stackoverflow.com/comment/47235704

http://stackoverflow.com/comment/47429519
type: Comment
score: 0
has text: The code is not working, trying to figure out why. My console says ReferenceError: param is not defined
type: QuestionComment
comment on: http://stackoverflow.com/q/29643479

http://stackoverflow.com/comment/47378493
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29616565
has text: this code works fine with root HTML page, what if I have an iframe in that HTML page which also needs to include this script. With the above code it generates the complete path of HTML file where file exists.
type: Comment

http://stackoverflow.com/comment/47314132
type: QuestionComment
score: 0
has text: @bjb568 your example doesn't work. You're missing `position: relative; display: inline-block;` on `#underlay`: http://jsfiddle.net/31480m7n/1/
type: Comment
comment on: http://stackoverflow.com/q/29582571

http://stackoverflow.com/a/29638008
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/90685522
has comment: http://stackoverflow.com/comment/125550862
has comment: http://stackoverflow.com/comment/111878119
type: Answer
has body: There's been a lot of discussion in the comments regarding whether this can be done, so I'll provide a Media Source-specific answer here. Media Source Extensions, or MSE, are a new (and not yet widely-supported) set of tools to help you control buffering and streaming with HTML5 videos. From the W3C abstract: This specification extends HTMLMediaElement to allow JavaScript to generate media streams for playback. Allowing JavaScript to generate streams facilitates a variety of use cases like adaptive streaming and time shifting live streams. I'll specifically refer you to the SourceBuffer Object, which has information on how audio &amp; video track buffering is handled. Support for MSE varies by browser and format (source): Chrome for Desktop 34+ (MP4, WEBM) Chrome for Android 34+ (MP4, WEBM) IE 11+ on Windows 8.1 (MP4) IE for Windows Phone 8.1+ (MP4) Safari for Mac (MP4, TS) Support for Firefox can be turned on by the user in about:config (source). Support has been in the works for some time. There is much more that needs to be implemented in order to make use of this effectively, including video file clustering. I would recommend reading this 4-part series that goes step by step into how to create a fully functional HTML5 video player utilizing everything mentioned above.
score: 4
downvote count: 1
has comment: http://stackoverflow.com/comment/104718801
upvote count: 5
answers question: http://stackoverflow.com/q/29636740
has comment: http://stackoverflow.com/comment/111877270
accepted answer of: http://stackoverflow.com/q/29636740

http://stackoverflow.com/a/33642751
type: Answer
score: 4
upvote count: 4
has body: Babelify is a best option for my point of view. Small clarification to @Dan's answer. For the babel v 6.0 you will need to install 2 preset. ES2015 React with something similar to npm install --save-dev babel-preset-react and npm install --save-dev babel-preset-es2015 commands and then specify this in babelify settings with: transform: [[babelify, {presets: ["es2015", "react"]}]] And if in your code you use some newest react features like ...other for example, you also need add stage-0 preset.
downvote count: 0
answers question: http://stackoverflow.com/q/29591818

http://stackoverflow.com/q/29674491
downvote count: 1
has comment: http://stackoverflow.com/comment/47620789
favorite count: 0
upvote count: 5
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/47544585
has body: I am trying to create pdf from table html with style by referring this post. But I got this error in jspdf.debug.js. Error: Unable to look up font label for font 'times ', 'bold'. Refer to getFontList() for available fonts. I tried different font names and styles.
answer count: 0
tagged with: fonts
has comment: http://stackoverflow.com/comment/47618763
type: UnansweredQuestion
has title: jspdf error : Unable to look up font label
has comment: http://stackoverflow.com/comment/47614871
type: Question
linked to: http://stackoverflow.com/q/23060563
tagged with: javascript
score: 4
tagged with: jspdf

http://stackoverflow.com/comment/47366192
type: AnswerComment
has text: Wow, it was such a little detail
type: Comment
comment on: http://stackoverflow.com/a/29604488
score: 1

http://stackoverflow.com/comment/47480331
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29671060
type: Comment
has text: Have you tried phantomjs? See this queston - http://stackoverflow.com/questions/8049520/web-scraping-javascript-page-with-python

http://stackoverflow.com/comment/47510450
comment on: http://stackoverflow.com/q/29685825
has text: @PeterKA: yes, something like row[index], but im not sure how to tell the url before fetching the data which tr has been clicked?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29672842
has body: I'm currently experiencing problems with idangerous swiper. I use following libraries which are included in that order: jQuery 1.9.1 jQuery Mobile 1.4.5 Idangerous Swiper (jQuery) 3.0.6 Before adding the swiper to DOM via javascript I'm modifying it to fit my needs. At the end following html code is generated which should match the needs of the api: Architektur The code is generated dynamically and should generate multiple swipers (therefore the class name swiper-X). The code for adding the swiper to the element is following one: new Swiper('.swiper-'+ pageId, { direction: 'horizontal', loop: true, preloadImages: true, updateOnImagesReady: true, grabCursor: true }); There are no errors in the console, and the swiper does not swipe. Update Problem is solved. Checked back the code after enigma prove that code seems to work fine without AJAX. As mentioned in the comment below the post of enigma the problem was that the ajax call was not even done but the swiper was already created. So putting the Swiper construct within the done() callback of the $.ajax everything is working fine.
favorite count: 0
downvote count: 2
has comment: http://stackoverflow.com/comment/47489472
has comment: http://stackoverflow.com/comment/47597392
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29806486
accepted answer: http://stackoverflow.com/a/29806486
score: 1
has comment: http://stackoverflow.com/comment/47596719
type: Question
has title: Idangerous Swiper not swiping
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/47596663
upvote count: 3
has comment: http://stackoverflow.com/comment/47483514
tagged with: swiper.js
has comment: http://stackoverflow.com/comment/47635537
answer count: 1

http://stackoverflow.com/comment/47230599
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29538764
has text: sorry, it looked fine in the editor, and i didn't checked the preview...

http://stackoverflow.com/comment/47217004
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29531522
has text: thank you very much. Your help is appreciable.
score: 0

http://stackoverflow.com/comment/47416183
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29637000
has text: You don't have access to the clients filesystem, nor can you add multiple files like that to the file download dialog etc.

http://stackoverflow.com/a/29591422
downvote count: 1
has comment: http://stackoverflow.com/comment/47352435
has comment: http://stackoverflow.com/comment/47429153
has comment: http://stackoverflow.com/comment/47404903
has comment: http://stackoverflow.com/comment/47331991
type: Answer
has body: $('figure').each(function() { $(this).attr('data-img','test.jpg'); }
upvote count: 0
has comment: http://stackoverflow.com/comment/47428648
has comment: http://stackoverflow.com/comment/47345560
answers question: http://stackoverflow.com/q/29591366
score: -1

http://stackoverflow.com/a/29532901
type: Answer
has body: It isn't realy clear to me if you want the parent-element or the sibbling element. If you want the html of the parent element of e, you can use following code: function deneme2(e){ alert(e.parentNode.innerHTML); } If you want the html of the child-element of e, you can use: e.children[i].innerHTML With i being the index of the element.
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/29532791
upvote count: 1

http://stackoverflow.com/comment/47285523
comment on: http://stackoverflow.com/a/29561199
type: Comment
has text: The points that I need to clarify are the following: - For each point (x, y) of the grid that I create, I have to run the script that you have shown me? - If I use mousedown, means I'm clicking the point (x, y), I would run the script to the simple passage at that point with the mouse, how do I change it? - The return is the element at the specified position (x,y): When the mouse is over a TextNode element, the returned object is the parent element of the TextNode. Correct?
score: 0
type: AnswerComment

http://stackoverflow.com/a/29646011
has comment: http://stackoverflow.com/comment/47453184
upvote count: 12
has comment: http://stackoverflow.com/comment/47452771
downvote count: 0
score: 12
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/29633473
answers question: http://stackoverflow.com/q/29633473
has body: The basic approach if you're only interested in wrapping the text parts is: Get the selection range For each range boundary, if it lies in the middle of a text node, you need to split the text node in two at the boundary and update the range's boundary so that the range stays in place (example code from Rangy) Get all the text nodes within the range (example code) Surround each text node in a element Re-select the range This is the approach taken by the class applier module of my Rangy library. I've created an example, mostly using code adapted from Rangy: function getNextNode(node) { var next = node.firstChild; if (next) { return next; } while (node) { if ( (next = node.nextSibling) ) { return next; } node = node.parentNode; } } function getNodesInRange(range) { var start = range.startContainer; var end = range.endContainer; var commonAncestor = range.commonAncestorContainer; var nodes = []; var node; // Walk parent nodes from start to common ancestor for (node = start.parentNode; node; node = node.parentNode) { nodes.push(node); if (node == commonAncestor) { break; } } nodes.reverse(); // Walk children and siblings from start until end is found for (node = start; node; node = getNextNode(node)) { nodes.push(node); if (node == end) { break; } } return nodes; } function getNodeIndex(node) { var i = 0; while ( (node = node.previousSibling) ) { ++i; } return i; } function insertAfter(node, precedingNode) { var nextNode = precedingNode.nextSibling, parent = precedingNode.parentNode; if (nextNode) { parent.insertBefore(node, nextNode); } else { parent.appendChild(node); } return node; } // Note that we cannot use splitText() because it is bugridden in IE 9. function splitDataNode(node, index) { var newNode = node.cloneNode(false); newNode.deleteData(0, index); node.deleteData(index, node.length - index); insertAfter(newNode, node); return newNode; } function isCharacterDataNode(node) { var t = node.nodeType; return t == 3 || t == 4 || t == 8 ; // Text, CDataSection or C…
type: Answer
has comment: http://stackoverflow.com/comment/108977594

http://stackoverflow.com/comment/47259311
has text: In general you cannot. The reason is, that many options involves a lot of bahind-the-scenes calculation, caching and DOM-building. What you must do is to reinitialize the table with the new options.
comment on: http://stackoverflow.com/q/29541725
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29546306
accepted answer: http://stackoverflow.com/a/29546600
has body: I have this code for example: Basket item 1 Basket item 2 When i run it i get the error message: TypeError: quantityInputs[i].addEventListener is not a function Could anyone tell me why this is happening?
has answer: http://stackoverflow.com/a/29546495
upvote count: 1
possible better answer: http://stackoverflow.com/a/29546428
downvote count: 1
linked to: http://stackoverflow.com/q/750486
has answer: http://stackoverflow.com/a/29546428
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47245577
has answer: http://stackoverflow.com/a/29546600
type: Question
answer count: 3
tagged with: javascript
favorite count: 0
score: 0
has comment: http://stackoverflow.com/comment/47244407
has title: Event listener giving error
has comment: http://stackoverflow.com/comment/47245034

http://stackoverflow.com/q/29591881
downvote count: 1
score: 2
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/29591932
possible better answer: http://stackoverflow.com/a/29591950
tagged with: javascript
has answer: http://stackoverflow.com/a/29591950
favorite count: 0
has body: var app = angular.module('app', []); app.controller('TheCtrl', ['$scope', function (scope) { scope.user = { name: "木士羽", email: 'fdaf@qfdsafq.com', }; scope.$watch('user.name', function () { console.log('change'); }); }]); angular.bootstrap(document.documentElement, ['app']); when page is loaded, 'change' is printed in console. $watch is triggered when init. How to avoid it?
has answer: http://stackoverflow.com/a/29591949
has title: angular $watch is triggered on init?
answer count: 4
tagged with: angularjs
upvote count: 3
has answer: http://stackoverflow.com/a/29591984
has answer: http://stackoverflow.com/a/29591932

http://stackoverflow.com/comment/47476751
has text: I see, I misread the question.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29668787

http://stackoverflow.com/a/29680866
type: Answer
answers question: http://stackoverflow.com/q/29680811
has body: You need to explicitly define the patterns combined with the delimiter | \w\{LINK_TO_WEB_VERSION\}\w?|\w?\{LINK_TO_WEB_VERSION\}\w|\w\{LINK_TO_WEB_VERSION\}\w DEMO
accepted answer of: http://stackoverflow.com/q/29680811
downvote count: 0
score: 1
type: AcceptedAnswer
upvote count: 1

http://stackoverflow.com/comment/47298371
has text: Store the sender and the uploaded file info in a global object. So when first computer sends file, it will be noted in the object. Similarly when the second computer sends file it will be noted as well. No matter whether it's first computer which sends file first/second. Chck the object whether both the senders have sent the file/not and if the object contains both entries then process the second script.
comment on: http://stackoverflow.com/a/29574326
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/47370088
score: 0
has text: @Felix Kling : I have no idea why it didn't work at first, but it did work later. Please check my solution part of my edited question. I hate javascript a lot :) Thanks for helping!
type: Comment
comment on: http://stackoverflow.com/q/29609982
type: QuestionComment

http://stackoverflow.com/comment/47381001
comment on: http://stackoverflow.com/q/29617688
type: QuestionComment
type: Comment
score: 0
has text: Yeah, I'm starting to think this is more of a laravel/carbon question than a client side issue

http://stackoverflow.com/comment/47511581
type: Comment
has text: @deceze—fair enough.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/29665353

http://stackoverflow.com/comment/47414180
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29627372
has text: OK I updated the fiddle and the solution, take care you take the right link 5/5, I saved some non-sense in between (5/4).

http://stackoverflow.com/comment/47421279
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/29639679
has text: It's `.reduce(function(p, collection) { ... }, {});` In other words, the rest of the `.reduce()` function call.

http://stackoverflow.com/comment/47507334
type: QuestionComment
type: Comment
score: 0
has text: controller: 'controllerName' should work here.
comment on: http://stackoverflow.com/q/29684658

http://stackoverflow.com/a/29628948
type: Answer
answers question: http://stackoverflow.com/q/29628349
has body: If you take a look at the documentation: here You can see that there is 3 arguments can be passed to the callback function - element - index - array If you call forEach like this: var x=[1,2,3,4,6]; x.forEach(function(e){ if(e==3)f=9; console.log(e); }) console.log(x); 1 2 9 4 6 [1, 2, 3, 4, 6] The value of the array element will not change because you are changing a buffers value. But if you use forEach like this: var x=[1,2,3,4,6]; x.forEach(function(e,i,a){ if(e==3)a[i]=9; console.log(a[i]); }) console.log(x); 1 2 9 4 6 [1, 2, 9, 4, 6] you see that the value changed in the array.
score: 0

http://stackoverflow.com/q/29605176
type: Question
has body: How can I get set of distinct tags from an HTML DOM using jQuery/JS? Below is sample DOM HTML -- Head -- META -- TITLE -- H1 -- BODY -- DIV -- DIV -- FORM -- INPUT -- INPUT -- INPUT then output should be HTML HEAD META TITLE H1 BODY DIV FORM INPUT thanks iuq
has comment: http://stackoverflow.com/comment/47355945
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/47356291
upvote count: 1
downvote count: 1
possible better answer: http://stackoverflow.com/a/29605413
has comment: http://stackoverflow.com/comment/47355954
duplicate of: http://stackoverflow.com/q/12947463
has comment: http://stackoverflow.com/comment/47356506
favorite count: 0
has title: Selecting distinct set of tags from HTML DOM
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/12947463
has answer: http://stackoverflow.com/a/29605413
has answer: http://stackoverflow.com/a/29605368
accepted answer: http://stackoverflow.com/a/29605368

http://stackoverflow.com/a/29693392
score: 1
has body: After spending over a day trying to get the drag and drop working I fixed it with one single line of code. import React from 'react/addons'; How it compiled and rendered at all without that, I don't even know.
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29684672
answers question: http://stackoverflow.com/q/29684672
type: Answer
upvote count: 1

http://stackoverflow.com/a/29649410
has body: You have a typo; when using addClass and hasClass you don't need to use the . prefix: if ($(this).prev("ul").hasClass("newList")) { $(".newList").append(" New list item! "); } else { $(" My new list! ").insertBefore(this); $(this).prev("ul").addClass("newList"); $("#modifyExample2").text("Click me again to insert list items!"); } Working fiddle Note that you can also tidy the logic a little: $("#modifyExample2").on("click", function () { var $ul = $(this).prev('ul'); if ($ul.hasClass("newList")) { $ul.append(" New list item! "); } else { $(" My new list! ").addClass("newList").insertBefore(this); $(this).text("Click me again to insert list items!"); } });
answers question: http://stackoverflow.com/q/29649361
has comment: http://stackoverflow.com/comment/47438560
downvote count: 0
accepted answer of: http://stackoverflow.com/q/29649361
has comment: http://stackoverflow.com/comment/47438751
has comment: http://stackoverflow.com/comment/47439163
type: AcceptedAnswer
type: Answer
score: 3
upvote count: 3

http://stackoverflow.com/q/29573066
has answer: http://stackoverflow.com/a/29573538
accepted answer: http://stackoverflow.com/a/29573538
has comment: http://stackoverflow.com/comment/47295525
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47296143
has body: I am having trouble getting this directive to work properly, It was working fine until I tried adding a scope to link a function. Here's what I have so far The directive (in requirejs format hence the module/component name stuff) : angular.module(metadata.moduleName, [ filterFieldControl.moduleName ]).directive(metadata.componentName, function(scope) { return { controller: filterFieldControl.componentName, restrict: 'C', replace: true, scope: { filterFn: '=' }, template: builderResultFiltersHTML }; } ); The controller angular.module(metadata.moduleName, []).controller(metadata.componentName, [ '$scope', function($scope) { $scope.filterChange = function() { $scope.filterFn(); }; } ]); The template: &lt;div&gt; &lt;ul&gt;{{filter.name}} &lt;li ng-repeat="value in filter.values"&gt; &lt;input type="checkbox" ng-model="filterObject[filter.name][value]" ng-change="filterChange()"&gt;{{value}} &lt;/li&gt; &lt;/ul&gt; Where it is being used (and maybe some of the issue is it's being repeated?) &lt;div ng-repeat="result in searchResults.results" class="builder-search-result" filter-fn="filterClicked" &gt;&lt;/div&gt; So if I take out the scope from the directive it works fine. If i add it in, there are no errors in console but nohting shows up. If I remove this, it works : scope: { filterFn: '=' }, Can't seem to figure out why. Could use some ideas. Edit: added fiddle here https://jsfiddle.net/vt1uasw7/31/ - you will notice if you remove the scope part of the directive, everything shows up fine.
has comment: http://stackoverflow.com/comment/47295409
has comment: http://stackoverflow.com/comment/47295431
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has title: Angular, adding scope is breaking my directive
tagged with: angularjs
upvote count: 2
has comment: http://stackoverflow.com/comment/47296028

http://stackoverflow.com/comment/90545016
has text: Samething to say for orderBy clause.
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/29608602

http://stackoverflow.com/q/29636347
has answer: http://stackoverflow.com/a/29638348
type: AnsweredQuestion
has body: I'm working on a chrome extension that injects a few buttons onto a page via content script, and I would like to have a button that links to the history page (chrome://history). This just opens a blank tab with no URL: window.open("chrome://history", "_blank"); And having a hyperlink to the history page directly give me an error: &lt;a href="chrome://history" target="_blank"&gt;...&lt;/a&gt; Not allowed to load local resource: chrome://history/ Chrome's Extension API doesn't have chrome://* listed as a supported scheme for extension pages, which explains the error, but all I want to do is provide a link to the history page. Is there any way to do this, even if it's a little (or a lot) convoluted? Thanks! EDIT: Added that this is done through a content script, I didn't clarify that in the initial post.
has comment: http://stackoverflow.com/comment/47418472
tagged with: url-scheme
accepted answer: http://stackoverflow.com/a/29638348
type: Question
has answer: http://stackoverflow.com/a/29638367
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/10667178
score: 0
answer count: 3
tagged with: google-chrome-extension
possible better answer: http://stackoverflow.com/a/29636671
has answer: http://stackoverflow.com/a/29636671
has title: Linking to chrome://history through extension

wordpress
tags question: http://stackoverflow.com/q/29652723
tags question: http://stackoverflow.com/q/29542756
tags question: http://stackoverflow.com/q/29571919
tags question: http://stackoverflow.com/q/29678489
tags question: http://stackoverflow.com/q/29536330
tags question: http://stackoverflow.com/q/29619605
tags question: http://stackoverflow.com/q/29685853
tags question: http://stackoverflow.com/q/29681145
tags question: http://stackoverflow.com/q/29596723
tags question: http://stackoverflow.com/q/29607189
tags question: http://stackoverflow.com/q/29603811
tags question: http://stackoverflow.com/q/29666343
tags question: http://stackoverflow.com/q/29548565
tags question: http://stackoverflow.com/q/29585270
tags question: http://stackoverflow.com/q/29589551
tags question: http://stackoverflow.com/q/29552211
tags question: http://stackoverflow.com/q/29531989
tags question: http://stackoverflow.com/q/29540359
tags question: http://stackoverflow.com/q/29561397
tags question: http://stackoverflow.com/q/29633511
tags question: http://stackoverflow.com/q/29638606
tags question: http://stackoverflow.com/q/29625571
tags question: http://stackoverflow.com/q/29580059
tags question: http://stackoverflow.com/q/29568986
tag name: wordpress
tags question: http://stackoverflow.com/q/29679363
tags question: http://stackoverflow.com/q/29548531
tags question: http://stackoverflow.com/q/29636033
tags question: http://stackoverflow.com/q/29582577
tags question: http://stackoverflow.com/q/29573894
tags question: http://stackoverflow.com/q/29561056
tags question: http://stackoverflow.com/q/29566338
tags question: http://stackoverflow.com/q/29620661
tags question: http://stackoverflow.com/q/29595804
tags question: http://stackoverflow.com/q/29544473
tags question: http://stackoverflow.com/q/29563806
tags question: http://stackoverflow.com/q/29544940
type: Tag

http://stackoverflow.com/comment/47464497
has text: There's a difference between the checked _attribute_ and the checked _property_. The _attribute_ is what appears in the source and is only used to indicate the **default** state of the input, and doesn't change when the element is checked and unchecked. The _property_ is a part of the DOM node, and represents what the element currently is, and that is what changes. And so it might be different from what the attribute says. There's a good answer on it [here](http://stackoverflow.com/questions/6003819/properties-and-attributes-in-html)
type: Comment
comment on: http://stackoverflow.com/a/29662345
score: 2
type: AnswerComment

http://stackoverflow.com/a/29672061
downvote count: 0
has body: There is no @@iterator function. That token produces a syntax error - it is only used in specification to denote a specific symbol. If you want to use that symbol in your code, e.g. to access iterators on arrays, you have to use Symbol.iterator. Which is a property of the Symbol class initialised to have the value @@iterator.
type: Answer
answers question: http://stackoverflow.com/q/29670320
score: 12
accepted answer of: http://stackoverflow.com/q/29670320
upvote count: 12
type: AcceptedAnswer

http://stackoverflow.com/comment/47321524
comment on: http://stackoverflow.com/a/29586892
has text: Thanks for the quick reply, I'll give it a try in the morning.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/29584321
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/29584287
score: 1
has body: If the buttonpush don't trigger an get/post event, u cant do this. If the button does, you have to simulate it by sending the next get or post with the button parameters. This will get you the expected datas, so no need to refresh.
upvote count: 1

http://stackoverflow.com/q/29538071
tagged with: javascript
answer count: 1
downvote count: 0
has body: hey guys i am an absolute newbie to jquery and here is one of my first scripts , its basically suppose to add an animation basically when scrolling to a particular, section , the fiddle is here. the scrolling code that i have in jquery is : $('nav a[href^="#"]').on('click', function (e) { e.preventDefault(); $('nav a').each(function () { $(this).removeClass('active'); }) $(this).addClass('active'); var target = this.hash, menu = target; $target = $(target); $('html, body').stop().animate({ 'scrollTop': $target.offset().top }, 500, 'swing', function () { window.location.hash = target; }); }); now i only know basic debugging in JS and so the only fault i could find in the script is that target is not defined. i got this script from an online tut and it worked perfectly over there , but i have no idea why here its not working. i can't understand the authors intent of adding an undefined variable . can somebody please point me out what am i doing wrong ? original Tutorial code can be found here. TY . Alex-z
tagged with: jquery
has comment: http://stackoverflow.com/comment/47228285
favorite count: 0
has answer: http://stackoverflow.com/a/29539306
has title: Scrolling animation code not working
score: 2
type: AnsweredQuestion
upvote count: 2
accepted answer: http://stackoverflow.com/a/29539306
type: Question

http://stackoverflow.com/a/29561145
type: Answer
downvote count: 0
score: 1
has body: You're looping over the second structure incorrectly. It is an array, not an object. for (var key in validation_messages) { if (validation_messages.hasOwnProperty(key)) { var obj = validation_messages[key]; // use a for loop here instead of for...in for (var i = 0, l = obj.length; i &lt; l; i++) { console.log(key + " = " + obj[i]); } } } DEMO
accepted answer of: http://stackoverflow.com/q/29561053
answers question: http://stackoverflow.com/q/29561053
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/47505468
score: 1
comment on: http://stackoverflow.com/q/29681672
has text: @JacquesBronkhorst Is unchecking the checkbox intended to delete the data?
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/47297179
has text: Using the output buffer just basically writes to memory before it writes to the page, then you assign the contents to a variable. It's basically the same thing you are doing, however, some of the wp functions echo which you can not assign to a variable. You can change the functions to return and not echo (according to the manual) then what you have "should" work
type: Comment
comment on: http://stackoverflow.com/a/29574035
type: AnswerComment
score: 0

http://stackoverflow.com/q/29628443
score: 0
answer count: 1
tagged with: setinterval
has comment: http://stackoverflow.com/comment/47400034
has answer: http://stackoverflow.com/a/29628489
type: AnsweredQuestion
tagged with: innerhtml
has comment: http://stackoverflow.com/comment/47399935
has body: Forgive the title, I'm not really sure what the problem is... I'm kind of guessing at this point. This is my first attempt at a reusable class in Javascript. Here's a stripped down version of it: Countdown = function ( elementID ) { this.timer = null; this.output = ''; this.element = document.getElementById(elementID) || document.getElementById('countdown'); } Countdown.prototype.start = function () { this.timer = setInterval(this.run, 1000); } Countdown.prototype.run = function () { this.output = 'test'; this.element.innerHTML = this.output; /* THE PROBLEM IS HERE */ } Countdown.prototype.toCalculatedTime = function () { this.start(); } var c = new Countdown(); c.toCalculatedTime(); console.log(c); I'm getting the error: Uncaught TypeError: Cannot set property 'innerHTML' of undefined" at the line specified. First, yes there is an element with an ID of 'countdown'. I've tried changing the name of the element, both in the markup and in the class. I've tried passing an element name upon instantiation of this class, and it doesn't seem to make a difference. I really don't know what to make of this. In the console, it looks like my class is being constructed just fine.
has comment: http://stackoverflow.com/comment/47399828
type: Question
tagged with: object
has title: Native JS in custom class: "Uncaught TypeError: Cannot set property 'innerHTML' of undefined"
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29628489

http://stackoverflow.com/q/29671211
has answer: http://stackoverflow.com/a/29671690
tagged with: slideshow
tagged with: javascript
has comment: http://stackoverflow.com/comment/47480362
has comment: http://stackoverflow.com/comment/47480492
favorite count: 0
has title: JavaScript Mouseover gallery works in IE but not in Chrome
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29671732
downvote count: 1
has body: I have a gallery which is shown on "mouseover". It enlarges a thumbnail in the centre of the screen. This is done with JavaScript. The problem is that it works in IE but not with Chrome. Here's the code:
score: -1
has answer: http://stackoverflow.com/a/29671442
type: Question
answer count: 3
upvote count: 0

http://stackoverflow.com/q/29631945
tagged with: express
favorite count: 0
score: 13
has answer: http://stackoverflow.com/a/69915122
has comment: http://stackoverflow.com/comment/52846252
tagged with: node.js
upvote count: 13
tagged with: body-parser
type: UnansweredQuestion
has title: Node hangs on POST request when using http-proxy and body-parser with express
type: Question
has answer: http://stackoverflow.com/a/32507207
tagged with: node-http-proxy
has answer: http://stackoverflow.com/a/32507006
answer count: 3
has body: I've also posted this to the relevant issue on http-proxy. I'm using http-proxy with express so I can intercept requests between my client and api in order to add some cookies for authentication. In order to authenticate the client must send a POST request with x-www-form-urlencoded as the the content-type. So I am using body-parser middleware to parse the request body so I can insert data in the request. http-proxy has a problem with using body-parser supposedly because it parses the body as a stream and never closes it so the proxy never never completes the request. There is a solution in the http-proxy examples that "re-streams" the request after it has been parsed which I have tried to use. I have also tried to use the connect-restreamer solution in the same issue with no luck. My code looks like this var express = require('express'), bodyParser = require('body-parser'), httpProxy = require('http-proxy'); var proxy = httpProxy.createProxyServer({changeOrigin: true}); var restreamer = function (){ return function (req, res, next) { //restreame req.removeAllListeners('data') req.removeAllListeners('end') next() process.nextTick(function () { if(req.body) { req.emit('data', req.body) //error gets thrown here } req.emit('end') }) } } var app = express(); app.use(bodyParser.urlencoded({extended: false, type: 'application/x-www-form-urlencoded'})); app.use(restreamer()); app.all("/api/*", function(req, res) { //modifying req.body here // proxy.web(req, res, { target: 'http://urlToServer'}); }); app.listen(8080); and I receive this error /Code/project/node_modules/http-proxy/lib/http-proxy/index.js:119 throw err; ^ Error: write after end at ClientRequest.OutgoingMessage.write (_http_outgoing.js:413:15) at IncomingMessage.ondata (_stream_readable.js:540:20) at IncomingMessage.emit (events.js:107:17) at /Code/project/lib/server.js:46:25 at process._tickCallback (node.js:355:11) I have tried to debug the flow but am grasping for straws. Any suggestions please??
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/47461955
score: 0
type: Comment
type: QuestionComment
has text: @CoolBlue The file is like 700 lines. The exit/remove is working but the transition isn't. Shouldn't that mean that it isn't the selection? If not, certainly let me know and I will try to add something more that is more in-depth.
comment on: http://stackoverflow.com/q/29658108

http://stackoverflow.com/comment/47242442
has text: No..You can too try it..just change your system time zone to +5.30 IST and run the script..you will get UTC always
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29545117

http://stackoverflow.com/a/29641414
type: Answer
accepted answer of: http://stackoverflow.com/q/29619224
answers question: http://stackoverflow.com/q/29619224
type: AcceptedAnswer
has body: The dijit slider ui worked as frank suggested in the above comment. I had to hide the slider handle using the css and it worked perfectly. Also I chose slider over the progress bar because I don't need the %age to be shown.
score: 0

http
tags question: http://stackoverflow.com/q/29673321
tags question: http://stackoverflow.com/q/29659154
tags question: http://stackoverflow.com/q/29661720
tags question: http://stackoverflow.com/q/29598582
tags question: http://stackoverflow.com/q/29588487
tags question: http://stackoverflow.com/q/29578235
tags question: http://stackoverflow.com/q/29657345
tag name: http
tags question: http://stackoverflow.com/q/29598925
tags question: http://stackoverflow.com/q/29612862
tags question: http://stackoverflow.com/q/29622610
type: Tag
tags question: http://stackoverflow.com/q/29676770
tags question: http://stackoverflow.com/q/29539290

http://stackoverflow.com/comment/47496649
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/29679363
has text: Revolution slider comes with its own overlay option, you can enable it and rewrite the background css for that. I usually do that and it works great. Try to enable 2x2 black, and add this: `.tp-dottedoverlay.twoxtwo { background: linear-gradient(to bottom, rgba(0,0,0,0.65) 0%,rgba(0,0,0,0) 100%) !important; }`
type: Comment

http://stackoverflow.com/q/29569868
has title: Mongoose - for each get count and select
type: UnansweredQuestion
tagged with: node.js
has answer: http://stackoverflow.com/a/29571676
has body: I have two schemas Advert: var AdvertSchema = new Schema({ created: { type: Date, default: Date.now }, title: { type: String, default: '', trim: true, required: 'title cannot be empty' }, advert: { type: String, default: '', required: 'advert cannot be empty' }, sport: [{ type: Schema.ObjectId, ref: 'Sport' }], }); mongoose.model('Advert', AdvertSchema); and Sport: var SportSchema = new Schema({ sportName: { type: String, default: '', required: 'sport cannot be empty' } }); mongoose.model('Sport', SportSchema); And I would like to know how can I for each sport get count of adverts and select _id and sportName of Sport schema. Note that in Advert schema is sport as array. The result then should be something like this: [{ _idOfSport: "some ID", sportName: "sport name", countOfSportAdverts: "number" }, etc for other sports... ] I guess I can use aggregation framework but I don't know how. Is it somehow possible to do it?
type: Question
tagged with: mongodb
tagged with: arrays
tagged with: mongoose
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/q/29633441
has comment: http://stackoverflow.com/comment/47413396
has title: what is the best (simplest) way to store the state of a check box for seven days on phones without using local storage
has comment: http://stackoverflow.com/comment/47409821
tagged with: javascript
has comment: http://stackoverflow.com/comment/47413717
has comment: http://stackoverflow.com/comment/47409488
score: 0
has comment: http://stackoverflow.com/comment/47413521
tagged with: state
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/47411656
type: UnansweredQuestion
tagged with: checkbox
has body: I am building a simple app that should store the state of a switch / checkbook for a period of seven days. the only issue I have is that the website I am using to build said app doesn't accommodate for local storage on the phones. what is a good yet very simple way to store the switch / checkbook state without doing it through local storage or linking to an online database as I haven't the simplest clue of how to manage or set up let alone create a database. code options I have available to work with are HTML, CSS and javascript the website I am using is buildfire.
has comment: http://stackoverflow.com/comment/47409859
tagged with: css
has comment: http://stackoverflow.com/comment/47409973
has answer: http://stackoverflow.com/a/38402671
has comment: http://stackoverflow.com/comment/47409236
has comment: http://stackoverflow.com/comment/47410167
has comment: http://stackoverflow.com/comment/47410280
type: Question

http://stackoverflow.com/comment/47217394
comment on: http://stackoverflow.com/q/29532026
type: Comment
type: QuestionComment
has text: This seems like a good Idea - but wouldnt work if I have duplicate tooltip - would it?
score: 0

http://stackoverflow.com/comment/47344747
type: Comment
score: 1
comment on: http://stackoverflow.com/q/29599171
has text: I am no expert, just out of curiosity why is it worrying that "the image will have to be retrieved from the server..?" isn't proper caching an answer to that ?
type: QuestionComment

firefox
tags question: http://stackoverflow.com/q/29636319
tags question: http://stackoverflow.com/q/29572935
tags question: http://stackoverflow.com/q/29649124
tags question: http://stackoverflow.com/q/29593306
tags question: http://stackoverflow.com/q/29597988
tags question: http://stackoverflow.com/q/29685894
tags question: http://stackoverflow.com/q/29630755
tags question: http://stackoverflow.com/q/29543719
tags question: http://stackoverflow.com/q/29655160
tag name: firefox
tags question: http://stackoverflow.com/q/29531727
tags question: http://stackoverflow.com/q/29533425
tags question: http://stackoverflow.com/q/29639448
tags question: http://stackoverflow.com/q/29555798
tags question: http://stackoverflow.com/q/29560441
tags question: http://stackoverflow.com/q/29662790
tags question: http://stackoverflow.com/q/29589994
tags question: http://stackoverflow.com/q/29550278
type: Tag
tags question: http://stackoverflow.com/q/29614408
tags question: http://stackoverflow.com/q/29598691
tags question: http://stackoverflow.com/q/29591623
tags question: http://stackoverflow.com/q/29548297
tags question: http://stackoverflow.com/q/29582208
tags question: http://stackoverflow.com/q/29661063
tags question: http://stackoverflow.com/q/29617131
tags question: http://stackoverflow.com/q/29685287
tags question: http://stackoverflow.com/q/29595159
tags question: http://stackoverflow.com/q/29563890
tags question: http://stackoverflow.com/q/29630808
tags question: http://stackoverflow.com/q/29540359
tags question: http://stackoverflow.com/q/29552789
tags question: http://stackoverflow.com/q/29535871
tags question: http://stackoverflow.com/q/29582646

http://stackoverflow.com/comment/47474475
comment on: http://stackoverflow.com/a/29663840
type: Comment
score: 0
has text: thank you so much! incase anyone ran into the same problem, or just wondering, rather than using a container , I just used React's getInitialState method and then called fetch inside the componentDidMount method using a success callback inside fetch to set the state to the data returned from the server.
type: AnswerComment

http://stackoverflow.com/comment/47229215
type: QuestionComment
comment on: http://stackoverflow.com/q/29538540
type: Comment
score: 0
has text: And please use `var` where appropriate and be consistent with semi-colons. You (and your colleagues) will thank you someday.

http://stackoverflow.com/q/29610770
upvote count: 5
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has answer: http://stackoverflow.com/a/29611587
downvote count: 0
has comment: http://stackoverflow.com/comment/47367996
has body: JS fiddle I have a coordinates array populated by mouse clicks on a canvas. var pointsArray = []; This array is pushed x and y values using a click event. pointsArray.push({x: xVal, y: yVal}); I iterate the points array and draw a line between the current point, and the previous point. function drawPolygon(points) { //check arguments for null values if(!points) return false; var i; for(i = 0; i &lt; points.length; i++) drawLine(points[i-1], points[i]); //draw the final line drawLine(points[i-1], points[0]); } drawLine looks like this: function drawLine(point1, point2) { //check arguments for null values if(!point1 || !point2) return false; context.beginPath(); context.moveTo(point1.x, point1.y); context.lineTo(point2.x, point2.y); context.stroke(); } Unfortunately, depending on what order the users click, I can have the lines intersect, which I don't want: https://i.sstatic.net/NefX5.png How would I solve for this? My first instinct tells me to order the points top-to-bottom, left-to-right in the array then draw.
has answer: http://stackoverflow.com/a/29613081
accepted answer: http://stackoverflow.com/a/29613081
possible better answer: http://stackoverflow.com/a/29611587
has comment: http://stackoverflow.com/comment/47367504
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/47367440
has comment: http://stackoverflow.com/comment/47367942
has comment: http://stackoverflow.com/comment/47368446
answer count: 2
score: 5
tagged with: canvas
has title: Draw a polygon between coordinates, preventing intersects
has comment: http://stackoverflow.com/comment/47368409
tagged with: javascript

http://stackoverflow.com/q/29666964
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29667516
upvote count: 1
has answer: http://stackoverflow.com/a/29667100
type: Question
possible better answer: http://stackoverflow.com/a/29667126
has answer: http://stackoverflow.com/a/29667126
tagged with: javascript
has answer: http://stackoverflow.com/a/29667206
tagged with: angularjs-scope
has title: Using Angular $scope variable inside an object
has comment: http://stackoverflow.com/comment/47472840
accepted answer: http://stackoverflow.com/a/29667100
downvote count: 0
has body: I tried searching SO for similar question as mine, but could not get any. Pardon if this question is duplicate and has already been answered. My HTML has two input fields for First Name and Last Name, and a button: Fname = {{fname}} Lname = {{lname}} This is my JS file which has the controller function: var myApp = angular.module("myApp", []); myApp.controller("myCtrl",function($scope){ $scope.fname = "sandeep"; $scope.lname = "nayak"; $scope.createObj= function(){ var obj = {fn:$scope.fname, ln: $scope.lname}; console.log(obj); $scope.fname = ""; $scope.lname = ""; console.log(obj); }; }); In createObj method, I create an object which holds the first name and last name, and then I clear the $scope. I log the object twice, before and after I clear the $scope. But I do not see any difference. Why is the object still same, even after I clear the $scope, since I refer the $scope in my object? http://jsfiddle.net/7eo4zcvq/
score: 1
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/q/29559623
linked to: http://stackoverflow.com/q/4935632
type: Question
tagged with: decode
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/47269144
answer count: 1
has answer: http://stackoverflow.com/a/29559711
has body: I have a encoded JSON string returning the following sting which I am displaying on my webpage from a database call. {"Value 1":"1234","Value 2":"123456"} How do I decode this string and also format the data to be displayed in a table? I am at a lost as how to do this. Thanks
has comment: http://stackoverflow.com/comment/47271687
has title: Decode a JSON String in Javascript
has comment: http://stackoverflow.com/comment/47269128
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/11922383
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/47269223

http://stackoverflow.com/comment/47348919
comment on: http://stackoverflow.com/q/29601437
has text: Or any other module loader really, you don't have to implement this yourself there are a lot of libraries that do a good job and handle edge cases.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/29688108
score: 1
has comment: http://stackoverflow.com/comment/47539897
has answer: http://stackoverflow.com/a/29707974
upvote count: 1
has comment: http://stackoverflow.com/comment/47519805
type: Question
tagged with: javascript
has title: Titanium studio require() javascript module
has comment: http://stackoverflow.com/comment/47513324
has body: I am new to Titanium Studio and I was trying to follow the tutorial from appcelerator http://docs.appcelerator.com/titanium/3.0/#!/guide/CommonJS_Modules_in_Titanium-section-29004791_CommonJSModulesinTitanium-AntipatternsandUnsupportedBehavior However, when I create the Person.js (in app/controller folder) and try to use it in my index.js file by var Person = require("Person"); var don = new Person('Don','Thorp'); var donsName = don.fullName(); // "Don Thorp" I encountered the error that the fullNmae() was not defined (it is defined in Person.js). Did any people have the similar problem? Please help me out,thanks! The Person.js code is function Person(firstName,lastName) { this.firstName = firstName; this.lastName = lastName; } Person.prototype.fullName = function() { return this.firstName+' '+this.lastName; }; module.exports = Person; The error message is : [ERROR] : TiExceptionHandler: (main) [196,196] ----- Titanium Javascript Runtime Error ----- [ERROR] : TiExceptionHandler: (main) [0,196] - In alloy/controllers/index.js:1,69 [ERROR] : TiExceptionHandler: (main) [0,196] - Message: Uncaught TypeError: Object #&lt;Controller&gt; has no method 'fullName' [ERROR] : TiExceptionHandler: (main) [0,196] - Source: xtend(s,s.__views);var l=require("Person"),c=new l("Don","Thorp");c.fullName() [ERROR] : V8Exception: Exception occurred at alloy/controllers/index.js:1: Uncaught TypeError: Object #&lt;Controller&gt; has no method 'fullName'
downvote count: 0
answer count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: titanium-mobile

http://stackoverflow.com/comment/47236388
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29542204
has text: Do you mean you want to redirect automatically after the animation has finished? Or load new content to the same page without changing the location?
score: 0

http://stackoverflow.com/q/29612479
answer count: 2
score: 2
downvote count: 0
tagged with: javascript
has body: I am looking to prepare an object for send. It initially looks like so : var myObj = {"state":{"Saved":true,"Committed":false,"Published":false},"discipline":{"Marketing":true}}; And needs to be change via looking at the inner objects and turning it into an array of keys of the objects who's values are true. So in this example it would change into this : {"state":["Saved"],"discipline":["Marketing"]}; (committed and published were removed because they were set to false. ) Here is what I've tried so far: function mutate() { //map obj return _.map(myObj, function(object){ //pluck keys that have = true return _.keys(_.pick(object[0], Boolean)); }); } Struggling with this a bit, and how to traverse and build this correctly. I am using underscore - but plain javascript is fine if it makes more sense. Thanks!
possible better answer: http://stackoverflow.com/a/29613273
favorite count: 0
has answer: http://stackoverflow.com/a/29613273
has answer: http://stackoverflow.com/a/29612599
has title: Javascript, Transforming object with underscore (or not)
upvote count: 2
type: AnsweredQuestion
tagged with: underscore.js
accepted answer: http://stackoverflow.com/a/29612599
type: Question

http://stackoverflow.com/a/29616615
type: Answer
answers question: http://stackoverflow.com/q/29616577
score: 0
has body: jQuery(document).ready(function($) { //-------------------------------------------------------------------- // use the class selector instead of id, this will allow you to do the // same for all elements with the same class //-------------------------------------------------------------------- $(".rep_label input[type=checkbox]").change(function() { //Cache the current element var $this = $(this); //cache the current checked state var checked = $this.is(':checked'); var State = (checked)? "1":"0"; //send ajax request $.ajax({ url: 'code.php', type: 'POST', //set the state variable to the current element checked state data: { db_column:$this.attr("name"), strState:state, user:"admin" }, success: function() { // this happens after we get results //make the element checked $this.attr('checked', checked); }, error:function(){ //make the element unchecked $this.attr('checked', !checked); } }); }); });

http://stackoverflow.com/q/29568486
has body: getBrand: function(brandId) { for(var i=0; i&lt;malls.length; i++) { for(var j=0;j&lt;malls[i].brands.length; j++){ //console.log(malls[i][brands[j]); //console.log(malls[i].brands[j].id); if(malls.brands[j].id==(brandId)){ console.log(malls.brands[j].id); return malls.brands[j].id; } } } } I need help please, and in my console i get this message:TypeError: Cannot read property '0' of undefined
has answer: http://stackoverflow.com/a/29568652
has answer: http://stackoverflow.com/a/29571382
upvote count: 1
has comment: http://stackoverflow.com/comment/47286518
downvote count: 1
type: Question
has title: Cannot read property '0' of undefined
has answer: http://stackoverflow.com/a/29568694
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/47286461
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/47286399
favorite count: 0
has comment: http://stackoverflow.com/comment/47286526
type: UnansweredQuestion

http://stackoverflow.com/q/29567703
has comment: http://stackoverflow.com/comment/47284956
has title: How can I request a webpage that is a .txt file?
upvote count: 1
possible better answer: http://stackoverflow.com/a/29567843
type: Question
has answer: http://stackoverflow.com/a/29567843
has comment: http://stackoverflow.com/comment/47286142
tagged with: javascript
score: -1
answer count: 2
has comment: http://stackoverflow.com/comment/47284905
has answer: http://stackoverflow.com/a/29567877
favorite count: 0
has body: I would like to retrieve the page data from a webserver in which the URL is http://www.xxxx.com/data.txt Is there a way with client side javascript to do this? Does the webserver have to be configured to allow it? John
downvote count: 2
has comment: http://stackoverflow.com/comment/47284920
accepted answer: http://stackoverflow.com/a/29567877
type: AnsweredQuestion

http://stackoverflow.com/a/29926130
has comment: http://stackoverflow.com/comment/47985983
answers question: http://stackoverflow.com/q/29634910
score: 2
has body: When you refer to a a fully ajaxed website, I think a SPA -- Single Page Application. The distinction may be semantics, but AJAX implies DOM manipulation, while SPA implies Templating and Navigation. HTML templates are loaded when your page is loaded. Each template maps to particular navigation route. The major changes are NOT with event mapping, but with which Template is shown, and whether new data has been loaded. See my example AngularJS SPA Plunkr AngularJS routing looks like this: scotchApp.config(function($routeProvider) { $routeProvider // route for the home page .when('/', { templateUrl: 'pages/home.html', controller: 'mainController' }) // route for the cars page .when('/cars', { templateUrl: 'pages/Cars.html', controller: 'CarsController' }) // route for the vegetables page .when('/vegetables', { templateUrl: 'pages/Vegetables.html', controller: 'VegetablesController' }); }); So each route has a corresponding HTML Template and Controller (where call back functions are defined). For CDN purposes, templates can be passed back as JSON // route for the vegetables page .when('/vegetables', { template: ' Cars Page Available Cars: LoadCars Make/Model Year Price {{ car.name }} {{ car.year }} ${{ car.price }} ', controller: 'VegetablesController' }); In "templated" applications, HTML of each type is loaded once. Events and controls are bound once. The incremental changes are JSON being passed back and forth. Your end points are not responsible for rendering HTML. They can be restful and there is a clear Separation of Concerns. You can create templated SPA applications with AngularJS, Ember, Backbone, JQuery, and more.
has comment: http://stackoverflow.com/comment/47988251
has comment: http://stackoverflow.com/comment/47978954
downvote count: 0
has comment: http://stackoverflow.com/comment/48027694
has comment: http://stackoverflow.com/comment/48026836
has comment: http://stackoverflow.com/comment/48016527
upvote count: 2
type: Answer

http://stackoverflow.com/q/29531453
has answer: http://stackoverflow.com/a/29537026
downvote count: 0
score: 1
tagged with: http://stackoverflow.com/tag/json
type: Question
accepted answer: http://stackoverflow.com/a/29534733
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29534733
answer count: 2
possible better answer: http://stackoverflow.com/a/29537026
upvote count: 1
has title: Group JSON Data in Jquery usinng Underscore.js
favorite count: 0
has body: I would like to format my JSON data to display Chart in my reporting templates.I want to produce a daily reporting chart with date wise Approved, Rejected and Pending data. My current JSON is: json_data = '[ {"Approved":1,"updated_date":"2015-03-07"}, {"Approved":1,"updated_date":"2015-03-07"}, {"Rejected":1,"updated_date":"2015-03-07"}, {"Pending":1,"updated_date":"2015-03-07"},{"Approved":1,"updated_date":"2015-03-07"} ]'; I want to achieve this output $data= '[ { "date": "1 Mar", "approved": 0, "completed": 0, "rejected": 0 }, { "date": "2 Mar", "approved": 0, "completed": 0, "rejected": 0 }, { "date": "3 Mar", "approved": 9, "completed": 20, "rejected": 11 }, { "date": "4 Mar", "approved": 20, "completed": 50, "rejected": 30 }, { "date": "5 Mar", "approved": 40, "completed": 50, "rejected": 10 }, { "date": "6 Mar", "approved": 35, "completed": 70, "rejected": 20 }, { "date": "7 Mar", "approved": 50, "completed": 80, "rejected": 30 }];' I want to display only last 7 days data report through CHART.
type: AnsweredQuestion

http://stackoverflow.com/comment/47256387
has text: I don't really get the calculation for `third`. Shouldn't it just be `9 - first - second`?
score: 1
comment on: http://stackoverflow.com/a/29552485
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47346297
has text: @ZeroRequiem The open calendar window doesn't have a class called datepicker
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29599619

http://stackoverflow.com/comment/47328065
type: Comment
comment on: http://stackoverflow.com/q/29590524
type: QuestionComment
has text: jQuery **is** Javascript.
score: 0

http://stackoverflow.com/comment/47428028
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29643363
has text: No, that's just the element where you display the message. The script as you have shown runs only once when the page is loaded, so if the message length is initially less than 70, then its divided by 70. I'm guessing you probably want to handle the `.keyup()` event of the textbox so the value is updated as you type (but not sure what you really want)
score: 0

http://stackoverflow.com/a/29799735
accepted answer of: http://stackoverflow.com/q/29686236
type: Answer
answers question: http://stackoverflow.com/q/29686236
type: AcceptedAnswer
has body: After some searching I didn't turn up an idiomatic way to accomplish what I was after. I ended up working around the issue leveraging our (already) modified compile process. Essentially the idea is to: Remove the child element's contents entirely during it's compile phase. In our case this serves to break an otherwise infinitely recursive compilation process and also to defer compilation until we can get a reference to the parent controller to help us modify the child's template. The child's postLink function get's passed a reference to the parent controller. Use the controller to get information from the parent directive and build a new template for the child. Compile this template and append it to the child. If anyone has a more elegant alternative I'd be happy to accept it!
score: 0

http://stackoverflow.com/a/29664267
has comment: http://stackoverflow.com/comment/47467861
score: 9
type: AcceptedAnswer
downvote count: 1
has body: The fetch polyfill library you are using is not as of this writing up-to-spec. For credentials, it expects 'cors' to be the value as opposed to 'include'. I would edit my local copy of fetch.js on line 264 to accommodate the standard, submit a pull request, and be on the lookout for a better supported polyfill library. See open issue: https://github.com/github/fetch/issues/109 https://github.com/github/fetch https://developer.mozilla.org/en-US/docs/Web/API/GlobalFetch/fetch
answers question: http://stackoverflow.com/q/29662394
upvote count: 10
type: Answer
has comment: http://stackoverflow.com/comment/84983318
accepted answer of: http://stackoverflow.com/q/29662394
has comment: http://stackoverflow.com/comment/58908441
has comment: http://stackoverflow.com/comment/58907444
has comment: http://stackoverflow.com/comment/100522988

http://stackoverflow.com/q/29590050
has comment: http://stackoverflow.com/comment/47374699
tagged with: javascript
linked to: http://stackoverflow.com/q/31641466
score: 12
has comment: http://stackoverflow.com/comment/47354267
tagged with: reactjs
answer count: 1
tagged with: reactjs-flux
favorite count: 0
has answer: http://stackoverflow.com/a/29705441
tagged with: flux
has title: How to deal with relations in Flux?
type: UnansweredQuestion
upvote count: 13
linked to: http://stackoverflow.com/q/25409164
has body: Imagine something like Quora. [ { type: "question", answers: [ { type: "answer", upvotes: [ { type: "upvote" } /* more upvotes */ ], comments [ { type: "comment" } /* more comments */ ] } /* more answers */ ] } /* more questions */ ] I'd surely have something like a QuestionsStore. But for all child entities I'm unsure what to do with them. Coming from Backbone I'm thinking every answer should have a UpvotesStore and a CommentsStore and components would get their data from these Stores and subscribe to updates from them. As far as I understand Flux, "child"/relational stores are somewhat uncommon. When every component subscribes to updates from QuestionsStore that leads to something like: /* in CommentsComponent */ onUpdate: function() { this.setState({ comments: QuestionsStore.getComments({questionId: 1, answerId: 1}); }); } or more extreme: /* in CommentComponent */ onUpdate: function() { this.setState(QuestionsStore.getComment({questionId: 1, answerId: 1, commentId: 1})); } Since the relational data lives in a tree structure, every component needs to know all "parent" id's in order to be able to query their data from QuestionsStore. I find this somehow weird. So what is the best Flux pattern to deal with relational (one-to-many) data structure?
linked to: http://stackoverflow.com/q/25701168
has comment: http://stackoverflow.com/comment/51394602
downvote count: 1
type: Question

http://stackoverflow.com/q/29586172
has comment: http://stackoverflow.com/comment/47320555
has comment: http://stackoverflow.com/comment/47320540
type: AnsweredQuestion
has body: I am working on a project which requires status update. I would like to add onlcick even on select box to show textarea only if the users selected the status as pending. echo " ".$res1['ProjStatus']." Completed Ongoing Pending "; Question: I would like to show the textarea only if the user change the project status to pending. The above code work but this refresh the whole page
has title: Loading Textarea with Javascript on click event
type: Question
has comment: http://stackoverflow.com/comment/47320569
has comment: http://stackoverflow.com/comment/47320408
has answer: http://stackoverflow.com/a/29586239
accepted answer: http://stackoverflow.com/a/29586239
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/47320376
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/47320600

http://stackoverflow.com/q/29538764
has answer: http://stackoverflow.com/a/29539376
has answer: http://stackoverflow.com/a/29539394
type: Question
answer count: 2
upvote count: 0
tagged with: javascript
tagged with: jquery
score: -8
has comment: http://stackoverflow.com/comment/47230599
tagged with: http://stackoverflow.com/tag/html
has title: Jquery or javascript to show hidden text
favorite count: 0
has comment: http://stackoverflow.com/comment/47229562
type: UnansweredQuestion
downvote count: 8
has comment: http://stackoverflow.com/comment/47247581
has body: I'm trying to turn this: Item1 ShowMore&lt;br&gt; Item2 ShowMore&lt;br&gt; Item3 ShowMore&lt;br&gt; Into Item1 hidden text&lt;br&gt; Item2 more hidden text&lt;br&gt; Item3 even more text&lt;br&gt; So I need to show that hidden text, in line, when i click on ShowMore, and the ShowMore has to disappear when pressed. Also i have hundreds of lines where i will use this, and I wander if there is an way to accomplish this without giving a unique id to each element. I found an posible solution here, but it does the opposite thing, it hides the text... http://w3schools.invisionzone.com/index.php?showtopic=49205 (second post)

http://stackoverflow.com/comment/47233375
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29540078
has text: That would only move it if it had completed the transition though, right? I want it to be snappy with the arrow key presses. If I hit left and then hit left again (within 0.2 seconds), I want it to skip the rest of the first transition (and complete the movement of 175px) and start the next transition immediately.
type: AnswerComment

http://stackoverflow.com/a/29608260
has comment: http://stackoverflow.com/comment/47430492
upvote count: 0
answers question: http://stackoverflow.com/q/29608139
has comment: http://stackoverflow.com/comment/47416467
has comment: http://stackoverflow.com/comment/47435931
has body: $("#PC13871_btnRefresh").click(function (e) { e.preventDefault(); alert("Handler for .click() called."); }); Use the e.preventDefault(). It will cancel the default action for an input of type submit
downvote count: 2
has comment: http://stackoverflow.com/comment/47362543
score: -2
has comment: http://stackoverflow.com/comment/47443225
has comment: http://stackoverflow.com/comment/47443391
has comment: http://stackoverflow.com/comment/47363140
has comment: http://stackoverflow.com/comment/47435192
type: Answer

http://stackoverflow.com/comment/47486899
has text: Then you did not add it in the right place. But using `type="button" is better anyway.
score: 0
comment on: http://stackoverflow.com/q/29674447
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/47406491
type: QuestionComment
has text: So, normally dependencies can be injected in any order. I thought $scope, $element and $attrs had to be in the correct order because they were normal function parameters rather than dependencies being injected. If they're just like any other dependency then they can go in any order like ($swipe, $element, $scope)? If so, then how come some people get away with calling them (scope, element, attrs) without the dollar sign?
comment on: http://stackoverflow.com/q/29630797
score: 0
type: Comment

http://stackoverflow.com/comment/47397587
type: AnswerComment
comment on: http://stackoverflow.com/a/29627053
score: 0
type: Comment
has text: @Navendu After checking the jsFiddle from the OP, I guess this isn't really relevant to his situation. I meant that the inner div has to be a child HTML element of the parent; you can't use CSS to position one div inside another and expect `stopPropagation` to work.

http://stackoverflow.com/comment/47361841
comment on: http://stackoverflow.com/a/29608085
type: Comment
has text: but what is the problem? the link example you gave,is working fine how I see
type: AnswerComment
score: 0

conflict
tag name: conflict
tags question: http://stackoverflow.com/q/29599060
type: Tag

http://stackoverflow.com/q/29581060
has title: .hover() not working in jQuery
has body: I tried to create a jQuery function .hover to change the background-color of div by using another class and using hover to addClass and removeClass. HTML: Untitled 1 HOME ABOUT CONTACT CSS: div { display:inline; font-family: Helvetica; color: white; background-color:#FF6666; padding: 20px; } .hltd { display:inline; font-family: Helvetica; color: black; background-color:#66FF33; padding: 20px; } Javascript: $(document).ready(function(){ $('div').hover( function(){ $(this).addClass('hltd'); }, function(){ $(this).removeClass('hltd'); } ); });
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/29581076
has answer: http://stackoverflow.com/a/29581101
answer count: 4
tagged with: hover
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29581076
has answer: http://stackoverflow.com/a/29581085
type: Question
has answer: http://stackoverflow.com/a/29581104
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/29581085
tagged with: jquery

http://stackoverflow.com/a/29625347
score: 1
answers question: http://stackoverflow.com/q/29625167
type: Answer
upvote count: 1
has body: Oversimplifying, functions are something we can pass around, like anything else. We can pass parameters that are numbers, functions, strings, etc. Take a look at this: // We'll just call the function passed in our function // This is essentially a callback that does no work before // calling the callback. function call_function(f) { return f(); } var func = function(s) {console.log('func was called');} var notAFunc = 42; call_function(func); // func was called call_function(notAFunc); // TypeError: number is not a function The TypeError is the same as trying to call 42 as a function (because that's all we're doing): 42() // TypeError: number is not a function The basics are that JavaScript doesn't do anything extra special to know if a callback you're passing is a function or not. At some point it will try to call the function, which may or may not result in an error. EDIT Xufox noted in a comment that the type of the paramenter could be checked, something like this: function call_function(f) { if (typeof f === 'function') { return f(); } } It's good to keep that in mind, but that has nothing to do with the engine, it's up to the programmer to do that kind of sanity checking.
downvote count: 0

http://stackoverflow.com/q/29545506
has body: I am working on a chrome extension project and i'm trying to upload photo to an facebook album but it always returns the following response no matter which image i try to upload. { "error": { "message": "This message contains content that has been blocked by our security systems.", "type": "OAuthException", "code": 368 } } Here is my code: var canvas = document.createElement('CANVAS'); var ctx = canvas.getContext('2d'); var img = new Image; img.crossOrigin = 'Anonymous'; img.onload = function(){ canvas.height = img.height; canvas.width = img.width; ctx.drawImage(img,0,0); var dataURL = canvas.toDataURL( 'image/png'); blob = dataURItoBlob(dataURL); goon(blob); canvas = null; }; img.src = "image url"; function dataURItoBlob(dataURI) { var byteString = atob(dataURI.split(',')[1]); var ab = new ArrayBuffer(byteString.length); var ia = new Uint8Array(ab); for (var i = 0; i &lt; byteString.length; i++) { ia[i] = byteString.charCodeAt(i); } return new Blob([ab], { type: 'image/png' }); } function goon(kkv){ var formdata= new FormData(); formdata.append("access_token", "Acces token"); formdata.append("message", "test message"); formdata.append("source", kkv); formdata.append("privacy", "{'value':'EVERYONE'}"); try { $.ajax({ url: 'https://graph.facebook.com/me/photos', type: "POST", data: formdata, processData: false, contentType: false, cache: false, error: function (shr, status, data) { console.log("error " + data + " Status " + shr.status); }, success: function (msg) { //successful } }); } catch (e) { console.log(e); } } I am using facebook graph api v2.3 to get access token( with extended permissions) I have tried to use url parameter insted of source but it gave me the same response formdata.append("url", 'image url'); Is there any way to do this without access token, i wanna use it just for my facebook account on my computer.If not, how can i get rid of this error ?
type: Question
has answer: http://stackoverflow.com/a/29551291
tagged with: javascript
has title: javascript- facebook uploading photo
answer count: 1
tagged with: facebook-graph-api
type: UnansweredQuestion
tagged with: facebook
score: 0

http://stackoverflow.com/comment/47322614
comment on: http://stackoverflow.com/q/29584741
type: Comment
has text: Ok guys thanks for your answer I have the IDE set correctly as for jshint option. What I forgot to say is I created the file as scratch using as well the options ecma6... I created a real file with the same content and it works it seems that only the scratch function failing...
score: 0
type: QuestionComment

http://stackoverflow.com/comment/47436999
has text: Try `[1, 2, 3]` and `[3, 2, 1]`. OP wants `true` for this case.
comment on: http://stackoverflow.com/a/29648565
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47591709
comment on: http://stackoverflow.com/a/29664757
score: 0
type: AnswerComment
has text: That's because of the browser prefix issues. I just opened the -prefix-free option in the same codepen and now it should work in Safari (and other browsers too). Do notice that if you are going to use CSS3 properties, you'll have to include prefix for those rules. You may try [autoprefixer](https://www.npmjs.com/package/gulp-autoprefixer) (for gulp) or [Compass](http://compass-style.org/reference/compass/css3/) (for sass) to lessen this tedious work.
type: Comment

http://stackoverflow.com/a/29616984
upvote count: 2
type: Answer
has body: Just add your new function call as a separate statement: if (window.total_time &lt;= window.cutOffTime) { tos = TrackingLogTime(tos.split(":").reverse()); ga("send", "event", "Time", "Log", tos); ga("newTracker.send", "event", "Time", "Log", tos); } else { window.clearInterval(window.stIntervalObj); }
has comment: http://stackoverflow.com/comment/47378950
score: 2
accepted answer of: http://stackoverflow.com/q/29616972
answers question: http://stackoverflow.com/q/29616972
downvote count: 0
type: AcceptedAnswer

http://stackoverflow.com/q/29675606
has comment: http://stackoverflow.com/comment/47489459
tagged with: angularjs
has answer: http://stackoverflow.com/a/29676303
has title: angularjs - ng-include dynamic position
type: UnansweredQuestion
type: Question
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/47490945
has comment: http://stackoverflow.com/comment/47489273
has body: There are 8 divs positioned as 4 per row. When i click on any of the first 4 divs my dynamic template ( via ng-include ) should be placed after 4th div. And when i click on any of next 4 divs dynamic template should be placed after 8th div. I dont know how to do this in angularjs. Should i use jquery for dom manipulation to find the clicked div position index and then create the ng-include div to place the content? Here's what i tried with jquery and angularjs. {{college.name}} and my controller code app.controller("collegeCtrl", function($scope){ $scope.colleges = [ {name:'...', logo:'...', viewname:'...'}, /*.... and 7 more ....*/ ]; $scope.goToView = function(viewname){ $('div.placeHolderDiv').remove(); var stepBlock = $('.stepBlock'); var stepPos = this.$index; var placeHolderDiv = stepBlock.eq(stepPos < 4 ? 3 : stepBlock.length-1); var _view = $(' '); var _compiled = $compile(_view)($scope); _compiled.insertAfter(placeHolderDiv).hide().fadeIn(); }; $scope.onViewLoad = function(){ alert('view loaded'); }; }); Update : i've managed to create a Plunker ( sorry, i'm not good at CSS but you will get the idea) Is this something hard to do with angular only?
answer count: 1

http://stackoverflow.com/comment/47461956
comment on: http://stackoverflow.com/a/29661024
has text: I am aware that if my variable is global, on post back this value could change and I did try using hiddenfields(forgot to mention that), but you can't access hiddenfields or any other control inside a method that it's called by the Object data source. Everytime I did, got null.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/47270079
comment on: http://stackoverflow.com/a/29559590
score: 0
type: AnswerComment
has text: Although this method works nicely, trying not to rewrite all the bootstrap compatible collapse and redo my active method, was hoping there was an easy method of collapsing using bootstrap backend...
type: Comment

http://stackoverflow.com/comment/47418437
type: Comment
comment on: http://stackoverflow.com/a/29636671
has text: I didn't clarify that this is a content script. [This thread](http://stackoverflow.com/questions/10667178/chrome-tabs-create-is-giving-an-error-uncaught-typeerror-cannot-call-method) says that content scripts can't access any extension APIs except for parts of [chrome.extension](https://developer.chrome.com/extensions/extension). When I run this, it gives me this error: `Cannot read property 'create' of undefined`
score: 0
type: AnswerComment

http://stackoverflow.com/q/29684145
has answer: http://stackoverflow.com/a/29684272
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/29685751
has body: My news website serves 3 types of content: articles, videos and tweets. I load one or all of these content types based on a received parameter. So: switch(param){ case 'articles': loadArticles(); break; case 'videos': loadVideos(); break; case 'tweets': loadTweets(); break; default: loadArticles(); loadVideos(); loadTweets(); break; } I am using NProgress to give the user the illusion of progress. How do I set progress values in loadArticles(), loadVideos() and loadTweets() to mimic progress? EDIT: Each of these functions have their respective factory calls (each of which have their own $http.get()). E.g.: articleFactory.getArticles().then(function(data){$scope.articles = data;})
answer count: 3
tagged with: asynchronous
favorite count: 0
has answer: http://stackoverflow.com/a/29684236
tagged with: angularjs
type: UnansweredQuestion
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/47505285
has comment: http://stackoverflow.com/comment/47505386
type: Question
has title: How do I know if a group of async functions have completed executing?

http://stackoverflow.com/comment/47431163
has text: I would say: Just debugging it a little bit should help. Deactivate the scripts step by step to figure out what script blocks your screen from showing up. Did you try to bind an onload to the body with a div which hovers the full screen and displays a loading image?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/29644612
type: QuestionComment

http://stackoverflow.com/a/29684827
upvote count: 1
score: 1
downvote count: 0
type: Answer
has body: You forgot a period. It should be: d.getHours() &gt;= 21 et cetera. :)
answers question: http://stackoverflow.com/q/29684772

http://stackoverflow.com/comment/47216081
type: QuestionComment
score: 0
has text: @BenedictRuban refer my answer there no id required you can get element using $(this) and with reference to parent easily in jquery
comment on: http://stackoverflow.com/q/29530564
type: Comment

http://stackoverflow.com/a/29541606
has comment: http://stackoverflow.com/comment/47236049
accepted answer of: http://stackoverflow.com/q/29541409
has comment: http://stackoverflow.com/comment/47235212
has comment: http://stackoverflow.com/comment/47236864
upvote count: 5
has body: Give this a shot: var x = document.querySelector('#x'); var initialWidth = x.clientWidth; window.onresize = function() { //Be careful about calculating too many things in the resize handler! //This isn't that intensive, so it shouldn't matter, but look into "debouncing" if you have things like this elsewhere initialWidth = x.clientWidth; }; document.getElementById("a").onclick = function() { x.style.width = x.clientWidth - (initialWidth * 0.01) + "px"; }; nav#control { display: flex; flex-basis: 50px; align-items: center; justify-content: center; background: #FFF; padding: 5px; width: 100% } .knob { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; cursor: pointer } #b { position: relative; flex-grow: 1; background: #EFEFEF; margin: 0 10px; height: 30px } #x { position: absolute; background: #4C8EFA; width: 100%; height: 30px; border-radius: 1px; z-index: 2 } #c { display: flex; align-items: center; justify-content: center; height: 30px; } background This uses clientWidth to get the real width of the element (in terms of pixels), takes 1% off that number, then reset the number back to pixels again. Explanation: In your original code, you were trying to access style.width of #x. Since this is a percentage, and not a static value, this will actually return nothing. Luckily, we can get the rendered width of the element with Javascript's clientWidth property. Using this, we can find the real size of the bar, and calculate the new values from that. It also might be possible to directly inject the CSS with insertRule - but I don't see any problems with the clientWidth solution. EDIT: Use @jwatts1980's solution from the comments: http://jsfiddle.net/a9okwLd1/1/
answers question: http://stackoverflow.com/q/29541409
type: Answer
has comment: http://stackoverflow.com/comment/47236691
downvote count: 0
has comment: http://stackoverflow.com/comment/47235051
score: 5
has comment: http://stackoverflow.com/comment/47235674
has comment: http://stackoverflow.com/comment/47235306
has comment: http://stackoverflow.com/comment/47235216
type: AcceptedAnswer

http://stackoverflow.com/a/29704315
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/29650402
downvote count: 0
type: Answer
has body: Your base interface can define properties as optional: interface ISuccessResponse { Success?: boolean; Message?: string; } interface IAppVersion extends ISuccessResponse { OSVersionStatus: number; LatestVersion: string; } class MyTestClass implements IAppVersion { LatestVersion: string; OSVersionStatus: number; }

http://stackoverflow.com/comment/47387780
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/29621575
has text: after see your ajax response you already call rating function . so no need to add in ajax complete .
score: 0

http://stackoverflow.com/a/29607405
answers question: http://stackoverflow.com/q/29607189
accepted answer of: http://stackoverflow.com/q/29607189
type: AcceptedAnswer
has body: var image = document.getElementById('yourImagesId'); var date = new Date(); var url = 'site.com/files/' + date.getFullYear() + '/' + (date.getMonth() +1) + '/' + date.getDate() + '/img1.jpg'; image.setAttribute('src',url);
type: Answer
score: 0

http://stackoverflow.com/comment/47456471
comment on: http://stackoverflow.com/a/29658085
type: AnswerComment
score: 0
type: Comment
has text: Still have `undefined` in output. `'"quoted phrase" followed by text'.match(/"([^"]*)"|(^\w+)/) ==> ['"quoted phrase"', "quoted phrase", undefined]`

http://stackoverflow.com/comment/47345066
type: QuestionComment
comment on: http://stackoverflow.com/q/29599101
has text: What you mean exactly by Processing data ?
score: 0
type: Comment

http://stackoverflow.com/comment/95800735
comment on: http://stackoverflow.com/a/46477864
has text: Yes, but I do not see any advantage at that. Because you have to know the app-path, where you can save a file, as well.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/29617742
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/29617775
has comment: http://stackoverflow.com/comment/47380573
favorite count: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/29617775
tagged with: css
has comment: http://stackoverflow.com/comment/47380397
possible better answer: http://stackoverflow.com/a/29617822
has comment: http://stackoverflow.com/comment/47381266
has comment: http://stackoverflow.com/comment/47380437
has answer: http://stackoverflow.com/a/29617822
has comment: http://stackoverflow.com/comment/47380340
has answer: http://stackoverflow.com/a/29617837
upvote count: 1
has body: Situation I have a lot of btns that I want to hide. I kind of get them to hide, but not exactly as I intentionally want. They are flashing very fast while my page is loading. I'm struggling trying to hide them. Steps I took First, I used hide() jQuery function to do that. I liked it, but then I notice all those btns is flashing during page load. #Curious ??? Second, I learned that .css("display","none"); is faster than hide() so I tried that, and I still get the same result, maybe it faster, but I still see the flashing. Third, some people claim that .attr('disabled', true); is even faster, and YES I've tried that, and that is not even working at all. .attr('disabled', true); might be outdated, then I use the most current one .prop('disabled', true); , and that still still not working ! I'm completely clueless now. I hope someone can help me put an end to this. What is the most efficient way to hide element completely from your page ?
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/47380331
has comment: http://stackoverflow.com/comment/47380540
has title: What is the most efficient way to hide element completely from your page?
type: Question
has comment: http://stackoverflow.com/comment/47380332

http://stackoverflow.com/a/29597664
answers question: http://stackoverflow.com/q/29597136
upvote count: 1
accepted answer of: http://stackoverflow.com/q/29597136
score: 1
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: get https://angular-ui.github.io/bootstrap/ once you do, in your code make sure angular.module('myModule', ['ui.bootstrap']); and for typeahead have &lt;input type="text" ng-model="currentProvider" typeahead="provider for provider in getProviders($viewValue) | limitTo:8" class="form-control"&gt; In your controller make sure you have $scope.getProviders = function(val){ return $http.get('/search/providers/?query=' + val).then(function(response){ return response.data; }) } This should do the trick although I haven't tested

http://stackoverflow.com/comment/47440801
comment on: http://stackoverflow.com/a/29646994
has text: When your code is `uglified` or `minified` the function parameter `$http` will be replaces with something like: `a`. Angular will not know what service to inject at this point. That is where `$inject` comes in. This is typically only an issue that is seen once code is shipped to QA or PROD.
type: AnswerComment
score: 3
type: Comment

http://stackoverflow.com/comment/47217852
comment on: http://stackoverflow.com/q/29532279
score: 0
type: Comment
type: QuestionComment
has text: can you provide plunker/fiddle?

http://stackoverflow.com/comment/47427428
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/29643113
has text: @Pratik No i want to send the whole HTML. including any input a user may have entered

google-chrome-app
tags question: http://stackoverflow.com/q/29568543
type: Tag
tags question: http://stackoverflow.com/q/29532697
tags question: http://stackoverflow.com/q/29617092
tags question: http://stackoverflow.com/q/29574916
tag name: google-chrome-app

http://stackoverflow.com/q/29546010
answer count: 1
tagged with: dojo
type: AnsweredQuestion
type: Question
has body: I have a dojo method to make an xhrRequest to get the latest list of items from DB and i do it periodically using setInterval(). Is there any other better way without using setInterval() that would automatically update the Memory store whenever a new item is added to the DB?.. The current code is below &lt;div data-dojo-type="dojo/store/Memory" data-dojo-id="dataStore"&gt; &lt;script type="dojo/method"&gt; var myStore = this; setInterval(function(){ require(["dojo/request/xhr"], function(xhr){ xhr("myurl", { handleAs: "json" }).then(function(data){ if (data &amp;&amp; data.length &gt; 0) { myStore.setData(data); } }, function(err){ // Handle the error condition }, function(evt){ // Handle a progress event from the request if the // browser supports XHR2 }); }); }, 2000); &lt;/script&gt; &lt;/div&gt;
has title: Dojo Memory Store Periodic Refresh
has answer: http://stackoverflow.com/a/29554313
accepted answer: http://stackoverflow.com/a/29554313
tagged with: javascript
score: 0

http://stackoverflow.com/q/29641088
has answer: http://stackoverflow.com/a/29641431
type: AnsweredQuestion
score: 1
has title: Stop page element to load
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/47423908
has comment: http://stackoverflow.com/comment/47424284
accepted answer: http://stackoverflow.com/a/29641431
tagged with: javascript
has body: Is there any way to programatically stop particular page element to load. For example stop a div to load or a praticular image to load from the google chrome console using the dom.
tagged with: dom
answer count: 1
downvote count: 0
tagged with: console
favorite count: 0