http://stackoverflow.com/comment/45979860
comment on: http://stackoverflow.com/q/28856676
has text: there are "2" couse if it is not equal value it gets new value and if somewhere is the same value then the other get also "2" but if not then it gets also new value
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28874942
has comment: http://stackoverflow.com/comment/46012617
has comment: http://stackoverflow.com/comment/46012523
has comment: http://stackoverflow.com/comment/46012731
has answer: http://stackoverflow.com/a/28876326
has comment: http://stackoverflow.com/comment/46013979
linked to: http://stackoverflow.com/q/28854771
has comment: http://stackoverflow.com/comment/46012398
has answer: http://stackoverflow.com/a/28878103
type: Question
has comment: http://stackoverflow.com/comment/46013495
has title: How to call javascript function from javascript
has answer: http://stackoverflow.com/a/28876210
has comment: http://stackoverflow.com/comment/46012611
has comment: http://stackoverflow.com/comment/46012848
score: 0
linked to: http://stackoverflow.com/q/6867003
has comment: http://stackoverflow.com/comment/46014350
has body: I am stucked in the middle of my code and need help. I am creating a web application using jsp. Here is my code: <%@include file="dbconnection.jsp"%> <TITLE> <%ResultSet resultset = statement.executeQuery("select title from Books;") ;%> <% int counter=0; while(resultset.next()){ String result=resultset.getString(1); counter++; %> <a href="javascript:showdata(<%=counter%>)"><%=result%> <% } %> When i click on a particular link then showdata function gets called after that i am clicking on another link for which the code is written inside showdata() to call Nextdata() function. But this Nextdata function doesn't get called why so? where is my mistake? Please help.
has comment: http://stackoverflow.com/comment/46014125
has comment: http://stackoverflow.com/comment/46012201
answer count: 4
has comment: http://stackoverflow.com/comment/46013100
has comment: http://stackoverflow.com/comment/46014103
has comment: http://stackoverflow.com/comment/46012684
has answer: http://stackoverflow.com/a/28875227
tagged with: jsp
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/q/28830040
answer count: 2
has answer: http://stackoverflow.com/a/28831569
accepted answer: http://stackoverflow.com/a/28832163
has title: Polymer built-in way to use "sub-pages" and core-submenu?
has body: I'm trying to create a page with core-submenu (and therefore also "subpages" (not a real component)). But as I've seen around the web there's a "problem" with this, since a press on a core-submenu item will trigger the selected event even though naturally one only want it triggered when a child element is pressed on. I found this link which explain a method to achieve what I want, but this approach relies on ids on all the pages and core-submenu childs. I have no need to "loop"-generate my menu. By not using core-submenu everything is working without even the slightest javascript-code. Is there some built-in support for core-pages and core-submenu that can be used? In otherwords: A way that does not require any (or minimal) use of javascript? . . //some code here . . . //some code here . Hello content World content . . //some code here . Thank you!
possible better answer: http://stackoverflow.com/a/28831569
type: AnsweredQuestion
score: 0
has answer: http://stackoverflow.com/a/28832163
type: Question
tagged with: polymer
linked to: http://stackoverflow.com/q/26162227
tagged with: javascript

http://stackoverflow.com/a/28903066
answers question: http://stackoverflow.com/q/28902681
upvote count: 2
type: AcceptedAnswer
has body: Reading about handwriting recognition software it seems that the early phases such a recognising the strokes might be helpful. Decompose the gesture into a number of elements (lines or curves) then apply some matching algorithms.
type: Answer
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28902681

http://stackoverflow.com/comment/46062356
comment on: http://stackoverflow.com/a/28865494
type: Comment
has text: $(this) is nowhere, it's not in any of the expressions that you listed. It's just been written at the very beginning of the JavaScript file. As above answered, I think it refers to window.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46055115
comment on: http://stackoverflow.com/q/28897788
has text: Everything is right guys. The js folder is relative to the html file. The syntax is correct. Even in developer source it shows the scripts. It just doesn't run.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28781497
has answer: http://stackoverflow.com/a/28782168
type: Question
tagged with: momentjs
has body: I'm working on a chat app and I want to display the date and time of the each message sent my flow is like this 1) when user clicks on send button, I'm calling server method with the message as param In the server method 1) I'm getting the date using var d = new Date(); which is storing something like "Sat Feb 28 2015 17:33:20 GMT+0200 (EET)" In every browser I want to display this time according to their timezones, how to do this? I've moment package installed too.
score: 0
tagged with: date
has comment: http://stackoverflow.com/comment/45839807
answer count: 1
has comment: http://stackoverflow.com/comment/45839882
has title: recommended way of storing date and displaying them in client
has comment: http://stackoverflow.com/comment/45840021
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45839836

jhipster
tag name: jhipster
tags question: http://stackoverflow.com/q/28773327
type: Tag

http://stackoverflow.com/a/29443446
type: Answer
has body: Works for me, I would ask you to try these few changes. Remove the ui.bootstrap module, that is not required. To set attributes to your ace editor, add a variable to the $scope like this, $scope.aceOptions = { theme: 'tomorrow_night_eighties', mode: 'html', useWrapMode : true } Doing this you can easily add various properties to the ace editor. Now in your DOM(HTML code), include ace editor using following code. &lt;div ui-ace="aceOptions" ng-trim="true"&gt;&lt;/div&gt; This will initialize your ace editor. Works well for me. Hope this helps you.
score: 0
answers question: http://stackoverflow.com/q/28865153

http://stackoverflow.com/comment/66024841
has text: @Roamer-1888: The problem is that you must make the `catch` conditional, otherwise it swallows all exceptions. See vilicvane's answer which does that with `BreakSignal`.
comment on: http://stackoverflow.com/a/28832276
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28775457
tagged with: jquery
has title: Convert jquery function to js
downvote count: 2
answer count: 1
favorite count: 0
type: AnsweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/28775508
accepted answer: http://stackoverflow.com/a/28775508
has body: can somebody help me with converting following code to plain js $(function() { var wheight = $(window).height(); //get height of the window $('.fullheight').css('height', wheight); $(window).resize(function() { var wheight = $(window).height(); $('.fullheight').css('height', wheight); }); });
type: Question
score: -2
tagged with: javascript

mongodb
tags question: http://stackoverflow.com/q/28899524
tags question: http://stackoverflow.com/q/28775051
tags question: http://stackoverflow.com/q/28824411
tags question: http://stackoverflow.com/q/28781541
tags question: http://stackoverflow.com/q/28849237
tags question: http://stackoverflow.com/q/28769936
tags question: http://stackoverflow.com/q/28837595
tags question: http://stackoverflow.com/q/28789058
tags question: http://stackoverflow.com/q/28897151
tags question: http://stackoverflow.com/q/28882552
tags question: http://stackoverflow.com/q/28889824
tags question: http://stackoverflow.com/q/28772187
tags question: http://stackoverflow.com/q/28891980
tags question: http://stackoverflow.com/q/28872291
tags question: http://stackoverflow.com/q/28891264
tags question: http://stackoverflow.com/q/28812948
tag name: mongodb
tags question: http://stackoverflow.com/q/28867550
tags question: http://stackoverflow.com/q/28837259
tags question: http://stackoverflow.com/q/28756864
tags question: http://stackoverflow.com/q/28784524
tags question: http://stackoverflow.com/q/28836674
tags question: http://stackoverflow.com/q/28836120
tags question: http://stackoverflow.com/q/28900545
tags question: http://stackoverflow.com/q/28892379
tags question: http://stackoverflow.com/q/28825011
tags question: http://stackoverflow.com/q/28852745
tags question: http://stackoverflow.com/q/28822557
tags question: http://stackoverflow.com/q/28798882
tags question: http://stackoverflow.com/q/28763954
tags question: http://stackoverflow.com/q/28807546
tags question: http://stackoverflow.com/q/28866930
tags question: http://stackoverflow.com/q/28902685
type: Tag
tags question: http://stackoverflow.com/q/28855790
tags question: http://stackoverflow.com/q/28814293
tags question: http://stackoverflow.com/q/28777907
tags question: http://stackoverflow.com/q/28785700
tags question: http://stackoverflow.com/q/28905263
tags question: http://stackoverflow.com/q/28804904
tags question: http://stackoverflow.com/q/28794251
tags question: http://stackoverflow.com/q/28885943
tags question: http://stackoverflow.com/q/28802125
tags question: http://stackoverflow.com/q/28804588
tags question: http://stackoverflow.com/q/28844354
tags question: http://stackoverflow.com/q/28843646
tags question: http://stackoverflow.com/q/28802133
tags question: http://stackoverflow.com/q/28818256
tags question: http://stackoverflow.com/q/28811905
tags question: http://stackoverflow.com/q/28891876
tags question: http://stackoverflow.com/q/28849936
tags question: http://stackoverflow.com/q/28807426
tags question: http://stackoverflow.com/q/28845053
tags question: http://stackoverflow.com/q/28874334
tags question: http://stackoverflow.com/q/28887304
tags question: http://stackoverflow.com/q/28890752
tags question: http://stackoverflow.com/q/28848840
tags question: http://stackoverflow.com/q/28868152
tags question: http://stackoverflow.com/q/28855396
tags question: http://stackoverflow.com/q/28815720
tags question: http://stackoverflow.com/q/28770373
tags question: http://stackoverflow.com/q/28813103
tags question: http://stackoverflow.com/q/28838307
tags question: http://stackoverflow.com/q/28823428
tags question: http://stackoverflow.com/q/28782783

http://stackoverflow.com/comment/46069656
type: AnswerComment
comment on: http://stackoverflow.com/a/28904663
score: 0
type: Comment
has text: This makes sense as to why I'm having trouble accessing its prototype. After youre help I figured out I could then set `Object.defineProperty($.fn,'letter',{enumerable:false})` So I am now closer to my goal +1

http://stackoverflow.com/comment/45960150
type: AnswerComment
has text: To me it's dead simple. I converted the hard part to a function for you so it can be somewhat self-documenting.
comment on: http://stackoverflow.com/a/28845721
type: Comment
score: 1

http://stackoverflow.com/q/28805935
has title: jquery mobile, call transition from event
answer count: 1
tagged with: jquery-mobile
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28806013
type: AnsweredQuestion
score: 0
has body: To have JQM apply a transition on a link, we use the following: I'll pop How do I call a transition form a custom event? I use: window.location.href = href; to navigate from my custom event. I can't seem to find anything on the reference material, except for the markup.
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28806013

http://stackoverflow.com/a/28804885
has comment: http://stackoverflow.com/comment/45883019
has body: I tested now in Google Chrome Version 40.0.2214.115 and It is working great. What version of chrome you used for testing ?
downvote count: 0
has comment: http://stackoverflow.com/comment/45882961
has comment: http://stackoverflow.com/comment/45883505
accepted answer of: http://stackoverflow.com/q/28804829
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28804829
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/q/28754748
type: Question
has title: ExtJS auto width layout with composite field
tagged with: javascript
tagged with: extjs
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28759181
type: UnansweredQuestion
has body: Using ExtJS 4.2.1 I'm trying to add a 'composite' control to my Form Panel that consists of a textfield and a button next to it (which will invoke a lookup dialog). I've implemented this as follows: Ext.onReady(function () { Ext.create('Ext.form.Panel', { renderTo: Ext.getBody(), defaults:{ anchor:'100%', border: 0 }, items: [{ xtype: 'textfield', fieldLabel: 'foo' }, { xtype: 'panel', layout:'hbox', items: [{ xtype: 'textfield', fieldLabel: 'bar' }, { text: '...', xtype: 'button' }] }] }); }); The problem I have is in terms of Layout. I want the 'bar' textfield to shrink/grow to fill the available width of the form, but it's currently maxing out at a fixed width, even when the 'foo' textfield extends correctly across the width of the form Please advise the correct layout settings? jsFiddle

http://stackoverflow.com/q/28862516
type: Question
tagged with: bookshelf.js
tagged with: javascript
has title: Express.js - foreach array of data and store them in the database
has comment: http://stackoverflow.com/comment/45990353
has comment: http://stackoverflow.com/comment/45990349
answer count: 2
has answer: http://stackoverflow.com/a/28863518
linked to: http://stackoverflow.com/q/28478606
upvote count: 1
favorite count: 0
tagged with: promise
has comment: http://stackoverflow.com/comment/45990613
tagged with: node.js
has answer: http://stackoverflow.com/a/28878270
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28878270
has body: I'm using expressjs, bookshelf.js and I want to post array of data, foreach such data and save it. I'm not exactly sure where the issue is (express, bookshelf or just plain old javascript), but here's the scenario: when I post the said array and try to iterate through it, I get the correct amount of saves into the database, but all have the value of the last item in array. Here's the code: router.post('/save/', function(req, res){ var data = req.body; var result = []; for (var i in data) { var d = data[i]; if (d.user_id == -1) d.user_id = null; new Term().where({'date_of_driving': d.day}) .fetch() .then(function(terms){ if (terms != null) { return new Term({'id':terms.id}).save(d).then(function(item_updated){}); } else { return new Term().save(d).then(function(item_saved){}); } }) .catch(function(error){ console.log(error); }); } res.send({'saved': 'ok'}); }); My understanding is, that these calls are asynchronous and always operate on the last data, because for sentence is quicker than save. Am I onto something? What are some of the best, easiest and most correct solutions to this problem?
tagged with: bluebird
downvote count: 0
possible better answer: http://stackoverflow.com/a/28863518
score: 1

http://stackoverflow.com/q/28755645
has answer: http://stackoverflow.com/a/28755674
answer count: 1
accepted answer: http://stackoverflow.com/a/28755674
has comment: http://stackoverflow.com/comment/45792674
has comment: http://stackoverflow.com/comment/45792768
favorite count: 0
has comment: http://stackoverflow.com/comment/45792808
has title: What does 0 mean in indexOf?
has body: While I am writing some JavaScript, I came across a new code "indexOf". After read another post I thought its behaviour is as shown below but it seems not true. Can someone kindly give me an explanation about "indexOf", please? false = -1; true = 0 and more? I have tried to change -1 to 0 and more but then nothing happens. Just to have a better understanding about jquery/indexOf. what I have now, $(this).closest(row)[td_word.indexOf(keyword) !== -1 ? 'show' : 'hide'](); it search for match(es) of "keyword" from "td_word", if it is not false (!== -1, thus true) display:visible;, if it is not true (false) display:hide;. Thanks in advance.
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45792648
score: 1
downvote count: 3
linked to: http://stackoverflow.com/q/19683295
type: Question
upvote count: 4
has comment: http://stackoverflow.com/comment/45792829
tagged with: javascript
has comment: http://stackoverflow.com/comment/45792677

http://stackoverflow.com/comment/45863283
has text: `$dateSelect` should be an integer value, not an a array.
type: AnswerComment
comment on: http://stackoverflow.com/a/28790613
score: 0
type: Comment

http://stackoverflow.com/comment/45827306
type: QuestionComment
score: 1
has text: Have you tried other methods of communicating with local programs like web socket?
comment on: http://stackoverflow.com/q/28774487
type: Comment

http://stackoverflow.com/comment/46352742
comment on: http://stackoverflow.com/a/29055405
type: AnswerComment
has text: Thank you. How to make it to work in FireFox also, where to add try/catch ?. How to send all information which is returned in any browser ? According to your answer, chrome returns name also, how to log this ? This shoudl be common requirement, where to find generic onerror handler which logs maximum information from any browser ? I can try to create it according to your answer but I expect that this is already created.
score: 0
type: Comment

http://stackoverflow.com/comment/45896514
score: 0
comment on: http://stackoverflow.com/q/28812240
type: Comment
type: QuestionComment
has text: yes i have the image moving down the canvas using a simple for loop and maxY property of the image. However the image appears straight away without a delay of 5 seconds.

http://stackoverflow.com/comment/102093117
comment on: http://stackoverflow.com/a/54159564
type: AnswerComment
type: Comment
has text: @Rubanov, thanks. I adjusted the code per your suggestion.
score: 0

http://stackoverflow.com/a/28863636
type: Answer
answers question: http://stackoverflow.com/q/28862923
score: 0
has body: sendResponse(function) becomes invalid when the event listener returns, unless you return true from the event listener to indicate you wish to send a response asynchronously (this will keep the message channel open to the other end until sendResponse is called). See the reference: onMessage. Because sendResponse is called asynchronously in chrome.storage.sync.get's callback, you need to return true from the onMessage listener to prevent the function from being invalidated. Code similar is Like: chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) { if (request.message === 'loadconfig') { sendResponse(loadStuff()); return true; } return false; });

http://stackoverflow.com/a/28852191
downvote count: 0
type: Answer
score: 2
upvote count: 2
has body: They are nearly the same, Canvas is an HTML element that you can use, which requires JS to run. Other options would be using SVG or HTML DOM for the view elements. So Canvas is not the same as JS games but a tool which you can use in your JS games ;).
answers question: http://stackoverflow.com/q/28851992

http://stackoverflow.com/q/28886833
favorite count: 0
upvote count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46035086
has title: Add values to database on button click
tagged with: php
has comment: http://stackoverflow.com/comment/46037073
has comment: http://stackoverflow.com/comment/46034955
type: Question
has answer: http://stackoverflow.com/a/28886948
has comment: http://stackoverflow.com/comment/46035141
has comment: http://stackoverflow.com/comment/46035157
tagged with: javascript
score: -7
tagged with: http://stackoverflow.com/tag/html
has body: Hello I made a code to enter the values from the input text into the databse but it add an empty values in the database Register <?php $servername = ""; $username = "root"; $password = "ahmed2001"; $db = "html"; $conn = mysqli_connect($servername, $username, $password, $db); if(!$conn) { die("Connection failed: " . mysqli_connect_error()); } ?> Is there anyway to do it without usin jQuery ?
answer count: 1
downvote count: 7

http://stackoverflow.com/q/28825310
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/45921508
has title: how to print or get an array that sent from jquery to php file Wordpress
tagged with: wordpress
has comment: http://stackoverflow.com/comment/45921967
tagged with: php
linked to: http://stackoverflow.com/q/13276583
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45921558
has body: I want to send an array generated in jQuery to a php file. I get stuck on this. I tried several way but no luck. I want to echo/print_r the array in php file. Experts give me your kind look. My code is given below : js: &lt;script&gt; jQuery(document).ready(function($){ url = '&lt;?php echo includes_url().'cs_cause.php'; ?&gt;'; var allVals = []; $('#deleteProduct').click(function(){ $('.delete-product:checked').each(function() { allVals.push($(this).val()); }); $.post(url,{ array : allVals }, function(response,status){ alert( response+ ' ' + status); }); }) }) &lt;/script&gt; php : &lt;?php if($_POST['array']) { $r = $_POST["array"]; print_r($r); } ?&gt;
has comment: http://stackoverflow.com/comment/45921676
has answer: http://stackoverflow.com/a/28825703
type: Question
answer count: 1
tagged with: arrays
accepted answer: http://stackoverflow.com/a/28825703
tagged with: javascript
has comment: http://stackoverflow.com/comment/45921933

http://stackoverflow.com/comment/46066075
score: 0
type: AnswerComment
has text: I am not aware that there are errors in the code. I am sure that it should be a java script WordPress compatibility issue. perhaps my s2...variables are duplicated? I am trying plugins for wordpress that allows javascript functionality. Although I assumed that there was already that. Thankyou for your time this afternoon honestly, it has been invaluable.
type: Comment
comment on: http://stackoverflow.com/a/28901336

http://stackoverflow.com/a/28804067
has comment: http://stackoverflow.com/comment/57201339
upvote count: 101
type: Answer
has comment: http://stackoverflow.com/comment/57201301
has body: When No Refresh token is used: 1.While changing password: when the user changes his password, note the change password time in the user db, so when the change password time is greater than the token creation time, then token is not valid. Hence the remaining session will get logged out soon. 2.When User logs out: When the user logs out, save the token in a seperate DB (say: InvalidTokenDB and remove the token from Db when token expires). Hence user logs out from the respective device, his sessions in other device left undisturbed. Hence while invalidating a JWT, I follow the below steps: Check whether the token is valid or not. If valid, check it is present in invalidTokenDB (a database where logged out tokens are stored till their expiry time). If its not present, then check the token created time and changed password time in user db. If changed password time &lt; token created time, then token is valid. Concern with the above method: For each api request, I need to follow all the above steps, which might affect performance. When Refresh token is used: with expiry of access token as 1 day, refresh token as lifetime validity 1. While changing password: When the user changes his password, change the refresh token of the user. Hence the remaining session will get logged out soon. 2. When User logs out: When the user logs out, save the token in a seperate DB (say: InvalidTokenDB and remove the token from Db when token expires). Hence user logs out from the respective device, his sessions in other device left undisturbed. Hence while invalidating a JWT, I follow the below steps: check whether the token is valid or not If valid, check whether the token is present in InvalidTokenDB. If not present, check the refresh token with the refresh token in userDB. If equals, then its a valid token Concern with the above method: For each api request, I need to follow all the above steps, which might affect performance. How do I invalidate the refresh token, as refresh token has no …
has comment: http://stackoverflow.com/comment/69649555
has comment: http://stackoverflow.com/comment/64901984
has comment: http://stackoverflow.com/comment/91134826
downvote count: 5
has comment: http://stackoverflow.com/comment/91134900
has comment: http://stackoverflow.com/comment/61424358
answers question: http://stackoverflow.com/q/28759590
accepted answer of: http://stackoverflow.com/q/28759590
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/91134654
has comment: http://stackoverflow.com/comment/61505049
score: 96

http://stackoverflow.com/comment/45874136
comment on: http://stackoverflow.com/a/28800096
type: AnswerComment
has text: Hmm, keyCommands/moveRight is defined in the ctor. Or is that wrong? I've tried to put all commands in a simple json object
type: Comment
score: 0

ajax
tags question: http://stackoverflow.com/q/28780327
tags question: http://stackoverflow.com/q/28878551
tags question: http://stackoverflow.com/q/28758481
tags question: http://stackoverflow.com/q/28888395
tags question: http://stackoverflow.com/q/28877941
tags question: http://stackoverflow.com/q/28855025
tags question: http://stackoverflow.com/q/28858411
tags question: http://stackoverflow.com/q/28828286
tags question: http://stackoverflow.com/q/28810109
tags question: http://stackoverflow.com/q/28783893
tags question: http://stackoverflow.com/q/28830186
tags question: http://stackoverflow.com/q/28839687
tags question: http://stackoverflow.com/q/28872872
tags question: http://stackoverflow.com/q/28822814
tags question: http://stackoverflow.com/q/28826033
tags question: http://stackoverflow.com/q/28765472
tags question: http://stackoverflow.com/q/28881288
tags question: http://stackoverflow.com/q/28856938
tags question: http://stackoverflow.com/q/28865244
tags question: http://stackoverflow.com/q/28815578
tags question: http://stackoverflow.com/q/28828845
tags question: http://stackoverflow.com/q/28790195
tags question: http://stackoverflow.com/q/28821251
tags question: http://stackoverflow.com/q/28880027
tags question: http://stackoverflow.com/q/28868859
tags question: http://stackoverflow.com/q/28848382
tags question: http://stackoverflow.com/q/28816434
tags question: http://stackoverflow.com/q/28854819
tags question: http://stackoverflow.com/q/28885232
tags question: http://stackoverflow.com/q/28842092
tags question: http://stackoverflow.com/q/28770099
tags question: http://stackoverflow.com/q/28790075
tags question: http://stackoverflow.com/q/28789184
tags question: http://stackoverflow.com/q/28897386
tags question: http://stackoverflow.com/q/28837207
tags question: http://stackoverflow.com/q/28787494
tags question: http://stackoverflow.com/q/28832610
tags question: http://stackoverflow.com/q/28802180
tags question: http://stackoverflow.com/q/28824561
tags question: http://stackoverflow.com/q/28763116
tags question: http://stackoverflow.com/q/28872668
tags question: http://stackoverflow.com/q/28879755
tags question: http://stackoverflow.com/q/28882744
tags question: http://stackoverflow.com/q/28777653
type: Tag
tags question: http://stackoverflow.com/q/28881181
tags question: http://stackoverflow.com/q/28767509
tags question: http://stackoverflow.com/q/28769496
tags question: http://stackoverflow.com/q/28887241
tags question: http://stackoverflow.com/q/28893154
tags question: http://stackoverflow.com/q/28801800
tags question: http://stackoverflow.com/q/28840455
tags question: http://stackoverflow.com/q/28894614
tags question: http://stackoverflow.com/q/28888249
tags question: http://stackoverflow.com/q/28786947
tags question: http://stackoverflow.com/q/28812329
tags question: http://stackoverflow.com/q/28772015
tags question: http://stackoverflow.com/q/28874190
tags question: http://stackoverflow.com/q/28793074
tags question: http://stackoverflow.com/q/28818203
tags question: http://stackoverflow.com/q/28841975
tags question: http://stackoverflow.com/q/28885393
tags question: http://stackoverflow.com/q/28818229
tags question: http://stackoverflow.com/q/28773495
tags question: http://stackoverflow.com/q/28777514
tags question: http://stackoverflow.com/q/28801991
tags question: http://stackoverflow.com/q/28876930
tags question: http://stackoverflow.com/q/28811542
tags question: http://stackoverflow.com/q/28822912
tags question: http://stackoverflow.com/q/28802086
tags question: http://stackoverflow.com/q/28903546
tags question: http://stackoverflow.com/q/28821008
tags question: http://stackoverflow.com/q/28795325
tags question: http://stackoverflow.com/q/28789259
tags question: http://stackoverflow.com/q/28891655
tags question: http://stackoverflow.com/q/28771162
tags question: http://stackoverflow.com/q/28804569
tags question: http://stackoverflow.com/q/28888389
tags question: http://stackoverflow.com/q/28851172
tags question: http://stackoverflow.com/q/28856729

http://stackoverflow.com/q/28799182
tagged with: jasmine
linked to: http://stackoverflow.com/q/9510148
favorite count: 0
type: Question
has body: I am writing a test to see if Array.prototype.map was called. I thought this would work since Array.prototype.map is located on the global window object: it("does not use Array.prototype.map", function(){ spyOn(window, "Array.prototype.map") fn([2,2,3]); expect(Array.prototype.map.calls.count()).toEqual(0); }); I receive the error Array.prototype.map does not exist. When I create my own custom global functions, this method works fine. Based on this other post It appears any global functions can be spied on using the syntax I am using above. If I create my own functions, this syntax works. Any ideas on why Array.prototype.map is returning undefined?
upvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/30474908
tagged with: javascript
type: UnansweredQuestion
has title: Jasmine Create Spy on Native JS Function on Global Window Object
downvote count: 0
score: 1

http://stackoverflow.com/comment/46535993
type: AnswerComment
score: 0
type: Comment
has text: I don't know... but it worked fine in a greasemonkey script for me... are you using the standard @grant GM_addStyle or whatever it is?
comment on: http://stackoverflow.com/a/29057070

http://stackoverflow.com/q/28772839
has comment: http://stackoverflow.com/comment/45832884
favorite count: 0
tagged with: aes
tagged with: ruby
downvote count: 0
has body: For a given project, I'm looking to encrypt a piece of data with AES 256, and then RSA encrypt the key. I've been using Forge and the Encryptor gem in ruby, and i can't seem get matching encryption values: var key = 'strengthstrengthstrengthstrength'; var iv = 'cakecakecakecakecakecakecakecake'; var cipher = forge.aes.createEncryptionCipher(key, 'CBC'); cipher.start(iv); cipher.update(forge.util.createBuffer("some string")); cipher.finish(); var encrypted = cipher.output; console.log(btoa(encrypted.data)); // outputs: CjLmWObDO2Dlwa5tJnRBRw== Then in IRB: Encryptor.encrypt 'some string', :key =&gt; 'strengthstrengthstrengthstrength', :key =&gt; 'cakecakecakecakecakecakecakecake' Base64.encode64 _ # outputs: C9Gtk9YfciVMJEsbhZrQTw==\n Over using string values for Key &amp; IV, tried: var key = forge.random.getBytesSync(32); var iv = forge.random.getBytesSync(32); Then doing a btoa() call on each of them. Using the Base64.decode64 on the ruby side, before passing them to Encryptor.decrypt, but still no luck. Any idea where i've gone wrong?
has answer: http://stackoverflow.com/a/28883073
tagged with: encryption
type: Question
type: AnsweredQuestion
score: 1
has title: Encrypting data with forgejs on the client side, and decrypting with ruby
upvote count: 1
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45827413
accepted answer: http://stackoverflow.com/a/28883073

http://stackoverflow.com/comment/46045123
score: 0
type: QuestionComment
has text: of course not set by mouse click =.=, by a js function
type: Comment
comment on: http://stackoverflow.com/q/28891603

http://stackoverflow.com/a/28753504
answers question: http://stackoverflow.com/q/28753183
downvote count: 0
has comment: http://stackoverflow.com/comment/45826501
has body: $.ajax({ doesn't modify the DOM nor the window.location. It is an asynchronous request, and therefore happens "behind the scenes" so to speak. No navigation takes place, and the page/DOM is not modified without you explicitly doing so. If you want the entire page to refresh, you have a couple of options. Navigation via standard href Make your link point to a valid href so when they user clicks it, they will be navigated. Use javascript as the user modifies selections to modify the href encoding parameters as query string values. You get the "Refresh" effect just by pointing the URL to the same page, but dynamically updating the href as the user makes selections before hitting refresh. When the user clicks the link, the controller should parse the parameters, and return the same page with new filters applied. Refresh Navigation via window.location Keep you as is, but modify your javascript such that instead of making an ajax request, you build a URL as described above, and set it as window.location, causing the page to navigate to the new URL: // assume you build part after ? dynamically var url = '/VerifyAssets/NewCutoffDateInterval?someParameter=someValue'; window.location.href = url; Refreshing partial page If you create an action that returns a partial view, you can refresh a portion of the page by replacing the content of some element with what is returned: success: function (resp) { $('#idOfSomeDiv').html(resp); // replace contents with returned }, If the request points to a partial view, then resp will be the HTML fragment representing the partial view, and we need to take that and insert it somewhere on the page, which is what $('#idOfSomeDiv').html(resp); does. There's lots of nuances to each of these approaches that's covered pretty thoroughly elsewhere, so I'm not going to get into that. Some versions of jquery for example require you parse the response before setting it in the DOM. I'll leave it up to you to research your method of choice further.
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/45827739
upvote count: 1

http://stackoverflow.com/q/28787469
has comment: http://stackoverflow.com/comment/45851193
tagged with: javascript
has comment: http://stackoverflow.com/comment/45851025
has comment: http://stackoverflow.com/comment/45851091
has body: I'm in a bit of a pickle. I have a form in the page. When user makes it dirty and tries to leave the page, a custom modal (mostly bootstrap modal) should pop up with a confirmation message as in "are you sure you want leave?" I made a plunker which uses native browser's alert box (and also bootstrap pop modal). Alert box works - commented out. But modal is not working. http://embed.plnkr.co/6LHacFZhZ74TxmyFY8f8/preview Any help would be greatly appreciated.
downvote count: 0
has comment: http://stackoverflow.com/comment/45850959
favorite count: 0
linked to: http://stackoverflow.com/q/14809686
tagged with: angularjs
has title: Angularjs - How to open custom modal on leaving the page?
tagged with: twitter-bootstrap
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/45851263
answer count: 0
score: 1
type: Question

http://stackoverflow.com/q/28819301
has title: Exchange data between an sql and javascript
favorite count: 0
has body: I am about to learn sql and I have a question.Is it possible to use jquery(or php) to collect data(and add) from an sql database? I would like a detailed answer
type: Question
has answer: http://stackoverflow.com/a/28819721
tagged with: php
score: 0
upvote count: 1
downvote count: 1
accepted answer: http://stackoverflow.com/a/28819721
tagged with: javascript
has comment: http://stackoverflow.com/comment/45910497
type: AnsweredQuestion
tagged with: sql
answer count: 1
has comment: http://stackoverflow.com/comment/45910430
has comment: http://stackoverflow.com/comment/45910970

http://stackoverflow.com/q/28900629
answer count: 6
has answer: http://stackoverflow.com/a/28900803
tagged with: http://stackoverflow.com/tag/html
has body: Hello I have a sign up form which is visible and I am trying to hide it when the page loads. So what I did was to put the whole form in a div class named "signup" and then hide it with a script code. UPDATE: html &lt;script&gt; document.write('&lt;div class="js"&gt;'); &lt;/script&gt; &lt;span class="button"&gt;Sign In&lt;/span&gt; &lt;div id="signup"&gt; &lt;div class="modal-bg"&gt; &lt;div id="modal"&gt; &lt;span&gt;Sign In&lt;a href="#close" id="close"&gt;&amp;#215;&lt;/a&gt;&lt;/span&gt; &lt;form&gt; &lt;input id="username" name="username" type="textbox" placeholder="Username" required&gt; &lt;input id="password" name="password" type="password" placeholder="Password" required&gt; &lt;a id="forgot-link" href="#"&gt;Forgot password?&lt;/a&gt; &lt;button name="submit" id="submit" type="submit"&gt;Sign in&lt;/button&gt; &lt;/form&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;script&gt; document.write('&lt;/div&gt;'); &lt;/script&gt; My JS code (without hide function): $('.button').click(function(){ $('#modal').css('display','block'); $('.modal-bg').fadeIn(); }); $('#close,.modal-bg').click(function(){ $('.modal-bg').fadeOut(); $('#modal').fadeOut(); return false; }); Even though the hide/appear seems to work the form goes hidden if I click on it. This is a problem as no one can sign up if they can't type/click on the form. (ISSUE FIXED) here is the codepen (live version): http://codepen.io/mariomez/pen/WbgrNK
score: 1
possible better answer: http://stackoverflow.com/a/28900657
has comment: http://stackoverflow.com/comment/46060515
has answer: http://stackoverflow.com/a/28900657
favorite count: 0
has answer: http://stackoverflow.com/a/28900837
has answer: http://stackoverflow.com/a/28900991
downvote count: 2
has answer: http://stackoverflow.com/a/28901953
tagged with: css
has comment: http://stackoverflow.com/comment/46060717
type: AnsweredQuestion
upvote count: 3
has title: Hide div class on page load
tagged with: hide
has answer: http://stackoverflow.com/a/28901178
type: Question
accepted answer: http://stackoverflow.com/a/28900991
has comment: http://stackoverflow.com/comment/46060639
has comment: http://stackoverflow.com/comment/46060670
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46061167

http://stackoverflow.com/q/28794287
has comment: http://stackoverflow.com/comment/45863483
tagged with: javascript
has body: I wrote a small application(proof of concept) in angular.js and i encountered the need of persisting simple data between application instantiations. I would like to know if there's a way of storing JSON objects to a local file, on my computer, without server or database intervention. The easiest solution I found is using ColdFusion, but this requires setting up a server too. Thanks!
has answer: http://stackoverflow.com/a/28794385
answer count: 1
has title: Write json to local disk javascript
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45863181
type: UnansweredQuestion
score: 0
tagged with: http://stackoverflow.com/tag/json
type: Question
has comment: http://stackoverflow.com/comment/49465731

http://stackoverflow.com/comment/45799800
type: QuestionComment
score: 0
type: Comment
has text: @Mayhem No..its works for me..I have mentioned the required condition which needs to be done first at clients browser, so as to see correct logs..
comment on: http://stackoverflow.com/q/28759719

javascript
tags question: http://stackoverflow.com/q/28764165
tags question: http://stackoverflow.com/q/28851738
tags question: http://stackoverflow.com/q/28892342
tags question: http://stackoverflow.com/q/28753785
tags question: http://stackoverflow.com/q/28756740
tags question: http://stackoverflow.com/q/28844398
tags question: http://stackoverflow.com/q/28803527
tags question: http://stackoverflow.com/q/28834718
tags question: http://stackoverflow.com/q/28787125
tags question: http://stackoverflow.com/q/28770467
tags question: http://stackoverflow.com/q/28755586
tags question: http://stackoverflow.com/q/28767078
tags question: http://stackoverflow.com/q/28861821
tags question: http://stackoverflow.com/q/28888949
tags question: http://stackoverflow.com/q/28804795
tags question: http://stackoverflow.com/q/28898845
tags question: http://stackoverflow.com/q/28844703
tags question: http://stackoverflow.com/q/28772386
tags question: http://stackoverflow.com/q/28803287
tags question: http://stackoverflow.com/q/28877475
tags question: http://stackoverflow.com/q/28791657
tags question: http://stackoverflow.com/q/28823231
tags question: http://stackoverflow.com/q/28813103
tags question: http://stackoverflow.com/q/28843255
tags question: http://stackoverflow.com/q/28796179
tags question: http://stackoverflow.com/q/28760655
tags question: http://stackoverflow.com/q/28884406
tags question: http://stackoverflow.com/q/28780598
tags question: http://stackoverflow.com/q/28854772
tags question: http://stackoverflow.com/q/28824014
tags question: http://stackoverflow.com/q/28856444
tags question: http://stackoverflow.com/q/28880747
tags question: http://stackoverflow.com/q/28793315
tags question: http://stackoverflow.com/q/28773229
tags question: http://stackoverflow.com/q/28894227
tags question: http://stackoverflow.com/q/28797869
tags question: http://stackoverflow.com/q/28752226
tags question: http://stackoverflow.com/q/28863245
tags question: http://stackoverflow.com/q/28838307
tags question: http://stackoverflow.com/q/28807621
tags question: http://stackoverflow.com/q/28777157
tags question: http://stackoverflow.com/q/28817284
tags question: http://stackoverflow.com/q/28766631
tags question: http://stackoverflow.com/q/28813405
tags question: http://stackoverflow.com/q/28879223
tags question: http://stackoverflow.com/q/28814577
tags question: http://stackoverflow.com/q/28811139
tags question: http://stackoverflow.com/q/28898532
tags question: http://stackoverflow.com/q/28849603
tags question: http://stackoverflow.com/q/28759728
tags question: http://stackoverflow.com/q/28838620
tags question: http://stackoverflow.com/q/28821594
tags question: http://stackoverflow.com/q/28884446
tags question: http://stackoverflow.com/q/28863121
tags question: http://stackoverflow.com/q/28759818
tags question: http://stackoverflow.com/q/28766032
tags question: http://stackoverflow.com/q/28846651
tags question: http://stackoverflow.com/q/28901517
tags question: http://stackoverflow.com/q/28864931
tags question: http://stackoverflow.com/q/28852429
tags question: http://stackoverflow.com/q/28906435
tags question: http://stackoverflow.com/q/28821542
tags question: http://stackoverflow.com/q/28776061
tags question: http://stackoverflow.com/q/28771395
tags question: http://stackoverflow.com/q/28884504
tags question: http://stackoverflow.com/q/28764622
tags question: http://stackoverflow.com/q/28828204
tags question: http://stackoverflow.com/q/28835302
tags question: http://stackoverflow.com/q/28818830
tags question: http://stackoverflow.com/q/28808114
tags question: http://stackoverflow.com/q/28763476
tags question: http://stackoverflow.com/q/28857322
tags question: http://stackoverflow.com/q/28799892
tags question: http://stackoverflow.com/q/28840149
tags question: http://stackoverflow.com/q/28897036
tags question: http://stackoverflow.com/q/28899873
tags question: http://stackoverflow.com/q/28824340
tags question: http://stackoverflow.com/q/28826523
tags question: http://stackoverflow.com/q/28871141
tags question: http://stackoverflow.com/q/28859083

http://stackoverflow.com/comment/45836223
comment on: http://stackoverflow.com/a/28779014
type: Comment
has text: @PriyankaSharma Offering for help! And the reward?
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45902893
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28815578
has text: are you using iCheck plugin? if so use API for plugin. if not, try using `change` event

http://stackoverflow.com/q/28860673
tagged with: callback
favorite count: 0
has answer: http://stackoverflow.com/a/28860723
has title: iteration, JSON and callback in JS
upvote count: 1
accepted answer: http://stackoverflow.com/a/28860723
has body: (translation with Google Traductor) Hi, I'm learning javascript, and I was trying to simulate the change that occurs in the stock quotes on page yahoo finance. I was reading many responses from stackoverflow page, and I did this. http://js.do/code/53880 If you are using google chrome, after about a minute into the console errors occur. Control -Shift -J (console tab/ error) error: net::ERR_INSUFFICIENT_RESOURCESjquery-1.9.1.js:8336 sendjquery-1.9.1.js:7978 jQuery.extend.ajaxVM8678:12 update also the page is lags $(function(){ $(function() { setInterval(update, 0); }); function update() { var query = "select * from yahoo.finance.quotes where symbol = "; var symbolo = "'AAPL'"; var yql = "http://query.yahooapis.com/v1/public/yql?q=" + escape(query+symbolo) + "&amp;format=json&amp;diagnostics=true&amp;env=store://datatables.org/alltableswithkeys&amp;callback=?"; var xhr2 = $.ajax({ url: yql, jsonp: "myCallback", dataType: 'jsonp', success: function(data) { var keys = data.query.results.quote; $("#a").html(keys.LastTradePriceOnly); }, error: function (xhr, ajaxOptions, thrownError) { alert("oth1"+xhr.statusText); alert("oth2"+xhr.responseText); alert("oth3"+xhr.status); alert("oth4"+thrownError); } }); } });
type: AnsweredQuestion
score: 1
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: jsonp
tagged with: yql
answer count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/28881592
has answer: http://stackoverflow.com/a/28881910
has body: Okay so i have to take the number of adults inputted by the user and times it against the journey cost which I've got, however i also need to take the number of children and give them a flat %20 discount rate across all journeys, Here is my code. HTML Bristol - Newcastle Bristol - London Glasgow - Manchester Number of Adults: Number of Children: Submit Journey Price: Number of Adults: Number of Children: Total Cost: Javascript function BookingFare() { var journeyList = document.getElementById("journeyList"); var price =journeyList.options[journeyList.selectedIndex].value; var Adults = document.getElementById("ofAdults").value; var Children = document.getElementById("ofChild").value; //var total = price * Adults; document.getElementById('priceBox').innerHTML = price; document.getElementById('adultsBox').innerHTML = Adults; document.getElementById('childBox').innerHTML = Children; document.getElementById('totalBox').innerHTML = total; } Should i be looking to do if statements? Thankyou for any suggestions!
type: UnansweredQuestion
tagged with: percentage
type: Question
has answer: http://stackoverflow.com/a/28881820
has answer: http://stackoverflow.com/a/28881848
tagged with: math
tagged with: javascript
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has title: Working out total price of Journey cost with multiple variables

http://stackoverflow.com/q/28766995
has body: So, i'm making a site for a project. I have 2 radio buttons, if the radio button: 'Yes' is checked a div has to be shown on the same page at the moment when the radio button is checked. When the radio button 'no' is checked nothing has to happen and the div shouldn't be shown. here's the thing is was trying but it just won't work. I don't know what's wrong and can't find a solution on the web. Here's my code: &lt;?php $ervaringja = 0; ?&gt; Hebt u enige ervaring met Fitnessen? &lt;input type="radio" name="ErvaringJa_Nee" &lt;?php if (isset($Ervaring) &amp;&amp; $Ervaring=="Ja") $ervaringja = 1;?&gt; value="Ja"&gt;Ja &lt;input type="radio" name="ErvaringJa_Nee" &lt;?php if (isset($Ervaring) &amp;&amp; $Ervaring=="Nee") echo "checked";?&gt; value="Nee"&gt;Nee&lt;br&gt; &lt;?php if ($ervaringja == 0){ echo '&lt;script&gt;'. 'ervaringjanee()'. '&lt;/script&gt;'; } ?&gt; And the script: &lt;script&gt; function ervaringjanee() { document.getElementById("WelkeErvaring").style.display = "hidden"; } &lt;/script&gt; but the div keeps showing up, can some one help me?
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28767058
upvote count: 2
tagged with: php
score: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28767058
type: Question
downvote count: 0
tagged with: javascript
has title: Radio button show div
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/45870786
type: AnswerComment
has text: I've posted a new question regarding this problem here: http://stackoverflow.com/questions/28798240/ajax-is-not-returning-the-correct-response-laravel
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28790462

http://stackoverflow.com/comment/45960670
has text: You can't access file system using javascript in browser
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/28845855

http://stackoverflow.com/q/28875773
score: 0
has comment: http://stackoverflow.com/comment/46014048
has title: Autocomplete ajax is not working
has comment: http://stackoverflow.com/comment/46014529
answer count: 1
tagged with: jquery-autocomplete
has comment: http://stackoverflow.com/comment/46013951
has comment: http://stackoverflow.com/comment/46014584
has body: Above is an autocomplete script. Both script having same function set_time . If i changed function name as set_time1, then autocomplete is not working . How to resolve this issue? . I need to use two autocomplete in a single page.
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/46014296
tagged with: autocomplete
has answer: http://stackoverflow.com/a/28876508
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46014758
tagged with: ajax
linked to: http://stackoverflow.com/q/27389241

http://stackoverflow.com/q/28898839
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/45441539
score: 7
type: Question
has title: lodash 'includes' not working
has answer: http://stackoverflow.com/a/28898918
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: lodash
accepted answer: http://stackoverflow.com/a/28898918
has body: I tried to use this function, but it's not defined (jsfiddle). console.log(_.include([1, 2, 3], 1)); console.log(_.includes([1, 2, 3], 1)); also I saw that 'include;' without 's' work well. they have mistake in the docs? or I missed something? thanks!
upvote count: 7
possible better answer: http://stackoverflow.com/a/45441539

http://stackoverflow.com/a/28904989
type: Answer
answers question: http://stackoverflow.com/q/28904631
has body: This is a solution that avoids the for...in that you mentioned. However, I think the for...in solution is much more elegant. This will walk the prototype chain and return all properties as a recursive function. As well as remove all duplicates. function getKeys(obj) { var keys = Object.keys(obj); var parent = Object.getPrototypeOf(obj); if (!parent) { return keys; } return keys.concat(getKeys(parent)) .filter(function (item, index, col) { return col.indexOf(item) === index; }); } var a = { a: 1, b: 2 }; var b = Object.create(a); b.a = 2; b.c = 3; var c = Object.create(b); console.log(getKeys(c));
score: 0

http://stackoverflow.com/q/28767535
has comment: http://stackoverflow.com/comment/45883297
tagged with: javascript
linked to: http://stackoverflow.com/q/26080776
has body: I have a jpeg image that has been decoded, and I am writing it to canvas with putImageData. Is it possible to then move this image around? I cannot find any documentation on it. The idea is that I will crop a certain part of the decoded image with dirtyX and dirtyY, and now I would like to crop another part of the image. I'm using the decoded image like a spritesheet.
score: 0
has comment: http://stackoverflow.com/comment/45815770
tagged with: html5-canvas
has comment: http://stackoverflow.com/comment/45845310
possible better answer: http://stackoverflow.com/a/28767953
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45815826
has comment: http://stackoverflow.com/comment/45814117
has title: Animating / Move canvas image that has been placed by putImageData
tagged with: putimagedata
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28767953
tagged with: canvas
has answer: http://stackoverflow.com/a/28769477
accepted answer: http://stackoverflow.com/a/28769477

http://stackoverflow.com/comment/79372489
type: QuestionComment
has text: which functionality?
comment on: http://stackoverflow.com/q/28751532
score: 0
type: Comment

http://stackoverflow.com/q/28893110
has title: dynamically added anchor click doesn't call function in jquery mobile
has body: My page fetches string data from local SQL and appends it to data-role='listview' as li using function below(simplified version) function CreateListview{ var temp =' String Here '; $("# -selector").append(temp).listview("refresh"); } well, it works fine so I binded a click event for the anchor(class='.anchor') $(document).on('vclick', '.anchor', function(e){ e.preventDefault(); alert("ANCHOR CLICKED"); }); OR $(document).on('vclick', '#ul-selector > a', function(e){ e.preventDefault(); alert("ANCHOR CLICKED"); }); OR $(document).on('vclick', '#ul-selector > li a', function(e){ e.preventDefault(); alert("ANCHOR CLICKED"); }); OR even $(document).on('vclick', 'a', function(e){ e.preventDefault(); alert("ANCHOR CLICKED"); }); But nothing works I double-checked if click event on other elements works by using the function below on dynamically added li and it sometimes works and sometime doesn't. I don't know why it works randomly, but I checked that click events are fired on some other dynamically added elements. $(document).on('vclick', '#ul-selector > li', function(e){ alert(" CLICKED"); }); When it comes to binding click function to dynamically added anchors, the function won't be fired.. could it be a bug? or am I writing codes wrong? Can you give me a working example binding click event to dynamically added anchor?
type: Question
tagged with: anchor
tagged with: jquery-mobile
possible better answer: http://stackoverflow.com/a/28893297
tagged with: javascript
has answer: http://stackoverflow.com/a/28893297
has answer: http://stackoverflow.com/a/28893153
tagged with: jquery
tagged with: click
has answer: http://stackoverflow.com/a/28897410
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28893233
accepted answer: http://stackoverflow.com/a/28897410
score: 0

http://stackoverflow.com/comment/45900954
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28814164
has text: Which would still work fine on phones assuming it's in a relative container @lori

http://stackoverflow.com/comment/46030634
score: 0
type: Comment
type: QuestionComment
has text: @erosman - cheers, much appreciated. You can find the last working version here (I haven't published the changes I outlined above as didn't see the point in publishing a known broken version). https://addons.mozilla.org/en-US/firefox/addon/nomorvom/
comment on: http://stackoverflow.com/q/28862327

http://stackoverflow.com/a/28790560
answers question: http://stackoverflow.com/q/28790546
score: 1
downvote count: 0
type: Answer
upvote count: 1
has body: In JavaScript, and many other languages, functions can be treated as values. So your first function returns a value which itself is a reference to a function. Then, the returned function value is applied, like any other function, to the argument 45.

http://stackoverflow.com/comment/45830502
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28775769
has text: Yes, it is a good solution. What other parameter would you want to pass? Isn't it something you can infer from the identifier for the post?
type: AnswerComment

http://stackoverflow.com/comment/45812330
has text: @Nikos M. The way I have it set up, there are never any negative numbers, and it just gets farther away and closer to (0,0), which is the top left of the page. It was working, but now its not, and I can't figure out why.
score: 0
comment on: http://stackoverflow.com/q/28755841
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/46036814
score: 1
has text: The problem you've got is an *algorithmic* problem. Switching to another iteration mechanism won't help anything.
type: Comment
comment on: http://stackoverflow.com/q/28887739
type: QuestionComment

http://stackoverflow.com/a/28773375
accepted answer of: http://stackoverflow.com/q/28773229
score: 3
has comment: http://stackoverflow.com/comment/45825821
downvote count: 0
has comment: http://stackoverflow.com/comment/45825468
has comment: http://stackoverflow.com/comment/45825434
has body: My demo EDIT: updated the opacity. Did a quick copy paste. Works. You only need to call the $(window).on('scroll', function(){}); once. var sf = $('.scroll-fade'); var sfl = $('.scroll-fade-long'); var sfl2 = $('.scroll-fade-long-2'); $(window).on('scroll', function(){ var st = $(this).scrollTop(); sf.css({ 'opacity' : 1 - st/135, 'margin-top': -(st/3)+"px" }); sfl.css({ 'opacity' : 1 - st/255, 'margin-top': -(st/3)+"px" }); sfl2.css({ 'opacity' : 1 - st/355, 'margin-top': -(st/3)+"px" }); }); Also see Miro's compact solution: http://jsfiddle.net/ocntm9tx/5/ $(window).on('scroll', function(){ var st = $(this).scrollTop(); for(i=1; i&lt;=3; i++){ $('.scroll-fade-'+i).css({ 'opacity' : 1 - st/(i*100), 'margin-top': -(st/3)+"px" }); } });
upvote count: 3
has comment: http://stackoverflow.com/comment/45825614
has comment: http://stackoverflow.com/comment/45825261
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45825597
answers question: http://stackoverflow.com/q/28773229
type: Answer
has comment: http://stackoverflow.com/comment/45825652

http://stackoverflow.com/comment/45905544
type: QuestionComment
has text: Any errors being thrown that would prevent code from running?
type: Comment
score: 1
comment on: http://stackoverflow.com/q/28816675

http://stackoverflow.com/a/28817717
upvote count: 1
answers question: http://stackoverflow.com/q/28817031
has body: The magic CSS rule you're missing is word-break: break-all;. Add that, and it works just like you'd expect. Proof
downvote count: 0
type: Answer
score: 1

http://stackoverflow.com/q/28846814
has answer: http://stackoverflow.com/a/41456262
has answer: http://stackoverflow.com/a/37806632
type: Question
has body: Webpack docs state that output.publicPath is: The output.path from the view of the JavaScript. Could you please elaborate on what this actually means? I use output.path and output.filename to specify where Webpack should output the result, but I’m not sure what to put in output.publicPath and whether it is required. module.exports = { output: { path: path.resolve("./examples/dist"), filename: "app.js", publicPath: "What should I put here?" } }
has answer: http://stackoverflow.com/a/28899482
tagged with: webpack
has comment: http://stackoverflow.com/comment/61559343
tagged with: javascript
has title: What does "publicPath" in Webpack do?
downvote count: 0
has answer: http://stackoverflow.com/a/67962869
has answer: http://stackoverflow.com/a/41475106
favorite count: 0
upvote count: 314
answer count: 9
has answer: http://stackoverflow.com/a/57491576
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/70049023
has answer: http://stackoverflow.com/a/38748466
has answer: http://stackoverflow.com/a/43812565
score: 314
has comment: http://stackoverflow.com/comment/59969759
has answer: http://stackoverflow.com/a/32294026

http://stackoverflow.com/a/28844603
answers question: http://stackoverflow.com/q/28843651
type: Answer
accepted answer of: http://stackoverflow.com/q/28843651
score: 2
downvote count: 0
upvote count: 2
type: AcceptedAnswer
has body: I guess there is not a CSS3 solution to this question? Most Media Queries will conflict. I have decided to answer my own question with a JavaScript approach. I hope it helps. This will cover most scenarios. You can then add different styles for each added class. The width checks for portrait and the height checks for landscape basically. Pretty simple. var $banner = $('#banner'), h = window.innerHeight, w = window.innerWidth; if (w === 320 || h === 320) { //iPhone 5 or below $banner.addClass('iPhone'); } else if (w === 375 || h === 375) { //iPhone 6 $banner.addClass('iPhone6'); } else if (w === 414 || h === 414) { //iPhone 6 Plus $banner.addClass('iPhone6Plus'); } else if (w === 346 || h === 346) { //Smart phone e.g. Q10 $banner.addClass('smartPhoneSmall'); } else if (w === 360 || h === 360) { //Smart phone e.g. Samsung Galaxy S3/ S4 $banner.addClass('smartPhoneMed'); } else if (w === 384 || h === 384) { //Smart phone e.g. LG Nexus 4 $banner.addClass('smartPhoneBig'); } else if (w === 400 || h === 400) { //Smart phone e.g. Samsung Galaxy Note $banner.addClass('smartPhoneLarge'); } Phone CSS width reference: http://mydevice.io/devices/ EDIT: I forgot about nesting so you can do it with CSS3 /* Portrait Styles */ @media only screen and (orientation : portrait) { @media only screen and (min-device-width: 346px) and (max-device-width: 359px) { /* Small Smartphones e.g. Q10 */ .banner { height: 129px; width: 346px; } } @media only screen and (min-device-width: 360px) and (max-device-width: 374px) { /* Medium Smartphones e.g. Samsung Galaxy S3/ S4 */ .banner { height: 135px; width: 360px; } } @media only screen and (min-device-width: 375px) and (max-device-width: 383px) { /* iPhone 6 */ .banner { height: 140px; width: 375px; } } @media only screen and (min-device-width: 384px) and (max-device-width: 399px) { /* Big Smartphones e.g. LG Nexus 4 */ .banner { height: 144px; width: 384px; } } @media only screen and (min-device-width: 400px) and (max-device-width: 413px) { /* L…

http://stackoverflow.com/q/28759157
tagged with: unit-testing
has comment: http://stackoverflow.com/comment/45842317
type: Question
has comment: http://stackoverflow.com/comment/45860727
tagged with: javascript
has title: How to test java script file test with Chutzpah and TFS? And how to fix the error?
upvote count: 3
favorite count: 0
has comment: http://stackoverflow.com/comment/45880402
answer count: 0
type: UnansweredQuestion
tagged with: chutzpah
has body: I am trying to test the testSpec.js file in Visual Studio Online in TFS by Chutzpah java script test runner: /// &lt;reference path="jasmine.js"/&gt; describe('Javascript test: testjsinTFS', function () { it('should have scope defined', function () { var a =1; expect(a).toBeDefined(); expect(a).toEqual(1); }); }); I have added the dependencies as found in the blog: Error: Unknown error occurred when executing test file. Received exit code of -1 While Running:C:\a\bin\testSpec.js So how can I fix the problem? Thanks in advance for help.
tagged with: tfs
has comment: http://stackoverflow.com/comment/45884134
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/45874989

http://stackoverflow.com/a/28871236
upvote count: 2
answers question: http://stackoverflow.com/q/28870943
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46006056
has comment: http://stackoverflow.com/comment/46005988
type: Answer
has comment: http://stackoverflow.com/comment/46005867
has comment: http://stackoverflow.com/comment/46006013
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/46006086
has body: toFixed returns you String. So "11" &gt; "10000" returns you true because. 1 followed by 1 is greater than 1 followed by 0 You can try in your console: "01" &gt; "0001" will return you true which is also based on the same concept. To avoid it : parseFloat(val) &gt; parseFloat(max.toFixed(5))
has comment: http://stackoverflow.com/comment/46005938
accepted answer of: http://stackoverflow.com/q/28870943

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

http://stackoverflow.com/comment/46021014
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28879454
has text: no event `changes` it is `change`

http://stackoverflow.com/q/28754998
tagged with: angularjs
tagged with: karma-runner
has answer: http://stackoverflow.com/a/28755058
tagged with: unit-testing
type: Question
type: AnsweredQuestion
has title: AngluarJS Unit Test - Undefined is not a function
accepted answer: http://stackoverflow.com/a/28755058
has body: I am trying to learn how to unit test within angular. Unit testing my controllers to start with then my services. I have started off with a basic test. Controller code: angular.module('app') .controller('TestCtrl', function ($rootScope,$scope,fileLoader,ngProgress) { $scope.test= []; $scope.init = function(){ fileLoader.getFile("test") .then(function(res){ //Success console.log(res); $scope.test= res; }, function(err){ //Error }); ngProgress.complete(); } $scope.init(); $scope.title = "Test"; }); Test code: describe('Controller: TestCtrl', function () { // load the controller's module beforeEach(module('app')); var TestCtrl, scope,test; test = {}; test.getFile = function(name) { return [ { "id": 0, "name": "Test", "imgName": "Test.png" }, { "id": 1, "name": "Test1", "imgName": "Test1.png" }]; }; // Initialize the controller and a mock scope beforeEach(inject(function ($controller, $rootScope) { scope = $rootScope.$new(); TestCtrl= $controller('TestCtrl', { $scope: scope, fileLoader : test }); })); it('should have the correct title', function () { expect(scope.title).toBe("Test"); }); }); And I can't understand why I am getting the following error: TypeError: 'undefined' is not a function (evaluating 'fileLoader.getFile("test") .then') undefined Is there any way once this is resolved I can lay all my mocking out in a separate file e.g. my fileLoader mock and just inject it that way? I don't understand how I am injecting it but yet it is undefined. Thanks
answer count: 1
tagged with: javascript
tagged with: jasmine
score: 0

http://stackoverflow.com/q/28770768
has comment: http://stackoverflow.com/comment/45820401
tagged with: javascript
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28770839
has answer: http://stackoverflow.com/a/28770857
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28770839
possible better answer: http://stackoverflow.com/a/28770857
tagged with: php
has body: function search() { var dateFrom = $("#datepickerFrom").val(); var dateTo = $("#datepickerTo").val(); var sponsers = $("#storeCheck").val(); var organiser = $("#organiser").val(); var sort = $("#sort").val(); $(document).ready(function() { $.post("searchEvents.php", { datepickerFrom: datepickerFrom, datepickerTo: datepickerTo, storeCheck: sponsers, organiser: organiser, sort: sort }, function(data) { alert("Data Loaded: " + data); }); }); } Im trying to pass variables from jquery to php but it shows me Uncaught TypeError: Illegal invocation.Please help!
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45820092
has title: illegal invokation error jquery
type: Question

http://stackoverflow.com/q/28770061
answer count: 1
downvote count: 0
favorite count: 0
has title: require.js error (topojson not loading)
has answer: http://stackoverflow.com/a/28771705
tagged with: requirejs
upvote count: 1
tagged with: topojson
type: AnsweredQuestion
score: 1
type: Question
accepted answer: http://stackoverflow.com/a/28771705
tagged with: javascript
has body: Can anyone help me understand/fix this error? Uncaught ReferenceError: topojson is not defined I am new to requireJS and don't fully understand it. Thank you in advance! require.config({ paths: { d3: "//cdnjs.cloudflare.com/ajax/libs/d3/3.5.3/d3.min", geo: "//d3js.org/d3.geo.projection.v0.min", topo: "//d3js.org/topojson.v1.min" }, shim: { geo: { deps: ["d3"] }, topo:{ deps: ["d3","geo"] } } }); require(["d3","geo","topo"],function(){ $(document).ready(RecruitingData.ondomready); $(document).bind('framework.resize',RecruitingData.scalescharts()); $(document).bind('framework.resize',RecruitingData.scalescharts1()); $(document).bind('framework.resize',RecruitingData.linechart()); $(document).bind('framework.resize',RecruitingData.mapchart()); })

java
tags question: http://stackoverflow.com/q/28759235
tags question: http://stackoverflow.com/q/28851172
tags question: http://stackoverflow.com/q/28905855
tags question: http://stackoverflow.com/q/28771789
tags question: http://stackoverflow.com/q/28845166
tags question: http://stackoverflow.com/q/28874553
tags question: http://stackoverflow.com/q/28772195
tags question: http://stackoverflow.com/q/28758103
tags question: http://stackoverflow.com/q/28838923
tags question: http://stackoverflow.com/q/28804890
tags question: http://stackoverflow.com/q/28830208
tags question: http://stackoverflow.com/q/28839406
tags question: http://stackoverflow.com/q/28775191
tags question: http://stackoverflow.com/q/28876020
tags question: http://stackoverflow.com/q/28855198
tags question: http://stackoverflow.com/q/28785022
tags question: http://stackoverflow.com/q/28860602
tags question: http://stackoverflow.com/q/28804607
tags question: http://stackoverflow.com/q/28828972
tags question: http://stackoverflow.com/q/28765951
tags question: http://stackoverflow.com/q/28870309
tags question: http://stackoverflow.com/q/28818142
tags question: http://stackoverflow.com/q/28875402
tags question: http://stackoverflow.com/q/28763657
tags question: http://stackoverflow.com/q/28779597
tags question: http://stackoverflow.com/q/28769744
tags question: http://stackoverflow.com/q/28828741
tags question: http://stackoverflow.com/q/28876584
tags question: http://stackoverflow.com/q/28840777
tags question: http://stackoverflow.com/q/28819210
tags question: http://stackoverflow.com/q/28789989
tags question: http://stackoverflow.com/q/28794156
tags question: http://stackoverflow.com/q/28840872
tags question: http://stackoverflow.com/q/28823196
tags question: http://stackoverflow.com/q/28794101
tags question: http://stackoverflow.com/q/28849425
tag name: java
tags question: http://stackoverflow.com/q/28791701
tags question: http://stackoverflow.com/q/28887526
tags question: http://stackoverflow.com/q/28794298
tags question: http://stackoverflow.com/q/28806610
tags question: http://stackoverflow.com/q/28881464
tags question: http://stackoverflow.com/q/28758541
tags question: http://stackoverflow.com/q/28905849
tags question: http://stackoverflow.com/q/28877992
tags question: http://stackoverflow.com/q/28810109
tags question: http://stackoverflow.com/q/28788702
tags question: http://stackoverflow.com/q/28858428
tags question: http://stackoverflow.com/q/28875651
tags question: http://stackoverflow.com/q/28780040
tags question: http://stackoverflow.com/q/28783377
type: Tag
tags question: http://stackoverflow.com/q/28781212
tags question: http://stackoverflow.com/q/28840204
tags question: http://stackoverflow.com/q/28807142
tags question: http://stackoverflow.com/q/28880729
tags question: http://stackoverflow.com/q/28798007
tags question: http://stackoverflow.com/q/28843213

http://stackoverflow.com/a/28907055
type: Answer
has comment: http://stackoverflow.com/comment/50540749
accepted answer of: http://stackoverflow.com/q/28905945
answers question: http://stackoverflow.com/q/28905945
has body: Okay so I tried to use seleniumAddress: 'http://127.0.0.1:4444/wd/hub', istead of directConnect: true. It worked for me. My Firfox versionis 36.01 and Webdriver is 2.45.
type: AcceptedAnswer
score: 0

http://stackoverflow.com/q/28869287
has answer: http://stackoverflow.com/a/28869419
score: 0
answer count: 1
tagged with: javascript
tagged with: angularjs
has body: I'am new in AngularJs. I try to make multilanguage web using AngularJs, Translator working fine. When i try to put translator result to onClick for executing my function it's not working. My function show Bootstrap modal and replace modal content with some string than translated. I've write my code on Plunker I hope someone can help me to learn and solved this Here All mycode, other code in Plunker index.html Learn Angular
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46014952
has title: AngularJs : How to use ng-click to show modal bootstrap
type: Question

http://stackoverflow.com/a/28889388
type: Answer
answers question: http://stackoverflow.com/q/28875087
has body: You can convert an HTML string to text by inserting it into a DOM element and then asking for just the text back out. This will work in even older versions of IE: function stripHTML(html) { var div = document.createElement("div"); div.innerHTML = html; return div.textContent || div.innerText; } Working demo: http://jsfiddle.net/jfriend00/tbnfnvv6/
accepted answer of: http://stackoverflow.com/q/28875087
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/45909137
has text: Will be hard reading all of it in the comments. Update your question. Post the same errors. Also show part of your html where you link all the libraries related to fancybox (js and css) (I'm interested in the order on how you linked them and where you create your .fancybox)
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28817482

http://stackoverflow.com/comment/45819922
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28770208
has text: Hello, I removed the anchor and it works with the span. The alert pops up but my cart doesn't get updated when clicked. I currently have: $.post( '" . $producturl[0]->URL . "' ); to send this URL over (which is the add to cart link) -- is this not the correct method?

http://stackoverflow.com/q/28826213
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: jquery-ui
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28826364
has answer: http://stackoverflow.com/a/28826302
has body: I am trying to add dynamic fields on click and want to fetch each input box value that user types. Here is my working code. HTML code Add More Fields JS code $(document).ready(function() { var max_fields = 10; //maximum input boxes allowed var wrapper = $(".input_fields_wrap"); //Fields wrapper var add_button = $(".add_field_button"); //Add button ID var x = 1; //initlal text box count $(add_button).click(function(e){ //on add input button click e.preventDefault(); if(x < max_fields){ //max input box allowed x++; //text box increment $(wrapper).append(' Remove save '); //add input box } }); $(wrapper).on("click",".remove_field", function(e){ //user click on remove text e.preventDefault(); $(this).parent('div').remove(); x--; }) $(wrapper).on("click",".save_field", function(e){ //user click on remove text e.preventDefault(); //Here on click of each save button I wanna grab particular text box value that user types in }) }); On each click of add more fields I get new text box along with remove and save button, upon clicking on save button I want to grab its respective text box value that user has typed. JSFiddle
accepted answer: http://stackoverflow.com/a/28826228
has answer: http://stackoverflow.com/a/28826364
answer count: 3
downvote count: 0
tagged with: jquery
favorite count: 0
has title: How to Grab input values of dynamically added input boxes using jquery
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28826228

http://stackoverflow.com/q/28886316
has comment: http://stackoverflow.com/comment/46034103
tagged with: css
answer count: 1
downvote count: 6
has comment: http://stackoverflow.com/comment/46034124
has comment: http://stackoverflow.com/comment/46033932
upvote count: 1
has answer: http://stackoverflow.com/a/28886452
has body: For example I have 4 div's. And each div has specific day/days, when a class has to be added to it, like so: And I want to add class active on first div, if today is 17th or 18th of current month. Any ideas? Im not saying I need to extract "on-17" to get number 17, it can be manual method, just to check for certain 'on-#'s, in this case 17,18,20,21,22. For example, if today was 2015-03-17th, it would trigger to add acive class on ->
has comment: http://stackoverflow.com/comment/46033935
has comment: http://stackoverflow.com/comment/46034196
tagged with: javascript
has title: How do I add class using jquery/javascript to different elements depending on what day is it?
type: AnsweredQuestion
score: -5
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28886452
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/46034062
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28753477
tagged with: arrays
has comment: http://stackoverflow.com/comment/45814602
tagged with: javascript
tagged with: jquery
has title: Appending User Input
has body: Situation: I currently have a search box that utilizes Jquery’s Autocomplete plugin. When a user begins typing in the search box for a sport’s team (i.e. Boston Red Sox) it will determine relevant matches. When they select on the team I would like it to append to a list (perhaps it should be append to an array as this seems most common – but if it is an array I may need to alter my current content) so that they can have their sport’s team displayed on a navbar (my css allows for this currently) To get a better idea of what I am discussing here is my fiddle http://jsfiddle.net/saLbjdw1/1/ Existing Code: TEST I will skip the css portion unless requested (found in JSFiddle) HOME BOSTON RED SOX NEW ENGLAND PATRIOTS BOSTON CELTICS BOSTON BRUINS I did attempt to piece together some of my thoughts on where I might begin after reviewing other stack posts such as; using JavaScript to append the user input (which was from the availableTeams [])to a new array called activeArray or list. After it is appended it would appear on the #topBar...hopefully myThoughts: activeArray=["BOSTON RED SOX", "NEW ENGLAND PATRIOTS"]; document.getElementById("tags").onClick=function() { if (document.getElementById("tags").value=="NEW ENGLAND REVOLUTION") { push searchedItem to activeArray } else { dont do anything } } I realize a lot of what is shown just above is rubbish but I am in a very basic sense trying to outline some rough thoughts. Any suggestions would be much appreciated.
answer count: 0
type: UnansweredQuestion
tagged with: appendto
has comment: http://stackoverflow.com/comment/45789418
has comment: http://stackoverflow.com/comment/45788999
type: Question
score: 0
has comment: http://stackoverflow.com/comment/45788910

http://stackoverflow.com/tag/json
tags question: http://stackoverflow.com/q/28755072
tags question: http://stackoverflow.com/q/28840089
tags question: http://stackoverflow.com/q/28780327
tags question: http://stackoverflow.com/q/28792809
tags question: http://stackoverflow.com/q/28897035
tags question: http://stackoverflow.com/q/28805371
tags question: http://stackoverflow.com/q/28866494
tags question: http://stackoverflow.com/q/28906136
tags question: http://stackoverflow.com/q/28876380
tags question: http://stackoverflow.com/q/28839647
tags question: http://stackoverflow.com/q/28882567
tags question: http://stackoverflow.com/q/28863082
tags question: http://stackoverflow.com/q/28871507
tags question: http://stackoverflow.com/q/28893025
tags question: http://stackoverflow.com/q/28783604
tags question: http://stackoverflow.com/q/28790698
tags question: http://stackoverflow.com/q/28794715
tags question: http://stackoverflow.com/q/28803157
tags question: http://stackoverflow.com/q/28800062
tags question: http://stackoverflow.com/q/28816434
tags question: http://stackoverflow.com/q/28884672
tags question: http://stackoverflow.com/q/28837419
tags question: http://stackoverflow.com/q/28905793
tags question: http://stackoverflow.com/q/28790075
tags question: http://stackoverflow.com/q/28866140
tags question: http://stackoverflow.com/q/28820738
tags question: http://stackoverflow.com/q/28751030
tags question: http://stackoverflow.com/q/28882744
tags question: http://stackoverflow.com/q/28831410
tags question: http://stackoverflow.com/q/28786324
tags question: http://stackoverflow.com/q/28750969
tags question: http://stackoverflow.com/q/28852107
tags question: http://stackoverflow.com/q/28806624
tags question: http://stackoverflow.com/q/28807142
tags question: http://stackoverflow.com/q/28876405
tags question: http://stackoverflow.com/q/28793074
tags question: http://stackoverflow.com/q/28864414
tags question: http://stackoverflow.com/q/28826727
tags question: http://stackoverflow.com/q/28785022
tags question: http://stackoverflow.com/q/28890630
tags question: http://stackoverflow.com/q/28868977
tags question: http://stackoverflow.com/q/28842422
tags question: http://stackoverflow.com/q/28762687
tags question: http://stackoverflow.com/q/28836965
tags question: http://stackoverflow.com/q/28884846
tags question: http://stackoverflow.com/q/28784615
tags question: http://stackoverflow.com/q/28773851
tags question: http://stackoverflow.com/q/28815545
tags question: http://stackoverflow.com/q/28770242
tags question: http://stackoverflow.com/q/28896687
type: Tag
tags question: http://stackoverflow.com/q/28837427
tags question: http://stackoverflow.com/q/28831391
tags question: http://stackoverflow.com/q/28841791
tags question: http://stackoverflow.com/q/28826400
tags question: http://stackoverflow.com/q/28862715
tags question: http://stackoverflow.com/q/28887335
tags question: http://stackoverflow.com/q/28751170
tags question: http://stackoverflow.com/q/28856988
tags question: http://stackoverflow.com/q/28811684
tags question: http://stackoverflow.com/q/28777486
tags question: http://stackoverflow.com/q/28791046
tags question: http://stackoverflow.com/q/28848558
tags question: http://stackoverflow.com/q/28842056
tags question: http://stackoverflow.com/q/28892885
tags question: http://stackoverflow.com/q/28828414
tags question: http://stackoverflow.com/q/28751308
tags question: http://stackoverflow.com/q/28820989
tags question: http://stackoverflow.com/q/28872643
tags question: http://stackoverflow.com/q/28787536
tags question: http://stackoverflow.com/q/28826070
tags question: http://stackoverflow.com/q/28757036
tags question: http://stackoverflow.com/q/28804231
tags question: http://stackoverflow.com/q/28772150
tags question: http://stackoverflow.com/q/28887234
tags question: http://stackoverflow.com/q/28756740
tags question: http://stackoverflow.com/q/28861821
tags question: http://stackoverflow.com/q/28845947
tags question: http://stackoverflow.com/q/28763476
tags question: http://stackoverflow.com/q/28895237

http://stackoverflow.com/comment/100795913
score: 1
type: AnswerComment
has text: Important note! This is a property of JavaScript strings, *not JSON strings*. Ref [json.org](https://www.json.org/) and section 9 of the [ECMA standard](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).
comment on: http://stackoverflow.com/a/28796460
type: Comment

http://stackoverflow.com/a/28885290
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28885207
answers question: http://stackoverflow.com/q/28885207
score: 5
upvote count: 5
has body: Angular doesn't have this, but there are some libraries you can use alongside it which provide LINQ-like features, including .any(): https://lodash.com/ http://underscorejs.org/

http://stackoverflow.com/comment/45931869
type: AnswerComment
type: Comment
score: 0
has text: You are right Nytramr. That method is simpler and works just as well.
comment on: http://stackoverflow.com/a/28771790

http://stackoverflow.com/a/28805394
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28805371
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28805371
type: Answer
has body: Try this var test = Ext.JSON.decode(&lt;?php echo $php_arr; ?&gt;); and you must escape " like so $php_arr = json_encode(array('1'=&gt;'\"data1', '2'=&gt;'data2')); Also in PHP you can use addslashes, like so $php_arr = json_encode(array('1'=&gt;'"data1', '2'=&gt;'data2')); $php_arr = addslashes($php_arr);
score: 2

http://stackoverflow.com/a/28790672
has comment: http://stackoverflow.com/comment/45856686
answers question: http://stackoverflow.com/q/28790625
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45856713
score: 0
has comment: http://stackoverflow.com/comment/45857433
has comment: http://stackoverflow.com/comment/45856632
accepted answer of: http://stackoverflow.com/q/28790625
has body: Try This fiddle: http://jsfiddle.net/LkjccadL/1/ This uses your example string, var myHTMLString = '&lt;!-- SC_OFF --&gt;&lt;div class="md"&gt;&lt;p&gt;It&amp;#39;s in the best interests of anyone holding &lt;b&gt;you&lt;/b&gt; back.&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt;'; $("#mydivthingy").html($.parseHTML(myHTMLString)); This works as excepted and creates the div/p. Keeps the comment tags and uses the correct quote and all. If it stops working once you apply it to your code/variable, i would suggest doing an alert or check your console for errors? alert(child); alert(child.data); alert(child.data.selftext_html); as suspect you might not actually be getting the html ?? possibly? Exactly what is creating child.data.selftext_html // Something To Try?? // This appears to be the jQuery way of doing this... seems.. hackish? var sHTMLResult = $('&lt;textarea /&gt;').html(child.data.selftext_html).text(); $("#myelement").html(sHTMLResult );
type: Answer
has comment: http://stackoverflow.com/comment/45856554
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45857551
has comment: http://stackoverflow.com/comment/45856744
has comment: http://stackoverflow.com/comment/45857451

http://stackoverflow.com/a/28792933
score: 2
has comment: http://stackoverflow.com/comment/45860918
downvote count: 0
has body: Here's something to get you started. I've used recursion to save you having to manually type your big if/else and it shows you how to do the timeouts, too. var message = "Hello World" function printChar(i) { var output = document.getElementById("output") var char = message.charAt(i); output.innerHTML = output.innerHTML + char; if (i &lt; message.length) { window.setTimeout(function() { i = i + 1; printChar(i); }, 1000) } } printChar(0); Demo here: http://jsfiddle.net/4c6msk8L/ Short version, out of interest (see comments): var m = "Hello World" function p(i) { document.getElementById("output").innerHTML += m.charAt(i); if (i&lt;m.length) {window.setTimeout(function() {p(++i);}, 100)} } p(0);
has comment: http://stackoverflow.com/comment/45865068
has comment: http://stackoverflow.com/comment/45862000
answers question: http://stackoverflow.com/q/28792845
upvote count: 2
has comment: http://stackoverflow.com/comment/45867356
type: Answer
has comment: http://stackoverflow.com/comment/45865029

http://stackoverflow.com/q/28808919
has answer: http://stackoverflow.com/a/28809212
type: Question
linked to: http://stackoverflow.com/q/7886460
tagged with: javascript
has title: Centering glyphicon in navbar
accepted answer: http://stackoverflow.com/a/28809212
answer count: 1
tagged with: jquery
has body: I'm trying to move my glyphicon(with its text) into the middle of the navbar and make it stay centered and responsive when you thin the window down. And I don't want it to scrunch together when the window is crammed, and I don't want the dropdown menu to go off to one side or anything(since one of the offered solutions did just that, which wasn't very nice). Have looked at lots of stackexchange solutions, such as the following: How do I center Glyphicons horizontally using Twitter Bootstrap Center align "span" text inside a div how do i get glyphicon in the center of the bootstrap navbar? But they didn't help, I tried modifying them a bit but to no avail. This is the piece in particular where the glyphicon and button is: M E N U Here's the entire code: Twenty Eight Interiors M E N U Design Process Profile Contact Info And does anyone know how I get rid of this gap?: EDIT: The CSS
tagged with: twitter-bootstrap
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/23229249
tagged with: css
linked to: http://stackoverflow.com/q/25831153
type: AnsweredQuestion
score: 0

http://stackoverflow.com/comment/46011765
score: 0
has text: I think this is over complicating it, if you click on the 3 different plans on the top it shows a different div at the bottom, this div just needs a different submit button which submits the form, then redirects to a different URL
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28865354

http://stackoverflow.com/q/28751225
duplicate of: http://stackoverflow.com/q/1726630
type: Question
has body: I'm sure this is an easy solution, but I'm not sure where to find this answer being novice in Javascript. I would like to take a single digit whole number like 6 and change it to a decimal, ex. 6.0 for aesthetic reasons. What method would I use to accomplish this?
has comment: http://stackoverflow.com/comment/45793479
score: 0
has title: convert whole number to a decimal javascript
has comment: http://stackoverflow.com/comment/45784342
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45793531
linked to: http://stackoverflow.com/q/1726630
answer count: 0

http://stackoverflow.com/comment/45826996
has text: I receive array(0) when i use `echo var_dump($_POST);`
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28774302
type: QuestionComment

http://stackoverflow.com/a/28869155
has comment: http://stackoverflow.com/comment/46002888
has comment: http://stackoverflow.com/comment/46003937
score: 2
has comment: http://stackoverflow.com/comment/46003232
has body: The same origin policy (which prevents making of CORS requests) is there for your security, not the security of the server: it prevents malicious scripts to access your data on other servers using your cookies. So, if you want you can still disable it at your own risk, on your browser. In Chrome/Chromium, if you want to disable the same origin policy you can start it with the --disable-web-security option: chromium-browser --disable-web-security Anyway, if you want it to work for your users, they will not able to make CORS requests if they have not disabled this security check in their browsers (which is discouraged if not for testing). As noted in other answers, some servers can purposely allow this kind of requests if they believe this can be useful and not harmful for their users, and they can do this with the Access-control headers. Moreover, if you still want to find a way to provide this kind of functionality to the users, you might make a Chrome extension, which is not bound to the same origin policy. A common solution to this is to make the cross origin request server side, returning the result to your application. You should be careful coding this: passing the url to fetch to the server will easily cause security concerns for your server side software. But if you have to fetch the same url every time, you could hard code it server side, in PHP would look like something like this: &lt;?php echo file_get_contents("http://your_cross_request/"); ?&gt; then making an ajax request to this page (which will be from the same origin) will return the content of the remote url.
answers question: http://stackoverflow.com/q/28868869
has comment: http://stackoverflow.com/comment/46002758
downvote count: 0
type: Answer
upvote count: 2

http://stackoverflow.com/comment/45978205
comment on: http://stackoverflow.com/a/28856086
score: 1
type: AnswerComment
has text: You'd still be **FAR** better off removing the JavaScript from your elements, and wiring up everything in jQuery.
type: Comment

functional-programming
tags question: http://stackoverflow.com/q/28835229
tags question: http://stackoverflow.com/q/28771782
tags question: http://stackoverflow.com/q/28792326
tags question: http://stackoverflow.com/q/28842694
tags question: http://stackoverflow.com/q/28896800
tag name: functional-programming
type: Tag
tags question: http://stackoverflow.com/q/28821765
tags question: http://stackoverflow.com/q/28869770
tags question: http://stackoverflow.com/q/28792158

http://stackoverflow.com/tag/html
tags question: http://stackoverflow.com/q/28840183
tags question: http://stackoverflow.com/q/28905512
tags question: http://stackoverflow.com/q/28814046
tags question: http://stackoverflow.com/q/28839860
tags question: http://stackoverflow.com/q/28904154
tags question: http://stackoverflow.com/q/28871357
tags question: http://stackoverflow.com/q/28844476
tags question: http://stackoverflow.com/q/28782166
tags question: http://stackoverflow.com/q/28865395
tags question: http://stackoverflow.com/q/28775318
tags question: http://stackoverflow.com/q/28835704
tags question: http://stackoverflow.com/q/28890816
tags question: http://stackoverflow.com/q/28810668
tags question: http://stackoverflow.com/q/28876672
tags question: http://stackoverflow.com/q/28845711
tags question: http://stackoverflow.com/q/28813815
tags question: http://stackoverflow.com/q/28764532
tags question: http://stackoverflow.com/q/28758145
tags question: http://stackoverflow.com/q/28837044
tags question: http://stackoverflow.com/q/28865362
tags question: http://stackoverflow.com/q/28759574
tags question: http://stackoverflow.com/q/28849560
tags question: http://stackoverflow.com/q/28848203
tags question: http://stackoverflow.com/q/28897201
tags question: http://stackoverflow.com/q/28778546
tags question: http://stackoverflow.com/q/28823997
tags question: http://stackoverflow.com/q/28883514
tags question: http://stackoverflow.com/q/28775339
tags question: http://stackoverflow.com/q/28865472
tags question: http://stackoverflow.com/q/28887335
tags question: http://stackoverflow.com/q/28900530
tags question: http://stackoverflow.com/q/28856808
tags question: http://stackoverflow.com/q/28796068
tags question: http://stackoverflow.com/q/28781353
tags question: http://stackoverflow.com/q/28891999
tags question: http://stackoverflow.com/q/28877427
tags question: http://stackoverflow.com/q/28765343
tags question: http://stackoverflow.com/q/28856693
tags question: http://stackoverflow.com/q/28782074
tags question: http://stackoverflow.com/q/28900004
tags question: http://stackoverflow.com/q/28759925
tags question: http://stackoverflow.com/q/28899405
tags question: http://stackoverflow.com/q/28866954
tags question: http://stackoverflow.com/q/28793723
tags question: http://stackoverflow.com/q/28845450
tags question: http://stackoverflow.com/q/28882289
tags question: http://stackoverflow.com/q/28873280
tags question: http://stackoverflow.com/q/28755149
tags question: http://stackoverflow.com/q/28808903
tags question: http://stackoverflow.com/q/28903369
tags question: http://stackoverflow.com/q/28800201
tags question: http://stackoverflow.com/q/28851388
tags question: http://stackoverflow.com/q/28751902
tags question: http://stackoverflow.com/q/28849234
tags question: http://stackoverflow.com/q/28887586
tags question: http://stackoverflow.com/q/28905569
tags question: http://stackoverflow.com/q/28794941
tags question: http://stackoverflow.com/q/28834053
tags question: http://stackoverflow.com/q/28875391
tags question: http://stackoverflow.com/q/28852536
tags question: http://stackoverflow.com/q/28823577
tags question: http://stackoverflow.com/q/28865611
tags question: http://stackoverflow.com/q/28841797
tags question: http://stackoverflow.com/q/28779345
tags question: http://stackoverflow.com/q/28821488
tags question: http://stackoverflow.com/q/28853741
tags question: http://stackoverflow.com/q/28874256
tags question: http://stackoverflow.com/q/28776663
tags question: http://stackoverflow.com/q/28795516
tags question: http://stackoverflow.com/q/28777523
tags question: http://stackoverflow.com/q/28895233
tags question: http://stackoverflow.com/q/28780160
tags question: http://stackoverflow.com/q/28814377
tags question: http://stackoverflow.com/q/28900422
tags question: http://stackoverflow.com/q/28874605
tags question: http://stackoverflow.com/q/28806519
tags question: http://stackoverflow.com/q/28777719
tags question: http://stackoverflow.com/q/28870456
tags question: http://stackoverflow.com/q/28899702
tags question: http://stackoverflow.com/q/28872234

http://stackoverflow.com/q/28859975
has answer: http://stackoverflow.com/a/28864906
tagged with: kendo-mvvm
has title: Binding event to other UI component's function, in Kendo MVVM
downvote count: 0
tagged with: javascript
tagged with: kendo-ui
tagged with: mvvm
answer count: 1
accepted answer: http://stackoverflow.com/a/28864906
favorite count: 0
has body: In Kendo UI, what is the best practice to reference another UI element's (widget) functionality; the MVVM way? For example, let's say I have both a grid and a button. I want the button to trigger the AddRow function of the grid. For this, let's say I have the following html: &lt;div id="grid" data-role="grid" /&gt; &lt;div id="button" data-bind="click: foo" /&gt; My viewmodel would look something like: var viewmodel = kendo.observable({ foo: function() { // how to call the grid's functions here ideally, like for example in: // var _grid = $("#grid").data("kendoGrid"); // _grid.addRow(); } }); Uncommenting the lines and doing it like this has a smell to it; it doesn't really seem observable, but a pure DOM bound event. An alternative, like storing the _grid separately as a property or function in my viewmodel, also seems similarly inefficient. But there are of course scenarios, like the pseudo sample above illustrates, where this could be wishful. Undoubtedly, I'm looking in the wrong direction here. So, any tips or best practices would be gratefully appreciated.
upvote count: 1
type: AnsweredQuestion
score: 1
type: Question

http://stackoverflow.com/comment/47352628
type: Comment
type: QuestionComment
score: 0
has text: That looks promising upon first sight... Definitely will check it out. Thanks!
comment on: http://stackoverflow.com/q/28894611

http://stackoverflow.com/q/28890804
tagged with: angularjs
type: AnsweredQuestion
score: 1
has title: $routeParams not returning Object
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28890985
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28890935
answer count: 2
has body: I have a controller that I'm trying to access the parameters on using $routeParams but when I check the value with console.log a reference to lodash is being made. (function() { 'use strict'; angular .module('card-info.controller', ['ui.bootstrap']) .controller('CardInfoController', CardInfoController); CardInfoController.$inject = [ 'fetchCard', 'fetchSet', '_', '$routeParams', '$filter', '$location' ]; function CardInfoController (fetchCard, _, $routeParams, $filter, $location) { var vm = this; var id = $routeParams.id; fetchCard.getCardInfo(id).then(function(d) { displayCard(d); }); ... } )}() Here is a link to the controller. The router event is firing and the URL is changing properly it just seems like there is something wrong within my injections.
has answer: http://stackoverflow.com/a/28890935
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/28890985

http://stackoverflow.com/comment/45788770
comment on: http://stackoverflow.com/a/28753131
type: Comment
has text: Yeah, we already have handled this in JavaScript previously. Using "html" was the new option, but wanted to add a warning using strictly "html".
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45912208
comment on: http://stackoverflow.com/q/28815545
score: 0
type: Comment
type: QuestionComment
has text: @calamari Thanks for the follow up. This worked perfectly in Chrome. I used `<div id="user" data-number="<?php echo $userIDnum ?>"> ` in my HTML and `var userinfo = document.querySelector('#user'); alert(userinfo.dataset.number);` in the script. Unfortunately, userinfo.dataset.number returns 'SCRIPT5007: Unable to get value of the property 'number': object is null or undefined` in IE9, and the majority of users will be using IE9... :/ Any ideas? Regardless, your solution worked - if you post it as an answer I can select it. Thanks again!

http://stackoverflow.com/comment/45909061
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28818335
type: Comment
has text: Updated my code to reflect the html. I have checked the scopes for my elements using Java Script and they are in different scopes.

http://stackoverflow.com/comment/45966992
type: Comment
has text: Hmm, apparently i did something wrong somewhere, the code in the plnkr fixed my issue :)
comment on: http://stackoverflow.com/a/28849226
type: AnswerComment
score: 0

http://stackoverflow.com/comment/46027361
type: QuestionComment
comment on: http://stackoverflow.com/q/28883097
type: Comment
has text: Add the variables to the `window` object, as thats where other global variable are stored (aka `window["attack"] = data[16]`) - not recommended though. it might be better to use a global variable to store variables _in_ and them request them from that object (aka `var settings = {}` globally, `settings[attack] = data[16]` to se it and `settings.attack` to retrieve.).
score: 0

http://stackoverflow.com/q/28861912
tagged with: javascript
has comment: http://stackoverflow.com/comment/45992160
tagged with: user-experience
has body: I have a directive which is for an sticky sidebar, everything is OK on the top of the page, the issue I have is on the footer, I need to do something that dynamically catches the height of the screen or the screen resolution this my directive .directive('sticky', function($document, $timeout) { return { restrict: 'A', link: function(scope, element) { var width = $document.width(); if (width &gt; 991) { $timeout(function() { angular.element($document).ready(function() { var stickySidebar = element, stickyHeight, sidebarTop, scrollTop, stickyStop, sidebarBottom, stopPosition; if (stickySidebar.length &gt; 0) { stickyHeight = stickySidebar.height(); sidebarTop = stickySidebar.offset().top; } $document.scroll(function() { if (stickySidebar.length &gt; 0) { scrollTop = $document.scrollTop() + 52; //stkicy responds to the navbar if (sidebarTop &lt; scrollTop) { stickySidebar.css('top', scrollTop - sidebarTop); sidebarBottom = stickySidebar.offset().top + stickyHeight; stickyStop = $('.main-content').offset().top + $('.main-content').height(); if (stickyStop &lt; sidebarBottom) { stopPosition = $('.main-content').height() - stickyHeight; stickySidebar.css('top', stopPosition); } } else { stickySidebar.css('top', '0'); } } }); $document.resize(function() { if (stickySidebar.length &gt; 0) { stickyHeight = stickySidebar.height(); } }); }); }, 1000); }else { console.log('do not apply function because the size is not the proper one'); } } }; }); look at the image here, this is the proper behavior but in a very big resolution screen, as you can see the red label below is the margin that I want to give to every resolution screen and this is the one in 13&quot; laptop as you can see there is no margin so the Sticky element on the left doesn't work if it is the same height of the screen, I want to give that same margin on every single resolution as in the first image, how can I do that with my directive ?
favorite count: 0
has title: how to calculate the height of an element on document.ready?
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45994854
upvote count: 1
tagged with: css
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/45989143
type: Question
downvote count: 0

http://stackoverflow.com/comment/45918526
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28823411
has text: I have tried the solution you have proposed but without luck fixing the issue. I tried logging the pass through the loop, it passed 95 times, so then I changed the `var locations = [json]` and then it passed only once. However the marker is still not shown :( I tried manually centering the map to the exact coordinates passed. Also, if I pass more info in json, it still says one, so I assume I have to slice it and fix it.
score: 0

http://stackoverflow.com/comment/46068538
comment on: http://stackoverflow.com/a/28894832
type: AnswerComment
score: 0
has text: I think that you should add `MainElement+'='+ChildElement` in both cases, but if it's working... ;)
type: Comment

http://stackoverflow.com/q/28831185
has comment: http://stackoverflow.com/comment/45932118
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/28831856
has body: I put a panel inside a bootstrap dropdown, but when I click inside the panel, the dropdown goes away. I got many solution on stackoverflow but it didn't work for me. How can i prevent panel from disappearing when i click inside.enter code here Advanced Search Panel content
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28831701
type: Question
has title: Dropdown menu should not be closed if it is clicked inside
answer count: 2
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/39187922
has body: This is not a direct answer with source code building the part of your application to your spec. This is really not an easy thing to do. You're right - the way to solving this problem is to use a contenteditable="true" container. But I'm afraid that from there it gets much much more complicated. Enter DraftJS - A javascript solution to rich-text editing which does most of the heavy lifting for you. Both of my solutions below require the use of both React and DraftJS The Plug-&amp;-Play Solution: The React + DraftJS + Someone Else's "Plugin" solution is already here. You can check out draft-js-plugins.com. And here's the Github source code. Personally, I wouldn't go this way. I would rather study their GitHub source code and implement my own DraftJS entities. Because I think that React-JS-Plugins feels a little bit clunky and overweight for just Links and Mentions. Plus, where are you "mentioning" from? Your own Application? Twitter? Doing it this way lets you have control over where you're grabbing the so-called "mentions". The DIY Solution: The best way I have found is to build your own set of working entities on top of a DraftJS based rich-text editor. This of course also requires that you're using React. Forgive me for not actually building a complete set of working code. I was interested in doing something similar for an App I'm building in Meteor with React on the front-end. So this really made sense to me because I'd only be adding one more library (DraftJS) and the rest would be my custom entities coded out.
score: 7
answers question: http://stackoverflow.com/q/28820293
downvote count: 0
has comment: http://stackoverflow.com/comment/131269262
type: Answer
upvote count: 7
has comment: http://stackoverflow.com/comment/130626087

http://stackoverflow.com/comment/45981921
type: Comment
comment on: http://stackoverflow.com/a/28857351
has text: It does not behave as an edit control would by default — and I can't find any docs on how to make it behave as it does on SO.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45786037
comment on: http://stackoverflow.com/a/28751777
type: Comment
has text: How's the target class? hospitality-expanded? If that's the case, you can remove the "color" class and and -expanded to the remaining class
score: 0
type: AnswerComment

http://stackoverflow.com/q/28886382
type: AnsweredQuestion
tagged with: leaflet
downvote count: 0
score: 1
has title: Mapbox JS markers not being removed using .removeLayer()
type: Question
accepted answer: http://stackoverflow.com/a/28886557
tagged with: javascript
has answer: http://stackoverflow.com/a/28886557
has body: I have a function that successfully adds markers to a map using the mapbox javascript library. However, I want the function to clear all markers from the map before adding two new ones, so that only two markers are showing at a time. I have looked at other questions/answers here, but none of them have worked so far; markers are just continually added without being removed. var map = L.mapbox.map(...); function updateMarkers(d) { var featureLayer = L.mapbox.featureLayer(); map.removeLayer(featureLayer); getCoordX = d.stn_f_c; getCoordX = getCoordX.split(","); getCoordY = d.stn_t_c; getCoordY = getCoordY.split(","); featureLayer = L.marker([getCoordX[0],getCoordX[1]], { icon: L.mapbox.marker.icon({ 'marker-size': 'large', 'marker-symbol': 'bicycle', 'marker-color': '#66CD00' }) }).addTo(map); featureLayer += L.marker([getCoordY[0],getCoordY[1]], { icon: L.mapbox.marker.icon({ 'marker-size': 'large', 'marker-symbol': 'bicycle', 'marker-color': '#FF6666' }) }).addTo(map); } Thank you in advance for any assistance.
upvote count: 1
answer count: 1
favorite count: 0
tagged with: mapbox

http://stackoverflow.com/comment/46054689
type: QuestionComment
comment on: http://stackoverflow.com/q/28897488
type: Comment
has text: I haven't errors, i get values from rest successful , when i use one check box everything is ok, but when we have check list chekboxes ara not cheked
score: 0

http://stackoverflow.com/a/28761953
score: -1
answers question: http://stackoverflow.com/q/28761585
downvote count: 1
type: Answer
upvote count: 0
has body: You are using the "controller as" syntax and referring to your data through your controller, but the controller is placing the data in the $scope. Do: app.controller('CatController', function($scope, Category) { var self = this; Category.query(function(data) { self.categories = data; }); }); EDIT: As per the comment, this did not refer to the correct object (the controller).
has comment: http://stackoverflow.com/comment/45803616

http://stackoverflow.com/q/28881288
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/46026330
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/46024833
has comment: http://stackoverflow.com/comment/46032510
tagged with: codeigniter
has body: I am trying to learn MVC with phpcodeigniter. I got a project file with all the codes and my task is just to learn from them simply by running the files using xamp. All the bits are doing fine but, whenever I try to create a new user with the form, I get a an instant message next to the RTC-ID saying "user already existing" and the submit button disappears! even though there is no data loaded in the database (tried to upload the image for this issue but I am not permitted to do so). I am trying to find out why this error is showing up. I have tried to look up where this issue is from and found this codes acting on the form and the data. These are some of the code snippets which creates the new user. I have tried to solve this issues for many days. I will be really grateful if someone could kindly help me solve the issue and I am not sure if I am posting at the right forum my apologies. Thank you! views/rtc.php <form action="<?= site_url('form/rtc_insert'); ?>" method="post"> RTC ID: Name: Country: Select Country New zealand District: Village: Address: Controller/form.php function rtc_insert() { $session_user=$this->session->userdata('logged_in'); if($session_user['ath']=='admin') { $msg = $this->form_model->rtc_ins(); redirect('form/rtc/You Have Successfully Created '.$msg); } else { echo ' '; redirect('login/home'); } } models/form_model.php function rtc_ins() { $session_user=$this->session->userdata('logged_in'); $sysdat = date("Y-m-j H:i:s"); $data= array( 'id' => $this->input->post('id'), 'name' => $this->input->post('name'), 'country' => $this->input->post('country'), 'city' => $this->input->post('city'), 'state' => $this->input->post('state'), 'address' => $this->input->post('address'), 'cre_name' => $session_user['username'], 'cre_date' => $sysdat ); $this->db->insert('rtc_info',$data); return $this->input->post('id'); // echo " "; // print_r($_POST); } models/ajax_models.php public function rtc_reg_id($id) { $query = $this->db->get_where('rtc_info',array('id…
has comment: http://stackoverflow.com/comment/46024958
answer count: 0
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46032225
tagged with: ajax
has title: User ID already exist even before the form is submitted
has comment: http://stackoverflow.com/comment/46024406
downvote count: 0
linked to: http://stackoverflow.com/q/21533285
score: 1
has comment: http://stackoverflow.com/comment/46023874

http://stackoverflow.com/q/28775339
downvote count: 1
linked to: http://stackoverflow.com/q/20744628
score: -1
type: Question
has comment: http://stackoverflow.com/comment/45828976
tagged with: google-maps
upvote count: 0
answer count: 1
has body: I'm looking for a way to compress the tiles from a Google Map (which I've already done) and then somehow replace the old tiles with the compressed tiles. This is how a tile looks in the code, for example:&lt;img src="https://mts1.googleapis.com/vt?pb=!1m4!1m3!1i13!2i2475!3i3029!2m3!1e0!2sm!3i293208756!3m9!2sen-US!3sUS!5e18!12m1!1e47!12m3!1e37!2m1!1ssmartmaps!4e0!5m1!5f2" draggable="false" style="width: 256px; height: 256px; -webkit-user-select: none; border: 0px; padding: 0px; margin: 0px;"&gt; The reason I want to do this is because Google PageSpeed Insights keeps complaining: Should Fix: Optimize images Properly formatting and compressing images can save many bytes of data. Optimize the following images to reduce their size by 245.2KiB (17% reduction). (And all of the images it wants me to optimize are from the map.) I haven't been able to find anything googling around, so I don't even know if it's possible to do what I'm asking. Any ideas?
tagged with: javascript
has answer: http://stackoverflow.com/a/28775460
tagged with: google-maps-api-3
tagged with: http://stackoverflow.com/tag/html
has title: Compressing Google Maps Tiles
favorite count: 0
tagged with: image-compression
type: UnansweredQuestion

http://stackoverflow.com/comment/45831984
type: QuestionComment
has text: Stack Overflow has [many other questions that are very similar to this one](https://www.google.com/?gws_rd=ssl#q=site:stackoverflow.com+javascript+gpa+calculator).
score: 1
comment on: http://stackoverflow.com/q/28776904
type: Comment

http://stackoverflow.com/a/28901571
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28901570
has body: Investigating this further, it seems that if you send "undefined" as the 3rd praameter, then you can use this call as a promise, like: gapi.client.load('guestbook', 'v1', undefined, '/_ah/api').then(function() { $scope.is_backend_ready = true; $scope.list(); }); I haven't seen any google documentation of this. Please let me know if this exists.
upvote count: 1
type: Answer

http://stackoverflow.com/comment/45875764
has text: Where is this code failing? I can see at least one issue in that you don't save the password after you've replaced it.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28780638
score: 0

http://stackoverflow.com/comment/45979941
has text: Yes.. @DLeh is right...so either this can be resolved by making ajax call sync or else if you can put return false into success.
comment on: http://stackoverflow.com/q/28856938
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45940050
has text: It doesn't update. If I have 8 items on my D3 chart, and leave the page, do stuff so I should have 9 items on the chart. When I go again on the chart page I still have 8 items... unless I restart the application :(
comment on: http://stackoverflow.com/a/28834974
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45971773
comment on: http://stackoverflow.com/q/28852536
type: QuestionComment
type: Comment
score: 2
has text: You need to learn about forms, a server side programming language and multipart MIME emails. It's far too broad a topic for a Stackoverflow question.

http://stackoverflow.com/comment/105184281
type: AnswerComment
comment on: http://stackoverflow.com/a/54344724
score: 0
type: Comment
has text: @Kelly The symbols you are referring to are a *regular expression*. It's kind of like a mini-programming language for parsing text. Here's a link to where you can learn more about each symbol: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions

http://stackoverflow.com/comment/68740825
comment on: http://stackoverflow.com/a/40706580
score: 2
has text: ok, could we agree first, that this is not clear, barely subjective, controversial topic? What if somebody write answers and explanations instead of me? How it will change the discourse?
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28881812
type: AcceptedAnswer
has body: Object.prototype.toString basically returns the Class (implementation detail) internal property of the objects. Quoting the section from ECMA Script 5.1 specification, where this is defined If the this value is undefined, return "[object Undefined]". If the this value is null, return "[object Null]". Let O be the result of calling ToObject passing the this value as the argument. Let class be the value of the Class internal property of O. Return the String value that is the result of concatenating the three Strings "[object ", class, and "]". Also, The value of the Class internal property is defined by this specification for every kind of built-in object. The value of the Class internal property of a host object may be any String value except one of "Arguments", "Array", "Boolean", "Date", "Error", "Function", "JSON", "Math", "Number", "Object", "RegExp", and "String". The value of a Class internal property is used internally to distinguish different kinds of objects. Note that this specification does not provide any means for a program to access that value except through Object.prototype.toString. So, Object.prototype.toString is the only function which can access the Class property.
type: Answer
downvote count: 0
score: 7
accepted answer of: http://stackoverflow.com/q/28881720
answers question: http://stackoverflow.com/q/28881720
upvote count: 7

http://stackoverflow.com/q/28892342
tagged with: http://stackoverflow.com/tag/csv
has body: I've created this macro script in .js. But there's a problem with looping. Attached the script here : http://justpaste.it/js5j You can see there're 2 datasources. Sites.csv DB.csv What I want to do is, Go to COL1 in sites csv and loop the db.csv 10 times. And then go to COL2 in sites.csv DB.csv works fine, but in the second main loop, it doesn't go to COL2. In other words DATASOURCE Line is always 1 How can I make this work. Tires alot, But still couldn't figure it out. Need you guys help. Thank you.
has answer: http://stackoverflow.com/a/32727515
has title: imacros javascript datasource line loop
type: UnansweredQuestion
tagged with: imacros
type: Question
answer count: 1
tagged with: javascript
score: 0

http://stackoverflow.com/a/28823534
accepted answer of: http://stackoverflow.com/q/28823152
downvote count: 0
answers question: http://stackoverflow.com/q/28823152
score: 1
has comment: http://stackoverflow.com/comment/45919637
type: AcceptedAnswer
upvote count: 1
type: Answer
has body: The canvas drawing function uses the projected values of the lat/long co-ordinates, but you're not updating the scale and translate of your projection in your zoom handler. One way to get the behavior that you're after, is to switch from a transform on the svg in the zoom handler, to a transform on the projection. I have done just that in this updated fiddle: http://jsfiddle.net/30w8nv4t/7/ The differences are: Update the zoom behavior to use the projection translate and scale as the default values, and to set the scaleExtent values to be based on the projection as well. var zoom = d3.behavior.zoom() .translate(projection.translate()) .scale(projection.scale()) .scaleExtent([projection.scale()/5, projection.scale()*5]) .on("zoom", zoomed); Update your zoomed function to translate and scale the projection and then redraw the svg based paths. function zoomed(d) { //g.style("stroke-width", 1.5 / d3.event.scale + "px"); //g.attr("transform", "translate(" + d3.event.translate + ")scale(" + d3.event.scale + ")"); projection.translate(d3.event.translate).scale(d3.event.scale); g.selectAll("path").attr("d", path); var zTranslate = zoom.translate(); var zScale = zoom.scale(); console.log(zTranslate, zScale, d); context.clearRect(0, 0, width, height); context.beginPath(); canvasPath(states); context.stroke(); } Update your clicked function accordingly. function clicked(d) { if (active.node() === this) { zoom.scale(500).translate([width/2, height/2]); active.classed("active", false); active = d3.select(null); } else { var centroid = path.centroid(d), translate = zoom.translate(), bounds = path.bounds(d), dx = bounds[1][0] - bounds[0][0], dy = bounds[1][1] - bounds[0][1], scale = .9/ Math.max(dx / width, dy / height); zoom.scale(scale * zoom.scale()) .translate([ translate[0] - centroid[0] * scale + width * scale / 2, translate[1] - centroid[1] * scale + height * scale / 2]); active.classed("active", false); active = d3.select(this).classed("active", true); } zoom.event(svg); }…

http://stackoverflow.com/q/28842569
tagged with: material-design
has answer: http://stackoverflow.com/a/45075082
has body: Does Angular Material Design require an input ng-model to be equal to a variable in order for required to work? Without using Material Design, the following error checking works perfectly fine. First Name (as it appears on your card) Using Material Design though, the following always returns invalid unless the user types something, deletes it, and types something else. First Name (as it appears on your card) However, I set test equal to something in the scope, then error checking works fine: $scope.test = 'this value'; Is there a way to error check using Material Design without needing to specify a default value for fields?
type: Question
tagged with: angular-ngmodel
has comment: http://stackoverflow.com/comment/45955009
answer count: 1
tagged with: javascript
has title: material design angular input require
score: 0
tagged with: angularjs
tagged with: required
has comment: http://stackoverflow.com/comment/45954601
has comment: http://stackoverflow.com/comment/45954947
has comment: http://stackoverflow.com/comment/46291976
type: UnansweredQuestion

http://stackoverflow.com/a/28878120
score: 2
has body: The desired outcome is for the child template to access a result of the parent's helper. You can do this by setting the context of the photoGallery template like so: {{&gt; photoGallery post}} Now, inside of photoGallery, the context is a post so we can iterate over the photos: &lt;template name="photoGallery"&gt; {{#each photos}} &lt;img src="{{src}}"&gt; {{/each}} &lt;/template&gt;
answers question: http://stackoverflow.com/q/28877540
accepted answer of: http://stackoverflow.com/q/28877540
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer

http://stackoverflow.com/comment/46269683
type: AnswerComment
comment on: http://stackoverflow.com/a/28866943
score: 0
type: Comment
has text: @KrishnaNandan thanks Krishna, glad I could help. A good starting point could be f.ex. [it-ebooks.info](http://it-ebooks.info/book/1361/). I haven't read these, but you will likely find one that suits need and area.

http://stackoverflow.com/q/28754626
tagged with: ember.js
has comment: http://stackoverflow.com/comment/45790981
tagged with: ember-cli
has comment: http://stackoverflow.com/comment/45821507
has comment: http://stackoverflow.com/comment/45822741
type: UnansweredQuestion
has body: I am cloning this project to run locally. These are the steps i have done in my Terminal git clone https://github.com/lrdiv/ember-soundcloud.git cd ember soundcloud ember install ember server I got this errors in my Terminal: And this is what i see in my http://localhost:4200/ Server is runnings, so this is good sign! but how can i fix it?
has comment: http://stackoverflow.com/comment/45790932
type: Question
answer count: 1
has answer: http://stackoverflow.com/a/28771341
tagged with: javascript
has title: Ember - Cli Error: spawn ENOENT
score: 0

http://stackoverflow.com/a/28811370
accepted answer of: http://stackoverflow.com/q/28811285
score: 2
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28811285
type: Answer
upvote count: 2
has body: You could do something like this: var found = false; for (i = 1; i &lt; jsonml.length; i++) { if (jsonml[i][0] === 'hr') { var hr = jsonml[i] console.log(hr); found = true; // outputs: [ 'hr' ] } else if (jsonml[i][0] === 'para' &amp;&amp; found) { var para = jsonml[i]; console.log(para); // process or escape the loop } }

http://stackoverflow.com/comment/46028947
type: Comment
type: QuestionComment
score: 0
has text: Is there a particular reason you have to use GET params and not POST data for this?
comment on: http://stackoverflow.com/q/28883723

http://stackoverflow.com/q/28851782
accepted answer: http://stackoverflow.com/a/28852332
score: 0
tagged with: calendar
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28852332
has body: I am making a .net MVC aplication, and I recreated the problem in fiddle. When I attempt to change my date, the calendar just stays there and when I click elsewhere on the screen the calendar goes but the other date gets erased. I just want the calendar to disappear when I select the date, and not have the other date erased. $('#from').datepicker({ inline: true, showOtherMonths: true, dateFormat: 'dd.mm.yy.', firstDay: 1, changeMonth: true, changeYear: true, yearRange: "-50:+50", onClose: function (selectedDate) { $("#to").datepicker("option", "minDate", selectedDate); } }); $('#to').datepicker({ inline: true, showOtherMonths: true, dateFormat: 'dd.mm.yy.', firstDay: 1, changeMonth: true, changeYear: true, yearRange: "-50:+50", onClose: function (selectedDate) { $("#from").datepicker("option", "maxDate", selectedDate); } }); $(".dates").change(function () { var dateFrom = $("#from").val(); //check that there is data before saving into sessionStorage if (dateFrom.value.length &gt;= 8) sessionStorage.setItem("fromDate", this.value) var dateTo = $("#to").val(); //check that there is data before saving into sessionStorage if (dateTo.value.length &gt;= 8) sessionStorage.setItem("toDate", dateTo) if (dateTo != null &amp;&amp; dateFrom !=null) { $.ajax({ url: '/MainPage/DateSessionCreate', type: 'POST', data: { "dateTo": dateTo, "dateFrom": dateFrom }, dataType: 'json' }); } else { alert("one of the dates is null"); } }); var today = new Date(); var curr_date = today.getDate(); var curr_month = today.getMonth(); curr_month++; var curr_year = today.getFullYear(); var toDate = ""; //check if there's a to Date in sessionStorage if (sessionStorage.getItem("toDate")) { toDate = sessionStorage.getItem("toDate"); sessionStorage.setItem("toDate", toDate); } else { toDate = curr_date + "." + curr_month + "." + curr_year; sessionStorage.setItem("toDate", toDate); if (toDate != null) { $.ajax({ url: '/MainPage/DateSessionCreate', type: 'POST', data: { "dateTo": toDate}, dataType: 'js…
tagged with: date
type: Question
tagged with: jquery-ui
answer count: 1
tagged with: javascript
tagged with: jquery
has title: Why does Jquery UI erase my input box?

http://stackoverflow.com/a/28852027
has body: You can use also jquery like : $("body").css("background-color", color);
answers question: http://stackoverflow.com/q/28851318
downvote count: 0
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/45972050
score: 1

http://stackoverflow.com/comment/45989521
type: Comment
comment on: http://stackoverflow.com/a/28862071
has text: Its doing that behavior now. The JavaScript function is an OnChange handler that submits the form.Can I do it without submitting the form?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45803763
type: QuestionComment
has text: What values have variables `left, top, step`? Can you add it to `console.log()` ?
comment on: http://stackoverflow.com/q/28762045
score: 0
type: Comment

http://stackoverflow.com/comment/45957691
score: 0
comment on: http://stackoverflow.com/q/28844376
type: Comment
type: QuestionComment
has text: Any chance you could dump an example of what comicID is? Just to make sure there aren't any unexpected characters like `"'images/0.jpg'"`

http://stackoverflow.com/comment/45948608
score: 1
type: Comment
type: QuestionComment
has text: This is quite weird. You probably want something else to be aware of all the inputs and decide to add a new input, rather than place this directive on each and every input. If we knew what you tried to do perhaps we could offer a better design.
comment on: http://stackoverflow.com/q/28839528

http://stackoverflow.com/comment/45874785
type: AnswerComment
comment on: http://stackoverflow.com/a/28800279
score: 0
type: Comment
has text: @davisec52 - I added a second version of the code that will work with versions of IE earlier than IE9.

jquery
tags question: http://stackoverflow.com/q/28874440
tags question: http://stackoverflow.com/q/28843505
tags question: http://stackoverflow.com/q/28904237
tags question: http://stackoverflow.com/q/28904965
tags question: http://stackoverflow.com/q/28827025
tags question: http://stackoverflow.com/q/28765472
tags question: http://stackoverflow.com/q/28773130
tags question: http://stackoverflow.com/q/28898795
tags question: http://stackoverflow.com/q/28866734
tags question: http://stackoverflow.com/q/28794325
tags question: http://stackoverflow.com/q/28840777
tags question: http://stackoverflow.com/q/28807051
tags question: http://stackoverflow.com/q/28892839
tags question: http://stackoverflow.com/q/28751959
tags question: http://stackoverflow.com/q/28759011
tags question: http://stackoverflow.com/q/28828165
tags question: http://stackoverflow.com/q/28868583
tags question: http://stackoverflow.com/q/28838071
tags question: http://stackoverflow.com/q/28855576
tags question: http://stackoverflow.com/q/28813279
tags question: http://stackoverflow.com/q/28845442
tags question: http://stackoverflow.com/q/28767736
tags question: http://stackoverflow.com/q/28833403
tags question: http://stackoverflow.com/q/28869151
tags question: http://stackoverflow.com/q/28837616
tags question: http://stackoverflow.com/q/28867748
tags question: http://stackoverflow.com/q/28894967
tags question: http://stackoverflow.com/q/28861400
tags question: http://stackoverflow.com/q/28805282
tags question: http://stackoverflow.com/q/28755070
tags question: http://stackoverflow.com/q/28836727
tags question: http://stackoverflow.com/q/28798856
tags question: http://stackoverflow.com/q/28835137
tags question: http://stackoverflow.com/q/28854237
tags question: http://stackoverflow.com/q/28813527
tags question: http://stackoverflow.com/q/28818988
tags question: http://stackoverflow.com/q/28853341
tags question: http://stackoverflow.com/q/28774397
tags question: http://stackoverflow.com/q/28770445
tags question: http://stackoverflow.com/q/28844878
tags question: http://stackoverflow.com/q/28854577
tags question: http://stackoverflow.com/q/28782562
tags question: http://stackoverflow.com/q/28797931
tags question: http://stackoverflow.com/q/28828845
tags question: http://stackoverflow.com/q/28793312
tags question: http://stackoverflow.com/q/28845580
tags question: http://stackoverflow.com/q/28813349
tags question: http://stackoverflow.com/q/28861792
tags question: http://stackoverflow.com/q/28866670
tags question: http://stackoverflow.com/q/28774302
tags question: http://stackoverflow.com/q/28758520
tags question: http://stackoverflow.com/q/28757063
tags question: http://stackoverflow.com/q/28775308
tags question: http://stackoverflow.com/q/28774372
tags question: http://stackoverflow.com/q/28754606
tags question: http://stackoverflow.com/q/28828388
tags question: http://stackoverflow.com/q/28763551
tags question: http://stackoverflow.com/q/28784078
tags question: http://stackoverflow.com/q/28806174
tags question: http://stackoverflow.com/q/28774736
tags question: http://stackoverflow.com/q/28858731
tags question: http://stackoverflow.com/q/28806682
tags question: http://stackoverflow.com/q/28874740
tags question: http://stackoverflow.com/q/28871628
tags question: http://stackoverflow.com/q/28903418
tags question: http://stackoverflow.com/q/28791944
tags question: http://stackoverflow.com/q/28828001
tags question: http://stackoverflow.com/q/28845569
tags question: http://stackoverflow.com/q/28809759
tags question: http://stackoverflow.com/q/28900497
tags question: http://stackoverflow.com/q/28873949
tags question: http://stackoverflow.com/q/28897225
tags question: http://stackoverflow.com/q/28766468
tags question: http://stackoverflow.com/q/28780967
tags question: http://stackoverflow.com/q/28793450
tags question: http://stackoverflow.com/q/28805855
tags question: http://stackoverflow.com/q/28760045
tags question: http://stackoverflow.com/q/28881519
tags question: http://stackoverflow.com/q/28756219
tags question: http://stackoverflow.com/q/28840339

http://stackoverflow.com/q/28855254
has answer: http://stackoverflow.com/a/28855314
favorite count: 0
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/28855314
downvote count: 1
tagged with: node.js
accepted answer: http://stackoverflow.com/a/28855279
tagged with: supertest
score: 0
upvote count: 1
tagged with: javascript
has title: Getting "TypeError: object is not a function" when using supertest/superagent in forEach loop
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28855279
tagged with: superagent
has body: I'm using supertest to test a set of URLs by the same rules. var urls = [ "https://www.example.com", "https://www.example2.com" ]; urls.forEach(function (url) { console.log('begin'); request = request(url) .get('') .expect(200) .end(function (err, res) { // Check for something }); console.log('end'); }); When there is only 1 URL in the array, it works just fine. If I add a 2nd one, however, it fails with the output: begin end begin file.js:11 request = request(json) ^ TypeError: object is not a function My guess is that I can't have 1 instance of supertest running twice, but I can't seem to find a solution to work around this. Any help is appreciated.

http://stackoverflow.com/comment/45976945
has text: Yes running on localhost
comment on: http://stackoverflow.com/a/28854293
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28790564
upvote count: 2
has body: buildBoundDetector() is a function that returns a function. In Javascript, you can assign a function to a variable. That's what buildBoundDetector() does. It defines an anonymous function, then assigns it to isBetween, then returns isBetween. f is set to the result of buildBoundDetector(), which is that function. Because f is a function, you can call it.
score: 2
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28790546

http://stackoverflow.com/a/28864954
score: 9
has comment: http://stackoverflow.com/comment/45995087
has comment: http://stackoverflow.com/comment/45995197
type: AcceptedAnswer
upvote count: 9
accepted answer of: http://stackoverflow.com/q/28864940
answers question: http://stackoverflow.com/q/28864940
type: Answer
has comment: http://stackoverflow.com/comment/45995229
downvote count: 0
has body: Because var glorp; //&lt;--undefined console.log(glorp); //logs undefined glorp = glorp + "x"; // undefined + "x" -&gt; "undefined" + "x" -&gt; "undefinedx" console.log(glorp); //logs "undefinedx" set it to an empty string var glorp = "";

http://stackoverflow.com/q/28867035
downvote count: 1
has title: Javascript <--> XHTML troubles
has answer: http://stackoverflow.com/a/28867421
type: AnsweredQuestion
score: -1
has comment: http://stackoverflow.com/comment/45999202
type: Question
answer count: 2
upvote count: 0
tagged with: http://stackoverflow.com/tag/xhtml
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28867421
has body: Sorry, I am reallllly new to Javascript/HTML. Okay so I am writing a program that shows the user a form. On that form they enter the price of an object they bought and click the shipping they want (standard or expedited). Then they click calculate and then it will show the S&H price, tax, and the total of the order. So the problem I am having is being able to communicate between the javascript code and the html form. We are also using very bacis techniques so I do not know how to do anything advanced. the code is here: Price: $ Shipping Method (Please only select one) <Label>Standard Expedited S&H Charges: Tax (@6.00%): Total Price:
possible better answer: http://stackoverflow.com/a/28867129
has answer: http://stackoverflow.com/a/28867129
has comment: http://stackoverflow.com/comment/45999128
favorite count: 0

http://stackoverflow.com/comment/45821252
comment on: http://stackoverflow.com/a/28771102
type: Comment
has text: ah good. Its always good to have a good IDE. ok, well if that solved your problem make sure to accept my answer, unless you have more questions
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45898092
type: QuestionComment
comment on: http://stackoverflow.com/q/28812984
type: Comment
has text: What happened to the braces?
score: 1

http://stackoverflow.com/a/28807922
score: 0
type: Answer
has body: Not exactly sure what you need but maybe this will point you in the right direction: $(document).ready(function(){ $('.rdbtn').click(function(){ $('.first').hide(); //if you want to hide one that is already shown $(this).closest('.container').find('.first').show(); }); }); Demo It uses $(this) to get the clicked radio, then uses it as an anchor point. It uses closest, which works up the way to find the parent container and then finds the button you want inside only that container.
has comment: http://stackoverflow.com/comment/45889397
has comment: http://stackoverflow.com/comment/45889233
has comment: http://stackoverflow.com/comment/45889021
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28807711
answers question: http://stackoverflow.com/q/28807711

http://stackoverflow.com/a/28826988
has comment: http://stackoverflow.com/comment/45924693
has comment: http://stackoverflow.com/comment/45924594
has comment: http://stackoverflow.com/comment/45925326
has comment: http://stackoverflow.com/comment/45925126
upvote count: 4
has comment: http://stackoverflow.com/comment/45924441
downvote count: 0
score: 4
type: AcceptedAnswer
has body: filddle if ($('#datePickersAppearance').is(':empty')) to if ($('.datePickersAppearance').val() == '') document.getElementById("from").innerHTML should be document.getElementById("from").value
has comment: http://stackoverflow.com/comment/45924950
accepted answer of: http://stackoverflow.com/q/28826955
type: Answer
answers question: http://stackoverflow.com/q/28826955

http://stackoverflow.com/q/28842921
tagged with: javascript
has body: Essentially I have a page I made in Bootstrap, where the top 60% of the page is taken up by a fluid container. I want the bottom 40% to consist of four clickable Accordion panels at 10% each. I have set this up, but the problem is I cannot change the size of the panels. If you follow this link, you can see what I've already created. http://bootstrapissue.s3-website-us-west-2.amazonaws.com The image below shows what I am trying to accomplish. https://i.sstatic.net/VMGUd.png Any help would be GREATLY appreciated.
score: 0
has title: Bootstrap 3 Accordion Panel Issue
answer count: 1
has answer: http://stackoverflow.com/a/28843018
tagged with: twitter-bootstrap
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28843018
type: Question

http://stackoverflow.com/comment/45967594
comment on: http://stackoverflow.com/q/28849981
score: 0
type: Comment
type: QuestionComment
has text: `code.jquery.com/jquery- 1.8.0.min.js`, where is the problem?? It leaped out at me

http://stackoverflow.com/comment/45928863
comment on: http://stackoverflow.com/q/28829299
type: QuestionComment
has text: _an array named "tdaPages"_ yes that would be same for all.
score: 0
type: Comment

http://stackoverflow.com/q/28886008
linked to: http://stackoverflow.com/q/20774648
has title: Texture rendering problems
tagged with: 3d
tagged with: javascript
has body: Hej there, i have a problem with the rendering of a texture on an OBJ imported model. In this image you can see, how the texture is rendered. and here you can see how the texture should look (mapped to the object) And here is my code: loader = new THREE.ImageLoader(); loader.load('./tex/Stuhl1-vorn.jpg', function (image) { var imageObj = new Image(); imageObj.src = $(image).prop('src'); var canvas = document.createElement("canvas"); canvas.width = imageObj.width; canvas.height = imageObj.height; var ctx = canvas.getContext("2d"); ctx.drawImage(imageObj, 0, 0, imageObj.width, imageObj.height, 0, 0, canvas.width, canvas.height); texture.image = canvas; texture.needsUpdate = true; }); var material = new THREE.MeshLambertMaterial({ map: texture, needsUpdate: true }); var loader = new THREE.OBJLoader(manager); loader.load('obj/sitz.obj', function (object) { object.traverse(function (child) { if (child instanceof THREE.Mesh) { child.material = material; child.side = THREE.FrontSide; } }); object.position.y = -400; scene.add(object); }, onProgress, onError);
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28900015
type: UnansweredQuestion
tagged with: three.js
type: Question

http://stackoverflow.com/comment/46037869
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28884903
has text: @derekmx271 You are welcome:) Try `if (!!styles[styleId].Color) { // do stuff };` http://jsfiddle.net/yao01h4b/11/
type: AnswerComment

css
tags question: http://stackoverflow.com/q/28881160
tags question: http://stackoverflow.com/q/28886028
tags question: http://stackoverflow.com/q/28901773
tags question: http://stackoverflow.com/q/28839901
tags question: http://stackoverflow.com/q/28869396
tags question: http://stackoverflow.com/q/28798815
tags question: http://stackoverflow.com/q/28874932
tags question: http://stackoverflow.com/q/28877476
tags question: http://stackoverflow.com/q/28899347
tags question: http://stackoverflow.com/q/28893580
tags question: http://stackoverflow.com/q/28895845
tags question: http://stackoverflow.com/q/28859204
tags question: http://stackoverflow.com/q/28861379
tags question: http://stackoverflow.com/q/28825231
tags question: http://stackoverflow.com/q/28791660
tags question: http://stackoverflow.com/q/28866538
tags question: http://stackoverflow.com/q/28815007
tags question: http://stackoverflow.com/q/28885931
tags question: http://stackoverflow.com/q/28873727
tags question: http://stackoverflow.com/q/28826714
tags question: http://stackoverflow.com/q/28790209
tags question: http://stackoverflow.com/q/28868653
tags question: http://stackoverflow.com/q/28801075
tags question: http://stackoverflow.com/q/28877830
tags question: http://stackoverflow.com/q/28822298
tags question: http://stackoverflow.com/q/28888452
tags question: http://stackoverflow.com/q/28881085
tags question: http://stackoverflow.com/q/28892053
tags question: http://stackoverflow.com/q/28806693
tags question: http://stackoverflow.com/q/28799351
tags question: http://stackoverflow.com/q/28875038
tags question: http://stackoverflow.com/q/28826176
tags question: http://stackoverflow.com/q/28844396
tags question: http://stackoverflow.com/q/28851318
tags question: http://stackoverflow.com/q/28881986
tags question: http://stackoverflow.com/q/28810394
tags question: http://stackoverflow.com/q/28872084
tags question: http://stackoverflow.com/q/28890714
tags question: http://stackoverflow.com/q/28757343
tags question: http://stackoverflow.com/q/28855031
tags question: http://stackoverflow.com/q/28794240
tags question: http://stackoverflow.com/q/28896014
tags question: http://stackoverflow.com/q/28774119
tags question: http://stackoverflow.com/q/28848132
tags question: http://stackoverflow.com/q/28855693
tags question: http://stackoverflow.com/q/28773200
tags question: http://stackoverflow.com/q/28849564
tags question: http://stackoverflow.com/q/28893021
tags question: http://stackoverflow.com/q/28769567
tags question: http://stackoverflow.com/q/28875769
tags question: http://stackoverflow.com/q/28776711
tags question: http://stackoverflow.com/q/28803931
tags question: http://stackoverflow.com/q/28872369
tags question: http://stackoverflow.com/q/28785164
tags question: http://stackoverflow.com/q/28871628
tags question: http://stackoverflow.com/q/28897715
tags question: http://stackoverflow.com/q/28878897
tags question: http://stackoverflow.com/q/28838038
tags question: http://stackoverflow.com/q/28840183
tags question: http://stackoverflow.com/q/28905512
tags question: http://stackoverflow.com/q/28814046
tags question: http://stackoverflow.com/q/28782166
tags question: http://stackoverflow.com/q/28775318
tags question: http://stackoverflow.com/q/28835704
tags question: http://stackoverflow.com/q/28901783
tags question: http://stackoverflow.com/q/28809897
tags question: http://stackoverflow.com/q/28810668
tags question: http://stackoverflow.com/q/28876672
tags question: http://stackoverflow.com/q/28764532
tags question: http://stackoverflow.com/q/28894486
tags question: http://stackoverflow.com/q/28758145
tags question: http://stackoverflow.com/q/28837044
tags question: http://stackoverflow.com/q/28878638
tags question: http://stackoverflow.com/q/28865362
tags question: http://stackoverflow.com/q/28759574
tags question: http://stackoverflow.com/q/28826400
tags question: http://stackoverflow.com/q/28819821
tags question: http://stackoverflow.com/q/28865472
tags question: http://stackoverflow.com/q/28900530
tags question: http://stackoverflow.com/q/28826178

http://stackoverflow.com/q/28773839
accepted answer: http://stackoverflow.com/a/28774088
favorite count: 0
has answer: http://stackoverflow.com/a/56488457
upvote count: 83
possible better answer: http://stackoverflow.com/a/39756262
has title: React form onChange->setState one step behind
answer count: 10
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/66814471
has answer: http://stackoverflow.com/a/71987360
has answer: http://stackoverflow.com/a/74457461
has answer: http://stackoverflow.com/a/36657304
type: Question
has answer: http://stackoverflow.com/a/28774517
score: 83
has answer: http://stackoverflow.com/a/39756262
has answer: http://stackoverflow.com/a/60586172
tagged with: javascript
has answer: http://stackoverflow.com/a/54242246
has body: I encountered this problem building a webapp and I replicated it in this jsfiddle. Essentially, I would like an input to call this.setState({message: input_val}) every time I type something into it, then pass it into the parent App class which then re-renders the message onto the Message class. However the output seems to always be one step behind what I actually type. The jsfiddle demo should be self explanatory. I am wondering if I did anything wrong to prompt this. html js var App = React.createClass({ getInitialState: function() { return {message: ''} }, appHandleSubmit: function(state) { this.setState({message: state.message}); console.log(this.state.message); }, render: function() { return ( <MyForm onChange={this.appHandleSubmit}/> <Message message={this.state.message}/> ); } }); var MyForm = React.createClass({ handleSubmit: function() { this.props.onChange(this.state); }, handleChange: function(e) { console.log(e.target.value); this.setState({message: e.target.value}); this.handleSubmit(); }, render: function() { return ( ); } }); var Message = React.createClass({ render: function() { return ( {this.props.message} ) } }); React.render( <App />, document.getElementById('app') );
tagged with: reactjs
has answer: http://stackoverflow.com/a/28774088

google-maps-markers
tags question: http://stackoverflow.com/q/28889783
tags question: http://stackoverflow.com/q/28811320
tag name: google-maps-markers
tags question: http://stackoverflow.com/q/28889422
tags question: http://stackoverflow.com/q/28783759
type: Tag
tags question: http://stackoverflow.com/q/28890440
tags question: http://stackoverflow.com/q/28899971

http://stackoverflow.com/a/28868530
type: Answer
accepted answer of: http://stackoverflow.com/q/28867871
has body: React.createElement accepts tag names as strings: Create and return a new ReactElement of the given type. The type argument can be either an html tag name string (eg. 'div', 'span', etc), or a ReactClass (created via React.createClass). Look at your own code example :) React.createElement('div', {className: 'articleContent'}, reactElements ) You could have a lookup for custom component names to the corresponding ReactClass and assume everything else is a regular HTML tag.
upvote count: 1
answers question: http://stackoverflow.com/q/28867871
score: 1
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/45787358
type: QuestionComment
type: Comment
has text: Use the `$compile` service to compile dynamic HTML against the `$scope`
score: 0
comment on: http://stackoverflow.com/q/28752671

http://stackoverflow.com/comment/46002985
type: AnswerComment
has text: the issue is that i have a single string with all of the value in them up front so i wanted to avoid having to parse it into seperate fields to then put it back together again
type: Comment
comment on: http://stackoverflow.com/a/28869249
score: 0

http://stackoverflow.com/comment/56745102
type: QuestionComment
has text: How did you manage to create that evt.clipboardData.getData()?
comment on: http://stackoverflow.com/q/28861479
score: 0
type: Comment

http://stackoverflow.com/comment/45935135
comment on: http://stackoverflow.com/q/28832585
has text: Of course; I corrected my question. If you are sure that it will be parsed, feel free to put this in an answer :)
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28858540
tagged with: dom
type: Question
tagged with: javascript
tagged with: ckeditor
tagged with: jquery
has body: There have been a few related questions on SO about how to remove CKeditor instances, most using .destroy(). This is fine when the editor is still in the dom, however. I have a situation where a CMS is adding a text area, which I am converting to a CKeditor. the cms moves elements from the dom (on an unrelated event). I can bind an event to the complete emit of that unrelated event, so that the CKeditor can be re-initialized. All that works fine but when I come to remove those left over instances I get errors, this is how I tried: for (var name in CKEDITOR.instances) { CKEDITOR.instances[name].destroy(true); } but it generates a error: Uncaught TypeError: Cannot read property 'clearCustomData' of null I have recreated the issue on a jsfiddle You'll see that the code: creates a ckeditor instance from a textarea removes the parent dom element creates new dom elements tried to remove all current instances creates a new ckeditor instance Step 4 generates the error. n.b. related questions on removing ckeditor instances relate to still existing dom elements where in this situation the dom has been removed. I have no control over the dom element being removed. Is there a way to bind an event to the ckeditor triggered when it parent dom elements are removed? I'd assume I'd still hit this issue even if that was the case. Any one any idea? n.b. I am using jQuery in other places in this project, so a solution involving jQuery would be suitable even though I'm not using it in the ckeditor code. UPDATE: I did try setting the instances to null, which does work, but doesn't kill the object created on a CKeditor instance. i.e. CKEDITOR.htmlDataProcessor (using 'Profiles -&gt; Heap snapshot' in Chrome dev tools is a good demo of the issue) UPDATE: Thanks @oleq for the information, I looked at the discussion but couldn't so how to add to it so updated here: Please see the image of mem profiles before and after dom changes. You'll see the size of the CKEDITOR properties really go up. …
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/33307641
tagged with: dom-events
has answer: http://stackoverflow.com/a/33307641
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28862755
has title: How to remove CKeditor instances after the editor has been removed from the DOM
accepted answer: http://stackoverflow.com/a/28862755

http://stackoverflow.com/a/28773555
has comment: http://stackoverflow.com/comment/45825570
has comment: http://stackoverflow.com/comment/45832373
has body: Since you have an ng-repeat on the h2 tag, it will be repeated. <h2 id="saturdayWrap" style="background-color:#FFFFFF; text-transform:uppercase;" ng-repeat="item in artists | filter:{value='Saturday'}" {{item.day}} You might want to have the h2 by itself, and then repeat content below it. Saturday -- You could keep it as-is and have an array of 'days' that you repeat over. On your controller you'd have: $scope.days = ['Saturday', 'Sunday']; And your template {{day}}
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45825687
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/46030744
answers question: http://stackoverflow.com/q/28773083
has comment: http://stackoverflow.com/comment/45992471
has comment: http://stackoverflow.com/comment/45830018
accepted answer of: http://stackoverflow.com/q/28773083
has comment: http://stackoverflow.com/comment/45987706

http://stackoverflow.com/q/28757213
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/28757248
tagged with: jquery
has body: I tried this $('.setting-editor').prev('.visibleWrap').show(); but nothing happened, I think I used the prev() wrongly. Below is my DOM look like
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28757308
has answer: http://stackoverflow.com/a/28757248
has title: jquery prev until class doesn't work in my case
possible better answer: http://stackoverflow.com/a/28757308
type: Question
tagged with: javascript

http://stackoverflow.com/comment/45855261
comment on: http://stackoverflow.com/q/28789398
score: 0
has text: Please don't use images, if it's code, just put it in the question directly as a code block.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45926351
comment on: http://stackoverflow.com/q/28827256
type: Comment
type: QuestionComment
has text: @Barmar...thank sir for trying to help me...and btw i saw this from a tutorial in youtube https://www.youtube.com/watch?v=Y2NYbEjTzE8&list=PLF99B82E8685AA149&index=13
score: 0

http://stackoverflow.com/comment/45887281
type: AnswerComment
type: Comment
has text: Bootstrap uses this technique for its sticky header http://getbootstrap.com/examples/sticky-footer-navbar/
comment on: http://stackoverflow.com/a/28806358
score: 0

http://stackoverflow.com/comment/46094930
has text: pretty unpleasant. So do You have any idea about is there any way to carry clients closure session info in some kind of automated way? I can write those sessions in db to further reconnect users to their rooms and eachother in case of some kind critical failure, but i dont know how can i logically bind just reconnected after error user to his previous session data. Got any guidelines?
type: Comment
comment on: http://stackoverflow.com/a/28918080
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45947626
type: Comment
has text: Check out `event.target` instead of `this`
comment on: http://stackoverflow.com/q/28839091
score: 0
type: QuestionComment

http://stackoverflow.com/q/28877843
has answer: http://stackoverflow.com/a/28880957
has body: I'm using Javascript and I have two Parse tables. One table has a "user" field with that has a pointer to the user table. I want to do a query on the first table where I filter the results by the objectId of the pointer ("user" field). I've tried several things such as using dot notation and containerIn and equalTo or matches query with an inner query. From looking at other sources I get the feeling it's up one of these two allys but clearly I'm not executing well. Here is the code from one of my attempts: var innerQuery = new Parse.Query(Parse.User); innerQuery.equalTo("objectId", conId); //where conId is an array of ObjectIds tQuery.matchesQuery("user", innerQuery); //where "user" is the field in the tQuery table with the pointer to the User table.
tagged with: parse-platform
has title: Sorting Parse results by objectId of pointer
type: Question
accepted answer: http://stackoverflow.com/a/28880957
type: AnsweredQuestion
answer count: 1
tagged with: javascript
tagged with: pointers
score: 0

http://stackoverflow.com/q/28819635
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/58021177
upvote count: 2
has answer: http://stackoverflow.com/a/58021177
has body: I want to tag some words like Facebook when you are posting and tag some people, mixed with text, using jQuery. This is the example:
has comment: http://stackoverflow.com/comment/45911857
type: Question
linked to: http://stackoverflow.com/q/1125292
tagged with: tags
accepted answer: http://stackoverflow.com/a/28833413
has title: How to tag words mixed with text
answer count: 2
score: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45920350
has answer: http://stackoverflow.com/a/28833413

http://stackoverflow.com/q/28838307
tagged with: sinon
tagged with: node.js
answer count: 0
type: UnansweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: javascript
tagged with: mocha.js
has body: I am trying to test a similar code to this testFind = (cb) -&gt; cb() wrapper = (fn) -&gt; (req, mongodb) -&gt; users = mongodb.db.collection("user") # fired here fn req, mongodb testFind (err, user) -&gt; #fired here fn req, mongodb users.findOne "username": "user1" , (err, user) -&gt; console.log "user is valid", user console.log "req.done is still a spy object", req.done #not fired here fn req, mongodb test = wrapper (req, mongodb) -&gt; req.done 200 module.exports = test and pass a spy for req.done. As mentioned in the comments above, the spy is never fired inside the mongodb callback, even though it is a valid spy object and the callback is called. But it works outside of it. It also works if I replace the mongodb findOne with a local sample function that calls the callback. This is the test code mongodb = {} describe.only "test:", -&gt; before (done) -&gt; this.timeout(5000) MongoClient.connect "mongodb://localhost/test", (err, db) -&gt; if err? done err mongodb.db = db done() it "should fire complete", -&gt; @req = complete: sinon.spy().named("complete") test @req, mongodb @req.complete.should.have.been.calledThrice
tagged with: mongodb
has title: sinon spy is not fired inside the mongodb findOne callback
downvote count: 0
favorite count: 0

http://stackoverflow.com/comment/45867491
type: Comment
has text: if i include all .js and .css files in parent page, will $(document).on('pageinit', function(){}); be called multiple times? if so, how should i implement 'pageinit' functions on each page?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28795636

http://stackoverflow.com/q/28785764
score: 2
downvote count: 0
tagged with: mysql
type: Question
tagged with: javascript
upvote count: 2
has title: mysql loop - pre-load data?
has body: I am putting together a drag-and-drop page, with the draggable boxes containing content populated by an sql table. Once a box is dragged away, it disappears and a new one appears with fresh data. I would only like to have 15 boxes appear at any one time, but I am not sure how to do this with SQL, since the dragging/dropping of boxes occurs after loading, and so php won't help me - do I need to pre-load the list of box names into a js array before the page loads? Does that mean my entire list is then exposed to the public? I have written this already using an xml table, and I am migrating to sql. This is the function I wrote which is called every time a JQuery drop event occurs: function AddNextSkill() { var div = document.getElementById('productbox'); div.innerHTML = div.innerHTML + '&lt;div class="product" id= "box' + RunningCount +' "&gt;&lt;h4&gt;' + MyToolList[RunningCount][1] + "&lt;/h4&gt;&lt;/div&gt;"; RunningCount += 1; $("#productbox .product").draggable({//JQUERY DETAILS//} }); In this case I made a pre-loaded array in JS MyToolList[i][j], which contains a list of tools and their id's. Is this an inefficient way of doing this? Would it be better to use sql and not preload any tables?
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/45848977
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28789017
tagged with: php

http://stackoverflow.com/a/28873111
type: Answer
has body: i figured it out, a div was needed, css background pill needed to be separated and updated with selected option's position in each update defined in custom binding.
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28850518
answers question: http://stackoverflow.com/q/28850518

http://stackoverflow.com/q/28901068
type: Question
score: 3
tagged with: stomp
tagged with: javascript
has title: stomp nodejs not sending header on connect
upvote count: 3
answer count: 1
tagged with: websocket
favorite count: 0
accepted answer: http://stackoverflow.com/a/28984484
tagged with: node.js
has answer: http://stackoverflow.com/a/28984484
type: AnsweredQuestion
downvote count: 0
has body: I have a super simple nodejs application using stomp to connect to a server using websockets. Problem is the application is NOT sending the headers I'm telling it to send. Documentation and examples couldn't be clearer about how to send a header, so I have no idea why I'm not seeing mine in wireshark. var Stomp = require('stompjs'); var client = Stomp.overWS('ws://localhost:8080/web/wsendpoint'); var headers = { login: 'mylogin', passcode: 'mypasscode', // additional header 'Auth-Token': 'token' }; client.connect(headers, connectCallback); var connectCallback = function(frame) { alert('connected'); }; This connects fine, but the headers seem to be ignored. Any one have any idea why this is?

http://stackoverflow.com/comment/45866907
type: Comment
has text: Thanks AwesomeGuy, I've removed the firefox tag
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28795228

http://stackoverflow.com/q/28802253
score: 3
has title: Self evaluating Javascript
has answer: http://stackoverflow.com/a/28802320
tagged with: javascript
has answer: http://stackoverflow.com/a/28802390
has body: Please help me to understand this in javascript how this works fine? var myEvent = window.attachEvent || window.addEventListener; var chkevent = window.attachEvent ? 'onbeforeunload' : 'beforeunload'; /// make IE7, IE8 compitable myEvent(chkevent, function(e) { // For &gt;=IE7, Chrome, Firefox var confirmationMessage = 'Are you sure to leave the page?'; // a space (e || window.event).returnValue = confirmationMessage; return confirmationMessage; }); I understand the other parts of the script but not the (e || window.event).returnValue how thus it will be evaluated? does it means if e is true then its property returnValue will be set else it will use the window.event? NOTE: Please guide me with the right title for this question as I don't know how this kind of javascript coding pattern is called
possible better answer: http://stackoverflow.com/a/28802320
upvote count: 3
favorite count: 0
has answer: http://stackoverflow.com/a/28802354
accepted answer: http://stackoverflow.com/a/28802333
answer count: 4
has comment: http://stackoverflow.com/comment/45878449
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/28802333
has comment: http://stackoverflow.com/comment/45878490
type: Question

http://stackoverflow.com/comment/45992630
type: Comment
comment on: http://stackoverflow.com/a/28863605
has text: @EricPeng Internet Explorer can override inline content if it wants to. So it'd be better to display it wrapped in HTML like in my answer. By the way, your question says ".json", but your comments say ".js". They're not the same.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45928733
type: Comment
type: QuestionComment
has text: Sorry I am german and ry this as best as I could. I try to make it clearer
score: 0
comment on: http://stackoverflow.com/q/28829245

http://stackoverflow.com/q/28784629
tagged with: javascript
has body: I'm using the latest version of FullCalendar and I was hoping someone could tell me how I could check whether an event got a description. I tried it with this snippet, but the only thing I get is "undefined". eventRender: function(event, element, view) { if(event.description == ''){var getDesc = event.description;}; //some more code }, I hope someone can help me. Thanks I forgot to mention, that I use a google calendar feed to get events into my FullCalendar. When I use event.Description or event.Location or anything else that isn't set in my google events, I receive "undefined" as mentioned above. Thanks to @Bryce Siedschlaw for pointing out my mistake to set getDesc only when the description is empty. That of course was not wanted. He also gave me some pretty good tips but sadly didn't work out for me. If it's helping, here is a link to the FullCalendar I've set up, maybe it helps to understand what I'm saying. FullCalendar Setup Ps. It isn't a beauty (and in german) but I'm working on it ;) Found an answer after hours of research. @brasofilo answered it over there. Link to the solution. var getDesc = (event.description) ? event.description : 'No Description'; It will check if the description is set and will output a default text if it isn't.
has comment: http://stackoverflow.com/comment/45845571
type: UnansweredQuestion
type: Question
has title: How to check for empty event.description (Google Calendar Feed)?
tagged with: fullcalendar
linked to: http://stackoverflow.com/q/25558317
has answer: http://stackoverflow.com/a/28784775
score: 0
answer count: 1

http://stackoverflow.com/comment/46023822
has text: I don't understand what you mean by the first example that you claim shows "it can be adjusted Booking.com", that is the way these business POI infowindows display in the Google Maps Javascript API v3. The infowindows are different on Google Maps.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28880331

http://stackoverflow.com/comment/45952343
type: Comment
comment on: http://stackoverflow.com/a/28835800
has text: @S.tenBrinke ok, have you changed the dataType to this: dataType: "json"
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46083394
has text: Please see here some type code is use http://wallpapers.wapego.net/main.php?f=3259946 actually i am trying to make image gallery which change image by prev and next function and show a loading image when image is loading
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28892727
score: 0

http://stackoverflow.com/q/28868819
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28869556
tagged with: php
has answer: http://stackoverflow.com/a/28868886
upvote count: 0
type: UnansweredQuestion
type: Question
has title: after navigate to another page, bootstrap dropdown become unusable
tagged with: javascript
score: -1
has body: I had 3 .php files, they are index.php, load_file.php,and register.php In index.php, contain navigation, and each navigation has dropdown list, i call this navigation and the dropdown from database. and also index.php has link to register.php, note : load_file.php included in this file In load_file.php, contain code to check value of page, by using if($_GET['page']),and trigger every value with switch-case register.php, just a normal form My problem is, after I navigate to register.php by typing ?page=register in browser, my dropdown in index.php file become unusable ::UPDATE:: this is my index.php file <?php session_start(); require_once './model/functions.php'; if(isset($_GET["category"])){ $index_page= $_GET["category"]; $index_sub_page= null; }elseif (isset ($_GET["sub_category"])) { $index_sub_page = $_GET["sub_category"]; $index_page= null; }else{ $index_sub_page= null; $index_page= null; } if($_POST){ $username = $_POST["username"]; $password = $_POST["password"]; if(check_username_and_password_from_users($username, $password)){ $_SESSION["username"] = $username; } } ?> Learn Bootstrap <?php if(isset($_SESSION["username"])){ ?> <?php echo $_SESSION["username"]; ?> Logout <?php }else{ ?> Dropdown Register <?php } ?> FAQs Twitter Facebook Go! <?php $subject_set = find_all_subjects(); while($subject = mysqli_fetch_assoc($subject_set)){ ?> <a id="dLabel" data-target="#" href="?subject=<?php echo urlencode($subject["id"]);?>" data-toggle="dropdown" aria-haspopup="true" role="button"> <?php echo $subject["name"];?> <?php $page_set = find_pages_from_subjects($subject["id"]); while($page = mysqli_fetch_assoc($page_set)){ ?> <a href="?category=<?php echo urlencode($page["id"]);?>"><?php echo $page["name"];?> <?php $sub_page_set = find_sub_pages_from_pages($page["id"]); while($sub_page = mysqli_fetch_assoc($sub_page_set)){ ?> <a href="?sub_category=<?php echo urlencode($sub_page["id"]);?>"><?php echo $sub_page["name"];?> <?php } clear_result($sub_page_set); ?> <?php } …
answer count: 2
downvote count: 1

http://stackoverflow.com/q/28798828
tagged with: javascript
score: 1
accepted answer: http://stackoverflow.com/a/28799386
type: Question
has comment: http://stackoverflow.com/comment/45872080
tagged with: autofill
favorite count: 0
has title: Autofill input with another input values
possible better answer: http://stackoverflow.com/a/36195494
answer count: 2
has answer: http://stackoverflow.com/a/36195494
has body: I need to autofill an input field with the values of another input fields. So far I have this: $("#field1, #field2").keyup(function(){ $("#result").val(this.value); }); &lt;input type="text" id="field1" name="field1" value="" &gt; &lt;input type="text" id="field2" name="field2" value="" &gt; //* to be filled with the values of the inputs above *// &lt;input type="text" id="result" name="resut" value=""&gt;
upvote count: 1
has comment: http://stackoverflow.com/comment/45871969
has answer: http://stackoverflow.com/a/28799386
has comment: http://stackoverflow.com/comment/45872225
has comment: http://stackoverflow.com/comment/45872381
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/comment/45853072
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28786454
has text: Awesome that works. I expected that when I declare a class in the module I would need to use it like this: import View = require('famous/core/View'); var view = new View.View(); . But it doesnt, it works perfectly, thanks!
type: AnswerComment

http://stackoverflow.com/q/28759590
tagged with: javascript
has body: I would like to know the best practices to invalidate JWT without hitting db while changing password/logout. I have the idea below to handle above 2 cases by hitting the user database. 1.Incase of password changes, I check for password(hashed) stored in the user db. 2.Incase of logout, I save last-logout time in user db, hence by comparing the token created time and logout time, I can able to invalidate this case. But these 2 cases comes at the cost of hitting user db everytime when the user hits the api. Any best practise is appreciated. UPDATE: I dont think we can able to invalidate JWT without hitting db. So I came up with a solution. I have posted my answer, if you have any concern, you are welcome.
possible better answer: http://stackoverflow.com/a/28760618
tagged with: token
has answer: http://stackoverflow.com/a/39231077
has answer: http://stackoverflow.com/a/28760618
linked to: http://stackoverflow.com/q/26739167
has title: Best practices to invalidate JWT while changing passwords and logout in node.js?
favorite count: 0
accepted answer: http://stackoverflow.com/a/28804067
answer count: 5
has answer: http://stackoverflow.com/a/34727640
upvote count: 89
tagged with: node.js
type: AnsweredQuestion
tagged with: jwt
has answer: http://stackoverflow.com/a/40989193
has comment: http://stackoverflow.com/comment/117132059
downvote count: 3
linked to: http://stackoverflow.com/q/27359104
type: Question
tagged with: auth-token
score: 86
has answer: http://stackoverflow.com/a/28804067

http://stackoverflow.com/a/28803701
score: 1
type: Answer
has body: You can use jquery:$("#SelectEmptyPoints").find("option:selected").length.It wiil work on ie11.I've tested.
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28803589
answers question: http://stackoverflow.com/q/28803589
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28834569
tagged with: css
has comment: http://stackoverflow.com/comment/45938833
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45938786
has title: change color when a country selected
upvote count: 1
downvote count: 1
type: Question
has body: I am trying to change color of a telephone field when a country is selected on the options. For example if someone selects UK the color must change to Red. But I'm not sure what I'm doing wrong. This doesn't change at the moment. jQuery('select[name="address[_item1][country_id]"]').change(function() { if (jQuery(this).val() == 'GB') { jQuery('#_item1telephone').css("background-color", "yellow"); }) }); Uruguay
has comment: http://stackoverflow.com/comment/45938722
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28834843
has comment: http://stackoverflow.com/comment/45938835
score: 0
tagged with: jquery-selectors
answer count: 1
has answer: http://stackoverflow.com/a/28834843
favorite count: 0
has comment: http://stackoverflow.com/comment/45938700
has comment: http://stackoverflow.com/comment/45938777

http://stackoverflow.com/q/28851111
tagged with: node.js
type: AnsweredQuestion
tagged with: dot.js
score: 1
has answer: http://stackoverflow.com/a/28851430
has body: I'm in the process of converting a Grunt file to a Gulp file. My Grunt file contains the following line var config = grunt.file.readJSON('json/config.json'); What this line is doing is that it is setting some variables which it then injects into the html it generates, specifically related to languages. I tried converting the file automatically with grunt2gulp.js but it always fails with config being undefined. How would I write grunt.file.readJSON using gulp?
type: Question
linked to: http://stackoverflow.com/q/22645779
answer count: 2
tagged with: javascript
tagged with: gruntjs
has answer: http://stackoverflow.com/a/28884916
accepted answer: http://stackoverflow.com/a/28851430
possible better answer: http://stackoverflow.com/a/28884916
tagged with: gulp
favorite count: 0
upvote count: 2
has title: Converting `grunt.file.readJSON` to gulp
downvote count: 1

http://stackoverflow.com/a/28897322
answers question: http://stackoverflow.com/q/28897169
has comment: http://stackoverflow.com/comment/46054432
has comment: http://stackoverflow.com/comment/46058726
has comment: http://stackoverflow.com/comment/46057526
has comment: http://stackoverflow.com/comment/46056734
accepted answer of: http://stackoverflow.com/q/28897169
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46056888
score: 0
has body: Remove all ifs and just sum all areas: $('.floor').change(function() { var floor1 = parseInt($('#firstfloor').val(), 10) || 0; var floor2 = parseInt($('#secondfloor').val(), 10) || 0; var floor3 = parseInt($('#thirdfloor').val(), 10) || 0; var floor4 = parseInt($('#fourthfloor').val(), 10) || 0; var total = floor1 + floor2 + floor3 + floor4; console.log(total); $('#area_total').val(total); });
type: Answer

http://stackoverflow.com/comment/45995563
comment on: http://stackoverflow.com/q/28865136
type: QuestionComment
type: Comment
score: 1
has text: You would need to show more code because `validate()` just seems to be a method of the `win` object, rather than a method within the JavaScript library method. i.e. you're not going to find anything online easliy unless you know what `win` is/does.

http://stackoverflow.com/comment/46040765
has text: Try `for (;AccountNum < Usernames.length; AccountNum++)`. Also, the convention is lowercase variables.
type: QuestionComment
comment on: http://stackoverflow.com/q/28889902
score: 0
type: Comment

http://stackoverflow.com/q/28840555
favorite count: 0
tagged with: angularjs
has body: While searching the internet it seems that Grunt is the preferred task runner for executing AngularJS test under Karma/Jasmine. Our project has server side java code and browser side javascript code. We already have a full unit test suite for the Java code, which we use ANT to run this suite. I have written some unit tests for our Javascript using Karma, Jasmine and PhantomJS. For CI, I would like to run these Karma scripts the same way that we do the Java scripts, which again is ANT tasks. Having a hard time finding an ANT task for runnig Karma. Would greatly appreciate any suggestions.
type: AnsweredQuestion
tagged with: phantomjs
score: 3
has answer: http://stackoverflow.com/a/29453312
upvote count: 3
has title: ANT task for calling Karma/Jasmine
type: Question
tagged with: ant
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29453312
tagged with: karma-jasmine
answer count: 1

http://stackoverflow.com/comment/45894751
type: QuestionComment
has text: @ Amit Joki Yes, only array of strings.
comment on: http://stackoverflow.com/q/28811285
score: 0
type: Comment

http://stackoverflow.com/comment/45919175
type: QuestionComment
has text: If you are using Django's `forms.Form`, please contain that part also.
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28823916

http://stackoverflow.com/comment/46246175
type: QuestionComment
type: Comment
has text: Thanks @Kaiido - sorry I should have explained the setup as well - the script resides on the (ASP.NET) master page and an Ajaxified user control is changed on navigation therefore the JS doesn't get reloaded - hence why I'm using polling.
comment on: http://stackoverflow.com/q/28846870
score: 0

http://stackoverflow.com/a/28787527
downvote count: 0
answers question: http://stackoverflow.com/q/28787334
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/45851013
accepted answer of: http://stackoverflow.com/q/28787334
has comment: http://stackoverflow.com/comment/45850892
score: 1
has body: You will still need some kind of a looping. If you don't want to do a standard looping with counter variables etc. you can do something like this: [].forEach.call(document.getElementsByTagName("label"), function(el) { if (el.innerHTML.indexOf('item3') != -1) el.click(); }) It is arguable whether it's better method or not, but it works
type: AcceptedAnswer

http://stackoverflow.com/comment/45835970
type: AnswerComment
comment on: http://stackoverflow.com/a/28779063
score: 0
type: Comment
has text: how to mention that where? im just new to php. I already have this xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

http://stackoverflow.com/q/28867169
upvote count: 1
tagged with: smoothstate.js
has answer: http://stackoverflow.com/a/28884501
type: Question
has title: smoothstate.js vs pjax is there a difference
tagged with: javascript
answer count: 1
tagged with: pjax
downvote count: 0
accepted answer: http://stackoverflow.com/a/28884501
favorite count: 0
has body: I am thinking about implementing a webpage preloader and I am looking at smoothstate.js and pjax. They both seem similar in what they do but I think I am missing something. Is there any major difference between them they I should know before I implement one?
type: AnsweredQuestion
score: 1
tagged with: preloader

http://stackoverflow.com/q/28890146
has comment: http://stackoverflow.com/comment/46046619
tagged with: arrays
has comment: http://stackoverflow.com/comment/46055762
tagged with: javascript
has comment: http://stackoverflow.com/comment/46058255
upvote count: 1
tagged with: parsing
favorite count: 0
answer count: 0
tagged with: multidimensional-array
has title: how to parse a dynamic array with javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46041666
downvote count: 0
has body: Haw can i parse this json? {"A":{"A":{"1":{"1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7"},"2":{"1":"8","2":"9","3":"10","4":"11","5":"12","6":"13","7":"14"},"3":{"1":"15","2":"16","3":"17","4":"18","5":"19","6":"20","7":"21"}},"B":{"1":{"1":"22","2":"23","3":"24","4":"25","5":"26","6":"27","7":"28"},"2":{"1":"29","2":"30","3":"31","4":"32","5":"33","6":"34","7":"35"},"3":{"1":"36","2":"37","3":"38","4":"39","5":"40","6":"41","7":"42"}}}} I try this, but... does not work, and lot of more things but i'm very new on this and i can't resolve myself for (var i = 0; i &lt; datos.A.length; i++) { items.push( "&lt;div class='rackCod'&gt;" + val[0] + "&lt;/div&gt;" ); }
score: 1
tagged with: http://stackoverflow.com/tag/json
type: Question

recursion
type: Tag
tags question: http://stackoverflow.com/q/28906527
tag name: recursion
tags question: http://stackoverflow.com/q/28892206
tags question: http://stackoverflow.com/q/28780657
tags question: http://stackoverflow.com/q/28768070
tags question: http://stackoverflow.com/q/28773367

internet-explorer
tags question: http://stackoverflow.com/q/28857067
tags question: http://stackoverflow.com/q/28841890
tags question: http://stackoverflow.com/q/28865929
tags question: http://stackoverflow.com/q/28825574
tags question: http://stackoverflow.com/q/28874842
tags question: http://stackoverflow.com/q/28839669
tags question: http://stackoverflow.com/q/28823661
tags question: http://stackoverflow.com/q/28879480
tags question: http://stackoverflow.com/q/28812190
tag name: internet-explorer
tags question: http://stackoverflow.com/q/28891386
tags question: http://stackoverflow.com/q/28837467
tags question: http://stackoverflow.com/q/28760363
tags question: http://stackoverflow.com/q/28815845
tags question: http://stackoverflow.com/q/28760166
tags question: http://stackoverflow.com/q/28779896
tags question: http://stackoverflow.com/q/28810449
tags question: http://stackoverflow.com/q/28875766
tags question: http://stackoverflow.com/q/28845409
tags question: http://stackoverflow.com/q/28903440
tags question: http://stackoverflow.com/q/28756244
tags question: http://stackoverflow.com/q/28774184
tags question: http://stackoverflow.com/q/28856649
tags question: http://stackoverflow.com/q/28835475
tags question: http://stackoverflow.com/q/28881669
tags question: http://stackoverflow.com/q/28857557
tags question: http://stackoverflow.com/q/28764020
tags question: http://stackoverflow.com/q/28867615
tags question: http://stackoverflow.com/q/28773550
tags question: http://stackoverflow.com/q/28903864
tags question: http://stackoverflow.com/q/28865244
type: Tag
tags question: http://stackoverflow.com/q/28898344
tags question: http://stackoverflow.com/q/28761218
tags question: http://stackoverflow.com/q/28850489
tags question: http://stackoverflow.com/q/28809386
tags question: http://stackoverflow.com/q/28803408
tags question: http://stackoverflow.com/q/28770086
tags question: http://stackoverflow.com/q/28847202
tags question: http://stackoverflow.com/q/28796112
tags question: http://stackoverflow.com/q/28881124

http://stackoverflow.com/comment/45903009
comment on: http://stackoverflow.com/a/28815560
has text: :D hehe, the form I describe is simply a next/prev button image gallery with some cms behind it that I'm not fully aware of.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28864594
linked to: http://stackoverflow.com/q/824349
score: 1
type: Question
upvote count: 2
answer count: 2
possible better answer: http://stackoverflow.com/a/28864790
tagged with: javascript
has answer: http://stackoverflow.com/a/28864790
has comment: http://stackoverflow.com/comment/45994416
has answer: http://stackoverflow.com/a/28864854
accepted answer: http://stackoverflow.com/a/28864854
linked to: http://stackoverflow.com/q/12446317
downvote count: 1
duplicate of: http://stackoverflow.com/q/824349
favorite count: 0
has title: Add variable to current URL using javascript
type: AnsweredQuestion
has body: I currently have this javascript snippet which loads a URL depending on the dropdown selection... var orderby = jQuery('#dropdown'); var str; orderby.change(function(){ str = jQuery(this).val(); window.location.href = "http://www.example.com?variable="+str; }); Is there a simple way to modify this so that instead of going to http://www.example.com?variable=str it just adds variable=str to the end of the current url and then redirects to it? EDIT Didn't make things clear, I still want to redirect but instead of specifying the new URL I want to take the current URL + variable and then redirect
linked to: http://stackoverflow.com/q/5999118

http://stackoverflow.com/comment/66648113
comment on: http://stackoverflow.com/a/30495399
type: Comment
score: 0
type: AnswerComment
has text: @xmnboy I forgot that I actually had found another fallback already, left handy as a comment in my script, which seems to be still true and, a working fallback for iOS10.

android
tags question: http://stackoverflow.com/q/28896856
tags question: http://stackoverflow.com/q/28753295
tags question: http://stackoverflow.com/q/28752424
tags question: http://stackoverflow.com/q/28874605
tags question: http://stackoverflow.com/q/28844488
tags question: http://stackoverflow.com/q/28862650
tags question: http://stackoverflow.com/q/28835323
tags question: http://stackoverflow.com/q/28811139
tags question: http://stackoverflow.com/q/28812608
tags question: http://stackoverflow.com/q/28802070
tags question: http://stackoverflow.com/q/28764390
tags question: http://stackoverflow.com/q/28795665
tags question: http://stackoverflow.com/q/28791627
tags question: http://stackoverflow.com/q/28792989
tags question: http://stackoverflow.com/q/28789989
tags question: http://stackoverflow.com/q/28807514
tags question: http://stackoverflow.com/q/28887518
tags question: http://stackoverflow.com/q/28840872
tags question: http://stackoverflow.com/q/28853559
tags question: http://stackoverflow.com/q/28900116
tags question: http://stackoverflow.com/q/28826706
tags question: http://stackoverflow.com/q/28797342
tags question: http://stackoverflow.com/q/28780733
tags question: http://stackoverflow.com/q/28898777
tags question: http://stackoverflow.com/q/28817347
tags question: http://stackoverflow.com/q/28903877
tags question: http://stackoverflow.com/q/28780172
tags question: http://stackoverflow.com/q/28891977
tags question: http://stackoverflow.com/q/28751384
tags question: http://stackoverflow.com/q/28777981
tags question: http://stackoverflow.com/q/28861183
tags question: http://stackoverflow.com/q/28900354
tags question: http://stackoverflow.com/q/28843883
tags question: http://stackoverflow.com/q/28793899
tags question: http://stackoverflow.com/q/28756637
tags question: http://stackoverflow.com/q/28852298
tags question: http://stackoverflow.com/q/28851032
tags question: http://stackoverflow.com/q/28844752
tags question: http://stackoverflow.com/q/28751831
tags question: http://stackoverflow.com/q/28886028
tags question: http://stackoverflow.com/q/28900216
tags question: http://stackoverflow.com/q/28753071
tags question: http://stackoverflow.com/q/28775317
tag name: android
tags question: http://stackoverflow.com/q/28849267
type: Tag

http://stackoverflow.com/comment/46003227
type: QuestionComment
comment on: http://stackoverflow.com/q/28869591
score: 0
type: Comment
has text: @PM77-1 what do u mean by hide?

http://stackoverflow.com/comment/45867340
type: QuestionComment
has text: Just changing smileys= [] to smileys = {}; yes?
score: 0
comment on: http://stackoverflow.com/q/28796365
type: Comment

http://stackoverflow.com/a/28847102
has body: try this Sample Data JSFiddle Demo
type: Answer
answers question: http://stackoverflow.com/q/28846880
has comment: http://stackoverflow.com/comment/45962580
score: 0

http://stackoverflow.com/comment/46017133
type: QuestionComment
has text: Here is a good article about it (is the methodology used in ionic): http://ionicframework.com/blog/collection-repeat/
comment on: http://stackoverflow.com/q/28877528
score: 1
type: Comment

http://stackoverflow.com/a/28897447
has body: There are no 'text-decoration' or similar available in the text methods of the HTML Canvas Context. You could make it bold or oblique( via the fontStyle property) but underline is not available. But they exist a workaround, explained here.
accepted answer of: http://stackoverflow.com/q/28871117
type: Answer
answers question: http://stackoverflow.com/q/28871117
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/46023449
type: QuestionComment
comment on: http://stackoverflow.com/q/28880806
has text: @LuudJacobs It's hard to enter HTML, as this is a wordpress menu, so contains lots of code. using `*` as the css selector after the submenu, but the overlay disappears whenever I hover over margin of any child elements. (like submenus)
score: 0
type: Comment

http://stackoverflow.com/q/28778618
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45837102
tagged with: php
has comment: http://stackoverflow.com/comment/45837080
has body: I have admin page which is purely in html, After Login as admin It redirect to admin page. Url of admin page is http://URL/index.html. But this page is also accessible if we just type URL. So any body can access this page if he know the url of this page. So I want to protect this html page from unauthorized access. Here php file, html file are separate. To access that page there will be login id and password. After only matching login id and password, the required page should be load. &lt;head&gt; &lt;title&gt;Service for home - Next Generation of Service Provider - Admin &lt;/head&gt; &lt;body&gt; Welcome admin.. &lt;/body&gt;
has comment: http://stackoverflow.com/comment/45835064
has comment: http://stackoverflow.com/comment/45835018
has comment: http://stackoverflow.com/comment/45836918
type: Question
has comment: http://stackoverflow.com/comment/45834854
has title: How to protect purely html page from unauthorized access?
tagged with: javascript
has answer: http://stackoverflow.com/a/28779865
has comment: http://stackoverflow.com/comment/45834807
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/45837143
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45835110
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45836959
has answer: http://stackoverflow.com/a/28778782
has comment: http://stackoverflow.com/comment/45834867
type: UnansweredQuestion

http://stackoverflow.com/a/28867200
accepted answer of: http://stackoverflow.com/q/28867077
answers question: http://stackoverflow.com/q/28867077
has comment: http://stackoverflow.com/comment/45999852
has comment: http://stackoverflow.com/comment/46000105
has comment: http://stackoverflow.com/comment/46000265
type: AcceptedAnswer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/46000335
type: Answer
has body: You tagged this question with [jquery] so I'm going to give an answer using jquery, even though your sample code doesn't use it. Here's a fiddle: http://jsfiddle.net/u2f2b5qq/ Given a few images on the page, like this: &lt;img src="http://placehold.it/250x150"&gt; &lt;img src="http://placehold.it/200x250"&gt; &lt;img src="http://placehold.it/350x150"&gt; &lt;img src="http://placehold.it/150x50"&gt; You can do some action on all of them once the page loads, like this: $(function() { $('img').each(function() { $(this).on('click', function() { alert('You clicked ' + $(this).attr('src')); // window.parent.Tumblr.Lightbox.init(this); }); }); }); What I've done is attach a click handler to every image and alert when it's clicked. You would replace that with your lightbox code. I don't have a full understanding of how tumblr does its magic with interpolating those values, but I assume you could do something like this for each image. It attaches the Photo data to each image element, and then retrieves it later. &lt;img src="example.jpg" id="photo_{PostID}" data-width="{PhotoWidth-HighRes}" data-height="{PhotoHeight-HighRes}" data-low_res="{PhotoURL-250}" data-high_res="{PhotoURL-HighRes}" /&gt; and then in the jquery kickoff: $(function() { $('img').on('click', function() { var $img = $(this); alert('You clicked ' + $img.attr('src')); window.parent.Tumblr.Lightbox.init({ width: $img.data('width'), height: $img.data('height'), low_res: $img.data('low_res'), high_res: $img.data('high_res') }); }); }); Give that a shot.
upvote count: 1

http://stackoverflow.com/q/28854935
has answer: http://stackoverflow.com/a/28855110
has body: I am learning jQuery, and I wrote something like this: $('#bt1').on('click',function() { $('#area1').fadeToggle(1000); }); and it works fine for one element. When I add one more element and place it next to the first element, the second element takes the place of the first when i click on bt1, because the first element disappears. My question is: how to keep elements (div) in place, where they are at the beginning, when one element is hidden?
has comment: http://stackoverflow.com/comment/45975924
has answer: http://stackoverflow.com/a/28855197
upvote count: 1
has comment: http://stackoverflow.com/comment/45975964
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45976480
has comment: http://stackoverflow.com/comment/45975954
has comment: http://stackoverflow.com/comment/45975874
score: 1
type: Question
possible better answer: http://stackoverflow.com/a/28855197
has comment: http://stackoverflow.com/comment/45976128
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28855110
answer count: 3
has comment: http://stackoverflow.com/comment/45975834
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has answer: http://stackoverflow.com/a/28855120
has title: what should i do to avoid moving element on web page(html,css,jQuery)?
has comment: http://stackoverflow.com/comment/45975866
favorite count: 0

http://stackoverflow.com/comment/46022848
type: QuestionComment
comment on: http://stackoverflow.com/q/28845409
score: 0
has text: http://stackoverflow.com/questions/335244/why-does-chrome-ignore-local-jquery-cookies It works as long as I don't use local host.
type: Comment

http://stackoverflow.com/comment/45832498
comment on: http://stackoverflow.com/a/28773739
type: AnswerComment
has text: i'm obviously talking about the cases where a shortcut is provided.
type: Comment
score: 0

knockout.js
tags question: http://stackoverflow.com/q/28832967
tags question: http://stackoverflow.com/q/28872495
tags question: http://stackoverflow.com/q/28752068
tags question: http://stackoverflow.com/q/28854840
tags question: http://stackoverflow.com/q/28896703
tags question: http://stackoverflow.com/q/28849128
tags question: http://stackoverflow.com/q/28838946
tags question: http://stackoverflow.com/q/28812429
tags question: http://stackoverflow.com/q/28866954
tags question: http://stackoverflow.com/q/28822261
tags question: http://stackoverflow.com/q/28831091
tag name: knockout.js
tags question: http://stackoverflow.com/q/28828242
tags question: http://stackoverflow.com/q/28856761
tags question: http://stackoverflow.com/q/28818615
tags question: http://stackoverflow.com/q/28819190
tags question: http://stackoverflow.com/q/28904587
tags question: http://stackoverflow.com/q/28779538
tags question: http://stackoverflow.com/q/28862498
tags question: http://stackoverflow.com/q/28798997
tags question: http://stackoverflow.com/q/28878019
tags question: http://stackoverflow.com/q/28874910
tags question: http://stackoverflow.com/q/28811619
tags question: http://stackoverflow.com/q/28851855
tags question: http://stackoverflow.com/q/28825748
tags question: http://stackoverflow.com/q/28836569
type: Tag
tags question: http://stackoverflow.com/q/28858535
tags question: http://stackoverflow.com/q/28841975
tags question: http://stackoverflow.com/q/28878304
tags question: http://stackoverflow.com/q/28852718
tags question: http://stackoverflow.com/q/28794863
tags question: http://stackoverflow.com/q/28775186
tags question: http://stackoverflow.com/q/28790044
tags question: http://stackoverflow.com/q/28869981
tags question: http://stackoverflow.com/q/28850518
tags question: http://stackoverflow.com/q/28820451

http://stackoverflow.com/q/28883295
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46044742
has comment: http://stackoverflow.com/comment/46032898
has title: Using Pointers for ios App & Javascript website
type: Question
has answer: http://stackoverflow.com/a/28891949
tagged with: ios
accepted answer: http://stackoverflow.com/a/28891949
tagged with: javascript
tagged with: pointers
has comment: http://stackoverflow.com/comment/46028888
score: 0
tagged with: xcode
answer count: 1
has body: I have an iphone app created as a multiplication game and saves the following into a class called 'Results'. PFObject *Results = [PFObject objectWithClassName:@"Result"]; [Results setObject:levelNumberLabel.text forKey:@"LevelNumber"]; [Results saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) etc. I also have a class called 'currentUser' that stores the following: PFObject *currentUser = [PFObject objectWithClassName:@"currentUser"]; [currentUser setObject:_firstnameLabel.text forKey:@"SFirstName"]; I want to run a javascript query that 'links' these two tables. I have a point er set up called 'currentuser' in the currentUser class and a pointer called 'currentResult'.. These hold no value (undefined). How am I able to merge these classes together? Will it be a case of linking it through the app or using javascript? I'm slightly confused. Here is my javascript code var Show = Parse.Object.extend("Result"); var query = new Parse.Query(Show); query.include('currentUser'); query.find({ success: function(shows) { for(var i = 0; i &lt; shows.length; i++) { var show = results[i]; var surname = results.get('SSurname'); console.log(i); var users = show.get('currentUser'); var username = users.get("SFirstName"); $(".success").append(username + " on " + surname + "&lt;br/&gt;"); Any questions/help please let me know. Any help on the subject would be greatly appreciated
tagged with: parse-platform

http://stackoverflow.com/comment/45813809
type: AnswerComment
type: Comment
score: 2
has text: @Jongware It's not my code. OP asked for an explanation. Are you seriously downvoting the answer because you don't like the initial conditions of the code in the question?
comment on: http://stackoverflow.com/a/28767409

http://stackoverflow.com/comment/45978492
type: Comment
comment on: http://stackoverflow.com/q/28855763
score: 0
has text: Ahh yes this rings some bells! I think it will help alot, I will try it now.
type: QuestionComment

http://stackoverflow.com/q/28813517
tagged with: javascript
has comment: http://stackoverflow.com/comment/45947049
linked to: http://stackoverflow.com/q/21736191
answer count: 1
downvote count: 0
favorite count: 0
has body: In the following code why is promise resolved displayed before promise being resolved? var p = protractor.promise.defer(); element(by.css("input.m-call-to-action")).click().then(function() { console.log('promise being resolved'); p.fulfill(true); }); browser.wait(function() { console.log('p', p); return p; }, 5000); console.log('promise resolved', p);
tagged with: promise
accepted answer: http://stackoverflow.com/a/28813698
linked to: http://stackoverflow.com/q/28808137
upvote count: 2
has title: Promises callbacks ordering in Protractor
score: 2
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28813698
tagged with: protractor

http://stackoverflow.com/a/28833343
type: Answer
has comment: http://stackoverflow.com/comment/45937134
has comment: http://stackoverflow.com/comment/45944868
has comment: http://stackoverflow.com/comment/45944230
has comment: http://stackoverflow.com/comment/45938389
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45943698
accepted answer of: http://stackoverflow.com/q/28833013
answers question: http://stackoverflow.com/q/28833013
has body: Please take a look at this fiddle and see if this solves your problem. var num = 0; num++; var cloudWrap = $('&lt;div /&gt;', { id: 'cloudWrap_'+num}), outerWrap = $('&lt;div /&gt;').appendTo(cloudWrap); outerWrap.append( $('&lt;div /&gt;', { class: 'tf', id: 'oWrapper_'+num, style: 'white-space:pre-line; font-size: 2vw;' }) ); cloudWrap.appendTo('body'); $("#oWrapper_" + num).resizable({ handles: 'ne, se, sw, nw', aspectRatio: true, }); Your custom css classes were interfering with jQuery-UI's classes that are added when .resizable() is called. Also, I moved the .resizable() call to the end of the code block to ensure that the element is present in the DOM before it's called. If this isn't what you were looking for, or if I misunderstood something, please let me know and I will make the necessary changes. Thanks!
has comment: http://stackoverflow.com/comment/45949765
has comment: http://stackoverflow.com/comment/45945493
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45946942

http://stackoverflow.com/comment/45844506
has text: Of course it isn't an answer; that's why it isn't an answer.
score: 1
comment on: http://stackoverflow.com/q/28783930
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28835229
tagged with: functional-programming
downvote count: 0
has comment: http://stackoverflow.com/comment/45943002
tagged with: meteor
has title: can't pass function to call(method)
favorite count: 0
has answer: http://stackoverflow.com/a/28835559
has body: I'm trying to pass a function as an argument but for some reason this doesn't work. While debugging I end up with this situation: with a server/twitter.js: Meteor.methods({ mytweets: function(callback){ //someday I'll asynchronously get some tweets, then callback. console.log("server got callback=",callback) } }) This works: in /client/views/twitter.js: Template.twitter.created = function(){ Meteor.call("mytweets",123); } this properly logs server got callback=123 and at this point everything is ok. However the following won't work: This won't work. Why? Meteor.call('mytweets', function(){ return 123; }) when passing a function, the output is server got callback= undefined Any idea why ? note: I'm new with both meteor and javascript so I don't really know (yet) if that's more a javascript or a meteor-related issue. I'll tag both just in case. Thanks in advance !!
possible better answer: http://stackoverflow.com/a/28835655
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28835655
score: 1
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/28835559
linked to: http://stackoverflow.com/q/26226583
tagged with: javascript
answer count: 2

http://stackoverflow.com/a/28850170
has comment: http://stackoverflow.com/comment/45968065
type: Answer
score: 2
downvote count: 0
has body: Chrome actually makes its work for the key combinations (Alt+key, Ctrl+Key, Shift+Key, etc.) on 'keyup' instead of 'keydown' as you expect. So, when you listen to 'keydown' event it's too early, while 'keypress' is too late stage. You should catch 'keyup' event and do your customization there.
answers question: http://stackoverflow.com/q/28849769
upvote count: 2

http://stackoverflow.com/comment/45799345
comment on: http://stackoverflow.com/q/28759467
has text: @KyraShin Where are you taking input for number of customers?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/50570778
has text: actually i am **blocked from asking question** due to irrelevant questions , helpless questions . due to that i was on verge to delete this question.so while deleting this question i thought if i un-accept i will be able to delete the question.but i was not able to delete , at last to delete this question i have raised flagged of which i haven’t received response till now. reply me if go wrong some where :)
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28874572
score: 0

http://stackoverflow.com/a/28757282
upvote count: 4
downvote count: 0
has body: Traverse your array of functions within the bound listener function and call each one: var funcs = [f1, f2, f3, f4]; $(window).on("keypress", function() { for(var i in funcs) { if(!funcs.hasOwnProperty(i)) { continue; } funcs[i](); } });
answers question: http://stackoverflow.com/q/28757063
score: 4
type: Answer

http://stackoverflow.com/a/28855869
upvote count: 1
answers question: http://stackoverflow.com/q/28855773
score: 1
has body: if (clicks &lt; 0) is being called only once, when the page loads, and right after you set clicks = 0, so it never meets the criteria. You need to put that logic in both the onClick and offClick or extract it out in to some method, for example: var clicks = 0; function resetClicks() { if (clicks &lt; 0) { clicks = 0; document.getElementById("ticketAmmount").innerHTML = clicks; } } function onClick() { clicks += 1; document.getElementById("ticketAmmount").innerHTML = clicks; resetClicks(); }; function offClick() { clicks -= 1; document.getElementById("ticketAmmount").innerHTML = clicks; resetClicks(); }
downvote count: 0
type: Answer

http://stackoverflow.com/q/28760166
has comment: http://stackoverflow.com/comment/45802412
downvote count: 0
tagged with: javascript
has title: Cannot Claim OPOS MSR in JS
score: 1
favorite count: 0
answer count: 0
type: UnansweredQuestion
upvote count: 1
has body: I have Posiflex MSR MR2000 Series. I've intalled Posiflex OPOS Control. I need to manage MSR on html page under IE 8. I use ocx control OPOS.MSR in my JS code / object with regarding CLSID. I have such a code (ActiveX version) function msrop(){ try { if ( r = msro.Open('MR1') ) { log ( ER100 + ' ' + 'MSROP' + ' ' + r ); return } log(r); } catch ( e ) { log ( 'MSROP' , e ) ; return ; } } function msrcl(){ try { if ( r = msro.Claim(-1) ) { log ( ER100 + ' ' + 'MSRCL' + ' ' + r ); return } msro.DeviceEnabled = true ; msro.DataEventEnabled = true ; log(r); } catch ( e ) { log ( 'MSRCL' , e ) ; return ; } } function ol(){ try { msro = new ActiveXObject ( 'OPOS.MSR' ) ; } catch ( e ) { alert(e) } bind ( msro ) ; } function bind( o ){ function o::DataEvent(){ log(' ' + '->Tracks read ' + 'T1: ' + o.Track1Data + ' T2: ' + o.Track2Data + 'T3: ' + o.Track3Data + 'T4: ' + o.Track4Data ); log(' ' + '->DataEventEnabled ' + ( msro.DataEventEnabled = true )) var d = document.getElementById('track'); d.innerHTML = o.AccountNumber; } } ... Open Claim This code works pretty well within HTA application: Claim method returns OPOS_SUCCESS (0). But when I try it as HTM in Internet Explorer 8, Claim method raises exception and object ResultCode property is 104 (OposENoservice). Recall returns ResultCode 102 (OposEClaimed). I need to get work Claim method properly in Internet Explorer. Why does the same code work different in HTA, which is based on IE??
tagged with: opos
tagged with: internet-explorer
tagged with: hta
has comment: http://stackoverflow.com/comment/45823719
type: Question
has comment: http://stackoverflow.com/comment/45885836
has comment: http://stackoverflow.com/comment/45802044

http://stackoverflow.com/comment/45861724
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28793120
score: 0
has text: update above, my script is a server and Clint side regular update script. so no need to click or others else.

http://stackoverflow.com/comment/45883755
has text: did you check it in the network tab? (in the chrome developer tool)? are you getting 200 OK ?
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28804988

http://stackoverflow.com/comment/109832899
score: 0
comment on: http://stackoverflow.com/a/52948276
type: Comment
has text: Hi @AMDI thanks for trying. The code is for JSONArray not JSONObject you can try the object by adding array [] like ex: `myObj = [{ "name":"John", "age":30, "car":null }];`
type: AnswerComment

http://stackoverflow.com/comment/45927794
type: Comment
has text: Yes. That's the point of `event.stopPropagation`.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28828733

http://stackoverflow.com/q/28792158
accepted answer: http://stackoverflow.com/a/28802421
type: Question
possible better answer: http://stackoverflow.com/a/28795279
has comment: http://stackoverflow.com/comment/45861538
tagged with: javascript
has answer: http://stackoverflow.com/a/28802421
tagged with: haskell
upvote count: 2
has title: Getting every Friday until a certain date, but in a functional style?
tagged with: functional-programming
favorite count: 0
has comment: http://stackoverflow.com/comment/45859306
has answer: http://stackoverflow.com/a/28795279
linked to: http://stackoverflow.com/q/8197032
answer count: 4
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/45859334
has body: For example, I want to get the dates of every Friday from now until 30 days from now. Currently, I can make use of the underscore library and moment.js to do this. But the result is super verbose and annoyingly procedural/imperative. Observe: var initDate = moment().day("Friday"); var endDate = moment().add(30, 'days'); var result = []; result.push(initDate); while (_.last(result).isBefore(endDate)) { var x = _.last(result); result.push(nextWeek(x)); } alert(result); // answer here // create a new moment from given moment and add 7 days function nextWeek(initMoment) { var x = moment(initMoment); return x.add(7,'days'); } Here is the corresponding fiddle: http://jsfiddle.net/aafsh5xa/ I was wondering if there's a way to use Haskell-like features such as list comprehensions or infinite lists (lazy evaluation) to make this a lot more concise. Maybe something like: var initDate = moment(); var endDate = moment().add(30,days); var everyFriday = genLazyList(initDate, nextFridayFrom); var result = _.filter(everyFriday, function(input){ return input.isBefore(endDate); }); Note that everyFriday is an infinite list generated by genLazyList and is not evaluated until the _.filter() function is called upon it. And nextFridayFrom() is a function that genLazyList uses to make the lazy list.
tagged with: lazy-evaluation
downvote count: 0
tagged with: underscore.js
has comment: http://stackoverflow.com/comment/45859414
has answer: http://stackoverflow.com/a/28792316
has answer: http://stackoverflow.com/a/37161621

http://stackoverflow.com/a/28866248
score: 1
has body: The javascript you have defined is incorrect as the color itself needs to be a string literal. See the following example for the correct use: echo " ";
downvote count: 0
answers question: http://stackoverflow.com/q/28866145
type: Answer
upvote count: 1

http://stackoverflow.com/a/28824486
upvote count: 18
has comment: http://stackoverflow.com/comment/60000160
type: Answer
has comment: http://stackoverflow.com/comment/46032557
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28822881
has comment: http://stackoverflow.com/comment/46125413
answers question: http://stackoverflow.com/q/28822881
score: 18
has body: Because of the drought of documentation of biblical proportions for Facebook Flux, I didn't know that I was using code from previous versions. In AppDispatcher.js, you need to define AppDispatcher in the following way using the new keyword: var Dispatcher = require('flux').Dispatcher; var assign = require('object-assign'); var AppDispatcher = assign(new Dispatcher(), { handleViewAction: function(action) { this.dispatch({ source: 'VIEW_ACTION', action: action }); } }); module.exports = AppDispatcher; Here is a link to a repository with the working code: https://github.com/bengrunfeld/react-flux-simple-app
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46125575
has comment: http://stackoverflow.com/comment/46130700

http://stackoverflow.com/q/28900881
answer count: 1
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/71985145
favorite count: 0
has comment: http://stackoverflow.com/comment/47487821
tagged with: console.log
has comment: http://stackoverflow.com/comment/46061718
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/50935981
has comment: http://stackoverflow.com/comment/46091730
has comment: http://stackoverflow.com/comment/47463715
tagged with: ie11-developer-tools
tagged with: internet-explorer-11
upvote count: 5
has title: Logging with Angular in IE11 shows strange behavior
type: Question
has body: I am currently debugging a rather strange issue in an angular application on IE11 (Edge). We are using a custom Logger which then writes everything that's necessary through angulars $log Service into the console. Now in IE11 we have the following behavior: If we load the page (and thus initialize our Angular app) with the F12 tools open, there is no issue with logging. As soon as we close the F12 tools, subsequent logs apparently trigger a javascript error and no following JS-Code is executed. However since I can't debug it I don't know the error. The only reference I sometimes get when I reopen the devtools is an issue with browsertools.library.js. If we load the page with our F12 tools closed however, there is no issue at all, even when we open and close the F12 tools again. This also doesn't happen with other browsers (e.g. Chrome). Our Angular version is 1.2.18 (company policy...) Thanks for any hint or solution. Chnoch
score: 5
has comment: http://stackoverflow.com/comment/46098624

http://stackoverflow.com/comment/45882386
has text: This is functionally and peformance-wise same as the code in the question right?
type: AnswerComment
comment on: http://stackoverflow.com/a/28804510
type: Comment
score: 0

http://stackoverflow.com/a/28819521
downvote count: 0
answers question: http://stackoverflow.com/q/28819363
upvote count: 3
type: AcceptedAnswer
has body: You cannot use objects with ordinal scales. Internally, the mapping from input to output uses D3 maps, which coerce the keys (i.e. the input) to strings. For objects, the result is "[object Object]" for all objects. That is, all objects "look" the same to an ordinal scale.
type: Answer
score: 3
accepted answer of: http://stackoverflow.com/q/28819363

http://stackoverflow.com/q/28762281
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28762470
has answer: http://stackoverflow.com/a/28762667
type: Question
accepted answer: http://stackoverflow.com/a/28762667
has body: Looking at the angular documentation for controller there's something that confuses me. Let's say someone does this: angular.module('foo').controller('controller1', ['$scope', function($scope) { }); and: &lt;div ng-app='app' ng-controller='controller1'&gt; &lt;/div&gt; How does angular know that 'controller1' resides in module 'foo'? And furthermore if someone does this in addition: angular.module('bar').controller('controller1', ['$scope', function($scope) { }); Which one will angular chose now?
tagged with: javascript
score: 0
answer count: 2
has title: How does angular resolve controllers defined in modules?
tagged with: angularjs
has answer: http://stackoverflow.com/a/28762470

http://stackoverflow.com/comment/45939226
type: AnswerComment
score: 0
type: Comment
has text: The point is that i want to take time offset with javascript, and return it to razor, actually i did created script, and also a razor code which takes string as hours, when i hardcode it, works perfectly, javascript also returns what i want as alert, so i wanted to know if i can combine them and get the point. However thank you for your fast response.
comment on: http://stackoverflow.com/a/28834764

http://stackoverflow.com/comment/45927700
comment on: http://stackoverflow.com/q/28828733
type: Comment
type: QuestionComment
has text: You probably have some code stopping propagation, but you haven't shown enough to tell.
score: 1

http://stackoverflow.com/q/28798967
has comment: http://stackoverflow.com/comment/45874613
has body: I'm building a WC website and I'd like to change the display of the attributes. Rather than display them as a dropdown form element, each attribute should be displayed as a text link. Here's an example site that does it right with the shoe sizes: http://shop.nordstrom.com/s/vince-addie-sandal/3761939?origin=category I purchased the Variations Swatches and Images plugin for the site. It works for product sizing (it's easy to predict product sizes, so I could make the images) but the product colors are custom for each item (Berry, Turquoise, etc). The end client isn't saavy enough to generate an image of text for every color possibility, however. I considered converting the dropdown to radio buttons (seen here on SO), removing the radio elements, and styling the labels, but the WP plugin that's available doesn't generate valid labels to click on. Admittedly, my JS knowledge is limited to basic scripts and tinkering, so building a custom thing would be hard... Any ideas of where to go from here would be appreciated. Here's what I'm considering: Modifying the SO post from above to have valid labels and pray it works Adding in color swatches for the shoes as colors or text every time Leaving the colors as a drop down and asking client to work with it (not good)
type: Question
answer count: 1
has answer: http://stackoverflow.com/a/28800395
tagged with: javascript
tagged with: jquery
has title: Convert Woocommerce Attribute Dropdown to Clickable Text
downvote count: 0
has comment: http://stackoverflow.com/comment/45873742
linked to: http://stackoverflow.com/q/12374110
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45873511
score: 3
tagged with: woocommerce
upvote count: 3
tagged with: wordpress

http://stackoverflow.com/comment/46031575
score: 0
has text: @george `:before` is supported in all major browsers. Even on all modern mobile devices. Since IE9 so your good. IE8 is being phased out quickly.
type: AnswerComment
comment on: http://stackoverflow.com/a/28883795
type: Comment

http://stackoverflow.com/a/28809401
type: Answer
upvote count: 3
has body: If you want to use a framework, I can suggest something like knockout JS. http://www.knockoutjs.com The purpose of this framework is to separate your JavaScript model (in this case your Contact objects) from the presentation. Your code contains a lot of HTML manipulation which can be offloaded into knockout and it will provide this functionality for you using data binding. E.g it takes a model, and it takes a view (of HTML with data binding configuration) and binds them together to create your output. When the model changes, the view is updated automatically, and when fields change on the view, the model is updated automatically. This two way binding gives you clear separation of concerns and clean code that does not contain (or should not contain) any JavaScript which directly modifies the HTML document (e.g document.getElementById / document.createElement etc...) Can I suggest you read the knockout js link, and to put it into context have a look at this fiddle that demonstrates the basic behavior you are after by using KnockoutJS. http://jsfiddle.net/tt0L6zm0/2/ The View Model: var vm = { items: ko.observableArray([]), contactReference: ko.observable(), growerReference: ko.observable(), mainGroup: ko.observable(), item: ko.observable(), quantityOrdered: ko.observable(), totalPrice: ko.observable(), deliveryDate: ko.observable(), addItem: function () { this.items.push({ contactReference: this.contactReference(), growerReference: this.growerReference(), mainGroup: this.mainGroup(), item: this.item(), quantityOrdered: this.quantityOrdered(), totalPrice: this.totalPrice(), deliveryDate: this.deliveryDate() }); } } ko.applyBindings(vm); The view: Contract Reference: Grower Reference: Main Group: Item: Quantity Ordered: Total Price for Order: Delivery Date: Contact Reference Grower Reference Main Group Item Quantity Ordered Total Price for Order Delivery Date This may look a little unfamiliar if you are used to operating directly with the DOM, but it will simplify your …
accepted answer of: http://stackoverflow.com/q/28808903
score: 3
answers question: http://stackoverflow.com/q/28808903
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/28795656
score: 1
has body: I believe this will do the job. function myIntersection() { var objectLists = [].slice.call(arguments), objMapper = objectLists.pop(); var flatLists = objectLists.map(function(lst) { return lst.map(objMapper); }); // There will be duplicates in this list, but maybe that's the desired // behaviour, so I'll leave it to you to sort that out. var mergedObjectLists = _.flatten(objectLists); var intersectingValues = _.intersection.apply(null, flatLists); return mergedObjectLists.filter(function(obj) { return intersectingValues.indexOf(objMapper(obj)) !== -1 }); } myIntersection(list1, list2, function(obj) {return obj.item.id}); I'd love to see other approaches.
has comment: http://stackoverflow.com/comment/74513709
downvote count: 0
answers question: http://stackoverflow.com/q/28794764
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28794764
has comment: http://stackoverflow.com/comment/46223609
type: Answer
upvote count: 1

http://stackoverflow.com/q/28751995
has title: How to obtain Google service account access token javascript
has comment: http://stackoverflow.com/comment/45944267
linked to: http://stackoverflow.com/q/18478764
tagged with: google-analytics-api
score: 31
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45989741
upvote count: 31
has answer: http://stackoverflow.com/a/68290623
linked to: http://stackoverflow.com/q/28070463
type: Question
has answer: http://stackoverflow.com/a/29288013
tagged with: javascript
has answer: http://stackoverflow.com/a/67163329
downvote count: 0
has body: I'm trying to set up an analytics dashboard of my site for my leadership to view site usage. I don't want them to have to have a google account or to add them individual to see the results. I've set up a service account and OAuth2 access. All the tutorials I find show code like this: gapi.analytics.auth.authorize({ clientid: 'Service account client ID', serverAuth: { access_token: 'XXXXXXXXXXXXXXXXX' } And all the documentation talks about "...once you recieve your access token...." But none of them actually say how to get that! I see Certificate Fingerprints, Public key fingerprints. I also see how to generate JSON and P12 keys. I don't see how to generate the access token. Can someone explain how to do this? I found this. It explains that I need the key file and that it is a bad idea, but doesn't say how to actually do it. I also found this. But I don't know anything about Node.js and I'm hoping that is just one possible route?
possible better answer: http://stackoverflow.com/a/43401376
accepted answer: http://stackoverflow.com/a/29288013
favorite count: 0
has answer: http://stackoverflow.com/a/43401376
answer count: 5
has answer: http://stackoverflow.com/a/32210815

http://stackoverflow.com/comment/45845999
has text: I guess I could make a for loop and add the length of all items and sub items from sub arrays but that's kind of ugly...
score: 0
comment on: http://stackoverflow.com/a/28784781
type: AnswerComment
type: Comment

fullpage.js
tags question: http://stackoverflow.com/q/28877830
tags question: http://stackoverflow.com/q/28775611
tag name: fullpage.js
tags question: http://stackoverflow.com/q/28757752
type: Tag

http://stackoverflow.com/a/28842977
type: Answer
accepted answer of: http://stackoverflow.com/q/28841721
upvote count: 4
answers question: http://stackoverflow.com/q/28841721
has body: This is just a simple demo on how you could achieve this with the modulo operator %. There will be more efficient and smaller solutions. var musicItems = [ ["assets/audio/1.wav"], ["assets/audio/2.wav"], ["assets/audio/3.wav"], ["assets/audio/4.wav"], ["assets/audio/5.wav"], ["assets/audio/6.wav"], ["assets/audio/7.wav"], ["assets/audio/8.wav"], ]; var sets = new Object(); var set = new Array(); var setCounter = 0; for(var i = 0; i &lt; musicItems.length; i++) { set.push(musicItems[i]); if((i + 1) % 5 == 0 || (i + 1) &gt;= musicItems.length) { setCounter++; sets['set' + setCounter] = set; set = new Array(); } } console.log(sets['set1']); console.log(sets['set2']); Basically what this does is to iterate through the musicItems, with modulo % 5 we check if the current item can be devided by 5 without rest, so we know a set is complete as we collected 5 items. Then we add the set to the overall sets object to use it later on as a dictionary (as wished with 'set1', 'set2' etc.) and we clear the current set, to fill it with the next n-5 items.
score: 4
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28825513
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46405509
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/29086372
tagged with: parse-cloud-code
has comment: http://stackoverflow.com/comment/45941061
score: 0
tagged with: geopoints
has title: Parse Cloud Code geoPoint Query Javascript Syntax
has body: I am attempting to write a Parse Cloud Code function where the parameter is a list of Objects that each include a geoPoint member. For each item in the list, I will search the Parse data store for an existing item in a 1 mile radius with the same name. If the item does not exist, then create the item and save it to the data store. My Function /** * Take a list of Place and check for existence in Parse. * If it doesn't already exist, add it. * @see https://www.parse.com/questions/access-distance-on-a-geoquery * @param {JSON Place.PlaceSearch} * @return none */ function addConvertedApiResult(placeData) { for ( var i = 0; i &lt; placeData.length; i++ ) { // look near loc for existing name var loc = new Parse.GeoPoint(placeData[i].lat, placeData[i].lon) var query = new Parse.Query("Place"); query.withinMiles("location", loc, 1); query.equalTo("name", placeData[i].name); console.log("placeData[i].name:"+placeData[i].name); query.find({ success: function(results) { // results contains a list of places that are within 1 mile // and have the same name console.log("results.length = "+results.length); if(results.length &lt; 1) { // add the place var Place = Parse.Object.extend("Place"); var place = new Place(); place.set("en", placeData[i].name); place.set("location", loc); place.set("moreInfo", placeData[i].moreInfo); place.save(); } }, error: function(error) { // There was an error. console.log("error = "+error.message); } }); console.log("leaving addConvertedApiResult"); } } My request to a Cloud Function that calls addConvertedApiResult (Must escape '"' from windows command line) curl -X POST -H "X-Parse-Application-Id: &lt;key&gt;" -H "X-Parse-REST-API-Key: &lt;key&gt;" -H "Content-Type: application/json" -d "{\"name\":\"Storm+Mountain\",\"lat\":44.0760,\"lon\":-103.2280,\"limit\":5,\"radius\":25}" https://api.parse.com/1/functions/getPlace {"result":[{"lat":43.95483,"lon":-103.36869,"moreInfo":"&lt;apiUrl&gt;/item.php?c=1\u0026i=3439","name":"Storm Mountain"}]} Resultin…
tagged with: parse-platform
has comment: http://stackoverflow.com/comment/45922582
has answer: http://stackoverflow.com/a/29086372
type: Question

http://stackoverflow.com/q/28818625
has comment: http://stackoverflow.com/comment/45909279
tagged with: forms
has comment: http://stackoverflow.com/comment/45909237
has body: Not able to submit these two forms with a singe submit button. I tried to use javascript but didn't work. Can anyone please help me with this? &lt;form id="batting" name="form1" method="post" action=""&gt; &lt;input type="checkbox" name="batsman[]" value="1" /&gt; &lt;?php echo $bat1; ?&gt;&lt;br /&gt; &lt;input type="checkbox" name="batsman[]" value="2" /&gt; &lt;?php echo $bat2; ?&gt;&lt;br /&gt; &lt;input type="checkbox" name="batsman[]" value="3" /&gt; &lt;?php echo $bat3; ?&gt;&lt;br /&gt; &lt;input type="checkbox" name="batsman[]" value="4" /&gt; &lt;?php echo $bat4; ?&gt;&lt;br /&gt; &lt;input type="checkbox" name="batsman[]" value="5" /&gt; &lt;?php echo $bat5; ?&gt;&lt;br /&gt; &lt;input type="checkbox" name="batsman[]" value="6" /&gt; &lt;?php echo $bat6; ?&gt;&lt;br /&gt; &lt;input type="checkbox" name="batsman[]" value="7" /&gt; &lt;?php echo $bat7; ?&gt;&lt;br /&gt;&lt;br /&gt; &lt;/form&gt; &lt;form id="bowling" name="form2" method="post" action=""&gt; &lt;input type="checkbox" name="bowler[]" value="1" /&gt; &lt;?php echo $bow1; ?&gt;&lt;br /&gt; &lt;input type="checkbox" name="bowler[]" value="2" /&gt; &lt;?php echo $bow2; ?&gt;&lt;br /&gt; &lt;input type="checkbox" name="bowler[]" value="3" /&gt; &lt;?php echo $bow3; ?&gt;&lt;br /&gt; &lt;input type="checkbox" name="bowler[]" value="4" /&gt; &lt;?php echo $bow4; ?&gt;&lt;br /&gt; &lt;input type="checkbox" name="bowler[]" value="5" /&gt; &lt;?php echo $bow5; ?&gt;&lt;br /&gt;&lt;br /&gt; &lt;/form&gt; &lt;input type="button" value="Click Me!" onclick="submitForms()" /&gt; &lt;script type="text/javascript"&gt; //Syntax: checkboxlimit(checkbox_reference, limit) checkboxlimit(document.forms.batting, 2) //Syntax: checkboxlimit(checkbox_reference, limit) checkboxlimit(document.forms.bowling, 1) submitForms = function(){ document.forms["form1"].submit(); document.forms["form2"].submit(); } &lt;/script&gt;
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45909559
has comment: http://stackoverflow.com/comment/45908888
has comment: http://stackoverflow.com/comment/45908836
has title: two forms one submit button javascript
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45909262

http://stackoverflow.com/q/28880515
tagged with: javascript
tagged with: web
tagged with: jquery
score: 0
answer count: 0
type: UnansweredQuestion
tagged with: javascript-objects
type: Question
has comment: http://stackoverflow.com/comment/46022660
tagged with: cookies
linked to: http://stackoverflow.com/q/14573223
has title: How to make a simple webpage register form using cookies? (jQuery)
has body: I'm making a register/login form in javascript. User should enter information about himself and the computer should put that information into an array and remember it but it 'forgets' it every time I reload the page. else { document.cookie = email; cookies[cookies.length] = document.cookie; $('#error').text("Your registration is complete."); break; } ...more code $('.btn').click(function() { alert(cookies[cookies.length - 1]); }); Any ideas to solve this? I have one more question. How can I check weather is an username alerady in use? Here is the full js code: var main = function() { var people = []; var cookies = []; $('#register_email').val(""); $('#register_username').val(""); $('#register_password').val(""); $('#register2_password').val(""); function Person(username, email, password, repeat_password) { this.username = username; this.email = email; this.password = password; this.repeat_password = repeat_password; } $('#register').click(function() { var username = $('#register_username').val(); var email = $('#register_email').val(); var password = $('#register_password').val(); var r_password = $('#register2_password').val(); if( email==="" || username==="" || password==="" || r_password==="") { $('#error').text("You didn't fill everything"); } else { people[people.length] = new Person(username, email, password, r_password); for(var key in people) { //This should check weather this username was used before but I'm not really sure what to insert instead of "name" if(people[people.length - 1].username === "name") { $('#error').text("This username is already in use"); break; } else if(password !== r_password) { $('#error').text("Passwords don't match"); break; } else { document.cookie = email; cookies[cookies.length] = document.cookie; $('#error').text("Your registration is complete."); break; } } } }); $('.btn').click(function() { alert(cookies[cookies.length - 1]); }); }; $(document).ready(main); There is a js-fiddle live example in comments.
has comment: http://stackoverflow.com/comment/46022459

http://stackoverflow.com/comment/46008884
type: AnswerComment
comment on: http://stackoverflow.com/a/28872576
type: Comment
has text: Can you show me how you tried to instantiate it? You have to apply it to the element that contains the text, not the text itself. `$('.message-text').linkify();
score: 0

http://stackoverflow.com/q/28874898
has comment: http://stackoverflow.com/comment/46012083
favorite count: 0
has body: I have the following markup that shows a value from ng-model: {{document.content.replace(/\d+\_/,"")}} Before each document.content I add a number and an underscore, something like "12122141_document.txt". I want to replace this part by using the regex /\d+\_/. This throws an error in AngularJS, although {{ document.replace(" ","") }} works. Is the only way to solve this a directive or am I doing something wrong? Plunker
tagged with: angularjs
has answer: http://stackoverflow.com/a/28875915
has title: AngularJS replace using regex on template
tagged with: regex
upvote count: 6
type: AnsweredQuestion
score: 6
has comment: http://stackoverflow.com/comment/46013372
type: Question
accepted answer: http://stackoverflow.com/a/28875915
tagged with: javascript
tagged with: replace
answer count: 1
downvote count: 0

http://stackoverflow.com/q/28893523
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46047348
has comment: http://stackoverflow.com/comment/46047612
downvote count: 1
type: Question
has body: can i get 3 digit after decimal with 3rd digit as zero for example var x = 5.123456; y = x.toFixed(3); in this value in y will be 5.123 but the result should be as 5.120
has title: .toFixed with 3 digit but last digit should be zero
has comment: http://stackoverflow.com/comment/46057518
tagged with: javascript
score: -1
upvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/28893803

http://stackoverflow.com/a/28895763
upvote count: 2
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 2
accepted answer of: http://stackoverflow.com/q/28895668
has body: You can use String.prototype.replace() to achieve that: jQuery(document).ready(function($) { //get the url var oldUrl = $("#menu-item-1").children().attr("href"); //remove # using String.prototype.replace() var url = oldUrl.replace(/#/, ""); //add attribute data-menuanchor to li element $('#menu-1 li').attr('data-menuanchor', url); }); first Page Also in one line: jQuery(document).ready(function ($) { $('#menu-1 li').attr('data-menuanchor', $("#menu-item-1").children().attr("href").replace(/#/, "")); }); Also to add the data-menuanchor to all li elements you need an iterator. Here an example using jquery .filter() jQuery(document).ready(function($) { $('#menu-1 li').filter(function() { $(this).attr('data-menuanchor', this.children[0].hash.replace(/#/, "")); }); }); first Page second Page third Page
answers question: http://stackoverflow.com/q/28895668

http://stackoverflow.com/q/28899336
tagged with: viewmodel
tagged with: mvvm
type: AnsweredQuestion
has body: I have this simple mvvm example: https://fiddle.sencha.com/#fiddle/j8m When I console.log the viewModel from the controller, stores appear in the data attribute, calling viewModel.getStores() returns me null. I don't get it :/... Here is the same code as in the fiddle: Ext.define('MainViewModel', { extend: 'Ext.app.ViewModel', alias: 'viewmodel.mainviewmodel', stores: { todoAccountsStore: { type: 'tree' }, skipAccountsStore: { type: 'tree' } } }); Ext.define('MainViewController', { extend: 'Ext.app.ViewController', alias: 'controller.mainviewcontroller', init: function() { console.log(this.getViewModel()); } }); Ext.define('MainView', { extend: 'Ext.panel.Panel', xtype: 'view-main', controller: 'mainviewcontroller', viewModel: { type: 'mainviewmodel' } }); var test = Ext.create('MainView', { renderTo: Ext.getBody() });
type: Question
has title: EXTJS 5 Can I have a tree store in stores property of view model?
score: 0
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28925697
accepted answer: http://stackoverflow.com/a/28925697
tagged with: extjs

http://stackoverflow.com/comment/46065793
type: QuestionComment
has text: If you are referring to adding a div in the page you can use $('container').append('.divSecond') , check out jquery append/prepend/html
comment on: http://stackoverflow.com/q/28903111
score: 0
type: Comment

http://stackoverflow.com/comment/45794236
score: 1
has text: Do you want to keep it from being bigger or smaller than 140px?
comment on: http://stackoverflow.com/q/28756629
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45949775
type: AnswerComment
comment on: http://stackoverflow.com/a/28837592
type: Comment
has text: @Chris No, you don't need a loop. `filter` is exactly the result you need. See updated answer
score: 0

http://stackoverflow.com/comment/45969913
comment on: http://stackoverflow.com/a/28850787
score: 0
type: AnswerComment
has text: Thanks for solution. However i'm getting something like ,second,,fourth. Strange. However the next comment solves this. Thanks again.
type: Comment

http://stackoverflow.com/comment/46134811
type: AnswerComment
type: Comment
score: 1
has text: So the first lines sets the domain to be an array of different types from your data (['inc_call', 'out_text', 'out_call', 'inc_text']. These values you want to map to different y coordinates. The second line assigns the min and max of time to be the domain for x. The last one maps all types to colors. Note that y and colorOf have the same domain (array of different types) but different ranges (y coordinates or colors)
comment on: http://stackoverflow.com/a/28908327

http://stackoverflow.com/q/28812358
accepted answer: http://stackoverflow.com/a/28812589
has comment: http://stackoverflow.com/comment/45897387
downvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45897708
has answer: http://stackoverflow.com/a/28812802
has comment: http://stackoverflow.com/comment/45897507
has comment: http://stackoverflow.com/comment/45897415
type: Question
has comment: http://stackoverflow.com/comment/45900728
upvote count: 0
has answer: http://stackoverflow.com/a/28813061
tagged with: javascript
answer count: 6
tagged with: jquery
has answer: http://stackoverflow.com/a/28812589
has body: I would like to know how to append text from the selected dropdown value and also the the text from textbox into a single string. I need results in JQuery and i found this link, which doesn't work. Thank You in advance. here is my JSFiddle for more information. - select one - Client_ID Employee_ID Salary - select one - Equals Not Equals <option value="<">Less Than ">Greater Than - select one - OR AND END Script: function summarise(container, what, sumClass) { var els = container.querySelectorAll(what), sumTo = container.querySelector(sumClass), vals = []; for (var i = 0, len = els.length; i < len; i++) { vals.push(els[i].value); } sumTo.value = vals.join(' ').trim(); } var fieldsets = document.querySelectorAll('fieldset'); for (var i = 0, len = fieldsets.length; i < len; i++) { fieldsets[i].addEventListener('change', function () { summarise(this, 'select', '.summary'); }, false); } The output should be something like this: for "Client_ID(dd) Equals 708 OR Employee_ID Not Equals 1025 END" (client_id == "708"|| employee_id ! = "1025" ) Sorry all for not being clear in my question for the first time and updating it later. http://jsfiddle.net/Dd3ee/ similar work
has comment: http://stackoverflow.com/comment/45897019
has comment: http://stackoverflow.com/comment/45896921
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45897624
possible better answer: http://stackoverflow.com/a/28812659
has answer: http://stackoverflow.com/a/28812714
favorite count: 0
score: -1
has answer: http://stackoverflow.com/a/28812659
has comment: http://stackoverflow.com/comment/45896657
has answer: http://stackoverflow.com/a/28812843
has title: How to append textbox value along with dropdown values and vice versa using JQuery

http://stackoverflow.com/q/28873949
tagged with: jquery
has answer: http://stackoverflow.com/a/28874018
has answer: http://stackoverflow.com/a/28873989
has title: Clone full table and submit as form value
tagged with: http://stackoverflow.com/tag/html
tagged with: php
type: AnsweredQuestion
type: Question
possible better answer: http://stackoverflow.com/a/28874018
has body: How to correctly copy/clone a html table with javascript and submit it to php, where it will be converted to PDF and XLS documents? So far I have a html something like this: blah blah blah blah Eksport and jquery: $("#exportPDF").on("click", function (){ var value = $('.planning-table').clone(); $("#table_data").val( escape( value ) ); $("#exportPDFform").submit(); return false; }); Now, the cloning works, but, when put inside input field, it gives me: [object-Object] How do I correctly do this? PS: the form gets changed/created dinamically when selecting different filters, so it would be much easier to use the final product then to recreate it on PHP side.
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/28873989
answer count: 2

http://stackoverflow.com/q/28807078
has body: In the below code I am displaying a gallery that contains images. When I click on an image, I want to show the same image in a popup, and I also want to show the next and previous images. Any idea what my mistake was? But it was displaying as a new window. Can any one help me? html
has comment: http://stackoverflow.com/comment/45889512
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/28808741
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45888708
type: Question
has comment: http://stackoverflow.com/comment/45887904
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45888508
score: 0
has comment: http://stackoverflow.com/comment/45888656
has title: popup image not working in html using jquery

http://stackoverflow.com/comment/45965462
score: 0
type: AnswerComment
has text: Thanks for reply. I found another solution. My problem was due to missed sequence about assigning variable. Thanks for your help.
type: Comment
comment on: http://stackoverflow.com/a/28840737

http://stackoverflow.com/a/28853978
has comment: http://stackoverflow.com/comment/45975184
has comment: http://stackoverflow.com/comment/45975531
has comment: http://stackoverflow.com/comment/45975146
type: Answer
has body: Try to wrap your interval with the setTimeout function: // interval variable var cycle = 10; // variable for the interval since we are invoking it within a function, the callMeEverySecond function can't reach it var t; var callMeEverySecond = function() { cycle--; // Logs the Date to the console console.log(new Date()); if(cycle === 0) { console.log("stop this"); clearInterval(t); // do something further. } } // Start the timeout after 5 seconds setTimeout(function() { // call the function 'callMeEverySecond' each second t = setInterval(callMeEverySecond, 1000); }, 5000); http://devdocs.io/dom/window.settimeout And a small tutorial: http://javascript.info/tutorial/settimeout-setinterval
has comment: http://stackoverflow.com/comment/45974589
answers question: http://stackoverflow.com/q/28853885
score: 0

http://stackoverflow.com/comment/46071759
comment on: http://stackoverflow.com/q/28905263
type: Comment
type: QuestionComment
score: 0
has text: It's obviously querying the right packId, The only thing I can think of is that it's not querying the right collection of the right database. Try querying just an empty object and see what is returned: `Card.find({}, function(err, docs) {console.log(err, docs)})`

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

http://stackoverflow.com/comment/45859685
score: 0
type: QuestionComment
type: Comment
has text: I need to return the object if I want to do something like: `someOtherFunction(foo(o))`. What you probably mean is that it doesn't matter if this is a fresh object or a reference to the external object.
comment on: http://stackoverflow.com/q/28792326

http://stackoverflow.com/q/28811176
has comment: http://stackoverflow.com/comment/45894472
type: AnsweredQuestion
tagged with: tampermonkey
possible better answer: http://stackoverflow.com/a/28812371
has answer: http://stackoverflow.com/a/28812371
has answer: http://stackoverflow.com/a/28813730
type: Question
tagged with: typescript
score: 5
upvote count: 5
tagged with: userscripts
tagged with: javascript
has comment: http://stackoverflow.com/comment/45895306
has answer: http://stackoverflow.com/a/28820613
answer count: 3
accepted answer: http://stackoverflow.com/a/28813730
downvote count: 0
favorite count: 0
has title: How to 'return' outside function definition in typescript
linked to: http://stackoverflow.com/q/9298839
has body: I need to rewrite my tampermonkey script on typescript. What is correct way to rewrite this javascript on typescript? if (window.top != window.self ) { return; } Main goal is to stop executing script if it's running not in window.top. Typescript compiler write ERROR TS1108: A 'return' statement can only be used within a function body.

http://stackoverflow.com/comment/45886004
score: 0
comment on: http://stackoverflow.com/q/28806425
has text: Have you tried to google this? [Using the title of your question returns quite a number of relevant results.](https://www.google.com/search?q=In+javascript+why+we+use+var+for+declaring+variable%3F&ie=utf-8&oe=utf-8&gws_rd=cr&ei=Zi_0VMX_Dcr3UInSgugO)
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28837015
tagged with: increment
answer count: 7
has answer: http://stackoverflow.com/a/28837137
accepted answer: http://stackoverflow.com/a/28837177
has answer: http://stackoverflow.com/a/28837062
possible better answer: http://stackoverflow.com/a/28837053
has answer: http://stackoverflow.com/a/28837109
has answer: http://stackoverflow.com/a/28837053
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28837307
type: Question
has title: Why am I getting weird increments in my for loop?
tagged with: for-loop
has body: I have been testing ways to check individual characters in a string for a numeric value. I set up a for loop that goes through them, but when I'm logging it to the console, I get a weird response: isNumeric: function(n){ for(var i = 0; i &lt; n.length; i++){ console.log("Looping " + i+1); } }, So I passed in the value "10" to test it. I get a weird response when I call the function. I get two logs onto the console (like expected), but it says Looping 01 Looping 11 What is going on here? I didn't think that I was concating strings here, but for some reason it thinks I am? I declared i as an integer var i = 0; and when you increment it by one, what is it doing? The only other thing I think it must be doing is logging something else appended to Looping 0 and Looping 1, but I don't think that's the case. If anyone can please help, this is really bugging me and I can't seem to fix it. Thanks in advance.
tagged with: javascript
has answer: http://stackoverflow.com/a/28837206
has answer: http://stackoverflow.com/a/28837177
score: 0

http://stackoverflow.com/a/28842404
score: 1
downvote count: 0
has body: The HTML5 LocalStorage is an associative array storage with the getItem function grabbing one of the items. So, localStorage.getItem ("somekey") returns whatever variable somekey was set to. In your code snippet, the variable you are storing in the localStorage is a String that happens to be in JSON form. JSON.parse () turns that JSON into the actual array represented by the String you've stored. var existEvents = JSON.parse (localStorage.getItem ('events')); for (var i = 0; i &lt; existEvents.length; i++) { var item = existEvents [i]; console.log(item); }; existEvents is an Array object so you can access it like normal. After you've retrieved it from localStorage and parsed it, you no longer need to access localStorage.getItem.
type: Answer
answers question: http://stackoverflow.com/q/28842153
upvote count: 1

http://stackoverflow.com/q/28849353
tagged with: codeigniter
possible better answer: http://stackoverflow.com/a/28849504
type: Question
has answer: http://stackoverflow.com/a/28849504
accepted answer: http://stackoverflow.com/a/28850572
tagged with: javascript
answer count: 6
tagged with: jquery
has answer: http://stackoverflow.com/a/28849481
has body: Need help to put some jquery function inside if statement . I want to hide my div when data from database is empty . I've done like this , and nothing happened. <?php if(empty($all_data)){ ?> <===update <?php }else{ ?> <?php foreach($all_data->result() as $data){ ?> <?php echo $data->id_history;?> <?=$data->id_admin;?> <?=$data->ipc;?> <?=$data->task_date;?> <?=$data->task_time;?> <?php if ($data->id_task == 1){ ?> Login Site <?php }else{ ?> Logout Site <?php } ?> - <?php } ?> <?php } ?> Is it possible to put some jquery inside php ??
has title: Jquery inside PHP if statement
score: 0
has answer: http://stackoverflow.com/a/28851262
has answer: http://stackoverflow.com/a/28849389
has comment: http://stackoverflow.com/comment/45967581
has answer: http://stackoverflow.com/a/28849524
has comment: http://stackoverflow.com/comment/45966286
has comment: http://stackoverflow.com/comment/45966244
has answer: http://stackoverflow.com/a/28850572
has comment: http://stackoverflow.com/comment/45966197
tagged with: php
type: AnsweredQuestion

http://stackoverflow.com/comment/45820131
comment on: http://stackoverflow.com/a/28770518
type: AnswerComment
has text: The form works I am able to subit the data just need it so that it does not submit twice by key and date. I know javascript can be disable but no one here would know how to do that so doesn't matter
score: 0
type: Comment

http://stackoverflow.com/a/30069952
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28830373
answers question: http://stackoverflow.com/q/28830373
type: Answer
has body: This question is old but, There are two things I would suggest... Firstly why don't you use PostGIS a postgresql extension which is superb and fast when it comes to GIS data. Secondly.. No! you can't do that... But for advanced where clause conditions I would suggest mixing things up with Knex.js A raw query builder. You can use Knex.js to build your where clause and mix things up with PostGIS to get the best results.

http://stackoverflow.com/q/28840516
has title: Angular text input submission fails to trigger console log
tagged with: angularjs
has answer: http://stackoverflow.com/a/28840741
accepted answer: http://stackoverflow.com/a/28840741
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28840723
has comment: http://stackoverflow.com/comment/45950299
has body: The following code snippets are meant to create a text input form that displays a message to the console every time the user submits new text from it. AngularJS Snippet: myApp.controller("appCtrl", function ($scope) { var data = { text: "" }; $scope.testSubmit = function () { console.log("Console Log");//I fail to see this message }; } HTML Snippet: &lt;form ng-submit="testSubmit()"&gt; &lt;input type="text" ng-model="data.text"&gt;&lt;/input&gt; &lt;/form&gt; Unfortunately, I fail to ever see the console log message. What am I missing?
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45950276
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/28840723

http://stackoverflow.com/q/28783893
has title: How to intercept ajax calls to return mock data.
has comment: http://stackoverflow.com/comment/45844103
downvote count: 0
has comment: http://stackoverflow.com/comment/45844784
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/45844673
has answer: http://stackoverflow.com/a/30507842
has answer: http://stackoverflow.com/a/28784238
linked to: http://stackoverflow.com/q/13765031
has comment: http://stackoverflow.com/comment/45845081
type: AnsweredQuestion
score: 2
possible better answer: http://stackoverflow.com/a/30507842
has comment: http://stackoverflow.com/comment/45844451
upvote count: 2
type: Question
has comment: http://stackoverflow.com/comment/45844995
has body: In my previous angularjs project I used interceptors to intercept the http calls, and to be able to serve mock data instead of the real data from the server. I found it very useful throughout the development process. My question is, how could I do this without angularjs (In my current project I use another framework, which does not have interceptors)? Is there any other http library out there, that supports this? How could I achive this using jquery's or superagent's http capabilities?
has comment: http://stackoverflow.com/comment/45844083
accepted answer: http://stackoverflow.com/a/28784238
tagged with: javascript
has comment: http://stackoverflow.com/comment/45844188
answer count: 2
has comment: http://stackoverflow.com/comment/45844579

http://stackoverflow.com/comment/45897124
type: AnswerComment
comment on: http://stackoverflow.com/a/28811408
type: Comment
has text: The reponse of my servlet is a pdf file stream. Therefore the browser automatically opens/saves the file.
score: 0

http://stackoverflow.com/comment/46009555
score: 1
type: AnswerComment
has text: Writing `In your example, change ... to ...` without any additional comment, indicates that this will create the fading. It is correct to suggest to change the code that way, but it is just an additional note and not a solution to the actual problem. Your answer is just a _link only answer_, so either leave it as comment or create a working example for the usage of `fadeIn` and `fadeOut`.
comment on: http://stackoverflow.com/a/28873390
type: Comment

http://stackoverflow.com/q/28884672
has answer: http://stackoverflow.com/a/28884767
favorite count: 0
has body: I have a script that converts XML into "JSON". The data available is able to be accessed using styles.Default.FontName (for example). However, instead of manually inserting 'Default' in that line, I need to be able to use a variable. I need to be able to use many different combinations of 'styles.XXXX.XXXX'. Here is my script function convertData(xml) { var styles = {} $(xml).find('Style').each(function() { var id = $(this).attr('ss:ID'); var name = $(this).attr('ss:Name'); var type = $(this).children(); var style = {}; styles[id] = style; style['Name'] = name; type.each(function() { $.each(this.attributes, function() { if (this.specified) { style[stripPrefix(this.name)] = this.value; } }); });; // You can now use 'styles.s57.FontName' and the like to return values :) }); $(xml).find('Worksheet').each(function() { var name = $(this).attr('ss:Name'); var data = $(this).find('Data'); data.each(function() { var cell = $(this).parent('Cell'); var value = $(this).text(); var styleId = cell.attr('ss:StyleID'); $(window).load(function() { // Here is my issue (see below for working calls...) // This guy doesn't work (because of the 'styleId' variable not being an actual style id like 's57') $('.testing').append('&lt;span class="color:#f60;"&gt;' + styles.styleId.Color + '&lt;/span&gt;'); }); }); }); $(document).ready(function() { $('body').append('&lt;div class="testing"/&gt;'); // Works fine $('.testing').html(styles.Default.FontName); $('.testing').append(styles.s59.Bold); $('body').append('&lt;div class="json-output"/&gt;'); $('.json-output').append(JSON.stringify(styles)); for (var i in styles) { console.log(i); } }); } So, how can I use a variable here instead of specifying 'Default' or 's59'? Any help is greatly appreciated! To clarify what I am asking... The use of **styles.Default.FontName** is working fine. I just need to be able to dynamically swap 'Default' with a variable. Why? Because I will be using this inside loops that are iterating through "Cells" that eac…
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/22753629
has answer: http://stackoverflow.com/a/28884903
tagged with: http://stackoverflow.com/tag/json
has title: How can I use variables when calling JSON values?
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
score: 0
upvote count: 1
downvote count: 1

http://stackoverflow.com/a/28822128
has comment: http://stackoverflow.com/comment/45920318
has comment: http://stackoverflow.com/comment/45921162
score: 1
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45929478
accepted answer of: http://stackoverflow.com/q/28820983
type: Answer
has body: Right name of the property is OnClientClicked, and it should be given a function name, so: OnClientClicked="openwin" This comes directly from docs: Sets a name of a JavaScript function that will be called when the RadButton is > clicked, after the OnClientClicking event.
answers question: http://stackoverflow.com/q/28820983
upvote count: 1

http://stackoverflow.com/comment/45887850
type: QuestionComment
score: 1
has text: @MårtenWikström Yes, like developer tools "Copy CSS Path".
type: Comment
comment on: http://stackoverflow.com/q/28804207

http://stackoverflow.com/comment/45958618
score: 0
has text: returnlatlang result will be return after the codeAddress function, but the real value should be gotted by the callback function. So you can not get it now. You should define a callback function ,in the callback function you use the returnlatlang , and set the callback to be invoked in the geocode callback function.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28844844

http://stackoverflow.com/a/28895052
type: Answer
accepted answer of: http://stackoverflow.com/q/28894613
upvote count: 3
answers question: http://stackoverflow.com/q/28894613
score: 3
type: AcceptedAnswer
downvote count: 0
has body: If You don't want to /cannot change the JSON, simply change detailsArray = [] to detailsObject = {} and companiesArray[company]=[company,detailsArray]; to companiesArray[company]=detailsObject; Now you can use companiesArray['company1'].employee

http://stackoverflow.com/comment/45801693
has text: can u help me, how can i give the save as future to save it in a particular folder. plz help
comment on: http://stackoverflow.com/a/28758795
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28815705
has comment: http://stackoverflow.com/comment/45929675
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28815271
type: Answer
answers question: http://stackoverflow.com/q/28815271
upvote count: 1
has body: A simple solution is to "flatten" both objects using a function similar to this: function flatObj(obj, key, res) { res = res || {}; if(typeof obj != "object" || obj === null) { res[key] = obj; return res; } return Object.keys(obj).reduce(function(res, k) { return flatObj(obj[k], (key || "") + "." + k, res); }, res); } var EN = { messages: { newButton: { text: "New" }, userSettings: { language: { selectYourLanguage: "Choose your preferred language", fr: "French", en: "English" } } } }; flat = flatObj(EN) document.write("&lt;pre&gt;"+JSON.stringify(flat,0,3)) and then calculate the set difference between Object.keys(flat(EN)) and Object.keys(flat(FR)).
has comment: http://stackoverflow.com/comment/45904977
has comment: http://stackoverflow.com/comment/45929819
type: AcceptedAnswer

http://stackoverflow.com/comment/45815953
type: QuestionComment
comment on: http://stackoverflow.com/q/28768494
type: Comment
has text: what is `shift`? `this` is not a string. Why do you even need to use jQuery for this and not do it with angular? Provide sample html for issues like these
score: 0

http://stackoverflow.com/q/28800185
has answer: http://stackoverflow.com/a/28809809
tagged with: revealing-module-pattern
has title: Javascript module pattern - Object.create
has comment: http://stackoverflow.com/comment/45876995
type: Question
has comment: http://stackoverflow.com/comment/45874501
tagged with: javascript
tagged with: module-pattern
score: 0
accepted answer: http://stackoverflow.com/a/28809809
linked to: http://stackoverflow.com/q/10131052
answer count: 1
has body: A bit of confusion regarding what exactly is going on here. given this simple code : stuff = (function(){ function extendFoo(bar) { $.extend(this.foo,bar); } this.foo = {}; return { foo : foo, extendFoo: extendFoo}; })(); Following this simple operation : zz = Object.create(stuff); zz.extendFoo({bar:'bar'}); vv = Object.create(stuff); //foo is still extended(??) So from what I realized, operations conducted on the returned object form Object.create still affect the prototype of that Object, So when you create a new object, his prototype is changed, thus resulting in a 'modified' version. This seems wrong on a lot of levels, Can anyone explain what's going on here? this behavior is not reproducible using the following pattern : stuff = (function(){ function setFoo(bar) { this.foo = bar; } var foo; return { foo : foo, setFoo: setFoo}; })(); So I suspect $.extend is to blame here. Any input would be great!
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45874533

http://stackoverflow.com/q/28867110
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 4
has answer: http://stackoverflow.com/a/28867194
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28867313
type: Question
has answer: http://stackoverflow.com/a/28867630
accepted answer: http://stackoverflow.com/a/28867630
score: 0
has body: I have 2 span elements inside 2 div elements. Both span elements have no id and both div elements also have no id. The 1st div has the 1st input element with an id (id_name) and then have the 1st span element after it. The 2nd div has the 2nd input element with an id (id_password) and then have the 2nd span element after it. I have a javascript function which I call on submit of form. Inside that function I can get the 1st input element in a variable element_id_name and the 2nd input element in a variable element_id_password. Now how can I get the 1st span element which comes after 1st input element? And how can I get the 2nd span element which comes after 2nd input element? Since I dont have id for span elements, I cannot use document.getElementById(). Is there a way to get 1st span element by reference to 1st input element? This is my code: test User Name: Required field Password: Required field Submit Thank you for reading my question.
has comment: http://stackoverflow.com/comment/45998963
has comment: http://stackoverflow.com/comment/45999010
tagged with: javascript
has title: How to get span element with no id which is inside a div with no id
possible better answer: http://stackoverflow.com/a/28867205
has answer: http://stackoverflow.com/a/28867205

google-chrome-extension
tags question: http://stackoverflow.com/q/28752895
tags question: http://stackoverflow.com/q/28853896
tags question: http://stackoverflow.com/q/28854906
tags question: http://stackoverflow.com/q/28786723
tags question: http://stackoverflow.com/q/28816374
tags question: http://stackoverflow.com/q/28760664
tag name: google-chrome-extension
tags question: http://stackoverflow.com/q/28754994
tags question: http://stackoverflow.com/q/28760679
tags question: http://stackoverflow.com/q/28805551
tags question: http://stackoverflow.com/q/28884898
tags question: http://stackoverflow.com/q/28871627
tags question: http://stackoverflow.com/q/28889928
tags question: http://stackoverflow.com/q/28760463
tags question: http://stackoverflow.com/q/28770357
tags question: http://stackoverflow.com/q/28829233
tags question: http://stackoverflow.com/q/28857636
tags question: http://stackoverflow.com/q/28809381
tags question: http://stackoverflow.com/q/28783584
tags question: http://stackoverflow.com/q/28774346
tags question: http://stackoverflow.com/q/28793930
type: Tag
tags question: http://stackoverflow.com/q/28832699
tags question: http://stackoverflow.com/q/28880373
tags question: http://stackoverflow.com/q/28803708
tags question: http://stackoverflow.com/q/28752268
tags question: http://stackoverflow.com/q/28869887
tags question: http://stackoverflow.com/q/28828101
tags question: http://stackoverflow.com/q/28809643
tags question: http://stackoverflow.com/q/28823002
tags question: http://stackoverflow.com/q/28887782
tags question: http://stackoverflow.com/q/28796083
tags question: http://stackoverflow.com/q/28835080
tags question: http://stackoverflow.com/q/28790903
tags question: http://stackoverflow.com/q/28803681
tags question: http://stackoverflow.com/q/28782228
tags question: http://stackoverflow.com/q/28832011
tags question: http://stackoverflow.com/q/28771797
tags question: http://stackoverflow.com/q/28757386
tags question: http://stackoverflow.com/q/28858027
tags question: http://stackoverflow.com/q/28844406
tags question: http://stackoverflow.com/q/28818606
tags question: http://stackoverflow.com/q/28867757
tags question: http://stackoverflow.com/q/28873206
tags question: http://stackoverflow.com/q/28825492
tags question: http://stackoverflow.com/q/28862923
tags question: http://stackoverflow.com/q/28799892

http://stackoverflow.com/q/28841622
has body: Just when I thought I could handle any button, I come across one that is responding to NOTHING I try. Here is the basic frame of my code (very basic). Just trying to open this page and click the next page button. Set objWshShell = Wscript.CreateObject("Wscript.Shell") Set IE = CreateObject("internetexplorer.application") IE.Visible = True IE.Navigate "http://centraloklahomaproperties.com/SiteContent/OKC/MemberSearchOKC.aspx" Do Until IE.ReadyState = 4: WScript.sleep 100: Loop On error resume next Dim i i = 0 Do while i &lt; 5 i = i + 1 Do Until IE.ReadyState = 4: WScript.sleep 100: Loop 'Click button here! Loop Things I've tried: 1) IE.Navigate "javascript:open.document.getElementByID('btnRight').onclick;" 2) IE.Navigate "Javascript:window.opener.btnright.click();" 3) For Each btn In IE.Document.getElementsByTagName("img") If btn.id = "btnRight" Then btn.Click() Next 4) ie.navigate "javascript:InvokeScript('Next(1)');" 5) Browser.InvokeScript("Next(1)") 6) ie.Navigate( Uri("javascript:(function(){ Next(1); })();") ) 7) Set oButton = IE.getElementById("btnRight") oButton.Click() Also tried methods here: How can I click a js button on VB Here is button html: &lt;img width="30" height="28" id="btnRight" onmouseover="Tab(event)" onmouseout="Tab(event)" onclick="Next(1);" alt="Next" src="http://centraloklahomaproperties.com/SiteContent/OKC/images/icon_arrow_next-default.gif"&gt; What's weird is, unless I specifically right click the left frame and view source, it's as if that frame doesn't even exist. If I just open the page in IE and go to >Edit>Source, it's non existent. Might be part of my problem.
has answer: http://stackoverflow.com/a/28841771
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/17656344
has comment: http://stackoverflow.com/comment/45952496
type: Question
tagged with: javascript
has title: Button clicking blues (click js button from vbs)
tagged with: vbscript
score: 0
has comment: http://stackoverflow.com/comment/45952986
answer count: 1
tagged with: frame

http://stackoverflow.com/q/28788362
score: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/28788467
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I am having issue getting my css to display. I think its because I applied the html through a directive. here is my js file: angular.module('app', []); angular.module('app').controller('mainCtrl', function($scope){ $scope.user = { name:'Chelsey', address:{ street:'PO Box 123', city: 'Secret Rebel Base', planet: 'Yavin 4' }, friends:[ 'Hans', 'chewbacca', 'Leia' ] } }); angular.module('app').directive('userInfoCard', function(){ return { templateUrl:"userInfoCard.html", restrict:"E", controller: function($scope){ $scope.knightMe=function(user){ user.rank="knight"; }; } } }); my root html: <scriptsrc="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"> Hello World! ** ** The html that I want the css applied too (user-info-card.html): ** {{user.name}} ** Address: {{user.address.street}} {{user.address.city}} {{user.address.planet}} Friends: {{friend}} Rank: {{user.rank}} Knight Me and my css in jade: style. .panel-heading { text-decoration-color: blue; } I am just trying to get my css to display {{user.name}} in blue right now but it keeps saying that the class is never used. I am a little new to this so anything would be helpful.
accepted answer: http://stackoverflow.com/a/28788467
has comment: http://stackoverflow.com/comment/45865302
has comment: http://stackoverflow.com/comment/45852989
type: Question
type: AnsweredQuestion
has title: css, html, angularjs or jade issue?
has comment: http://stackoverflow.com/comment/45852764
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45853316

http://stackoverflow.com/comment/46125413
score: 6
type: AnswerComment
comment on: http://stackoverflow.com/a/28824486
type: Comment
has text: I would definitely call it that. Go onto Youtube and show me *one* tutorial of how to create a simple application using Flux. Also, while there is definitely official documentation about Flux, it is unintuitive and written for experienced engineers who just "get it", not for more junior engineers who need more hand-holding. Hence [@rynclark](https://twitter.com/rynclark)'s comment - "If you're like me and you wanted to go further with React, you more than likely would've checked out Flux, had a glance, closed the tab and then reassessed your life as a Javascript developer."

http://stackoverflow.com/a/28850232
type: AcceptedAnswer
has body: You need to go to the parent tr and then access the sibling with .next() $(this).closest('tr') .next(".parentTR").slideToggle("slow") .siblings(".parentTR:visible").slideUp("slow"); Fiddle
has comment: http://stackoverflow.com/comment/46546480
type: Answer
answers question: http://stackoverflow.com/q/28849564
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28849564
has comment: http://stackoverflow.com/comment/45968277
upvote count: 1

http://stackoverflow.com/comment/46040135
score: 0
has text: Make a wrapper for eval which accept your context (this) as an argument, and alter every string to be eval'ed into `with` statement you already now how to use.
comment on: http://stackoverflow.com/a/28889356
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45983581
has text: Ok, thanks for your help, I am going to give this a try and see if I can manage to get it working.
score: 0
comment on: http://stackoverflow.com/a/28858425
type: Comment
type: AnswerComment

http://stackoverflow.com/a/28896461
has comment: http://stackoverflow.com/comment/46053131
upvote count: 1
type: AcceptedAnswer
downvote count: 1
has comment: http://stackoverflow.com/comment/46053352
has comment: http://stackoverflow.com/comment/46053389
has comment: http://stackoverflow.com/comment/46054358
has comment: http://stackoverflow.com/comment/46054201
type: Answer
has body: Just get the key value: $(document).keypress(function(e) { if(e.which == 116) { window.location.href = '/index.html'; } }); Key Reference Alternative method: document.onkeydown = fkey; document.onkeypress = fkey document.onkeyup = fkey; var wasPressed = false; function fkey(e){ e = e || window.event; if( wasPressed ) return; if (e.keyCode == 116) { window.location.href = '/index.html'; wasPressed = true; }else { alert("Window closed"); } }
accepted answer of: http://stackoverflow.com/q/28896249
answers question: http://stackoverflow.com/q/28896249
has comment: http://stackoverflow.com/comment/46053371
score: 0
has comment: http://stackoverflow.com/comment/46053483

http://stackoverflow.com/comment/46064223
comment on: http://stackoverflow.com/q/28898770
score: 1
has text: This is not meant to be a full blown answer but a comment around the EACCESS error. Did you try sudo npm install scripted -g ? It's just permissions issue since you are doing a global install. I'll try to test scripted out and let you know when I get a chance. In the meantime, tmux and vim could work out.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28828922
tagged with: node.js
possible better answer: http://stackoverflow.com/a/32635751
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/41607352
has comment: http://stackoverflow.com/comment/84241914
score: 16
has answer: http://stackoverflow.com/a/28828967
type: Question
has title: Console has no method 'debug' in Nodejs?
tagged with: javascript
answer count: 6
has answer: http://stackoverflow.com/a/42346896
has answer: http://stackoverflow.com/a/70378592
downvote count: 0
accepted answer: http://stackoverflow.com/a/28828967
has comment: http://stackoverflow.com/comment/45928049
favorite count: 0
tagged with: console
has answer: http://stackoverflow.com/a/49191922
has answer: http://stackoverflow.com/a/32635751
has answer: http://stackoverflow.com/a/47785668
has body: The console.debug() function can be invoked in the browser console. However there is one error when console.debug() is called in Nodejs. TypeError: Object #&lt;Console&gt; has no method 'debug' at Object.&lt;anonymous&gt; (c:\share\node\receive.js:20:9) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:929:3 Why? Is there any way to replace console.debug in Nodejs?
upvote count: 16

hybrid-mobile-app
tags question: http://stackoverflow.com/q/28862673
type: Tag
tag name: hybrid-mobile-app
tags question: http://stackoverflow.com/q/28841643

http://stackoverflow.com/q/28845061
accepted answer: http://stackoverflow.com/a/28845130
has answer: http://stackoverflow.com/a/28845122
has comment: http://stackoverflow.com/comment/45959070
has body: I have been banging my head over this (probably simple) issue and am missing something really basic. Why does this first code display the expected output xmlhttp=xmlhttp.responseXML; document.getElementById("CenterDataBox").innerHTML= xmlhttp.getElementsByTagName("ShowDay")[0].childNodes[0].nodeValue; and this second one doesn't? I think this is something really simple I've overlooking. xmlhttp=xmlhttp.responseXML; var DayOfShow = xmlhttp.getElementsByTagName("ShowDay")[0].childNodes[0].nodeValue; document.getElementById("CenterDataBox").innerHTML= DayofShow;
has answer: http://stackoverflow.com/a/28845130
has title: Can't get text into variable from XML files using javascript
type: AnsweredQuestion
type: Question
possible better answer: http://stackoverflow.com/a/28845122
has answer: http://stackoverflow.com/a/28845184
tagged with: javascript
tagged with: variables
score: 0
answer count: 3
tagged with: string
tagged with: http://stackoverflow.com/tag/xml

http://stackoverflow.com/comment/45850711
has text: It sounds like you don't actually want to debounce then.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28787436
score: 0

rgraph
type: Tag
tag name: rgraph
tags question: http://stackoverflow.com/q/28849877

http://stackoverflow.com/comment/46056903
comment on: http://stackoverflow.com/q/28883221
score: 0
type: Comment
type: QuestionComment
has text: OK. it works now on FIDDLE because i added jquery ui 1.9.2. But how can i fix that in my jsp page on netbeans?

http://stackoverflow.com/q/28870309
has title: error in build to process builder in java
score: -1
answer count: 2
tagged with: perl
upvote count: 0
tagged with: javascript
has body: I have devloped myself tagger and I want to host on the web. my server is based on jsp. But This tagger is based on svmtool and it has been written in Perl script. That's why, I have created one ".java" file. In this file I've created Processor builder and via the Runtime.getRuntime().exec through this process I am calling this file. It is working but it doesn't show my output. Plz help to solve this issue. For the better under standing below I am giving my java code and also given last line of output/stop the process: import java.io.*; public class ExeCommand { String outS = "", errS=""; try { // run the Unix "type your terminal command" command System.out.println ("Running tagger!"); String command = "perl /home/svmtool_v1.3.2/bin/SVMTagger.pl -V 4 -S LRL /home/svmtool_v1.3.2/models/ih/IN &lt; /home/tomcat4.1.40/webapps/pos/textfile/tests.txt &gt; /home/tomcat4.1.40/webapps/pos/textfile/output.txt"; Process p = Runtime.getRuntime().exec(command); BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream())); BufferedReader stdError = new BufferedReader(new InputStreamReader(p.getErrorStream())); // read the output from the command System.out.println("It will take time so keep the patience:\n" + command); System.out.println ("First error line: " + stdError.readLine()); // read any errors from the attempted command System.out.println("Please check your command (if any):\n"); while ((errS = stdError.readLine()) != null) { System.out.println("Error:\t" + errS); } stdError.close(); System.out.println ("First output line: " + stdInput.readLine()); while ((outS = stdInput.readLine()) != null) { System.out.println("Output:\t" + outS); } stdInput.close(); System.out.println("Finished!"); } catch (Exception e) { System.out.println("found exception: " + e); e.printStackTrace(); //System.exit(-1); } System.out.println("Finished all!"); } } After this nothing doing/ last output shows in terminal: TAGGING &lt; DIRECTION = left-to-right then right-to-le…
favorite count: 0
has answer: http://stackoverflow.com/a/30416599
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28872919
has comment: http://stackoverflow.com/comment/46004283
has comment: http://stackoverflow.com/comment/46004284
downvote count: 1
type: Question
tagged with: java

http://stackoverflow.com/a/28844542
downvote count: 0
has comment: http://stackoverflow.com/comment/100968914
score: 42
type: Answer
answers question: http://stackoverflow.com/q/28844406
has body: That should work fine : https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/chrome/index.d.ts TIP: make sure you have a reference tag added: /// &lt;reference path="pathTo/chrome.d.ts"/&gt;
accepted answer of: http://stackoverflow.com/q/28844406
has comment: http://stackoverflow.com/comment/91913887
upvote count: 42
type: AcceptedAnswer

http://stackoverflow.com/comment/45901003
comment on: http://stackoverflow.com/q/28813510
type: QuestionComment
has text: Do you need to attach a pre-existing class to the BODY tag, or create a whole new class and apply it to the BODY?
score: 1
type: Comment

http://stackoverflow.com/a/28936165
has body: try this Your code behind function [WebMethod] public static void GetPart() { //your code goes here } . Javascript $(document).ready(function () { $("#btnname").click(function () { $.ajax({ type: "POST", url: "/youraspxpagename.aspx/GetPart", contentType: "application/json; charset=utf-8", dataType: "json", success: function (msg) { } }); }); });
upvote count: 5
downvote count: 0
answers question: http://stackoverflow.com/q/28827196
has comment: http://stackoverflow.com/comment/46127614
has comment: http://stackoverflow.com/comment/46127581
score: 5
type: Answer

http://stackoverflow.com/comment/45944106
score: 0
comment on: http://stackoverflow.com/q/28837247
type: Comment
type: QuestionComment
has text: Since you've mentioned it in your question - Questions (and answers) on Stack Overflow are preferred to be complete by themselves. By all means add links to jsfiddles etc to help demonstrate the problem, but in theory your question should be answerable without having to leave this site - that's why it's prompting you for code.

http://stackoverflow.com/a/28884397
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28883976
upvote count: 2
has body: $("table a").each(function() { if (this.href.indexOf('StationLocation') != -1) { alert($('table a').attr("href")); } else { alert("Category"); $('#mainbody h1').html("Careers by Category"); } });
accepted answer of: http://stackoverflow.com/q/28883976
score: 2

http://stackoverflow.com/comment/45858284
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28791508
has text: please look at my edit (I tested it and I know those functions return always the correct value).
score: 0

http://stackoverflow.com/q/28904382
has body: I want to build an app where my page background is the image from the camera (real time, update as I move) Does somebody know a plugin or a way to capture the camera 'view' into canvas or background-image on a div?
answer count: 1
favorite count: 0
tagged with: cordova
has answer: http://stackoverflow.com/a/28904517
type: AnsweredQuestion
upvote count: 1
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/28904517
tagged with: javascript
has title: Phonegap real time camera capture
score: 0

http://stackoverflow.com/comment/45975478
type: AnswerComment
comment on: http://stackoverflow.com/a/28854683
score: 0
type: Comment
has text: if it's in a form it will usually submit that form when clicked

http://stackoverflow.com/q/28857151
downvote count: 0
type: Question
has title: Is it possible to get notified only once if several model attributes change simultaniously?
has body: I want to have a Marionette ItemView (or LayoutView), which rerenders when its model changes. It is actually pretty easy to implement: modelEvents: { 'change': 'render' } However, not every view displays every attribute of the model. So I had an idea to lessen the number of rerenders by listening to only those events, that change some of the attributes. If only one attribute is required by the view, the situation is also easy: modelEvents: { 'change:attribute': 'render' } However, it is more complicated, if several attribute changes need to be listened to. Both modelEvents: { 'change:attribute1': 'render', 'change:attribute2': 'render' } and modelEvents: { 'change:attribute1 change:attribute2': 'render' } would rerender the view twice if both attribute1 and attribute2 are changed in one event. Is there any simple syntax to be notified only once in such an occasion? I know, I can do this: modelEvents: { 'change': 'checkIfRenderNeeded' }, checkIfRenderNeeded: function(event) { if (('attribute1' in event.changed) || ('attribute2' in event.changed)) { this.render(); } } But is there some more elegant solution? Maybe some special syntax to include this behaviour in modelEvents property without having to program a change checker on general change event listener?
score: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28863899
upvote count: 2
has answer: http://stackoverflow.com/a/28859308
has answer: http://stackoverflow.com/a/28863899
answer count: 2
tagged with: javascript
favorite count: 0
tagged with: marionette
possible better answer: http://stackoverflow.com/a/28859308

http://stackoverflow.com/comment/45994142
score: 2
comment on: http://stackoverflow.com/q/28864513
has text: Please post your code.
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28792965
answers question: http://stackoverflow.com/q/28782791
type: AcceptedAnswer
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28782791
has body: Apprently the issue was that the PLAIN auth. isn't working for JAXL, so changed it to another AUTH and it worked fine.

http://stackoverflow.com/a/28893753
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/46054378
has body: The “best” way that I can think of “dragging and dropping elements while updating the element identifiers” is as follows: function move(key, src, to, array) { var length = array.length if (length === 0) return array var srcIndex = -1 var toIndex = -1 var index = 0 loop: do switch (array[index][key]) { case src: srcIndex = index++; break loop case to: toIndex = index++; break loop } while (++index < length) if (index === length) return array if (srcIndex < 0) do if (array[index][key] === src) { srcIndex = index; break } while (++index < length) else do if (array[index][key] === to) { toIndex = index; break } while (++index < length) if (index === length) return array var step = toIndex < srcIndex ? 1 : -1 src = array[srcIndex] do { to = array[toIndex] array[toIndex] = src src[key] = toIndex toIndex += step src = to } while (toIndex !== srcIndex) array[toIndex] = src src[key] = toIndex return array } This is what I am doing: The first loop finds either the srcIndex or the toIndex, whichever one comes first. If we find either srcIndex or toIndex and if it is not the last index of array (which means that we may find the other index as well) then we continue. Otherwise we return array. We check which index is still not found and we loop through the remaining elements to find it. If we can't find the second index then we return array. Otherwise we continue. Now that we have the two indices, we can simply rearrange the elements in the final loop. Hope that helps.
answers question: http://stackoverflow.com/q/28892118
has comment: http://stackoverflow.com/comment/46063965
downvote count: 0
has comment: http://stackoverflow.com/comment/46065637
type: Answer

http://stackoverflow.com/a/29188756
upvote count: 15
has comment: http://stackoverflow.com/comment/46739815
has comment: http://stackoverflow.com/comment/46739843
score: 15
has comment: http://stackoverflow.com/comment/46739818
downvote count: 0
answers question: http://stackoverflow.com/q/28759015
has comment: http://stackoverflow.com/comment/46738749
has comment: http://stackoverflow.com/comment/46738760
has comment: http://stackoverflow.com/comment/46739901
type: Answer
has comment: http://stackoverflow.com/comment/46738685
has comment: http://stackoverflow.com/comment/67570352
has body: A component is just a view, so the following should work: Ember.View.views[&lt;GUID&gt;] So in your example: Ember.View.views['ember592'] You need to use get/set if you want to modify/read the value property, for example: Ember.View.views['ember592'].get('value') Ember.View.views['ember592'].set('value', 'newValue')
has comment: http://stackoverflow.com/comment/46738649

http://stackoverflow.com/comment/46015261
comment on: http://stackoverflow.com/q/28872986
type: QuestionComment
score: 1
has text: This seem very specialized and you will probably have to make something from scratch. In any case, asking for recommendations of libraries is off-topic on SO.
type: Comment

http://stackoverflow.com/comment/45788257
has text: Maybe a race condition? I'm not familiar with flipbook, but if it's parsing the DOM before ngRepeat adds children you might need to tell it to parse again via ng-repeat-end
comment on: http://stackoverflow.com/q/28752950
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46073231
has text: Using lodash now, and the 'null' example is definitely different. This is important for the loop because when the page is first loaded, __coordinates will be null, so I need to put the markers initially. However, I still need to check both (_.difference(__coordinates, coordinates)) and (_.difference(coordinates, __coordinates)) because both underscore and lo-dash returns values in the second array that is not in the first. For example, _.difference([1,2,3],[1] = [2, 3], but _.difference([1], [1,2,3]) = null . So I need to check both conditions in case markers get added or subtracted.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28880306

http://stackoverflow.com/q/28862618
tagged with: javascript
has body: I assume I have a syntax error here. I have a group of 4 functions in my controller: add new item, delete current item, move item backward (up) in the array, move item forward (down) in the array. They all are working except when the item to be moved down is the first object vm.maxChoices = 6; vm.addNewChoice = function(arr) { var newItemNo = arr.length + 1; arr.push({ 'id': 'choice' + newItemNo }); }; vm.deleteChoice = function(arr, index) { arr.splice(index, index); }; vm.moveUpChoice = function(arr, index) { var currItem = index; if (currItem&gt;0) { arr.splice(currItem-1,0, arr.splice(currItem, currItem)[0]); } }; vm.moveDownChoice = function(arr, index) { var currItem = index; var newPosition = index+1; if (currItem &lt; arr.length) { arr.splice(newPosition,0, arr.splice(currItem, currItem)[0]); } }; vm.showAddChoice = function(choice,arr) { return arr.length !== vm.maxChoices; }; What did I do wrong with moveDownChoice? Working example: http://plnkr.co/edit/WPdnmYbDSXC0LsbeMduM?p=preview Try creating 3 or 4 rows, put data in the fields to see it move. You can move #2 to #3 etc., but if you try to move the first one down, it creates a NEW item instead of moving to #2.
answer count: 2
has answer: http://stackoverflow.com/a/28863046
tagged with: arrays
tagged with: angularjs-ng-repeat
tagged with: angularjs
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28863046
score: 0
has title: Reordering Angular JS array items breaking on first item?
type: Question
possible better answer: http://stackoverflow.com/a/28862985
has answer: http://stackoverflow.com/a/28862985

http://stackoverflow.com/comment/45834266
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28774036
has text: @MarioLegenda Are you saying compiling after appending is what solved your problem? My answer was the same suggestion to create the new scope at the beginning... I deleted it because you said it didn't work.

http://stackoverflow.com/q/28776283
accepted answer: http://stackoverflow.com/a/28779651
has comment: http://stackoverflow.com/comment/45835721
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
upvote count: 2
tagged with: d3.js
tagged with: css
has body: I designed a simple bar/line graph combination using d3.js: https://i.sstatic.net/coJI9.jpg That screenshot is from Firefox. However, when I open the same page with Chrome, it looks like this: https://i.sstatic.net/L7H2o.jpg And in Safari even worse: https://i.sstatic.net/KTks5.jpg I didn't bother to test IE. Is this a known issue with d3.js? Because weirdly enough I could not find anything on google, so I am hoping there is indeed a mistake in my code. EDIT: Following up on meetamit's answer, I could narrow the problem to the sorting of the dates. Here is what it looks like: // sort on key values function keysrt(key, desc) { return function (a, b) { return desc ? ~~(a[key] &lt; b[key]) : ~~(a[key] &gt; b[key]); }; } [...] var parseDate = d3.time.format("%Y-%m-%d").parse; allDates = JSON.parse(allDates); data = JSON.parse(data); data.forEach(function (d, i) { d.Datum = parseDate(d.Datum); }); allDates.forEach(function (d, i) { d.Datum = parseDate(d.Datum); }); allDates.sort(keysrt('Datum')); data.sort(keysrt('Datum')); Order of array in Chrome: Sat Jul 20 2013 00:00:00 GMT+0200 (Mitteleuropäische Sommerzeit) einAusVis.js:57 Sat Jan 05 2013 00:00:00 GMT+0100 (Mitteleuropäische Zeit) einAusVis.js:57 Sat Sep 15 2012 00:00:00 GMT+0200 (Mitteleuropäische Sommerzeit) einAusVis.js:57 Sat Aug 18 2012 00:00:00 GMT+0200 (Mitteleuropäische Sommerzeit) einAusVis.js:57 Sat Oct 13 2012 00:00:00 GMT+0200 (Mitteleuropäische Sommerzeit) einAusVis.js:57 Sat Dec 08 2012 00:00:00 GMT+0100 (Mitteleuropäische Zeit) einAusVis.js:57 Sat Oct 15 2011 00:00:00 GMT+0200 (Mitteleuropäische Sommerzeit) einAusVis.js:57 And in Firefox: Date {Sat Sep 17 2011 00:00:00 GMT+0200} einAusVis.js (Zeile 57) Date {Sat Oct 15 2011 00:00:00 GMT+0200} einAusVis.js (Zeile 57) Date {Sat Dec 10 2011 00:00:00 GMT+0100} einAusVis.js (Zeile 57) Date {Sat Jan 07 2012 00:00:00 GMT+0100} einAusVis.js (Zeile 57) Date {Sat Feb 04 2012 00:00:00 GMT+0100} einAusVis.js (Zeile 57) Date {Sat Mar 03 2012 00:00:00 GMT+0100} ei…
has comment: http://stackoverflow.com/comment/45830690
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28776946
has answer: http://stackoverflow.com/a/28776946
has title: Cross browser d3.js SVG line rendering date sorting
has answer: http://stackoverflow.com/a/28779651
has comment: http://stackoverflow.com/comment/45831667
type: Question
answer count: 2
linked to: http://stackoverflow.com/q/19430561
downvote count: 0
tagged with: javascript
score: 2

http://stackoverflow.com/comment/45804300
has text: @Mayhem "if i use two class which while changing class name which one will be changed" form the OP's comment. Not sure whether I got the meaning right though.
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28760135
type: AnswerComment

http://stackoverflow.com/q/28906505
tagged with: atscript
tagged with: angular
answer count: 1
has comment: http://stackoverflow.com/comment/46072414
has answer: http://stackoverflow.com/a/28906661
upvote count: 27
favorite count: 0
type: UnansweredQuestion
tagged with: typescript
downvote count: 0
has comment: http://stackoverflow.com/comment/63607803
has title: What does the @ (at sign) mean in the latest TypeScript (presumably v1.5) example?
has body: There is a very interesting picture was posted in the official TypeScript blog. I wonder what the @ (at sign) symbol is doing there since (as far as I know) it cannot be used in JavaScript identifiers.
type: Question
tagged with: javascript
score: 27

http://stackoverflow.com/comment/45902654
type: Comment
has text: those are reserved words? the array.prototype and thanks for your answers
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28815118

http://stackoverflow.com/comment/45792588
comment on: http://stackoverflow.com/q/28755586
score: 0
type: Comment
type: QuestionComment
has text: `$_POST['name']` will be an array, not a string.

http://stackoverflow.com/a/28827142
has comment: http://stackoverflow.com/comment/45926386
upvote count: 2
has comment: http://stackoverflow.com/comment/45926560
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28826910
type: Answer
answers question: http://stackoverflow.com/q/28826910
score: 2
downvote count: 0
has body: By doing it your way, it's just impossible. PHP can't "read" or "interact with" javascript directly in the same page. You have to understand that PHP is a preprocessor, it generates HTML on the server, then the generated page is sent to the client. In this page, the PHP code has entirely disappeared. You can only see what it generated (that is, HTML or JS). Then, the javascript code runs, and it has no idea it was generated using PHP, and no idea of PHP's presence whatsoever. In order to pass variables to a PHP script, you have to call the file with GET or POST methods : (JS) $.get( 'myScript.php', { // This is calling the PHP file, passing variables (use get or post) variable1 : "Hello", variable2 : "world!" }, function(data){ // PHP will then send back the response as "data" alert(data); // will alert "Hello world!" }); (myScript.php) $variable1 = $_GET['variable1']; // or POST if you're using post $variable2 = $_GET['variable2']; echo $variable1 . " " . $variable2; // Concatenates as "Hello world!" and prints it out. //The result of the PHP file is sent back to Javascript when it's done. Of course, this is a very basic example. Never read and use directly what is sent to PHP (as I just did), because anyone could inject whatever they'd want. Add securities.

http://stackoverflow.com/q/28843269
answer count: 1
accepted answer: http://stackoverflow.com/a/28844021
tagged with: css
linked to: http://stackoverflow.com/q/3514784
type: AnsweredQuestion
has body: in my website, there are projects icons that have a layer on mouseover, that displays titles. What I looking for is to have that layer constantly there when viewing the site on mobiles. There is this piece of javascript code that apparently deals with that effect: /* Set Default Text Color for all elements */ $(".ut-hover").each(function(index, element) { var text_color = $(this).closest('.ut-portfolio-wrap').data('textcolor'); $(this).find(".ut-hover-layer").css({ "color" : text_color }); $(this).find(".ut-hover-layer").find('.portfolio-title').attr('style', 'color: '+text_color+' !important'); }); $('.ut-hover').on('mouseenter touchstart', function() { var hover_color = $(this).closest('.ut-portfolio-wrap').data('hovercolor'), hover_opacity = $(this).closest('.ut-portfolio-wrap').data('opacity'); $(this).find(".ut-hover-layer").css( "background" , "rgba(" + hover_color + "," + hover_opacity+ ")" ); $(this).find(".ut-hover-layer").css( "opacity" , 1 ); }); $('.ut-hover').on('mouseleave touchend', function() { $(this).find(".ut-hover-layer").css( "opacity" , 0 ); }); The css of the layer containing the text is "ut-hover-layer" I need to modify that script so that IF the site is seen on a mobile screen, the "ut-hover-layer" is visible on load and always stays, so no mouseover is supposed to happen. Anyone would have a solution to achieve that ? if that can help, here is the link to the site Thanks in advance !
tagged with: jquery-hover
type: Question
tagged with: javascript
has title: responsive website: how to keep on mobile, hover layer element "on" by default
score: 0
has answer: http://stackoverflow.com/a/28844021
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/46064855
has text: @jamiec, either or, I have underscore in right now, but i'm not picky
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28902650

http://stackoverflow.com/q/28821804
possible better answer: http://stackoverflow.com/a/28830669
has answer: http://stackoverflow.com/a/28830669
has comment: http://stackoverflow.com/comment/45915445
accepted answer: http://stackoverflow.com/a/28823169
has comment: http://stackoverflow.com/comment/115764874
downvote count: 3
score: 23
has answer: http://stackoverflow.com/a/74309371
tagged with: php
has body: I don't need the city or address, just the state. And I don't want to make an API call if possible. The priority is a light-weight solution, ideally just Javascript. I have a user-input zipcode, and I want to display a paragraph of text depending on the state that the zipcode is in. I know it's much more complicated to lookup City and State, and for that an API such as the one the USPS exposes is probably best. But to just match state, perhaps on just the first three numbers, the solution (I think) should be easy and lightweight. Javascript ideally. PHP could also work.
linked to: http://stackoverflow.com/q/31868020
has title: How can I quickly determine the State for a given zipcode?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/70535249
has answer: http://stackoverflow.com/a/76932762
upvote count: 26
has answer: http://stackoverflow.com/a/55242468
has answer: http://stackoverflow.com/a/64081110
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/69471805
has answer: http://stackoverflow.com/a/28823169
favorite count: 0
has comment: http://stackoverflow.com/comment/45915371
has answer: http://stackoverflow.com/a/28823248
answer count: 9
has comment: http://stackoverflow.com/comment/45915374
linked to: http://stackoverflow.com/q/431616
has comment: http://stackoverflow.com/comment/45916046
tagged with: geo
tagged with: zipcode

http://stackoverflow.com/q/28755149
type: UnansweredQuestion
tagged with: php
tagged with: model-view-controller
has answer: http://stackoverflow.com/a/28755385
type: Question
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I have a shift.js and shift_view.php in shift_view.php: Select ID Region Description Start Time End Time $/hr Ride Bonus Ride Bonus Rate Drivers Edit Shift which sets the first row of the table, and in shift.js: for(var i = 0; i < 2; i++){ var shift = response[i]; var arr = [ I_NEED_A_CHECK_BOX_VAR, shift.ID, regions[shift.RegionID], shift.Description, shift.StartStr, shift.EndStr, parseFloat(shift.GuaranteeRate).toFixed(2).toString(), parseFloat(shift.RideBonus).toFixed(2).toString(), parseFloat(shift.RideBonusRate).toFixed(2).toString(), shift.NumDrivers.toString() + " / " + shift.DriversNeeded, 'Edit']; if(parseInt(shift.NumDrivers) < 0.75 * parseInt(shift.DriversNeeded)){ arr[arr.length-2] = '' + arr[arr.length-2] + ''; } if(shift.StartTimestamp*1000 < Date.now() && Date.now() < shift.EndTimestamp*1000 ){ arr[0] = '' + arr[0] + ''; } $('#main_table').dataTable().fnAddData(arr); The js will populate the data to the view. what should i do to "I_NEED_A_CHECK_BOX_VAR" to make it a checkbox? My task is to make each row selectable so when a 'submit' button is clicked, the selected row's shift.ID will be send to another function in an array. From all the researches, I could only find that a checkbox is made in the html(view) since the view actively calles function to get data, but in this case, the view isn't, it is the js that updates the view. thanks for all your help!! Luke
has title: how to add a variable with checkbox property in javascript which will populate a table in the view.php

http://stackoverflow.com/comment/45883518
has text: Thanks a lot for the clear explanation. I finally made it work!
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28799691
type: Comment

http://stackoverflow.com/a/28882929
answers question: http://stackoverflow.com/q/28879508
score: 1
upvote count: 1
type: AcceptedAnswer
has body: Prefix search can be done with allDocs() and startkey/endkey. Some examples are described here.
type: Answer
accepted answer of: http://stackoverflow.com/q/28879508
downvote count: 0

http://stackoverflow.com/a/28773582
accepted answer of: http://stackoverflow.com/q/28773467
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28773467
downvote count: 0
has body: you are not passing in a string echo '&lt;input id="ratetb" onkeyup="clean(ratetb)" onkeydown="clean(ratetb)" should be echo '&lt;input id="ratetb" onkeyup="clean(\'ratetb\')" onkeydown="clean(\'ratetb\')" better yet, pass in the object reference echo '&lt;input id="ratetb" onkeyup="clean(this)" onkeydown="clean(this)" and change the function function clean(textfield) { var replc=/[^0-9 .]/gi; textfield.value=textfield.value.replace(replc,""); } Or even better, do not use inline events.
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/comment/46008068
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/28872291
has text: The `.near()` method implemented in mongoose uses an older command syntax for which the $near operator more or less succeeds. The `.geoNear()` method does much the same thing with a "geoNear" command syntax which is still reasonably valid. Aggregate `$geoNear` is a "boosted" version of that command syntax. Main point is geospatial is still somewhat evolving, and things are a bit more stable now than they were.

http://stackoverflow.com/a/28884381
answers question: http://stackoverflow.com/q/28868443
has body: Have you tried to load a dummy URL instead of an empty one? mWebview.loadUrl("data://dummy"); This worked for me ;)
score: 0
type: Answer

http://stackoverflow.com/q/28758180
tagged with: http://stackoverflow.com/tag/html
score: 0
has title: how to prevent my web page from being modified from other applications
has comment: http://stackoverflow.com/comment/45796949
tagged with: c#
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45798344
has body: I have one application written in C#. i am using web browser control on my application to load my web page.(web page is one module of application). in a specific system when my application is getting launched it shows System.UnauthorizedAccessException: Access is denied. exception. System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) at System.Windows.Forms.UnsafeNativeMethods.IHTMLLocation.GetHref() at System.Windows.Forms.WebBrowser.get_Document() at UIApplication.frmMaps.LoadMap() This exception is shown every time when trying to access JavaScript function from C# code. by looking into Temporary internet files I observed that my JS files are converted into .htm files. is conversion of .js file .htm file is thowing 'UnauthorizedAccessException: Access is denied.' error. if yes, how can i prevent this.
answer count: 0
type: Question

http://stackoverflow.com/comment/45951243
has text: It should now show text only once in center of circle, please check.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28840505

http://stackoverflow.com/q/28820408
tagged with: jquery
favorite count: 0
tagged with: ajax
has body: I'm a bit lost where is the proper place to make this with the Full Calendar documentation and need some fiddle to point me into the right way. When my calendar loads the events, before them show up on the calendar, I need to make a ajax call into a wordpress db which should return a date of a post. Each post is an event on the calendar. Depending on the response of the database, if the post date is in future time than the current time, then the calendar should show this event in an specific color, if it is past or current time it should be another different specific color. So basically, before each event renders on the calendar I need to trigger an ajax call for each of them and evaluate the data returned to apply them the right color for past/current events and future events. Someone experienced with Full Calendar could point me a fiddle with an example how is this done within the Full Calendar documentation? This is the code I went so far. I am looking to stay in the loop with the calendar refetchEvents and be able to fetch with ajax in the background data from the posts of a WordPress website to use it on the next refetchEvents trigger and so on. $(function () { var date = new Date(); var d = date.getDate(); var m = date.getMonth(); var y = date.getFullYear(); var webData = null; //array() data $('#calendar-holder').fullCalendar({ eventRender: function(event, element, webData) { var dataHoje = new Date(); /* Use webData data taken with ajax on eventAfterAllRender callback option inside this conditional statements to draw on the event box colors and text values depending on the status and date of the post returned. */ if (event.start < dataHoje && event.end > dataHoje) { element.css('background-color', '#FFB347'); element.find('.fc-event-inner').append('ON AIR'); } else if (event.start < dataHoje && event.end < dataHoje) { element.css('background-color', '#77DD77'); element.find('.fc-event-inner').append('Published'); } else if (event.start > dataHoje && event.en…
has title: Full Calendar trigger ajax call before event renders on calendar
has answer: http://stackoverflow.com/a/28902831
accepted answer: http://stackoverflow.com/a/28902831
upvote count: 1
tagged with: calendar
type: AnsweredQuestion
score: 1
tagged with: fullcalendar
type: Question
answer count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/28899540
has answer: http://stackoverflow.com/a/58493760
has title: Calling controller function from Ember setupController inside Route
favorite count: 0
has body: How can I call a function inside action handlebars from setupController located in the Route. (Also, how can I call a function inside a controller and not the route itself). I want my page to analyse the URL parameters and fill in some variables based on those parameters. App.CresRoute = Ember.Route.extend({ setupController: function(){ this.send('testFunction', "Print me"); }, actions: { testFunction: function(string){ console.log(string); }, } }); This returns an error: "Nothing handled the function 'testFunction'." Obviously my methods are more complex, with many parameters, and this is just to demonstrate the problem.
tagged with: ember.js
upvote count: 2
accepted answer: http://stackoverflow.com/a/58493760
score: 2
type: AnsweredQuestion
type: Question
possible better answer: http://stackoverflow.com/a/28901697
answer count: 2
has answer: http://stackoverflow.com/a/28901697
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/30310393
answers question: http://stackoverflow.com/q/28826619
type: Answer
score: 0
has body: I would recommend creating a new function that Game Maker can understand and then use that to create your object and the constructor you are showing here. company.initialize = function(params) { companyname.getSharedEventCenter().postEvent(SharedEventKeys.API_INITIALIZE); _isInitialized = true; if (typeof params !== "undefined") { var muteSoundCallback = ("soundMuteCallback" in params &amp;&amp; typeof params["soundMuteCallback"] === "function") ? params["soundMuteCallback"] : undefined; var unmuteSoundCallback = ("soundUnmuteCallback" in params &amp;&amp; typeof params["soundUnmuteCallback"] === "function") ? params["soundUnmuteCallback"] : undefined; _adsManager.setSoundCallbacks(function() { typeof muteSoundCallback === "function" &amp;&amp; muteSoundCallback(); [].forEach.call(document.getElementsByTagName("audio"), function(element){ element.muted = true; }); }, function() { typeof unmuteSoundCallback === "function" &amp;&amp; unmuteSoundCallback(); [].forEach.call(document.getElementsByTagName("audio"), function(element){ element.muted = false; }); }); } _tryShowAd(); }; function createMuteCallback() { muteCallback = function () { // Code to handle the callback } return muteCallback; } function createUnmuteCallback() { unmuteCallback = function () { // Code to handle the callback } return unmuteCallback; } function createCompany (mute, unmute) { if (mute == 1) { soundMuteCallback.createMuteCallback(); } if (unmute == 1) { soundUnmuteCallback.createUnmuteCallback(); } company.initialize(soundMuteCallback, soundUnmuteCallback); } So all of that goes in the same .js file. Create a new extension in Game Maker. Add the .js file to that extension. Add a function named createCompany with two optional parameters. Then when you call createCompany(1, 1); in your Game Maker code, the .js file will run and will initialize the company object with the two callback functions. Hope this helps.
accepted answer of: http://stackoverflow.com/q/28826619
type: AcceptedAnswer

http://stackoverflow.com/a/28790626
score: 0
type: Answer
has body: var someArray = [0,0,7]; var incrementLastArrayElement = function(_array) { var newArr = _array.slice(); newArr[newArr.length - 1]++; return newArr; } console.log(incrementLastArrayElement(someArray)); JSFIDDLE.
answers question: http://stackoverflow.com/q/28790584

http://stackoverflow.com/q/28806682
downvote count: 0
has answer: http://stackoverflow.com/a/28806852
has answer: http://stackoverflow.com/a/28806824
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/28806913
type: Question
has answer: http://stackoverflow.com/a/28806925
tagged with: javascript
answer count: 6
upvote count: 2
possible better answer: http://stackoverflow.com/a/28806824
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45886524
has answer: http://stackoverflow.com/a/28807106
tagged with: http://stackoverflow.com/tag/html
has title: Iterate all JSON objct and put into html
has answer: http://stackoverflow.com/a/28807005
accepted answer: http://stackoverflow.com/a/28807005
score: 2
type: AnsweredQuestion
has body: I need to loop all the json object and frame into html. I can iterate all the json object but I could not get only one json object(first json object). var res = '[{"ID":"246","mobile":"samsung","feedback":"feedback goes here"},{"ID":"1485","mobile":"Moto","feedback":"feedback goes here"},{"ID":"6982","mobile":"iPhone","feedback":"feedback goes here"}]'; obj = JSON.parse(res); console.log('response length:' + obj.length); for (var i = 0; i &lt; obj.length; i++) { var finalResult = ""; var objects = obj[i]; for (var key in objects) { var res = "&lt;tr&gt;&lt;td&gt;" + objects.ID + "&lt;/td&gt;&lt;td&gt;" + objects.mobile + "&lt;/td&gt;&lt;td&gt;" + objects.feedback + "&lt;/td&gt;&lt;td&gt;&lt;/tr&gt;"; console.log('res:' + res); finalResult = res.concat(res); console.log('finalResult:' + finalResult); } } And i am unable to put everything into 'tr' element since javascript doest not have stringbuffer. I think it can be by using StringBuffer in java. How can it be done using javascript/jquery? Pls help me.

http://stackoverflow.com/comment/45858514
has text: what is in the file you read in? And as my ByteHamster did already, I would suggest you tell us the stack trace.
type: Comment
comment on: http://stackoverflow.com/q/28791701
score: 0
type: QuestionComment

http://stackoverflow.com/a/28826364
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28826213
type: Answer
has body: PFB code , hope it helps $(document).ready(function() { var max_fields = 10; //maximum input boxes allowed var wrapper = $(".input_fields_wrap"); //Fields wrapper var add_button = $(".add_field_button"); //Add button ID var x = 1; //initlal text box count $(add_button).click(function(e) { //on add input button click e.preventDefault(); if (x < max_fields) { //max input box allowed x++; //text box increment $(wrapper).append(' Remove save '); //add input box } }); $(wrapper).on("click", ".remove_field", function(e) { //user click on remove text e.preventDefault(); $(this).parent('div').remove(); x--; }) $(wrapper).on("click", ".save_field", function(e) { //user click on remove text var inpVal = $(this).siblings('input').val(); alert('inp value is :' + inpVal); e.preventDefault(); //Here on click of each save button I wanna grab particular text box value that user types in }) }); Add More Fields
downvote count: 0

http://stackoverflow.com/a/28844318
downvote count: 0
score: 1
has body: You could use the prop method, for sample: string editUrl = "javascript:openDialog('myUrl/EditForm.aspx')" $('#lnkEdit').prop('href', editUrl); But as a good pratice, would be a good approach using a function to provide this window, for sample: $('#lnkEdit').on('click', function() { openDialog('myUrl/EditForm.aspx'); });
accepted answer of: http://stackoverflow.com/q/28844307
answers question: http://stackoverflow.com/q/28844307
upvote count: 1
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/28818667
has comment: http://stackoverflow.com/comment/45909396
tagged with: javascript
tagged with: jquery
tagged with: ajax
has body: Flow: main page -> ajax request on php(tester.php) -> json information back to main page. I can't find a way around this error. Thanks ajax call $.ajax({ url : "tester.php", type : "POST", //dataType : 'json', data : { 'lat':lat, 'lng':lng, 'year1':year1, 'month1':month1, 'day1':day1, 'year2':year2, 'month2':month2, 'day2':day2, 'category':category }, success: function(data) { $.getJSON('tester.php',function(cost) { document.getElementById('userdensity').innerHTML = cost[0]+","+cost[1]; document.getElementById('advertising_cost').innerHTML = cost[2]+","+cost[3]; }); }); Php:(tester.php): &lt;? $lat = $_POST['lat']; $lng = $_POST['lng']; $year1 = $_POST['year1']; $year2 = $_POST['year2']; $cost = array($lat,$lng,$year1,$year2); echo json_encode($cost); ?&gt; Error: [02-Mar-2015 21:02:35 Europe/Berlin] PHP Notice: Undefined index: lat in /Users/tester.php on line 2 [02-Mar-2015 21:02:35 Europe/Berlin] PHP Notice: Undefined index: lng in /Users/tester.php on line 3 [02-Mar-2015 21:02:35 Europe/Berlin] PHP Notice: Undefined index: year1 in /Users/tester.php on line 4 [02-Mar-2015 21:02:35 Europe/Berlin] PHP Notice: Undefined index: year2 in /Users/tester.php on line 5 Unsure where the error is. I have done this in the past and went well. Solution: changed success to: success: function(data) { var info = $.parseJSON(data); document.getElementById('userdensity').innerHTML = info[0]+","+info[1]; document.getElementById('advertising_cost').innerHTML = info[2]+","+info[3]; }
has answer: http://stackoverflow.com/a/28818920
score: 0
has comment: http://stackoverflow.com/comment/45909078
answer count: 1
has comment: http://stackoverflow.com/comment/45909242
has comment: http://stackoverflow.com/comment/45909263
favorite count: 0
upvote count: 1
tagged with: php
downvote count: 1
accepted answer: http://stackoverflow.com/a/28818920
type: AnsweredQuestion
type: Question
has title: Ajax call to php - Undefined index error

http://stackoverflow.com/q/28866471
has answer: http://stackoverflow.com/a/28866568
accepted answer: http://stackoverflow.com/a/28866568
answer count: 1
has body: please watch this Plunker So I working with angular and need to add new input field when all others are filled in (by default on page placed 5 inputs and if all of them are filled automatically add one more input if new input also using will add one more input and etc). For generate inputs I use ng-repeat and name_list[] for it: &lt;div collect-input&gt; &lt;div class="form-group" ng-repeat="(i, name) in name_list track by $index"&gt; &lt;div class="row"&gt; &lt;div class="col-xs-12"&gt; &lt;input class="form-control" type="text" ng-model="data.name_list[i]" add-input/&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; Each input have directive attr "add-input" with $watch() method inside. This method method track when $isEmpty parameter had changed. Then value function pass value of this parameter to listen function. directive('addInput', ['$compile', '$sce', '$timeout', function ($compile, $sce, $timeout) { return { restrict: 'A', require: ['^collectInput', '?ngModel'], link: function (scope, element, attrs, ctrl) { var collectInput = ctrl[0]; var ngModel = ctrl[1]; $timeout(function(){ scope.$watch( function(){ return ngModel.$isEmpty(ngModel.$modelValue); }, function(isEmpty){ collectInput.reportInput(ngModel, isEmpty); } ); },1000) } } }]); Then this function call "reportInput()" that placed inside parent directive "collect-input". Main goal of this function is to add new input name to name_list[] for generating via ng-repeat userApp.directive('collectInput', function() { return { restrict: 'A', controller: function($scope) { var dirtyCount = 0; this.reportInput = function(modelValue, isEmpty) { var count = $scope.name_list.length; if (isEmpty == false){ dirtyCount ++; console.log('+1:' + dirtyCount); } if (isEmpty == true){ if (dirtyCount &lt;= 0){ dirtyCount = 0; console.log('0:' + dirtyCount); } else if(dirtyCount &gt; 0){ dirtyCount --; console.log('-1:' + dirtyCount) } } if (count === dirtyCount) { $scope.name_list.push(modelValue); //dirtyCount = dirtyCount + 1; …
tagged with: angularjs
type: AnsweredQuestion
tagged with: angularjs-scope
type: Question
tagged with: angularjs-directive
tagged with: angular-ngmodel
has title: How dynamically add new input element if all others was filled in AngularJS
tagged with: javascript
score: 0

http://stackoverflow.com/q/28805420
upvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45883999
answer count: 3
has answer: http://stackoverflow.com/a/28805732
favorite count: 0
has comment: http://stackoverflow.com/comment/45884002
type: UnansweredQuestion
has title: Javascript - multidimensional set value not working
score: -4
has body: var myArray = []; myArray[0].binary = 'qweqwe'; myArray[0].src = 'qweqwe'; myArray[1].binary = 'zxczxc'; myArray[1].src = 'zxczxc'; myArray[2].binary = 'asdasd'; myArray[2].src = 'asdasd'; console.log(myArray); please help me... this is not working why? any other solution? cause I need it badly... need it fast please..
has answer: http://stackoverflow.com/a/28805535
has answer: http://stackoverflow.com/a/28805532
type: Question
downvote count: 4

http://stackoverflow.com/comment/45984211
comment on: http://stackoverflow.com/q/28859238
has text: Can you show as a code snippet from your HTML
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/131164079
type: Comment
has text: Glad it helped brother!! keep it on :)
comment on: http://stackoverflow.com/a/68413989
score: 0
type: AnswerComment

http://stackoverflow.com/q/28788785
has comment: http://stackoverflow.com/comment/45853614
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/28788817
type: Question
has comment: http://stackoverflow.com/comment/45853151
tagged with: javascript
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/45853307
favorite count: 0
has body: Recently I'm looking at Babel.js (previously 6to5). It's a transpiler for ES6. One interesting functionality it provides is to change tail calls to loops. In the example: function factorial(n, acc = 1) { "use strict"; if (n &lt;= 1) return acc; return factorial(n - 1, n * acc); } // Stack overflow in most implementations today, // but safe on arbitrary inputs in eS6 factorial(100000) Babel.js transpile it to: "use strict"; var _temporalAssertDefined = function (val, name, undef) { if (val === undef) { throw new ReferenceError(name + " is not defined - temporal dead zone"); } return true; }; var _temporalUndefined = {}; function factorial(_x2) { var _arguments = arguments; var _again = true; _function: while (_again) { var n = _temporalUndefined; var acc = _temporalUndefined; _again = false; var n = _x2; n = acc = undefined; n = _arguments[0] === undefined ? undefined : _arguments[0]; acc = _arguments[1] === undefined ? 1 : _arguments[1]; "use strict"; if ((_temporalAssertDefined(n, "n", _temporalUndefined) &amp;&amp; n) &lt;= 1) { return _temporalAssertDefined(acc, "acc", _temporalUndefined) &amp;&amp; acc; }_arguments = [_x2 = (_temporalAssertDefined(n, "n", _temporalUndefined) &amp;&amp; n) - 1, (_temporalAssertDefined(n, "n", _temporalUndefined) &amp;&amp; n) * (_temporalAssertDefined(acc, "acc", _temporalUndefined) &amp;&amp; acc)]; _again = true; continue _function; } } // Stack overflow in most implementations today, // but safe on arbitrary inputs in eS6 factorial(100000); My question is, I never saw a JavaScript syntax like _function: while(again). But it's valid JavaScript! I tried to type simliar code like a: 1 in Chrome devtools console and it's correct. Could anyone tell me: What's the name of this syntax? Where can I get the syntax information? In which case we need to write code like this?
tagged with: babeljs
accepted answer: http://stackoverflow.com/a/28788817
type: AnsweredQuestion
has title: What's this "_function: while" syntax in Babel.js tail call?

http://stackoverflow.com/q/28849782
has title: Meteor JS Error "ReferenceError: X is not defined"
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29118661
has comment: http://stackoverflow.com/comment/45995154
has comment: http://stackoverflow.com/comment/45974926
tagged with: coffeescript
has answer: http://stackoverflow.com/a/28884677
downvote count: 1
possible better answer: http://stackoverflow.com/a/29118661
type: Question
answer count: 2
upvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45967194
score: -1
has comment: http://stackoverflow.com/comment/45967263
tagged with: papaparse
accepted answer: http://stackoverflow.com/a/28884677
tagged with: meteor
has comment: http://stackoverflow.com/comment/45967423
favorite count: 0
has body: I have installed a package using this command meteor add harrison:papa-parse. Then I used it in my script but an error message "ReferenceError: Papa is not defined". Do I need to do something else? doStuff = (data) -&gt; console.log data parseData = (url, callBack) -&gt; Papa.parse url, download: true dynamicTyping: true complete: (results) -&gt; callBack results.data Meteor.startup -&gt; parseData "tests/sample.csv", doStuff return

http://stackoverflow.com/q/28836965
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has title: JSON object but can't parse
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28837067
has comment: http://stackoverflow.com/comment/45943595
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28837100
has body: I need to do a lookup onto an itunes url which throws the json, in my nodejs based backend, i am using requests module of nodejs to get the json, and it indeed returns me the json as well, but the moment i try parsing it doesn't return me internal objects, however calls like stringify or JSON.parse just work without any exception. sample url https://itunes.apple.com/lookup?id=477091027 //sample url https://itunes.apple.com/lookup?id=477091027 request(itunesUrl, function (error, response, body) { if (!error &amp;&amp; response.statusCode == 200) { var jsonbody = JSON.stringify(body.trim()); var obj = JSON.parse(jsonbody); console.log(obj); /*for(var myKey in obj) { console.log("key:"+myKey+", value:"+obj[myKey]); }*/ //none of these show value in them appinfo.appname = obj.results[0].trackName; appinfo.appImage = obj.results[0].artworkUrl60; appinfo.appCategory = obj.results[0].genres[0]; } }); I am at my wits end now
has comment: http://stackoverflow.com/comment/45943508
possible better answer: http://stackoverflow.com/a/28837637
has answer: http://stackoverflow.com/a/28837637
accepted answer: http://stackoverflow.com/a/28837067
tagged with: node.js

http://stackoverflow.com/q/28759292
has comment: http://stackoverflow.com/comment/45799015
tagged with: javascript
has comment: http://stackoverflow.com/comment/45799174
accepted answer: http://stackoverflow.com/a/28760129
has comment: http://stackoverflow.com/comment/45798808
has comment: http://stackoverflow.com/comment/45799481
has comment: http://stackoverflow.com/comment/45799172
score: 0
has comment: http://stackoverflow.com/comment/45799339
has comment: http://stackoverflow.com/comment/45798875
has comment: http://stackoverflow.com/comment/45798949
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/28759351
has answer: http://stackoverflow.com/a/28759351
has comment: http://stackoverflow.com/comment/45798843
answer count: 4
has answer: http://stackoverflow.com/a/28759383
has comment: http://stackoverflow.com/comment/45798868
has comment: http://stackoverflow.com/comment/45799412
has comment: http://stackoverflow.com/comment/45799102
linked to: http://stackoverflow.com/q/3068534
has body: i have bind object 'p' with input fields using angularJS like this &lt;input ng-model="p.p1" type="text" /&gt; &lt;input ng-model="p.p2" type="text" /&gt; &lt;input ng-model="p.p3" type="text" /&gt; it seems like my object is like this when these inputs are empty: var p = { "p1": null, "p2": null, "p3": null }; I have tried Object.keys(p); // return [] (empty array) Can any one tell me how I can get list of all keys contains in JavaScript object, including keys which contain null value as well ?
has comment: http://stackoverflow.com/comment/45799113
has comment: http://stackoverflow.com/comment/45799060
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28760129
has title: Get JavaScript/angularJS object keys which contains NULL value
has answer: http://stackoverflow.com/a/28759620
has comment: http://stackoverflow.com/comment/45798798
has comment: http://stackoverflow.com/comment/45799195
has comment: http://stackoverflow.com/comment/45798999
has comment: http://stackoverflow.com/comment/45798781
type: Question
has comment: http://stackoverflow.com/comment/45799438
has comment: http://stackoverflow.com/comment/45799063

http://stackoverflow.com/comment/45944271
type: QuestionComment
has text: [MDN apply()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply)
score: 0
comment on: http://stackoverflow.com/q/28837363
type: Comment

http://stackoverflow.com/a/28812163
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28812021
type: Answer
answers question: http://stackoverflow.com/q/28812021
has comment: http://stackoverflow.com/comment/45898195
has comment: http://stackoverflow.com/comment/45899660
upvote count: 1
has body: The problem is that you are creating 2 contractTables in your Javascript. The following code creates a new table instead of using the existing one: var contractTable = document.createElement("TABLE"); contractTable.setAttribute("id", "contractTable"); document.body.appendChild(contractTable); If you replace that code with the following: var contractTable = document.getElementById("contractTable"); Then it will use the existing table and put your items in there. JSFiddle demo c) There are several grey lines running across the screen. Does anyone know where these are coming from? and how I can get rid of these? These are &lt;hr&gt; tags, which you are inserting through Javascript: document.body.appendChild(document.createElement('hr')); Since this code is in a for loop, they are actually added 3 times. Just removing this line of code gets rid of the grey lines. JSFiddle demo
score: 1
has comment: http://stackoverflow.com/comment/45899176

http://stackoverflow.com/a/28810037
type: Answer
accepted answer of: http://stackoverflow.com/q/28809067
upvote count: 6
answers question: http://stackoverflow.com/q/28809067
downvote count: 1
score: 5
has comment: http://stackoverflow.com/comment/50824991
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/49339788
has body: @hitesh, Please remove the datatype:'jsonp' from the ajax request. This way you'll get json string if the video id is available and if its not available then the ajax error callback would be invoked. I tried on your fiddle and its working. Try like this- //var videoID = 'kn8yzJITdvI';//not working var videoID = 'p4kIwWHP8Vc';//working $.ajax({ url: "https://gdata.youtube.com/feeds/api/videos/" + videoID + "?v=2&amp;alt=json", //dataType: "jsonp", success: function(data) { console.log(data) $("#result").text(data); }, error: function(jqXHR, textStatus, errorThrown) { // Handle errors here alert('ERRORS: ' + textStatus); } }); Here is another short implementation for the solution you need- //var videoID = 'kn8yzJITdvI';//not working var videoID = 'p4kIwWHP8Vc';//working $.getJSON('http://gdata.youtube.com/feeds/api/videos/'+videoID+'?v=2&amp;alt=jsonc',function(data,status,xhr){ alert(data.data.title); }).error(function() { alert("error"); });

http://stackoverflow.com/q/28804988
has comment: http://stackoverflow.com/comment/45884524
has title: Uncaught ReferenceError: funcName is not defined
has comment: http://stackoverflow.com/comment/45883366
has comment: http://stackoverflow.com/comment/45884013
has comment: http://stackoverflow.com/comment/45883182
type: UnansweredQuestion
tagged with: php
tagged with: laravel
has comment: http://stackoverflow.com/comment/45884265
has comment: http://stackoverflow.com/comment/45883755
has comment: http://stackoverflow.com/comment/45883727
has comment: http://stackoverflow.com/comment/45883293
has body: 'm getting annoying error when i try to include js file "Uncaught ReferenceError: funcName is not defined" im working on laravel 4.2 i use php view file to include the js example : example when it runs on client side and i click on the img myFunc action - returns the error i try to include the script in the main level of the html view and it works. but i don't want to include the file in this level i want to use this script Only when the specific file uploaded by the command include ($pat_to_file) the js function is function myFunc(sig_id) { sigWindow = window.open("/forms_module_files/js/sig.html?sig_id="+sig_id, "_blank", "toolbar=no, scrollbars=no, resizable=no, top=500, left=500, width=550, height=500"); } Thanks!!!
has comment: http://stackoverflow.com/comment/45884280
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/45883613
has comment: http://stackoverflow.com/comment/45885098
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28805760
has comment: http://stackoverflow.com/comment/45883891
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28805088

http://stackoverflow.com/q/28857527
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28857725
has body: The problem I am unit testing a directive has no controller or template, only a link function. The directive requires ngModel and calls one of its functions in the link function. I want to spy on ngModel in my unit tests to ensure the right function is being called. The code Directive: angular.module('some-module').directive('someDirective', function() { return { restrict: 'A', require: 'ngModel', link: function(scope, element, attr, controller) { controller.doSomething(); //Calls some random function on the ngModel controller } }; }); What I've tried I've tried to inject a spy ngModel like this: beforeEach(module(function($provide) { $provide.factory('ngModelDirective', function() { return {}; }); $provide.factory('ngModelController', function() { return function() {}; }); })); As I discovered on this question, trying to override built-in properties causes an error to be thrown, and is bad practice. So then I tried to test the directive the way the Angular docs say to: var $scope = $rootScope.$new(); var element = $compile('&lt;div some-directive&gt;&lt;/div&gt;')($scope); And spy on NgModelController like this: var ngModelControllerSpyDoSomething = sinon.spy(element.controller('ngModel'), 'doSomething'); But this doesn't work, because one $compile is run, it executes the link function, so I'm not spying on it until it's too late (the spy is coming back as never having been called). This is also the case if I put $scope.$digest(); before or after creating the spy.
has title: How can I spy on ngModel?
tagged with: unit-testing
type: Question
score: 0
answer count: 1
tagged with: javascript
linked to: http://stackoverflow.com/q/28840114

http://stackoverflow.com/q/28827355
has comment: http://stackoverflow.com/comment/45926695
has comment: http://stackoverflow.com/comment/45925405
has title: Only the topmost code in $(window).scroll is working
type: AnsweredQuestion
tagged with: scroll
accepted answer: http://stackoverflow.com/a/28828244
type: Question
has comment: http://stackoverflow.com/comment/45925260
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45925493
score: 0
answer count: 1
has body: I've got some code in $(window).scroll that checks if an element is visible, then triggers another function. However, only the first section of code is firing. Both bits of code work in and of themselves - if I swap their order, whichever is on top fires correctly. My code is as follows: $.fn.isOnScreen = function() { "use strict"; var win = $(window), viewport = { top: win.scrollTop(), left: win.scrollLeft() }, bounds = this.offset(); viewport.right = viewport.left + win.width(); viewport.bottom = viewport.top + win.height(); bounds.right = bounds.left + this.outerWidth(); bounds.bottom = bounds.top + this.outerHeight(); return !(viewport.right &lt; bounds.left || viewport.left &gt; bounds.right || viewport.bottom &lt; bounds.top || viewport.top &gt; bounds.bottom); }; $(window).scroll(function() { "use strict"; var load_more_results = $("#ajax-load_more_results").isOnScreen(); if (load_more_results === true) {LoadMoreResults();} var load_more_staff = $("#ajax-load_more_staff").isOnScreen(); if (load_more_staff === true) {LoadMoreStaff();} }); What am I doing wrong? Can you only fire one event from $(window).scroll? I assume not.
has comment: http://stackoverflow.com/comment/45925420
has comment: http://stackoverflow.com/comment/45925268
has answer: http://stackoverflow.com/a/28828244

http://stackoverflow.com/comment/45818858
type: Comment
score: 0
type: AnswerComment
has text: @jfriend00 i have added my implementation in the original post
comment on: http://stackoverflow.com/a/28757061

http://stackoverflow.com/q/28898905
score: -3
type: Question
tagged with: usb
has body: I need this: The user inserts a USB drive in his PC. Then, it autoruns a .html page in user's default browser. In the HTML page there are two buttons: if the user presses button 1, I need to copy files to local disk and then run these. If the user presses button 2, I need to call a file from local disk. I know how can autorun a .html file from USB memory. But 1) how can I copy files from HTML to local disk, and 2) how can I run files from local disk using HTML? (in Chrome, Firefox and IE). Thanks!
has answer: http://stackoverflow.com/a/28899035
has title: Execute application from HTML in a USB
upvote count: 0
has comment: http://stackoverflow.com/comment/46057102
answer count: 1
tagged with: javascript
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
downvote count: 3

masking
tag name: masking
tags question: http://stackoverflow.com/q/28792899
type: Tag

http://stackoverflow.com/q/28905390
type: Question
linked to: http://stackoverflow.com/q/29365713
tagged with: javascript
has answer: http://stackoverflow.com/a/29397226
score: 0
has title: Ionic AngularJS parent animation not running correctly when triggered in child controller
answer count: 1
has comment: http://stackoverflow.com/comment/46106156
has comment: http://stackoverflow.com/comment/46352965
has body: I have been trying this for days now. I have a parent controller MainCtrl that is wired to a background layer bgId. (This is outside the ion-nav-view) A child of this controller is HomeCtrl. (Inside the 'ion-nav-view') HomeCtrl has a button that when pressed it should: a) transition to the next State b) change the color of bgId layer. I can get the bgId layer to change, but the transition does not run smoothly - it just pops into place. If I disable either of the animations then the other works fine, but with both enabled I get the annoying popping effect. Does anyone have any ideas about what the solution is? Edit: Here are some relevant code sections. //.... = code removed for clarity index.html app.css .greenBg-add, .greenBg-remove, .redBg-add, .redBg-remove, .blueBg-add, .blueBg-remove, .yellBg-add, .yellBg-remove, .purpBg-add, .purpBg-remove { -webkit-transition: background 1000ms linear !important; -moz-transition: background 1000ms linear !important; -o-transition: background 1000ms linear !important; transition: background 1000ms linear !important; } .greenBg, .greenBg-add.greenBg-add-active { background-color: #9BDB25; } .redBg, .redBg-add.redBg-add-active { background-color: #D62459; } .blueBg, .blueBg-add.blueBg-add-active { background-color: #51DBD8; } .yellBg, .yellBg-add.yellBg-add-active { background-color: #D8DB51; } .purpBg, .purpBg-add.purpBg-add-active { background-color: #662eb4; } app.js var myloApp = angular.module('app', ['ionic', 'app.controllers', 'app.servicesConnect', 'app.servicesData', 'app.servicesAuth', 'app.services', 'app.directives', 'ionic.utils', 'firebase', 'ngCordova', 'ngAnimate']); app.config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider) { $stateProvider .state('home', { url: '/', templateUrl: 'templates/home.html', controller: 'HomeCtrl' }) .state('page1', { url: '/page1', templateUrl: 'templates/page1.html', controller: 'Page1Ctrl' }) .state('page2', { url: '/page2', templateUrl: 'tem…
has comment: http://stackoverflow.com/comment/46084575
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46131045
tagged with: animation
tagged with: css
tagged with: ionic-framework

http://stackoverflow.com/a/28773221
answers question: http://stackoverflow.com/q/28773200
has body: Don't directly assign to style. Assign to style.backgroundColor.
type: Answer
has comment: http://stackoverflow.com/comment/45824794
score: 0

http://stackoverflow.com/q/28865882
type: UnansweredQuestion
has body: I am creating a plugin in wordpress. I am trying to get the img url and file url in jQuery. Code below. What did I do wrong? $('.result_tag') .append('&lt;img src="plugin_dir_url( __FILE__ ).'remove_sign.png'" &gt;'); $.post("plugin_dir_url( __FILE__ ).'delete.inc.php'", { tag : text,/ }, function(data){ $("#result_tag").html(data); });
has comment: http://stackoverflow.com/comment/45996994
score: 1
tagged with: wordpress
upvote count: 1
has title: How to get img url and file url in jquery in wordpress plugin?
type: Question
tagged with: javascript
downvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28866132

http://stackoverflow.com/comment/45850393
has text: It's *different*, and there are reasons why it is commonly used with cosine, whereas min/max is commonly used with Euclidean. And no, min/max scaling *will* change the results.
score: 0
comment on: http://stackoverflow.com/q/28771117
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/116910750
has text: `output.publicPath` has an `'auto'` option.—But what is it doing except burning extra CPU cycles for the same effect as plain `''` or `'./'` have. No clue. Who knows _that_?
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/38748466

http://stackoverflow.com/comment/46003232
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28869155
has text: @NickolayKondratyev: This answer is slightly misleading. CORS is not about browser security level. It is a protocol that enables the server to tell the browser that it is OK to fetch the data using XHR and not block it because it's cross origin. To enable CORS you need to modify the server you're fetching the data from (not always possible) and make it send CORS headers allowing your site to fetch its data. Everything else in this answer is about same-origin policy which is a related topic but is **not** CORS.

http://stackoverflow.com/comment/45815967
type: Comment
has text: @Dave It actually works properly for me in both Debuggex and my browser. Maybe it is a browser issue ? Which one are you using ?
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28768377

http://stackoverflow.com/q/28836674
has title: Expressjs & MongoDB update object in collection's array
has answer: http://stackoverflow.com/a/28838597
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/28845053
type: Question
tagged with: mongodb
accepted answer: http://stackoverflow.com/a/28838597
tagged with: javascript
has body: I want to update collection's array, I have problems with finding object in collection's array and pushing new values to object, I tried few thing but then It seems I cannot use collection method on array? router.post('/mountain_rescue_update', function(req, res) { var collection = db.collection('rescuemodels'); var id = req.body.id; collection.update({"type": "FeatureCollection"},function (err, doc) { if (doc) { doc.find({"features": []}, function (err, result) { if (err) throw err; res.send(result); }); } }); }); In FeatureCollection i have array features, i want to do find method on that array and find object by id and then make push if it is possible. Actually How to find array? so some operations like find and update can be done on that array. I now that expression features: [] looks incorrectly but i don't have idea how to find it. I tried something like this collection.find({"features":{"properties":{"date":id}}}, function(err,doc){ console.log(doc); } If collection has one document which have array features? Shouldn't it work? In mongodb i found db.rescuemodels.find({"features.properties":{"title":"Wild Wolfs"}}) So it should look into collection features and give result of all objects which properties.title is Wild Wolfs? My json { "_id" : ObjectId("54f50753a879d4e045b24878"), "features" : [ { "properties" : { "title" : "Alona 45D", "description" : "...", "date" : ISODate("2015-03-03T01:00:40.842Z"), "urgency" : "Low", "phone" : "675 675 345", "completion" : "NO", "rescuer" : "Aleksander Gagarin" }, "geometry" : { "coordinates" : [ 11.2637333, 23.1135565 ], "type" : "Point" }, "type" : "Feature" },...etc ], "type" : "FeatureCollection", "__v" : 0 } Ok I succeeded with finding object in document's array, So now just replacing some properties left. db.rescuemodels.find({"type":"FeatureCollection"},{"features": {$elemMatch:{"properties.title":"W"}}}) Maybe somebody know how to make this statement ok db.rescuemodels.update({"type":"FeatureCollection"},{"feature…
tagged with: express
score: 0
answer count: 1

http://stackoverflow.com/q/28847491
tagged with: passport.js
favorite count: 0
tagged with: token
type: Question
tagged with: passport-local
tagged with: node.js
score: 17
has comment: http://stackoverflow.com/comment/45973830
answer count: 1
upvote count: 17
type: UnansweredQuestion
has body: I just looking for solution which makes verification email with token for my local autentification in passport.js Is there some plugin or component for node which can make me verification easyer? Or I have to do it myself? My controller exports.postSignup = function(req, res, next) { req.assert('email', 'Email is not valid').isEmail(); req.assert('password', 'Password must be at least 4 characters long').len(4); req.assert('confirmPassword', 'Passwords do not match').equals(req.body.password); var errors = req.validationErrors(); if (errors) { req.flash('errors', errors); return res.redirect('/signup'); } var user = User.build({ email: req.body.email, password: req.body.password, }); User .find({ where: { email: req.body.email } }) .then(function(existingUser){ if (existingUser) { req.flash('errors', { msg: 'Account with that email address already exists.' }); return res.redirect('/signup'); } user .save() .complete(function(err){ if (err) return next(err); req.logIn(user, function(err){ if (err) return next(err); res.redirect('/'); }); }); }).catch(function(err){ return next(err); }); }; Thanks for any opinion!
has comment: http://stackoverflow.com/comment/65488059
has title: Verification email with token in passport.js
downvote count: 0
has answer: http://stackoverflow.com/a/39751850
tagged with: javascript

http://stackoverflow.com/comment/45917428
type: QuestionComment
has text: Check your console. Are you sure you're loading the templates as well as the JS provided in the example?
comment on: http://stackoverflow.com/q/28823001
type: Comment
score: 1

http://stackoverflow.com/a/28858624
has comment: http://stackoverflow.com/comment/45983327
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28858572
answers question: http://stackoverflow.com/q/28858572
score: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45983139
has body: Since you told it to hide, it won't show unless you tell it to show itself: .different_header, .different_footer { display: none; } @media print{ .different_header, .different_footer { display: block; /* &lt;------------------- HERE */ } .different_header { position: fixed; top: 0; } .different_footer { position: fixed; bottom: 0; } }
has comment: http://stackoverflow.com/comment/45983077
type: Answer

http://stackoverflow.com/comment/46035790
type: AnswerComment
has text: You should at least paste the error/warning you are getting.
type: Comment
comment on: http://stackoverflow.com/a/28884678
score: 0

http://stackoverflow.com/q/28848932
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45965869
has answer: http://stackoverflow.com/a/28849286
accepted answer: http://stackoverflow.com/a/28849165
has comment: http://stackoverflow.com/comment/45965813
possible better answer: http://stackoverflow.com/a/28849286
tagged with: checkbox
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45965696
type: Question
has title: checkbox group get value of checked checkbox jquery
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45965581
score: 0
has answer: http://stackoverflow.com/a/28849165
answer count: 2
has body: Ive been searching for idea on how to get value of checkbox group but i need to the x and y for this so far what i have seen is only with one so i havent really found any relevant answer or idea to my problem so i will explain what i want to happend. In my X i have a number of columns namely first quarter,second quester,third quarter and fourth quarter in my Y i have names of students. And i also have an extra checkbox option to add additional student. I want to Check the check corresponding to names and quarter. I will used this to track down student who has taken the exam and who has not yet taken the exam. I am wondering how to group the the checkboxes in a way that when i check on it will automatically get the student name and corresponding quarter. HTML: 1st Quarter 2nd Quarter 3rd Quarter 4th Quarter Joe Smith John Smith Check fiddle Update $("input[name='student[]']:checked").map(function() { var $td = $(this).closest('td'), index = $td.index(); valueToPush.push({ Quarter: quarter.eq($td.index()).find('span').text().trim(), Student: $td.parent().find('td:first-child span').text().trim() }); });

http://stackoverflow.com/a/28814831
has comment: http://stackoverflow.com/comment/55693225
has comment: http://stackoverflow.com/comment/45901598
downvote count: 1
score: 3
answers question: http://stackoverflow.com/q/28814585
upvote count: 4
has body: The most reliable way to check type of a variable in JavaScript is the following: var toType = function(obj) { return ({}).toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase() } toType(new Boolean(true)) // returns "boolean" toType(true); // returns "boolean" The reason for this complication is that typeof true returns "boolean" while typeof new Boolean(true) returns "object".
has comment: http://stackoverflow.com/comment/45901815
type: Answer
has comment: http://stackoverflow.com/comment/45903551

http://stackoverflow.com/q/28858138
tagged with: utf-8
has body: Is it save to write JavaScript source code (to be executed in the browser) which includes UTF-8 character literals? For example, I would like to use an ellipses literal in a string as such: var foo = "Oops… Something went wrong"; Do "modern" browsers support this? Is there a published browser support matrix somewhere?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45982186
has answer: http://stackoverflow.com/a/28858338
upvote count: 5
has title: Is it safe to use UTF-8 character literals in JavaScript source code?
type: Question
score: 5
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/28858338
has comment: http://stackoverflow.com/comment/45982278
has comment: http://stackoverflow.com/comment/45982402

http://stackoverflow.com/comment/45943679
type: AnswerComment
comment on: http://stackoverflow.com/a/28837067
score: 0
type: Comment
has text: *"but it won't work"* If you elaborate on that, we might be able to help you. If not....then not.

http://stackoverflow.com/comment/45863532
type: Comment
comment on: http://stackoverflow.com/q/28794467
score: 0
has text: you missed "." $('.person').click
type: QuestionComment

http://stackoverflow.com/comment/45975259
has text: Yes highlighted text is for full match but `MATCH INFORMATION` is for the data that you want. Since there is no lookbehind in JS therefore we are utilizing matched group feature. Rest should be clear from the code above.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28853014

http://stackoverflow.com/comment/45866142
score: 0
type: Comment
type: QuestionComment
has text: how you have checked console.log() ? use alert("test")
comment on: http://stackoverflow.com/q/28795713

http://stackoverflow.com/a/28870985
has comment: http://stackoverflow.com/comment/46005372
has body: If I'm understanding you correct: val = 11; max = 10000; if(val &gt; max) if(11 **is greater than** 10000) It should return false. 11 is not higher than 10,000.
has comment: http://stackoverflow.com/comment/46005679
has comment: http://stackoverflow.com/comment/46005331
type: Answer
has comment: http://stackoverflow.com/comment/46005584
answers question: http://stackoverflow.com/q/28870943
has comment: http://stackoverflow.com/comment/46005811
score: 0

http://stackoverflow.com/comment/45849960
type: Comment
type: QuestionComment
has text: i fixed the snippet of code, also i meant from jquery to vanilla javascipt
comment on: http://stackoverflow.com/q/28787026
score: 0

http://stackoverflow.com/comment/45796175
has text: I understand that I could simply skip the loop and get the values directly from the input, and I tried that first. However, when manipulating the data I started running into issues since the display and the array would be separate.
comment on: http://stackoverflow.com/a/28757681
type: Comment
type: AnswerComment
score: 0

http://stackoverflow.com/comment/46021499
has text: Hi i am aware of this, and this requires more complicated code to handle, therefore I have left out the Order Of Operation. example a more complicated expression: 1+2*3-4/5, people would assume 1+(2*3)-(4/5) but it could also mean ((1+2*3)-4)/5 and any other combinations. To handle this correctly you will need to construct a parse tree for the expression and evaluate it from there. That way you can easily control which operator should be done first etc...
type: Comment
comment on: http://stackoverflow.com/a/28868338
type: AnswerComment
score: 0

http://stackoverflow.com/a/28900130
type: Answer
has body: Like in your previous question, fs.readFile is returning a string when you add 'utf8' as the encoding type. Remove this and readFile will return a buffer, which zlib.gunzip can work with. fs.readFile(tmp_path, function(err, body) { fs.unlink(tmp_path, function(err) { if (err) throw err; }); prepareBody(req, res, body); });
score: 2
type: AcceptedAnswer
upvote count: 3
has comment: http://stackoverflow.com/comment/48023582
downvote count: 1
accepted answer of: http://stackoverflow.com/q/28899956
answers question: http://stackoverflow.com/q/28899956

http://stackoverflow.com/comment/45952704
has text: possible duplicate of [Splitting a JS array into N arrays](http://stackoverflow.com/questions/8188548/splitting-a-js-array-into-n-arrays)
comment on: http://stackoverflow.com/q/28841721
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28819416
downvote count: 0
score: 1
has body: I'm assuming you are using Quickblox's javascript SDK and as per documentation: http://quickblox.com/developers/Javascript#Browsers_support It only supports IE10+.
accepted answer of: http://stackoverflow.com/q/28809386
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28809386
type: Answer

http://stackoverflow.com/comment/46048407
type: AnswerComment
comment on: http://stackoverflow.com/a/28893098
type: Comment
has text: @SabuThomas are you mean get data from database and alert it ? or display it in your page ??
score: 0

http://stackoverflow.com/comment/46079062
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28890334
has text: other than `getComputedStyle`? you can see the actual CSS rules if you look into the `.sheet.cssRules` of the ` ` element
type: Comment

http://stackoverflow.com/q/28776976
tagged with: export
has body: So we all know that we can manually export a Parse class by pressing the button in the data browser but is there some JavaScript code that can be used to make a Cloud Function/Job that export's the data for us?
downvote count: 0
tagged with: javascript
score: 4
favorite count: 0
tagged with: parse-cloud-code
upvote count: 4
tagged with: parse-platform
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/67832802
has title: Automatically export Parse data?
type: Question

http://stackoverflow.com/q/28896658
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/28896735
type: AnsweredQuestion
has body: I'm learning from the book: Javascript the good parts. And I came across the following code augmenting function definitions. Function.prototype.method = function(name, func){ this.prototype[name] = func; return this; }; However, if I replace this.prototype[name] with this.prototype.name there is an error from Firebug, and I was wondering where is the mistake? Thank you for your help in advance.
type: Question
has title: Why dot notation failed in my property access?
tagged with: javascript
has answer: http://stackoverflow.com/a/28896754
favorite count: 0
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28946441
accepted answer: http://stackoverflow.com/a/28896754
possible better answer: http://stackoverflow.com/a/28896735

http://stackoverflow.com/a/28786488
has comment: http://stackoverflow.com/comment/45849377
has comment: http://stackoverflow.com/comment/45849313
has body: You can use the shuffle function. shuffle($array); It will randomize the order in your array. http://php.net/manual/en/function.shuffle.php
has comment: http://stackoverflow.com/comment/45849173
has comment: http://stackoverflow.com/comment/45849085
type: Answer
answers question: http://stackoverflow.com/q/28786391
score: 0
has comment: http://stackoverflow.com/comment/45849152
has comment: http://stackoverflow.com/comment/45849484
has comment: http://stackoverflow.com/comment/45849581

http://stackoverflow.com/q/28822814
score: 0
has comment: http://stackoverflow.com/comment/46024308
answer count: 1
tagged with: jquery
tagged with: ajax
has body: Lately I've been working on a project that requires me to make numerous AJAX calls to a Symfony backend. Since each AJAX call is made to a different URI, I've ended up with a script that's really long, but with numerous .on('event', function(){...}) code blocks, like this: $(document).ready(function(){ $('.class').on('click', function(e){ e.preventDefault(); //AJAX call This is basically duplicated over and over again, but because of slight variations in the selector and the type of data to be received, I keep writing this same block of code over and over again. I've been thinking of using a builder pattern (is it even possible in JS?) to trim the code. I'm not very good at javascript, so any help would be much appreciated. UPDATE: /** * AJAX prototype * * @param options * @constructor */ //set TestProtObj properties in the constructor var AjaxProt = function (options) { this.ajaxCallType = options.ajaxCallType; this.targetEl = options.targetEl; this.event = options.event; this.method = options.method; this.htmlFactory = options.htmlFactory; }; //add methods to the object prototype AjaxProt.prototype = { init: function () { var targetEl = this.targetEl; targetEl.on(this.event, function(e) { e.preventDefault(); this.ajaxCall(); }) }, modalCallback: function(successData) { var modal = this.htmlFactory.createHtml({ title: 'Bet: Detailed View', id: '#bet-detailed-model', htmlType: 'modal' }); if (successData.success = true) { $('#content').prepend(modal); $('#bet-detailed-model').modal({show: true }); } else { $('#content').prepend(modal); $('#bet-detailed-model').modal({ show: true }); $('.modal-body').append(alert); } }, ajaxCall: function() { var url = this.targetEl.attr('href'), method = this.method, ajaxCallType = this.ajaxCallType; switch (ajaxCallType) { case 'modalGet': var callback = this.modalCallback(); break; } $.ajax({ url: url, type: method, success: function(data) { callback(data) } }); } }; //initialize client code $(document).ready(function () { // init…
has comment: http://stackoverflow.com/comment/45917155
has answer: http://stackoverflow.com/a/28822897
type: UnansweredQuestion
has title: Consolidating jQuery listeners
type: Question
tagged with: oop
has comment: http://stackoverflow.com/comment/45917121
tagged with: javascript

http://stackoverflow.com/q/28777321
tagged with: nav
type: Question
answer count: 2
tagged with: javascript
has title: Hover menu behaving eratically
accepted answer: http://stackoverflow.com/a/28788495
score: 0
possible better answer: http://stackoverflow.com/a/28778603
tagged with: menu
has answer: http://stackoverflow.com/a/28778603
tagged with: hover
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28788495
has body: I have built a simple hover menu. Working example here When the user scroll from the left to the right a little to quicky, or hits the padding and not the grey part the menu slides down and then up and down again. I want it to make it seamless for the user. So that when they hover over the menu at all times it works. You can see what I mean in my example if you play around mousing over. IS there a way to make this work flawlessly and as expected? $(document).ready(function($) { $("#mmenu").hide(); $("#main-menu").hover(function() { $("#mmenu").slideToggle(500); }); }); #main-menu{ background:#fff url(http://www.tzelan.com/wordpress/wp-content/uploads/2015/02/menu-black-bg.png) center center no-repeat; background-size: 9px 39px; border: 1px solid #b5b5b5; border-bottom:none; -webkit-border-radius: 5px 0 0 0; border-radius: 5px 0 0 0; position: absolute; left: 50px; text-align: center; top: 50px; vertical-align: middle; width: 25px; z-index:999; cursor:pointer; min-height: 100px; } #main-menu:after { background: url("http://www.tzelan.com/wordpress/wp-content/uploads/2015/01/menu-bottom-arrow.png") no-repeat scroll center bottom; bottom: -11px; content: ""; display: block; height: 24px; left: -1px; position: absolute; width: 27px; z-index: 999; } #main-menu #mmenu{ display: none; list-style: outside none none; position: relative; left: 0px; top:-5px; text-align: left; width: 275px; text-transform: uppercase; font-size: 10px; letter-spacing: 2px; font-family:"Apercu Light", Calibri, sans-serif; font-size-adjust:0.508; font-weight:200; font-style:normal; } #main-menu #mmenu li{ height: 25px; line-height: 25px; padding:7px 0 0; } #main-menu #mmenu li a{ background-color: #948f8f; color:#fff; text-decoration:none; text-align:left; padding:0 10px; display:block } #main-menu #mmenu li a:hover{ background-color: #ccc; } Our Vision Friends & Family Studio Collection Collected Curios Live With Us The Fifth Quarterly Publication

http://stackoverflow.com/a/28785872
type: AcceptedAnswer
type: Answer
has body: You could change the URL hash by changing the value of window.location.hash. In doing so, the :target pseudo-class isn't active (which is what is making the #new__event element visible). Updated Example $('.target').on('click', function () { window.location.hash = null; }); As a side note, when you click on the anchor element, Criar evento The window.location.hash value is changed to new__event.
accepted answer of: http://stackoverflow.com/q/28785733
answers question: http://stackoverflow.com/q/28785733
score: 0

http://stackoverflow.com/a/28794816
downvote count: 0
has comment: http://stackoverflow.com/comment/45866728
accepted answer of: http://stackoverflow.com/q/28794639
type: Answer
has comment: http://stackoverflow.com/comment/45866690
answers question: http://stackoverflow.com/q/28794639
has body: You can try this: change your form to be something like this: &lt;form id='form1' action="backup.php" method="post"&gt; &lt;input type='button' onclick='submitForm()' value="BackUp" /&gt; &lt;/form&gt; submitForm function: function submitForm() { StartProgress(); var form1 = document.getElementById('form1'); form1.submit(); //setTimeout(function(){ // form1.submit(); //}, 1000); }
score: 1
has comment: http://stackoverflow.com/comment/45866976
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/q/28806174
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: The design is responsive, then there will be tiled divs (variable number). My Problem is how can I keep one of the div always center horizontally and vertically but must flow along with other divs. So the centered div must dynamically move to make itself centered if the screen is resized. I have used jquery to acheived the centered div, but it is position absolute. The challenge is how to acheive the centered div with relative position but dynamically move to center if page is resized.
has comment: http://stackoverflow.com/comment/45885441
answer count: 0
has comment: http://stackoverflow.com/comment/46024985
upvote count: 1
type: Question
tagged with: responsive-design
score: 1
has comment: http://stackoverflow.com/comment/46023973
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: How can I dynamically center a div between tiled divs?

http://stackoverflow.com/comment/45921547
comment on: http://stackoverflow.com/a/28825328
type: AnswerComment
type: Comment
score: 2
has text: You have to replace the contents of the variable. The `array` argument is not a strict reference to the array outside, it is a new value, that happens to hold a reference.

http://stackoverflow.com/q/28843850
possible better answer: http://stackoverflow.com/a/28844379
tagged with: javascript
has body: The following code works perfectly... but it would seem using __proto__ is considered controversial. Is this true in the confines of Protractor/Nodejs? And if so, how else could I accomplish the same thing? Given a basePage: var BasePage = function() { this.to = function() { browser.get(this.url); }; }; module.exports = new BasePage; And a page that would extend BasePage: var basePage = require('../pages/basePage.js'); var MyPage = function() { this.__proto__ = basePage; // extend basePage... this.url = 'http://myPage.com'; }; module.exports = new MyPage; When a test calls: var myPage = require('../pages/myPage.js'); it('should go to page', function() { myPage.to(); }; Then win?
has answer: http://stackoverflow.com/a/28844379
has comment: http://stackoverflow.com/comment/45957251
tagged with: node.js
has title: Extending a base page object in Protractor with __proto__
accepted answer: http://stackoverflow.com/a/28844547
has comment: http://stackoverflow.com/comment/45957737
type: AnsweredQuestion
tagged with: protractor
linked to: http://stackoverflow.com/q/10898786
linked to: http://stackoverflow.com/q/23807805
linked to: http://stackoverflow.com/q/10406552
type: Question
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28844547

http://stackoverflow.com/q/28769744
has body: Oracle recently released Java 8, which includes Oracle Nashorn as a JavaScript engine. Does Nashorn only works one way in that you can convert JavaScript code into Java bytecode? Or is there any way to use it to convert Java code into JavaScript code?
has title: Is it possible to use Nashorn to convert Java code to Javascript?
has answer: http://stackoverflow.com/a/30621662
tagged with: java-8
score: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/30621662
upvote count: 2
tagged with: java
linked to: http://stackoverflow.com/q/440302
type: Question
tagged with: nashorn
has comment: http://stackoverflow.com/comment/46118267
has comment: http://stackoverflow.com/comment/49402493
has comment: http://stackoverflow.com/comment/49463393
has comment: http://stackoverflow.com/comment/45818987
tagged with: javascript
downvote count: 0
answer count: 1
favorite count: 0

http://stackoverflow.com/a/28881205
upvote count: 2
has body: The main point: I just want the javascript to respond and only make the element that is clicked larger For that, you don't want to access the stylesheet at all; instead, just access the style information of the clicked element: &lt;p onclick="resize(this)"&gt;...&lt;/p&gt; Then function resize(element) { var elementStyle = element.currentStyle || getComputedStyle(element); // Read elementStyle.fontSize here, set element.style.fontSize to change it } Re the code in your question: This line: var styleSheet = document.getElementById('mycss').href; gives you a string containing the URL of the stylesheet. It doesn't give you the stylesheet. Strings don't have a style property, so styleSheet.style is undefined, and styleSheet.style.fontSize fails because you tried to read a property from undefined. If you want to access the stylesheet information, you'll want to find the style sheet in the document.styleSheets collection. Or, according to the HTML5 specification, HTMLLinkElement implements the LinkStyle interface defined by CSSOM, which suggests that on conformant browsers you could use this to get the stylesheet: var styleSheet = document.getElementById('mycss').sheet; I haven't personally done that, just followed the information in the specs.
type: Answer
answers question: http://stackoverflow.com/q/28881160
score: 2
downvote count: 0

http://stackoverflow.com/q/28849088
possible better answer: http://stackoverflow.com/a/28849305
has answer: http://stackoverflow.com/a/28849305
has title: What does this expression mean in JavaScript : if ($(element).attr('id') in special_validations)
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/13149450
type: Question
answer count: 2
has body: I don´t understand the key word 'in'. it´s a conditional builder? This is the context: if ($(element).attr('id') in special_validations) { var validation = special_validations[$(element).attr('id')]($(element).val()); if (validation == true && typeof validation == 'boolean') $(element).parent().removeClass('has-error').addClass('has-success'); else { total_errors++; $(element).parent().addClass('has-error').removeClass('has-success'); if (typeof validation == 'string') $(' '+validation+' ').insertAfter(element); else $(' Formato no válido ').insertAfter(element); } }
accepted answer: http://stackoverflow.com/a/28849126
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28849126
duplicate of: http://stackoverflow.com/q/13149450

http://stackoverflow.com/comment/45911126
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28818865
has text: ya it still just goes out of bounds and does not reset

http://stackoverflow.com/q/28824545
has body: I'm trying to setup an Ember-CLI app to use DreamFactory. I'm using: ember-cli 0.2.0-beta.1 DreamFactory 1.9.0 emberjs 1.10.0 I've tries to import swagger-client and shred.bundle through Brocfile but this causes an error that app-boot.js is unable to find the module &lt;app_name&gt;/app. If I remove swagger-client and shred.bundle, it loads fine. How can I import swagger and make it available to the Ember app? Thanks,
type: Question
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/62833875
tagged with: rest
has title: How to setup Ember-CLI project with Swagger-Client to use DreamFactory REST services
tagged with: ember.js
has comment: http://stackoverflow.com/comment/62842152
tagged with: ember-cli
favorite count: 0
answer count: 0
upvote count: 2
type: UnansweredQuestion
score: 2
tagged with: swagger

http://stackoverflow.com/comment/46048494
score: 0
type: Comment
has text: No I meant that I am able to alert the Ip from java script can I directly pass it to my database without passing it to any other control any how at the end i need it in my database
comment on: http://stackoverflow.com/a/28893098
type: AnswerComment

http://stackoverflow.com/comment/45850690
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28787334
score: 0
has text: @eqiz As variant you can use this http://jsbin.com/yejeno/2/edit?js,output

http://stackoverflow.com/comment/63797470
type: AnswerComment
has text: This is a nice solution, but doesn't work if you use the context. This is a problem with many libs like `redux` and `react-intl`.
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28823590

http://stackoverflow.com/comment/45915218
comment on: http://stackoverflow.com/q/28812214
score: 0
type: Comment
type: QuestionComment
has text: Please post your html code (rendered by php) instead of php source code here.

http://stackoverflow.com/a/28770075
type: Answer
answers question: http://stackoverflow.com/q/28765303
score: 0
has body: You could try using the https://developers.google.com/drive/v2/reference/children/list with your mime-type query and run that for each folder. Which approach is more efficient will obv depend on your ratio of folders to files, and whether you already have a cache of folder ids.

http://stackoverflow.com/comment/45944479
comment on: http://stackoverflow.com/a/28837122
score: 0
type: Comment
has text: @Paulie_D, right. I saw this question http://stackoverflow.com/questions/17498855/svg-polygon-points-with-percentage-units-support and updated the code. There's no need for JS to resize
type: AnswerComment

http://stackoverflow.com/a/28765485
has body: Seems quite simple... just check if negative differences EDIT: as suggested, is more polite using Math.abs(): var dif1 = Math.abs(number1 - randomNumber); var dif2 = Math.abs(number2 - randomNumber); if (dif1 &lt; dif2) // first value is closer
answers question: http://stackoverflow.com/q/28765389
type: Answer
accepted answer of: http://stackoverflow.com/q/28765389
score: 2
upvote count: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45809793

http://stackoverflow.com/q/28821880
has body: I've tried using jquery's built in draggable and I've tried using custom drag functions with no avail. Both have their respected issues and I will try to highlight both of them. Basically, I am trying to allow the dragging of an element that is on a scaled div container. The following methods work okay on a scaled element that is less than around 2. But if you go any higher than that, we see some issues. Any help would be appreciated. Thank you for your time. HTML Hi Method 1 (Jquery draggable function) I've tried the jquery draggable function as you can see in this jsfiddle example. The problems I found in this example are the following: Biggest concern: The droppable container does not change when it is scaled up. So if the element is being dragged over part of the scaled container that isn't a part of it's original size, it will fail. When you click to drag a div, it teleports a little bit away from the mouse and is not a seamless drag. JS var percent = 2.5; $("#dragme").draggable({ zIndex: 3000, appendTo: 'body', helper: function (e, ui) { var draggable_element = $(this), width = draggable_element.css('width'), height = draggable_element.css('height'), text = draggable_element.text(), fontsize = draggable_element.css('font-size'), textalign = draggable_element.css('font-size'); return $(' ' + text + ' ').css({ 'position': 'absolute', 'text-align': textalign, 'background-color': "red", 'font-size': fontsize, 'line-height': height, 'width': width, 'height': height, 'transform': 'scale(' + percent + ')', '-moz-transform': 'scale(' + percent + ')', '-webkit-transform': 'scale(' + percent + ')', '-ms-transform': 'scale(' + percent + ')' }); }, start: function (e, ui) { $(this).hide(); }, stop: function (e, ui) { $(this).show(); } }); $("#container").droppable({ drop: function (event, ui) { var formBg = $(this), x = ui.offset.left, y = ui.offset.top, drag_type = ui.draggable.attr('id'); var element_top = (y - formBg.offset().top - $(ui.draggable).height() * (percent -…
accepted answer: http://stackoverflow.com/a/28994492
tagged with: jquery-ui-draggable
upvote count: 11
has answer: http://stackoverflow.com/a/28925445
has comment: http://stackoverflow.com/comment/45917371
has comment: http://stackoverflow.com/comment/45917327
score: 11
possible better answer: http://stackoverflow.com/a/28922773
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28922773
tagged with: jquery-ui
type: Question
has answer: http://stackoverflow.com/a/28994492
has comment: http://stackoverflow.com/comment/45915992
downvote count: 0
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/23999282
has comment: http://stackoverflow.com/comment/46222431
favorite count: 0
has title: Dragging elements on a scaled div
linked to: http://stackoverflow.com/q/19787104
answer count: 3

http://stackoverflow.com/comment/45970026
type: QuestionComment
comment on: http://stackoverflow.com/q/28851483
score: 0
type: Comment
has text: Huh what? Which different colors?

http://stackoverflow.com/q/28857636
has answer: http://stackoverflow.com/a/28858795
type: Question
has title: Access DOM of linked pages in Chrome bookmarks
answer count: 1
tagged with: javascript
score: 0
tagged with: google-chrome-extension
type: UnansweredQuestion
has body: I want to create a Chrome extension where I programmatically access the DOM of the bookmarked links, check for the page title and display it in the popup.html. Can we programmatically access DOM of multiple URLs without having to open them?

http://stackoverflow.com/a/28852522
upvote count: 1
has body: If the TV and your dev machine are on the same network you should find out the internal ip-address for your dev machine. On OS X and Linux you can type ifconfig in the terminal. Look for a line that looks like this: inet addr:10.2.0.15 Bcast:10.2.0.255 Mask:255.255.255.0 The addr: part lists your ip address. In this case it would be 10.2.0.15. If you type this ip address into the address bar of your smart tv browser you should be able to view your website on the Smart tv. I'm not sure about actual apps for the TV, I do think it will be different for each brand and that you will have to package it up individually.
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28852370
accepted answer of: http://stackoverflow.com/q/28852370
type: Answer
has comment: http://stackoverflow.com/comment/45971958
downvote count: 0
score: 1

http://stackoverflow.com/a/28982249
score: 1
has body: Yeah I had the same problem not so long ago. Whenever I trigger something from an event the automatic mocking of Jest doesn't seem to work. Maybe it is worth to open an issue on Github. In the mean time I solved the problem by manual mocking the action at the top of the page: jest.mock('../../actions/FluxCartActions'); Not a very elegant solution within Jest but it works. Also I think that you meant this: var addToCartBtn = getElementByTag(product, 'button'); instead of var addToCartBtn = getElementByTag(product, 'select'); So you can simulate the click of the button and call addToCart.
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28868369
downvote count: 0

http://stackoverflow.com/comment/45866902
has text: I remember seeing a similar case. Try rewriting globs so that there's no negations.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28796043

http://stackoverflow.com/q/28899650
tagged with: javascript
answer count: 1
has comment: http://stackoverflow.com/comment/46061499
has comment: http://stackoverflow.com/comment/46065666
tagged with: d3.js
has comment: http://stackoverflow.com/comment/46060267
has comment: http://stackoverflow.com/comment/46065908
tagged with: flatten
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28964172
has body: I have an an array with four levels that I would like to have flattened. Simplified code with two starting array-elements and flattening of the lowest level: var tstArray = [{Count:2,Yr:2008,Dep:"NDep_1",Periodtype:"Week",Period:1,Beds:5}, {Count:9,Yr:2008,Dep:"NDep_2",Periodtype:"Week",Period:1,Beds:10} ]; console.log(tstArray); tstArray = d3.nest() .key(function(d) { return d.Periodtype;}) .key(function(d) { return d.Yr;}) .key(function(d) { return d.Period;}) .key(function(d) { return d.Dep;}) .rollup(function(d) { return {"Count":d3.sum(d, function(g) {return g.Count; }), "Beds":d3.sum(d, function(j) {return j.Beds;})}; }).entries(tstArray); console.log(tstArray); tstArray = tstArray.map(function(d){ var Periodtype = d.key var values1 = d.values.map(function(e){ var Yr = e.key var values2 = e.values.map(function(f){ var Period = f.key; var values3 = f.values.map(function(g){ return{'Dep':g.key,Count':+g.values.Count,'Beds':+g.values.Beds} }); return {'Period':Period,'values3':values3} }); var tmparr = []; for ( var i = 0, len=values2.length; i &lt; len; i++) { for ( var j = 0, lenj=values2[i].values3.length; j &lt; lenj; j++) { tmparr.push({ 'Period':values2[i].Period, 'Dep':values2[i].values3[j].Dep, 'Count': +values2[i].values3[j].Count, 'Beds': +values2[i].values3[j].Beds }); }; }; return{'Year':Yar,'values2':tmparr} }); return{'Periodtype':Periodtype,'values1':values1} }) ; console.log(tstArray); JsFiddle Now, I have one solution, I think. I could just redo this for the lowest level (three more goes) but that seems to be a bad way to go about this. How can i get all the flattening in one go? I have tried but I have had little luck with values3. I still understand these concepts too shallowly. Help much appreciated.
score: 0
has title: Flatten multiple nested hierarchial array - d3.js
accepted answer: http://stackoverflow.com/a/28964172
type: Question
has comment: http://stackoverflow.com/comment/46061545
has comment: http://stackoverflow.com/comment/46059764
tagged with: arrays

http://stackoverflow.com/comment/45851025
has text: it may be helpfull http://stackoverflow.com/questions/14809686/showing-alert-in-angularjs-when-user-leaves-a-page
score: 0
comment on: http://stackoverflow.com/q/28787469
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46147368
type: Comment
has text: Alright, that should be easy enough to do with the above code. Keep the `.display` code but always change it to true in `setExists`. Conditionally change the color in `setExists` as well. Something like: http://jsfiddle.net/slicedtoad/8udq79hx/7/
score: 1
comment on: http://stackoverflow.com/a/28902831
type: AnswerComment

http://stackoverflow.com/q/28799029
has comment: http://stackoverflow.com/comment/45872329
has title: javascript dynamically generated table with onclick event not working right
has answer: http://stackoverflow.com/a/28799068
has comment: http://stackoverflow.com/comment/45872298
duplicate of: http://stackoverflow.com/q/750486
type: Question
has body: I have a dynamically generated table that works great except for the onclick event. I put the result to an alert so you can see. I was expecting it to show the correct value of var i at each iteration, but each iteration shows the same value of 3 each time, instead of 0, 1, 2 like I would expect it to. Am I doing something wrong, or is there a better way to implement an onclick event? NOTE: No jquery please
accepted answer: http://stackoverflow.com/a/28799068
has comment: http://stackoverflow.com/comment/45872332
answer count: 1
tagged with: javascript
score: 0
linked to: http://stackoverflow.com/q/750486
type: AnsweredQuestion

http://stackoverflow.com/a/28904059
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28903678
has body: var week = ["monday","tuesday","wednesday","thursday","saturday","sunday","friday"]; var hours = { monday: { close: "18:00:00", open: "10:00:00", call: false }, tuesday: { close: "18:00:00", open: "12:00:00", call: true }, friday: { close: "None", open: "None", call: false }, wednesday: { close: "18:00:00", open: "17:00:00", call: false }, thursday: { close: "None", open: "None", call: true }, sunday: { close: "18:00:00", open: "15:33:00", call: false }, saturday: { close: "18:00:00", open: "15:00:00", call: false } } for (day in week){ console.log(hours[week[day]]) }

http://stackoverflow.com/a/28872972
answers question: http://stackoverflow.com/q/28872872
type: Answer
has comment: http://stackoverflow.com/comment/46008762
has body: You pass this to the FormData constructor. In this context, this is the button clicked, identified in the error message as a HTMLFormElement. According to the documentation the FormData constructor expects a form element. So you have to change your code accordingly: var form = $("#uploadXls"); $ajax({ ... data: new FormData(form), .... });
has comment: http://stackoverflow.com/comment/46008797
has comment: http://stackoverflow.com/comment/46008904
score: 4
upvote count: 4
downvote count: 0

http://stackoverflow.com/q/28864208
has comment: http://stackoverflow.com/comment/45997595
answer count: 0
upvote count: 3
has comment: http://stackoverflow.com/comment/45993744
type: Question
score: 3
tagged with: javascript
has title: Javascript implement PRNG
tagged with: prng
has body: I'm trying to write a small multiplayer game, running as part of a website, utilizing websockets for communication. Therefore client needs to be javascript, however server is golang. The idea is to synchronize only by sending player inputs, meaning calculations must be deterministic. This means I need an identical PRNG on both sides. I found the java implementation: seed = (seed * 0x5DEECE66DL + 0xBL) &amp; ((1L &lt;&lt; 48) - 1); return (int)(seed &gt;&gt;&gt; (48 - bits)); However I don't really know how to port it to javascript, where all numbers always are 64bit floats. In theory the 53 bits for the base part of the number in a float64 are enough to store the 48bit long result. The problem is, that the multiplication part "overflows" the 53 bits of accuracy, resulting in cutting the trailing bits (which are exactly the ones I need) instead of behaving like a modulo on an integer overflow. How do I best work my way around this?
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/45993572
type: UnansweredQuestion

http://stackoverflow.com/comment/45882664
type: QuestionComment
has text: FYI. You can't delete all cookies via javascript, You can't even delete server cookies via javascript. You can only delete particular page/domain page. You just need to use browser feature to delete the cookies for all pages.
comment on: http://stackoverflow.com/q/28804564
score: 0
type: Comment

http://stackoverflow.com/q/28827256
has comment: http://stackoverflow.com/comment/45926170
has answer: http://stackoverflow.com/a/28827754
has comment: http://stackoverflow.com/comment/45925855
has comment: http://stackoverflow.com/comment/45926351
has comment: http://stackoverflow.com/comment/45926717
has answer: http://stackoverflow.com/a/28827304
has answer: http://stackoverflow.com/a/28827632
has comment: http://stackoverflow.com/comment/45925474
score: -1
has comment: http://stackoverflow.com/comment/45925055
tagged with: forms
downvote count: 1
type: Question
has body: Im trying to make my school project and would like to make a login system and registration system...my login queries are fine but my registration is taking its time...ivev been here for 3-4 hours trying to figure this out im crying right now.... ive done everything....so in my desperate need i asked this community... please provide immediate answers i desperately need it... the problem is... i cannot seem to haul in the data that i type into my form...tahts it...i dont know whats the reason behind if($_POST['registerbtn']) { $getuser = $_POST['user']; $getemail = $_POST['email']; $getpass = $_POST['pass']; $getconfirmation = $_POST['confirmation']; if($getemail){ if($getuser){ if($getpass){ if($getconfirmation){ if( $getpass === $getconfirmation ){ if( (strlen($getemail) >= 7) && (strstr($getemail, "@")) && (strstr($getemail, "."))) { require("./Connect.php"); $query = mysql_query("SELECT * FROM users WHERE username='$getuser'"); $numrows = mysql_num_rows($query); if($numrows == 0){ $query = mysql_query("SELECT * FROM users WHERE email='$getemail'"); $numrows = mysql_num_rows($query); if($numrows == 0){ $date = date("F d, Y"); $code = rand(); mysql_query("INSERT INTO users VALUES('', '$getuser', '$getemail', '$getpass', '$date' )"); mysql_query("SELECT * FROM users WHERE username='$getuser'"); $numrows = mysql_num_rows($query); if($numrows == 1){ }else $errormsg = "An Error Has Occurred. Account Not Processed"; }else $errormsg ="There is already a user with that email."; }else $errormsg ="There is already a user with that username."; mysql_close(); }else $errormsg = "You must enter a valid email address"; }else $errormsg = "Your passwords did not match"; }else $errormsg = "Confirm your password"; }else $errormsg = "You must enter your password"; }else $errormsg = "You must enter your username"; }else $errormsg = "You must enter your email address"; } $form = " $errormsg Account :Username :Email :Passcode :Confirmation "; echo "$form"; ?>
has comment: http://stackoverflow.com/comment/45924954
linked to: http://stackoverflow.com/q/60174
upvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45925273
has comment: http://stackoverflow.com/comment/45926394
has comment: http://stackoverflow.com/comment/45925434
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45925830
has comment: http://stackoverflow.com/comment/45925258
has title: I cannot somehow POST files on my database
has comment: http://stackoverflow.com/comment/45925506
favorite count: 0
has comment: http://stackoverflow.com/comment/45924934
has comment: http://stackoverflow.com/comment/45925507
has comment: http://stackoverflow.com/comment/45925718
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45925618
tagged with: php

http://stackoverflow.com/a/28876277
answers question: http://stackoverflow.com/q/28876126
score: 0
has body: You could define a different height for the textarea when you are printing: @media print { .selectorOfYourTextarea { height: 500px; } } This will make your textarea 500px in height only for the printer. The problem though still is that 500px might not be enough.
type: Answer

http://stackoverflow.com/comment/46049518
type: QuestionComment
has text: 'Which' value like is a interger value which i am taking from url using php GET
type: Comment
comment on: http://stackoverflow.com/q/28892727
score: 0

http://stackoverflow.com/comment/45824297
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28771610
type: AnswerComment
has text: I tried using the toggle class but no success, would the fact that I am using bootstrap cause complications?

http://stackoverflow.com/comment/46036519
type: Comment
comment on: http://stackoverflow.com/q/28887576
score: 1
type: QuestionComment
has text: @MightyPork Easier for you, maybe, but probably not for OP. Really a little whitespace would help a lot more than putting the variable names (all of which are really obvious—`tabell` is "table," `tekst` is "text," and `navn` is "name"—and I don't even know what language it is) in English.

http://stackoverflow.com/a/28912263
type: Answer
accepted answer of: http://stackoverflow.com/q/28904952
answers question: http://stackoverflow.com/q/28904952
type: AcceptedAnswer
score: 0
has body: Finally I found out what is wrong with it. Because jade is a template engine that works with node (actually in server side), it has a lack of support in client side usage. So when you compile a jade template with underscore _.template function, you can't expect a functional template file. But there is an alternative way of sending variables from backbone view to jade template. You can create a helper function which print what ever you want in a jade template. .... var SampleView = Backbone.View.extend({ template: _.template($('#sample-template').html()), render: function() { this.$el.append(this.template({ link: this.model.toJSON(), ahref: this.ahref })); return this; }, ahref: function( href, title ) { return '&lt;a href=' + href + '&gt;' + title + '&lt;/a&gt;'; } }); .... Then I need to pass link helper function into the jade template. .... &lt;script type="text/template" id="sample-template"&gt; ahref(link.href, link.title); &lt;/script&gt; ....

http://stackoverflow.com/q/28832380
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45935505
has comment: http://stackoverflow.com/comment/45935320
tagged with: angularjs
tagged with: twitter-bootstrap
type: UnansweredQuestion
tagged with: datepicker
has comment: http://stackoverflow.com/comment/45934506
has body: I have a single page application, using ngBoilerplate as a base for structure. I've installed bootstrap datepicker through bower and using it inline in my template file (which end up being compiled into javascript file as angular template cache modules). &lt;div id="datepicker"&gt;&lt;/div&gt; All the javascript dependencies are loaded properly. Jquery first followed by Angular and all the rest. At the end of my index I have: &lt;script&gt; $(document).ready(function () { $("#datepicker").datepicker({todayHighlight: true, autoclose: true}); }); &lt;/script&gt; Now after landing on index page and I navigate to the page which contains the datepicker div, it is empty, as if the init script never was executed. However when I do full refresh to the page then it will be executed and datepicker appears. What's causing this anomaly? If I move my datepicker div to the index then it always is initalised and works, but not on first initial load which uses cache templates.
answer count: 0
has title: Angular template cache + bootstrap datepicker not activating on document ready
has comment: http://stackoverflow.com/comment/45935842
score: 0
type: Question

http://stackoverflow.com/comment/46044909
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28892032
has text: @jlars62 both `.prop` and `attr` are still there, both has different use cases

http://stackoverflow.com/comment/46064649
type: Comment
comment on: http://stackoverflow.com/a/28901860
has text: The value of textbox is already there when the page loads, not something that is entered in.
score: 0
type: AnswerComment

http://stackoverflow.com/q/28905598
downvote count: 0
tagged with: webrtc
has comment: http://stackoverflow.com/comment/46071810
tagged with: getusermedia
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/17578199
score: 2
has comment: http://stackoverflow.com/comment/46071158
answer count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/46072271
tagged with: google-chrome
type: Question
tagged with: javascript
has body: I am trying to access my local camera using WebRTC and the console log displays this message: NavigatorUserMediaError constraintName: "" message: "" name: "PermissionDeniedError" what could it be? google version: 41.0.2272.76 m
has comment: http://stackoverflow.com/comment/46109901
has title: permission denied error using WebRTC with google chrome
has comment: http://stackoverflow.com/comment/46070510

http://stackoverflow.com/q/28852847
score: 0
tagged with: google-maps
tagged with: google-maps-embed
answer count: 1
has comment: http://stackoverflow.com/comment/45972263
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/13555261
has body: I have a problem using &lt;iframe&gt; to embed my map (protocols must match). One suggested workaround is to replace https with http BUT THIS DOES NOTHING, as google forces it over SSL anyway. Also, leaving out both http and https, like so: //www.google.com does nothing. Another solution is to hard-code the map coordinates, zoom and whatnot into javascript, omitting the &lt;iframe&gt; altogether. However, that is not what I need. I need my custom map, with its clickable pins, default view (position and zoom) and base map settings. Is there a way in javascript to reference to this map, or even to build a map from scratch, but without registering for API_KEY with Google?
tagged with: iframe
has answer: http://stackoverflow.com/a/28861280
has comment: http://stackoverflow.com/comment/45972152
type: Question
has title: CUSTOM CREATED google maps embedding
tagged with: javascript

jquery-deferred
tags question: http://stackoverflow.com/q/28860289
tags question: http://stackoverflow.com/q/28821896
tags question: http://stackoverflow.com/q/28878963
tag name: jquery-deferred
tags question: http://stackoverflow.com/q/28840869
type: Tag

http://stackoverflow.com/q/28803157
type: Question
tagged with: c#
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/28803181
has title: Response.Redirect inside JsonResult
has comment: http://stackoverflow.com/comment/45879916
has comment: http://stackoverflow.com/comment/45881047
answer count: 1
downvote count: 0
tagged with: javascript
score: 1
tagged with: asp.net
favorite count: 0
accepted answer: http://stackoverflow.com/a/28803181
has body: I want to pass this query string to some aspx file ( WebForm1.aspx).But in here i'm unable to pass it.This is MVC5 application.Everything working but response.redirect not working public JsonResult SubmitReportData(SelectedReportViewModel SubmitData) { Response.Redirect("~/Report/WebForm1.aspx?Id="+SubmitData.SelectedNode+"&amp;stDate="+SubmitData.stDate+"&amp;enDate"+SubmitData.enDate); //return Json(new { x = 1 }); return null; }
has comment: http://stackoverflow.com/comment/45879842
has comment: http://stackoverflow.com/comment/45879797
has comment: http://stackoverflow.com/comment/45879823
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45879966
linked to: http://stackoverflow.com/q/199099
upvote count: 1

http://stackoverflow.com/q/28837424
has answer: http://stackoverflow.com/a/28837975
tagged with: javascript
upvote count: 2
answer count: 1
tagged with: jquery
has body: In simple, I am trying to retrieve the objectId for a particular user in parse (using Javascript). I can retrieve any other query in the database, such as username, phone, mailing address but not the objectId, here is how I retrieve the rest of the query: var objectId = userInfo.get("objectId"); Any assistance would be greatly appreciated. Below is more lines of the code (everything is retrieved beside objectId) query.find({ success: function(array) { // this means the query was a success, but we're not yet certain that we found anything // the param to find's success is an array of PFObjects, possibly empty if (array.length &gt; 0) { var userInfo = array[0]; var address = userInfo.get("address"); $scope.address = address; var email = userInfo.get("username"); $scope.email = email; var fullName = userInfo.get("fullName"); $scope.fullName= fullName; var number = userInfo.get("phoneNumber"); $scope.number= number; var objectId = userInfo.get("objectId"); $scope.objectId= objectId; var mailingAddress = userInfo.get("mailingAddress"); $scope.mailingAddress = mailingAddress; var plan = userInfo.get("plan"); $scope.plan = plan; Thanks in advance
favorite count: 0
tagged with: parse-platform
has title: Retrieve objectId in Parse
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
score: 2
downvote count: 0
type: Question

http://stackoverflow.com/comment/46019528
score: 1
comment on: http://stackoverflow.com/q/28878784
type: Comment
type: QuestionComment
has text: By default `transform-origin` is at center

http://stackoverflow.com/q/28768845
has body: I have a date in the following format Fri Mar 16 2012 05:53:18 GMT 0200 (GTB Standard Time) And I want to convert it into a unix timestamp. Until now I manually split the string by spaces and then I am giving it as an input to a Date object, in order to get milliseconds in a latter step. Is there any easiest way? (I am trying to avoid jQuery plug-ins and do it using vanila javascript)
upvote count: 1
has title: javascript date format conversion (full text date to unix time stamp)
tagged with: javascript
has comment: http://stackoverflow.com/comment/45816351
type: AnsweredQuestion
downvote count: 0
answer count: 1
score: 1
has answer: http://stackoverflow.com/a/28768882
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/45816773
accepted answer: http://stackoverflow.com/a/28768882

http://stackoverflow.com/q/28834240
tagged with: javascript
score: 4
has body: I have read lot of articles on the web about AngularJS and JS generally, and can't figure out the best way to make a service (like a class) the right way. Is this a good or a bad way to do this (it works) - pros an cons? .service('Field', function() { /** * Constructor */ function Field(id, name) { this.id = id; this.name = name; } /** * Public method */ Field.prototype.getName = function() { return this.name; } /** * Public method */ Field.prototype.setName = function(name) { this.name = name; } return Field; }) .controller('CreateCtrl', function($scope, Field) { $scope.fields = [ new Field(1, "Test1"), new Field(2, "Test2") ]; console.log($scope.fields[0].getName()); }) I was inspired by this article - https://medium.com/opinionated-angularjs/angular-model-objects-with-javascript-classes-2e6a067c73bc
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
upvote count: 4
has comment: http://stackoverflow.com/comment/45939900
has comment: http://stackoverflow.com/comment/45938174
answer count: 0
downvote count: 0
type: Question
has title: AngularJS service class - Good (right) or bad way?

http://stackoverflow.com/q/28830489
possible better answer: http://stackoverflow.com/a/28831043
has answer: http://stackoverflow.com/a/28831043
has body: My code is as simple: .controller('Ctrl', ['$scope', '$timeout', function ($scope, $timeout) { $timeout(function () { $scope.x = 5; }, 2000); }]) .directive('ngHey', ['$parse', function ($parse) { return { 'restrict': 'A', 'scope': true, 'link': function($scope, el, atr) { var go = function () { if ($parse(atr.ngHey)()) { alert('oiiiiiii'); } }; atr.$observe('ngHey', function (val) { if (val) { go(); } }); } }; }]); //view.html &lt;div ng-controller="Ctrl"&gt; &lt;span ng-hey="x &gt; 3"&gt;&lt;/span&gt; &lt;/div&gt; I would like to be able to fire when directive expression changes and when it's true or false, but at the moment the alert never happen... It works only if i do something like: &lt;div ng-controller="Ctrl"&gt; &lt;span ng-hey="{{x &gt; 3}}"&gt;&lt;/span&gt; &lt;/div&gt; which is not what i would like, i would like the directive to execute expressions as for ng-if or ng-hide etc... Any tip or help appreciated, thanks
has title: AngularJS observe directive attribute expressions, inherit scope dynamically
tagged with: angularjs-directive
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/28833659
tagged with: expression
upvote count: 3
tagged with: angularjs-scope
accepted answer: http://stackoverflow.com/a/28833659
type: Question
has comment: http://stackoverflow.com/comment/45934928
answer count: 2
has comment: http://stackoverflow.com/comment/45931597
has comment: http://stackoverflow.com/comment/45931867
has comment: http://stackoverflow.com/comment/45931196
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: angularjs

angularjs-digest
tags question: http://stackoverflow.com/q/28786824
tag name: angularjs-digest
tags question: http://stackoverflow.com/q/28772134
type: Tag
tags question: http://stackoverflow.com/q/28905111

http://stackoverflow.com/q/28759728
has title: React, Flux, React-Router Dispatch Error - Possible batchUpdates solution?
has body: Alright so I'm stuck on an issue with reactjs, flux architecture, and react-router. I have the following routes (just a portion of the routes): &lt;Route name="prepare-seniors"&gt; &lt;Route name="senior" path=":candidateId" handler={SeniorCandidate}&gt; &lt;DefaultRoute handler={SeniorProfile}/&gt; &lt;Route name="senior-recommendations" path="recommends"&gt; &lt;DefaultRoute handler={SeniorRecommends}/&gt; &lt;Route name="senior-rec-new" path="new"/&gt; &lt;/Route&gt; &lt;/Route&gt; &lt;/Route&gt; The Senior Profile view makes an API call to load the individual's data. When you navigate to the Recommends view, the individual's id is used to make another call to load the recommendations. It works great if I actually view the profile page first and navigate to the recommendations page. But if I do a hard reload I get: Uncaught Error: Invariant Violation: Dispatch.dispatch(...): Cannot dispatch in the middle of a dispatch. I realize this is because the dispatch is getting called after the first API returns, which goes out and starts updating components. Before it finishes the recommendations page calls its API and tries to dispatch its results. I read on a forum that React.addons.batchUpdates is a way to fix this, but I couldn't figure out how to get it to work. GitHub Batch Updates Issue and another link here that discusses something similar Trying to use waitFor. The first one recommends adjusting the dispatcher by adding the following: // assuming a var `flux` containing your Flux instance... var oldDispatch = flux.dispatcher.dispatch.bind(flux.dispatcher); flux.dispatcher.dispatch = function(action) { React.addons.batchedUpdates(function() { oldDispatch(action); }); }; But I could not make this work. Maybe I'm just implementing it incorrectly. I've read the Chat and TodoMVC examples. I understand how the waitFor is used in the chat example...but those both use the same API so it's clear that the one is going to wait for the other. My issue involves a race conditi…
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28777364
tagged with: react-router
score: 4
upvote count: 4
tagged with: reactjs
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: reactjs-flux
favorite count: 0
tagged with: flux

http://stackoverflow.com/comment/45858884
type: Comment
type: QuestionComment
has text: @Riliam It's just f.write()
score: 0
comment on: http://stackoverflow.com/q/28791369

http://stackoverflow.com/a/28793941
type: Answer
downvote count: 0
score: 1
has body: One way is to set it to a empty function, after the code has executed. function myFunction(){ //(..) Some code myfunction = function(){}; // empty the function so nothing happens next time }
answers question: http://stackoverflow.com/q/28793906
accepted answer of: http://stackoverflow.com/q/28793906
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45866405
has comment: http://stackoverflow.com/comment/45862475

http://stackoverflow.com/q/28792966
tagged with: jsbn
upvote count: 5
has comment: http://stackoverflow.com/comment/45861683
tagged with: python
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/42172578
has body: I encrypt plain text from JS RSA Library(http://www-cs-students.stanford.edu/~tjw/jsbn/) and decrypt from python, Crypto.PublicKey. But, when I decrypt cipher text from JS with python, It has dummy text. I don't know why they are. So, I want clear text which does not have dummy.(ex. test) Step Make key pairs in Python. key = RSA.generate(1024) #(publicKey, privateKey) Save modulus, exponent in JS and Encrypt "test" var rsa = new RSAKey(); rsa.setPublic(modulus, exponent); //modulus and exponent hex string rsa.encrypt("test"); result(hex string): d0ab7e22f92adcca7182e3c622b513382d163033df5ca0f3c0327e8a1774258800ae57dfc98522f5ed40a4bed2f4b54f46ea800ff1ef522b104b0f874a598f6bbcf5453506f8bf2f8aa3b04b0c73f0018564707304b3a059326d51945d3ff0282d63c2c4c1ea6ba5a2172af83ef8bdc1d104a8d67ba95ee97ab89b36cd5c34d4 Decrypt using PrivateKey in Python key.decrypt(above_result.decode('hex')) result: \x02\xf0\xae\xafK\xd3\x17\xfc\xf4\xd6\xd9=\xee7\x04\x94\xea\x9c\xd8\xf7--\x19\x05$!'#\xad\x82'\xfcKG\xadK\xb6_\xabMZ:\x9dU\xa4\xc0[\x8c\xa6hC\x93\xf7\xbc\xf1:\x9f\x107D\xe8\xfe\x07R\x8c\xd7\xb3\xe6\xc6\xcf^\x92\xa2\xe2X\xe4\xaf|\x8aS\xfe\xd3\x84)\xc3\x82\xdc\xd1\x7f\xc9\x12\xd0\x94\xd2jS\xee\x83\xfda\xc6\xc7d\xdd\x0b2\xe6\x1d\x84\x0c\x93\x8aK\xc2\x10U\xc0Y~\xbf\x15\xfa\x00test
tagged with: pycrypto
type: Question
score: 5
tagged with: rsa
tagged with: javascript
answer count: 2
possible better answer: http://stackoverflow.com/a/42172578
has answer: http://stackoverflow.com/a/28800963
accepted answer: http://stackoverflow.com/a/28800963
downvote count: 0
has title: RSA Encrypt and Decrypt between JS and Python(pycrypto)
favorite count: 0
has comment: http://stackoverflow.com/comment/45860785

http://stackoverflow.com/q/28897078
type: AnsweredQuestion
has title: Using Underscore sortBy - Sorting by multiple parts
tagged with: underscore.js
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28899711
linked to: http://stackoverflow.com/q/16426774
accepted answer: http://stackoverflow.com/a/28899711
tagged with: javascript
score: -1
tagged with: sorting
has body: So I am trying to sort an array of objects by both their priority and their position. This is an example of the data I am trying to sort: widgetInfo = [ {name: 'box1', position: 'mobile-top', priority: 'priority-1'}, {name: 'box2', position: 'mobile-top', priority: false}, {name: 'box3', position: 'mobile-top', priority: 'priority-2'}, {name: 'box4', position: false, priority: false}, {name: 'box5', position: 'mobile-bottom', priority: false} ]; What I want to be able to do is to get them in order so the objects that have a position of mobile-first are first, followed by those with a position of false and lastly followed by those with a position of mobile-bottom. Then of the ones that have mobile-top, I want to sort those in order of priority, so the mobile-top with priority-1 appears above the mobile-top, priority-2. So the data would come out like: widgetInfo = [ {name: 'box1', position: 'mobile-top', priority: 'priority-1'}, {name: 'box3', position: 'mobile-top', priority: 'priority-2'}, {name: 'box2', position: 'mobile-top', priority: false}, {name: 'box5', position: false, priority: false}, {name: 'box4', position: 'mobile-bottom', priority: false} ]; I understand I can use the underscore sortBy function and to sort by a string name of the property but is there a way to use it to do what I am after? My question is different to Underscore: sortBy() based on multiple attributes in the fact I am not after ordering alphabetically or numerically but in a specific order so that mobile-top is first, followed by the false entries followed by the mobile-bottoms and then sorted inside these.
has comment: http://stackoverflow.com/comment/46053746
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/46053866
downvote count: 2

http://stackoverflow.com/comment/46213803
has text: I found that after calling `range.expand('word')`,the range's properties(startOffset,endOffset,startContainer,endContainer) seems to be set correctly.And I also have found this:[https://github.com/edg2s/rangefix](https://github.com/edg2s/rangefix).
comment on: http://stackoverflow.com/a/28943857
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45904978
has text: @hobberwickey. Ouch! Don't recommend snapshotting the canvas using `getImageData` or even `toDataURL`--it results in horribly inefficient performance!
type: Comment
comment on: http://stackoverflow.com/a/28815978
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45838934
comment on: http://stackoverflow.com/a/28771879
type: AnswerComment
has text: you can check that append is done successfully in beforeSend if its not then you can return false, and ajax request will be aborted. Read the doc it has everything that you need. ;)
score: 0
type: Comment

http://stackoverflow.com/q/28765227
score: 1
favorite count: 0
upvote count: 1
tagged with: css
possible better answer: http://stackoverflow.com/a/28765413
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28765413
has answer: http://stackoverflow.com/a/28765372
has body: I'm trying to create a simple game, but I'm wondering how to implement 3 layered in canvas, somehow like in a photoshop. I want the background to be as background, the transparent one would be something it can reflect the background to the foreground and foreground layer would be the main animations/rendering. Will that be a good point for performance? Also, how to implement the 3 layered structure here? HTML CSS #container { width: 800px; margin: 20px auto; height: 200px; } #canvas_background{ border: 1px solid #666; position: absolute; } #canvas_trans{ position: absolute; background-color: transparent; z-index: 1; } #canvas_foreground{ position: absolute; }
type: Question
has title: 3 layered canvas in Html5
answer count: 2
tagged with: canvas
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/3008635
accepted answer: http://stackoverflow.com/a/28765372
has comment: http://stackoverflow.com/comment/45809419
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/46070255
type: QuestionComment
type: Comment
has text: Also, I'd move the inline onclick handlers into you main JS - it's just confusing matters.
comment on: http://stackoverflow.com/q/28905156
score: 0

http://stackoverflow.com/q/28880518
type: UnansweredQuestion
downvote count: 0
type: Question
tagged with: grunt-browserify
score: 1
has answer: http://stackoverflow.com/a/34497757
tagged with: javascript
has body: Our current infrastructure relies on Titanium for native. I am trying to convert my node project into CommonJS using https://www.npmjs.com/package/grunt-titaniumifier . However, it fails on the JSX: return ( &lt;div className="App"&gt; &lt;EnergyChart width="1000" data={JSONData.data} customerID={customerID} lineColor='#FF0' height="500" marginTop="20" marginLeft="50" marginBottom="20" marginRight="20" /&gt; &lt;/div&gt; ); Browserify works fine, as it uses the transform like so: browserify: { app: { src: 'app/App.js', dest: 'dist/bundle.js', options: { transform: ['grunt-less-browserify', require('grunt-react').browserify], } }, } For titaniumifier, I have the following: "titaniumifier": { "module": { files: { // The package is in "." and the zipfile will be written in "." ".": "." }, }, options: { transform: [ require('grunt-react').browserify], } } However running grunt titaniumifier:module returns Fatal error: Parsing file /Users/rduckworth/Projects/titanium-d3/app/App.js: Unexpected token (23:6) which is the JSX code above. Is there anyway I can get Titaniumifier to compile the JSX like browserify does?
tagged with: gruntjs
has title: React JSX + Titaniumifier
tagged with: reactjs
upvote count: 1
answer count: 1
favorite count: 0

http://stackoverflow.com/comment/45804454
has text: @kuroineko What would be an alternative to `eval()`
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28762510
type: Comment

http://stackoverflow.com/comment/45808811
score: 0
type: Comment
has text: Usually you don't. Just make sure you place the `script` tag at the bottom of your pages (right before the `body` closing tag).
comment on: http://stackoverflow.com/a/28764692
type: AnswerComment

http://stackoverflow.com/q/28906527
has title: What does this code from Eloquent JS Chapter 5 do?
type: Question
has comment: http://stackoverflow.com/comment/46072927
has comment: http://stackoverflow.com/comment/46072791
has answer: http://stackoverflow.com/a/28906894
tagged with: javascript
has comment: http://stackoverflow.com/comment/46073858
has comment: http://stackoverflow.com/comment/46072514
answer count: 1
favorite count: 0
has body: I have hard time understanding the first part of the code. I don't understand what we're after with the combine function. Also what does thisOneCounts do? Really, anything I haven't commented over I don't understand. //count the ancestors over 70 function countAncestors(person, test) { //supposed to combine parents recursively function combine(person, fromMother, fromFather) { //stores people over 70 var thisOneCounts = test(person); //if the person passed the `test` (&gt;70), then 1 is included return fromMother + fromFather + (thisOneCounts ? 1 : 0); } return reduceAncestors(person, combine, 0); } //find the percentage of known ancestors, who lived &gt; 70 years function longLivingPercentage(person) { var all = countAncestors(person, function(person) { return true; }); var longLiving = countAncestors(person, function(person) { //lifespan return (person.died - person.born) &gt;= 70; }); //percentage of &gt;70 return longLiving / all; } console.log(longLivingPercentage(byName["Emile Haverbeke"])); // → 0.145 The reduceAncestors function: function reduceAncestors(person, f, defaultValue) { function valueFor(person) { if (person == null) return defaultValue; else return f(person, valueFor(byName[person.mother]), valueFor(byName[person.father])); } return valueFor(person); }
accepted answer: http://stackoverflow.com/a/28906894
upvote count: 2
downvote count: 1
tagged with: recursion
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46072644
has comment: http://stackoverflow.com/comment/46073540
score: 1

http://stackoverflow.com/comment/45953115
type: Comment
comment on: http://stackoverflow.com/a/28839715
has text: @HexLuthor Perhaps share a jsfiddle or something so I can demo and help debug.
type: AnswerComment
score: 0

http://stackoverflow.com/a/28771705
downvote count: 0
score: 3
type: Answer
upvote count: 3
has body: I don't know anything about require.js but looking at the api, you are missing the arguments to your require callback: require(["d3","geo","topo"],function(d3,geo,topojson){ // you can now use topojson! }); Example here.
accepted answer of: http://stackoverflow.com/q/28770061
answers question: http://stackoverflow.com/q/28770061
type: AcceptedAnswer

http://stackoverflow.com/a/28772668
has body: If you really don't care about the language, you can try WatIn. I've already use it for test automation purpouse, but in your case, should work also (thinking in some clicks in span). Tutorial how to use WatIn
type: Answer
score: 1
answers question: http://stackoverflow.com/q/28772608
upvote count: 1
has comment: http://stackoverflow.com/comment/45827046
downvote count: 0

http://stackoverflow.com/comment/46041451
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28890145
has text: I ran it again this time it printed 146 ID's ... any idea whats wrong ?

http://stackoverflow.com/comment/46049793
type: Comment
has text: You need to remove the `"Model."` bit (check the previous edit I made)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28894005

http://stackoverflow.com/comment/46024723
comment on: http://stackoverflow.com/a/28880362
score: 0
type: AnswerComment
type: Comment
has text: This regExp works ... but when you continue writing into the input field, and write a second "." this regular expression let write it. And the problem is that, there must not be permited write a second "." character Any other idea. Thanks

http://stackoverflow.com/comment/45827865
type: AnswerComment
has text: Hi @Coderhs, thanks but wouldnt that give me all health_care_insurence_ids instead of just the checked ones?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28774435

http://stackoverflow.com/comment/45838527
type: QuestionComment
has text: Stack Overflow has answer to this: http://stackoverflow.com/questions/2490825/how-to-trigger-event-in-javascript
comment on: http://stackoverflow.com/q/28780598
score: 1
type: Comment

http://stackoverflow.com/comment/45921985
has text: http://en.wikipedia.org/wiki/Distance_transform
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28825605

http://stackoverflow.com/q/28834053
type: Question
has comment: http://stackoverflow.com/comment/45938944
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28835338
has comment: http://stackoverflow.com/comment/45938013
has body: I have a list that displays all the questions in a test randomly, but I am trying to have only some of the test display. I tried making the length of the list shorter and outputting that way but it still dislpays all of the list. Any help is appreciated. HTML What are the three main areas of the Standard User Interface? Header, Banner, Frame, Application Window Content Frame, Homepage, Form Application Navigator, Banner Frame, Content Frame Larry, Moe, and Curly In the User interface, what is the gray toolbar called which allows you to add bookmarks? Gauge Edge Remedy Banner What can be captured in an update set? Modified CI Rules Business Rules Scheduled Jobs None of these JavaScript // Function that randomizes the test questions that are displayed along // with the answers as soon as the page loads function call_onLoad() { var ol = document.querySelector('ol'); temp = ol.cloneNode(true); for (var i = temp.children.length - 10; i >= 0; i--;) { temp.appendChild(temp.children[Math.random() * i | 0]); alert(temp.children.length); } ol.parentNode.replaceChild(temp, ol); var ul = document.querySelectorAll('ul'), parent; alert("found " + ul.length + " ul's"); for (var k = ul.length - 1; k >= 0; k--) { parent = ul[k].parentNode; temp = ul[k].cloneNode(true); for (var i = temp.children.length + 1; i--;) { temp.appendChild(temp.children[Math.random() * i | 0]); } parent.replaceChild(temp, ul[k]); } }
answer count: 1
has comment: http://stackoverflow.com/comment/45937655
has title: How do i get an ordered list to randomly spit out only some of the list
has comment: http://stackoverflow.com/comment/45937710
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45937680
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28835338
score: 0
has comment: http://stackoverflow.com/comment/45938727

http://stackoverflow.com/q/28833032
tagged with: ember.js
tagged with: page-refresh
answer count: 0
score: 0
has body: Using Ember.js: I have a Route App.QueryDataRoute = Ember.Route.extend({ model: function(params) { return Ember.RSVP.hash({ propertyObject: this.controllerFor("cres").get("properties").findBy('title', params.propertytype_title), nrOfOffers: this.controllerFor("queryData").get("nrOfOffers"), deal: this.controllerFor("queryData").get("deal"), price: this.controllerFor("queryData").get("price"), surface: this.controllerFor("queryData").get("surface"), }); } }); All those .get('[variable name]') are variables inside QueryData controller. Update: added controller App.QueryDataController = Ember.ObjectController.extend({ id: null, property: null, deal: null, nrOfOffers: null, price: null, surface: null, actions: { checkPropType: function (county, property, dealtype) { if(property.title ==="Apartment"){ this.send('populateEstateData', property.title, dealtype.title, county.nrOfApartSale,county.avgPriceApartSale, county.avgSurfaceApartSale); }else if(property.title ==="House"){ this.send('populateEstateData', property.title, dealtype.title, county.nrOfHouseSale,county.avgPriceHouseSale, county.avgSurfaceHouseSale); }; }, populateEstateData: function(pProperty, pDeal,pNrOfOffers, pPrice, pSurface){ this.set('id', 1); this.set('property', pProperty); this.set('deal', pDeal); this.set('nrOfOffers', pNrOfOffers); this.set('price', pPrice); this.set('surface', pSurface); }}, PROBLEM: After page refresh I lose those variables ofcourse because they are declared as null again inside the controller. QUESTION: How can I not reset the variables inside the contorller after page refresh so that I can load them again from Route.
has comment: http://stackoverflow.com/comment/45944082
has comment: http://stackoverflow.com/comment/45966016
type: Question
has comment: http://stackoverflow.com/comment/45943022
has comment: http://stackoverflow.com/comment/45944485
has comment: http://stackoverflow.com/comment/45943925
has comment: http://stackoverflow.com/comment/45944751
tagged with: javascript
tagged with: routes
has comment: http://stackoverflow.com/comment/45946229
tagged with: controller
has comment: http://stackoverflow.com/comment/45966210
has title: Ember.js controller variables reseting after page refresh
type: UnansweredQuestion

http://stackoverflow.com/q/28868623
answer count: 1
tagged with: javascript
has body: I want to assign a value inside javascript value function abc(){ var b = document.getElementById("tc").value; if(b=="true"){ &lt;#assign x=true&gt; } else{ &lt;#assign x=false&gt; } } however I am not able to get value of x. Can someone please let me know how to assign freemarker variable inside javascript.
tagged with: freemarker
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28878477
has title: Assigning Freemarker variable in javascript
type: Question
has comment: http://stackoverflow.com/comment/46001714
score: 0

http://stackoverflow.com/comment/45802855
score: 1
type: AnswerComment
type: Comment
has text: Thanks, thats what I was looking for. Could you give a short explanation of what u did compare to what I did?
comment on: http://stackoverflow.com/a/28761481

http://stackoverflow.com/a/28860186
answers question: http://stackoverflow.com/q/28859009
type: Answer
has body: this is optional to choose the form for submitting data or you can do it without the HTML form this is what i do and the using folloing javascript and jquery style I hope it helps
score: 0

http://stackoverflow.com/q/28904664
has comment: http://stackoverflow.com/comment/46069219
answer count: 2
has comment: http://stackoverflow.com/comment/46069158
downvote count: 0
possible better answer: http://stackoverflow.com/a/28904874
favorite count: 0
accepted answer: http://stackoverflow.com/a/28904898
has title: Prototypical inheritance without creating a parent object
upvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46069171
score: 1
linked to: http://stackoverflow.com/q/17392857
has comment: http://stackoverflow.com/comment/46069268
has body: So I was reading the book Head First Javascript Programming, which is a great book btw, learned me a lot, when I stumbled into the subject of multiple inheritance. The book taught me that to achieve multiple inheritance you should set the prototype of your constructor to a new object of your parent. As an example: //Parent function Dog (name){ this.name = name; }; //Child function AwesomeDog(name){ Dog.call(this, name); }; AwesomeDog.prototype = new Dog(); AwesomeDog.prototype.constructor = AwesomeDog; AwesomeDog.prototype.isAwesome = true; Now I don't agree that this is the best way to do it, you call the Dog constructor only for its prototype property, but you also get the name property with it, that you will typically never use and therefore always be undefined. Why not just do this: AwesomeDog.prototype = Dog.prototype; You're only interested in the prototype anyway so why not? In my opinion this is better because of 2 reasons: The overhead of creating a new object is left out (insignificant, but it's something) You don't have useless properties floating around in your child's prototype, that will probably always remain undefined. Now this book has been brilliant in every way so that led me to believe that I perhaps missed something crucial, but I can not see what. I can not imagine any use cases where having double properties (one in the child object and the undefined version in your prototype) can be useful. Is my way of thinking correct and can I stick with my method?
type: Question
has answer: http://stackoverflow.com/a/28904898
tagged with: javascript
has comment: http://stackoverflow.com/comment/46069373
tagged with: inheritance
has answer: http://stackoverflow.com/a/28904874

http://stackoverflow.com/q/28793150
accepted answer: http://stackoverflow.com/a/28793249
has comment: http://stackoverflow.com/comment/45861473
downvote count: 1
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28793249
type: Question
linked to: http://stackoverflow.com/q/28653505
answer count: 1
tagged with: javascript
has title: Span element with unconstant length
favorite count: 0
has body: Similar to: Text width not applying in span Using the same 'span' idea: Code The span width still wobbles - but the text is effectively always the same length - at least the letters are the same? JSFiddle before JSFiddle after
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45861168
upvote count: 2
has comment: http://stackoverflow.com/comment/45861041

http://stackoverflow.com/comment/45875428
has text: Ah, changed `duration` to `10s` , able to "see" _"it goes back to beginning"_ Should elements remain outside of viewport if new content stops being appended ? When to stop ? What is expected result when content stops being appended ? Should elements be removed from `#list` , or maintained within `DOM` when outside of viewport ?
comment on: http://stackoverflow.com/q/28800685
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/28887410
type: AnsweredQuestion
score: 3
type: Question
tagged with: filtering
has body: I am trying to use checkboxes and a dropdown menu to filter (.hide(), .show()) divs. I have an example working but need the two functions to check each other. http://jsfiddle.net/fj8vLns1/3/ The idea would be to have the check box for link2 checked and select 2015 on the dropdown menu and have only div2 display (not both 1 and 2). JS jQuery("input[type='checkbox']").prop("checked", true); $("input[type='checkbox']").on("click", function () { var selector = $(this).data("toggle"); if ($(this).prop('checked')) { $(selector).show(); } else { $(selector).hide(); } }); $('#year').change(function () { var val = $('#year').val(); $('.yearselected').hide(); if (val) { $("." + val).show(); } }); HTML link 1 link 2 link 3 link 4 2015 2014 div 1 div 2 div 3 div 4
downvote count: 0
tagged with: javascript
tagged with: jquery
upvote count: 3
answer count: 1
has title: Using jQuery to filtering with two input types
favorite count: 0
has answer: http://stackoverflow.com/a/28887706
accepted answer: http://stackoverflow.com/a/28887706

http://stackoverflow.com/a/28895954
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/46051808
upvote count: 3
downvote count: 3
answers question: http://stackoverflow.com/q/28895866
has body: You can check event.shiftKey boolean propery. $("element selector").click(function(event) { if (event.shiftKey) { alert("Shift key is pressed"); } }); Demo

http://stackoverflow.com/comment/46052660
comment on: http://stackoverflow.com/q/28896227
has text: Is the map trying to render before the geocoding function has completed? Maybe call the geocoding function before initializing the map.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28813770
has comment: http://stackoverflow.com/comment/45899630
upvote count: 1
score: 1
has body: Can you try this and let me know? Meteor.publish('posts', function(limit) { limit = limit || Meteor.settings.public.pageLimit; check(limit, Number); var options = { sort: {submitted: -1}, limit: limit }; return Posts.find({}, options); });
answers question: http://stackoverflow.com/q/28813567
downvote count: 0
type: Answer

http://stackoverflow.com/comment/46014396
score: 0
type: Comment
type: QuestionComment
has text: @DavidThomas...we are supporting both 12 hour (12:30a,12:30am,1230a,1230am) and 24 hour (1430,14:30)
comment on: http://stackoverflow.com/q/28876076

http://stackoverflow.com/a/28764537
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/45812418
has body: I strongly recommend using ids. Use a directive to add ids to each checkbox, then you can something like this: element(by.css('input[myid="checkbox_x"]')); // where x is defined in a loop
has comment: http://stackoverflow.com/comment/45813393
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28753312

http://stackoverflow.com/comment/45982118
type: QuestionComment
comment on: http://stackoverflow.com/q/28857438
has text: Actually I just realized it works if IE Developer Tool is opened ...
score: 0
type: Comment

http://stackoverflow.com/comment/45934231
type: QuestionComment
comment on: http://stackoverflow.com/q/28832313
score: 0
has text: Have you tried anything? If so, post it.
type: Comment

http://stackoverflow.com/comment/45820460
score: 0
has text: check the update, also use chrome developer tool to debug your code and post if you are seeing any error.
comment on: http://stackoverflow.com/a/28770239
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/85328789
score: 1
type: Comment
comment on: http://stackoverflow.com/a/44195731
type: AnswerComment
has text: What file does this get added to?

http://stackoverflow.com/comment/46003720
comment on: http://stackoverflow.com/a/28869788
score: 0
type: Comment
has text: Thank you ! It works perfectly now. I forgot foreach doesn't return anything
type: AnswerComment

http://stackoverflow.com/a/28788275
has body: The removeClass method doesn't take multiple parameters, it takes a space separated string of class names: $('#imgLoader figure').removeClass('img1 img2 img3 img4').addClass('img2');
upvote count: 5
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28788236
answers question: http://stackoverflow.com/q/28788236
score: 5
type: AcceptedAnswer

http://stackoverflow.com/comment/45940274
type: AnswerComment
comment on: http://stackoverflow.com/a/28833131
type: Comment
has text: hm, well this is a sub section of my main app so chaning the $urlRouteProvider wont do. but the first answer Ill give a try. I thought it would be possible to load child states into a non-abstract parent as long as there was a named view but I suppose that just is not how angular-ui-router works, thanks for the feedback! Ill give it a go and mark you as the answer once I find it working
score: 0

http://stackoverflow.com/a/28860095
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28859363
type: Answer
accepted answer of: http://stackoverflow.com/q/28859363
has comment: http://stackoverflow.com/comment/45989078
has body: Instead of &lt;?php echo json_encode($date_list_res); ?&gt;; Type just &lt;?php echo $date_list_res; ?&gt;; Everything should be dandy.
score: 0

http://stackoverflow.com/q/28881519
type: Question
score: 3
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: How can I return the number of videos in a YouTube playlist using javascript?
has answer: http://stackoverflow.com/a/28883209
accepted answer: http://stackoverflow.com/a/28883209
type: AnsweredQuestion
upvote count: 3
has comment: http://stackoverflow.com/comment/46026417
has body: I'm embedding a YouTube playlist and want it to play a random video on every page load. How do I find the number of videos in a playlist using JavaScript or JQuery so that i can use javascript to select a random number between 0 and the total number of videos?
tagged with: youtube

http://stackoverflow.com/q/28771840
downvote count: 0
tagged with: javascript
favorite count: 0
has title: Random number generator, what's wrong with my approach/statistics? [JS]
tagged with: statistics
has answer: http://stackoverflow.com/a/28772226
tagged with: sha512
has comment: http://stackoverflow.com/comment/45822633
upvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28772179
accepted answer: http://stackoverflow.com/a/28772226
score: 1
possible better answer: http://stackoverflow.com/a/28772179
has comment: http://stackoverflow.com/comment/45822328
type: Question
answer count: 2
tagged with: random
has body: First of all, what I want to know is if I am doing a systematic fault or am I messing up with the math, or do you have any ideas what could be wrong? I was trying to write a little random number generator which numbers can be influenced / verified by the user (provably fair). The generated number is between 4096 and 65535. I simulated the function 100,000 times and get some strange statistics (Or am I thinking wrong??). Why is the chance that the number is under 8000 around ~50%. Shouldn't it be 50% around the middle of the number range (~30700)? Here is the output of the simulation: &lt; 65536 : 100000 Times :100% &lt; 60000 : 91813 Times :91.813% &lt; 56000 : 86406 Times :86.406% &lt; 52000 : 81334 Times :81.334% &lt; 48000 : 76743 Times :76.743% &lt; 32768 : 62356 Times :62.356% &lt; 32000 : 61748 Times :61.748% &lt; 30719 : 60860 Times :60.86% &lt; 24000 : 56628 Times :56.628% &lt; 16000 : 52871 Times :52.871% &lt; 12000 : 51540 Times :51.54% &lt; 8000 : 50447 Times :50.447% &lt; 6000 : 36003 Times :36.003% &lt; 5096 : 21583 Times :21.583% &lt; 4608 : 11714 Times :11.714% &lt; 4250 : 3674 Times :3.674% &lt; 4100 : 100 Times :0.1% &lt; 4096 : 0 Times :0% A little more details on the function I wrote: I am generating two hashes. One is the userhash and the other is the serverhash. Both of these have a format like e.g.: Server =3CDC3C8C97DEE62169B2C403BB2B6B501C1B0A0BD8015699B47DA67789C3F628 User =CF27CC73E33E0AC1DA5239DE8DAF94044D89B8636DA90F4CE510E652C8AC7F54 (The Userhash, is generated by a unique ID. The Serverhash is generated by taking a random number (standard function: math.random() )and a timestamp and then HMAC-SHA-512 them.) To get my "random" number, i take both (user and server) hashes and add them as hexadecimal numbers (userhash + serverhash = result). Then I take the result and cut everything except the first 4 digits. (E.g result = CF27) After that, I convert it to decimal again. The smallest number I can get from this should be in Hex 1000 (dec=40…

http://stackoverflow.com/comment/46033844
type: Comment
type: QuestionComment
has text: What did you try so far?
score: 0
comment on: http://stackoverflow.com/q/28886278

http://stackoverflow.com/q/28893030
has comment: http://stackoverflow.com/comment/46066626
downvote count: 1
has title: Pass a function's return object as an argument
has answer: http://stackoverflow.com/a/28893049
has body: i am converting an inline event handlers to external js files using addEventListner(). the prefrence onclick="return somefun();" here the some function returns a function. im converting it to elemet.addEventListener("click", somefun) but here somefn() is getting passed instead of the return value of the somefun(). how can i get to pass the return value of the function??
score: -1
type: Question
upvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/a/28825179
type: Answer
has body: &lt;form method="put"&gt; is invalid HTML and will be treated like &lt;form&gt; , GET and POST are the only allowed values for the "method" attribute. if you want to use put use ajax like this : $.ajax({ url:'/miles', type:'PUT', data:{ miles : $('.form-control').val() }, success:function(data){ console.log('put'); }, error:function(err){ console.log(err); } }); //and in back-end recieve this value app.put('/miles', isLoggedIn, function(req, res) { var userModel = mongoose.model('User',userSchema), miles = req.body.miles; //recive miles send using ajax userModel.update({ "userInfo.fullname" : "max26" } , { $push : { 'milesLog' : { 'miles' : miles } } } , function(err , data ) { console.log(data); } });
answers question: http://stackoverflow.com/q/28811905
score: 0

http://stackoverflow.com/q/28801453
has body: Here is my code: After the loading, it should invoke event --"onReady", then print out "My player is onReady" in browser console. But it doesn't show. Basically, this is a very simple example for YouTube API usage, but I can't find what's wrong here. Even I have followed steps in the youtube video. Any helps? Thank you in advance!! THis is YOutube API testing Here is log in browser console:
tagged with: youtube
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28801569
upvote count: 1
type: Question
has title: Youtube API onReady doesn't work
tagged with: javascript
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/28801569
score: 1
linked to: http://stackoverflow.com/q/20503462
possible better answer: http://stackoverflow.com/a/49073356
favorite count: 0
has answer: http://stackoverflow.com/a/49073356

http://stackoverflow.com/comment/45867960
type: QuestionComment
comment on: http://stackoverflow.com/q/28796705
score: 0
has text: @Pointy I want to validate that google understand input adsress
type: Comment

http://stackoverflow.com/comment/57216797
comment on: http://stackoverflow.com/a/34727640
has text: Cool appreciate your answer. I have a query, Sorry if am incorrect. Say if you're not storing changed password time in database, then login would happen with the tokens created with old password also right . Example you have logged in using mobile, now changed your password in computer, but still session runs in mobile for the 3 days. I believe in this case, session should not work in mobile. Because of this case only, I added a logic of storing changed password time in database.
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28762464
has comment: http://stackoverflow.com/comment/45804351
downvote count: 0
type: Answer
score: 1
answers question: http://stackoverflow.com/q/28762291
accepted answer of: http://stackoverflow.com/q/28762291
upvote count: 1
has body: I think you are using blade template in laravel. Could you please try { $var } instead of {{ $var }}
type: AcceptedAnswer

http://stackoverflow.com/comment/46077735
score: 0
type: AnswerComment
has text: Thanks, your code is work on html pages but I have long sentences on mysql fields (long description) and I display results on a jquery-flexigrid table. In your case long sentences is written inside`var paragraph = " ....` including in html/php pages but I can't write javascript on mysql fields because i have not a javascript code that decode that. I use Autolinker.min.js for decoding html code writing inside mysql fields. Have you got a similar solution for this?
type: Comment
comment on: http://stackoverflow.com/a/28899567

google-apps-script
tags question: http://stackoverflow.com/q/28883149
tags question: http://stackoverflow.com/q/28848766
tags question: http://stackoverflow.com/q/28896063
tags question: http://stackoverflow.com/q/28768178
tags question: http://stackoverflow.com/q/28850024
tags question: http://stackoverflow.com/q/28838768
tags question: http://stackoverflow.com/q/28751471
type: Tag
tag name: google-apps-script
tags question: http://stackoverflow.com/q/28862194
tags question: http://stackoverflow.com/q/28903148
tags question: http://stackoverflow.com/q/28803656
tags question: http://stackoverflow.com/q/28830462
tags question: http://stackoverflow.com/q/28752565
tags question: http://stackoverflow.com/q/28795844
tags question: http://stackoverflow.com/q/28822353
tags question: http://stackoverflow.com/q/28903342
tags question: http://stackoverflow.com/q/28898814
tags question: http://stackoverflow.com/q/28773425
tags question: http://stackoverflow.com/q/28864106
tags question: http://stackoverflow.com/q/28862765
tags question: http://stackoverflow.com/q/28884013
tags question: http://stackoverflow.com/q/28855218
tags question: http://stackoverflow.com/q/28906198
tags question: http://stackoverflow.com/q/28778327
tags question: http://stackoverflow.com/q/28902898
tags question: http://stackoverflow.com/q/28787954

http://stackoverflow.com/a/28769301
has comment: http://stackoverflow.com/comment/45817105
accepted answer of: http://stackoverflow.com/q/28769037
upvote count: 3
score: 3
type: AcceptedAnswer
downvote count: 0
has body: $("textarea").on('keydown', function(e) { if(e.keyCode == 9) { e.preventDefault(); for(var i=0; i<4; i++) { var start = this.selectionStart, end = this.selectionEnd, value = $(this).val(); $(this).val(value.substring(0, start) + " " + value.substring(end)); this.selectionStart = this.selectionEnd = start + 1; } } });
type: Answer
answers question: http://stackoverflow.com/q/28769037

http://stackoverflow.com/comment/45917997
type: AnswerComment
comment on: http://stackoverflow.com/a/28823070
has text: nice, this did indeed smoothen the process abit, now it just a really minor delay showing, i'd say 0.5 seconds, sec let me post my code.
type: Comment
score: 0

http://stackoverflow.com/q/28817771
favorite count: 0
type: UnansweredQuestion
has body: I'm trying to assign the function below to a variable so I can bind it to another function. Here is this original function var timer = 0; $(document).ready(function(e) { $(this).on("mousemove", function(e){ clearTimeout(timer); console.log("TRUE mouse"); timer= setTimeout(function (e) { console.log("false mouse"); },"5000"); }) }); I tried assigning the above function to this.onMouseHandler, but it doesn't seem to be working. How can I assign the above function to a variable to which I can bind things too? this.onMouseHandler = function(e ) {var timer = 0; $(this).on("mousemove", function( e ){ clearTimeout(timer); console.log("true"); this.active = true; timer= setTimeout(function () { console.log("false"); this.active = false; },"5000"); }) };
tagged with: mouse
answer count: 0
score: 1
upvote count: 1
type: Question
has title: Mouse movement event handler
tagged with: javascript
tagged with: mouseevent
downvote count: 0

http://stackoverflow.com/comment/45917101
has text: Activate jQuery top left and scale down demo to just the necessary html.
comment on: http://stackoverflow.com/q/28822719
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46014350
score: 0
type: Comment
type: QuestionComment
has text: @dimple, not this code. When you run your application and load this jsp on a web browser, we would like to see the generated html code from the browser. Not the jsp code you have written..
comment on: http://stackoverflow.com/q/28874942

http://stackoverflow.com/comment/45822978
score: 0
type: Comment
type: QuestionComment
has text: I think you may want to set your CSS styles to be very narrow in specificity so that they only apply to the HTML section/elements you want to affect (and not the entire page)
comment on: http://stackoverflow.com/q/28772200

http://stackoverflow.com/q/28786173
tagged with: rtcdatachannel
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28787800
score: 2
has title: How do I initiate a WebRTC data channel?
type: Question
has answer: http://stackoverflow.com/a/28787153
tagged with: javascript
upvote count: 2
answer count: 2
downvote count: 0
tagged with: webrtc
favorite count: 0
has body: I'm trying to create a WebRTC data channel between clients using web sockets. I listed some ICE servers var rtcsettings = { iceServers: [ {url: "stun:stun.ekiga.net"}, {url: "stun:stun.voipbuster.com"}, {url: "stun:stun.1.google.com:19302"}, ] }; Then there is a connect function that creates a channel and offer and sends it over the web socket. function(them) { var pc = new RTCPeerConnection(rtcsettings); self.channel = pc.createDataChannel("gamelink"); console.log(pc, self.channel); self.peerconnection = pc; pc.createOffer(function(offer) { pc.setLocalDescription(new RTCSessionDescription(offer), function() { self.socket.send(JSON.stringify({ "to": them, "uuid": uuid, "offer": offer, })); }, pc.close); }, pc.close); } Then on the other end there is a callback that adds the offer to its connection and sends a response. It also sets a callback for when a data channel is added, but this never fires. What am I missing? function (message){ var offer = message.offer; var pc = new RTCPeerConnection(rtcsettings); pc.ondatachannel = function(ch) { self.channel = ch; console.log(self.channel); } console.log(pc); pc.setRemoteDescription(new RTCSessionDescription(offer), function() { pc.createAnswer(function(answer) { pc.setLocalDescription(new RTCSessionDescription(answer), function() { self.socket.send(JSON.stringify({ "to": message.uuid, "uuid": uuid, "answer": answer, })); }, pc.close); }, pc.close); }, pc.close); self.peerconnection = pc; } Then finally there is another callback on the initiator that adds the response descriptor to its connection. function(message) { self.peerconnection.setRemoteDescription( new RTCSessionDescription(message.answer), function() { }, self.peerconnection.close); } All of the code except the socket stuff and the data channel stuff is taken almost verbatim from the MDN Basic Usage page. I'm testing with Chrome on localhost, so firewalls should not be a problem. After the exchange happens, both connections have a local and remote descriptor se…

http://stackoverflow.com/a/37814396
type: Answer
score: 13
downvote count: 0
has comment: http://stackoverflow.com/comment/87761080
has body: Ideally we should do it from either controller or directive as per applicable. Use $anchorScroll, $location as dependency injection. Then call this two method as $location.hash('scrollToDivID'); $anchorScroll(); Here scrollToDivID is the id where you want to scroll. Assumed you want to navigate to a error message div as Your Error Message For more information please see this documentation
upvote count: 13
answers question: http://stackoverflow.com/q/28871434

http://stackoverflow.com/a/28792417
answers question: http://stackoverflow.com/q/28792138
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28792138
has comment: http://stackoverflow.com/comment/45860334
score: 1
has body: Use Text interpolation: var flash_message = '#{flash.any? ? flash_to_html_helper(flash) : nil}';

http://stackoverflow.com/comment/45980732
has text: It is not static, I don't know the spans in advance, so I must derive the height of the fieldset somehow from the highest span, but of course not waste space by choosing some arbitrary extra offset. In my browser, when I ckick "toggle" the fieldset size changes, which I don't want. It seems to be egnough adding twice the fontsize of the fieldset, but that is not logical.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28851909
score: 0

http://stackoverflow.com/comment/46035230
type: Comment
type: QuestionComment
has text: For what it's worth, you should advise your client that an upper limit is a really bad idea.
score: 2
comment on: http://stackoverflow.com/q/28886707

http://stackoverflow.com/comment/45858508
comment on: http://stackoverflow.com/q/28791701
score: 0
has text: org.openqa.selenium.WebDriverException: unknown error: Runtime.evaluate threw exception: SyntaxError: Unexpected token ";"
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/46064666
type: QuestionComment
comment on: http://stackoverflow.com/q/28902434
has text: Your error means, that no element wasnt found with the id data, which you want to clone
score: 0
type: Comment

http://stackoverflow.com/q/28883494
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46150626
tagged with: synchronous
tagged with: sequencing
has title: Web Audio API - Scheduling Issue
has comment: http://stackoverflow.com/comment/46070640
has body: I am trying to build a loop sequencer that utilises the web audio API and many different musical loops of different lengths. The general idea is that the loops are chosen at random (to a degree), then played back in in a specific order for a beginning, middle and end section. There are four channels - bass, drums, lead, and FX. Just before the end of the last section a new set of samples are chosen and played back using the same formula. I then intend to add a visualiser and maybe some automation - i.e maybe reverb for the final few bars. I have to tried to follow the 'Tale of Two Clocks' method but as I am relatively new to programming - and to javascript - I am having a hard time implementing it. I think it might make things more complicated than necessary to complete this. My initial idea was to create a for loop with the play method inside that specified the amount of times I want a loop to play, but I have found that the samples will instead all play at once. As per the 'Tale of Two Clocks', I am avoiding using setTimeout() and setInterval() as much as possible as it will only lead to lag. My second idea was to call all the play methods at once, except each is cued at a certain point in the 'song', for example START SECTION playlead(time, buffer); playdrums(time + length*2, buffer); MIDDLE SECTION playlead(time + length*10, buffer); playdrums(time + length*10, buffer); playlead2(time + length*10, buffer); playbass(time + length*10, buffer); and so on. This has caused its own set of problems however and seems like a fairly inefficient way to go about it. It feels like a may be missing an obvious solution but after quite a bit of research, I have still not been able to solve it. It seems like the easiest thing to do would be to make the playSound function in my for loop wait for the sample to finish before iterating again but this is a lot harder to do than it seems. Please if anyone could offer up any advice I would be very grateful as I am at wits end with this…
type: Question
has comment: http://stackoverflow.com/comment/46150619
has answer: http://stackoverflow.com/a/28951533
has comment: http://stackoverflow.com/comment/46151979
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/46146376
tagged with: http://stackoverflow.com/tag/html
tagged with: web-audio-api
accepted answer: http://stackoverflow.com/a/28951533
has comment: http://stackoverflow.com/comment/46150678
upvote count: 2

http://stackoverflow.com/comment/46144094
type: AnswerComment
comment on: http://stackoverflow.com/a/28944881
type: Comment
has text: what's going on in this code, its shuffling the drop down list ....somewhat working but not proper...http://jsfiddle.net/0yyq1Lkn/
score: 0

http://stackoverflow.com/comment/45975179
type: Comment
has text: @amitjoki Mostly because I think that `regex` looks complicated, making an easy task harder to debug, and otherwise because regex is quite performance heavy. I mostly use them in large chunks of text. But its always interesting to see that someone always finds a way to use them, even for mundane tasks :) Joost, you have to join your array together (`array.join('')`, which turns it into a string);
comment on: http://stackoverflow.com/a/28854455
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45816577
comment on: http://stackoverflow.com/a/28768655
has text: thanks for the reply. There is an error it's BoxesFx not BoxesFX...could I see the code for new buttons? It's not very clear to me
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45989087
has text: Or you can use `prepend()` if you want the image get "inserted" before the text.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28861845
type: Comment

http://stackoverflow.com/a/28762852
score: 0
type: Answer
has body: If you want to establish a connection to the websocket just once you can use jQuery's once() handler. Use it like this $('#ws-show-log').once('click', function() { // inner code } If you want to establish a new connection to your server each time you click on #ws-show-log, then you should close the connection after you used it. Otherwise the connection will stay open and each time you click on #ws-show-log will result in an extra connection to your server. You can close your WebSocket by using webSocket.close();. You could put this close function inside your onmessage handler. Now when you received a message from you server, the WebSocket will be closed. You can do that like this: webSocket.onmessage = function(event) { console.log('onmessage: ' + event.data); webSocket.close(); };
answers question: http://stackoverflow.com/q/28762751
has comment: http://stackoverflow.com/comment/45805625
has comment: http://stackoverflow.com/comment/45806436
has comment: http://stackoverflow.com/comment/45805998
has comment: http://stackoverflow.com/comment/45805790

http://stackoverflow.com/comment/46010599
score: 0
comment on: http://stackoverflow.com/a/28868911
type: Comment
has text: Any success is largely luck. lol 1. I don't know what you mean by define the script. 2. Markup? Is that the bit? I don't think that was covered yet in the book, and I was only guessing that it was where the text appeared on the result section. 3. I updated my jsfiddle bookmark to automatically load JQuery when I load a blank page, does it cause problems to leave it on? Your description of the event handlers and DOMs is helpful! Thank you! I still haven't gotten it working, but I'm coming at it with a clear head and hopefully I can get SOMETHING working.
type: AnswerComment

http://stackoverflow.com/comment/46052445
type: QuestionComment
type: Comment
has text: Edited my question to include HTML
comment on: http://stackoverflow.com/q/28896262
score: 0

http://stackoverflow.com/a/28848653
answers question: http://stackoverflow.com/q/28841975
has body: You can use lazy loading observable to get data into your viewModel observables, and computed to subscribe on load of the parent level observables. function ViewModel() { this.workout = ko.onDemandObservable(ViewModel.prototype.getWorkout, this); this.diet = ko.onDemandObservable(ViewModel.prototype.getDiet, this); this.feedback= ko.onDemandObservable(ViewModel.prototype.getFeedback, this); this.suggestedWorkouts = ko.observable(); ko.computed(ViewModel.prototype.listsLoaded, this); } ViewModel.prototype.listsLoaded= function () { if (this.workout.loaded() &amp;&amp; this.diet.loaded() &amp;&amp; this.feedback.loaded()) { this.loadSuggestedWorkouts(); } } ViewModel.prototype.getWorkout = function () { ... } ViewModel.prototype.getDiet = function () { ... } ViewModel.prototype.getFeedback = function () { ... } ViewModel.prototype.loadSuggestedWorkouts = function () { ... }
downvote count: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28841975
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/62775779
has text: You better add `@inner` or type definition will have `global` scope in the documentation. +1
score: 3
comment on: http://stackoverflow.com/a/28763616
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46010808
score: 1
has text: where is the array? I don't see the array `contentHeight`.
comment on: http://stackoverflow.com/q/28874173
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46013771
comment on: http://stackoverflow.com/q/28875766
score: 0
has text: What do you think `this` represents? It's `gotoPage()`, not a DOM element as you seem to be thinking. So `$(this)` wraps the function itself, which has no `role` attribute. I think this code just can't work as you intend it to.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45790476
comment on: http://stackoverflow.com/a/28754031
score: 0
type: Comment
has text: Selected you as the right answer as it's the most elegant solution
type: AnswerComment

http://stackoverflow.com/comment/46063328
type: QuestionComment
comment on: http://stackoverflow.com/q/28901778
has text: Yes, its a valid xml file. sorry i am very new to this..how would i accomplish this task of adding data from an xml file into a already made table in html if not document.write?
score: 0
type: Comment

http://stackoverflow.com/a/28826828
has body: With your markup this becomes more convoluted than it needs to be. $(document).on("click", ".checkbox-inline :checkbox", function () { var $nextTextbox = $(this).closest("div").next("div").find(":text").first(); if (this.checked) { $nextTextbox.prop("required", true).after('*'); } else { $nextTextbox.prop("required", false).next('.required-indicator').remove(); } }); Notes This approach uses event delegation. There are no IDs involved, because I suppose you need the same thing more than once on your page. Tying it to a specific element ID is counter-productive. This approach relies on the specific document structure from your sample Grails template. If you want something more flexible and easier-to-read, change your HTML. This applies to all checkboxes that have a text field in the immediately following . Use CSS classes on your elements to filter it/make it apply to specific ones only. If there is no immediately following with a text box, the function does nothing. $(this).is(":checked") is superfluous. You don't need jQuery to find out if the current DOM element is checked. this.checked is a lot simpler and has the same effect. Don't use inline event handlers (onclick="..."). Ever. See it in action: $(document).on("click", ".checkbox-inline :checkbox", function () { var $nextTextbox = $(this).closest("div").next("div").find(":text").first(); if (this.checked) { $nextTextbox.prop("required", true).after('*'); } else { $nextTextbox.prop("required", false).next('.required-indicator').remove(); } }); input[required] { background-color: #FFD1D1; } Checkbox Some Text Field Here
answers question: http://stackoverflow.com/q/28817728
accepted answer of: http://stackoverflow.com/q/28817728
has comment: http://stackoverflow.com/comment/45945707
has comment: http://stackoverflow.com/comment/45940901
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45982535
has comment: http://stackoverflow.com/comment/45946045
type: Answer
has comment: http://stackoverflow.com/comment/45942020
downvote count: 0
score: 1

http://stackoverflow.com/q/28880806
has body: Is it possible to trigger changes to CSS of an element that is completely unrelated to the hovered div? I have a CSS hover effect on a dropdown menu, that I also want to trigger the opacity of a div right at the bottom of the page to create a background overlay effect. This is the CSS I'm using: #overlay { background:rgba(0,0,0,0.5); position:absolute; top:120px; left:0; z-index:0; height:120%; width:100%; visibility:hidden; opacity:0; } #menu-main-menu li.menu-parent-item:hover ul.sub-menu, #menu-main-menu li.menu-parent-item:hover #overlay { visibility:visible; opacity:1; } The hover of the sub menu works fine, but the div #overlay is right at the bottom of the page, and doesn't get called when it's hovered. I've tried all kinds of alternatives such as :hover > #overlay, :hover + #overlay, but nothing seems to trigger it. I also can't seem to find a definitive answer to the question. Is it possible?
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/46023449
answer count: 3
has comment: http://stackoverflow.com/comment/46022963
upvote count: 1
has answer: http://stackoverflow.com/a/28881421
has comment: http://stackoverflow.com/comment/46024425
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28880900
tagged with: css
tagged with: hover
has title: Trigger completely separate div based on hover of other div
has comment: http://stackoverflow.com/comment/46024790
has comment: http://stackoverflow.com/comment/46023711
tagged with: overlay
has comment: http://stackoverflow.com/comment/46023751
downvote count: 1
has answer: http://stackoverflow.com/a/28881448
type: Question
has comment: http://stackoverflow.com/comment/46022973

http://stackoverflow.com/q/28781290
tagged with: if-statement
accepted answer: http://stackoverflow.com/a/28781369
tagged with: javascript
has comment: http://stackoverflow.com/comment/45839388
linked to: http://stackoverflow.com/q/4216869
answer count: 1
downvote count: 0
favorite count: 0
has body: I think the problem is really simple, but I'm not seeing it. I just want to move the "ball" to the left 132.5px when I click the "dice" and if the ball is 0px left. I think the if statement is wrong!! Can someone help me? var ball = document.getElementById('ball'); var dice = document.getElementById('dice'); function move() { if (ball.style.left === '0px') { ball.style.left = 132.5 + 'px'; } } dice.onclick = move;
has answer: http://stackoverflow.com/a/28781369
tagged with: semantics
tagged with: css
has comment: http://stackoverflow.com/comment/45839408
type: AnsweredQuestion
tagged with: equals
has comment: http://stackoverflow.com/comment/45839481
score: 1
has comment: http://stackoverflow.com/comment/45839562
upvote count: 1
has title: Javascript if statement if (ball.style.left === '0px') {
type: Question
has comment: http://stackoverflow.com/comment/45839461

http://stackoverflow.com/q/28815172
accepted answer: http://stackoverflow.com/a/28894769
score: 1
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/45902331
answer count: 1
has body: I have the following situation: I have a button. When clicked, a hidden form and submit button appears. The form is validated using the jQuery Validation plugin. In the submit handler, I want to submit the form using Ajax. My problem is, the code I wrote in the submit handler does not seem to execute. HTML page: First name: JavaScript file: $(document).ready(function() { $('#accountForm').hide(); $('#saveButton').hide(); $('#editInfoButton').on('click', function() { $('#accountForm').show(); $('#saveButton').show(); }); $('#accountForm').validate({ rules: //some rules submitHandler: function(form) { $.ajax({ type: 'POST', url: '/account/profile', data: $(form).serialize(), success: function(data, status, jqXHR) { //some stuff } }); return false; } }); }); When I click on the submit button, there is no POST-request send to /account/profile but a GET-request to /account?firstName=.... I don't really understand why this isn't working.
has comment: http://stackoverflow.com/comment/45902604
has comment: http://stackoverflow.com/comment/45902647
upvote count: 1
tagged with: forms
tagged with: jquery-validate
has comment: http://stackoverflow.com/comment/45902831
has comment: http://stackoverflow.com/comment/45902446
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Ajax submit in hidden form validation not executed
has answer: http://stackoverflow.com/a/28894769
tagged with: ajax
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45902692

http://stackoverflow.com/comment/45954975
score: 0
type: AnswerComment
type: Comment
has text: But what if we want to spy on it, like to make sure that the right property on ngModel is called?
comment on: http://stackoverflow.com/a/28840276

http://stackoverflow.com/q/28762672
tagged with: javascript
has comment: http://stackoverflow.com/comment/45805317
linked to: http://stackoverflow.com/q/6847697
score: 0
has comment: http://stackoverflow.com/comment/45804724
has title: node.js request returning object
answer count: 1
has body: it might be a stupid question already but my purpose of this is to return an object called user where I can then use properly. http node.js documentation is full of console.log but nothing mentioned about returning objects. this is my code (which is from the standard documentation) where I also tried to assign the user or return it in the end method but it always return false. var options= { host : 'localhost', port : 3000, path : '/users?userName=Rosella.OKon56', // the rest of the url with parameters if needed method : 'GET' // do GET }; callback = function(response) { var str = ''; //another chunk of data has been recieved, so append it to `str` response.on('data', function (chunk) { str += chunk; }); //the whole response has been recieved, so we just print it out here response.on('end', function () { //console.log(str); }); } var req = http.request(options, callback); req.end();
tagged with: request
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45804804
tagged with: http
type: Question
has comment: http://stackoverflow.com/comment/45804901
has comment: http://stackoverflow.com/comment/45804828
has answer: http://stackoverflow.com/a/28762714
accepted answer: http://stackoverflow.com/a/28762714

http://stackoverflow.com/q/28854819
has comment: http://stackoverflow.com/comment/45975827
has comment: http://stackoverflow.com/comment/45976130
has comment: http://stackoverflow.com/comment/45976051
has comment: http://stackoverflow.com/comment/45976438
has comment: http://stackoverflow.com/comment/45976582
has body: I've tried to load external html page on same server using jQuery .load() by clicking on div , but it just doesn't work ! I tried using examples of $.get or $.post from Jquery API website . but every time I found this error in my chrome console : Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. every correct answers on Stackoverflow also had same results . I know a little of JavaScript,Jquery and php . can somebody help me out here ? Extra Notes : I've also tested my codes in XAMP local server ; I've tried many ways , the last time my code was : link1 new: I tested the same code in online free webhost and it just worked there ! I still cand understand the reason why it didnt work in xamp server !
has comment: http://stackoverflow.com/comment/45975841
answer count: 0
score: 0
has title: cant load external page using ajax or jquery
has comment: http://stackoverflow.com/comment/45975732
has comment: http://stackoverflow.com/comment/45976194
has comment: http://stackoverflow.com/comment/45976542
has comment: http://stackoverflow.com/comment/45976110
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45975704
has comment: http://stackoverflow.com/comment/45975989
tagged with: get
has comment: http://stackoverflow.com/comment/45976216
has comment: http://stackoverflow.com/comment/45976186
has comment: http://stackoverflow.com/comment/45975895
has comment: http://stackoverflow.com/comment/45976431
has comment: http://stackoverflow.com/comment/45976306
tagged with: jquery
has comment: http://stackoverflow.com/comment/45975667
tagged with: ajax
has comment: http://stackoverflow.com/comment/45976401
type: Question
has comment: http://stackoverflow.com/comment/45975881

http://stackoverflow.com/comment/45947914
comment on: http://stackoverflow.com/q/28839091
type: Comment
has text: @below9k also how to fetch there field?
type: QuestionComment
score: 0

http://stackoverflow.com/comment/46028418
type: Comment
comment on: http://stackoverflow.com/a/28880275
score: 0
has text: Thnak you so much. After posting question I have done something similar: `if(count == 5){div.style.display = 'none';}`.
type: AnswerComment

http://stackoverflow.com/q/28855900
favorite count: 0
has answer: http://stackoverflow.com/a/49670690
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28861616
has title: Get the Trim Area of a PDF with PDF.js?
downvote count: 0
score: 1
type: Question
has body: I'm playing about with PDF.js, and can't seem to find a solution to my problem. I have a PDF with a trim area and bleed, I need to get the trim area so that I can crop the PDF image data in HTML canvas. I see that Acrobat has javascript that can return the Trim based on getPageBox("Trim"). Is there any equivalent in PDF.js? I cant seem to find a reference when inspecting the Javascript PDF Object in the console.
tagged with: javascript
tagged with: pdf.js
answer count: 3
has answer: http://stackoverflow.com/a/42348268
upvote count: 1
tagged with: http://stackoverflow.com/tag/pdf
tagged with: http://stackoverflow.com/tag/html

c#
tags question: http://stackoverflow.com/q/28865246
tags question: http://stackoverflow.com/q/28767509
tags question: http://stackoverflow.com/q/28876104
tags question: http://stackoverflow.com/q/28786347
tags question: http://stackoverflow.com/q/28814735
tags question: http://stackoverflow.com/q/28816450
tags question: http://stackoverflow.com/q/28828372
tags question: http://stackoverflow.com/q/28818229
tags question: http://stackoverflow.com/q/28903466
tags question: http://stackoverflow.com/q/28899685
tags question: http://stackoverflow.com/q/28878365
tags question: http://stackoverflow.com/q/28887795
tag name: c#
tags question: http://stackoverflow.com/q/28827196
tags question: http://stackoverflow.com/q/28875097
tags question: http://stackoverflow.com/q/28811684
tags question: http://stackoverflow.com/q/28872104
tags question: http://stackoverflow.com/q/28849660
tags question: http://stackoverflow.com/q/28759095
tags question: http://stackoverflow.com/q/28791690
tags question: http://stackoverflow.com/q/28818584
tags question: http://stackoverflow.com/q/28844485
tags question: http://stackoverflow.com/q/28812984
tags question: http://stackoverflow.com/q/28859238
tags question: http://stackoverflow.com/q/28903127
tags question: http://stackoverflow.com/q/28837375
tags question: http://stackoverflow.com/q/28840991
tags question: http://stackoverflow.com/q/28875861
tags question: http://stackoverflow.com/q/28758621
tags question: http://stackoverflow.com/q/28849600
tags question: http://stackoverflow.com/q/28822131
tags question: http://stackoverflow.com/q/28900186
tags question: http://stackoverflow.com/q/28805977
tags question: http://stackoverflow.com/q/28842591
tags question: http://stackoverflow.com/q/28851282
tags question: http://stackoverflow.com/q/28752690
tags question: http://stackoverflow.com/q/28859894
tags question: http://stackoverflow.com/q/28886230
tags question: http://stackoverflow.com/q/28763810
tags question: http://stackoverflow.com/q/28883433
tags question: http://stackoverflow.com/q/28835933
tags question: http://stackoverflow.com/q/28829359
tags question: http://stackoverflow.com/q/28773523
tags question: http://stackoverflow.com/q/28833406
tags question: http://stackoverflow.com/q/28904217
tags question: http://stackoverflow.com/q/28847204
tags question: http://stackoverflow.com/q/28765472
tags question: http://stackoverflow.com/q/28779158
tags question: http://stackoverflow.com/q/28803157
tags question: http://stackoverflow.com/q/28885498
tags question: http://stackoverflow.com/q/28880027
tags question: http://stackoverflow.com/q/28848382
tags question: http://stackoverflow.com/q/28757956
tags question: http://stackoverflow.com/q/28829747
tags question: http://stackoverflow.com/q/28828373
type: Tag
tags question: http://stackoverflow.com/q/28832368
tags question: http://stackoverflow.com/q/28788594
tags question: http://stackoverflow.com/q/28832343
tags question: http://stackoverflow.com/q/28885207
tags question: http://stackoverflow.com/q/28836763
tags question: http://stackoverflow.com/q/28806818
tags question: http://stackoverflow.com/q/28842422
tags question: http://stackoverflow.com/q/28753183
tags question: http://stackoverflow.com/q/28887801
tags question: http://stackoverflow.com/q/28758180
tags question: http://stackoverflow.com/q/28900125
tags question: http://stackoverflow.com/q/28880967
tags question: http://stackoverflow.com/q/28864638
tags question: http://stackoverflow.com/q/28813842

http://stackoverflow.com/q/28767293
tagged with: ionic-framework
type: Question
tagged with: mobile
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28767363
score: 0
has body: Please forgive me for my little knowledge about this, but I have just started using Ionic to develop a hybrid app. Ideally i wanted to use my own javascript and so far it doesn't seem to work. Is this a conflict with Angular? I want my own external JS file so I can handle what happens with inputs and don't want to use Angular. Any info would be appreciated. As to what doesn't work, i'm trying to use innerHTML to replace a value on page load and it seems to load in before the DOM so I get an error in the console. Tried moving the placement of the external js file reference but still doesn't work.
has answer: http://stackoverflow.com/a/28767363
tagged with: angularjs
has title: Ionic and AngularJS
type: AnsweredQuestion

http://stackoverflow.com/q/28858767
type: Question
duplicate of: http://stackoverflow.com/q/3163407
has answer: http://stackoverflow.com/a/28858879
tagged with: javascript
tagged with: inheritance
has comment: http://stackoverflow.com/comment/45983939
has title: JavaScript && notation in Object Creation
has body: My question is on the following expression: var prototype = Object.create(extend &amp;&amp; extend.prototype); I think it's creating the prototype object inheriting the extend object. And extend &amp;&amp; extend.prototype is checking to see if extend exists and extend.prototype exists. If either one doesn't exist, prototype will be a object without superclass. And if both exist, prototype will inherit extend? How does it know to use extend.prototype with extend &amp;&amp; extend.prototype syntax? So var prototype = Object.create(extend &amp;&amp; extend.prototype) and var prototype = Object.create(extend.prototype) are the same if both extend and extend.prototype are there? Thanks.
score: 0
has comment: http://stackoverflow.com/comment/45983494
answer count: 1
has comment: http://stackoverflow.com/comment/45983635
has comment: http://stackoverflow.com/comment/45983543
type: AnsweredQuestion
tagged with: object
has comment: http://stackoverflow.com/comment/46005009
linked to: http://stackoverflow.com/q/3163407
accepted answer: http://stackoverflow.com/a/28858879

http://stackoverflow.com/tag/pdf
tags question: http://stackoverflow.com/q/28874940
tags question: http://stackoverflow.com/q/28862778
tags question: http://stackoverflow.com/q/28764174
tags question: http://stackoverflow.com/q/28804890
tags question: http://stackoverflow.com/q/28887795
type: Tag
tag name: pdf
tags question: http://stackoverflow.com/q/28874605
tags question: http://stackoverflow.com/q/28895539
tags question: http://stackoverflow.com/q/28774397
tags question: http://stackoverflow.com/q/28812349
tags question: http://stackoverflow.com/q/28855900
tags question: http://stackoverflow.com/q/28789788
tags question: http://stackoverflow.com/q/28806904

http://stackoverflow.com/a/28890926
answers question: http://stackoverflow.com/q/28886840
score: 0
accepted answer of: http://stackoverflow.com/q/28886840
type: Answer
has comment: http://stackoverflow.com/comment/46060799
has comment: http://stackoverflow.com/comment/46051181
has body: Just refactor the code a bit - Extract the lines which draws the circle into a single function which takes one of those circle objects as an argument: function drawCircle(circle) { context.beginPath(); context.arc(circle.x, circle.y, circle.radius, 0, 2 * Math.PI, false); context.fillStyle = 'green'; context.fill(); context.lineWidth = lineWidth; context.strokeStyle = '#003300'; context.stroke(); } Then replace those lines which they came from originally, in the loop with this line (after the circle object has been pushed): drawCircle(circles[circles.length-1]); // draw last added circle Now you can use this function in your click events by modifying the code (here, it toggles text on and off): if (context.isPointInPath(x, y)) { if (circle.clicked) { drawCircle(circle); // now we can reuse this function to clear the text circle.clicked = false; } else { circle.clicked = true; context.fillStyle = "blue"; context.font = "bold 34px Arial"; context.textAlign="center"; context.fillText("Yeah", circle.x, circle.y); } break; } Modified fiddle Just a note with this approach: this will redraw the circles on top of each other. Over time the lines will start to look jaggy due to the added anti-aliasing on the edges. For this reason a full clear of the canvas is better, and then redraw them all. But I'll leave that as an exercise for you.. :-)
has comment: http://stackoverflow.com/comment/46051596
type: AcceptedAnswer

ng-bind
tags question: http://stackoverflow.com/q/28753083
tag name: ng-bind
type: Tag

algorithm
tags question: http://stackoverflow.com/q/28866321
tag name: algorithm
tags question: http://stackoverflow.com/q/28781265
tags question: http://stackoverflow.com/q/28750724
tags question: http://stackoverflow.com/q/28820906
type: Tag
tags question: http://stackoverflow.com/q/28785863
tags question: http://stackoverflow.com/q/28879269
tags question: http://stackoverflow.com/q/28884773

http://stackoverflow.com/comment/45913176
comment on: http://stackoverflow.com/q/28820656
has text: `Array.map` as well as `forEach` calls a function for each element. Try replacing that with a for loop.
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28797336
type: Answer
has comment: http://stackoverflow.com/comment/45884316
has body: That's a 404 error being returned from your server: you sent the request to the wrong URL. Examine the request you've sent on your browser's deverloper console's network tab (it'll probably show up in red, because it was unsuccessful)
has comment: http://stackoverflow.com/comment/45873935
has comment: http://stackoverflow.com/comment/45880569
score: 0
has comment: http://stackoverflow.com/comment/45873712
answers question: http://stackoverflow.com/q/28797317
has comment: http://stackoverflow.com/comment/45874092

http://stackoverflow.com/a/28860287
type: Answer
answers question: http://stackoverflow.com/q/28852886
upvote count: 2
downvote count: 1
has comment: http://stackoverflow.com/comment/45993853
has comment: http://stackoverflow.com/comment/46068822
score: 1
has comment: http://stackoverflow.com/comment/45988472
has body: The automation values are not exposed in the .value attribute. See computation of value, bullet item 1.
has comment: http://stackoverflow.com/comment/45995804

http://stackoverflow.com/q/28851318
has title: Change color of an HTML page
has body: I want to add a new feature in my HTML page.It is a responsive page. I am using bootstarp css and js .Now I want to change the color of page , that means ,the user select a background color or text color , the page color is changed automatically. Example link I don't know how to apply this.I need a plugin or something like that. Anyone please help me.
score: -1
type: Question
has answer: http://stackoverflow.com/a/28852027
has answer: http://stackoverflow.com/a/28851947
tagged with: javascript
tagged with: jquery
favorite count: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
tagged with: plugins
tagged with: css
has answer: http://stackoverflow.com/a/28852082
type: UnansweredQuestion
downvote count: 2
upvote count: 1

http://stackoverflow.com/comment/45879500
type: Comment
has text: usually, i'm using firebug addon in Firefox browser to check javascript compiled (including ajax req-param-response-status).
comment on: http://stackoverflow.com/a/28802651
score: 0
type: AnswerComment

http://stackoverflow.com/q/28813527
has title: for loop inside another for loop javascript (jquery)
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28813679
has body: I have this select options color: HTML: select color: Red Blue Green Black I want to make a for loop javascript for this 4 lines that used for hide option that have value <= 0 JS: $('option#red').attr("hidden", true); $('option#blue').attr("hidden", true); $('option#green').attr("hidden", true); $('option#black').attr("hidden", true); I try to make for loop for above code. JS: //TO HIDE SELECT COLOR THAT DOSE NOT HAVE A VALUE //color values red= -1; blue=9; green= -4; black=3; //red and green must be hide because it's less than 0 color_value = [red,blue,green,black]; for(var $x=0 ; $x < color_value.length ; $x++){ //first for loop color_str=['red','blue','green','black']; for(var $j=0 ; $j < color.length ; $j++){ //second for loop ids = "option#"+color[$j]; if (color_value[$x] <= 0){ $(ids).attr("hidden", true); } } } You can see it on jsfiddle
has comment: http://stackoverflow.com/comment/45898959
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
score: 0
accepted answer: http://stackoverflow.com/a/28813783
has comment: http://stackoverflow.com/comment/45899003
has answer: http://stackoverflow.com/a/28813679
favorite count: 0
has answer: http://stackoverflow.com/a/28813783
upvote count: 1
downvote count: 1

http://stackoverflow.com/q/28840455
has title: Catching variable in ajax response url without refreshing Bootstrap (3) modal?
has comment: http://stackoverflow.com/comment/45950217
tagged with: javascript
has body: I have a login script and I am using bootstrap modal for login form. It works fine except i am unable to catch the value of a php var, this is sent as a response when the form is submitted. http://localhost/clock/index.php?f=4 I would like to be able to catch value of f4 in my modal which I am not able to. how can i do this ? Edited: Javascript/Jquery code to send ajax request $(document).ready(function(){ $('#csignin').click(function(){ $("#myModal-signin").modal('show'); }); $('#csignup').click(function(){ $("#myModal-signup").modal('show'); }); $('#loginForm').on("submit", function (e) { e.preventDefault(); //alert('submitting'); $.ajax({ type: "POST", url: 'usr/login_process.php', data: $('#loginForm').serialize(), dataType: 'text', timeout: 5000, success: function(data) { //success msg //alert(data); $(".signin-msg").html("&lt;?php if (isset($_SESSION['f'])) { switch ($_SESSION['f']) { default: break; case 0: echo LOGIN_NOT_ACTIVE_USER; break; case 1: echo LOGIN_USER_BLOCKED; break; case 2: echo LOGIN_PASSWORDS_NOT_MATCHED; break; case 3: echo LOGIN_NO_TRIES; break; case 4: echo LOGIN_USER_INFO_MISSING; break; case 5: echo LOGIN_NOT_ACTIVE_ADMIN; break; } } ?&gt;").css("color", "red"); } }); }); }); this is PHP code sends response to ajax call (http://localhost/clock/index.php?f=4) if (isset($_POST['process'])) { // Try to login the user if ($qls-&gt;User-&gt;login_user()) { $qls-&gt;redirect($qls-&gt;config['login_redirect']); } else { $_SESSION['f']=$qls-&gt;User-&gt;login_error; $qls-&gt;redirect('../index.php?f=' . $qls-&gt;User-&gt;login_error); } } else { $qls-&gt;redirect('../index.php'); } I would like to catch the var f sent by php in the modal box to show the appropriate error message. I would appreciate any help.
score: 0
has comment: http://stackoverflow.com/comment/45952912
tagged with: jquery
tagged with: ajax
tagged with: php
answer count: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion
type: Question

http://stackoverflow.com/comment/45897084
type: QuestionComment
has text: Nope, this is a fixable bug with your own code. Calling `setInterval()` from a function that is itself triggered by `setInterval()` is probably not what you want to do.
score: 2
comment on: http://stackoverflow.com/q/28812565
type: Comment

http://stackoverflow.com/comment/46009292
score: 0
type: Comment
type: QuestionComment
has text: and which plugin are you using for making the checkbox list
comment on: http://stackoverflow.com/q/28873256

http://stackoverflow.com/comment/46806428
has text: I needed the full width only, so `canvas[resize] { width: 100%; height: 600px; }` did it for me. Thanks!!! (I'm using Paper.js 0.9.22)
comment on: http://stackoverflow.com/a/29103200
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45931463
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28805003
has text: So why didn't you say so? ;-) Anyway, assuming you are using HTML (or alike) - all you need to do is provide a link to the file you want to make available for download... e.g. Download

http://stackoverflow.com/comment/46061082
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28900010
has text: Path at my local: C:/xampp/htdocs/THEMEFOREST/Theme_1/js Path on server: www.e-plus.com.pl/mateusz(this is my website directory)/js I tried to do src="/js/..." but then even on my local server charts are missing :/
score: 0

http://stackoverflow.com/q/28882791
score: 0
has answer: http://stackoverflow.com/a/28883126
tagged with: django
has title: Django running a javascript function imported from parent, called by the child
has comment: http://stackoverflow.com/comment/46026904
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46027772
accepted answer: http://stackoverflow.com/a/28883126
type: Question
has body: I have a javascript file in an outside folder under static. My index.html is not running the javascript function that was imported from base.html. File path: -- project -- app -- templates -- app name -- index.html -- src -- static -- hello_world.js -- templates -- base.html View page source from browser Home Register Login Welcome to WAM's board 2 player board games! Base.html {% block doctype %} {% endblock %} {% block head %} {% load staticfiles %} {% endblock %} {% block navbar %} Home {% if user_logged_in %} Upload Challenge User Logout of {{ user_name }} {% else %} Register Login {% endif %} {% endblock %} {% block content %}{% endblock %} index.html {% extends "base.html" %} {% block navbar %}{{ block.super }}{% endblock %} {% block content %} Welcome to WAM's board 2 player board games! {% endblock %}
answer count: 1
tagged with: javascript
tagged with: inheritance

http://stackoverflow.com/a/28811372
has body: Best example of REST API is github api example of merge a pull request (Merge Button): PUT /repos/:owner/:repo/pulls/:number/merge The main goal is using resources instead a commands. For example: REST: PUT /repos/:owner/:repo/pulls/:number/merge {"commit_message":"mesg"} NO-REST: POST /merge {"commit_message": "mesg", "owner": 123, "repo":"asd", "number": 1} Cheers
score: -1
downvote count: 1
type: Answer
upvote count: 0
answers question: http://stackoverflow.com/q/28811129

http://stackoverflow.com/a/28782906
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45842541
has body: the console.log is outside the callback. so that it's undefined. Put it in the callback. var collection = req.db.get('myCollection'); collection.find( { foo: 'bar' },{ fields : { myTargetField: 1, _id: 0}, limit : 1, sort : {$natural : -1} } , function(err, doc) { if (err) { console.log(err); } var variableIWantToSet = doc[0].myTargetField; console.log(variableIWantToSet); }); for making it easier to understand : //The callback function will be call after the mongodb response right value. var callback = function(err, doc) { if (err) { console.log(err); } variableIWantToSet = doc[0].myTargetField; console.log(variableIWantToSet); // return doc[0].myTargetField; }; var variableIWantToSet; var collection = req.db.get('myCollection'); collection.find( { foo: 'bar' },{ fields : { myTargetField: 1, _id: 0}, limit : 1, sort : {$natural : -1} } , callback); console.log(variableIWantToSet); // return undefined; if you don't understand about callback, google it, it's the basic of asynchronous programming, which makes javascript different.
type: Answer
accepted answer of: http://stackoverflow.com/q/28782783
answers question: http://stackoverflow.com/q/28782783
score: 0

http://stackoverflow.com/a/36748339
type: Answer
downvote count: 0
has body: Since its a sharepoint code try running this: SP.SOD.executeFunc("SP.js","ClientContext",functionName) This ensures that the specified file (sp.js) that contains the specified function (ClientContext) is loaded and then runs the specified callback function name. Realize that SharePoints _spPageContextInfo is being used before it gets auto initialized
answers question: http://stackoverflow.com/q/28828286
score: 5
has comment: http://stackoverflow.com/comment/75044188
upvote count: 5

http://stackoverflow.com/a/28834145
downvote count: 0
has comment: http://stackoverflow.com/comment/129302915
has body: Unfortunately there is no easy solution in this situation. The only one way you can do it is to subscribe to editor's drop event, and cancel it if needed, like: editor.on('contentDom', function() { var editable = editor.editable(), // #11123 Firefox needs to listen on document, because otherwise event won't be fired. // #11086 IE8 cannot listen on document. dropTarget = (CKEDITOR.env.ie &amp;&amp; CKEDITOR.env.version &lt; 9) || editable.isInline() ? editable : editor.document; editable.attachListener(dropTarget, 'drop', function(evt) { //do all checks here }); }); You can find how it works in CKEditor (See code of function setupDragAndDrop)
has comment: http://stackoverflow.com/comment/45990586
type: Answer
accepted answer of: http://stackoverflow.com/q/28832967
answers question: http://stackoverflow.com/q/28832967
score: 3
upvote count: 3
type: AcceptedAnswer

http://stackoverflow.com/a/28791667
type: Answer
answers question: http://stackoverflow.com/q/28791480
has body: Hi I created listing for you, review it: link here new You have a next issue, you work almost good, you have just one issue: when you return your output value it returns it like an value, but if you want to keep connection between output and new apple variable you should return it like an object in this case it will be returned not like an value but like a link to the object.
has comment: http://stackoverflow.com/comment/45858655
has comment: http://stackoverflow.com/comment/45873074
has comment: http://stackoverflow.com/comment/45882716
has comment: http://stackoverflow.com/comment/45858707
score: 0
has comment: http://stackoverflow.com/comment/45858911
has comment: http://stackoverflow.com/comment/45859219

http://stackoverflow.com/comment/45824025
type: QuestionComment
comment on: http://stackoverflow.com/q/28772796
score: 1
type: Comment
has text: Sorry to be that guy, but have you tried changing the route names and seeing if it works?

http://stackoverflow.com/comment/46051648
type: Comment
comment on: http://stackoverflow.com/q/28889943
has text: @VinothKrishnan Thank you for your answer. What tutuorial do you recomend?
score: 0
type: QuestionComment

http://stackoverflow.com/a/28824293
answers question: http://stackoverflow.com/q/28824199
has comment: http://stackoverflow.com/comment/45919703
has body: You have to start the session (session_start) in logout page also.. Did you do it ?
has comment: http://stackoverflow.com/comment/45919695
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28824199
score: 0
type: Answer

http://stackoverflow.com/comment/45880665
has text: Check this, please: http://stackoverflow.com/questions/6027525/how-do-i-accomplish-an-if-else-in-mustache-js
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28802932

http://stackoverflow.com/q/28777440
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28777766
has comment: http://stackoverflow.com/comment/45832996
favorite count: 0
has comment: http://stackoverflow.com/comment/45833118
upvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45833075
downvote count: 3
has body: I am currently struggling on this project, as I have no idea what goes where and through the various searches online, I get different answers so the code I have currently have most likely is no where near correct. The multiplication table goes 1 - 10 and shows multiplication answers up to 5. (1x1 = 1, 1x2 = 2, all the way up to 5x10, if that makes sense) I need a correct example of my code. Multiplication Tables Enter a number below to see its multiplication table. Click Me
has answer: http://stackoverflow.com/a/28777766
has title: How to make a simple 5 line JavaScript Multiplication table for loop
type: Question
has comment: http://stackoverflow.com/comment/45833302
score: -2
answer count: 1

http://stackoverflow.com/q/28862715
has body: I have the following code to get the results of a query. The query results are in the form of JSON. $.ajax({ url: ..... //url//..., contentType: "application/json; charset=utf-8", data: JSON.stringify({ "type": "daysofyear", "entity": { "year": "2015" } }), type: "POST", dataType: "json", success: function(result) { if ((result) &amp;&amp; (result.isSuccess == true)) { alert("SUCCESS"); alert(json.entity.day); } }, }); The returned JSON is: { "isSuccess": true, "results": [{ "jsonClass": "RuleSuccess", "message": "Found mapping for year: 2015", "rule": { "name": "Year rule", "metadata": {} }, "entity": { "year": "2015", "month": "December", "day": "Saturday" } }] } Im basically trying to extract the value of month, year, day separately and display them alone using alert(json.entity.day); Please advice.
accepted answer: http://stackoverflow.com/a/28862777
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/11922383
has comment: http://stackoverflow.com/comment/45990674
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45990922
has answer: http://stackoverflow.com/a/28862792
duplicate of: http://stackoverflow.com/q/11922383
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45991314
possible better answer: http://stackoverflow.com/a/28862792
has title: How to extract a JSON object from the resulting JSON array?
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28862777
tagged with: jquery

http://stackoverflow.com/comment/45804695
type: Comment
has text: `app.model('Categories').findAll()` is the string itself. It will return an array with objects. The idea is to simulate something like https://docs.angularjs.org/api/ng/directive/ngRepeat
comment on: http://stackoverflow.com/a/28762510
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46020243
has text: Just do your homework kid. It has nothing to do with Deferred you are getting 'undefined' value from start() there should be something fishy in your console when you run that.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28878963
score: 0

http://stackoverflow.com/q/28828483
tagged with: javascript
tagged with: http://stackoverflow.com/tag/r
score: 0
tagged with: shiny
has answer: http://stackoverflow.com/a/28832469
has comment: http://stackoverflow.com/comment/45928438
has comment: http://stackoverflow.com/comment/45931111
has title: How can I hide an actionbutton in Shiny using Javascript
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28832469
has body: I am quite a rookie when it comes to shiny. Here in my app I require to hide a button when I click it, and here I am bringing in JS to get that effect, but I am unable to get it as the buttons don't show up when I run the app. the following is the code I use. ui.R shinyUI( fluidPage( titlePanel("Conditional panels"), column(3, wellPanel( a<-actionButton("action", label="Action"), br(), br() )), column(4, "This will show the button", "when we click action.", conditionalPanel("input.action > 0", a1<- actionButton("show1", label="Show_1"), a2<-actionButton("show2", label="Show_2"), tags$script('document.getElementById("action").style.visibility="hidden";')) ) )) It is a bit confusing. Are there any method other than conditionalPanel which I can explore? Do I also need an extra configuration in server.R Kindly Help.
answer count: 1

http://stackoverflow.com/a/40257522
upvote count: 2
answers question: http://stackoverflow.com/q/28779631
downvote count: 0
has body: I see that you are using Stripe. They offer a nice plugin that will do exactly what you are looking for. Note that you can use this plugin without using Stripe: https://github.com/stripe/jquery.payment And if you are looking for a pure javascript and light version, I created one that will support the American Express format (15 digits) as well as Visa, MasterCard and others (16 digits): https://stackoverflow.com/a/39804917/1895428 Watch out for the simple solutions that will replace the whole value and always put the focus at the end of the input: it can be annoying if the user edits what he previously entered.
type: Answer
score: 2

http://stackoverflow.com/q/28778189
has answer: http://stackoverflow.com/a/28778217
has answer: http://stackoverflow.com/a/28778237
has answer: http://stackoverflow.com/a/28778458
score: 0
answer count: 3
accepted answer: http://stackoverflow.com/a/28778458
tagged with: javascript
tagged with: web
has body: I was writing some code and for some reason that I am unaware of, whenever I click on the button, the function that it is assigned does not run. Does anybody know why? Thanks in advance. Your Number: Click "Got my number" to find out!. Got my number
tagged with: http://stackoverflow.com/tag/html
has title: The code not working. I cannot identify the issue
type: AnsweredQuestion
type: Question
possible better answer: http://stackoverflow.com/a/28778217

http://stackoverflow.com/comment/45986990
comment on: http://stackoverflow.com/a/28857880
has text: @medBo: They don't if you let any user access them. Please engage the services of a professional or do a **lot** more study before you let users loose on this thing.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45963612
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28847758
score: 0
has text: I have seen the link but I am not able to add any input fields to the tooltip and also when i try to place mouse over tooltip content then tooltip get disappears .

http://stackoverflow.com/a/28769704
has comment: http://stackoverflow.com/comment/45818954
type: Answer
score: 0
upvote count: 1
downvote count: 1
has body: I would do it as soon as possible, and not when the document has been loaded. A flicker may be better than having the styles change after the page styles have already rendered. $('link[rel~="stylesheet"]').prop('disabled', true);
answers question: http://stackoverflow.com/q/28769567

http://stackoverflow.com/q/28896227
tagged with: google-maps-api-3
has comment: http://stackoverflow.com/comment/46063030
answer count: 1
has comment: http://stackoverflow.com/comment/46052830
favorite count: 0
has body: So, when I do this: &lt;!-- javascript file --&gt; function geocodeFromAdress(address) { geocoder = new google.maps.Geocoder(); geocoder.geocode( { 'address': address}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { var latLng = results[0].geometry.location; console.log(latLng.lat() + ", " + latLng.lng()); return latLng.lat() + ", " + latLng.lng(); } else { alert("Geocode was not successful for the following reason: " + status); } }); } &lt;!-- HTML view --&gt; &lt;script type="text/javascript"&gt; $(function(){ myOptions = { center: new google.maps.LatLng(geocodeFromAdress('Los Angeles')), zoom: 7, mapTypeId: google.maps.MapTypeId.ROADMAP }; Gmaps.map = new google.maps.Map($('.map')[0], myOptions); addFacilities(Gmaps.map); }); &lt;/script&gt; the map is not rendered, but if I do: &lt;script type="text/javascript"&gt; $(function(){ myOptions = { center: new google.maps.LatLng(34.0522342, -118.2436849), zoom: 7, mapTypeId: google.maps.MapTypeId.ROADMAP }; Gmaps.map = new google.maps.Map($('.map')[0], myOptions); addFacilities(Gmaps.map); }); &lt;/script&gt; then the maps is properly rendered. Why it doesn't accept the coordinations from the JS function? The output of the JS function: 34.0522342, -118.2436849 Thank you in advance.
has title: Google Maps API doesn't display map if the center is populated by a javascript function
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46053040
linked to: http://stackoverflow.com/q/23667086
downvote count: 1
has answer: http://stackoverflow.com/a/28897120
score: -1
has comment: http://stackoverflow.com/comment/46062353
type: Question
tagged with: google-maps
upvote count: 0
has comment: http://stackoverflow.com/comment/46052660
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/28813950
score: 1
answers question: http://stackoverflow.com/q/28780115
has body: It's hard to debug exactly what's going on without an example link. But if I had to guess... The default height of a &lt;div&gt; with no content is zero pixels. It's likely that what's happening is that your charts are being sized correctly horizontally, but they occupy no space vertically. The solution is to either add an explicit height: #graphdiv1, #graphdiv2 { height: 400px; } or otherwise give the &lt;div&gt;s some height.
upvote count: 1
type: Answer
downvote count: 0

http://stackoverflow.com/comment/45844697
score: 0
comment on: http://stackoverflow.com/a/28783303
type: Comment
type: AnswerComment
has text: Not quite-- the new view constructor needs to be extended from `gvCreator` (the other view constructor), not the view instance. Backbone view instances don't have an extend method. (See updated answer)

http://stackoverflow.com/comment/46066831
type: QuestionComment
comment on: http://stackoverflow.com/q/28903277
score: 0
type: Comment
has text: Ah yes thank you! managed to get it working

http://stackoverflow.com/a/28912739
type: Answer
answers question: http://stackoverflow.com/q/28831912
accepted answer of: http://stackoverflow.com/q/28831912
score: 0
type: AcceptedAnswer
has body: Invented by myself. Notices: 1) clientRect is a square object, returned by Element.getBoundingClientRect(). 2) dialogs is an Array of objects that we need to place inside the square. (were just dialog windows in my case). I implemented the methods like setTop, setWidth, setLeft, setHeight, but you can use just element.style.top = top + 'px'; etc. function tileHorizontalDialogs(clientRect, dialogs) { var dialogsCount = dialogs.length; var top = clientRect.top; var left = clientRect.left; var XC = Math.floor(Math.sqrt(dialogsCount)); var YC = Math.floor(dialogsCount / XC); var w = clientRect.width / XC; var h0 = clientRect.height / YC; var h1 = clientRect.height / (YC + 1); var modulo = dialogsCount % XC; var firstExtendedColumnNumber = XC - modulo + 1; var d = 0; for (var hIterator = 1; hIterator &lt;= XC; hIterator++) { var h = 0; var vLimit = 0; if (hIterator &lt; firstExtendedColumnNumber) { vLimit = YC; h = h0; } else if (hIterator &gt;= firstExtendedColumnNumber) { vLimit = YC + 1; h = h1; } for (var vIterator = 1; vIterator &lt;= vLimit; vIterator++) { dialogs[d].setTop(top); dialogs[d].setLeft(left); dialogs[d].setWidth(w); dialogs[d].setHeight(h); top += h; d++; } top = clientRect.top; left += w; } }; function tileVerticalDialogs(clientRect, dialogs) { var dialogsCount = dialogs.length; var top = clientRect.top; var left = clientRect.left; var YC = Math.floor(Math.sqrt(dialogsCount)); var XC = Math.floor(dialogsCount / YC); var h = clientRect.height / YC; var w0 = clientRect.width / XC; var w1 = clientRect.width / (XC + 1); var modulo = dialogsCount % YC; var firstExtendedRowNumber = YC - modulo + 1; var d = 0; for (var vIterator = 1; vIterator &lt;= YC; vIterator++) { var w = 0; var hLimit = 0; if (vIterator &lt; firstExtendedRowNumber) { hLimit = XC; w = w0; } else if (vIterator &gt;= firstExtendedRowNumber) { hLimit = XC + 1; w = w1; } for (var hIterator = 1; hIterator &lt;= hLimit; hIterator++) { dialogs[d].setTop(top); dialogs[d].setLeft(left); dialogs[d…

http://stackoverflow.com/comment/45783966
has text: @Alex that, and if you're going to have that many conditionals you might want to leave a comment inside of them explaining what the condition means... and the variables could use some more descriptive names.
score: 0
comment on: http://stackoverflow.com/q/28750902
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28870377
downvote count: 1
type: Answer
upvote count: 0
answers question: http://stackoverflow.com/q/28870258
score: -1
has comment: http://stackoverflow.com/comment/46025875
has body: As @Rakesh_Kumar said, you need to catch it when you lose the focus of the input. This can be made by using the blur() function. You code then goes like this: $("input").blur(function(){ $.cookie("asofdate", $(this).val()); window.location.reload(); });

http://stackoverflow.com/q/28895591
has answer: http://stackoverflow.com/a/28898056
has comment: http://stackoverflow.com/comment/46051443
has comment: http://stackoverflow.com/comment/46051963
has comment: http://stackoverflow.com/comment/46051539
has comment: http://stackoverflow.com/comment/46051574
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46051325
upvote count: 1
has comment: http://stackoverflow.com/comment/46051346
type: Question
has comment: http://stackoverflow.com/comment/46051938
has comment: http://stackoverflow.com/comment/46051513
has comment: http://stackoverflow.com/comment/46051306
score: 1
has comment: http://stackoverflow.com/comment/46051876
has body: I have an array that has following values Nata_sha_AD8_02_ABA Jack_DD2_03_K Alex_AD8_01_PO Mary_CD3_03_DC John_DD2_01_ER Daniel_AD8_04_WS I want to group them based on following array ['AD8','CD3','DD2','PD0']; and sort each group based on number of each value. So the output should be Alex_AD8_01_PO Nata_sha_AD8_02_ABA Daniel_AD8_04_WS Mary_CD3_03_DC John_DD2_01_ER Jack_DD2_03_K So far, I wrote following code, but it does not work properly, and I am stuck here. var temparr = []; var order = 1000; var pos = -1; var temp = -1; var filterArray= ['AD8','CD3','DD2','PD0']; for (i =0; i&lt; filterArray.length; i++) { for (j =0; j &lt; myarray.length; j++) { if(filterArray[i].toUpperCase().search(myarray[j])&gt;0){ temp = str.substring(myarray[j].indexOf(filterArray[i])+4, myarray[j].indexOf(filterArray[i]+6); if(temp &lt; order){ pos = j; order = temp; } if(j == myarray.length-1){ //reached end of the loop temparr.push(myarray[pos]); order = 1000; } } } }
has comment: http://stackoverflow.com/comment/46051162
has comment: http://stackoverflow.com/comment/46051273
answer count: 3
has answer: http://stackoverflow.com/a/28895733
tagged with: arrays
downvote count: 0
has comment: http://stackoverflow.com/comment/46051392
tagged with: javascript
tagged with: sorting
has comment: http://stackoverflow.com/comment/46051213
favorite count: 0
has answer: http://stackoverflow.com/a/28895906
has comment: http://stackoverflow.com/comment/46056187
has title: How to sort an array based on values of another array?
has comment: http://stackoverflow.com/comment/46051103
has comment: http://stackoverflow.com/comment/46083723

http://stackoverflow.com/comment/45829332
score: 0
comment on: http://stackoverflow.com/q/28773900
type: Comment
type: QuestionComment
has text: The app is using MooTools but I have access to jQuery as well. I'd prefer not to use either and opt for a Vanilla JS solution.

http://stackoverflow.com/a/28776032
type: Answer
upvote count: 1
has body: Because it's empty, try to add some content between the div tags, or if you want to have a block like a button you have to change the CSS to: &lt;style&gt; #div{ background-color:black; width:50px; height:50px; } &lt;/style&gt;
answers question: http://stackoverflow.com/q/28775990
downvote count: 0
score: 1

http://stackoverflow.com/comment/45919886
has text: Please repost this using jsFiddle. Use this preconfigured fiddle as your basis: http://jsfiddle.net/joshdmiller/HB7LU/
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28824478

http://stackoverflow.com/comment/60724842
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28877001
type: QuestionComment
has text: I'm not sure why, but for me it works by requesting `https://fonts.googleapis.com/css?family=Font` instead of `https://fonts.googleapis.com/css?family=Font:100, 200,400,900`, my guess is that works because of less loading time. "fast enough" to load before `canvas`

http://stackoverflow.com/q/28778020
type: Question
answer count: 1
tagged with: javascript
score: 4
has title: angularjs show sidebar on some routes and hide in others
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/28778061
accepted answer: http://stackoverflow.com/a/28778061
upvote count: 4
type: AnsweredQuestion
has body: I'm trying to utilize ng-if to include side bar in some of my singlepage app pages and hide it from other. the html is : in above example ng-include loads the sidebar, and the id page-wrapper is used to add the extra margin on container for the sidebar, and the ng-view is where my view get loaded in. what i need to do is in somepages i dont want the sidebar to exists, like (in the login page for example) angular.module('exampleApp', ['ngRoute', 'ngResource', 'ngCookies']) //Routes .config(['$routeProvider', function($routeProvider) { $routeProvider. when('/login', { templateUrl: 'partials/login.html', controller: 'loginCtrl' }). when('/home', { templateUrl: 'partials/home.html', controller: 'homeCtrl' }). otherwise({ redirectTo: '/login' }); } ]) .controller('mainCtrl',function($rootScope,$window){ $rootScope.show = true; if($window.location.hash == '#/login'){ $rootScope.show = false; } }); my best solution that i cameup with was to add another ctrl to the page body and use ng-if and condition to add id to div. </sidebar> this worked fine.. yet when ever page changes.. this condition is not reapplied :( so if i opened #/login i can see there is no sidebar, yet once i move to /home the sidebar doesnot show either. can you please help ? i tried searching for hours with no success. thanks
downvote count: 0

http://stackoverflow.com/comment/45888780
comment on: http://stackoverflow.com/q/28808114
type: QuestionComment
type: Comment
has text: yes it is possible, thousand ways to rome
score: 1

http://stackoverflow.com/comment/45989584
has text: the dropdowns do populate and appear, the problem is they don't trigger the change event.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28862023

http://stackoverflow.com/a/30309180
accepted answer of: http://stackoverflow.com/q/28855356
answers question: http://stackoverflow.com/q/28855356
type: AcceptedAnswer
score: 0
has body: I've ended up doing a kind of preliminary parse on the URL. Using only ngRoute (ui-router wasn't an option...), I check if the path matches with the restrictions, if not, a redirect is triggered, defining correctly the path. Below, follows a snippet of the solution, for the primary route, and a simple subsequent example, due to the quantity of the routes on the app, and their specific data, that doesn't belongs to the basis idea: $routeProvider .otherwise({ redirectTo: function () { return '/404/'; } }) .when('/:i18n/', { redirectPath: '/:i18n/', templateUrl: 'home.html', controller: 'HomeCtrl', resolve: { i18n: [ '$location', '$route', 'i18nService', function ($location, $route, i18nService) { var params = $route.current.params; return i18nService.init(params.i18n) .then(null, function (fallback) { if (params.i18n === '404') { return $location.path('/' + params.i18n + '/404/').search({}).replace(); } $location.path('/' + fallback).search({}).replace(); }); } ], data: [ 'dataService', function (dataService) { return dataService.resolve(); } ] } }) .when('/:i18n/search/:search/', { redirectPath: '/:i18n/search/:search/', templateUrl: 'search.html', controller: 'SearchCtrl', resolve: { i18n: [ '$location', '$route', 'i18nService', function ($location, $route, i18nService) { var params = $route.current.params; return i18nService.init(params.i18n) .then(null, function (fallback) { $location.path('/' + fallback + '/search/').search({ search: params.search }).replace(); }); } ], data: [ '$route', 'searchService', function ($route, searchService) { var params = $route.current.params; return searchService.resolve({ 'search': params.search }); } ] } }); The redirectPath property is used in case of you need the pattern for that route, because ngRoute keeps one copy for private use, but doesn't give access to it with $route public properties. Due to the required parse before any app request (except the i18nService, which loads the locale list and triggers angular-translate to …
type: Answer

http://stackoverflow.com/q/28874910
type: AnsweredQuestion
tagged with: javascript
type: Question
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/28876050
has answer: http://stackoverflow.com/a/28876224
accepted answer: http://stackoverflow.com/a/28876224
has title: How to filter data with computed using both knockout data and "external" data
has body: Background: I'm in the process of moving javascript logic in a legacy system over to knockout to get more structure and having to write less code in the future. Due to time constraints I can only move parts of the code over to knockout between each deploy. Problem: Some of the data is generated by legacy code and some of the data is generated by knockout and I'm having problem with creating knockout logic to handle the following scenario (see below for code snippet and a JSFiddle link to the same code). The product radio buttons are not generated by knockout but the offer lists are. The key buttons to filter the offer lists works like I want them to, but I havn't managed to figure out how to get only the offers for product 1 listed under Product 1 and only offers for product 2 listed under Product 2. Anyone that could help? I assume that if the product headers were generated from the data in the knockout view model my problem wouldn't be so hard to solve, but as you can see this isn't the case. https://jsfiddle.net/b6er4wke/3/ function myViewModel() { var self = this; self.wrappedProducts = ko.observableArray(); self.availableOffers = ko.observableArray(); self.filterKey = ko.observable(1); filteredItems = ko.computed(function() { return ko.utils.arrayFilter(self.availableOffers(), function (offer) { var isCorrectKey = offer.key == self.filterKey(); return (isCorrectKey); }); }); self.filter = function(keyFilter) { self.filterKey(keyFilter); }; (function() { // Products self.wrappedProducts.push({"prod":"1"}); self.wrappedProducts.push({"prod":"2"}); // Offers self.availableOffers.push({"name": "offer1", "key": "1", "prod": 1}); self.availableOffers.push({"name": "offer2", "key": "2", "prod": 1}); self.availableOffers.push({"name": "offer3", "key": "2", "prod": 2}); })(); } var viewModel = new myViewModel(); ko.applyBindings(viewModel); ul, h4 {margin-top: 0px; margin-bottom:0px;} label {font-weight:bold;} All products Available offers key1 key2 filterKey = Product …
tagged with: knockout.js
has answer: http://stackoverflow.com/a/28876050

http://stackoverflow.com/comment/94534559
score: 0
type: Comment
comment on: http://stackoverflow.com/a/37232294
has text: Any way you could look at this? https://stackoverflow.com/questions/53824495/express-subdomain-simple-setup-not-working
type: AnswerComment

http://stackoverflow.com/comment/45864331
has text: very helpful, that must be what I am looking for, will try it out! Thanks for a well explained answer, and for an alternative wat to add url. I think, that it suits me best to have url as the third argument, as I want different url's for my page. Otherwise I would only have 4 different url's, right? And for sharing pages, and navigating back and forward, it seems more logic to have different url's, so that people can navigate directly to the page if they i.e. bookmark it, or share to a friend. I can then look into changing title, and og:titles:) I will play around with it a bit :) Thanks!
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28793114

http://stackoverflow.com/q/28860864
has answer: http://stackoverflow.com/a/28860948
accepted answer: http://stackoverflow.com/a/28860953
has title: How to open a window in new tab with just href attribute?
type: Question
tagged with: href
possible better answer: http://stackoverflow.com/a/28860948
tagged with: javascript
score: -1
answer count: 2
has answer: http://stackoverflow.com/a/28860953
favorite count: 0
downvote count: 2
has comment: http://stackoverflow.com/comment/45987363
upvote count: 1
has body: Edit: The link above doesn't contain any answer that applies to this question. If the person who put it there actually read this question they would have realized this. What's my best option for opening a link in either a new tab or new window when I only have control over the href attribute of an anchor tag? We have a homegrown menu navigation system that someone before me built and it sets the href of the menu anchor links based on a url column in a database table. So I know there are much better ways to open a link in a new window than what I'm asking for and I wouldn't normally try this, but for now I just need to do it this way. I've tried using: javascript:window.open('http://www.goodwill.org') That does work for opening the link in a new tab, however it changes the current tab to be a blank page except for the text [object], which obviously defeats the purpose.
tagged with: anchor
type: AnsweredQuestion

http://stackoverflow.com/comment/79372574
comment on: http://stackoverflow.com/q/28751532
type: Comment
type: QuestionComment
has text: to auto-complete an address in a form field
score: 0

http://stackoverflow.com/comment/45817325
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28769119
type: Comment
has text: @Mateusz: I am very new to PHP. but I will surely try it. Do you have any useful stuff ?

http://stackoverflow.com/a/28884482
accepted answer of: http://stackoverflow.com/q/28881614
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/28881614
has body: Change your Date.now() to new Date(), looks like before you were storing time as integer. { gt: new Date() }

http://stackoverflow.com/comment/45835072
score: 3
comment on: http://stackoverflow.com/a/28776193
type: AnswerComment
type: Comment
has text: *"Defining a let variable globally leaves this open to interpretation"* As you can see from my answer, it does not. What you say is true, we really do have more things that create scope (modules as well), however, that alone does not answer the posed question.

http://stackoverflow.com/q/28892755
tagged with: javascript
type: UnansweredQuestion
has title: How to remove specific string from output?
score: -3
answer count: 2
upvote count: 0
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: node.js
has answer: http://stackoverflow.com/a/28904987
has answer: http://stackoverflow.com/a/28892845
tagged with: asterisk
downvote count: 3
has body: i have a node.JS script that prints the status of peers some how its prints undefined which is dont want to be printed on browser. It prints output as : undefined "Reachable" undefined undefined "Reachable" undefined undefined "Reachable" undefined. So is there any way in javascript though which i can remove the undefined from the output? My code for printing data is ` `

http://stackoverflow.com/q/28801812
has body: I have a Google Maps program written so that it will provide a string of coordinates for a polyline. Something like this: (-33.26165676732799, 150.8367919921875),(-33.51849923765609, 150.22705078125),(-34.139088373438476, 149.864501953125),(-34.99850370014628, 150.0567626953125),(-35.39352808136066, 149.315185546875),(-35.69745580725804, 149.9688720703125) I want to change all open parenthesis ( to the following: new google.maps.LatLng( with a line break in front if possible. I have tried using regular expressions, but It will only change the first instance. I want it to change all the instances of (. This is my last attempt: var polyPath = line.getPath().getArray().toString(); var re = /^\(/g; var polyPathFormatted = polyPath.replace(re,"new google.maps.LatLng("); The "g" or at the end is not changing all of the instances, just the first one. Any guidance will be appreciated.
upvote count: 0
answer count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: regex
has comment: http://stackoverflow.com/comment/45877366
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28801838
has title: Regular Expression to change all instances in a string
tagged with: javascript
score: -1

http://stackoverflow.com/q/28862765
tagged with: javascript
has title: Google Sheets - Get File Name from Hard Drive and Insert into Sheet - (Emulate Excel's Appication.GetOpenFilename)
has comment: http://stackoverflow.com/comment/45992711
score: 0
linked to: http://stackoverflow.com/q/21593249
has comment: http://stackoverflow.com/comment/45992878
accepted answer: http://stackoverflow.com/a/28864787
answer count: 1
favorite count: 0
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45993296
tagged with: filepicker
has body: In Excel I can run a VBA script with application.getopenfilename and am able to place the filepath of the items selected into that cell. I'm trying to convert my VBA Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) If Not Application.Intersect(Target, Range("AG4:AG910")) Is Nothing Then Dim FileNames As Variant Dim Msg As String Dim i As Integer FileNames = Application.GetOpenFilename(MultiSelect:=True) If IsArray(FileNames) Then For i = LBound(FileNames) To UBound(FileNames) Msg = Msg &amp; FileNames(i) &amp; vbNewLine Next i Target = Msg Else MsgBox "No files were selected." End If End If Basically I want to be be able to select images and then get the filenames. I only need the filenames because the clients send me the product pics which I have to then optimize before uploading.
has comment: http://stackoverflow.com/comment/45991100
has answer: http://stackoverflow.com/a/28864787
tagged with: file
upvote count: 1
downvote count: 1
type: Question
tagged with: google-apps-script
tagged with: google-sheets

http://stackoverflow.com/q/28783933
has answer: http://stackoverflow.com/a/28784003
accepted answer: http://stackoverflow.com/a/28784003
upvote count: 1
answer count: 1
tagged with: jquery
favorite count: 0
type: AnsweredQuestion
downvote count: 0
score: 1
has body: I'm trying to use jquery to get the closest element to an input field so I can use the element's text/html as the value of the input field. my jquery looks like this: jQuery("[name=currencies]").val(Currency.currentCurrency).change(function() { $(".moneyPrice").val($("span.money").text()); }); the span.money and its text is being created dynamically. the code above works in a way but it will put all the span.money in the input fields. what I am trying to do is to get the closest span.money to each input fields and put its text in that input field. I have created a jsfiddle to demonstrate the issue: http://jsfiddle.net/v6v146sv/ Please change the select options and take a note of the input fields values. any help would be appreciated.
type: Question
has title: jQuery: on change get the closest element for its text?
tagged with: javascript

http://stackoverflow.com/a/28798498
score: 0
type: Answer
has body: You do not assign B any specific prototype properties so the inheritance chain is broken.
answers question: http://stackoverflow.com/q/28798427

http://stackoverflow.com/q/28904415
has comment: http://stackoverflow.com/comment/46070590
type: Question
tagged with: resources
tagged with: api
answer count: 1
has body: Hi I have some angular code that utilises $resource to call a web api and get back some data. All works fine until the dataset being returned from the api gets over a few thousand rows. I get a really unhelpful error as detailed below: Error: [$resource:badcfg] array http://errors.angularjs.org/1.2.28/$resource/badcfg?p0=object I'm calling with GET, isArray: true and with some headers which just contain dates. Anyone encountered this sort of problem?
tagged with: javascript
has answer: http://stackoverflow.com/a/29360022
has comment: http://stackoverflow.com/comment/46131725
score: 0
has title: Angular $resource with large dataset
has comment: http://stackoverflow.com/comment/46175575
tagged with: angularjs
has comment: http://stackoverflow.com/comment/46092614
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46090189

http://stackoverflow.com/comment/57315019
score: 0
type: AnswerComment
has text: So all the timeouts that are set while the Jasmine clock is installed, will be removed when the clock is uninstalled? They will not start running again after you uninstall it?
type: Comment
comment on: http://stackoverflow.com/a/28889643

http://stackoverflow.com/comment/45850091
has text: Ok - tried this and it's exposed that the $_SESSION['counter'] isn't being set by the parent ajax call.
type: QuestionComment
comment on: http://stackoverflow.com/q/28786947
type: Comment
score: 0

http://stackoverflow.com/q/28784832
has body: Well, I've got this javascript code to open and close a login tab on my website: $(document).ready(function() { $('#vale_presente_info').tooltip(); $('#top-login').hover( function(){ $(this).children('#top-login-over:hidden').slideDown(100); }, function(){ $('#top-login-over:visible').slideUp(100); } ); $('#top-login').hover( function(){ $(this).children('#top-login-over-logged:hidden').slideDown(100); }, function(){ $('#top-login-over-logged:visible').slideUp(100); } ); }); //ready HTML: <?php if(! isLoggedIn()) : ?> ENTRE ou <a href="<?php echo base_url('cadastro'); ?>">CADASTRE-SE <?php if($this->session->flashdata('loginError')){$loginError = $this->session->flashdata('loginError');} ?> <form method="post" action="<?php echo base_url('login'); ?>" novalidate> <?php if(isset($loginError)){echo $loginError['user_email'];} ?> <?php if(isset($loginError)){echo $loginError['user_password'];} ?> esqueci minha senha <input type="hidden" name="url" value="<?php echo current_url(); ?>" /> <a href="<?php echo $login_url; ?>"> Ainda não é um membro? Cadastre-se <a href="<?php echo base_url('cadastro'); ?>">aqui <?php else : ?> VOCÊ ESTÁ LOGADO <?php if(!empty($user['thumb'])) : ?> <img src="<?php echo $user['thumb']; ?>" alt="<?php echo $user['primeiro_nome']." ".$user['sobrenome']; ?>" /> <?php else: ?> <img src="<?php echo base_url('student_images/sample_thumb.png'); ?>" alt="<?php echo $user['primeiro_nome']." ".$user['sobrenome']; ?>" /> <?php endif; ?> <?php echo $user['primeiro_nome'];?> <a href ="<?php echo base_url('aluno/meu-perfil'); ?>">Editar Perfil <a href="<?php echo base_url('aluno/meu-perfil'); ?>">Meu Perfil | <a href="<?php echo base_url('aluno'); ?>">Meu Campus <a href="<?php echo base_url("login/logout"); ?>">Sair <?php endif; ?> The thing is, it's kind of annoying when you're typing your e-mail address and you accidentally move your mouse out of the top-login div. So I want to change it to open when you click. And close when you click again. Simply cha…
score: 0
has comment: http://stackoverflow.com/comment/45845884
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45846016
has comment: http://stackoverflow.com/comment/45846319
has title: Javascript hover to click
has comment: http://stackoverflow.com/comment/45846054
has comment: http://stackoverflow.com/comment/45846557
has comment: http://stackoverflow.com/comment/45847234
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45846048

http://stackoverflow.com/q/28856356
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has title: jquery p:last-child not working
has answer: http://stackoverflow.com/a/28856379
accepted answer: http://stackoverflow.com/a/28856379
type: AnsweredQuestion
score: 1
type: Question
tagged with: javascript
has body: I'm trying to add some data to my paragraphs, how ever it is only working for my first p. I can make it put the data into my last p by using p:gt(0) but seems like I should be able to use p:last-child. Any idea where I'm going wrong? HTML JS: $("#quizEnd p:first-child").text("Navn : " + quizName); $("#quizEnd p:last-child").text("Email : " + quizMail);
upvote count: 1
has comment: http://stackoverflow.com/comment/45978672
downvote count: 0

http://stackoverflow.com/a/28878108
score: 2
answers question: http://stackoverflow.com/q/28878019
has body: From what I can ascertain from your description, I don't think knockout or indeed any MVVM binding framework is correct for you. It would be good to understand more about what you are trying to do, with some sample code, before we help any further. The samples over at knockout's page are a little simple, you may want to check out http://www.scottlogic.com/blog/2014/07/30/spa-angular-knockout.html for a more in-depth article with code.
downvote count: 0
has comment: http://stackoverflow.com/comment/46021578
upvote count: 2
type: Answer

http://stackoverflow.com/comment/45967363
type: AnswerComment
score: 0
has text: give us a sample of your *JSON*
type: Comment
comment on: http://stackoverflow.com/a/28833533

http://stackoverflow.com/comment/45814927
comment on: http://stackoverflow.com/q/28768138
type: Comment
type: QuestionComment
has text: possible duplicate of [Round to at most 2 decimal places in JavaScript](http://stackoverflow.com/questions/11832914/round-to-at-most-2-decimal-places-in-javascript)
score: 0

http://stackoverflow.com/q/28801729
tagged with: javascript
has comment: http://stackoverflow.com/comment/45879748
tagged with: jquery
has title: get content loaded with json
has comment: http://stackoverflow.com/comment/45877576
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: Installed an app for shopify (qucik view) which shows product in a popup. It looks like all of the content and data is loaded into divs with specific id's an classes with json. I'm trying to pull and edit some parts of it (like hrefs) with jquery, but have no luck. I'm new to js, so it look like there is something i don't know. Trying to make it with standard jquery lines $(".sca-qv-showqv").each(function(){ var ttlhref = $(this).find("#sca-qv-detail").attr("href"); $(this).find("a.sca-qv-title").attr("href",ttlhref); }); My guess is that it's trying to pull data before all of it is loaded. I've also tried window load, and no luck with that. Errors from console: Uncaught Error: Syntax error, unrecognized expression: .main-nav ul li ul. .superimage img sca-qv-pro-scripts-noconfig.js?shop=mineral-fusion.myshopify.com:4 load jquery 1.11 jquery.js:9592 Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/. sca-qv-pro-scripts-noconfig.js?shop=mineral-fusion.myshopify.com:3 collection_handle : undefined sca-qv-pro-scripts-noconfig.js?shop=mineral-fusion.myshopify.com:3 Disable QV : sca-qv-pro-scripts-noconfig.js?shop=mineral-fusion.myshopify.com:3 image_zoom_type : original sca-qv-pro-scripts-noconfig.js?shop=mineral-fusion.myshopify.com:3 image_show_type : large foundation.min.map:1 GET http://cdn.shopify.com/s/files/1/0519/3185/t/10/assets/foundation.min.map 404 (Not Found) app.css.map:1 GET http://cdn.shopify.com/s/files/1/0519/3185/t/10/assets/app.css.map 404 (Not Found)
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45877681
answer count: 0
has comment: http://stackoverflow.com/comment/45877239
has comment: http://stackoverflow.com/comment/45877377
has comment: http://stackoverflow.com/comment/45882206
tagged with: http://stackoverflow.com/tag/json
type: Question

http://stackoverflow.com/q/28777019
has comment: http://stackoverflow.com/comment/45834336
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28777133
has comment: http://stackoverflow.com/comment/45832124
has comment: http://stackoverflow.com/comment/45832140
type: Question
type: AnsweredQuestion
has title: Remove item from array and html list using jquery
answer count: 1
tagged with: javascript
tagged with: jquery
has body: I have a javascript array called names[] which stores names. (ofcourse) The names are also stored in list items in my html document, I have this code that removes a name when you click on it; $(document).ready(function(){ $(document).on('click', 'li', function(){ $(this).remove(); }); }); Can anyone tell me how I remove the same item from the array names[]? UPDATE: names[] is defined as follows: function submit() { var theName = document.getElementById("enter").value; if (theName == "" || theName.length == 0) { return false; } names.push(theName); document.getElementById("name").children[0].innerHTML += "&lt;li&gt;" + names[names.length - 1] + "&lt;/li&gt;"; document.getElementById("enter").value = ""; } This is done with an &lt;input&gt;.
has answer: http://stackoverflow.com/a/28777133
score: 0

http://stackoverflow.com/q/28874810
tagged with: javascript
score: 0
answer count: 1
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/30540868
has title: How add clips in Imperavi Redactor?
tagged with: wysiwyg
type: Question
has body: I use Imperavi Redactor 10.0.6 with plugin Clips. Ago for adding my own clips I used this solution: http://www.yiiframework.ru/forum/viewtopic.php?f=3&amp;t=11042, but in current version this method not working. In file clips.js I found variable items. I can change this array, but I'm not sure, that it`s best solution. Thanks for help.

http://stackoverflow.com/comment/45997173
type: QuestionComment
comment on: http://stackoverflow.com/q/28865465
has text: I would try using `oSettings.oInstance.fnDraw()` instead ... This is always present, cannot know why `this.fnDraw()` is undefined (it should not be so)
score: 0
type: Comment

http://stackoverflow.com/a/28901899
type: Answer
answers question: http://stackoverflow.com/q/28900354
score: 0
has comment: http://stackoverflow.com/comment/46068834
has body: Works fine for me too on Samsung galaxy s5. Might sound silly but it isn't just cached on your devices is it since before you added the wrapper and overflow-x: hidden? I had to clear my phone cache a lot when I was updating my site recently.

http://stackoverflow.com/q/28762973
has comment: http://stackoverflow.com/comment/45805283
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45805862
tagged with: ajax
has comment: http://stackoverflow.com/comment/45806074
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45805678
has title: how to pass json string from Controller to ajax sucess event
has answer: http://stackoverflow.com/a/28763315
tagged with: asp.net-mvc-3
has comment: http://stackoverflow.com/comment/45805546
type: Question
tagged with: asp.net-mvc
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45833408
tagged with: javascript
has body: I want to pass "recentlyupgraded" string from controller to ajax success event and check at ajax sucess event . My code is : This is My Controller: [HttpPost] [AuthorizeEnum(UserRole.Normal, UserRole.Power)] public ActionResult BusinessUpdate(BusinessSetting business) { ActionResult _returns; if (viewModel.BusinessSettingUpdate(business)) viewModel.InitalizeBusiness(); if (Session["recentlyUpgraded"] != null &amp;&amp; (bool) Session["recentlyUpgraded"]) { _returns = Json("recentlyUpgraded",JsonRequestBehavior.AllowGet); }); } else { _returns = PartialView("_Business", viewModel.Business); } return _returns; now i want to check it at ajax success event code is: function OnSuccess(formName) { $(formName).removeData("validator"); $(formName).removeData("unobtrusiveValidation"); $.validator.unobtrusive.parse(formName); alert(formName.innerHTML);//this code gives undefined } function OnComplete(request, status) { $("#DetailandSetting").fadeTo('slow', 1); // alert(JSON.stringify(request)); // if (request.innerhtml = "recentlyUpgraded") { // window.location.href = '/NMPAccount/LogOff'; // } } Note :This is ajax form .

http://stackoverflow.com/comment/67832802
has text: Me also, I might get going to on-writing one, will update
comment on: http://stackoverflow.com/q/28776976
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45901050
comment on: http://stackoverflow.com/q/28813835
has text: `sub_a.times = 1;` will never (!) change the `sub_b.times`, unless `sub_a === sub_b`. This has nothing to do with prototypes. *Assigning* to a property always adds or changes the property on the objects itself (whether it exists in the prototype chain or not).
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/q/28830272
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45930466
possible better answer: http://stackoverflow.com/a/28830484
score: 1
accepted answer: http://stackoverflow.com/a/28830331
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45930458
has answer: http://stackoverflow.com/a/28830484
duplicate of: http://stackoverflow.com/q/1359469
has title: Change div id text content
has answer: http://stackoverflow.com/a/28830331
tagged with: javascript
has comment: http://stackoverflow.com/comment/45930517
answer count: 2
downvote count: 0
favorite count: 0
linked to: http://stackoverflow.com/q/1359469
has body: so i've been trying to change the text in a div. some name I thought a simple: document.getElementById("companyname").innerText = "Company"; Would work, but no. Help would be appreciated.
has comment: http://stackoverflow.com/comment/45930422

http://stackoverflow.com/comment/45995944
score: 0
type: AnswerComment
has text: yes, I mean, is just that the percentage sign doesn't do anything, is doesn't affect anything. if I use it nothing changes, only using px
type: Comment
comment on: http://stackoverflow.com/a/28864449

http://stackoverflow.com/q/28886385
type: Question
has answer: http://stackoverflow.com/a/28886455
downvote count: 0
tagged with: javascript
has title: Underscore, retrieving value incorrectly
has body: I am trying to retrieve a nested items value with a chain like so. The object I am traversing looks like this: var testStates = [{ "module": "module1", "customUrl": [ { "mod1": "2" }, { "mod2": "1" } ] }, { "module": "module2", "customUrl": [ { "mod3": "false" }, { "mod4": "5" } ] } ]; And my chain looks like this: findState = _.chain(currentState) .findWhere({ module: moduleName}) .result('customUrl') .find(function (v) { return v.hasOwnProperty(stateName)}) .values() .value(); This is returning the right item however it is in an array by itself so if I console.log it, it gives me back ["false"] instead of "false". Not sure what is causing this.
answer count: 1
score: 1
accepted answer: http://stackoverflow.com/a/28886455
favorite count: 0
upvote count: 1
type: AnsweredQuestion
tagged with: underscore.js

http://stackoverflow.com/a/28999918
has comment: http://stackoverflow.com/comment/46316758
score: 1
upvote count: 1
has body: So the problem turned out to be an issue with the pager addon/widget. When a cell is edited, an "updateCell" event is triggered by the editable widget to update the internal cache. Once this process completes, an "updateComplete" event is triggered by the core plugin. In the pager code, when an "updateComplete" event is triggered, it updates the total rows and total pages inappropriately because ajax is being used and it only counts the rows currently in the table. So basically, I added a check to prevent recalculating the page/row count if ajax is being used. Get this latest update for the pager from the GitHub repository master branch.
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46316859
has comment: http://stackoverflow.com/comment/46316815
type: Answer
has comment: http://stackoverflow.com/comment/46307828
accepted answer of: http://stackoverflow.com/q/28897162
answers question: http://stackoverflow.com/q/28897162
downvote count: 0
has comment: http://stackoverflow.com/comment/46299599

http://stackoverflow.com/q/28850178
has body: I have a link on a page and I would love to do some processing with ajax and pass the results to another page. I want to handle all of this when someone is clicking the link and they are sent to the other page and shown the results of the processed data which i want to add to a div on the new page. I tried something like this. $('#view_report').click( function () { //Some logic to pick data on this page called index. //Send the data via an ajax call $.ajax({ type : "POST", url : "/cycles/wizard/0", data :"sample data, dataType : "html", success : function(response) { //load the data in a div with the class report on the new page called report $('.report').load("/cycles/report",response, function(){ console.log("worked"); }); } }); return false; } ); I have a link on my index page like so View Report However when I click the link it doesn't work and if I remove the id it works fine moving to the report page. How can I achieve this?
has title: Capturing and processing some data on clicking a link on a page using ajax and passing the processed data to new page which the link directs to
tagged with: jquery
has comment: http://stackoverflow.com/comment/45968664
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28850918
has answer: http://stackoverflow.com/a/28850406
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45968079
tagged with: javascript
has answer: http://stackoverflow.com/a/28850928
type: Question
score: 0
answer count: 3

http://stackoverflow.com/comment/45937818
comment on: http://stackoverflow.com/a/28813462
score: 0
type: AnswerComment
has text: @Jelle I think you used same id for two sliders try to implement horizontal with using class rather than id
type: Comment

http://stackoverflow.com/comment/45920878
comment on: http://stackoverflow.com/q/28825011
has text: Ah perhaps I over thought it? Do you just do it all on the client side. So you subscribe to all your Posts and then only show the ones from a certain timestamp. And use .count() to know the difference between the ones being displayed and the ones that are new.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/28795681
has comment: http://stackoverflow.com/comment/45869118
answer count: 1
tagged with: websocket
accepted answer: http://stackoverflow.com/a/28797650
has title: Client Socket.io disconnects and reconnects to websocket persistently
tagged with: node.js
type: AnsweredQuestion
score: 0
has body: I am connected via Socket.io 1.3.4 (via websockets) to the NodeJS server and client socket.io fires up "disconnect" event 5-30 seconds. Every "disconnect"->"reconnecting"->"reconnect" iteration takes approx. 2 seconds. I am connected via cable to pretty stable network. Server is hosted on AWS. Sometimes I have bad Wi-Fi connection, but no "disconnect" event fire up at all. How can I debug this issue? How can I see who is guilty - server or client? How does socket.io understands that it is time to disconnect? Could not understand this from their code. Edit. Socket.io config: io = require('socket.io')(server, { log: false , "close timeout": 60 , "heartbeat timeout": 60 , "heartbeat interval": 20 })
tagged with: socket.io
has answer: http://stackoverflow.com/a/28797650
type: Question
has comment: http://stackoverflow.com/comment/45868712
tagged with: javascript

http://stackoverflow.com/comment/45887497
has text: We are writing fairly complex application where we are having 60 -70 modules, each module is being developed by a dedicated team. Each team is using r.js optimizer individually. What I wanted to do is to take all modules `build_config.js` for optimizer and run them concurrently so that the entire build process becomes much more faster.
comment on: http://stackoverflow.com/q/28778492
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45954687
type: AnswerComment
type: Comment
has text: Pardon my ignorance but where would the XHR requests be found if I'm using Firebug
comment on: http://stackoverflow.com/a/28842366
score: 0

http://stackoverflow.com/comment/46050026
has text: I believe it does answer the question. There are other things the OP needs to accomplish server-side to get the date in the format he would want after passing the data to the server. However, based on my research, it is not possible to get JS to pass the date to the server in the format he wishes. Hence, he will need to pass the timezone separately. If I am wrong about this, I would love to hear.
type: Comment
comment on: http://stackoverflow.com/a/28855268
score: 0
type: AnswerComment

http://stackoverflow.com/q/28904273
answer count: 1
accepted answer: http://stackoverflow.com/a/29148779
favorite count: 0
upvote count: 2
has title: Struct operations in Javascript through Emscripten
tagged with: emscripten
score: 2
type: AnsweredQuestion
tagged with: unsigned
has answer: http://stackoverflow.com/a/29148779
type: Question
tagged with: struct
downvote count: 0
tagged with: javascript
has body: I am having quite a lot of problems with emscripten inter-operating between C and Javascript. More specifically, I am having trouble accessing a struct created in C in javascript, given that the pointer to the struct is passed into javascript as an external library. Take a look at the following code: C: #include &lt;stdlib.h&gt; #include &lt;stdio.h&gt; #include &lt;inttypes.h&gt; struct test_st; extern void read_struct(struct test_st *mys, int siz); struct test_st{ uint32_t my_number; uint8_t my_char_array[32]; }; int main(){ struct test_st *teststr = malloc(sizeof(struct test_st)); teststr-&gt;my_number = 500; for(int i = 0; i &lt; 32; i++){ teststr-&gt;my_char_array[i] = 120 + i; } for(int i = 0; i &lt; 32; i++){ printf("%d\n",teststr-&gt;my_char_array[i]); } read_struct(teststr,sizeof(teststr)); return 0; } Javascript: mergeInto(LibraryManager.library, { read_struct: function(mys,siz){ var read_ptr = 0; console.log("my_number: " + getValue(mys + read_ptr, 'i32')); read_ptr += 4; for(var i = 0; i &lt; 32; i++){ console.log("my_char[" + i + "]: " + getValue(mys + read_ptr, 'i8')); read_ptr += 1; }; }, }); This is then compiled using emcc cfile.c --js-library jsfile.js. The issue here is that you can't really read structs in javascript, you have to get memory from the respective addresses according to the size of the struct field (so read 4 bytes from the uint32_t and 1 byte from the uint8_t). Ok, that wouldn't be an issue, except you also have to state the LLVM IR type for getValue to work, and it doesn't include unsigned types, so in the case of the array, it will get to 127 and overflow to -128, when the intended behaviour is to keep going up, since the variable is unsigned. I looked everywhere for an answer but apparently this specific intended behaviour is not common. Changing the struct wouldn't be possible in the program I'm applying this to (not the sample one above).
tagged with: http://stackoverflow.com/tag/c

http://stackoverflow.com/comment/45949674
has text: Guys before downvoting explain the reason!!!This is a pretty good question
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28840207

http://stackoverflow.com/comment/46030604
comment on: http://stackoverflow.com/a/28883904
type: AnswerComment
score: 0
type: Comment
has text: @poipoi Not entirely certain what requirement would be within `.forEach` where more than a single property was returned from `.filter()` , whose values were appended to `DOM` ? Piece at OP appear to seek filter of _single_ item within returned data ?

http://stackoverflow.com/a/42980761
answers question: http://stackoverflow.com/q/28872720
type: Answer
has body: This is my workaround based on the DesignerGuy solution. A directive that also supports CTRL + click and center button click. function navigate($state) { return { restrict: 'A', link: function(scope, element, attrs) { element.on('mousedown', function(event) { event.preventDefault(); var to = attrs.navigate.split("(")[0]; var str = attrs.navigate.split("(")[1].slice(0, -1); var params = JSON.parse(JSON.stringify(eval('(' + str + ')'))); if (event.metaKey || event.ctrlKey || event.which == 2) { var url = $state.href(to, params, { absolute: true }); window.open(url, '_blank'); } else if (event.which == 1) { $state.go(to, params); } }); } } } angular .module('xxx') .directive('navigate', navigate) and in the view just this &lt;tr ng-repeat="item in items" navigate="view-item({itemId: {{item.id}} })"&gt;
score: 0

http://stackoverflow.com/q/28777956
tagged with: each
tagged with: javascript
has title: Build 2 level javascript array inside loop
has answer: http://stackoverflow.com/a/28777969
has body: I dont know if the title is wrong... i dont know which term i should use to exaplain the desired result - the end result i am trying to achieve is this: 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" } ] I am trying to build this type of array inside a .each loop while getting the values from a form (that can grow in the amount of rows..) Here is what i got now (which "doesnt work"): // GET VALUES FROM TR var cnt = 0; var datasets = []; $('.pie-table &gt; tbody &gt; tr').length; $('.pie-table &gt; tbody &gt; tr').each(function() { var ctrid = '#' + $(this).attr('id'); var size = $(ctrid).find('input#value').val(); var color = $(ctrid).find('input#color').val(); var hlight = $(ctrid).find('input#highlight').val(); var label = $(ctrid).find('input#label').val(); if (size.length &gt; 0) { datasets[cnt] = 'value: ' + size + ', color:"' + color + '", highlight: "' + hlight + '", label: "' + label + '"'; } cnt++; }) var pieData = []; for (var key in datasets) { pieData.push(datasets[key]); }; How can i achive a structure similer to the example inside that loop?
type: AnsweredQuestion
tagged with: arrays
type: Question
accepted answer: http://stackoverflow.com/a/28777969
score: 0
possible better answer: http://stackoverflow.com/a/28777987
answer count: 2
tagged with: loops
has answer: http://stackoverflow.com/a/28777987

http://stackoverflow.com/a/28786044
type: Answer
has comment: http://stackoverflow.com/comment/45848413
score: 1
upvote count: 1
has body: UPDATE I just realized that you used display:inline-block;,this is what is causing your margin, you can either remove it, change it to display:table; or give a negative margin of -4px that will eliminate the blank space in between. You may need to adjust that negative margin according to your need but it will do the trick. You can find more about Fighting the Space Between Inline Block Elements HERE
answers question: http://stackoverflow.com/q/28785988
has comment: http://stackoverflow.com/comment/45848550
has comment: http://stackoverflow.com/comment/45848582
downvote count: 0
has comment: http://stackoverflow.com/comment/45848482
has comment: http://stackoverflow.com/comment/45848340

http://stackoverflow.com/comment/45912092
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28820175
type: AnswerComment
has text: It does not work ... I have to force calling those two methods: $("#finishBillingModal").css("display", "none"); $(".modal-backdrop").remove();

http://stackoverflow.com/comment/46019145
comment on: http://stackoverflow.com/q/28877837
type: Comment
type: QuestionComment
has text: Yes, I probably meant `" "+2+3`
score: 0

http://stackoverflow.com/q/28887976
type: Question
answer count: 2
has body: After resizing the graph area or browser window, the tool tip popup wont show on mouse-over in highcharts. $(function () { $.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename=large-dataset.json&amp;callback=?', function (data) { // Create a timer var start = +new Date(); // Create the chart $('#container').highcharts('StockChart', { chart: { events: { load: function () { if (!window.isComparing) { this.setTitle(null, { text: 'Built chart in ' + (new Date() - start) + 'ms' }); } } }, zoomType: 'x' }, rangeSelector: { buttons: [{ type: 'day', count: 3, text: '3d' }, { type: 'week', count: 1, text: '1w' }, { type: 'month', count: 1, text: '1m' }, { type: 'month', count: 6, text: '6m' }, { type: 'year', count: 1, text: '1y' }, { type: 'all', text: 'All' }], selected: 3 }, yAxis: { title: { text: 'Temperature (°C)' } }, title: { text: 'Hourly temperatures in Vik i Sogn, Norway, 2004-2010' }, subtitle: { text: 'Built chart in ...' // dummy text to reserve space for dynamic subtitle }, series: [{ name: 'Temperature', data: data, pointStart: Date.UTC(2004, 3, 1), pointInterval: 3600 * 1000, tooltip: { valueDecimals: 1, valueSuffix: '°C' } }] }); }); }); http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/stock/demo/data-grouping/
tagged with: highcharts
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/46042838
has title: how to prevent highcharts tooltip popup from hiding, on graph area or browser window resize?
tagged with: css
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/28894877
score: 1
has answer: http://stackoverflow.com/a/28897686

http://stackoverflow.com/a/28877025
answers question: http://stackoverflow.com/q/28876930
upvote count: 0
score: -1
type: Answer
has body: You may use starting with jQuery Attribute Selector $("div[class|='.article-options_'" + MAIN_ARTICLE_ID + "']").remove() The [attribute|=value] selector is used to select elements with the specified attribute starting with the specified value.
downvote count: 1
has comment: http://stackoverflow.com/comment/46015875

http://stackoverflow.com/comment/46027138
has text: @PeterFlannery Should I incorporate that link into my answer?
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28882819
type: AnswerComment

http://stackoverflow.com/a/28778713
has body: var my_numberA = 3; // This is typeof number var my_numberB = '3'; // This is typeof string So depending on how you write it: a 3 is a number where '3' is a string The trick is to do the following: Any string multiplied by 1 will convert the string to a number. However, multiplying a string that can not be represented by a number will return an error. So you need to compensate for that possibility with a try{}catch(err){} that converts the string to a number if possible function convertToNumber(input){ try{var output = 1*input}catch(error){var output = input} return output } var my_numberA = 3; // This is typeof number var my_numberB = '3'; // This is typeof string console.log( typeof my_numberA ) // Will show 'number' console.log( typeof my_numberB ) // Will show 'string' console.log( typeof convertToNumber(my_numberA) ) // Will show 'number' console.log( typeof convertToNumber(my_numberB) ) // Will show 'number' I prefer this in some cases rather than the Number() function because it returns the same passed object instead of returning NaN.
downvote count: 0
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28778549

http://stackoverflow.com/q/28823591
has answer: http://stackoverflow.com/a/28823864
tagged with: javascript
has title: Array.sort angular filter and "Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!"
has comment: http://stackoverflow.com/comment/45918547
has comment: http://stackoverflow.com/comment/45918538
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/28823864
has body: I am trying to sort some elements in an ng-repeat directive. I have created a custom filter that appears to work although I get the error: "Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!" From what i've read on other answers this is often due to returning a different value for each filter. I have checked and I am returning the same array object...so I'm not sure what could be causing it. .filter('sortOffers', function() { return function(vals, predicate, reverse) { var vals_old = vals; vals.sort(function(a, b) { var sorter = reverse ? 1 : -1; if(predicate === 'seeking') { if(a.data.valueSought > b.data.valueSought) { return sorter; } else if(a.data.valueSought < b.data.valueSought) { return -sorter; } else { return 0; } } if(predicate === 'offering') { if(a.data.valueOffered > b.data.valueOffered) { return sorter; } else if(a.data.valueOffered < b.data.valueOffered) { return -sorter; } else { return 0; } } }); return vals; } }); html: {{ offer.offeringString }} {{ offer.seekingString }} Accept Offer Cancel Your Offer
score: 0
has comment: http://stackoverflow.com/comment/45918463
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45918636
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/28823820
has answer: http://stackoverflow.com/a/28823820

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

http://stackoverflow.com/q/28816429
linked to: http://stackoverflow.com/q/7558182
tagged with: javascript
tagged with: sorting
has comment: http://stackoverflow.com/comment/45904662
linked to: http://stackoverflow.com/q/8734786
tagged with: html-table
has body: I need to dynamically build an HTML table given a certain query method. It doesn't seem too complex and I figure there must be a quick way of doing this. The query method: Given x amount of data sources, I can query each one, one after the other, for a given time period and get timestamps:values for matching records in that time period. The queries happen one after the other so I have to build an HTML table out of them one by one. My idea: build it out one by one to look something like this: timestamp source 1 source 2 source 3 timestamp 1 source 1 value 1 timestamp 2 source 1 value 2 timestamp 3 source 1 value 3 timestamp 1 source 2 value 1 timestamp 2 source 2 value 2 timestamp 3 source 2 value 3 timestamp 1 source 3 value 1 timestamp 2 source 3 value 2 timestamp 3 source 3 value 3 Check this fiddle for a good visual: http://jsfiddle.net/ac0o2715/2/ Then sort that table by timestamp using something like this: http://jsfiddle.net/qNwDe/417/ (from this StackExchange thread: Sort a table fast by its first column with Javascript or jQuery ) Then combine by identical timestamp columns using some efficient method that I cannot think of unfortunately, however I feel should not be very difficult since there should be no conflicting columns when combining. OR, maybe this entire strategy is inefficient, I just couldn't think of a quick way of inserting new rows into the current table sorted by timestamp (and also combining them on identical timestamp) while iterating through the queried data. It seems like it would be faster to dump them all in first and then do one sorting function and merge. This project is using jQuery, so Javascript and/or jQuery solutions are just fine.
score: 0
tagged with: jquery
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
answer count: 0
has comment: http://stackoverflow.com/comment/45941375
has comment: http://stackoverflow.com/comment/45904843
type: Question
has title: Fastest method of building HTML table one data source at a time

http://stackoverflow.com/q/28755841
tagged with: trigonometry
has comment: http://stackoverflow.com/comment/45795169
has answer: http://stackoverflow.com/a/28766880
tagged with: dynamic
has comment: http://stackoverflow.com/comment/45793425
type: Question
type: AnsweredQuestion
has body: I have been working on a JS project where a sun goes around an image in a circle, and based on its position a higher index div will change opacity to make it darker or lighter. My problem is; while at one point the Sun moved in a circle, it no longer does. I have tried many things to fix this, but to no avail. My documented code is as follows: &lt;style&gt; sun{ position: absolute; z-index: 1; } dark-light{ z-index: 2; } &lt;/style&gt; CSS:^ JS:v &lt;script&gt; move(); //calls move function move(){ //set rot var rot = 180; var pictureToDisplay = prompt('Please insert link to picture to display','URL Necessary to function properly, but not required. Press enter to continue.'); //asks user to insert picture link for STATIONARY picture var img = document.getElementById('img'); if (pictureToDisplay == 'URL Necessary to function properly, but not required. Press enter to continue.'){ }else{ img.src = pictureToDisplay; } //Sets stationary picture window.setInterval( function() { //Repeats every 75 milliseconds forever. var obj = document.getElementById('sun'); // obj. is equal to id sun var top = (Math.sin(rot)*500)+500; var left = (Math.cos(rot)*500)+500; //uses var rot, sine, and cosine to determine moving sun position var toppx = top + 'px'; var leftpx = left + 'px'; //adds the px after those values obj.style.top = toppx; obj.style.left = leftpx; //attempts to set position of obj (id sun) var darkToLight = -0.5+(top/500); //determines opacity of div using var top //document.write(rot+' = rot : '); var lightDiv = document.getElementById('dark-light'); // same as var obj, but with the div lightDiv.style.opacity = darkToLight; //sets lightDiv to opacity //document.write(toppx,' ,',leftpx,' : '); rot = (rot+0.01) % 360; //moves rot up by 0.01, modulate 360 }, 75); //back to top of setInterval } &lt;/script&gt; P.S. I know no JQuery. Edit: The position of all is absolute, 0,0 is the top left corner of the page. I made sure not to deal with negatives. The sun should be absol…
accepted answer: http://stackoverflow.com/a/28766880
tagged with: image
has comment: http://stackoverflow.com/comment/45794091
has comment: http://stackoverflow.com/comment/45793293
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45812330
tagged with: position
has title: Need help fixing Dynamic Position of Image JS
score: 0
has comment: http://stackoverflow.com/comment/45793960

http://stackoverflow.com/comment/46067034
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28903762
type: QuestionComment
has text: That's not how `this` works.

http://stackoverflow.com/a/28819007
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28818967
has body: No, Call is an internal method (for specification purposes only). It's defined for user-created functions or bound functions, but can also be implemented on host objects. The Function.prototype.call method, an actual language-accessible object, is different from it, though it invokes Call.
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28818967
score: 1

http://stackoverflow.com/comment/45785485
has text: While this answers the question, it's very fragile. What if the clicked element has multiple classes, perhaps added by a plugin?
type: AnswerComment
comment on: http://stackoverflow.com/a/28751777
score: 0
type: Comment

http://stackoverflow.com/comment/46066127
has text: @geocodezip — I also tried using the default Google Maps infoWindow and it has the same problem.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28890011

http://stackoverflow.com/comment/45927125
has text: I used ur code, but the sub buttons are getting printed before i click on case radio button
type: Comment
comment on: http://stackoverflow.com/a/28828325
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45807267
score: 0
comment on: http://stackoverflow.com/q/28762959
type: QuestionComment
type: Comment
has text: addr is any valid index of the write[] array (actually 0 to 65535). I will look up the difference between function names and references, thats a good idea if I am correct in what you mean thanks.

http://stackoverflow.com/comment/45986482
has text: You'll need to add a lot more of the code :) Aka a working example or the JS
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28859949

http://stackoverflow.com/comment/45905347
type: QuestionComment
score: 3
comment on: http://stackoverflow.com/q/28816810
has text: Don't use HTML. Generate a PDF on the fly.
type: Comment

http://stackoverflow.com/comment/46052881
score: 0
type: QuestionComment
type: Comment
has text: @RoryMcCrossan if 03 == March , just wanted to show the format, anyway I have corrected
comment on: http://stackoverflow.com/q/28896369

http://stackoverflow.com/q/28849161
tagged with: javascript
favorite count: 0
has body: I want to call function in javascript only a one time but after some time. setTimeout(function(){ $('.alert').fadeOut(2000) }, 5000); right now i am using this, But this function call multiple time. I need to call only a single time after some time
has comment: http://stackoverflow.com/comment/45965923
type: AnsweredQuestion
has title: call function after some time but only one time
accepted answer: http://stackoverflow.com/a/28849310
has comment: http://stackoverflow.com/comment/45965942
type: Question
has comment: http://stackoverflow.com/comment/45965893
score: 1
has answer: http://stackoverflow.com/a/28849310
upvote count: 2
answer count: 1
downvote count: 1

http://stackoverflow.com/q/28821511
tagged with: jasmine
accepted answer: http://stackoverflow.com/a/28821717
has body: AngularJS v1.2.26 Jasmine v2.2.0 How can I change or remove the behavior of a spyOn? When I try to override it, I get the following error: Error: getUpdate has already been spied upon var data1 = 'foo'; var data2 = 'bar'; describe("a spec with a spy", function(){ beforeEach(module('app')); var $q; beforeEach(inject(function(_updateService_, _$q_){ updateService = _updateService_; //spy the results of the getUpdate() $q = _$q_; var deferred = $q.defer(); deferred.resolve( data1 ); spyOn(updateService, 'getUpdate').and.returnValue(deferred.promise); })); describe('and here the spy should be different', function() { it('returns a different value', function() { var deferred = $q.defer(); deferred.resolve( data2 ); spyOn(updateService, 'getUpdate'); //ERROR HERE updateService.getUpdate.and.returnValue(deferred.promise); ... }); }); ... When I remove the second spyOn the test doesn't work. How do I do this?
favorite count: 0
upvote count: 93
has answer: http://stackoverflow.com/a/57513049
tagged with: angularjs
has title: Angular unit testing with Jasmine: how to remove or modify spyOn
type: AnsweredQuestion
downvote count: 0
possible better answer: http://stackoverflow.com/a/34950537
has answer: http://stackoverflow.com/a/47478499
has comment: http://stackoverflow.com/comment/102909170
tagged with: unit-testing
has answer: http://stackoverflow.com/a/34950537
type: Question
score: 93
has answer: http://stackoverflow.com/a/43924235
tagged with: javascript
answer count: 6
tagged with: karma-jasmine
has answer: http://stackoverflow.com/a/45696032
linked to: http://stackoverflow.com/q/36200532
has answer: http://stackoverflow.com/a/28821717

http://stackoverflow.com/a/28823688
score: 1
has body: You should generally bind to the most restrictive element that contains the dynamic elements that you want to delegate to. The way delegation works is that an internal jQuery handler is run every time the event occurs anywhere in the element that you bind to. This handler performs a check to see if the target matches the selector argument, and if so it calls your handler function. So if you use $(document).on, it will have to do this check anytime you click anywhere on the page. But if you use $(".parent").on it only has to do the check when you click inside the parent element. This is less overhead on the browser. Also, delegation depends on the event bubbling out to the element you bind to. If there's an element that contains button.btn and it has a click handler that calls event.stopPropagation(), this will cancel the bubbling, and the jQuery's internal handler will never be run. Binding to the parent should make this unlikely.
has comment: http://stackoverflow.com/comment/45918577
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28823636
type: Answer

http://stackoverflow.com/comment/45871494
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28798568
has text: What does the HTML for the element you are targeting look like? Is it actually HTML or are you adding it with JS?

http://stackoverflow.com/a/28841081
has comment: http://stackoverflow.com/comment/45951956
has comment: http://stackoverflow.com/comment/45951876
upvote count: 1
answers question: http://stackoverflow.com/q/28840998
has body: Why not just use ng-click? link: function(scope, element, attrs) { scope.onHandleClick = function() { console.log('onHandleClick'); }; } &lt;div ng-click="onHandleClick($event)"/&gt;
has comment: http://stackoverflow.com/comment/45951273
has comment: http://stackoverflow.com/comment/45954051
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/45951939
score: 1

http://stackoverflow.com/a/28893574
has comment: http://stackoverflow.com/comment/46047863
has comment: http://stackoverflow.com/comment/46048556
has body: You have made a silly mistake, because of which you are not getting expected output. Instead of doing like: //selectedt is HTMLCollection having list of all elements with tag "select" //&amp; typeof calcit is String, which you need to make a number before multiplying with 65 var calcit = selectedt.options[selectedt[i].selectedIndex].value; do, var calcit = parseInt(selectedt[i].options[selectedt[i].selectedIndex].value); And, apart from switch usage, what other approach you are thinking to take. For Obvious reasons, switch is more preferable than if-else.
has comment: http://stackoverflow.com/comment/46048664
has comment: http://stackoverflow.com/comment/46049290
has comment: http://stackoverflow.com/comment/46048096
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28893385
has comment: http://stackoverflow.com/comment/46047544
has comment: http://stackoverflow.com/comment/46048290

http://stackoverflow.com/q/28813563
has comment: http://stackoverflow.com/comment/45899669
has title: MVC5: Refresh partial view on button click?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45911214
has comment: http://stackoverflow.com/comment/45899438
tagged with: razor
has comment: http://stackoverflow.com/comment/45901062
has body: My VerifyAsset/Index view is currently defined as so: @using GridMvc.Html @using System.Collections.Generic @model List<InventoryTracker.Models.INV_Assets> @{ ViewBag.Title = "Index"; Layout = "~/Views/Shared/_Layout.cshtml"; } Verify Assets @Html.DropDownList("NumberValueSelection", Enumerable.Range(1, 31).Select(x => new SelectListItem { Text = x.ToString(), Value = x.ToString() })) @Html.DropDownList("intervalList") REFRESH @* Create Asset Clear All Filters*@ @* prism - admin/usermanagement/index - mvcgrid example *@ @*Images in Columns: https://gridmvc.codeplex.com/discussions/440977*@ @try { @Html.Grid(Model).Columns(columns => { columns.Add().Encoded(false).Sanitized(false).SetWidth(30).RenderValueAs(o => @Html.CheckBox("checked", false)); columns.Add().Encoded(false).Sanitized(false).RenderValueAs(o => @ @*View*@).SetWidth(15); @*columns.Add().Encoded(false).Sanitized(false).RenderValueAs(o => @ @*View*).SetWidth(15);*@ columns.Add(o => o.Status.status_description).Titled("Status").RenderValueAs(o => o.Status.status_description).Sanitized(false).Encoded(false).Sortable(true).Filterable(true).SetWidth(20); columns.Add(o => o.Location.location_dept).Titled("Dept").RenderValueAs(o => o.Location.location_dept).SetWidth(20); columns.Add(o => o.Location.location_room).Titled("Room").RenderValueAs(o => o.Location.location_room).SetWidth(20); columns.Add(o => o.owner).Titled("Owner").RenderValueAs(o => o.owner).SetWidth(20); columns.Add(o => o.Type.type_description).Titled("Type").RenderValueAs(o => o.Type.type_description).SetWidth(20); columns.Add(o => o.Manufacturer.manufacturer_description).Titled("Manufacturer").RenderValueAs(o => o.Manufacturer.manufacturer_description).SetWidth(20); columns.Add(o => o.Model.model_description).Titled("Model").RenderValueAs(o => o.Model.model_description).SetWidth(20); columns.Add(o => o.Vendor.vendor_name).Titled("Vendor").RenderValueAs(o => o.Vendor.vendor_name).SetWidth(20); columns.Add(o => o.description).Titled("Desc").Rend…
linked to: http://stackoverflow.com/q/5248183
linked to: http://stackoverflow.com/q/28747690
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/45900612
has comment: http://stackoverflow.com/comment/45899555
type: Question
has comment: http://stackoverflow.com/comment/45899372
has comment: http://stackoverflow.com/comment/45899506
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: partial-views
score: 0
downvote count: 1
has comment: http://stackoverflow.com/comment/45900879
has comment: http://stackoverflow.com/comment/45899589
has answer: http://stackoverflow.com/a/28813857

http://stackoverflow.com/a/28867936
accepted answer of: http://stackoverflow.com/q/28866954
answers question: http://stackoverflow.com/q/28866954
type: Answer
upvote count: 2
score: 2
type: AcceptedAnswer
downvote count: 0
has body: Here's one approach. It will get you about 75% there, you'll need to add the logic to get the behavior you're looking for. Check out the JSFiddle for a working demo function MenuFunctionVM() { self = this; self.menuItems = [ { name: "MES INFOS", items: ["item0", "item1", "item2"] }, { name: "DEMANDE", items: ["item3", "item4", "item5"] }, { name: "OFFRES", items: ["item6", "item7", "item8"] } ]; self.subMenuVisible = ko.observable(false) self.subMenuItems = ko.observableArray([]); self.showMenu = function (data) { self.subMenuVisible(!self.subMenuVisible()); alert("clicked"); self.subMenuItems(data.items); } }; ko.applyBindings(new MenuFunctionVM());

http://stackoverflow.com/comment/45902532
comment on: http://stackoverflow.com/q/28815107
has text: @Nik, I appreciate the enthusiasm, but please try to keep it to one question per question. The questions you're asking are too broad, to be answerable. I think at this point you should review [the StackOverflow help center article on how to ask a good question](http://stackoverflow.com/help/how-to-ask). If you're really just after a code review, then please post on [CodeReview.SE].
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/q/28845294
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28845364
type: Question
has body: I can't figure out how to prevent that draggable objects are added several times in one drag event. I made a small example where you can produce the problem. https://jsfiddle.net/richiwarmen/afqu96v3/1/ $( ".draggableEl" ).droppable({ accept: ".dropme", drop: function( event, ui ) { $(this).append(ui.draggable.clone().css("left","0px")); }}); $( ".draggableEl" ).draggable(); $( ".dropme" ).draggable({ revert: 'invalid', helper: "clone" , }); drag the purple block in the upper left of the green block, .
has title: prevent draggable objects are added several times jQuery
score: 1
linked to: http://stackoverflow.com/q/17053289
answer count: 2
upvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28845492
downvote count: 0

http://stackoverflow.com/q/28762150
downvote count: 0
tagged with: file-upload
favorite count: 0
has body: I have a question regarding upload a file to some server. I understand that due to security issues, web browser does not allow javascript to access user's file directory. So currently my method is to add a choose file button and manually choose a file to upload. I did a lot of research on internet for other alternate approach, but did not find anything useful. Is there any possible way to automate the process of choosing the file? (I only need to upload one file) Like changing web browser setting or attach this file somewhere inside html or any other approach?
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45803879
tagged with: file
type: Question
upvote count: 2
accepted answer: http://stackoverflow.com/a/28763055
tagged with: javascript
has title: Upload local file without choose button
has comment: http://stackoverflow.com/comment/45803967
has comment: http://stackoverflow.com/comment/45804092
has answer: http://stackoverflow.com/a/28763055
has comment: http://stackoverflow.com/comment/45803984
tagged with: http://stackoverflow.com/tag/html
answer count: 1

http://stackoverflow.com/comment/45924356
has text: I think it should work the way you did it. Are you using a framwork, and can you make sure you don't have something like `htmlspecialchars ` somewhere in your code?
comment on: http://stackoverflow.com/q/28826910
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46032812
comment on: http://stackoverflow.com/q/28883399
type: Comment
type: QuestionComment
has text: attach a jsFiddle link. The HTML is missing in your question. please add that
score: 0

http://stackoverflow.com/comment/45994655
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28864034
has text: @Spencer: That's how I'm interpreting it. Sorry if that wasn't clear. Anyways, I will try to reach out and see if this part can be clarified.
type: AnswerComment

http://stackoverflow.com/a/28864787
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28862765
accepted answer of: http://stackoverflow.com/q/28862765
type: AcceptedAnswer
downvote count: 0
has body: This explanation shows: Automatic creation of Custom Menu Item Code to open Dialog box HTML and &lt;script&gt; tag in the HTML for the dialog box Code to put the result into the spreadsheet Code.gs - onOpen() - Create Custom Menu function onOpen() { SpreadsheetApp.getUi() .createMenu('Custom Menu') .addItem('Show Upload Dialog', 'showUploadBox') .addToUi(); }; gs Code - Open Dialog function showUploadBox() { var htmlOutput = HtmlService.createHtmlOutputFromFile('Dialog') .setWidth(500) .setHeight(500); SpreadsheetApp.getUi().showModalDialog(htmlOutput, 'Title of Dialog'); }; Dialog Upload.html Create a new file with this HTML &lt;div id="formDiv"&gt; &lt;form id="myForm"&gt; &lt;input id="fileName" name="picToLoad" type="file" /&gt; &lt;br&gt; &lt;br/&gt; &lt;input type="button" value="Submit" onclick="fncGetFileName()" /&gt; &lt;br&gt; &lt;br&gt; &lt;br&gt; &lt;input id="idBtnClose" type="button" value="Close" style="display: none" onclick="google.script.host.close()" /&gt; &lt;/form&gt; &lt;/div&gt; &lt;br&gt; &lt;br&gt; &lt;div id="status" style="display: none"&gt; &lt;!-- div will be filled with innerHTML after form submission. --&gt; Working. Please wait... &lt;/div&gt; &lt;script&gt; function fncGetFileName(frmData) { console.log('fncGetFileName ran!'); var theFileName = document.getElementById('fileName').value; theFileName = theFileName.slice(12); console.log('theFileName: ' + theFileName); document.getElementById('status').style.display = 'inline'; //Display msg google.script.run .withSuccessHandler(updateOutput) .processForm(theFileName) }; // Javascript function called by "submit" button handler, // to show results. function updateOutput() { var outputDiv = document.getElementById('status'); outputDiv.innerHTML = "The File Name was Written!"; document.getElementById('idBtnClose').style.display = 'inline'; //Display msg } &lt;/script&gt; gs Code to Save File Name to Sheet function processForm(argFileName) { Logger.log('argFileName: ' + argFileName); var ss…
type: Answer

http://stackoverflow.com/comment/45960843
type: QuestionComment
comment on: http://stackoverflow.com/q/28846053
score: 0
has text: It's not possible to style a text file directly. But you can write a program that reads the file and converts it to something that can be styled.
type: Comment

http://stackoverflow.com/a/28782624
score: 8
downvote count: 0
has body: Use the forEach method of the data class to loop over the features and remove them using the remove method: map.data.forEach(function (feature) { map.data.remove(feature); }); data reference: https://developers.google.com/maps/documentation/javascript/reference#Data
accepted answer of: http://stackoverflow.com/q/28782352
answers question: http://stackoverflow.com/q/28782352
upvote count: 8
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/46076965
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28906725
type: Comment
has text: Thanks for your reply, but I think I didn't phrase my question correctly. The zooming part is not what is giving me problems, it's more about the visibility of polygons in relation to the zoom level of the map (a really small polygon won't be visible until you zoom in enough).

http://stackoverflow.com/comment/45827591
score: 0
type: Comment
type: QuestionComment
has text: Your way of declaring the controller has been deprecated and removed. `app.controller("AdamState", function($scope, $http) { });`
comment on: http://stackoverflow.com/q/28774657

http://stackoverflow.com/comment/45918998
has text: Perfect that worked thanks, i'm a little confused though because I read in other questions that this was the exact reason why you would get such an error (because you should return the same array not a new one)
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28823864

http://stackoverflow.com/a/28882824
answers question: http://stackoverflow.com/q/28882590
type: Answer
has body: You should consider using an object for keeping track of actual variable names (using keys) For instance // note that I messed with the order of values on purpose // since objects should not care about keys order var numericValues = { a: 100, c: 20, b: -2 }; function whichIsTheGreatest(numericValues) { var max = -Infinity; // calling Math.max with no arguments returns -Infinity var maxName = null; for (var key in numericValues) { var num = numericValues[key]; if (num &gt; max) { max = num; maxName = key; } max = (num &gt; max &amp;&amp; num) || max; } return maxName; } console.log(whichIsTheGreatest(numericValues)); // 'a'
score: 0

http://stackoverflow.com/a/28823361
has body: The first way is correct. function RootNode(sTitle, authName, storyNum) { this.sTitle = sTitle; this.authName = authName; this.storyNum = storyNum; this.creationDate = new Date(); } However, this method isn't really like a class, its more of a unique object. Defining the object this way is more like a Java class. function RootNode(sTitle, authName, storyNum) { //your constructor this.sTitle = sTitle; this.authName = authName; this.storyNum = storyNum; this.creationDate = new Date(); } RootNode.prototype.myMethod = function() { //my code } This pattern is useful as it allows multiple instantiation without duplicating the memory for the properties. Also, it's necessary if you want to create sub classes. Read this to learn about the prototype and constructor properties
type: Answer
has comment: http://stackoverflow.com/comment/45918243
has comment: http://stackoverflow.com/comment/45918275
answers question: http://stackoverflow.com/q/28823283
score: 0

http://stackoverflow.com/comment/45914632
type: QuestionComment
has text: What you have is a JavaScript array containing JavaScript objects. Nothing what you posted has anything to do with JSON.
comment on: http://stackoverflow.com/q/28821432
score: 0
type: Comment

http://stackoverflow.com/comment/45941057
type: AnswerComment
comment on: http://stackoverflow.com/a/28832163
type: Comment
has text: I want the page to stay at the same page until a "sub-item" has actually been pressed. Sorry if I'm asking stupid questions. It's really new to me this whole thing!
score: 0

http://stackoverflow.com/a/28756435
type: Answer
has comment: http://stackoverflow.com/comment/45794010
has body: If I'm understanding you correctly, you can just use a dictionary to contain the grades. var names = { "David": "A", "Paul": "C", "Laura": "B", "Joe": "D", "Kevin": "A" }; function getGrade(name) { return names[name]; } function getName(grade) { var students = []; for (var name in names) { if (names[name] == grade) { students.push(name); } } return students; } console.log(getGrade("David")); // A console.log(getName("A")) //["David", "Kevin"]
answers question: http://stackoverflow.com/q/28756353
score: 0

http://stackoverflow.com/comment/46071565
type: AnswerComment
has text: Yes but what happens if the OP has two names in the root level? I took the initiative of returning a list. But it's always possible to extract the first element of my output.
comment on: http://stackoverflow.com/a/28905959
type: Comment
score: 2

http://stackoverflow.com/comment/45863505
has text: @sinanspd no, it is something like this: http://i59.tinypic.com/r9rjn5.jpg
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28778058

http://stackoverflow.com/comment/45973153
type: Comment
type: QuestionComment
has text: "Well, it seemed like a good idea" is perfectly valid :) There might have been another reason I couldn't see from your code example, so it couldn't hurt to ask.
comment on: http://stackoverflow.com/q/28851855
score: 0

http://stackoverflow.com/comment/45955962
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28839512
type: Comment
has text: i'm familiar with R# but not with respect to running ng tests. have you looked at the R# Javascript specific test settings, ie this page? http://imgur.com/Rq2yh7E

http://stackoverflow.com/a/28897304
has body: Is it possible in MongoDB to $push the new on to the front, while simultaneously using $pop to remove an equal amount of objects off the back? Yes, using $slice: $push: { data: { $each: [ { ... }, { ... } ], // your batch $slice: -100 // maximum array size } } For an example, see http://docs.mongodb.org/manual/tutorial/limit-number-of-elements-in-updated-array/
answers question: http://stackoverflow.com/q/28897151
downvote count: 0
upvote count: 6
has comment: http://stackoverflow.com/comment/46054312
type: Answer
score: 6

http://stackoverflow.com/a/54827309
score: 1
upvote count: 1
has body: If you're doing browser automation you need to think what your user will be doing. I'm aware this is old but incase other people find it. send_keys uses the default selenium implementation that types keys as a user would. If you "can" use this, you "should" use this.
downvote count: 0
answers question: http://stackoverflow.com/q/28754408
type: Answer

http://stackoverflow.com/a/28858180
type: Answer
has body: you can use a boolean that switches: var done=true; $('.btn-1').click(function(){ $('log').html($('log').html()+'bt1 pressed&lt;br&gt;') if(done){ done=false; $('.btn-2').click() } done=true; }) http://jsfiddle.net/2o3k5wet/
score: 0
answers question: http://stackoverflow.com/q/28857696

http://stackoverflow.com/q/28865266
tagged with: angularjs
has answer: http://stackoverflow.com/a/28865705
tagged with: factory
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28865705
has comment: http://stackoverflow.com/comment/45996355
score: 0
tagged with: angularjs-scope
type: Question
has body: I have some code like this: (function() { 'use strict'; angular.module('outApp.core') .factory('socket', socketDataService); function socketDataService() { var service = { openSocket: openSocket, closeSocket: closeSocket, getUpdates: getUpdates, sendUpdates: sendUpdates, }; return service; function openSocket() { var contextPath = document.location.href.split('/#')[0]; var sock = new SockJS(contextPath + '/api/cart'); var stompClient = Stomp.over(sock); stompClient.connect({}, function(frame) { console.log('Connected ' + frame); stompClient.subscribe("/app/cart", {}, { customerId: "4654654", cartId: "54654" }); }); } There are other named functions as shown in the JS object named service at the beginning but I'm excluding them for brevity. I am trying to grant access to the functions I mentioned in the service object using a factory constructor that should be injectable and therefore accessible in our entire app. I have two questions: Is this the correct way to define and return the methods? I know I can define: var service.method = function () { //do stuff } var service.anothermethod = function () { // do other stuff } return service; but for clarity, readability and style we have chosen to do it this way. I have seen another developer do it the first way but I'm not clear on what is going on. Next question: how can I access and thus test these methods within the function? I set a debugger at the end of the factory but I am not able to see the methods in the console. Thanks!
tagged with: javascript
has comment: http://stackoverflow.com/comment/45996269
has title: HOW TO: Angular Factory method declared in a JavaScript object?
answer count: 1
linked to: http://stackoverflow.com/q/14324451
has comment: http://stackoverflow.com/comment/45996471

performance
tags question: http://stackoverflow.com/q/28887739
tags question: http://stackoverflow.com/q/28783930
tags question: http://stackoverflow.com/q/28819197
tags question: http://stackoverflow.com/q/28762959
tags question: http://stackoverflow.com/q/28838631
tags question: http://stackoverflow.com/q/28877941
tags question: http://stackoverflow.com/q/28792469
tags question: http://stackoverflow.com/q/28820656
tags question: http://stackoverflow.com/q/28883115
tags question: http://stackoverflow.com/q/28755433
tags question: http://stackoverflow.com/q/28770476
tags question: http://stackoverflow.com/q/28810292
tag name: performance
tags question: http://stackoverflow.com/q/28890280
tags question: http://stackoverflow.com/q/28790702
tags question: http://stackoverflow.com/q/28835717
type: Tag
tags question: http://stackoverflow.com/q/28765343
tags question: http://stackoverflow.com/q/28768211

http://stackoverflow.com/comment/45854454
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28789496
has text: It's a json file. You can still make a jsonp request can't you?
score: 0

http://stackoverflow.com/q/28842520
favorite count: 0
has answer: http://stackoverflow.com/a/28843532
answer count: 1
linked to: http://stackoverflow.com/q/1936021
upvote count: 2
has title: Click on line in canvas
tagged with: line
score: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28843532
has body: Is it possible get info, if is click on line in canvas? var canvas; var x = 200; var y = 200; var dx=4; var dy=4; var d = 5; var width, height; function init() { canvasE = document.getElementById('game'); canvas= canvasE.getContext('2d'); width = canvasE.width; height = canvasE.height; canvasE.addEventListener("click", onClick, false); drawCircle(); } function drawCircle() { clear(); canvas.arc(x-1,y-1,d,0,Math.PI*2,true); canvas.beginPath(); canvas.arc(x-1,y-1,d,0,Math.PI*2,true); canvas.closePath(); canvas.fill(); canvas.beginPath(); canvas.moveTo(20,20); canvas.lineTo(150,100); canvas.stroke(); //check if click coords within current path if(canvas.isPointInPath(x,y)) { document.getElementById("inPath").innerHTML = "yes"; } else { document.getElementById("inPath").innerHTML = "no"; } canvas.closePath(); } function clear() { canvas.fillStyle="#ffffff"; canvas.fillRect(0,0,width,height); canvas.fillStyle="#ff0000"; canvas.strokeRect(0,0,width,height); } function onClick(e) { var element = canvasE; var offsetX = 0, offsetY = 0 if (element.offsetParent) { do { offsetX += element.offsetLeft; offsetY += element.offsetTop; } while ((element = element.offsetParent)); } x = e.pageX - offsetX; y = e.pageY - offsetY; drawCircle(); document.getElementById("info").value = "x: " + x + ", y: " + y; } init(); canvas, input { margin: 10px; text-align: center; } No Thanks
type: Question
tagged with: canvas
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/46001538
comment on: http://stackoverflow.com/q/28868466
score: 0
type: QuestionComment
type: Comment
has text: Say i want to display an iFrame with the item1 = height and item2=width. I get the content of iFrame from mypage.php. But i want to use some attributes of the var item1 to item5. I apologise as the var list of the first script is : `code `

http://stackoverflow.com/a/28780857
has body: That code is not recursive per se, quite the contrary, it uses continuation passing to eliminate tail calls. Here's an example without setTimeout: // naive, direct recursion function sum_naive(n) { return n == 0 ? 0 : n + sum_naive(n-1); } try { sum_naive(50000) } catch(e) { document.write(e + "&lt;br&gt;") } // use CPS to optimize tail recursive calls function sum_smart(n) { function f(s, n) { return n == 0 ? s : function() { return f(s+n, n-1) }; } var p = f(0, n) while(typeof p == "function") p = p() return p; } document.write(sum_smart(50000) + "&lt;br&gt;") CPS is commonly used for tail recursion optimization in languages that don't support it out of the box. Javascript's setTimeout basically takes the current continuation and "throws" it to the main thread. Once the main thread is ready, it "catches" the continuation and runs the code in the restored context.
upvote count: 5
has comment: http://stackoverflow.com/comment/96691707
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/28780657
score: 5

http://stackoverflow.com/a/28840266
has body: eX is a valid part of a Number literal and means *10^X, just like in scientific notation: &gt; 1e1 // 1 * Math.pow(10, 1) 10 &gt; 1e2 // 1 * Math.pow(10, 2) 100 And because of that, converting a string containing such a character sequence results in a valid number: &gt; var x = 2; &gt; Number(x + "e1") 20 &gt; Number(x + "e2") 200 For more information, have a look at the MDN JavaScript Guide. But of course the way this notation is used in your example is horrible. Converting values back and forth to numbers and strings is already bad enough, but it also makes it more difficult to understand. Simple multiple or divide by a multiple of 10.
answers question: http://stackoverflow.com/q/28840207
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45950637
accepted answer of: http://stackoverflow.com/q/28840207
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/comment/45796254
has text: They both accomplish the same thing really, but if you're pedantic about it you can replace that line with: `list.innerHTML += " "+nameList[nameList.length-1]+" ";`
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28757706
type: Comment

http://stackoverflow.com/a/28822569
score: 0
answers question: http://stackoverflow.com/q/28822425
has comment: http://stackoverflow.com/comment/45943776
type: Answer
has comment: http://stackoverflow.com/comment/45988424
has comment: http://stackoverflow.com/comment/45988602
has body: Can you give me an example of where it does that? I copy pasted your code and for me it gives the correct values. From what I understand the only thing you are writting into the cost per gallon field is the gallons used times the price per gallon. An that seems to be working fine. If you can provide me with a example calculation you want to achive i'd be happy to help. On another note, i suggest not using the same variable again in line 27 that you used to hold the DOM object of the input field. Also toFixed does not change the variable you used it on but return a new variable so instead remove that in line 28 and have line 27 look something like this: var newVarNameIsBoss = (gallons*costGallon).toFixed(2); Hope this helps revised code &lt;!DOCTYPE html&gt; &lt;!-- scorrect doctype--&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;title&gt; MPG application &lt;/title&gt; &lt;script&gt; var $ = function(id) { return document.getElementById(id); };//remember that a var decleration always ends with a ; even if it's a function /* the user entries will be parsed floats and a if statment is checking to see if the person enters not #*/ var calculateMpg = function () { var miles = parseFloat($("miles").value), //alert(miles); gallons = parseFloat($("gallons").value), costGallon = document.getElementById("costGallon").value, mpg,totalCost; if (isNaN(miles) || isNaN(gallons)) { alert("enter a valid number"); } else { mpg = miles/gallons; totalCost = (gallons*costGallon).toFixed(2); costGallon.value=totalCost; alert("your total new is " + totalCost); $('totalMpg').innerHTML = String(mpg.toFixed(2)) + " Miles per Gallon"; } };//remember that a var decleration always ends with a ; even if it's a function //write to the page window.onload = function () { $("calculate").onclick = calculateMpg; //focues means brings the window to the front $("costGallon").focus(); };//remember that a var decleration always ends with a ; even if it's a function &lt;/script&gt; &lt;/he…

angularjs
tags question: http://stackoverflow.com/q/28855356
tags question: http://stackoverflow.com/q/28849943
tags question: http://stackoverflow.com/q/28773083
tags question: http://stackoverflow.com/q/28889155
tags question: http://stackoverflow.com/q/28842569
tags question: http://stackoverflow.com/q/28828286
tags question: http://stackoverflow.com/q/28837878
tags question: http://stackoverflow.com/q/28840114
tags question: http://stackoverflow.com/q/28752671
tags question: http://stackoverflow.com/q/28793025
tags question: http://stackoverflow.com/q/28821511
tags question: http://stackoverflow.com/q/28876380
tags question: http://stackoverflow.com/q/28777518
tags question: http://stackoverflow.com/q/28877887
tags question: http://stackoverflow.com/q/28869877
tags question: http://stackoverflow.com/q/28839512
tags question: http://stackoverflow.com/q/28788106
tags question: http://stackoverflow.com/q/28828626
tags question: http://stackoverflow.com/q/28815343
tags question: http://stackoverflow.com/q/28772134
tags question: http://stackoverflow.com/q/28818924
tags question: http://stackoverflow.com/q/28762293
tags question: http://stackoverflow.com/q/28751856
tags question: http://stackoverflow.com/q/28877611
tags question: http://stackoverflow.com/q/28793621
tags question: http://stackoverflow.com/q/28757476
tags question: http://stackoverflow.com/q/28893954
tags question: http://stackoverflow.com/q/28807391
tags question: http://stackoverflow.com/q/28817312
tags question: http://stackoverflow.com/q/28765856
tags question: http://stackoverflow.com/q/28787241
tags question: http://stackoverflow.com/q/28804891
tags question: http://stackoverflow.com/q/28773900
tags question: http://stackoverflow.com/q/28861733
tags question: http://stackoverflow.com/q/28843314
tags question: http://stackoverflow.com/q/28857942
tags question: http://stackoverflow.com/q/28874623
tags question: http://stackoverflow.com/q/28833405
tags question: http://stackoverflow.com/q/28905390
tags question: http://stackoverflow.com/q/28833844
tags question: http://stackoverflow.com/q/28818006
tags question: http://stackoverflow.com/q/28790207
tags question: http://stackoverflow.com/q/28892498
tags question: http://stackoverflow.com/q/28787469
tags question: http://stackoverflow.com/q/28840516
tags question: http://stackoverflow.com/q/28858566
tags question: http://stackoverflow.com/q/28849704
tags question: http://stackoverflow.com/q/28779672
tags question: http://stackoverflow.com/q/28756038
tags question: http://stackoverflow.com/q/28865857
tags question: http://stackoverflow.com/q/28874898
tags question: http://stackoverflow.com/q/28825748
tags question: http://stackoverflow.com/q/28772822
tags question: http://stackoverflow.com/q/28820468
tags question: http://stackoverflow.com/q/28781241
tags question: http://stackoverflow.com/q/28886811
tags question: http://stackoverflow.com/q/28858661
tags question: http://stackoverflow.com/q/28817063
tags question: http://stackoverflow.com/q/28887430
tags question: http://stackoverflow.com/q/28769742
tags question: http://stackoverflow.com/q/28875575
tags question: http://stackoverflow.com/q/28869287
tags question: http://stackoverflow.com/q/28859773
tags question: http://stackoverflow.com/q/28763840
tags question: http://stackoverflow.com/q/28785839
tags question: http://stackoverflow.com/q/28826465
tags question: http://stackoverflow.com/q/28815102
tags question: http://stackoverflow.com/q/28879005
tags question: http://stackoverflow.com/q/28854371
tags question: http://stackoverflow.com/q/28857189
tags question: http://stackoverflow.com/q/28879865
tags question: http://stackoverflow.com/q/28812122
tags question: http://stackoverflow.com/q/28820195
tags question: http://stackoverflow.com/q/28846221
type: Tag
tags question: http://stackoverflow.com/q/28872720
tags question: http://stackoverflow.com/q/28761517
tags question: http://stackoverflow.com/q/28819760
tags question: http://stackoverflow.com/q/28856788
tags question: http://stackoverflow.com/q/28778257

http://stackoverflow.com/a/28774652
has comment: http://stackoverflow.com/comment/45834879
accepted answer of: http://stackoverflow.com/q/28773631
type: Answer
has comment: http://stackoverflow.com/comment/45829558
answers question: http://stackoverflow.com/q/28773631
upvote count: 1
has body: EDIT: Updated comments in answer and updated code. There were a number of things that stopped your code from working, alas I'm tired and forgot to make note of them as I went and have forgotten the specifics. :( You may wish to review the following code. It loads the images using a fileReader and the method .readAsDataURL. This then fires a user-supplied callback on completion. This callback method then attempts to load the dataURL as an image. When (if!) this succeeds, the image is drawn onto a scaled canvas and then the dataURL of that canvas is retrieved. This dataURL is added to an array and the number of scaled images is compared to the number of selected images. When the two numbers match, it JSON encodes the array and stuffs it into the hidden input, before submitting the form. On the php side, we get the submitted data and JSON decode it. We then display a count of the number of images in this array, before ouputing each element as the src of an image,to confirm successful upload. I've added code that will ensure the chosed file is an image before processing it any further. You can select a mixed list of files and only the images will be processed. I don't handle the case when the chosen file is an image yet trying to load it into an img element fails. resizeAndUpload.html submit! save.php <?php $imgArray = json_decode( $_POST['sizedpics'] ); print_r( count($imgArray) ); $numPics = count($imgArray); for ($i=0; $i<$numPics; $i++) { printf(" \n", $imgArray[$i]); } ?> Output Your English is just fine.It's better than that of many native-speakers. ;)
has comment: http://stackoverflow.com/comment/45828245
score: 1
has comment: http://stackoverflow.com/comment/45828282
has comment: http://stackoverflow.com/comment/45827797
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/28808575
type: Answer
answers question: http://stackoverflow.com/q/28808504
has body: Just Use if (url) { // require a URL window.location.href = url; // redirect } Because in the options value you're not passing the complete URL.
has comment: http://stackoverflow.com/comment/45889747
upvote count: 1
score: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45889659

http://stackoverflow.com/comment/45810178
comment on: http://stackoverflow.com/q/28765587
type: Comment
type: QuestionComment
has text: do you have any fiddle for this?
score: 0

http://stackoverflow.com/comment/46016871
comment on: http://stackoverflow.com/q/28874957
score: 0
type: Comment
type: QuestionComment
has text: Thanks Lars! In principle I think I understand what you're telling me. But obviously not well enough to get it to work. I have updated the original question...

http://stackoverflow.com/a/28772355
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28771898
score: 1
upvote count: 1
has body: It sounds from your description as if you have two separate node apps, and each one serves its own purpose. Regardless of how these apps are implemented, the best way to handle this sort of thing is via multiple heroku apps. This is what they were designed for! You can think of a Heroku app as a single-purpose web server. If you have one codebase that does something independent of another, create two Heroku apps. If you have 3 codebases that all do different things, make 3 Heroku apps. In addition to this being the best way to handle this sort of thing in general (you get more reliability as each service has it's own servers), it's also cheaper: you get 1 free Heroku dyno per app, this means you'll have 2x's the free web servers you would have otherwise.

http://stackoverflow.com/q/28855773
tagged with: javascript
has comment: http://stackoverflow.com/comment/45977575
answer count: 3
has comment: http://stackoverflow.com/comment/45977654
has answer: http://stackoverflow.com/a/28855874
has comment: http://stackoverflow.com/comment/45977641
has comment: http://stackoverflow.com/comment/45977660
favorite count: 0
has body: I'm trying to make a counter, that can only go from 0, to a max of 10, right now I can add and delete number from the counter, but for some reason my if/else never works, no matter where I put them. I'm a real noob to javascript so if anyone could give me some advice it would be highly appreciated. Here's my code: &lt;script type="text/javascript"&gt; var clicks = 0; if (clicks &lt; 0) { clicks = 0; document.getElementById("ticketAmmount").innerHTML = clicks; } function onClick() { clicks += 1; document.getElementById("ticketAmmount").innerHTML = clicks; }; function offClick() { clicks -= 1; document.getElementById("ticketAmmount").innerHTML = clicks; } i also have tried this: but then the counter gives me NaN &lt;script type="text/javascript"&gt; var clicks = 0; function onClick() { if (clicks &lt; 0) { clicks = 0; document.getElementById("ticketAmmount").innerHTML = clicks; } else { clicks += 1; document.getElementById("ticketAmmount").innerHTML = clicks; } }; function offClick() { clicks -= 1; document.getElementById("ticketAmmount").innerHTML = clicks; } &lt;/script&gt;
has comment: http://stackoverflow.com/comment/45977943
has comment: http://stackoverflow.com/comment/45977587
has answer: http://stackoverflow.com/a/28855869
score: 0
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/28855964
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28855874
possible better answer: http://stackoverflow.com/a/28855964
has title: javascript counter with if else
type: Question
has comment: http://stackoverflow.com/comment/45977640

http://stackoverflow.com/comment/45832019
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28776739
type: Comment
has text: Im confused man, can you put it in a fiddle for me, it will not work. :/

http://stackoverflow.com/comment/46036813
type: AnswerComment
comment on: http://stackoverflow.com/a/28887729
type: Comment
has text: Have you entered anything in the `input`?
score: 0

http://stackoverflow.com/q/28769668
linked to: http://stackoverflow.com/q/7744611
tagged with: javascript
tagged with: jquery
has body: Is there any how javascript or jquery to store values in the given variables while interacting through functions wuthout using global vars? I made an example: http://jsfiddle.net/1fw2urks/3/ $(document).ready(function(){ start(); }); function start(){ var n = 0; for (i = 0; i &lt; 10; i++){ count(n); } alert(n); } function count(n){ countAgain(n); } function countAgain(n){ n += 1; } n var should come with value 10 if it worked, but it seems that we can't change the passed parameters value while in the function. Is this affirmation right? (I did some research and i found this answer, but, I am stubborn)
has title: Store value in the given variable through functions
duplicate of: http://stackoverflow.com/q/10231868
score: 0
duplicate of: http://stackoverflow.com/q/7744611
type: UnansweredQuestion
answer count: 0
has comment: http://stackoverflow.com/comment/45820973
type: Question
has comment: http://stackoverflow.com/comment/45817983
linked to: http://stackoverflow.com/q/10231868

http://stackoverflow.com/comment/45943995
comment on: http://stackoverflow.com/q/28837247
type: Comment
type: QuestionComment
has text: But that shouldn't happend for 30 seconds given the example....
score: 0

twitter-bootstrap
tags question: http://stackoverflow.com/q/28838041
tags question: http://stackoverflow.com/q/28895039
tags question: http://stackoverflow.com/q/28904361
tag name: twitter-bootstrap
tags question: http://stackoverflow.com/q/28847897
tags question: http://stackoverflow.com/q/28832380
tags question: http://stackoverflow.com/q/28894500
tags question: http://stackoverflow.com/q/28780115
tags question: http://stackoverflow.com/q/28867372
tags question: http://stackoverflow.com/q/28797407
tags question: http://stackoverflow.com/q/28819574
tags question: http://stackoverflow.com/q/28771135
tags question: http://stackoverflow.com/q/28774037
tags question: http://stackoverflow.com/q/28852837
tags question: http://stackoverflow.com/q/28815007
tags question: http://stackoverflow.com/q/28827332
tags question: http://stackoverflow.com/q/28783320
tags question: http://stackoverflow.com/q/28876568
tags question: http://stackoverflow.com/q/28838071
tags question: http://stackoverflow.com/q/28855576
tags question: http://stackoverflow.com/q/28807755
tags question: http://stackoverflow.com/q/28761104
tags question: http://stackoverflow.com/q/28787469
tags question: http://stackoverflow.com/q/28791944
tags question: http://stackoverflow.com/q/28897715
tags question: http://stackoverflow.com/q/28893726
tags question: http://stackoverflow.com/q/28775318
tags question: http://stackoverflow.com/q/28814057
tags question: http://stackoverflow.com/q/28823608
tags question: http://stackoverflow.com/q/28856693
tags question: http://stackoverflow.com/q/28802655
tags question: http://stackoverflow.com/q/28873280
tags question: http://stackoverflow.com/q/28795036
tags question: http://stackoverflow.com/q/28773707
tags question: http://stackoverflow.com/q/28853522
tags question: http://stackoverflow.com/q/28787472
tags question: http://stackoverflow.com/q/28863852
tags question: http://stackoverflow.com/q/28792580
tags question: http://stackoverflow.com/q/28837875
tags question: http://stackoverflow.com/q/28852519
tags question: http://stackoverflow.com/q/28847998
tags question: http://stackoverflow.com/q/28800643
tags question: http://stackoverflow.com/q/28765037
tags question: http://stackoverflow.com/q/28800656
tags question: http://stackoverflow.com/q/28891634
tags question: http://stackoverflow.com/q/28808919
tags question: http://stackoverflow.com/q/28827025
tags question: http://stackoverflow.com/q/28807391
tags question: http://stackoverflow.com/q/28845569
tags question: http://stackoverflow.com/q/28762569
tags question: http://stackoverflow.com/q/28753211
tags question: http://stackoverflow.com/q/28858661
tags question: http://stackoverflow.com/q/28801475
tags question: http://stackoverflow.com/q/28824561
type: Tag
tags question: http://stackoverflow.com/q/28856420
tags question: http://stackoverflow.com/q/28840455
tags question: http://stackoverflow.com/q/28877382
tags question: http://stackoverflow.com/q/28868060
tags question: http://stackoverflow.com/q/28831959
tags question: http://stackoverflow.com/q/28763970
tags question: http://stackoverflow.com/q/28763920
tags question: http://stackoverflow.com/q/28822867
tags question: http://stackoverflow.com/q/28784254
tags question: http://stackoverflow.com/q/28824374
tags question: http://stackoverflow.com/q/28781146
tags question: http://stackoverflow.com/q/28754084
tags question: http://stackoverflow.com/q/28848743
tags question: http://stackoverflow.com/q/28896660
tags question: http://stackoverflow.com/q/28777486
tags question: http://stackoverflow.com/q/28842921
tags question: http://stackoverflow.com/q/28771513
tags question: http://stackoverflow.com/q/28860113
tags question: http://stackoverflow.com/q/28785558
tags question: http://stackoverflow.com/q/28827328
tags question: http://stackoverflow.com/q/28752851
tags question: http://stackoverflow.com/q/28903225
tags question: http://stackoverflow.com/q/28764622
tags question: http://stackoverflow.com/q/28857322
tags question: http://stackoverflow.com/q/28831185

http://stackoverflow.com/comment/45819547
type: QuestionComment
comment on: http://stackoverflow.com/q/28770405
has text: This may help, http://stackoverflow.com/questions/7708819/keep-only-first-n-characters-in-a-string
score: 0
type: Comment

http://stackoverflow.com/a/28805535
has body: When you access an array entry that doesn't exist, you get the value undefined. Your code is trying to add properties to undefined, which you can't do (you get a TypeError). To add objects to your array, you add objects, perhaps using an object initializer: var myArray = []; myArray[0] = { binary: 'qweqwe', src: 'qweqwe' }; myArray[1] = { binary: 'zxczxc', src: 'zxczxc' }; myArray[2] = { binary: 'asdasd', src: 'asdasd' }; console.log(myArray); You can actually combine those with the array initializer: var myArray = [ { binary: 'qweqwe', src: 'qweqwe' }, { binary: 'zxczxc', src: 'zxczxc' }, { binary: 'asdasd', src: 'asdasd' } ]; console.log(myArray); ...which may be clearer, and has the advantage of making it a bit easier to reorder them (e.g., in the source, if you need to put them in a different initial order). Or you can use push to make it easier to reorder them: var myArray = []; myArray.push({ binary: 'qweqwe', src: 'qweqwe' }); myArray.push({ binary: 'zxczxc', src: 'zxczxc' }); myArray.push({ binary: 'asdasd', src: 'asdasd' }); console.log(myArray); Any of those works, pick the one most appropriate to what you're doing.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28805420

http://stackoverflow.com/comment/46044644
type: Comment
has text: OK, so I've given you the information needed correctly then. Also you won't have any problem finding lots of tutorials on manipulating dates
type: AnswerComment
comment on: http://stackoverflow.com/a/28891669
score: 0

http://stackoverflow.com/a/28808889
accepted answer of: http://stackoverflow.com/q/28808504
type: Answer
has body: So, assuming your URLs have query strings such as "?hello=about", "?hello=xxx" etc. the following should work. Drop this code just after the selectbox bind method. Bear in mind that I've not tested this code. var option = location.search.replace(/(^\?hello=[^&amp;#]+).*?$/i, "$1"); $('#selectbox').val(option);
upvote count: 1
type: AcceptedAnswer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28808504

http://stackoverflow.com/q/28876380
has answer: http://stackoverflow.com/a/30769621
answer count: 4
type: AnsweredQuestion
upvote count: 0
has body: I have a form: &lt;form ng-submit="submitForm()" name="theForm"&gt; &lt;input type="number" name="age" ng-model="age" /&gt; &lt;input type="submit" value="Submit" /&gt; &lt;/form&gt; which I then submit with: $scope.submitForm = function() { $http.post('/someplace', $scope.theForm); } The problem is that I want the POSTed data to be { "age", 42 } but instead it is { "$error": {}, "$name": "theForm", "$dirty": true, "$pristine": false, "$valid": true, "$invalid": false, "$submitted": true, "age": { "$viewValue": "42", "$modelValue": "42", "$validators": {}, "$asyncValidators": {}, "$parsers": [ null, null ], "$formatters": [ null ], "$viewChangeListeners": [], "$untouched": false, "$touched": true, "$pristine": false, "$dirty": true, "$valid": true, "$invalid": false, "$error": {}, "$name": "age", "$options": null } } Is there a simple built-in way in angular to get the desired output?
tagged with: http://stackoverflow.com/tag/json
type: Question
accepted answer: http://stackoverflow.com/a/28877106
has answer: http://stackoverflow.com/a/28876448
tagged with: javascript
score: -1
possible better answer: http://stackoverflow.com/a/28876448
has answer: http://stackoverflow.com/a/28876849
has answer: http://stackoverflow.com/a/28877106
downvote count: 1
has title: POST form data from angularjs to server
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/comment/45830355
comment on: http://stackoverflow.com/q/28775793
score: 0
type: Comment
type: QuestionComment
has text: As far as I know userscripts can't do that. Unless it's a third party application entirely.

http://stackoverflow.com/q/28820983
answer count: 2
downvote count: 0
has body: I am using RadButton and RadWindow. On my RadButton I am trying to use OnClick and OnClientClick together to show a popup first and then go to a page via a server call. <telerik:RadButton ID="btnMedLogin" CssClass="actionButton secondary" runat="server" Text="Doctor Login" SingleClick="true" SingleClickText="Logging in" OnClick="btnDoctor_Click" OnClientClick="openwin();return false"> </telerik:RadButton> When I just put OnClick="btnDoctor_Click" It works fine. however I want my radwindow modal to show as well so I put OnClientClick="openwin();" but it isn't working. I tried OnClientClicked but not working either. Here is the rest of the code function openwin() { window.radopen(null, "RadWindow1"); } <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Width="500px" Height="500px"> <telerik:RadWindow ID="RadWindow1" runat="server" Modal="true" Behaviors="close" Title="Countdown Clock"> Some Text </telerik:RadWindow> </telerik:RadWindowManager> How can I make it so it goes to the page and my radwindow pop up shows up?
tagged with: asp.net
favorite count: 0
accepted answer: http://stackoverflow.com/a/28822128
tagged with: telerik
has answer: http://stackoverflow.com/a/28859500
has answer: http://stackoverflow.com/a/28822128
score: 1
upvote count: 1
type: Question
has title: Using OnClick and OnClientClick together doesn't work
type: AnsweredQuestion
tagged with: javascript
tagged with: webforms
possible better answer: http://stackoverflow.com/a/28859500

http://stackoverflow.com/comment/45983838
score: 0
type: AnswerComment
has text: a big thanks my friend
type: Comment
comment on: http://stackoverflow.com/a/28858538

http://stackoverflow.com/a/28757422
answers question: http://stackoverflow.com/q/28757279
type: Answer
has body: If I'm understanding you correctly, something like this may work. When a checkbox is clicked, it will calculate the total of all checkboxes, multiply that against the users input, and output it. // When a checkbox is clicked $('#container input[type=checkbox]').click(function() { // Get user input and set initial variable for the total inputBox = parseInt($('#chatinput').val()); totalCheckbox = 0; // itterate through each checkbox // If it's checked, add the current value to total $('#container input[type=checkbox]').each(function() { if($(this).prop('checked')) { thisValue = parseInt($(this).val()); totalCheckbox = totalCheckbox + thisValue; } }); // Output the total checkbox value multipled against user input $('#Totalcost').html(total * inputBox); }); jsfiddle
score: 0

http://stackoverflow.com/q/28862923
linked to: http://stackoverflow.com/q/17246133
has title: Get configs from background page to content script in chrome extension
has answer: http://stackoverflow.com/a/28867761
type: Question
tagged with: google-chrome-extension
score: 0
answer count: 2
tagged with: google-chrome
has body: I'm trying to get some user configs from the background page of my chrome extension to the content script (or popup) but I'm having some problems, I think the problem is that chrome.storage.sync.get is async, I tried using callbacks but I also read that callbacks can't return the value so I have no idea how to solve this. Here's kinda how the code looks: popup.js: (function() { chrome.runtime.sendMessage({ message: "loadconfig" }, function(response) { console.log(response); if (response.status === 'success') { console.log(response); } else { console.log(response.except); } }); })(); background.js (function() { chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) { switch (request.message) { case "loadconfig": sendResponse(loadStuff()); break; default: sendResponse({ reply: null }); break; } }); function loadStuff() { var to_return_configs = { blocked_characters: '', good_post: '' }; var function_status = 'failed'; var exception = ''; var blocked_characters_parsed, good_post_parsed; try { var to_get = ["blocked_characters_saved", "good_post_saved"]; chrome.storage.sync.get(to_get, function(result) { to_get.forEach(function(got) { if (got === "good_post_saved") { to_return_configs.good_post = result[got]; } if (got === "blocked_characters_saved") { to_return_configs.blocked_characters = result[got]; } }); }); exception = ''; function_status = 'success'; } catch (err) { exception = String(err); function_status = 'failed'; } var to_return = { status: function_status, configs: to_return_configs, except: (exception) }; return to_return; } })(); The problem here is that when I'm looking at the popup.js console, "blocked_characters" and "good_post" are both empty. How can I solve this?
has answer: http://stackoverflow.com/a/28863636
tagged with: javascript
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/17377911

http://stackoverflow.com/comment/46062208
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28882602
has text: It works under the same premise as jQuery's old `live` method. It binds the event handler to the document, which always exists, and then delegates to a sub-item as the item comes and goes. This is a way to bind events to elements that may or may not exist on the page. You can read more here: http://api.jquery.com/on/
type: AnswerComment

http://stackoverflow.com/comment/45898398
type: QuestionComment
has text: Especially note that with the loop, you are creating many regexs, which all need to be compiled etc. The version in the first comment here has 1 regex that covers all forms of `{...}`
score: 0
comment on: http://stackoverflow.com/q/28812932
type: Comment

http://stackoverflow.com/q/28890213
has answer: http://stackoverflow.com/a/28890350
has comment: http://stackoverflow.com/comment/46041633
has body: I have the following code that creates a few functions: hidePara1(), which toggles between the CSS hidden attribute of a paragraph; and displayFrame(), which does the same with the display attribute of an Iframe. Both the paragraph and the Iframe are set to display:none and visibility:hidden respectively, using CSS. var Par1 = document.getElementById("para1"); var Frame1 = document.getElementById("iframe1"); function hidePara1() { Par1.style.display = ((Par1.style.display!='none') ? 'none' : 'block') } function displayFrame() { Frame1.style.visibility = ((Frame1.style.visibility!='hidden') ? 'hidden' : 'visible'); } And the HTML where the elements exist, and in which I also call the functions via onClick attributes. Display iFrame This is the text for paragraph 1. The problem is bizarre: both onclick events work perfectly, from the second click onwards. In other words, neither works when first clicked. This seems to be quite a common problem, judging by the tons of other similar questions I came across, but I can't figure it out, and one of those questions could help me. Note that it also needs to be vanilla JS - frameworks won't do. A solution to this would be very appreciated. Thanks
has answer: http://stackoverflow.com/a/28890334
has answer: http://stackoverflow.com/a/28890351
answer count: 4
type: AnsweredQuestion
has title: OnClick Functions Only Work On Second Click
possible better answer: http://stackoverflow.com/a/28890351
type: Question
accepted answer: http://stackoverflow.com/a/28890334
tagged with: javascript
has answer: http://stackoverflow.com/a/28890333
score: 0

http://stackoverflow.com/a/28790360
has body: Sorry, I missed that, but it's fixed now. Please get the latest version of breeze.d.ts from the Breeze github repo. I've sent a pull request to DefinitelyTyped also, but that can take a few days. Thanks for letting us know.
accepted answer of: http://stackoverflow.com/q/28766724
has comment: http://stackoverflow.com/comment/45905763
upvote count: 1
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/45859357
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28766724

http://stackoverflow.com/a/28755408
type: Answer
score: 1
upvote count: 1
downvote count: 0
has body: Is there any reason you can't still use the static ID? var staticID = '&lt;?php echo $nospaces; ?&gt;'; $('#' + staticID).dataTable();
answers question: http://stackoverflow.com/q/28754786

http://stackoverflow.com/a/28769336
score: 1
type: Answer
has body: As forked from your update 1: http://jsfiddle.net/5ka355sa/ Two changes 1. ng-bind is always an expression, don't use curly braces there. 2. You used ng-minlength = "18" which mean things like 'foo' were invalid as they were too short. Invalid values aren't added to the model. `\ Alternatively for the label you can do {{inputMaxLength - input.length}} characters left.
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28768268

http://stackoverflow.com/q/28870075
score: 0
has body: $(function ($) { var gridster; widget_base_width: 240; widget_base_height: 240; widget_margin_h: 10; widget_margin_v: 10; gridActive: false; this.gridster = $('.gridster ul').gridster({ widget_margins : [this.widget_margin_h, this.widget_margin_v], widget_base_dimensions : [this.widget_base_width, this.widget_base_height], helper : 'clone', draggable : {} }).data('gridster'); $(".chart-button").click(function () { this.gridster.add_widget(' heloooooo '); }); }); I am using this code to add the tile using gridster but I am getting error saying : Uncaught TypeError: Cannot read property 'add_widget' of undefined (anonymous function) x.event.dispatch jquery-1.10.2.min.js:22 v.handle jquery-1.10.2.min.js:22
answer count: 1
accepted answer: http://stackoverflow.com/a/28930716
type: AnsweredQuestion
tagged with: gridster
type: Question
has answer: http://stackoverflow.com/a/28930716
tagged with: javascript
tagged with: jquery
has title: Javascript error while adding grid using Gridster

http://stackoverflow.com/comment/45932568
has text: Where are your icons? http://i.imgur.com/RqqMfXV.png
comment on: http://stackoverflow.com/q/28831059
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/q/28862456
tagged with: datatables-1.10
has comment: http://stackoverflow.com/comment/45991353
score: 0
has comment: http://stackoverflow.com/comment/45991345
tagged with: datatables
answer count: 1
has comment: http://stackoverflow.com/comment/45991050
tagged with: jquery
has title: jQuery DataTables sorting is not working
accepted answer: http://stackoverflow.com/a/28863244
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45991652
has body: Using jQuery 2.1.3 and DataTables 1.10.5, my table won't sort when I click on the up- and down-arrows above the columns. From what I can tell from the documentation, this is the simplest example, and should work. I can't seem to figure out why it isn't. My HTML/JavaScript Simple Example Column-1 Column-2 Column-3 Column-1 Column-2 Column-3 A-1 A-2 A-3 B-1 B-2 B-3 C-1 C-2 C-3
has comment: http://stackoverflow.com/comment/45991169
has comment: http://stackoverflow.com/comment/45991543
type: Question
has comment: http://stackoverflow.com/comment/45991405
tagged with: javascript
has answer: http://stackoverflow.com/a/28863244

http://stackoverflow.com/q/28800062
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45874201
type: Question
tagged with: object
has comment: http://stackoverflow.com/comment/45876137
tagged with: mongoose
tagged with: javascript
has answer: http://stackoverflow.com/a/28801208
has title: NodeJS add element to Object
score: 0
has body: I need to add element to existing Object. Exemple of Object (Mongoose): param: { hello: 'Olá Mundo PT ' } And I need to add new element, ex : params.param.set(JSON.parse('{"'+req.param('param')+'":"'+req.param('trans')+'"}')); //And I tryed push params.param.push(JSON.parse('{"'+req.param('param')+'":"'+req.param('trans')+'"}')); But nothing works...
answer count: 1
has comment: http://stackoverflow.com/comment/45875213
accepted answer: http://stackoverflow.com/a/28801208
tagged with: node.js
has comment: http://stackoverflow.com/comment/45874129
type: AnsweredQuestion

http://stackoverflow.com/comment/45787332
has text: updated , Sorry for my poor English
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28752090

http://stackoverflow.com/q/28781822
type: Question
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
score: -1
tagged with: ajax
has answer: http://stackoverflow.com/a/28781987
has title: External variable not updating correctly within success callback
favorite count: 0
type: AnsweredQuestion
has body: I'm looping through an array of data, updating a variable named commentBody each time. The variable is updated within the loop itself, but when I reference it from inside a success callback, it always output the final value of the array for all loops. What am I missing? for (var p = 0; p &lt; data.comments.length; p++) { var commentBody = data.comments[p].comment; var authorName = "not set yet"; getName(data.comments[p].userId).success(function(a) { authorName = a.username; setter(); }); console.log(commentBody); // CORRECT = DIFFERENT VALUE EACH TIME var setter = function() { console.log(commentBody); // SAME VALUE FOR ALL INTERATIONS }; };
accepted answer: http://stackoverflow.com/a/28781987
downvote count: 1

http://stackoverflow.com/a/28881939
has body: This is what ngAnimate is for. ngAnimate adds 4 classes, for different ngView states. &lt;style&gt; .slide.ng-enter { } /* starting animations for enter */ .slide.ng-enter.ng-enter-active { } /* terminal animations for enter */ .slide.ng-leave { } /* starting animations for leave */ .slide.ng-leave.ng-leave-active { } /* terminal animations for leave */ &lt;/style&gt; Download and include a reference to angular-animate.js. Then, add ngAnimate as a dependency angular.module('testApp', ['ngAnimate']); Update Markup &lt;div ng-view class="left-inner-nav"&gt;&lt;/div&gt; CSS .left-inner-nav.ng-enter {} /* starting animations for enter */ .left-inner-nav.ng-enter.ng-enter-active {} &lt;style&gt; .slide.ng-enter { } /* starting animations for enter / .slide.ng-enter.ng-enter-active { } / terminal animations for enter */
has comment: http://stackoverflow.com/comment/46025631
type: Answer
has comment: http://stackoverflow.com/comment/46025376
has comment: http://stackoverflow.com/comment/46025573
answers question: http://stackoverflow.com/q/28881762
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/46025462
downvote count: 0
has comment: http://stackoverflow.com/comment/46048779

http://stackoverflow.com/comment/45827722
score: 1
comment on: http://stackoverflow.com/q/28774551
has text: please provide your css and html code thanks!
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/94972916
type: Comment
has text: @mpen I think they are bad UX, except for some rare prompts like "Are you sure ..?"
comment on: http://stackoverflow.com/a/45291662
type: AnswerComment
score: 0

http://stackoverflow.com/q/28887570
downvote count: 0
tagged with: javascript
favorite count: 0
has title: React: How to listen to child component events
has body: I have a component, let's say it contains a form. The form has child components which are essentially UI widgets for outputting text inputs and select menus. The select menu components are a bit fancy and do some state maintaining using the onChange event. My question is; how do I hook into the onChange event for a select menu from the parent (form) component? I can't pass onChange through props as I already have onChange specified inside the select component and I don't want to override it. Example: var Form = React.createClass({ handleSelectChange: function(){ // Do something when <Select /> changes }, render: function () { var selectMenuOptions = [ {label: 'Choose...', value: ''}, {label: 'First option', value: 'one'}, {label: 'Second option', value: 'two'} ]; return ( ); } }); var Select = React.createClass({ getDefaultProps: function() { return { options: [], className: "select" }; }, getInitialState: function () { return { buttonText: 'Loading...', defaultValue: null }; }, handleChange: function (e) { // Update buttonText state }, render: function () { return ( {this.state.buttonText} {this.props.options.map(function(option, i){ return ( ); })} ); } });
upvote count: 13
has answer: http://stackoverflow.com/a/28888347
score: 13
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46036421
accepted answer: http://stackoverflow.com/a/28888347
tagged with: reactjs
answer count: 1

http://stackoverflow.com/a/28841682
type: AcceptedAnswer
score: 0
has body: You shouldn't be hacking the CKEditor with JQuery like this. What is the problem exactly? Is it trapping the event or figuring out if it is on or off? If you're having trouble detecting if source mode is on or off, you should be able to get that via the editor mode attribute: http://docs.ckeditor.com/#!/api/CKEDITOR.editor-property-mode
has comment: http://stackoverflow.com/comment/45990366
type: Answer
has comment: http://stackoverflow.com/comment/85014922
answers question: http://stackoverflow.com/q/28841330
accepted answer of: http://stackoverflow.com/q/28841330

http://stackoverflow.com/comment/45945601
type: Comment
has text: You can read more about Bridge mode on [https://dacosta51.wordpress.com/2008/08/07/vmware-configuracin-de-red-en-modo-bridge/](https://dacosta51.wordpress.com/2008/08/07/vmware-configuracin-de-red-en-modo-bridge/)
comment on: http://stackoverflow.com/a/28771993
score: 0
type: AnswerComment

joomla2.5
tags question: http://stackoverflow.com/q/28831851
tag name: joomla2.5
type: Tag

http://stackoverflow.com/comment/45995028
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28864940
score: 0
has text: I know there is many dupes on this, struggling to find one to close it with.

http://stackoverflow.com/a/28868562
downvote count: 0
has body: In terms of the JavaScript you get to run, yes. This is normally not an issue because anything you intend to execute in JavaScript that might take more than a millisecond can be expressed as an "asynchronous" operation (for instance, AJAX requests, animation transitions, etc). That means all your code does is start the operation, and register possible callbacks for it to finish. There are very infrequent exceptions to that where it makes sense to have a "Web Worker", but I have never actually seen those put to use.
upvote count: 3
answers question: http://stackoverflow.com/q/28868529
type: Answer
score: 3

http://stackoverflow.com/comment/62185507
type: AnswerComment
has text: @Machtyn could you please create a separate question and let's see if this is built-in now and works? Thanks!
type: Comment
comment on: http://stackoverflow.com/a/28893508
score: 2

http://stackoverflow.com/q/28869001
has title: throw message; TypeError: first argument must be a string or Buffer
tagged with: javascript
answer count: 1
has body: I'm trying this code: app.get('/caminhosRelevantes',function(req,res){ console.log(req.protocol+":/"+req.get('host')); var collection = "caminhos"; var ObjectId = require('mongodb').ObjectID; collectionDriver.getCollection(collection, function(error, the_collection) { if (error) { res.end(" Eerro "); } else the_collection.aggregate([ { $match: { id_usuario: "54bef57a14b88ad70a8ab74e" } }, { $group: { _id: { rua: "$rua", data: "$data" } } }, { $group: { _id: "$_id.rua", data: { $push: "$_id.data" }, count: { $sum: 1 } } }, { $match: { count: { $gt: 5 } } } ], function(error,doc) { //C if (error) res.end(error); else res.end(doc); }); }); }); but I'm getting the following error: /server/node_modules/mongodb/lib/mongodb/connection/base.js:242 throw message; ^ TypeError: first argument must be a string or Buffer at ServerResponse.OutgoingMessage.write (http.js:851:11) at ServerResponse.OutgoingMessage.end (http.js:985:16)
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28869062
has comment: http://stackoverflow.com/comment/57272571
tagged with: node.js
type: AnsweredQuestion
score: 1
upvote count: 1
linked to: http://stackoverflow.com/q/10470133
type: Question
accepted answer: http://stackoverflow.com/a/28869062

http://stackoverflow.com/comment/46079335
type: AnswerComment
comment on: http://stackoverflow.com/a/28897513
has text: I'm not really sure why you would need to attach the store to the toolbar. You can instantiate the store separately and query it's values and then `setTitle` on the toolbar. Since toolbar doesn't inherit anty data-bound properties a store is not accepted in anycase in the config.
score: 0
type: Comment

http://stackoverflow.com/a/28834974
has comment: http://stackoverflow.com/comment/45940237
downvote count: 0
has comment: http://stackoverflow.com/comment/45939579
has comment: http://stackoverflow.com/comment/45939667
has comment: http://stackoverflow.com/comment/45939608
has comment: http://stackoverflow.com/comment/45940050
has comment: http://stackoverflow.com/comment/45940747
type: Answer
answers question: http://stackoverflow.com/q/28832428
has comment: http://stackoverflow.com/comment/45940946
has body: Well, you get the "undefined" error when you are trying to use a variable without a value. console.log(data) //return undefined Based on what you say, the Meteor.method returns a JSON who depends on other collections. So I think the best option you have here is to use a waitOn on the myPage Template. waitOn:function(){ //return all the collection that the JSON depends } You can try with the session, and using a Tracker too. var data = Meteor.call('myData'); Session.set('data',data) //and later Template.myPage.rendered = functiopn(){ Tracker.autorun(function(){ var data = Session.get('data') if(data === undefined){ //this is the long way console.log("Wait the data value still undefined") }else{ //load all the D3 stuff console.log(data) } }); } GL
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45939804

http://stackoverflow.com/comment/46065194
comment on: http://stackoverflow.com/q/28792040
score: 0
has text: Did you get your answer?
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28839024
has body: Use .val() to fetch the value of the input field. $("input[type=submit]").click(function(e){ e.preventDefault(); // &lt;-------- To stop form submission var txt = $("input[type=text]").val(); // &lt;----- Fetch value of input field console.log(txt) // &lt;----------- Check console has the value of the input field. });
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28838921
answers question: http://stackoverflow.com/q/28838921
type: Answer
score: 0

http://stackoverflow.com/comment/46016281
comment on: http://stackoverflow.com/a/28877169
has text: @PushkeyYadav thanks ... but it does look kind of way too many bytes
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28871063
answer count: 1
has answer: http://stackoverflow.com/a/28872083
type: UnansweredQuestion
tagged with: handlebars.js
tagged with: ember.js
type: Question
has body: I have to display respective time zone in digital format. The clock is displayed but it only updates after refreshing the page. Below is the code I used. Below is my javascript code: time: function() { var zone = _.date.fleetTimeZone(); return moment().zone(zone).format('h:mm:ss a'); }.property('DS.session.last_fleet_interacted'), Below is my handlebars: &lt;div class="time"&gt;{{time}}&lt;/div&gt;
tagged with: javascript
score: 0
has title: Not able to update digital clock

http://stackoverflow.com/a/28944598
type: Answer
upvote count: 1
score: 1
has body: Without digging into the code (but having used Passport before) I'm assuming that the oauth_token is being stored with the user data in your database. You may have to access your database models directly in order to get the token, then you can use it with the provider APIs to get access to the information you need.
downvote count: 0
answers question: http://stackoverflow.com/q/28826878

http://stackoverflow.com/comment/45977376
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/72232/discussion-between-terkhos-and-med-amine-touil).
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28855270
type: Comment

http://stackoverflow.com/comment/130467860
type: Comment
has text: Good addition with manifest v3
comment on: http://stackoverflow.com/a/65716369
score: 0
type: AnswerComment

http://stackoverflow.com/a/28892032
accepted answer of: http://stackoverflow.com/q/28891999
upvote count: 4
has comment: http://stackoverflow.com/comment/46044889
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46044884
score: 4
has comment: http://stackoverflow.com/comment/113409467
answers question: http://stackoverflow.com/q/28891999
has body: Check for the attribute value, the property returns a relative value if an absolute path is not specified. $("#testImage").attr("src") Demo: Fiddle
has comment: http://stackoverflow.com/comment/46044909
type: Answer

http://stackoverflow.com/comment/45945708
has text: As functions **getsec(myHandler)** and **countdown('countdown')** run on **window.onload** (every second), why does **getsec(myHandler)** stops working when called inside **countdown('countdown')**???
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28837207

http://stackoverflow.com/q/28778163
has answer: http://stackoverflow.com/a/61780646
tagged with: web-midi
score: 3
has answer: http://stackoverflow.com/a/28780935
tagged with: midi
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/46258759
has comment: http://stackoverflow.com/comment/45836194
has body: I've been reading the documentation about Web Midi API and I tried to look at different websites about the topic. Is there a way of playing a midi sound without using fancy libraries and stuff? Let's say I just want to generate a single note: how do I access the midi module that is present on your local machine? Can anyone write a small snippet of code that plays a single note and that I can simply embed in the element?
answer count: 3
has answer: http://stackoverflow.com/a/51635411
has title: MIDI JavaScript: how to generate a single MIDI note in JavaScript without libraries?
downvote count: 1
tagged with: javascript
type: UnansweredQuestion
upvote count: 4

http://stackoverflow.com/comment/46069978
comment on: http://stackoverflow.com/a/28903723
score: 0
type: AnswerComment
has text: Yes, just add another line to your click function like this $("<id for your other element>").toggle();
type: Comment

http://stackoverflow.com/comment/45997071
has text: Cannot reproduce the error. How do you call `customFilter`? Can you setup a fiddle that produces the error?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28865465

http://stackoverflow.com/a/30212505
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28904904
has body: Your ".florence"-element has two class attributes. You need to write it like this: &lt;img class="florence animate" src="images/florence.png"&gt; And adding the class "animate" a second time won't do anything (the Fiddle example from the comments only worked because the second class attribute gets ignored. If you click a second time on the button it won't work as well since the valid class attribute now has a animate class). You need to remove and add the class again. Unfortunatelly you can't do it right away like this: $(".florence").removeClass("animate"); $(".florence").addClass("animate"); This will not work either for animations. You need to delay the second step a little: $('button').click(function(){ $(".florence").removeClass("animate"); setTimeout(function(){ $(".florence").addClass("animate"); },1); }); This works now. See JSFiddle

http://stackoverflow.com/q/28752424
has comment: http://stackoverflow.com/comment/45805489
has title: Close a child window in an Android app made with Angularjs
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45786982
has comment: http://stackoverflow.com/comment/45787606
has comment: http://stackoverflow.com/comment/45786893
score: 1
has comment: http://stackoverflow.com/comment/45801766
type: Question
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45786933
has comment: http://stackoverflow.com/comment/45787291
has comment: http://stackoverflow.com/comment/45787325
tagged with: android
linked to: http://stackoverflow.com/q/19974097
answer count: 1
accepted answer: http://stackoverflow.com/a/28765821
favorite count: 0
has body: I'm coding an Android app with Angularjs and cordova, but I have a problem: For an oauth call I need to open a new window, go to the withings site and when I come on my callback url close the window. I have tried to use setInterval (or $interval) to check every 2 seconds if I reveived the infos by a call to my API. It works fine on a computer in chrome but when I compile the app with Cordova I never enter in the loop. So I tried to catch an event or $watch on the url of my new window but I execute only once my function at the first url change even if my call to the API result an error. This is my last code but I tried a lot of different tests : var newWindow = $window.open(result.res); var unwatch = $scope.$watch(window.location, function() { $http.get(url) .success(function(result) { newWindow.close(); unwatch(); $location.path('/tab/dash'); }) .error(function(error) { console.log(error); }); }); If you have any idea to make this work, would be very happy. Thanks by advance !
tagged with: cordova
tagged with: angularjs
upvote count: 1
has answer: http://stackoverflow.com/a/28765821

http://stackoverflow.com/a/28900883
has body: Use 0 for the first, and array.length - 1 for the last var firstVal = array2[0]; var lastVal = array2[array2.length - 1] var combo = firstVal + "-" + lastVal;
has comment: http://stackoverflow.com/comment/46060936
type: AcceptedAnswer
score: 4
type: Answer
upvote count: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/46060963
accepted answer of: http://stackoverflow.com/q/28900859
answers question: http://stackoverflow.com/q/28900859

http://stackoverflow.com/a/28899351
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/69381403
has body: Webpack hides modules coming from folders like ["node_modules", "bower_components", "jam", "components"] in your console output by default. This helps you to focus on your modules instead on your dependencies. You can display them by using the --display-modules argument.
has comment: http://stackoverflow.com/comment/118641625
has comment: http://stackoverflow.com/comment/72314426
upvote count: 127
type: Answer
accepted answer of: http://stackoverflow.com/q/28858176
has comment: http://stackoverflow.com/comment/75134920
has comment: http://stackoverflow.com/comment/71391691
answers question: http://stackoverflow.com/q/28858176
has comment: http://stackoverflow.com/comment/71334201
score: 127
has comment: http://stackoverflow.com/comment/121005340
has comment: http://stackoverflow.com/comment/70462477

http://stackoverflow.com/comment/46449617
type: Comment
comment on: http://stackoverflow.com/q/28877698
has text: My code was only this. But i solved this problem using a surface and joining sprites to create a custom shape
score: 0
type: QuestionComment

http://stackoverflow.com/comment/46054848
type: AnswerComment
has text: `new RegExp("/\\* start-" + identifier + " \\*/([\\s+\\S]*)/\\* end-" + identifier + " \\*/[\\r\\n]+");` right? Output is still the same. To illustrate: http://oi62.tinypic.com/zx5q1i.jpg
type: Comment
comment on: http://stackoverflow.com/a/28897392
score: 0

http://stackoverflow.com/q/28757407
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28757684
has comment: http://stackoverflow.com/comment/45955032
has comment: http://stackoverflow.com/comment/45954990
downvote count: 1
type: Question
has body: The best way to validate and display the user input on the fly?
tagged with: javascript
score: -1
has title: Best way to validate the value of an input field immediately?
answer count: 2
upvote count: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/28757569
favorite count: 0
tagged with: ajax

http://stackoverflow.com/a/28779905
has body: Since containment option accepts array of coordinates, you could subtract 375px from the height of the containment element. (sample code. Exact coordinates depends on your CSS and HTML structure) $("#map").draggable({ containment: [ $('#range').offset().left, $('#range').offset().top, $('#range').offset().left + $('#range').width() - $("#map").innerWidth(), $('#range').offset().top + $('#range').height() - 275 ] }); #range{ width: 400px; height: 400px; background: #ccc; } #map{ padding:5px; max-width:36px; background:black; color:white; } MAP Yet another solution is to make a #virtual-range element inside #range element and set its height to $('#range').height()-375. Then use that #virtual-range as dragging region. And once again - all depends on your CSS and HTML structure. $('#virtual-range').css('height', $('#range').height()-275); $("#map").draggable({ containment: $('#virtual-range') }); #range{ margin-left: 50px; margin-top: 50px; width: 400px; height: 400px; background: #ccc; } #map{ padding:5px; max-width:36px; background:black; color:white; } MAP
score: 0
answers question: http://stackoverflow.com/q/28779345
type: Answer

http://stackoverflow.com/comment/45806304
comment on: http://stackoverflow.com/q/28763598
score: 0
type: Comment
type: QuestionComment
has text: what will be the actual value of `str`? what do you mean by combining these 2 scripts

http://stackoverflow.com/comment/45843700
comment on: http://stackoverflow.com/a/28782764
has text: I have created a jsfiddle now which you can view here: http://jsfiddle.net/v6v146sv/
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28866319
score: 0
accepted answer: http://stackoverflow.com/a/28866748
upvote count: 1
answer count: 1
downvote count: 1
has body: After use mustache render I try to get the dom just append, how do I select only li.data? or How to make mustache return appendedDom not include #text? .. var html = Mustache.to_html(this.template.data, response); var appendedDom = $(html).appendTo(this.el.container); console.log(appendedDom); &gt;&gt; console.log &lt;li class=​"data"&gt;​…​&lt;/li&gt;​ #text I tried $(appendedDom+'.data') this not work , Error: Syntax error, unrecognized expression: [object Object].data console.log($(appendedDom+'.data'));
tagged with: jquery
favorite count: 0
tagged with: mustache
has title: select the element not equal `#text`
has comment: http://stackoverflow.com/comment/45998357
type: AnsweredQuestion
tagged with: dom
has comment: http://stackoverflow.com/comment/45998283
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28866748

http://stackoverflow.com/q/28781923
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45844360
score: 0
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/28784635
type: UnansweredQuestion
has body: To display my latest blog-posts on a different page I want to parse the rss-feed from the blog and then generate elements with it. I first tried to parse a fixed .xml file for which I wrote the following code: var maxBlogposts = 5; var blogPosts = 0; $.get("rss.xml", function(data) { $(data).find("item").each(function() { if(blogPosts === maxBlogposts) return; var el = $(this); //Only display 3 posts on small devices. var extra = (blogPosts &gt;= 3) ? "not-small 12u(small)" : "12u(small)"; var div = $('&lt;div class="6u ' + extra + '" class="blog-entry"&gt;&lt;/div&gt;'); var h = $('&lt;h4&gt;&lt;a href="' + el.find("link").text() + '"&gt;' + el.find("title").text() + '&lt;/a&gt;&lt;/h4&gt;'); var description = el.find("description").text().replace('[&amp;#8230;]', '&lt;a href="' + el.find("link").text() + '"&gt;[&amp;#8230;]&lt;/a&gt;'); var p = $('&lt;p&gt;' + description + '&lt;/p&gt;'); div.append(h); div.append(p); $('#blog').append(div); blogPosts++; }); }); This worked perfectly fine. Now I want to parse the actual rss-feed. For this I wrote a PHP script which simply gets the feed and echos it. &lt;?php $rss = file_get_contents('http://xn--der-grne-baum-1ob.net/feed/'); die($rss); ?&gt; And again I get the correct XML file on the frontend. The problem I have is that now my code is no longer working. Getting the description was failing as well as the links. I fixed the description by accessing el.find(description")[0].innerHTML However I can't seem to get the links to work. The data returned from the PHP file contains a node with the link in it. The "el"-element also contains children named "link" but those no longer contain the actual link. I feel like the links may get "escaped" during parsing? At least that is the only reason i could think of that would result in what I am observing. The XML I am parsing comes from http://xn--der-grne-baum-1ob.net/feed/
tagged with: http://stackoverflow.com/tag/xml
has comment: http://stackoverflow.com/comment/45841166
has title: Parsing links from an XML files with JavaScript

http://stackoverflow.com/comment/45972917
score: 1
comment on: http://stackoverflow.com/q/28853219
type: QuestionComment
type: Comment
has text: and `succes: function() {` should be `success`.

http://stackoverflow.com/q/28889826
has answer: http://stackoverflow.com/a/48043225
has answer: http://stackoverflow.com/a/44462495
has answer: http://stackoverflow.com/a/57977698
has body: What's the react way of setting focus on a particular text field after the component is rendered? Documentation seems to suggest using refs, e.g: Set ref="nameInput" on my input field in the render function, and then call: this.refs.nameInput.getInputDOMNode().focus(); But where should I call this? I've tried a few places but I cannot get it to work.
has answer: http://stackoverflow.com/a/36925998
linked to: http://stackoverflow.com/q/37949394
has answer: http://stackoverflow.com/a/64980615
type: Question
has answer: http://stackoverflow.com/a/44587766
has answer: http://stackoverflow.com/a/36899383
tagged with: reactjs
has answer: http://stackoverflow.com/a/28890286
has answer: http://stackoverflow.com/a/72007855
downvote count: 0
has answer: http://stackoverflow.com/a/46072722
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28891210
has answer: http://stackoverflow.com/a/42508449
has answer: http://stackoverflow.com/a/66073061
has answer: http://stackoverflow.com/a/28891210
has answer: http://stackoverflow.com/a/75193631
has answer: http://stackoverflow.com/a/28890330
has answer: http://stackoverflow.com/a/39457349
has answer: http://stackoverflow.com/a/45007591
has answer: http://stackoverflow.com/a/40235334
favorite count: 0
score: 990
has answer: http://stackoverflow.com/a/41142873
has answer: http://stackoverflow.com/a/55565576
has answer: http://stackoverflow.com/a/63865579
has answer: http://stackoverflow.com/a/34081225
has answer: http://stackoverflow.com/a/54225169
has answer: http://stackoverflow.com/a/54159564
has answer: http://stackoverflow.com/a/36523713
answer count: 28
upvote count: 990
has answer: http://stackoverflow.com/a/30457700
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28890330
has answer: http://stackoverflow.com/a/28977776
has comment: http://stackoverflow.com/comment/131815492
has title: How to set focus on an input field after rendering?
has answer: http://stackoverflow.com/a/51261092

http://stackoverflow.com/comment/46053235
comment on: http://stackoverflow.com/a/28896275
type: Comment
has text: I hope you don't write code that is expected to run on any other machines. If you develop with UAC off then you can expect epic pain when the code leaves your machine. Setting those registry entries should be done outside your program. As a deployment step. And you really must stop hard coding Wow6432Node. The docs are clear. There's a proper way to do it. Why not avail yourself of it?
score: 1
type: AnswerComment

http://stackoverflow.com/comment/45979968
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28856761
has text: you should add dinamically inputs with ids and f.e. ```id="dyn-input-i"``` where ```i``` is a number. So you can managed this inputs for removing in your code

http://stackoverflow.com/a/28799963
has comment: http://stackoverflow.com/comment/45874380
has body: The problem with jQuery(document).ready(function ($) { "use strict"; $('.chat-messages').perfectScrollbar({suppressScrollX: true}); }); is that you are leaving $ undefined in your local scope by naming a parameter of your anonymous function with that identifier. jQuery passes no arguments to that function, but your declaration of the parameter masks the global definition of $. If you are not using no conflict mode, then $ will already be available in the global scope, so the following should work: $(document).ready(function () { "use strict"; $('.chat-messages').perfectScrollbar({suppressScrollX: true}); }); As an aside, the point of noConflict is to avoid clashes with other code which may be relying on a global definition of $ which differs from jQuery's use of $ as an alias for jQuery.
type: Answer
answers question: http://stackoverflow.com/q/28798568
score: 0

http://stackoverflow.com/comment/46122484
type: Comment
comment on: http://stackoverflow.com/a/28929149
score: 1
type: AnswerComment
has text: Hey, you've given me some good thinking points, thanks. My app is much more complex than just a single hierarchical task, so I'll definitely need to use a design pattern, but maybe you're right that I could do even large calculations in a single module that has 'nested' dependancies. I'm not entirely sure how this would work though...

http://stackoverflow.com/a/28902813
type: Answer
has body: I didnt understand why the parent and child has to have isolated scope but if you just want to communicate between parent and child you can use $emit and $on. app.directive('parent', function($rootScope) { return { restrict: 'E', scope: true, controller: function($scope, $element, $attrs) { var child = $element.find('child'); this.changeText = function() { child.attr('text', 'new text'); }; $rootScope.$emit('FromParent', somedata); } }; }); app.directive('child', function($rootScope) { return { restrict: 'E', scope: true, link: function(scope, element, attrs) { attrs.$observe('text', function(text) { element.html(text); }); $rootScope.$on('FromParent', function(event, somedata){ //Do something with the data }); } }; });
has comment: http://stackoverflow.com/comment/46072045
has comment: http://stackoverflow.com/comment/46070642
score: 0
answers question: http://stackoverflow.com/q/28902752

http://stackoverflow.com/q/28764989
has answer: http://stackoverflow.com/a/48498228
has comment: http://stackoverflow.com/comment/45808968
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45808985
tagged with: css
has title: Why are these CSS files being downloaded twice?
has comment: http://stackoverflow.com/comment/45809447
tagged with: cookies
has comment: http://stackoverflow.com/comment/80415870
tagged with: caching
type: Question
has comment: http://stackoverflow.com/comment/45809527
has comment: http://stackoverflow.com/comment/45808939
downvote count: 0
answer count: 1
tagged with: javascript
score: 4
favorite count: 0
has comment: http://stackoverflow.com/comment/45808956
tagged with: http://stackoverflow.com/tag/html
upvote count: 4
has body: I have included all the files just once. I have triple checked it. Here are some screen shots. I noticed that the request headers are different. How do I resolve this issue? <?php require_once("cssheadertop.php");?> My title <?php require_once("cssheaderbottom.php")?> This is cssheadertop.php <?php require_once('../../templates/sitelink.php');?> UPDATE sitelink.php just has PHP and cssheaderbottom.php just has navigation. UPDATE 2 It is not just about bootstrap.min.css but every css file is being downloaded twice sometime thrice (You can see it in the images below).

http://stackoverflow.com/q/28806693
has body: I have a problem with my game website. When the user is playing a Flash game that requires the up and down arrow keys, the page scrolls up and down instead of the object in the game. You can check out this problem through this link to my website http://triceragames.net/diving-dennis/. My website based on Wordpress. The left and right arrows work without any problems.
linked to: http://stackoverflow.com/q/8916620
has title: How do I stop my website from scrolling up and down with the arrow keys when playing games?
tagged with: flash
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28806820
has comment: http://stackoverflow.com/comment/45886632
type: Question
tagged with: css
answer count: 1
score: 0

http://stackoverflow.com/a/28827071
has body: If you want to start from foo: foo:\/\/([^\s]+) If you also want to keep foo in the regex: (foo:\/\/[^\s]+)
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/45924747
downvote count: 0
has comment: http://stackoverflow.com/comment/45924811
score: 1
answers question: http://stackoverflow.com/q/28826848

http://stackoverflow.com/a/28802643
has comment: http://stackoverflow.com/comment/45898710
has comment: http://stackoverflow.com/comment/45893461
score: 0
has body: You can get styles from elements directly via the style attribute and the window.getComputedStyle method. This is more accurate than just taking the first result that appears in the list of CSS rules (where you also just find selectors, not actual elements the style is applied to). The MDN page about the style attribute has some easy examples, for your purpose, it could be look like this. var getFontFamily = function() { var el = document.getElementById(id); var cs = window.getComputedStyle(el, null); return cs.fontFamily || ''; }
has comment: http://stackoverflow.com/comment/45879504
has comment: http://stackoverflow.com/comment/45898390
has comment: http://stackoverflow.com/comment/45899434
type: Answer
answers question: http://stackoverflow.com/q/28801928
has comment: http://stackoverflow.com/comment/45898909

http://stackoverflow.com/a/28831623
answers question: http://stackoverflow.com/q/28830998
score: 0
type: Answer
has body: If the div had style value anything other than block or none , the following code should do nothing and preserve the original style value. function Change(){ document.getElementById("mobilemenu").style.display = ( document.getElementById("mobilemenu").style.display === "block" ) ? "none" : ( document.getElementById("mobilemenu").style.display === "none" ) ? "block" : document.getElementById("mobilemenu").style.display ; }

http://stackoverflow.com/a/28829994
answers question: http://stackoverflow.com/q/28829909
has body: I would recommend you to use .each() the callback is fired in the context of the current DOM element, so the keyword this refers to the element. var rows = $('#mytable tbody tr.selected'); rows.each(function(){ console.log(this.id); //Here this refers current row }) OR var rows = $('#mytable tbody tr.selected'); //Here you need to add break condition for (var i = 0; i &lt; rows.length; i++) { console.log('rows.attr("id")' + rows[i].id); //access row using index }
type: Answer
upvote count: 4
downvote count: 0
score: 4
accepted answer of: http://stackoverflow.com/q/28829909
type: AcceptedAnswer

http://stackoverflow.com/q/28826792
has answer: http://stackoverflow.com/a/28827091
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28827011
favorite count: 0
has title: Json cascading dropdown
downvote count: 1
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/28827011
score: -1
type: Question
has comment: http://stackoverflow.com/comment/45925275
answer count: 2
possible better answer: http://stackoverflow.com/a/28827091
upvote count: 0
has body: I'm trying to set up a cascading dropdown using JSON data. I have it working somewhat but need some assistance getting the 2nd tier to work as intended. Currently it seems to be grabbing the number in the array. Ideally for my 2nd tier I want to show the text in the dropdown as the option text, and I'd like to use the id field in the json as the value of the option. var data = { "Crime":[ {"id":"1","text":"Number of police"}, { "id":"2","text":"Number of crimes"} ], "Health":[ {"id":"3","text":"Number of doctors"}, {"id":"4","text":"Number of hospital visits"}, {"id":"5","text":"Number of nurses"} ], } I have a jsfiddle showing what I have so far. Happy to use whatever combination of javascript/jquery works best.

http://stackoverflow.com/a/30052028
type: Answer
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/28840414
has body: these are the tags CKEditor 4 removes when empty: abbr, acronym, b, bdi, bdo, big, cite, code, del, dfn, em, font, i, ins, label, kbd, mark, meter, output, q, ruby, s, samp, small, span, strike, strong, sub, sup, time, tt, u, var to allow all empty tags - try to add this to the config.js : for(var tag in CKEDITOR.dtd.$removeEmpty){ CKEDITOR.dtd.$removeEmpty[tag] = false; }
downvote count: 0

http://stackoverflow.com/comment/45961541
comment on: http://stackoverflow.com/q/28846534
type: QuestionComment
has text: @jfriend00 first i need to store all the auto-suggest query from that url in to an array. that i am not able to do.
score: 0
type: Comment

http://stackoverflow.com/comment/46047367
has text: Could you output the actual values to your inputs? Or, do you plan to define the price in your JavaScript and just multiply? Also, you will have multiple selects?
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28893385

http://stackoverflow.com/comment/45972380
has text: In Css. I have done something like: overflow-y:auto; overflow-x:hidden;
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28852235

http://stackoverflow.com/q/28812329
tagged with: ajax
has comment: http://stackoverflow.com/comment/45896775
has answer: http://stackoverflow.com/a/28812886
has comment: http://stackoverflow.com/comment/45896739
type: UnansweredQuestion
upvote count: 1
has title: Express-node server return empty array on GET
tagged with: node.js
score: 1
has body: app.get('/:user/:tag', function (req, res) { fs.readdir( 'api'+path.sep+req.params.user, function (err, files) { var tweets=[]; for (var i =1, j=files.length ; i &lt;j; i++) { fs.readFile('api'+path.sep+req.params.user+path.sep+files[i],'utf8', function (err, data) { data=JSON.parse(data); if (data.tag==req.params.tag){tweets.push(data);}; }); }; res.send(tweets); }); }); It seems that problem is fs method's callbacks, but I can't solve it for a long time.
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: callback
tagged with: express
favorite count: 0

http://stackoverflow.com/comment/47352335
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28894611
has text: Then you might want to have a look at [hyperquest](https://github.com/substack/hyperquest) it might be helpful for you. Also personally when I have to do a lot of requests like this I use some job queues with X workers to make sure that I stay below X concurrent requests.

http://stackoverflow.com/comment/45990792
has text: This code indeed opens a pop-up every time I select a row, unfortunately it is empty. I've tried some variations of it's content (e.g., `event.target.target_id`, `event.id`, etc...), however in these cases it goes "worse", i.e., I get a pop-up only with "undefined" in it. What can be possibly wrong here?
type: AnswerComment
comment on: http://stackoverflow.com/a/28860328
score: 0
type: Comment

http://stackoverflow.com/q/28887241
tagged with: backbone.js
downvote count: 0
type: UnansweredQuestion
has body: There are a lot of answers out there for browser caching but most are about either turning caching on or off or requesting using a different url for some static asset like js or images. I am loading json data over an ajax request This is dynamic content, say a list of tasks I only want to update when a user has done a certain action. Until then it can be cached forever. When the user takes that action, I want to invalidate the cache and get a new version from the server. Is there a way to clear the browsers local cache without changing the url. So, /tasks is cached until next year. I want to invalidate that and force future requests to /tasks to get new data and a new expires header. Would I be better off not allowing browser caching and cache the requests/data on the server instead? Another similar question: Forcing AJAX request to revalidate cache with server, without reloading completely
has title: Selectively Force Browser Cache to Clear Ajax Request
score: 1
tagged with: caching
type: Question
has comment: http://stackoverflow.com/comment/46036210
linked to: http://stackoverflow.com/q/17308953
answer count: 1
tagged with: javascript
tagged with: ajax
has comment: http://stackoverflow.com/comment/46036422
upvote count: 1
has answer: http://stackoverflow.com/a/28902740
favorite count: 0

http://stackoverflow.com/a/28812844
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28812699
has body: You can add a common class to your radio buttons and attach a single event to all of them. From there you can use DOM traversal to only change the related text input. Something like this: $ $('.input-toggle').change(function() { $('.input-group input[type="text"]').prop('disabled', true); // disable all $(this).closest('.input-group').find('input[type="text"]').prop('disabled', false); }); Example fiddle
upvote count: 1
has comment: http://stackoverflow.com/comment/45898486

http://stackoverflow.com/q/28867920
accepted answer: http://stackoverflow.com/a/28870493
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28870777
score: 1
has title: Get width of svg element from uploaded file
has answer: http://stackoverflow.com/a/28870777
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
has body: I selected a svg file and read it via readDataUrl(&lt;file&gt;), I can set it to an html image element by setting the src to be the value read from the file. However the width and height attributes will be 0. How can I set the value read from a file to an svg element in order to be able to do a getBBox().width to obtain its width?
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
has answer: http://stackoverflow.com/a/28870493
upvote count: 1

http://stackoverflow.com/a/29401306
downvote count: 0
upvote count: 50
accepted answer of: http://stackoverflow.com/q/28777464
has body: You have to use .checked For example: Javascript: document.getElementById('mySwitch').checked JQuery: $('#mySwitch').prop('checked') I hope that I help you.
type: AcceptedAnswer
score: 50
type: Answer
answers question: http://stackoverflow.com/q/28777464
has comment: http://stackoverflow.com/comment/54516920

http://stackoverflow.com/a/28762809
downvote count: 0
has body: https://jsfiddle.net/hmfcLsf2/1/ first input: second input: Try it Use getElementById. See the jsfiddle above.
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/46707252
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28762562
answers question: http://stackoverflow.com/q/28762562
type: Answer
has comment: http://stackoverflow.com/comment/45805344

http://stackoverflow.com/q/28833387
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45936442
accepted answer: http://stackoverflow.com/a/28835280
linked to: http://stackoverflow.com/q/16881478
has comment: http://stackoverflow.com/comment/45938736
tagged with: angularjs
tagged with: angularjs-directive
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45937153
has body: I have this directive: function Recaptcha(RecaptchaService) { return { restrict: 'E', templateUrl: 'app/components/login/recaptcha.html', controller: function($scope) { $scope.sendResp = function(response) { RecaptchaService.sendResponse(response); }; } } } With the template login/recaptcha : So, I want to call $scope.sendResp inside my . But I'm getting $scope is not defined. Is there a way to do that?
has comment: http://stackoverflow.com/comment/45937182
has answer: http://stackoverflow.com/a/28835280
has title: Calling AngularJS inside tag
type: Question
score: 0

http://stackoverflow.com/comment/45801966
type: AnswerComment
has text: Your welcome, i would just rather see people set on the right path from the start. PHP itself is a common server side language that is free. But if you have apache, you most likely have PHP nd the above code is about as easy as it can be done, of course expanding it would be desired.
type: Comment
comment on: http://stackoverflow.com/a/28760357
score: 0

http://stackoverflow.com/comment/45946338
type: Comment
type: QuestionComment
has text: I removed the one from the footer. Same result.
score: 0
comment on: http://stackoverflow.com/q/28838352

http://stackoverflow.com/q/28849877
type: Question
has comment: http://stackoverflow.com/comment/46299796
accepted answer: http://stackoverflow.com/a/28889118
tagged with: javascript
has comment: http://stackoverflow.com/comment/46040137
score: 0
answer count: 2
tagged with: rgraph
favorite count: 0
has answer: http://stackoverflow.com/a/28889118
type: AnsweredQuestion
has title: RGraph: scientific notation (eg. "4e-2" instead of "0.02") at y-axis
has body: Sometimes RGraph plots "4e-2" instead of "0.02" at the y-axis of a line-chart. I have set scale.decimals to 2 and 0 ist correctly displayed as 0.00, but 0.02, 0.04 etc. are displayed in scientific notation. If there is no property which can be set to force this, how do I change the labels "manually" via javascript before the chart is printed? Many thanks in advance. Michael
possible better answer: http://stackoverflow.com/a/28889625
upvote count: 1
has comment: http://stackoverflow.com/comment/46301207
downvote count: 1
has answer: http://stackoverflow.com/a/28889625

http://stackoverflow.com/comment/45823825
score: 0
comment on: http://stackoverflow.com/a/28772421
type: AnswerComment
has text: Could you go a little more in depth in how its different than you want? Is it big or small? Does it move? If so which direction? etc.
type: Comment

http://stackoverflow.com/q/28786680
favorite count: 0
accepted answer: http://stackoverflow.com/a/28801311
tagged with: codemirror
score: 2
type: AnsweredQuestion
has title: Codemirror: Grab Title Value To Input[type=text]
upvote count: 2
has body: I'm trying to grab the tag in Codemirror and set it's value as a input[type=text] value. However I keep getting an integer instead of the text. In this sample it's "HTML5 canvas demo". Of course it changes. DEMO $(document).ready(function() { var dest = $(".projectname"); var editorTitle = editor.getValue().search(" "); dest.val(editorTitle).val(dest.val().split(" ").join("")); }); var delay; // Initialize CodeMirror editor var editor = CodeMirror.fromTextArea(document.getElementById('code'), { mode: 'text/html', tabMode: 'indent', styleActiveLine: true, lineNumbers: true, lineWrapping: true, autoCloseTags: true, foldGutter: true, dragDrop : true, gutters: ['CodeMirror-linenumbers', 'CodeMirror-foldgutter'] }); // Live preview editor.on('change', function() { clearTimeout(delay); delay = setTimeout(updatePreview, 300); }); function updatePreview() { var previewFrame = document.getElementById('preview'); var preview = previewFrame.contentDocument || previewFrame.contentWindow.document; preview.open(); preview.write(editor.getValue()); preview.close(); } setTimeout(updatePreview, 300); .CodeMirror, iframe { border: 1px solid black; } .CodeMirror, iframe, .projectname { float: left; } .CodeMirror { width: 50%; } iframe { width: 49%; height: 300px; border-left: 0; } .projectname { width: 99.4%; } Codemirror: Grab Title Value HTML5 canvas demo hello world!
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28801311

http://stackoverflow.com/comment/45979217
comment on: http://stackoverflow.com/q/28856312
has text: It's possible you are trying to use the post._id before angular is done processing the value.
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/q/28840207
has comment: http://stackoverflow.com/comment/45949674
linked to: http://stackoverflow.com/q/14470973
tagged with: encryption
has title: Can someone please explain this JavaScript decimal rounding function in detail?
possible better answer: http://stackoverflow.com/a/28840313
score: 2
has body: function Round2DecimalPlaces(l_amt) { var l_dblRounded = +(Math.round(l_amt + "e+2") + "e-2"); return l_dblRounded; } Fiddle: http://jsfiddle.net/1jf3ut3v/ I'm mainly confused on how Math.round works with "e+2" and how addition the "+" sign to the beginning of Math.round makes any difference at all. I understand the basic of the function; the decimal gets moved n places to the right (as specified by e+2), rounded with this new integer, and then moved back. However, I'm not sure what 'e' is doing in this situation.
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45950623
has answer: http://stackoverflow.com/a/28840266
accepted answer: http://stackoverflow.com/a/28840266
has comment: http://stackoverflow.com/comment/45949720
has comment: http://stackoverflow.com/comment/45950630
upvote count: 2
type: Question
tagged with: rounding
has answer: http://stackoverflow.com/a/28840313
tagged with: javascript
answer count: 2
tagged with: function
downvote count: 0
has comment: http://stackoverflow.com/comment/45950026
favorite count: 0

http://stackoverflow.com/comment/45997547
comment on: http://stackoverflow.com/q/28866269
score: 0
type: Comment
type: QuestionComment
has text: @artymcfly yes, that's i want, just add couple line of code to a few existing functions in javassript

http://stackoverflow.com/q/28897225
type: AnsweredQuestion
has title: getJson returns all Handlers instead of data
possible better answer: http://stackoverflow.com/a/28897321
type: Question
has body: i am trying to load a config.json from my filesystem in an html application: var data = $.getJSON('../../modules/config.json'); console.log(data); but i don´t receive the data from the json file (the path is correct, i checked it twice) instead i got this: Object {readyState: 1, getResponseHeader: function, getAllResponseHeaders: function, setRequestHeader: function, overrideMimeType: function…}abort: function (a){var b=a||u;return i&amp;&amp;i.abort(b),x(0,b),this}always: function (){return e.done(arguments).fail(arguments),this}complete: function (){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&amp;&amp;k.has(c)||h.push(c):c&amp;&amp;c.length&amp;&amp;"string"!==d&amp;&amp;f(c)})}(arguments),b?e=h.length:c&amp;&amp;(g=d,j(c))}return this}done: function (){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&amp;&amp;k.has(c)||h.push(c):c&amp;&amp;c.length&amp;&amp;"string"!==d&amp;&amp;f(c)})}(arguments),b?e=h.length:c&amp;&amp;(g=d,j(c))}return this}arguments: nullcaller: nulllength: 0name: ""prototype: m.Callbacks.k.add__proto__: function Empty() {}&lt;function scope&gt;error: function (){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&amp;&amp;k.has(c)||h.push(c):c&amp;&amp;c.length&amp;&amp;"string"!==d&amp;&amp;f(c)})}(arguments),b?e=h.length:c&amp;&amp;(g=d,j(c))}return this}fail: function (){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&amp;&amp;k.has(c)||h.push(c):c&amp;&amp;c.length&amp;&amp;"string"!==d&amp;&amp;f(c)})}(arguments),b?e=h.length:c&amp;&amp;(g=d,j(c))}return this}getAllResponseHeaders: function (){return 2===t?f:null}getResponseHeader: function (a){var b;if(2===t){if(!j){j={};while(b=Cc.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b}overrideMimeType: function (a){return t||(k.mimeType=a),this}pipe: function (){…
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28897307
score: 0
answer count: 3
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/28897321
tagged with: jquery
has answer: http://stackoverflow.com/a/28897307
favorite count: 0
has comment: http://stackoverflow.com/comment/46058361
has comment: http://stackoverflow.com/comment/46054130
tagged with: getjson
has answer: http://stackoverflow.com/a/28897501

http://stackoverflow.com/comment/45864045
type: QuestionComment
comment on: http://stackoverflow.com/q/28794491
has text: I called ctx2.drawImage(ctx1,0,0)
score: 0
type: Comment

http://stackoverflow.com/comment/45819963
type: Comment
has text: I have a php insert page I can post
comment on: http://stackoverflow.com/a/28770518
score: 0
type: AnswerComment

http://stackoverflow.com/a/28835188
type: Answer
answers question: http://stackoverflow.com/q/28835119
has comment: http://stackoverflow.com/comment/45939846
has body: If You put Your html file via "drag&amp;drop" to browser window, and You see file:// as protocol, then jQuery cant be downloaded from URL. This is propably Your problem. Edit: I see Your JS code is inside test.js file which is loaded in head section. So if this is still not working, try to replace code in Your test.js file to following: $(document).on('click', 'li', function (){ alert('working'); });
score: 0
has comment: http://stackoverflow.com/comment/45939909

http://stackoverflow.com/comment/45788910
comment on: http://stackoverflow.com/q/28753477
score: 0
type: Comment
type: QuestionComment
has text: so to simplified your question, do you mean you want to check if use import exist in current dataset if not add to data set?

http://stackoverflow.com/q/28886757
type: UnansweredQuestion
downvote count: 2
has answer: http://stackoverflow.com/a/28887153
type: Question
score: -2
tagged with: javascript
has body: This probably has a very simple answer, but I just couldn't get it to work. First Part (not working). Inside infowindow: dataTitle = place.name; content += "&lt;input type='button' value='Add this Spot' onclick='addToList("+place.geometry.location.lat()+","+place.geometry.location.lng()+",dataTitle);' &gt;"; Alert dataTitle on the spot works fine, however dataTitle is empty in the addToList function for some reason. Second Part (Working). Now I use the exact same thing OUTSIDE of customed infowindow and it works just fine... dataTitle = $(this.content).find("div.gm-title").text(); var link = $("&lt;input type='button' value='Add this Spot' onclick='latLngSet(dataTitle)' &gt;"); function latLngSet(title) { addToList(userLatitude,userLongitude,title); } Latitude and Longitude both display correctly, just the title is showing blank inside custom infowindow...
tagged with: google-maps-api-3
has title: Interactive Infowindow Google Map V3
tagged with: google-maps
upvote count: 0
answer count: 1
favorite count: 0

http://stackoverflow.com/comment/50128202
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28776610
score: 1
has text: No. We will post on developers.facebook.com when it becomes available

http://stackoverflow.com/comment/45859042
score: 0
type: AnswerComment
has text: He didn't ask for C# .NET code. He asked for JS code.
type: Comment
comment on: http://stackoverflow.com/a/28792017

http://stackoverflow.com/q/28842694
has answer: http://stackoverflow.com/a/28842890
answer count: 3
tagged with: functional-programming
tagged with: mixins
tagged with: javascript
has answer: http://stackoverflow.com/a/28845151
has comment: http://stackoverflow.com/comment/45954594
has comment: http://stackoverflow.com/comment/45954567
has body: I'm trying to get an example working for functional mixins in JavaScript. http://jsfiddle.net/xe207yec/3/ The function is supposed to create a new object from the old, add the properties from the mixin object to it, and return the new object - all the while not mutating the old object so that it can be used as expected. var plusMixin = function(oldObj, mixin) { var newObj = oldObj; newObj.prototype = Object.create(oldObj.prototype); for (var prop in mixin) { if (mixin.hasOwnProperty(prop)) { newObj.prototype[prop] = mixin[prop]; } } return newObj; }; But it's not working. The problem is that the old object is still getting mutated. Any idea why? Thanks!
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28859093
has title: What's wrong with my function for JavaScript mixins?
score: 0
type: Question
possible better answer: http://stackoverflow.com/a/28842890
accepted answer: http://stackoverflow.com/a/28859093

http://stackoverflow.com/q/28782228
tagged with: google-chrome-extension
accepted answer: http://stackoverflow.com/a/28784434
downvote count: 0
favorite count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/45841180
score: 2
type: AnsweredQuestion
has title: Stop a download from appearing on chrome download bar
has body: I'm making a Chrome Extension and I'm using this code to "catch" a download on request. chrome.downloads.onCreated.addListener(function(downloadItem) { }); What I want is to stop the download from appearing on the download bar, read the file in my extension and then delete the file from the computer. I've tried using chrome.extensions.download.erase() and chrome.browsingData.remove() but to no avail. How can I do this?
has answer: http://stackoverflow.com/a/28784434
possible better answer: http://stackoverflow.com/a/28797117
has answer: http://stackoverflow.com/a/28797117
type: Question
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/45842974

http://stackoverflow.com/comment/45842858
score: 0
comment on: http://stackoverflow.com/q/28781828
type: Comment
type: QuestionComment
has text: possible duplicate of [How to capitalize first letter of every single word in a text area?](http://stackoverflow.com/questions/28584146/how-to-capitalize-first-letter-of-every-single-word-in-a-text-area)

http://stackoverflow.com/q/28768789
accepted answer: http://stackoverflow.com/a/28769965
tagged with: javascript
score: 0
tagged with: animation
has title: snap svg animation unwanted cropping
possible better answer: http://stackoverflow.com/a/28932249
tagged with: css
tagged with: http://stackoverflow.com/tag/svg
has body: I have an svg animated with snap - mina.elastic. Due to the nature of this animation the paths I'm animating go beyond the size of the svg and crops the shapes. I want to see the strech of the whole path animation. here is the HTML &lt;svg width="130px" height="113px" viewBox="0 0 130 113" id="svg"&gt; &lt;/svg&gt; the CSS body{ text-align: center; padding: 2em; background-color: #07AD91; } JS s = Snap("#svg"); var firstShape = s.path("M119.297,113L119.297,113v-11.488H130l0,0V113H119.297z").attr({ fill: "#07AD91" }); var secondShape = s.path("M0,11.488L0,11.488V0h10.703l0,0v11.488H0z").attr({ fill: "#07AD91" }); firstShape.animate({ d: "M10.011,112.182L0,94.098l54.068-92.65l40.161,71.15H73.607L53.62,37.577L10.011,112.182z;" fill:"#46CEB4" }, 9000, mina.elastic); secondShape.animate({ d: "M130,91.641H49.094l11.094-16.658h38.5L56.472,0h20.471l42.236,72.818L130,91.641z" fill:"#97E8DA" }, 9000, mina.elastic); Here is the CODEPEN I've tried enlarging the svg height and width but then the paths stay top left and crop there.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28932249
type: Question
has answer: http://stackoverflow.com/a/28769965
answer count: 2

http://stackoverflow.com/comment/45971817
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28852567
score: 1
has text: It seems that this link is not available anymore, and there is an other version of geoip (2.1) available at http://js.maxmind.com/js/apis/geoip2/v2.1/geoip2.js.

http://stackoverflow.com/comment/45931470
type: AnswerComment
score: 0
type: Comment
has text: thanks to giving attention to me
comment on: http://stackoverflow.com/a/28830427

http://stackoverflow.com/comment/45880720
type: Comment
comment on: http://stackoverflow.com/q/28803576
type: QuestionComment
has text: Use the "edit" link to add the the code to your question. No one can read code in comments.
score: 1

http://stackoverflow.com/a/28801939
answers question: http://stackoverflow.com/q/28801840
has body: There is no such thing as "removeElement" function. Probably a JavaScript error makes your browser refresh, because it's on a link, and return false doesn't get run because of the error. You should change your removal link into a button first, then fix the "removeElement" script like this.
score: 0
type: Answer

http://stackoverflow.com/q/28825572
type: Question
accepted answer: http://stackoverflow.com/a/28919862
upvote count: 0
tagged with: javascript
score: -1
answer count: 1
has body: I have error at gulp on angularJS, display Error in plugin 'gulp-ng-annotate' app.js: couldn't process source due to parse error first, I don't know what gulp-ng-annotate function,anybody know?
favorite count: 0
tagged with: angularjs
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28919862
downvote count: 1
has title: #ask #angularJS gulp-ng-annotate

jquery-selectors
tags question: http://stackoverflow.com/q/28885646
type: Tag
tags question: http://stackoverflow.com/q/28760774
tags question: http://stackoverflow.com/q/28776119
tags question: http://stackoverflow.com/q/28823636
tags question: http://stackoverflow.com/q/28834569
tags question: http://stackoverflow.com/q/28853777
tag name: jquery-selectors
tags question: http://stackoverflow.com/q/28862179
tags question: http://stackoverflow.com/q/28826002
tags question: http://stackoverflow.com/q/28868908

http://stackoverflow.com/q/28823725
has answer: http://stackoverflow.com/a/28823809
has answer: http://stackoverflow.com/a/28823746
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/28823744
answer count: 4
accepted answer: http://stackoverflow.com/a/28823744
type: AnsweredQuestion
type: Question
possible better answer: http://stackoverflow.com/a/28823746
has answer: http://stackoverflow.com/a/28823771
has title: Styling $(this).text in JQuery
tagged with: javascript
has body: is that a way to style my text inside the JQuery, for this example: Eg. When I clicked on the button 'Show Table' will turn red to blue. $(document).ready(function () { $('#hide').on('click', function () { if ($('#category-table').is(':visible')) { $(this).text("Show Table"); /*style this text color: red;*/ $('#category-table').hide(); } else { $(this).text("Hide Table"); /*style this text color: blue;*/ $('#category-table').show(); } }); });
tagged with: jquery

http://stackoverflow.com/comment/45852989
type: QuestionComment
has text: jade can be used to write html and css. From what I have seen the 'style.' designates the following code as css. So this should be fine.
score: 0
comment on: http://stackoverflow.com/q/28788362
type: Comment

http://stackoverflow.com/comment/101761842
has text: Your suggestion of `return` saved me from brain haemorrhage. You earned an upvote for that.
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28896304
type: Comment

nodelist
type: Tag
tags question: http://stackoverflow.com/q/28774368
tag name: nodelist

http://stackoverflow.com/a/28800600
answers question: http://stackoverflow.com/q/28800587
has comment: http://stackoverflow.com/comment/45875208
score: 4
has comment: http://stackoverflow.com/comment/45875840
has body: If you replaced your images in the ajax call (which it sounds like) or any time after the imageFades object was created, then you will have to rerun the selector so that it can see the newly added images. imageFades: { init: function() { $('img').fadeIn(200); console.log('fire') } } jQuery objects are not "live". They don't keep up with changes in the DOM. They represent a snapshot of what was in the DOM at the time you created the jQuery object and that point in time that it ran the selector query.
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/45875286
downvote count: 0
has comment: http://stackoverflow.com/comment/45875112

markers
tags question: http://stackoverflow.com/q/28899176
type: Tag
tag name: markers

http://stackoverflow.com/comment/46142896
type: QuestionComment
comment on: http://stackoverflow.com/q/28883940
has text: @CameronTinker, thank you for your help. I actually did some homework and as of now there seems to be a loophole (perhaps intentional) in the HTTP specification, that in fact allows GET requests to have a body. Very easy to google and find on stack - please check. Nonetheless - this is actually off-topic here.
score: 0
type: Comment

http://stackoverflow.com/q/28887623
has comment: http://stackoverflow.com/comment/46036517
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28887729
has body: I'm having hard time to get attribute value of one textbox. This is what I have in Firebug: I tried different approaches, such as prop(), attr(), val() but without any success. Any idea how can I get that value?
type: Question
has title: Get attribute value of textbox in jQuery
has comment: http://stackoverflow.com/comment/46036642
has answer: http://stackoverflow.com/a/28887819
has comment: http://stackoverflow.com/comment/46036511
accepted answer: http://stackoverflow.com/a/28887729
score: 0
has comment: http://stackoverflow.com/comment/46036600
answer count: 3
has comment: http://stackoverflow.com/comment/46036698
has comment: http://stackoverflow.com/comment/46036607
possible better answer: http://stackoverflow.com/a/28887731
tagged with: jquery-ui
has answer: http://stackoverflow.com/a/28887731
has comment: http://stackoverflow.com/comment/46036722
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/28752690
has comment: http://stackoverflow.com/comment/45787757
tagged with: javascript
has body: I use a RangeValidator on a text field and the error text gets set properly when the value is changed and it's not within the range specified. However, I want to run some Javascript as well but I can't seem to get the javascript to trigger. How can I make javascript run on error? I tried using onerror but that didn't seem to work: &lt;asp:RangeValidator ID="maxUsersRangeValidator" runat="server" ControlToValidate="maxNumUsersTextBox" ErrorMessage="Error: max users must be between 100 and 1,000 users per batch" ForeColor="Red" MaximumValue="1000" MinimumValue="100" onerror="javascript:closeloading()" Type="Integer"&gt;&lt;/asp:RangeValidator&gt;
type: Question
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45787728
tagged with: asp.net
has answer: http://stackoverflow.com/a/28753004
accepted answer: http://stackoverflow.com/a/28753004
has title: How do I call javascript code on RangeValidator error in ASP.NET C#?
type: AnsweredQuestion
tagged with: c#

http://stackoverflow.com/a/28872670
upvote count: 1
type: Answer
accepted answer of: http://stackoverflow.com/q/28872643
downvote count: 0
answers question: http://stackoverflow.com/q/28872643
score: 1
has body: You can redirect to new page by changing location.href property: if (json.success) { location.href = '/thank-you.php'; }
type: AcceptedAnswer

http://stackoverflow.com/a/29231399
has comment: http://stackoverflow.com/comment/46738622
answers question: http://stackoverflow.com/q/28759015
downvote count: 0
has comment: http://stackoverflow.com/comment/46738779
has body: Correct me if I am wrong but it seems that you aren't using the ember inspector (available on firefox and as a bookmarklet). Once you have that installed it is really easy to inspect debug and modify anything ember related, for the purpose of this answer I will be using the chrome version. Open up your chrome dev tools in the tab that has your ember app running, once there head to the ember tab in the developer tools. In order to see the components you will have to tick a checkbox Once enabled you will be able to see all of the components currently used. Clicking on a component will open up a panel that contains all of the component's properties. In order to access those properties from the console all you need to do is click on the $E next to the components. Once clicked you should see something similar in the console. Ember Inspector ($E): Class {helperName: (...), logout: (...), isOpenBinding: StreamBinding, currentUserBinding: StreamBinding, _morph: Morph…} Now all you need to do in order to get the property values: $E.get('myProperty'); And To set them: $E.set('myProperty', newValue);
score: 19
type: Answer
has comment: http://stackoverflow.com/comment/46738654
upvote count: 19
has comment: http://stackoverflow.com/comment/46738711
has comment: http://stackoverflow.com/comment/46738615

http://stackoverflow.com/q/28857417
has answer: http://stackoverflow.com/a/28857508
type: Question
answer count: 2
has title: Save data URI in cookie to retrieve it later
tagged with: html5-canvas
has answer: http://stackoverflow.com/a/28857518
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/28857508
possible better answer: http://stackoverflow.com/a/28857518
has body: I'm working with html canvas and creating a data URI to preview an image that the user can build himself. When he hits a preview button, the image gets displayed: $("#show_label").html('&lt;img src='+canvas.toDataURLWithMultiplier("png",1,1)+' width="157" height="202"&gt;'); Works fine. Now I want to save the dataURL in a cookie as I want to restore the image at a later stage on the website or store it in my database later. $.cookie("current_label",canvas.toDataURL()); That won't work. I understand that this is not a no-brainer, although it would make sense to store objects in a cookie as well. I guess I would have to encode the data URI and decode it later. But how? Researching didn't give me any results. Also, could it be that cookies would become too large then so this is not even something to consider? Should I store the dataURL in a SQL database instead and just use a cookie to identify the database entry (e.g. via ID)? Any help appreciated.
type: AnsweredQuestion
tagged with: cookies

http://stackoverflow.com/comment/46042838
type: QuestionComment
comment on: http://stackoverflow.com/q/28887976
has text: Have you tried chart.redraw() or chart.reflow() on resize? This is weird behavior. Good luck.
score: 0
type: Comment

http://stackoverflow.com/a/28887279
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46035851
score: 4
has comment: http://stackoverflow.com/comment/46035982
has comment: http://stackoverflow.com/comment/46036169
has comment: http://stackoverflow.com/comment/46036651
type: Answer
accepted answer of: http://stackoverflow.com/q/28887214
has comment: http://stackoverflow.com/comment/46036382
answers question: http://stackoverflow.com/q/28887214
has comment: http://stackoverflow.com/comment/46036690
has comment: http://stackoverflow.com/comment/46036792
has body: $(document).on('click', '.edit-select a', function() { // do stuff }); jQuery is only aware of the elements in the page at the time that it runs, so new elements added to the DOM are unrecognized by jQuery. To combat that use event delegation, bubbling events from newly added items up to a point in the DOM that was there when jQuery ran on page load. Many people use document as the place to catch the bubbled event, but it isn't necessary to go that high up the DOM tree. Ideally you should delegate to the nearest parent that exists at the time of page load. Keep in mind that elements added to the DOM dynamically during page load can be bound to without relying on bubbling and delegation as long as events are bound to them after the element has been included. Consider the following example - var newKid = ' Jan '; $('.parent').append(newKid); $('.kid').click(function() { var kidName = $(this).html(); var message = kidName + ' got clicked '; $('.whoGotClicked').append(message); }); var newKid = ' Cindy '; $('.parent').append(newKid); Who do you think will be added to the 'got clicked' list here? Marsha is included in the original markup and Jan was added to the DOM as the script ran, but prior to the click event being bound to the kid class. Cindy was added to the DOM after the binding occurred. Both Marsha and Jan are handled by the click event while Cindy is left in the cold. Using event delegation $(document).on('click', '.kid', function() {... will insure that all kids, now and in the future, will get handled.
upvote count: 4
has comment: http://stackoverflow.com/comment/46036541
has comment: http://stackoverflow.com/comment/46036096

http://stackoverflow.com/comment/45807740
score: 0
type: AnswerComment
has text: @jurgemaister I will take care of this in future. Thanks for bringing this into my consideration. :)
type: Comment
comment on: http://stackoverflow.com/a/28763354

http://stackoverflow.com/comment/46007330
comment on: http://stackoverflow.com/q/28871627
type: Comment
type: QuestionComment
has text: Is there a reason that `myscript.js` is in both `start.html` and in `context_scripts`? The first case is for the icon click and the second case is for the individual tabs.
score: 0

http://stackoverflow.com/a/28840505
has comment: http://stackoverflow.com/comment/45951759
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28839518
has comment: http://stackoverflow.com/comment/45951243
upvote count: 2
has comment: http://stackoverflow.com/comment/45951326
type: Answer
has body: Here you go! - I merged it for ease. Just click on circle to see text on it. var canvas = document.getElementById('canvas'); var context = canvas.getContext('2d'); var radius = 70; var lineWidth = 5; var cols = 3; var rows = 2; var distance = 50; var circles = []; //click circle to write canvas.onclick = function(e) { // correct mouse coordinates: var rect = canvas.getBoundingClientRect(), // make x/y relative to canvas x = e.clientX - rect.left, y = e.clientY - rect.top, i = 0, circle; // check which circle: while(circle = circles[i++]) { context.beginPath(); // we build a path to check with, but not to draw context.arc(circle.x, circle.y, circle.radius, 0, 2*Math.PI); if (context.isPointInPath(x, y) &amp;&amp; !circle.clicked) { circle.clicked = true; context.fillStyle = "blue"; context.font = "bold 34px Arial"; context.textAlign="center"; context.fillText("Yeah", circle.x, circle.y); break; } } }; //draw circles for (var i = 0; i &lt; rows; i++) { for (var j = 0; j &lt; cols; j++) { // Draw circle var offset = radius * 2 + lineWidth + distance; var center = radius + lineWidth; var x = j * offset + center; var y = i * offset + center; circles.push({ id: i + "," + j, // some ID x: x, y: y, radius: radius, clicked:false }); console.log(circles) context.beginPath(); context.arc(x, y, radius, 0, 2 * Math.PI, false); context.fillStyle = 'green'; context.fill(); context.lineWidth = lineWidth; context.strokeStyle = '#003300'; if (j != cols - 1) { // Draw horizontal line var hLineX = x + radius; var hLineY = y; context.moveTo(hLineX, hLineY); context.lineTo(hLineX + distance + lineWidth, hLineY); } if (i &gt; 0) { // Draw vertical line var vLineY = y - radius - distance - lineWidth; context.moveTo(x, vLineY); context.lineTo(x, vLineY + distance + lineWidth); } context.stroke(); } } &lt;div id="ways" style="width:1000px;margin:0 auto;height:100%;"&gt; &lt;canvas id="canvas" width="1000" height="1000"&gt;&lt;/canvas&gt; &lt;/div&gt; Happy Helping!
has comment: http://stackoverflow.com/comment/45950335
score: 2
has comment: http://stackoverflow.com/comment/45950936
has comment: http://stackoverflow.com/comment/45951061
has comment: http://stackoverflow.com/comment/45965554
has comment: http://stackoverflow.com/comment/45952004
has comment: http://stackoverflow.com/comment/45950541
accepted answer of: http://stackoverflow.com/q/28839518

http://stackoverflow.com/a/28823301
type: Answer
answers question: http://stackoverflow.com/q/28823283
has body: You can use the first style, but I personally prefer this: http://www.w3schools.com/js/js_objects.asp
has comment: http://stackoverflow.com/comment/45918089
has comment: http://stackoverflow.com/comment/45917916
has comment: http://stackoverflow.com/comment/45917950
score: 0

http://stackoverflow.com/q/28826872
has title: How to render html in Angularjs directive?
downvote count: 0
has body: I am trying to make custom directive to display: Will {{selectedAsset}} go {{red}} or {{green}}？ It looks like this on the screen: AUD/USD will down(red color) or up(green color)? The {{red}} and {{green}} part should have its own color . Hence I am trying to wrap it with a span having desired classes. But it is not working, below is the code: var widgetMessage = { "Trade_Header": "Will {{selectedAsset}} go {{red}} or {{green}}？", "goUp": "up", "goDown": "down"} myApp.directive("tradeHeader", function($sce) { return { restrict: "AE", scope: { selectedAsset: "=", green:"=", red:"=" }, link: function(scope, element, attrs) { scope.green = $sce.trustAsHtml('' + scope.green + ''); }, template: widgetMessage.Trade_Header, } }); widgetMessage.Trade_Header need to be variable cause the design. This consequence will be : "AUD/USD will down or up？" I need it to be compiled as HTML, any suggestions?
type: AnsweredQuestion
score: 1
type: Question
has comment: http://stackoverflow.com/comment/45924461
upvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/28827608
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28827608
favorite count: 0
linked to: http://stackoverflow.com/q/28346861
tagged with: angularjs

http://stackoverflow.com/q/28789235
answer count: 0
score: 0
has title: How to rename linux directories using javascript function
has comment: http://stackoverflow.com/comment/45854181
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45854125
has comment: http://stackoverflow.com/comment/45876722
tagged with: directory
has body: Brand new to stackoverflow. I've looked this up and can't seem to find a clear cut answer based on my situation. I have an Ubuntu Server running Apache for a shared file system that I can view on my IP's port 80. I've made a style.css file and am using a php file for the index of Apache. It simply uses a for loop to get all of the current directory's file/directory names, and then puts them into a table with an that takes me to the directory/file you click on. So far I've successfully put an "edit" button that makes the name of all files/directories editable, and then saved the new names onto the localStorage. My question is how do I use a FileSystemObject to get the directory of the edited file/directory and change the name to the new content stored in the localStorage? I read that FSO's only work with windows? Is there another API that I can use to grab the directories and change their names? Thanks
type: UnansweredQuestion
tagged with: names

http://stackoverflow.com/a/28764692
type: Answer
has body: You can save the Javascript code in an external js file and include it in your html/php files via the script tag; EDIT: Ok, first of all, you need to remove the overloaded getOutput(link) function altogether. This will make your call to xyz.php file point to the actual php file, otherwise it points to a file called undefined (since you don't provide the link parameter). Then, there is a typo in your xyz.php file in lines 16,17: $URL = "xyz.php?eingabe=',temp2a[$i],'&eingabe2=',$datei,"; echo ''; should be changed to this; // Note the missing $ sign from your temp2a variables and the missing quotes from the anchor tag $URL = "xyz.php?eingabe=',$temp2a[$i],'&eingabe2=',$datei,"; echo '';'; EDIT2: Found some other minor bugs in your files; index.html: Search xyz.php: <?php $vergleich = $_GET["eingabe"]; $datei = $_GET["eingabe2"]; $temp2a = array("0.1.2.4", "0.1.2.3", "0.1.2.2"); for ($i = 0; $i < count($temp2a); $i++) { $URL = "xyz.php?eingabe=".$temp2a[$i]."&eingabe2=".$datei; echo ' link '; } ?> script.js: function getOutput(url) { url = url || "xyz.php?eingabe=123&eingabe2=File.csv"; getRequest( url, // URL for the PHP file drawOutput, // handle successful request drawError // handle error ); return false; } // handles drawing an error message function drawError() { var container = document.getElementById('wagoartikelnr2'); container.innerHTML = 'Bummer: there was an error!'; } // handles the response, adds the html function drawOutput(responseText) { var container = document.getElementById('wagoartikelnr2'); container.innerHTML = responseText; } // helper function for cross-browser request object function getRequest(url, success, error) { var req = false; try{ // most browsers req = new XMLHttpRequest(); } catch (e){ // IE try{ req = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { // try an older version try{ req = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { return false; } } } if (!req) return false; if (typeof success != 'function') success = function…
has comment: http://stackoverflow.com/comment/45810172
has comment: http://stackoverflow.com/comment/45808735
has comment: http://stackoverflow.com/comment/45809072
has comment: http://stackoverflow.com/comment/45890355
upvote count: 3
has comment: http://stackoverflow.com/comment/45810866
answers question: http://stackoverflow.com/q/28764628
has comment: http://stackoverflow.com/comment/45809834
accepted answer of: http://stackoverflow.com/q/28764628
has comment: http://stackoverflow.com/comment/45810774
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45808811
score: 3

http://stackoverflow.com/a/28878124
has body: This should do the trick: Usuario: {{user.user}} Clave: {{user.pass}}
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28878031

http://stackoverflow.com/comment/45816017
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28768307
has text: @georg You forgot a \n right before `Cuisine` in the text.
score: 0

storage
tag name: storage
tags question: http://stackoverflow.com/q/28815107
type: Tag

http://stackoverflow.com/comment/46071022
score: 0
has text: Got it.. url in your ajax definition should be `'email.php'` in quotes, without that it's just sending a call to `http://test.bunkerhill.com/` and your PHP code sending `email` is never invoked at all :)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28905342

http://stackoverflow.com/q/28802687
answer count: 5
has body: I got a requirement like this, Add More Qulification 1 Qulification 2 remove Qulification 3 remove qulification2 and qulification3 span default keep hide, when click one time on "Add More" btn, it shows qulification2. next click shows qulification3. How to do it? I have done it using two Add More button. but it is not good way, Add More Add More $('#addmore2').click(function() { $('#qulification2').show(); }); $('#addmore3').click(function() { $('#qulification3').show(); });
type: AnsweredQuestion
has title: JQuery / Javascript Show Hide multiple Content using one button?
possible better answer: http://stackoverflow.com/a/28802723
type: Question
has comment: http://stackoverflow.com/comment/45879097
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45879142
has comment: http://stackoverflow.com/comment/45879061
score: 0
accepted answer: http://stackoverflow.com/a/28802793
has comment: http://stackoverflow.com/comment/45879116
has answer: http://stackoverflow.com/a/28802751
has answer: http://stackoverflow.com/a/28802723
has answer: http://stackoverflow.com/a/28802779
has answer: http://stackoverflow.com/a/28802769
has answer: http://stackoverflow.com/a/28802793

http://stackoverflow.com/comment/45849622
type: QuestionComment
comment on: http://stackoverflow.com/q/28786789
score: 0
has text: @sdespont - the numbers are randomly generated
type: Comment

http://stackoverflow.com/a/28788964
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28788896
type: Answer
has body: First thing is avoid using js code inside html tags it is a bad practice , you can use the keyup event to get the content of the input after the user release any pressed key &lt;input id="input"&gt; &lt;script&gt; var input = document.getElementById('input'); input.addEventListener('keyup',function(){alert(input.value);}); &lt;/script&gt;
has comment: http://stackoverflow.com/comment/45853687
has comment: http://stackoverflow.com/comment/45853723
upvote count: 6
has comment: http://stackoverflow.com/comment/45853676
score: 6
has comment: http://stackoverflow.com/comment/45853652
answers question: http://stackoverflow.com/q/28788896

http://stackoverflow.com/q/28831040
has body: I'm using Owl Carousel 2 to display some images for a lookbook. On small screens I show only 1 image at a time. When more screen space is available I display 2 images at a time, think of it like a printed magazine. Now, I can't figure out how to move slides when dragging (touch swipe) by 2 images on screens where 2 images get displayed at a time. So basically on bigger screens I want the same behavior when swiping as when the owl nav is pressed. Is this possible? $('.lookbook-slider').owlCarousel({ autoplay:true, loop:true, nav:true, lazyLoad:true, navText: ["&lt;i class='icon-arrow-left4'&gt;&lt;/i&gt;","&lt;i class='icon-uniE64D'&gt;&lt;/i&gt;"], dots:false, margin:0, responsiveClass:true, responsive:{ 0:{ items:1, slideBy:"1", merge:false, mergeFit:true }, 640:{ items:2, slideBy:"2", merge:true, mergeFit:true } } }); Thanks in advance!
tagged with: jquery-plugins
tagged with: owl-carousel
upvote count: 4
tagged with: touch
downvote count: 0
tagged with: javascript
has title: Owl Carousel 2 touchDrag by same number as slideBy possible?
tagged with: carousel
favorite count: 0
score: 4
answer count: 0
type: UnansweredQuestion
type: Question

http://stackoverflow.com/comment/45853015
type: Comment
has text: Ok, so it seems your `.panel-heading` css rule has not been parsed. By the way I noticed you wrote `type="text/css/"` instead of `type="text/css">` in your `index.html` file
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28788467

http://stackoverflow.com/a/28758066
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28757956
type: Answer
has body: You could: var allErrors = []; $.each( modelState, function( name, errors ){ allErrors = allErrors.concat(errors); } );
answers question: http://stackoverflow.com/q/28757956

http://stackoverflow.com/comment/46014638
score: 1
has text: You linked to a question that this could have been closed as a duplicate of and said it didn't help - can you clarify _why_ it didn't help, so we understand why this isn't a duplicate of that one?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28876300

http://stackoverflow.com/a/28778385
has body: W3C link for style.visibility document.getElementById("controlid").style.visibility = "hidden" you just change like function trVisible(val) { var selected = $("#" + val.id + " input:radio:checked").val(); if (selected == "1") { document.getElementById('&lt;%=TrMarketingDetails.ClientID %&gt;').style.visibility = "visible"; document.getElementById('&lt;%= hfdMarket.ClientID %&gt;').value = 'Y'; } else if (selected == "2") { document.getElementById('&lt;%=TrMarketingDetails.ClientID %&gt;').style.visibility = "hidden"; } } You are already use jquery syntax in your code, then good to do this via jquery syntax like $('#&lt;%=TrMarketingDetails.ClientID %&gt;').show(); $('#&lt;%=TrMarketingDetails.ClientID %&gt;').hide(); Check this link with same question
has comment: http://stackoverflow.com/comment/45834672
type: Answer
answers question: http://stackoverflow.com/q/28778223
has comment: http://stackoverflow.com/comment/45834819
score: 0

http://stackoverflow.com/q/28812240
has title: Make an image appear on the canvas after x amount of seconds
has comment: http://stackoverflow.com/comment/45896370
score: 0
answer count: 2
tagged with: html5-canvas
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28821097
has answer: http://stackoverflow.com/a/28812282
has comment: http://stackoverflow.com/comment/45896358
has body: I want to draw an image on to the canvas after say 5 seconds. Once it has been drawn i want it to move down the screen a little and then just stop. Is there any way to do this? Here is the technique I've tried: I have the image moving down the canvas using a simple for loop and maxY property of the image. However the image appears straight away without a delay of 5 seconds.
accepted answer: http://stackoverflow.com/a/28821097
tagged with: animation
possible better answer: http://stackoverflow.com/a/28812282
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/45896514
tagged with: javascript

http://stackoverflow.com/comment/45860749
comment on: http://stackoverflow.com/a/28792937
type: AnswerComment
has text: can't use document.write after the page loads, will wipe everything else out
type: Comment
score: 3

http://stackoverflow.com/a/28837690
downvote count: 0
answers question: http://stackoverflow.com/q/28837247
type: Answer
score: 2
upvote count: 2
has body: Your code doesn't work because of this line: setInterval( intervalFunc(thinkingTime, answerTime), 1000); Change it into this: setInterval( function(){ intervalFunc(thinkingTime, answerTime); }, 1000); You need to provide a function to setInterval(), while you are providing undefined. This is why it doesn't run. Running code: function enableTimer(time) { var elem = jQuery('#qanda-time-remaining'), interval = setInterval( function(){ if(time/1 == time/1 && time) //if(!isNaN(time) && time>0) { elem.text( time-- ); } else { clearInterval(interval); elem.text(0); } }, 1000); } enableTimer(5); I have simplified your code to the extreme and is so much easy to read. You can set a new parameter to which you provide a function that will run after the time is up: function enableTimer(time, fn) { var elem = jQuery('#qanda-time-remaining'), interval = setInterval( function(){ if(time/1 == time/1 && time) //if(!isNaN(time) && time>0) { elem.text( time-- ); } else { clearInterval(interval); elem.text(0); if( fn instanceof Function )//if fn is a function { fn();//call it } } }, 1000); } enableTimer(5, function(){ alert('Time\'s up!'); });

http://stackoverflow.com/a/28907279
has comment: http://stackoverflow.com/comment/64783914
type: Answer
answers question: http://stackoverflow.com/q/28796222
score: 1
type: AcceptedAnswer
upvote count: 1
has body: The third argument of PIXI.autoDetectRenderer should be an Object, not an element. You should set the Object property "view" to be your canvas element. var renderer = PIXI.autoDetectRenderer( 512, 384, { view: document.getElementById("game-canvas") }); Also note that you may need to run a local server in order to view it in Chrome.
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28796222

http://stackoverflow.com/a/28974279
accepted answer of: http://stackoverflow.com/q/28891046
answers question: http://stackoverflow.com/q/28891046
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1
has body: (Summary from chat) Short answer: Just to clarify the original issue: it was caused by a timing problem. The code uses several ajax calls, which are asynchronous. As a result, the function that refreshes the DIV was trying to grab the selected company before the company list was even populated. Obviously, the solution is to wait until after it is populated. Then refresh the DIV. Longer answer: The original code used a &lt;cfselect bind...&gt;, or ExtJS, using a different event model than jQuery. JQuery's document.ready event was actually firing before ExtJS loaded the select list. Consequently, when PopulateCustomerAlertDIV() tries to grabs the "selected" company: $.ajax({ url:'cfcs/customerAlertDIV.cfc?method=getAlert&amp;returnformat=json', data: { company_name: $("##company_name&gt;option:selected").attr("Value") }, .. }); ... the result is null/undefined. So it does not actually pass a valid company_name to the CFC. That is why the &lt;div&gt; is not populated correctly. &lt;script&gt; $(document).ready(function() { //... // 1st: $.ajax() call to populate select list PopulateList(); // 2nd: populate div with selected company PopulateCustomerAlertDIV(); //... }); &lt;/script&gt; The later code uses jQuery to populate the list instead of a "bind". That is better IMO, because it does not mix event models. However, it still has a slight timing problem. The first function uses an $.ajax() call to populate the company list. $.ajax() calls are asynchronous by default. Even though the PopulateCustomerAlertDIV() function is invoked second, there is no guarantee the first function will have finished executing when it starts. So ultimately, PopulateCustomerAlertDIV() is still trying to access the selected company before the company list is even populated. The solution is to invoke PopulateCustomerAlertDIV() after the company list is populated: as Mike suggested, inside the success() method of the ajax call. (Though no need to modify the function parameters). Keep in mind y…
score: 1

http://stackoverflow.com/a/28759734
score: 4
answers question: http://stackoverflow.com/q/28759694
type: Answer
has body: If you're just going to download the file, you don't need tags, which are for playing the file, not downloading, you can of course use both, but the anchor has nothing to do with the audio tag DownloadButton
has comment: http://stackoverflow.com/comment/78888136
upvote count: 4
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28759694

http://stackoverflow.com/a/28789429
score: 1
has comment: http://stackoverflow.com/comment/45858054
type: AcceptedAnswer
downvote count: 0
has body: You are having more of a JavaScript problem than a testing problem. What you have is essentially the same as: var result = bcrypt.compareSync('newTestPassword', this); return u.ChangePassword('testPassword', 'newTestPassword').should .eventually.be.an.instanceof(User) .and.have.property('encrypted_password') .that.satisfy(result); which should make the issue clearer. this in your case is mochas test function context object, not your property. .satisfy expects a function, so I'd do either: .that.satisfy(function(hash){ return bcrypt.compareSync('newTestPassword', hash); }); or use .bind, though it's probably more confusing: .that.satisfy(bcrypt.compareSync.bind(bcrypt, 'newTestPassword'));
answers question: http://stackoverflow.com/q/28788781
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28788781

http://stackoverflow.com/a/28851797
upvote count: 7
has comment: http://stackoverflow.com/comment/78895458
score: 7
has comment: http://stackoverflow.com/comment/74635610
has body: Similar to my answer here the technique is to chain the actions themselves, either by an actual for loop or by a .reduce. Since you asked for a for loop let's stick to that: var queue = Promise.resolve(); // start waiting urls.forEach(function(url){ queue = queue.then(function(result){ // put result somewhere return visitPage(url); }); }); queue.then(function(){ // all done here }); You can change visitPage to only take a url rather than mutate urls which should be nicer anyway.
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28851578
type: Answer
answers question: http://stackoverflow.com/q/28851578

http://stackoverflow.com/comment/45803847
comment on: http://stackoverflow.com/q/28762045
has text: For what reasons uses variable `condition` ?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45792648
type: Comment
type: QuestionComment
has text: So… what’s the question? Is it “why does `indexOf` return `-1` sometimes?
score: 2
comment on: http://stackoverflow.com/q/28755645

http://stackoverflow.com/comment/132866535
has text: This worked for me. Thanks! I had tried another ones with NextJS but there were some issues with Edge runtime
comment on: http://stackoverflow.com/a/41024899
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46012751
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28874371
type: AnswerComment
has text: Using filter doesn't work in my approach, because I need access to the chosen element. Otherwise instead of display(header) you can use (header | space) and it will display the text going through the filter. I already mentioned in the answer that it temporarily removes the indentation of the chosen element in the select list as well, and if that doesn't work for you, you should consider one of the more complicated alternatives I listed. Still, you will not get to display a text without indentation in the closed form and with indentation in the open form at the same time.

http://stackoverflow.com/q/28752929
answer count: 1
tagged with: javascript
tagged with: carrierwave
favorite count: 0
has body: I am building a rails app that uses Carrierwave to let a user upload svg files and Inline_SVG to display them inline in my views. I need to be able to upload files of any size and then resize and rotate them according to specifications. If these were png's or jpegs ImageMagick could do it, but it doesn't handle svgs. I tried to change the attributes using javascript to resize, but it does not solve my issue, and I have no idea how that would work to rotate them anyways: &lt;script type="text/javascript"&gt; var img; var images = $('svg'); for (i = 0; i &lt; images.length; i++) { img = images[i]; img.setAttribute('viewBox', '0 0 1000 1000'); img.removeAttribute('height'); img.removeAttribute('width'); } &lt;/script&gt; Any pointers?
has answer: http://stackoverflow.com/a/28753176
tagged with: http://stackoverflow.com/tag/svg
type: UnansweredQuestion
has title: Manipulating an uploaded svg file in rails
upvote count: 1
tagged with: ruby-on-rails
type: Question
score: 1
downvote count: 0

http://stackoverflow.com/comment/46000161
comment on: http://stackoverflow.com/q/28867765
type: Comment
type: QuestionComment
has text: @Jaxo it won't help - the queue moves.
score: 0

http://stackoverflow.com/q/28751167
tagged with: javascript
score: 0
tagged with: path
has answer: http://stackoverflow.com/a/29665479
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js
has title: How to smoothen a path using D3
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/29665479
has body: This is concerning: Making a SVG path like a smooth line instead of being ragged So would like to smooth all lines on my map if possible. Finally I have a topojson but I was not able to find anything that can smooth a topojson path. Here is a solution that smoothes for a geojson at least: http://bl.ocks.org/hugolpz/d53d33af6ffb1366e187 And here is something about a single line: http://www.d3noob.org/2013/01/smoothing-out-lines-in-d3js.html But I have no clue how to change it. Here is a small jsfiddle example where you can play around: jsfiddle.net/kwoxer/kpL1uyy2/6/ Would be awesome if this would be something like a simple command called smooth =)
type: Question
answer count: 1
linked to: http://stackoverflow.com/q/28638327

http://stackoverflow.com/comment/46068199
has text: We can access to `thisbinding component` with `this` keyword, though?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28902999
type: AnswerComment

http://stackoverflow.com/a/28825230
score: 3
has comment: http://stackoverflow.com/comment/45922167
downvote count: 0
has comment: http://stackoverflow.com/comment/45922268
accepted answer of: http://stackoverflow.com/q/28825157
answers question: http://stackoverflow.com/q/28825157
has comment: http://stackoverflow.com/comment/45922108
has comment: http://stackoverflow.com/comment/45922403
has comment: http://stackoverflow.com/comment/45922808
has comment: http://stackoverflow.com/comment/45923083
upvote count: 3
has comment: http://stackoverflow.com/comment/45922138
type: AcceptedAnswer
has body: In order for date_format to work, you need to initialize a DateTime object first: <?php $month = ''; if(isset($_GET["reviewdate"])) { $date = new DateTime($_GET["reviewdate"]); // or $date = date_create($_GET["reviewdate"]); will work the same $month = date_format($date, "n"); } ?> <input name="reviewmonth" type="hidden" value="<?php echo $month; ?>"> If you want to do this in JS, you need to add a handler for the datepicker to handle the reviewmonth and append it inside the hidden input: <?php if(isset($_POST['submit'])) { echo ' ', print_r($_POST), ' '; } ?> Sample Output
has comment: http://stackoverflow.com/comment/45922194
type: Answer

http://stackoverflow.com/a/28904525
has body: Use the jquery id selector # for an object &lt;script&gt; $(function () { $('#span1WidthExpMap').addClass('byDeafult'); $('#inputWidthExpMap').addClass('byDeafult'); $('#span2WidthExpMap').addClass('byDeafult'); }); &lt;/script&gt;
score: 0
answers question: http://stackoverflow.com/q/28904447
type: Answer
has comment: http://stackoverflow.com/comment/46068779

http://stackoverflow.com/comment/45877045
type: Comment
has text: And also I just found in google's official docs, it doesn't add "()". Here is the link-- https://developers.google.com/youtube/iframe_api_reference
type: AnswerComment
comment on: http://stackoverflow.com/a/28801569
score: 0

http://stackoverflow.com/q/28822715
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28825500
has comment: http://stackoverflow.com/comment/45960318
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28825500
tagged with: createjs
answer count: 1
favorite count: 0
has title: Drag and drop doesn't work in chrome using EaselJS
tagged with: google-chrome
type: AnsweredQuestion
has body: I've been trying to implement some drag and drop functionality for a Bitmap in EaselJS. Anyways, it works just fine in Firefox and IE, but nothing happens when I try to run the code in Chrome. All of the code is local, as is the image. Here's a brief overview of the relevant code: stage = new createjs.Stage("testCanvas"); img = new createjs.Bitmap("img.png"); stage.addChild(img); img.addEventListener("pressmove", function ( event ) { img.x = event.stageX; img.y = event.stageY; }); stage.update();
has comment: http://stackoverflow.com/comment/45917046

http://stackoverflow.com/a/28800666
accepted answer of: http://stackoverflow.com/q/28800639
type: Answer
has body: You could simply make those elements radio buttons with the same name attribute: Updated Example In doing so, the elements are mutually exclusive, and only one can be selected at once. &lt;div class="container"&gt; &lt;input type="radio" name="yes-no" class="yesno"/&gt;Yes &lt;input type="radio" name="yes-no" class="yesno"/&gt;no &lt;input type="checkbox" class="yesno"/&gt;maybe &lt;/div&gt;
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45875224
has comment: http://stackoverflow.com/comment/45876390
score: 0
has comment: http://stackoverflow.com/comment/45875197
has comment: http://stackoverflow.com/comment/45875265
answers question: http://stackoverflow.com/q/28800639

http://stackoverflow.com/comment/45913761
score: 0
type: Comment
has text: <event> I need to know the width of event and assign the related with to ul element
type: QuestionComment
comment on: http://stackoverflow.com/q/28820195

http://stackoverflow.com/a/30193091
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28812796
has body: EDIT: Now I see you have played with some of this, just pay attention to the MTL tip. Have you tried modifying the ambient/directional light components or adding them? it looks like you have to configure how light is apllied to your model. ambient = new THREE.AmbientLight(0xFFFFFA); //most black scene.add( ambient ); var directionalLight = new THREE.DirectionalLight( 0xffeedd ); //to see shaders directionalLight.position.set( 0, 0, 1 ).normalize(); //front of scene scene.add( directionalLight ); you may also change manually the Ks and Ke components of your material on the mtl file. A common problem is that they configure like this by default: Ks 0.0000 0.0000 0.0000 Ke 0.0000 0.0000 0.0000 And they might be with some other values like 1 instead of 0 in order to correct light reflectance. You can also be interested in centering your obj in the scene, you could do it by setting the position on the load of your model with something like var loader = new THREE.OBJMTLLoader(); loader.load( 'models/'mymodel.obj', 'textures/mymodel.mtl', function ( object ){ //after the load of your model you can modify it's initial position by object.position.set(0,0,0); //in one step object.position.y = -80; //or by separated components scene.add(object); }); or you can also modify camera parameters by camera.position.z = 550 ; //for example I hope you can do something with that.

http://stackoverflow.com/comment/46071041
type: QuestionComment
comment on: http://stackoverflow.com/q/28892824
has text: I have posted an answer for this. Check @pradip
score: 0
type: Comment

http://stackoverflow.com/comment/45975593
type: AnswerComment
has text: In the example method above, where I have `console.log(object.get("productName"))`, you actually have the `product`. You can access all the attributes as you did with your example result.get("productName"). If you wanted to render this in a page, if this was client-side javascript, you could modify a HTML element with the value of the product. If this was server side javascript, and you were using the express framework, you could render that value out to a template.
type: Comment
comment on: http://stackoverflow.com/a/28854002
score: 0

wkwebview
tags question: http://stackoverflow.com/q/28795476
tags question: http://stackoverflow.com/q/28766676
type: Tag
tag name: wkwebview

http://stackoverflow.com/q/28899900
has comment: http://stackoverflow.com/comment/46059298
has answer: http://stackoverflow.com/a/28900630
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/28900630
has title: jQuery File Upload and Validation undefined function
has comment: http://stackoverflow.com/comment/46060393
has body: I am using jQuery file upload and validation but it looks like there is some conflict which I am not able to resolve. I have tried to fix it by applying jQuery.noConflict(); but that did not help at all. Error: Uncaught TypeError: undefined is not a function (index):943 (anonymous function) (index):943 m.Callbacks.j jquery.min.js:2 m.Callbacks.k.fireWith jquery.min.js:2 m.extend.ready jquery.min.js:2 J jquery.min.js:2 Code on Line 943 var amount_input = 5; Here is the jQuery code: HTML Code: Please, fill the required fields above to begin file upload Upload File File ( jpg, png, jpeg, gif ): Upload more files
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46059251
score: 0
has comment: http://stackoverflow.com/comment/46059233
tagged with: undefined

http://stackoverflow.com/comment/45904308
score: 0
type: Comment
type: QuestionComment
has text: DavidP, the latter. The answer below, by wlin, answers 99% of my initial question. Thanks!
comment on: http://stackoverflow.com/q/28813510

http://stackoverflow.com/comment/45887085
comment on: http://stackoverflow.com/q/28806949
score: 0
has text: hindmost, this is totally incorrect you can use either and its recommended to use both
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/70636085
has text: @wrschneider because without parens js parser thinks that its a function body, not an object, and foo is [a label](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/label)
score: 71
comment on: http://stackoverflow.com/a/28770578
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45917742
type: Comment
has text: @Ninetainedo it worked! thank you! Your solution help me out a lot THUMBS UP!
comment on: http://stackoverflow.com/a/28812427
score: 1
type: AnswerComment

http://stackoverflow.com/q/28814299
has answer: http://stackoverflow.com/a/28814437
has comment: http://stackoverflow.com/comment/45900387
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has title: Javascript passing color into table name css
score: 0
has comment: http://stackoverflow.com/comment/45900388
has body: This is very close to working but I just can't seem to get the final bit right to apply the individual pathColor to the row with the same index. Here is what I have so far: // Set row colour based on chart colours $(function() { var paths = $('#results_donut .highcharts-series path'); var rows = $('.result-figures table tr'); paths.each(function(idx, element){ var path = $(this) var pathColor = path.attr('fill'); rows.each(function(idx) { $(this).css('color', pathColor); }) }); }); This is outputting the last pathColor and applying it to every row. Does anyone know how to correctly apply the pathColor of each path to the corresponding row based on the index?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28814392

http://stackoverflow.com/comment/61619049
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28888413
has text: Other content types work as well, as long as it's the same in the signature and the actual `PUT` request.
type: Comment

http://stackoverflow.com/q/28816009
has comment: http://stackoverflow.com/comment/45938122
has comment: http://stackoverflow.com/comment/46157819
has comment: http://stackoverflow.com/comment/45935273
has comment: http://stackoverflow.com/comment/45906140
has comment: http://stackoverflow.com/comment/45937427
has comment: http://stackoverflow.com/comment/46052873
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45929526
has comment: http://stackoverflow.com/comment/46155273
has body: I'm trying to make a visualization of a center node that's connected to nodes around it. Currently, there's one line between the center node and each of the other nodes. I would like to change that into two parallel lines with different width and color (one showing information about calls and one showing information about texts). It's important that the two lines fit exactly next to each other with no space between them and no overlap. EDIT: The answer from mdml and comments from LarsKotthoff helped me. However, I'm still facing some issues as seen in the comments: The offset seems to push the two lines in the direction of the bigger line (see imgur.com/Fwri75T). I really can't understand. I've updated the code here. Full code can be found at https://www.dropbox.com/s/xykoln14euewm9z/Network%20View%20v2.zip?dl=0 function total_width(d) { return (d.inc_calls + d.out_calls + d.inc_texts + d.out_texts) / max_interactions * line_width_factor; } var line_diff = 1; function line_perpendicular_shift(d, direction) { theta = getAngle(d); theta_perpendicular = theta + (Math.PI / 2)*direction; width = total_width(d) + line_diff // Both lines are pushed 1/4, moving the center by 1/2, causing the two lines to connect exactly at the middle. delta_x = width / 4 * Math.cos(theta_perpendicular) delta_y = width / 4 * Math.sin(theta_perpendicular) return [delta_x, delta_y] }
has comment: http://stackoverflow.com/comment/46172286
tagged with: visualization
has comment: http://stackoverflow.com/comment/46154367
tagged with: data-visualization
tagged with: graph-visualization
has comment: http://stackoverflow.com/comment/46053108
has comment: http://stackoverflow.com/comment/46053213
has comment: http://stackoverflow.com/comment/45930779
favorite count: 0
has comment: http://stackoverflow.com/comment/46155943
answer count: 0
upvote count: 2
tagged with: d3.js
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46154123
has comment: http://stackoverflow.com/comment/45938283
has title: Two parallel lines between two nodes using D3
has comment: http://stackoverflow.com/comment/46180875
has comment: http://stackoverflow.com/comment/45934630
score: 2
type: Question

http://stackoverflow.com/a/28906248
type: AcceptedAnswer
downvote count: 0
score: 4
type: Answer
has comment: http://stackoverflow.com/comment/46072051
answers question: http://stackoverflow.com/q/28906145
has body: It doesn't move when you click it because you are setting it to a static value. You need to change the value somehow. var deg=45; $('#gauge').click(function(){ var t = 'rotate(' + deg +'deg)'; $('#gauge').css({transform: t}) deg = deg+5; }); http://jsfiddle.net/4xc3wnux/6/
accepted answer of: http://stackoverflow.com/q/28906145
has comment: http://stackoverflow.com/comment/46072422
upvote count: 4

http://stackoverflow.com/comment/45909203
score: 0
comment on: http://stackoverflow.com/q/28818749
has text: And what does the code for the popup look like, does it remove the markup from the DOM
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28866954
upvote count: 1
type: AnsweredQuestion
score: 1
tagged with: knockout.js
has title: Knockout dynamic foreach binding not working
type: Question
accepted answer: http://stackoverflow.com/a/28867936
downvote count: 0
answer count: 1
tagged with: javascript
has body: I'm new to knockout. I made two divs one visible and one not, I want to show the hidden div when clicking a link on the visible div and then bind an observable array to a unordered list inside the hidden div and show the hidden div with the dynamic values in it. HTML: MES INFOS DEMANDE OFFRES JS: function MenuFunctionVM() { self = this; self.subMenuVisible = ko.observable(false), self.subMenuItems = [], self.showMenuInfos = function () { this.subMenuVisible(!this.subMenuVisible()); alert("clicked"); this.subMenuItems = menuInfos; }, self.showMenuInter = function () { this.subMenuVisible(!this.subMenuVisible()); this.subMenuItems = menuInter; }, self.showMenuOffres = function () { this.subMenuVisible(!this.subMenuVisible()); this.subMenuItems = menuOffres; } }; ko.applyBindings(new MenuFunctionVM()); Please help :)
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28867936

http://stackoverflow.com/a/28766870
answers question: http://stackoverflow.com/q/28763300
downvote count: 0
type: AcceptedAnswer
has body: In the zoom function svg.select(".state") selects only the first group of bars, svg.selectAll(".state") selects all groups. Grouping all states in a "g" element with the new variable allStates var allStates = svg.append("g") .attr("class", "allStates"); and referencing to this new variable var state = allStates.selectAll(".state") .data(data) .enter().append("g") .attr("class", "state") .attr("transform", function(d) { return "translate(" + x0(d.State) + ",0)"; }); and also in zoom function svg.select(".allStates").attr("transform", "translate(" + d3.event.translate[0]+",0)scale(" + d3.event.scale + ",1)"); on doubleclick event it will zoom over all the states
type: Answer
score: 1
accepted answer of: http://stackoverflow.com/q/28763300
upvote count: 1

http://stackoverflow.com/q/28897315
has answer: http://stackoverflow.com/a/28959331
downvote count: 0
has comment: http://stackoverflow.com/comment/46133316
tagged with: requirejs
has comment: http://stackoverflow.com/comment/46133980
type: Question
has comment: http://stackoverflow.com/comment/46132769
has title: Angular controller sporadically not loading
possible better answer: http://stackoverflow.com/a/29022609
tagged with: angularjs-scope
has comment: http://stackoverflow.com/comment/46369363
upvote count: 2
has answer: http://stackoverflow.com/a/29022609
answer count: 2
has comment: http://stackoverflow.com/comment/46164996
has body: I have a website set up with RequireJS and Angular, but at seemingly random moments, it will decide to either not load part of the Javascript or not databind part of the angular code. The page in question has several different components on it with their own angular controllers. Everything loads fine about 90% of the time, but sometimes something will happen that prevents databinding (angular brackets visible, ng-hide not working,...). Additionally, the 'network' tab in Chrome devtools shows no files being loaded, though they are listed in 'sources'. I don't know if that is relevant somehow. I get no errors in the console at all. Digging around in the JS console I've found that one of the broken controllers in question does exist ( = I get an object using angular.element(...).scope() ) but when I try to access one of its properties, they are either undefined OR in case of the init() function I use in all my controllers, it returns the function of the parent controller. What could cause the controller to be loaded but its scope variables to be undefined at seemingly random times? EDIT: The only way I've found to sort of reproduce this issue without errors showing up in the console is to initialise the controller as an empty function. This produces similar scope behavior in the console, but it doesn't cause the angular curly braces to show up. I will accept any clue that leads me to the cause of the issue or a viable workaround.
tagged with: javascript
has comment: http://stackoverflow.com/comment/46133657
has comment: http://stackoverflow.com/comment/46134553
favorite count: 0
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/28959331
score: 2
type: AnsweredQuestion

http://stackoverflow.com/q/28830663
accepted answer: http://stackoverflow.com/a/28852284
has comment: http://stackoverflow.com/comment/45933507
linked to: http://stackoverflow.com/q/16336367
has comment: http://stackoverflow.com/comment/45931335
tagged with: javascript
has comment: http://stackoverflow.com/comment/45933613
linked to: http://stackoverflow.com/q/15349733
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28852284
type: Question
score: 0
has comment: http://stackoverflow.com/comment/45932652
has comment: http://stackoverflow.com/comment/45933046
answer count: 1
has body: I am learning Node.js and having a very hard time in understanding the working of setImmediate() and process.nextTick(). In order to understand the concepts clear, I have three programs, one plain, simple node.js program, one using setImmediate() and one using process.nextTick(). Apparently all three behaving in different way. It would be of great help if anyone explain how these programs differ in operation under the hood and explain the significance of using both timers for effective Node.js programming. Program 1: (without setImmediate() and process.nextTick()) var fs = require('fs'); function logCar(car, callback){ console.log("Saw a %s", car); if(cars.length){ callback(); } } function logCars(cars){ var car = cars.pop(); logCar(car, function(){ logCars(cars); }); } var cars = ["Ferrari", "Porsche", "Bugatti", "Lamborghini", "Aston Martin"]; logCars(cars); var fileCheck = function(){ console.log('entered file operation'); fs.stat("fileio.js", function(err,stats){ if(stats) console.log("file exists"); }); } fileCheck(); Result: Saw a Aston Martin Saw a Lamborghini Saw a Bugatti Saw a Porsche Saw a Ferrari entered file operation file exists Program 1: (with setImmediate()) var fs = require('fs'); function logCar(car, callback){ console.log("Saw a %s", car); if(cars.length){ setImmediate(function(){ callback(); }); } } function logCars(cars){ var car = cars.pop(); logCar(car, function(){ logCars(cars); }); } var cars = ["Ferrari", "Porsche", "Bugatti", "Lamborghini", "Aston Martin"]; logCars(cars); var fileCheck = function(){ console.log('entered file operation'); fs.stat("fileio.js", function(err,stats){ if(stats) console.log("file exists"); }); } fileCheck(); Result: Saw a Aston Martin entered file operation Saw a Lamborghini file exists Saw a Bugatti Saw a Porsche Saw a Ferrari Program 2: (with process.nextTick()) var fs = require('fs'); function logCar(car, callback){ console.log("Saw a %s", car); if(cars.length){ process.nextTick(function(){ callback(); }); } …
tagged with: node.js
has comment: http://stackoverflow.com/comment/127851326
has title: Significance of using setImmediate() and process.nextTick() in Node.js

http://stackoverflow.com/q/28814280
linked to: http://stackoverflow.com/q/10172381
tagged with: javascript
has comment: http://stackoverflow.com/comment/45902879
has title: Using JSDoc with AMD
favorite count: 0
answer count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: jsdoc
tagged with: requirejs
has comment: http://stackoverflow.com/comment/45903797
has comment: http://stackoverflow.com/comment/45904565
has body: I have the following AMD structure for my modules. /* globals define */ define([""], function() { 'use strict'; var module = {}; function _somePrivateFunc() {} function somePublicFunc() {} module.somePublicFunc = somePublicFunc; return module; }); I'm struggling with JSDoc to make it work with my modules. Until now, I could make it work like /* globals define */ /** * Module description here * @module some/module/name */ define([""], function() { 'use strict'; /** * @alias module:some/module/name */ var module = {}; function _somePrivateFunc() {} function somePublicFunc() {} /** * Some property description here * @itWorks */ module.somePublicFunc = somePublicFunc; return module; }); As you can see, it's working. But I want my doc comments to be defined on the function declarations instead where I add them to the module. I want to achieve this: /* globals define */ /** * Module description here * @module some/module/name */ define([""], function() { 'use strict'; /** * @alias module:some/module/name */ var module; /** * Somehow make this appear in JSDoc * @extend module:some/module/name * @private */ function _somePrivateFunc() {} /** * Make this appear in JSDoc for sure. */ function somePublicFunc() {} // I want this to NOT annotate, and I want the property to gather JSDoc // from the func. declaration module = { somePublicFunc: somePublicFunc }; return module; }); The latter one is what I would like to achieve, but sadly it's not working :( Any ideas? Cheers Edit: I made some progress. Mind, that if I write only this: define('dep', function(require) { /** * @exports dep */ var module = {}; /** * Adds two numbers together. * @param {Number} a the first number * @param {Number} b the second number * @return {Number} the sum of a and b */ function sum(a, b) { return a + b; } module.sum = sum; return module; }); then the output is empty. JSDoc can't generate the documentation properly. Although if I add a @method &lt;name&gt; annotation to my function, then it automagi…
tagged with: jsdoc3
score: 1
tagged with: amd
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45903585

http://stackoverflow.com/comment/46005771
type: Comment
has text: I may just have to send a get request to pull the data. I was just trying to populate the variable because I already have a get request method set up and all this needs to do is update the count the first time. After that, the rest of the method will take care of itself. There's got to be a way to get this info in there though. This shouldn't be this difficult
comment on: http://stackoverflow.com/a/28870878
type: AnswerComment
score: 0

http://stackoverflow.com/a/28760357
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28759719
score: -1
has comment: http://stackoverflow.com/comment/45800953
has body: This is the standard method to do this task: Since people keep going along the path of trying to use cross domain for something other than JSONP... IT WILL NOT WORK! The following code below is an example of what will work, as your server is allowed to get content from other network locations being its more controlled.. Your browser on the other hand can only receive JSONP or PLAIN TEXT... Most google results should explain this as well.. YOUR ONLY OPTION Is to use a PROXY of some form to obtain what your trying to access, So you only have three choices here. Use JSONP or Plain Text Use a Proxy or some other method that is local to your server/website/script/page Keep trying to use examples posted here after being told cross domain rules apply. JAVASCRIPT: function loadXMLDoc(sURL) { $.post( "myproxy.php", { requrl: sURL }).done(function( data ) { alert(data); console.log(data); document.write(data); }); } PHP: myproxy.php &lt;?php header('Content-Type: application/xml; charset=utf-8'); $file = file_get_contents($_POST['requrl']); echo $file; ?&gt; Please note that is you plan to use this with other types of content then you will need to change/remove the header line. YOUR BROWSER ALLOWS YOU TO AJAX XML FROM OTHER WEBSITES If this is the case, then you need to replace or update your web browser.. THE ABOVE SOLUTION IS NOT COMPLEX This is virtually copy and paste code ready to go, The JS function will return the result/data/content in the three most know ways... The PHP script is a copy and paste as well.. So if you have PHP installed. All you would need to do is create a new text file in the same location as your html document and name it as "myproxy.php" and this example will work.
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45800984
answers question: http://stackoverflow.com/q/28759719
type: Answer
has comment: http://stackoverflow.com/comment/45801966
downvote count: 2

http://stackoverflow.com/q/28875766
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/46014525
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46014411
favorite count: 0
tagged with: inspect
accepted answer: http://stackoverflow.com/a/28876705
has comment: http://stackoverflow.com/comment/46014243
has title: jQuery - IE9 issues (works once debugger was opened )
has body: I have a one page site, and im using the following code for scrolling between the pages: function gotoPage() { var cur = $(this); var role = cur.attr('role'); var target = $('#' + role); $('html,body').animate({ scrollTop: target.offset().top - 94 }, 1000); } $('.navBt').click(gotoPage); HTML: &lt;div class="navBt" role="topSpacing"&gt; &lt;img src="img/nav_campaign.png" /&gt; &lt;/div&gt; &lt;div class="navBt" role="sectionD"&gt; &lt;img src="img/nav_club.png" /&gt; &lt;/div&gt; It works perfectly on any browser except IE. When i open it on IE9 (not sure about other versions) it wouldnt work, but once i press F12 to open the inspection, it would start working normally from that point, even if i refresh the page or enter the page again without the inspection opened. Any ideas why?
upvote count: 1
type: Question
type: AnsweredQuestion
tagged with: internet-explorer
score: 1
tagged with: internet-explorer-9
has answer: http://stackoverflow.com/a/28876705
linked to: http://stackoverflow.com/q/3127429
has comment: http://stackoverflow.com/comment/46013771

http://stackoverflow.com/comment/45827368
has text: Don't forget the quotes around the keys in the data JSON.
comment on: http://stackoverflow.com/a/28774523
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45973995
comment on: http://stackoverflow.com/a/28853863
type: Comment
has text: @lharby, `.control` is not child of `header` so `$('#header a').not('.control a')` will still refer to `$('#header a')`. what are you trying to acheive?
score: 0
type: AnswerComment

http://stackoverflow.com/q/28751471
type: UnansweredQuestion
downvote count: 2
has answer: http://stackoverflow.com/a/28782251
type: Question
tagged with: google-apps-script
tagged with: google-sheets
upvote count: 0
score: -2
tagged with: javascript
has body: Is there any way of adding a script to a Google spreadsheet to take info from certain fields on a sheet and add them to my Google calendar as an event. E.g. The dates and times and an event title?
has comment: http://stackoverflow.com/comment/45837948
tagged with: google-calendar-api
answer count: 1
has title: Example of script in a Google Sheet to take entries and Create a calender event
favorite count: 0
has comment: http://stackoverflow.com/comment/45792495

http://stackoverflow.com/q/28894322
answer count: 2
tagged with: javascript
tagged with: jquery
score: 0
type: UnansweredQuestion
tagged with: ruby-on-rails
type: Question
has title: Pass values from javascript into rails code
has answer: http://stackoverflow.com/a/28895010
linked to: http://stackoverflow.com/q/14432558
has answer: http://stackoverflow.com/a/28896020
has comment: http://stackoverflow.com/comment/46049490
duplicate of: http://stackoverflow.com/q/14432558
has body: Can I pass values from javascript into rails code ?? Here my example: &lt;script&gt; function upload_fun() { $.ajax({ url : '/upload', datatype : 'json', data :{ file : file, }, success : function(data_get) { console.log(data_get) #example: data_get = "1234" }, }); } &lt;/script&gt; &lt;div&gt; #I wan't to put data_get in javascript to rails code like this: &lt;% @data = Data.find_by_dataname(:dataname =&gt; "data_get")%&gt; &lt;/div&gt; Can I pass value like that?
has comment: http://stackoverflow.com/comment/46048839

http://stackoverflow.com/q/28858853
accepted answer: http://stackoverflow.com/a/28860580
downvote count: 0
tagged with: underscore.js
tagged with: http://stackoverflow.com/tag/json
has body: As you can see in the image below, I have some returned json data with three objects; each contains a clients id => data. exact_match : {104} match_4 : {104, 103} match_2 : {104, 103, 68} How can I "trim" or remove the duplicate objects based on previous ones? something like: exact_match : {104} match_4 : {103} match_2 : {68} I tried _.difference but did not work (Maybe because it is for arrays not objects?): var exact_match = data.exact_match, match_four_digits = _.difference(data.match_4, data.exact_match), match_two_digits = _.difference(data.match_2, data.exact_match, data.match_4), Any help would be appreciated :) Update I need that the returned value has the same object data instead of a new array :)
has comment: http://stackoverflow.com/comment/45991364
type: Question
score: 5
has title: lodash/underscore; compare two objects and remove duplicates
possible better answer: http://stackoverflow.com/a/28859311
has comment: http://stackoverflow.com/comment/45993316
has answer: http://stackoverflow.com/a/28859311
has comment: http://stackoverflow.com/comment/45983610
tagged with: javascript
answer count: 3
tagged with: lodash
favorite count: 0
upvote count: 5
has answer: http://stackoverflow.com/a/28859474
tagged with: object
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28860580

http://stackoverflow.com/q/28865374
downvote count: 0
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/45995811
has title: What 'this' means in javascript?
type: Question
has comment: http://stackoverflow.com/comment/45995764
has comment: http://stackoverflow.com/comment/45996437
has answer: http://stackoverflow.com/a/28865494
has answer: http://stackoverflow.com/a/28865520
has answer: http://stackoverflow.com/a/28865842
answer count: 3
has comment: http://stackoverflow.com/comment/45995806
upvote count: 1
has comment: http://stackoverflow.com/comment/45995900
tagged with: javascript
has body: If I just put a 'this' at the beginning of JavaScript, it's not in any functions. Does 'this' have the same meaning with 'document'? or it means window? Example: $(this).ajaxComplete(handler); In this case, do I attache the handler to the window or the document or something else?
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45997076

http://stackoverflow.com/a/28840758
type: Answer
has body: The simplest way it's clear canvas and redraw grid jsfiddle, but also you must reset slots function clear() { canvas.clearRect(0,0,816,816); canvas.fillRect(250,0,33,816); canvas.fillRect(533,0,33,816); canvas.fillRect(0,250,816,33); canvas.fillRect(0,533,816,33); slots = [false, false, false, false, false, false, false, false, false]; } Update - Addressing the second problem, replace this line - window.addEventListener("click", change, false); with this, using canvas to detect the click: canvas.addEventListener("click", change, false); Otherwise the click on the button will also be detected as a click in the window. Updated fiddle.
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28840503
answers question: http://stackoverflow.com/q/28840503
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/46057015
score: 0
type: AnswerComment
type: Comment
has text: @Fergoso: please see updated code and demo again. I used `find()` to select any child `div` with an ID beggining with `im`.
comment on: http://stackoverflow.com/a/28898523

http://stackoverflow.com/q/28812214
possible better answer: http://stackoverflow.com/a/43132231
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/43132231
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45965320
has comment: http://stackoverflow.com/comment/45915242
has comment: http://stackoverflow.com/comment/45963215
has title: Jssor - Uncaught TypeError: Cannot read property 'currentStyle' of undefined
score: 0
answer count: 2
linked to: http://stackoverflow.com/q/25206272
has body: Jssor is causing a JavaScript error on . It is the same problem for IE 8, and IE 11. What I have tried: Checked https://stackoverflow.com/questions/26465515/script5007-error-in-jssor-slider-in-ie8 Checked https://stackoverflow.com/questions/26632335/jssor-slider-js-error-on-testing-server Checked JSSOR - Cannot read type property 'currentStyle' of undefined Updated to latest version jssor on github. Checked the code for error in the code. Checked on other browsers and it works well. Outcome Couldn't get any working solution. The error message Error line `var jssor_slider1 = new $JssorSlider$("slider1_containerc", options);` Uncaught TypeError: Cannot read property 'currentStyle' of undefined jssor.slider.min.js:2 E jssor.slider.min.js:2 V jssor.slider.min.js:2(anonymous function) jssor.slider.min.js:2 f.$JssorSlider$ jssor.slider.min.js:2 $.ajax.success map.js:584 j jquery-2.1.1.min.js:2 k.fireWith jquery-2.1.1.min.js:2 x jquery-2.1.1.min.js:4(anonymous function) The code; HTML CHLOR_A-2003-APR-MAY-JUN CHLOR_A-2004-APR-MAY-JUN CHLOR_A-2013-APR-MAY-JUN jssor js in jquery ajax function: var _CaptionTransitions = []; var _SlideshowTransitions = [ //{$Duration:1200,x:0.3,$SlideOut:true,$Easing {$Left:$JssorEasing$.$EaseInCubic,$Opacity:$JssorEasing$.$EaseLinear},$Opacity:2} {$Duration:3000,$Opacity:4,$Brother:{$Duration:3000,$Opacity:1}}//Fade ]; var options = { $AutoPlay: true, //[Optional] Whether to auto play, to enable slideshow, this option must be set to true, default value is false $DragOrientation: 1, //[Optional] Orientation to drag slide, 0 no drag, 1 horizental, 2 vertical, 3 either, default value is 1 (Note that the $DragOrientation should be the same as $PlayOrientation when $DisplayPieces is greater than 1, or parking position is not 0) $CaptionSliderOptions: { //[Optional] Options which specifies how to animate caption $PlayInMode: 1, //[Optional] 0 None (no play), 1 Chain (goes after main slide), 3 Chain Flatten (goes after main slide and flatten all cap…
has comment: http://stackoverflow.com/comment/45915218
has comment: http://stackoverflow.com/comment/45964415
has comment: http://stackoverflow.com/comment/45963244
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28849552
tagged with: ajax
has answer: http://stackoverflow.com/a/28849552
tagged with: jssor

http://stackoverflow.com/comment/45901787
score: 0
comment on: http://stackoverflow.com/a/28814833
type: Comment
has text: I know, but that is not how you have coded it. You return the rid and than you try to read the rid again. And when there is only one, you do not return an array so that would be an issue also.
type: AnswerComment

http://stackoverflow.com/comment/50167992
type: Comment
has text: well done for finding that ! I was looking for this file and tried to run without cors...alas is needed.
type: AnswerComment
score: 2
comment on: http://stackoverflow.com/a/29061622

http://stackoverflow.com/comment/46014789
type: Comment
has text: Before your answer i checked and corrected it but still the same
comment on: http://stackoverflow.com/a/28876326
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45800726
comment on: http://stackoverflow.com/q/28760363
has text: Could you show the code of NewsFeed?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28807073
type: Answer
answers question: http://stackoverflow.com/q/28797709
score: 0
has body: http://stats.nba.com/js/data/sportvu/2014/defenseData.json http://stats.nba.com/js/data/sportvu/2014/catchShootData.json http://stats.nba.com/js/data/sportvu/2014/drivesData.json ... and so on. Use Chrome developer tools to the the URL's. Look in the network tab, filtering by XHR makes it easier to spot usually.
accepted answer of: http://stackoverflow.com/q/28797709
type: AcceptedAnswer

http://stackoverflow.com/q/28863291
tagged with: ajax
has answer: http://stackoverflow.com/a/28863383
linked to: http://stackoverflow.com/q/14220321
type: UnansweredQuestion
has body: I have this ajax code: $.ajax({ type: "POST", url: "inc/ajax.php", data: $('#form-responder').serialize(), success: function (data) { console.log(data); // prints: {"sucesso":"true", "mensagem":"Correta: A pulseira de identificação se aplica a todos os pacientes, sem exceção. ", "index_proxima":"2"} //var sucesso = eval(data.sucesso); var mensagem = data.mensagem; alert(mensagem); // shows: undefined } }); I need to get some object values but all of them are returning 'undefined', what is wrong with that? I used to do data.something and always worked before, maybe something with this jQuery version 2.1.3 ?
upvote count: 1
has answer: http://stackoverflow.com/a/28863460
has comment: http://stackoverflow.com/comment/45991836
has title: How to get object from data returned from Ajax call in jQuery?
has comment: http://stackoverflow.com/comment/45992065
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/45942871
has text: With computed properties, this can even be simplified to `var obj = {[Symbol.toStringTag]: "MyClass"};`.
type: Comment
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28830453

http://stackoverflow.com/comment/46007199
type: QuestionComment
comment on: http://stackoverflow.com/q/28871669
score: 0
has text: you're close, make sure the signatures match and that no extra whitespace or quotes are sneaking in.
type: Comment

http://stackoverflow.com/q/28773679
tagged with: javascript
tagged with: mobile-safari
has comment: http://stackoverflow.com/comment/45825951
has comment: http://stackoverflow.com/comment/45825802
downvote count: 0
favorite count: 0
type: UnansweredQuestion
answer count: 0
score: 1
upvote count: 1
has body: Is there a way to give focus to a text box on page load for Safari mobile (Ipad)? If not, would using Chrome for IOS work for this, or is it an IOS feature that prevents this, and not Safari?
type: Question
has title: How to give focus to a text box on page load for Safari mobile?
tagged with: ios

http://stackoverflow.com/q/28904965
score: 1
has title: html jquery toggle between two forms
type: Question
tagged with: javascript
upvote count: 1
answer count: 1
tagged with: jquery
has body: I have two forms on a single html page A login form and a Register form I want to be able to toggle between the forms when i click on the coressponding "span" button The page should load with just the login form showing but both the login and register "span" buttons at the top When i click login i want the login form to "hide" and the register form to be shown and vice versa. here is the code i have so far: Login Form Log in Register Log In Register UserName*: First Name*: Second Name*: Email Address*: Password*: Thanks!
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/46069504
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has answer: http://stackoverflow.com/a/28906931
accepted answer: http://stackoverflow.com/a/28906931
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/comment/45840113
score: 0
type: Comment
type: QuestionComment
has text: As you correctly point out, gv seems to be an instance of a view rather than a constructor/function.
comment on: http://stackoverflow.com/q/28781182

http://stackoverflow.com/comment/46009776
type: QuestionComment
has text: What do you have in @files? File name (e.g. line_icon.jpg)?
score: 0
comment on: http://stackoverflow.com/q/28873555
type: Comment

http://stackoverflow.com/a/28825500
type: Answer
upvote count: 1
has body: Chrome does not allow access to pixel data on canvases that have been "tainted" by local images (security sandbox restriction). EaselJS relies on pixel data to provide accurate mouse interactions. Run your code from a local server (ex. MAMP) to test.
score: 1
accepted answer of: http://stackoverflow.com/q/28822715
answers question: http://stackoverflow.com/q/28822715
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/28754556
answers question: http://stackoverflow.com/q/28753312
has comment: http://stackoverflow.com/comment/45812454
score: 0
type: Answer
has body: I'm sure there will be better answer out there. I just started learning protractor :) You can try clicking on it by index. 3 = position. element.all(by.repeater('column in $parent.columns.standardMetrics').get(3).element(by.css('[ng-model="column.visible"]')).click();

http://stackoverflow.com/comment/45821942
has text: It's interesting that i tried to do this 'var test = /({{(?!{*textdata.*)#\s*.[\w\.]+\.*}})/gm.match(passingString)' and it would not work. Uncaught TypeError: undefined is not a function. But your example works
comment on: http://stackoverflow.com/a/28771694
type: Comment
type: AnswerComment
score: 0

http://stackoverflow.com/a/28879413
has body: In your layout add an EditText as this: &lt;EditText android:id="@+id/editText1" android:layout_width="match_parent" android:layout_height="wrap_content" android:ems="10" &gt; &lt;requestFocus /&gt; &lt;/EditText&gt; In your activity add this in onCreate method: final EditText mEditText = (EditText) findViewById(R.id.editText1); mEditText.setImeActionLabel("Done", KeyEvent.KEYCODE_ENTER); EditText.OnEditorActionListener exampleListener = new EditText.OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { Log.d(TAG, "onEditorAction, key="+event.getKeyCode() + " action="+event.getAction()); if (event.getAction() == KeyEvent.KEYCODE_ENTER) { openPDF(mEditText.toString()); } return true; } }; To open a PDF, install a PDF app from market and in your activity open PDF as this: private void openPDF(String fileName){ File file = new File("/sdcard/pdf/"+fileName+".pdf"); if (file.exists()) { Uri path = Uri.fromFile(file); Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(path, "application/pdf"); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); try { startActivity(intent); } catch (ActivityNotFoundException e) { Toast.makeText(this, "No reader", Toast.LENGTH_SHORT).show(); } } }
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46173585
has comment: http://stackoverflow.com/comment/46420055
accepted answer of: http://stackoverflow.com/q/28874605
score: 0
has comment: http://stackoverflow.com/comment/46172601
has comment: http://stackoverflow.com/comment/46022592
answers question: http://stackoverflow.com/q/28874605
has comment: http://stackoverflow.com/comment/46171453
type: Answer
has comment: http://stackoverflow.com/comment/47132529
has comment: http://stackoverflow.com/comment/46281926
has comment: http://stackoverflow.com/comment/46023921
has comment: http://stackoverflow.com/comment/46420495
has comment: http://stackoverflow.com/comment/46022219
has comment: http://stackoverflow.com/comment/46271510
has comment: http://stackoverflow.com/comment/46420350
has comment: http://stackoverflow.com/comment/46170746
has comment: http://stackoverflow.com/comment/46747450
has comment: http://stackoverflow.com/comment/46173703
has comment: http://stackoverflow.com/comment/46267564
has comment: http://stackoverflow.com/comment/46297707
has comment: http://stackoverflow.com/comment/46023696
has comment: http://stackoverflow.com/comment/46269943

http://stackoverflow.com/comment/45860220
type: AnswerComment
comment on: http://stackoverflow.com/a/28792150
type: Comment
score: 1
has text: In which browsers does the `lang` attribute affect the behavior of `toLowerCase`? What is the source of this information?

http://stackoverflow.com/q/28891235
downvote count: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/46043872
favorite count: 0
tagged with: download
upvote count: 6
has answer: http://stackoverflow.com/a/62930087
tagged with: http://stackoverflow.com/tag/zip
has answer: http://stackoverflow.com/a/28892894
type: UnansweredQuestion
score: 6
linked to: http://stackoverflow.com/q/17657184
linked to: http://stackoverflow.com/q/14180375
has body: Is it possible to download multiple files from an url into one created folder or as a zip? I currently download a file given a url like so: var download_url = &quot;&quot;; window.location.href = download_url; If I were to have an array of urls, I could do something like... for each url in urls window.location.href = url; This works, but will lead to individual downloaded files in the downloads folder. This can be messy. Is it possible to create and specify which folder to download all of the files or convert all the downloaded files into a zip?
tagged with: javascript
has comment: http://stackoverflow.com/comment/46043540
has title: Download multiple files as a zip or in a folder using Javascript?
type: Question
answer count: 2

http://stackoverflow.com/comment/46010887
has text: ClipTo() can be use for cropping. But if I need to modify the image shape? check this http://stackoverflow.com/questions/18428355/how-to-bend-curve-a-image-in-html5-canvas
type: Comment
comment on: http://stackoverflow.com/a/28873258
score: 0
type: AnswerComment

http://stackoverflow.com/a/28828936
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28826974
has body: After rewrite my login function as @ayanami suggested the code works smoothly and it looks like this: login.js var login = function(form, cb){ $.getJSON("loginURL", {"user":user, "pass":pass}, function(response){ if(response.status === "success"){ //do something } else{ //do something else } cb(response.status); }); }; test.js (qunit) test( "Testing login", function( assert ) { var done = assert.async(); var cb = function(param){ assert.equal(param,"success", "Expect getJSON/login to success"); done(); }; login(user, pass,cb); });

http://stackoverflow.com/a/28860101
score: 1
type: AcceptedAnswer
downvote count: 0
has body: Unlike html where tooltips are attributes, in SVG tooltips are child elements i.e. you need to construct something like tooltip via .append("svg:title")
type: Answer
answers question: http://stackoverflow.com/q/28859545
accepted answer of: http://stackoverflow.com/q/28859545
has comment: http://stackoverflow.com/comment/46012251
upvote count: 1
has comment: http://stackoverflow.com/comment/46012149

http://stackoverflow.com/comment/45823389
has text: yes, but the console returns that the newAryElement is undefined
comment on: http://stackoverflow.com/a/28772312
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45839461
type: Comment
type: QuestionComment
has text: yes it is absolute. When I take off the if statement the ball moves when I click the dice. So I think the problem must be ball.style.left === '0px'
comment on: http://stackoverflow.com/q/28781290
score: 0

http://stackoverflow.com/q/28801272
favorite count: 0
has comment: http://stackoverflow.com/comment/45876372
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45876367
has title: Select child element
linked to: http://stackoverflow.com/q/197748
downvote count: 2
has answer: http://stackoverflow.com/a/28801367
upvote count: 1
has comment: http://stackoverflow.com/comment/45876351
has body: I'm not sure if this is the correct term (child element) but I have CSS I need to change with JavaScript. How do I make this text area field visible? #desc { display = 'none'; } #desc textarea { display: none; background-color: red; } &lt;div id='desc'&gt; &lt;textarea&gt; &lt;/textarea&gt; &lt;/div&gt; var x = document.getElementById('desc').style.display = 'block'; var t = document.getElementById('textarea').style.display = 'block';
type: Question
score: -1
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45876301

http://stackoverflow.com/q/28787334
favorite count: 0
has answer: http://stackoverflow.com/a/28787558
has comment: http://stackoverflow.com/comment/45850637
has comment: http://stackoverflow.com/comment/45850751
possible better answer: http://stackoverflow.com/a/28787513
has comment: http://stackoverflow.com/comment/45850690
has comment: http://stackoverflow.com/comment/45850939
has title: Single Line Javascript method to find item with specific text then invoke a click
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question
has comment: http://stackoverflow.com/comment/45850566
has answer: http://stackoverflow.com/a/28787513
has comment: http://stackoverflow.com/comment/45850714
tagged with: javascript
has comment: http://stackoverflow.com/comment/45850665
answer count: 3
has answer: http://stackoverflow.com/a/28787527
upvote count: 1
linked to: http://stackoverflow.com/q/24266313
accepted answer: http://stackoverflow.com/a/28787527
has comment: http://stackoverflow.com/comment/45850555
has comment: http://stackoverflow.com/comment/45850577
has body: I'm wanting to be able to click on an input that has no ID thats inside a LABEL that has no ID either. Here is sample HTML... &lt;label&gt; &lt;input type="radio" /&gt; item1 &lt;/label&gt; &lt;label&gt; &lt;input type="radio" /&gt; item2 &lt;/label&gt; &lt;label&gt; &lt;input type="radio" /&gt; item3 &lt;/label&gt; now using ONLY Javascript. How could I go about just invoking a click on the item2 in this example? I know that I could probably do a FOR loop through all the document.getElementsByTag("label") then check the text of each one and then probably invoke a click after I've found the specific label... BUT i was wondering if it was posssible to do this in a very simplified method instead like using document.querySelectorAll("label") or something to this effect? like is there noting that would allow me to do like a uh... document.querySelectorAll("label[text='item2']").click() Nothing like this or anything possible? Would need to do this on a page that already exists, so creating a Javascript Method to call/reference wouldn't work in this instance EDIT #1 - based off people stating its impossible for single selectors If its not possible to do it using a querySelectorAll and you would have to use a For-Loop/While then how would you do this in a single line? I know sometimes you can do stuff like... javascript:(function() { document.getElementById('LABELID').value+='SETVALUE'; document.querySelectorAll("Button[type='submit']")[0].click();})() Is it possible to do this search and click in a single line also?

http://stackoverflow.com/a/28753205
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28753093
type: Answer
has comment: http://stackoverflow.com/comment/45788873
has body: http://backbonejs.org/#Router During page load, after your application has finished creating all of its routers, be sure to call Backbone.history.start(), or Backbone.history.start({pushState: true}) to route the initial URL.
has comment: http://stackoverflow.com/comment/45788301
accepted answer of: http://stackoverflow.com/q/28753093

http://stackoverflow.com/q/28861282
tagged with: css-selectors
has comment: http://stackoverflow.com/comment/45988114
has title: Issue with querySelector 'tbody > tr[data-index=-1]'
has body: I have the following query selector. Using Chrome 38 I get a "SYNERR: Is not a valid selector" .. Now the interesting thing is that in CSS it works fine. tbody &gt; tr[data-index=-1] Any ideas why JavaScript doesn't like that path?
has answer: http://stackoverflow.com/a/28861324
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28861324
tagged with: dom
type: Question
has comment: http://stackoverflow.com/comment/45988046
answer count: 1
tagged with: javascript
score: 0

http://stackoverflow.com/comment/45803336
has text: ('#select_button').click(function(){ var gs= $('#number_selection').val(); $('#feedback').append(gs + ' ' + ' ' + ' '); }); $('#gs_remove').click(function(){ (this).hide(); }); but with this i am not able to remove each selected option.
comment on: http://stackoverflow.com/a/28760787
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45807908
type: Comment
type: QuestionComment
has text: Sorry guys there is already " just I did not take it while copiying line.
comment on: http://stackoverflow.com/q/28764164
score: 0

http://stackoverflow.com/comment/45866205
score: 0
type: AnswerComment
has text: perfect thank you. also I didnt know about the difference between for and forEach. what do you mean by 'scope the info and passLoc'
type: Comment
comment on: http://stackoverflow.com/a/28795309

http://stackoverflow.com/comment/45856732
type: Comment
type: QuestionComment
has text: Why you do not want to use `r.js`?
comment on: http://stackoverflow.com/q/28790732
score: 0

http://stackoverflow.com/a/28890446
has body: To create a canvas with Jquery try: var canvas = document.createElement('canvas'); var context = canvas.getContext('2d'); $('body').append($(canvas)); canvas.width = 1000; canvas.height = 1000; You can replace 'body' with whatever you'd like. To draw your images do this: var image1 = new Image(); var image2 = new Image(); image1.src = "/src/image1.png" image2.src = "/src/image1.png" context.drawImage(image1, 0, 0, 500, 500) context.drawImage(image2, 500, 0, 500, 500) context.drawImage(image1, 0, 500, 500, 500) context.drawImage(image2, 500, 500, 500, 500) Good luck
upvote count: 3
type: Answer
score: 3
downvote count: 0
answers question: http://stackoverflow.com/q/28886278

http://stackoverflow.com/comment/45922520
has text: stating a variable on a newline like `varname; ` does not reinitialize it in any language that I know
comment on: http://stackoverflow.com/q/28825903
score: 3
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28882335
has title: Image loaded by $.get() doesn't show
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
tagged with: image
has body: I have an image in a div in one html doucment, whic is loaded by another document using this code: $.get("injections.html", function(data) { if ($('#header').length) { $("#header").replaceWith(data.getElementById("header")) } }); It loads text just fine but when it loads images, they show up in the page inspection but not the page itself. Does anyone know why?
has comment: http://stackoverflow.com/comment/46041218
has comment: http://stackoverflow.com/comment/46025917
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46026376
type: Question
has comment: http://stackoverflow.com/comment/46026428
has answer: http://stackoverflow.com/a/28882491
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/46026029

http://stackoverflow.com/q/28764814
has body: I have typescript function that takes function GetOne&lt;T&gt;(predicate: (e: T) =&gt; boolean): T; var user = GetOne&lt;IUser&gt;(a =&gt; a.Id === this.id); predicate toString() returns "function (a) { return a.Id === _this.id; }" how can i get value from "_this.id" ? I would like to make a breezejs Predicate from that function informations... Thanks
has answer: http://stackoverflow.com/a/28816451
has answer: http://stackoverflow.com/a/28789905
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/45809474
favorite count: 0
type: Question
answer count: 2
upvote count: 1
tagged with: typescript
has title: Get value from function body parameter

http://stackoverflow.com/comment/45942427
type: Comment
has text: Yes, I was thinking in PHP! Sorry!
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28835561

http://stackoverflow.com/q/28840991
has comment: http://stackoverflow.com/comment/45951173
type: AnsweredQuestion
type: Question
has title: Jquery click runs only once on web page - Web Forms C#
has comment: http://stackoverflow.com/comment/45977578
tagged with: c#
linked to: http://stackoverflow.com/q/6137172
tagged with: javascript
has body: On my login page I want to display a simple table row that says loading. I put a simple script tag with a jquery function in the aspx page to show the table row when the login button is clicked. Everything works fine the first time the user clicks the login button. The login button and table row to display are inside an UpdatePanel container. When the user clicks login again , with good or bad credentials, the table row does not display. Here is my code on the page: <%@ Page Language="c#" AutoEventWireup="false" StylesheetTheme="Theme1" Codebehind="Default.aspx.cs" Inherits="....Default" %> <%@ MasterType VirtualPath="~/..." %> <asp:scriptmanager ID="Scriptmanager1" runat="server"></asp:scriptmanager> <asp:Panel ID="Panel1" runat="server" Width="371px" BackColor="white" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px"> <asp:UpdatePanel ID="upLogin" runat="server" RenderMode="block" UpdateMode="always"> <%= this.VersionName %> Please Log In: Username: <asp:TextBox Width="150" ID="txtUserName" runat="server" AutoCompleteType="Disabled" /> Password: <asp:TextBox Width="150" TextMode="password" ID="txtPassword" runat="server" AutoCompleteType="Disabled" /> I forgot my password <asp:Button Text="Log In" CssClass="actionButton" ID="btnLogin" runat="server" onclick="BtnLoginClick1" /> Invalid login. Please try again. Loading... </asp:UpdatePanel> </asp:Panel> Is it possible to get a jquery click event handler to work on the login button?
has answer: http://stackoverflow.com/a/28856086
accepted answer: http://stackoverflow.com/a/28856086
has comment: http://stackoverflow.com/comment/45951599
score: 0
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/45951201
tagged with: asp.net
has comment: http://stackoverflow.com/comment/45974410

http://stackoverflow.com/q/28848459
has comment: http://stackoverflow.com/comment/45965207
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28850237
has body: This is driving me nuts now. I've searched everywhere but none of the solution seems to work. The autocomplete works fine with all the label value loaded correctly to the autocomplet dropdown. I can select any label value with mouse and the same value goes to the textbox. But when I used keyup or keydown to select the label, the textbox gets the value instead of label. For example, with this data, [{"label":"Tom Smith","value":"1234"},{"label":"Tommy Smith","value":"12321"}] on keydown if I select "Tom Smith", the textbox will get value "1234". My autocomplete code looks like below: $('.autocompleteEval').autocomplete({ source: '@Url.Action("autocompleteEvalList")', minLength: 2, select: function (event, ui) { debugger; event.preventDefault(); $(this).val(ui.item.label); if (ui.item.value == "-1") { $('.autocompleteEval').val(''); $('#EvaluatorAjax').hide(); } else { $('.autocompleteEval').val(ui.item.label); $('#EvaluatorAjax').hide(); } event.preventDefault(); return false; } , change: function (event, ui) { if (!ui.item) { $('.autocompleteEval').val(''); } else { $('.autocompleteEval').val(ui.item.label); $(this).attr('actionId', ui.item.values); $('#EvaluatorAjax').hide(); } } , search: function (event, ui) { $('#EvaluatorAjax').css('visibility', ''); } , response: function (event, ui) { $('#EvaluatorAjax').css('visibility', 'hidden'); } }).focus(function (event, ui) { event.preventDefault(); $('.autocompleteEval').val(ui.item.label); return false; }); Any help/suggestion(maybe wire the keypress event to autocomplete, not sure) on this is very much appreciated Thanks
score: 1
has title: when doing keyup or keydown, textbox gets value instead of label for jQuery autocomplete
upvote count: 1
type: Question
tagged with: autocomplete
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45967356
answer count: 1
downvote count: 0
favorite count: 0

http://stackoverflow.com/a/28771700
type: Answer
upvote count: 3
accepted answer of: http://stackoverflow.com/q/28771654
score: 3
answers question: http://stackoverflow.com/q/28771654
has body: exec .vs match: exec will only generate one result at a time, requiring successive exec() calls until it generates null. Match, on the other hand, finds all matches at the same time. If you run this, you get four results: var passingString = '{{#something}} I HONESTLY CANNOT BELIEVE THIS SHIT {{#something}} I HONESTLY CANNOT BELIEVE THIS SHIT {{#something}}{{#something}} \n asdasdas {{/something}}'; passingString.match(/({{(?!{*textdata.*)#\s*.[\w\.]+\.*}})/gm) result: Array [ "{{#something}}", "{{#something}}", "{{#something}}", "{{#something}}" ] If you still want exec you need to run it as a while loop, terminating when it no longer generates anything: var arr; while (arr = regex.exec(passingString)) { console.log(arr); } this will find four entries and then break out of the loop.
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/138646886
comment on: http://stackoverflow.com/a/78640271
type: AnswerComment
has text: gh linK: https://github.com/GrinZero/node-network-devtools
score: 0
type: Comment

http://stackoverflow.com/q/28872104
tagged with: javascript
upvote count: 1
answer count: 1
has body: I have been trying to solve this for a few days now. Basically I have a like/share button on my site generated using the facebook developer tool. So it is very standard. But I can't get it to like/share the current URL. &lt;div class="fb-like col-xs-offset-1" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"&gt;&lt;/div&gt; What I have tried: 1) Using data-href =" &lt;%= Request.Url.AbsoluteUri %&gt; " 2) Setting data-href using javascript using window.location 3) Leaving data-href empty. Now this is said to work, but it does not for me. However I suspect this is because I am running on localhost, could that be why? When I try these methods it gives me this link before I get to the actual share-window: https://www.facebook.com/v2.2/plugins/like.php?action=like&amp;app_id=78205603350&amp;channel=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter%2FrFG58m7xAig.js%3Fversion%3D41%23cb%3Df2283ae550ed898%26domain%3Dlocalhost%26origin%3Dhttp%253A%252F%252Flocalhost%253A59928%252Ff3ee4865310c9fa%26relation%3Dparent.parent&amp;container_width=1237&amp;href=http%3A%2F%2Flocalhost%3A59928%2FDefault&amp;layout=standard&amp;locale=en_US&amp;sdk=joey&amp;share=true&amp;show_faces=true And then when I press next and come to the actual sharing-window it tries to share "www.facebook.com"
tagged with: asp.net
favorite count: 0
tagged with: facebook
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question
has title: Facebook like/share current URL
tagged with: c#
has answer: http://stackoverflow.com/a/28872275
accepted answer: http://stackoverflow.com/a/28872275

http://stackoverflow.com/q/28890275
upvote count: 17
favorite count: 0
type: UnansweredQuestion
score: 16
has comment: http://stackoverflow.com/comment/46041630
tagged with: ruby-on-rails
has answer: http://stackoverflow.com/a/65386007
tagged with: video
tagged with: audio
tagged with: http
type: Question
has answer: http://stackoverflow.com/a/28890773
has comment: http://stackoverflow.com/comment/115599569
tagged with: javascript
has title: How to combine video and audio through API or JS?
answer count: 3
has body: I am working to design a system which does the following: User uploads a video, JS code finds the length of the video. Performs HTTP calls to an already-existing service to retrieve an audio track of the same length. Synchronize and combine the audio and video (which are the exact same length). The best thing I could think to do is to play them both at the same time (entirely doable with HTML5), but I want to be able to have a user download a combined file, or be able to say... upload it to YouTube through their API. I have been doing lots of googling, and so far have not found any services or code which might be able to do this. I am familiar with JavaScript, Ruby on Rails, HTML, CSS, jQuery, and both AngularJS and Backbone.js. If a solution exists in one of those languages, or perhaps something I can access through HTTP, that would be wonderful.
downvote count: 1
has answer: http://stackoverflow.com/a/65373659

http://stackoverflow.com/q/28833095
score: 0
has comment: http://stackoverflow.com/comment/45935805
tagged with: selectionchanged
type: Question
has comment: http://stackoverflow.com/comment/45935788
has comment: http://stackoverflow.com/comment/45936110
accepted answer: http://stackoverflow.com/a/28833283
has comment: http://stackoverflow.com/comment/45936356
tagged with: javascript
has answer: http://stackoverflow.com/a/28833215
answer count: 3
tagged with: onchange
has title: onChange not working to show/hide a div
has comment: http://stackoverflow.com/comment/45935759
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28833399
has answer: http://stackoverflow.com/a/28833399
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28833283
has body: I have a piece of code with HTML & JavaScript. HTML code is Cash Credit BULB and JavaScript code is function insProviderTable() { if ($('#paytype').val() == 'Credit') { $('#insuranceDetails').show(1000); } else { $('#insuranceDetails').hide(1000); } }; $(insProviderTable); The issue is on page load the div insuranceDetails is appearing but if I change the value of paytype to Cash, nothing happens. Please let me know where I am mistaken. jsfiddle link https://jsfiddle.net/5bjfxdq4/
type: AnsweredQuestion

sdp
tag name: sdp
tags question: http://stackoverflow.com/q/28801507
type: Tag

http://stackoverflow.com/q/28890524
has answer: http://stackoverflow.com/a/28890622
has body: I have tried all the solutions from other threads but nothing seems to work for me. I am trying to show the table with descending Weight Score (which is the last column of my table). Here is the table for reference: Slno Mutual Fund Scheme AUM Last Year % Two Years % Three Years % 5 Years % Weight Score 1 UTI MNC Fund (G) 519 88 47 32 25 155.3 ...... You can check the table here. Please tell me how do I sort it as per Weight score column.
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28890622
type: Question
tagged with: javascript
tagged with: jquery
score: 0
has title: Table sorting as per last column Jquery
answer count: 1

http://stackoverflow.com/a/28859291
has body: Your browser is looking for the favicon.ico, then it sends a request for the actual content. Try to console.log both the request and response to get more information.
accepted answer of: http://stackoverflow.com/q/28859070
answers question: http://stackoverflow.com/q/28859070
score: 2
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer

http://stackoverflow.com/comment/46011358
comment on: http://stackoverflow.com/a/28873681
score: 0
type: AnswerComment
type: Comment
has text: Moksh Shah Plz see my answer below. Your solution is great but I can't make it work on my aspx page... Am I missing something?

http://stackoverflow.com/q/28820752
type: AnsweredQuestion
has title: Javascript issue: Array of integers recieved as a string at the Web API controller
accepted answer: http://stackoverflow.com/a/28820806
has comment: http://stackoverflow.com/comment/45913410
type: Question
tagged with: asp.net-web-api2
tagged with: asp.net-mvc
has answer: http://stackoverflow.com/a/28820815
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/28820815
has answer: http://stackoverflow.com/a/28820806
tagged with: asp.net-web-api
has body: Why i am getting a string in my web api controller when I am setting the the property as $("#ProfessionsCheckBoxes input:checked").each(function() { professionsChecked.push($(this).attr("Id")); }); $("#SelectedProfessions").val(professionsChecked); SelectedProfessions is a list of string in my view model. It is really frustrating Like if I check two check boxes, I get in my controller "2,3" at the 0 index of the list i.e: [0] = "2,3". Not not a list like: [0] ="2" and [1] = "3" Note1: This is how I am generating my checkboxes: &lt;div id="ProfessionsCheckBoxes" class="some item"&gt; &lt;div class="form-group thirds"&gt; @if (Model.Professions != null) { foreach (var item in Model.Professions) { &lt;div class="one-third"&gt; @Html.Label(item.Name) @Html.CheckBox(item.Name, item.IsChecked, new {id = item.Id}) &lt;/div&gt; } } &lt;/div&gt; &lt;/div&gt; Note2: I am submit the form through an ajax call with form.serialize() method.

http://stackoverflow.com/comment/46012278
type: Comment
has text: Do we have many refresh token for a single user. I thought a user could have many access token and a single refresh token. Correct me If I'm wrong
type: AnswerComment
comment on: http://stackoverflow.com/a/28760618
score: 0

http://stackoverflow.com/comment/45844609
has text: No problem, rememer MDN has a good source of javascript stuff you can look at too :)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28784138
type: Comment

http://stackoverflow.com/a/28893468
accepted answer of: http://stackoverflow.com/q/28893440
answers question: http://stackoverflow.com/q/28893440
upvote count: 4
type: AcceptedAnswer
downvote count: 0
score: 4
type: Answer
has comment: http://stackoverflow.com/comment/46047276
has body: Something like this ? str.substring(str.indexOf("XX3")+4, str.length) This is how you want to use substring str.substring(indexA[, indexB]) indexA An integer between 0 and the length of the string, specifying the offset into the string of the first character to include in the returned substring. indexB Optional. An integer between 0 and the length of the string, which specifies the offset into the string of the first character not to include in the returned substring. Source: mdn UPDATE You are looking for a regex based on the comment var str = "Jack_XX3_24930YYYG"; var reg = /XX3_(\+?\d+)/g; var match = reg.exec(str); alert(match[1]);

http://stackoverflow.com/comment/45791887
comment on: http://stackoverflow.com/q/28755070
score: 0
type: Comment
type: QuestionComment
has text: I'm not sure how to do this... but you should look up how to edit DOMs in internal iframes. It looks like it's several layers deep of iframes.

http://stackoverflow.com/q/28813667
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: asp.net
has body: I have to retrieve hier2 object in jquery from following HTML code in ASPX page &lt;div&gt; &lt;hier2:hierarchy &gt; &lt;hier:x1&gt;&lt;/hier:x1&gt; &lt;hier2:hierarchy &gt; &lt;/div&gt; I trier document.all.hier2 in IE 11 and its not working what is the best approach to do this.
has comment: http://stackoverflow.com/comment/45899246
has answer: http://stackoverflow.com/a/28813887
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28813887
has comment: http://stackoverflow.com/comment/45900414
type: Question
has title: how to get XML object from HTML document in JQUERY
answer count: 1

http://stackoverflow.com/a/28848393
has comment: http://stackoverflow.com/comment/45969101
accepted answer of: http://stackoverflow.com/q/28847752
type: Answer
has comment: http://stackoverflow.com/comment/45968711
upvote count: 4
answers question: http://stackoverflow.com/q/28847752
has comment: http://stackoverflow.com/comment/45967784
has body: For ng-repeat scope creation works differently. For each loop, ng-repeat creates a new scope, which inherits from parent but there's a catch here If the property is primitive as count in your case it justs create a copy in the child scope. The code of ng-repeat is as follows childScope = scope.$new(); childScope[valueIdent] = value; count ($scope) copied to countCopy($childScope) So the increment on your count property is done on a local copy of count inside your first loop. So all your increments are not reflected in the main count in your scope. Workaround would be to make count as property inside an object. If you change it to an object property then a copy of object would be made which would still have reference to the same main count property. countObj ($scope) copied to countObjCopy($childScope) both countObj and countObjCopy refer to same property count //while initializing //while incrementing {{countObj.count= index1+1}} On further drilling down it seems there's more problem than caused due to child scope creation. I have commented on issue and its more related to angular infinite digest error caused by updated scope variables inside view rendering. Refer here for more https://docs.angularjs.org/error/$rootScope/infdig So the best approach would be to update count obj outside view content One of the workaround is to use as follows is to update countobj's count in init of the first loop itself and use index to display {{index1+1}} // here I assing index1 to parent scope count {{data}}{{index1+1}} // here count has the correct value {{result.data2[$index]}} {{index2+countObj.count+1}} // here I add count to index2 {{result.data3[$index]}}{{countObj.count}} // here count has no value {{result.data4[$index]}}
downvote count: 0
has comment: http://stackoverflow.com/comment/45964848
score: 4
has comment: http://stackoverflow.com/comment/45968283
has comment: http://stackoverflow.com/comment/45965980
type: AcceptedAnswer

http://stackoverflow.com/q/28863287
has comment: http://stackoverflow.com/comment/45991814
has answer: http://stackoverflow.com/a/28863764
tagged with: javascript
has title: referencing object inside another object javascript
score: 0
has comment: http://stackoverflow.com/comment/45991915
answer count: 1
has body: So I have two different set of objects: var house = {}; house["01"] = {hID: "01", neighbh: "00001", name: "house 1"}; house["02"] = {hID: "02", neighbh: "00001", name: "house 2"}; house["03"] = {hID: "03", neighbh: "00002", name: "house 3"}; house["04"] = {hID: "04", neighbh: "00003", name: "house 4"}; var neighborhood = {}; neighborhood["00001"] = {id: "00001", name: "first neighborhood", houses: {} }; neighborhood["00002"] = {id: "00002", name: "second neighborhood", houses: {} }; neighborhood["00003"] = {id: "00003", name: "third neighborhood", houses: {} }; I want to be able to reference the house objects inside houses {} within neighborhood. But filter them to their respective neighborhood. i.e. house["01"] should go in the neighborhood["00001"] (those that have the neighborhood id matching house neighbh). This is so that I can have all the houses in one different object, but still be able to make changes to them through the neighborhood object. Hopefully I have managed to make myself clear. Any help will be appreciated. Thanks
tagged with: reference
accepted answer: http://stackoverflow.com/a/28863764
tagged with: pass-by-reference
type: AnsweredQuestion
tagged with: object
type: Question

http://stackoverflow.com/a/28906741
upvote count: 1
has comment: http://stackoverflow.com/comment/46073567
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28906535
has body: Are you looking for something like this ? //channels is your array that you have put var obj = []; channels.forEach(function(channel) { // it takes publishedTracks of the channel and pushes into a separate array. obj.push(channel.publishedTracks); //remove from channel object delete channel.publishedTracks; }); console.log(obj);
downvote count: 0
answers question: http://stackoverflow.com/q/28906535
score: 1

http://stackoverflow.com/a/28917243
has body: Ok now it works - problem was with that doubleclick - cause it's default event for zooming in, it still should work but it doesn't, so i changed 'dbclick' to 'click' and it works
answers question: http://stackoverflow.com/q/28904237
type: Answer
score: 0

angularjs-directive
tags question: http://stackoverflow.com/q/28834811
tags question: http://stackoverflow.com/q/28768085
tags question: http://stackoverflow.com/q/28788490
tags question: http://stackoverflow.com/q/28866556
tags question: http://stackoverflow.com/q/28769900
tag name: angularjs-directive
tags question: http://stackoverflow.com/q/28833387
tags question: http://stackoverflow.com/q/28886990
tags question: http://stackoverflow.com/q/28753501
tags question: http://stackoverflow.com/q/28805223
tags question: http://stackoverflow.com/q/28758252
tags question: http://stackoverflow.com/q/28843522
tags question: http://stackoverflow.com/q/28846044
tags question: http://stackoverflow.com/q/28826753
tags question: http://stackoverflow.com/q/28808502
tags question: http://stackoverflow.com/q/28884245
tags question: http://stackoverflow.com/q/28762645
tags question: http://stackoverflow.com/q/28768814
tags question: http://stackoverflow.com/q/28859771
tags question: http://stackoverflow.com/q/28902752
tags question: http://stackoverflow.com/q/28751398
tags question: http://stackoverflow.com/q/28773900
tags question: http://stackoverflow.com/q/28782099
tags question: http://stackoverflow.com/q/28818335
tags question: http://stackoverflow.com/q/28833027
tags question: http://stackoverflow.com/q/28805854
tags question: http://stackoverflow.com/q/28833043
tags question: http://stackoverflow.com/q/28815913
tags question: http://stackoverflow.com/q/28793025
tags question: http://stackoverflow.com/q/28877887
tags question: http://stackoverflow.com/q/28817312
tags question: http://stackoverflow.com/q/28787241
tags question: http://stackoverflow.com/q/28825748
type: Tag
tags question: http://stackoverflow.com/q/28782043
tags question: http://stackoverflow.com/q/28797370
tags question: http://stackoverflow.com/q/28786244
tags question: http://stackoverflow.com/q/28830489
tags question: http://stackoverflow.com/q/28851893
tags question: http://stackoverflow.com/q/28903047
tags question: http://stackoverflow.com/q/28896884
tags question: http://stackoverflow.com/q/28861991
tags question: http://stackoverflow.com/q/28824243
tags question: http://stackoverflow.com/q/28769354
tags question: http://stackoverflow.com/q/28764564
tags question: http://stackoverflow.com/q/28830840
tags question: http://stackoverflow.com/q/28858090
tags question: http://stackoverflow.com/q/28857086
tags question: http://stackoverflow.com/q/28816256
tags question: http://stackoverflow.com/q/28766504
tags question: http://stackoverflow.com/q/28872595
tags question: http://stackoverflow.com/q/28866471
tags question: http://stackoverflow.com/q/28888269

http://stackoverflow.com/a/28904250
type: Answer
upvote count: 12
score: 11
answers question: http://stackoverflow.com/q/28904140
has body: Shouldn't it be like Arguably, it should be: this.askTeller = function(pass) { if (pass == 1234) return bankBalance; return "Wrong password."; }; or this.askTeller = function(pass) { return pass == 1234 ? bankBalance : "Wrong password."; }; E.g., there's no point to the else at all. But getting to your point about {}: They're optional. Control-flow structures like if (and while, and for, etc.) are connected to the one statement that follows them; if you want to have them connected to more than one statement, you use the block statement ({...}) to do that. Many, many, many people always use the block statement even when they could get away with not using it, both for clarity and to make it easier to add a second thing into the block.
downvote count: 1

http://stackoverflow.com/a/28839351
has comment: http://stackoverflow.com/comment/45948346
has comment: http://stackoverflow.com/comment/45948392
downvote count: 0
has comment: http://stackoverflow.com/comment/45948301
has comment: http://stackoverflow.com/comment/45948982
type: Answer
answers question: http://stackoverflow.com/q/28839216
has comment: http://stackoverflow.com/comment/45948404
has comment: http://stackoverflow.com/comment/45948819
has comment: http://stackoverflow.com/comment/45948909
has comment: http://stackoverflow.com/comment/45948240
upvote count: 1
has body: Why not just add an extra class to the ones you want to use. Classes don't necessarily need to be reflective of css styling and can be used for scripting purposes also &lt;div class="thumbnail myHoverClass"&gt; JS $('.thumbnail.myHoverClass').hover(... /* or just */ $('.myHoverClass').hover(... If that's not practical can do $('.thumbnail').not('.jumbotron .thumbnail').hover(...
score: 1
has comment: http://stackoverflow.com/comment/45948354

http://stackoverflow.com/q/28812984
tagged with: c#
has title: JSON parse not working with xml string
has body: I have the following line of code at the C#: @{ var data = @Html.Raw(Json.Encode(y)); } And the javascript with error. var x = JSON.parse('@data'); Data is like [...]"Value":"\u003croot ex=\"something\"\u003e\u003c/root\u003e" [...]. The original value is a xml string: &lt;root ex="something"&gt;&lt;/root&gt; My problem is that when I use a xml string at the JSON.parse I got an invalid error: "0x800a03f6 - JavaScript runtime error: Invalid character" Where is the problem?
has comment: http://stackoverflow.com/comment/45897877
tagged with: javascript
has comment: http://stackoverflow.com/comment/45897922
score: 0
has comment: http://stackoverflow.com/comment/45897742
tagged with: jquery
has comment: http://stackoverflow.com/comment/45897954
has comment: http://stackoverflow.com/comment/45898092
has comment: http://stackoverflow.com/comment/45897973
answer count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45897991
has comment: http://stackoverflow.com/comment/45897796
type: Question

http://stackoverflow.com/a/28905355
score: 2
upvote count: 2
has body: The value being returned is not an array. It's a plain object. Presumably you do want to use an object here, so that you can use string-valued keys. You can print out its contents like so: var cookies = get_cookies_array(); console.log(JSON.stringify(cookies)); Or line by line: Object.keys(cookies).forEach(function (key) { console.log(key, ' - ', cookies[key]); });
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28905264
type: Answer
answers question: http://stackoverflow.com/q/28905264

http://stackoverflow.com/comment/45815122
comment on: http://stackoverflow.com/a/28767594
type: AnswerComment
score: 0
has text: @Noémie O'connor so far I not used it much but it does work for me when using it in a test of fetching some markers through an API. It worked just fine for me. Let's me take a look into your code. Found some strange thing there.
type: Comment

http://stackoverflow.com/a/28875209
has body: As far as I understand you want to check, if alle the files are given within input fields? Your check could look like this: if ($(files[i]).val().length == 0) I prepared a simple pen to show how the function check() could work on a button: http://codepen.io/rias/pen/emjxJv Also you could iterate through all of the input fields, if you give them a common class like .file-input and use jQuery to iterate over them: function check () { $('.file-input).each(function () { if ($(this).val() == 0) { return false; } }); return true; //return true, if everything is okay! }
score: 0
answers question: http://stackoverflow.com/q/28874903
type: Answer

http://stackoverflow.com/comment/46304448
type: Comment
type: QuestionComment
has text: Actually the server is OneDrive. There is an already working .NET version of this code that I want to port to io.js. So the request is forged in that way that the server should understand for sure.
comment on: http://stackoverflow.com/q/28899036
score: 0

http://stackoverflow.com/q/28791480
type: Question
has body: I have a checkbox and when the user clicks on it I want it to change the private variable output. then I want to update an object's property to the output. In the code below I can't get the change event to work I believe it's because I don't know how to interact with DOM elements through the Module pattern. so if you can help with that it would be great. Something else that concerns me is that I want the price variable in the apple object to be updated when ever the user click. the price will change values to a random number every time the user clicks the checkbox. I always have a problem updating an object outside of a change event like you will see in my code. apple.price is outside change event. If you could me with that would be gratefully appreciated too. var CreatItems = function(name, price, pic){ this.name = name; this.price = price; this.pic = pic; } CreatItems.prototype.listOut = function(){ console.log(this.name + this.price + this.pic) } var changingPrice = (function(){ // testMethod : function(){ // return 1.77 // } var output; var testMethod = function(){ return output } var clickedWithOnes = function(){ $("#withones").change(function(){ if(this.checked){ // output = "checked"; console.log("Checked") }else{ // output = "unchecked"; console.log("unchecked") } }) } return{ testMethod : testMethod, clickedWithOnes : clickedWithOnes } })() changingPrice.clickedWithOnes() var price = changingPrice.testMethod() // console.log(price) var apple = new CreatItems("apple", price, "will be red div") console.log(apple.price) I get consoled "undefined"
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28791667
score: 0
has title: Trying to implement a change() event on a DOM Element through the module pattern
answer count: 1
tagged with: events
has comment: http://stackoverflow.com/comment/45858157
has comment: http://stackoverflow.com/comment/45858267
type: UnansweredQuestion
tagged with: oop
has comment: http://stackoverflow.com/comment/45858206

http://stackoverflow.com/comment/45968070
type: QuestionComment
has text: "not working in firefox" - that's a very vague description of the problem. What actually happens in Firefox?
score: 1
comment on: http://stackoverflow.com/q/28849348
type: Comment

http://stackoverflow.com/comment/46000630
has text: @jeff i'm checking these links
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28868060

http://stackoverflow.com/comment/45865013
score: 0
type: Comment
has text: it works perfect if i use <?php require_once 'my_file_with_php.php'; ?> in html but i need to repeat my Some_Data::getData(); without reloading page maby its impossible to get oop result with .load ? maby i need to use .get ?
comment on: http://stackoverflow.com/a/28794865
type: AnswerComment

http://stackoverflow.com/a/28860218
answers question: http://stackoverflow.com/q/28855795
type: Answer
has body: I came up with a solution which includes using a combination of MutationObserver and "old location value checking". Basically I implemented a value check on location.href but using a MutationObserver to detect changes in the DOM, instead of using an interval which would kill the performance and waste some precious milliseconds. Thanks for the contributions. Hope this helps anyone.
accepted answer of: http://stackoverflow.com/q/28855795
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/89049510
type: AnswerComment
score: 0
type: Comment
has text: brilliant - i try to understand why its happen so much time!!!!
comment on: http://stackoverflow.com/a/44836029

http://stackoverflow.com/q/28784028
type: Question
has comment: http://stackoverflow.com/comment/45851265
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28788338
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: Image not send using javascript when submit form no refresh page
has body: I have a javascript using send text and photo, my problem is photo not send in my directory folder and empty column photo in database. How to fix this? I'm confused :( This is my screenshot result index.php Nama <input type="hidden" value="<?php echo $sk->kode?>" name="kode"> Status Foto Komentar Send testi.php <?php include "element/koneksi.php"; $nama = $_POST['nama']; $kode = $_POST['kode']; if ($nama!=NULL or $kode!=NULL) { date_default_timezone_set("Asia/Jakarta"); $tglnya = date("Y-m-d"); $status = $_POST['status']; $komentar = $_POST['komentar']; $warna = "#52B3D9"; $kon = "NO"; $namafile_tmp = $_FILES['foto']['tmp_name']; if($namafile_tmp){ $namafile = $_FILES['foto']['name']; $file = $kode."_".$tglnya."_".$namafile; copy($namafile_tmp, "images/sekolah/testimoni/{$file}"); unlink($namafile_tmp); } $query= "INSERT INTO sekolah_testimoni VALUES(id_testi,'$kode','$nama','$komentar','$status','$file','$warna',now(),'$kon','$kon')"; mysql_query($query); } else { echo " "; } ?>
tagged with: php
has comment: http://stackoverflow.com/comment/45844423
accepted answer: http://stackoverflow.com/a/28788338
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45844332

http://stackoverflow.com/a/28818766
has body: You can get the node that has the selection, and check if it has the class or is the child of an element that has the class etc function pasteHtmlAtCaret(html, selector) { var sel, range, parent, node = null; if (document.selection) { node = document.selection.createRange().parentElement(); } else { var selection = window.getSelection(); if (selection.rangeCount &gt; 0) { node = selection.getRangeAt(0).startContainer; if (node !== $(node).closest(selector).get(0)) { node = node.parentNode; } } } if (node &amp;&amp; $(node).closest(selector).length &gt; 0 &amp;&amp; window.getSelection) { sel = window.getSelection(); if (sel.getRangeAt &amp;&amp; sel.rangeCount) { range = sel.getRangeAt(0); range.deleteContents(); var el = document.createElement("div"); el.innerHTML = html; var frag = document.createDocumentFragment(), node, lastNode; while ((node = el.firstChild)) { lastNode = frag.appendChild(node); } range.insertNode(frag); if (lastNode) { range = range.cloneRange(); range.setStartAfter(lastNode); range.collapse(true); sel.removeAllRanges(); sel.addRange(range); } } } else if (document.selection &amp;&amp; document.selection.type != "Control") { document.selection.createRange().pasteHTML(html); } } FIDDLE
accepted answer of: http://stackoverflow.com/q/28818636
has comment: http://stackoverflow.com/comment/46802339
has comment: http://stackoverflow.com/comment/47012019
has comment: http://stackoverflow.com/comment/47011713
score: 0
has comment: http://stackoverflow.com/comment/45909260
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46982969
type: Answer
has comment: http://stackoverflow.com/comment/46812672
answers question: http://stackoverflow.com/q/28818636
has comment: http://stackoverflow.com/comment/47012319

http://stackoverflow.com/q/28822912
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45917325
tagged with: ajax
has body: I am doing a graduation website for my school. On each tab I will ajax call all the works to display, once the works got displayed, I got a function $(".viewport-computer .img_thumb_holder").on({ mouseenter: function () { //stuff to do on mouse enter $(this).find(".caption").stop().fadeTo('slow', 1); }, mouseleave: function () { //stuff to do on mouse leave $(this).stop().fadeTo('slow', 1); $(".caption").stop().fadeTo('slow', 0); $(".viewport-computer .img_thumb_holder .img_thumb").stop().fadeTo(1, 1); $(".viewport-computer .img_thumb").hide(); } }); which allows me to hover on the works and display the name and caption of the works displayed. This works fine if the ajax call appended 20 or lesser works. But when I have more than 20 works, there will be a significant lag feeling when you hover over the works, where the transition to show the name and caption only show after like 3 seconds after hovering. I am quite stressed on how I can solve the lag issues as initially I was using $(".viewport-computer .img_thumb_holder").hover(function(){ //$(this).stop().fadeTo('slow', 0.4); $(this).find(".caption").stop().fadeTo('slow', 1); },function(){ $(this).stop().fadeTo('slow', 1); $(".caption").stop().fadeTo('slow', 0); $(".viewport-computer .img_thumb_holder .img_thumb").stop().fadeTo(1, 1); $(".viewport-computer .img_thumb").hide(); }); but I changed it to .on(mouseenter) after online searching that i should use .on but it doesn't solve the issues. Any other advice will be appreciated Update - to show my codings on how I display it HTML: JS - once this tab is clicked, it will display all works $(".tab_bm").click(function() { $(".container .popUp .author_pic_holder img").css("border-color", "#006a96"); $(".divider").css("background-image", "url(images/divider_it.png)"); $(".infinite_header img").attr("src", "images/header_it.png"); $(document.body).css("background-image", "url(images/BG/BlueBG.jpg)"); $(".footer img").attr("src", "images/Footer_v1_1.jpg"); //remove all d…
has comment: http://stackoverflow.com/comment/45917345
score: 2
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45917610
favorite count: 0
type: Question
upvote count: 2
has title: $.on("mouseenter") lags my website when I have a lot of Dynamically generated div tags
answer count: 1
tagged with: css
has answer: http://stackoverflow.com/a/28823070
has comment: http://stackoverflow.com/comment/45917405
downvote count: 0
tagged with: javascript

jsp
tags question: http://stackoverflow.com/q/28875402
tags question: http://stackoverflow.com/q/28778529
tags question: http://stackoverflow.com/q/28788702
tags question: http://stackoverflow.com/q/28883221
tags question: http://stackoverflow.com/q/28819210
tags question: http://stackoverflow.com/q/28866670
tags question: http://stackoverflow.com/q/28870767
tags question: http://stackoverflow.com/q/28830932
tags question: http://stackoverflow.com/q/28777653
tags question: http://stackoverflow.com/q/28818719
tags question: http://stackoverflow.com/q/28814377
tags question: http://stackoverflow.com/q/28859159
tags question: http://stackoverflow.com/q/28798007
tags question: http://stackoverflow.com/q/28831753
tags question: http://stackoverflow.com/q/28792675
type: Tag
tags question: http://stackoverflow.com/q/28889943
tags question: http://stackoverflow.com/q/28781212
tags question: http://stackoverflow.com/q/28880729
tags question: http://stackoverflow.com/q/28888201
tags question: http://stackoverflow.com/q/28804607
tags question: http://stackoverflow.com/q/28759235
tags question: http://stackoverflow.com/q/28778399
tags question: http://stackoverflow.com/q/28785381
tag name: jsp
tags question: http://stackoverflow.com/q/28829862
tags question: http://stackoverflow.com/q/28876020
tags question: http://stackoverflow.com/q/28857526
tags question: http://stackoverflow.com/q/28828972
tags question: http://stackoverflow.com/q/28860651
tags question: http://stackoverflow.com/q/28829265
tags question: http://stackoverflow.com/q/28874942
tags question: http://stackoverflow.com/q/28803527
tags question: http://stackoverflow.com/q/28852429
tags question: http://stackoverflow.com/q/28853636
tags question: http://stackoverflow.com/q/28854122

http://stackoverflow.com/comment/45847157
type: AnswerComment
has text: As you can see in my plunker I did a echo of my {{trip}} to see what happens ! The last added value will be the last in my array ! With your solution I am now sorting my days by date with angular ! But this won't change the array in {{trip}} ! Do you know how to fix this ?
comment on: http://stackoverflow.com/a/28785361
score: 0
type: Comment

http://stackoverflow.com/comment/45980065
has text: I mean, at what point in the code, can I call registry.byId("upId") because as per above code, whenever dropdown changes, it calls this function and re-initializes "up" .
type: AnswerComment
comment on: http://stackoverflow.com/a/28856172
score: 0
type: Comment

http://stackoverflow.com/q/28884035
tagged with: javascript
has comment: http://stackoverflow.com/comment/46029221
has answer: http://stackoverflow.com/a/28884228
has answer: http://stackoverflow.com/a/28884225
answer count: 4
favorite count: 0
type: UnansweredQuestion
has body: i want to know how can i store data in an array like that in order to do it with push function. here is the code var data_array = []; and data look like that var my_data = { "2011":{"name":"Team Leaders","total":93,"drilldown":"true"}, "2012":{"name":"Agents","total":1997,"drilldown":"true"}, "2013":{"name":"Coachs","total":1188,"drilldown":"true"}, "2014":{"name":"Formateurs","total":1188,"drilldown":"true"}, "2015":{"name":"Quality Analysts","total":1188,"drilldown":"true"} }; any help to change this way of inserting and use push function .
downvote count: 1
has comment: http://stackoverflow.com/comment/46029473
has comment: http://stackoverflow.com/comment/46029413
has comment: http://stackoverflow.com/comment/46029210
has answer: http://stackoverflow.com/a/28884494
score: -1
has comment: http://stackoverflow.com/comment/46029284
type: Question
has answer: http://stackoverflow.com/a/28884475
has title: How to push a value in an array
upvote count: 0
tagged with: arrays

http://stackoverflow.com/comment/45991282
type: AnswerComment
has text: Thanks for the help. I got the answer. It is `alert(result.results[0].entity.day);`
comment on: http://stackoverflow.com/a/28862777
score: 0
type: Comment

http://stackoverflow.com/a/28755571
answers question: http://stackoverflow.com/q/28755529
has comment: http://stackoverflow.com/comment/45792718
has comment: http://stackoverflow.com/comment/45792604
has body: The other two functions aren't doing what was asked. One should be summing two numbers, the other should be multiplying two numbers.
downvote count: 3
has comment: http://stackoverflow.com/comment/45792529
has comment: http://stackoverflow.com/comment/45792496
score: -3
type: Answer
upvote count: 0

http://stackoverflow.com/comment/45850587
type: Comment
type: QuestionComment
has text: Define "the output is wrong". What is the output? What do you *expect* the output to be? When you step through the code in a debugger, where does its behavior differ from what you expect? Stack Overflow is a poor substitute for debugging.
comment on: http://stackoverflow.com/q/28787404
score: 0

http://stackoverflow.com/q/28779503
favorite count: 0
has answer: http://stackoverflow.com/a/28779556
possible better answer: http://stackoverflow.com/a/28779599
has answer: http://stackoverflow.com/a/28779599
tagged with: request
upvote count: 6
tagged with: node.js
type: AnsweredQuestion
has body: I try to get the image and display on a url. and I use request module. For example, I want to get the image https://www.google.com/images/srpr/logo11w.png, and display on my url http://example.com/google/logo. Or display by &lt;img src="http://example.com/google/logo" /&gt;. And I try to use request and express: app.get("/google/logo", function(req, res) { request.get("https://www.google.com/images/srpr/logo11w.png", function(err, result, body) { res.writeHead(200, {"Content-Type": "image/png"}); res.write(body); res.end(); }) }) but the response is not a image. How to get image and output? Please give me some suggestion about the question. THANKS.
accepted answer: http://stackoverflow.com/a/28779556
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
score: 6
tagged with: express
has title: How to request images and output image in Node.js

http://stackoverflow.com/q/28892682
has comment: http://stackoverflow.com/comment/46045971
tagged with: javascript
has body: The following code is a method to grab the number of rows from a server. &lt;?php //retrieving number of rows from server $num_check = $handler-&gt;query("SELECT * FROM table"); $num_to_display = $num_check-&gt;rowCount(); ?&gt; I'm using a counter widget written in Javascript to provide a customer facing counter that displays the number of rows found (numbers of entry in the table). The counter was written by chap named Chris Nanney. The section of the source that I am using is below. &lt;script&gt; $(function(){ //changed value to be a PHP variable. var myCounter = new flipCounter('myCounter', {value: myVar, inc: 0, pace: 1000, auto: true}); $('#style-switcher a').on('click', function(e){ e.preventDefault(); $("#myCounter").removeClass().addClass('flip-counter '+$(this).data('style')); $('#style-switcher a').removeClass('active'); $(this).addClass('active'); }); //the following lines I probably don't need and will delete. But as they are in use now, I felt it necessary to include them $('#inc_slider').slider({ range: 'max', value: 123, min: 0, max: 1000, slide: function(event, ui){ $('#inc_value').text(ui.value); myCounter.setIncrement(ui.value); if (ui.value == 0) myCounter.setAuto(false); else myCounter.setAuto(true); } }); // Pace $('#pace_slider').slider({ range: 'max', value: 1000, min: 400, max: 2000, step: 100, slide: function(event, ui){ myCounter.setPace(ui.value); $("#pace_value").text(ui.value); } }); }); &lt;/script&gt; The trouble I am running into is changing the PHP variable $number_to_display to a Javascript variable that can be parsed by the parameters of the function specifically the value field. Some debugging showed that the number echoes properly from the PHP end so I doubt the PHP is the issue. More likely the issue is in converting it to Javascript. So far I have attempted to change it over to JS within the function itself, and some treasure hunting on other forums gave me the following stub which was my most recent attempt at passing it. &l…
has comment: http://stackoverflow.com/comment/46046481
answer count: 3
has comment: http://stackoverflow.com/comment/46046466
upvote count: 1
has comment: http://stackoverflow.com/comment/46045922
has comment: http://stackoverflow.com/comment/46046445
linked to: http://stackoverflow.com/q/7605505
favorite count: 0
has comment: http://stackoverflow.com/comment/46045958
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28893211
has comment: http://stackoverflow.com/comment/46046491
tagged with: php
has comment: http://stackoverflow.com/comment/46046523
has answer: http://stackoverflow.com/a/28892721
has comment: http://stackoverflow.com/comment/46046493
downvote count: 0
has title: Moving variables from PHP to Javascript widget
score: 1
has answer: http://stackoverflow.com/a/28893278
type: Question

http://stackoverflow.com/q/28856444
has answer: http://stackoverflow.com/a/28856631
has title: javascript select box values not updating
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28857523
has comment: http://stackoverflow.com/comment/45979225
has comment: http://stackoverflow.com/comment/45978965
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45979545
has answer: http://stackoverflow.com/a/28857902
has body: I'm hoping you can please help. I have the following HTML code: Annual Half Yearly Quarterly Depending on what option is selected, fields are displayed in a divider. For example if you select annual, a field to enter annual bonus is displayed. If you select 'Half Yearly' two fields to enter two half yearly bonuses are displayed. The trouble I'm having is that if you select 'Half yearly' for example, then enter what the half yearly bonus into the fields, then you change your mind and decide you want to enter an annual bonus instead, the values that you enter into the half yearly bonus are retained. I need them to be set to zero when you switch between options in the html select box. I tried the following code to help with this but it's not working and i'm not sure why. All it does is prevent me from putting anything at all into the half year boxes. var bonus_val_1 = document.getElementById("bonus1frequency"); var strUser = bonus_val_1.options[bonus_val_1.selectedIndex].value; if (strUser = "0") //if annual bonus is selected { document.getElementById("halfyear_bonus_one").value = 0.00; } Edit: I'm using the following JQUERY in the main HTML document to actually switch what fields are displayed when the user selects each option. So if the user selects option value 0 'annual' in the select box, the following code will show the annual bonus divider containing the annual bonus field, and hide the dividers that show half yearly and quarterly bonus fields. Based on comments about how I need to tie resetting these fields to the change event, I just thought maybe I can reset the fields to zero within the following jquery code. However I'm even less familiar with JQUERy and not sure how to do that...any help would be much appreciated. $('#bonus1frequency').on('change', function() { if ( this.value == '0') //.....................^....... { $("#annual").show(); $("#halfyearly").hide(); $("#quarterly").hide(); } if ( this.value == '1') //.....................^....... { $("#annual…
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28857523
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45978967
possible better answer: http://stackoverflow.com/a/28856631
has comment: http://stackoverflow.com/comment/45979088

http://stackoverflow.com/comment/45962580
type: AnswerComment
has text: I have tried that. I am starting to feel that the problem is based on the way I created my table. I wish I could show you guys a snapshot of how it looks. I tried my code on Notepad++ and running it on my browser it works, but moment I move it to wicket, my tables remain the same.
type: Comment
comment on: http://stackoverflow.com/a/28847102
score: 0

http://stackoverflow.com/q/28760333
has comment: http://stackoverflow.com/comment/45808421
tagged with: javascript
tagged with: easeljs
has title: How to add text or picture to a createjs.Sprite?
has answer: http://stackoverflow.com/a/28796527
upvote count: 0
tagged with: game-engine
answer count: 1
favorite count: 0
tagged with: createjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45800761
score: -1
downvote count: 1
has body: I would like to add Text or Picture to a createjs.Sprite object, to create similar sprites. How can I achieve this? I think create a createjs.Container for each Sprite is a waste of resource. Like the picture, how to add the numbers to the background and create the sprite?
type: Question

http://stackoverflow.com/comment/45925190
type: AnswerComment
comment on: http://stackoverflow.com/a/28827304
type: Comment
has text: That shouldn't make a difference.
score: 1

http://stackoverflow.com/comment/45986307
comment on: http://stackoverflow.com/a/28859442
type: AnswerComment
has text: Thanks, but when the onclick event calls sjcap(), it replaces the entire html content of the page instead of just the div. I don't know. I might have to put the captcha in an old-fashioned iframe, or something.
type: Comment
score: 0

http://stackoverflow.com/comment/45856360
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28790326
type: Comment
has text: Based on comments to my answer, it's safe to say that the actual code being asked about is quite different from the code in the question. Can you update your question with an MCVE (http://stackoverflow.com/help/mcve)

http://stackoverflow.com/comment/45906678
comment on: http://stackoverflow.com/a/28785541
score: 0
type: AnswerComment
type: Comment
has text: Please mark this as the answer (when SO allows) so that we know this is no longer an open issue. Glad Breeze is working for you :-)

http://stackoverflow.com/comment/45915122
comment on: http://stackoverflow.com/q/28821532
has text: Just to be sure that the real problem is on the helper and not on the accounts-facebook console.log the 2 return statment and looks what you get, if you get a correct url put it on the tag with the static content, btw the helper looks good, also did you have another template helper named "avatar"?
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/28752117
has comment: http://stackoverflow.com/comment/45789947
has comment: http://stackoverflow.com/comment/45787206
has comment: http://stackoverflow.com/comment/45786318
has comment: http://stackoverflow.com/comment/45787933
has comment: http://stackoverflow.com/comment/45787397
has comment: http://stackoverflow.com/comment/45819115
has comment: http://stackoverflow.com/comment/45788729
has comment: http://stackoverflow.com/comment/45787013
answers question: http://stackoverflow.com/q/28751648
has comment: http://stackoverflow.com/comment/45789787
has comment: http://stackoverflow.com/comment/45815806
has comment: http://stackoverflow.com/comment/45787704
has comment: http://stackoverflow.com/comment/45793209
score: 0
has body: I looked at your markup, and I'm going to take a stab at a fuller solution. The solution was to add data attributes to the elements from which you want to trigger the slide up/down, and then corresponding data attributes for the elements that will be affected. Click Me Slide me 'round Then in your JS: $("[data-trigger-action]").on("click", function(e) { e.preventDefault(); var _key = $(this).attr("data-trigger-action"); $triggerKeys .filter('[data-trigger-key!="' + _key + '"]').slideUp() .end().filter('[data-trigger-key="' + _key + '"]').slideDown(); }); See this codepen for a working example. (Note: I may have misidentified the items you want to affect, so moving the [data-trigger-key] attributes around should resolve that.) EDIT Here's the updated JS code, which would use your original HTML: // configure some action keys and selectors for elements to apply them to var keysToApply = { /* 'key/value to share': ['jquery-selector-to-action-el', 'jquery-selector-to-target-el'] */ 'hospitality': ['.color-list .color.hospitality', '.greybg.tuckinfo'], 'taverns': ['.color-list .color.taverns', '#wrapper .information'] }; // loop through our config and apply the data attributes $.each(keysToApply, function(key, params) { $(params[0]).attr('data-trigger-action', key); $(params[1]).attr('data-trigger-key', key); }) // cache our jQuery objects for our actions/keys var $triggerActions = $('[data-trigger-action]'), $triggerKeys = $('[data-trigger-key]'); // handle the sliding up/down of items on click $("[data-trigger-action]").on("click", function(e) { e.preventDefault(); var _key = $(this).attr("data-trigger-action"); $triggerKeys .filter('[data-trigger-key!="' + _key + '"]').slideUp() .end().filter('[data-trigger-key="' + _key + '"]').slideDown(); });
has comment: http://stackoverflow.com/comment/45822568
has comment: http://stackoverflow.com/comment/45786489
type: Answer
has comment: http://stackoverflow.com/comment/45793220
has comment: http://stackoverflow.com/comment/45786848
has comment: http://stackoverflow.com/comment/45790275
has comment: http://stackoverflow.com/comment/45790356
has comment: http://stackoverflow.com/comment/45787526
has comment: http://stackoverflow.com/comment/45821863

http://stackoverflow.com/a/29870522
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/47901220
upvote count: 2
has body: x
accepted answer of: http://stackoverflow.com/q/28847202
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28847202
type: Answer

http://stackoverflow.com/q/28892232
has comment: http://stackoverflow.com/comment/46045199
has title: Angular routes partial to 404
has comment: http://stackoverflow.com/comment/46054914
has comment: http://stackoverflow.com/comment/46045221
has comment: http://stackoverflow.com/comment/46045383
has comment: http://stackoverflow.com/comment/46045279
has comment: http://stackoverflow.com/comment/46045341
has comment: http://stackoverflow.com/comment/46045205
type: Question
has comment: http://stackoverflow.com/comment/46054847
has comment: http://stackoverflow.com/comment/46045326
tagged with: javascript
has comment: http://stackoverflow.com/comment/46045271
score: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/46047658
answer count: 0
type: UnansweredQuestion
has body: When loading a page of my app directly to the link /pl/param1 all the files fail to load because angular prepends the directories. How can I fix it? angular.module('html5app', [ 'ngRoute' ]) .config(['$locationProvider', '$routeProvider', function config ($locationProvider, $routeProvider){ //enabling HTML5 mode $locationProvider.html5Mode(true).hashPrefix('!'); //setting up routes $routeProvider.when('/',{ templateUrl: '/partials/home.html', controller: 'HomeCtrl as home'}); $routeProvider.when('/about',{ templateUrl: '/partials/about.html'}); $routeProvider.when('/pl',{ templateUrl: '/partials/plPartials/pl.html'}); $routeProvider.when('/pl/:name',{ templateUrl: '/partials/plPartials/pl.html', controller: 'PlCtrl as plDetail'}); }]); Failed to load url (why is pl getting stuck after the port number?): http://localhost:3000/pl/js/app.js Attached SEO server: var express = require('express'), app = express(); //initialize static server that will spit out contents of public folder app.use('/', function(){ var staticPath = __dirname + '/', req = arguments[0]; if(/_escaped_fragment_=/.test(req.url)){ // testing if url contains '_escaped_fragment_=' part req.url = req.url.replace(/\?.*$/,'').replace(/\/+$/,''); // if it does, then strip it // if url became empty then it means 'http://someurl/?_escaped_fragment_=' was requested, // so we need to return pre-rendered index.html, otherwise we should add '.html' extension // so that it would return 'posts.html' when http://someurl/posts?_escaped_fragment_= is requested req.url += (req.url === '') ? '/index.html' : '.html'; staticPath += 'snapshots'; // making '/snapshots' the base directory of our static server } else { staticPath += 'public'; // if it's a regular link, then initialize static server in '/public' directory } express.static(staticPath).apply(this, arguments); }); //send our main angular html file if any link without dot is requested, e.g. 'http://someurl/about' //this is our actual server side redirect, we don'…
has comment: http://stackoverflow.com/comment/46045284

http://stackoverflow.com/comment/46021110
type: QuestionComment
has text: ok thanks, I didn't know the `input` event!
comment on: http://stackoverflow.com/q/28879454
score: 0
type: Comment

http://stackoverflow.com/q/28842459
has comment: http://stackoverflow.com/comment/45957662
accepted answer: http://stackoverflow.com/a/28844642
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28844642
has body: I am looking to render a component based upon a string. Essentially, I am hoping to find the JSX equivalent to JavaScript's dynamic function name ability (parent["childMethod"]). So, if I have a string, such as "&lt;MyComponent /&gt;", how can I turn into JSX and render?
tagged with: reactjs
has comment: http://stackoverflow.com/comment/124753614
has comment: http://stackoverflow.com/comment/128808884
linked to: http://stackoverflow.com/q/33471880
answer count: 1
downvote count: 1
tagged with: javascript
score: 4
favorite count: 0
upvote count: 5
has title: React/JSX dynamic component names

http://stackoverflow.com/q/28858668
tagged with: javascript
favorite count: 0
tagged with: ajax
accepted answer: http://stackoverflow.com/a/31342244
tagged with: oauth
upvote count: 2
tagged with: oauth-2.0
tagged with: authentication
has body: I am trying to get an Oauth access token through JavaScript. In partilar I want to authenticate to DeviantArt API keeping as simple as it can be. Here are my approaches, I only need one but anyone is working so just one solution for any of the will be enough. Since it is a Cross-Origin I tried using ajax. This is the code: var response_type = "code"; var client_id = "1234"; //Random clientId for stackoverflow var redirect_uri = "http://localhost:8080/my-project/authDeviantArt.html"; var authorization1 = "https://www.deviantart.com/oauth2/authorize"; var authorization2 = "https://www.deviantart.com/oauth2/token"; var client_secret = "qwerty12345"; //Random secret for stackoverflow var grant_type1 = "authorization_code"; var grant_type2 = "client_credentials"; var scopes = "basic"; //Using The Authorization Code Grant var request1 = authorization1+'?response_type='+response_type+'client_id='+client_id+'&amp;redirect_uri='+redirect_uri; //Using The Client Credentials Grant var request2 = authorization2+'?client_id='+client_id+'&amp;client_secret='+client_secret+'&amp;grant_type='+grant_type2; $.ajax({ url: request1, dataType: "jsonp", success: function (res){ console.log("Response: "+res.access_token); }); The problem is that I allways get the following error Uncaught SyntaxError: Unexpected token : but clicking on the error in the JavasCript console I can see the response JSON: {"access_token":"662b..5d58","token_type":"Bearer","expires_in":3600,"status":"success"} and the Concole.log prints Error: [object Object] (despite chrome console does not throw any error in that line). I also tried with the library JSO but I don't achieve saving the token neither. I also tried with the library Hello.js but it does not support DeviantArt and my approaches modifying it had neither any success. I tried also trying to modify headers in XMLHttpRequest() or adding options to getJson but always CORS error, no matter what I try. I have been trying tens of solutions posted on stackover…
has title: DeviantArt Oauth authentication with JavaScript
linked to: http://stackoverflow.com/q/29175006
score: 2
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/31342244
downvote count: 0
answer count: 1

http://stackoverflow.com/comment/46030875
comment on: http://stackoverflow.com/q/28884263
score: 0
type: Comment
has text: Why can't you call `PrimeFacesGeneratedFunction()` directly in your `popstate` event handler instead of doing it indirectly ?
type: QuestionComment

http://stackoverflow.com/a/28815118
type: Answer
answers question: http://stackoverflow.com/q/28815008
has comment: http://stackoverflow.com/comment/45902654
has comment: http://stackoverflow.com/comment/45913478
has comment: http://stackoverflow.com/comment/45907905
has comment: http://stackoverflow.com/comment/45944842
score: 0
has body: It's perfectly acceptable to use a polyfill for these types of things: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf#Polyfill if (!Array.prototype.indexOf) { // paste polyfill here } You could also use methods provided by different libraries: // jQuery if ($.inArray("some_value", someArray) &gt; -1) { ... } // Underscore if (_.contains(someArray, "some_value")) { ... }

http://stackoverflow.com/a/28824838
score: 0
has body: The two expressions are equivalent, the second one is just the negated version of yours. The opposite (more or less) of == is !=, the opposite of &amp;&amp; is ||, and the opposite of true is false. You are placing a comma whenever the count is divisible by 3 and you aren't at the start of the number. They are not placing a comma anytime the count is not divisible by 3 or they are at the start of the number.
type: Answer
answers question: http://stackoverflow.com/q/28824764

http://stackoverflow.com/comment/45983494
type: QuestionComment
type: Comment
score: 0
has text: I don't agree that the question is a duplicate, although that answer should help the OP understand this as well...
comment on: http://stackoverflow.com/q/28858767

http://stackoverflow.com/comment/45866629
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28795362
type: Comment
has text: Ok I figured it out: counter = '<?php echo $x ;?>'; var options = { useEasing : true, useGrouping : true, separator : ',', decimal : '.' , prefix : '' , suffix : '' } var demo = new countUp("myTargetElement", 0, counter, 0, 2.5, options); demo.start();

http://stackoverflow.com/comment/45806524
has text: Then that's why you use event delegation using `.on` - e.g. `$(document).on('click', '#button', function() { ...` (but you should ideally replace `document` with the closest ancestor that exists in the main view when the view is first rendered)
type: QuestionComment
comment on: http://stackoverflow.com/q/28763145
score: 2
type: Comment

http://stackoverflow.com/comment/45984138
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28859093
has text: You know, this is a Q&A answer format, not a discussion site or forum. You can use the chat to discuss and not having enough reputation doesn't allow you to break rules basically.
type: AnswerComment

http://stackoverflow.com/comment/45826274
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28773870
score: 1
has text: You're assuming that because the arguments have the same name, they will somehow magically be passed by reference

http://stackoverflow.com/q/28821134
tagged with: javascript
favorite count: 0
type: UnansweredQuestion
has body: When I inspect my polymer objects in Chrome Developer Tools, I find that for every published property, there's a version of the property that has a trailing underscore added. Both have the same values, but the original published property displays a value of (...) which must be clicked before I can see it. E.g. if I publish a height property with a value of 23, I'll see a height: (...) listing in Chrome Dev Tools and an additional height_: 23 listing. What purpose to these additional properties serve? Are there any issues with publishing properties that themselves have a trailing underscore, e.g. height_?
has comment: http://stackoverflow.com/comment/45918454
has title: What are these "property_" versions of published properties on my Polymer elements?
answer count: 0
score: 1
tagged with: google-chrome-devtools
upvote count: 1
type: Question
tagged with: polymer
downvote count: 0

http://stackoverflow.com/comment/46024667
comment on: http://stackoverflow.com/a/28852323
type: Comment
has text: Do you think a browser security setting or a windows security setting is doing this?
type: AnswerComment
score: 0

http://stackoverflow.com/a/33487931
type: Answer
has body: Identical model definition from ground up - when working with a known normalized model instead of raw data, its easy for plug and play in case of changes in business or model. A thoroughly componentized to the lowest level - what you see is what you get. Using raw data instead of model with schema may cause inconsistencies across the application (in model validations for example). Model validations - by using models you can validate the given model (in your case in the POST requests) against its schema - required attributes, attribute types and advanced validations. Out-of-the-box database querying - advanced querying using Waterline Query Language
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/28874306
downvote count: 0

http://stackoverflow.com/q/28896800
tagged with: functional-programming
downvote count: 0
possible better answer: http://stackoverflow.com/a/28899169
favorite count: 0
accepted answer: http://stackoverflow.com/a/28902368
has answer: http://stackoverflow.com/a/28899169
type: AnsweredQuestion
score: 3
tagged with: ramda.js
upvote count: 3
type: Question
has body: So I have a list of divs: list i want a subset of the list removing the divs with the .fade class. and also just grabbing the list from the div with .selected class. so using R.takeWhile and R.dropWhile. then i want to map over that new list and add a .active class on a subset of that list with R.take and R.forEach or R.map something like : var takeFromSelected = R.dropWhile(function(item){!$(item).hasClass('selected')}; var removeFadeItems = R.takeWhile(function(item){!$(item).hasClass('fade')}); var addActiveClass = function(x){ $(x).addClass('.active')}; var processList = R.pipe(R.map(addActiveClass), removeFadeItems, takeFromSelected); processList(list); Im really new to this FP stuff and trying to get the grip of it. Any insight would be greatly apreciated!! Thanks! :) Update for future reference this is what i did : @addActiveClass = (x)-&gt; $(x).addClass('active') return @takeFromSelected = R.dropWhile((item)-&gt; !$(item).hasClass('selected')) @removeFadeItems = R.takeWhile((item)-&gt; !$(item).hasClass('fade')) @addWeekView = R.compose(addActiveClass, removeFadeItems, takeFromSelected)
tagged with: javascript
has title: How can i do this better with Ramda.js
answer count: 2
has answer: http://stackoverflow.com/a/28902368

http://stackoverflow.com/a/28802239
accepted answer of: http://stackoverflow.com/q/28802175
answers question: http://stackoverflow.com/q/28802175
type: Answer
has comment: http://stackoverflow.com/comment/45919095
has comment: http://stackoverflow.com/comment/45889363
has body: The problem is just a missing a brace to close the function you're passing to .addEventListener: document.getElementById('text_input').addEventListener('keypress', function (event){ if(event.which != 13){ return; } else{ var comment = document.createElement('li'); comment.textContent = document.getElementById('text_input').value; var data = document.getElementById('text_input').value document.getElementById('consolelog').appendChild(comment); document.getElementById('text_input').value = ""; } }); //a brace was missing here alert("test");
has comment: http://stackoverflow.com/comment/45951447
has comment: http://stackoverflow.com/comment/45879546
score: 0
has comment: http://stackoverflow.com/comment/45951336
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45951297

event-handling
tag name: event-handling
tags question: http://stackoverflow.com/q/28885307
tags question: http://stackoverflow.com/q/28885912
tags question: http://stackoverflow.com/q/28857649
tags question: http://stackoverflow.com/q/28857385
type: Tag
tags question: http://stackoverflow.com/q/28786896

http://stackoverflow.com/q/28852256
favorite count: 0
upvote count: 5
has body: I am currently documenting one of my APIs using JSDoc. Although this works well, one thing that really annoys me is the occurence of duplicate documentation. One common example of this is the documentation of a property and its getter: function AClass() { /** * The current state of the object. Determines wether this object has been initialized yet. * @type {String} * @private */ this._state = "initalized"; } /** * Returns the current state of the object, which determines if the object has been initalized yet. * @return {String} The current state of the object */ AnObject.prototype.getState = function() { return this._state; } I suppose everyone sees the issue here. The property is actually documented three times (the private property itself, the getter method description and the method's return value). Simply changing the method's description to something like Returns the state is not really an option, since I generally hide private properties in the documentation output. I am interested in if there is a best practice for such cases and how others handle this. As a DRY-obsessed guy it seems to be that there should be a better option to handle these cases.
type: UnansweredQuestion
tagged with: jsdoc
tagged with: documentation-generation
downvote count: 0
has answer: http://stackoverflow.com/a/29399221
has title: JSDoc: How to avoid duplicate documentation for properties/getters?
type: Question
score: 5
tagged with: jsdoc3
has answer: http://stackoverflow.com/a/74704563
tagged with: javascript
answer count: 2
tagged with: documentation

http://stackoverflow.com/comment/46067540
has text: I found a serious bug in the solution.
type: Comment
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28853014

clang
tags question: http://stackoverflow.com/q/28767105
tag name: clang
type: Tag

webbrowser-control
type: Tag
tags question: http://stackoverflow.com/q/28813842
tag name: webbrowser-control

http://stackoverflow.com/comment/45922220
comment on: http://stackoverflow.com/q/28825060
score: 0
type: Comment
type: QuestionComment
has text: @Barmar thanks, but is my jqGrid I downloaded from the mentioned site compatible to your jQgrid? Are there different products? Or all jqGrid the same?

http://stackoverflow.com/q/28769634
tagged with: javascript
downvote count: 0
tagged with: http://stackoverflow.com/tag/q
favorite count: 0
tagged with: promise
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/18386753
has body: I have a array of promises which I want to execute in sequence: var promises = []; promises.push(testPromise('entity1')); promises.push(testPromise('entity2')); promises.push(testPromise('entity')); Q.all(promises).done(function(){ //all promises resolved; }); dc.testPromise = function(entity){ return localForage.getItem(entity).then(function(result){ //do something with the result }); }; I want to complete the execution of testPromise function for one entity completely before executing it for other. But I find that after localForage.getItem gets executed for entity1, the then part is not called but the function gets executed for entity2. I want the then part to be executed first before testPromise gets executed for entity2.
answer count: 0
score: 1
duplicate of: http://stackoverflow.com/q/18386753
upvote count: 1
has title: Execute promises in squence
type: Question

twilio
tag name: twilio
tags question: http://stackoverflow.com/q/28842056
type: Tag

http://stackoverflow.com/comment/45951862
comment on: http://stackoverflow.com/q/28841318
score: 2
type: Comment
type: QuestionComment
has text: You might want to read [Benefits of using `Object.create` for inheritance](http://stackoverflow.com/q/17392857/218196). I also recommend to read the [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Introduction_to_Object-Oriented_JavaScript).

http://stackoverflow.com/comment/46784677
comment on: http://stackoverflow.com/a/28864680
type: AnswerComment
score: 0
type: Comment
has text: @jsve hahaha yeah it's very funny. I remember when someone gave me a link to this site a long time ago in IRC... :D

http://stackoverflow.com/a/28762465
has comment: http://stackoverflow.com/comment/45805038
type: Answer
has body: Your issue is that you did not inject the dependencies : angular.module('app.controllers', ['ionic', 'app.services.myservice']).controller('myCtrl', ['$scope', '$ionicLoading', 'MyService', MyCtrl]) function MyCtrl($scope, $ionicLoading, MyService){ } This should work To make it more clear, I suggest you to declare controllers that way : var controllers = angular.module('app.controllers', ['ionic', 'app.services.myservice']); controllers.controller('myCtrl', ['$scope', '$ionicLoading', 'MyService', MyCtrl]); function MyCtrl($scope, $ionicLoading, MyService){ }
answers question: http://stackoverflow.com/q/28762317
score: 0

http://stackoverflow.com/q/28774551
has body: I have div container, stretched vertically to 'body'. Inside it I have 2 DIVs on the one level. The 1st must be stretched to browser's window. But it minimal height shouldn't be smaller, than the second's height. The 2nd have 2 fixed heights (changing by JS). The problem is: Can I solve this problem WITHOUT using JS, but only with CSS+HTML? UPDATE: My HTML code structure - jsFiddle &lt;div class="container"&gt; &lt;div class="div1"&gt;&lt;/div&gt; &lt;div class="div2"&gt;&lt;/div&gt; &lt;/div&gt; .container{ position: absolute; top: 0; bottom: 0; left: 0; right: 0; padding-top: 51px; } .div1{ width: 100%; height: 100%; position: absolute; margin-top: -51px; background: red; } .div2{ float: left; width: 440px; height: 500px; margin-top: 44px; margin-left: 30px; position: absolute; background: #cccccc; }
has comment: http://stackoverflow.com/comment/45829107
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/28781198
favorite count: 0
has comment: http://stackoverflow.com/comment/45838394
type: UnansweredQuestion
tagged with: css
has title: Div that flexible by content, but stretched by body tag (height)
downvote count: 1
has comment: http://stackoverflow.com/comment/45827722
type: Question
upvote count: 0
has comment: http://stackoverflow.com/comment/45829751
tagged with: javascript
tagged with: jquery
score: -1

http://stackoverflow.com/comment/45907966
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28817738
has text: no i don't see anything only that the code is not working, I have there in code a small transition, but this is not working
type: AnswerComment

http://stackoverflow.com/q/28862517
has title: Ratchet: How to share information between pages?
type: UnansweredQuestion
has body: I'm currently using the Ratchet framework for UI and was wondering how I would go about sharing information (ex. user inputted data) between pages. The site doesn't seem to cover this and I can't seem to find a tutorial of any sort.
has comment: http://stackoverflow.com/comment/45990793
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45990400
score: 0
tagged with: ratchet
answer count: 1
has comment: http://stackoverflow.com/comment/45990638
has answer: http://stackoverflow.com/a/29595571

memoization
type: Tag
tags question: http://stackoverflow.com/q/28763057
tag name: memoization

http://stackoverflow.com/a/78090840
answers question: http://stackoverflow.com/q/28775051
type: Answer
score: 0
has body: let results = await User.find( {$text: {$search: "text that you want to search for"}}, {score: {$meta: "textScore"}}) .sort({score:{$meta:"textScore"}}); where User is the schema that you have created and the function in which this is coded should be made async.
has comment: http://stackoverflow.com/comment/137676544

http://stackoverflow.com/a/28784557
has body: There are some syntax issues with your code. First, you need to remove the quotes (") and ()s from setInterval and capitalize the I. setInterval(changecolor, 3000); The setInterval function takes in two arguments: a callback function (which can be a local variable such as your changecolor function) and a number (the number of milliseconds for the interval). You also need to declare your array properly with [ and ] instead of { and }. Also (although not necessary) include a ; at the end of the statement. var colors = ["red", "orange", "green", "blue", "brown", "purple", "gray", "white"]; As Tarun Gaba pointed out, you should use bgColor instead of bgcolor.
answers question: http://stackoverflow.com/q/28784531
score: 0
has comment: http://stackoverflow.com/comment/45845357
type: Answer

drag-and-drop
tags question: http://stackoverflow.com/q/28876398
tags question: http://stackoverflow.com/q/28879524
tag name: drag-and-drop
tags question: http://stackoverflow.com/q/28902386
tags question: http://stackoverflow.com/q/28867350
tags question: http://stackoverflow.com/q/28838555
tags question: http://stackoverflow.com/q/28834022
tags question: http://stackoverflow.com/q/28855572
tags question: http://stackoverflow.com/q/28842157
tags question: http://stackoverflow.com/q/28879784
type: Tag

http://stackoverflow.com/comment/45853038
has text: you'll need to use res.redirect. Consider setting the values to the session, then retrieving them in the new route, and passing them to your view there
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28788523
score: 1

http://stackoverflow.com/comment/45961644
type: AnswerComment
has text: Thanks for your answer! My problem is setting column, not getting column.
type: Comment
comment on: http://stackoverflow.com/a/28846367
score: 0

http://stackoverflow.com/comment/45809758
score: 0
comment on: http://stackoverflow.com/q/28765383
type: Comment
type: QuestionComment
has text: I need for both the cases with and without input

http://stackoverflow.com/q/28883221
has comment: http://stackoverflow.com/comment/46055579
has comment: http://stackoverflow.com/comment/46056952
type: Question
has comment: http://stackoverflow.com/comment/46056903
tagged with: autocomplete
tagged with: javascript
has comment: http://stackoverflow.com/comment/46056239
score: 0
has comment: http://stackoverflow.com/comment/46125981
has body: I am new in jsp and so in javascript and i am trying to create an autocomplete form with two text fields. Also i want the second one to take some value automatic according to the value of the first one. Well, i did a little research and i found in another topic a code snippet. The think is that when i put it in a single jsp page in netbeans it doesn't works.I think something is missing. Can you please help with that. Thanks. Here is my code: &lt;%@page contentType="text/html" pageEncoding="UTF-8"%&gt; &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;body&gt; &lt;input id='fruit' name='fruit' type='text'&gt; &lt;input id='details' name='details' type='text'&gt; &lt;script&gt; var x = [ { label : 'apple', value : 'Delicious' }, { label : 'kiwi', value : 'Yummy' }, { label : 'kiwiooo', value : 'aaa' }, { label : 'lemon', value : 'Sour' } ]; $( "#fruit" ).autocomplete({ source: x, focus : function(){ return false; } }) .on( 'autocompleteresponse autocompleteselect', function( e, ui ){ var t = $(this), details = $('#details'), label = ( e.type === 'autocompleteresponse' ? ui.content[0].label : ui.item.label ), value = ( e.type === 'autocompleteresponse' ? ui.content[0].value : ui.item.value ); t.val( label ); details.val( value ); return false; }); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; FIDDLE UPDATED
has title: Jquery autocomplete in jsp
tagged with: jsp
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46047708
has comment: http://stackoverflow.com/comment/46060120
answer count: 0

http://stackoverflow.com/comment/45813363
type: Comment
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/28767138
has text: Add common class like this ` `. And then use the code from my first comment.

http://stackoverflow.com/comment/46056598
type: QuestionComment
type: Comment
score: 1
has text: Please see ["Should questions include “tags” in their titles?"](http://meta.stackexchange.com/questions/19190/should-questions-include-tags-in-their-titles), where the consensus is "no, they should not"!
comment on: http://stackoverflow.com/q/28896703

http://stackoverflow.com/q/28757441
downvote count: 0
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
score: 1
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/45795672
has answer: http://stackoverflow.com/a/28757492
has comment: http://stackoverflow.com/comment/45870579
has body: I have a button that when it is clicked triggers this: var approved = false; $('.confirm').on('click', function (e) { var type = $(this).attr("data-confirm"); if (approved === false) { bootbox.confirm("Are you sure would like to " + type +"?", function (result) { if (result) { approved = true; $(this).trigger('click'); } }); e.preventDefault(); } }); Its a modal confirm box with 2 buttons, cancel and confirm. The goal here is to wait the click to perform until the user clicks on confirm box. When the code runs it display the box and wait, if user clicks cancel, its close the modal and don't trigger the clicks, perfect fine, if the user clicks on confirm it closes the modal, assign approved to true, however the click event doesn't trigger again with new command. how can I change this to perform this. if approved is false, load bootbox.confirm and pause. User clicks confirm its loads if(result) assign approved to true and continue the click. Any help? thanks
answer count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/45795711
has title: Jquery to stop click event until function is completed
has answer: http://stackoverflow.com/a/28801779

http://stackoverflow.com/comment/46021978
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28774487
has text: also doesn't work, already tried. I guess loading custom URI works some other way

http://stackoverflow.com/comment/45937004
comment on: http://stackoverflow.com/a/28832163
has text: It seems the {{number}}-value becomes null when the core-submenu is pressed and is not set to a correct value until a sub-item is actually is pressed. This null value is causing faulty behaviour. Is there anything that can be done to prevent this?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45933613
type: QuestionComment
comment on: http://stackoverflow.com/q/28830663
has text: If you're running I/O behind the scenes and that's meant to take priority, yes use `setImmediate`. However, note that your own code will run slower as a result.
score: 0
type: Comment

kendo-combobox
tag name: kendo-combobox
tags question: http://stackoverflow.com/q/28764473
type: Tag

http://stackoverflow.com/comment/45835617
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28778257
has text: @Claies I better use global search in source code than searching it with github's search method next time T_T

http://stackoverflow.com/comment/46012398
has text: No errors... when i run my code i get multiple links one below the other .. when i click on a particular link i get another set of links and after that when i click on those links there i should get alert box but i am not getting it
type: QuestionComment
comment on: http://stackoverflow.com/q/28874942
score: 0
type: Comment

http://stackoverflow.com/a/55147931
score: -1
has body: from excel workbook object get sheet using getSheetAt(sheetNumber); then using sheet object getRow(0); then using cellIterator() you can iterate till last column of row. Example using XSSFWorkBook XSSFWorkBook wb=new XSSFWorkBook(FileInputStream object);//object got by passing excel file path to FileInputStream Sheet sh=wb.getSheetAt(0) or wb.getSheet("sheet name"); Row row=sh.getRow(0); Iterator cit=row.cellIterator();Cell cell; while(cit.hasNext()) { cell=cit.next(); } when you come out of the while loop you will have last cell object in 'cell' variable
upvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28768178
downvote count: 1
has comment: http://stackoverflow.com/comment/97036485

http://stackoverflow.com/comment/45924418
comment on: http://stackoverflow.com/a/28796231
score: 0
type: AnswerComment
type: Comment
has text: Thanks George. I understand the choice should be on the user. So I'd like to show some message like: "Please open this page on Chrome for the best performance", then put something like deeplink to open Chrome to make the user easier to access, otherwise the user have to copy the URL, open Chrome then paste it on the URL bar, which takes a lot of trouble. Ideally I'd like to find a way to open Chrome with just one tap. Because my app currently desn't run on Facebook in-app browser but it does on Chrome...Is there any way to do it?

http://stackoverflow.com/q/28773707
type: Question
has title: Bootstrap sidebar and footer not working properly
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28773789
answer count: 2
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28773914
downvote count: 0
has answer: http://stackoverflow.com/a/28773914
favorite count: 0
tagged with: twitter-bootstrap
tagged with: css
accepted answer: http://stackoverflow.com/a/28773789
has body: I have to add a footer for many web pages developed using jQuery and bootstrap 3. I have written the following script based on this Bootstrap's example to do the job // Default $( document ).ready(function() { $('body').append(' ' + ' © 2015 ABC Company. All rights reserved. | Content for internal use only. | ' + 'Contact Us ' + ' '); }); related CSS html { position: relative; min-height: 100%; } body { /* Margin bottom by footer height */ margin-bottom: 40px; } .footer { position: absolute; bottom: 0; width: 100%; /* Set the fixed height of the footer here */ height: 40px; background-color: #99FFFF; padding-top:5px; } This work well for all pages except pages with sidebars where the sidebar overlaps the footer like below I have tried to fix it by adding margin-bottom: 40px; /* Margin bottom by footer height */ to .sidebar in CSS. Now it looks like below Bootply How to fix this? I can't add and style individual footer for each page as there are many pages.
type: AnsweredQuestion
score: 2
upvote count: 2

http://stackoverflow.com/a/28795692
upvote count: 1
score: 1
has body: You're not showing response section after hiding it in the first time use this line $("#response").show(); in the beginning $('form.ajax').on('submit', function(){ $("#response").show(); /* bla bla your code bla bla ............................ */ });
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28795631

http://stackoverflow.com/q/28834365
downvote count: 0
favorite count: 0
tagged with: hudson
has title: How to get a reference to form elements in a Jenkins jelly script for a Builder configuration when the form loads?
tagged with: jelly
has answer: http://stackoverflow.com/a/28855456
tagged with: jenkins
type: UnansweredQuestion
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/28844919
type: Question
has body: I am writing a Jenkins Builder, and in the jelly script for its configuration in the build configuration page I have some Javascript that I want to run when the form is loaded, to do a server lookup and get some information to help the user out with their configuration, which will also be performed when the user changes the form's values. Previously I have got references to the form elements by passing this in to functions in onchange or onkeyup attributes. However, now I want to run some script even when the form hasn't changed. I know I could set ID attributes on the form elements, however that's not going to work if the users add to a build two build steps both using this builder. I've tried generating a random ID on my builder class, and then use that to construct IDs for the elements and write that into some Javascript in the jelly file so I can find those elements there, but that doesn't get initialised until the user saves, so it won't work if the user adds two instances of this builder without saving the job: &lt;j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form"&gt; &lt;f:entry title="Entry 1"&gt; &lt;f:textbox field="field1" id="${instance.id}-field1" onchange="fieldChanged('${instance.id}-field1')"/&gt; &lt;/f:entry&gt; &lt;script type="text/javascript"&gt; function fieldChanged(elementId) { ... } fieldChanged('${instance.id}-field1'); &lt;/script&gt; &lt;/j:jelly&gt; Are there any conventions on how to do this sort of thing? Anything built in to Jenkins/jelly to support multiple instances of the same jelly file being able to refer to their own elements?
tagged with: javascript
tagged with: jenkins-plugins
answer count: 2

http://stackoverflow.com/a/28905863
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28904606
has body: CDATA is an XML concept. It is a way of specifying a section of text inside which things that look like mark-up or special XML characters are treated as plain text. It is essentially equivalent to escaping &lt; to &amp;lt; etc. everywhere within the CDATA section. If the document has an HTML doctype, then the CDATA receives no special processing and is just more characters. If the document had an XHTML doctype, then you would be able to retrieve the CDATA section as is, with no further ado.

http://stackoverflow.com/q/28858428
upvote count: 1
type: Question
has body: I have created a type=text pattern="abc.|123." for a personal mini project but this is for my user id field. Is there anyway i can add a pattern type to restrict the use of Symbols or Special characters in my Password field? And a minimum of ONE Uppercase letter? I have tried using ~NOT JavaScript but i am unsure if this is the right or easy solution. Any help will be appreciated Thanks Mike R.
tagged with: http://stackoverflow.com/tag/xhtml
tagged with: javascript
has answer: http://stackoverflow.com/a/28859459
has title: Type=text pattern issue with special characters
answer count: 1
downvote count: 0
score: 1
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28859459
tagged with: java

http://stackoverflow.com/q/28818368
has body: I have the following code that parses fields from an HL7 2.1 message, it converts it to a JSON object for further processing in Logstash/ElasticSearch/Kibana my issue is how to correctly parse the date-time stamps from HL7 local time to a UTC ISO8691 date time in a transformer. I have included the entire code of the transformer. The ConvertToISODate function is a hack to simply create a ISO Date time string, but it doesn't convert it to UTC, which I need. function ConvertToISODate(hl7Date) { // this function will return an ISO formatted date string from the insanity that is hl7 dates // this function is also insane but the sane ways didn't seem to work var outdate = ''; //4 year outdate += hl7Date.substring(0,4) + '-'; //2 month outdate += hl7Date.substring(4,6) + '-'; //2 day outdate += hl7Date.substring(6,8) + 'T'; //2 hour outdate += hl7Date.substring(8,10) + ':'; //2 minute outdate += hl7Date.substring(10,12) + ':'; //2 second assume start of minute as not precise outdate += '00.000Z'; return outdate; } function Group(obrseg) { this.seqno = obrseg['OBR.1']['OBR.1.1'].toString(); if (this.seqno == '') { this.seqno = '1'; } else { this.seqno = this.seqno; } this.reptno = obrseg['OBR.3']['OBR.3.1'].toString(); this.reqno = obrseg['OBR.3']['OBR.3.1'].toString().substr(0, 10); this.test = obrseg['OBR.4']['OBR.4.1'].toString(); // TODO what about s/a's ? this.groupname = obrseg['OBR.4']['OBR.4.2'].toString(); this.priority = obrseg['OBR.5']['OBR.5.1'].toString(); this.reg_dt = ConvertToISODate(obrseg['OBR.6']['OBR.6.1'].toString()); this.requester_id = obrseg['OBR.16']['OBR.16.1'].toString(); this.requester_surname = obrseg['OBR.16']['OBR.16.2'].toString(); this.requester_firstname = obrseg['OBR.16']['OBR.16.3'].toString(); this.rept_dt = ConvertToISODate(obrseg['OBR.22']['OBR.22.1'].toString()); this.status = obrseg['OBR.25']['OBR.25.1'].toString(); } function Constit(obxseg) { this.seqno = obxseg['OBX.1']['OBX.1.1'].toString(); if (this.seqno == '') { this.seqno = '…
score: 0
tagged with: datetime
possible better answer: http://stackoverflow.com/a/30113497
tagged with: mirth
accepted answer: http://stackoverflow.com/a/29077074
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/29077074
has answer: http://stackoverflow.com/a/30113497
answer count: 2
has title: In mirth connect convert hl7 datetime in local time to iso date in UTC
tagged with: javascript

http://stackoverflow.com/q/28818615
upvote count: 1
tagged with: knockout.js
type: Question
tagged with: javascript
tagged with: twitter-typeahead
has answer: http://stackoverflow.com/a/28819278
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has title: Twitter typeahead, KnockoutJS not firing onchange/update observable in Chrome/Explorer
has body: I'm using twitter typeahead together with knockout and I noticed that the observable for the input bind is not updating in chrome/explorer when choosing from typeaheads suggestions. In order for it to update you will have to make a keystroke(like a space) after you have chosen one of the suggestions. Enter/unfocusing the input is not enough(but works in firefox). Please test it with the following fiddle with chrome/explorer vs firefox: http://jsfiddle.net/s415L158/5/ var viewModel = { city:ko.observable() } var cities = new Bloodhound({ datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'), queryTokenizer: Bloodhound.tokenizers.whitespace, local: $.map(["Stockholm","Oslo","Copenhagen"], function(city) { return { value: city }; }) }); cities.initialize(); $('#typeahead').typeahead({ hint: true, highlight: true, minLength: 1 }, { name: 'cities', displayKey: 'value', source: cities.ttAdapter() }); ko.applyBindings(viewModel); Any ideas how to fix this? Update: To reproduce: Start typing 'S' in the input Select 'Stockholm' from suggestions Unfocus input Observable not updated
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28819278
score: 1

http://stackoverflow.com/q/28885020
possible better answer: http://stackoverflow.com/a/28898153
tagged with: sprite
tagged with: tween
has body: I have a sprite that I want to animate using TweenJS. My first thought was to write something like this: createjs.Tween.get(mySprite).to({currentFrame:30}, 1000); Which didn't work. And simply writing... mySprite.currentFrame = 10; mySprite.currentAnimationFrame = 10; ...does not cause the sprite to update either. So I'm guessing these properties are get only? (mySprite.gotoAndStop(10); works just fine.) Do I need to call an update method of some sort? Or perhaps resort to some gotoAndStop hack? Seems kinda strange that this is a problem. If anyone can shed some light on this it's much appreciated.
has answer: http://stackoverflow.com/a/28898153
type: Question
has title: TweenJS tweening the frames of a Sprite
tagged with: easeljs
score: 0
has answer: http://stackoverflow.com/a/28903442
tagged with: javascript
has answer: http://stackoverflow.com/a/33380679
answer count: 3
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28903442

http://stackoverflow.com/a/28879620
score: 0
has comment: http://stackoverflow.com/comment/46023318
type: Answer
has comment: http://stackoverflow.com/comment/46021591
has comment: http://stackoverflow.com/comment/46022341
has comment: http://stackoverflow.com/comment/46022144
has comment: http://stackoverflow.com/comment/46022283
has body: You can use $(document).off('success.aliAjax'); Change $("a.ajax").click(... into $("a.ajax").on('click', function... then you can use $("a.ajax").off("click") EDIT: Is that what you want? FIDDLE
answers question: http://stackoverflow.com/q/28879538
has comment: http://stackoverflow.com/comment/46020955
has comment: http://stackoverflow.com/comment/46021963
has comment: http://stackoverflow.com/comment/46022836

http://stackoverflow.com/q/28761082
has body: I'm trying to get a leave animation working with velocity and angular so that when the table rows leave they move to the right. In the example I use the leave callback to try an animate the leaving of ng-repeat but the callback runs however nothing happens! angular.module('myApp', ['ngAnimate']) .controller('myCtrl', function($scope) { $scope.items = ['item1', 'item2', 'item3'] $scope.shiftItems = function() { var items = ['asdf', 'bill', 'bob', 'joe', 'items'] for (var i = 0; i < $scope.items.length; i++) $scope.items.shift() for (var i = 0; i < items.length; i++) $scope.items.push(items[i]) } }) .animation('.velocity-tableSlideInOut', [function() { return { enter: function(element, done) { Velocity(element, 'transition.slideLeftIn', [0.36, 0.96, 0.6, 0.96]) }, leave: function(element) { Velocity(element, {opacity: 0}, [0.4, 0.04, 0.64, 0.04]) } } }]) {{item}} Reorder
type: Question
has answer: http://stackoverflow.com/a/28846996
has title: Velocity animations for leave callback of ngAnimate
accepted answer: http://stackoverflow.com/a/28846996
score: 0
answer count: 1
tagged with: javascript
tagged with: angularjs
tagged with: velocity.js
type: AnsweredQuestion

http://stackoverflow.com/comment/45884676
has text: Can you post a link to the page? You can split the URL so it is not followed by Google spiders
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28805377

http://stackoverflow.com/q/28821113
has body: I have a project where I'd like to compile separate script bundles - one main one that gets included on every page and a bunch of separate bundles that will get included only on specific pages. I have a NPM script that looks like this: "build-site": "watchify Scripts/site.js -o Scripts/bundle.js -v -d .", "build-student": "watchify Scripts/modules/student.js -o Scripts/student_bundle.js -v -d .", "start": "npm run build-site | npm run build-student", So I run npm start and Watchify kicks in and starts watching the files. This part works well enough. Whenever I make a change to the student module, both files get recompiled (no problem) but when I go to view the page in the browser I get an error that the module 'site.js' could not be found. If I then go to the site.js file and modify something, the recompile occurs but this time it works well in the browser. So the crux of it is that when I try to compile one file, I have to make a change to the other to get that to compile properly as well. I feel like the way I'm doing it is kind of unstable but I can't find much information on bundling multiple files with Watchify. To summarise my question: How can I compile multiple bundles with Watchify in a way that avoids the above problem?
has comment: http://stackoverflow.com/comment/46000888
upvote count: 3
possible better answer: http://stackoverflow.com/a/28978778
has answer: http://stackoverflow.com/a/28978778
favorite count: 0
tagged with: npm
tagged with: watchify
accepted answer: http://stackoverflow.com/a/28999834
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/45999604
downvote count: 0
has answer: http://stackoverflow.com/a/28999834
has title: Compiling multiple script bundles using NPM and Watchify
type: Question
answer count: 2
tagged with: javascript

http://stackoverflow.com/comment/45830477
comment on: http://stackoverflow.com/q/28776079
score: 0
has text: In node.js's repl - if you do `var x = 15` it will scope it to the global scope which you can easily verify by typing `global.x` in the following line.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28767678
has answer: http://stackoverflow.com/a/28767721
has answer: http://stackoverflow.com/a/28767740
type: Question
has body: In HTML I have tables in tables. So I have for example a table in a td element. However when getting all td's for the closest row : var row = $(this).closest('tr').find('td'); I am getting all the subchildren also (all td elements in the child table). How you get all childs without sub elements ? Thanks in advance
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: Get children without subchildren

http://stackoverflow.com/a/28782996
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/28782795
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28782795
type: Answer
has body: store $('#somediv &gt; p') in a variable instead of repeating the selection on every loop turn don't use :nth-of-type( k ) in an iteration. Just select all of them at once, and iterate the collection you get as a result. In summary: $('#somediv &gt; p') does already give you the result you want. Just iterate through it using jQuery's idiomatic each method - a plain js loop would be faster, but that's neglible. $('#somediv &gt; p').each(function() { console.log($(this)); }); Of course, if you look for raw speed, don't use jQuery at all. It might be something like var els = document.getElementById("somediv").children; for (var i=0, l=els.length; i&lt;l; i++) if (els[i].tagName == "P") console.log(els[i]);

http://stackoverflow.com/comment/45956523
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28843785
has text: What does your HTML look like? If the children have both data-company_id and data-user_id you'll always hit the first case.

http://stackoverflow.com/a/28889800
upvote count: 7
answers question: http://stackoverflow.com/q/28847967
type: Answer
downvote count: 0
has body: So after reading through the csrf hook linked in the question a bit more I managed to work it out. As of v0.11.0 : If you try to provide an object with settings in the csrf.js config file, the hook simply overwrites them with "default on" for all settings. The csrf object ends up looking like this { grantTokenViaAjax: true, protectionEnabled: true, origin: '-', routesDisabled: '-' } In order to add route exemptions to the object, you need to do it after this has been set up, so I did this in config/bootstrap.js. So to add the route "http://yourhost.com/webhooks/testhook/" : // In bootstrap.js sails.config.csrf.routesDisabled = "/webhooks/testhook"; If you want to add more than one hook, you add them in the same string, comma delimited: // In bootstrap.js sails.config.csrf.routesDisabled = "/webhooks/testhook,/webhooks/anotherhook";
score: 7

http://stackoverflow.com/a/28846247
score: -1
has body: you can use "keydown" event instead. It will give you the result you want. document.addEventListener('keydown', function(evt){ console.log(evt); });
upvote count: 0
type: Answer
downvote count: 1
answers question: http://stackoverflow.com/q/28846164

http://stackoverflow.com/comment/45994579
type: QuestionComment
comment on: http://stackoverflow.com/q/28864692
score: 3
type: Comment
has text: don't include a path

http://stackoverflow.com/a/28757264
answers question: http://stackoverflow.com/q/28756770
score: 0
has comment: http://stackoverflow.com/comment/45795320
has body: I suspect that what is happening is your HTML file is loading faster than your JS file. By executing the code immediately (even though it's at the bottom of your HTML file), it is likely getting hung up because those methods technically haven't loaded yet. Try executing your code after the page loads. function initPage () { document.write('&lt;h1&gt;' + returnWeek() + ', ' + returnMonth(false) + ' ' + new Date().getDate() + ', ' + new Date().getFullYear() + '&lt;/h1&gt; &lt;small&gt;' + returnMonth(true) + '.' + new Date().getDate() + '.' + new Date().getFullYear() + '&lt;/small&gt;'); } if (window.addEventListener) { window.addEventListener("load", initPage, false); } else { window.onload = initPage; }
type: Answer
has comment: http://stackoverflow.com/comment/45795338

http://stackoverflow.com/a/45252226
type: Answer
upvote count: 16
has comment: http://stackoverflow.com/comment/77557103
has body: Here you go. /** @type {HTMLTextAreaElement} */ var _buffer; /** * Returns the number of lines in a textarea, including wrapped lines. * * __NOTE__: * [textarea] should have an integer line height to avoid rounding errors. */ function countLines(textarea) { if (_buffer == null) { _buffer = document.createElement('textarea'); _buffer.style.border = 'none'; _buffer.style.height = '0'; _buffer.style.overflow = 'hidden'; _buffer.style.padding = '0'; _buffer.style.position = 'absolute'; _buffer.style.left = '0'; _buffer.style.top = '0'; _buffer.style.zIndex = '-1'; document.body.appendChild(_buffer); } var cs = window.getComputedStyle(textarea); var pl = parseInt(cs.paddingLeft); var pr = parseInt(cs.paddingRight); var lh = parseInt(cs.lineHeight); // [cs.lineHeight] may return 'normal', which means line height = font size. if (isNaN(lh)) lh = parseInt(cs.fontSize); // Copy content width. _buffer.style.width = (textarea.clientWidth - pl - pr) + 'px'; // Copy text properties. _buffer.style.font = cs.font; _buffer.style.letterSpacing = cs.letterSpacing; _buffer.style.whiteSpace = cs.whiteSpace; _buffer.style.wordBreak = cs.wordBreak; _buffer.style.wordSpacing = cs.wordSpacing; _buffer.style.wordWrap = cs.wordWrap; // Copy value. _buffer.value = textarea.value; var result = Math.floor(_buffer.scrollHeight / lh); if (result == 0) result = 1; return result; } Demo here
score: 16
answers question: http://stackoverflow.com/q/28905965
has comment: http://stackoverflow.com/comment/132103642
downvote count: 0
has comment: http://stackoverflow.com/comment/77527308

http://stackoverflow.com/a/28774351
upvote count: 2
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45827104
has body: Assuming there's only one &lt;input&gt; in the &lt;td&gt;, you should be able to find it using the selector you already have as the basis: var inpVal = thisObj.closest("tr").children('td:first').find('input').val()
accepted answer of: http://stackoverflow.com/q/28774306
answers question: http://stackoverflow.com/q/28774306

http://stackoverflow.com/comment/45895428
has text: When i change the mode to no wrap in body, it works, but the others do not, how do i make my code function to "no wrap - in body" http://jsfiddle.net/9qtkdh5o/
comment on: http://stackoverflow.com/a/28810872
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28901975
score: 0
answers question: http://stackoverflow.com/q/28897556
type: Answer
has body: I think this is what you need to solve your problem. 1 new function getLeft(); the rest is adaptions of existing functions and css. I think this ought to work for more images, so the client has to push the right-button multiple times to get to the end. You might also want extra calculations to restrict the range; so all the images are not beyond the right or left of the .wrapper-thumbs (feel free to ask me). Notice: maybe you want left and right to do the opposite (I've seen both) ; just swap the 500 &lt;-> -500 Or do you only want as many images so that only 1 push of the button gets you totally left or right? css: #slideshow .controls .wrapper-thumbs { overflow: hidden; position: relative; /* this means: the upper-left corner of &lt;div class="wrapper-thumbs"&gt; is now the the new base/zero (for style.left) for all the children with position: absolute */ float: left; /* this is so the left- and right-button are kept in place */ margin: 0; width: 556px; height: 76px; } #thumbs { display: inline-block; width: 900px; height: 76px; position: absolute; /* So now, the new base of #thumbs is set to the base/zero of &lt;div class="wrapper-thumbs"&gt; */ z-index: 99; } script: // function reads style.left; removes 'px'; returns the numeric value. function getLeft() { var left = document.getElementById('thumbs').style.left; return Number(left.substr(0, left.length - 2)); // .substr removes the 'px' } // Move thumbs to the left function left() { var currentLeft = getLeft(); var newLeft = currentLeft -500; document.getElementById('thumbs').style.left = newLeft + 'px'; } // Move thumbs to the right function right() { var currentLeft = getLeft(); var newLeft = currentLeft +500; document.getElementById('thumbs').style.left = newLeft + 'px'; }

http://stackoverflow.com/a/28797339
answers question: http://stackoverflow.com/q/28797199
downvote count: 0
has body: First of all you should not use double-quotes inside of sourounding double quotes. Change var elm = " "; to var elm = ' '; Now $(elm) will be the div with id #a. Only if you are searching for child elements of $(elm) you can find those with for example $(elm).find('#b') while $(elm).find('#a') will give you no result since #a is no child of itself.
upvote count: 2
type: Answer
score: 2

http://stackoverflow.com/comment/45874419
type: Comment
type: QuestionComment
score: 0
has text: phantom.js renders the code in a picture if you use the render function.
comment on: http://stackoverflow.com/q/28800122

http://stackoverflow.com/q/28851909
has comment: http://stackoverflow.com/comment/45972364
tagged with: fieldset
has comment: http://stackoverflow.com/comment/45970746
type: Question
has title: html fieldset inner height
answer count: 2
has comment: http://stackoverflow.com/comment/45980732
tagged with: javascript
has comment: http://stackoverflow.com/comment/45971828
has comment: http://stackoverflow.com/comment/45976198
has answer: http://stackoverflow.com/a/28855490
tagged with: css
has body: I have a fieldset with several divs inside, of which only one is displayed at a time. I want the fieldset to always keep its height, even when the visibility of its contents changes. So I set the fieldset.style.minHeight to the maximum of the offsetHeight of all possible content parts. But this doesn't take into account that the minHeight is the height of the outside and not the client part of the fieldset. So I tried to add the difference between the offsetHeight and the clientHeight of the fieldset. But this is not the correct value (it is only 2 px in my case). So the question is: how to set the minHeight of a fieldset so that there is egnough space for a child with a given height. (I am using no borders, margins or padding, I am looking for a pure JavaScript solution) jsfiddle Status Short text. Some longer text. Some longer text. Some longer text. Some longer text. Some longer text. Some longer text. Some longer text. Some longer text. Some longer text. Some longer text. Some longer text. Some longer text. Some longer text. Some longer text. Some longer text. Some longer text. function onLoad() { var fs = document.getElementById("fs"); var span1 = document.getElementById("id1"); var span2 = document.getElementById("id2"); fs.style.minHeight = Math.max(span1.offsetHeight, span2.offsetHeight).toString() + "px"; span1.style.display = "block"; span2.style.display = "none"; } function toggle() { var span1 = document.getElementById("id1"); var span2 = document.getElementById("id2"); if (span1.style.display == "block") { span1.style.display = "none"; span2.style.display = "block"; } else { span1.style.display = "block"; span2.style.display = "none"; } }
score: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28853921

http://stackoverflow.com/a/29022609
has body: You might have to use AngularAMD. Works great for our angular website.
type: Answer
answers question: http://stackoverflow.com/q/28897315
upvote count: 1
downvote count: 0
score: 1

http://stackoverflow.com/a/29388438
has body: I just found the problem. I was setting the wrong key when adding the "withinKilometers" constraint. Cheers
type: Answer
accepted answer of: http://stackoverflow.com/q/28810160
answers question: http://stackoverflow.com/q/28810160
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/45968945
has text: google ajax history pushstate
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28850903

http://stackoverflow.com/comment/45962571
type: Comment
comment on: http://stackoverflow.com/a/28847069
score: 0
type: AnswerComment
has text: @s_m - second code example added to my answer that produces a list of suggestion words.

http://stackoverflow.com/q/28817284
answer count: 4
favorite count: 0
upvote count: 2
has body: How can I write a regex that limits user input to 3 digits in the range of 0-128? I've been trying \d{1,3} but this allows for a match more than the 0-128 range. Thanks
has answer: http://stackoverflow.com/a/28817322
tagged with: regex
score: 2
type: AnsweredQuestion
has title: Regex - limit user input to 0-128
has answer: http://stackoverflow.com/a/28817350
accepted answer: http://stackoverflow.com/a/28817350
has answer: http://stackoverflow.com/a/28817625
has comment: http://stackoverflow.com/comment/45906565
type: Question
has comment: http://stackoverflow.com/comment/45906883
downvote count: 0
possible better answer: http://stackoverflow.com/a/28817322
tagged with: javascript
has comment: http://stackoverflow.com/comment/45906517
has comment: http://stackoverflow.com/comment/45906240
has answer: http://stackoverflow.com/a/28822517

http://stackoverflow.com/a/28870341
type: Answer
has comment: http://stackoverflow.com/comment/46009855
score: 1
has body: Try this The anchor tag when gets clicked it search for the text $('.nav li a').on('click', function(e){ e.preventDefault(); console.log("Value is " + $(this).text()); });
upvote count: 1
has comment: http://stackoverflow.com/comment/46017245
answers question: http://stackoverflow.com/q/28870017
downvote count: 0

http://stackoverflow.com/comment/46060515
type: Comment
type: QuestionComment
score: 2
has text: If you wanted to do this on load, why not do it with CSS? .signup { display: none; }
comment on: http://stackoverflow.com/q/28900629

http://stackoverflow.com/comment/45783826
comment on: http://stackoverflow.com/q/28750902
score: 2
has text: read about nested coding horror and try to flatten your statement. that would be the "right" way
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28904904
type: Question
has title: How can I get my CSS animation to run when clicking the button by usng jQuery?
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46070916
tagged with: css
score: 0
has answer: http://stackoverflow.com/a/30212505
answer count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/46070992
has comment: http://stackoverflow.com/comment/46071674
downvote count: 1
has comment: http://stackoverflow.com/comment/46071446
has body: I want my CSS animation to begin when i click on the button and due to the assignment brief instructions from my course at uni I must use jquery to do so can anybody help me? $('button').onClick(function(){ $(".florence").addClass(".animate"); }); body{ margin:0; padding:0; } #background { width:1024px; height:768px; position:absolute; overflow:hidden; } button { width:300px; height:100px; color:#1f1f1f; background-color:#fff; position:absolute; top:500px; left:300px; z-index:1; } .sky { position:absolute; top:0; left:0; } .grass { position:absolute; top:568px; left:0; float:left; -webkit-animation-duration: 3s; -webkit-animation-name: grass; -webkit-animation-timing-function: normal ease-out; } .florence { position:absolute; top:100px; left:600px; float:left; z-index:1; } .animate { -webkit-animation-duration: 5s; -webkit-animation-name: florence; -webkit-animation-timing-function: normal ease-out; } .cloud1 { position:absolute; top:70px; left:50px; float:left; z-index:1; -webkit-animation-duration: 3s; -webkit-animation-name: cloudone; -webkit-animation-timing-function: normal ease-out; } .cloud2 { position:absolute; top:192px; left:195px; float:left; z-index:1; -webkit-animation-duration: 3s; -webkit-animation-name: cloudtwo; -webkit-animation-timing-function: normal ease-out; } .cloud3 { position:absolute; top:100px; left:515px; float:left; -webkit-animation-duration: 3s; -webkit-animation-name: cloudthree; -webkit-animation-timing-function: normal ease-out; } .cloud4 { position:absolute; top:10px; left:670px; float:left; -webkit-animation-duration: 3s; -webkit-animation-name: cloudfour; -webkit-animation-timing-function: normal ease-out; } .cloud5 { position:absolute; top:70px; left:914px; float:left; -webkit-animation-duration: 3s; -webkit-animation-name: cloudfive; -webkit-animation-timing-function: normal ease-out; } .sun { position:absolute; top:25px; left:275px; float:left; -webkit-animation-duration: 3s; -webkit-animation-name: sun; -webkit-animation-timi…
has comment: http://stackoverflow.com/comment/46071822
has comment: http://stackoverflow.com/comment/46070721
has comment: http://stackoverflow.com/comment/46070817
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46070915
tagged with: webkit
has answer: http://stackoverflow.com/a/28905784
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46071862
favorite count: 0
has comment: http://stackoverflow.com/comment/46072833
has comment: http://stackoverflow.com/comment/46069215

http://stackoverflow.com/comment/57362057
score: 0
type: Comment
has text: why not? When you hit Ctrl+space inside { }, WebStorm suggests named exports from the module specified in 'from'
type: AnswerComment
comment on: http://stackoverflow.com/a/28812074

http://stackoverflow.com/comment/45920394
type: Comment
comment on: http://stackoverflow.com/a/28824663
has text: Ofcourse you need send.php, I am assuming you are somehow passing the `$error` back to the html page somehow. Why don't you place the php code in the same file as your html, then it'd work automatically.
score: 0
type: AnswerComment

http://stackoverflow.com/a/71774031
downvote count: 0
answers question: http://stackoverflow.com/q/28905420
has comment: http://stackoverflow.com/comment/128571832
type: Answer
upvote count: 12
has body: I took the IMO best answer (by @Neil) and made it a bit more human-readable: function listenOnDevicePixelRatio() { function onChange() { console.log("devicePixelRatio changed: " + window.devicePixelRatio); listenOnDevicePixelRatio(); } matchMedia( `(resolution: ${window.devicePixelRatio}dppx)` ).addEventListener("change", onChange, { once: true }); } listenOnDevicePixelRatio(); No fixed boundary or variables needed.
score: 12
accepted answer of: http://stackoverflow.com/q/28905420
type: AcceptedAnswer

http://stackoverflow.com/a/28847850
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45965178
has body: Try this to uncheck: $('.host-list').find('input').prop('checked',false); UPDATE: You should check your click function and then get values, so inside for I added a conditional. for (each in check_hosts) { if($(".host-list:checkbox[value='" + check_hosts[each] + "']").attr("checked")){ $(".host-list:checkbox[value='" + check_hosts[each] + "']").attr("checked", false); }else { $(".host-list:checkbox[value='" + check_hosts[each] + "']").attr("checked", true); } }
answers question: http://stackoverflow.com/q/28847722

http://stackoverflow.com/comment/46071862
type: Comment
type: QuestionComment
has text: Do you have a javascript error in your console?
score: 0
comment on: http://stackoverflow.com/q/28904904

http://stackoverflow.com/comment/45967303
has text: don't you think there is something wrong in `http://code.jquery.com/jquery- 1.8.0.min.js`... there are extra space between `jquery-` and `1.8.0` so `http://code.jquery.com/jquery-1.8.0.min.js`
comment on: http://stackoverflow.com/q/28849981
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28849869
type: Answer
has comment: http://stackoverflow.com/comment/45970433
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28849560
has comment: http://stackoverflow.com/comment/45969609
has comment: http://stackoverflow.com/comment/45970659
has body: You can try var clone = $('#room-1').clone(); //clone clone.children(':first').text("CAMERA " + i); //change ids appropriately clone.find('[id]').addBack().attr('id', function (_, id) { return id.replace(/\d+$/, i) }); clone.find('[name]').attr('name', function (_, name) { return name.replace(/rooms\[\d+\]/, 'rooms[' + i + ']') }); Demo: Fiddle
answers question: http://stackoverflow.com/q/28849560
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45969919
has comment: http://stackoverflow.com/comment/45970527

http://stackoverflow.com/comment/137403497
type: Comment
has text: This looks wrong -- the React docs say "Calling ref.current.focus() during render is wrong because it is a side effect. Side effects should either be placed inside an event handler or be declared with useEffect." cf. https://react.dev/learn/synchronizing-with-effects#focus-a-field-on-mount
comment on: http://stackoverflow.com/a/40235334
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45968133
has text: I'm using the feed dialog, which is only discouraged by Facebook, not deprecated, because with the Share Dialog I can't post on my page, but only on my profile. Anyway, the Facebook docs says that if I want users to post something, I can't let them post without editing the content, so they encourage to use Share dialogs, which aren't suitable for what I'm trying to do
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28836689

http://stackoverflow.com/comment/45855663
has text: Worked. Thanks a lot. But how can i download the PDF file?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28789818
type: Comment

http://stackoverflow.com/comment/46051633
type: Comment
type: QuestionComment
has text: Chrome 40.0.2214 (Windows 7) ExecutiveController controller should not be null F AILED TypeError: undefined is not a function at Object.<anonymous> (C:/EngineeringExcellence_New/test/unit/Execut iveControllerSpec.js:13:38) at Object.e [as invoke] (C:/EngineeringExcellence_New/app/js/vendor/ angular.min.js:37:19) at Object.workFn (C:/EngineeringExcellence_New/test/lib/angular/angu lar-mock.js:2341:34) Error: Declaration Location
comment on: http://stackoverflow.com/q/28895408
score: 0

pebble-watch
tags question: http://stackoverflow.com/q/28817348
tag name: pebble-watch
type: Tag

http://stackoverflow.com/a/28877501
score: 0
has comment: http://stackoverflow.com/comment/46017058
type: Answer
has comment: http://stackoverflow.com/comment/46017130
has comment: http://stackoverflow.com/comment/46018332
has comment: http://stackoverflow.com/comment/46017353
has comment: http://stackoverflow.com/comment/46017462
answers question: http://stackoverflow.com/q/28877341
has body: There is no equivalent to ::-webkit-scrollbar in firefox. before few days back i was searching for the same problem then i came to know that There is no solution for this and this bug is already registered in https://bugzilla.mozilla.org
has comment: http://stackoverflow.com/comment/46016953
has comment: http://stackoverflow.com/comment/46018265

http://stackoverflow.com/comment/45965668
comment on: http://stackoverflow.com/q/28849010
type: Comment
type: QuestionComment
has text: Option 1: `eval` (if you are sure data is safe). Option 2: helper function like in [this](http://stackoverflow.com/questions/27978593/access-nested-objects-in-js/27978873#27978873) answer.
score: 0

http://stackoverflow.com/q/28869711
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/31032062
tagged with: touchswipe
score: 0
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
type: Question
has body: I am working on a simple online portfolio that displays a single image from an array with a corresponding caption and a link to the next or previous image in the array. I would like to utilize the swiping function of mobile devices so that someone who views the site on such a device will not have to use the hyperlink to view the next or previous image (the link is small and hyperlinks trigger the navigation bar on iphones which is disruptive). Is there a way to make a swiping motion link to another page or do I need to have all of the images available on one page and use JS to show one image at a time while hiding the others? Here is the relevant code: &lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; border=&quot;0&quot; height=&quot;100%&quot; width=&quot;100%&quot;&gt; &lt;tr valign=&quot;middle&quot;&gt;&lt;td align=&quot;center&quot; colspan=&quot;2&quot;&gt; &lt;img src=&quot;31.jpg&quot; width=&quot;40%&quot; style=&quot;padding-top:38px; max-width:672px&quot;&gt; &lt;/td&gt;&lt;/tr&gt; &lt;tr valign=&quot;bottom&quot;&gt;&lt;td style=&quot;padding:0 0 22 16&quot; height=&quot;38&quot;&gt; Cover for a book of photographs &lt;/td&gt;&lt;td align=&quot;right&quot; style=&quot;padding:0 16 22 0&quot;&gt; &lt;a href=&quot;10.html&quot;&gt;&amp;lt;&lt;/a&gt;&amp;nbsp; 01 / 10 &amp;nbsp;&lt;a href=&quot;2.html&quot;&gt;&amp;gt;&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt; &lt;/table&gt;
has title: Utilize swiping function on mobile device to navigate array of images
answer count: 1
tagged with: ios

http://stackoverflow.com/comment/46224407
type: QuestionComment
comment on: http://stackoverflow.com/q/28851214
has text: where the callbacks for "drop_finish"? http://old.jstree.com/documentation/dnd
score: 0
type: Comment

http://stackoverflow.com/q/28852274
has title: I want to scroll zoom in and out of an image, but also have pins on that image stay positioned correctly. jQuery
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
answer count: 1
has body: So I want to make a scroll zoom feature on a map I have created. The map contains an image and a number of divs positioned on top of the map marking out positions (pins). I have found a number of jQuery tools which allows me to scroll zoom on an image. And I could probably try and use the mouse position and scroll amount to edit the coordinates of my divs as well. Is this the best way of going about this, or does anyone know any jQuery tools that will allow me to scroll zoom in and out of divs? Here are some tools I found for scrolling on images. image zoomer Wheel zoom
favorite count: 0
accepted answer: http://stackoverflow.com/a/28852761
upvote count: 1
tagged with: css
type: AnsweredQuestion
score: 1
type: Question
linked to: http://stackoverflow.com/q/13110763
has answer: http://stackoverflow.com/a/28852761
tagged with: javascript
tagged with: jquery
tagged with: jquery-plugins

http://stackoverflow.com/q/28790744
has answer: http://stackoverflow.com/a/75320081
has comment: http://stackoverflow.com/comment/45856769
has comment: http://stackoverflow.com/comment/59366309
has comment: http://stackoverflow.com/comment/55058053
downvote count: 0
has comment: http://stackoverflow.com/comment/45856779
has answer: http://stackoverflow.com/a/44578144
favorite count: 0
tagged with: promise
has comment: http://stackoverflow.com/comment/45856677
answer count: 5
has comment: http://stackoverflow.com/comment/45856836
has comment: http://stackoverflow.com/comment/136613718
has comment: http://stackoverflow.com/comment/46056680
has comment: http://stackoverflow.com/comment/45857332
has comment: http://stackoverflow.com/comment/45856860
has comment: http://stackoverflow.com/comment/45857188
has comment: http://stackoverflow.com/comment/45856763
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45857484
has comment: http://stackoverflow.com/comment/59366271
has comment: http://stackoverflow.com/comment/45857104
has comment: http://stackoverflow.com/comment/46014899
type: Question
has answer: http://stackoverflow.com/a/66984737
has comment: http://stackoverflow.com/comment/46006872
has comment: http://stackoverflow.com/comment/45856694
has comment: http://stackoverflow.com/comment/45856958
has comment: http://stackoverflow.com/comment/45856707
has answer: http://stackoverflow.com/a/36589183
tagged with: javascript
score: 43
has title: How would one do async JavaScript getters and setters?
has comment: http://stackoverflow.com/comment/59408483
upvote count: 43
has body: Think of how Rails, e.g. allows you to define a property as associated with another: class Customer &lt; ActiveRecord::Base has_many :orders end This does not set up a database column for orders. Instead, it creates a getter for orders, which allows us to do @orders = @customer.orders Which goes and gets the related orders objects. In JS, we can easily do that with getters: { name: "John", get orders() { // get the order stuff here } } But Rails is sync, and in JS, if in our example, as is reasonable, we are going to the database, we would be doing it async. How would we create async getters (and setters, for that matter)? Would we return a promise that eventually gets resolved? { name: "John", get orders() { // create a promise // pseudo-code for db and promise... db.find("orders",{customer:"John"},function(err,data) { promise.resolve(data); }); return promise; } } which would allow us to do customer.orders.then(....); Or would we do it more angular-style, where we would automatically resolve it into a value? To sum, how do we implement async getters?
has answer: http://stackoverflow.com/a/60609442

http://stackoverflow.com/a/28794139
has comment: http://stackoverflow.com/comment/45862887
has body: var a = new Date("2015-01-04T16:59:33.000Z"); var b = Date.parse(a); var c = Date.parse(new Date().toISOString()); //use toISOString to return UTC date. var diff = c - b; var diffInDays = diff/1000/60/60/24; document.body.textContent = diffInDays; //just to show output in the snippet. This will convert the date from now and the date your SQL supplied to milliseconds and subtracts them from each other. Since they are milliseconds, divide by 1000 milliseconds, than 60 seconds, 60 minutes and 24 hours to get the days.
has comment: http://stackoverflow.com/comment/45862942
has comment: http://stackoverflow.com/comment/45863115
type: Answer
has comment: http://stackoverflow.com/comment/45862922
has comment: http://stackoverflow.com/comment/45862834
downvote count: 1
has comment: http://stackoverflow.com/comment/45862861
score: 1
accepted answer of: http://stackoverflow.com/q/28794086
has comment: http://stackoverflow.com/comment/45862877
answers question: http://stackoverflow.com/q/28794086
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45862932
has comment: http://stackoverflow.com/comment/45863098

http://stackoverflow.com/comment/45996328
score: 0
type: QuestionComment
type: Comment
has text: This application is not running in IE, it's a standalone running pre OS. IE is not involved. Not sure if that matters at this point, either.
comment on: http://stackoverflow.com/q/28863121

http://stackoverflow.com/comment/45805973
score: 0
comment on: http://stackoverflow.com/a/28762146
type: AnswerComment
type: Comment
has text: Yeah you can do that, there is no need for JS

http://stackoverflow.com/comment/45898195
comment on: http://stackoverflow.com/a/28812163
type: Comment
score: 0
type: AnswerComment
has text: Thanks for such a helpful answer. This solved all of my problems, but now the text will not center align. I'm using #contractTable td to try this but text-align will not work here nor above in my original code. Do you know if this is the correct notation? I read around and it also says try #contractTable > td or > tr > td but none are working

http://stackoverflow.com/comment/45810474
has text: I've tried this and it takes too much time to retrieve and has low performance if we have bulk of data in list and want to search something from it.. I want something which will retrieve direct items from View...
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28765137

http://stackoverflow.com/q/28868041
tagged with: ckeditor
has body: I am doing like below to group set of commands into single dropdown but all items are not showing up CKEDITOR.config.toolbar = [{ name: 'paragraph', groups:['list', 'indent', 'blocks', 'align', 'bidi'], items: ['More'] }]; CKEDITOR.replace(editorName, { on: { pluginsLoaded: function () { var editor = this, items = {}, groupName = 'Justify_Group', config = CKEDITOR.config; var more_Group = 'More_Group'; editor.addMenuGroup(more_Group); var moreButtons = { Subscript: 'Sub Script', Superscript: 'Super Script', NumberedList: 'Numbered List', BulletedList: 'Bullet List', Outdent: 'Outdent', Indent: 'Indent', Blockquote: 'Blockquote', RemoveFormat: 'Remove Format' }, moreItems = {}; for (var i in moreButtons) { var v = moreButtons[i]; moreItems[i.toLowerCase()] = { label: v, group: more_Group, command: i.toLowerCase(), order: 1 }; } editor.ui.add('More', CKEDITOR.UI_MENUBUTTON, { label: 'More', name: 'More', modes: { wysiwyg: 1 }, onMenu: function () { var active = {}; for (var p in moreItems) active[p] = null return active; } }); } } }); But same thing works well for Justify buttons. In above list of commands only Bulleted Lists are showing up in dropdown that too with (properties) text added to given label. How can I fix this issue
accepted answer: http://stackoverflow.com/a/28950075
has comment: http://stackoverflow.com/comment/46139388
type: AnsweredQuestion
type: Question
has title: Custom UI dropdown button not showing up all commands
has answer: http://stackoverflow.com/a/28950075
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/46141960
tagged with: javascript

http://stackoverflow.com/a/28905673
downvote count: 0
type: Answer
upvote count: 2
has body: Well I'm gonna make this simple, if all your anchor tags have common expand class and all your div elements have common content class and they're placed one below the other like this Open 1 Hello Assuming your content class will have rules in CSS file to hide that div or you can have an inline style="display:none;" on the div element, then on click of hyper link, you can select the next div element and toggle it like this $(document).ready(function(){ $('.expand').on('click', function(e) { e.preventDefault(); var $div = $(this).next('.content'); $('.content').not($div).slideUp('slow'); $div.slideToggle('slow'); }); });
answers question: http://stackoverflow.com/q/28905108
score: 2

http://stackoverflow.com/a/28793294
has comment: http://stackoverflow.com/comment/45863707
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/45861499
has comment: http://stackoverflow.com/comment/45864184
upvote count: 1
has body: Just make the menu inline block and center it with text-align. .drop { text-align:center; background:#005555; } .drop_menu { background:#005555; padding:0; margin:15px 0; list-style-type:none; height:30px; display:inline-block; } .drop_menu li { float:right; } .drop_menu li a { padding:9px 20px; display:block; color:#fff; text-decoration:none; font:12px arial, verdana, sans-serif; } .drop_menu ul { position:absolute; right:-9999px; top:-9999px; list-style-type:none; } .drop_menu li:hover { height: 100%; position:relative; background:#5FD367; } .drop_menu li:hover ul { right:0px; top:30px; background:#5FD367; padding:0px; } .drop_menu li:hover ul li a { padding:5px; display:block; width:168px; text-indent:15px; background-color:#5FD367; } .drop_menu li:hover ul li a:hover { background:#005555; } דף הבית הרשמה התחברות אודות צור קשר קישורים נוספים תיק עבודות תת תפריט תת תפריט
score: 1
answers question: http://stackoverflow.com/q/28792876

http://stackoverflow.com/a/28805604
has comment: http://stackoverflow.com/comment/45884643
answers question: http://stackoverflow.com/q/28805321
has comment: http://stackoverflow.com/comment/45886044
type: Answer
accepted answer of: http://stackoverflow.com/q/28805321
has comment: http://stackoverflow.com/comment/45886619
has comment: http://stackoverflow.com/comment/45885573
score: 1
has comment: http://stackoverflow.com/comment/45885150
upvote count: 1
has comment: http://stackoverflow.com/comment/45885624
has body: You can use the pattern rule from the additional-method.js file from jquery-validate $("#register-form").validate({ rules: { firstname: "required", lastname: "required", email: { required: true, email: true }, mobile: { required: true, minlength: 10, pattern: /^[789]/ }, dob: "required", location: "required", state: "required", gender: "required", agree: "required" }, messages: { firstname: "Please enter your first name", lastname: "Please enter your last name", mobile: { required: "Please provide your mobile number", minlength: "Your mobile number must be 10 characters long", pattern: 'should start with 7,8 or 9' }, email: "Please enter a valid email address", dob: "Please provide you Date of Birth", location: "Please provide your location", state: "Please provide your state", gender: "Please provide your gender", agree: "Please accept our terms of service" }, submitHandler: function (form) { form.submit(); } }); Demo: Fiddle
has comment: http://stackoverflow.com/comment/45886432
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45886173

http://stackoverflow.com/a/31932402
accepted answer of: http://stackoverflow.com/q/28824752
upvote count: 3
has body: Since I can't find any documentation on the phaser to make this happen then i simply just make a work around to look like i am able to make the direction of the text to be right align. Here is a simple text var txt = this.game.add.text(10, 10, '0', { font: "21px arial", fill: "#00FF00", align:'right', fontWeight:'bold', }); compute for the new position x of the txt formula : txt.x = contant - txt.width the constant will be a reference point you want to offset according to your positioning so when the variable txt text updated then you can re-position it again using the the new data txt.setText(100); txt.x = 84 - (txt.width);
score: 3
answers question: http://stackoverflow.com/q/28824752
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/46528520
has text: Bradgnar, that's not true. bookmarklets can be inject javascript into any page including Gmail.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29124135
type: AnswerComment

http://stackoverflow.com/comment/46008135
type: AnswerComment
comment on: http://stackoverflow.com/a/28871167
score: 0
type: Comment
has text: Nice idea! I absolutely forgot about this way. But I should make too much changes in code, to do it in this way(

http://stackoverflow.com/comment/46026164
has text: @geocodezip basically I want to know if it is possible. I see documentation centring maps based CountryName like [here](https://developers.google.com/maps/documentation/javascript/examples/geocoding-simple?csw=1) but CountryCode is not working, also the _zoom_ is not automatically set to show the whole Country.
comment on: http://stackoverflow.com/q/28880990
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/comment/45878712
comment on: http://stackoverflow.com/q/28802343
score: 0
type: Comment
type: QuestionComment
has text: @ctt thank you, simple reading comprehension error on my part. all is working now.

http://stackoverflow.com/a/28876220
score: 3
downvote count: 0
has body: Change plusCell.Attributes.Add("onclick", "onClickTd()"); and add this js function. function onClickTd { window.location.assign('/Add.aspx'); }
upvote count: 3
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28876104
answers question: http://stackoverflow.com/q/28876104
type: Answer

http://stackoverflow.com/q/28841261
linked to: http://stackoverflow.com/q/5094233
upvote count: 1
accepted answer: http://stackoverflow.com/a/28845265
has title: Fancybox iframe not working when called via javascript function
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28841372
tagged with: fancybox-2
type: Question
has answer: http://stackoverflow.com/a/28841372
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28845265
tagged with: fancybox
score: 1
has body: I tried calling iframe in a fancybox, but it is not working. Here is what I wrote: var paramsFancy={ 'transitionOut': 'elastic', 'transitionIn': 'elastic', 'speedOut': 300, 'speedIn': 500, 'autoScale': true, 'centerOnScroll': true, 'autoDimensions': true, 'href' : '/index.php' }; $.fancybox.open(paramsFancy); I read the people comments from Open fancybox from function but nothing works for me. Can anyone please help?

http://stackoverflow.com/q/28829265
tagged with: javascript
has title: dynamical made dropdowns lists, how I use active class on each dropdown when chose any of the list
score: 0
tagged with: jstl
answer count: 1
tagged with: jsp
has answer: http://stackoverflow.com/a/28829590
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: My JSTL tags code is below: &lt;ul class="megamenu skyblue"&gt; &lt;!--1st level of categories --&gt; &lt;c:forEach var="item1" items="${shoppingCart.categories}"&gt; &lt;li id="headerCategory" class="grid" style="border-right: 1px solid #e5edec;"&gt; &lt;a class="inactive color1" href="#"&gt;${item1.name}&lt;/a&gt; &lt;div class="megapanel"&gt; &lt;div class="row"&gt; &lt;fmt:parseNumber var="i" type="number" value="${item1.id}" /&gt; &lt;c:forEach var="item2" items="${shoppingCart.subcategories}"&gt; &lt;c:if test="${item2.parentCategory.id==i}"&gt; &lt;div class="col1"&gt; &lt;div class="h_nav"&gt; &lt;h4&gt; &lt;a href="#" onclick="dispProductCategoryWise('${item2.name}','${item2.id}')"&gt;${item2.name}&lt;/a&gt; &lt;/h4&gt; &lt;ul&gt; &lt;fmt:parseNumber var="j" type="number" value="${item2.id}" /&gt; &lt;c:forEach var="item3" items="${shoppingCart.subcategories}"&gt; &lt;c:if test="${item3.parentCategory.id==j}"&gt; &lt;li&gt; &lt;a href="#" &gt; &amp;#9830;${item3.name} &lt;/a&gt; &lt;/li&gt; &lt;/c:if&gt; &lt;/c:forEach&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/c:if&gt; &lt;/c:forEach&gt; &lt;%-- &lt;img src="${pageContext.request.contextPath}${item1.image}" alt=""/&gt; --%&gt; &lt;/div&gt; &lt;/div&gt;&lt;/li&gt; &lt;/c:forEach&gt; &lt;/ul&gt; My JavaScript code is below:- $(document).on('click', '#headerCategory', function(){ alert("hello"); $('a.inactive').toggleClass('inactive active'); //$(this).toggleClass('active inactive'); }); And css is :- .skyblue li a.active{ background:#EF5F21; color: #ffffff; } .skyblue li a.inactive{ background:0; color: 0; } When i run above piece of code, all the dropdown menu is active.But i want how only selected-dropdown will be highlighted. Help me for highlighted the select dropdown list.
type: Question

http://stackoverflow.com/a/28788202
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28787404
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45852206
has comment: http://stackoverflow.com/comment/45852150
accepted answer of: http://stackoverflow.com/q/28787404
has body: not in is the negative containment check. In this specific instance, it's checking that the object in uus is not contained in the container returned by m.keys().

http://stackoverflow.com/q/28752451
score: 0
answer count: 1
tagged with: ruby
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28752564
tagged with: ruby-on-rails
has title: Tracking when users click on a download link
has body: I have a application that allows user to download the latest builds of an application. I need to record whenever a user clicks on a link. I have create a UserVersions model that tracks this data. But I'm not sure how to make the call, via javascript or some rails utility to create a new record. I have an idea of how to do it using jquery. But I'm not sure how to get the version_id for each link. config/routes.rb post 'user_versions/create/:user_id/:version_id', to: 'user_versions/#create' app/controllers/user_versions_controller.rb class UserVersionsController &lt; ApplicationController def create user = params[:user_id] version = params[:version_id] UserVersion.find_or_create_by(user: user, version: version) end end app/view/version/_full.html.erb ... &lt;li class="download cols-lg-4 pull-right"&gt; &lt;% if (version.app[:app_type] == 'ios') %&gt; &lt;%= button_to 'Download', "itms-services://?action=download-manifest&amp;url=#{CGI::escape version.plist_url}", class:"btn-primary btn-small pull-right" %&gt; &lt;% else %&gt; &lt;%= button_to 'Download', version.plist_url, class: 'download-btn btn-primary btn-small pull-right', method: :get %&gt; &lt;% end %&gt; &lt;/li&gt; ... app.js.erb ... $('.download-btn').on('click', function(){ $.ajax({ type: 'POST', url: "/user_versions/create/" + current_user[:id] +"/" + :version_id" }); });
type: Question
tagged with: javascript

http://stackoverflow.com/comment/45885118
type: AnswerComment
score: 0
has text: This is a copy of his code, just a online example using it.. well minus the have to copy n paste to w3
type: Comment
comment on: http://stackoverflow.com/a/28792734

http://stackoverflow.com/q/28864360
has answer: http://stackoverflow.com/a/28864497
has body: i am looking for create a regular exp in JavaScript to look for patterns like ${.............}. Lets say if have string like { "type" : "id", "id" : ${idOf('/tar/check/inof/high1')}, "details" : [ { "name" : "Sanio", "sig" : "DA123QW" }, { "name" : "Tarer", "sig" : "BAWE3QW" }, { "name" : "Kadek", "sig" : "KSWE2J" }, ] }, So i am searching for all patterns having ${whateverhere} i am trying with var pathRegExp = /\$(.*)\}/; But it is not ending at "}" symbol.
has answer: http://stackoverflow.com/a/28864487
downvote count: 0
tagged with: javascript
tagged with: string
has title: Reg Exp for string in Javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/28864487
tagged with: regex
answer count: 4
tagged with: node.js
has answer: http://stackoverflow.com/a/28864484
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28864573
has comment: http://stackoverflow.com/comment/45993999
upvote count: 1
possible better answer: http://stackoverflow.com/a/28864484
type: Question
score: 1
has comment: http://stackoverflow.com/comment/45993920

http://stackoverflow.com/q/28790984
type: AnsweredQuestion
upvote count: 0
has body: myData = {"a1":"tom","a2":"dick","a3":"harry"}; D1 D2 D3 I use: $.each( myData, function( key, value ) { $( "#" + key ).text( value ); }); to load json values into the div's with corresponding id's. But I now want to move the div content to the corresponding json values like so: myData.a1 = $( "#a1" ).text(); which does result in: {"a1":"D1","a2":"dick","a3":"harry"}; But I need a $.each function to iterate over the collection similar to my loading function. Any ideas? Maybe a JSFiddle?
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/28791048
type: Question
has comment: http://stackoverflow.com/comment/45857204
tagged with: javascript
has answer: http://stackoverflow.com/a/28791079
accepted answer: http://stackoverflow.com/a/28791079
score: -1
possible better answer: http://stackoverflow.com/a/28791023
has answer: http://stackoverflow.com/a/28791023
downvote count: 1
tagged with: jquery
favorite count: 0
has title: Needing $.each function to alter json string
has answer: http://stackoverflow.com/a/28791027
answer count: 4

http://stackoverflow.com/a/28873866
has body: See below snippet - here I do the same - zooming together, but degrouping the objects in case somebody clicks on it. The problem to get to original object properties can be solved, ungrouping the group and creating copies of them and reattaching - a bit annoying, but the only solution I found. &lt;script id="main"&gt; // canvas and office background var mainGroup; var canvas = this.__canvas = new fabric.Canvas('c'); fabric.Object.prototype.transparentCorners = false; fabric.Object.prototype.originX = fabric.Object.prototype.originY = 'center'; createOnjects(canvas); // events - zoom $(canvas.wrapperEl).on('mousewheel', function(e) { var target = canvas.findTarget(e); var delta = e.originalEvent.wheelDelta / 5000; if (target) { target.scaleX += delta; target.scaleY += delta; // constrain if (target.scaleX &lt; 0.1) { target.scaleX = 0.1; target.scaleY = 0.1; } // constrain if (target.scaleX &gt; 10) { target.scaleX = 10; target.scaleY = 10; } target.setCoords(); canvas.renderAll(); return false; } }); // mouse down canvas.on('mouse:up', function(options) { if (options.target) { var thisTarget = options.target; var mousePos = canvas.getPointer(options.e); if (thisTarget.isType('group')) { // unGroup console.log(mousePos); var clone = thisTarget._objects.slice(0); thisTarget._restoreObjectsState(); for (var i = 0; i &lt; thisTarget._objects.length; i++) { var o = thisTarget._objects[i]; if (o._element.alt == "officeFloor") continue; else { if (mousePos.x &gt;= o.originalLeft - o.currentWidth / 2 &amp;&amp; mousePos.x &lt;= o.originalLeft + o.currentWidth / 2 &amp;&amp; mousePos.y &gt;= o.originalTop - o.currentHeight / 2 &amp;&amp; mousePos.y &lt;= o.originalTop + o.currentHeight / 2) console.log(o._element.alt); } } // remove all objects and re-render canvas.remove(thisTarget); canvas.clear().renderAll(); var group = new fabric.Group(); for (var i = 0; i &lt; clone.length; i++) { group.addWithUpdate(clone[i]); } canvas.add(group); canvas.renderAll(); } } }); // functi…
answers question: http://stackoverflow.com/q/28863678
type: Answer
downvote count: 1
score: -1
upvote count: 0
has comment: http://stackoverflow.com/comment/46012532

http://stackoverflow.com/a/28867205
has body: var spans = document.getElementsByTagName('span'); span[0] is the first span, span[1] is the second span. However it's not the preferred way to do this. Use jQuery to make it easier or add an id or classname
upvote count: 2
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/28867110

http://stackoverflow.com/a/28839694
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/55174849
downvote count: 0
has body: The Embed API does not currently support a sign out feature, but you should be able to accomplish this manually by calling the underlying gapi.auth.signOut() method yourself. Note there may be some weirdness if you try to log back in without refreshing the page (I'm not sure because I haven't tested this fully). Update (11/10/2015): The Embed API's auth component now officially supports a signOut method, so you can just use that instead.
has comment: http://stackoverflow.com/comment/55206142
type: Answer
has comment: http://stackoverflow.com/comment/55341323
accepted answer of: http://stackoverflow.com/q/28836533
has comment: http://stackoverflow.com/comment/55199512
score: 7
upvote count: 7
has comment: http://stackoverflow.com/comment/55174146
has comment: http://stackoverflow.com/comment/55310747
answers question: http://stackoverflow.com/q/28836533
has comment: http://stackoverflow.com/comment/45950981

typeahead
type: Tag
tags question: http://stackoverflow.com/q/28827395
tag name: typeahead

sapui5
tags question: http://stackoverflow.com/q/28837560
tags question: http://stackoverflow.com/q/28750755
tag name: sapui5
tags question: http://stackoverflow.com/q/28827702
type: Tag
tags question: http://stackoverflow.com/q/28838767
tags question: http://stackoverflow.com/q/28800924
tags question: http://stackoverflow.com/q/28900004

http://stackoverflow.com/q/28839832
type: UnansweredQuestion
upvote count: 1
score: 1
tagged with: segment
type: Question
tagged with: uri
answer count: 1
tagged with: url
downvote count: 0
tagged with: javascript
favorite count: 0
has body: How can I get URI components in AngularJS? For example I have http://domain.com/photo/1 So how can I get that second segment (=1) to a variable in angular? Thank you.
linked to: http://stackoverflow.com/q/736513
has answer: http://stackoverflow.com/a/28839895
tagged with: angularjs
has title: How can I obtain URI components using angular.js

http://stackoverflow.com/a/28852367
downvote count: 0
has comment: http://stackoverflow.com/comment/45971851
type: Answer
score: 1
has body: You can scroll the page to the needed section like so: //find all subpages beforehand var subPages = $('.subpage'), scroll_offset = -10; //if the position of the scroll needs tweaking $('#menu-main-nav').on('click' ,'a', function(e) { e.preventDefault(); $anchor = $(this).attr('href'); //find the needed div var target = subPages.filter(function(){ return $(this).data('url') == $anchor; //this will return the needed div }); //find the target coordinates var position = target.offset(); $('html, body').animate({ scrollTop: position.top + scroll_offset }, 500); }) Can be seen live here: http://jsfiddle.net/L69642ta/ If you don't need to animate to the needed div, simply remove the .animate() and make it like this: ... $('html, body').scrollTop(position.top + scroll_offset); ... Can be seen live here: http://jsfiddle.net/L69642ta/1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28851823
answers question: http://stackoverflow.com/q/28851823
type: AcceptedAnswer

http://stackoverflow.com/q/28830230
type: Question
possible better answer: http://stackoverflow.com/a/28830590
has title: how would i go about adding some paragraphs on the go and show the result to the document with paragraph tags
tagged with: javascript
has comment: http://stackoverflow.com/comment/45930624
has body: I need to add 3 paragraphs tags here straight from the script that prints The same thing that logs on the console &lt;script &gt; var array= [1,2,4]; $.each(array,function (index,value) { console.log(index + ": "+value) }); &lt;/script&gt;
answer count: 3
downvote count: 0
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28830429
has comment: http://stackoverflow.com/comment/45930545
has answer: http://stackoverflow.com/a/28830632
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28830590
score: 1
upvote count: 1
accepted answer: http://stackoverflow.com/a/28830429

http://stackoverflow.com/q/28853616
tagged with: abstraction
type: Question
downvote count: 0
favorite count: 0
has body: I am working on a project where I need to use charts. I am currently using nvd3 with angular. But due to its heavy payload, I will be switching to some other chart library. Now, I want to create an abstraction layer in js which allows me to use any charting library without changing much of code. Now what are the best things that i can include into it to make it awesome? What are few things I should keep in mind before making an abstraction layer. I have never created any abstraction layer. What would be best practices for creating such abstraction layer. I want to use this abstraction layer across angular, backbone and jquery projects too. Thanks.
has title: Best Practices for Creating an abstraction layer for charts library
answer count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: charts
score: 1
tagged with: javascript

http://stackoverflow.com/comment/46008172
score: 0
type: Comment
has text: why don't you use data attribute instead of href like this
type: QuestionComment
comment on: http://stackoverflow.com/q/28872668

http://stackoverflow.com/q/28866249
upvote count: 0
has comment: http://stackoverflow.com/comment/45997415
tagged with: php
has body: This might sound a bit dumb, but how did they get the slider : http://demosthenes.info/blog/757/Playing-With-The-HTML5-range-Slider-Input#volume That number (%) updates instantaneously to the movement of your mouse when you slide the dot. I was wondering for my own 'learning purposes' how that is possible since with the same code that they provide on my website, it won't work... ;) Thnx! UPDATE My code: Volume 50%
accepted answer: http://stackoverflow.com/a/28866364
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28866325
has comment: http://stackoverflow.com/comment/45997483
tagged with: live
has answer: http://stackoverflow.com/a/28866364
type: Question
has answer: http://stackoverflow.com/a/28866358
downvote count: 2
possible better answer: http://stackoverflow.com/a/28866268
score: -2
has answer: http://stackoverflow.com/a/28866268
tagged with: javascript
tagged with: instant
has title: I want my JavaScript on my php/html website to update live and instantaneously
has comment: http://stackoverflow.com/comment/45997391
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45997538
answer count: 4
favorite count: 0

http://stackoverflow.com/comment/46058231
comment on: http://stackoverflow.com/q/28899286
score: 0
type: Comment
type: QuestionComment
has text: `$("[class*='timelineplace']").on("click","select", function() { var object = $(this); alert(object.attr("class").match(/timelineplace-(.*?)(?:\s+|$)/)[1]); });` btw

datetimepicker
type: Tag
tag name: datetimepicker
tags question: http://stackoverflow.com/q/28795079
tags question: http://stackoverflow.com/q/28808502

http://stackoverflow.com/q/28779144
tagged with: iframe
type: Question
has answer: http://stackoverflow.com/a/28779495
tagged with: javascript
score: 0
answer count: 1
tagged with: asp.net
has body: i created a popup menu in iframe i want to open that popup menu one time whenever user clicks on remaining links in the navigation but not at home page after filling that popup menu it must redirect to user clicked page... i am not getting any idea please help me to write code here i am pasting some code please help anyone ` above code is opening for each link for every time but i want to get open only one time whenever user clicks other than home button
type: UnansweredQuestion
has title: Displaying POP up menu only one time whenever user clicks other than homebutton
has comment: http://stackoverflow.com/comment/45835937

http://stackoverflow.com/comment/45850154
score: 0
has text: @AhmedHassan — Then you have to do something to display it **when you click a button**.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28787026

http://stackoverflow.com/comment/46236458
comment on: http://stackoverflow.com/a/28950696
type: AnswerComment
score: 0
type: Comment
has text: Yes, please post complete code that shows the dependencies :-)

http://stackoverflow.com/a/28764371
answers question: http://stackoverflow.com/q/28762180
has comment: http://stackoverflow.com/comment/111310835
has body: Select2 API v3.x (sortResults) You can sort elements using sortResults callback option with String.localeCompare(): $( '#mylist' ).select2({ /* Sort data using localeCompare */ sortResults: data => data.sort((a, b) => a.text.localeCompare(b.text)), }); United States Austria Alabama Jamaica Taiwan canada palau Wyoming Select2 API v4.0 (sorter) You can sort elements using sorter callback option: $('#mylist').select2({ sorter: data => data.sort((a, b) => a.text.localeCompare(b.text)), }); United States Austria Alabama Jamaica Taiwan canada palau Wyoming Without jQuery I had another general purpose approach (you can use value or an attribute for sorting elements) without using jQuery: var select = document.getElementById("mylist"); var options = []; // Get elements to sort document.querySelectorAll('#mylist > option').forEach( option => options.push(option) ); // Empty select while (select.firstChild) { select.removeChild(select.firstChild); } // Sort array using innerText (of each option node) options.sort( (a, b) => a.innerText.localeCompare(b.innerText) ); // Add the nodes again in order for (var i in options) { select.appendChild(options[i]); } United States Austria Alabama Jamaica Taiwan canada palau Wyoming With jQuery Thanks @Narendra Sisodia for jQuery tip: /* Get options */ var selectList = $('#mylist > option'); /* Order by innerText (case insensitive) */ selectList.sort( (a, b) => a.innerText.localeCompare(b.innerText) ); /* Re-do select HTML */ $('#mylist').html(selectList); United States Austria Alabama Jamaica Taiwan canada palau Wyoming
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 56
has comment: http://stackoverflow.com/comment/96365065
upvote count: 56
has comment: http://stackoverflow.com/comment/96366216
accepted answer of: http://stackoverflow.com/q/28762180

http://stackoverflow.com/a/28763572
upvote count: 1
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: as p tag is added dynamically, you need to use event delegation: $("#additional-room").on('click','a',function(e) { e.preventDefault(); $(this).parent().remove(); numAdd--; if (numAdd &lt; 1) $("#additional-room").hide(""); }); Working Demo
score: 1
accepted answer of: http://stackoverflow.com/q/28763551
has comment: http://stackoverflow.com/comment/45806429
answers question: http://stackoverflow.com/q/28763551

http://stackoverflow.com/a/28781119
type: Answer
has body: In index.html there is no element &lt;a&gt; with rel='colorbox'.
answers question: http://stackoverflow.com/q/28780761
has comment: http://stackoverflow.com/comment/45885321
score: 0
has comment: http://stackoverflow.com/comment/45885292

http://stackoverflow.com/comment/45840845
type: AnswerComment
score: 0
type: Comment
has text: Powers of -1 was the concept I was trying to remember. :D
comment on: http://stackoverflow.com/a/28761799

http://stackoverflow.com/comment/45838742
has text: Marios version worked better, you where first to answer, however when clicking the previous button once you reach the end it takes 3 clicks for the previous button to work. Not sure if its my browser or the code tho.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28780885
type: Comment

http://stackoverflow.com/a/28782782
accepted answer of: http://stackoverflow.com/q/28782074
has comment: http://stackoverflow.com/comment/62541067
answers question: http://stackoverflow.com/q/28782074
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45852741
has comment: http://stackoverflow.com/comment/45868525
has comment: http://stackoverflow.com/comment/45843803
type: Answer
has comment: http://stackoverflow.com/comment/68196820
has comment: http://stackoverflow.com/comment/45843206
has body: NOTE: Not 100% Cross Browser Check browser compatibility @ http://caniuse.com/#search=FileReader as you will see people have had issues with the not so common browsers, But this could come down to the version of the browser.. I always recommend using something like caniuse to see what generation of browser is supported... This is only a working answer for the user, not a final copy and paste code for people to just use.. The Fiddle: http://jsfiddle.net/d2atnbrt/3/ THE HTML CODE: &lt;input type="file" id="my_file_input" /&gt; &lt;div id='my_file_output'&gt;&lt;/div&gt; THE JS CODE: var oFileIn; $(function() { oFileIn = document.getElementById('my_file_input'); if(oFileIn.addEventListener) { oFileIn.addEventListener('change', filePicked, false); } }); function filePicked(oEvent) { // Get The File From The Input var oFile = oEvent.target.files[0]; var sFilename = oFile.name; // Create A File Reader HTML5 var reader = new FileReader(); // Ready The Event For When A File Gets Selected reader.onload = function(e) { var data = e.target.result; var cfb = XLS.CFB.read(data, {type: 'binary'}); var wb = XLS.parse_xlscfb(cfb); // Loop Over Each Sheet wb.SheetNames.forEach(function(sheetName) { // Obtain The Current Row As CSV var sCSV = XLS.utils.make_csv(wb.Sheets[sheetName]); var oJS = XLS.utils.sheet_to_row_object_array(wb.Sheets[sheetName]); $("#my_file_output").html(sCSV); console.log(oJS) }); }; // Tell JS To Start Reading The File.. You could delay this if desired reader.readAsBinaryString(oFile); } This also requires https://cdnjs.cloudflare.com/ajax/libs/xls/0.7.4-a/xls.js to convert to a readable format, i've also used jquery only for changing the div contents and for the dom ready event.. so jquery is not needed This is as basic as i could get it, EDIT - Generating A Table The Fiddle: http://jsfiddle.net/d2atnbrt/5/ This second fiddle shows an example of generating your own table, the key here is using sheet_to_json to get the data in the correct format for JS use.. …
has comment: http://stackoverflow.com/comment/62539370
has comment: http://stackoverflow.com/comment/45843674
has comment: http://stackoverflow.com/comment/45843459
has comment: http://stackoverflow.com/comment/45843169
downvote count: 1
upvote count: 40
has comment: http://stackoverflow.com/comment/45843283
score: 39
has comment: http://stackoverflow.com/comment/68183452
has comment: http://stackoverflow.com/comment/45868535
has comment: http://stackoverflow.com/comment/62539209
has comment: http://stackoverflow.com/comment/45843490

http://stackoverflow.com/q/28886998
has answer: http://stackoverflow.com/a/28887122
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28887066
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28887099
has title: Remove div based on child element using JQuery
accepted answer: http://stackoverflow.com/a/28887066
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28887121
has answer: http://stackoverflow.com/a/28887121
answer count: 4
has body: I have a list of divs similar to the following: I'd like to remove the div which has data-card-uid="THIS ONE" How can I do this? I understand you can use .remove() to remove the corresponding div but I'm not sure how to select the appropriate one.
favorite count: 0
upvote count: 2

http://stackoverflow.com/a/29055057
has comment: http://stackoverflow.com/comment/46368480
has comment: http://stackoverflow.com/comment/46366863
score: 3
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28839901
downvote count: 0
has comment: http://stackoverflow.com/comment/46358979
answers question: http://stackoverflow.com/q/28839901
has body: @bobdye's example doesn't work because &lt;div&gt; elements aren't "focusable" by default. You can force this behaviour by assigning a tabindex property to the div, here is a fiddle. HTML &lt;div class="defocus"&gt;.::.:.:.::.&lt;/div&gt; &lt;div class="defocus"&gt;:..:.:.:..:&lt;/div&gt; &lt;div class="defocus"&gt;.::.:.:.::.&lt;/div&gt; You add the class="defocus" attribute to any element that needs to blur after x seconds. CSS (relevant) div:active { color:lightcoral; } JavaScript (function () { window.addEventListener("load", function () { var seconds = 0.15 * 1000; var defocused = document.getElementsByClassName("defocus"); for (var i = 0, l = defocused.length; i &lt; l; i++) { var el = defocused[i]; el.style.outline = 0; //optional el.setAttribute("tabindex", -1); el.addEventListener("mousedown", blur); } function blur(e) { var el = e.target; setTimeout(function (el) { el.blur(); }, seconds, el); } }); })(); First we wrap this function in a seaf just as a commodity (it will prevent the blur function and variables from being accessible). Then we get all the elements with a defocus class. Then we iterate over them. First we eliminate the focus outline some browsers use because it looks ugly in a div, but it's up to you. Then we set a tabindex="-1". Using -1 as an index prevents it from acting as a tab break point but allows it to recieve focus and blur events. Finally we add the blur() function to the mousedown event which will defocus de element after x seconds. Then we define the blur() function which will take care of defocusing the element with a setTimeout(). That's it, hope it helps! Note: I don't particularly care for the bounty, keep your rep! Note: Thanks to @Adam for pointing out that seaf's variables need the var prefix to prevent them from being global.
type: Answer
upvote count: 3

http://stackoverflow.com/comment/45978387
type: Comment
has text: No reason, just to unlock the page until response is received, synchronous requests may temporarily lock the browser.
comment on: http://stackoverflow.com/a/28856149
type: AnswerComment
score: 0

http://stackoverflow.com/a/28890121
score: 2
answers question: http://stackoverflow.com/q/28874761
has body: I updated my version of ui-grid to the "pre-beta" 3.x and now I'm at the same point you are. Using 'showGridFooter' set to true will show total rows info automatically. Specifying a 'footerTemplate' doesn't do anything. I've tried with both 'showGridFooter' and 'showFooter' present and absent. So the following paragraph of my answer only works for the 2.x "stable" version of ui-grid. Wierdly, showFooter property needed set to true. What worked for me is to add an html file to my project that contained a div full of goodies (like you were thinking). Seems like a bug. showGridFooter property didn't work for me. $scope.gridOptions1 = { showFooter: true, footerTemplate:'somePath/footerTemplate.html' }
downvote count: 0
upvote count: 2
type: Answer

http://stackoverflow.com/q/28902898
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
has body: I combined 2 examples which I found on the Internet, unfortunately I must be doing something wrong as only a part is draw in Jsfiddle Through these 2 example I wanted to learn how to create a DateSlider. Can somebody please point me to my errors? The first example comes from https://blog.smalldo.gs/2013/04/google-chart-tools-walkthrough-part-3/#add-to-dashboard The second example comes from interactive charts google.setOnLoadCallback(drawChart); function drawChart() { var dashboard = new google.visualization.Dashboard(document.getElementById('programmatic_dashboard_div')); var data = new google.visualization.DataTable(); data.addColumn('number', 'Drie'); data.addColumn('string', 'Name'); data.addColumn('date', 'Date'); data.addColumn('number', 'Donuts eaten'); data.addColumn('number', 'Hours Worked'); data.addRows([ [33333333,'Michael', new Date(2012,0,2),1,9], [33333,'Elisa', new Date(2012,0,3),7,8], [3,'Robert', new Date(2012,0,4),9,10], [3,'John', new Date(2012,0,5),7,8], [3,'Jessica', new Date(2012,0,6),3,5], [3,'Aaron', new Date(2012,0,6),7,4], [3,'Margareth', new Date(2012,0,7),7,3] ]); // We omit "var" so that programmaticSlider is visible to changeRange. programmaticSlider = new google.visualization.ControlWrapper({ 'controlType': 'NumberRangeFilter', 'containerId': 'programmatic_control_div', 'options': { 'filterColumnLabel': 'Donuts eaten', 'ui': {'labelStacking': 'vertical'} } }); programmaticChart = new google.visualization.ChartWrapper({ 'chartType': 'PieChart', 'containerId': 'programmatic_chart_div', 'options': { 'width': 300, 'height': 300, 'legend': 'none', 'chartArea': {'left': 15, 'top': 15, 'right': 0, 'bottom': 0}, 'pieSliceText': 'value' } }); dashboard.bind(programmaticSlider, programmaticChart); //Create a DataView from the data_table var dataView = new google.visualization.DataView(data); //Set the first column of the dataview to format as a string, and return the other columns [1, 2 and 3] dataView.setColumns([{calc: function(data, row) { r…
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28948236
has comment: http://stackoverflow.com/comment/46080051
type: Question
has title: dataview with multiple controls
tagged with: google-apps-script
score: 0
has comment: http://stackoverflow.com/comment/46084848
tagged with: google-visualization
answer count: 1

http://stackoverflow.com/a/29015252
has body: Needed to add this in my code behind app.Application.Products.IsaDetails.IsaTransfers.Clear();
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28806484
answers question: http://stackoverflow.com/q/28806484
score: 0

http://stackoverflow.com/a/28860959
answers question: http://stackoverflow.com/q/28860345
accepted answer of: http://stackoverflow.com/q/28860345
type: AcceptedAnswer
type: Answer
score: 0
has body: Do do this cleanly, I'd consider prototyping the global Array object and adding a method to push values but only if they're unique to the array. Something like this: Array.prototype.pushUnique = function (item) { if (this.indexOf(item) != -1) { console.log("Item with value of " + item + " already exists in the array." } else { this.push(item); } } If you're not comfortable prototypeing global types like Array, you can build the same thing in a procedural pattern: function arrayPushUnique (arr, item) { if (arr.indexOf(item) != -1) { console.log("Item with value of " + item + " already exists in the array." } else { arr.push(item); } } Then to use it, simply create a new empty array and start pushing things to it. var numCent = []; // The Array.prototype method numCent.pushUnique(number); // The procedural method arrayPushUnique(numCent, number);

http://stackoverflow.com/comment/46012410
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28875012
has text: str_pad worked for me Melon tell me about this function thanks but how to do this in javascript?

http://stackoverflow.com/comment/45802817
score: 0
has text: yes, i mean "The same(duplicate values)"
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28761277

http://stackoverflow.com/comment/45805635
type: Comment
comment on: http://stackoverflow.com/q/28762687
has text: Does it work if you remove $sanitize?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45840161
type: Comment
has text: Obviously for _localhost_ I suppose the same server of the application... not the machine on which the site is viewed.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28781697

http://stackoverflow.com/comment/45944667
type: Comment
comment on: http://stackoverflow.com/a/28836425
type: AnswerComment
score: 0
has text: I have added some pseudo code to my question to make it more clear as to what I am after.

http://stackoverflow.com/q/28837875
score: 2
type: AnsweredQuestion
has body: I have a weird jquery effect using .effect("shake").My span which is the effect applied to moves in front of the element that contains it and when the effect is over it returns back to it's original position <?php ?> <a href="<?=base_url()?>home">Home All Products Shopping Cart<?=count($ses)?> My Account Sign Up Contact Us <?=form_open_multipart(base_url().'products/search')?> <img src="<?=base_url()?>images/search.png" width="20" height="17" id="searchslika"/> css: #menu_area{ width:1000px; height:50px; } #menu{ margin:0; padding:0; line-height:35px; list-style:none; float:left; position:relative; } #menu li{ display:block; float:left; } #menu a{ text-decoration:none; padding:8px; margin:5px; color:#444; font-weight:bold; } bootstrap badge class: .badge{ display:inline-block; min-width:10px; padding:3px 7px; font-size:12px; font-weight:700; line-height:1; color:#fff; text-align:center; white-space:nowrap; background-color:#777; border-radius:10px} js: $("#badgemessage").effect("shake",{distance:1,times:1});
has comment: http://stackoverflow.com/comment/45946721
type: Question
has answer: http://stackoverflow.com/a/28839522
has comment: http://stackoverflow.com/comment/45946394
has title: jquery shake effect with bootstrap issue
tagged with: javascript
answer count: 1
downvote count: 0
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28839522
favorite count: 0
upvote count: 2
tagged with: twitter-bootstrap
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/q/28774117
has body: I'm testing a Django site using Selenium. I have added a function to report javascript errors via Google Analytics, how can I write a test that checks that when there is a javascript error an AJAX call is made to Analytics?
tagged with: selenium
tagged with: django
answer count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/29833438
tagged with: testing
tagged with: javascript
type: UnansweredQuestion
has title: How to see the result of an AJAX in Python and Selenium
score: 1
favorite count: 0
type: Question
upvote count: 2

http://stackoverflow.com/a/28797910
score: 0
type: Answer
has body: there is a comma at end of password: { required: true, midlength: 5, equalTo: "#verify", }, that break js execution
answers question: http://stackoverflow.com/q/28797882

http://stackoverflow.com/q/28824478
type: Question
has answer: http://stackoverflow.com/a/32021489
has comment: http://stackoverflow.com/comment/45948077
score: 0
answer count: 1
tagged with: reader
tagged with: javascript
type: UnansweredQuestion
has body: I'm trying to get books to display based on the assignment above but can't figure out what is wrong for the life of me. I built the service and modified the controller and view pages to the point where I believe they should display the books in the view, but I'm just seeing a blank page. I feel like I am probably not retrieving the data properly and accessing it in the view/html. Any ideas? Link to jsFiddle. Index.html Reader js/apps.js var app = angular.module('ReaderApp', ['ngRoute']); app.config(function($routeProvider){ $routeProvider .when('/books', { controller: 'BookshelfController', templateUrl: 'views/bookshelf.html' }) .otherwise({ redirecTo: '/books' }); }); js/services/books.js app.factory('books', ['$http', function($http) { return $http.get('https://s3.amazonaws.com/codecademy-content/courses/ltp4/books-api/books.json') .success(function(data) { return data; }) .error(function(err) { return err; }); }]); js/controllers/BookshelfController app.controller('BookshelfController', ['$scope', 'books', function($scope, books) { books.success(function(data) { $scope.myBooks = data; }); }]); js/views/bookshelf.html {{ book.title }} by {{ book.author }}
has comment: http://stackoverflow.com/comment/45919886
has title: Books Won't Display for Reader App Exercise
tagged with: angularjs-ng-repeat
tagged with: angularjs

http://stackoverflow.com/a/28854815
type: Answer
has body: &lt;exec failonerror="true" executable="haxe"&gt; &lt;!-- arg line="-lib polygonal-core -lib createjs" /--&gt; &lt;arg value="-js" /&gt; &lt;arg line="-cp aha/" /&gt; &lt;arg file="${buildDir}" /&gt; &lt;arg line="HelloWorld" /&gt; &lt;/exec&gt; This will find the class I'm trying to access, I forgot to add the class path i.e -cp aha/ this aha/ folder contains my HelloWorld.hx and the class name is HelloWorld.
answers question: http://stackoverflow.com/q/28853154
score: 0

http://stackoverflow.com/comment/46028219
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28883285
has text: Yeah indeed, thanks for reminding, sometimes in code lines belgium is coming back :(
type: AnswerComment

http://stackoverflow.com/comment/45839973
type: QuestionComment
has text: You should use a timer to determine whether to change the last character in the input or add a new one. That way if you click two times and writes a "b" and then you want to add an "a", you just wait a second or two and the timer by then will have ended and the script would add another char.
comment on: http://stackoverflow.com/q/28781353
score: 0
type: Comment

http://stackoverflow.com/a/28903723
has comment: http://stackoverflow.com/comment/46069978
has body: You have to include the jQuery library if you are going to use it. Add this to your head section and you should be fine.
type: Answer
accepted answer of: http://stackoverflow.com/q/28903277
has comment: http://stackoverflow.com/comment/46067199
score: 0
answers question: http://stackoverflow.com/q/28903277
type: AcceptedAnswer

http://stackoverflow.com/q/28871240
tagged with: phpmailer
has comment: http://stackoverflow.com/comment/46005871
has comment: http://stackoverflow.com/comment/46007101
has comment: http://stackoverflow.com/comment/46005943
has title: How to execute php script in background process?
tagged with: sql
answer count: 0
has comment: http://stackoverflow.com/comment/46006122
has comment: http://stackoverflow.com/comment/46007189
has comment: http://stackoverflow.com/comment/46007079
type: Question
tagged with: http://stackoverflow.com/tag/html
has body: I am developing a mail sending module in php; where I will be fetching email id from database and will send a message to that email id. I will also be updating database with the information I sent in mail and also will display delivered information. My Problem: It takes more time to send mail; so until mail is not sent the database does not get updated and the delivered information is also not displayed; So, I planned to run mailing functionality in background process and I came across this piece of code which was similar; but I am unable to understand it. Would any one help me? shell_exec("/path/to/php /path/to/send_notifications.php '".$post_id."' 'alert' &gt;&gt; /path/to/alert_log/paging.log &amp;")
tagged with: php
score: 0
has comment: http://stackoverflow.com/comment/46007196
has comment: http://stackoverflow.com/comment/46005828
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/comment/45929070
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28828728
type: Comment
has text: Updated my answer. please check

http://stackoverflow.com/q/28879027
tagged with: php
has title: HTML File doesnt update with PHP and JQuery .load()
answer count: 0
score: 0
has body: Please help, this really made me stuck. I have HTML file "newsfeed.html" that loads onto another page using JQuery .load() and I have PHP file "ajax_fetch_posts.php". My HTML file uses XMLHTTPREQUEST Object to fetch data from my PHP file, my problem begun when I noticed that everytime I update my HTML file code and HIT refresh on my browsers reload, that page doesn't change at all, whatever I do it keeps on displaying the same all over and over again. I also tried to clear my browser cache or cookies but it's useless. Is this some sort of tag? or header() in php? It seemed my page being kept as cached copy or is this some sort of virus? Here is my html code so far: this is an example Here's JavaScript: $(document).ready(function() { var xhr = new XMLHttpRequest(); var form = new FormData(); form.append('EmailAd', EmailAd); form.append('UserID', UserID); form.append('Studentnumber', Studentnumber); xhr.open('POST', 'ajax/ajax_fetch_post.php', true); xhr.onload = function() { var div_shout_handle = document.getElementById('div_shout_handle'); div_shout_handle.innerHTML = this.response; } xhr.send(form); }); PHP File: <?php include '../include/class.inc.php'; $array_post = array(); if($_SERVER['REQUEST_METHOD'] == 'POST') { $pdo = new dbConnection; $pdo->dbInstance($db); $stmt = $db->prepare("SELECT * FROM posts"); $stmt->setFetchMode(PDO::FETCH_ASSOC); $stmt->execute(); while($row = $stmt->fetch()) { array_push($array_post, $row['Content']); } echo json_encode(array('Posts' => $array_post)); } ?> Please help, this probably sound so easy.
has comment: http://stackoverflow.com/comment/46019944
has comment: http://stackoverflow.com/comment/46020010
type: Question
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46046048
has comment: http://stackoverflow.com/comment/46046030
type: UnansweredQuestion

http://stackoverflow.com/comment/45863386
score: 0
type: QuestionComment
has text: For cleaning up, bluebird provides `.dispose()`.
type: Comment
comment on: http://stackoverflow.com/q/28794251

http://stackoverflow.com/q/28879005
has body: In angularjs I have made sure to register a service like this, inside the services directory inside modules -> module_name angular.module('module_name').factory('service_name', [ function() { // Public API console.log('hello'); return { someMethod: function() { return true; } }; } ]); from this Error: Unknown provider: employeesProvider &lt;- employees i found removing the ngController solves the issue, but I am trying to render a view that must have a controller to render some model data. If i remove that ngController, i get no data. What do i do?
score: 1
type: Question
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/18284793
has title: Error: [$injector:unpr] Unknown provider: someProvider <- SomeService
answer count: 1
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/29442262

http://stackoverflow.com/q/28890704
accepted answer: http://stackoverflow.com/a/28890763
type: Question
tagged with: indexof
tagged with: javascript
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/28890763
type: AnsweredQuestion
has title: Remove element if anchor uses Javascript: void(0)
has body: Home About Services if ($('.slicknav_item').attr('href').indexOf('javascript: void(0)') > 0) { $('.slicknav_item span').remove(); } Using the above code, I'm trying to find anytime ".slicknav_item" contains "javascript: void(0)" as the href, and remove the element ".slicknav_item span" but ONLY from that specific "slicknav_item" element. It doesn't seem to be giving me any results. I am worried the problem is the "javascript: void(0)"? The problem for me is that the "javascript: void(0)" is the only thing that separates it from the other links. Any advice?
score: 0

http://stackoverflow.com/comment/45974233
type: Comment
has text: No problem, i've started using knockoutjs lately and i noticed it can get messy very fast, especially with the mapping-plugin...
type: AnswerComment
comment on: http://stackoverflow.com/a/28853232
score: 0

http://stackoverflow.com/comment/45950458
type: Comment
has text: It works perfectly in Chrome 40.0.2214.115 m.(**Edit**: and Firefox 35.0.1, and IE11)
comment on: http://stackoverflow.com/q/28840461
score: 0
type: QuestionComment

http://stackoverflow.com/q/28861784
score: 0
has comment: http://stackoverflow.com/comment/45990413
answer count: 1
tagged with: jquery
has title: How to format returned json response from servlet using jquery ajax
tagged with: ajax
has answer: http://stackoverflow.com/a/28870944
has comment: http://stackoverflow.com/comment/45989106
accepted answer: http://stackoverflow.com/a/28870944
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46003711
tagged with: forms
type: Question
has body: I am trying to present the list of users returned from servlet called using jquery ajax. The first script block works perfectly well but could not pass the form parameters like text and dropdown list value but presents the list of users returned from server in well formatted list. The script that formats the response but cannot pass the form parameters to servlet . $(document).ready(function() { $("form").submit(function(){ alert("form submitted"); $.get('SearchUserServlet', function(responseJson) { alert(responseJson); alert("inside the servlet"); var $ul = $('&lt;ul class="list-group"&gt;').appendTo($('.well')); $.each(responseJson, function(index, item) { $('&lt;li class="list-group-item"&gt;&lt;strong&gt;').text(item).appendTo($ul); }); }); }); }); The second script i tried passes the form parameters properly to the servlet but the response returned from the servlet does not get formatted like the first script does. Below is the second script var form = $('#SearchForm'); form.submit(function(){ type: form.attr('method'),url: form.attr('action'),data: form.serialize(), success: function(responseJson) { alert(responseJson); alert("inside the servlet"); var $ul = $('&lt;ul class="list-group"&gt;').appendTo($('.well')); $.each(responseJson, function(index, item) { $('&lt;li class="list-group-item"&gt;&lt;strong&gt;').text(item).appendTo($ul); }); }); }); please help me find the problem in the two scripts so that i can pass the form parameters as well get the response formatted in proper list. Please review and advice.
tagged with: javascript
tagged with: servlets

http://stackoverflow.com/comment/46068231
type: QuestionComment
has text: Besides the slight height difference, what is wrong with your current code?
score: 0
comment on: http://stackoverflow.com/q/28904398
type: Comment

continuous-integration
tags question: http://stackoverflow.com/q/28816374
tag name: continuous-integration
type: Tag

http://stackoverflow.com/comment/45905709
has text: If you're trying to check for a single case of any of one- or two-character operators, use the "alternation" operation `|`.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28816861
type: Comment

http://stackoverflow.com/a/28889840
score: 1
answers question: http://stackoverflow.com/q/28889720
upvote count: 1
has body: Your a element is not part of the DOM (Document Object Model) yet, hence a.click() will not "do" much. Within your doExportMap() function, just after the a.click(); bit, try the following: document.getElementById("exportMapForm").appendChild(a); Now it is part of the DOM, and will work as expected. It is in your "exportMapForm" for now, but you can append it anywhere you like ;)
type: Answer
downvote count: 0

http://stackoverflow.com/comment/46070795
type: Comment
has text: As understand it, POST should only be used if the call changes the state of the server, like updating a database. Since I am just sending an email, GET seems appropriate.
comment on: http://stackoverflow.com/a/28905389
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46014997
has text: Regarding that potential duplicate - please read beyond the top voted accepted answer - indeed note that that answer itself points you to one of the others.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28876300
score: 0

http://stackoverflow.com/q/28817846
favorite count: 0
has title: Building a page that allows YouTube Search using YouTube API
has comment: http://stackoverflow.com/comment/45910163
type: UnansweredQuestion
has body: What's wrong here? I am new to JavaScript and working with APIs. Any advice is greatly appreciated. I want the page to simply search youtube for the searchTerm and return matching videos to the console and add them to the Document. Here's my HTML and JS. HTML: &lt;body&gt; &lt;form id="search-term"&gt; &lt;input type="text" name="input" id="query" placeholder="Enter YouTube search here" /&gt; &lt;label for="input"&gt;&lt;input type="submit" class="submit" value="Submit" /&gt;&lt;/label&gt; &lt;/form&gt; &lt;div id="search-results"&gt; &lt;/div&gt; JS: $(document).ready(function(){ $(function () { $('#search-term').submit(function(event){ event.preventDefault(); var searchTerm = $('#query').val(); getRequest(searchTerm); }); }); function getRequest(searchTerm){ var params = { part: 'snippet', key: 'AIzaSyBCaDivrcL_ivWRsuA_rw-UWH0Xr9K0iLQ', q: searchTerm, // r: 'json' }; url = 'https://www.googleapis.com/youtube/v3/search'; $.getJSON(url, params, function(data){ showResults(data.Search); }); } function showResults (results) { var html = ""; $.each(results, function(index, value) { html += '&lt;p&gt;' + value.Title + '&lt;/p&gt;'; console.log(value.Title); }); $('#search-results').html(html); } });
downvote count: 0
tagged with: youtube-api
tagged with: youtube
type: Question
has comment: http://stackoverflow.com/comment/45907794
has answer: http://stackoverflow.com/a/28821108
score: 1
tagged with: javascript
tagged with: api
upvote count: 1
linked to: http://stackoverflow.com/q/26975365
answer count: 1

http://stackoverflow.com/q/28851949
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/28851996
has answer: http://stackoverflow.com/a/28852068
answer count: 3
has title: using (this) with dynamic content jQuery
has body: I have trouble understanding the addition of dynamic content with jQuery. My code will prepend items to a list and when you click an item on that list, the contents of that item should be visible. At the moment, when I click an item, the contents of all items are displayed. I tried adding (this) but that doesn't work. $(document).ready(function() { var hidden = true; $("#add").click(function() { var item = $("#name").val(); var date = $("#date").val(); if(item == "") { return false; } var prependItem = "&lt;li class='new'&gt;"+ "&lt;button class='btn btn-default' id='check'&gt;&lt;/button&gt;"+ "&lt;span class='item'&gt;&amp;nbsp;"+item+"&lt;/span&gt;"+ "&lt;ul class='sub'&gt;"+ "&lt;li&gt;"+ "Due date: 5/3/2015"+ "&lt;/li&gt;"+ "&lt;/ul&gt;"+ "&lt;/li&gt;"; $(".todo").prepend(prependItem); $(".sub").hide(); $(".form")[0].reset(); return false; }); // show sub content $(".todo").on("click", ".item", function() { if(hidden == true) { $(".sub").show(); hidden = false; } else { $(".sub").hide(); hidden = true; } }); $(".todo").on("click", "#check", function() { // line through }) });
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28851996
score: 2
possible better answer: http://stackoverflow.com/a/28851990
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/28851990
favorite count: 0

http://stackoverflow.com/q/28772366
has comment: http://stackoverflow.com/comment/45952237
has title: Selenium IDE Selecting drop down box item in infopath
answer count: 0
tagged with: javascript
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/45950015
has comment: http://stackoverflow.com/comment/45987613
tagged with: infopath2010
has comment: http://stackoverflow.com/comment/46238805
tagged with: selenium-ide
has comment: http://stackoverflow.com/comment/45955432
has comment: http://stackoverflow.com/comment/45910486
score: 0
tagged with: selenium
has body: I am trying to get selenium to select items from a infopath dropdown list box I have a simple test infopath form with a single dropdown list box listing car makers. I record the steps using selenium of opening the form, selecting a car maker and submitting the form and it runs correctly. When I go to play back the test suite I get the following from the log [info] Playing test case Untitled [info] Executing: |open | /Tdata/Car%20makers/Forms/AllItems.aspx | | [info] Executing: |clickAndWait | id=idHomePageNewItem-WPQ2 | | [info] Executing: |select | id=FormControl_V1_I1_D1 | label=volvo | [error] Option with label 'volvo' not found [info] Test case failed [info] Test suite completed: 1 played, 1 failed When I inspect the element using firebug I see the following <select style="direction:ltr" title="" tabindex="0" originalid="V1_I1_D1" formid="FormControl" viewdatanode="2" direction="ltr" wrapped="true" class="k_CL3j7VgxtmnkG4un_0 b_CL3j7VgxtmnkG4un_0 o_CL3j7VgxtmnkG4un_0 z_CL3j7VgxtmnkG4un_0" scriptclass="DropDownList" id="FormControl_V1_I1_D1" onblur="return (DropDownList.OnBlur(this, event));" onfocus="return DropDownList.OnFocus(this, event));" onchange="return (DropDownList.OnChange(this, event));"> in firebug there is plus sign next to this if I click on it I can then see the options Select... Ford fiat GM datsun volvo and my selenium script will run correctly if I press this plus sign before running the script. So I am thinking that this is created by Javascript. I tried SelectandWait in selenium and this didn't work. How would I get selenium to trigger the Javascript to create the dropdown box list, so it can then be selected?

http://stackoverflow.com/q/28783813
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28784258
has comment: http://stackoverflow.com/comment/45844080
tagged with: jquery
has comment: http://stackoverflow.com/comment/45844164
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/28783873
has comment: http://stackoverflow.com/comment/45844232
has body: HTML: Home Art Photography Drawing Painting Film Blog About Contact jQuery/CSS: $('#menu_bar div').css("display","inline"); This jquery puts each div horizontally but I want the .art a tags to be organised vertically so it ends up looking like this: I have tried adding this: $('.art').css("display","block"); But this makes the menu look like this: Which is not what I want. Please see the JSFiddle of my attempt Edit: I have also tried: $('.art a').css("display","block"); Which has ended up making it look like this: Getting closer... Edit 2: Thank you @Paulie_D is there anyway to prevent this gap (that I highlighted red):
accepted answer: http://stackoverflow.com/a/28783873
has answer: http://stackoverflow.com/a/28784167
type: Question
type: AnsweredQuestion
has title: How to add vertical divs inside horizontal divs
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28784258

http://stackoverflow.com/comment/45936337
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28833403
has text: `data:value` not `data:data`

http://stackoverflow.com/comment/45868824
has text: Well your string is invalid.
score: 1
comment on: http://stackoverflow.com/q/28797199
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28773934
has comment: http://stackoverflow.com/comment/45826377
tagged with: html-lists
score: 0
has comment: http://stackoverflow.com/comment/45826488
has answer: http://stackoverflow.com/a/28774434
has title: .slideup() removing entire ul instead of just the nested li
has comment: http://stackoverflow.com/comment/45828548
has comment: http://stackoverflow.com/comment/45827024
accepted answer: http://stackoverflow.com/a/28832015
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28774434
has answer: http://stackoverflow.com/a/28832015
type: Question
tagged with: slideup
answer count: 2
has body: Having a few issues with this badboy: Basically need it so that when one of the hidden lists collapses the markup is checked to see if there are any other 'active' lists already open, and to close those before a new one is opened. It looks messy if more than one is open at the same time. Link: http://www.matchboxlondon.com/ten/menu3/index.html Try: 1. Click Menu 2. Click Services 3. Click Pilates to expand 4. Click Fitness to expand Problem: Heading is also removed when .slideup() is used. What my code is doing at the moment is checking to see if anything is opened with a globally defined variable called 'somethingOpen' - this is set to null on page load. This is all well and good BUT I feel it may have something to do with the complete display:none of the collapsable lists: Because it's listy and nesty, I'll only include the js in here and not the markup: somethingOpen = null; // to set after close and open $('#cssmenu &gt; ul &gt; li &gt; a').click(function () { if (somethingOpen === true) { // first check $("#cssmenu &gt; ul &gt; li").each(function () { $("#cssmenu &gt; ul &gt; li.active").removeClass('active').slideUp(); // &lt;-- problem here somethingOpen = false; // closing so set to false return false; // exit function }); } // End somethingOpen if // Open var checkElement = $(this).next(); // more checks $(this).closest('li').addClass('active'); // add active class somethingOpen = true; // redefine if anything is open // Close if ((checkElement.is('ul')) &amp;&amp; (checkElement.is(':visible'))) { $(this).closest('li').removeClass('active'); checkElement.slideUp('normal'); somethingOpen = false; } if ((checkElement.is('ul')) &amp;&amp; (!checkElement.is(':visible'))) { $('#cssmenu ul ul:visible').slideUp('normal'); checkElement.slideDown('normal'); } // Returns if (checkElement.is('ul')) { return false; } else { return true; } }); // End click
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/28846187
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
tagged with: css
has title: JQuery carousel track looping
has answer: http://stackoverflow.com/a/28847089
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28847089
score: 3
downvote count: 0
type: Question
has body: I am having trouble making the images inside the slider loop around. I want track to loop around from either sides after they are hidden. here is the the jsfiddle for what I have now. http://jsfiddle.net/V2x6s/3/ Here's Javascript setInterval(function() { var left1 = parseInt($('#track1').css('left')), left2 = parseInt($('#track2').css('left')), left3 = parseInt($('#track3').css('left')); if ($('#left1').is(":hover")) { $('#track1').css('left', left1+2); } else if ($('#left2').is(":hover")) { $('#track2').css('left', left2+2); } else if ($('#left3').is(":hover")) { $('#track3').css('left', left3+2); } else if ($('#right1').is(":hover")) { $('#track1').css('left', left1-2); } else if ($('#right2').is(":hover")) { $('#track2').css('left', left2-2); } else if ($('#right3').is(":hover")) { $('#track3').css('left', left3-2); } }, 10); .slider { position: relative; background-color: #ccc; height: 150px; margin: 10px; padding: 10px; overflow: hidden; } .track { position: absolute; top: 10px; left: 10px; margin: 0; padding: 0; border: 0; width: 2000px; } .book { float: left; margin: 0; margin-right: 10px; padding: 0; border: 0; width: 150px; height: 150px; -webkit-transition: opacity 0.2s; -moz-transition: opacity 0.2s; -ms-transition: opacity 0.2s; -o-transition: opacity 0.2s; -webkit-transition: opacity 0.2s; } .book:hover { opacity: 0.5; } .book:nth-child(1) { background-color: #ff0000; } .book:nth-child(2) { background-color: #ffaa00; } .book:nth-child(3) { background-color: #ffff00; } .book:nth-child(4) { background-color: #00ff00; } .book:nth-child(5) { background-color: #0000ff; } .book:nth-child(6) { background-color: #aa00ff; } .book:nth-child(7) { background-color: #ff00ff; } .left, .right { position: absolute; color: white; font-size: 48px; top: 57px; cursor: pointer; z-index: 1; } .left { left: 0; } .right { right: 0; } &lt;div class="slider"&gt; &lt;div id="left1" class="left"&gt;&amp;lt;&lt;/div&gt; &lt;div id="right1" class="right"&gt;&amp;gt;&lt;/div&gt; &lt…
answer count: 1
tagged with: javascript
tagged with: jquery
upvote count: 3

http://stackoverflow.com/q/28773870
has comment: http://stackoverflow.com/comment/45826246
has body: I'll admit it. The idea of callbacks does not make sense to me right way. I am trying to implement one for my program right now as my variable remains unaltered after modifying it inside of a function. function getMessage(callback) { setTimeout(function() {callback(setupAddress(ownerPickupAddressItem)); }, 0); } getMessage(function(ownerPickupAddressItem) { console.log(ownerPickupAddressItem); }); function setupAddress(ownerPickupAddressItem) { ownerPickupAddressItem = $('.timeline-item.active-item &gt; .timeline-status &gt; .pickup-address').text(); } I've tested the above and ownerPickupAddressItem is still undefined. Any idea why?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28774042
has comment: http://stackoverflow.com/comment/45826128
has title: Using callbacks to deliver a message once available
has comment: http://stackoverflow.com/comment/45826226
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/45826274
tagged with: javascript
has comment: http://stackoverflow.com/comment/45826249
score: 0
has answer: http://stackoverflow.com/a/28773992
accepted answer: http://stackoverflow.com/a/28773992
possible better answer: http://stackoverflow.com/a/28774042

http://stackoverflow.com/comment/45943447
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28836425
has text: Maybe your question lacks in detail or is too board to answer? People will answer the best they can and this fits the question asked. If you want to expand the question then maybe you should think about your question before posting it? Give a real example or display your attempts and maybe people will have something worth working with.
score: 1

http://stackoverflow.com/comment/45950960
has text: Use `indexOf`, example: `var zips = ["11111", "12345", "12345"]` and check `if (zips.indexOf(value.zip) > -1)`
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28840809

http://stackoverflow.com/a/28760439
has comment: http://stackoverflow.com/comment/45801154
type: Answer
has comment: http://stackoverflow.com/comment/74644875
upvote count: 4
answers question: http://stackoverflow.com/q/28760345
downvote count: 0
score: 4
has body: You can simplify your code: $(document).ready(function () { $('.input_control').change(function () { $('input[name=' + this.value + ']')[0].disabled = !this.checked; }).change(); }); Demo: http://jsfiddle.net/t5qdvy9d/1/
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28760345

http://stackoverflow.com/q/28885612
tagged with: logic
type: AnsweredQuestion
has title: Random Number Game, Trouble with Min and Max
accepted answer: http://stackoverflow.com/a/28885671
type: Question
score: 0
has body: I'm trying to write a random number game in JavaScript, but I'm having a lot of trouble with getting the random number to actually generate something in between min and max if they're changed. This is what I have so far: var min = 1, max = 10; function randomNumber() { var val; do { val = Math.round(Math.random() * max); } while (val&lt;=(min - 0.5)); return val; } However, if I change min and max, the numbers just don't really work out. I'd appreciate any help, thanks.
tagged with: random
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28885671

http://stackoverflow.com/q/28839406
answer count: 1
downvote count: 0
tagged with: tomcat
favorite count: 0
has answer: http://stackoverflow.com/a/28851668
has comment: http://stackoverflow.com/comment/45970135
tagged with: spring
score: 1
tagged with: java
tagged with: maven
type: Question
type: AnsweredQuestion
has body: I imported a project for Eclipse that uses Spring MVC and maven and performed in Tomcat 8 and get this error in the browser when I try to load a javascript file in the JSP page: GET http://localhost:8080/edp-data/ext/src/app/application.js?_dc=1425406963138 net::ERR_CONTENT_LENGTH_MISMATCH I've tried to correct in various ways with various solutions of the Internet, changing the server.xml tomcat, permission of files and folders and several other attempts without success. Could anyone help me? Thank's!
tagged with: javascript
has title: net::ERR_CONTENT_LENGTH_MISMATCH - Failed load javascript
upvote count: 1
accepted answer: http://stackoverflow.com/a/28851668

http://stackoverflow.com/comment/46144785
has text: @evermean Resize selected `element `, `font-size` , or both ?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28923014
type: Comment

http://stackoverflow.com/a/28890818
downvote count: 0
score: 1
has body: Javascript is run on the client, so I don't think this is going to possible. Anything that you need to be kept secret is going to need to be server side.
answers question: http://stackoverflow.com/q/28890783
upvote count: 1
has comment: http://stackoverflow.com/comment/100494754
type: Answer

http://stackoverflow.com/q/28849659
has answer: http://stackoverflow.com/a/28850002
has answer: http://stackoverflow.com/a/28849767
downvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/28850002
tagged with: javascript
score: -1
answer count: 2
accepted answer: http://stackoverflow.com/a/28849767
upvote count: 0
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has title: Random image appear when website is loaded
has body: I have 2 pictures for my website, and i want it to load one of them whem the website loads. I have tried using some javascript. But i am quite new to all this. This is how i am think i want to make it. &lt;div class="image"&gt; Show one of 2 images here. &lt;/div&gt; &lt;script&gt; var r = Math.floor(Math.random() * 100) + 1; if(r &lt; 51) { SHOW IMAGE 1 } else { SHOWIMAGE 2 } &lt;/sccript&gt; So i was hoping someone could teach me how to actually turn this into functional code. Thanks.
type: AnsweredQuestion

http://stackoverflow.com/comment/45961077
type: QuestionComment
type: Comment
has text: Make an Ajax call to the url? Look for the string in the returned current? Which part are you having difficulty with?
comment on: http://stackoverflow.com/q/28846146
score: 0

http://stackoverflow.com/a/33575696
type: Answer
has body: You need to use following code on change function of datapicker $scope.$apply( function(){ $scope.varible = date; } );
answers question: http://stackoverflow.com/q/28870039
score: 0

http://stackoverflow.com/q/28821488
has comment: http://stackoverflow.com/comment/45931817
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/45954505
tagged with: overlay
upvote count: 1
has answer: http://stackoverflow.com/a/28842794
downvote count: 1
type: AnsweredQuestion
has title: Is it possible to remove a portion of a CSS hover overlay when hovering over a child element?
type: Question
has answer: http://stackoverflow.com/a/28822499
possible better answer: http://stackoverflow.com/a/28821682
accepted answer: http://stackoverflow.com/a/28842794
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28821682
favorite count: 0
score: 0
has body: I am faking an image map by using CSS Image Map Generator. When the user hovers over the outer image, I want the entire image to darken a little and have a border appear around the hot spots. When they hover over a hotspot, I want that hotspot to be undarkened. Is this even possible? This image shows a box containing an image of a product interface - removed for security purposes - inside it (via CSS background-image). The user is not hovering over it right now. No visible hotspots, no image overlay. This image shows a user hovering over a portion of the "outer" image. The image has a transparent overlay (black, 45% opacity) applied and the image map hotspots become visible. This image shows a user hovering over a hotspot. When they hover over the hotspot, I'd like the hotspot area of the parent hover overlay to be removed. Is that possible? I'll accept any demonstrable solution. Javascript/jQuery is fine. HTML: CSS: .map_image { display: block; width: 200px; height: 596px; position: relative; border: 1px solid gray; } .map_image .map_link { display: block; position: absolute; text-indent: -999em; overflow: hidden; border: 2px solid orange; } .map_image #map_link_0 { top: 106px; left: 20px; } .map_image #map_link_1 { top: 106px; left: 79px; } .map_image #map_link_2 { top: 106px; left: 138px; } .map_image #map_link_3 { top: 160px; left: 20px; } .map_image #map_link_4 { top: 160px; left: 79px; } .map_image #map_link_5 { top: 160px; left: 138px; } .map_image #map_link_6 { width: 30px; height: 27px; top: 0px; right: 0px; } .map_image #map_link_7 { width: 196px; height: 27px; top: 33px; left: 0px; } .map_image #map_link_8 { bottom: 2px; left: 6px; } .map_image #map_link_9 { bottom: 2px; left: 43px; } .map_image #map_link_10 { bottom: 2px; left: 80px; } .map_image #map_link_11 { bottom: 2px; left: 117px; } .map_image #map_link_12 { bottom: 2px; left: 155px; } #map_link_8, #map_link_9, #map_link_10, #map_link_11, #map_link_12 { height: 30px; width: 30px;} #map_link_0, #map…
answer count: 3

http://stackoverflow.com/q/28846722
favorite count: 0
upvote count: 4
linked to: http://stackoverflow.com/q/7627113
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45964445
downvote count: 0
has answer: http://stackoverflow.com/a/28846912
type: Question
has answer: http://stackoverflow.com/a/28846862
accepted answer: http://stackoverflow.com/a/28846862
tagged with: javascript
score: 4
answer count: 2
possible better answer: http://stackoverflow.com/a/28846912
has body: If possible, I'd like to display JavaScript console output in a log window that I developed for my application. There's a lot of solutions for posting messages to the console, but I couldn't find any that let you capture the console output. I'm not even sure if this is possible. Is console output stored in an object at some level of the DOM? Thanks in advance for any hints/suggestions.
has comment: http://stackoverflow.com/comment/45964594
has title: Is there a way to capture JavaScript console output so I can reference it elsewhere?

http://stackoverflow.com/comment/45988403
comment on: http://stackoverflow.com/a/28861114
type: AnswerComment
score: 0
type: Comment
has text: I'm very glad to have helped! :)

http://stackoverflow.com/comment/46030693
comment on: http://stackoverflow.com/a/28882543
score: 0
has text: Thanks! but is there any alternative way to do it?
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28827942
score: 2
answers question: http://stackoverflow.com/q/28827670
downvote count: 0
has body: If you don't want to use the buffer as an image source, the only option left is to parse the raw buffer yourself. Just have in mind that this buffer contains the unprocessed (raw) file, so by parsing it means low-level byte parsing (using a DataView). It's doable but you need to handle all aspects of parsing JPEG files such as header, format areas, decompressing and decoding any kind of image buffers (RGB, CMYK, YUV etc.), validation and error handling. However, this can be unpractical unless you intend to use special aspects of the JPEG file such as retrieving for example raw CMYK data. So the only practical way, if you want to avoid using a JavaScript parser, is to convert your ArrayBuffer to Base-64 (going by a view such as Uint8Array), prepend it with a data-uri header, and then set it as src for an Image object. Better yet, just set the URL as image source directly and let the browser parse and decode the file. There are essentially only two ways to get image data into canvas: using an image source which can be Image, Video, Canvas or a context. Writing raw pixel data using ImageData objects. For the latter you need to get the bitmap from somewhere, usually another or the same canvas, or from an external source in form of raw uncompressed bitmap data, or a file you pass on to the browser to process, or you process using the low-level approach mentioned earlier (both cases require CORS requirements to be fulfilled). Sorry, there are no other ways.. You can still draw the JPEG image to canvas and then extract the image data (pixels): context.drawImage(image, x, y); // image to canvas var imageData = context.getImageData(x, y, width, height); // get ImageData object var uint8clampedarray = imageData.data; // get the 8-bit view var arraybuffer = uint8clampedarray.buffer; // the raw byte buffer
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45926568
has comment: http://stackoverflow.com/comment/45927464
type: Answer
accepted answer of: http://stackoverflow.com/q/28827670
has comment: http://stackoverflow.com/comment/45926466

http://stackoverflow.com/q/28862592
type: AnsweredQuestion
has title: javascript FOR don't change class
has answer: http://stackoverflow.com/a/28886033
accepted answer: http://stackoverflow.com/a/28886033
type: Question
has body: I'm trying to build a JavaScript function for this code, but when I click: And before: The first div does not change its class. I think the problem is caused by the for loop. Javascript Html inputs <asp:Button ID="Todos" runat="server" Text="Mostrar Todos los empleados" OnClick="TodosEmpleados" /> Html Divs Insertar una fecha Seleccione una Categoría Seleccione un Departamento Inserte un salario desde el que iniciar la búsqueda jsfiddle example
tagged with: for-loop
tagged with: javascript
has comment: http://stackoverflow.com/comment/45990692
has comment: http://stackoverflow.com/comment/46032046
tagged with: class
score: 0
has comment: http://stackoverflow.com/comment/46025506
has comment: http://stackoverflow.com/comment/46032851
has comment: http://stackoverflow.com/comment/46025232
answer count: 1
has comment: http://stackoverflow.com/comment/46032226
tagged with: frontend
has comment: http://stackoverflow.com/comment/46026145

http://stackoverflow.com/comment/45871065
comment on: http://stackoverflow.com/q/28798073
has text: @dfsq Just added it.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45888923
comment on: http://stackoverflow.com/a/28807189
has text: @wagster Yes what you are saying sounds correct but you may be mixing up the types of objects. In JS, _everything_ is an object, including functions, so `function Bird(){}` will create an object of type `Function` with name `Bird` in the current scope. In fact to make it clearer you can write it as `var Bird = function(){}`. At this point, no Birds actually exist, you have just told JS how to create one. If you want an actual `Bird`, you will need to use `var canary = new Bird("Tweety Pie")`. It is _this_ call which will actually run your `Bird` method and give you an object of type `Bird`.
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/45935746
has text: No, if the user you're testing this with is the apps admin/developer/tester, it should theoretically work. But for taking this live, the permissions need to be approved by FB.
score: 1
comment on: http://stackoverflow.com/q/28831870
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/48455649
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28892571
score: 0
has text: Note that this only returns the hostname, not the url.

http://stackoverflow.com/comment/47972808
type: AnswerComment
type: Comment
has text: I'd either update Tracker as a global var on your swipe callbacks, or find a way to not present both experiences to the user. Capability detection? Keeping the tracker accounted for really shouldn't be that difficult now. Can you fire code on a successful swipe? @Obsidian
score: 0
comment on: http://stackoverflow.com/a/29780698

http://stackoverflow.com/comment/45921314
comment on: http://stackoverflow.com/q/28825286
score: 0
has text: Why you don't want to use colobox plugin for this?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28906201
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
tagged with: angularjs
has answer: http://stackoverflow.com/a/28906276
favorite count: 0
possible better answer: http://stackoverflow.com/a/28906268
has body: I am getting to know AngularJS and I am having trouble building the scripts destined to handle all the angular's logic while mixing jQuery's effects and such. So I am doing a simple CRUD "to-dos" app and when I'm deleting a task I'd like to make the task div to fade a way in some fancy way. So this is where the deleteTask method is called: &lt;div class="delete-task glyphicon glyphicon-remove" ng-click="deleteTask(task)"&gt;&lt;/div&gt; And here the definition the angular controller: $scope.deleteTask = function(task) { var index = $scope.tasks.indexOf(task); $scope.tasks.splice(index, 1); }; In this last piece of code, how can I retrieve the div that called the method? I want to know that DOM element so I can apply some effect to the parent div and make it fade away in some pretty manner.
upvote count: 1
has answer: http://stackoverflow.com/a/28906268
has title: Fetch element that fires ng-click
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28906276
type: Question
answer count: 2

http://stackoverflow.com/comment/68196820
has text: Anything specific for IE... Well firstly that is the most broken browser in the world lol.. But it really comes down to your IE version mostly.. Check out http://caniuse.com/#search=FileReader and you can see it requires verson 11 and even then its only partially supported... Just a reminder people, i simply did this answer over a year ago.. All i did was learn the code and make a working example. People, use your browsers console and debug the code if it does not work.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28782782

http://stackoverflow.com/comment/45892152
comment on: http://stackoverflow.com/a/28808513
has text: great, I got your idea and changed my logic abit. it really works. Thanks !
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45854876
comment on: http://stackoverflow.com/a/28789507
score: 2
has text: Holy crap man...thanks so much! I have no idea how that happened. You saved me hours! I feel like a goon. :(
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28875089
has title: Why is my PHP array not posting as an array to JavaScript?
type: AnsweredQuestion
score: 2
downvote count: 0
tagged with: mysql
possible better answer: http://stackoverflow.com/a/28875318
type: Question
has comment: http://stackoverflow.com/comment/46012530
has comment: http://stackoverflow.com/comment/46012666
tagged with: jquery-ui
tagged with: arrays
has comment: http://stackoverflow.com/comment/46012498
tagged with: javascript
has body: This is my first time building my own JavaScript code so not completely up to speed with it yet. I am querying my MySQL database to get all the disabled days so that the results are disabled in the date picker. I nearly have this working but the problem is that only one set of values is being posted to the JavaScript variable when there are two being read from the database. i.e if there are two bookings in my database, one from 6/3/15 - 10/3/15 and one from 14/3/15 - 17/3/15 only one is being stored in the JavaScript variable. i.e 6/3/15 - 10/3/15. When I echo the json_encode($date_list) i get the results as: ["2015-3-14","2015-3-15","2015-3-16","2015-3-17","2015-3-17"] ["2015-3-6","2015-3-7","2015-3-8","2015-3-9","2015-3-10","2015-3-10"] Which is correct but when I do a console.log on the bookedDays variable the only values stored are: ["2015-3-6", "2015-3-7", "2015-3-8", "2015-3-9", "2015-3-10", "2015-3-10"] Below is the code I am using. &lt;?php $bookeddates = "SELECT fromdate, todate FROM messages WHERE listing_id = '".$_GET['listingid']."'"; $resultbookeddates = mysql_query($bookeddates) or die(mysql_error() . "&lt;br&gt;" . $bookeddates); while ($rowbookeddates = mysql_fetch_assoc($resultbookeddates)) { $from = date('Y-n-j', strtotime($rowbookeddates['fromdate'])); $to = date('Y-n-j', strtotime($rowbookeddates['todate'])); $start_time = strtotime($from); $end_time = strtotime($to); $date_list = array($from); $current_time = $start_time; while($current_time &lt; $end_time) { //Add one day $current_time += 86400; $date_list[] = date('Y-n-j',$current_time); } $date_list[] = $to; ?&gt; &lt;script type="text/javascript"&gt; var bookedDays = &lt;?php echo json_encode($date_list); ?&gt;; &lt;/script&gt; &lt;?php echo json_encode($date_list); } ?&gt; Any help would be appreciated.
upvote count: 2
has comment: http://stackoverflow.com/comment/46012942
answer count: 2
has comment: http://stackoverflow.com/comment/46012390
accepted answer: http://stackoverflow.com/a/28875319
has answer: http://stackoverflow.com/a/28875318
favorite count: 0
has comment: http://stackoverflow.com/comment/46013093
has comment: http://stackoverflow.com/comment/46012674
has comment: http://stackoverflow.com/comment/46012639
has answer: http://stackoverflow.com/a/28875319
tagged with: php

http://stackoverflow.com/comment/45844080
has text: You should be rethinking the HTML structure because it's not logical at the moment,
score: 1
comment on: http://stackoverflow.com/q/28783813
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46064172
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28901735
score: 0
has text: Why have you added identifiers to comments, rather than elements?

http://stackoverflow.com/q/28896367
upvote count: 2
has body: HTML: &lt;div id="background_cycler"&gt; &lt;img class="active" src="" alt=""/&gt; &lt;img src="" alt="" /&gt; &lt;img src="" alt="" /&gt; &lt;img src="" alt=""/&gt; &lt;/div&gt; jQuery: var bgImg = [ 'img/bg1.jpg', 'img/bg2.jpg', 'img/bg3.jpg', 'img/bg4.jpg' ]; $("#background_cycler").each(function(index){ $(this).find('img').attr("src", bgImg[index]); }); The above code inserted bg1.jpg into all of my images, where is my mistake? I thought I loop through the bgImg array using each()'s index?
has title: Loop through an array using each jquery
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28896409
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28896409
has comment: http://stackoverflow.com/comment/46052512
favorite count: 0
score: 2

http://stackoverflow.com/a/28772552
has body: OK, thanks for the help, but I found an easy way to accomplish my task using jQuery. The problem was how to validate a form submit button if the length of the child ng-repeat scope.length === 0. But since you cannot access this child scope outside parent scope I just wrote simple jQuery like this and problem is solved: suppQuestCtrl.checkQuestions = function(){ $timeout(function(){ setInterval(function(){ var qLength = jQuery('li#questions-text'); if(qLength.length === 0){ jQuery('#save-button.btn.btn-save').addClass('disabled') } else{ jQuery('#save-button.btn.btn-save').removeClass('disabled') } },500) },500) }; suppQuestCtrl.checkQuestions();
score: 0
has comment: http://stackoverflow.com/comment/45825017
answers question: http://stackoverflow.com/q/28770570
type: Answer
has comment: http://stackoverflow.com/comment/45905928

http://stackoverflow.com/a/28874572
has comment: http://stackoverflow.com/comment/50572062
has comment: http://stackoverflow.com/comment/46011831
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28874481
upvote count: 2
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/50570292
has comment: http://stackoverflow.com/comment/50570778
has comment: http://stackoverflow.com/comment/46020149
has comment: http://stackoverflow.com/comment/46012392
accepted answer of: http://stackoverflow.com/q/28874481
has body: There is no difference. They are just being shown differently in whatever manner you are observing the values. Execute this in both environments: var str = "hi'ee"; var res = str.replace("'", "\\'"); console.log(res); console.log(res.length); You will see that the output is hi\'ee 6 in both cases.

http://stackoverflow.com/comment/45954601
type: Comment
type: QuestionComment
has text: I am not sure what you mean error checking not working, but the second sounds like the correct behavior. A field is marked as incorrect when the required attr is present if empty AND touched (ie edited) and not before. This way the required fields are not marked invalid as soon as the form is presented.
score: 0
comment on: http://stackoverflow.com/q/28842569

http://stackoverflow.com/comment/45808956
has text: Can you show us your HTML?
comment on: http://stackoverflow.com/q/28764989
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45865454
type: QuestionComment
comment on: http://stackoverflow.com/q/28795362
type: Comment
has text: Not working I'm afraid, I need $x variable to be inserted, please be more specific about how to achieve it using ajax
score: 0

http://stackoverflow.com/comment/45961899
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28846495
has text: Thank you, but how could I compare date1.toString() >= 4.5?

angular-strap
tag name: angular-strap
type: Tag
tags question: http://stackoverflow.com/q/28899731

http://stackoverflow.com/comment/46072464
type: QuestionComment
type: Comment
has text: This code could be much much nicer in bluebird. Just saying.
score: 0
comment on: http://stackoverflow.com/q/28905800

http://stackoverflow.com/q/28853717
answer count: 0
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45973972
tagged with: google-chrome
type: Question
tagged with: javascript
upvote count: 1
has title: d3.js chart screen size shrinks when jquery dialog exceeds bottom
favorite count: 0
tagged with: d3.js
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45986339
tagged with: jquery-dialog
has body: I'm having a problem in D3.js chart. There are lots of nodes in chart and everytime we click the node a jquery dialog will appear, showing some information about the node. There are some nodes at the bottom that, when I click one of them, make the jquery dialog exceed the chartsize and the chart automatically shrinks. $('#dialog').dialog("option", "position", { my: "left", at: "right", of: d3.event, offset: "20 40" }); Is there is a solution for this? It occours in Chrome and Safari but not so in Firefox.

http://stackoverflow.com/comment/46020101
comment on: http://stackoverflow.com/a/28878326
type: Comment
has text: @LazyLooser Sorry, I need to check my eyesight. Look at the protocol, it should be file:// NOT file:\\
score: 0
type: AnswerComment

http://stackoverflow.com/q/28764390
has answer: http://stackoverflow.com/a/29503636
favorite count: 0
has answer: http://stackoverflow.com/a/29512473
tagged with: android
tagged with: http://stackoverflow.com/tag/html
has body: I am working on a web application where the user should be abled to sign a document on a tablet. We use the Galaxy Tab 12.2 because the S-Pen has the desired precision. The canvas where i draw on uses listens to the touch events to draw on the canvas. canvas.addEventListener('touchstart', handleStart); canvas.addEventListener('touchmove' , handleMove); The problem here is, that if the user touches the canvas with his fingers, the canvas will draw lines there. Is there a way to differentiate between S-Pen events and 'normal' touch events? I know that on the Surface Pro 3 with Internet Expoler I can handle Pen input different from finger input.
score: 4
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/29512473
has answer: http://stackoverflow.com/a/73730033
tagged with: javascript
upvote count: 4
has title: Using Samsung S-Pen in Canvas
tagged with: canvas
answer count: 3
possible better answer: http://stackoverflow.com/a/29503636
downvote count: 0

http://stackoverflow.com/a/28851957
type: Answer
has comment: http://stackoverflow.com/comment/45988997
score: 0
answers question: http://stackoverflow.com/q/28851220
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28851220
has comment: http://stackoverflow.com/comment/45992782
has body: One problem with your regex is that you are not escaping the decimal point (.) which matches any single character except the newline - documentation is here: https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions I have tried the below which returns an array of content.size and content.price You can try it out and see if it helps you: var firstString = "content.size | price: $content.price"; var regex = /content\.[\S]+/g; var newValue = firstString.match(regex); console.log(newValue); Let me know if it helps you. SO1

http://stackoverflow.com/comment/46051298
comment on: http://stackoverflow.com/a/28894572
score: 0
type: Comment
has text: Can you be more specific, where do you want the string to appear, do you want something like this. `//phoneNumber.innerHTML = contactdetails[this.value]; var previousString = contactdetails.StudyP; previousString = previousString.concat("Henley in Arden College Personname number "); phoneNumber.innerHTML = previousString;`
type: AnswerComment

gmail
type: Tag
tags question: http://stackoverflow.com/q/28818084
tags question: http://stackoverflow.com/q/28889987
tag name: gmail

http://stackoverflow.com/q/28790494
tagged with: css
downvote count: 0
score: 1
has body: I have two modals: one is for login action and another one is for registration action. In login modal there is a link "Not yet registered?" that opens a registration modal. And in registration modal there is a link "Already a member?" that opens a login modal. When login modal is opened I want windows.location to be changed to /login and when registration modal is opened I want windows.location to be changed to /registration. And I want Back and Forward buttons of a browser work correctly, so that they change modals from /login to /registration back and forth. 1) What is the name of this functionality (if it has some standard name)? 2) Do famous frameworks like Bootstrap or http://pgwjs.com/pgwmodal/ or others provide this functionality out of the box? Which one? 3) How can I create that functionality myself?
type: Question
tagged with: modal-dialog
has answer: http://stackoverflow.com/a/28790737
tagged with: javascript
tagged with: jquery
has title: How to change window.location on modal open?
has comment: http://stackoverflow.com/comment/45856242
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/a/28883337
upvote count: 1
has comment: http://stackoverflow.com/comment/46030044
has comment: http://stackoverflow.com/comment/46034606
has body: You're using AJAX calls, which are by default asynchronous - there is NO guarantee whatsoever as to what order the responses come back in. e.g. if you have requests A,B,C, then the response to A might come 20 minutes after the C response, because someone's backhoe severed an optic cable somewhere and caused the A request to take a much longer path to the server than C's. You can switch to synchronous, but that will lock the browser while the requests are pending, which is a bad user experience. You'd be better off simplifying the code. Instead of doing one ajax call per fetch, you should have ONE call, and send over all of the ids you want to fetch. In other words, instead of $.get('getCover.php', {id:1}); $.get('getCover.php', {id:2}); $.get('getCover.php', {id:3}); switch your code over to $.get('getCover.php', {ids:[1,2,3]}); Now it's one single ajax request, one single json response, and within that response, you can order your data however you want.
downvote count: 0
has comment: http://stackoverflow.com/comment/46032401
has comment: http://stackoverflow.com/comment/46032470
type: Answer
has comment: http://stackoverflow.com/comment/46031692
has comment: http://stackoverflow.com/comment/46027953
answers question: http://stackoverflow.com/q/28883238
score: 1

http://stackoverflow.com/comment/45801214
type: Comment
has text: sorry, i handled '/' pattern. but, ' / ' pattern is did't anything, only ' /* ' pattern is working fine. :)
type: AnswerComment
comment on: http://stackoverflow.com/a/28758805
score: 0

http://stackoverflow.com/a/29606504
has body: This might help you completely disable the save button https://crmdynamite.wordpress.com/
type: Answer
answers question: http://stackoverflow.com/q/28767789
score: 0

http://stackoverflow.com/comment/45810968
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28765856
has text: Suggest you create a demo in [plunker](http://plnkr.co/edit/?p=catalogue) that replicates issue. We can't see your controllers to do any debugging

http://stackoverflow.com/q/28785882
tagged with: switch-statement
type: Question
score: -2
answer count: 1
tagged with: javascript
favorite count: 0
downvote count: 2
has body: How do you make this have a result which is an image, not text switch(true){ case (a&gt;b):document.getElementById("result").innerHTML="hey"; break;
has comment: http://stackoverflow.com/comment/45847913
linked to: http://stackoverflow.com/q/6065609
upvote count: 0
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28785946
accepted answer: http://stackoverflow.com/a/28785946
has title: How to add an image in javascript with document.getElementById
tagged with: image

http://stackoverflow.com/a/29415291
has comment: http://stackoverflow.com/comment/79933372
downvote count: 2
accepted answer of: http://stackoverflow.com/q/28782656
has comment: http://stackoverflow.com/comment/112950834
answers question: http://stackoverflow.com/q/28782656
upvote count: 147
has comment: http://stackoverflow.com/comment/70511131
type: AcceptedAnswer
score: 145
has comment: http://stackoverflow.com/comment/52631702
has body: Add the babel-cli and babel-preset-es2015 (aka ES6) dependencies to your app's package.json file and define a start script: { "dependencies": { "babel-cli": "^6.0.0", "babel-preset-es2015": "^6.0.0" }, "scripts": { "start": "babel-node --presets es2015 app.js" } } Then you can simply execute the following command to run your app: npm start If you ever decide to stop using Babel (e.g. once Node.js supports all ES6 features), you can just remove it from package.json: { "dependencies": {}, "scripts": { "start": "node app.js" } } One benefit of this is that the command to run your app remains the same, which helps if you are working with other developers.
type: Answer
has comment: http://stackoverflow.com/comment/79933424
has comment: http://stackoverflow.com/comment/55375194

http://stackoverflow.com/comment/45867481
has text: If you are at the bottom of the page before there is a page update, you scroll down to the new bottom if there is a page update. If you aren't on the bottom before a page update, then you do not scroll down to the latest update.
comment on: http://stackoverflow.com/q/28796432
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45807596
type: Comment
comment on: http://stackoverflow.com/q/28764164
type: QuestionComment
has text: remove this spaces in between : `value = #{mybean.cfTransactionTime}` to `value=#{mybean.cfTransactionTime}` on the `<h:inputText`
score: 0

http://stackoverflow.com/a/28857518
upvote count: 1
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28857417
type: Answer
has body: Do you have to use cookies? Might I suggest using localStorage? Example: localStorage['aVariable'] = 'a Value'; //A week later this will still hold value: alert(localStorage['aVariable'])

http://stackoverflow.com/comment/45820606
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28770894
type: AnswerComment
has text: @ThisSuitIsBlackNot, hum, if you're at the point that post for help on SO, perhaps you should have checked for error messages?

http://stackoverflow.com/a/28887216
score: 0
answers question: http://stackoverflow.com/q/28885337
type: Answer
has body: I wound up having to do a crazy hack to make this work. It's basically a combination of preventDefault() as mentioned above with some other stuff. Because it's a Drupal form if I do form.submit() it would use the 'back' button i have on my form instead of the actual submit causing an obvious problem. So I had to use the actual submit button to do the trigger. This involved basically triggering a second call on the button. The first time shows the overlay then calls the submit again and actually triggers the submit. Here's the code: var submitOpen = true; $('#edit-submit-order').on('click',function(e){ if (submitOpen) { e.preventDefault(); $('#processing-overlay').css('display','block'); submitOpen = false; setTimeout(function(){$('#edit-submit-order').trigger('click')},5); } else { submitOpen = true } });

http://stackoverflow.com/comment/45826096
score: 0
type: AnswerComment
has text: AH took me a few minutes of fiddling with it to understand, thank you for your help!!
type: Comment
comment on: http://stackoverflow.com/a/28773408

http://stackoverflow.com/q/28854253
has comment: http://stackoverflow.com/comment/45975055
has title: Buttons are not shown in jQueryUI Style
has comment: http://stackoverflow.com/comment/45975334
accepted answer: http://stackoverflow.com/a/28854591
has comment: http://stackoverflow.com/comment/45974602
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45975084
tagged with: css
has comment: http://stackoverflow.com/comment/45975239
score: -1
type: AnsweredQuestion
downvote count: 1
type: Question
tagged with: jquery-ui
possible better answer: http://stackoverflow.com/a/28854843
has answer: http://stackoverflow.com/a/28854591
has answer: http://stackoverflow.com/a/28854843
answer count: 2
upvote count: 0
has body: im new to jQueryUI and tested it a bit. Here is my current code: Tools Tools Welcome User XXXXX YYYYYYY Bla bla blub Role Analysis Risk Analysis Here comes the Text. Drag me around As you can see I have already implemented dragable and sizable windows and tabs in the windows. Now I want to add some buttons in the windows . My problem is that every time I am pasting the code from jQuery (http://jqueryui.com/button/) the Buttons are still in the standard HTML-Style and the dragable and sizable functions of my windows are gone. The code which causes this problem is this one. If I don't paste it in the code, everything works fine. $(function() { $( "input[type=submit], a, button" ) .button() .click(function( event ) { event.preventDefault(); }); Has anybody an idea to fix this problem? Thank you in advance!
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/96328051
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28779756
has text: The plain JS version there is not viable for editing/backspacing.
type: Comment

http://stackoverflow.com/comment/45799084
has text: I am not sure can you try this request.getAttribute("Output")!=null. With this condition it will display the text area and value if not null . If null it will display the text area and the value will be empty
comment on: http://stackoverflow.com/q/28759235
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45888975
type: Comment
comment on: http://stackoverflow.com/q/28808077
score: 1
has text: Firstly, this is not going to work. LESS is a preprocessor language that needs to be compiled into CSS (use a server side solution to do this or use CodeKit). Secondly, your IIS is not setup to serve LESS files, hence why you get the "The page you are requesting cannot be served because of the extension configuration" error in the response from the server. Please see http://davidsonsousa.net/en/post/using-webconfig-to-make-your-aspnet-project-accept-css-less
type: QuestionComment

http://stackoverflow.com/a/28816855
has body: According to how you implement this lightbox and based on the code you put into your HTML, it seems as though you have implemented the lightbox incorrectly. First, inside the head tag of your HTML, make sure that you include the CSS and links to the javascript files as follows: Once you have included those files, you should add images to you HTML using the following format ONLY: Image #1 Replace "img/image-1.jpg" with the path to your image. Replace "image-1" with any name that you would like to group your images together with. Make sure that any images that you would like to show together have this same value. Replace "My caption" with what you would like to appear as a caption in the lightbox. Replace "Image #1" with something that you would like to have appear in the HTML. You can add as many anchor (a) tags as you need for each image. Example In the following example, I have two lightbox groups. One will show cars, and the other will show animals: FROGS DOGS My SUV A Toyota Camry
upvote count: 1
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28816660

http://stackoverflow.com/q/28878963
tagged with: jquery
tagged with: deferred
favorite count: 0
has comment: http://stackoverflow.com/comment/46019774
has body: Having a few teething problems with $.deferred, $.when and $.done. I'm calling a method which has a couple of tasks inside on a timer. I'm looking at getting a callback when everything inside this method has completed, including the stuff in timers, so started looking at $.when() and $.done() to achieve this. The problem I am getting is the function is firing before the tasks have completed, immediately as the method is called. So, I started playing with $.deferred and resolve(), but haven't managed to get anything working. Without the timers, I can do it. This is where I call the method: $.when(cover.start()).done(function() { console.log("Cover has started."); }); This is the entire method: return { other: function() {}, start: function() { var dfd = $.Deferred(); el.filter.animate({ "opacity": "0.6", "filter": "alpha(opacity=60)" }, 2000, "easeInOutCirc", function() { el.share.removeClass('fa-spin'); setTimeout(function() { el.share.removeClass('fa-cog').addClass('fa-bars'); },1000); setTimeout(function() { el.scroll.animate({ "opacity": "1", "bottom": "40px" }, 1200, "easeOutBounce", function() { var pulseOptions = { opacity: "0" }; setTimeout(function() { el.scroll.pulse(pulseOptions, { duration : 400, pulses: 3, interval: 500, returnDelay: 800 }); }, 2000); dfd.resolve(); }); }, 2000); return dfd.promise(); }); } } // end return As you can see, after my original attempt failed, I added dfd.resolve() to where I want the callback and tried to return the promise. However, the function still fires too early. Where am I going wrong?
has answer: http://stackoverflow.com/a/28879022
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46019728
accepted answer: http://stackoverflow.com/a/28879022
upvote count: 1
downvote count: 1
tagged with: .when
has comment: http://stackoverflow.com/comment/46020243
type: Question
has answer: http://stackoverflow.com/a/28898257
tagged with: jquery-deferred
has title: jQuery deferred - when multiple timeout tasks have completed
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28898257
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/46019899

http://stackoverflow.com/q/28756444
duplicate of: http://stackoverflow.com/q/119441
has comment: http://stackoverflow.com/comment/45796920
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45793971
answer count: 0
has body: Currently try to highlight the "searched term" found in the "table" by putting the "results found" into a . I get an error of "unexpected string" and with no results. Can some take a look and tell me where I am doing wrong? //string are words in table var str = ("table#id tr td"); //regexp is the word entered in input field var re = $("#search-criteria"); var found = str.match(re); console.log(found); if (found !== "") { //surround word found with span $(found).appendTo($"");} else { //remove all span.s_val if not found $("table#id tr td").children(.s_val).remove; } span.s_val{ background-color:yellow; } apple banana red green ee ana
has comment: http://stackoverflow.com/comment/45794258
type: UnansweredQuestion
has title: Highlight search word by adding span?
linked to: http://stackoverflow.com/q/119441
score: 0

http://stackoverflow.com/a/28850406
type: Answer
has comment: http://stackoverflow.com/comment/45968657
has comment: http://stackoverflow.com/comment/45968882
has comment: http://stackoverflow.com/comment/45969826
has comment: http://stackoverflow.com/comment/45970411
answers question: http://stackoverflow.com/q/28850178
has body: Seems like the href triggered before your click handler. You can try to remove the 'href' from and after console.log(..) add the line: window.location.href = "&lt;your domain&gt;/cycles/report";
score: 0
has comment: http://stackoverflow.com/comment/45972057
has comment: http://stackoverflow.com/comment/45973026
has comment: http://stackoverflow.com/comment/45969348
has comment: http://stackoverflow.com/comment/45968749

http://stackoverflow.com/comment/46042089
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28890444
has text: I've never heard about this before. Thank you!
score: 0

http://stackoverflow.com/comment/45914284
comment on: http://stackoverflow.com/q/28816810
type: QuestionComment
type: Comment
score: 1
has text: @TylerH - the question was answered successfully by just pointing them to a different printing technology that is designed for typographic consistency. This is a technology question and doesn't look like it's primarily opinion-based to me. I voted to reopen (don't understand why people are so quick to jump on closing questions rather than guiding the question to be improved).

http://stackoverflow.com/q/28831815
tagged with: forms
has answer: http://stackoverflow.com/a/28833397
accepted answer: http://stackoverflow.com/a/28833397
type: Question
has title: Button near textfield dont show in form inside a tabpanel
tagged with: javascript
tagged with: extjs
score: 0
has body: Im creating a Form with tabs in Ext-JS 5.0.1. In the first tab i want to put a button near the two first textfields but when i try to insert two items (one textfield and one button) the textfield use 100% of width, not show the fieldlabel and the button dont show too. What im doing wrong? this is my code and a pic of the result. var form_datosdoc = new Ext.form.Panel ({ bodyPadding: 10, defaultType: 'textfield', items: [ { items: [{ layout: "form", items: { fieldLabel: "Representante", xtype: "textfield", name: 'representante' } },{ items: { xtype: 'button', text: 'Click me' } }] }, { fieldLabel: 'Aprobador', name: 'aprobador' }, { xtype: 'datefield', fieldLabel: 'Fecha', name: 'fecha_doc', value: new Date(), //Fecha de hoy maxValue: new Date() //Máxima fecha la de hoy } ] }) var paneltab = new Ext.tab.Panel ({ width: window.innerWidth * 0.95, height: window.innerHeight * 0.88, xtype: 'tabpanel', title: '&lt;bean:message key="label.AGR.analisisgr.documento" /&gt;', tabPosition:'left', textAlign:'right', tabRotation: 0, renderTo: 'contenedor', items: [{ title: 'Datos del documento', tooltip: 'Datos del documento', layout: 'fit', items: [form_datosdoc] },{ title: 'Listado de activos', tooltip: 'Listado de activos + Valoracion CID', html: 'Ejemplo2' },{ title: 'Tipos de activo', tooltip: 'Activos por tipo de activo', html: 'Ejemplo3' },{ title: 'Amenazas', tooltip: 'Listado de amenazas', html: 'Ejemplo4' },{ title: 'Salvaguardas', tooltip: 'Listado de salvaguardas', html: 'Ejemplo5' },{ title: 'Amenazas por riesgo', tooltip: 'Listado de amenazas por riesgo y salvaguardas asociadas', html: 'Ejemplo6' },{ title: 'Activos por riesgo', tooltip: 'Listado de activos por riesgo, amenazas asociadas y salvaguardas asociadas a las amenazas', html: 'Ejemplo7' }] }); Thank you in advance
tagged with: extjs5
answer count: 1
type: AnsweredQuestion

http://stackoverflow.com/comment/45971145
comment on: http://stackoverflow.com/q/28852193
score: 0
type: Comment
type: QuestionComment
has text: share your javascript code also.

http://stackoverflow.com/comment/46072250
type: Comment
comment on: http://stackoverflow.com/a/28901723
has text: @RobertoBahia Using PHP to echo the JSON encoded sting into your javascript is a one way trick. If your issue is getting information from javascript back to PHP, you are going to need to look into making an AJAX call to a PHP processing script.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/53560729
comment on: http://stackoverflow.com/a/31032795
type: AnswerComment
score: 0
has text: Confirmed. Thank you; I don't know how I didn't find that - I just about went mad looking for it. This solves a nagging problem - I can finally remove `ursa` from our code.
type: Comment

http://stackoverflow.com/q/28753411
has title: React: Tagging active component in an array with a CSS class
has answer: http://stackoverflow.com/a/28763494
type: Question
tagged with: reactjs
has body: I am loading a series of sentences into an array Sentences in React. On my front end I have one "active" sentence and after user form input the next sentence in the loaded array should become "active" with a new CSS class attached to it. How would I go about doing this? I understand SentenceList needs to keep track of the active_sentence and the Sentence needs to tell SentenceList has been updated, and when it does it should set the class "active" to the next sentence sequentially. But I'm not sure how to implement it. SentenceList: var SentenceList = React.createClass({ render: function() { var sentences = []; active_sentence = 0; //loop through sentences and push each sentence into array this.props.sentences.forEach(function(sentence) { // increment an index variable here and put an if index === active_sentence statement? //grabs @sentences from Rails sentences.push(&lt;Sentence key={sentence.id} details={sentence} /&gt;) }); return ( &lt;div&gt;{sentences}&lt;/div&gt; ) } }); Sentence: var Sentence = React.createClass({ getInitialState: function() { return { // } }, addBlip: function(e) { var blipBody = this.refs.newBlip.getDOMNode().value; var sentenceId = this.props.details.id; var thisSentenceComponent = this; $.ajax({ url: '/sentences/' + sentenceId + '/blips', type: 'POST', dataType: 'json', data: {blip: {body: blipBody}} }); e.preventDefault(); }, render: function() { //get user input and submit blip and make next sentence "active" var phrase = this.props.details.body; var phrase_display = phrase.split("*"); return ( &lt;div className="blipForm"&gt; {phrase_display[0]} {this.props.details.index} &lt;form onSubmit={this.addBlip}&gt; &lt;input type="text" ref="newBlip" /&gt; &lt;/form&gt; {phrase_display[1]} &lt;/div&gt; ) } });
tagged with: javascript
score: 0
answer count: 1
type: UnansweredQuestion

http://stackoverflow.com/q/28837944
has comment: http://stackoverflow.com/comment/45946404
score: 0
has comment: http://stackoverflow.com/comment/45945811
has title: Simplest way to filter text copied from a web page using JavaScript
answer count: 1
has answer: http://stackoverflow.com/a/28838230
tagged with: clipboard
has comment: http://stackoverflow.com/comment/45946573
accepted answer: http://stackoverflow.com/a/28838230
type: AnsweredQuestion
has body: I have a web page where the text has &amp;shy; characters (= soft hyphens) and other unusual entities mixed in. While these entities are necessary for correct display of the page, I would like to filter them out of text copied from the page to the clipboard. 1) Is this possible with JavaScript? I’m familiar with the onCopy event, but the examples I’ve seen don’t make the copied text available for further processing. 2) If so, what is the simplest way to accomplish it? What I can’t do: a) Change the characters in the web page at the server side. b) Install JQuery or another JS framework just for this one function.
type: Question
has comment: http://stackoverflow.com/comment/45945536
tagged with: javascript

http://stackoverflow.com/q/28892762
tagged with: jquery
linked to: http://stackoverflow.com/q/6794000
has title: Bootstrap 3: Auto-clip affixed side-nav
type: Question
answer count: 1
tagged with: affix
tagged with: twitter-bootstrap-3
score: 0
has body: I've been playing around with this for some time but couldn't manage to get it working or find a similar question here. Here is the fiddle. We have an affixed side navigation containing a variable number of links. When the number of links get big, the side-nav goes beyond the available height. I would like to clip it off vertically based on available height (excluding the footer when it is in the view). I mean a scroll-bar should appear when the items are clipped. Has anyone worked on a similar issue? I would really appreciate if you share your experience. And please let me know if it's not a reasonable design :) I include some code here to make s.o. happy: HTML: Heading Lorem ipsum ... Heading Lorem ipsum ... Contents Heading Heading JS: // activate scrollspy and affix for sidenav $('body').scrollspy({ target: '#sidenav' }); $('#sidenav').affix({ offset: { top: 165 } }) CSS: #sidenav.affix { top: 50px; z-index: 1; width: 212.5px; } #sidenav { margin-bottom: 20px; }
has answer: http://stackoverflow.com/a/28904184
tagged with: javascript
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28904184

http://stackoverflow.com/q/28870999
tagged with: javascript
has comment: http://stackoverflow.com/comment/46005500
answer count: 3
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28872871
has answer: http://stackoverflow.com/a/28871057
tagged with: unit-testing
has title: How can I substitute variable in JS?
type: Question
score: 0
has answer: http://stackoverflow.com/a/28871167
has body: I'm trying to write unit-test. I have a simple module: var Common = module.exports = { unit: { somejQueryFn: function() { $('.selector') /* work with jQuery */ } } } Unit-test code: describe('Test jQuery spec', function(){ var Common = require('common'); it('not working :( ', function(){ //Work. I'm using jsdom, for using jQuery in tests; It's a jQuery instance expect( typeof $ ).toBe('function'); //$ is undefined in somejQueryFn; expect( Common.unit.somejQueryFn() ).toBe( result ); }) }) So, how can I handle it? Any ideas? I have tried using new Function(), but i think that is not a good idea.

http://stackoverflow.com/q/28793110
has comment: http://stackoverflow.com/comment/45861130
favorite count: 0
has body: It's probably more like a theoretical question but still. It is pretty simple to use inline base64 data to pass it in image source parameter. We are doing it like that: &lt;img src="data:image/png;base64,[base64 string]" /&gt;. But what if the data that represented in this base64 string is gzipped? Is there a way to tell the browser about it? It can be simply done when the image is loaded from a HTTP server by adding Content-Encoding: gzip header. But is it possible with the inline method? I couldn't find any information about this. The only solution that I see is use JavaScript to "unbase64" the data, "gunzip" it and then "base64" it again and put it to the src attribute. But it not seem to be a good solution...
has title: <img src="data:... with gzipped file
tagged with: http://stackoverflow.com/tag/html
upvote count: 11
has answer: http://stackoverflow.com/a/28793262
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45860950
has comment: http://stackoverflow.com/comment/45861010
type: Question
tagged with: gzip
has comment: http://stackoverflow.com/comment/45861164
tagged with: base64
tagged with: image
score: 11
answer count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/45975461
type: Comment
comment on: http://stackoverflow.com/q/28847045
score: 0
has text: Some Parse.com SDKs, for example the iOS SDK, do allow you to inherit from the Parse Object base type, and you can then do nice things like myParseClass.keyName = "foo", however this isn't possible in the Javascript SDK.
type: QuestionComment

http://stackoverflow.com/q/28795706
answer count: 1
has comment: http://stackoverflow.com/comment/45866321
type: UnansweredQuestion
tagged with: elliptic-curve
has title: ed25519 ECDH encryption possible and safe?
tagged with: encryption
has answer: http://stackoverflow.com/a/28796082
tagged with: encryption-asymmetric
type: Question
has body: As far as I can see everybody use curve25519 for public/private encryption (ECDH) and ed25519 for signing (ECDSA). This creates double size of keys or some special conversion tricks that may not be safe: https://github.com/dchest/ed2curve-js Is it not possible to use curve ed25519 for both ECDH and ECDSA and have half the key size? Is it not possible to use curve ed25519 for only ECDH? I admit that I have a very limited understanding of ECC so the reason above may be because of security considerations but it is not easy to find any hint about this on the web! NB: I understand that curve25519 can not be used for signing! Benny
tagged with: javascript
score: 0
tagged with: public-key-encryption

http://stackoverflow.com/a/28882662
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28874957
has body: Thanks to the advice from Lars and the solution proposed by nipro, the following works. By adding the following code just above the section that builds the legend, the legend is emptied first before it gets updated: d3.select('#legend') .selectAll('ul') .remove(); // build the map legend var legend = d3.select('#legend') ... And by doing the same for the main map, we can first empty the map before updating it: d3.select("g") .selectAll("path") .remove(); // build the choropleth map var appending = svg.selectAll("g") ... The full working updated code can been seen on bl.ocks.org here.

http://stackoverflow.com/q/28805694
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/45884897
has answer: http://stackoverflow.com/a/28806537
has comment: http://stackoverflow.com/comment/45884692
type: UnansweredQuestion
has title: Add 1 to a value in a div onsubmit
score: 0
has body: I have a forum that people comment on other people's entry which i submit the data to the database via ajax. I have a div called "total_number" which have the total number of responses to a particular subject. I have a script that adds 1 to the number in the total number div on click on a submit button. Now my problem is since the subject area is nested i'm finding it difficult to make the count to a particular row when its button is click. For example when i click on the submit button for row one, it adds up correctly, but when i click the next button being row two, the count doesn't work. So i need to find a script that can make up for the nested records so it counts to a particualr row when its button its click. I managed to add +1 to the total_number div so when each div is repeated it adds +1 to it. That total_number1, total_number2, but still fails to work $(document).ready(function(){ $('.form1').on('submit',function(event){ event.preventDefault(); // Disable submit button on this specific form $('.button-add', this).text('Submitted').prop('disabled', true); data = $(this).serialize(); $.ajax({ type: "POST", url: "insert_comment.php", data: data }).success(function() { window.counter=parseInt($('#total_number').html()); window.counter++; $('#total_number').html(window.counter); }); }); });
tagged with: javascript
type: Question
has comment: http://stackoverflow.com/comment/45884782
answer count: 2
has answer: http://stackoverflow.com/a/28805753

http://stackoverflow.com/comment/45951884
score: 0
comment on: http://stackoverflow.com/a/28841371
type: Comment
has text: `drawShape` should probably be defined on `PlayerShip.prototype` though.
type: AnswerComment

http://stackoverflow.com/a/28789316
has body: Something along the lines of: $.ajax({ type: method, url: url, data: form.serialize(), success: function(data) { // use a temp wrapper element to workaround weak jQuery HTML parser var tmp = $('&lt;div&gt;'); tmp.html(data); // update the comment box with the new one $('.comment-box').html(tmp.find('.comment-box').html()); // update the form (so it eventually shows validations errors) // don't forget to empty it via PHP if the submission was // successful $('.type-box').html(tmp.find('.type-box').html()); tmp.destroy(); } });
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45855302
has comment: http://stackoverflow.com/comment/45854346
has comment: http://stackoverflow.com/comment/45854326
has comment: http://stackoverflow.com/comment/45854310
has comment: http://stackoverflow.com/comment/45854284
has comment: http://stackoverflow.com/comment/45865853
has comment: http://stackoverflow.com/comment/45854430
downvote count: 0
answers question: http://stackoverflow.com/q/28789259
type: Answer

http://stackoverflow.com/comment/45879842
comment on: http://stackoverflow.com/q/28803157
score: 0
type: QuestionComment
type: Comment
has text: possible duplicate of http://stackoverflow.com/questions/199099/how-to-manage-a-redirect-request-after-a-jquery-ajax-call

http://stackoverflow.com/comment/45823014
comment on: http://stackoverflow.com/a/28772156
score: 0
has text: The problem is i'm using image and want to use HREF for changing mouse icon and also your code won't work with image.
type: Comment
type: AnswerComment

http://stackoverflow.com/a/28772312
has comment: http://stackoverflow.com/comment/45823474
has comment: http://stackoverflow.com/comment/45823458
accepted answer of: http://stackoverflow.com/q/28772132
answers question: http://stackoverflow.com/q/28772132
has comment: http://stackoverflow.com/comment/45823697
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45823716
score: 0
has body: Try this: for(var i=0; i &lt; allElements.length; i++){ if (allElements.children == 'LI.tab'){ var newAryElement = allElements[1]; menuTabs.push(newAryElement); } i++ } This might not solve your problem, but I suspect that it will reveal newAryElement to be an array itself, which you will then need to parse.
type: Answer
has comment: http://stackoverflow.com/comment/45823389

http://stackoverflow.com/q/28779205
answer count: 2
possible better answer: http://stackoverflow.com/a/30730560
upvote count: 1
favorite count: 0
tagged with: angularjs
tagged with: ngroute
has body: I made a two pages using angularjs ngRoute. On first page I show two connected jsPlumb objects. Second page does not contain an Plumb object. However, when I go from first page to second Plumb objects does not disappear. Do you know how to achieve proper jsPlumb refresh with ng-view update? http://plnkr.co/edit/8592E9BnuwVXuKAJ5Pdx?p=preview script.js var app; app = angular.module('ironcoderApp', [ 'ngRoute', 'appControllers' ]); app.config(['$routeProvider', function($routeProvider) { $routeProvider. when('/page1', { templateUrl: 'page1.html', controller: 'Page1Controller' }). when('/page2', { templateUrl: 'page2.html', controller: 'Page1Controller' }). otherwise({ redirectTo: '/page1' }); }]); var appControllers = angular.module('appControllers', []); app.controller('Page1Controller', ['$scope', '$rootScope', '$routeParams', '$location', '$timeout', function($scope, $rootScope, $routeParams, $location, $timeout) { $scope.text = 'page1'; $timeout(function(){ jsPlumb.connect({'source': $("#page1el1"), 'target': $("#page1el2"), 'label': 'te'}); }, 0); } ]); app.controller('Page2Controller', ['$scope', '$rootScope', '$routeParams', '$location', function($scope, $rootScope, $routeParams, $location) { $scope.text = 'page2'; } ]); app.controller('MainController', ['$scope', '$rootScope', '$location', function($scope, $rootScope, $location) { $scope.text = 'main'; } ]); page.html:
tagged with: ng-view
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question
has comment: http://stackoverflow.com/comment/77341281
has answer: http://stackoverflow.com/a/28779363
accepted answer: http://stackoverflow.com/a/28779363
has title: jsPlumb is not redrawn after view change in angular.js?
has answer: http://stackoverflow.com/a/30730560
tagged with: javascript
tagged with: jsplumb

http://stackoverflow.com/comment/45844784
score: 1
type: Comment
has text: please take a look on pretender https://github.com/trek/pretender
type: QuestionComment
comment on: http://stackoverflow.com/q/28783893

http://stackoverflow.com/comment/45966187
comment on: http://stackoverflow.com/a/28849239
score: 0
type: AnswerComment
has text: I have one question to you, I discuses architecture of project, Is this right approach and secure, If any suggestion please tell me..
type: Comment

http://stackoverflow.com/q/28843856
has answer: http://stackoverflow.com/a/28844513
type: UnansweredQuestion
has body: I am using a code from this page: http://green-beast.com/experiments/css_map_pop.php in my website and it works fine. But I am trying to modify the code so that when I hover a "hot spot", the picture (and text) that shows up (to the right) would fade in and then, if the mouse is moved out of the hot spot, would fade out. So far I have managed to make the fade in work, but I can't figure out a way for the fade out to work. I just added opacity: 0; transition: opacity .6s ease-in-out; to ul#cmp li a span.offset and opacity: 1.0; transition: opacity .6s ease-in-out; to ul#cmp li a:hover span.offset, ul#cmp li a:focus span.offset, ul#cmp li a:active span.offset. Now when I hover a hot spot, it will fade in, but again when I move out of the hot spot, it does not fade out. Can someone please show me how to achieve what I want? I have tried several things but with no success. Thank you. I have put the code from the page in a jsfiddle so it would be easy to make experiments. The first part of the CSS, called "Experiments Global CSS", is not of interest, IMO: http://jsfiddle.net/fidnut/r52kkrbw/
tagged with: fade
type: Question
has title: Fade in and fade out in popup element
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45957893
score: 0
has comment: http://stackoverflow.com/comment/45957711

http://stackoverflow.com/comment/46002104
has text: I up-voted your answer, but I find the syntax you suggested to be awkward...
type: AnswerComment
comment on: http://stackoverflow.com/a/28868840
type: Comment
score: 1

http://stackoverflow.com/comment/45994198
type: QuestionComment
has text: @charlietfl, Once the user clicks the notifications button I just need it to mark all of the users activity as viewed. So my thinking was that it would just search for all activity for that user that currently has the field viewed == false and update it to = true for the Activity model. So no activity should need to be passed in from the GET request. If that makes sense?
score: 0
comment on: http://stackoverflow.com/q/28864079
type: Comment

http://stackoverflow.com/comment/45959513
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28845289
has text: Thank you Paul. I'll go ahead and rephrase my question so that it is less ambiguous.
score: 0

http://stackoverflow.com/comment/110414105
comment on: http://stackoverflow.com/a/28899585
has text: @Xerillio, good point. It would take more code to differentiate block-level from inline elements, especially considering that CSS could change block-level to inline and vice-versa.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46027004
has text: `SELECT TableB.* FROM TableA INNER JOIN TableB WHERE TableB.FIELDB = TableA.somefield` Don't need two queries.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28882809
score: 1

http://stackoverflow.com/a/28860953
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45987466
score: 5
type: Answer
answers question: http://stackoverflow.com/q/28860864
has body: You need to ensure that the JS expression in your link does not return a value: javascript: void(window.open('http://www.goodwill.org'))
accepted answer of: http://stackoverflow.com/q/28860864
upvote count: 5

http://stackoverflow.com/q/28846053
tagged with: iframe
has comment: http://stackoverflow.com/comment/45960802
has body: I have a .txt file called LeaderBoardScores and I have the file within an iframe I would like to know if it is possible to change the text color of the .txt file that is within the iframe? Also is it possible to solve this with JQuery/Javascript or simple css? Thank you in advance for any assistance !
tagged with: textcolor
tagged with: javascript
type: UnansweredQuestion
has title: Changing Text color located in an iframe (text comes from a .txt file)?
answer count: 0
tagged with: jquery
type: Question
has comment: http://stackoverflow.com/comment/45961021
has comment: http://stackoverflow.com/comment/45960734
has comment: http://stackoverflow.com/comment/45960843
score: 0

http://stackoverflow.com/comment/45976112
has text: I didn't realize, from your original comment, that you were accusing me of plagiarism or I would have made a bigger deal about it. I completely came up with that if statement and feel like I was wrongly downvoted. I'd like to know how to handle this better next time.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28843049
type: Comment

http://stackoverflow.com/q/28814255
tagged with: sails.js
answer count: 1
has answer: http://stackoverflow.com/a/28814799
tagged with: javascript
tagged with: routes
has comment: http://stackoverflow.com/comment/51354752
has comment: http://stackoverflow.com/comment/45900808
has title: Sails.js POST route not
type: UnansweredQuestion
has body: Currently my routes look like this 'get /login': 'LoginController.showForm', 'post /login': 'LoginController.processForm' So going to /login and submitting a form redirects me to /login with method POST but I get this error You don't have permission to see the page you're trying to reach. The controller file looks like this module.exports = { showForm: function(req, res) { return res.view('login/form'); }, processForm: function(req, res) { return res.send('works') } } Config policies module.exports.policies = { LoginController: { } };
has comment: http://stackoverflow.com/comment/45900703
linked to: http://stackoverflow.com/q/28363626
type: Question
score: 0

http://stackoverflow.com/comment/46034704
type: Comment
has text: I also needed to use: return $.when(controlData, statusData).then(function (_cdata, _sdata). The key was THEN instead of DONE.
comment on: http://stackoverflow.com/a/28886180
type: AnswerComment
score: 0

http://stackoverflow.com/a/28901597
upvote count: 1
has body: You can store it in session: total: function() { var a = parseInt(Autoform.getFieldValue('calcs', 'a')) var b = parseInt(Autoform.getFieldValue('calcs', 'b')); var total = a+b; Session.set("total", total); return total; }, totalDouble: function(){ var total = Session.get("total"); return total* 2; }
score: 1
answers question: http://stackoverflow.com/q/28900670
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28900670
type: Answer

http://stackoverflow.com/comment/46203016
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28846870
has text: Your snippet does not work... According to [this answer](http://stackoverflow.com/questions/5706757/is-there-a-way-to-check-document-ready-if-jquery-is-not-available#5706881), `document.readyState !== 'complete'` works fine in all browsers.

http://stackoverflow.com/comment/45997373
comment on: http://stackoverflow.com/q/28865410
score: 0
type: Comment
type: QuestionComment
has text: That's your problem, you need to remove the leading `[` and trailing `]` from the response. You're sending down an array with a single object in it, you should only be sending the object.

http://stackoverflow.com/comment/45784512
type: AnswerComment
comment on: http://stackoverflow.com/a/28751217
score: 0
type: Comment
has text: @TheMan well it's not exactly obvious :) The word "class" has been a reserved word in JavaScript since forever, so using an alternative was necessary.

http://stackoverflow.com/comment/45994131
comment on: http://stackoverflow.com/q/28818728
score: 0
type: QuestionComment
has text: Have you tried creating a very minimal test. An aspx page with one field sending it to a new asp classic page? Did you do any debugging to make sure your sending the information in the correct format? Did you try using [fiddler](http://www.telerik.com/fiddler) to help with this? That's about all I can suggest at this point.
type: Comment

http://stackoverflow.com/comment/46047720
score: 1
comment on: http://stackoverflow.com/q/28893736
has text: Better can use ajax function check it out
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45832439
type: Comment
comment on: http://stackoverflow.com/a/28777167
type: AnswerComment
has text: @zzzzBov It's easy to reason this; changing the prototype afterwards affects both instances, thus it lives in its own part of memory and the other instances reference it.
score: 0

http://stackoverflow.com/q/28767355
has answer: http://stackoverflow.com/a/28768335
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45813662
downvote count: 0
accepted answer: http://stackoverflow.com/a/28768335
has comment: http://stackoverflow.com/comment/45813802
tagged with: javascript
tagged with: jquery
has body: Good morning. I am slowly but surely figuring out jQuery, but this morning I find myself stumped and head-scratching. First, my relevant code: HTML Return Specific Curriculum Information # Year Lang Week/Packet Quantity Delete JavaScript/jQuery $('#ccnt').data('count', 0); $('#addcurric').click(function () { function getcount() { var $this = $('#ccnt'), count = $this.data('count') + 1; $this.data('count', count); return count; } var mycount = getcount(); var myyear = 'cyear' + mycount; var mylang = 'clang' + mycount; var myweek = 'cweek' + mycount; var myqty = 'cqty' + mycount; alert('mycount: ' + mycount + '; myyear: ' + myyear + '; mylang: ' + mylang + '; myweek: ' + myweek + '; myqty: ' + myqty); var tdclass; if (mycount % 2 == 1) { tdclass = "td1"; } else { tdclass = "td2"; } var chtml = ""; chtml += "' "; chtml += " " + mycount + " \n"; chtml += " \n"; chtml += " -- Select -- \n"; chtml += " Year 1 \n"; chtml += " Year 2 \n"; chtml += " Year 3 \n"; chtml += " \\n"; chtml += " \n"; chtml += " -- Select -- \n"; chtml += " English \n"; chtml += " Spanish \n"; chtml += " \\n"; chtml += " \n"; chtml += ""; chtml += " \n"; chtml += " \n"; chtml += " X \n"; chtml += " \n'"; $('#retc > tbody').append(chtml); $(".dbutton").bind("click", Delete); }); $('#remcurric').click(function () { $('#retc > tbody').html(""); $('#ccnt').data('count', 0); }); function Delete() { var par = $(this).parent().parent(); par.remove(); } The Problem/Question As you can see, in my js/jQ code, I am generating dynamic table rows to handle 1-n records. I also left a blank where option lines should be for id "myweek" - because they should come from my database. Ordinarily, I would do something like this to fill those in: $('#'+mylang).change(function() { var lang = $('#'+mylang).val(); var year = $('#'+myyear).val(); $.post("/chairs-dev/jqf/returncurric_processajax.php", {LANG: lang, YEAR: year}, function (data) { $('#'+myweek).append(data); }); }); This code didn't work, so I went code hunting …
type: Question
score: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28767725
has title: jquery $('id').change inside $('id2').click?
answer count: 2
upvote count: 1
possible better answer: http://stackoverflow.com/a/28767725
linked to: http://stackoverflow.com/q/6658752

http://stackoverflow.com/q/28756389
answer count: 1
has body: I'm trying to create a new contact for an authorised user using javascript and I want to avoid using XML. The playground gives me the option to post JSON but I cannot find the required format anywhere. The current javascript client library doesn't work with the contacts API so I need to use http requests. If any one could point me to the JSON format needed that would be great.
type: UnansweredQuestion
has title: Post JSON to create new contact
tagged with: google-contacts-api
has comment: http://stackoverflow.com/comment/45796660
type: Question
tagged with: gdata
tagged with: oauth2-playground
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has comment: http://stackoverflow.com/comment/45798455
score: 0
has answer: http://stackoverflow.com/a/28759280

http://stackoverflow.com/q/28893524
has comment: http://stackoverflow.com/comment/46047365
has comment: http://stackoverflow.com/comment/46047421
type: Question
has answer: http://stackoverflow.com/a/28893696
tagged with: javascript
has body: I am working on a form checking. I am stuck on how to stop submitting the form. So basically, the form has 2 fieldsets (Creat New Customer and Return customer). I have a function which is checking the return customer fieldset if either one of the text field is blank then it will display an message. However, this function also affects on the fieldset (New customer), thus even all the text fields of new customer filled out, it display the message from that function as well. My code: HTML Create New Account Account: Password: Password Again: Email: Login Account: Password: JS: function loginCheck() { var x = document.getElementById("loginAcc"); var y = document.getElementById("loginPass"); if (x.value == "") { alert("You must type in both fields"); return false; } if (y.value == "") { alert("You must type in both fields"); return false; } return true; } How can I fix to get that function just check the login fieldset without affect on the create new customer fieldset? Thank you!
has title: How to validate multiple fieldset in one form tag?
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/46047442
type: UnansweredQuestion

http://stackoverflow.com/q/28810759
has title: Can't pass variable from PHP to JS
type: Question
has comment: http://stackoverflow.com/comment/45893788
tagged with: javascript
has answer: http://stackoverflow.com/a/28810942
accepted answer: http://stackoverflow.com/a/28810942
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: web
has comment: http://stackoverflow.com/comment/45895475
has body: I want to load data from my MySQL server with php code and then use it to draw chart with google charts. the problem is that i can't use the data that quered from my mysql in the java-script code. PHP code: $connection = mysql_connect('127.0.0.1','root','123456'); mysql_select_db('db_statmarket',$connection); $result2 = mysql_query('select sum(`How much read from customer`) as Leads, Date from monitor group by Date;',$connection) or die('cannot show tables'); Here in the javascript code where we can see the var data = ... i want that he will be the table that i quered from my database. HTML &amp; JS code: &lt;script type="text/javascript"&gt; google.setOnLoadCallback(drawChart); function drawChart() { var data = google.visualization.arrayToDataTable([ ['Year', 'Sales', 'Expenses'], ['2004', 1000, 400], ['2005', 1170, 460], ['2006', 660, 1120], ['2007', 1030, 540] ]); var options = { title: 'Company Performance', curveType: 'function', legend: { position: 'bottom' } }; var chart = new google.visualization.LineChart(document.getElementById('curve_chart')); chart.draw(data, options); } &lt;/script&gt; The output need to be seen like these:
tagged with: php
has comment: http://stackoverflow.com/comment/45893726
type: AnsweredQuestion

http://stackoverflow.com/q/28868908
tagged with: selectize.js
type: AnsweredQuestion
has body: Hello I have a problem regarding selectize. I tried and test this code to ensure that I get a list of email coming from the database. for(var i = 0; i &lt; e.email.length; i++){ console.log(e.email[i]); var list = e.email[i]; } The results are fine and I get what I want. But when using selectize... var $el = $("#poc-email").selectize(); var control = $el[0].selectize; control.setValue(list); It doesnt work. I also tried.. addOption(list); refreshItems(); and also I tried.. addItem(list); but it doesnt work. Thanks for the help.
accepted answer: http://stackoverflow.com/a/28934319
type: Question
tagged with: jquery-selectors
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: How to set array value into textfield using selectize.js
has answer: http://stackoverflow.com/a/28934319
score: 2
upvote count: 2

http://stackoverflow.com/q/28890856
has answer: http://stackoverflow.com/a/28890886
accepted answer: http://stackoverflow.com/a/28890886
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28890911
has answer: http://stackoverflow.com/a/28890895
tagged with: hover
type: AnsweredQuestion
tagged with: jquery-hover
type: Question
has body: I'm new with jquery and I'm trying to understand how can I hover the current element in my situation: <div class="feat_bg_img" style="background-image: url(<?php echo $src[0]; ?> );"> <a class="home-feat-title" href="<?php the_permalink(); ?>"><?php get_the_title() ? the_title() : the_ID(); ?> <div class="feat_bg_img" style="background-image: url(<?php echo $src[0]; ?> );"> <a class="home-feat-title" href="<?php the_permalink(); ?>"><?php get_the_title() ? the_title() : the_ID(); ?> <div class="feat_bg_img" style="background-image: url(<?php echo $src[0]; ?> );"> <a class="home-feat-title" href="<?php the_permalink(); ?>"><?php get_the_title() ? the_title() : the_ID(); ?> I know that I'm somewhat close to what I want to acomplish, here's the code: $(".feat_pic").hover(function(){ $(".home-featured ul li .feat_container ul li .feat_bg_img .layer").addClass("lilith"); $(".home-featured ul li a.home-feat-title").addClass("satan"); }, function(){ $(".home-featured ul li .feat_container ul li .feat_bg_img .layer").removeClass("lilith"); $(".home-featured ul li a.home-feat-title").removeClass("satan"); }); How can I make that add.Class to work only on the current .feat_pic?
tagged with: javascript
tagged with: jquery
has title: Select the current element jquery - multiple divs
possible better answer: http://stackoverflow.com/a/28890895

http://stackoverflow.com/a/28786911
accepted answer of: http://stackoverflow.com/q/28786872
has body: Event names include on prefix: it's onmousedown and onmouseup: function init() { document.getElementsByClassName("buttons")[0].onmousedown = blue; document.getElementsByClassName("buttons")[0].onmouseup = green; }
answers question: http://stackoverflow.com/q/28786872
type: Answer
has comment: http://stackoverflow.com/comment/45864290
score: 0
type: AcceptedAnswer

http://stackoverflow.com/a/28800839
upvote count: 2
answers question: http://stackoverflow.com/q/28800748
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/45887072
accepted answer of: http://stackoverflow.com/q/28800748
has comment: http://stackoverflow.com/comment/45887017
has comment: http://stackoverflow.com/comment/45888041
downvote count: 0
type: AcceptedAnswer
has body: You can see those tutorials : 1.blog_customization 2.basic-codes 3.See this video And if you need more info, google is then best way to find everything :) EDIT To change the colors of specific words you could use : text If you want to change the background you can use : text To edit your blog in Tumblr you have to do : How do I edit my blog’s Custom HTML? Click "Settings" under the Account menu at the top of the Dashboard. Choose the blog you’d like to update on the right side of the page, then click “Edit theme” in the Website Theme section. Click the Edit HTML button and edit the Custom HTML as desired in the source code editor to see the changes reflected on the page Click “Update Preview.” When you're finished, click the back arrow and then click "Save."

http://stackoverflow.com/q/28801306
has answer: http://stackoverflow.com/a/28803610
type: Question
answer count: 1
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45878469
accepted answer: http://stackoverflow.com/a/28803610
has comment: http://stackoverflow.com/comment/45876567
tagged with: attributes
has comment: http://stackoverflow.com/comment/45878981
tagged with: d3.js
has body: I have several paths I've made in D3.JS and on mouseover I call this mouseover function to get the attributes of that path and store them in variables. Then I try to measure the length of the level attribute and console.log it, however Im getting an error: I'd also like to use the .slice(-1,1) method to get the last figure in that value attribute but this doesn't work either. I think the attribute needs to be read as a string in order to do these things. but when I call .toString() on circleLevel I'm still getting this error. here is the mouseover function: function mouseover(){ var circleName = d3.select(this).attr("name"); var circleSize = d3.select(this).attr("size"); var circleLevel = d3.select(this).attr("level"); var levelLength = circleLevel.length(); console.log(circleLevel.length()); } here it is on JS fiddle: http://jsfiddle.net/RL_NewtoJS/ryyt6ruj/3/
has comment: http://stackoverflow.com/comment/45878080
has comment: http://stackoverflow.com/comment/45879141
type: AnsweredQuestion
has title: How to measure the length of a D3.JS node's attribute

http://stackoverflow.com/q/28837989
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28838058
type: Question
has answer: http://stackoverflow.com/a/28838023
tagged with: underscore.js
answer count: 2
tagged with: javascript
score: 0
has title: Underscore, find same key and replace value
has body: I have an object like so - {"house" : red, "car" : green, "apple" : blue}; and am being sent another object with a single key/value like so {"apple" : green} I need to be able essentially replace the value of "apple" (in this case), with the new value. So I need to find and replace (the value) with the same key as my new item. I have no idea what order the first object will be in each time, so if I can search each time and find and replace the value by matching key that would be great (by index maybe?). Doesn't have to be with underscore , Just have it in to play around with.

http://stackoverflow.com/comment/45831261
type: QuestionComment
has text: To answer my own question: yes and yes. 8.1 para 4. https://people.mozilla.org/~jorendorff/es6-draft.html#sec-lexical-environments
comment on: http://stackoverflow.com/q/28776079
score: 0
type: Comment

http://stackoverflow.com/q/28766032
tagged with: arrays
tagged with: javascript
tagged with: key
has title: Changing multiple array keys/names in JavaScript
accepted answer: http://stackoverflow.com/a/28766128
answer count: 1
favorite count: 0
score: -1
has body: So basically I've an array called arrayObj with three objects. So I have arrayObj[0], arrayObj[1] and arrayObj[2]. In those three objects I have the key name["user"] three times, obviously. I want to change those key names and made a function. This is my function so far: function renameObjNames(){ arrayObj[0].randomkeyname= arrayObj[0].user; delete arrayObj[0].user; } This function does only change the first one. I tried something with the for-loop, but unfortunally I suck with those loops. Is there a way to dynamically change the index of arrayObj[?]. I want to change those three at once in a function. Any additional help is always welcome. Sorry for my grammar if it is disturbing you. Thanks in advance :).
downvote count: 1
type: AnsweredQuestion
tagged with: object
tagged with: underscore.js
has answer: http://stackoverflow.com/a/28766128
type: Question
upvote count: 0

http://stackoverflow.com/q/28771789
has comment: http://stackoverflow.com/comment/45919487
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/45918656
has title: How to use Google Caja HTML/CSS sanitizer JS library in Java
upvote count: 2
type: UnansweredQuestion
has body: I have a Java API that accepts a custom CSS field. I need to sanitize the CSS before storing it in my database and would like to use Google Caja for this. First, I tried running the Google Caja HTML/CSS sanitizer JavaScript library using the Rhino JavaScript engine. Unfortunately, that didn't work because that library depends heavily on the existence of a DOM (specifically, the window object). Next, I imported the Caja project from the Maven repository. I looked through some of the tests, but could not find an example of how to use the sanitizer. I could try bringing the browser to the server, but that seems a bit excessive. Has anyone been able to use Caja to sanitize a CSS string in Java? Thanks in advance!
tagged with: css
score: 2
tagged with: java
has answer: http://stackoverflow.com/a/28889674
tagged with: google-caja
type: Question
has answer: http://stackoverflow.com/a/28899385
tagged with: sanitization
tagged with: javascript
answer count: 2

http://stackoverflow.com/a/28867335
type: Answer
has body: I think the problem is with setTimeout and setInterval. Chrome doesn't properly keep track of the timers for setTimeout and setInterval if you switch to a different tab. I guess the intention is to improve the browser's performance, but in this case, it's clearly not what you wanted. I don't think the chrome team intends to 'fix' this.
downvote count: 1
has comment: http://stackoverflow.com/comment/75533615
answers question: http://stackoverflow.com/q/28866977
score: -1
upvote count: 0

http://stackoverflow.com/q/28795345
has comment: http://stackoverflow.com/comment/45865894
tagged with: javascript
has body: How to write a JavaScript program to randomly generate a single digit number (0,1,…9) one hundred times and output how many 0s,1s, 2s,….9s were generated. I can generate a hundred numbers (see below) but can't figure out how to sort them into counters &lt;script&gt; for (i = 0; i &lt; 100; i++) { num = Math.floor((Math.random() * 10)); document.write(num); } &lt;/script&gt;
has answer: http://stackoverflow.com/a/28795484
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45865851
has comment: http://stackoverflow.com/comment/45865165
score: -2
favorite count: 0
accepted answer: http://stackoverflow.com/a/28795484
has comment: http://stackoverflow.com/comment/45865157
answer count: 2
downvote count: 2
has comment: http://stackoverflow.com/comment/45865272
tagged with: loops
possible better answer: http://stackoverflow.com/a/28795515
has answer: http://stackoverflow.com/a/28795515
has comment: http://stackoverflow.com/comment/45865164
has title: JavaScript program to randomly generate a single digit number (0,1,…9) one hundred times and output how many 0s,1s, 2s,….9s were generated
upvote count: 0

http://stackoverflow.com/q/28874578
score: 5
tagged with: web-config
has answer: http://stackoverflow.com/a/28874694
answer count: 1
tagged with: javascript
favorite count: 0
has body: I am coding a MVC 5 internet application and have a question in regards to JavaScript caching (and caching in general). Currently, when I update a JavaScript file that is referenced in a view, when I browse to the view, the old JavaScript code is used. If I then refresh the browser, the updated JavaScript code is then used. This is not ideal, as a user may often browse to a view that has an old JavaScript file, and as such, the view may not be displayed correctly. I am currently referencing JavaScript files as follows: @section Scripts{ &lt;script src="~/Scripts/filename.js"&gt;&lt;/script&gt; } Is there a web.config setting that controls caching? Is there a NuGet package that can help with caching? How can I resolve this situation?
upvote count: 5
duplicate of: http://stackoverflow.com/q/3224
downvote count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/3224
has title: MVC 5 JavaScript Caching
type: Question
tagged with: caching
tagged with: asp.net-mvc-5

http://stackoverflow.com/comment/45984014
score: 3
type: Comment
comment on: http://stackoverflow.com/q/28859070
type: QuestionComment
has text: @gmo it'll be a lot of useless data, something like `console.log('request received:', request.url);` will be much more useful.

http://stackoverflow.com/a/29018981
answers question: http://stackoverflow.com/q/28774346
type: Answer
has body: The problem was that I didn't have the test/dev/local addresses in my manifest.json in the permissions section. Once I included those, then the XHR's were completed successfully.
score: 0

http://stackoverflow.com/comment/45855367
has text: Sorry, I deleted my last comment because my fiddles were not convincing enough: Here is a much better recursive one: http://jsfiddle.net/g9u4z0ex/1/ and iterative one: http://jsfiddle.net/a3kdLo7z/1/
type: AnswerComment
comment on: http://stackoverflow.com/a/28789742
score: 0
type: Comment

http://stackoverflow.com/q/28795888
tagged with: asp.net-mvc
accepted answer: http://stackoverflow.com/a/28810821
has answer: http://stackoverflow.com/a/28810681
type: Question
has answer: http://stackoverflow.com/a/28810821
tagged with: javascript
tagged with: jquery
has body: i'm working with asp mvc 5 I have a javascript function that applies an action on a given class, for applied this function on a class I use the keyword this by being in this class, my problem is that I do not know how to use this function in any class at the same time, this is my javascript function flipCard_1(el, dir) { var flipcard = el.closest('div[class|="fsc-comp-flipcard"]'); if (dir == 1) { var card_new_h = flipcard.children('div[class|="fsc-comp-card"]').eq(1).height(); flipcard.css('height', card_new_h).addClass('flipped'); } else { var card_new_h = flipcard.children('div[class|="fsc-comp-card"]').eq(0).height(); flipcard.css('height', card_new_h).removeClass('flipped'); } } I want that el supports any class that FSC-comp-card and applies javascript totu the same time
score: 0
possible better answer: http://stackoverflow.com/a/28795925
answer count: 3
has answer: http://stackoverflow.com/a/28795925
has title: ASP.NET MVC applied JavaScript to all class
type: AnsweredQuestion

http://stackoverflow.com/comment/46030756
score: 0
type: AnswerComment
type: Comment
has text: If I used Javascript to add an additinal ` ` element to head, do you expect it would work well?
comment on: http://stackoverflow.com/a/28883874

http://stackoverflow.com/comment/45939422
comment on: http://stackoverflow.com/a/28833803
has text: I am using directive and added it to link function.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28764532
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45808274
tagged with: css
has comment: http://stackoverflow.com/comment/45808111
has comment: http://stackoverflow.com/comment/45808209
has answer: http://stackoverflow.com/a/28764655
type: Question
tagged with: javascript
score: 0
has title: Scale and maintain DIV positions with window resize
answer count: 1
has body: How do I scale and maintain DIV positions when the browser window is resized using jQuery? This is what I've done so far. But doesn't do exactly what I need. The positioning is wrong. $(window).resize(function(){ for(i=1;i&lt;3;i++){ var p = $('#dv'+i); var offset = p.offset(); var newwidth = $(window).width() / ($('#dv'+i).width()); var newheight = $(window).height() / ($('#dv'+i).height()); $('#dv'+i).height(newheight).width(newwidth); $('#dv'+i).offset({ top: offset.top, left: offset.left}); } });
tagged with: jquery
has comment: http://stackoverflow.com/comment/45808147

http://stackoverflow.com/comment/46082016
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28898441
has text: You may have been including some other library.

affix
tags question: http://stackoverflow.com/q/28892762
tags question: http://stackoverflow.com/q/28891634
type: Tag
tag name: affix

http://stackoverflow.com/q/28835560
has comment: http://stackoverflow.com/comment/45940960
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28837237
type: AnsweredQuestion
upvote count: 0
has title: Best way to create a 7 by 7 reflowable grid/table
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
score: -2
tagged with: css
accepted answer: http://stackoverflow.com/a/28837237
has body: I am looking into making a grid/table of 49 divs/cells (representing numbers) rendered in a grid of max 7 rows by 7 columns when there is enough space, but reflowable to more rows and less columns or more columns and less rows depending on the room it has in the view. What would be the best/easiest/recommended way to make this? Looking into pure html/css solution, no 3rd party library. EDIT: I have a main div with all the 49 numbered divs inside the main. I added a float: left attribute, which seems to take me in the right direction. however, I want a max of 7 columns when there is enough space for them, and decrease the number of columns when there is not.
downvote count: 2

http://stackoverflow.com/q/28793025
has answer: http://stackoverflow.com/a/28794144
downvote count: 0
answer count: 1
tagged with: javascript
has title: How can I set my field to $dirty inside my custom directive?
favorite count: 0
has body: I have a dropdown/select directive that I used to replace the select boxes inside my form. I have few buttons that I set to disable as long as the form is pristine. app.directive('dropdown', function ($timeout) { return { restrict: 'E', template: ' ' + ' ' + '{{ items[ngModel].name }}' + '' + ' ' + ' ' + ' '+ '< / a >' + ' '+ ' '+ ' ', scope: { ngModel: '=', // selected option items: '=', // options }, link: function (scope, element, attrs) { scope.select = function (item) { scope.ngModel = item.id; }; } }; }); In HTML: With my directive, the $pristine is not being triggered. Can someone point to me what I'm doing wrong?
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/28794144
type: AnsweredQuestion
upvote count: 1
type: Question
tagged with: angularjs-directive
score: 1

http://stackoverflow.com/q/28890344
upvote count: 6
type: AnsweredQuestion
tagged with: protractor
has title: Get element's offset position with protractor
has answer: http://stackoverflow.com/a/28890368
type: Question
downvote count: 0
tagged with: javascript
has body: I am trying to make sure the page scrolls to an element when a certain span is clicked. So I need to check the element's y position. Can someone explain how I can get an element's position? element.all(by.css('[scroll-to="section-executive-summary-anchor"]')) .then(function (elem) { elem[0].click().then(function () { element(by.id('section-executive-summary-anchor')) .then(function (el) { // I need "el.position" or something along those lines }); }); });
answer count: 1
accepted answer: http://stackoverflow.com/a/28890368
tagged with: angularjs-e2e
favorite count: 0
score: 6

http://stackoverflow.com/comment/45861878
comment on: http://stackoverflow.com/a/28779772
has text: Uncaught ReferenceError: Reveal is not defined (anonymous function) mySlides.html:37 Uncaught Error: Mismatched anonymous define() module: function () { root.Reveal = factory(); return root.Reveal; } http://requirejs.org/docs/errors.html#mismatch makeError require.js:166 intakeDefines require.js:1236 (anonymous function) require.js:1423
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45855392
type: AnswerComment
comment on: http://stackoverflow.com/a/28789742
type: Comment
has text: The recursive one shows that there is always a 100ms interval between iterations: "Timeout at: 102, Computation start: 0 103, Computation end: 0 232, Timeout at: 333, Computation start: 1 333, Computation end: 1 456, Timeout at: 557 ..."
score: 0

http://stackoverflow.com/comment/46027892
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28881923
has text: As this whole code is in a content script, this won't work. "chrome.tabs" is only available in background scripts. Also, I tried setting that from background script, but with no luck.
score: 0

http://stackoverflow.com/q/28823924
score: 0
linked to: http://stackoverflow.com/q/22389313
answer count: 1
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/45920697
has comment: http://stackoverflow.com/comment/45919449
has body: i had some difficulty on calling my ajax function when i clicked the submit button. When i'm trying to troubleshoot the ajax function with other form it work well, but when i'm trying on the actual code that i wanted to insert the data into database, the ajax function just can't be called. Anything that i need to change in order to make it work? Please guide me thanks. Here is my example of sponsor.php: //File and text upload with formDATA function $("form#form").submit(function(){ var formData = new FormData($(this)[0]); $.ajax({ url:'sponsorItem.php', type: 'POST', data: formData, async: false, beforeSend: function(){ if(confirm('Are you sure?')) return true; else return false; }, cache: false, contentType: false, processData: false }).done(function () { //do something if you want when the post is successfully if(!alert('Banner Had Successfully Updated.')){document.getelementbyclassname('form').reset()} }); return false; }); Where else this is the getSponsorForm.php where it get the item id from the ajax which pass the value into it to call the form. Here is the function to pass variable to the getSponsorForm.php: Here is the getSponsorForm.php : <?php $q = intval($_GET['sponsor']); include 'dbConnection.php'; global $dbLink; $query="SELECT * FROM sponsor_item WHERE sponsor_item_id = '".$q."'"; $result = $dbLink->query($query); // Numeric array while($row=mysqli_fetch_array($result,MYSQLI_ASSOC)){ echo ' Edit Sponsor No.'.$row["sponsor_item_id"].' 编辑器 Sponsor Title 赞助称号 Sponsor Description 赞助描述 File input Your picture size not more than 2MB. (Only JPEG or JPG is allowed) Update '; } mysqli_free_result($result); // Close the mysql connection $dbLink->close(); ?> I'm not sure why i click the submit button, it just won't call the function in sponsorItem.php and insert data into database. FYI: I had try to put the getSponsorForm.php code for the form into the sponsor.php, then when i click submit button it work. But i separate out the form function in getSponsorForm.p…
tagged with: php
has title: Unable to call ajax function
type: UnansweredQuestion
tagged with: mysql
has answer: http://stackoverflow.com/a/28824215
type: Question
tagged with: javascript

http://stackoverflow.com/comment/45842450
type: QuestionComment
has text: Is there any reason why you're not using the r.js `optimize` method directly? http://requirejs.org/docs/node.html#optimizer
comment on: http://stackoverflow.com/q/28778492
score: 0
type: Comment

http://stackoverflow.com/comment/46012075
has text: I cant get why click works two times. It console log two times content of the same button.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28873243
type: Comment

http://stackoverflow.com/comment/46065290
type: QuestionComment
has text: @connor The reason i dont want to add id manually is because i have multiple functions like this, and multiple functions which can create elements. That means that in every element-creation function i have to add myFunction(), but also myFunction2 if i get one etc. Also, if i create a new function, i have to add it to all element-creation functions and vica versa.
score: 0
comment on: http://stackoverflow.com/q/28902413
type: Comment

http://stackoverflow.com/comment/46065275
score: 0
has text: @user4493177 The link i sent you is the answer to your question. you need to observe the document for any elements being dynamically created and inserted.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28902413

http://stackoverflow.com/a/28780070
has body: If I understand your requirements correctly the jQuery event jqGridInitGrid or onInitGrid callback is what you need. It's the first events/callbacks which will be called once during creating the grid after the outer part of jqGrid will be constructed and before the first filling of jqGrid with data. The event/callback can be used in jqGrid 4.6/4.7 The new version of free jqGrid, which I'm developing now, contains additionally beforeInitGrid callback and jqGridBeforeInitGrid event. The callback/event will be called before jqGrid start processing of input parameters. So it's possible for example make any modification of the parameter. You can for example modify/generate colModel based on the input data. So the best choice of the callbacks/events depend on at what moment of initialization you need to do some changes and from which version of jqGrid you use.
has comment: http://stackoverflow.com/comment/45838460
has comment: http://stackoverflow.com/comment/45838407
has comment: http://stackoverflow.com/comment/45838486
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28778434
has comment: http://stackoverflow.com/comment/45838526
has comment: http://stackoverflow.com/comment/45838277
answers question: http://stackoverflow.com/q/28778434
type: Answer
has comment: http://stackoverflow.com/comment/45838631
score: 2
upvote count: 2

http://stackoverflow.com/comment/46766413
type: QuestionComment
has text: had the same problem over here !!
comment on: http://stackoverflow.com/q/28819246
score: 0
type: Comment

http://stackoverflow.com/q/28770840
has comment: http://stackoverflow.com/comment/45820323
tagged with: ajax
has body: I'm trying to auto submit a form when the username column is not null. i've got my script down there but since i'm new to jquery, i've got it missed up and its not working $(function() { var $username = $('#username'), if ($username != null){ $("#form1").submit,function(event){ event.preventDefault(); data = $(this).serialize(); $.ajax({ type: "POST", url: "http://mysample.com/ans.php", data: data, success: function(data) { $('#log_msg').html(data); var result = $.trim(data); if(result==="ok"){ window.location = 'page.html'; } }); }); });
has comment: http://stackoverflow.com/comment/45820200
has answer: http://stackoverflow.com/a/28770978
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45820537
has comment: http://stackoverflow.com/comment/45820340
has comment: http://stackoverflow.com/comment/45820480
has comment: http://stackoverflow.com/comment/45820421
has title: auto submit form to a url if textfield is not empty
has comment: http://stackoverflow.com/comment/45820272
type: Question
has answer: http://stackoverflow.com/a/28771188
tagged with: javascript
has comment: http://stackoverflow.com/comment/45820230
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/45820278
has comment: http://stackoverflow.com/comment/45820378
tagged with: jquery

http://stackoverflow.com/comment/45981215
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28857438
has text: Where's the code that isn't working?

internet-explorer-11
tags question: http://stackoverflow.com/q/28849468
tags question: http://stackoverflow.com/q/28797213
type: Tag
tags question: http://stackoverflow.com/q/28900881
tags question: http://stackoverflow.com/q/28799419
tags question: http://stackoverflow.com/q/28833382
tags question: http://stackoverflow.com/q/28880585
tag name: internet-explorer-11
tags question: http://stackoverflow.com/q/28857438
tags question: http://stackoverflow.com/q/28760363

http://stackoverflow.com/comment/45931207
has text: I have edited my code, so you can see where the picture is taken. The text "Take photo" is one that the ipad bringes up when I click on the textbox for taking the picture
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28829577

http://stackoverflow.com/a/28876459
score: 2
answers question: http://stackoverflow.com/q/28876126
upvote count: 2
type: AcceptedAnswer
type: Answer
downvote count: 0
has body: Checkout this one Demo and press Ctrl+P, you'll see that &lt;textarea&gt; is hidden and &lt;div class="textarea"&gt; is visible. .textarea { display: none; } @media print { textarea { display: none; } .textarea { display: block; } }
accepted answer of: http://stackoverflow.com/q/28876126
has comment: http://stackoverflow.com/comment/46015382

http://stackoverflow.com/comment/45803873
score: 0
comment on: http://stackoverflow.com/q/28761983
type: Comment
type: QuestionComment
has text: Did you try to include a container to your elemnts and set width to desire pixels? [fiddle](http://jsfiddle.net/s9p5do2q/)

http://stackoverflow.com/q/28902465
type: Question
has title: How to place an absolutely positioned img at the top of the page?
has comment: http://stackoverflow.com/comment/46064504
answer count: 2
downvote count: 4
has comment: http://stackoverflow.com/comment/46064473
upvote count: 1
has comment: http://stackoverflow.com/comment/46064356
tagged with: javascript
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/28902870
has comment: http://stackoverflow.com/comment/46065958
has comment: http://stackoverflow.com/comment/46064324
has answer: http://stackoverflow.com/a/28902937
accepted answer: http://stackoverflow.com/a/28902937
score: -3
has body: I've built a jsfiddle. It is my first, so I am not certain that it is correct but all the code from my small example is there. Nothing cahnges when I run it. On my machine, the click handler is called but I see no change to the position of the viewport. That is the problem, I would like the image to move to the top of the viewport. Hope this is a better question. My original question is below: I have a relatively positioned div that contains some absolute imgs. I want this arrangement to appear at the top of the viewport. I believe that if I can set the top of the div (position:relative) to the top to the viewport, the images it contains will come along. Problem is, I can't figure out how to do this. The relative div is at the bottom of the page, and when I click on it, I want the document to reposition so it is displayed at the top with its content. I've tried scrollTop with large positive and negative numbers and I can't get the div to reposition. I've been trying things like: $(#view2").scrollTop(xxx); With no luck. My html looks like the following. Everything but #view2 is absolute, #view2 is relative. The content of #view1 is set dynamically. &lt;div id="view2"&gt; &lt;img&gt; &lt;img&gt; &lt;div id="view1" &gt;&lt;/div&gt; &lt;img&gt; &lt;img&gt; &lt;/div&gt;
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28902870

http://stackoverflow.com/a/32686858
answers question: http://stackoverflow.com/q/28815150
downvote count: 0
score: 1
upvote count: 1
type: Answer
has body: The statements are equivalent, any mistakes must happen in the code besides this example. If I were to guess I'd say the selector returns nothing and val() is invalid.

http://stackoverflow.com/comment/45897838
comment on: http://stackoverflow.com/q/28812921
type: Comment
type: QuestionComment
score: 2
has text: Please [edit] your question to add the relevant script here; the demo is nice but it's a bonus, your question should be self-contained in order to guard against external sites falling over or otherwise going away.

http://stackoverflow.com/comment/45789463
type: Comment
has text: Not totally clear what you are asking to do. What is the problem with the GET approach using query string?
comment on: http://stackoverflow.com/q/28753408
score: 0
type: QuestionComment

http://stackoverflow.com/q/28826804
has body: I have input: &lt;input ng-model="email" type="email" id="form-email" name="email" placeholder="Inter email" maxlength="250"&gt; When I enter so long hosting: fax@test.cooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooom I have: $scope.email // undefined document.getElementById("form-email").value //fax@test.cooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooom But when I enter fax@testooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooh.com I have $scope.email // fax@testooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooh.com How to fix this trouble?
has answer: http://stackoverflow.com/a/28827047
type: Question
has comment: http://stackoverflow.com/comment/45924044
has answer: http://stackoverflow.com/a/28827115
tagged with: javascript
score: 0
answer count: 2
has title: How to get HTML-INPUT-EMAIL using AngularJS?
tagged with: angularjs
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/46034062
score: 0
comment on: http://stackoverflow.com/q/28886316
type: Comment
type: QuestionComment
has text: added example for my problem. I dont know how to check what day is it with jquery today.

http://stackoverflow.com/comment/45844129
comment on: http://stackoverflow.com/q/28783930
score: 4
has text: Can't you just test it yourself?
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28903983
has comment: http://stackoverflow.com/comment/46067974
has comment: http://stackoverflow.com/comment/46067514
has comment: http://stackoverflow.com/comment/46067748
has comment: http://stackoverflow.com/comment/46067392
accepted answer: http://stackoverflow.com/a/28904420
has comment: http://stackoverflow.com/comment/46067389
has body: I have a set of boxes: HTML Ajax content 1 Ajax content 1 In the PHP loop I do: <?php $permalink = get_permalink(); // Link of the box ?> The php loop above prints the correct link for each box link in each simple variable I then call the content via ajax like this: $(document).on( 'click', ".btn-modal", function(){ var cont = $(this).simple + " .content"; // Load via ajax the Box link + content jQuery(".modal-body").load(cont); }); The variable simple is applied to all the boxes correctly but I am not getting this box link on click but I am getting a no found error instead http://www.example.com/xchanges/home/work/interactive/undefined 404 (Not Found)
has title: How to get "this" variable mixing php and jQuery?
has comment: http://stackoverflow.com/comment/46067416
has comment: http://stackoverflow.com/comment/46067453
has comment: http://stackoverflow.com/comment/46067673
tagged with: php
has comment: http://stackoverflow.com/comment/46067773
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46067543
has comment: http://stackoverflow.com/comment/46067852
has comment: http://stackoverflow.com/comment/46067369
has comment: http://stackoverflow.com/comment/46067690
has comment: http://stackoverflow.com/comment/46067860
has comment: http://stackoverflow.com/comment/46067357
has comment: http://stackoverflow.com/comment/46067678
has comment: http://stackoverflow.com/comment/46067495
type: Question
has comment: http://stackoverflow.com/comment/46067368
has comment: http://stackoverflow.com/comment/46067834
tagged with: javascript
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/46067429
score: 0
has answer: http://stackoverflow.com/a/28904420
answer count: 1

http://stackoverflow.com/comment/45836318
type: QuestionComment
has text: can u post formulaSelect function code ?
comment on: http://stackoverflow.com/q/28779489
score: 0
type: Comment

http://stackoverflow.com/comment/115283250
comment on: http://stackoverflow.com/a/54344724
type: Comment
has text: Different technique for different cases, and this is the right approach for my case, Telegram's bot development that require no innerHTML or something that required in web development.
score: 0
type: AnswerComment

http://stackoverflow.com/a/28886565
has comment: http://stackoverflow.com/comment/46034425
answers question: http://stackoverflow.com/q/28886198
score: 0
has comment: http://stackoverflow.com/comment/46034488
has comment: http://stackoverflow.com/comment/46034384
has body: I think you need to make sure, you're javascript executing after page load. it may works for you $( document ).ready(function() { for (var i = 0; i &lt; document.links.length; i++) { document.links[i].onclick = function() { alert('testing') } } }); FYI, i'm using jQuery ready event to make sure script executes after page load.
has comment: http://stackoverflow.com/comment/46034777
type: Answer
has comment: http://stackoverflow.com/comment/46035171

http://stackoverflow.com/q/28904150
has comment: http://stackoverflow.com/comment/46090863
score: 2
type: AnsweredQuestion
upvote count: 2
has title: How reload or refresh page when session has expired with Ruby on Rails
tagged with: ruby-on-rails
type: Question
has comment: http://stackoverflow.com/comment/46085666
has body: Good morning! We are implementing session control for our app, we need to reload page automatically to go to login page when session expires or show a modal or pop-up to make user know that the session has expired and take user to login page, we have tried a lot of options to make it, but anything works for us. This is our context: application_controller.rb before_filter :prepare_session def prepare_session if !session[:expiry_time].nil? and session[:expiry_time] &lt; Time.now # Session has expired. Clear the current session. deny_access 'Your session has timed out. Please log back in.' end # Assign a new expiry time, whether the session has expired or not. session[:expiry_time] = 1.minutes.from_now return true end session_helper.rb def deny_access(msg = nil) msg ||= 'Please sign in to access this page.' flash[:notice] ||= msg redirect_to :controller =&gt; 'users', :action =&gt; 'login' end and inside deny_access method after flash message, we have redirect_to and our login function controller, but it just do that in background, and ruby console give us this log RubyMine log Redirected to http://localhost:3000/users/login Filter chain halted as :prepare_session rendered or redirected Completed 302 Found in 1ms (ActiveRecord: 0.0ms) Started GET "/users/login" for 127.0.0.1 at 2015-03-06 11:28:06 -0500 Processing by UsersController#login as JSON Rendered users/login.html.erb within layouts/application (0.8ms) Completed 200 OK in 1089ms (Views: 1087.4ms | ActiveRecord: 0.0ms) Despite the message telling us that view users/login.html.erb have been redirected, nothing happens in our app, just until we reload page manually, so, these are all options that we have tried: redirect_to: redirect_to :controller =&gt; 'users', :action =&gt; 'login' redirect_to url_for(:controller =&gt; :users, :action =&gt; :login) redirect_to 'users/login' redirect_to :back redirect_to root_url redirect_to(request.env["HTTP_REFERER"]) respond_to: for this test, we created a redirect_to_login.js…
tagged with: session
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28918106
has comment: http://stackoverflow.com/comment/46080959
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/46094627
has answer: http://stackoverflow.com/a/28918106
favorite count: 0
tagged with: ruby-on-rails-3
tagged with: ruby
has comment: http://stackoverflow.com/comment/46090996

http://stackoverflow.com/comment/45946918
has text: toggle a class in callback of notification code, use setTimeout() to remove it
score: 0
comment on: http://stackoverflow.com/q/28838531
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28831656
has comment: http://stackoverflow.com/comment/45987866
has comment: http://stackoverflow.com/comment/46011382
has comment: http://stackoverflow.com/comment/46010659
type: Answer
has comment: http://stackoverflow.com/comment/45988581
has body: You want a structure like this : var json = { "div1" : { top: 212, left: 386 }, "div2" : { top: 40, left: 166 }, "div3" : { top: 20, left: 218 } } Each div needs to have its own ID, otherwise, how could you identify them and give them their position back? Here is how you build your json : var json = {}; $('.person').each( function(){ json[ $(this).attr('id') ] = $(this).position(); }) Then here is how you restore the positions of the divs at load time : $.each( json, function( id, position ){ $("#"+id).css({ 'top' : position.top , 'left' : position:left }) }); Does it make sense? However, saving their exact state with animation direction and velocity, trajectory etc. seems much harder. Especially if animations are random...
answers question: http://stackoverflow.com/q/28831346
score: 0
accepted answer of: http://stackoverflow.com/q/28831346
type: AcceptedAnswer

http://stackoverflow.com/a/28865315
has body: Sort of a repeat of this question: How do I synchronize the scroll position of two divs? But this answer would involve scrollLeft() instead of scrollTop(). $('#bottom').scroll(function () { $('#top').scrollTop($(this).scrollLeft()); }); Jsfiddle: http://jsfiddle.net/wvwLt3s9/ You would have to play around with the syncing of the two to get them to scroll at the rates you want, but this should work.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28864706

http://stackoverflow.com/q/28755540
has answer: http://stackoverflow.com/a/28757774
accepted answer: http://stackoverflow.com/a/28757774
has comment: http://stackoverflow.com/comment/57471150
has title: Rails remote form sends html instead of js
type: Question
upvote count: 4
answer count: 2
has comment: http://stackoverflow.com/comment/45796142
has comment: http://stackoverflow.com/comment/45796181
has comment: http://stackoverflow.com/comment/45796249
tagged with: javascript
score: 4
has comment: http://stackoverflow.com/comment/45795960
tagged with: ruby-on-rails-4
possible better answer: http://stackoverflow.com/a/58793851
has comment: http://stackoverflow.com/comment/45796302
downvote count: 0
has comment: http://stackoverflow.com/comment/45796216
favorite count: 0
has comment: http://stackoverflow.com/comment/45795534
has comment: http://stackoverflow.com/comment/45795779
tagged with: ruby-on-rails
has body: I have a remote form_for in my Rails 4 app that is not requesting a JavaScript response. I am getting an UnknownFormat error when I click submit on the form. It is saying the parameters were: {"utf8"=&gt;"✓", "authenticity_token"=&gt;"eAzS1lELwDL9Qt+fM2hAPlPmCxCgFPuAvl1QYWOIL3IBPdrnxn0woYYC+5uzGjyqH3lQxGxWGrYq/fnMrFNfnw==", "artist"=&gt;{"name"=&gt;"Joe"}, "commit"=&gt;"Save Artist"} My form code is: = form_for(@artist, remote: true, authenticity_token: true) do |f| - if @artist.errors.any? #error_explanation %h2= "#{pluralize(@artist.errors.count, "error")} prohibited this artist from being saved:" %ul - @artist.errors.full_messages.each do |msg| %li= msg .field = f.label :name = f.text_field :name .actions = f.submit 'Save Artist' I have a create.js.erb file, and my create method in my ArtistsController looks like: def new @artist = Artist.new respond_to do |format| format.js end end def create @artist = Artist.new(artist_params) if @artist.save respond_to do |format| format.js end end end My shows form is: = form_for @show, html: {role: 'form'} do |f| - if @show.errors.any? #error_explanation %h2= "#{pluralize(@show.errors.count, "error")} prohibited this venue from being saved:" %ul - @show.errors.full_messages.each do |msg| %li= msg .row = f.label :venue_id = f.collection_select :venue_id, Venue.all, :id, :name, class: 'form-control' .row .col-sm-6 = link_to 'New Artist', new_artist_path, id: :new_artist_link, remote: true .row.row-centered .col-sm-6 .form-group = f.label :date = f.date_select :show_date, order: [:day, :month, :year], class: 'form-control' .col-sm-6 .form-group = f.label :doors_open = f.time_select :doors_open, class: 'form-control' .row.row-centered .col-sm-6 .form-group = f.label :dinner_starts = f.time_select :dinner_starts, class: 'form-control' .col-sm-6 .form-group = f.label :show_starts = f.time_select :show_starts, class: 'form-control' .row.row-centered .col-sm-6 .form-group = f.label :dinner_ends = f.time_select :dinner_ends, class: '…
has comment: http://stackoverflow.com/comment/45795038
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/58793851

http://stackoverflow.com/a/55531213
score: 1
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/97784838
type: Answer
has body: I also encountered the same problem using navigator.geolocation which seem to work well on PC. I tried accessing it on my phone but keeps showing error. I finally resolved the issue by adding https:// to the address I was visiting on my mobile. Even if you don't have an SSL on your site, just add https:// to the url and everything will be fine.
accepted answer of: http://stackoverflow.com/q/28889783
upvote count: 1
answers question: http://stackoverflow.com/q/28889783

http://stackoverflow.com/a/28760839
downvote count: 1
score: -1
upvote count: 0
answers question: http://stackoverflow.com/q/28760679
has body: Why are you isng slice function on refreshHTML? slice is used to cut portions from an array, and you are not using it on an array here. Use the following instead: if (i == 0) translatedHTML = arraytrans + refreshHTML.substring(5000*i+5000); else if (i == loops - 1) translatedHTML = refreshHTML.substring(0, 5000*i) + arraytrans; else translatedHTML = refreshHTML.substring(0, 5000*i) + arraytrans + refreshHTML.substring(5000*i+5000);
has comment: http://stackoverflow.com/comment/45823843
type: Answer
has comment: http://stackoverflow.com/comment/45824423

http://stackoverflow.com/comment/45888980
has text: Again, what's the question?
comment on: http://stackoverflow.com/q/28790338
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28847473
type: Answer
answers question: http://stackoverflow.com/q/28847074
score: 0
has body: Fiddle: $('select option:selected').next('option[task_estimated_hours]').val();

http://stackoverflow.com/comment/46057238
comment on: http://stackoverflow.com/a/28898893
type: AnswerComment
has text: I try to add this table code ` TEXT ` but text don't break. Can you post a correct table example with your CSS, please?
score: 0
type: Comment

http://stackoverflow.com/comment/46049756
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28883149
has text: Looping Array Elements - Sounds like you want to understand JavaScript arrays - lots of tutorials on that. See Looping Array Elements at: http://www.w3schools.com/js/js_arrays.asp the section:

http://stackoverflow.com/a/28841390
score: 0
has body: add id attr into input: newdiv.innerHTML = "Entry " + (counter + 1) + " &lt;br&gt;&lt;input type='text' name='myInputs[]' id='"+counter+"'&gt;"; then you cann't write: var x = document.getElementById("1").value;
type: Answer
answers question: http://stackoverflow.com/q/28840853
has comment: http://stackoverflow.com/comment/45952879

http://stackoverflow.com/q/28855604
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has body: I'm trying to use javascript to show/hide the 'player-api' div tag on a YouTube video URL. The idea is that I load a button through a chrome extension that the user can then click. I'm receiving an error saying "3 Uncaught TypeError: Cannot read property 'style' of null" on line 11 (the line of code where it starts messing with the display after getting the ID of player-api). I'm assuming that the issue will have something to do with the extension not actually being able to see player-api to affect it. I have no idea how to fix that though and similar questions haven't really helped me out. Could anyone tell me for sure what I'm doing wrong and how I would fix it? Javascript var button = document.createElement("Button"); var t = document.createTextNode("Show/Hide"); button.appendChild(t); document.body.appendChild(button); button.addEventListener('click', toggleVisibility, false); function toggleVisibility() { var e = document.getElementById('player-api'); if (e.style.display == 'block' || e.style.display == '') e.style.display = 'none'; else e.style.display = 'block'; } HTML Player-API's Popup Manifest.json { "manifest_version": 2, "name": "player-api", "description": "This extension will show/hide Youtube videos", "version": "1.0", "background": { "scripts": [ "background.js" ], "persistent": false }, "browser_action": { "default_icon": "icon.png", "default_popup": "popup.html" }, "permissions": [ "declarativeContent", "activeTab" ], "content_scripts": [ { "matches": [ "*://*.youtube.com/*" ], "js": [ "popup.js" ] } ] }
has comment: http://stackoverflow.com/comment/45992465
has comment: http://stackoverflow.com/comment/45993113
answer count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: youtube
type: Question
has comment: http://stackoverflow.com/comment/45992804
has title: Use javascript to hide 'player-api' from youtube
score: 1
has comment: http://stackoverflow.com/comment/45977527
has comment: http://stackoverflow.com/comment/45992900
has comment: http://stackoverflow.com/comment/46405565
has comment: http://stackoverflow.com/comment/45977298
has comment: http://stackoverflow.com/comment/45992738
downvote count: 0

http://stackoverflow.com/q/28808862
score: 0
has title: jQuery sortable stop dropping in original parent
answer count: 1
has body: I have a a couple of sortable lists in a backbone view this.$(".users:not('.client')").sortable({ connectWith: ".users:not('.client')", helper: 'clone', revert: true, start: function(e, ui) { ui.item.parent().add('droppable-active'); }, over: function(e, ui) { $('.droppable-active').removeClass('droppable-active'); $(this).addClass('droppable-active'); }, stop: function(e, ui) { ui.item.parent().removeClass('droppable-active'); }, receive: function(e, ui) { //do save } }); What I wanting to is stop the user being able drop an list item in it's original parent, and trigger a save. Is there away to just do a revert of similar if a list item is added to it's original parent sortable list? Here is a jsbin example of sortable lists, jsbin.com/mabarevuhe/4
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
type: Question
has answer: http://stackoverflow.com/a/28809993
tagged with: jquery-ui
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45890510

http://stackoverflow.com/comment/46036901
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28882491
has text: After:

http://stackoverflow.com/comment/46053452
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28891046
has text: No form of javascript is required to get the value. Something in your coldfusion code is either doing so, or can do so very easily. You can then make that value available to javascript with a toScript function or cfwddx tag.

http://stackoverflow.com/comment/45890669
type: Comment
has text: after downloading i was changed the path
comment on: http://stackoverflow.com/a/28808741
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45932648
score: 0
comment on: http://stackoverflow.com/a/28828325
type: AnswerComment
has text: "checked" is not displayed, and tried with checked="checked", again same problem.
type: Comment

http://stackoverflow.com/a/28784018
upvote count: 1
has comment: http://stackoverflow.com/comment/45851465
score: 0
downvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/45847053
has comment: http://stackoverflow.com/comment/45845765
has comment: http://stackoverflow.com/comment/45846501
answers question: http://stackoverflow.com/q/28783930
has body: In computer systems, the only basic operators are + (adders) and (*) multipliers. You either add (negative or positive) numbers or rotate numbers (either left or right for multiplication and division respectively). You should be able to work it out whether multiplication or division takes longer... *btw...unless I am wrong, your question has nothing to do with javascript. Javascript is an interpreted language with engines such as spidermonkey or rhino.... FYI You should read this - directly from the main people....to have better insight of "what" might be happening.

http://stackoverflow.com/comment/45917758
comment on: http://stackoverflow.com/a/28822735
type: Comment
type: AnswerComment
has text: perfect, i had a typo and i had var calTotal=0; for (i = 0; i < food.length; i++) { calTotal = food[i].calories; } instead of var calTotal=0; for (i = 0; i < food.length; i++) { calTotal += food[i].calories; } that makes sense
score: 0

http://stackoverflow.com/comment/45984051
type: QuestionComment
comment on: http://stackoverflow.com/q/28859009
has text: I am trying to get it to log, but the problem is the page refreshes due to the form being submitted. Whereabouts exactly am I putting this 'event.preventDefault()' ? In the ajax call?
score: 0
type: Comment

http://stackoverflow.com/comment/45947964
has text: Tambo that works for me thank you! But could you explain how this is working exactly?
type: Comment
comment on: http://stackoverflow.com/a/28839261
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46003867
comment on: http://stackoverflow.com/q/28869887
score: 0
type: Comment
has text: Look at this: https://developer.chrome.com/extensions/webRequest
type: QuestionComment

http://stackoverflow.com/q/28762180
has answer: http://stackoverflow.com/a/28764371
tagged with: jquery-select2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28764371
has answer: http://stackoverflow.com/a/56187408
favorite count: 0
has title: How to sort the select2 (jQuery plugin) options alphabetically?
type: Question
upvote count: 32
has body: I want to sort the select2 options in alphabetical order. I have the following code and would like to know, how can this be achieved: United States Austria Alabama Jamaica Taiwan canada palau Wyoming $('#mylist').select2({ sortResults: function(results) { return results.sort(); } }); I want to sort the data via 'text'.
has answer: http://stackoverflow.com/a/31923222
answer count: 4
has answer: http://stackoverflow.com/a/59650502
downvote count: 0
possible better answer: http://stackoverflow.com/a/31923222
tagged with: javascript
tagged with: jquery
score: 32

http://stackoverflow.com/q/28844446
tagged with: angularjs
has title: unbinding scope property in angular
tagged with: unbind
has answer: http://stackoverflow.com/a/28856439
linked to: http://stackoverflow.com/q/122102
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45957785
type: Question
has comment: http://stackoverflow.com/comment/45957903
accepted answer: http://stackoverflow.com/a/28856439
tagged with: javascript
has body: Is there a way to unbind the reference when we are assigning values from scope properties? For example I have $scope.X and $scope.Y. At some point in my function I want to assign the value of $scope.Y at that time to $scope.X: $scope.X = $scope.Y However, whenever scope.Y changes, looks like $scope.X changes too. Is there a way to avoid the chain? I just want to assign the value of $scope.Y once. I tried using angular copy but it didn't work: $scope.X = angular.copy([$scope.Y])[0]; Thanks
tagged with: scope
score: 0
answer count: 1

cross-domain
tags question: http://stackoverflow.com/q/28878554
tags question: http://stackoverflow.com/q/28880633
tags question: http://stackoverflow.com/q/28812042
type: Tag
tags question: http://stackoverflow.com/q/28841228
tag name: cross-domain
tags question: http://stackoverflow.com/q/28858411

http://stackoverflow.com/comment/45923465
type: QuestionComment
comment on: http://stackoverflow.com/q/28826400
type: Comment
has text: @mohamedrias I was just being sure that I include everything. I have removed it from the code now.
score: 0

http://stackoverflow.com/comment/45988423
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28861357
score: 0
has text: @alsafoo What do you mean, exactly? I get no errors/warnings in my console log if that's what you mean

http://stackoverflow.com/a/28897808
has body: Here is my version (untested) var monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], date = "20150306", time = "185900", //http://www.w3schools.com/jsref/jsref_slice_string.asp date_year = date.slice(0, 4), date_month = date.slice(4, 6), date_day = date.slice(6, 8), time_hours = time.slice(0, 2), time_mins = time.slice(2, 4), time_secs = time.slice(4, 6), //http://www.w3schools.com/jsref/jsref_obj_date.asp dateObj = new Date(date_year, date_month, date_day, time_hours, time_mins, time_secs, 0), dateString = [monthNames[dateObj.getMonth() - 1], " ", dateObj.getDate(), ", ", dateObj.getFullYear()].join(""), //Bit of Math timeHours = dateObj.getHours() % 12 || 12, timeSuffix = time_hours &gt;= 12 ? 'PM' : 'AM', timeString = [timeHours, ':', time_mins, ' ', timeSuffix].join(""); console.log("Date: " + dateString); console.log("Time: " + timeString);
downvote count: 0
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/28896369
has comment: http://stackoverflow.com/comment/46055834

http://stackoverflow.com/q/28828029
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/100011284
score: 25
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/45927072
has comment: http://stackoverflow.com/comment/45927163
has comment: http://stackoverflow.com/comment/45926836
has comment: http://stackoverflow.com/comment/121139518
has comment: http://stackoverflow.com/comment/45926559
type: Question
possible better answer: http://stackoverflow.com/a/65192395
has comment: http://stackoverflow.com/comment/45926885
upvote count: 25
has answer: http://stackoverflow.com/a/65192395
has title: HTML - read .txt file from URL location in javascript
has answer: http://stackoverflow.com/a/28828681
accepted answer: http://stackoverflow.com/a/28828681
answer count: 2
has comment: http://stackoverflow.com/comment/45927299
has comment: http://stackoverflow.com/comment/45927484
has comment: http://stackoverflow.com/comment/45927231
tagged with: javascript
has body: I want to read a .txt file an URL location, lets say from http://www.puzzlers.org/pub/wordlists/pocket.txt and process its content on my page. Can you point me out some tutorials or some basic code on how to do this in javascript? I have a basic HTML code where I have some tables and I want to populate them with text from a .txt from a given URL location, but I do not know how to read the data from that location. Pseudoganglia Interface HP # SN % of used RAM IBM # CN % of used RAM
favorite count: 0
linked to: http://stackoverflow.com/q/15547407
has comment: http://stackoverflow.com/comment/45926388

http://stackoverflow.com/comment/45867573
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28796473
has text: About the {literal} I tried by added them before the first { of my code, so juste afiter my var lines, and the closing {/literal} before the script tag, but without success
type: Comment

http://stackoverflow.com/comment/46052001
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28895845
has text: **transform-origin: center center** is the **default** by the way for most HTML elements.
score: 0

http://stackoverflow.com/tag/xml
tags question: http://stackoverflow.com/q/28840149
tags question: http://stackoverflow.com/q/28781923
tags question: http://stackoverflow.com/q/28872608
tags question: http://stackoverflow.com/q/28821008
type: Tag
tags question: http://stackoverflow.com/q/28785871
tags question: http://stackoverflow.com/q/28845061
tags question: http://stackoverflow.com/q/28810290
tags question: http://stackoverflow.com/q/28881452
tags question: http://stackoverflow.com/q/28849897
tags question: http://stackoverflow.com/q/28867966
tags question: http://stackoverflow.com/q/28783805
tag name: xml
tags question: http://stackoverflow.com/q/28889928
tags question: http://stackoverflow.com/q/28823196
tags question: http://stackoverflow.com/q/28882744
tags question: http://stackoverflow.com/q/28901778
tags question: http://stackoverflow.com/q/28866938
tags question: http://stackoverflow.com/q/28838923
tags question: http://stackoverflow.com/q/28755287
tags question: http://stackoverflow.com/q/28887234

http://stackoverflow.com/a/28757177
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28756928
downvote count: 0
has body: Check this answer out Basically, it doesn't look like you're doing anything wrong fundamentally. That's how the context is supposed to work. What you really need is some syntax sugar for your specific use case. You can make these sugar extensions yourself or use a library to do some heavy lifting. You also could restructure your code like Danbopes suggests and organize it so you're doing less inline-binding. This would allow you to read your flow better.
answers question: http://stackoverflow.com/q/28756928
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/a/28759507
score: 3
upvote count: 3
has body: 1) _.contains vs _.some I think, it is possible to say, that _.contains is special case of _.some. That is, _.contains( list, value ) is a shortcut for _.some( list, function ( el ) { return value == 3; }) The second variant is just too verbose. In lodash such useful shortcuts presents in many functions, for example: var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user': 'fred', 'age': 40, 'active': false } ]; _.contains({ 'user': 'fred', 'age': 40 }, 'fred'); or _.filter(users, { 'age': 36 }); 2) _.map vs _.each These functions are just different. _.map used for collection transformation. If your input has size of N, result of _.map also has size of N. In other words, _.map is expression - use it when you need to transform each element of input collection. _.each is just a shortcut for the for loop. It is useful, because you don't need to calculate length of array as in for (var i = 0, len = myArray.length; i &lt; len; i++ ) { } When you use _.map or _.each properly, you declare explicitly your intentions.
answers question: http://stackoverflow.com/q/28759010
type: Answer
downvote count: 0

http://stackoverflow.com/comment/45807760
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28760363
has text: Was the `NewsFeed` class loaded successfully before it was used in your code? The class needs to be loaded before it is used. You should be able to confirm using Network tab do rev tools. Then, set a breakpoint if that works. Is everything in the right sequence?

http://stackoverflow.com/q/28830998
score: 0
linked to: http://stackoverflow.com/q/4866229
has comment: http://stackoverflow.com/comment/45931945
answer count: 5
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/28831099
has answer: http://stackoverflow.com/a/28831087
has answer: http://stackoverflow.com/a/28831352
has title: Javascript change display CSS
type: Question
has answer: http://stackoverflow.com/a/28831310
has answer: http://stackoverflow.com/a/28831623
tagged with: javascript
has body: Im completely new to Javascript, this is what i want: Guy clicks on an element, so i trigger an onclick and i want to run a JS function, all clear so i need a JS function, what this function needs to do: Check if the display of element #mobilemenu is block or none. When it is block change it to none, when its none change it to block. What i found so far was this: function Change(){ document.getElementById("mobilemenu").style.display = "block"; } But i am stuck on checking if it is currently block or none. I am kinda new to JS so maybe it is super easy (as i think) but i can't find a proper tutorial or some examples. Thanks in advance!

http://stackoverflow.com/comment/45871385
has text: Ok, added that as an answer then:)
comment on: http://stackoverflow.com/q/28798359
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46028463
comment on: http://stackoverflow.com/q/28883097
type: Comment
type: QuestionComment
has text: @somethinghere Also, would the `var setting = {}` Be outside of the XML Function?
score: 0

http://stackoverflow.com/q/28830517
favorite count: 0
type: UnansweredQuestion
tagged with: escaping
has comment: http://stackoverflow.com/comment/45930940
has body: This is my code to escape E = { "\x26": "\x26amp;", "\x3c": "\x26lt;", "\x3e": "\x26gt;", '"': "\x26quot;", "'": "\x26#39;", "/": "\x26#x2F;" }; function myescape(a) { return a.replace(/[&amp;&lt;&gt;"'\/]/g, function(a) {return E[a] }) }; The problem here is, when I escape following: '!@#$%^&amp;*()_+=-:"' It generates following: '!@#$%^&amp;amp;*()-=+_';&amp;quot;' So, basically all the characters are getting escaped. But, single quote is getting rendered as it is. Any clue how to get past this? I also tried to added following meta tag (dint work) &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45931113
upvote count: 0
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/28830666
has comment: http://stackoverflow.com/comment/45931009
answer count: 1
has title: Escaping ' (Single Quote/aprostrophe) not working

http://stackoverflow.com/comment/45796142
score: 0
comment on: http://stackoverflow.com/q/28755540
type: Comment
type: QuestionComment
has text: @Mingsheng How do I check that? I was under the impression adding remote: true made it request JavaScript.

http://stackoverflow.com/comment/45882117
has text: i will mention it. its nt an issue bt how to retrive it that tell me
comment on: http://stackoverflow.com/q/28804329
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28764758
has answer: http://stackoverflow.com/a/54462966
has answer: http://stackoverflow.com/a/66044962
has body: I added datetime picker plugin in my code. It works but not positioning rightly. When I focused on the input it's showed in footer of page not near the input. What should I check for? $(".form-date").datetimepicker({ format: "dd.mm.yyyy", minView: 2, maxView: 4, autoclose: true, language: 'tr', pickerPosition: "bottom-left" }); Tarih
tagged with: javascript
score: 4
has comment: http://stackoverflow.com/comment/114167699
upvote count: 4
has title: Bootstrap datetime picker positioning
downvote count: 0
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28765515
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 4
has comment: http://stackoverflow.com/comment/78414861
has answer: http://stackoverflow.com/a/53995057
tagged with: twitter-bootstrap
type: UnansweredQuestion
type: Question

http://stackoverflow.com/a/28890155
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46047089
has comment: http://stackoverflow.com/comment/46055249
upvote count: 5
type: Answer
downvote count: 0
score: 5
accepted answer of: http://stackoverflow.com/q/28802885
answers question: http://stackoverflow.com/q/28802885
has body: No need for documentation. Just look in the source. A Directive Prologue is the longest sequence of ExpressionStatement productions occurring as the initial SourceElement productions of a Program or FunctionBody and where each ExpressionStatement in the sequence consists entirely of a StringLiteral token followed a semicolon. The semicolon may appear explicitly or may be inserted by automatic semicolon insertion. A Directive Prologue may be an empty sequence. A Use Strict Directive is an ExpressionStatement in a Directive Prologue whose StringLiteral is either the exact character sequences "use strict" or 'use strict'. A Use Strict Directive may not contain an EscapeSequence or LineContinuation. A Directive Prologue may contain more than one Use Strict Directive. However, an implementation may issue a warning if this occurs. In other words, Directive Prologue is the longest sequence of string literal + semicolon at the exact start of function or program (top-level code): (function(){ "use strict"; // &lt;-- Directive Prologue })() or: (function() { // Directive Prologue start "foo bar" "baz"; '123'; ''; // Directive Prologue end })(); or: 'blah'; // &lt;-- Directive Prologue (top-level code) /* rest of the code here */ Notice that as soon as the string literal is not the first statement, it's no longer a Directive Prologue: var x; "use strict"; // &lt;-- NOT a Directive Prologue or: (function() { 1 + "use magic"; // &lt;-- NOT a Directive Prologue })();

http://stackoverflow.com/comment/45819540
comment on: http://stackoverflow.com/a/28769137
score: 0
type: AnswerComment
type: Comment
has text: Okay need to modify the code using ternary Operator. Thanks Arogachev

http://stackoverflow.com/a/28819680
type: Answer
answers question: http://stackoverflow.com/q/28818830
has body: You got an error on Line # 22 The string concatenation sign [+] is missing.
score: 0

http://stackoverflow.com/a/28793504
has body: This is an issue with ng-if child scope and the fact you are trying to 2-way bind a primitive in a child scope. You should always try to use objects in your scope as models so that you leverage the benefits of prototypical inheritance. See the difference here: {{model.shouldShow}} Hide Section {{model.shouldShow}} JS function Ctrl($scope) { $scope.model={shouldShow:false} } Also read the docs for ng-init. It should not be used for arbitrary variables. It's main purpose is for aliasing variables in ng-repeat DEMO
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28793130
score: 1
answers question: http://stackoverflow.com/q/28793130
upvote count: 1

http://stackoverflow.com/comment/46040078
type: Comment
type: QuestionComment
has text: FYI: The jQuery Validation Engine and the jQuery Validate plugin are two different things. Please be more mindful when tagging. Thanks.
score: 0
comment on: http://stackoverflow.com/q/28889558

http://stackoverflow.com/comment/46066730
type: QuestionComment
has text: @WissemAchour http://www.kirupa.com/html5/handling_events_for_many_elements.htm This is just an example, you can find many many more on the web
comment on: http://stackoverflow.com/q/28903492
score: 0
type: Comment

http://stackoverflow.com/q/28792877
has comment: http://stackoverflow.com/comment/45860791
type: Question
score: 1
has body: i want to find DOM element id/value by its offset. may be the picture explain exactly. i have a div that appoint ranges of value. and buttons that change values but ranges div is fix. now i want to find the ranges value after buttons event. this my html code. {{y.year}} - up down + - i use this code to find value but alert undefined var dom= $(document.body).find('[offsetTop = '+80+']'); alert($(dom).attr('id'));
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/45860865
tagged with: javascript
has comment: http://stackoverflow.com/comment/45860610
tagged with: jquery
has answer: http://stackoverflow.com/a/28792949
favorite count: 0
accepted answer: http://stackoverflow.com/a/28792949
has comment: http://stackoverflow.com/comment/45861004
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45860821
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45860633
has title: How to find DOM element id/value by its offset
downvote count: 0

http://stackoverflow.com/a/28862766
has body: you can use navigator.language to find the language used by user and then accordingly load the required language stored in your js.
type: Answer
has comment: http://stackoverflow.com/comment/45991679
score: 0
has comment: http://stackoverflow.com/comment/45991966
answers question: http://stackoverflow.com/q/28862669

http://stackoverflow.com/comment/45918416
comment on: http://stackoverflow.com/q/28823277
has text: I have, but haven't found any that use plain javascript...
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28829577
has comment: http://stackoverflow.com/comment/45929345
accepted answer: http://stackoverflow.com/a/28830849
upvote count: 2
downvote count: 2
has comment: http://stackoverflow.com/comment/45931469
type: Question
has title: Take picture using html 5 and js
has comment: http://stackoverflow.com/comment/45931399
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45931637
has answer: http://stackoverflow.com/a/28830849
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45931316
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45931207
type: AnsweredQuestion
has body: When I click on "Take photo", I just get a black screen. I have been trying for 3 hours to solve this, but I have hit a dead end. I am able to chose a picture that is on the tablet, but I just can't take a new picture. My JS code looks like this: function hasSelectedPhoto() { var x = 0, y = 0, width = 150, height = 130; var takePicture= document.querySelector("#take-picture"), showPicture= document.querySelector("#show-picture"); if (takePicture&amp;&amp; showPicture) { takePicture.onchange = function (event) { var files = event.target.files, file; if (files &amp;&amp; files.length &gt; 0) { file = files[0]; var reader = new FileReader(); reader.onload = function (e) { var imageUrl = e.target.result, c = showPicture, context = c.getContext("2d"), imageObject = new Image(); imageObject.onload = function () { context.clearRect(x, y, width, height); context.drawImage(imageObject, x, y, width, height); }; imageObject.src = imageUrl; }; reader.readAsDataURL(file); } }; } } And html code: &lt;div id="uploadedImageDiv" style="margin-left: 10px; width:300px; float: left;"&gt; @Html.LabelFor(m =&gt; m.NoteViewModel.ImageUpload) @Html.TextBoxFor(m =&gt; m.NoteViewModel.ImageUpload, new { id="take-picture", type = "file", accept = "image/*" }) &lt;input type="button" id="cancelPicture" value="Annuller billede" style="visibility: hidden;" /&gt; &lt;button type="reset" id="resetUploadedImage" style="display: none"&gt;&lt;/button&gt; &lt;/div&gt; &lt;canvas id="show-picture" style="display: none; border: medium solid #cccccc; margin-top: -50px;" width="150" height="125"&gt; &lt;/canvas&gt; I know there is a bunch of js code, but I really hope someone might spot a bug in my code, that makes med unable to take a picture. I'm desperate Thanks in advance

http://stackoverflow.com/q/28835271
favorite count: 0
tagged with: ajax
score: 2
type: AnsweredQuestion
upvote count: 3
has body: The solution to my problem can be found below. I can not get my code to work. I need to send an AJAX call to an action method in my controller that has to return a string (for now). But when I activate the AJAX call, it returns the HTML source code of the page I'm currently on And it does not even hit the desired controller action. This is my code: Ajax call &lt;script&gt; function addtoCart() { amount = prompt("Hoeveel producten wilt u toevoegen aan uw winkelwagen?", 1); //find product var product = { "id": '@Model.ID', "naam": "@Model.Naam", "afbeelding": "@Model.Afbeelding", "beschrijving": "@Model.Beschrijving", "prijs": "@Model.Prijs", "aantal": amount }; $.ajax({ url: '@Url.Action("storeProductInSession", "Product")', type: 'POST', data: JSON.stringify(product), dataType: 'json', //Right now, this gives an "Unexpected Token &lt; error". This is probably because when the method returns the entire HTML document, it won't be able to render &lt;!doctype html&gt; as JSON. contentType: 'application/json; charset=utf-8', success: function (result) { console.log(result); }, error: function (jqXHR, textStatus, errorThrown) { console.log(product); console.log(jqXHR); console.log(textStatus); console.log(errorThrown); }, async: true }); //sessionStorage.setItem('@Model.ID', JSON.stringify(product)); This is for later } StoreProductInSession(The method that has to be called) [HttpPost] public string storeProductInSession(object product)/*, string naam, string afbeelding, string beschrijving, decimal prijs, int aantal)*/ { return "This method is going to do session stuff, but for now it just has to return this string"; //Get the POST input from the AJAX call //Add the input to a JSON array //add the array to the session //Return the array //let javascript convert that array to the cart &lt;li&gt; } It still returns the entire HTML page, and even if the object product parameter is incorrect, I would be happy to see that the ajax call actually hits that method. I am thinking…
has answer: http://stackoverflow.com/a/28835800
downvote count: 1
type: Question
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/45942808
possible better answer: http://stackoverflow.com/a/28835561
has title: Jquery Ajax call doesn't hit the action method/returns entire HTML page
has comment: http://stackoverflow.com/comment/45941123
has answer: http://stackoverflow.com/a/28835561
answer count: 2
accepted answer: http://stackoverflow.com/a/28835800
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/28858179
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: JavaScript - Drag Image - max. 3
type: Question
score: 0
accepted answer: http://stackoverflow.com/a/28858946
answer count: 1
has body: I am trying to make a javascript script that makes it possible to drag 3 images into another div. once the user dragged 3 images on the box, it can't drag another image to the box, JsFiddle: http://jsfiddle.net/qvmwgf5p/1/ As you can see, it allows user to drag all images to the div, and I want to make it a lock on 3. Thanks forwards ;') $(function () { $(".cards img").draggable({ revert: "invalid", refreshPositions: true, drag: function (event, ui) { ui.helper.addClass("draggable"); }, stop: function (event, ui) { ui.helper.removeClass("draggable"); var image = this.src.split("/")[this.src.split("/").length - 1]; if ($.ui.ddmanager.drop(ui.helper.data("draggable"), event)) { } else { alert(" Sleep de kaart naar de box, Dat is er naast.. drunk."); } } }); $("#dvDest").droppable({ drop: function (event, ui) { if ($("#dvDest img").length == 3) { alert(" DEBUG: Selected 3 cards -&gt; Now we have to flip them"); // $("#dvDest").html(""); dit zorgt ervoor dat me kaarten verdwijnen, appart:p } if ($("#dvDest img").length == 4) { alert(" DEBUG: Wow dude, relax... The limit is 3 cards. 4 is not possible, fix this"); // $("#dvDest").html(""); dit zorgt ervoor dat me kaarten verdwijnen, appart:p } ui.draggable.addClass("dropped"); $("#dvDest").append(ui.draggable); } }); });
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28858946

http://stackoverflow.com/q/28798045
possible better answer: http://stackoverflow.com/a/28798170
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: web
tagged with: css
accepted answer: http://stackoverflow.com/a/28798061
type: AnsweredQuestion
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28798170
has answer: http://stackoverflow.com/a/28798061
has body: This is my JS code, the problem I have is the one in the title. It seems as though $(this) is returning undefined.: function load() { $(".inactiveTab").attr("onclick", "clickInactiveTab()"); } function clickInactiveTab() { $(this).attr("class", "activeTab"); } The html is the following: Tab 1 Tab 2
tagged with: javascript
tagged with: jquery
has title: $(this).attr({class: "activeTab"}); is not working because this is undefined

http://stackoverflow.com/q/28795127
has comment: http://stackoverflow.com/comment/45865808
type: UnansweredQuestion
upvote count: 1
has title: why it did not echo in console
tagged with: node.js
has comment: http://stackoverflow.com/comment/45922238
answer count: 0
score: 0
downvote count: 1
tagged with: socket.io
has comment: http://stackoverflow.com/comment/45864752
type: Question
has comment: http://stackoverflow.com/comment/45864736
tagged with: javascript
has comment: http://stackoverflow.com/comment/45916218
has comment: http://stackoverflow.com/comment/45864764
favorite count: 0
has body: I just follow this from other site https://nodesource.com/blog/understanding-socketio, I am still newbie in socket.io with node.js,.I am confuse why it did not echo in the console.can someone help me on this. Thank you in advance. app.js var server = require("net").createServer(); var io = require("socket.io")(server); var handleClient = function (socket) { // we've got a client connection socket.emit("tweet", {user: "nodesource", text: "Hello, world!"}); }; server.listen(8080); io.on("connection", handleClient); index.html
has comment: http://stackoverflow.com/comment/45865713

http://stackoverflow.com/q/28800442
tagged with: arrays
downvote count: 0
tagged with: javascript
has title: Eloquent Javascript Chapter 4: arrayToList/listToArray Execise
score: 4
linked to: http://stackoverflow.com/q/24231056
accepted answer: http://stackoverflow.com/a/28800542
has answer: http://stackoverflow.com/a/28800471
has answer: http://stackoverflow.com/a/67446120
favorite count: 0
has answer: http://stackoverflow.com/a/35290150
has answer: http://stackoverflow.com/a/69390959
has answer: http://stackoverflow.com/a/76518646
has comment: http://stackoverflow.com/comment/45874927
has answer: http://stackoverflow.com/a/56386887
possible better answer: http://stackoverflow.com/a/35290150
type: AnsweredQuestion
has body: Question from eloquentjavascript: Write a function arrayToList that builds up a data structure like the previous one when given [1, 2, 3] as argument, and write a listToArray function that produces an array from a list. Also write the helper functions prepend, which takes an element and a list and creates a new list that adds the element to the front of the input list, and nth, which takes a list and a number and returns the element at the given position in the list, or undefined when there is no such element. Can anyone explain this answer without any jargon? I can only learn by instructions. Here is what I came up with for arrayToList: So start list null, create for loop decrementing and inside define "i" then return list. function arrayToList(array){ //pass list as parameter var list = null; // don't know why we make it null for (var i=array.length-1; i&gt;=0; i--) // why -1 on the length? list = {value: array[i], rest:list}; //clueless return list; } what is rest:list inside the list object?
has answer: http://stackoverflow.com/a/28800542
has answer: http://stackoverflow.com/a/32218603
type: Question
upvote count: 4
answer count: 8

http://stackoverflow.com/a/28871093
has body: 1) In function displayAmounts, pass parameters tip &amp; total 2) Instead of tipSpan.innerText = tip, TRY WITH tipSpan.innerHTML = tip; and same for total , use totalSpan.innerHTML = total instead of totalSpan.innerText ; Then it should work
answers question: http://stackoverflow.com/q/28870973
type: Answer
score: 0

http://stackoverflow.com/comment/45963976
has text: Should be `.modal('hide')`, not `.modal('close')`
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28811542

http://stackoverflow.com/a/28759065
type: Answer
answers question: http://stackoverflow.com/q/28758822
has body: var gen = document.subscribe.gender[0].checked; var gen1 = document.subscribe.gender[1].checked; Instead of this use var x = document.getElementById("gender1").value; var x = document.getElementById("gender2").value; html &lt;input type="radio" name="gender" value="male" id="gender1"&gt; &lt;input type="radio" name="gender" value="female" id="gender2"&gt; Or for complete example Visit http://www.chennaisunday.com/jsradio.html
score: 0

http://stackoverflow.com/comment/46017495
type: Comment
type: QuestionComment
has text: @Titus requiring watir.......
comment on: http://stackoverflow.com/q/28862586
score: 0

http://stackoverflow.com/comment/45957847
type: AnswerComment
type: Comment
score: 3
has text: Nope, won't do that. Your solution is probably okay. But Async is a lovely library that eases much of the pain of node. Look for Async caolan, you'll find it.
comment on: http://stackoverflow.com/a/28844463

http://stackoverflow.com/comment/46035631
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28886990
has text: @pankajparkar ok let me try reproducing :)

http://stackoverflow.com/q/28848410
tagged with: javascript
type: UnansweredQuestion
upvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28849374
tagged with: ajax
has body: Before giving detail information on Question, I want to tell that architecture of project, project is design in three separate parts 1. UI Part, this is in Pure HTM-5, JavaScript, Ajax, JSON, RestFull API, there is no any embedded code like PHP, jSP. 2. Service Part, service is written in PHP, URL of these services access by UI part. 3. DataBase I don't want to add any PHP code in HTML file Now I want to create login form in pure html page, After successfully login it redirect to userProfile, Now user able to update the profile, I want to main session for this type scenario. I am successfully able to login and redirect to userProfile with info Which I fetch from server using JSON, and send this info to userProfile with help of storeUserDataInSession. Now I want to add Update and Logout facility without send again userName and password, please help me on this, I am new in session management. JavaScript for Login form &lt;script type="text/javascript"&gt; $(document).ready(function(){ var userData = { storeUserDataInSession: function(userData) { var userObjectString = JSON.stringify(userData); window.sessionStorage.setItem('userObject',userObjectString) }, getUserDataFromSession: function() { var userData = window.sessionStorage.getItem('userObject') return JSON.parse(userData); } } $("#register-form-header").submit(function(){ var uName = $('#userName').val(); var upassd=$('#password').val(); $.ajax({ url:"http://localhost/login/login.php", type:"POST", dataType:"json", data:{type:"login",uName:uName,password:upassd}, ContentType:"application/json", success: function(response){ userData.storeUserDataInSession(response); window.location = 'userProfile.html'; }, error: function(err){ //alert(JSON.stringify(err)); alert("fail"); window.location.href = 'error.html'; } }); return false; }); //loadJSON(0); }); &lt;/script&gt; JavaScript for UserProfile &lt;script&gt; $( document ).ready(function() { var userData = { storeUserDataInSession: function(userData) { var userObje…
type: Question
tagged with: php
has answer: http://stackoverflow.com/a/28849239
score: -1
tagged with: http://stackoverflow.com/tag/json
answer count: 2
downvote count: 1
has title: How to pass session object with JSON response in php?
tagged with: session

http://stackoverflow.com/comment/45956065
comment on: http://stackoverflow.com/q/28843505
score: 0
type: Comment
type: QuestionComment
has text: @FelixKling I'm not sure what you mean, I'm getting a string of json back and have verified that by logging data to the console (see my edit), and using the stringify alert that Med.Amine.Touli suggested.

http://stackoverflow.com/a/67263950
has comment: http://stackoverflow.com/comment/122261652
has body: Most (or all?) answers on the internet only detect a specific change. Typically they detect whether the value is 2 or something else. The issue probably lies in the MediaQuery, because they only allow checking for specific hardcoded values. With some programming, it's possible to dynamically create a media query, which checks for a change of the current value. let remove = null; const updatePixelRatio = () => { if(remove != null) { remove(); } let mqString = `(resolution: ${window.devicePixelRatio}dppx)`; let media = matchMedia(mqString); media.addListener(updatePixelRatio); remove = function() {media.removeListener(updatePixelRatio)}; console.log("devicePixelRatio: " + window.devicePixelRatio); } updatePixelRatio();
score: 12
has comment: http://stackoverflow.com/comment/135854517
upvote count: 13
answers question: http://stackoverflow.com/q/28905420
downvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/135915808
has comment: http://stackoverflow.com/comment/122322971

http://stackoverflow.com/q/28799624
has comment: http://stackoverflow.com/comment/45873403
tagged with: php
tagged with: laravel
type: Question
tagged with: blueimp
has comment: http://stackoverflow.com/comment/45873482
accepted answer: http://stackoverflow.com/a/28799711
score: 2
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: jquery-file-upload
has comment: http://stackoverflow.com/comment/45873462
has body: I'm trying to implement the blueimp jquery file upload with a laravel app. https://github.com/blueimp/jQuery-File-Upload I've set up the form which is working and behaving as expected using the plugin but I'm having problems creating the server side scripts in laravel to handle the upload. I've changed the form action as follows: &lt;form id="fileupload" action="{{ route('photos.post.upload') }}" method="POST" enctype="multipart/form-data"&gt; in main.js (part of the plugin) I've set the url to: $('#fileupload').fileupload({ // Uncomment the following to send cross-domain cookies: //xhrFields: {withCredentials: true}, url: '/photos/upload/' }); In my routes file I have created a route as follows: Route::any('photos/upload', [ 'as'=&gt;'photos.post.upload', 'uses' =&gt; 'PhotosController@uploadImage' ]); My function in the controller: public function uploadImage() { dd(Input::file()); return Response::json( array( "files" =&gt; array( "name" =&gt; "post" )) ); } At this point I simply want to test the form data is received. However on upload the data is empty. Using either Route::any() or Route::post() but get a 301 error (permanently moved) Checking in google chrome it appears POST is being used for the upload as expected and looks like the file is included. So. Why am I getting the 301 error - what am I missing from either the javascript side Why does Input::file() return empty Any help appreciated
type: AnsweredQuestion
has title: bootstrap jquery file upload and laravel
upvote count: 2
has answer: http://stackoverflow.com/a/28799711

http://stackoverflow.com/q/28867871
score: 0
tagged with: reactjs
has title: How to best render react components dynamically from data model
answer count: 1
has body: I'm trying to create texteditor with React.JS that works a bit like Sir Trevor(https://madebymany.github.io/sir-trevor-js/example.html). So you basically have blocks of different types of content that you order, edit and embed. I have a JSON data set from the backend that looks like this. var content = [ {"tag": "p", "content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit."}, {"tag": "Youtube", "content": "dQw4w9WgXcQ"}, {"tag": "ul", "content": [ {"tag": "li", "content": "Rick"}, {"tag": "li", "content": "Astley"}, ]}, {"tag": "TagCloud", "content": ["news","opinon","papers"]} ]; Youtube and TagCloud are React classes. I render the code like this: var ArticleContent = React.createClass({ render: function() { var elments = this.props.content; var reactElements = [] for (var elementIndex in elments) { if (elments.hasOwnProperty(elementIndex)) { var tagname = elments[elementIndex].tag; var content = elments[elementIndex].content; console.log(tagname.toString()); if(!/(div|p|li)/.test(tagname)) tagname = React.createFactory(tagname) reactElements.push(React.createElement(tagname, null, content)); } } return ( React.createElement('div', {className: 'articleContent'}, reactElements ) ); } }); React.render( &lt;ArticleContent content={content}&gt;&lt;/ArticleContent&gt; document.getElementById('content') ); Now my whish is to render normal html tags with just createElement, but for those matching a defined React component Class, I want to render using the components render method. As far as I understand this is not possible because createElement only accepts proper React objects or strings of html tags. Help please :)
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28868530
type: Question
has answer: http://stackoverflow.com/a/28868530
tagged with: javascript

http://stackoverflow.com/q/28750623
type: Question
has answer: http://stackoverflow.com/a/28750736
upvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45783233
tagged with: angularjs
has body: I have the following angular setup routing setup: angular.module('app') .constant('USER_ROLES', { all: '*', lb: 1, superadmin: 2, subadmin: 3, client: 4, external_partner: 5 }) .run( [ '$rootScope', '$state', '$stateParams', function ($rootScope, $state, $stateParams) { $rootScope.$state = $state; $rootScope.$stateParams = $stateParams; } ] ) .config( [ '$stateProvider', '$urlRouterProvider', 'JQ_CONFIG', function ($stateProvider, $urlRouterProvider, JQ_CONFIG) { $urlRouterProvider .otherwise('/access/signin'); $stateProvider .state('app', { abstract: true, url: '/app', templateUrl: 'tpl/app.html' }) .state('app.dashboard-v1', { url: '/dashboard-v1', templateUrl: 'tpl/app_admin_dashboard.html', resolve: { deps: ['$ocLazyLoad', function( $ocLazyLoad ){ return $ocLazyLoad.load(['js/controllers/chart.js', 'js/controllers/dashboard/DashboardController.js']); }] }, data: { authorizedRoles: [USER_ROLES.superadmin, USER_ROLES.subadmin] } }) .state('access', { url: '/access', template: '&lt;div ui-view class="fade-in-right-big smooth"&gt;&lt;/div&gt;', data: { authorizedRoles: [USER_ROLES.all] } }) .state('access.signin', { url: '/signin', templateUrl: 'tpl/page_signin.html', resolve: { deps: ['uiLoad', function( uiLoad ){ return uiLoad.load( ['js/controllers/user/userController.js'] ); }] } }) .state('access.signup', { url: '/signup', templateUrl: 'tpl/page_signup.html', resolve: { deps: ['uiLoad', function( uiLoad ){ return uiLoad.load( ['js/controllers/signup.js'] ); }] } }) .state('access.forgotpwd', { url: '/forgotpwd', templateUrl: 'tpl/page_forgotpwd.html' }) .state('access.404', { url: '/404', templateUrl: 'tpl/page_404.html' }) } ] ); I wont bother you with the rest of the code (however if you need it il provide it) When i run my app i get the following error: Uncaught Error: [$injector:modulerr] Failed to instantiate module app due to: ReferenceError: USER_ROLES is not defined
has title: Constant is defined however app could not find variable
downvote count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28750736
score: -1

http://stackoverflow.com/comment/45874921
score: 0
has text: You could also use [event delegation](http://api.jquery.com/on/) and attach the handler to a common parent element that exists on initial page load. If you post your markup, someone can provide a specific example.
comment on: http://stackoverflow.com/q/28800494
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28803362
tagged with: redis
has comment: http://stackoverflow.com/comment/45880325
has answer: http://stackoverflow.com/a/28803661
has comment: http://stackoverflow.com/comment/45880217
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45880170
has title: How to work with Javascript objects?
type: Question
has comment: http://stackoverflow.com/comment/45880161
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
has body: Having trouble understanding javascript objects in the particular script im trying to use. if anyone could point me in the right direction that would be great. please understand im new to javascript. and trying to learn while coding. so it may not be the prettiest. var Cryptsy = require('cryptsy'); redis = require('redis'); client = redis.createClient() var cryptsy = new Cryptsy('key', 'secret'); var obj = new Number(obj); client.hget("Pool_Stats:CurrentShift:WorkerBTC", "Total", function (err, obj) { console.dir(obj); var obj = new Number(obj); }); cryptsy.api('makewithdrawal', { address: '13WjD67H382MU8AqA6FyAU5VaKyXzQ35Kr', amount: 'obj' }, function (err, data) { console.log(data); console.log(err); }); client.quit();

http://stackoverflow.com/a/28813127
score: 0
has body: You can validate the Cloned Elements like this function validate() { var contact_person_name= document.getElementById('formid').elements["branch_contact_person_name[]"]; var contact_person_email=document.getElementById('formid').elements["branch_contact_person_email[]"]; var contact_person_mobile=document.getElementById('formid').elements["branch_contact_person_mobile[]"]; var length = contact_person_name.length; if(isNaN(length)) { if(contact_person_name.value=='') { alert('Please enter name'); return false; } if(contact_person_email.value=='') { alert('Please enter email'); return false; } if(contact_person_mobile.value=='') { alert('Please enter Mobileno'); return false; } } for (var i = 0; i &lt; contact_person_name.length; i++) { if (contact_person_name[i].value== '') { alert('Please enter name.'); return false; } if (contact_person_email[i].value== '') { alert('Please enter email.'); return false; } if (contact_person_mobile[i].value== '') { alert('Please enter mobile.'); return false; } } document.yourform.submit(); } Make sure declare id for your HTML form .This was might be helpful to you.Thanks
type: Answer
answers question: http://stackoverflow.com/q/28807038

http://stackoverflow.com/comment/46258015
comment on: http://stackoverflow.com/a/28866943
type: AnswerComment
has text: @KrishnaNandan the setTimeout makes it asynchronous (in the demo, about one frame, you can lower the rate using 33ms instead - or use requestAnimationFrame as a better choice). As each setTimeout will create a timer event, the browser can do other tasks in the mean time until the event expire - then this function is called again, and eventually added back to the event queue. In simple words, there shouldn't be any problems doing other tasks. It will only run once, wait etc. Everything is still single-threaded but there are time-slots available to do other things. Hope this helps.
type: Comment
score: 0

http://stackoverflow.com/comment/46066424
has text: But if you only need a title on the event then, yes, do it with `eventDataTransform`
score: 0
comment on: http://stackoverflow.com/a/28902831
type: Comment
type: AnswerComment

http://stackoverflow.com/q/28899475
tagged with: facebook-graph-api-v2.0
answer count: 2
accepted answer: http://stackoverflow.com/a/28899856
downvote count: 0
has title: Facebook {page-id}/tabs not working with v2 sdk
favorite count: 0
has body: I have a web app that also integrates facebook login. Since v1 is available only until 30th april 2015, I've changed the JS calls to use v2 sdk (sdk.js) but the {page-id}/tabs request no longer works. Facebook responds with an error: code: 200 message: "(#200) Requires either an app access token, or a page access token for this Page" type: "OAuthException" This is the api call: checkForInstalledApp: function(pageId, callbackFunction){ FB.api(pageId+'/tabs/'+appid, function(response){ if (response &amp;&amp; !response.error) { callbackFunction(response.data.length &gt; 0); } }); } Changing back to all.js works just fine. Also the login is successful. Only {page-id}/tabs returns an error.. so far. Anyone else encountered this issue?
tagged with: facebook
possible better answer: http://stackoverflow.com/a/28900326
has answer: http://stackoverflow.com/a/28900326
type: AnsweredQuestion
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/28899856
type: Question
tagged with: javascript

http://stackoverflow.com/a/28889643
score: 19
has body: The install() function actually replaces setTimeout with a mock function that jasmine gives you more control over. This makes it synchronous, because no actual waiting is done. Instead, you manually move it forward with the tick() function, which is also synchronous. See the source code: https://github.com/jasmine/jasmine/blob/ce9600a3f63f68fb75447eb10d62fe07da83d04d/src/core/Clock.js#L21 Suppose you had a function that internally set a timeout of 5 hours. Jasmine just replaces that setTimeout call so that the callback will be called when you call tick() so that the internal counter reaches or exceeds the 5 hour mark. It's quite simple!
has comment: http://stackoverflow.com/comment/62570130
accepted answer of: http://stackoverflow.com/q/28889562
has comment: http://stackoverflow.com/comment/46040511
has comment: http://stackoverflow.com/comment/46040384
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/57315019
type: Answer
has comment: http://stackoverflow.com/comment/61727763
upvote count: 19
has comment: http://stackoverflow.com/comment/46040430
answers question: http://stackoverflow.com/q/28889562

http://stackoverflow.com/a/28834165
type: Answer
has body: One possible reason could be "when" you are switching to the default content - try to do it only once the form is submitted: element(by.id('fileUploadForm')).submit().then(function() { browser.switchTo().defaultContent(); });
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28833844
upvote count: 1

http://stackoverflow.com/a/28800945
score: 1
has comment: http://stackoverflow.com/comment/45909590
has comment: http://stackoverflow.com/comment/45914364
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/45911242
accepted answer of: http://stackoverflow.com/q/28756038
answers question: http://stackoverflow.com/q/28756038
type: AcceptedAnswer
has body: In the following code-block, you named events $events when passing it to the function. //app.controller('DayController', ['$scope', 'events', function($scope, $events) { app.controller('DayController', ['$scope', 'events', function($scope, events) { events.success(function(data) { $scope.day = data; }); }]); That is the only error I could find on replicating the project assuming your actual project had angular and angular-routes being correctly pulled into your project (They were missing from your index.html). EDIT: To display the events in the view, you need to set up your ng-repeat differently. Currently, you have "day" in front of the wrong variable. Swap it and it should work as expected. ($scope.events is undefined but $scope.day.events is the list you are looking for in the ng-repeat. Once inside the ng-repeat, the individual elements of the array $scope.day.events are referenced as $scope.event) {{ event.name }} {{ event.from }} - {{ event.to }}
downvote count: 0

http://stackoverflow.com/comment/45853136
score: 0
type: Comment
has text: S'ok :) I did make some leaping assumptions about what he was trying to accomplish with this bit of code, e.g. the "randomNumber" variable.
comment on: http://stackoverflow.com/a/28788723
type: AnswerComment

http://stackoverflow.com/comment/45801299
has text: If you don't load the transitions module, then [`$.support.transition`](https://github.com/twbs/bootstrap/blob/bcf7dd38b5ab180256e2e4fb5da0369551b3f082/js/transition.js#L46) will be undefined, so [transitions will merely be disabled](https://github.com/twbs/bootstrap/blob/442d2dd458c6283c7ecb75c6eb7cb4bcee916eab/js/modal.js#L125)
comment on: http://stackoverflow.com/q/28753211
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/46030336
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28871627
has text: @peterdotjs also could you tell me where in my content_script would I add window.open or chrome.windows

http://stackoverflow.com/q/28886955
tagged with: javascript
tagged with: jquery
score: -1
has answer: http://stackoverflow.com/a/28887543
answer count: 3
downvote count: 1
favorite count: 0
tagged with: backbone.js
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28887590
upvote count: 0
has title: Why can I not trigger a Backbone view's function on window resize?
has body: I have a view with a $(window).on("resize", function) listener in the initialize function. I see others on SO doing this. window.SidebarView = BaseView.extend({ el: "#sidebar-container", template: HB.template("topics/sidebar"), events: { "click .sidebar-tab": "toggle_sidebar", "click .fade": "check_external_click", "click .sidebar-back": "sidebar_back_one_level" }, initialize: function(options) { var self = this; $(window).on("resize", self.render); // blah blah more code }, render: function() { var self = this; this.$el.html(this.template()); // blah blah more code } On window resize, I get an error at this.$el.html(this.template()); in render saying undefined is not an object. I have tried changing self.render to this.render. Same issue. I'm sure I'm missing something tiny.
has answer: http://stackoverflow.com/a/28887555
type: Question

http://stackoverflow.com/q/28805551
tagged with: google-chrome
type: Question
type: AnsweredQuestion
tagged with: javascript
has comment: http://stackoverflow.com/comment/45899863
accepted answer: http://stackoverflow.com/a/28806211
score: 13
has body: I am finished up with my google chrome extension development. Now its time to deploy on google chrome extension dashboard. But the problem is How do I minify my javascript files (background.js and content.js). I can use online tools available but they do one file at a time and do not consider the dependency on other javascript file. For example, message passing between background.js and content.js is done by a key value, which tells the other party that what kind of message is this. I am not sure whether chrome itself minifies my javascript file. I little illiterate here. Please help.
possible better answer: http://stackoverflow.com/a/49906628
has comment: http://stackoverflow.com/comment/140175363
answer count: 2
has answer: http://stackoverflow.com/a/49906628
downvote count: 0
linked to: http://stackoverflow.com/q/522315
has comment: http://stackoverflow.com/comment/45884240
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45919598
tagged with: google-chrome-extension
has comment: http://stackoverflow.com/comment/122982883
upvote count: 13
has answer: http://stackoverflow.com/a/28806211
has title: How to minify my google chrome extension's javascript files

http://stackoverflow.com/q/28757646
possible better answer: http://stackoverflow.com/a/34079080
tagged with: node.js
score: 6
has comment: http://stackoverflow.com/comment/45796002
has body: I'm quite new to Node.js and I'm trying to wrap my head around its error-first callback style. I was curious as to how a function would know if the first parameter was for handling errors and when it's for handling requests and what not since those variable names are arbitrary. Here are some examples of code with and without the err first fs.readFile('/foo.txt', function(err, data) { if (err) { console.log('Ahh! An Error!'); return; } console.log(data); }); and http.createServer(function(req, res) { ... }); I believe the Express framework does this by counting the number of arguments, having err as the optional first arg but in these cases, there are only two arguments.
has answer: http://stackoverflow.com/a/34079080
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28757703
has title: How does Node.js know if the first parameter of a callback is an error handler?
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28757703
upvote count: 6
downvote count: 0
tagged with: javascript
tagged with: callback
tagged with: express
favorite count: 0

http://stackoverflow.com/q/28859238
tagged with: asp.net
has title: ASP .NET table sum of rows and columns with textbox
type: AnsweredQuestion
score: 0
has body: I've got an ASP .NET webforms application where employee's are filling out a timesheet. I've got a table that has ASP:TextBox's for user input and what i'd like to do is calculate the sum total of their hours in the current row and the current column. I've looked at this previous example: SUM Total for Column and it get's me very close. I run the following javascript on every keyup of any textbox: var totalsByRow = [0, 0, 0, 0, 0]; var totalsByCol = [0, 0, 0, 0, 0]; $(document).ready(function () { $('.sum').keyup(function (e) { var $dataRows = $("#sum_table tr:not('.totalColumn, .titlerow')"); $dataRows.each(function (i) { $(this).find('td:not(.totalRow)').each(function (j) { totalsByCol[j] += parseFloat($(this).val()); totalsByRow[i] += parseFloat($(this).val()); }); }); for (var i = 0; i < totalsByCol.length - 1; i++) { totalsByCol[totalsByCol.length - 1] += totalsByCol[i]; } $("#sum_table td.totalCol").each(function (i) { $(this).html("total:" + totalsByCol[i]); }); $("#sum_table td.totalRow").each(function (i) { $(this).html("total:" + totalsByRow[i]); }); }); }); The issue is simple: $(this).html() doesn't get the value of the textbox. I've also tried $(this).val() and $(this).value based on other posts with no success. So how do I get the value of the textbox calling this keyup function? EDIT: The HTMl code I'm using is just a simple test table i've set up. Here it is for further clarification: Apple Orange Watermelon Strawberry Total By Row <asp:TextBox runat="server" ID="TextBox1" CssClass="sum"></asp:TextBox> <asp:TextBox runat="server" ID="TextBox2" CssClass="sum"></asp:TextBox> <asp:TextBox runat="server" ID="TextBox3" CssClass="sum"></asp:TextBox> <asp:TextBox runat="server" ID="TextBox4" CssClass="sum"></asp:TextBox> <asp:TextBox runat="server" ID="TextBox5" CssClass="sum"></asp:TextBox> <asp:TextBox runat="server" ID="TextBox6" CssClass="sum"></asp:TextBox> <asp:TextBox runat="server" ID="TextBox7" CssClass="sum"></asp:TextBox> <asp:TextBox runat="serv…
has answer: http://stackoverflow.com/a/28861242
type: Question
has comment: http://stackoverflow.com/comment/45984211
tagged with: c#
has comment: http://stackoverflow.com/comment/45987683
tagged with: javascript
tagged with: jquery
tagged with: webforms
linked to: http://stackoverflow.com/q/10803996
accepted answer: http://stackoverflow.com/a/28861242
answer count: 1

http://stackoverflow.com/a/28794620
answers question: http://stackoverflow.com/q/28794467
type: Answer
has body: I am not sure whether you have done as below. But try this trouble shooting: First of all, check if you imported jquery.min.jscorrectly, which includes correct path to jquery. Then, check if your script loads only after jquery.min.js is loaded. Once, again please make sure your code (or script) is fired or called only after jquery.min.js is loaded. If this is ok, then, check if, in between any script fails to execute, as if any script fails to run in between, the code following it will be skipped. I mean to say like: line in which your `jquery.min.js` . . . . . Some code that is error prone . . . . . And at last your script lies (which wont fire)
score: 0

http://stackoverflow.com/a/28805497
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28768085
answers question: http://stackoverflow.com/q/28768085
has body: Solved my issue by making the script easier. app.directive('valiCrypt', function ($timeout) { var validateInput =function(input) { // Returns validation logic result here. } return { restrict: 'A', require: 'ngModel', replace: true, scope: { vcModel: "=ngModel", vcDuration: "@", vcText: "@" }, link: function (scope) { if (!scope.vcDuration) { scope.vcDuration = 0; } if (!scope.vcText) { scope.vcText = ""; } scope.$watch('vcModel', function (value) { if (value) { if (value.length === 11) { var result = validateInput(value); if (result) { var copy = angular.copy(scope.vcModel); scope.vcModel = scope.vcText; $timeout(function () { // &lt;script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/sha256.js"&gt;&lt;/script&gt; copy = CryptoJS.SHA256(value); scope.vcModel = copy; }, scope.vcDuration, true); } } } }); } }; });
type: AcceptedAnswer

http://stackoverflow.com/comment/45884013
score: 0
type: Comment
type: QuestionComment
has text: i can't see it load in the devtool->Network->Scripts
comment on: http://stackoverflow.com/q/28804988

http://stackoverflow.com/comment/46035810
has text: @LucasTrzesniewski - I benched it in Perl. The `.*$` was a cut'n paste hang over from a different version, still, I'm using it as a visual aid testing regex using [this](http://www.regexformat.com). They released a fully functional trial version if you want to try it out.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28886707

http://stackoverflow.com/comment/45938835
has text: @sdcr - Why would that cause problems?
comment on: http://stackoverflow.com/q/28834569
type: Comment
type: QuestionComment
score: 3

http://stackoverflow.com/comment/45991187
has text: @prudviraju: You can use the `when` method. I added an example above.
comment on: http://stackoverflow.com/a/28827638
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45925806
type: AnswerComment
type: Comment
score: 0
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/72126/discussion-between-afaan-bilal-and-rish).
comment on: http://stackoverflow.com/a/28824663

http://stackoverflow.com/comment/46091730
type: QuestionComment
comment on: http://stackoverflow.com/q/28900881
score: 1
has text: Not necessarily. I fixed the issue by bypassing angulars $log Service and directly writing to the console from our custom Logger. Apparently there's an issue when applying the respective console function (log, warn, error...) from angular. But it's a seriously weird issue, especially because it's not really debuggable.
type: Comment

http://stackoverflow.com/comment/46030608
comment on: http://stackoverflow.com/q/28884324
score: 0
type: Comment
type: QuestionComment
has text: Removing return stops the tab opening. I'm guessing the script isn't called.

http://stackoverflow.com/comment/45796275
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28757681
type: Comment
has text: In that case, maybe have a separate function outside of the first one that is called when all the data has been added. The second function would contain the loop.

http://stackoverflow.com/a/28855270
has comment: http://stackoverflow.com/comment/45976937
has comment: http://stackoverflow.com/comment/45976843
has body: the problem is with your URL Use the ResolveClientUrl() method &lt;%= ResolveUrl("~/Default.aspx/BuscaEquipe") %&gt; And you must Have [WebMethod] attribute before your static server function [WebMethod] public static string BuscaEquipe(int pIndex, int pLimite, int pUnidadeCE) { //Code } Your data: var requestData= JSON.stringify({ pIndex: pIndex, pLimite: 4, pUnidadeCE: codigoEmitente }) and then data:requestData
has comment: http://stackoverflow.com/comment/45977199
has comment: http://stackoverflow.com/comment/45977261
type: Answer
has comment: http://stackoverflow.com/comment/45977376
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45977341
has comment: http://stackoverflow.com/comment/45976551
accepted answer of: http://stackoverflow.com/q/28855025
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28855025
has comment: http://stackoverflow.com/comment/45977125
upvote count: 1

http://stackoverflow.com/comment/45835924
comment on: http://stackoverflow.com/a/28779189
has text: Sure i will update, But i need admin permission to do the same so raised a ticket, once i check i will let you know thanks a lot :)
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/q/28864412
has comment: http://stackoverflow.com/comment/45994044
has comment: http://stackoverflow.com/comment/45997098
type: Question
type: AnsweredQuestion
answer count: 1
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/14994391
score: 0
has body: I am making an app, the user can either select an item or use their camera to get the qr code which translates into an item's ID. The problem is that I think some JQuery is messing with my scope from working properly. I have to get the QR code by listening to an innerHtml change, once it changes (DOMSubtreeModified) the following occurs. var index = 0; $('#result').one('DOMSubtreeModified', function(e) { var code = ""; if (e.target.innerHTML.length &gt; 0) { code = e.target.innerHTML; $scope.ToRun(code); } }); $scope.ToRun = function(code) { for (i = 0; i &lt; $scope.plantList.length; i++) { if ($scope.plantList[i].plantcode == code) { index = i; break; } } $scope.currentPlant = $scope.plantList[index]; $scope.plantDetails = false; $scope.searchDetails = true; } For some reason the following does not have any effect on my ng-classes. As when an item is selected I hide the input dialogs, and show the result one. $scope.plantDetails = false; $scope.searchDetails = true; But when a user selects the item manually it works just perfectly. (the items have an ng-click on it) $scope.viewPlant = function(plant) { $scope.currentPlant = plant $scope.plantDetails = false; $scope.searchDetails = true; }; And the above works fine, with the ng-click. So why won't my new function that listens for an innerHtml change work? HTML snippet &lt;div ng-class="{ 'hidden': searchDetails }"&gt; &lt;!-- CHOOSE INPUT TYPE --&gt; &lt;div class="form-group" style="margin-bottom:0px"&gt; &lt;div class="btn-group btn-group-justified"&gt; &lt;div class="btn-group"&gt; &lt;button type="button" class="btn btn-default" ng-click="digits = false; qr = true"&gt;Plant Code&lt;/button&gt; &lt;/div&gt; &lt;div class="btn-group"&gt; &lt;button type="button" class="btn btn-default" ng-click="digits = true; qr = false"&gt;QR Code&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;br /&gt; &lt;!-- QR CODE INPUT --&gt; &lt;div ng-class="{ 'hidden': qr }"&gt; &lt;img id="blah" src="./images/placeholder.png…
tagged with: angularjs
has answer: http://stackoverflow.com/a/28864725
accepted answer: http://stackoverflow.com/a/28864725
has comment: http://stackoverflow.com/comment/45994089
has comment: http://stackoverflow.com/comment/45994477
tagged with: http://stackoverflow.com/tag/html
has title: Is JQuery breaking my functionality?

http://stackoverflow.com/comment/45924050
score: 0
type: Comment
type: QuestionComment
has text: have u referenced your `abastecimientos_service.js` in the HTML page??
comment on: http://stackoverflow.com/q/28826836

http://stackoverflow.com/comment/45878149
type: QuestionComment
type: Comment
has text: Check out [this jsbin](http://jsbin.com/layupipame/1/edit); it will tell you why it doesn't work, i.e. parse error.
comment on: http://stackoverflow.com/q/28802175
score: 0

http://stackoverflow.com/a/28842225
has body: Three things here: var x = document.body.forms["example"]["firstname_"].value; document.write NULL The forms property does not exist on body use: var x = document.forms["example"]["firstname_"].value; using document.write when the page is already loaded will cause a new document to be written, replacing the current one, thus breaking your page. NULL will also throw an error since it's undefined use null in lowercase. Why was your code not executing; because document.body.forms threw an error, halting further script execution. You can easily debug such errors by yourself by using the build in development tools present in all major browsers. You can bring them up with F12.
has comment: http://stackoverflow.com/comment/45953678
accepted answer of: http://stackoverflow.com/q/28842111
score: 0
answers question: http://stackoverflow.com/q/28842111
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/45991836
has text: You need to specify `dataType: 'json'` in your ajax call if you 're returning json data.
comment on: http://stackoverflow.com/q/28863291
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/62984304
has text: @MikeWilliamson: I linter/stylechecker/etc could find such mistakes as well and guarantee (as a part of your build process) that they don't happen. Or we could blame the "bundle" concatenation script whose responsibility it actually is to take care of these things. I believe that such setting things up properly is better style than to take mostly unnecessary precautions in each and every file - and that's probably also the reason why these things (`void …`, [`;(…)`](http://stackoverflow.com/q/1873983/1048572), [`!…`](http://stackoverflow.com/q/5827290/1048572)) never took off.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28828348

http://stackoverflow.com/comment/45938648
has text: As Vinay K says, it is working correctly. console.log(e) comes after console.log('this should be called 1st')
score: 0
comment on: http://stackoverflow.com/q/28833043
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28845289
has comment: http://stackoverflow.com/comment/45959365
has comment: http://stackoverflow.com/comment/45959286
possible better answer: http://stackoverflow.com/a/28845394
has body: EDIT: Rephrased the question so that it is less ambiguous. I have two HTML files, x.html and y.html, and I have two javascript files, x.js and y.js. I have a form in x.html like so: &lt;form action="y.html"&gt; &lt;input type="text" value="Blank." /&gt; &lt;br /&gt; &lt;input type="submit" /&gt; &lt;/form&gt; Note that x.html and x.js work together, and y.html and y.js work together. I want to access the value that a user submits into this form from y.js. How do I do this? Thank you!
answer count: 3
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45959385
tagged with: user-input
favorite count: 0
has comment: http://stackoverflow.com/comment/45959291
score: -3
has comment: http://stackoverflow.com/comment/45959450
downvote count: 4
has answer: http://stackoverflow.com/a/28845394
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28845474
has title: Access HTML form submitted value from a different javascript file?
tagged with: forms
has answer: http://stackoverflow.com/a/28845395
type: Question
has comment: http://stackoverflow.com/comment/45959382
has comment: http://stackoverflow.com/comment/45959323
has comment: http://stackoverflow.com/comment/45959384
has comment: http://stackoverflow.com/comment/45959513
has answer: http://stackoverflow.com/a/28845474
tagged with: javascript

waveform
tag name: waveform
type: Tag
tags question: http://stackoverflow.com/q/28804356

http://stackoverflow.com/q/28851993
has body: I know that embed code can autoplay but youtube will not calculate these views. However I search for javascript that automatically play the video after the visitor stay for XX seconds in site. i.e: I want to Auto Play Youtube Embedded Video without editing the embedding code. Can that be?
has answer: http://stackoverflow.com/a/28852500
type: AnsweredQuestion
tagged with: view
tagged with: youtube
tagged with: embed
type: Question
score: 0
has title: Javascript to auto play youtube video?
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28852500

http://stackoverflow.com/comment/45797178
type: AnswerComment
comment on: http://stackoverflow.com/a/28756331
score: 0
type: Comment
has text: Thanks a lot. onLoad is asynchronous indeed. :)

http://stackoverflow.com/comment/45929334
comment on: http://stackoverflow.com/q/28829299
type: QuestionComment
type: Comment
has text: Use #index to check counter for different pageDetails section
score: 0

http://stackoverflow.com/a/28833174
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/45943162
score: 4
has body: For one, it's easier to read. Performance is rarely more important than that. Also, you could make a dedicated arity 2 function with nearly the same performance. The other benefit is the composition can be easily changed at runtime. You can create versions that trim before capitalization, capitalize before trimming, trim only, capitalize only, or neither, without having to explicitly specify every single combination in the code. This can greatly simplify your code sometimes. Runtime composition is one of those things you never knew you always wanted. For example: var c = function(x) {return x;} // identity var onTrimClick = function() {c = compose(c, trim);} var onCapitalizeClick = function() {c = compose(c, capitalize);} var onSomethingElseClick = function() {c = compose(c, somethingElse);} This lets you create a composed function c at runtime based on what the user clicks and in what order.
accepted answer of: http://stackoverflow.com/q/28821765
answers question: http://stackoverflow.com/q/28821765
upvote count: 4
type: AcceptedAnswer

http://stackoverflow.com/q/28783759
accepted answer: http://stackoverflow.com/a/28783975
has comment: http://stackoverflow.com/comment/45844136
score: -1
type: AnsweredQuestion
downvote count: 1
has title: Local Image object not getting initialized properly in Javascript
type: Question
tagged with: google-maps
upvote count: 0
has answer: http://stackoverflow.com/a/28783975
tagged with: javascript
tagged with: google-maps-markers
answer count: 1
favorite count: 0
has body: I am facing an issue where local object in For loop in not getting initialized for every iteration in Javascript. Below code works fine: function initialize() { var mapOptions = { zoom: 10, center: new google.maps.LatLng(-33.9, 151.2) } var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); setMarkers(map, beaches); } var beaches = [ ['Bondi Beach', -33.890542, 151.274856, 4, 'https://google-developers.appspot.com/maps/documentation/javascript/examples/full/images/beachflag.png'], ['Coogee Beach', -33.923036, 151.259052, 5, 'https://google-developers.appspot.com/maps/documentation/javascript/examples/full/images/beachflag.png'], ['Cronulla Beach', -34.028249, 151.157507, 3, 'https://google-developers.appspot.com/maps/documentation/javascript/examples/full/images/beachflag.png'], ['Manly Beach', -33.80010128657071, 151.28747820854187, 2, 'https://google-developers.appspot.com/maps/documentation/javascript/examples/full/images/beachflag.png'], ['Maroubra Beach', -33.950198, 151.259302, 1, 'https://google-developers.appspot.com/maps/documentation/javascript/examples/full/images/beachflag.png'] ]; function setMarkers(map, locations) { for (var i = 0; i &lt; locations.length; i++) { var beach = locations[i]; var image = { url: beach[4], size: new google.maps.Size(20, 32), origin: new google.maps.Point(0, 0), anchor: new google.maps.Point(0, 32) }; var myLatLng = new google.maps.LatLng(beach[1], beach[2]); var marker = new google.maps.Marker({ position: myLatLng, map: map, icon: image, title: beach[0], zIndex: beach[3] }); } } google.maps.event.addDomListener(window, 'load', initialize) However, if my first array becomes like this, all the flags stops displaying.: ['Bondi Beach', -33.890542, 151.274856, 4, '']; Why Map Marker is not getting initialized every time? Is there something in Google Maps which I am missing here? JSFiddle link for the sample code: http://jsfiddle.net/anujagg/Lrkvu4mu/25/ Thanks.

http://stackoverflow.com/q/28855309
has comment: http://stackoverflow.com/comment/46009122
answer count: 1
favorite count: 0
has title: dc.js and crossfilter reduce average counts per day of week
type: UnansweredQuestion
has body: I am struggle to get my crossfilter groups set up right. Maybe someone can drop a hint! My datastructure looks more or less this way: {datetime: "2014-01-01 20:00:00", id:1} {datetime: "2014-01-01 22:21:08", id:2} {datetime: "2014-01-02 12:00:23", id:3} etc... The dimension is on datetime to return the day of week: var weekdayDimension = ndx.dimension(function(d) { return new Date(d.datetime).getDay(); }); Now I have problems with the grouping. I want the average count of events per weekday. So far I have (of course no correct) var weekdayAvgGroup = weekdayDimension.group(function (d) { return d; }); I think I do not understand what that grouping is doing exactly... My goal is to have some chart like: Monday =&gt; Average 40.3 Events Tuesday =&gt; Average 35.4 Events I created a JSFiddle please take a look. Can anybody drop a hint please? UPDATE: After additional thinking I could create a dimension on the Date. All I would have to do is to know the number of days selected in order to calculate the (total amount of events selected/number of selected days) So I would need to count the number of groups on the date dimension. But haven't found the solution on this one either. Thank you
score: 3
has comment: http://stackoverflow.com/comment/51729264
upvote count: 3
has comment: http://stackoverflow.com/comment/46012012
type: Question
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28879739
tagged with: dc.js
tagged with: crossfilter
has comment: http://stackoverflow.com/comment/46018315

http://stackoverflow.com/comment/45957584
comment on: http://stackoverflow.com/a/28842366
has text: Hmm, I not sure, but if you look at "XMLHttpRequest monitoring" on this site that might give you a clue. http://getfirebug.com/network
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45841824
has text: Please post a jsfiddle or the entire html/css in this post so we can see exactly what you are doing.
comment on: http://stackoverflow.com/q/28782274
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45827059
type: QuestionComment
has text: I don't meant to print directly, i want to show the preview print dialog
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28774184

http://stackoverflow.com/comment/45858158
has text: yes. I want the user to confirm cancelling by custom confirm box.
comment on: http://stackoverflow.com/q/28791508
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28801507
has body: I am dealing with a RTCPeerConnection (pc) which has an event handler named onnegotiationneeded. The "onnegotiationneeded" is triggered when a complete media stream is added or removed with pc.addStream or pc.removeStream. Is it possible to tell inside the onnegotiationneeded function if it has been executed because the stream was added or removed? Because from reading the docs I couldn't find a state for that. At the moment I am switching a flag when I do pc.addStream or pc.removeStream. This flag helps me to tell within onnegotiationneeded if it has been triggered by a stream remove or not. But I was wondering if there is already such a property given by the browser's (Chrome 40 or Firefox 36) API?
downvote count: 0
type: UnansweredQuestion
upvote count: 8
type: Question
tagged with: sdp
tagged with: webrtc
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/46182286
favorite count: 0
tagged with: peer-connection
has title: How to tell if pc.onnegotiationneeded was fired because stream has been removed?
tagged with: http://stackoverflow.com/tag/html
score: 8

http://stackoverflow.com/q/28899838
type: AnsweredQuestion
score: 0
has comment: http://stackoverflow.com/comment/46058953
has comment: http://stackoverflow.com/comment/46062533
upvote count: 1
has body: I'm looking for a solution that will make scrollTop not to leave records in browser history. When i first launch the page I wanted browser to go to a specific section of it if url has a parameter with an internal anchor name. so i do this: $('html,body').animate( { scrollTop: $(".section[tagname='"+url_tagname+"']").offset().top }, 'slow'); But now when i hit browser "back" button it goes to the page top first. SO i actually have to hit "back" twice to go to previous page. Is there a way to make scrolltop not to leave navigation history?
downvote count: 1
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28900806
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/46059816
favorite count: 0
accepted answer: http://stackoverflow.com/a/28900806
tagged with: scrolltop
has title: make jQuery scrollTop Not to leave browser history

http://stackoverflow.com/q/28831331
tagged with: node.js
has comment: http://stackoverflow.com/comment/45933627
score: 0
linked to: http://stackoverflow.com/q/8125507
tagged with: nginx
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45933567
has comment: http://stackoverflow.com/comment/45934884
tagged with: real-time
answer count: 0
has comment: http://stackoverflow.com/comment/45941260
tagged with: websocket
has body: I know there are a lot of articles and notes about this, but I can't find any good client and server examples. Also, I'm not understanding exactly what should the Nginx server do after the first handshake. There's an upgrade header, I know that, but from a perspective of a sysadmin, what are the changes that needs to be done so the servers create and maintain open a connection of WS? For the client side, I wrote this: window.onload = function() { var socket = new WebSocket('wss://echo.websocket.org'); socket.onopen = function(event) { console.log('conectat'); socket.send("Here's some text that the server is urgently awaiting!"); }; } I'm not understanding how to write the server side code, and in what. For the example above, I just want a sample code of the server side that sends back whatever I send to the server. What this code will look like? I appreciate any schema/sample of code, but please don't provide stuff like "Try Socket.IO". I need something raw so I can understand exactly what is happening.
type: Question
has comment: http://stackoverflow.com/comment/46123006
has title: How to start coding for websockets?

http://stackoverflow.com/comment/45867459
comment on: http://stackoverflow.com/q/28796365
has text: Yes, exactly. You can even use a complete object literal then, like `var smileys = {":/":"derp.png", ":)":"happy.png", …};`
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45826498
type: Comment
type: QuestionComment
has text: @Oriol Edited the post to show exactly where in the code block
comment on: http://stackoverflow.com/q/28773851
score: 0

http://stackoverflow.com/q/28842355
type: AnsweredQuestion
downvote count: 0
type: Question
has comment: http://stackoverflow.com/comment/45954125
has comment: http://stackoverflow.com/comment/45954167
accepted answer: http://stackoverflow.com/a/28842483
has answer: http://stackoverflow.com/a/28842529
tagged with: javascript
score: 4
has comment: http://stackoverflow.com/comment/45953960
answer count: 2
has answer: http://stackoverflow.com/a/28842483
has comment: http://stackoverflow.com/comment/45954657
favorite count: 0
has body: Here is my HTML &lt;h2&gt;Please Enter the Value in the Box(click on the desired value)&lt;/h2&gt; &lt;input id='value' type="text" autocomplete="on" placeholder="country" /&gt; &lt;div id="dropdown"&gt; &lt;select name="list" id="list"&gt;&lt;/select&gt; &lt;/div&gt; Here is my JavaScript var arr = ["Afghanistan","Albania","Algeria","Andorra","Angola","Anguilla","Antigua &amp;amp; Barbuda","Argentina","Armenia","Aruba","Australia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bermuda","Bhutan","Bolivia","Bosnia &amp;amp; Herzegovina","Botswana","Brazil","British Virgin Islands","Brunei","Bulgaria","Burkina Faso","Burundi","Cambodia","Cameroon","Cape Verde","Cayman Islands","Chad","Chile","China","Colombia","Congo","Cook Islands","Costa Rica","Cote D Ivoire","Croatia","Cruise Ship","Cuba","Cyprus","Czech Republic","Denmark","Djibouti","Dominica","Dominican Republic","Ecuador","Egypt","El Salvador","Equatorial Guinea","Estonia","Ethiopia","Falkland Islands","Faroe Islands","Fiji","Finland","France","French Polynesia","French West Indies","Gabon","Gambia","Georgia","Germany","Ghana","Gibraltar","Greece","Greenland","Grenada","Guam","Guatemala","Guernsey","Guinea","Guinea Bissau","Guyana","Haiti","Honduras","Hong Kong","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Isle of Man","Israel","Italy","Jamaica","Japan","Jersey","Jordan","Kazakhstan","Kenya","Kuwait","Kyrgyz Republic","Laos","Latvia","Lebanon","Lesotho","Liberia","Libya","Liechtenstein","Lithuania","Luxembourg","Macau","Macedonia","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Mauritania","Mauritius","Mexico","Moldova","Monaco","Mongolia","Montenegro","Montserrat","Morocco","Mozambique","Namibia","Nepal","Netherlands","Netherlands Antilles","New Caledonia","New Zealand","Nicaragua","Niger","Nigeria","Norway","Oman","Pakistan","Palestine","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Poland","Portugal","Puer…
has title: Implementing a AutoComplete dropdown in plain JavaScript
has comment: http://stackoverflow.com/comment/45953913
possible better answer: http://stackoverflow.com/a/28842529
has comment: http://stackoverflow.com/comment/45954039
upvote count: 4

http://stackoverflow.com/a/28807014
type: AcceptedAnswer
downvote count: 0
has body: Well, in your code snippet you are explicitly setting the same id (that equals '1') to each row you are inserting. That can't work, as primary keys need to differ, right? :) The thing with autoincrementing columns is that you don't provide value for them, they are set up for you automatically. So just omit the 'id' column when inserting, like this: tx.executeSql('INSERT INTO activity_stream (band, clubID, time, title) VALUES (?, ?, ?, ?), [Xband, XclubID, Xtime, Xtitle]');
score: 1
answers question: http://stackoverflow.com/q/28803858
has comment: http://stackoverflow.com/comment/46032096
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28803858

http://stackoverflow.com/comment/45964170
has text: Chrome has a "device mode" that is exactly what you need. You can get to it through the developer tools window, or press ctrl-shift-M. But there is no way (AFAIK) to launch chrome already in that mode. Docs here: https://developer.chrome.com/devtools/docs/device-mode
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28848023

http://stackoverflow.com/q/28792993
has comment: http://stackoverflow.com/comment/49059484
score: 12
tagged with: prerender
answer count: 1
downvote count: 0
has title: Using prerender with proxy in nginx
favorite count: 0
tagged with: angularjs
has body: I'm trying to use prerender.io to get an snapshot of angularjs pages. Currently I have an NodeJS instance for the web app and nginx reverse proxy redirects requests from port 80 to 4000. According to prerender nginx manual (https://gist.github.com/thoop/8165802) I can forward search-engine bot requests to the prerender url but because I already have a proxy for NodeJS application, I don't know how can I prerender try_files directive. My question is, how can I use both NodeJS application proxy and prerender directive?
accepted answer: http://stackoverflow.com/a/30549900
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/49131918
type: Question
upvote count: 12
tagged with: nginx
tagged with: javascript
has answer: http://stackoverflow.com/a/30549900

http://stackoverflow.com/comment/46000430
type: QuestionComment
has text: Do you just want to [create Markers from XML](http://stackoverflow.com/search?q=%5Bgoogle-maps-api-3%5D+markers+from+XML)?
score: 0
comment on: http://stackoverflow.com/q/28867966
type: Comment

http://stackoverflow.com/q/28903678
has answer: http://stackoverflow.com/a/28904059
score: 0
has title: Open now time button
has answer: http://stackoverflow.com/a/28903956
has comment: http://stackoverflow.com/comment/46066909
tagged with: time
has comment: http://stackoverflow.com/comment/46067095
tagged with: loops
type: Question
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
linked to: http://stackoverflow.com/q/242841
accepted answer: http://stackoverflow.com/a/28903956
has comment: http://stackoverflow.com/comment/46067273
answer count: 2
has body: I am trying to create a button that displays what shops are open at the time I push the button. I am using filterJSON: Function() to filter out the times that are open but I can't seem to get the loop to display just the open times. I know what I need to do to create the button but can't figure out a way to just display open times at the the current time. var hours = feature.properties.hours; for (y = 0; y &lt; hours.length; y++) { var normalizeHours= hours[y].replace(/\s/g, '').toLowerCase(); if (watcher.indexOf(normalizeHours) !== -1) { return feature; } }` JSON is below hours: { monday: { close: "18:00:00", open: "10:00:00", call: false }, tuesday: { close: "18:00:00", open: "12:00:00", call: true }, friday: { close: "None", open: "None", call: false }, wednesday: { close: "18:00:00", open: "17:00:00", call: false }, thursday: { close: "None", open: "None", call: true }, sunday: { close: "18:00:00", open: "15:33:00", call: false }, saturday: { close: "18:00:00", open: "15:00:00", call: false } },
possible better answer: http://stackoverflow.com/a/28904059
tagged with: button
tagged with: javascript

http://stackoverflow.com/comment/45854539
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28789277
type: Comment
has text: I'm checking the dump by assigning the inner HTML of a div on the page. It's easier and quicker when running it. `$_POST['name']` is undefined in all browsers.

http://stackoverflow.com/a/30259515
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28782027
has body: The easiest solution I could find (just to end this unanswered question), was to write the checked property into the checked-attribute of all checkboxes and radiobuttons everytime one of them changes a value. This brief jquery-code takes care of this, and makes sure only those input-elements have their attribute changed where the property and the attribute do not yet correspond. $("input[type=checkbox], input[type=radio]").change(function () { $("input[checked='checked']:not(:checked)").each(function (index) { $(this).removeAttr('checked'); }); $("input:not([checked='checked']):checked").each(function (index) { $(this).attr('checked', 'true'); }); });
answers question: http://stackoverflow.com/q/28782027
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/q/28873819
has title: jQuery return undefined when work with String.FromCharCode
has answer: http://stackoverflow.com/a/28873999
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46010997
type: Question
score: 0
has comment: http://stackoverflow.com/comment/46011177
accepted answer: http://stackoverflow.com/a/28873999
has comment: http://stackoverflow.com/comment/46010319
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46010270
has body: I have jQuery code that must change Cyrillic input to Latin. This looking for position of Cyrillic char in array and replace it's with Latin Char, unfortunately I'm receiving undefined. $("input[name*=Name]").keypress(function (e) { if (e.charCode &gt;= 1000 &amp;&amp; e.charCode &lt;= 1103) { var englishchars = ["a", "b", "v", "g", "d", "e", "yo", "zh", "z", "i", "yi", "k", "l", "m", "n", "o", "p", "r", "s", "t", "u", "f", "kh", "c", "ch", "sh", "shch", "i", "e", "yu", "ya"]; var slavicchars = ["a", "б", "в", "г", "д", "е", "ё", "ж", "з", "и", "й", "к", "л", "м", "н", "о", "п", "р", "c", "т", "у", "ф", "х", "ц", "ч", "ш", "щ", "ы", "э", "ю", "я"]; var verified = String.fromCharCode(e.key).match(/[^а-яё]/); if (verified) { e.preventDefault(); //If it's first char return, if not - get last char var lastchar = this.value.length &gt; 1 ? this.value.substr(-1) : this.value; //Get position of Cyrillic char in array var russiancharindex = jQuery.inArray(lastchar, slavicchars); //Looking for corresponding Latin char var englishcharindex = englishchars[russiancharindex]; this.value = this.value.replace(lastchar, englishcharindex); } } });

http://stackoverflow.com/a/28768659
answers question: http://stackoverflow.com/q/28768099
type: AcceptedAnswer
downvote count: 0
has body: Not sure if this has to do with the version of the jQuery (as it works on the fiddle but not if i change the jquery version) You could alter it a bit to work on a simple object var e = jQuery.Event('mousemove'); e.pageX = jQuery(window).width() / 2; jQuery({pageX:e.pageX}).animate({pageX: 1000}, { step: function(){ console.log(this.pageX); e.pageX = this.pageX; jQuery('.mouseover').trigger(e); }, duration: 5000, easing: 'linear' } );
upvote count: 2
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/28768099
has comment: http://stackoverflow.com/comment/45816693

http://stackoverflow.com/q/28851942
tagged with: indexeddb
tagged with: javascript
has title: Indexeddb OpenCursor returns null on specific key-value
score: 0
has body: I am working on Indexeddb, I have an objectstore named Items_S1 and KeyPath: "ItemID" I have some orders in the objectstore having ORDERID, ItemID, ItemName, Qty, Rate and NetAmount. While ordering same item again, it increases its quantity.. Now the problem is that when I click a button next to any record to decrease its quantity Nothing happens... same code is working in another project but here I am having problem... I used OpenCursor() but it is returning null. Somebody help Me please, here is the code: $("#cart_menu").on("click", "#deselect", function(){ var thisId = $(this).parent().parent().data("key"); var transaction = db.transaction(["Item_S1"], "readwrite"); var objectstore = transaction.objectStore("Item_S1"); objectstore.openCursor(thisId).onsuccess = function(e){ var cursor = e.target.result; if(cursor){ if(Number(cursor.value.ItemQty) &gt; 1) { objectstore.put({ OrderID: cursor.value.OrderID, ItemID: cursor.value.ItemID, ItemName: cursor.value.ItemName, ItemQty: Number(cursor.value.ItemQty) - 1, ItemRate: cursor.value.ItemRate , ItemAmnt: (Number(cursor.value.ItemQty) - 1) * Number(cursor.value.ItemRate), ItemID: cursor.value.ItemID }); } else { objectstore.delete(cursor.value.ItemID); } } }; transaction.oncomplete = function(){ displayMenuItem(); }; });
answer count: 1
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28892989
upvote count: 1
downvote count: 1
type: Question

http://stackoverflow.com/comment/45994301
type: Comment
has text: @gpapps you have to set the `G` (global) flag. I've just edited the answer
comment on: http://stackoverflow.com/a/28864487
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45923139
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28826175
has text: @war1oc The argument to `JSON.parse()` should be a string, not an object.

http://stackoverflow.com/comment/46033122
has text: You're welcome! And I'm sorry, but I don't have experience with drag and drop so I'm not sure how you would do it.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28882543
type: Comment

http://stackoverflow.com/a/28805919
has comment: http://stackoverflow.com/comment/45885870
has comment: http://stackoverflow.com/comment/45885062
answers question: http://stackoverflow.com/q/28805875
has comment: http://stackoverflow.com/comment/45885177
score: 0
type: AcceptedAnswer
has body: You can't use confirm when dealing with that event, you must return a string that will be used as a confirmation message : angular.element($window).bind("beforeunload", function (event) { return 'Sure?'; }); see the MDN on beforeunload Note that you have no real guarantee the user will see this confirmation dialog : 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. The rationale is that a site should not make it difficult or painful to close the tab/window/browser.
type: Answer
has comment: http://stackoverflow.com/comment/45886021
has comment: http://stackoverflow.com/comment/45886096
accepted answer of: http://stackoverflow.com/q/28805875

http://stackoverflow.com/comment/46127581
type: AnswerComment
type: Comment
has text: try this and let me know if you have still problems
comment on: http://stackoverflow.com/a/28936165
score: 0

http://stackoverflow.com/comment/46018242
score: 0
type: Comment
type: QuestionComment
has text: need document.getElementById("id").value; insted of id.value
comment on: http://stackoverflow.com/q/28878190

http://stackoverflow.com/comment/46062479
type: AnswerComment
score: 0
type: Comment
has text: That worked! Thank you! May the beer fairy be good to you this weekend.
comment on: http://stackoverflow.com/a/28899416

http://stackoverflow.com/comment/46013676
has text: i didnt wrote about ffmpeg... because done that i will improve the websocket system to control the machine...
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28875330

http://stackoverflow.com/a/28898681
has body: You need to select each element of your list by doing list[index] like so: var list = document.getElementsByClassName('Me'); for (var i = 0; i < list.length; i++) { var me = list[i]; console.log(me.offsetTop); } div,p { position: relative; } div{ background:#ddd;} .Me{ background:#7ae;} Content before container Space content padding Me 1 Me 2 Me 3
score: 5
type: Answer
answers question: http://stackoverflow.com/q/28898604
accepted answer of: http://stackoverflow.com/q/28898604
upvote count: 5
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/28902166
has body: You can remove push effect on button by adding a button { padding:0; }
answers question: http://stackoverflow.com/q/28901777
has comment: http://stackoverflow.com/comment/46071215
score: 0
type: Answer

http://stackoverflow.com/q/28807867
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28807958
has body: I have a table as follows: $(document).ready(function(){ $("button").click(function(){ // I'd like a suggestion here }); }); Name Email abc abc@gmail.com xyz xyz@gmail.com click here I want after clicking that button it should create a json object conataining all data in table send it to the another url using jquery.
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
score: 0
has comment: http://stackoverflow.com/comment/45888481
accepted answer: http://stackoverflow.com/a/28807958
tagged with: http://stackoverflow.com/tag/html
has title: How to post data in JSON format from table using jQuery
tagged with: css
upvote count: 1
downvote count: 1

http://stackoverflow.com/comment/46105047
score: 0
type: Comment
has text: yes unfortunately. in fact, on mobile that popup does not even show
comment on: http://stackoverflow.com/a/28918830
type: AnswerComment

http://stackoverflow.com/a/28773526
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45825553
has body: http://somescript.js seems like a very improbable URL for your script src, are you sure that's something which resolves locally to a script?
has comment: http://stackoverflow.com/comment/45826405
answers question: http://stackoverflow.com/q/28773302
upvote count: 2
has comment: http://stackoverflow.com/comment/45826284

http://stackoverflow.com/q/28789259
upvote count: 2
has title: Reload part of page, not whole page, once Ajax is successful. Laravel
answer count: 1
favorite count: 0
tagged with: ajax
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45854110
has answer: http://stackoverflow.com/a/28789316
tagged with: php
tagged with: laravel
score: 2
downvote count: 0
has body: I'm using Laravel 4 for my project. I have a "newsfeed" of posts. Each post can be commented on. When a user comments on a post the page reloads and the new comment is shown in the comment box. How ever i do not want the whole page to reload. So, I'm able to submit the post using ajax. I submit the form and prevent the page from refreshing. However, now I don't know how to get the comment to appear on the post without manually refreshing the page? Here is my route for posting comments: Route::post('post/{id}/comment', ['as' =&gt; 'commentPost', 'uses' =&gt; 'CommentsController@postComment']); The controller that posts this comment to the DB: public function postComment() { extract(Input::only('user_id', 'resource_id', 'body')); $this-&gt;execute(new PostCommentCommand($user_id, $resource_id, $body)); return Redirect::back(); } Im using a command bus that ultimately saves the comment to the DB like this: public function leaveComment($user_id, $resource_id, $body) { $comment = Comment::leavePostComment($resource_id, $body); User::findOrFail($user_id)-&gt;comments()-&gt;save($comment); return $comment; } Comment model: public static function leavePostComment($resource_id, $body) { return new static([ 'resource_id' =&gt; $resource_id, 'body' =&gt; $body ]); } Here is the view that loads the comment box (contains all comments belonging to the post and a type box for posting new comments. I use JS to post the comment when user hits "enter/return" key): &lt;div class="comment-box-container"&gt; &lt;div class="comment-box"&gt; @if ($type-&gt;comments) @foreach ($type-&gt;comments as $comment) &lt;div class="user-comment-box"&gt; &lt;div class="user-comment"&gt; &lt;p class="comment"&gt; &lt;!-- starts off with users name in blue followed by their comment--&gt; &lt;span class="tag-user"&gt;&lt;a href="{{ route('profile', $comment-&gt;owner-&gt;id) }}"&gt;{{ $comment-&gt;owner-&gt;first_name }}&amp;nbsp;{{ $comment-&gt;owner-&gt;last_name }}&lt;/a&gt;&amp;nbsp;&lt;/span&gt;{{…
type: Question
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/28911400
has comment: http://stackoverflow.com/comment/46143778
type: AcceptedAnswer
has body: You can modify the tooltip's anchoring code: Html target: &lt;span id="temp-log"&gt;&lt;/span&gt; Chart: var s = $("#temp-log").kendoSparkline({ type: "column", data: [ 16, 17, 18, 19, 20, 21, 21, 22, 23, 22, 20, 18, 17, 17, 16, 16, 17, 18, 19, 20, 21, 22, 23, 25, 24, 24, 22, 22, 23, 22, 22, 21, 16, 15, 15, 16, 19, 20, 20, 21 ], tooltip: { format: "{0} &amp;deg;C" } }).data("kendoSparkline"); This will only change the tooltip for this specific chart: var templogHeight = $("#temp-log").height(); s._tooltip._slotAnchor = function(point, slot) { var result = kendo.dataviz.SharedTooltip.fn._slotAnchor.call(this, point, slot); return { x: result.x, y: result.y - templogHeight }; }; (demo) You could also do this for all sparkline charts by overriding the widget and changing the anchor code in the widget's init method.
score: 0
accepted answer of: http://stackoverflow.com/q/28904579
answers question: http://stackoverflow.com/q/28904579
type: Answer

http://stackoverflow.com/a/28752523
type: AcceptedAnswer
downvote count: 0
has body: Go to the theme directory: /wp-content/themes/yourtheme/ Create a file here which will be your custom page template, e.g: customtemplate.php Start the file off with the following, which will allow you to select this template from within WordPress: &lt;?php /* Template name: Custom Page */ ?&gt; Create the WordPress loop if needed (this will allow whatever you type in the admin to display on the website): &lt;?php if ( have_posts() ) { while ( have_posts() ) { the_post(); } // end while } // end if ?&gt; Now from the page edit screen on the right, select TEMPLATE - and choose your template name, as defined in step 3.
answers question: http://stackoverflow.com/q/28752226
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/45787356
accepted answer of: http://stackoverflow.com/q/28752226
score: 1

http://stackoverflow.com/a/28834865
score: 0
has body: I would recommend using radio buttons for that. Also there is an error variable given by angular. With mixing these things and html5, you can simply create good validation for this. Without need to submit that to functions. ... Dog Cat Please select one. Here is something about it.
answers question: http://stackoverflow.com/q/28834654
type: Answer

http://stackoverflow.com/q/28854239
type: AnsweredQuestion
score: 1
downvote count: 1
has answer: http://stackoverflow.com/a/28854344
has comment: http://stackoverflow.com/comment/45974702
has comment: http://stackoverflow.com/comment/45974798
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/28854409
has title: Displaying Source Code of HTML
has answer: http://stackoverflow.com/a/28854490
tagged with: javascript
has answer: http://stackoverflow.com/a/28854348
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/1815021
has comment: http://stackoverflow.com/comment/45974739
answer count: 4
favorite count: 0
possible better answer: http://stackoverflow.com/a/28854490
accepted answer: http://stackoverflow.com/a/28854344
has body: I'm creating a Feature Index for a website and I thought that it would be nice if the user could just click on a link to view the source code instead of using the browser developer tools. After some research I found that we can easily view the source code of the current page like this: View Source Sadly, i'm kind of a big javascript noob still and was wondering if there is a way to hyperlink to the source code of other HTML pages on the site. Thanks

http://stackoverflow.com/a/28885859
answers question: http://stackoverflow.com/q/28885644
has comment: http://stackoverflow.com/comment/46033203
has comment: http://stackoverflow.com/comment/46033118
has body: $(window).on('resize', function (e) { if (window.foo) clearTimeout(window.foo); window.foo = setTimeout(function () { //reload your page after resize (not the best way... but works) this.location.reload(false); //or reexecute your function (better :) ) //... }, 100); });
type: Answer
score: 0

http://stackoverflow.com/a/28844440
answers question: http://stackoverflow.com/q/28844398
score: 0
type: AcceptedAnswer
has body: Use String.Format to be clearer, and put spaces in your strings. and use "" to have VB write a single double-quote character. Dim viewLink as String = String.Format( _ "View Item ", _ item_id _ ) This will render like this: View Item That said, links in emails will generally always open in a new window, regardless of e-mail client used (e.g. desktop Outlook, GMail, etc), so adding an explicit target="_blank" is unnecessary.
has comment: http://stackoverflow.com/comment/45958725
type: Answer
has comment: http://stackoverflow.com/comment/45960739
accepted answer of: http://stackoverflow.com/q/28844398

http://stackoverflow.com/comment/45942563
has text: Avoid `body` for delegation to avoid any chance of hitting the "0-computed height" bug. Always default to `document`.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28836452

http://stackoverflow.com/comment/45862522
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28786616
has text: can you please show me the demo,I could not run the example
score: 0

http://stackoverflow.com/comment/45907942
type: QuestionComment
comment on: http://stackoverflow.com/q/28818145
has text: maybe this could help http://stackoverflow.com/questions/5379120/get-the-highlighted-selected-text
score: 0
type: Comment

http://stackoverflow.com/comment/57388864
score: 3
type: AnswerComment
comment on: http://stackoverflow.com/a/34823160
type: Comment
has text: please explain a bit around your code. That would improve your answer.

http://stackoverflow.com/comment/46045284
has text: so you are saying it loads fine at app entry point?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28892232
score: 0

http://stackoverflow.com/q/28869292
type: AnsweredQuestion
tagged with: conversion-tracking
has answer: http://stackoverflow.com/a/28869350
has title: Conversion Tracking After Specific Time
type: Question
tagged with: javascript
has body: I want to set up a conversion metric to track when a user has been on a page longer than 30 seconds. I'm confused about Google Adwords. It's provided me with a piece of javascript code to inject into my body tag. Here's my problem. There is no obvious piece of code that I see that actually initiates the conversion. Look below: &lt;!-- Google Code for 30+ Seconds on site Conversion Page --&gt; &lt;script type="text/javascript"&gt; /* &lt;![CDATA[ */ var google_conversion_id = "my id here"; var google_conversion_language = "en"; var google_conversion_format = "3"; var google_conversion_color = "ffffff"; var google_conversion_label = "the label"; var google_remarketing_only = false; /* ]]&gt; */ &lt;/script&gt; &lt;script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js"&gt; &lt;/script&gt; My plan is to set up a simple timeout delay in javascript and once those 30 seconds have past, then run the code above. But will that work? I don't see any line that shouts "Hey, this line of code communicates to the google server and initiates this conversion". What do I need to do get this to work? Thanks.
tagged with: google-ads-api
score: 0
accepted answer: http://stackoverflow.com/a/28869350
answer count: 1

http://stackoverflow.com/comment/46065118
score: 0
comment on: http://stackoverflow.com/a/28902814
type: Comment
has text: @ajmajmajma yep, added an example of that.
type: AnswerComment

http://stackoverflow.com/q/28845753
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
has body: this is my code for dropdown list &lt;?php $sql = "SELECT * FROM parts"; $result = mysql_query($sql); echo "&lt;select name='name' class='ed'&gt;"; echo "&lt;option id='0'&gt; --Select Part Name-- &lt;/option&gt;"; while ($row = mysql_fetch_array($result)) { $op1=$row['part_description']; $op2=$op1.$row['price']; $op3=$op2.$row['weight']; echo "&lt;option value='" . $row['part_description'] ."'&gt;" .$op3 ."&lt;/option&gt;"; echo $op3; } echo "&lt;/select&gt;"; ?&gt; I have 3 columns for my database part_description, price and weight. In the dropdownlist i created, you can select stored items at part_description. What I want to do is if I select that item in drop down list it will also display also the price and weight. But the display should be out of the box. Please help me thanks
has title: I created a dropdown list and how to display the other columns data of selected item?
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45960290
has comment: http://stackoverflow.com/comment/45960988
tagged with: php
upvote count: 1
has comment: http://stackoverflow.com/comment/45960386
type: Question
has answer: http://stackoverflow.com/a/28845952
has answer: http://stackoverflow.com/a/28847559
tagged with: javascript
has comment: http://stackoverflow.com/comment/45960439
answer count: 2

http://stackoverflow.com/comment/45976127
type: AnswerComment
type: Comment
has text: I had already tested it before, but it did not work. ` `
comment on: http://stackoverflow.com/a/28843518
score: 0

http://stackoverflow.com/a/28813783
accepted answer of: http://stackoverflow.com/q/28813527
answers question: http://stackoverflow.com/q/28813527
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45900244
has comment: http://stackoverflow.com/comment/45900383
has comment: http://stackoverflow.com/comment/45899444
has comment: http://stackoverflow.com/comment/45900747
has body: You confused indexes variables, it should be color_value[$j]: for(var $x=0 ; $x &lt; color_value.length ; $x++){ //first for loop for(var $j=0 ; $j &lt; color_str.length ; $j++){ //second for loop ids = "option#"+color_str[$j]; if (color_value[$j] &lt;= 0){ $(ids).attr("hidden", true); } } } Demo: https://jsfiddle.net/qu8ekvhk/3/ One more simpler option with alternative (more convenient) data structure: var colors = { red: -1, blue: 9, green: -4, black: 3 }; $('#selected_color option').filter(function() { return colors[this.id] &lt; 0; }).hide(); Demo: https://jsfiddle.net/qu8ekvhk/1/ Also, as pointed in comments if you support IE, then you can't just hide option in this browser, you will have to either remove() them or use one of the many workarounds.
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/45899392

http://stackoverflow.com/a/28918080
score: 1
has comment: http://stackoverflow.com/comment/46094652
has comment: http://stackoverflow.com/comment/46094930
has body: The client closure will remain alive as long as there is code running that uses that closure so you generally don't have to worry about that issue. A closure is essentially an object in Javascript and it will only be garbage collected when there is no active code that has a reference to anything inside the closure. As for your concurrency issue with a socket being disconnected while you are writing to the DB, you are correct to recognize that this is an issue to be careful with. Exactly what you need to do about it depends a bit on how your database behaves. Because node.js runs single threaded, your node.js code writing to the database will run to completion before any disconnect event gets processed. This doesn't mean that the database write will have completed before the disconnect event starts processing, but it does mean that it will have already been sent to the database. So, if your database processes multiple requests in the order it receives them, then it will likely just do the right thing and you won't have any extra code to worry about. If your database could actually process the delete before the write finishes (which seems unlikely), then you'd have to code up some protection for that. The simplest concept there is to implement a database queue on all database operations for a given user. I'd probably create an object with common DB methods on it to implement this queue and create a separate object in each client closure so they were local to a given user. When a database operation is in process, this object would have a flag indicating that an operation was in progress. If another database operation was called while this flag was set, that second operation would go in a queue rather than being sent directly to the database. Each time a database operation finishes, it checks the queue to see if there is a next operation is waiting to run. If so, it runs it. FYI, I have a simple node.js app (running on a Raspberry Pi with temperature sensors) that recor…
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28904380
has comment: http://stackoverflow.com/comment/46095102
type: Answer
accepted answer of: http://stackoverflow.com/q/28904380
has comment: http://stackoverflow.com/comment/46094873
downvote count: 0

http://stackoverflow.com/a/40989193
upvote count: 12
has comment: http://stackoverflow.com/comment/69649964
type: Answer
score: 11
answers question: http://stackoverflow.com/q/28759590
has body: I am not sure if I'm missing something here but I find that the accepted answer is more complicated than is necessary. I see that db has to be hit to validate or invalidate a token for each api request, however the total process could have been simpler as I see things here. Whenever a jwt is created, i.e. during login or change/reset password, insert the jwt with userid into a table and maintain a jti (a uuid number basically) for each jwt. The same jti goes into jwt payload too. Effectively jti uniquely identifies a jwt. A user can have multiple jwts at the same time when the account is accessed from multiple devices or browsers in which case, jti differentiates the device or the user-agent. So the table schema would be, jti | userId. (and a primary key ofcourse) For each api, check if the jti is in the table, which means the jwt is a valid one. When the user changes or resets the password, delete all the jti of that userId from the db. Create and insert a new jwt with a new jti into the table. This will invalidate all the sessions from all other devices and browsers except the one that changed or reset the password. When the user logsout, delete that particular jti of that user but not all. There would be a Single Login but not a single Logout. So when the user logs out, he shouldnt be logged out from all the devices. However, deleting all the jtis would logout from all the devices too. So it would be one table and no date comparisons. Also it would be the same case if a refresh token is used or not. However to minimize the db interference, and possible delays, cache usage would certainly help to ease things on processing time front. Note: Please reason if you are down voting it.
has comment: http://stackoverflow.com/comment/69666064
downvote count: 1
has comment: http://stackoverflow.com/comment/69676550
has comment: http://stackoverflow.com/comment/117076133

http://stackoverflow.com/q/28866677
accepted answer: http://stackoverflow.com/a/28867478
answer count: 1
favorite count: 0
upvote count: 1
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28867478
has body: I'm trying to display reactive plots on different panels. Some of them are based on the same inputs, which come from sliders on the sidebar. I want to conserve the same slider (and inputs) between these panels. In other panels, I want unique conditional inputs. Here is an example: ##server shinyServer(function(input, output) { output$scatterPlotA &lt;- renderPlot({ x &lt;- rnorm(input$slider1) y &lt;- rnorm(input$slider1) plot(x, y) }) output$scatterPlotB &lt;- renderPlot({ x &lt;- rnorm(input$slider2) y &lt;- rnorm(input$slider2) plot(x, y) }) output$scatterPlotC &lt;- renderPlot({ x &lt;- rnorm(input$slider2) y &lt;- rnorm(input$slider2) plot(x, y,col="red") }) }) This ui conserves the slider between panels 2-3, but it won't control 3. ##ui shinyUI(pageWithSidebar( headerPanel("Conditional Panels"), sidebarPanel( conditionalPanel(condition="input.conditionedPanels==1", helpText("Content Panel 1"), sliderInput("slider1", "Number of points: S1", min = 10, max = 200, value = 50, step = 10) ), conditionalPanel(condition="input.conditionedPanels==2", helpText("Content Panel 2"), sliderInput("slider2", "Number of points: S2", min = 10, max = 200, value = 50, step = 10) ), conditionalPanel(condition="input.conditionedPanels==3", helpText("Content Panel 2"), sliderInput("slider2", "Number of points: S2", min = 10, max = 200, value = 50, step = 10) ) ), mainPanel( tabsetPanel( tabPanel("Panel 1", value=1, plotOutput("scatterPlotA", height = 300)), tabPanel("Panel 2", value=2, plotOutput("scatterPlotB", height = 300)), tabPanel("Panel 3", value=3, plotOutput("scatterPlotC", height = 300)), id = "conditionedPanels" ) ) )) This ui does what I want EXCEPT that the slider from panel 2 ends up on panel 1. ##ui shinyUI(pageWithSidebar( headerPanel("Conditional Panels"), sidebarPanel( conditionalPanel(condition="input.conditionedPanels==1", helpText("Content Panel 1"), sliderInput("slider1", "Number of points: S1", min = 10, max = 200, value = 50, step = 10) ), conditionalPanel(co…
type: Question
has title: R Shiny: conditionalPanel sharing sidebars on select panels
downvote count: 0
tagged with: javascript
tagged with: http://stackoverflow.com/tag/r
tagged with: shiny

http://stackoverflow.com/q/28798312
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28798509
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45871211
possible better answer: http://stackoverflow.com/a/28798368
has comment: http://stackoverflow.com/comment/45871216
has answer: http://stackoverflow.com/a/28798509
has title: Vertical center icon element
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45871025
has answer: http://stackoverflow.com/a/28798368
type: Question
has body: I have this JSFiddle I want to create an 'X' button that will close the div. I can't seem to center it vertically, though. The button is actually a span with the fa fa-times class of font-awesome. I don't want to center anything horizontally. I want to center vertically the X in the div. HTML &lt;div id="panel"&gt; &lt;span class="fa fa-times"&gt;&lt;/span&gt; &lt;/div&gt; CSS #panel { display:table; width:500px; background-color:yellow; height:40px; text-align:right; } span { display:table-cell; padding:4px; background-color:green; vertical-align:middle; margin-right:10px; } JS(doesn't matter as it's a CSS problem) $(document).ready(function () { $('span').click(function () { $('#panel').hide(); }); });
answer count: 2

http://stackoverflow.com/comment/46005396
type: QuestionComment
has text: I meant the ActionScript code of the SWF (the source code) not the code used to embed it in the html page.
score: 0
comment on: http://stackoverflow.com/q/28870265
type: Comment

breeze
tags question: http://stackoverflow.com/q/28783545
tags question: http://stackoverflow.com/q/28766724
type: Tag
tags question: http://stackoverflow.com/q/28902501
tags question: http://stackoverflow.com/q/28754379
tags question: http://stackoverflow.com/q/28754940
tag name: breeze

http://stackoverflow.com/q/28776813
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28776844
type: AnsweredQuestion
score: 2
upvote count: 2
type: Question
has body: Supposing I have such object: var obj = { 'a': 'fizzle', 'b': 'wizzle', 'c': 'bum', 'd': 'crum' } I would like to take the key names and flatten these into an array, like so: // -&gt; ['a', 'b', 'c', 'd']; I could achieve this with a simple object loop, however I am wondering if there is a common underscore utility that could turn it into a one-liner. I looked through the underscore functions and couldn't find one for this.
tagged with: underscore.js
has title: Underscore.js flatten object keys to array
accepted answer: http://stackoverflow.com/a/28776844
answer count: 1

http://stackoverflow.com/a/29066006
answers question: http://stackoverflow.com/q/28843362
type: Answer
has comment: http://stackoverflow.com/comment/46394450
has comment: http://stackoverflow.com/comment/46393472
score: 0
has body: Based on Elad's andwer and comments I created the following method which returns call stack in IE, Chrome and FireFox: window.onerror = function (errorMsg, url, lineNumber, column, errorObj) { var stack; // Firefox does not send errorObj argument. Wrap the code with try catch // and send e.toString() and e.stack. try { stack = errorObj ? errorObj.stack : ''; } catch (e) { stack = e.toString() + " stack " + e.stack; } $.ajax('/api/errorlog?' + $.param({ errorMsg: errorMsg, url: url, lineNumber: lineNumber, column: column }), { data: JSON.stringify({ stack: stack }), type: 'POST', dataType: 'json', contentType: "application/json" }); alert(errorMsg + ' Line ' + lineNumber + ' Column ' + column + '\n\n' + stack); };

http://stackoverflow.com/a/28824609
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28824522
has body: When you say a div with a number, It should be on id attribute. &lt;div class="your_div_selector" id="div-1"&gt; so, in your javascript, using jquery and when the other div is clicked, just do this: var div_id = $('.your_div_selector').attr("id") var new_id = 1 + parseInt(div_id.split("-").pop());
answers question: http://stackoverflow.com/q/28824522

http://stackoverflow.com/a/28750723
has comment: http://stackoverflow.com/comment/45940109
has comment: http://stackoverflow.com/comment/45932052
type: AcceptedAnswer
has body: You need to add return stament before clientsReq.then() this.get = { byId: function(id) { return clientsReq.then(function() { // Wait for clientsReq to finish for(var i = 0; i &lt; clients.length; i++) { // Iterate over clients if(clients[i].id === id) { // Check if clientID matches ID console.log(clients[i]); // Debug - IT LOGS THE CLIENT! (Working) return clients[i]; // Returns undefined (Not working) } } }); } }; Then in your controller ClientService.get.byId('123').then(function(client){ //here use client $scope.client = client; }); Remenber that is an async call, so you should return promises not pure values.
accepted answer of: http://stackoverflow.com/q/28750670
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28750670

http://stackoverflow.com/q/28885702
type: AnsweredQuestion
type: Question
tagged with: google-visualization
tagged with: bar-chart
answer count: 1
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28886913
accepted answer: http://stackoverflow.com/a/28886913
has body: I don't see annotations in my google charts. Here is the code. http://jsfiddle.net/sn37vp58/1/ google.load('visualization', '1', {packages: ['corechart']}); google.setOnLoadCallback(drawChart); function drawChart() { var data = new google.visualization.arrayToDataTable([ ['Status', 'Completed', 'In Progress', 'Registered / Not Started','Past Due',{role: 'annotation'}], ['Safety',100.0,0.0,0.0,0.0,'Hello'],['Conduct ',100.0,0.0,0.0,0.0,'Hello'],['Policy',100.0,0.0,0.0,0.0,'Hello'],['Privacy',100.0,0.0,0.0,0.0,'Hello'],['Violence',100.0,0.0,0.0,0.0,'Hello'],['Integrity',0.0,0.0,100.0,0.0,'Hello'] ]); var options = { height: 500, width: 500, chartArea:{left:100,top:100,right:0,bottom:0}, hAxis: { ticks: [25,50,75,100] }, isStacked: true, bar: {groupWidth: '20'}, vAxis:{textStyle:{color: '#000000',fontSize: '12', paddingRight: '0',marginRight: '0'}}, colors: ['green','#ffff99','#ffbf0c','red'], legend: { position: 'top' }, annotations: { alwaysOutside: false, textStyle: { fontSize: 17, auraColor: '#eee', color: '#eee' }}, }; var chart = new google.visualization.BarChart( document.getElementById('ex5')); chart.draw(data, options); } I am using google visualization bar chart to display the bar chart but annotations are missing....
has title: annotation in google bar chart

http://stackoverflow.com/a/28899910
downvote count: 0
answers question: http://stackoverflow.com/q/28899844
has comment: http://stackoverflow.com/comment/46059108
type: Answer
score: 1
upvote count: 1
has body: Try using ui-sref directive. It will use $state service to load a page. Link You have to configure your routes with $stateProvider to use route names.

http://stackoverflow.com/q/28875087
has answer: http://stackoverflow.com/a/28889388
has title: remove the html tag using javascript from html page
linked to: http://stackoverflow.com/q/1732348
score: 0
has comment: http://stackoverflow.com/comment/46016165
answer count: 2
has comment: http://stackoverflow.com/comment/46015670
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28878182
accepted answer: http://stackoverflow.com/a/28889388
has answer: http://stackoverflow.com/a/28878182
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46016179
has body: i have written a javascript codefor autosuggest. i am getting autosuggest.but when i am selecting any autosuggested word.it's coming with html tag like this.: if i am typing "w" in text box. then i am getting some autosuggested word if i select that word then on the text box it coming like w water,wall etc. below is my code.: how can i remove that html tag from the textbox.
type: Question
tagged with: javascript

http://stackoverflow.com/comment/45807260
type: QuestionComment
comment on: http://stackoverflow.com/q/28751289
score: 0
has text: Really hard to say without any context - is it possible to look at your site ? It is possible to rename the ga function, but that's nothing ones does by accident so I don't think this is what happened here.
type: Comment

http://stackoverflow.com/comment/45924877
score: 0
has text: possible duplicate of [d3.js pie chart with angled/horizontal labels](http://stackoverflow.com/questions/21769872/d3-js-pie-chart-with-angled-horizontal-labels)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28826317

strongloop
tags question: http://stackoverflow.com/q/28753392
tag name: strongloop
type: Tag

http://stackoverflow.com/a/28877252
upvote count: 1
has body: refer this link https://stackoverflow.com/a/18480589/4599982 and you can use jquery setTimeout(settimeout ) funcion for change of background after particular time.
downvote count: 0
type: Answer
score: 1
answers question: http://stackoverflow.com/q/28876845

http://stackoverflow.com/q/28880895
has comment: http://stackoverflow.com/comment/46024588
type: Question
has comment: http://stackoverflow.com/comment/46023955
has comment: http://stackoverflow.com/comment/46023313
has comment: http://stackoverflow.com/comment/46023875
has body: Using jQuery, I would like to submit a POST form on clicking an html link, into the target browser tab where the link is opened. This is Search for values submits the form as desired if the link is clicked with the mouse. But if the middle button is clicked to open the link in a new tab, I would like to see the form being submitted in that new tab if the right button is clicked and "open link in new tab" or "open link in new window" is chosen from the menu, I would like to see the form being submitted in the chosen way Any ideas or pointers how to achieve this?
tagged with: forms
answer count: 1
has comment: http://stackoverflow.com/comment/46023362
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46023353
has answer: http://stackoverflow.com/a/28881004
has comment: http://stackoverflow.com/comment/46023282
has comment: http://stackoverflow.com/comment/46024512
has title: Possibilities of submit a form on (left-/middle-/open-in-new-tab-or-window-)clicking an html link
has comment: http://stackoverflow.com/comment/46024305
has comment: http://stackoverflow.com/comment/46023223
has comment: http://stackoverflow.com/comment/46023918
favorite count: 0
has comment: http://stackoverflow.com/comment/46023494
score: 2
has comment: http://stackoverflow.com/comment/46023323
upvote count: 2
type: UnansweredQuestion

http://stackoverflow.com/q/28878751
tagged with: polymer
tagged with: submenu
has body: I am trying to work with Polymer 0.5.5 and its core features. When I tried to use Menu mixed with some SubMenu, the output is not was I expected. See sample source code: In my case, only the items of the subMenu are showing up, i.e. the Submenu entry and its icon are missing, and I can't get the label via the SubMenuItem. The selected variable is 0 in this case which is logical but doesn't help... My browser is Chrome 40.x which should be sufficient in terms of compatibility.
type: Question
has comment: http://stackoverflow.com/comment/46025411
has comment: http://stackoverflow.com/comment/46027129
has answer: http://stackoverflow.com/a/28885928
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/46028740
score: 0
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28885928
has title: Polymer core-submenu not showing the submenu but only its items
type: AnsweredQuestion

garbage-collection
tags question: http://stackoverflow.com/q/28818611
tags question: http://stackoverflow.com/q/28887250
tag name: garbage-collection
type: Tag
tags question: http://stackoverflow.com/q/28792040

http://stackoverflow.com/q/28889064
answer count: 1
has title: Render a component from a dynamic variable with Handlebars
type: UnansweredQuestion
tagged with: handlebars.js
tagged with: ember.js
has body: I'd like to render a component that I will define within a variable. I have a variable containing content like that: page.js Ember.Controller.extend({ c: { 'pageTitle': 'This is the title with a component {{my-component}}' } }); page.hbs &lt;div&gt; {{c.pageTitle}} &lt;/div&gt; The c object is populated from an API call, from a content server. I would like to provide the capability to inject components from what is defined in the content. Basically what I need would be to render 2 times, the first time to replace my {{pageTitle}} with the string, and the second time to replace {{my-component}} with the component. What would be the best solution to do such a thing? Thanks
type: Question
has answer: http://stackoverflow.com/a/28892315
tagged with: javascript
score: 0

http://stackoverflow.com/a/28802891
has body: In order to make this work without changing anything inside your function you could bind the element like so: ... ondblclick="Clear.call(this);" ... Inside Clear() you will reference the element using this. Bonus You could also pass in the event like so: ... ondblclick="Clear.call(this, event);" ... Then, your function would look like this: function Clear(event) { // ... } Alternatively You could also register the event handler separately: document.getElementById('green').addEventListener('dblclick', Clear);
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28802768

download
tags question: http://stackoverflow.com/q/28817196
tags question: http://stackoverflow.com/q/28847230
type: Tag
tags question: http://stackoverflow.com/q/28864156
tags question: http://stackoverflow.com/q/28833489
tag name: download
tags question: http://stackoverflow.com/q/28891235
tags question: http://stackoverflow.com/q/28897779

http://stackoverflow.com/a/28835460
has comment: http://stackoverflow.com/comment/65429626
has comment: http://stackoverflow.com/comment/127927005
score: 135
has comment: http://stackoverflow.com/comment/138127902
has comment: http://stackoverflow.com/comment/95071798
has comment: http://stackoverflow.com/comment/72515226
has body: I think that the following example demonstrates what you need: I removed the link because it was broken. The essence of the article is this code part: var fs = require('fs'); // function to encode file data to base64 encoded string function base64_encode(file) { // read binary data var bitmap = fs.readFileSync(file); // convert binary data to base64 encoded string return new Buffer(bitmap).toString('base64'); } // function to create file from base64 encoded string function base64_decode(base64str, file) { // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded var bitmap = new Buffer(base64str, 'base64'); // write buffer to file fs.writeFileSync(file, bitmap); console.log('******** File created from base64 encoded string ********'); } // convert image to base64 encoded string var base64str = base64_encode('kitten.jpg'); console.log(base64str); // convert base64 string back to image base64_decode(base64str, 'copy.jpg');
has comment: http://stackoverflow.com/comment/65459175
type: Answer
has comment: http://stackoverflow.com/comment/67122071
upvote count: 141
downvote count: 6
has comment: http://stackoverflow.com/comment/78734865
answers question: http://stackoverflow.com/q/28834835
has comment: http://stackoverflow.com/comment/123640013
has comment: http://stackoverflow.com/comment/134645487

http://stackoverflow.com/comment/46001951
comment on: http://stackoverflow.com/q/28868742
score: 0
has text: Please state some more information such as server supports Websocket/longpolling or general Ajax call.There are some way to achieve that and the best solution is all depends on the server side structure for pushing(sending) json data.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28863097
has body: I'm just getting started with Node.js, so I'm building very simple applications in order to practice the basics. I was trying to get some Django-like template inheritance working, but I'm at a bit of a loss on how to do it. I understand that the library "express-handlebars" includes the concept of layouts, and I thought that might be the best way to go about it, but at first glance I don't know if it allows more than one step of inheritance, or using it for replacing different blocks (I saw one general layout where the other templates are inserted in place of the {{{body}}} tag, although there may very well be more tricks to it). So, my question: how would one implement a multi-layered template inheritance (also, with children inserting content into different separate blocks, instead of a single one)? I'm using Node.js, Express and handlebars, but if it's not possible with the latter two I don't mind trying out other frameworks or templating languages. Thanks! Edit: A pseudo-coded example of what I mean: First, we could have a common outer template: Main Title {{section name block}} {{subsection name block}} {{content block}} then another one under it (middle template), substituting some of the outer one's blocks (and potentially adding other ones): {{inheriting from outer template}} {{section name block}} Section Three {{/block}} and finally an inner one, which would be the one to call from the javascript code: {{inheriting from middle template}} {{subsection name block}} Subsection Two {{/block}} {{content block}} This is the content of Section Three, Subsection Two. {{/block}} The result when processing the inner template would be: Main Title Section Three Subsection Two This is the content of Section Three, Subsection Two.
tagged with: node.js
has answer: http://stackoverflow.com/a/28863251
has answer: http://stackoverflow.com/a/28863338
score: 7
upvote count: 7
has answer: http://stackoverflow.com/a/47327958
has answer: http://stackoverflow.com/a/78867477
type: Question
tagged with: javascript
tagged with: inheritance
tagged with: express
downvote count: 0
has answer: http://stackoverflow.com/a/77003900
favorite count: 0
answer count: 5
type: UnansweredQuestion
tagged with: handlebars.js
has title: Template inheritance with Node.js, Handlebars and Express

http://stackoverflow.com/comment/46023874
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28881288
has text: `console.log(data);` right after the $.post line. Hit control+shift+i and go to console to see the value.
score: 0

http://stackoverflow.com/comment/46056345
type: QuestionComment
has text: possible duplicate of [jQuery Show-Hide DIV based on Checkbox Value](http://stackoverflow.com/questions/4444292/jquery-show-hide-div-based-on-checkbox-value)
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28897900

http://stackoverflow.com/comment/45934280
type: Comment
has text: @Terrabyte how did you use the editor binding? You have to give it access to the observable, as in `rev_ckeditor: app.models.userReview.body`
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28831695

http://stackoverflow.com/q/28752268
type: Question
has answer: http://stackoverflow.com/a/28753994
tagged with: javascript
has comment: http://stackoverflow.com/comment/45786677
has title: Using chrome.downloads.download, is it possible to make the file not popup the download bar?
score: 2
tagged with: google-chrome-extension
downvote count: 0
answer count: 1
has body: When I executed chrome.downloads.download, it downloads the file and popups up the download bar at the bottom and shows it, can I suppress it? Example: /* some code to suppress download bar */ chrome.downloads.download( { "url": request.ImageToDownload }, function (downloadId){ // ... } );
has comment: http://stackoverflow.com/comment/94249039
favorite count: 0
accepted answer: http://stackoverflow.com/a/28753994
upvote count: 2
has comment: http://stackoverflow.com/comment/45786571
type: AnsweredQuestion

http://stackoverflow.com/q/28866027
linked to: http://stackoverflow.com/q/10996835
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28881300
accepted answer: http://stackoverflow.com/a/28881300
has body: First of all, let me start off by saying the product I am developing will be used by people that don't inherently have access to HTML5. Some of the individuals will still be using IE8. I have a form like the following: &lt;form action="ee.cfc?method=xlsupload" enctype="multipart/form-data" method="post" &lt;input type="file" id="xlsfile" name="xlsfile" required&gt; &lt;input type="submit" value="Upload XLS"&gt; &lt;/form&gt; and in my .cfc file I have a function that processes the file and translates it to a structure (which will then upload to a database after the user validates the data). Currently I have it set to &lt;cfreturn SerializeJSON(dataset,true)&gt;. However, when I submit the form it opens the cfc file and shows the JSON structure. I have done plenty of form submits, etc. in JQuery before, but is there a way to do this without JQuery? One would hope Coldfusion would have the capability to do this, (though of course I wouldn't be surprised if it didn't).
score: 0
upvote count: 1
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/46028449
favorite count: 0
has comment: http://stackoverflow.com/comment/46020230
has comment: http://stackoverflow.com/comment/45997726
tagged with: coldfusion
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46059154
tagged with: forms
type: Question
has title: Coldfusion post form to cfc asynchronously
has comment: http://stackoverflow.com/comment/45997352

http://stackoverflow.com/comment/45835819
type: Comment
has text: still not working ! It always ends up targeting the first canvas
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28779169

http://stackoverflow.com/q/28827252
has comment: http://stackoverflow.com/comment/45925549
upvote count: 2
has title: Call a rails route into CSS (in haml)
has comment: http://stackoverflow.com/comment/45925308
tagged with: ruby-on-rails
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28828116
has comment: http://stackoverflow.com/comment/45925289
has comment: http://stackoverflow.com/comment/45925599
has body: = @photo.image.url (in haml) will compile a url of an image depending on the view I would like to use the image link produced by the tag in the CSS below- but that wont work. #BG { background: url( HERE!!! ) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; height: 400px; } I've tried javascript directly on the page to replace a hardwired image with a new image to test it out... but that didn't work. I've played with the code below and tried a lot of different versions of it. :javascript document.getElementById('BG').style.background = "url('newimg.jpg') no-repeat center center fixed" Here is the Haml code where it will be used: #BG This div should have the image as a background %p= @photo.title .container .jumbotron I need a solution to get the image url into the background url
has comment: http://stackoverflow.com/comment/45925469
has comment: http://stackoverflow.com/comment/45925958
has comment: http://stackoverflow.com/comment/45925164
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45926435
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28828116
favorite count: 0
has comment: http://stackoverflow.com/comment/45924989
has comment: http://stackoverflow.com/comment/45925264
tagged with: haml
tagged with: css
score: 2

http://stackoverflow.com/a/28783204
has body: You can give a special attribute to each span with the id of the element you want to select: //JS SelectText(e.target.attributes["select"].value); //HTML select select Or, if the order of the elements is always similar and is not likely to change, you can retrieve the previous sibling: SelectText(e.target.previousSibling.id);
downvote count: 0
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28783029

http://stackoverflow.com/comment/45980585
type: QuestionComment
comment on: http://stackoverflow.com/q/28857258
score: 0
has text: DO yo want to display number of yes and nos as user selects, or only after your form is submitted?
type: Comment

http://stackoverflow.com/a/28902749
accepted answer of: http://stackoverflow.com/q/28902672
answers question: http://stackoverflow.com/q/28902672
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46064986
type: Answer
has comment: http://stackoverflow.com/comment/46065053
score: 1
upvote count: 1
has body: You are returning promise from success function, this will never work. You should return defered.promise (promise object) from outside success function. CODE $stateProvider .state('home', { url: "/home", templateUrl: "home/homeTemplate.html", controller: 'homeController' }) .state('adminPage', { url: "/adminPage", templateUrl: "adminPage/adminTemplate.html", controller: 'adminPageController', resolve: { validate: function($q, $sails, $location) { var defer = $q.defer(); $sails.get("/user/getCurrentUser") .success(function(response) { if (response.user.accessAdminPage) { defer.resolve(); } else { defer.reject("Access blocked"); $location.path('/'); } }); return defer.promise; } } }); Hopefully this could help you, Thanks.

http://stackoverflow.com/q/28840784
type: AnsweredQuestion
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45951106
score: 0
answer count: 1
has title: Finding the mode in an object containing number properties
has answer: http://stackoverflow.com/a/28840995
accepted answer: http://stackoverflow.com/a/28840995
has comment: http://stackoverflow.com/comment/45950791
has body: I have an object that contains some categories as keys and then an integer as a property: { thing1: 12, thing2: 32, thing3: 9, thing4: 2 } I need to find the mode out of all the numbers (the highest number - 32 in this case) and then return the key. What's the best way to do this?
linked to: http://stackoverflow.com/q/1069666

http://stackoverflow.com/q/28807038
tagged with: jquery
has comment: http://stackoverflow.com/comment/45887390
tagged with: validation
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45896988
favorite count: 0
has comment: http://stackoverflow.com/comment/45897855
type: UnansweredQuestion
has body: I have following code. &lt;section class="section_class"&gt; &lt;input type="text" name="branch_contact_person_name[]" value="&lt;?php echo set_value('branch_contact_person_name'); ?&gt;" placeholder="Branch Contact Person Name" /&gt; &lt;input type="text" name="branch_contact_person_email[]" value="&lt;?php echo set_value('shop_email'); ?&gt;" placeholder="Branch Contact Person Email" /&gt; &lt;input type="text" name="branch_contact_person_mobile[]" value="&lt;?php echo set_value('shop_mobile'); ?&gt;" placeholder="Branch Contact Person Mobile" /&gt; &lt;/section&gt; &lt;input type="hidden" class="add_fields" /&gt; And i am using following jquery $(document).ready(function() { $("#add_next_branch").click(function() { //add_next_branch is a button $('.section_class').clone().appendTo('.add_fields'); }); }); The text fields are creating properly but when i submit form with all text fields blank then it will display proper message but the text fields are which are creating are going off. this is controller function branch_details() { $this-&gt;form_validation-&gt;set_rules('branch_contact_person_name[]', 'Site Name', 'required|xss_clean'); /*$this-&gt;form_validation-&gt;set_rules('product_category', 'Product Category', 'trim|required|xss_clean'); //This field is hidden $this-&gt;form_validation-&gt;set_rules('product_brand','Product Brand','required|greater_than[0]'); //select location -- $this-&gt;form_validation-&gt;set_rules('shop_mobile', 'Shop Mobile', 'trim|required|min_length[6]|max_length[12]|xss_clean|numeric'); //$this-&gt;form_validation-&gt;set_rules('brand_pic', 'Product Image', 'trim|required|xss_clean'); $this-&gt;form_validation-&gt;set_rules('product_desc', 'Product Description', 'trim|required|xss_clean'); $this-&gt;form_validation-&gt;set_rules('product_price_type', 'Product Price Type', 'required|xss_clean'); $this-&gt;form_validation-&gt;set_rules('product_mrp', 'M.R.P ', 'required|xss_clean'); */ $data = array(); $this-&gt;load-&gt;view('templat…
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/45888333
has title: codeigniter:make validation of dynamically created textfield using jquery clone method
score: 1
tagged with: codeigniter
has answer: http://stackoverflow.com/a/28813127
type: Question
has comment: http://stackoverflow.com/comment/45898354
tagged with: javascript

http://stackoverflow.com/comment/45987181
has text: Awesome! I'm glad I could be of help. Good luck on your Javascript quest for mastery :)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28844183
type: Comment

http://stackoverflow.com/a/28779805
has comment: http://stackoverflow.com/comment/45837029
has comment: http://stackoverflow.com/comment/45837172
type: Answer
has body: If you just wanna show like the firstname and the last name you could do this: function enter(){ var firstname = document.getElementById("firstName").value; var lastname = document.getElementById("lastName").value; document.getElementById("show").innerHTML = firstname + " " + lastname; } &lt;form&gt; &lt;input type="text" id="firstName"&gt; &lt;input type="text" id="lastName"&gt; &lt;input type="submit" onclick="enter()" value="Submit"&gt; &lt;/form&gt; &lt;div id="show"&gt;&lt;/div&gt;
answers question: http://stackoverflow.com/q/28779394
score: 0
has comment: http://stackoverflow.com/comment/45837073

http://stackoverflow.com/comment/45972913
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28852414
has text: What it is is probably the image bytes being rendered as characters. Open the image file in a text editor and you will see something similar.

typeconverter
type: Tag
tags question: http://stackoverflow.com/q/28871879
tag name: typeconverter

google-oauth
type: Tag
tag name: google-oauth
tags question: http://stackoverflow.com/q/28770357

http://stackoverflow.com/q/28868561
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
accepted answer: http://stackoverflow.com/a/28868576
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: Hover on an element to add a class to another element?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28868576
has body: So I want the rest of the page to darken when a user hovers over the menu bar on my page. I've tried messing around with some jQuery but I can't seem to figure out how to do this correctly? When a user hovers on #header, I want to add a class '.darken' to #content. I will probably use .darken to apply an opacity. Thank you Home About Contact Homepage Synth sriracha fashion axe gastropub. jsFiddle

http://stackoverflow.com/comment/131610365
type: Comment
has text: this is ace, thanks @Vasiliy Artamonov, for anyone wanting to add types to this, see my answer which extends upon this: https://stackoverflow.com/a/74558120/827129
type: AnswerComment
comment on: http://stackoverflow.com/a/73471976
score: 1

http://stackoverflow.com/q/28772868
tagged with: ajax
has answer: http://stackoverflow.com/a/28772936
answer count: 1
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/28772936
upvote count: 2
tagged with: php
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45824196
has title: AJAX success not displaying my PHP errors or success messages
has body: I have an AJAX call to submit a form and on success I want to display the PHP success message or Error message. Here is my AJAX success: success: function (data) { resultSuccess = $(data).find("#success"); resultError = $(data).find("#error"); $('#resultBlock').html(resultSuccess); $('#resultBlock').html(resultError); } If I remove one of them it works. For example if I write it like this: success: function (data) { resultSuccess = $(data).find("#success"); $('#resultBlock').html(resultSuccess); } I works with no problem its only when I add the other one is when it stops working. How do I write it in a way to show one and/or both messages?
type: Question
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/28798593
upvote count: 9
tagged with: intellij-idea
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/38437080
tagged with: webstorm
has answer: http://stackoverflow.com/a/38437080
has answer: http://stackoverflow.com/a/28812074
favorite count: 0
score: 9
tagged with: requirejs
has body: Huge fan on Intellij for Java(love it and love shortcuts). Trying to get my head around using WebStrom for ReactJS. Is there any additional tuning that can be done ? How to quickly create new react class without copy/paste, what is the short cut ? How to navigate around classes quickly ? How to use imports with ease e.g. require that with quick understanding of my project structure while I type ? How to build gulp from Webstorm ? Thanks, Peter
accepted answer: http://stackoverflow.com/a/28812074
type: AnsweredQuestion
has title: ReactJS Workflow in WebStorm
type: Question
tagged with: reactjs
answer count: 2

http://stackoverflow.com/q/28876300
has comment: http://stackoverflow.com/comment/46014767
favorite count: 0
linked to: http://stackoverflow.com/q/9885821
has answer: http://stackoverflow.com/a/28876564
accepted answer: http://stackoverflow.com/a/28876564
type: AnsweredQuestion
upvote count: 35
downvote count: 0
has comment: http://stackoverflow.com/comment/46014997
has comment: http://stackoverflow.com/comment/46014638
type: Question
has comment: http://stackoverflow.com/comment/46014680
tagged with: arrays
tagged with: javascript
linked to: http://stackoverflow.com/q/122102
has title: Deep copying array of nested objects in javascript
has body: I am trying to deep copy array of nested objects in javascript. My array look like this var arr = [{name:"adam",age:"21"}, {name:"freddie",age:"35",children:[{name:"mercury",age:"25"}]}, {name:"jim",age:"35",children:[{name:"morrison",age:"25",children:[{name:"some", age:"40"}]}]} ]; I want to make a deep copy of every object inside the array that is i want to create a exact copy of arr into new array which should not have object reference. Depth of array is also unknown that is children array can be upto any level. I have gone through this link Copying of an array of objects to another Array without object reference in javascript(Deep copy) but that did not help me. I googled and found some solutions in jQuery but that did not help me as i dont have knowledge of jQuery. I also tried implementing it with recursion but that's not working too http://ideone.com/kJi5X3 I want to do it in javascript only without using jQuery or anything. I am new to JavaScript so i may have missed if there is any library or simple method to do this. Please help me to solve this problem. Thanks in advance.
score: 35
tagged with: deep-copy
duplicate of: http://stackoverflow.com/q/122102
has comment: http://stackoverflow.com/comment/46014819
answer count: 1

http://stackoverflow.com/q/28879508
has body: I'm currently making a database for a journal-entrys-app, using PouchDB. Every journal entry can have multiple destinations and costs. The current id naming system is ent.1-x for entrys, cst.1-x for costs and dst.1-x foe destinations. I would now like to filter all jounal entrys whose id starts with "ent." . Whats the best way to do so? Or should I solve the document namin/typing in another way? I want to do it using PouchDB querys, since I don't want to waste ram and processing power loading the entire database and filtering it using pure JS.
has title: Filter all PouchDB Documents whos ID starts with "ent."
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28882929
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28882929
tagged with: pouchdb
score: 0
has comment: http://stackoverflow.com/comment/46021356
answer count: 1

http://stackoverflow.com/q/28806425
upvote count: 2
linked to: http://stackoverflow.com/q/2485423
downvote count: 2
has comment: http://stackoverflow.com/comment/45886004
has title: In javascript why we use var for declaring variable?
possible better answer: http://stackoverflow.com/a/28806619
type: Question
has comment: http://stackoverflow.com/comment/45885943
duplicate of: http://stackoverflow.com/q/2485423
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28806619
has body: I've been using javascript &amp; jQuery for a month. But I am still not getting what is the difference between using var variable and without declaring var. var data = 10; data = 10; What is difference between the two statements above? And why? Please explain to me in detail.
has comment: http://stackoverflow.com/comment/45885987
has comment: http://stackoverflow.com/comment/45886203
has answer: http://stackoverflow.com/a/28806464
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28806464
score: 0
has answer: http://stackoverflow.com/a/28806577
answer count: 3
favorite count: 0

http://stackoverflow.com/q/28812049
score: 2
has body: I'm currently building a slide-box with a large number of items. I've taken the code from the example outlined here for an infinite number of items, and it's working well in terms of performance. However as I actually have a large, yet limited number of items, I would like to make the slide box stop looping once I get to the end of my collection. As the above implementation relies on a circular buffer, my go-to method would be to simply toggle the "does-continue" property on or off depending on where I am in the larger collection. Is there a way to do this? I can't seem to locate a method on the slide box delegate which would allow such a behaviour, and it doesn't appear that I can bind a boolean expression to the does-continue attribute in the HTML either. Alternatively, is there another way to efficiently handle large, but noninfinite numbers of items in an Ionic slidebox?
upvote count: 2
has comment: http://stackoverflow.com/comment/50623818
type: Question
has title: Toggle Ionic Slide Box "does-continue"
tagged with: javascript
tagged with: ionic-framework
has answer: http://stackoverflow.com/a/32721473
answer count: 1
downvote count: 0
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/50459856
type: UnansweredQuestion
tagged with: css

http://stackoverflow.com/comment/45833480
has text: so as an example $.get("http://99.236.215.227:7379/hget/Pool_Stats:CurrentShift:WorkerBTC/" + a + ".txt", function(b) {$(".payout").text.parseFloat(b).toFixed(8)
type: AnswerComment
comment on: http://stackoverflow.com/a/28777785
type: Comment
score: 0

http://stackoverflow.com/comment/45997943
comment on: http://stackoverflow.com/a/28866331
score: 0
type: AnswerComment
type: Comment
has text: @Csteele5 - it seems to work fine for me here: http://jsfiddle.net/jfriend00/zk7bdfrv/ . You will have to show us the actual code you're using in the context you're using it to know what is wrong.

http://stackoverflow.com/comment/46048942
type: QuestionComment
comment on: http://stackoverflow.com/q/28894347
has text: remove the timezone part from the date string then parse it
score: 0
type: Comment

http://stackoverflow.com/a/28893249
score: 0
has body: You have to define canActivate method in your shell.js. For example: define(['durandal/system', 'plugins/router', 'services/logger', 'services/config'], function (system, router, logger, config) { function activate() { //... some code there } function canActivate() { var result = callMenuParameter(); var parsedData = JSON.parse(result); var menuParameter = parsedData.menuNbr; if (menuParameter == 0) { window.location.href = 'http://somesite.com'; return false; } // I suggest to place router initialization code here... return true; } var shell = { activate: activate, canActivate: canActivate, router: router }; return shell; } You can see article below for additional information and some technical details: http://durandaljs.com/documentation/Hooking-Lifecycle-Callbacks.html
type: Answer
answers question: http://stackoverflow.com/q/28886240
has comment: http://stackoverflow.com/comment/46190800

http://stackoverflow.com/q/28852370
answer count: 1
downvote count: 0
tagged with: javascript
has title: How do I test a HTML5 and Javascript Application on Smart TV's?
tagged with: http://stackoverflow.com/tag/html
has body: I'm building a TV application using a framework called TAL (TV Application Layer), which is a Javascript framework for building an HTML5 based TV app. I can run my application on localhost and test it in my browser. I can also test the app quite easily on the Amazon Fire TV using Amazon's Web App Tester tool, which accesses the web app running on my computer via my WiFi network and then runs it on the TV. However, I'm struggling to find a general approach to test this app on other set top boxes or smart TVs. Do I have to download the SDK for each individual device and package it up somehow? If so, what is the general approach for this? The documentation from individual manufacturers only seems to focus on using their SDK to build the app, and doesn't offer support about an HTML5 app that you've created yourself. As I'm just starting out on this, any pointers in the right direction would be much appreciated.
favorite count: 0
accepted answer: http://stackoverflow.com/a/28852522
type: AnsweredQuestion
score: 3
tagged with: smart-tv
upvote count: 3
tagged with: samsung-smart-tv
tagged with: tal
type: Question
has answer: http://stackoverflow.com/a/28852522

http://stackoverflow.com/comment/46031609
has text: OK, but this doesn't quite explain why I get TWO requests for the same image? Also, can you please provide a sample of how to return CSS? I'll figure out the rest. Thank you.
comment on: http://stackoverflow.com/a/28885130
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28799691
has comment: http://stackoverflow.com/comment/45883518
has body: textAngular actually uses document.execCommand internally (I'm the maintainer FYI). Your code is pretty much correct, the problem you are facing is that when you click on that button you loose the focus/selection of the contenteditable area, so it has no where to insert it. From memory you have to do two things; Make the element with the ng-click on it have the attribute unselectable="on" and also catch and prevent the mousedown event on the same element. Here's how we setup the buttons in textAngular: https://github.com/textAngular/textAngular/blob/ff8e48087f780d30f54e77b06f09e0b85f9517e9/src/taBind.js#L26-L39 The problem with $document is that you need to use $document[0] to get the actual HTML DOM element to be able to call execCommand.
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/86561736
type: Answer
answers question: http://stackoverflow.com/q/28781241
accepted answer of: http://stackoverflow.com/q/28781241
score: 4
upvote count: 4

http://stackoverflow.com/q/28765383
has comment: http://stackoverflow.com/comment/45811720
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45809685
has title: Input text Box Validation inside ng-repeat
has comment: http://stackoverflow.com/comment/45811654
has comment: http://stackoverflow.com/comment/45809568
favorite count: 0
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45809938
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45809758
tagged with: forms
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/45809879
has comment: http://stackoverflow.com/comment/45809711
has body: Am having a ng-repeat function wherein am displaying 3 input text boxes.But the sane button dosen't seem to apply validations(I need to enable 'Save' button only if I fill all the three inputs) Save Controller: $scope.items=[{ id:1, name:VALUE1 },{ id:2, name:VALUE2 },{ id:3, name:VALUE3 }]
tagged with: validation
answer count: 1
has answer: http://stackoverflow.com/a/28765727
accepted answer: http://stackoverflow.com/a/28765727
tagged with: javascript

http://stackoverflow.com/comment/45920104
has text: ahh, well in that case use this new code, it will increment the month when necessary.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28824453
type: Comment

http://stackoverflow.com/q/28807751
downvote count: 1
has body: Similar to Array slice(), is it possible to slice an object (without looping though it properties)? Simplified example: var obj = {a:"one", b:"two", c:"three", d:"four"}; For example: Get the first 2 properties var newObj = {a:"one", b:"two"};
has answer: http://stackoverflow.com/a/28807929
favorite count: 0
linked to: http://stackoverflow.com/q/5525795
has answer: http://stackoverflow.com/a/28810139
answer count: 4
has answer: http://stackoverflow.com/a/28808097
has comment: http://stackoverflow.com/comment/45888648
has comment: http://stackoverflow.com/comment/45888175
upvote count: 5
possible better answer: http://stackoverflow.com/a/28807929
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45888172
tagged with: javascript
score: 4
has answer: http://stackoverflow.com/a/62958776
type: Question
has comment: http://stackoverflow.com/comment/45888170
accepted answer: http://stackoverflow.com/a/28810139
has title: Is it possible to slice an object?

http://stackoverflow.com/comment/46035482
comment on: http://stackoverflow.com/a/28886996
type: AnswerComment
type: Comment
score: 0
has text: That character class is unnecessary, just use `/ +/`

http://stackoverflow.com/a/28763639
answers question: http://stackoverflow.com/q/28760045
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
has body: I still don't get the required answer. Below is my view. &lt;select name="brand" class="form-control" id="brand" required&gt; &lt;?php if($items) { foreach($items as $key) { ?&gt; &lt;option value="&lt;?php echo $key-&gt;brand_id ?&gt;"&gt; &lt;?php echo $key-&gt;brand_name ?&gt; &lt;/option&gt; &lt;?php } } ?&gt; &lt;/select&gt; &lt;select name="category" class="form-control" id="category" required&gt; &lt;/select&gt; Ajax: &lt;script&gt; $(function() { $("#brand").on('change', function() { var brand = $(this).val(); $.ajax ({ type: "post", url: "&lt;?php echo base_url(); ?&gt;receiving/showCategory", dataType: 'json', data: 'brand='+brand, success: function(msg) { var options; for(var i = 0; i&lt;msg.length; i++) { options = '&lt;option&gt;'+msg.category[i].category_name+'&lt;/option'&gt;; } $('#category').html(options); } }); }); }); &lt;/script&gt; My Controller: function showCategory() { if($this-&gt;session-&gt;userdata('success')) { $brand_id = $this-&gt;input-&gt;post('brand'); $data['category'] = $this-&gt;item_model-&gt;category($brand_id); echo json_encode($data); } else { //If no session, redirect to login page redirect('login', 'refresh'); $this-&gt;load-&gt;helper('url'); } } My category table contains: category_id, category_name, brand_id.
score: 1
accepted answer of: http://stackoverflow.com/q/28760045

http://stackoverflow.com/a/28786454
has comment: http://stackoverflow.com/comment/45853072
accepted answer of: http://stackoverflow.com/q/28785465
answers question: http://stackoverflow.com/q/28785465
upvote count: 1
type: Answer
has body: You need to define a class and use export = in View.d.ts. For example: declare module "famous/core/View" { class View { // TODO define members of View } export = View; }
downvote count: 0
score: 1
type: AcceptedAnswer

http://stackoverflow.com/a/28905470
score: 4
type: AcceptedAnswer
type: Answer
upvote count: 4
answers question: http://stackoverflow.com/q/28905364
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28905364
has body: Am I missing a key fundamental idea that IF statements ignore boolean values of FALSE? Yes, you are. This is the entire point of if. In most languages, if statements follow the following pattern: if (expression) then {statements} with the then being implied, rather than typed out, in many languages. The {statements} are only executed if the (expression) is true or 'thruthy' for languages that allow implisit casting to boolean or lack a native boolean type. For example 0 is considered false in many languages, and anything not 0 to be true. Your hasBubbleGum[i] is an expression which will return a boolean value depending on the contents of the array at index i. Your confusion may have come from not understanding what conditional expressions like == do; they simply are "special functions" which return either true or false based on their operands. if statements are one of the fudamental Control Flow primitives. The objective of flow-control statements is that they "control the flow of program execution" based on some condition. A while loop is also a control flow statement; The code inside its scope is executed in a loop so long as its condition remains true.

http://stackoverflow.com/comment/46092070
type: AnswerComment
type: Comment
has text: can i get upload speed from this var Kbytes_per_second? @FactoryAidan
comment on: http://stackoverflow.com/a/28893261
score: 0

http://stackoverflow.com/q/28773581
has answer: http://stackoverflow.com/a/28773796
answer count: 2
has comment: http://stackoverflow.com/comment/45825894
tagged with: php
accepted answer: http://stackoverflow.com/a/28773796
has comment: http://stackoverflow.com/comment/45825506
score: 2
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28773798
has body: I have the below code which uses JS procedure to format a date into May 6, 2012 which then will be echoed in PHP code: <?php echo ' '?> I need the JS procedure to format the date and display it within PHP but it returns nothing !! I would highly thank and appreciate any help !!
has answer: http://stackoverflow.com/a/28773798
has comment: http://stackoverflow.com/comment/45825493
has title: Trying to echo a Javascript procedure in PHP but it returns nothing
type: AnsweredQuestion
favorite count: 0
has comment: http://stackoverflow.com/comment/45825530
type: Question
upvote count: 2

http://stackoverflow.com/q/28847276
type: AnsweredQuestion
upvote count: 2
type: Question
has comment: http://stackoverflow.com/comment/45962772
has answer: http://stackoverflow.com/a/28847320
tagged with: javascript
has answer: http://stackoverflow.com/a/28847369
has title: Variable undefined in Java script
accepted answer: http://stackoverflow.com/a/28847365
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28847415
possible better answer: http://stackoverflow.com/a/28847320
has comment: http://stackoverflow.com/comment/45962906
has answer: http://stackoverflow.com/a/28847365
answer count: 5
has answer: http://stackoverflow.com/a/28847323
has body: function getForm() { var arry =[ [0,1] ,[1,2],[2,3],[3,4]]; var a; var x = 1 ; console.log(x); for (i = 0; i &lt; arry.length; ++i) { if (arry[i][0] == x) { a = arry[i][1]; } console.log(a); } } I am totally new to JavaScript, I was running this programming in Firebug. I have got the output as undefined I was expecting the output x=1,a=2(I mean first console.log and second one). I was defined all the variables inside the function only.
has comment: http://stackoverflow.com/comment/45962755
score: 2

relative-path
type: Tag
tags question: http://stackoverflow.com/q/28886988
tags question: http://stackoverflow.com/q/28808146
tag name: relative-path

http://stackoverflow.com/q/28903115
answer count: 0
has body: All, I'm using node-hid to send commands to a USB to I2C adapter. It is possible for the firmware on that adapter to get locked up when unplugging and replugging the device while my program is running. I have been able to determine that my program is hanging at my call to hid write which is a synchronous call. When the firmware locks up my program becomes unresponsive. If I replug the device and let the firmware recover then I can catch the write failure and handle appropriately. What I'm trying to do is alert the user that the device seems to have been locked up and they need to unplug and replug it. I tried doing something like the below to set a timeout for the write call and if it hadn't completed and cleared the timeout in 2 seconds then tell the user to reset the device. function alertUser() { alert("It appears that the USB2ANY has had an error\nPlease disconnect and reconnect the device and clear this alert"); } try { //TODO: Gets stuck here when USB2ANY goes south. Need a way to stop this or alert user to reset the USB2ANY // write is a synchronous call var timer = setInterval(alertUser, 2000); console.log("Calling hid write for " + command); this.hid.write(temp); clearInterval(timer); console.log("Finished hid write for " + command); } catch(err) { console.log("HID write failed = " + err); u2aFlushCallbacks(); } Unfortunately since the write command is synchronous the timer doesn't fire. I'm not sure how to work around this. Can I wrap this call somehow to make it asynchronous?
type: Question
has comment: http://stackoverflow.com/comment/46065767
linked to: http://stackoverflow.com/q/9121902
tagged with: javascript
has comment: http://stackoverflow.com/comment/46065664
score: 0
tagged with: asynchronous
has title: make synchronous call asynchronous in javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46065775
tagged with: synchronous

http://stackoverflow.com/a/28865870
has comment: http://stackoverflow.com/comment/45996702
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28864582
accepted answer of: http://stackoverflow.com/q/28864582
upvote count: 1
type: AcceptedAnswer
has body: Solved by rewriting the code as follows: var nameslist = document.baseURI.split('.'); nameslist.pop(); nameslist = nameslist.join('.') + ".dat"; console.log("Attempting to read from file: " + nameslist); var reader = new XMLHttpRequest() || new ActiveXObject('MSXML2.XMLHTTP'); reader.open("GET", nameslist); reader.onloadend = main; reader.responseType = "text"; reader.send(); function main() { nameslist = reader.responseText.split('\n'); nameslist = nameslist.filter(function(n){return n;}).sort(); console.log("Elements read: " + nameslist.length); // Additional code to be run after the load is complete goes in this block, starting at this line. }
type: Answer

http://stackoverflow.com/comment/45800863
type: Comment
type: QuestionComment
score: 0
has text: Yes sir. total php echo want to add jquery .append
comment on: http://stackoverflow.com/q/28759393

http://stackoverflow.com/q/28889035
score: 1
tagged with: sublimetext3
answer count: 0
has comment: http://stackoverflow.com/comment/46039319
has title: Sublime text 3 wrong auto complete on </ inside
type: UnansweredQuestion
upvote count: 1
has body: I want to write this code: When I typing </ in line return Hello World</ Sublime auto-closes tag to instead of . This is very annoying while coding using JSX style (react.js) Is there any way to fix this?
tagged with: auto-close
has comment: http://stackoverflow.com/comment/46039238
has comment: http://stackoverflow.com/comment/46039208
type: Question
has comment: http://stackoverflow.com/comment/46039148
has comment: http://stackoverflow.com/comment/46039566
tagged with: autocomplete
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/46039254
favorite count: 0
has comment: http://stackoverflow.com/comment/46039318

http://stackoverflow.com/comment/45929455
comment on: http://stackoverflow.com/a/28827816
has text: It will reload as obvious. When you click the server control, ASP.NET always loads the page and then call the event which is triggered from JavaScript call. Its like we are clicking the button without mouse.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28801710
type: Answer
answers question: http://stackoverflow.com/q/28801644
score: 0
has body: try this on your php code, &lt;?php echo json_encode(array(isset($_POST['functionname']) ? $_POST['functionname'] : "error" )); ?&gt;
has comment: http://stackoverflow.com/comment/45878151

http://stackoverflow.com/a/29496033
type: Answer
answers question: http://stackoverflow.com/q/28752744
has body: google.charts.Line is a reference to the newer Google Material Charts. From the docs: The Material Charts are in beta. The appearance and interactivity are largely final, but the way options are declared is not. Unfortunately, you can't set some options yet, see this open issue: The pointSize option is not yet supported for Material Charts.
score: 4
upvote count: 4
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28752744

http://stackoverflow.com/q/28768532
possible better answer: http://stackoverflow.com/a/28768652
tagged with: javascript
has body: I have a div box gallery with some pictures on background and 2 lateral buttons prev and next. On click of a button the JavaScript show the next or previous picture, that's ok but I wish also to make this transition automatic using an interval time to show the next picture. How can I proceed? This is my HTML: This is my JavaScript function: // goto next or previous slide BoxesFx.prototype._navigate = function( dir ) { if( this.isAnimating ) return false; this.isAnimating = true; var self = this, currentPanel = this.panels[ this.current ]; if( dir === 'next' ) { this.current = this.current < this.panelsCount - 1 ? this.current + 1 : 0; } else { this.current = this.current > 0 ? this.current - 1 : this.panelsCount - 1; } // next panel to be shown var nextPanel = this.panels[ this.current ]; // add class active to the next panel to trigger its animation classie.add( nextPanel, 'active' ); // apply the transforms to the current panel this._applyTransforms( currentPanel, dir ); // let´s track the number of transitions ended per panel var cntTransTotal = 0, // transition end event function onEndTransitionFn = function( ev ) { if( ev && !classie.has( ev.target, 'bg-img' ) ) return false; // return if not all panel transitions ended ++cntTransTotal; if( cntTransTotal < self.panelsCount ) return false; if( support.transitions ) { this.removeEventListener( transEndEventName, onEndTransitionFn ); } // remove current class from current panel and add it to the next one classie.remove( currentPanel, 'current' ); classie.add( nextPanel, 'current' ); // reset transforms for the currentPanel self._resetTransforms( currentPanel ); // remove class active classie.remove( nextPanel, 'active' ); self.isAnimating = false; }; if( support.transitions ) { currentPanel.addEventListener( transEndEventName, onEndTransitionFn ); } else { onEndTransitionFn(); } }
score: 0
answer count: 3
tagged with: jquery
has answer: http://stackoverflow.com/a/28768652
has answer: http://stackoverflow.com/a/28769696
accepted answer: http://stackoverflow.com/a/28769696
has answer: http://stackoverflow.com/a/28768655
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has title: How could I automate a JavaScript function to autoplay a slideshow?
linked to: http://stackoverflow.com/q/2199949
type: Question

http://stackoverflow.com/q/28877966
score: 1
has comment: http://stackoverflow.com/comment/46017889
favorite count: 0
has comment: http://stackoverflow.com/comment/46018098
has comment: http://stackoverflow.com/comment/46017819
has comment: http://stackoverflow.com/comment/46017765
has body: var mainCube = Array.prototype.slice.call(document.querySelectorAll('.mainCubeClass'));//assume there are **three** if (mainCube !== null) { for (k = 0; k &lt; mainCube.length; k++) { mainCube[k] = new Array(15); } //fill each slot in the array with an array of 15 slots document.write("Check1");//everything good so far for (var i = 0; i &lt; mainCube.length; i++) { document.write("Check2");//okay, still good for (var j = 0; j &lt; mainCube[i].length; j++) { //this is now 15 document.write("Check3");//everything still as expected mainCube[i][j] = document.createElement('div'); mainCube[i][j].className = '.letterPix'; mainCube[i].appendChild(mainCube[i][j]); document.write("Check4"); //doesn't execute } } I need to enter div elements into a 2dimensional array. I want to create these divs dynamically because the .mainCubeClass may vary from page to page. I've done this with 1d arrays but I've hit a wall now that I cannot seem to get past with 2d arrays and I've narrowed the area of error to the spot in between "check3" and "check4" but I can't seem to find a solution. Does anyone think they may know how to insert every new element created into a slot of my 2d array. For example, if there are 3 .mainCubeClasse then there should be a total of 45 elements being created and inserted at position mainCube[0][0]...mainCube[0][1] etc. etc.
answer count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/46017913
has answer: http://stackoverflow.com/a/28878125
has answer: http://stackoverflow.com/a/28878088
possible better answer: http://stackoverflow.com/a/28878088
has comment: http://stackoverflow.com/comment/46017736
has comment: http://stackoverflow.com/comment/46017956
tagged with: arrays
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28878125
type: Question
has comment: http://stackoverflow.com/comment/46017823
has comment: http://stackoverflow.com/comment/46018550
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: Inserting html div elements into 2-dimensional array
has comment: http://stackoverflow.com/comment/46017855

http://stackoverflow.com/a/28854348
answers question: http://stackoverflow.com/q/28854239
upvote count: 2
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/45975121
has body: You can use this. View Source
downvote count: 1
has comment: http://stackoverflow.com/comment/45975734

http://stackoverflow.com/comment/45863241
type: Comment
type: QuestionComment
has text: You don't have an element with id "message". Maybe it should be changed to "comments" here: document.getElementById('message').value!=''
score: 0
comment on: http://stackoverflow.com/q/28794325

http://stackoverflow.com/a/28803739
upvote count: 1
has comment: http://stackoverflow.com/comment/45909774
has comment: http://stackoverflow.com/comment/45911018
downvote count: 0
answers question: http://stackoverflow.com/q/28803287
has comment: http://stackoverflow.com/comment/45913762
has comment: http://stackoverflow.com/comment/45913000
type: Answer
has comment: http://stackoverflow.com/comment/45892023
has body: You could create a firstSucceeding function that would either return the value of the first succeeded operation or throw a NonSucceedingError. I've used ES6 promises, but you can adapt the algorithm to support the promise interface of your choice. function checkIf(val) { console.log('checkIf called with', val); return new Promise(function (resolve, reject) { setTimeout(resolve.bind(null, [val, val === 'B']), 0); }); } var firstSucceeding = (function () { return function (alternatives, succeeded) { var failedPromise = Promise.reject(NoneSucceededError()); return (alternatives || []).reduce(function (promise, alternative) { return promise.then(function (result) { if (succeeded(result)) return result; else return alternative(); }, alternative); }, failedPromise).then(function (result) { if (!succeeded(result)) throw NoneSucceededError(); return result; }); } function NoneSucceededError() { var error = new Error('None succeeded'); error.name = 'NoneSucceededError'; return error; } })(); function getMode() { return firstSucceeding([ checkIf.bind(null, 'A'), checkIf.bind(null, 'B'), checkIf.bind(null, 'C') ], function (result) { return result[1] === true; }); } getMode().then(function (result) { console.log('res', result); }, function (err) { console.log('err', err); });
score: 1
has comment: http://stackoverflow.com/comment/45908887

http://stackoverflow.com/q/28773562
accepted answer: http://stackoverflow.com/a/28773823
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28773734
type: Question
has answer: http://stackoverflow.com/a/28773739
tagged with: javascript
tagged with: jquery
has title: Suggestions for choosing between two functions
score: 0
possible better answer: http://stackoverflow.com/a/28773734
has comment: http://stackoverflow.com/comment/45834748
has body: Two pieces of jQuery code below (1) (2), Can someone tell which one is better and why? And should I place myfunction at the top or bottom? I have been seeing both in many answers on the related topics. (1) var myfunction = function () { // do stuff }; $(document).ready(myfunction); $(window).resize(myfunction); (2) $(document).ready(myfunction); $(window).on('resize',myfunction); function myfunction() { // do stuff } Forgive me if the question wasn't asked in the proper way.
has comment: http://stackoverflow.com/comment/45825718
has answer: http://stackoverflow.com/a/28773722
answer count: 4
has answer: http://stackoverflow.com/a/28773823

http://stackoverflow.com/comment/46063495
type: AnswerComment
comment on: http://stackoverflow.com/a/28901979
score: 0
has text: For discussion about this pattern see http://programmers.stackexchange.com/questions/203469/if-my-team-has-low-skill-should-i-lower-the-skill-of-my-code
type: Comment

http://stackoverflow.com/comment/45977010
score: 0
type: QuestionComment
type: Comment
has text: The plugin has so many bindings and events using the Aloha.bind() method, I'll post an example of one of them above.
comment on: http://stackoverflow.com/q/28855392

http://stackoverflow.com/comment/46045692
has text: I appreciate the help. Actually, I found the issue. Pulling #master was causing my problem. I instead should have been pulling the proper version I needed.
comment on: http://stackoverflow.com/q/28890328
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28775191
has title: How to make Browser request java scripts whenever we open different releases of same webpage of ADF application?
has body: Browser requests and cache java scripts when a web page is loaded for the first time and they could be out dated if you try to reopen the same webpage of an ADF application which runs with different release containing modified version of java scripts because browser doesn't seem to request again as they are cached. Does Oracle ADF provide mechanism to make sure browser requests for java scripts only if they are from different release ?
answer count: 1
type: UnansweredQuestion
tagged with: oracle-adf
tagged with: java
has answer: http://stackoverflow.com/a/28775576
type: Question
tagged with: javascript
score: 0

http://stackoverflow.com/comment/46044597
has text: I only see 1 div in your HTML and no thumbs, and no clear description of the problem.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28891835

http://stackoverflow.com/q/28887214
tagged with: jquery
linked to: http://stackoverflow.com/q/12824549
has answer: http://stackoverflow.com/a/28887354
has comment: http://stackoverflow.com/comment/46035721
score: 0
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28887279
has body: I want to add a clickable caption to a table with jQuery. I add it like this: $("table.table-legend").prepend(' Select All - None '); This works and I do get a clickable caption, but I can't figure out how to define the function that gets called. I tried: $('table caption a').on('click', function () { and $('.edit-select a').on('click', function () { and a few other ways, but no matter what, my function is not called. What is the proper way to do this?
accepted answer: http://stackoverflow.com/a/28887279
type: AnsweredQuestion
has title: Adding a clickable table caption with jQuery
has comment: http://stackoverflow.com/comment/46036403
type: Question
tagged with: html-table
has comment: http://stackoverflow.com/comment/46035739
possible better answer: http://stackoverflow.com/a/28887354
tagged with: javascript

http://stackoverflow.com/comment/45967762
comment on: http://stackoverflow.com/q/28839401
score: 0
type: Comment
has text: well... specifically the source of the leak :) any references to `this`
type: QuestionComment

http://stackoverflow.com/q/28884504
has body: I have structure like Upload Your Pic blabla 1 Upload Your Pic blablas 2 So with element fileuploader1 I must remove blabla 1 And with element fileuploader2 I must remove blabla 2 I tried something like below $('#fileuploader1').next().next().remove(); I need to remove only if next of next div is ajax-file-upload-statusbar
has comment: http://stackoverflow.com/comment/46032204
has comment: http://stackoverflow.com/comment/46030616
type: AnsweredQuestion
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/28885574
has comment: http://stackoverflow.com/comment/46032099
has answer: http://stackoverflow.com/a/28884679
type: Question
has title: Jquery remove next of next div element
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28885524
answer count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/28885524
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28885574
favorite count: 0

http://stackoverflow.com/q/28842628
has answer: http://stackoverflow.com/a/28843038
tagged with: javascript
linked to: http://stackoverflow.com/q/28551445
score: 12
has title: Does HTML comment <!-- act as a single-line comment in JavaScript, and why?
answer count: 1
downvote count: 0
has body: How specifically does JavaScript understand the construct &lt;!--? From the point of view of JavaScript, is it yet another comment in addition to // and /* */? From testing it seems that JavaSript treats &lt;!-- like //: a one-liner &lt;script&gt; &lt;!-- alert('hi') //--&gt; &lt;/script&gt; does nothing, while &lt;script&gt; &lt;!-- alert('hi') //--&gt; &lt;/script&gt; works as expected. Where is this behavior documented? This is not a duplicate of other questions: I don't ask why or whether or how it should be used. I ask what syntax and semantics it has in JavaScript, formally. The question is non-trivial and is not answered in other questions: for example, the behavior indicated above cannot be guessed from the other questions and their answers (in fact this was my motivation: my program with a one-liner as above did not work, and those questions and answers were no help in understanding why).
has comment: http://stackoverflow.com/comment/45954913
favorite count: 0
accepted answer: http://stackoverflow.com/a/28843038
has comment: http://stackoverflow.com/comment/45954491
linked to: http://stackoverflow.com/q/1507939
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45954395
has comment: http://stackoverflow.com/comment/45954915
type: Question
upvote count: 12

http://stackoverflow.com/a/28866364
has comment: http://stackoverflow.com/comment/45997718
has comment: http://stackoverflow.com/comment/45997779
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/28866249
answers question: http://stackoverflow.com/q/28866249
upvote count: 2
has body: This will work: Volume 50% You need to change onchange to oninput, they don't use what they tell you.
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/46026417
has text: assuming that you have jQuery on your page, and it has the alias $, this should work: $('li[data-index]').length
comment on: http://stackoverflow.com/q/28881519
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28763853
score: 1
answers question: http://stackoverflow.com/q/28763710
downvote count: 0
has body: $controller will instantiate the controller. You need to pass the scope to it. ctrl1 = $controller('ControllerOne', {$scope: $scope}) Here is the updated fiddle. http://jsfiddle.net/oqnrrL8y/1/
type: Answer
upvote count: 1

http://stackoverflow.com/a/28887021
answers question: http://stackoverflow.com/q/28886441
type: Answer
has body: If I understood your question correctly you want only to use the .active css class for showing the selected nav. One option would be to override the bootstrap's default color on focused nav's. .navbar-inverse .navbar-nav&gt;li&gt;a:focus { color:#777; outline:none; // to remove possible blue borders } http://jsfiddle.net/sygn/3k7e88p9/
has comment: http://stackoverflow.com/comment/46059147
has comment: http://stackoverflow.com/comment/46047964
score: 0
has comment: http://stackoverflow.com/comment/46046539
has comment: http://stackoverflow.com/comment/46058560

http://stackoverflow.com/comment/45931227
has text: @Ranjith: it didn't work..
comment on: http://stackoverflow.com/q/28830327
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45956997
has text: Please share you controller.
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28843522

http://stackoverflow.com/comment/45894268
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28802874
has text: I'd like to manipulate the text without changing any of the properties in the CSS file...
score: 0

http://stackoverflow.com/q/28791046
upvote count: 1
tagged with: php
has title: How to get new URL after submiting form on page that adds random code on URL using JavaScript?
has comment: http://stackoverflow.com/comment/45857562
score: 1
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45858470
type: Question
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45857345
favorite count: 0
tagged with: curl
has body: &lt;?php $hat2 = 'http://example.com/'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $hat2); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_AUTOREFERER, 1); $html = curl_exec($ch); ?&gt; When I click on a button of that page (example.com), it adds some more code (e.g. 1425192105017) to the URL using a JS script. But I can't get the code on the page itself, like 'http://example.com/xyz?_=1425192105017' My question is: how do I get the particular code (1425192105017) from $html? I don't know exactly how to get that code from the URL. I didn't use preg_match to find that code from the HTML page itself, because it doesn't have that code. A JS script randomly generates the code. I want that future URL (http://example.com/xyz?_=code) from $html to use that code in the next curl option.
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/a/28764004
answers question: http://stackoverflow.com/q/28763822
upvote count: 1
has comment: http://stackoverflow.com/comment/45807859
score: 1
downvote count: 0
has body: $(document).ready(function() { $('.text').keyup(function(){ if( $(this).val()!= ''){ var valThis = $(this).val().toLowerCase(); $('.number li').each(function(){ var text = $(this).text().toLowerCase(); (text.indexOf(valThis) !== -1) ? $(this).contents().get(0).nodeValue : $(this).hide(); }); }else{ $('.number li').show(); } }); }); /*-------------- Html ----------------- */ 1 2 3 4 5 6 7 8 9 10
type: Answer
has comment: http://stackoverflow.com/comment/45807101

http://stackoverflow.com/a/65301582
answers question: http://stackoverflow.com/q/28839532
downvote count: 0
has body: Add { resave: true, saveUninitialized: true } to your session middleware
type: Answer
score: 8
upvote count: 8

http://stackoverflow.com/comment/46047486
score: 0
comment on: http://stackoverflow.com/q/28893519
type: Comment
type: QuestionComment
has text: http://stackoverflow.com/questions/12893046/how-to-manage-client-side-javascript-dependencies

http://stackoverflow.com/comment/73451567
score: 0
type: Comment
has text: Not straightforward for a *multi*barchart.
comment on: http://stackoverflow.com/a/38247527
type: AnswerComment

http://stackoverflow.com/comment/45854512
comment on: http://stackoverflow.com/q/28789496
has text: @m59 care to explain? I'm genuinely curious. I thought JSONP was strictly just a way to call for cross-site requests. At least it's that in jQuery.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45802873
score: 1
has text: So, if i want to change `` text, how ?
comment on: http://stackoverflow.com/a/28761536
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28863272
has comment: http://stackoverflow.com/comment/46028904
type: AcceptedAnswer
has body: This isn't possible since every session creates it's own worker. Loading source code of worker in the main thread as text, and using that to create blob object will be hacky and less performant than loading it multiple times in a worker. If you are only concerned about network fetch, try setting proper cache headers for that file. If you want only one worker for all editors, you have to modify ace. You can use github to create feature or pull request.
type: Answer
score: 0
accepted answer of: http://stackoverflow.com/q/28861512
answers question: http://stackoverflow.com/q/28861512

http://stackoverflow.com/q/28795713
has answer: http://stackoverflow.com/a/28796357
tagged with: javascript
has comment: http://stackoverflow.com/comment/45866721
has comment: http://stackoverflow.com/comment/45866594
score: 0
tagged with: radio-button
has comment: http://stackoverflow.com/comment/45866858
has comment: http://stackoverflow.com/comment/45866142
has comment: http://stackoverflow.com/comment/45866554
has comment: http://stackoverflow.com/comment/45866248
has comment: http://stackoverflow.com/comment/45866223
has body: I'm trying to get onclick event in html radio buttons to call a function in JavaScript program. When I use button, it works: HTML5: ... ... Button1 ... JavaScript (in index.js): function clickedButton1 () { console.log("clickedButton1") } But when I use radio button, the onclick does not call the function: HTML5 (in the same file above): Yes No Javascript (in index.js): function test () { console.log ("test") } What's wrong with my code? Any help?
has comment: http://stackoverflow.com/comment/45866030
has comment: http://stackoverflow.com/comment/45866049
has comment: http://stackoverflow.com/comment/45865995
answer count: 5
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: radio button onclick event does not work
has answer: http://stackoverflow.com/a/28795760
has answer: http://stackoverflow.com/a/28795758
has answer: http://stackoverflow.com/a/28796490
has answer: http://stackoverflow.com/a/28796824
type: Question
has comment: http://stackoverflow.com/comment/45866909

http://stackoverflow.com/a/28868656
upvote count: 1
has comment: http://stackoverflow.com/comment/46001733
has body: You would use: $("#chkCom:checked").each(function () { // ... }); Since it looks like you are trying to iterate over multiple elements with an id of #chkCom, this implies there there are duplicate ids. It's worth mentioning that ids must be unique, use a class instead.
has comment: http://stackoverflow.com/comment/46001746
answers question: http://stackoverflow.com/q/28868583
downvote count: 0
has comment: http://stackoverflow.com/comment/46001676
has comment: http://stackoverflow.com/comment/46001654
type: Answer
score: 1

http://stackoverflow.com/comment/46048563
type: QuestionComment
comment on: http://stackoverflow.com/q/28893385
has text: I edited my answer, but here's an updated fiddle based on what you created: https://jsfiddle.net/mvc1poad/1/ (instead of a switch statement, I'm just pulling the values from a `data-attr` of the select element)
score: 0
type: Comment

http://stackoverflow.com/q/28777185
downvote count: 3
has answer: http://stackoverflow.com/a/28777446
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
possible better answer: http://stackoverflow.com/a/28777446
score: -3
tagged with: css
tagged with: node.js
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/45832419
accepted answer: http://stackoverflow.com/a/28777405
type: Question
tagged with: reactjs
has title: React Image displaying
tagged with: javascript
has answer: http://stackoverflow.com/a/28777405
has body: When im deploying my website localy there is no problem at all viewing my images, but when im deploying my build it gets very bad. How can i specify the source in the image tag to not be static/media in the build version? This is how the html looks on the website
answer count: 2

http://stackoverflow.com/comment/46025631
has text: So, what do you want to animate ? :)
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28881939

http://stackoverflow.com/comment/45793767
type: AnswerComment
comment on: http://stackoverflow.com/a/28754031
type: Comment
score: 1
has text: I'll just add this. As denoted in my tags, I'm using Yii 2. I was getting an issue with bad requests since I wasn't sending the _csrf value along with it in the post variables. I solved it by adding this to the post variables array: _csrf: $('meta[name="csrf-token"]').attr("content"). The only other way would have been to disable CSRF checking in the controller, which would be most distasteful.

http://stackoverflow.com/comment/45905191
type: Comment
type: QuestionComment
has text: What about using tidy ? http://tidy.sourceforge.net/
score: 1
comment on: http://stackoverflow.com/q/28816634

http://stackoverflow.com/comment/45835345
type: Comment
score: 1
has text: @mohamedrias: Better use `Object.create` and call `a.call(this);` inside `b`.
type: AnswerComment
comment on: http://stackoverflow.com/a/28778838

http://stackoverflow.com/a/28784565
accepted answer of: http://stackoverflow.com/q/28784234
has body: Please note that "forEach" is not supported in certain browsers such as IE8. Also, please consider the following implementation: function changeName(name) { var removearray = ['.CS', ' Dota2', '-Dota2', ' Esports', 'eSports', ' Tactics', 'DotCom', ' DotA2', ' - LoL', '-LoL', ' Carry', 'Â', ' LoL']; return team = removearray.reduce(function(previous, current) { return previous.replace( new RegExp( current, 'g' ), '' ); }, name); } The "reduce" method available in the Array Prototype in Javascript is a very nice way of doing tasks such as this one.
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28784234
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/comment/45830753
type: QuestionComment
has text: This is **NOT** a duplicate of Object ID. the entire point is I don't want object ids. I don't need them in other languages, why should I need them here.
score: 0
comment on: http://stackoverflow.com/q/28775157
type: Comment

http://stackoverflow.com/comment/45896291
type: Comment
has text: Added the isSpell function in my post. I will try ng-show :)
comment on: http://stackoverflow.com/q/28811565
score: 0
type: QuestionComment

http://stackoverflow.com/q/28793098
has answer: http://stackoverflow.com/a/50095649
has answer: http://stackoverflow.com/a/60616752
type: Question
answer count: 8
has answer: http://stackoverflow.com/a/29197975
has title: Express and Typescript - Error.stack and Error.status properties do not exist
tagged with: javascript
has answer: http://stackoverflow.com/a/31267401
tagged with: express
has answer: http://stackoverflow.com/a/28793841
has answer: http://stackoverflow.com/a/28800079
has body: I'm trying to convert an existing node.js project from javascript to typescript. I've been using the default 404 error catcher from the Visual Studio Express 4 template: // catch 404 and forward to error handler app.use(function (req, res, next) { var err = new Error('Not Found'); err.status = 404; next(err); }); However, I'm getting the following error message: Property 'status' does not exist on type 'Error'. I get a similar message if I try and invoke the Error's .stack property: Property 'stack' does not exist on type 'Error'. Does anyone know what's going on here? Edit: Steve Fenton points out that I could just put the error status on the response object. However, my error handling mechanism uses a two-step process: Create the 404 error and set its status Hand it on to the following generic handler: app.use(function (err, req, res, next) { res.status(err.status || 500); res.render('error', { message: err.message, error: {} }); }); So the error status is first set on the Error object, then read back by the error handler to decide how to handle the error.
downvote count: 0
accepted answer: http://stackoverflow.com/a/28800079
favorite count: 0
possible better answer: http://stackoverflow.com/a/46871443
has answer: http://stackoverflow.com/a/46871443
upvote count: 41
has answer: http://stackoverflow.com/a/40098090
tagged with: node.js
tagged with: typescript
type: AnsweredQuestion
score: 41

http://stackoverflow.com/q/28889212
has answer: http://stackoverflow.com/a/28891892
has title: Node-webkit run .js file only?
tagged with: node.js
favorite count: 0
has answer: http://stackoverflow.com/a/28890728
linked to: http://stackoverflow.com/q/27154941
answer count: 2
tagged with: node-webkit
upvote count: 1
possible better answer: http://stackoverflow.com/a/28890728
accepted answer: http://stackoverflow.com/a/28891892
tagged with: webkit
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
score: 1
has body: Is it possible for node-webkit to run a js file, and not a .html file? I have a small app that is supposed to open a external url (and capture it to image), and I don't see the point of creating a html file with my script. I just want the script to run
type: Question

http://stackoverflow.com/a/28883904
has comment: http://stackoverflow.com/comment/46031722
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46030604
has comment: http://stackoverflow.com/comment/46029981
has comment: http://stackoverflow.com/comment/46032095
has comment: http://stackoverflow.com/comment/46029761
type: Answer
has body: Edit, Updated Note, text not appear as property of object within datas.General , datas.Photos arrays ; see element.text . Properties appear named id , value ; i.e.g., element.id , element.value. To filter single property name, try function createElements(elements) { if (elements.target.readyState === 4) { var elems = elements.target.response; var keys = Object.keys(elems.datas).filter(function(name) { return name === "General" }); keys.forEach(function (element, i) { var el = elems.datas[element]; el.forEach(function(key, i) { var div = document.getElementById(key.id); div.innerHTML = key.value; }) }); } }; var request = new XMLHttpRequest(); request.onload = createElements; request.responseType = "json"; request.open("GET", "datas.json", true); request.send(); jsfiddle http://jsfiddle.net/k2f7b3mp/ To filter multiple property names, try function createElements(elements) { if (elements.target.readyState === 4) { var elems = elements.target.response; var keys = Object.keys(elems.datas).filter(function(name) { return name === "General" || name === "Color" }); console.log(keys, 1) keys.forEach(function (element, i) { var el = elems.datas[element]; el.forEach(function(key, i) { console.log(key, i); if (document.getElementById(key.id)) { var div = document.getElementById(key.id); div.innerHTML = key.value; } }) }); } }; http://jsfiddle.net/b6n8q1d1/2/
has comment: http://stackoverflow.com/comment/46029381
answers question: http://stackoverflow.com/q/28882926
has comment: http://stackoverflow.com/comment/46030297
accepted answer of: http://stackoverflow.com/q/28882926
has comment: http://stackoverflow.com/comment/46030092
has comment: http://stackoverflow.com/comment/46029825
has comment: http://stackoverflow.com/comment/46030081
score: 0

http://stackoverflow.com/comment/45901923
has text: [ngmodules](http://ngmodules.org/) or [bower package search](http://bower.io/search/) are good resources to see if "angular-ized" 3rd party modules are available for the functionality you are looking for. If you're looking for an isotope library for [Angular Isotope](http://mankindsoftware.github.io/angular-isotope/) is a good option.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28776007

http://stackoverflow.com/comment/46021389
comment on: http://stackoverflow.com/q/28879865
type: Comment
score: 1
type: QuestionComment
has text: You need to escape dot with \.

http://stackoverflow.com/comment/45853718
has text: Yes. At the end of the "it".I was convinced that was the issue. I had the same kind of issue recently, and it was a digest issue.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28788869

http://stackoverflow.com/comment/45976198
type: QuestionComment
comment on: http://stackoverflow.com/q/28851909
score: 0
has text: The question is still a little confusing - looking at your JSFiddle - You already achieve what has been asked - setting the minHeight style property of the Fieldset equal to the height of the highest child element in it. Am I missing something ? - Should the value be 54px ? (which is the height of the current greatest child element height)
type: Comment

http://stackoverflow.com/q/28769707
tagged with: html5-canvas
has comment: http://stackoverflow.com/comment/45817975
has body: I've been doing a project and I'm wondering if how to loop the draw image for the whole background part? I have a tile set image of 48 x 63 only, then my canvas is 800 x 500. I can't loop on every point, I tried to but it didn't work so I did on my old stuff was.. var x = document.getElementById('canvas_back'); canvas = x.getContext('2d'); var img = document.getElementById('grass'); var dx = 0; var dy = 0; canvas.drawImage(img, dx, dy); canvas.drawImage(img, dx, 60); canvas.drawImage(img, dx, 120); canvas.drawImage(img, dx, 180); canvas.drawImage(img, dx, 240); canvas.drawImage(img, dx, 300); canvas.drawImage(img, dx, 360); dx = dx + 48; HTML &lt;canvas id = "canvas_back" height= "400px" width= "624px"&gt; &lt;img id = 'grass' alt='Missing image' src = "Images/grass.png"/&gt; &lt;canvas id = "canvas_front" height= "400px" width= "600px"&gt; &lt;img id = 'house' alt='Missing image' src = "Images/house3.png"/&gt; &lt;img id = 'mail' alt='Missing image' src = "Images/mail3.png"/&gt; &lt;img id = 'building' alt='Missing image' src = "Images/building2.png" /&gt; &lt;img id = 'grass_up' alt = 'Missing image' src = "Images/grass_up.png"/&gt; &lt;img id = 'van' alt = 'Missing image' src = "Images/van2.png" /&gt; &lt;img id = 'tree' alt = 'Missing image' src = "Images/tree.png" /&gt; &lt;img id = 'player' alt = 'Missing image' src = "Images/player.png" /&gt; &lt;/canvas&gt; And so on.... Any easy loops to do it?
has comment: http://stackoverflow.com/comment/45818022
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45818065
has comment: http://stackoverflow.com/comment/45818018
answer count: 0
has comment: http://stackoverflow.com/comment/45818427
has comment: http://stackoverflow.com/comment/45818000
type: Question
tagged with: javascript
has title: Draw Image in a loop
has comment: http://stackoverflow.com/comment/45818184
has comment: http://stackoverflow.com/comment/45818502
score: 0

http://stackoverflow.com/a/65529490
accepted answer of: http://stackoverflow.com/q/28751709
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28751709
score: 0
type: Answer
has body: The workaround I took is calling an internal method trough ajax that check with a httpclient if the image is returning a 404 premade page. If so (any status 404), then returns my own anonymous image, if not, returns the string itself.

http://stackoverflow.com/q/28787772
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: Here, I have a working toogle code,so I have added some code that when click another place also return to default height(32px),but not working. var toggled = false; $('.dropdown-toggle').click(function() { $('.changeHeight').css('height', toggled ? '32px' : '65px'); toggled = !toggled; }); $(document).click( function(){ // if click another place will set default height $('.changeHeight').css('height','32'); });
possible better answer: http://stackoverflow.com/a/28788051
score: 1
has answer: http://stackoverflow.com/a/28788051
has title: jquery - How to return default height toogle automaticly by clicking another place
upvote count: 1
has answer: http://stackoverflow.com/a/28788081
type: AnsweredQuestion
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/28788081
downvote count: 0

http://stackoverflow.com/q/28841784
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/44695634
score: 0
has answer: http://stackoverflow.com/a/28843518
type: UnansweredQuestion
tagged with: iframe
linked to: http://stackoverflow.com/q/153152
has comment: http://stackoverflow.com/comment/45953165
has comment: http://stackoverflow.com/comment/45956077
tagged with: google-chrome
type: Question
has title: Get iframe content height in Google Chrome
has comment: http://stackoverflow.com/comment/45953477
has body: can anyone help me to do this code works on Google Chrome? It work's perfectly on IE. Thanks.
answer count: 2
has comment: http://stackoverflow.com/comment/45986355

http://stackoverflow.com/comment/45808332
comment on: http://stackoverflow.com/a/28764712
type: AnswerComment
has text: Because the effect I'm looking for is that some elements like blockquote tag have 100% width. In your example, the blockquote is also limited to 300px
score: 0
type: Comment

http://stackoverflow.com/q/28828881
favorite count: 0
downvote count: 0
has title: best practices with infinity.js
type: UnansweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28833182
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
has body: I am using AirBnb's infinity.js plugin to generate an infinite list in my app. I generate the list the first time on the create of the concerned page. But then the list has to update depending on filtering checkboxes and select buttons. So I have to regenerate the list. Given that the creation of my list new infinity.ListView($el); is whithin the function resetModelsListView, if I relaunch resetModelsListView every time I want to update the list it creates a new listview. How to manage this please ? function resetModelsListView(prodata, firsttime, funfeatureOn, specificBrand, specificPro) { ... //create listview var $el = $('#modelsListview'); var listView = new infinity.ListView($el); //add new content: var $newContent = $(optionsmodel); //optionsmodel is a list of &lt;li&gt;s listView.append($newContent); }
upvote count: 1
tagged with: infinity.js

http://stackoverflow.com/q/28752851
answer count: 1
tagged with: css
tagged with: twitter-bootstrap
type: UnansweredQuestion
tagged with: calendar
has answer: http://stackoverflow.com/a/28753147
type: Question
has body: I am trying to make a full Calendar appear when the user clicks on view appointment button, the calendar appears but at first I can only see the month, week, day links and then on clicking on them links I see a calendar - but I want the full calendar to be seen as soon as the user clicks on view appointment button $('#viewAvailableAppointments').click(function () { $('#page-four').slideUp(500); $('.calendar').show(); }) $('.calendar').fullCalendar({ header: { left: 'prev,next today', center: 'title', right: 'month,agendaWeek,agendaDay' }, editable: true }) and my HTML code is I also see there is an issue with CSS files, as the month, week and day are supposed to be buttons but they come up as "monthweekday" in the html page
has title: Bootstrap full calendar view on click button
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/a/28788340
downvote count: 0
type: Answer
has body: Seems like you are using Express 4.0 in which configure was removed. See http://expressjs.com/guide/migrating-4.html#other-changes
score: 1
accepted answer of: http://stackoverflow.com/q/28788325
upvote count: 1
answers question: http://stackoverflow.com/q/28788325
type: AcceptedAnswer

http://stackoverflow.com/comment/45953913
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28842355
has text: can you attach a jsFiddle please
score: 0

http://stackoverflow.com/comment/45784596
score: 0
has text: @user3846091 So it should print [Object object], not the above json.
comment on: http://stackoverflow.com/q/28750969
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28858731
has title: PHP Form with multiple submit buttons
answer count: 2
has body: I have a form with Two buttons. It's a submit form which is basically there to increase/Decrease an Integer value in a MySQL database depending on which button they click. This is a weird scenario, the page requires an ID extension; appinfo.php?id=12 Whenever I click one of the buttons it changes the extension to: appinfo.php?VoteYes=Yes Ideally I'd like it so if someone clicks on Yes it will increase a value within an SQL query and if they click no, it will decrease it. Here is what I have so far: <form action="<?php echo $_SERVER['PHP_SELF'] . "?id=" . $_GET['id']; ?>"/>
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45983460
tagged with: php
has answer: http://stackoverflow.com/a/28859256
type: UnansweredQuestion
tagged with: mysql
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28862039
tagged with: javascript
tagged with: forms

http://stackoverflow.com/comment/45864034
type: QuestionComment
comment on: http://stackoverflow.com/q/28794715
has text: Do u have a plunker?
score: 0
type: Comment

http://stackoverflow.com/q/28815707
has title: jQuery event will only run once
has comment: http://stackoverflow.com/comment/45903515
has comment: http://stackoverflow.com/comment/45903258
has comment: http://stackoverflow.com/comment/45926085
has comment: http://stackoverflow.com/comment/46203475
has comment: http://stackoverflow.com/comment/45903252
has comment: http://stackoverflow.com/comment/45903674
has answer: http://stackoverflow.com/a/28815849
score: 0
has comment: http://stackoverflow.com/comment/45903592
answer count: 3
upvote count: 1
downvote count: 1
possible better answer: http://stackoverflow.com/a/28815849
has body: I am using the table2excel plugin which will allow me to download a tables contents to an excel file. It works fine the first time but it only lets me download once per page load. I have tried changing the $("#export").click(function(){ to $("#export").on('click', function(){ but this did not work. The $('#export').click is within a doc ready // click function on page $("#export").click(function(){ $("#table2excel").table2excel({ // exclude CSS class exclude: ".noExl", name: "Excel Document Name" }); }); // external js file that gets called //table2excel.js ;(function ( $, window, document, undefined ) { var pluginName = "table2excel", defaults = { exclude: ".noExl", name: "Table2Excel" }; // The actual plugin constructor function Plugin ( element, options ) { this.element = element; // jQuery has an extend method which merges the contents of two or // more objects, storing the result in the first object. The first object // is generally empty as we don't want to alter the default options for // future instances of the plugin this.settings = $.extend( {}, defaults, options ); this._defaults = defaults; this._name = pluginName; this.init(); } Plugin.prototype = { init: function () { var e = this; e.template = " <!--[if gte mso 9]> "; e.template += "<x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions>"; e.template += "<x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook> <![endif]--> {table} "; e.tableRows = ""; // get contents of table except for exclude $(e.element).find("tr").not(this.settings.exclude).each(function (i,o) { e.tableRows += " " + $(o).html() + " "; }); this.tableToExcel(this.tableRows, this.settings.name); }, tableToExcel: function (table, name) { var e = this; e.uri = "data:application/vnd.ms-excel;base64,"; e.base64 = function (s) { return window.btoa(unescape(encodeURIComponent(s))); }; e.format = function (s, c) { return s.replace(/{(\w+)}/g, function …
tagged with: javascript
has comment: http://stackoverflow.com/comment/45963433
has answer: http://stackoverflow.com/a/67955011
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28816319
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/28816319
type: Question

http://stackoverflow.com/q/28811302
has title: Download a file on page load in Jquery
has answer: http://stackoverflow.com/a/28812091
favorite count: 0
accepted answer: http://stackoverflow.com/a/28812091
has comment: http://stackoverflow.com/comment/45894739
has body: I have a file in my server folder and now I want to download that file on page load. Example : If I click on Our products than a file has been downloaded automatically in users system from my server.
tagged with: php
type: AnsweredQuestion
tagged with: cakephp
score: -1
linked to: http://stackoverflow.com/q/1296085
type: Question
possible better answer: http://stackoverflow.com/a/28811833
answer count: 2
downvote count: 2
has answer: http://stackoverflow.com/a/28811833
upvote count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/45871240
comment on: http://stackoverflow.com/a/28798419
type: AnswerComment
score: 4
has text: Upvoted, but note `this` won't necessarily be the global object.
type: Comment

http://stackoverflow.com/comment/45817136
score: 6
has text: Don't use invalid HTML in the first place. The DOM tree created by your ` Some Text ` involves placing the text node before the table. That's why emptying it had no effect. The text is not in the table.
comment on: http://stackoverflow.com/q/28769291
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28807088
favorite count: 0
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28809642
upvote count: 1
has comment: http://stackoverflow.com/comment/45887825
has answer: http://stackoverflow.com/a/28809642
type: Question
has title: AngularJS | On refreshing the browser, angularjs templates load before the security context. How to stop it?
tagged with: angular-ui-router
has body: In my angularjs app(using angular-ui), on refreshing the browser, the templates are being loaded of the particular state before the security context is being fetched from the server. $http call for getting the security context is being hit but since it is asynchronous, they are not set yet. What is the best way to tackle this problem ? And also, I have been trying to do the following : //on the state change event from refresh $rootScope.$on('$stateChangeStart', function(event, toState, toParams, fromState, fromParams){ console.log("state change has started"); if(fromState.name === '' &amp;&amp; fromState.url === '^'){ console.log("inside state change from refresh"); //what needs to be done in this block to let the security context is fetched (should I use $timeout etc.) ? ......... ......... } });
accepted answer: http://stackoverflow.com/a/28820627
score: 1
answer count: 2
has comment: http://stackoverflow.com/comment/45887198
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/26232638
tagged with: angularjs
has answer: http://stackoverflow.com/a/28820627

http://stackoverflow.com/q/28851820
upvote count: 1
has title: Php echoing only last post from array and update it only
tagged with: javascript
type: UnansweredQuestion
tagged with: arrays
answer count: 0
downvote count: 0
score: 1
favorite count: 0
has body: This is my update script of wall page. If a user reply any comment, the update script update yet to all users wall page without refresh. ( just like chat ) So for do this, I need to sent two type id to server.php page, 1st is user page id and 2nd for all post id of user. I create a array for sent all post ids with javascript in wall.php page and another array in server.php to get them. All array works well, if I test it by print_r($_REQUEST['CID']); exit; at server.php page. But when I reply any post in user page, the update script working only for last post not for any others post. Where is my problem here please? my wall.php // id is dynamic //Check for any update after 15 second interval by post id. server.php while (true) { if($_REQUEST['tutid'] && $_REQUEST['CID']){ foreach($_REQUEST['CID'] as $key => $value){ date_default_timezone_set('Asia/Dhaka'); $datetime = date('Y-m-d H:i:s', strtotime('-15 second')); $res = mysqli_query($dbh,"SELECT * FROM comments_reply WHERE post_id =".$value." AND qazi_id=".$_REQUEST['tutid']." AND date >= '$datetime' ORDER BY id DESC LIMIT 1") or die(mysqli_error($dbh)); } // array close $rows = mysqli_fetch_assoc($res); $row[] = array_map('utf8_encode', $rows); $data = array(); $data['id'] = $rows['id']; $data['qazi_id'] = $rows['qazi_id']; //ect all // do something and echo $data['detail'] = $detail; if (!empty($data)) { echo json_encode($data); flush(); exit(0); } } // request close sleep(5); } // while close
type: Question
tagged with: php

http://stackoverflow.com/comment/45787399
has text: Where in your Javascript does giftarray get converted to the "gift" used in the Ajax call?
score: 0
comment on: http://stackoverflow.com/q/28751314
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28904952
tagged with: backbone.js
has answer: http://stackoverflow.com/a/28912263
type: Question
tagged with: node.js
score: 0
answer count: 1
has body: I have the following template in my index.jade: .... &lt;script type="text/template" id="sample-template"&gt; a(href="&lt;%= link.href %&gt;") &lt;%= link.title %&gt; &lt;/script&gt; .... And I have the below code in my backbone view which sends a variable called link to index.jade. .... var SampleView = Backbone.View.extend({ template: _.template($('#sample-template').html()), render: function() { this.$el.append(this.template({ link: this.model.toJSON() })); return this; } }); .... Now when I render that template I get the following output: &lt;a href="&lt;%= link.href %&gt;"&gt; sample link You see, I got the correct output for title variable. But the problem is with href. It doesn't print the value of link.href.
accepted answer: http://stackoverflow.com/a/28912263
has title: Send variable from backbone view to jade template
has comment: http://stackoverflow.com/comment/46071912
tagged with: javascript
type: AnsweredQuestion
tagged with: pug
linked to: http://stackoverflow.com/q/22777587
has comment: http://stackoverflow.com/comment/46072322

radupload
type: Tag
tag name: radupload
tags question: http://stackoverflow.com/q/28904905

http://stackoverflow.com/q/28751997
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45786302
tagged with: regex
has answer: http://stackoverflow.com/a/28752197
score: 2
upvote count: 2
tagged with: spaces
type: AnsweredQuestion
has body: I am struggling to make a javascript regex to satisfy the following: The first character has to be alphabetical ([a-zA-Z]) The rest can be any letters, any numbers, hyphen, dot, underscore and spaces BUT no consecutive spaces, e.g: two or more spaces in a row The length has to be between 3 and 25 (inclusive) So here is what I found Regex: /^[a-z][\s\w.-]{3,24}$/i My current regex works, but won't be able to test whether the user has written consecutive spaces. How can I test for that?
has title: regex to match a username with no consecutive spaces
accepted answer: http://stackoverflow.com/a/28752197
type: Question
has comment: http://stackoverflow.com/comment/45786122

http://stackoverflow.com/comment/46014899
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28790744
has text: @dandavis you may be right on that. In the end, for this particular need, I basically put in an `embed` property, so that instead of getting `customer` and then `customer.orders`, when you `get` the `customer`, you indicate that you will want the `orders` and it embeds them (deep object retrieval). It is a bit of a punt on it, but I could find no way that was clean!
score: 0

http://stackoverflow.com/q/28758764
tagged with: backbone.js
tagged with: model
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28760565
type: Question
tagged with: javascript
has title: Best Practises - BackBone JS - Model View Relationship
score: 0
answer count: 1
has body: I need some suggestions around what should be the best-practice for the below scenario : 1. *Who (Model or View ) should hold the promise when a "FETCH" is called upon the Model ?* For example : Model FOO --&gt; initialize: { .....this.promise = this.fetch(); } View view --&gt; someWhere: { var foo=new Foo(); foo.promise.done(..do something here) } OR Model FOO --&gt; initialize: { ... } View view --&gt; someWhere: { var foo=new Foo(); var myPromise=foo.fetch();myPromise.done(..do something..) } .... 2. Second Question is around whether Initializing a Model should automatically call the fetch ? ( As noted in the above Example ) There is no harm in doing either ways but I am not able to figure pros-cons of over each either style. Your opinion is appreciated

http://stackoverflow.com/a/28823300
answers question: http://stackoverflow.com/q/28823283
has comment: http://stackoverflow.com/comment/45918480
score: 3
has body: Simple answer: use the first one More detailed answer The first snippet sets the sTitle, authName, storyNum, and creationDate properties on the object. The second snippet creates 4 local variables and sets their values. Those variables are inaccessible from outside the function. You can use the local variables and the object variables together like this: function RootNode(sTitle, authName, storyNum) { this.sTitle = sTitle; // you can access this variable when you . into the object var privateVariable = 'You cannot see this variable when you . into the object directly'; this.methodInObject = function() { return privateVariable; // but you can access the variable from the function } } Note: You probably want to add a return this; at the end of the constructor function so that it returns the object that you constructed. UPDATE: Per the comments, you do not have to return this; as using new RootNode does this automagically (+1 for using automagically? :)) Further Reading Introduction to Object-Oriented JavaScript from MDN Pseudo-Classical Pattern JavaScript Inheritance: Pseudoclassical vs. Prototypal
downvote count: 0
has comment: http://stackoverflow.com/comment/45918222
has comment: http://stackoverflow.com/comment/45918321
upvote count: 3
type: Answer

http://stackoverflow.com/q/28774346
tagged with: javascript
answer count: 1
tagged with: google-chrome-extension
tagged with: xmlhttprequest
has body: I am trying to automate a repetitive task at work. Basically we have a feature on our website that is similar to the Piperlime's Add To Wishlist feature. I can succesfully perform a XMLHttpRequest POST on the production website, however the same call performed against the developer, test, and a locally run environment fail. The websites use https protocol. When I run my local environment and access the site I do receive the security warning about trying to connect securely but the browsers can't confirm that the connection is secure, aka the untrusted connection warning. Locally there is some java backend with jetty and maven. My foo with java is weak so I'm not sure what component is actually serving up the webpage. However I do not receive the security certificate warning when I hit the dev or test sites. I can successfully see the network requests go out in the browser debug window. I can grab the http request as a cURL command and succesfullly add items to my wishlist via the command line. I'm struggling with how to figure out what I'm missing. FWIW, I'm executing my javascript code as a google extension. Again, the extension works for the production site, but fails for the test/dev/local environments. Running: Google Chrome 40.0.2214.115 (64-bit) on Mac OSX 10.9.5
has answer: http://stackoverflow.com/a/29018981
tagged with: curl
type: UnansweredQuestion
score: 0
type: Question
has title: Https XMLHttpRequest POST fails on localhost

http://stackoverflow.com/comment/91913887
type: Comment
score: 2
has text: I recommend to install `npm install @typed/chrome`. There is no need for the reference path then (most IDE`s can resolve the types then easily).
type: AnswerComment
comment on: http://stackoverflow.com/a/28844542

http://stackoverflow.com/a/28847579
has body: Instead of .ui-dialog.table { border-width: 1px; border-color: #a9c6c9; border-collapse: collapse; } Try: #dialog-message table { border-width: 1px; border-color: #a9c6c9; border-collapse: collapse; } With jQueryUI dialogs, the dialog contents behave exactly as if they are part of the "dialog" DIV. That is, whatever div you use for the dialog -- any styling you do on that div, or on the contents of that div, will be reflected in the dialog. Just style the contents as part of the #dialog-message div and forget about the fact that they are in a dialog, and true happiness will be yours. jsFiddle Demo Edit: I just read the comments below your question and I see that Austin Mullins has a solution that should work, and it answers your question about adding a class to the table-within-the-dialog. I hope he will add it as an answer so it can be upvoted. But yes, it really is that simple. Quiet appreciation for John R
has comment: http://stackoverflow.com/comment/45963800
has comment: http://stackoverflow.com/comment/45963444
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/45982408
downvote count: 0
answers question: http://stackoverflow.com/q/28846955
score: 1

http://stackoverflow.com/a/51134811
answers question: http://stackoverflow.com/q/28858830
score: 1
upvote count: 1
type: Answer
has body: I hit this problem recently and encountered all sorts of problems getting around it. The heatmap was generated with heatmap.js and displayed successfully over a background image using CSS background-image: as described above. The problem came when trying to save both the heatmap and background as a single image on my local machine. I think this is the problem the OP was referring to. My understanding is that the problem arises due to how heatmap.js creates a canvas within an element such as a div A detailed search didn't come up with a solution that didn't introduce a new set of problems. I did however come across a fairly neat solution which at least met my needs. I used Steel.Liao's post ( https://stackoverflow.com/a/36077807/9438775 ) as the basis to clone the contents of the div using html2canvas.js into a new canvas. I then set the original div to display: none . You can then just right-click on the new canvas to save it as a PNG image file. Both the heatmap overlay and the background are contained in the saved image.
downvote count: 0

http://stackoverflow.com/q/28820738
tagged with: express
tagged with: client-side
has title: How do I receive and use a JSON object on the client-side from the server (Node JS and Express)?
favorite count: 0
has comment: http://stackoverflow.com/comment/45925804
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28820916
upvote count: 1
tagged with: node.js
has body: I am trying to do something seemingly very simple but I'm having trouble working it out. Users can submit some text using a HTML form with POST method. This is then sent off to an API for processing, and returns with a JSON object. I then just want the app.js file to send this JSON object back so I can play around with it using JQuery. Here is the .post method in my app.js app.post('/', function(req, res){ console.log("starting app.post"); // See User Modeling API docs. Path to profile analysis is /api/v2/profile // remove the last / from service_url if exist var parts = url.parse(service_url.replace(/\/$/,'')); var profile_options = { host: parts.hostname, port: parts.port, path: parts.pathname + "/api/v2/profile", method: 'POST', headers: { 'Content-Type' :'application/json', 'Authorization' : auth } }; // create a profile request with the text and the https options and call it create_profile_request(profile_options,req.body.content)(function(error,profile_string) { if (error) {res.render('home.html',{'error': error.message}); console.log("errormessage: "+error.message); } else { // parse the profile and format it var profile_json = JSON.parse(profile_string); var flat_traits = flatten.flat(profile_json.tree); // Extend the profile options and change the request path to get the visualization var fileName="file 1"; //this will eventually be imported automatically //console.log(flat_traits); var scoreObject={"title":fileName, "percentage":functions.matchPercentage(flat_traits)} res.send(scoreObject); //this is what I assume should send this back client-side }); } }); }); // creates a request function using the https options and the text in content // the function that return receives a callback var create_profile_request = function(options,content) { return function (/*function*/ callback) { // create the post data to send to the User Modeling service var post_data = { 'contentItems' : [{ 'userid' : 'dummy', 'id' : 'dummyUuid', 'sourceid' : 'freetext', 'contenttype'…
score: 1
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45926456
type: Question
has comment: http://stackoverflow.com/comment/45913312
answer count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/45820078
has text: I need it so when a user submits a a dept with dept key say O that there not able to do it again but for that same day
comment on: http://stackoverflow.com/q/28770240
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45839323
type: QuestionComment
type: Comment
has text: But it seems that `document.execCommand` is a Mozilla-only API
comment on: http://stackoverflow.com/q/28781241
score: 0

http://stackoverflow.com/a/28954122
answers question: http://stackoverflow.com/q/28890813
has body: this is my answer &lt;script&gt; function iniciar() { var filas = document.getElementById('num_filas').value; tabla(filas); } function factorial(p) { f = 1; for (i = 1; i &lt;= p; i++) f *= i; return f; } function combinaciones(m, n) { if (n &lt;= m) { var dividendo1 = factorial(m); var divisor1 = factorial(m - n); var divisor = factorial(n); var dividendo = dividendo1 / divisor1; var combinacion = Math.round(dividendo / divisor); return combinacion; } else return; } function tabla(filas) { var filas = parseInt(filas); var valor = 0; var matriz = new Array(filas*filas); var cont = 0; var div; for (m = 0; m &lt; filas; m++) { for (n = 0; n &lt; filas; n++) { if (n &lt;= m) { valor = combinaciones(m, n); matriz[cont] = valor; cont = cont + 1; } else break; } } cont = 0; for(i = 0 ; i &lt; filas ; i++) { for(j = 0; j &lt; filas ; j++) { div=document.getElementById('triangulo'); div.innerHTML += matriz[cont]; div.innerHTML += " "; cont = cont + 1; if(i == j) break; } document.getElementById('triangulo').innerHTML += '&lt;br&gt;'; } } &lt;/script&gt; for the whole site visit enter link description here
score: 0
type: Answer

http://stackoverflow.com/comment/45927709
type: QuestionComment
comment on: http://stackoverflow.com/q/28828678
score: 0
type: Comment
has text: or use the `.text()` - function

http://stackoverflow.com/comment/45842682
type: AnswerComment
score: 0
has text: the tree structure of HTML?
type: Comment
comment on: http://stackoverflow.com/a/28782764

http://stackoverflow.com/q/28761670
has answer: http://stackoverflow.com/a/28761773
has answer: http://stackoverflow.com/a/28761907
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28761741
has answer: http://stackoverflow.com/a/28761751
type: Question
upvote count: 4
has answer: http://stackoverflow.com/a/28761805
downvote count: 0
has body: I'm using the following to create an if statement based on the last word of the url after the slash: // Sticky var match = location.search.match(/(\w+)$/)[0]; if (match === 'complete') { $('p:has(audio)').addClass('sticky-child'); $('p:has(audio)').appendTo('.lesson_lang_switch'); } The problem is, the front page doesn't have any word at the end of the URL (After the slash): www.example.com/ So I get this error: Uncaught TypeError: Cannot read property '0' of null How can I do it so that the error doesn't appear?
tagged with: javascript
score: 4
favorite count: 0
possible better answer: http://stackoverflow.com/a/28761805
answer count: 5
has answer: http://stackoverflow.com/a/28761741
has title: How to remove this JavaScript null error?

http://stackoverflow.com/q/28793621
accepted answer: http://stackoverflow.com/a/28793798
tagged with: javascript
answer count: 1
downvote count: 0
favorite count: 0
tagged with: angularjs
has body: I'm learning the use of the directives in AngularJS. I have a password.html file with a input password and then I have created my own directive 'passwordRequirement' to force the user to meet these requirements when creating a user. This is the code of password.html: Password For your security, the password needs to meet the following requirements Password must contain at least a lowercase character Password must contain at least uppercase character Password length must be between 12 and 20 characters Password must contain at least a digit As each requirement is binded to a different property in the scope, in the definition of the directive I have specified in the scope the variable "binding". See the code of the definition of the directive: app.directive('passwordRequirement',function() { return { restrict: 'E', scope:{binding:'@'}, templateUrl:'partials/content/common/passwordRequirement.html', transclude:true }; }); And then the html template for the password requirement (which consists in a label plus a checkbox to be checked or not depending if the requirement is met or not): {{binding}} As you can see I want bind the ng-model to the variable I have specified in password.html. However if I print the value of the bind property using {{binding}}, it prints the correct values. But if I inspect the source code of the page I see: Which means that in the page the variable binding it is not being interpreted so that it is not working properly. Why? I cannot do data-ng-model={{binding}} , so what is the solution for this? Is this doable in AngularJs? If so, what is the right way to achieve that? I though it was the way I'm doing but apparently is not. Thank you very much in advance.
has answer: http://stackoverflow.com/a/28793798
has title: Issue with directives
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question

http://stackoverflow.com/a/28852638
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28851829
has body: getProjection() isn't available until the map is finished initializing. You have to wait on the "projection_changed" event before accessing it. As I know your code should looks like this: var map, pro; var loc = new google.maps.LatLng(52.5498783, 13.425209099999961); function initialize() { var mapOptions = { zoom: 14, center: loc, mapTypeId: google.maps.MapTypeId.ROADMAP, scroll: { x: 0, y: $(window).scrollTop() }, }; map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions); new google.maps.Marker({ map: map, position: map.getCenter() }); google.maps.event.addListenerOnce(map,"projection_changed", function() { $(console).text(map.getProjection().fromLatLngToPoint(loc).toString()); console.log(map.getProjection().fromLatLngToPoint(loc).toString()); }); } //end function google.maps.event.addDomListener(window, 'load', initialize); this is a jsfiddle
type: Answer
has comment: http://stackoverflow.com/comment/45973615
answers question: http://stackoverflow.com/q/28851829

http://stackoverflow.com/a/29086372
answers question: http://stackoverflow.com/q/28825513
score: 0
type: AcceptedAnswer
has body: The code snippets I provided above are syntactically correct. My problem though, was that it took me awhile to get my head wrapped around the concept of programming sequential asynchronous calls to Parse and other APIs from CloudCode. Ultimately I was able to accomplish what I wanted using one single function with a string of promises using the following pattern. someCall( function(someObject) { // do some stuff return result; }).then( function(resultOfPrev) { // do some more stuff return result; }).then( function(resultOfPrev) { // create some nested promises // Create a trivial resolved promise as a base case. var queryPromise = Parse.Promise.as(); _.each(resultsOfPrev, function(thing) { // For each item, extend the promise with a function to ... queryPromise = queryPromise.then( function() { var query = new Parse.Query(Thing); query.equalTo("name", thing.name); return query.find().then( function(result) { var savePromise = Parse.Promise.as(); savePromise = savePromise.then( function() { var saved = false; if(result.length &lt; 1) { // then save the thing var newThing = new Thing(); newThing.set('name', thing.name); return newThing.save(); } else { return false; } }); return savePromise; }); }); }); return queryPromise; }).then( function(resultsOfPrev) { // response must not be called until // the end of the chain. response.success( resultsOfPrev); }.then( function() { // i realy don't understand why but, // I need this empty function at the // tail of the chain. });
type: Answer
accepted answer of: http://stackoverflow.com/q/28825513

http://stackoverflow.com/comment/45932118
score: 2
comment on: http://stackoverflow.com/q/28831185
type: Comment
type: QuestionComment
has text: can you please post a jsfiddle ?

http://stackoverflow.com/q/28798539
has comment: http://stackoverflow.com/comment/45871415
type: AnsweredQuestion
has title: Simple angular.js example sometimes doesn't load
upvote count: 7
accepted answer: http://stackoverflow.com/a/28798694
type: Question
has comment: http://stackoverflow.com/comment/45871487
has body: Problem: I started using angular.js for my project and during development I noticed that controller sometimes doesn't load, so I tried removing parts of the project until the smallest possible example but the problem still remains. Code: index.html Test app.js console.log("INIT"); angular.module('myApp', []) .controller('TestController', ['$scope', function($scope) { $scope.testText = '172.17.2.1'; console.log("SCOPE"); }]); Note: "INIT" part always gets displayed in console. Altough "SCOPE" part sometimes (or most of the time) doesn't so the input field doesn't get filled. Versions: Chrome: 36.0.1985.125 Angular.js: 1.3.14
score: 7
has answer: http://stackoverflow.com/a/28798694
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/a/28906931
accepted answer of: http://stackoverflow.com/q/28904965
answers question: http://stackoverflow.com/q/28904965
score: 0
has body: useExtending from Erick Souza's answer. You can also add a 'formnovalidate' attribute to the form you don't want to validate. This will cause the one form to validate on submit and not the other. It has been my experience that you can not simply hide one form and validate the other. As the submit button will attempt to validate both forms. This idea might look like: $("#toggle-login").click(function(){ $("#register").hide().attr("formnovalidate"); $("#login").toggle(); }); $("#toggle-register").click(function(){ $("#login").hide().attr("formnovalidate"); $("#register").toggle(); }); To force an elements behavior on page load you should use this basic handler: $("document").ready(function(){ $("#register").hide(); }; That should do the trick. Or in your css doc you can use the attribute display: none;
has comment: http://stackoverflow.com/comment/46142451
type: Answer
has comment: http://stackoverflow.com/comment/46075756
type: AcceptedAnswer

http://stackoverflow.com/q/28905990
tagged with: restangular
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46071536
type: Question
has body: I'm using Restangular to consume some REST Api that I've built and I'm receiving a XMLHTTPRequest cannot load telling me that my origin is not allowed. But when I look at the network section on browser inspector, the response is there with a 200(Ok) and when I send the request via Postman it works too. Do I need to set something other than the baseUrl on Restangular to get this done right? This is my headers: response.headers.add('Access-Control-Allow-Origin', '*') response.headers.add('Access-Control-Allow-Headers', 'Content-Type,Authorization') response.headers.add('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE')
has title: Restangular XMLHTTPRequest cannot load, but browser show response
tagged with: javascript
has comment: http://stackoverflow.com/comment/46124402
score: 0
answer count: 1
tagged with: angularjs
has answer: http://stackoverflow.com/a/28947311
accepted answer: http://stackoverflow.com/a/28947311

http://stackoverflow.com/comment/45862389
has text: @PeterPik hmm.. it's the first time I'm editing plunker code sample so there could be hick-ups I guess, but I tried to edit your original code sample by replacing the space in ....html(match['live in']); with underscore _ and and in the json data respectively, I was able to get updates. In any case, I need to call it a day. Good luck!
comment on: http://stackoverflow.com/a/28793563
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45863274
comment on: http://stackoverflow.com/q/28794101
score: 0
type: Comment
type: QuestionComment
has text: It would help if you can add the request headers of ajax calls that you think are failing

http://stackoverflow.com/comment/45852289
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28788223
has text: It's possible your scripts could be conflicting, have you tried changing the order in which you render them to the page? Also are you loading your scripts synchronously or asynchronously?
score: 0

http://stackoverflow.com/comment/45958269
type: Comment
has text: thanks P.T, getting undefined in console.log as above...any thoughts?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28843410

http://stackoverflow.com/a/28788479
has comment: http://stackoverflow.com/comment/45852708
score: 0
has body: Using Firebug on your page and checking the console on date change, you see the line: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://webinarmeetingroom.com/webinar/modules/regdatetime/functime2.php. This can be fixed by moving the resource to the same domain or enabling CORS. That means you cannot run the scripts from a different domain.
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28788434
has comment: http://stackoverflow.com/comment/45852687
type: Answer
accepted answer of: http://stackoverflow.com/q/28788434

http://stackoverflow.com/q/28878554
has body: I am trying to Get Data from another url using JavaScript but failed , I tried All Solution from jsfiddle and Stack-overflow but one error is not going away http://renault.twobulls.com/?code=waeuhh (Destination URL) I tried $.getJson,$.ajax, and all even jsonp too...please help me out, I have this error when I use call back in url for jsonp Error: Does anyone have a solution?
tagged with: javascript
has answer: http://stackoverflow.com/a/28878752
accepted answer: http://stackoverflow.com/a/28878752
possible better answer: http://stackoverflow.com/a/28878915
has comment: http://stackoverflow.com/comment/46019070
has comment: http://stackoverflow.com/comment/46019297
has comment: http://stackoverflow.com/comment/46019046
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/28878915
has title: Cross Side Scripting (JavaScript)
type: Question
score: 0
answer count: 2
tagged with: cross-domain
has comment: http://stackoverflow.com/comment/46019157

http://stackoverflow.com/comment/46039658
score: 1
comment on: http://stackoverflow.com/q/28888389
has text: @developerwjk but it wasn't new, it was at least 1 minute old ;)
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46065664
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28903115
has text: See [the stacksverflow](https://stackoverflow.com/questions/9121902/call-an-asynchronous-javascript-function-synchronously) topic.
score: 0

http://stackoverflow.com/comment/45851127
type: AnswerComment
comment on: http://stackoverflow.com/a/28768309
score: 0
type: Comment
has text: Still can't get the text in there though , it doesn't seem to work. Am i still missing something? Sorry for being a complete amateur

http://stackoverflow.com/comment/45957283
has text: Thank you for your answer. Can you please give an example on the above elements which I am working on?
comment on: http://stackoverflow.com/a/28844030
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28864169
accepted answer of: http://stackoverflow.com/q/28858957
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28858957
has body: I just noticed the docs at the bottom state - For CoffeeScript support, add require('coffee-script') with CoffeeScript 1.6- or require('coffee-script/register') with CoffeeScript 1.7+. I added a require statement for my own compiler at the top of my gulp file require('./my_compiler'); and this seemed to work.
upvote count: 2
score: 2

http://stackoverflow.com/comment/46037009
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28886835
score: 0
has text: So how does the script vary from call to call?

http://stackoverflow.com/q/28782478
has answer: http://stackoverflow.com/a/28782724
tagged with: node.js
type: AnsweredQuestion
score: 1
tagged with: error-handling
upvote count: 1
has comment: http://stackoverflow.com/comment/45841920
type: Question
has title: What type of error object is retuned from a http call if statusCode is not 200?
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28782724
tagged with: api
answer count: 1
downvote count: 0
has body: I am making http calls in meteor using the npm 'request' package. I would like to know what type of error object is created when a response.statusCode is not equal to 200? Is this handled by the javascript engine and considered a runtime error? Or if the statusCode is not equal to 200 is determined by the service provider whether they will create an error object or not? If the latter, do I create a 'manual error', new Error('throwing my own error for the catch block to handle') var request = function() { // HTTP call to server }, function (error, response, body) { if (!error &amp;&amp; response.statusCode === 200) { // processed and created data object return data } else { return (error) ; // How can I ensure the catch(e) block in the try/catch method will catch the error with an addition of my own 'message'. } }) }; try { request() } catch(e) { console.log(e) } For my scenario, I would like to ensure the catch(e) block will grab this error and I would like to add my own message including the stack trace.
tagged with: meteor
favorite count: 0
linked to: http://stackoverflow.com/q/28703715

http://stackoverflow.com/q/28795362
has body: I have this js script. Instead of "2175" I'd need to insert here a certain $x php variable. How do I go about that? var options = { useEasing : true, useGrouping : true, separator : ',', decimal : '.' , prefix : '' , suffix : '' } var demo = new countUp("myTargetElement", 0, 2175, 0, 2.5, options); demo.start();
downvote count: 0
favorite count: 0
type: UnansweredQuestion
tagged with: php
linked to: http://stackoverflow.com/q/5895842
answer count: 0
score: 1
has title: how to insert php variable in js script
duplicate of: http://stackoverflow.com/q/5895842
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45865209
tagged with: javascript
has comment: http://stackoverflow.com/comment/45866629
has comment: http://stackoverflow.com/comment/45865454

http://stackoverflow.com/a/28857163
has comment: http://stackoverflow.com/comment/45981619
has body: Here's a way to clear the form from the top of my head: In your HTML, add &lt;input type="reset" style="display:none;" id="reset-button" /&gt; Then, in your JS: if (data == "Your Query has been received, We will contact you soon.") { $('#reset-button').click(); } About the CC part, why don't you use PHPMailer, it'll reduce your effort and be a lot easier to send to many recipients.
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28857003

http://stackoverflow.com/comment/45861866
has text: Nice, this is what I needed :)
type: Comment
comment on: http://stackoverflow.com/a/28793615
score: 0
type: AnswerComment

http://stackoverflow.com/q/28899444
score: 0
has comment: http://stackoverflow.com/comment/46058363
tagged with: radio-button
has comment: http://stackoverflow.com/comment/46058694
has comment: http://stackoverflow.com/comment/46058130
answer count: 5
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46058307
has body: I'm trying to input the value of the checked radio button as one of a functions parameres (here sign). This is my code: first input: second input: north south The Answer: try it I don't know what to put instead of ?? ? The sign determines if sign is positive or negative.
tagged with: http://stackoverflow.com/tag/html
tagged with: input
has title: Output a radio button in a webpage
has answer: http://stackoverflow.com/a/28899832
tagged with: output
type: Question
has answer: http://stackoverflow.com/a/28899902
has answer: http://stackoverflow.com/a/28899710
tagged with: javascript
has answer: http://stackoverflow.com/a/28900140
has answer: http://stackoverflow.com/a/28899683

http://stackoverflow.com/comment/45990700
type: Comment
type: QuestionComment
has text: @LShetty clone and detach may not be appropriate. Tanker doesn't want to clone the element, just move it.
score: 0
comment on: http://stackoverflow.com/q/28862402

http://stackoverflow.com/comment/45950961
type: Comment
has text: Great, not sure if you just want ".00" at the end or just to get the actual value to 2 decimal places like ".23". If you want the later, replace 'total = Math.ceil(pricePerWord * words / days);' with 'total = Math.round(pricePerWord * words / days) / 100;'. If you just want to have a ".00" at the end, replace 'output.value = total;' with 'output.value = total + ".00";'
comment on: http://stackoverflow.com/a/28757655
score: 0
type: AnswerComment

http://stackoverflow.com/a/29606858
accepted answer of: http://stackoverflow.com/q/28863678
answers question: http://stackoverflow.com/q/28863678
type: Answer
upvote count: 1
has body: I eventually fixed the problems I was having. To reset the zoom, instead of just setting the zoom to 1 with canvas.setZoom(1), I reapplied the canvas.zoomToPoint method to the same point but with zoom 1, to force the initial zoom but regarding the same point that was used to zoom in. As for the problem of restoring the image position in canvas (after panning for instance) it is as simple as removing the image, centering it in the canvas and re-adding it to the canvas as was done when adding first time: var img = canvas.getActiveObject(); canvas.remove(img); canvas.centerObject(img); canvas.setActiveObject(img); canvas.add(img); canvas.renderAll();
score: 1
type: AcceptedAnswer
downvote count: 0

playframework
tags question: http://stackoverflow.com/q/28881464
tags question: http://stackoverflow.com/q/28840204
tags question: http://stackoverflow.com/q/28849201
type: Tag
tag name: playframework

http://stackoverflow.com/a/28902092
score: 1
has comment: http://stackoverflow.com/comment/46063792
has comment: http://stackoverflow.com/comment/46063703
has body: Use : $(".Your_Checkbox_Class")each(function(){ if ($(this).is(':checked') ){ $(this).toggleClass("Your_New_Class"); } }); Explanation : Loop thru all Checkboxes (hope you have given them Class as i gave above ).And then check if its checked , if yes toggle the class. Edit Well your question is not 100% clear. But if you want event on click of only one checkbox and toggle only that checkbox , then use $(".Your_Checkbox_Class").click(function(){ var id = $(this).attr("id"); $("#"+id).toggleClass("Your_New_Class"); }) Explanation : If checkbox gets checked , then toggle class. I assume you have proper classes on DOM load . Like if after Loading DOM , if a checkbox is already ticked (Came from server side), it will already have class for checked_element already.
has comment: http://stackoverflow.com/comment/46064257
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/28901955
downvote count: 0

http://stackoverflow.com/q/28776522
has comment: http://stackoverflow.com/comment/45831170
answer count: 0
has comment: http://stackoverflow.com/comment/45831340
score: 0
has title: What is the difference between String and new String?
duplicate of: http://stackoverflow.com/q/17256182
type: Question
has comment: http://stackoverflow.com/comment/45831190
has body: Of the many methods to convert to a string, I am confused between: var foo = new String(val); vs var foo = String(val); When to use one over the other ?
tagged with: javascript
has comment: http://stackoverflow.com/comment/45831109
linked to: http://stackoverflow.com/q/10951906
has comment: http://stackoverflow.com/comment/45831150
has comment: http://stackoverflow.com/comment/45831143
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45831194
linked to: http://stackoverflow.com/q/17256182

http://stackoverflow.com/comment/45882227
type: Comment
type: QuestionComment
has text: It doens't look like your issue is related to the server side of things based on the errors you are getting.
comment on: http://stackoverflow.com/q/28804411
score: 0

http://stackoverflow.com/a/28762366
type: AcceptedAnswer
has body: You can use .push method, like so var data = []; data.push({ name: 'test1', value: 1}); data.push({ name: 'test2', value: 2}); data.push({ name: 'test3', value: 3}); console.log(data);
type: Answer
answers question: http://stackoverflow.com/q/28762327
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28762327
upvote count: 1

http://stackoverflow.com/q/28866366
tagged with: d3.js
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45998168
has answer: http://stackoverflow.com/a/28866775
possible better answer: http://stackoverflow.com/a/28866513
upvote count: 2
has comment: http://stackoverflow.com/comment/45997640
has answer: http://stackoverflow.com/a/28866513
has comment: http://stackoverflow.com/comment/45998095
type: Question
has body: I have a graph where I have both circles and rectangles along the ticks of my x-axis. I'd like to be able to center all elements on the ticks of the x-axis. Circles are automatically placed in the center and scaled with a radius attribute, but with rectangles, I am not able to move it as I am using an ordinal scale to create my x-axis values. This is how much graph looks like: http://puu.sh/gmCkZ/37ab176161.png It can be seen that the squares upper-left corner is the position I want to be it's center. My code for the x-axis looks like the following: var x = d3.scale.ordinal() .rangeRoundBands([0, width], 1); var xAxis = d3.svg.axis() .scale(x) .orient("bottom"); d3.tsv("data.tsv", type, function(error, data) { x.domain(data.map(function(d) { return d.name; })); How can i center a figure like the square in a certain position? In this case, on a specific area of the x-axis? EDIT Added SVG code for square: var square = svgbody .selectAll("nodes.rect") .data(["B", "L"]); square.exit() .style("opacity", 1) .transition() .duration(500) .style("opacity", 0) .remove(); square.enter() .append("rect") .attr("class", "squareNodes"); square .attr("x", function(d){ return x(d);}) .attr("y", function(d){return y(statusText);} ) .attr("width",19) .attr("height",19) .attr("rx", "3") .attr("ry", "3" ) .style('opacity', NODE_OPACITY) .style('fill', "green");
has comment: http://stackoverflow.com/comment/45998204
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28866775
answer count: 2
has comment: http://stackoverflow.com/comment/45998037
has title: How to center rectangles on position in D3.js?
downvote count: 0
has comment: http://stackoverflow.com/comment/45998352
favorite count: 0
has comment: http://stackoverflow.com/comment/45997752

http://stackoverflow.com/comment/45996551
type: QuestionComment
type: Comment
has text: For purposes of debugging, I'd break up this line into smaller parts: `var backup = DocsList.getFileById(SSID).makeCopy(SpreadsheetApp.openById(SSID).getName() + "_" + CopyDate);` You can always chain it back together later if you want.
comment on: http://stackoverflow.com/q/28864106
score: 0

http://stackoverflow.com/q/28890752
has answer: http://stackoverflow.com/a/28890887
tagged with: node.js
type: Question
tagged with: mongodb
answer count: 2
has title: Query on field of a referenced document
tagged with: mongoose
tagged with: javascript
has body: There are 2 collections 'actors' and 'movies' example of 1 actor : { _id: ObjectId("54f38bd9b814dca762778032"), name: { first: 'Jason', last: 'Statham' } } example of 2 movies { _id: ObjectId("54f5cbaf4d9f1129335993ef"), title: 'Fast &amp; Furious 7', actors: [ ObjectId("54f38bd9b814dca762778032") ] }, { _id: ObjectId("54f782493e7688c31f75307d"), title: 'Parker', actors: [ ObjectId("54f38bd9b814dca762778032") ] } How can I do to find movies with Jason Statham ? I use Node.js + Express + Mongoose Thanks
score: 0
has answer: http://stackoverflow.com/a/28891173
tagged with: mongodb-query
type: UnansweredQuestion

http://stackoverflow.com/q/28853636
tagged with: angularjs
type: UnansweredQuestion
has title: How to display server side validation error messages on form with angular js
tagged with: spring
tagged with: spring-mvc
score: 2
type: Question
tagged with: javascript
upvote count: 2
has body: I am using AngularJS and Spring MVC in my project. In this, I am sending JSON to rest controller which validate fields and return Error object in case of validation failure as follows: {"validationErrors":[ { "errorCode":"emailId", "errorDescription":"Please enter email address." } ]} Now, on jsp how to display inline error message? My jsp code is as follows: Email ID //Here, I want to display inline error message And my js code is: //Updated angular.module('MiniApp', []); angular.module('MiniApp').controller('loginCtrl', ['$scope', '$http','$location',function($scope,$http,$location) { $scope.loginSubmit = function(user) { $scope.errors = []; $scope.jsonObject = angular.copy(user); var data1; setTimeout(function(){ data1=document.getElementById("hiddenJson").value; $http({ method: 'POST', url: 'register1/login', headers: {'Content-Type': 'application/json'}, data: data1 }). success(function(data, status, headers, config) { alert('Success:'+data.prospectResponseDetails.emailId+" - "+status); $location.path('WEB-INF/pages/login-step1.jsp'); }). error(function(data, status, headers, config) { _showValidationErrors($scope, data.validationErrors); $scope.errors = data.validationErrors; }); $scope.getErrorMessage = function(errorCode) { var error; $scope.errors.forEach(function(error) { if(error.errorCode === errorCode) { error = error.errorDescription; } }); return error; } }, 200); }; }]);
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45974032
tagged with: jsp
has answer: http://stackoverflow.com/a/28853798
favorite count: 0

http://stackoverflow.com/comment/76597953
type: Comment
comment on: http://stackoverflow.com/a/28786462
score: 1
has text: This also fails to work for a single root child element.
type: AnswerComment

http://stackoverflow.com/q/28883514
tagged with: jquery
has answer: http://stackoverflow.com/a/28883944
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46028318
has body: I'd like to be able to click on an image and get a random sound reproduced between the sounds I put in a folder on my server. Actually my code is like this, clicking on the image will reproduce only AUDIO_SRC. The script should be able to pick a random sound from the folder /bf and reproduce it. Is that possible?
type: Question
accepted answer: http://stackoverflow.com/a/28883944
has comment: http://stackoverflow.com/comment/46028220
has title: Script that randomly choose a sound to reproduce when I click on a button
score: 0
has comment: http://stackoverflow.com/comment/46028342
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/46006718
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28857322
has text: @Neoaptt How do I even make jsfiddle use select2? It doesn't seem to be on the list of libraries. What I want is simple, really. Find tag in list? Use tag in list. Don't find tag in list? Make new one.
score: 0

http://stackoverflow.com/q/28764232
upvote count: 1
tagged with: ruby-on-rails
has body: I'm using rails, uglifier and have just started using coffeescript. My coffee script for handling ajax completion is: handleAjaxComplete = (xhr, response, status) -&gt; myFeatherBox.close() if myFeatherBox? if $(xhr.target).hasClass "crud_create" #creation button hit myFeatherBox = $.featherlight response.responseText, afterOpen: -&gt; $('form#frm_create').validate() $('#frm_create input[type!=hidden]').first().focus() return else #etc. This becomes the following javascript: handleAjaxComplete = function(xhr, response, status) { var new_aka_song_id; if (myFeatherBox != null) { myFeatherBox.close(); } if ($(xhr.target).hasClass("crud_create")) { myFeatherBox = $.featherlight(response.responseText, { afterOpen: function() { $('form#frm_create').validate(); $('#frm_create input[type!=hidden]').first().focus(); } }); } else //etc. But then when I open the hosted page (it's on heroku), myFeatherBox.close() didn't seem to be running. I checked the uglified code and it seems to have become: a=function(t,s) { var o; if(null!=h&amp;&amp;h.close(),$(t.target).hasClass("crud_create")) h=$.featherlight(s.responseText,{ afterOpen:function(){ $("form#frm_create").validate(), $("#frm_create input[type!=hidden]").first().focus() } }); else //etc. (I've added some whitespace where I don't think it will matter to make it a little more readable). My concern is with the condition on the third line of the uglified code. Am I correct that this is breaking what I'm trying to do? If so, how do I fix my coffee script so that the uglifier plays nice?
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45807524
tagged with: coffeescript
accepted answer: http://stackoverflow.com/a/28764349
answer count: 1
downvote count: 0
tagged with: javascript
score: 1
has comment: http://stackoverflow.com/comment/45807427
favorite count: 0
has comment: http://stackoverflow.com/comment/45807773
has title: Is Uglifier breaking my js?
tagged with: uglifier
has comment: http://stackoverflow.com/comment/45807533
has answer: http://stackoverflow.com/a/28764349

http://stackoverflow.com/q/28828348
tagged with: iife
has comment: http://stackoverflow.com/comment/62984525
answer count: 1
downvote count: 0
favorite count: 0
linked to: http://stackoverflow.com/q/1873983
linked to: http://stackoverflow.com/q/5827290
has comment: http://stackoverflow.com/comment/62984304
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/30315894
linked to: http://stackoverflow.com/q/3755606
has body: The common practise for creating modules is to wrap them in parens so you won't leak any variables outside of the module (when concatenating etc). There is also void operator, which evaluates a given expression and returns undefined. (See on MDN) I wonder what is the reason behind preferring wrapping functions in parens instead of using void. Is it historical, is it something related to concatenation, else? I know that you can have problems with concatenation when one of the files has a missing a semicolon, leading to nasty problems till you notice it. Examples Say, module1.js (notice the missing comma): (function () { return function () { console.log('module1. I should not be called'); }; })() and, module2.js: (function () { return function () { console.log('module2. I should not be called either'); }; })(); If you concat these scripts into a bundle, it will produce this: (function () { return function () { console.log('module1. I should not be called'); }; })()(function () { return function () { console.log('module2. I should not be called either'); }; })(); Since both modules(files) return a function, the second supposedly IIFE becomes an invocation of the return value of the first module, effectively calling console.log. The common workaround for this is to declare your module with !(function (){})(); which forces the returned value to be a boolean. If however, you were to use void, like: void function () { return function () { console.log('module1. I should not be called'); }; }() The concatenated file will still be wrong, but you will notice the error on the first run, therefore more easily noticed. See below. void function () { return function () { console.log('module1. I should not be called'); }; }()void function () { return function () { console.log('module2. I should not be called either'); }; }); This throws Unexpected token void. As fas as the modules are concerned, I believe !(function(){}() and void function(){}() achieve the same effect. But I feel l…
type: Question
score: 9
upvote count: 9
tagged with: javascript
has comment: http://stackoverflow.com/comment/48727084
linked to: http://stackoverflow.com/q/24067605
has title: Difference between using void vs wrapping in parens for IIFE void function() vs (function())
has comment: http://stackoverflow.com/comment/62978809

http://stackoverflow.com/comment/45943223
has text: You can just add your function before the asp on click. I'll update the answer.
type: AnswerComment
comment on: http://stackoverflow.com/a/28821754
score: 0
type: Comment

http://stackoverflow.com/a/28833868
answers question: http://stackoverflow.com/q/28833794
type: Answer
has body: Remove the second function call and try this $(".card").on('hover',function(){ var image = $(this).attr('src'); $('.cardpreview').attr('src', $(this).attr('src'); $('.cardpreviw').attr('src', 'http://mtgimage.com/card/cardback.jpg'); });
score: 0
has comment: http://stackoverflow.com/comment/45937176

http://stackoverflow.com/a/28757249
has body: Do you forget to make redirection? router.get("/", function (req, res) { res.redirect("/index"); });
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45795939
answers question: http://stackoverflow.com/q/28756968
has comment: http://stackoverflow.com/comment/45797806

http://stackoverflow.com/a/28861488
type: Answer
has comment: http://stackoverflow.com/comment/45988783
has comment: http://stackoverflow.com/comment/45988836
has body: Solution here: d = moment.duration(Math.floor(d.asHours()), 'hours').humanize(); This should convert your hours into a more human readable string. Doing it using plain JavaScript. var hours = Math.floor(d.asHours()); var days = Math.floor(hours / 24) //convert to days. hours = hours - days*24; //subtract the amount of hours from the total amount of hours that are full days. var s = days + " day(s) and " + hours + moment.utc(ms).format(":mm:ss"); And as a total solution: $(function() { var then = "2015/03/7"; //changed this to make the snippet work. Change it back to the php code for your production site. window.setInterval(function(){ var now = moment().format('YYYY-MM-DD HH:mm:ss'); var ms = moment(then,"YYYY-MM-DD HH:mm:ss").diff(moment(now,"YYYY-MM-DD HH:mm:ss")); var d = moment.duration(ms); if(d.asHours() > 96) { then = moment().endOf('day'); ms = moment(then,"YYYY-MM-DD HH:mm:ss").diff(moment(now,"YYYY-MM-DD HH:mm:ss")); d = moment.duration(ms); } var hours = Math.floor(d.asHours()); var days = Math.floor(hours / 24) //convert to days. hours = hours - days*24; //subtract the amount of hours from the total amount of hours that are full days. var s = days + " day(s) and " + hours + moment.utc(ms).format(":mm:ss"); if(d.asHours() <= 0) { s = "Verlopen"; } $( ".countdown_container_1" ).html( s ); }, 1000); }); 0:00:00
answers question: http://stackoverflow.com/q/28861044
has comment: http://stackoverflow.com/comment/45989180
score: 0

http://stackoverflow.com/comment/46026786
has text: @Sush, same premise, but now do the math on datetimes. See updated answer.
comment on: http://stackoverflow.com/a/28770890
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28771083
type: Answer
score: 0
has body: here is the exact same effect your are looking for : Live Demo I've used Jquery and waypoints.js to do so easily : $( function() { $( "#demo-heading" ).waypoint( function() { $( "#demo" ).fadeIn(); }, { offset: 400 } ); $( ".site-header" ).waypoint( 'sticky' ); } ); make sure to add these two libs after Jquery :
answers question: http://stackoverflow.com/q/28770445

http://stackoverflow.com/a/28813231
type: Answer
has comment: http://stackoverflow.com/comment/45898784
has comment: http://stackoverflow.com/comment/45898690
has body: There is a problem in your code: In this line: var html_string=""; You use two ' effectively creating this when parsed: This is the updated version with correct escaping. var aString="Andrew's String"; var html_string=""; $("#myDiv").html(html_string); Personally to avoid problems with unescaped strings altogether I would do this: var aString = "Andrew's String"; var element = $("Your caption here").click(function(){ getSettings("hello", aString); }); $("#myDiv").empty(); //empty the element; $("#myDiv").append(element);
score: 0
has comment: http://stackoverflow.com/comment/45898532
answers question: http://stackoverflow.com/q/28813136
has comment: http://stackoverflow.com/comment/45898562

http://stackoverflow.com/q/28895408
has comment: http://stackoverflow.com/comment/46059588
type: AnsweredQuestion
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/46059784
has comment: http://stackoverflow.com/comment/46061504
type: Question
has title: Angular Karma Test getting “TypeError: 'undefined' is not a function”
has comment: http://stackoverflow.com/comment/46052796
has comment: http://stackoverflow.com/comment/46062033
tagged with: javascript
has body: Controller dashboardApp.controller('ExecutiveController', ['$scope', 'ExecutiveService', function ($scope, executiveService) { executiveService.getDashboardData().then( function success(response) { $scope.productsInfo = response.data; }, function error(reason) { console.log(reason); }); } ]); Test case for Controller 'use strict'; describe('ExecutiveController', function () { var scope, ctrl, mockService, $timeout; beforeEach(module('do.dashboard')); beforeEach(inject(function ($rootScope, $controller, $q, _$timeout_) { mockService = jasmine.createSpyObj('ExecutiveService', ['getDashboardData']); scope = $rootScope.$new(); $timeout = _$timeout_; mockService.getDashboardData.andReturn($q.when( [{Products:{Name:'Resource ',measure:'59',Work:'60'}}] )); ctrl = $controller('ExecutiveController', { $scope: scope, ExecutiveService: mockService, }); })); it('controller should not be null', function () { expect(ctrl).not.toBe(null); }); it('should call the service method and set the scope data', function () { expect(mockService.getDashboardData).toHaveBeenCalled(); $timeout.flush(); expect(scope.productsInfo.Products.Name).toEqual('Resource'); expect(scope.productsInfo.products.measure).toEqual(59); }); }); Here when i run it in karma runner it shows error as Angular Karma Test getting “TypeError: 'undefined' is not a function” and it gives the message which is present in the it method
favorite count: 0
has comment: http://stackoverflow.com/comment/46051843
upvote count: 3
tagged with: karma-jasmine
accepted answer: http://stackoverflow.com/a/28897564
answer count: 1
has comment: http://stackoverflow.com/comment/46051628
has comment: http://stackoverflow.com/comment/46051633
tagged with: karma-runner
tagged with: angularjs
has comment: http://stackoverflow.com/comment/46051096
has answer: http://stackoverflow.com/a/28897564
has comment: http://stackoverflow.com/comment/46051262

http://stackoverflow.com/a/28779696
type: Answer
upvote count: 2
answers question: http://stackoverflow.com/q/28778952
score: 2
has comment: http://stackoverflow.com/comment/45836749
downvote count: 0
has body: You can use Angular's resolve in your routes configuration. Here is an example where I am resolving 'user' for a particular route. It must resolve before angular will load this route. app.config( [ '$routeProvider', '$locationProvider', function( $routeProvider, $locationProvider ) { $routeProvider .when('/somePath', { templateUrl: "someView.html", controller: "someController", resolve: { user: function( authService ){ return authService.getUser(); } } } ); } ]); Here is the service(factory in this case) to go along with it. I am checking to see if auth.user exists first so there won't be a request on each route change: app.factory('authService', [ '$http', '$q', function( $http, $q ) { var pub = {}; pub.user = null; pub.getUser = function() { var deferred = $q.defer(); if( pub.user ) { deferred.resolve( pub.user ); } else{ $http.get('/someAuthUrl').then(function( user ) { pub.user = user; deferred.resolve( user ); }); } return deferred.promise; }; return pub; } ]); And then finally the controller which will not load until the auth function has resolved with your needed user data. You can access the user object now through injection. app.controller( 'someController', [ '$scope', 'user', function( $scope, user ) { //Controller runs here only when user is resolved. // Anything resolved will be passed in as your last dependency. $scope.user = user; } ]); In this case you could have injected the service into the controller instead and use authService.user as we know it's available. app.controller( 'someController', [ '$scope', 'authService', function( $scope, authService ) { $scope.user = authService.user; } ]);
has comment: http://stackoverflow.com/comment/45836698

http://stackoverflow.com/a/28903847
score: 2
has comment: http://stackoverflow.com/comment/46074859
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28899512
answers question: http://stackoverflow.com/q/28899512
type: AcceptedAnswer
downvote count: 0
has body: What exactly are you trying to do with the filter select? You can change the select options using the filter_selectSource option (demo) $(function () { $('table').tablesorter({ theme: 'blue', widgets: ['zebra', 'filter'], widgetOptions: { filter_selectSource: { 1 : [ 'Client', 'Collaborator' ] } } }); });
type: Answer

http://stackoverflow.com/comment/46070200
comment on: http://stackoverflow.com/q/28905364
score: 0
type: QuestionComment
has text: Consider strongly learning to use an object oriented style. Parallel arrays of related items are a Bad Idea. `var products = { { name: 'gum', hasBubblesGum: true }, { name: 'chocolate', hasBubbleGum: false } ... }`
type: Comment

http://stackoverflow.com/q/28874842
score: 0
answer count: 1
tagged with: internet-explorer
tagged with: ie11-developer-tools
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46059409
has comment: http://stackoverflow.com/comment/46059370
has comment: http://stackoverflow.com/comment/46054102
has body: When debugging JavaScript I make heavy use of the console to evaluate individual lines of code, to retrieve instance values to test in 3rd party software (i.e. when building SOAP requests) Now I've got IE11, it looks like the code I type into the debugger is executed (I can open alert boxes etc..) however the results are not printed in the console. Does this mean I now have to surround everything I type into the console with console.log(JSON.stringify( /* ..expression.. */, null, 4 )) statements? Is there an easier way to return to the IE10 console behavior?
tagged with: javascript
has answer: http://stackoverflow.com/a/28946793
type: Question
has title: IE11 Debugging Capabilities

http://stackoverflow.com/q/28823187
has comment: http://stackoverflow.com/comment/45917894
type: UnansweredQuestion
tagged with: rackspace-cloudfiles
has comment: http://stackoverflow.com/comment/45917832
has answer: http://stackoverflow.com/a/28825627
tagged with: http-headers
has comment: http://stackoverflow.com/comment/45918137
type: Question
has comment: http://stackoverflow.com/comment/45918056
answer count: 1
has body: I have an image hosted on a CDN via Rackspace Cloud Files. I have the "Access-Control-Allow-Origin" header set to "*": curl -I http://ddfe38685b82abf2025a-3d3d68979b9884dbb99ee38fe4e87955.r49.cf1.rackcdn.com/images/ads/6/a6c3d7ec7ca8d8a41a4a065e27e317e2.jpg HTTP/1.1 200 OK Content-Length: 1304399 Accept-Ranges: bytes Last-Modified: Tue, 03 Mar 2015 02:10:06 GMT ETag: c8767efedb8057eaa637a2caeabed834 X-Timestamp: 1425348605.85405 Access-Control-Allow-Origin: * Content-Type: image/jpeg X-Trans-Id: tx5115bede82244690acd6a-0054f51e84dfw1 Cache-Control: public, max-age=259200 Expires: Fri, 06 Mar 2015 02:37:57 GMT Date: Tue, 03 Mar 2015 02:37:57 GMT Connection: keep-alive However, when I attempt to download this file via AJAX, I get No 'Access-Control-Allow-Origin' header is present on the requested resource: var xhr = new XMLHttpRequest(); xhr.open('GET', 'http://ddfe38685b82abf2025a-3d3d68979b9884dbb99ee38fe4e87955.r49.cf1.rackcdn.com/images/ads/6/a6c3d7ec7ca8d8a41a4a065e27e317e2.jpg', true); xhr.send(); Any ideas why I'm getting this error when the "Access-Control-Allow-Origin" clearly is set?
tagged with: javascript
has comment: http://stackoverflow.com/comment/45918278
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/45918018
has title: Why do I get "Access-Control-Allow-Origin" when downloading a file via AJAX when the header is already set?

http://stackoverflow.com/a/42864228
type: Answer
has body: In my case this issue was due to the file encoding of *.js files. Files generated with Sencha cmd were not encoded in UTF-8 and my editor respected the source encoding. Changing the encoding of the file to UTF-8 solved the problem.
score: 0
answers question: http://stackoverflow.com/q/28902129

http://stackoverflow.com/q/28889828
tagged with: javascript
tagged with: jquery-ui-datepicker
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/28890020
tagged with: jquery
has body: I'm trying to get the class set in the beforeShowDay function of a jQuery datepicker when a user clicks on the date. Something like this: $("#calendar").datepicker({ minDate: today, dateFormat: dateformat, beforeShowDay: function(date) { // set all the dates to have reserved class for now return [true, 'reserved', 'this date reserved']; }, onSelect: function(date, el){ if ($(el).hasClass('reserved')){ // on click, check if reserved class exists. console.log('it is reserved!'); } else { console.log('it is not reserved'); } } }); Every click returns "not reserved". How can I check the class of the clicked element? http://jsfiddle.net/sf90zw72/
type: AnsweredQuestion
has title: jQuery Datepicker onSelect event get class
has answer: http://stackoverflow.com/a/28890020
possible better answer: http://stackoverflow.com/a/42500880
type: Question
has answer: http://stackoverflow.com/a/42500880
tagged with: jquery-ui

http://stackoverflow.com/comment/45921525
comment on: http://stackoverflow.com/a/28822544
has text: That was dumb, I was following datatables manual but I think that I failed to look from the javascript side. Thanks buddy.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28905420
has answer: http://stackoverflow.com/a/67263950
has body: window.devicePixelRatio will return 1 or 2 depending on if I'm using my retina monitor or standard. If I drag the window between the two monitors, this property will change. Is there a way I can have a listener fire when the change occurs?
possible better answer: http://stackoverflow.com/a/29653772
has comment: http://stackoverflow.com/comment/105102356
tagged with: retina
upvote count: 26
has answer: http://stackoverflow.com/a/29653772
accepted answer: http://stackoverflow.com/a/71774031
has comment: http://stackoverflow.com/comment/109044992
has title: window.devicePixelRatio change listener
downvote count: 0
answer count: 7
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/46077192
has comment: http://stackoverflow.com/comment/125498157
score: 26
has answer: http://stackoverflow.com/a/71774031
has answer: http://stackoverflow.com/a/74720419
has answer: http://stackoverflow.com/a/74240780
type: Question
has comment: http://stackoverflow.com/comment/46073070
has answer: http://stackoverflow.com/a/75659777
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/70514686

http://stackoverflow.com/a/28770599
has body: It's almost certainly not from just picking any random float. That would not accurately represent the step of the random function, because it would not even be close to uniform distribution. Let's say you got that 2-1022 "step" (smallest non-zero value that fits in a float), plus 0.25 as a random value. Well, that would be rounded to 0.25 because floats can't represent that accuracy. So you've have a whole swathe of "values" that are all equal to 0.25 due to rounding. This is not even remotely uniform. I would say it's more likely that a float is generated with the exponent set to 0 with random bits for the mantissa, which would result in randomness of step 2-51 (I think XD) between 1 (included) and 2 (not included), from which you can then just subtract 1. In this case, the step would be the size of the mantissa.
answers question: http://stackoverflow.com/q/28770292
has comment: http://stackoverflow.com/comment/45820569
upvote count: 1
has comment: http://stackoverflow.com/comment/45822676
has comment: http://stackoverflow.com/comment/45820156
has comment: http://stackoverflow.com/comment/45819781
downvote count: 0
has comment: http://stackoverflow.com/comment/45819703
score: 1
type: Answer

http://stackoverflow.com/comment/45969244
type: Comment
type: QuestionComment
has text: kindly look at this http://stackoverflow.com/a/19188007/3164682
score: 1
comment on: http://stackoverflow.com/q/28851032

http://stackoverflow.com/q/28751788
has body: I am having trouble enabling touch events with Meteor. I installed chriswessels:hammerpackage but for some reason it's not working. I am probably missing something very simple. Do I need to somehow initialize it? When I simply add Template.showProduct.gestures({ 'swipe': function(e, t) { e.preventDefault(); console.log("HAMMERTIME!"); } }); Nothing happens. Here is a code sample http://meteorpad.com/pad/ZStmQwaPfP9LNDX2v/Hammertime I changed Template.player.events({ 'click': function () { Session.set("selectedPlayer", this._id); } }); to Template.player.events({ 'tap': function () { Session.set("selectedPlayer", this._id); } }); Shouldn't that work?
type: Question
has title: Getting started with hammer.js on Meteor.js
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28751857
score: 0
tagged with: hammer.js
answer count: 1
tagged with: meteor
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28751857

http://stackoverflow.com/comment/45937421
type: Comment
has text: Yes, you can just do `{{icon}}`, as the template context ("data") carries over into the embedded template, I forgot about that. And yes, if `prop.name` exists, it should work fine.
type: AnswerComment
comment on: http://stackoverflow.com/a/28814678
score: 0

http://stackoverflow.com/q/28861821
answer count: 1
tagged with: three.js
has answer: http://stackoverflow.com/a/28886156
type: AnsweredQuestion
has title: different key press events - different actions. How to? + 3D and JSON
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: keypress
accepted answer: http://stackoverflow.com/a/28886156
tagged with: javascript
score: 0
has body: Js noob here/ it's a question about several keypress events, and how to bind them to different actions. I've got this thing here: var imga = ["http://img1.jpegbay.com/gallery/004236128/1_t.jpg", "http://img1.jpegbay.com/gallery/004236128/2_t.jpg", "http://img1.jpegbay.com/gallery/004236128/3_t.jpg", "http://img1.jpegbay.com/gallery/004236128/4_t.jpg", "http://img1.jpegbay.com/gallery/004236128/5_t.jpg", "http://img1.jpegbay.com/gallery/004236128/6_t.jpg", "http://img1.jpegbay.com/gallery/004236128/7_t.jpg", "http://img1.jpegbay.com/gallery/004236128/8_t.jpg", ]; var imgb = ["http://img1.jpegbay.com/gallery/004236316/1_t.jpg", "http://img1.jpegbay.com/gallery/004236316/2_t.jpg", "http://img1.jpegbay.com/gallery/004236316/3_t.jpg" ]; window.addEventListener("keydown", checkKeyPressed, false); function checkKeyPressed(e) { if (e.keyCode == "65") { changeImage(-1); } if (e.keyCode == "66") { changeImage(-1); } }; function changeImage(dir) { var img = document.getElementById("imgClickAndChange"); img.src = imga[imga.indexOf(img.src)+dir] || imga[(dir==1) ? 0 : imga.length-1]; var img = document.getElementById("b"); img.src = imgb[imgb.indexOf(img.src)+dir] || imgb[(dir==1) ? 0 : imgb.length-1]; } it's on jsfiddle also: http://jsfiddle.net/k3wxhc58/39/ so two letters, two image batches, the top one is connected to the A button, and the other one should be connected to the B button, key press makes images change i want to make the whole alphabet. one more thing, in general, is it a smart way to do this typographical animation? i rendered it as a 3d object, so i was wondering is it better to use the THREE.js library and import my 3d model as a JSON? and somehow manipulate it in that way? no previous coding experience, everything what you see are bits of what i've glued together by googling stuff. thanks in advance guys J

http://stackoverflow.com/comment/45823747
score: 0
comment on: http://stackoverflow.com/a/28772421
type: AnswerComment
has text: In fact no matter if I add any number or you rest when you draw the result always the same. My image on the canvas not taken correctly
type: Comment

http://stackoverflow.com/comment/45870219
has text: I am sorry but it seems like JSFiddle has deleted my original code or I did not save it properly. I have updated the question with a fixed JSFiddle.
type: Comment
comment on: http://stackoverflow.com/q/28797170
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45945536
type: Comment
has text: javascript doesn't have access to the clipboard, afaik. you'd have to use flash or a similar plugin.
score: 1
comment on: http://stackoverflow.com/q/28837944
type: QuestionComment

http://stackoverflow.com/q/28796175
tagged with: forms
has body: I want to use webstorage :sessionStorage for saving form records. When the user submits the form i have to print all the form values that were submited. Here is my code: The above code does not work. Can you explain me how to do it ?
type: Question
tagged with: javascript
has title: javascript html saving forms with webstorage
score: 0
has answer: http://stackoverflow.com/a/28796262
tagged with: http://stackoverflow.com/tag/html
answer count: 1
type: UnansweredQuestion
tagged with: web-storage

http://stackoverflow.com/a/28882708
has comment: http://stackoverflow.com/comment/53257849
downvote count: 1
upvote count: 4
accepted answer of: http://stackoverflow.com/q/28882154
type: AcceptedAnswer
has body: Try utilizing &lt;input type="range"&gt; , transform: scale(sx[, sy]) var canvas = document.querySelectorAll("canvas")[0] , scale = document.getElementById("scale"); scale.addEventListener("change", function(e) { canvas.style.transform = "scale(" + e.target.value + "," + e.target.value + ")" }) body { height:800px; } canvas { background:blue; position:relative; display:block; } #scale { position:relative; display:inline-block; padding:8px; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;input id="scale" type="range" min="0" max="2" step="0.1" value=""/&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;canvas width="200" height="200"&gt;&lt;/canvas&gt;&lt;br /&gt;
answers question: http://stackoverflow.com/q/28882154
type: Answer
score: 3

http://stackoverflow.com/q/28811757
accepted answer: http://stackoverflow.com/a/28811891
has comment: http://stackoverflow.com/comment/45895692
type: Question
linked to: http://stackoverflow.com/q/447014
answer count: 1
tagged with: javascript
tagged with: jquery
has title: Using Jquery to refresh all of a page but a single image
score: 0
tagged with: http://stackoverflow.com/tag/html
has body: I have read how to refresh a single div with jquery, however I have a webpage based on mostly tables and updating elements. I currently have a separate script to refresh the webpage every 1.5 seconds, however I have a static image in my Web_Main file, that flashes every time the page refreshes, so I would like to use jquery in my Web_Run file to exclude that image from the page refresh. I have included the jquery-1.11.2.min.js file in my directory folder and have the header to reference it, but I am not familiar with jquery and do not know how to make the div for everything but my image refresh, as well as whether i should put it in the Web_Main script or Web_Run script. My Web_Main is set up as: My Web_Run page
has answer: http://stackoverflow.com/a/28811891
type: AnsweredQuestion

http://stackoverflow.com/q/28880990
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46027686
type: Question
has comment: http://stackoverflow.com/comment/46027247
tagged with: google-maps
upvote count: 0
score: -2
accepted answer: http://stackoverflow.com/a/28886027
tagged with: javascript
has body: I have a lists of CountryCodes, I would like to generate GoogleMap visualisations based on these CountryCodes. For example for China I have "CN" I would like to be able to generate an visualisation like this: https://goo.gl/maps/zyPk7 Center and zoom must to be automatic, due to the only information I have is the CountryCode Update I have tried with this code: JSFiddle playground, I can centre and zoom based on CountryName but not based on CountryCode. geocoder.geocode({"address": address}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { map.setCenter(results[0].geometry.location); map.fitBounds(results[0].geometry.bounds); } else { alert('Geocode was not successful for the following reason: ' + status); } }); When address is a CountryName it works, but I don't know how to make it works when address is a CountryCode.
has comment: http://stackoverflow.com/comment/46023910
answer count: 1
favorite count: 0
downvote count: 2
has comment: http://stackoverflow.com/comment/46026164
has answer: http://stackoverflow.com/a/28886027
has title: GoogleMaps, visualize Country based on a CountryCode

http://stackoverflow.com/q/28897497
tagged with: handlebars.js
has body: So I have a template and I need to show/hide some text based on a return value from a method. I searched and noticed one should use handlebars helpers in order to achieve this. So I added a resetPassword helper inside the controller. The options.fn(this) part works. The options.inverse(this) doesn't. It throws the ubiquitous JS error Uncaught TypeError: undefined is not a function.... templates/reset-password.hbs: {{#resetPassword}} Password has been reset Your new password is: {{password}} {{else}} Something went wrong! The password has not been reset! Please try again later. {{/resetPassword}} controllers/reset-password.js: export default Ember.Controller.extend({ token: null, init: function () { this._super(); Ember.Handlebars.registerHelper('resetPassword', function (options) { var token = this.get('token'); var result = false; /* Ember.$.ajax({ type: "POST", url: "/reset_password", contentType: "text/html", dataType: "json", async: false, beforeSend: function (request) { request.setRequestHeader("Authorization", token); }, success: function (data, textStatus) { this.set('password', data.password); result = true; }, error: function (data, textStatus) { result = false; } });*/ if (result) { return options.fn(this); } return options.inverse(this); }); } });
tagged with: ember.js
type: AnsweredQuestion
type: Question
tagged with: javascript
score: 0
has title: Ember Handlebars helper options.inverse undefined is not a function
answer count: 1
has answer: http://stackoverflow.com/a/30323805
accepted answer: http://stackoverflow.com/a/30323805

http://stackoverflow.com/a/28756522
score: 0
type: Answer
has body: You aren't resetting preitems You probably want... for (var i = 0; i &lt; j.length; i++) { preitems = ''; for (var u = 0; u &lt; j[i].preitem.length; u++) { ...
answers question: http://stackoverflow.com/q/28756480

audio
tags question: http://stackoverflow.com/q/28759694
tags question: http://stackoverflow.com/q/28802575
tags question: http://stackoverflow.com/q/28890275
tags question: http://stackoverflow.com/q/28874978
tags question: http://stackoverflow.com/q/28819422
type: Tag
tags question: http://stackoverflow.com/q/28813241
tag name: audio
tags question: http://stackoverflow.com/q/28822375

http://stackoverflow.com/comment/46161006
score: 0
type: Comment
has text: Thanks. I have got one more suggestion to load the template through $.get , seems working.fine. [caching Templates](http://lostechies.com/derickbailey/2012/04/10/javascript-performance-pre-compiling-and-caching-html-templates/)
comment on: http://stackoverflow.com/a/28820229
type: AnswerComment

http://stackoverflow.com/comment/45897915
has text: Thank you for your help on this. I would like to talk to you more about your advice if you have a chance. I could use some help refactoring and understanding what you mean. Thanks again.
comment on: http://stackoverflow.com/a/28806142
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46026535
comment on: http://stackoverflow.com/a/28882318
type: Comment
has text: I apologize and see the stupid simple mistakes. Been up too long and should have worked on this later. I also thought characters in a string start at 0 making the count comparison 6. Is this not correct? Thanks for the comments and assistance.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46053163
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28893785
type: Comment
has text: @Liam You can bind the scroll event from window to the div container like [this](http://jsfiddle.net/s7mufpzv/). Hope this is what you want.

http://stackoverflow.com/a/28771431
upvote count: 1
type: Answer
has body: The CSS Propert z-index : 1000 should do that. You can do it through class as well as through javascript/JQuery.
score: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28771355
answers question: http://stackoverflow.com/q/28771355

http://stackoverflow.com/comment/45900892
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28814164
has text: I respect that completely, but `position: absolute; left: 112px; top: -22px;` will place my loading animation in the absolute position, and I am not sure that this might be the best way to do it.
score: 0

http://stackoverflow.com/q/28817990
has answer: http://stackoverflow.com/a/28818051
accepted answer: http://stackoverflow.com/a/28818051
type: Question
tagged with: function
has body: Im working on a betting script and basically have two functions, one for if I win, and one for if I lose. I was wondering, whether any of you guys can help me with the code to be able to count how many times the function has been run,(or how many i have won, and how many times I have lost.) I was wondering whether it would then be possible to create an element on the page which would display these? Any help would be great. Im new to javascript and bit unsure how to make variables count?? Let me know if you need more info?
tagged with: javascript
has comment: http://stackoverflow.com/comment/45907682
score: -1
tagged with: console
answer count: 1
downvote count: 1
favorite count: 0
upvote count: 0
tagged with: count
type: AnsweredQuestion
has title: how to count how many times a function has been run in javascript? and then display it on page?

http://stackoverflow.com/a/28897813
score: 0
answers question: http://stackoverflow.com/q/28889215
has body: That's my consideration: index.html: &lt;input type="search" class="form-control" placeholder="Search" ng-model="searchText"&gt; test.html (here is my form): ... &lt;tr ng-repeat="data in datalist | offset: (currentPage-1)*itemsPerPage | limitTo: itemsPerPage | search: searchText"&gt; ... and in my Filter-File I have: .filter('search', ['$scope', '$resource', '$http', 'apiHost', function ($scope, $resource, $http, apiHost) { return function (input) { var url = $resource(apiHost + '/:id', { id: '@id' }); var req = { method: 'GET', url: url, data: input }; $http(req).success(function (data) { var dataresult = data; }); return dataresult; }; }]); I thought, I need all the data from the backend, because what I'm telling before, the default filter (not my custom filter) gets only the result of the first pagination site. For example when I'm looking for a category with the name "test" and the category is on Pagination page 2 the filter doesn't find the data with the category "test" on page 2.
has comment: http://stackoverflow.com/comment/46058201
type: Answer

http://stackoverflow.com/q/28854122
has title: jquery not loading. I need help in adding jquery to my project. It is not loading the javascript files
upvote count: 0
score: -2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28854268
has body: I have three jquery files under WebContent>js folder. I tried including these files into my jsp pages using the following, but there is no javascript file loaded. My jsp page is inside WEB-INF>view>welcome.jsp . I have checked using firebug and tried searching over the internet for solution but nothing seems to be working. &lt;script src="&lt;c:url value='/js/jquery-1.11.2.js'/&gt;"&gt;&lt;/script&gt; &lt;script src="&lt;c:url value='/js/jquery-ui.js'/&gt;"&gt;&lt;/script&gt; &lt;script src="&lt;c:url value='/js/datePicker.js'/&gt;"&gt;&lt;/script&gt;
answer count: 1
tagged with: jsp
has comment: http://stackoverflow.com/comment/45974357
favorite count: 0
type: UnansweredQuestion
downvote count: 2
has comment: http://stackoverflow.com/comment/45974421
has comment: http://stackoverflow.com/comment/45974543
type: Question

http://stackoverflow.com/comment/46011137
type: AnswerComment
has text: Hope i am not wrong ask this question.In your solution how 'appinfo.php?id=' changes to 'appinfo.php?VoteYes=' ? becasue the above code adds id="passed argument" it have to be VoteYes="passed argument" in some time right?
type: Comment
comment on: http://stackoverflow.com/a/28859256
score: 0

http://stackoverflow.com/q/28764612
duplicate of: http://stackoverflow.com/q/9466265
tagged with: javascript
score: 0
has title: Html, dynamic external link
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/9466265
tagged with: dynamic
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28764680
answer count: 1
has body: Using html and javascript i want to have an &lt;a href="externallink"&gt;text&lt;\a&gt; However i would like the link to be stored in another document, which will then be updated regularly. Is there a way that the href can link to the link in the other document? Ive been playing with javascript but could not achieve this! Thanks!

http://stackoverflow.com/q/28769795
has body: I am trying to authenticate a user with github, then pass their avatar_url to the client. Simplified structure looks as follows. server/ publications.js client/ users/ login.js main.js In my client/users/login.js file, I try to get the permission to the user Object which contains the avatar url Accounts.ui.config({ requestPermissions: { github: ['user'] } }); Then in my server/publications.js, I try to publish the data related to the avatar url. Meteor.publish('userData', function() { if(this.userId) { return Meteor.users.find( { _id: this.userId }, { fields: { 'services.github.id': 1, 'services.github.user.avatar_url': 1 } }) } else { this.ready(); } }); However I never get the data related to the github user when I get my user object. How can I get access to the user with OAuth?
tagged with: javascript
score: 0
answer count: 1
tagged with: meteor
tagged with: oauth
type: AnsweredQuestion
has title: accessing github user data in meteor oauth
type: Question
has answer: http://stackoverflow.com/a/28770563
accepted answer: http://stackoverflow.com/a/28770563

http://stackoverflow.com/q/28861183
type: Question
accepted answer: http://stackoverflow.com/a/28929015
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: media
tagged with: android
favorite count: 0
has title: Android Media Player not Working with Buttons
downvote count: 1
type: AnsweredQuestion
has body: my MediaPlayer is not working. I have 9 Buttons and 9 Songs. One Song is for one Button. All buttons are not working! Sorry for my bad english i come from Germany Here is my code: import android.media.MediaPlayer; import android.support.v7.app.ActionBarActivity; import android.os.Bundle; import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Button; public class MainActivity extends ActionBarActivity { private Toolbar toolbar; MediaPlayer achieve; MediaPlayer iyo; MediaPlayer krankelache; MediaPlayer mannarzt; MediaPlayer missgeburt; MediaPlayer mutterfinden; MediaPlayer omg; MediaPlayer scheisse; MediaPlayer twocups; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); //MediaPlayer this.achieve = MediaPlayer.create(this, R.raw.achieve); this.iyo = MediaPlayer.create(this, R.raw.iyo); this.krankelache = MediaPlayer.create(this, R.raw.krankelache); this.mannarzt = MediaPlayer.create(this, R.raw.mannarzt); this.missgeburt = MediaPlayer.create(this, R.raw.missgeburt); this.mutterfinden = MediaPlayer.create(this, R.raw.mutterfinden); this.twocups = MediaPlayer.create(this, R.raw.twocups); this.omg = MediaPlayer.create(this, R.raw.omg); this.scheisse = MediaPlayer.create(this, R.raw.scheisse); //Toolbar toolbar= (Toolbar) findViewById(R.id.app_bar); setSupportActionBar(toolbar); } .... Thanks
has answer: http://stackoverflow.com/a/28929015
score: -1

http://stackoverflow.com/a/28764415
type: Answer
has body: Like this? some HTML
answers question: http://stackoverflow.com/q/28764244
score: 0

http://stackoverflow.com/comment/45882540
has text: is not possible to apply any reg exp to keys ?
comment on: http://stackoverflow.com/q/28804588
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45891099
type: Comment
comment on: http://stackoverflow.com/a/28807562
score: 0
has text: You might want to read into javascript first, because renaming $ to jquery doesn't include jquery. You have to download the JQuery javascript file and include it in the of your html file. JQuery is an optional library, so you can't just use it. In my fiddle, in the top left corner, I included it under Frameworks and Extensions. Read here about how to include JQuery: http://www.w3schools.com/jquery/jquery_get_started.asp
type: AnswerComment

http://stackoverflow.com/comment/45907916
has text: Another solution is that if the "popover" has an isolate scope, you will need to pass the primitive objects into the directive through attributes.
comment on: http://stackoverflow.com/q/28817544
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28775227
answers question: http://stackoverflow.com/q/28775164
type: Answer
downvote count: 1
has body: Just do all of the logic in one mouseover handler. rects.on('mouseover', function(thisData) { rects.filter(function(d) { return d['userId'] === thisData['userId']; }) .style('fill', users[thisData['userId']]['color']); display.text(thisData['message']); });
score: -1
upvote count: 0

http://stackoverflow.com/a/28899548
has comment: http://stackoverflow.com/comment/46059291
has comment: http://stackoverflow.com/comment/46058304
type: Answer
score: 2
upvote count: 3
downvote count: 1
answers question: http://stackoverflow.com/q/28899298
has body: Try This:-

http://stackoverflow.com/q/28781969
answer count: 2
tagged with: javascript
score: 4
has answer: http://stackoverflow.com/a/28782572
possible better answer: http://stackoverflow.com/a/28782213
has answer: http://stackoverflow.com/a/28782213
has title: How do I find all input fields inside a form and copy their values into textarea using Javascript?
downvote count: 0
favorite count: 0
has body: I want to add a couple of input fields (name, age, location, status, etc...) to my form. When I click submit button, how do I get all the values inside a form and place them into a single textarea element, so that it's easy to copy? Thanks for the help! My current code: Submit
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28782572
type: AnsweredQuestion
tagged with: forms
type: Question
upvote count: 4

http://stackoverflow.com/comment/45853178
type: Comment
type: AnswerComment
has text: I see there is several lines have the same error, but i'm not familar with the JavaScript syntax error and the code i have was from my textbook example, i must implement wrong
comment on: http://stackoverflow.com/a/28788730
score: 0

http://stackoverflow.com/comment/46007824
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28872090
score: 0
has text: @NarekMamikonyan - on click

http://stackoverflow.com/comment/45921809
comment on: http://stackoverflow.com/q/28822752
type: QuestionComment
type: Comment
score: 0
has text: this is NOT a laravel issue.

http://stackoverflow.com/a/28854829
has comment: http://stackoverflow.com/comment/45975706
has body: If that is a list of values obtained from ord(or equivalent) you can use chr to invert the process. &gt;&gt;&gt; ''.join(chr(i) for i in l) 'function check(){\r\n\tvar a = \'d4g\';\r\n\tif(document.getElementById(\'txt\').value==a){\r\n\t\twindow.location.href=a+".php";\r\n\t}else{\r\n\t\talert("密码错误");\r\n\t}\r\n}' In formatted code, this string would be function check(){ var a = 'd4g'; if(document.getElementById('txt').value == a){ window.location.href= a + ".php"; } else{ alert("密码错误"); } }
answers question: http://stackoverflow.com/q/28854772
has comment: http://stackoverflow.com/comment/45975814
has comment: http://stackoverflow.com/comment/45976101
score: 0
type: Answer

http://stackoverflow.com/a/28875463
has comment: http://stackoverflow.com/comment/46013786
has comment: http://stackoverflow.com/comment/46013328
answers question: http://stackoverflow.com/q/28874932
has comment: http://stackoverflow.com/comment/46013708
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/46013068
upvote count: 1
has comment: http://stackoverflow.com/comment/46013483
has comment: http://stackoverflow.com/comment/46013171
type: Answer
has body: you have to use the appended method of masonry ... otherwise how would it know that you have added any new element. Adding the elements simply wont align them as masonry doesnt have any event listner for new element added. var el = $('&lt;div class="kesif-gonderi-alani" style="height:300px;"&gt;&lt;/div&gt;') $container.masonry().append( el ).masonry( 'appended',el ); Hers is small demo on codepen http://codepen.io/knaman2609/pen/xbJMRY Click on the button to append elements dynamically http://masonry.desandro.com/methods.html

http://stackoverflow.com/q/28773816
tagged with: javascript
tagged with: createjs
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/45827884
has answer: http://stackoverflow.com/a/29520265
type: UnansweredQuestion
tagged with: css
has body: My canvas element distorts in Internet Explorer 9 &amp; 10, it's at half of the height it should be. The canvas should be a responsive 640x480 box with a large red circle, not an oblong ellipse. I'm hoping it would take a css spec fix, but I'm not clear what the css or javascript fix would be. In ie10 and ie9 it looks like this: http://s7.postimg.org/4xtb6vjkr/ie10.png The code and correct display in chrome, firefox, safari and ie11 can be seen here: http://jsbin.com/vutiqatowo/1/edit?html,css,js,output This is a backwards compatibility requirement for a project, so wishing for visitors to not use ie10 is not an option for this.
has comment: http://stackoverflow.com/comment/45836315
has title: Canvas Element Squished in IE10
type: Question
tagged with: canvas

http://stackoverflow.com/comment/45865387
has text: with require_once its works indeed but we need to reload all page which is not good
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28794865
type: Comment

http://stackoverflow.com/comment/46042481
comment on: http://stackoverflow.com/a/28873698
type: AnswerComment
score: 0
type: Comment
has text: Thank you, glad for the github link. What difference between the jssor.slider.mini.js and jssor.slider.min.js files

http://stackoverflow.com/comment/45833853
comment on: http://stackoverflow.com/q/28776838
type: Comment
type: QuestionComment
has text: Voting to close because it's asking for offsite resources, overly broad, primarily opinion based, and asking multiple questions in a single question. These are all good questions, but this isn't on-topic on StackOverflow.
score: 0

http://stackoverflow.com/a/28753213
downvote count: 0
answers question: http://stackoverflow.com/q/28753129
has comment: http://stackoverflow.com/comment/45788777
has comment: http://stackoverflow.com/comment/45788614
has comment: http://stackoverflow.com/comment/45788750
accepted answer of: http://stackoverflow.com/q/28753129
type: Answer
has comment: http://stackoverflow.com/comment/45788510
upvote count: 1
has comment: http://stackoverflow.com/comment/45788277
has body: for the output you want is an array of objects. so for this var arrayFirstLast=[[58.94142647682763,23.5423357], [59.94142647682765,24.5423357]]; var arrayLongLat = [], latLon = {}; for(var i in arrayFirstLast){ latLon = {long: arrayFirstLast[i][0], lat: arrayFirstLast[i][1]}; arrayLongLat.push(latLon); }
score: 1
has comment: http://stackoverflow.com/comment/45788717
has comment: http://stackoverflow.com/comment/45788476
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45788706

http://stackoverflow.com/q/28834753
tagged with: javascript
has title: Troubling using QuaggaJS - Javascript Barcode Scanner
upvote count: 1
has comment: http://stackoverflow.com/comment/63274199
answer count: 1
downvote count: 0
tagged with: quagga
has body: I am using QuaggaJS. On the home page there, it has basic descriptions of its main methods, as well as an example html folder in its downloadable zip. My problem, is that one of the example HTMLs is called static_images. This takes in image src's for its scanning procedure, but I cannot figure out how to give it a custom single src that I specify. (The example HTML seems to use a pre-set list of images in the folder). I read (on QuaggaJS git homepage) that the method Quagga.decodeSingle(config, callback) does exactly what I want. In contrast to the calls described above, this method does not rely on getUserMedia and operates on a single image instead. The provided callback is the same as in onDetected and contains the result data object. But I cannot figure out how to implement that method into his example code. Can someone guide me, and explain, how I am to implement that method within QuaggaJS? (quagga/example/static_images.html/js)
favorite count: 0
type: UnansweredQuestion
score: 1
tagged with: barcode-scanner
type: Question
has answer: http://stackoverflow.com/a/30675399

http://stackoverflow.com/a/28851565
has comment: http://stackoverflow.com/comment/45971019
has comment: http://stackoverflow.com/comment/45970806
answers question: http://stackoverflow.com/q/28851145
has comment: http://stackoverflow.com/comment/45970587
type: AcceptedAnswer
has body: Try jQuery's outerHeight() function to get the "current computed height" of your slider, and execute it on load and on resize events: function resizeMenu(){ $("#menu-main-menu &gt; li.menu-parent-item &gt; ul.sub-menu").css("min-height", $("#new-royalslider-1").outerHeight() ); } // Do this on load and on resize $(window).load(resizeMenu).resize(resizeMenu); JS Fiddle Demo Edit: If you want to substract 40px to the height, you can just do ....outerHeight()-40. Js Fiddle Demo
downvote count: 0
has comment: http://stackoverflow.com/comment/45970951
type: Answer
accepted answer of: http://stackoverflow.com/q/28851145
has comment: http://stackoverflow.com/comment/45970497
score: 1
has comment: http://stackoverflow.com/comment/45970333
upvote count: 1

http://stackoverflow.com/q/28781282
score: 0
answer count: 2
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/28781465
favorite count: 0
has title: By using $http in angularjs can we write error or exception messages in text file?
tagged with: angularjs
type: UnansweredQuestion
has body: Question: How to write error/exception messages in text file {No jQuery Solution}
has answer: http://stackoverflow.com/a/28781373
type: Question
tagged with: javascript

http://stackoverflow.com/comment/107352848
has text: another good option is anychart: https://docs.anychart.com/Basic_Charts/Sunburst_Chart
type: AnswerComment
comment on: http://stackoverflow.com/a/40010642
score: 0
type: Comment

http://stackoverflow.com/comment/46025798
comment on: http://stackoverflow.com/a/28882080
score: 0
type: AnswerComment
type: Comment
has text: i am still not getting the viable to populate:

http://stackoverflow.com/comment/45915140
has text: please do me a favor, put this code `console.log('Result is:',[document.documentMode,document.compatMode])` into any webpage you are running, open the console in your browser and tell me what the result of this code is? it will look something like `Result is: [undefined, "CSS1Compat"]`
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28777051

http://stackoverflow.com/comment/45934874
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28831043
type: AnswerComment
has text: Sorry but i can't use $watch, scope variables are dynamic/unknown, is not always scope.x it could be whatever you want/need :)

http://stackoverflow.com/comment/45934981
has text: Unless I'm mistaken, the answer is "No - neither." It will just be what JS uses for numbers in general - a 64bit float. See more here: http://www.w3schools.com/js/js_numbers.asp
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28832585

http://stackoverflow.com/comment/46072221
type: AnswerComment
has text: Thanks! I looked at the link and your comments, but I'm not sure this will work for all of my cases. My example data may have been misleading with `5,10,15` because there is no guarantee of an even interval between supported zoom levels. I got my code working, but it seems like a weird UX to skip a bunch of zoom levels. Was thinking there could be a way to use the scaling that Leaflet already does when you zoom while it is waiting for the new tiles to load (even though it will result in a blurry image in some cases, it at least preserves the base layer context). I may consider extending L.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28905684

http://stackoverflow.com/comment/45825718
has text: (1) is (2)'s alias. `$(window).resize(myfunction)` internally calls `$(window).on('resize',myfunction);`
comment on: http://stackoverflow.com/q/28773562
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/46066477
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28903483
has text: For date manipulation, the best library is http://momentjs.com/ then do something like `moment("06/mar/2015", "DD/MMM/YYYY").unix()`

http://stackoverflow.com/a/28904218
has body: Ok. I found a VERY simple solution to this. Basically I will just set my variable to equal the last five minute mark by rounding the current time down to the last five minute mark! Silly me. The answer was here, except I subtracted 2.5 instead of added 2.5 since I want to find the last five minute mark: Javascript: Round Time UP nearest 5 minutes
answers question: http://stackoverflow.com/q/28903344
score: 0
type: Answer

http://stackoverflow.com/q/28904374
tagged with: hashtable
has body: The following code is my attempt at a fairly generic javascript hash code implementation. I'm planning to use this code in conjunction with a hash table implementation (e.g. jshashtable) that utilizes hashCode() if its defined for keys. I have attempted to adhere closely to java's hash code implementations for numbers, strings, and arrays. Questions: Are there any issues with this implementation regarding correctness or performance? Are there any pre-existing implementations for hash codes that do the same (or roughly the same) thing? Aside from jshashtable, are there other hash table implementations that utilizes hashCode() and equals() in the same way that I should also consider? NOTE: I'm aware that the code below could leverage other libs like underscore and jquery but I'd prefer not to have any 3rd party deps for my implementation. This is not say that I'm not interested in hash code libs that themselves may depend on jquery, underscore, etc. /** * Computes a hash code for an object based on a given subset of its fields * @param obj any type * @param keys an array of strings representing some subset of the keys in obj or undefined * @returns {Number} a java-like hash code for obj based on the hash codes of a subset of its fields * specified in keys. */ function hashCode(obj, keys) { if (!isDefined(keys)) return typeHashCode(obj); var result = 1; for (var k = 0; k &lt; keys.length; k++) { var key = keys[k]; if (isDefined(obj[key])) result = multiplyBy31AndAdd(result, typeHashCode(obj[key])); } return result; } /** * @param obj * @returns {Number} */ function typeHashCode(obj) { var result = 1; if (isDefined(obj)) { if (typeof obj === 'string') result = multiplyBy31AndAdd(result, stringHashCode(obj)); else if (typeof obj === 'number' &amp;&amp; isFinite(obj)) result = multiplyBy31AndAdd(result, numberHashCode(obj)); else if (typeof obj === 'object') { if (nonEmptyObject(obj)) { if (isDefined(obj[hashCode])) result = multiplyBy31AndAdd(result, obj.hashCode()); els…
has comment: http://stackoverflow.com/comment/51962743
tagged with: hash
answer count: 0
type: UnansweredQuestion
tagged with: hashcode
upvote count: 5
has comment: http://stackoverflow.com/comment/47556500
type: Question
score: 5
linked to: http://stackoverflow.com/q/4994201
downvote count: 0
tagged with: javascript
favorite count: 0
linked to: http://stackoverflow.com/q/2003493
linked to: http://stackoverflow.com/q/7616461
has title: javascript (java-like) hash code implementation

http://stackoverflow.com/a/28802723
score: 1
answers question: http://stackoverflow.com/q/28802687
has body: You can just do : var counter = 0; $('#addmore2').click(function() { if (count === 0) { $('#qulification2').show(); } else if (count == 1) { $('#qulification3').show(); } count++; });
has comment: http://stackoverflow.com/comment/45879056
type: Answer
has comment: http://stackoverflow.com/comment/45879173
upvote count: 2
has comment: http://stackoverflow.com/comment/45879191
downvote count: 1

http://stackoverflow.com/q/28797869
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/14813369
has comment: http://stackoverflow.com/comment/45870483
has comment: http://stackoverflow.com/comment/45870255
has answer: http://stackoverflow.com/a/28797935
duplicate of: http://stackoverflow.com/q/14813369
has comment: http://stackoverflow.com/comment/45870064
type: Question
has comment: http://stackoverflow.com/comment/45870178
has body: My objective is to test if a word (under 10 letters) that a user enters is a palindrome. I want to do this my comparing the first letter to the last, 2nd letter to the 2nd to last, 3rd letter to the 3rd to last... I am using a for loop and an array to do this. I cannot use the reverse() method. My main issue is formatting the comparison equation that I have: (lettersArray[i] + 1) == (lettersArray[i].length - 1) This is supposed to compare the first to last, 2nd and 2nd to last, and so on. Is this the right format? Am I right in my method of accessing the last index in the array and counting it down? Please let me kow what I am doing wrong since it's not running. Here is my code: var usersWord = prompt("Enter a Palindrome"); var lettersArray =usersWord.split(""); // this is the array for(var i=0; lettersArray.length &lt; 11; i++) { if((letters[i] + 1) == (lettersArray.length[i]-1)) { alert("is palindrome"); } //end if statement else{ alert("is not palindrome"); } // end else statement } // end for statement
tagged with: arrays
answer count: 1
downvote count: 0
tagged with: palindrome
tagged with: javascript
has title: Comparing Letters in a Palindrome (JavaScript)
favorite count: 0
has comment: http://stackoverflow.com/comment/45870018
has comment: http://stackoverflow.com/comment/45870057
has comment: http://stackoverflow.com/comment/45870481
score: 2
upvote count: 2

http://stackoverflow.com/comment/45789955
type: AnswerComment
has text: @forresto I believe PS uses square regions. The distance does not affect the result (it's not use as a weight, just to limit the area), only the area the pixels are retrieved from. You will here get an average of pixels inside the circle. Plain average is what you want to get the average of the pixel values... :) Blur will average current pixel with surrounding pixels - this is essentially a low-pass filter
type: Comment
comment on: http://stackoverflow.com/a/28752270
score: 0

http://stackoverflow.com/a/28902145
has comment: http://stackoverflow.com/comment/46063795
has comment: http://stackoverflow.com/comment/46063833
upvote count: 1
has comment: http://stackoverflow.com/comment/46064036
has body: It seems that all you need to do is remove the if statement: if (_.has(innerItem, stateName)) { innerItem[stateName] = startVar; } should become simply: innerItem[stateName] = startVar; Then if the property is not present, it will be added. If it is already present, it will be overwritten. EDIT: to handle absence at top level: myFunction = function(moduleName, stateName, startVar){ //currentState brought in from factory controlling it var currentState = StateFactory.current(); var found = false; _.each(currentState, function(item) { if (item.module === moduleName) { found = true; _.each(item.customUrl, function(innerItem) { if (_.has(innerItem, stateName)) { innerItem[stateName] = startVar; } }); } }); if ( ! found ) { var newItem = { module: moduleName, customUrl: [] }; var newInnerItem = {}; newInnerItem[stateName] = startVar; newItem.customUrl.push(newInnerItem); currentState.push(newItem); } }
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28901662
score: 1
answers question: http://stackoverflow.com/q/28901662
type: Answer
has comment: http://stackoverflow.com/comment/46063926

http://stackoverflow.com/comment/45868007
has text: You'd have to use the animation complete callback to set the height to auto. http://jsfiddle.net/psax3fge/6/ Just to show you that it is possible. However, the slideToggle option is much simpler so if it works for you, go for it.
score: 0
comment on: http://stackoverflow.com/q/28796439
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28828328
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28828387
type: Question
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45926909
has body: I'm trying to replace the context of a loaded element with the following code: $("#menu1").load("./templates/menu.html"); var str = $("#menu1").html(); alert(str); str.replace("[number]", "1"); $("#menu1").replaceWith(str); But I always get an empty str, the menu1 gets loaded correctly with the menu.html content so I have no idea what's going on.
score: 0
has title: Cannot get html content after a load
answer count: 3
accepted answer: http://stackoverflow.com/a/28828387
has answer: http://stackoverflow.com/a/28828453
has answer: http://stackoverflow.com/a/28828399
possible better answer: http://stackoverflow.com/a/28828399
has comment: http://stackoverflow.com/comment/45926907

http://stackoverflow.com/q/28769472
upvote count: 0
has answer: http://stackoverflow.com/a/28769875
has comment: http://stackoverflow.com/comment/45817979
has body: I have a form in which I'm hiding and showing fields according to the dropdown selection. Initially, when the button is clicked, only the dropdown selection option is shown and the rest of the fields are hidden. Once the form is saved, the user can add another form. So when I click the button for the second time, the .hide()/.show() doesn't work. Instead the entire form is displayed. Here is my code: $(document).ready(function () { $("#button").click(function () { alert("handler called"); $("#name").hide(); $("#selection").on('change', function () { alert("handler called1"); if ($("#selection").val() == "day") { $("#name").show(); } }); }); }); My HTML is: selection Name <input type="text" The alert("Handler called"); is fired the second time but the .hide() doesnt work.
has answer: http://stackoverflow.com/a/28771102
type: Question
has comment: http://stackoverflow.com/comment/45818090
has comment: http://stackoverflow.com/comment/45817515
has comment: http://stackoverflow.com/comment/45817770
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45818271
has comment: http://stackoverflow.com/comment/45817690
has comment: http://stackoverflow.com/comment/45817816
answer count: 3
downvote count: 3
possible better answer: http://stackoverflow.com/a/28769875
has comment: http://stackoverflow.com/comment/45817775
favorite count: 0
has title: Jquery .hide() with html firing only the first time on button click
has comment: http://stackoverflow.com/comment/45818128
score: -3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45817957
accepted answer: http://stackoverflow.com/a/28771102
has comment: http://stackoverflow.com/comment/45817543
has answer: http://stackoverflow.com/a/28769955
type: AnsweredQuestion

http://stackoverflow.com/comment/46043828
type: AnswerComment
has text: well if you don't want to affect every forms of your app but just these the other 2 solutions are better, otherwise indeed the first is simpler.
type: Comment
comment on: http://stackoverflow.com/a/28891262
score: 0

http://stackoverflow.com/a/28868920
downvote count: 0
has comment: http://stackoverflow.com/comment/74862800
type: Answer
has body: CORS headers are found in the response sent by the server to your request. If the requested page isn't sending the header, it doesn't matter what you did with the request in a stock browser, you'll get a security error The relevant CORS headers look like this, the last being the most important one Access-Control-Allow-Credentials: false Access-Control-Allow-Methods: GET Access-Control-Allow-Origin: * I tried opening "nczonline.net" and when I looked at the response headers I did not see any of these, so the server is not configured to permit being loaded in this way If you are an administrator of that website, you may want to consider adding the required headers to your responses, perhaps being specific about permitted origins rather than using the wildcard If you're simply trying to demo your code and want to try it with a third party, load a page which does send these headers e.g. developer.mozilla.org
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28868869

http://stackoverflow.com/q/28855226
possible better answer: http://stackoverflow.com/a/28855301
has comment: http://stackoverflow.com/comment/45977996
score: 2
type: AnsweredQuestion
has title: How to preserve timezone offset when posting a JavaScript date object?
upvote count: 2
type: Question
has answer: http://stackoverflow.com/a/28855313
accepted answer: http://stackoverflow.com/a/28855268
has body: From my AngularJS web app I'm posting a date to the server using $http.post. On the server side I would like to get the date's local representation but this isn't possible since the timezone isn't preserved when the Date object is serialized. This is what goes over the wire: {startTime: "2015-03-04T11:00:00.000Z"} but what I really want is {startTime: "2015-03-04T12:00:00.000+01:00"}. How can this be accomplished?
downvote count: 0
has comment: http://stackoverflow.com/comment/45976516
tagged with: javascript
has comment: http://stackoverflow.com/comment/45977033
favorite count: 0
has answer: http://stackoverflow.com/a/28855301
has comment: http://stackoverflow.com/comment/45976998
tagged with: angularjs
answer count: 3
has answer: http://stackoverflow.com/a/28855268
tagged with: datetime

alert
tags question: http://stackoverflow.com/q/28805977
tags question: http://stackoverflow.com/q/28850635
type: Tag
tags question: http://stackoverflow.com/q/28896975
tag name: alert

http://stackoverflow.com/q/28768654
has title: Test for equation irrational
score: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45816267
answer count: 3
has answer: http://stackoverflow.com/a/28995556
has comment: http://stackoverflow.com/comment/45847135
has answer: http://stackoverflow.com/a/28771465
upvote count: 2
has body: I'm making a number data shower, which show the data of a number, like even or odd. Now I stopped at irrational numbers, how can I test for is it that? Something like this: alert(isIrrational(Math.sqrt(9)));
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/45819850
tagged with: numbers
has comment: http://stackoverflow.com/comment/45816496
tagged with: math
has answer: http://stackoverflow.com/a/28784918

http://stackoverflow.com/comment/80130256
has text: In my instance, the script fails because of invalid JS syntax if I write `constructor` with lowercase letters. It only works if I write it as `Constructor`.
type: Comment
comment on: http://stackoverflow.com/a/30495399
score: 0
type: AnswerComment

http://stackoverflow.com/q/28869882
tagged with: jquery
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28870055
type: Question
tagged with: object
has answer: http://stackoverflow.com/a/28869971
has comment: http://stackoverflow.com/comment/46003699
has answer: http://stackoverflow.com/a/28870121
has title: Creating an object like jQuery
score: 0
answer count: 3
has body: For example, there is an object V which takes an element id, class or a tag name as a parameter and applies functions on it, like so. var V = function(elem) { // logic to getElementBy ID or class or tag name and return it if(type === '#') { // get by id domElem = document.getElementById(elem.slice(1)); } else if(type === '.') { // get by class domElem = document.getElementsByClassName(elem.slice(1)); } else if(typeof type === 'string' && (type !== '#' || type !== '.')) { // get by elem type domElem = document.getElementsByTagName(elem); } return domElem; } So now when you get an element, like so: var myDiv = V('#someDivElement'); it will return you the div element. Now, I also run a method on the returned object. For example, I want to run a method asdf that simply appends a paragraph tag inside the div, like so: V.prototype.asdf = function() { this.appendChild(' I am an awesome child! '); return this; } Ideally, it works when I do: var myDiv = V('#someDivElement'); But the below line doesn't seem to execute. myDiv.asdf(); What am I doing wrong here?
tagged with: function
tagged with: javascript

http://stackoverflow.com/comment/45984807
comment on: http://stackoverflow.com/a/28857880
score: 0
type: AnswerComment
has text: @T.J.Crowder humm I just thought of it as a low-risk as it can only be happen by coincidence... I have no way to prevent the user from seeing the page if he find it by chance on google...
type: Comment

http://stackoverflow.com/comment/46351780
has text: Thanks, I liked this map function very much. I saw your answer and looked at its javascript Documentation.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28880463
score: 1

http://stackoverflow.com/comment/45907322
has text: can you setup a plunker with minimal code.. i have done something similar around a year back.. but dont remember how, if you could setup a plunker, i could help
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28770778
score: 0

http://stackoverflow.com/q/28799892
has comment: http://stackoverflow.com/comment/112521219
upvote count: 32
tagged with: javascript
has answer: http://stackoverflow.com/a/28800008
answer count: 3
tagged with: google-chrome-extension
favorite count: 0
has answer: http://stackoverflow.com/a/74250131
score: 32
possible better answer: http://stackoverflow.com/a/65716369
has title: How to launch a new window in Google Chrome Extension
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/65716369
accepted answer: http://stackoverflow.com/a/28800008
type: Question
has body: I'm trying to develop a Extension for Google Chrome, but I have some problems, I want to launch or create a new window when user click on it in the icon. Like this: https://i.sstatic.net/WeNzw.png Thanks so much!

http://stackoverflow.com/a/28845871
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/28845691
has body: make the click event to change event in radio button. I have update the fiddle check it out Here is the updated fiddle
downvote count: 0
type: Answer

http://stackoverflow.com/q/28778767
has answer: http://stackoverflow.com/a/28778839
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45835369
linked to: http://stackoverflow.com/q/17392857
has answer: http://stackoverflow.com/a/28778838
has comment: http://stackoverflow.com/comment/45835421
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/45835033
tagged with: javascript
tagged with: inheritance
has body: Please refer - http://jsfiddle.net/sf4oaxun/ function a() { this.say = function () { alert("hello"); }; } a.prototype.what = function () { alert("234234"); }; function b() {} //b.prototype = Object.create(a); //b.prototype = a; var b1 = new b(); b1.say(); The 2 commented lines, are they different? Why does say not get invoked, and errors out when using either of the commented lines(please uncomment it) b.prototype = Object.create(a); b.prototype = a; Quick question added - If 'b' is inheriting from 'a' using b.prototype = Object.create(a.prototype), then would instances of b not be able to call any method of a which is not defined on a's prototype? Please refer - jsfiddle.net/sf4oaxun/3
has title: Javascript inheritence without prototype
score: 0

node.js
tags question: http://stackoverflow.com/q/28820738
tags question: http://stackoverflow.com/q/28860728
tags question: http://stackoverflow.com/q/28799659
tags question: http://stackoverflow.com/q/28754247
tags question: http://stackoverflow.com/q/28788911
tags question: http://stackoverflow.com/q/28844415
tags question: http://stackoverflow.com/q/28844132
tags question: http://stackoverflow.com/q/28770373
tags question: http://stackoverflow.com/q/28778492
tags question: http://stackoverflow.com/q/28852298
tags question: http://stackoverflow.com/q/28847875
tags question: http://stackoverflow.com/q/28777230
tags question: http://stackoverflow.com/q/28862201
tags question: http://stackoverflow.com/q/28843646
tags question: http://stackoverflow.com/q/28869121
tags question: http://stackoverflow.com/q/28750969
tags question: http://stackoverflow.com/q/28793098
tags question: http://stackoverflow.com/q/28761365
tags question: http://stackoverflow.com/q/28865631
tags question: http://stackoverflow.com/q/28798586
tags question: http://stackoverflow.com/q/28843358
tags question: http://stackoverflow.com/q/28888870
tags question: http://stackoverflow.com/q/28822034
tags question: http://stackoverflow.com/q/28774420
tags question: http://stackoverflow.com/q/28880063
tags question: http://stackoverflow.com/q/28840149
tags question: http://stackoverflow.com/q/28787518
tags question: http://stackoverflow.com/q/28775956
tags question: http://stackoverflow.com/q/28751837
tags question: http://stackoverflow.com/q/28899956
tags question: http://stackoverflow.com/q/28751248
tags question: http://stackoverflow.com/q/28790458
tags question: http://stackoverflow.com/q/28899524
tags question: http://stackoverflow.com/q/28822006
tags question: http://stackoverflow.com/q/28867584
tags question: http://stackoverflow.com/q/28800094
tags question: http://stackoverflow.com/q/28761155
tags question: http://stackoverflow.com/q/28796884
tags question: http://stackoverflow.com/q/28801550
tags question: http://stackoverflow.com/q/28767837
tags question: http://stackoverflow.com/q/28859070
tags question: http://stackoverflow.com/q/28811905
tags question: http://stackoverflow.com/q/28785735
tags question: http://stackoverflow.com/q/28891656
tags question: http://stackoverflow.com/q/28789398
tags question: http://stackoverflow.com/q/28795681
tags question: http://stackoverflow.com/q/28849936
tags question: http://stackoverflow.com/q/28794571
tags question: http://stackoverflow.com/q/28757646
tags question: http://stackoverflow.com/q/28778417
tags question: http://stackoverflow.com/q/28851111
tags question: http://stackoverflow.com/q/28755157
tags question: http://stackoverflow.com/q/28884872
tags question: http://stackoverflow.com/q/28840693
tags question: http://stackoverflow.com/q/28804411
tags question: http://stackoverflow.com/q/28849237
tags question: http://stackoverflow.com/q/28767271
tags question: http://stackoverflow.com/q/28887304
tags question: http://stackoverflow.com/q/28769936
tags question: http://stackoverflow.com/q/28890752
tags question: http://stackoverflow.com/q/28789058
tags question: http://stackoverflow.com/q/28897151
tags question: http://stackoverflow.com/q/28894074
tags question: http://stackoverflow.com/q/28770464
tags question: http://stackoverflow.com/q/28814349
tags question: http://stackoverflow.com/q/28868152
tags question: http://stackoverflow.com/q/28782523
tags question: http://stackoverflow.com/q/28851875
tags question: http://stackoverflow.com/q/28812974
tags question: http://stackoverflow.com/q/28864360
tags question: http://stackoverflow.com/q/28861688
tags question: http://stackoverflow.com/q/28767687
tags question: http://stackoverflow.com/q/28830663
tags question: http://stackoverflow.com/q/28846543
tags question: http://stackoverflow.com/q/28875330
tags question: http://stackoverflow.com/q/28877701
tags question: http://stackoverflow.com/q/28830902
tags question: http://stackoverflow.com/q/28849900
tags question: http://stackoverflow.com/q/28852497
tags question: http://stackoverflow.com/q/28897839

http://stackoverflow.com/q/28831976
score: 2
upvote count: 2
tagged with: mysql
has comment: http://stackoverflow.com/comment/45942849
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45943242
tagged with: javascript
has comment: http://stackoverflow.com/comment/45933852
has answer: http://stackoverflow.com/a/28846729
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45942892
tagged with: jquery
favorite count: 0
tagged with: ajax
has body: Hello Guys please help me out, I want pass Data-id value to Color Box Popup so what sholud i have to do..please help me or is there any other way to do the same.. JS HTML CODE ABC DEF XYZ Color Box Popup This is pop window on same page. Data-id = "" // Here I want to display data-id of clicked Post, Like if we click ABC Post than in Popup data-id is equal to 1, if click XYZ tha data-id equql to 3 in Popup
accepted answer: http://stackoverflow.com/a/28846729
has title: Pass value to colorbox on same page
has comment: http://stackoverflow.com/comment/45943114
tagged with: php
has comment: http://stackoverflow.com/comment/45961468

http://stackoverflow.com/q/28755259
has answer: http://stackoverflow.com/a/28755635
accepted answer: http://stackoverflow.com/a/28755635
has title: Raphael: Chaining ".data" to a raphael.js element
type: AnsweredQuestion
has body: I'm having trouble chaining ".data" to a raphael.js element. When I try to retrieve the data later, I get "undefined". Here's my fiddle: http://jsfiddle.net/HkNgT/9/ //Draw: paper.circle(circleCenterX, circleCenterY, circleCenterRadius) .attr({'fill':'blue', 'stroke':'red', 'stroke-width':2, 'opacity': 0.8}) .data({"circleCenterX":circleCenterX, "circleCenterY":circleCenterY, "boxYPosition":boxYPosition, "boxXPosition":boxXPosition}) .id = name+"-circle"; //Output: console.log("data is = ", paper.getById(name+"-circle").data("circleCenterX")); With this code, the ".data(...)" part just doesn't work. When I try to retrieve it (with paper.getById), it displays "data is = undefined". Other ways that I have tried: //Doesn't work paper.circle.... .data("circleCenterX",circleCenterX) .data("circleCenterY",circleCenterY) .data("boxYPosition",boxYPosition) .data("boxXPosition",boxXPosition); And another: //Doesn't work var c = paper.circle....; c.data("circleCenterX",circleCenterX); c.data("circleCenterY",circleCenterY); c.data("boxYPosition",boxYPosition); c.data("boxXPosition",boxXPosition); And another: //DOES work, but gives me huge performance losses paper.circle....; paper.getById(name+"-circle").data("circleCenterX",circleCenterX); paper.getById(name+"-circle").data("circleCenterY",circleCenterY); paper.getById(name+"-circle").data("boxYPosition",boxYPosition); paper.getById(name+"-circle").data("boxXPosition",boxXPosition); Any help?
tagged with: raphael
type: Question
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/28761517
tagged with: javascript
favorite count: 0
answer count: 3
has answer: http://stackoverflow.com/a/28763527
has title: Angularjs won't read from an external json file
tagged with: angularjs
upvote count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28763527
score: 1
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/28761618
possible better answer: http://stackoverflow.com/a/28761579
type: Question
has answer: http://stackoverflow.com/a/28761579
has body: Hi I'm trying to get my angularJs site to read from an external JSON file located in js/data.json. it only works if the json file is in the controller script...but when I remove it to data.json...it won't read it? When I type in anything on the search bar...nothing comes up. It only works when I include the script in the controller like: personApp.controller('PersonListCtrl', function ($scope, $http) { $http.get('data/persons.json').success(function (data) { $scope.persons = data; }); $scope.persons = [{ "name": "Mike Doe" }, { "name": "Jhon Doe" }, { "name": "Sam Doe" }, { "name": "Sam Doe" }, ] }); I just want the two files to be separate for simplicity. Thanks. Is there an error in my controller code? Thanks. Search: {{person.name}} script(really both module and controller are separate Js files. I've included both for simplicity) var personApp = angular.module('personApp', []); personApp.controller('PersonListCtrl', function ($scope, $http) { $http.get('js/data.json').success(function (data) { $scope.persons = data; }); }); and this is the external json file located in js/data.json [{ "name": "Mike Doe" }, { "name": "Jhon Doe" }, { "name": "Sam Doe" }, { "name": "Sam Doe" }, ] The JSON won't parse if I use: personApp.controller('PersonListCtrl', function ($scope, $http) { $http.get('data/persons.json').success(function (data) { $scope.persons = JSON.parse(data); }); }); and I keep getting an error on the browser console: I think it's to do with the JSON PARSE in controller. SyntaxError: Unexpected token o at Object.parse (native) at http://172.31.1.17/js/controllers/controllers.js:229:31 at https://ajax.googleapis.com/ajax/libs/angularjs/1.3.6/angular.min.js:80:486 at https://ajax.googleapis.com/ajax/libs/angularjs/1.3.6/angular.min.js:111:425 at k.$eval (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.6/angular.min.js:125:305) at k.$digest (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.6/angular.min.js:122:398) at k.$apply (https://ajax.googleapis.com/…
downvote count: 0

http://stackoverflow.com/comment/45914558
type: QuestionComment
comment on: http://stackoverflow.com/q/28820989
has text: But is this client-side?
score: 0
type: Comment

http://stackoverflow.com/q/28891281
answer count: 0
score: 1
upvote count: 1
type: Question
tagged with: heroku
tagged with: javascript
downvote count: 0
favorite count: 0
has title: Force live users to expire assets for JS Web Apps
tagged with: angularjs
has body: Our web application is built on AngularJS and Ruby on Rails. Sometimes we find a bug in the JS and need to patch it immediately. We push up an update to Heroku and the new JS files are then live. However, users on the site (who are currently on the site) and do not refresh their page, are still using the old JS file. Is there a way to force refresh of the assets on deployment with Heroku? Or, is there a better way to handle this type of problem? I am thinking of using web sockets to possibly handle the scenario.
type: UnansweredQuestion
tagged with: ruby-on-rails

http://stackoverflow.com/q/28802874
possible better answer: http://stackoverflow.com/a/28826208
has comment: http://stackoverflow.com/comment/45894282
has title: Horizontal scrolling Marquee, My text insists on bunching together when function is acxtivated
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28826208
type: Question
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/45894106
accepted answer: http://stackoverflow.com/a/28803069
has body: So Im creating a vertically scrolling marquee, which uses javascript to alter the the top position of the text. A function runs at timed intervals creating the illusion of several groups of text moving vertically within the marquee from bottom to top and back again. Everything is working fine Except the groups of text insist of been bunched together at the top of the marquee. Can anybody offer advice ??? window.onload = defineMarquee; var timeID; var marqueeTxt = new Array(); var marqueeOff = true; var topPos= 20; /* defineMarquee() Initializes the contents of the marquee, determines the top style positions of each marquee item, and sets the onclick event handlers for the document */ function defineMarquee() { var topValue; var allElems = document.getElementsByTagName("*"); for(var i = 0; i &lt; allElems.length; i++){ if (allElems[i].className == "marqueeTxt") marqueeTxt.push(allElems[i]); } //Extract the "top" CSS class from marqueeTxt for(var i = 0; i &lt; marqueeTxt.length; i++){ if(marqueeTxt[i].getComputedStyle) { topValue = marqueeTxt[i].getPropertyValue("top") marqueeTxt[i].style.top = topValue +"px"; } else if (marqueeTxt[i].currentStyle) { topValue = marqueeTxt[i].currentStyle("top"); marqueeTxt[i].style.top = topValue +"px"; } } document.getElementById("startMarquee").onclick = startMarquee; document.getElementById("stopMarquee").onclick = stopMarquee; } /* startMarquee() Starts the marquee in motion */ function startMarquee() { if(marqueeOff == true) { timeID = setInterval("moveText()", 50); marqueeOff = false; } } /* stopMarquee() Stops the Marquee */ function stopMarquee() { clearInterval(timeID); marqueeOff = true; } /* moveText () move the text within the marquee in a vertical direction */ function moveText() { for(var i = 0; i &lt; marqueeTxt.length; i++) { if(marqueeTxt[i].getComputedStyle) { topPos = parseInt(marqueeTxt.getPropertyValue("top")); } else if(marqueeTxt[i].currentStyle) { topPos = parseInt(marqueeTxt.currentStyle("top")); } if(topPos &…
tagged with: javascript
has comment: http://stackoverflow.com/comment/45879440
has comment: http://stackoverflow.com/comment/45879536
has comment: http://stackoverflow.com/comment/45894268
has answer: http://stackoverflow.com/a/28803069

http://stackoverflow.com/comment/45900785
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28814377
has text: you also can get rid of the extra "block" created with the second level braces
type: Comment

http://stackoverflow.com/comment/45914532
score: 0
type: AnswerComment
has text: I see you're one step ahead of me.
type: Comment
comment on: http://stackoverflow.com/a/28815027

http://stackoverflow.com/q/28761104
has comment: http://stackoverflow.com/comment/45812303
has body: I'm developping a Bootstrap application inside the intranet of a company. The intranet is composed of a navbar made with Bootstrap and my application is included under this navbar. In the intranet both css and js bootstrap files are included and my app is included with the PHP command "include_once". I have made a simple button which trigger a modal dialog. It works perfectly but the events on open or close the modal don't work. When I include bootstrap.js in my application the events work : I created an event which show an alert when the modal is closed : &lt;script&gt; $('#myModal').on('hidden.bs.modal', function (e) { alert("closed"); }) &lt;/script&gt; When I use the close button or the close icon, the alert is displayed, but when I click outside of the modal, the modal is closed but I don't have the alert because I find out that this line was created twice : &lt;div class="modal-backdrop fade in"&gt;&lt;/div&gt; It seems that the bootstrap.js file, included in the general page is only half used and if I include mine, some things are done twice. Do you have a solution for that problem ?
score: 0
has comment: http://stackoverflow.com/comment/45802453
has title: Bootstrap modal doesn't work correctly with bootstrap.js
answer count: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/45802665
has comment: http://stackoverflow.com/comment/45802554
tagged with: bootstrap-modal
tagged with: javascript

http://stackoverflow.com/a/28835053
has body: Your if else clauses don't add up (so your script is generating a script error, most likely a syntax error). else{ xmlhttp.open("GET","getfacility.php?q="+account,true); xmlhttp.send(); } This piece doesn't have an IF to accompany it. This would be correct: if(account == ""){ return; } else { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200) { document.getElementById("facilities").innerHTML = xmlhttp.responseText; } } xmlhttp.open("GET","getfacility.php?q="+account,true); xmlhttp.send(); } On a sidenote: Why create a form wrapper around your select (the one that where you can load accounts) when you use an onchange event to fire an XmlHTTPRequest?
upvote count: 1
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/45940283
has comment: http://stackoverflow.com/comment/45940100
has comment: http://stackoverflow.com/comment/45940334
has comment: http://stackoverflow.com/comment/45939926
has comment: http://stackoverflow.com/comment/45940129
has comment: http://stackoverflow.com/comment/45939865
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28834982
answers question: http://stackoverflow.com/q/28834982

http://stackoverflow.com/a/28890436
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/46078010
score: 2
answers question: http://stackoverflow.com/q/28890280
has body: Depending on the complexity of the calculate function, I'd say the second option (key event trigger) is probably fine. If there's a lot of calculation going on then you might even want to consider a mixture of key-trigger and setTimeout like so: var keyTimeoutDelay; $('body').on('keyup paste', function(){ // Check if a timeout is set, and clear it if so... if(keyTimeoutDelay) clearTimeout( keyTimeoutDelay ); // Set a timeout to delay the processing by 500ms. keyTimeoutDelay = setTimeout(function(){ calculate(); }, 500); }); function calculate(){ // Complex calculation stuff } This code will run on keyup event and 'paste' but will only call the calculate() function if there was a delay of 500ms between pressing keys. You can try it out by running your finger along all the keys on your keyboard - the calculate() method will only get called once you stop 'typing'
downvote count: 0

http://stackoverflow.com/a/28885463
has comment: http://stackoverflow.com/comment/46033231
accepted answer of: http://stackoverflow.com/q/28884699
downvote count: 0
answers question: http://stackoverflow.com/q/28884699
has comment: http://stackoverflow.com/comment/46036659
has comment: http://stackoverflow.com/comment/46036141
has comment: http://stackoverflow.com/comment/46032705
has comment: http://stackoverflow.com/comment/46033322
has comment: http://stackoverflow.com/comment/46035573
has comment: http://stackoverflow.com/comment/46035419
type: AcceptedAnswer
score: 1
has body: You have a lot of duplication in your code, which is bad because each place that you duplicate means that you need to change it when you update the code, which means that there are more places for bugs to pop up later. To help, I placed in only one session_start(), and I converted the if/elseif/elseif/elseif... to a switch statement. Instead of dealing with the location headers themselves, I've replaced those with the http_redirect function, which basically does it for you. To boot, it encodes the URLs for you so you don't have to worry about that. If you keep seeing a blank page, then you should check the webserver's logs (apache or nginx or php-fpm, or whatever) to see if the errors are there. Otherwise, turn on better error reporting; quite often blank pages are just errors that haven't been reported. &lt;?php session_start(); include 'inc/connection.php'; $db = mysqli_connect($dbserver, $dbuser, $dbpass, $dbname) or die('DB connection error...'); $sanitized_username = mysqli_real_escape_string($db, $_POST['username']); $sanitized_password = mysqli_real_escape_string($db, $_POST['password']); $query = "SELECT password, salt, privilege, username FROM members WHERE username = '$sanitized_username'"; $result = mysqli_query($db, $query); if (mysqli_num_rows($result) == 0) { // User not found. Redirected to login page. http_redirect('login.php', array('message' =&gt; 'Username not found, please try again'), true); } $userData = mysqli_fetch_array($result, MYSQL_ASSOC); $hash = hash('sha256', $userData['salt'] . hash('sha256', $sanitized_password) ); if($hash != $userData['password']) { // Incorrect passw. Redirected to login page. http_redirect('error.php', array('message' =&gt; 'Wrong password, please try again'), true); } // Just set the username once $_SESSION['username'] = $userData['username']; switch ( $userData['privilege'] ) : case 'ADMIN': http_redirect('redirection.php', array('URL' =&gt; 'admins/index.php'), true); break; case 'MODERATOR' : http_redirect('r…
has comment: http://stackoverflow.com/comment/46032986
has comment: http://stackoverflow.com/comment/46032788
type: Answer
has comment: http://stackoverflow.com/comment/46033181
has comment: http://stackoverflow.com/comment/46032152
upvote count: 1

http://stackoverflow.com/comment/46082173
score: 0
type: Comment
has text: Again same thing.. Only solution that I am thinking as of now is adding id's to various elements. Here is the error NoSuchElementError: No element found using locator: By.xpath("//div[contains(@class, \"angular-ui-tree-handle\") and contains(., \"Business\")]")
type: AnswerComment
comment on: http://stackoverflow.com/a/28889025

http://stackoverflow.com/q/28764235
upvote count: 1
type: AnsweredQuestion
tagged with: kibana
score: 1
has answer: http://stackoverflow.com/a/28784871
has comment: http://stackoverflow.com/comment/45816826
type: Question
has title: Merge two filters in kibana3/elastic.js
tagged with: javascript
has body: I have two filters in my custom panel in Kibana3: request = request.query( $scope.ejs.FilteredQuery( boolQuery, filterSrv.getBoolFilter(filterSrv.ids()) // has to be merged with BoolFilter2 )) .size($scope.panel.size); This works for either of the two filters but I want to filter with the two objects but I dont know how to merge them. Can anyone help?
accepted answer: http://stackoverflow.com/a/28784871
answer count: 1
tagged with: elasticsearch
downvote count: 0
favorite count: 0

http://stackoverflow.com/q/28818289
answer count: 1
score: -1
favorite count: 0
has answer: http://stackoverflow.com/a/28818498
has title: fit youtube embed playlist on website
type: UnansweredQuestion
tagged with: css
tagged with: youtube
tagged with: playlist
downvote count: 1
type: Question
upvote count: 0
has body: I am trying to embed a youtube playlist within a div on a website. the videos have various sizes. Some of the videos contains black borders at the sides and some at the top and buttom. So how do I set the style so the videos have a consistent size without black borders. Can you point me to the right reference. Thanks
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/46029446
type: Comment
has text: Added the code which populates the dropdownlist.
type: QuestionComment
comment on: http://stackoverflow.com/q/28883433
score: 0

http://stackoverflow.com/comment/46048839
comment on: http://stackoverflow.com/q/28894322
has text: No, in short - JavaScript is evaluated at client side (in browser), ERB (html templating in Rails) is evaluated at server side. They are not directly connected.
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/a/28866219
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28865778
upvote count: 1
answers question: http://stackoverflow.com/q/28865778
has comment: http://stackoverflow.com/comment/46018039
has body: var myScope={}; (function(window) { function Module(){ console.log('new instance of Module'); }; Module.prototype.someFunction = function(){ }; window.myScope.Module = Module; }(window)); myModule = new myScope.Module(); Something like this?
score: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/45928900
has text: Yes, it's very important, because with Angular you can solve this problem in **one line** of code, because it already provides tool for string parsing and context resolution in `$parse` service.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28829245

http://stackoverflow.com/q/28767967
has body: I'm having very odd behavior with a jQuery plugin royalSlider. I know that at run time the function exists and is in the jQuery object. console.info(jQuery.fn.royalSlider); //function (b){var f=arguments;return this.each(function(){var =l(this);if("object"===typeof ||!b)c.data("royalSlider")||c.data("royalSlider",new (c,b));else if((c=c.data("royalSlider"))&amp;&amp;c[b])return [b].apply(c,Array.prototype.slice.call(f,1))})} However running directly under this console.info royalSlider function will return undefined: $('#rsGallery').royalSlider(this.options); //TypeError: $(...).royalSlider is not a function How is it that royalSlider is on the jQuery object but not a jQuery selector?
answer count: 0
has comment: http://stackoverflow.com/comment/45814712
type: Question
has comment: http://stackoverflow.com/comment/45814597
has comment: http://stackoverflow.com/comment/45842976
tagged with: javascript
tagged with: jquery
has title: jQuery Function exists but not bound to selector
score: 0
type: UnansweredQuestion
tagged with: plugins

http://stackoverflow.com/comment/45858583
comment on: http://stackoverflow.com/q/28791701
score: 0
type: Comment
type: QuestionComment
has text: Is there something wrong the way I read the JS file ? I am assuming the blank spaces or new lines.

http://stackoverflow.com/comment/45966096
score: 0
type: Comment
type: QuestionComment
has text: off course you can use multiple maps.
comment on: http://stackoverflow.com/q/28849267

http://stackoverflow.com/q/28887601
has body: In angular I have in a view a list of items which will be display in another view depending on whether they are checked or not. this is the view where you check which sports you want to display in the another view &lt;ion-item ng-repeat="sport in sports" ng-init="sport.checked = true" ng-click="sport.checked = !sport.checked"&gt; &lt;/ion-item&gt; this is the another view &lt;div ng-show="sport.checked" ng-repeat="sport in sports"&gt; {{sport.name}} &lt;/div&gt; as you see all those sports has an ng-init = sport.checked = true, so all the sports are shown at the beginning but you can unchecked those sports in order to don't see them until you checked it again. that's all I have so far and works, but once you refresh the page, all the checks and unchecks die, everything restarts after refreshing, so as you know I need to persist that data in a DB or something, I am using node.js/sails.js along with Redis for this. I have an idea of how to create almost everything in the node.js part, but I need some help in the Angular part with the controller and the service, so I need your help here. I want that the users are able to checked their sports only once, and not every time they log in on the app. So what functions can I add to the controller to advise to the service when a sport has been unchecked, and how the service will be receiving that data ? also, if you have any suggestions for the NodeJS part, that would be awesome too.
has comment: http://stackoverflow.com/comment/46036968
tagged with: node.js
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/46037139
score: 1
has title: Creating a controller/service to persist data, with information from the DOM
has comment: http://stackoverflow.com/comment/46036867
type: Question
has comment: http://stackoverflow.com/comment/46036545
tagged with: sails.js
has comment: http://stackoverflow.com/comment/46036767
tagged with: javascript
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/46036981
favorite count: 0
has comment: http://stackoverflow.com/comment/46036499
has answer: http://stackoverflow.com/a/28888061
accepted answer: http://stackoverflow.com/a/28888061
tagged with: angularjs
has comment: http://stackoverflow.com/comment/46037060

function-parameter
type: Tag
tag name: function-parameter
tags question: http://stackoverflow.com/q/28782297

http://stackoverflow.com/comment/46135753
type: QuestionComment
has text: You could add it as a static variable.
score: 0
comment on: http://stackoverflow.com/q/28901098
type: Comment

http://stackoverflow.com/comment/45906670
comment on: http://stackoverflow.com/a/28817183
type: AnswerComment
score: 0
type: Comment
has text: I know I can (and should) use packages. But for those cases where a package will be used on one page and not at the rest of the pages (I'm obviously talking about a multipage webapp), I think this is the way to go, at least for the landing.js script, since I don't want that code to be executed at other routes. Anyway, current problem is that the template is not being loaded. Even if the landing.js is placed at /lib/ or /client/ and I let its execution automatically, the template should be rendering now. So where is the problem?

http://stackoverflow.com/q/28768217
has comment: http://stackoverflow.com/comment/45817335
upvote count: 1
has answer: http://stackoverflow.com/a/28769843
accepted answer: http://stackoverflow.com/a/28769843
answer count: 1
tagged with: gulp
favorite count: 0
has comment: http://stackoverflow.com/comment/45816333
has comment: http://stackoverflow.com/comment/45815985
has comment: http://stackoverflow.com/comment/45817223
tagged with: node.js
has comment: http://stackoverflow.com/comment/45817198
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/45817635
score: 1
type: Question
has body: I have following project structure assets --javascripts ----controllers ------somefile.js ------somefile.js.coffee and I would like to compile coffescripts files (*.js.coffee) then concat all the files and then minify them. var gulp = require('gulp') var concat = require('gulp-concat') var coffee = require('gulp-coffee'); var uglify = require('gulp-uglify') var gulpFilter = require('gulp-filter'); gulp.task('scripts', function() { var coffeeScriptFilesFilter = gulpFilter(['*.js.coffee']); return gulp.src(['assets/javascripts/**/*']) .pipe(coffeeScriptFilesFilter) .pipe(coffee()) .pipe(coffeeScriptFilesFilter.restore()) .pipe(concat('application.js')) .pipe(gulp.dest('public')) .pipe(uglify().on('error', errorHandler)); function errorHandler (error) { console.log(error.toString()); this.emit('end'); } }); Unfortunately I am getting this error Error in plugin 'gulp-uglify' Message: /var/www/gulp/public/application.js: Unexpected token: operator (&gt;) Details: fileName: /var/www/gulp/public/application.js lineNumber: 3 Without uglify plugin everything works fine. The results is console.log('hello!'); var lol = 'asd!'; (function() { var test; test = function() { return "lol"; }; }).call(this); The uglify plugin probably is trying to compress .js.coffee file but I do not know exactly why. How can I fix it?
has comment: http://stackoverflow.com/comment/45817038
has title: How to use coffescript with uglify in gulp?
has comment: http://stackoverflow.com/comment/45817132
tagged with: javascript

http://stackoverflow.com/comment/45904168
has text: Could you please add your HTML and CSS to the question. A working example in http://jsfiddle.net wouldn't hurt either.
type: QuestionComment
comment on: http://stackoverflow.com/q/28816244
type: Comment
score: 1

http://stackoverflow.com/comment/45859894
type: Comment
type: QuestionComment
has text: aren't you supposed to just half it and do it in two go's ? n/2
comment on: http://stackoverflow.com/q/28792469
score: 0

http://stackoverflow.com/q/28849943
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45967307
upvote count: 4
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45967278
has body: I called ng-click like this: &lt;div ng-repeat="(key,value) in filterdata"&gt; &lt;div ng-click="filter(key,value)"&gt; {{key}} ::::::: {{value}} &lt;/div&gt; &lt;/div&gt; and my Controller function looks like this: $scope.filter = function(key,value){ $location.search(key, value); var filter = $location.url(); service.get(filter).success(function(data) { $scope.applicationdata = data.data; console.log($scope.applicationdata); }); } and my HTML file has ng-repeat like this: &lt;div class="resultsa" ng-repeat="data in applicationdata"&gt; {{data.name}}&lt;hr&gt; &lt;div ng-repeat="metadata in data.metadata"&gt; {{metadata.name}}&amp;nbsp;&amp;nbsp;,&amp;nbsp;&amp;nbsp;{{metadata.pivot.value}} &lt;hr&gt; &lt;/div&gt; &lt;/div&gt; The first time I click, my service function is called and my model is updated but my view doesn't update. When I click a second time, my view properly updates. Can anyone tell me why this happening?
type: Question
score: 3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45989661
tagged with: css
has answer: http://stackoverflow.com/a/41959734
has comment: http://stackoverflow.com/comment/45967252
tagged with: angularjs
answer count: 1
downvote count: 1
has title: ng-click requires two clicks for view to update

youtube-javascript-api
type: Tag
tags question: http://stackoverflow.com/q/28822315
tag name: youtube-javascript-api
tags question: http://stackoverflow.com/q/28819246

http://stackoverflow.com/comment/45867367
has text: Aren't you getting the expected result in the `data` variable? Have you looked at the Network tab to analyze the exact data being sent back? Also is the request pointing to the correct url?
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28796314
type: Comment

http://stackoverflow.com/q/28791725
has comment: http://stackoverflow.com/comment/45862952
tagged with: textarea
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28791766
accepted answer: http://stackoverflow.com/a/28791766
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45863215
linked to: http://stackoverflow.com/q/15458876
has comment: http://stackoverflow.com/comment/45865051
type: Question
possible better answer: http://stackoverflow.com/a/28791795
has body: I'm having a simple commenting system, where i want the user should not type any html special chars, if they done like that they should give an alert of "html tags not allowed". How to do it? while submitting, a ajax call is passed to another page to store it in db. So in the javascript itself(before ajax call), how to find is there any html tags in the entered comment. Any suggestion.
tagged with: javascript
tagged with: jquery
has title: check whether any html tags entered in textarea using javascript
tagged with: htmlspecialchars
score: 0
has answer: http://stackoverflow.com/a/28791795
answer count: 3
has answer: http://stackoverflow.com/a/72627749

http://stackoverflow.com/comment/45794767
score: 1
comment on: http://stackoverflow.com/a/28756755
type: AnswerComment
has text: Added an alternate way of doing this that uses the promise returned by `$.post()` rather than creating your own.
type: Comment

http://stackoverflow.com/comment/46048075
type: AnswerComment
has text: ok if your ip is alerting then it should be work where did you write our code ? did you write it inside the function ?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28893098

http://stackoverflow.com/a/29159951
has comment: http://stackoverflow.com/comment/46647415
score: 0
has comment: http://stackoverflow.com/comment/46629863
has comment: http://stackoverflow.com/comment/46585211
type: Answer
has body: What is your expectation when the image links are clicked? When routing for images, instead of changing the location, try doing something else with image. Load it via AJAX and append it to some element or so as per your expectation. // image files page(/^.+\.(jpg|png|gif|bmp)$/, function (context, next) { // Culprit // window.location = '/' + context.path; showImage('/' + context.path); }); Edit Use a non page.js link for images to allow browser to directly handle it. Example. The jsfiddle link does not work well because of server side routing, but if you copy back to your server it will work.
answers question: http://stackoverflow.com/q/28803379
has comment: http://stackoverflow.com/comment/46697712

http://stackoverflow.com/a/28894535
accepted answer of: http://stackoverflow.com/q/28894438
upvote count: 3
answers question: http://stackoverflow.com/q/28894438
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46049295
type: Answer
downvote count: 0
has body: There is a syntax error in your code. Also, your if statement does not match your textual description. Given your desired functionality, the if statement should be: if (cashOutTenure == 'NA' || cashOutTenure &gt;= 1) { $('.cash-out-tenure-error').addClass('hidden'); } else { $('.cash-out-tenure-error').removeClass('hidden'); } When you negate clauses in an OR or an AND expression, you need to be careful about comparison operators and also about changing OR to AND (and vice versa). Repeat DeMorgan's laws to freshen up on these concepts. Your original code: if(cashOutTenure != 'NA' || cashOutTenure &lt; 1) evalates to true any time that the value of cashOutTenure is something else than 'NA', which includes all numeric values. And another thing: Your error message does not match your description of the desired effect. This error message: Value can be 'NA' or greater than 1 ...implies that a value of 1 is not allowed. But your description says that anything less than 1 is an error. Think about the requirements carefully before writing code (or error messages)...
score: 3

http://stackoverflow.com/a/28893008
has body: You can do something like this $(document).ready(function(){ $('tr[data-name="background_colour"] input.wp-color-picker').on('keyup', function(){ $(this).closest('tr').siblings('tr[data-type="wysiwyg"]').find('iframe').contents().find('body').css({ background: $(this).val() }); }); }); Demo PS: Accessing stuff inside iframe can get very nasty.
has comment: http://stackoverflow.com/comment/46046524
accepted answer of: http://stackoverflow.com/q/28892839
has comment: http://stackoverflow.com/comment/46046506
has comment: http://stackoverflow.com/comment/46062789
upvote count: 1
has comment: http://stackoverflow.com/comment/46046543
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28892839

http://stackoverflow.com/comment/46015685
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28876845
type: QuestionComment
has text: If you add / (slash) at the begening of path, browser will search file in example.com/web/images/001.png

http://stackoverflow.com/comment/45817815
comment on: http://stackoverflow.com/a/28768335
type: AnswerComment
score: 0
has text: Thank you again, Cory! Worked like a champ!!
type: Comment

http://stackoverflow.com/q/28871732
has title: FileDrop.js & PHP from data not pass but pic correctly work
tagged with: javascript
tagged with: jquery
tagged with: file-upload
favorite count: 0
tagged with: filedrop.js
tagged with: php
answer count: 0
downvote count: 0
type: UnansweredQuestion
has body: I am trying to my select box data with picture in my php file using FileDrop.js when file uploaded. my code works correctly except passing select box value. my code: dropbox.filedrop({ paramname:'pic', data: { param1: function () { return $('#opt').value(); } }, maxfiles: 50, maxfilesize: 2, url: 'post_file.php', uploadFinished:function(i,file,response){ $.data(file).addClass('done'); }, afterAll: function() { location.reload(); }, error: function(err, file) { switch(err) { case 'BrowserNotSupported': showMessage('Your browser does not support HTML5 file uploads!'); break; case 'TooManyFiles': alert('Too many files! Please select '+maxfiles+' at most! (configurable)'); break; case 'FileTooLarge': alert(file.name+' is too large! Please upload files up to '+maxfilesize+' (configurable).'); break; default: break; } }, beforeEach: function(file){ if(!file.type.match(/^image\//)){ alert('Only images are allowed!'); return false; } }, uploadStarted:function(i, file, len){ createImage(file); }, progressUpdated: function(i, file, progress) { $.data(file).find('.progress').width(progress); } }); Also my php code to receive (testing) post data is $pic = $_FILES['pic']; $option = $_POST['param1']; print' '; print_r($pic); print' '; print' '; print_r($option); print' '; Here pic have value but param1 have not any value when script run. my html Image Information 1 2 Drop images here to upload. (MAX UPLOAD 50 IMAGE AT ONCE)
type: Question
score: 1
upvote count: 1

http://stackoverflow.com/comment/46040673
has text: Nop. You could create a decorator that you apply to every function manually, or you can loop prototype properties and extend the functions. But as a feature this doesn't exist.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28889823
score: 0

http://stackoverflow.com/comment/45833229
comment on: http://stackoverflow.com/a/28772571
score: 0
type: Comment
has text: service can be your own common class for your common functionsand get url can be the javascript that gets you the previous page url
type: AnswerComment

http://stackoverflow.com/a/28854810
answers question: http://stackoverflow.com/q/28796112
has comment: http://stackoverflow.com/comment/46100466
has comment: http://stackoverflow.com/comment/46190557
has comment: http://stackoverflow.com/comment/46189136
score: 0
has comment: http://stackoverflow.com/comment/46193821
has comment: http://stackoverflow.com/comment/45977659
type: Answer
has body: This is completely Out of the Box, but if all you need is to read the property, why don't you use outerHTML and get the value from there, something like: var a = document.getElementById('myDiv').outerHTML; var i = a.search('color:'); var e = a.lastIndexOf('"'); var result = a.substr(i+6,e - (i+6)); alert(result); Edit 1: As the previous answer didn't work, I tried some other alternatives, and the only way i was able to add something to the style tag and ie actually kept it was this: style="display:none; -ms-custom: test;" Edit 2 if you need to add a custom style that isn't stripped by IE, you add -ms- before it, only IE will read it since it's -ms so it's safe
has comment: http://stackoverflow.com/comment/46162416
has comment: http://stackoverflow.com/comment/46195506
upvote count: 1
downvote count: 1

http://stackoverflow.com/a/28866943
has comment: http://stackoverflow.com/comment/46269683
answers question: http://stackoverflow.com/q/28811139
has comment: http://stackoverflow.com/comment/46292660
has comment: http://stackoverflow.com/comment/46258744
type: AcceptedAnswer
downvote count: 0
has body: Instead of driving the text with a timer/counter, which you will have no guarantee will synchronize, you should use the currentTime property of the audio element. This will force correct time independent on start. The property returns current absolute time in fractional seconds. Use this time to check time range for the word to be highlighted. For example (just arbitrary times here as the original data is not available): var words = [ { id: "W10", // or use reference to element start: 0, // time in seconds end: 0.2, highlighted: false // to reduce DOM updates }, { id: "W11", start: 0.22, end: 0.4, highlighted: false }, ... etc. ... ]; Then in highlight: function highlight() { var time = a2.currentTime, i = 0, word; for(; word = words[i++];) { if (time >= word.start && time <= word.end) if (!word.highlighted) { word.highlighted = true; // to reduce the need to update DOM // ... set CSS for highlighted here... } } else if (word.highlighted) { // ... set CSS for not highlighted here... word.highlighted = false; } } } Live demo Try pausing it during play and you will see text is still able to sync when continued. // NOTE: these are not 100% synchronized - they are just for example var words = [ {id: "W10", start: 0, end: 0.7, highlighted: false}, {id: "W11", start: 0.76, end: 1.1, highlighted: false}, {id: "W12", start: 1.2, end: 1.3, highlighted: false}, {id: "W13", start: 1.4, end: 2.1, highlighted: false}, {id: "W14", start: 2.1, end: 2.3, highlighted: false}, {id: "W15", start: 2.3, end: 2.7, highlighted: false}, {id: "W16", start: 2.7, end: 3.0, highlighted: false}, {id: "W17", start: 3.0, end: 3.2, highlighted: false}, {id: "W18", start: 3.2, end: 3.4, highlighted: false}], audio = document.getElementById("a2"); audio.onplaying = highlight; function highlight() { var time = a2.currentTime, i = 0, word; for(; word = words[i++];) { if (time >= word.start && time < word.end) { if (!word.highlighted) { word.highlighted = true; // to reduce the need to update DOM docum…
score: 4
has comment: http://stackoverflow.com/comment/46258015
has comment: http://stackoverflow.com/comment/46252348
type: Answer
upvote count: 4
accepted answer of: http://stackoverflow.com/q/28811139
has comment: http://stackoverflow.com/comment/46254534
has comment: http://stackoverflow.com/comment/46253723
has comment: http://stackoverflow.com/comment/46005125

http://stackoverflow.com/q/28852189
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45974363
has title: Events not showing by id from mysql database
tagged with: fullcalendar
tagged with: mysql
has comment: http://stackoverflow.com/comment/46014898
has body: I have a list of buttons and each one is related to a person. When you click on a button, it goes to calendar.php?id=5 (id of the personnal) I would like it shows his/her calendar with the vacations registered to his/her id from mysql database. events.php report properly the events from my database but the calendar stays empty. How can I make it works please ? Currently it gets events like this: (calendar.php) <?php $getid = $_GET['id']; //echo $getid; ?> (events.php) <?php $getid = $_GET['id']; $json = array(); $requete = "SELECT id,title,start,end FROM absence WHERE id='$getid'"; $resultat = $bdd->query($requete) or die(print_r($bdd->errorInfo())); echo json_encode($resultat->fetchAll(PDO::FETCH_ASSOC)); ?> The response from events.php seems good. It shows this for id 37 as exemple : (http://localhost/planning/events.php?id=37) [{"id":"37","title":"CONGE PAYE","start":"2013-05-10 00:00:00","end":"2013-05-10 00:00:00"},{"id":"37","title":"CONGE PAYE","start":"2013-07-22 00:00:00","end":"2013-08-11 00:00:00"},{"id":"37","title":"CONGE PAYE","start":"2013-12-19 00:00:00","end":"2014-01-07 00:00:00"},{"id":"37","title":"CONGE PAYE","start":"2012-07-30 00:00:00","end":"2012-08-09 00:00:00"},{"id":"37","title":"CONGE PAYE","start":"2012-05-11 00:00:00","end":"2012-05-13 00:00:00"},{"id":"37","title":"CONGE PAYE","start":"2014-08-11 00:00:00","end":"2014-08-24 00:00:00"},{"id":"37","title":"CONGE PAYE","start":"2014-11-10 00:00:00","end":"2014-11-16 00:00:00"},{"id":"37","title":"CONGE PAYE","start":"2014-06-10 00:00:00","end":"2014-06-11 00:00:00"},{"id":"37","title":"CONGE PAYE","start":"2014-12-24 00:00:00","end":"2015-01-11 00:00:00"},{"id":"37","title":"CONGE SANS SOLDE","start":"2012-08-10 00:00:00","end":"2012-08-15 00:00:00"}] Sadly the calendar stays empty.
score: 0
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/28913226
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28877689
type: UnansweredQuestion
upvote count: 1
tagged with: php

http://stackoverflow.com/q/28827842
tagged with: javascript
has title: Why two or more spaces becomes one space in Javascript
has comment: http://stackoverflow.com/comment/45925974
tagged with: angularjs
score: 0
type: UnansweredQuestion
has body: I have created a simple HTML/JS/Angular script to demonstarte the problem I have faced. I have a work-around, but still wanted to post this question to the experts. &lt;body ng-app&gt; &lt;div ng-controller='abc'&gt; &lt;h1 ng-click='title= "A B C D EFGH";'&gt;{{title}} &lt;/h1&gt; &lt;/div&gt; &lt;/body&gt; Angualr Code: function abc($scope) { $scope.title = 'Hello World'; }; When Clciked on : continuous spaces in-side the string are replaced with single space. Output is "A B C D EFGH" Why is this happening?
has answer: http://stackoverflow.com/a/28828158
type: Question
has comment: http://stackoverflow.com/comment/45926129
answer count: 1

http://stackoverflow.com/comment/113299801
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28999075
has text: fails completely if your traffic is on ssl
score: 2

http://stackoverflow.com/a/28820891
has comment: http://stackoverflow.com/comment/81107878
score: 37
downvote count: 0
answers question: http://stackoverflow.com/q/28800094
type: Answer
has body: The first warning means when you are defining a component, the data option should look like this: module.exports = { data: function () { return { listing: [ { title: 'Listing title number one', description: 'Description 1' }, { title: 'Listing title number two', description: 'Description 2' } ] } } } Also, don't put ajax requests inside computed properties, since the computed getters gets evaluated every time you access that value.
upvote count: 37
has comment: http://stackoverflow.com/comment/74946196

http://stackoverflow.com/q/28849900
tagged with: asynchronous
favorite count: 0
possible better answer: http://stackoverflow.com/a/28850450
upvote count: 5
has answer: http://stackoverflow.com/a/28850022
accepted answer: http://stackoverflow.com/a/28850022
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45967198
has body: I am trying to create a route in Node.js/Express that reads data from two queries and then increments a count based on that data from the queires. Since Node.js is asynchronous my total is displayed before all the data has been read. I created a simple example that gets to the point of what I am currently doing var express = require('express'); var router = express.Router(); var total = 0; /* GET home page. */ router.get('/', function(req, res, next) { increment(3); increment(2); console.log(total); res.end(); }); var increment = function(n){ //Wait for n seconds before incrementing total n times setTimeout(function(){ for(i = 0; i &lt; n; i++){ total++; } }, n *1000); }; module.exports = router; I'm not sure what I would have to do in order to wait until both functions finish before I print the total. Would I have to create a custom Event Emitter to achieve this?
type: Question
has answer: http://stackoverflow.com/a/28850450
answer count: 2
score: 5
downvote count: 0
has title: How to wait for function to finish before continuning in Node.js
tagged with: javascript

http://stackoverflow.com/q/28779791
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28903136
favorite count: 0
has answer: http://stackoverflow.com/a/28817731
possible better answer: http://stackoverflow.com/a/28780006
has title: How can I do a form submit on ENTER when I have multiple possible submit buttons?
upvote count: 6
answer count: 4
tagged with: angularjs
linked to: http://stackoverflow.com/q/15687921
score: 6
accepted answer: http://stackoverflow.com/a/28817731
has comment: http://stackoverflow.com/comment/46047673
type: AnsweredQuestion
has body: I have an unusual problem. My form loos like this: View Acquire What I need is for the enter key to trigger the action of the current button primary. Note that the button primary can be one of two buttons depending on the state of other items on the page. Can anyone suggest how this could be done? I saw reference to the ng-enter directive but if possible I think it would be better for me not to use non-standard directives. Here is what I have tried so far. Unfortunately when I click enter nothing happens: View Acquire
type: Question
has answer: http://stackoverflow.com/a/28815296
has answer: http://stackoverflow.com/a/28780006

http://stackoverflow.com/q/28841280
possible better answer: http://stackoverflow.com/a/28841319
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28841327
has answer: http://stackoverflow.com/a/28841319
type: Question
linked to: http://stackoverflow.com/q/17863986
has body: A have an image address of my IP cam: snapshot.cgi?user=#USERNAME&amp;pwd=#PASSWORD I need to put those two variables below in place #USERNAME and #PASSWORD: var user = "test"; var pass = "test"; Finish result must be: snapshot.cgi?user=test&amp;pwd=test I know there is a way to do that but i don't know how. The address of image need to stay exactly like it is as I am getting this from external source.
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28841329
has answer: http://stackoverflow.com/a/28841327
has comment: http://stackoverflow.com/comment/45951697
has title: Put variable into url
answer count: 4
has answer: http://stackoverflow.com/a/28841338

http://stackoverflow.com/comment/45908606
comment on: http://stackoverflow.com/a/28817183
score: 0
type: AnswerComment
has text: hmm weird i never use the `isClient` a before, what happened on this **2 thing first** put the `this.next();` at the very bottom of the `onBeforeAction` and **second** escenario if you put `this.next();` inside the rendered did you get the warning console "did you forget to call this.next();'
type: Comment

http://stackoverflow.com/comment/108955585
score: 8
has text: @DanMan It's called [computed properties](https://developer.mozilla.org/pt-PT/docs/Web/JavaScript/Reference/Operators/Object_initializer#Computed_property_names) and it's a feature of object literals.
comment on: http://stackoverflow.com/a/28770578
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28786244
tagged with: angularjs
has title: Call method from another ng-app in angular js
has body: I have 2 ng-app block on same page. One for listing items, and the other one is for insert. I want to call listing function after I have finished insert. I have tried something but I couldn't succeeded in. I found some documents about calling functions on same ng-app but i need to call a function from another ng-app. Here is my code, please help. Search : First Name Middle Name {{ u.FirstName }} {{ u.MiddleName }} First Name : Middle Name : Save Thank you for all your help...
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/45848693
upvote count: 1
has comment: http://stackoverflow.com/comment/45849157
has comment: http://stackoverflow.com/comment/45848738
has answer: http://stackoverflow.com/a/44327537
type: Question
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/45848843
has comment: http://stackoverflow.com/comment/45848906
tagged with: javascript
tagged with: angularjs-scope
answer count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/45849435

http://stackoverflow.com/comment/45873074
comment on: http://stackoverflow.com/a/28791667
score: 0
type: AnswerComment
type: Comment
has text: I don't understand why it dosnt work on the checkbox im working on and why I would need a set interval or another element like a button. the value should solely depend on the checkbox.

http://stackoverflow.com/comment/45839970
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28763752
score: 0
has text: not an answer to your question but you might be interested in this. https://github.com/greggman/requestanimationframe-fix.js

http://stackoverflow.com/q/28800039
type: AnsweredQuestion
tagged with: if-statement
has comment: http://stackoverflow.com/comment/45874188
has title: Button in if loop
has answer: http://stackoverflow.com/a/28800089
type: Question
tagged with: button
tagged with: javascript
score: 0
has body: I'm working on a trivia code in javascript/html for a class i am taking, and when you press the correct button, i want an image of a check mark to show up. Right now, for my check mark i am using the "opacity" trait: and then later i wanted to add that if you click the right button, the opacity would change from O to 1 (if you know a better way than this that's fine, I'm totally okay with changing that). My question: How can i say "if this button is clicked, then change the opacity to 1/put this image on the webpage. else console log try again." Help? Also, here is an example of the html i have right now: where is the atacama desert located? South America Africa Canada Russia
tagged with: http://stackoverflow.com/tag/html
answer count: 1
accepted answer: http://stackoverflow.com/a/28800089
tagged with: css
favorite count: 0
upvote count: 1
has comment: http://stackoverflow.com/comment/45874079
downvote count: 1

http://stackoverflow.com/q/28822131
has comment: http://stackoverflow.com/comment/46001045
type: UnansweredQuestion
has body: I inherited a large framework (my employer purchased a product) that uses ASP.Net modules (.ascx files loaded dynamically by Default.aspx). The product did not, of course, come with its tests (at least, I assume the product has tests). Because the ASP.Net postback client-side experience is awful, I've started adding more modern, Javascript-heavy functionality both to the existing modules, and in the new ones I create. Due to how the system works I really cannot move away from the module-driven framework currently in place into an MVC setup. I'm looking for a test framework that can access both the browser and the back-end framework. I think I've come up with a set of requirements for this framework/combination of frameworks: MUST handle navigation to multiple pages (wizard-like behavior). MUST handle new window popups. MUST handle DOM manipulation via Javascript (showing/hiding elements). MUST emulate mouse/keyboard input on pages. MUST be able to query/validate Javascript variable states. MUST be able to query/validate back-end SQL Server. MAY be able to query/validate back-end ASP.Net state. (Nice to have.) Ideally it would have integration with VS's Test Explorer, but that's not a hard-and-fast requirement. Does such a framework exist? The google searching I've done has come up with plenty for single-page Javascript-driven sites, MVC sites, and plain ASP.Net sites without pretty Javascript, but I've had a hard time finding (or recognizing) a framework to fit my needs.
type: Question
tagged with: functional-testing
tagged with: c#
has comment: http://stackoverflow.com/comment/46000971
tagged with: javascript
has title: Testing framework for ASP.Net modules + Javascript
has comment: http://stackoverflow.com/comment/45916683
score: 0
has comment: http://stackoverflow.com/comment/46001251
tagged with: asp.net
answer count: 0

http://stackoverflow.com/a/28885574
type: Answer
upvote count: 2
score: 2
has body: I think you can do: $('#fileuploader1').next().next('.ajax-file-upload-statusbar').remove();
downvote count: 0
answers question: http://stackoverflow.com/q/28884504

http://stackoverflow.com/comment/105804563
score: 0
comment on: http://stackoverflow.com/a/52438302
has text: It's not working, it actually messes with the navigation flow.
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28773821
has body: I don't have access to a dev environment, but have you tried setting a empty url for your 'accounts.create' state ? That's how they do it here: https://angular-ui.github.io/ui-router/sample/#/contacts Here's the source code (look for the "contacts.list" state): https://angular-ui.github.io/ui-router/sample/app/contacts/contacts.js Hope that helps.
answers question: http://stackoverflow.com/q/28773563
score: 0
has comment: http://stackoverflow.com/comment/45826943
type: Answer

http://stackoverflow.com/comment/46026751
score: 0
comment on: http://stackoverflow.com/q/28882585
has text: @maurycy worked like a charm thank you please provide an answer so i can accept it :D
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46536919
comment on: http://stackoverflow.com/q/28759015
type: Comment
type: QuestionComment
has text: I'll try to recreate the effect in a page / find another example which is public. With Ember, ExtJS, etc, it is not uncommon to have things which are don't have unique IDs to target with css/xpath. As the IDs/classes can be generated dynamically, each page load can be different if number of elements changes by 1.
score: 0

http://stackoverflow.com/comment/45964131
score: 0
type: Comment
type: QuestionComment
has text: @Pratik yes... then when is the error coming
comment on: http://stackoverflow.com/q/28847999

http://stackoverflow.com/comment/46035844
score: 0
type: Comment
has text: there is no error or warning, when I try to enlarge the text in browser, nothing happens
comment on: http://stackoverflow.com/a/28884678
type: AnswerComment

http://stackoverflow.com/a/28777364
has comment: http://stackoverflow.com/comment/45999134
has comment: http://stackoverflow.com/comment/45850634
has comment: http://stackoverflow.com/comment/45850550
has comment: http://stackoverflow.com/comment/45875707
has body: Ok first I'm just going to say I am learning React and Flux at the moment and am by no means an expert. However I'm going to give it a shot anyway: From what you have said, it sounds like you have 2 asynchronous operations triggering off and then when they return trying to send dispatch messages The issue arising from the dispatch call being triggered twice from 2 independent aync webservice calls. I don't think batching the updates would help in this case as it would depend heavily on timing(ie. if it has queued the re-render and is waiting for the opportunity to execute when the 2nd call comes in it could batch successfully, however if it comes in mid-update you are in the exactly the same situation place you are now). I think the actual issue here is coming from how/when these Actions are being triggered(you mention this briefly at the end of your post). It sounds like you are triggering Actions from the React component Render calls(kind of like lazy loading). This is pretty much exactly the thing Flux is trying to avoid, as that is a pattern that could easily result in an infinite loop or weird states/patterns in the flow of the application. As you mentioned in your description you probably need to trigger this loading up front instead of from the individual components, from the little I know I would suggest that needs to be done prior to calling React.render on your core component. If you look in the example chat app they do a similar thing in app.js: ChatExampleData.init(); // load example data into localstorage ChatWebAPIUtils.getAllMessages(); React.render( &lt;ChatApp /&gt;, document.getElementById('react') ); So I would suggest following the above pattern, loading any initial data up front while showing a loading spinner to the client. Alternatively, depending on your tech stack you could render initially on the server (node example here .Net version at ReactJS.Net) so you don't have that delay while the client side boots up(also you avoid all the funny bu…
has comment: http://stackoverflow.com/comment/45874256
score: 0
has comment: http://stackoverflow.com/comment/45874063
type: Answer
has comment: http://stackoverflow.com/comment/45850473
answers question: http://stackoverflow.com/q/28759728

http://stackoverflow.com/q/28839134
possible better answer: http://stackoverflow.com/a/28839224
has comment: http://stackoverflow.com/comment/45947565
has answer: http://stackoverflow.com/a/28839224
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28839320
has answer: http://stackoverflow.com/a/28839261
tagged with: css
has title: Javascript doesn't seem to unhide my element
type: AnsweredQuestion
has body: I have made the following code in jsfiddle, and if I check the checkbox, the div Nime should be unhidden and vice versa , but it is not happening, what am I doing wrong? Code in JSfiddle: Html: Newspaper? How? Email Post Both Javascript: function change(){ which = document.getElementById('nime'); if(which.style.display=="block"){ which.style.display="none"; }else{ which.style.display="block"; } };
linked to: http://stackoverflow.com/q/5468350
type: Question
has answer: http://stackoverflow.com/a/28840641
has answer: http://stackoverflow.com/a/28840688
linked to: http://stackoverflow.com/q/2336280
tagged with: javascript
has answer: http://stackoverflow.com/a/28839368
has answer: http://stackoverflow.com/a/28839189
score: 0
upvote count: 1
downvote count: 1
answer count: 7
accepted answer: http://stackoverflow.com/a/28839261
has comment: http://stackoverflow.com/comment/45948007
favorite count: 0

http://stackoverflow.com/a/28775769
downvote count: 0
has body: Put appropriate data in the submit buttons: View Post Delete checked posts Test to see which of the two submit button names appears in the submitted data. If it is view_post then ignore the checkbox data and just view the post. Otherwise, loop over the checkbox values and delete away.
has comment: http://stackoverflow.com/comment/45829923
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/28775638
has comment: http://stackoverflow.com/comment/45830502
accepted answer of: http://stackoverflow.com/q/28775638
type: AcceptedAnswer

http://stackoverflow.com/comment/46030868
score: 0
type: QuestionComment
has text: `Third` use the [switch](http://php.net/manual/en/control-structures.switch.php) statement, instead of these cumbersome `if/else`s
type: Comment
comment on: http://stackoverflow.com/q/28884699

plot
tags question: http://stackoverflow.com/q/28820906
tag name: plot
type: Tag

http://stackoverflow.com/comment/46000502
score: 0
type: AnswerComment
type: Comment
has text: Oh i thought you can just set it to whatever you want. fixed it and now working, thanks man! By the way, is there any way to error check when using a form? Like if I type in a -1 in the price can I use an alert to say "Enter a positive number" then have them re-enter?
comment on: http://stackoverflow.com/a/28867421

http://stackoverflow.com/q/28814438
answer count: 1
has title: Random behaviour of SWF loading
tagged with: actionscript-3
has comment: http://stackoverflow.com/comment/45932103
has comment: http://stackoverflow.com/comment/45906673
type: AnsweredQuestion
has body: I have a really strange behiavour with the loading of a SWF file: the buttons on it are working on the first load, but if I reload the page they don't work anymore, even if I empty my cache or force SWF reload by appending a random parameter at the end of the URL. The buttons are generated from a XML file called in the init function. Here is how I call my swf : &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"&gt;&lt;/script &lt;script type="text/javascript"&gt; // &lt;![CDATA[ window.onload=function(){ var _time = (new Date()).getTime(); var params = {wmode: "transparent", src: "http://www.mywebsite.com/sites/default/files/medias/map/monde.swf?" + _time}; var flashvars = {site: "/fr"}; swfobject.embedSWF("http://www.mywebsite.com/sites/default/files/medias/map/monde.swf?" + _time, "flashContent", 920, 450, "10", false, flashvars, params); }; // ]]&gt; &lt;/script&gt; &lt;div id="flashContent"&gt;&amp;nbsp;&lt;/div&gt; The only way to get the buttons back is to edit the source in Firebug, change the SWF URL with something random and change it back so the URL is loaded again (it's not working on the first try, I have to do it few times before it works). I don't have any cache on the SWF and on the XML I'm calling from AS3, so I don't understand how I can have such a random behaviour : Here is the relevant parts of the AS3 script : private function init(e:Event = null):void { removeEventListener(Event.ADDED_TO_STAGE, init); var site:String = ""; if (this.loaderInfo.parameters.site != undefined) site = this.loaderInfo.parameters.site; _uLoader = new URLLoader(); _uLoader.addEventListener(Event.COMPLETE, _initMap); var httpHeader : URLRequestHeader = new URLRequestHeader("pragma", "no-cache"); var httpRequest : URLRequest = new URLRequest(site+"/ajax/mywebsite_tools/list_master"); httpRequest.requestHeaders.push(httpHeader); httpRequest.method = URLRequestMethod.GET; httpRequest.data = new URLVariables("time="+Number…
has answer: http://stackoverflow.com/a/29128481
type: Question
tagged with: flash
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45924491
accepted answer: http://stackoverflow.com/a/29128481

http://stackoverflow.com/comment/45902627
type: AnswerComment
has text: Thank you, this was exactly what was happening, I had an object with count & some other values.
type: Comment
comment on: http://stackoverflow.com/a/28814638
score: 0

http://stackoverflow.com/comment/46026352
has text: But you load 2 jquery.js, and its make the page error. ` ` (at bottom of page) and ` ` (at top page, inside head tag). place the `$(document).ready` code after you load the jquery.js. and also choice one jquery.js load.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28881707
type: Comment

http://stackoverflow.com/comment/46064504
score: 0
type: Comment
type: QuestionComment
has text: Failed to provide relevant code **-1**
comment on: http://stackoverflow.com/q/28902465

http://stackoverflow.com/a/28857006
has comment: http://stackoverflow.com/comment/45990789
has body: Traditionally, JavaScript animation can be handled a number of ways. One approach involves using a timing function such as setTimeout or setInterval to adjust styling every couple milliseconds. Another approach creates a loop that changes styling as many times as possible along the animation’s time frame. The logic of both of these approaches is to throw a large number of animation frames at the browser, so that it hopefully renders smooth-looking motion. So, even though the browser renders as many frames of the animation as possible, the dropped frames still make for a choppy-looking animation, which is not to mention the performance implications of overloading the processor with as many tasks as possible. In reality, it’s actually better to render fewer frames, provided they are rendered consistently. That’s because our eyes pick up these subtle variations, and a few dropped frames tend to stick out more than an overall lower frame rate. That’s where HTML5′s requestAnimationFrame API comes in. Here is an example for your scenario: function animation(){ var visible = $('#container img:visible'); var next = visible.next('img'); if(next.length &lt;= 0) next = $('#container img:first'); next.show(); visible.hide(); }; setInterval(function() { window.requestAnimationFrame(animation); }, 64); DEMO
upvote count: 1
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28844386
type: Answer

http://stackoverflow.com/q/28880331
has comment: http://stackoverflow.com/comment/46022898
has body: When you fully setup your Custom infowindow, you can set whatever content you wanted. However, I am talking about the businesses that google map v3 initially added. How do I go about adjust the default infowindows of varies businesses? Like add pictures, stars OR HIDE them all? Any examples would be greatly appreciated! EDIT: First Example showing that it can be adjusted Booking.com: Second Example to hide all of them: Redfin.com How to adjust for google map defaults? Please help me out! How do I do both? Hide &amp; add pictures, stars etc to Default infowindow of google map v3?
tagged with: google-maps
has comment: http://stackoverflow.com/comment/46023822
has comment: http://stackoverflow.com/comment/46023976
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/46024457
favorite count: 0
has comment: http://stackoverflow.com/comment/46022150
has comment: http://stackoverflow.com/comment/46024946
has answer: http://stackoverflow.com/a/28881971
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46025213
downvote count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/46022671
type: Question
has title: Customize Google map V3 infowindow of defaults
has comment: http://stackoverflow.com/comment/46022398
has comment: http://stackoverflow.com/comment/46022330
has comment: http://stackoverflow.com/comment/46024191
linked to: http://stackoverflow.com/q/24234106
score: -1
accepted answer: http://stackoverflow.com/a/28881971
tagged with: google-maps-api-3

http://stackoverflow.com/q/28786664
has answer: http://stackoverflow.com/a/28787338
favorite count: 0
tagged with: ajax
has title: Convert basic like function to ajax request
type: UnansweredQuestion
tagged with: php
tagged with: laravel
downvote count: 0
score: 1
has body: I have this very basic like function in my app but its not how i want it to be because every time i click the button it reloads the page, so i want to translate this codes to ajax request. but i dont know javascript or jquery. in my Views.blade.php $posts->id)) }}" class="like">Like and my routes Route::get('like{id}', array( 'uses' => 'LoginUsersController@like', 'as' => 'like' )); and my controller public function like($id) { $post = Post::findOrFail($id); $post->likes++; $post->save(); return Redirect::back(); } im hoping that someone can show me how this is done in ajax request.
type: Question
tagged with: javascript
upvote count: 1
answer count: 1

http://stackoverflow.com/a/28783127
has comment: http://stackoverflow.com/comment/45842761
accepted answer of: http://stackoverflow.com/q/28783050
type: Answer
answers question: http://stackoverflow.com/q/28783050
upvote count: 3
has body: Your custom function is working correctly. What isn't working is your replace function. Your replace function isn't case-insensitive. $(this).html(function(_, html){ return html.replace( new RegExp("("+ q + ")", "ig"), // make a regex with capturing group "$1" // replace with the captured group ); }); The flags i and g are there to tell the engine to match case-insensitively and more than once, if available, respectively. We are then capturing it in group 1, which we use in replace string as $1 DEMO
score: 3
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/28833397
score: 1
has body: You need to specify the layout property and also make a wrapping container for both of those items as currently is ould assume it is of time texfield as you have that set for the defaultType items: [{ xtype: 'container', layout: "hbox", items: [{ items: { fieldLabel: "Representante", xtype: "textfield", name: 'representante' } }, { items: { xtype: 'button', text: 'Click me' } }] }, { fieldLabel: 'Aprobador', name: 'aprobador' }, { xtype: 'datefield', fieldLabel: 'Fecha', name: 'fecha_doc', value: new Date(), //Fecha de hoy maxValue: new Date() //Máxima fecha la de hoy }] Demo: https://fiddle.sencha.com/#fiddle/j2l
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28831815
answers question: http://stackoverflow.com/q/28831815
upvote count: 1

http://stackoverflow.com/a/28876351
type: Answer
has body: Append mode : 'local' to combo config. It's possible to use combobox with array instead of store (http://docs.sencha.com/extjs/3.4.0/#!/api/Ext.form.ComboBox-cfg-store)
score: 0
answers question: http://stackoverflow.com/q/28871540

http://stackoverflow.com/q/28851913
has comment: http://stackoverflow.com/comment/45971655
tagged with: angularjs
has title: Angular UI modal POST
has comment: http://stackoverflow.com/comment/45970926
has comment: http://stackoverflow.com/comment/45970999
has answer: http://stackoverflow.com/a/32276937
has comment: http://stackoverflow.com/comment/45970891
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/32276937
has comment: http://stackoverflow.com/comment/45971043
has comment: http://stackoverflow.com/comment/45971059
type: Question
has comment: http://stackoverflow.com/comment/45971210
has comment: http://stackoverflow.com/comment/45971454
has comment: http://stackoverflow.com/comment/45970775
tagged with: javascript
has body: I'm trying to load angular-ui modal but I can't find any information how to pass POST parameters to specified templateUrl url? var options = { controller: 'ModalInstance', backdrop: true, scope: $scope, size: ( typeof $element.data('size') != 'undefined' ) ? $element.data('size') : 'sm', backdropClass: backdrop, templateUrl: 'some url', data: { // needs to be replaced | this one is not working. media_id: 59 }, resolve: { element: function(){ return $element; } } }; $scope.instance = $modal.open( options ); If there is no any official ways, how can I do it without get parameters?
score: 0
answer count: 1

http://stackoverflow.com/a/28897095
has comment: http://stackoverflow.com/comment/46054266
answers question: http://stackoverflow.com/q/28896931
score: 0
has comment: http://stackoverflow.com/comment/46055049
type: Answer
has body: You could use the Object.keys method, to loop through keys of json1, and if key is not found in json2, set it to a blank string. e.g. var keys1 = Object.keys(json1); for (var key_i=0; key_i&lt;keys1.length; key_i++) { var key = keys1[key_i]; if (typeof json2[key] === 'undefined') { json2[key] = ''; } } Edit: If you want to copy over values from json1 to json2, if not in json2, then change: json2[key] = ''; to json2[key] = json1[key];

http://stackoverflow.com/comment/45975287
type: Comment
has text: view-source: http://etc... i need to learn how to tag code in these chats still ' body { display: block } test '
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28854344

http://stackoverflow.com/a/28801678
has body: Your not using the correct id of your &lt;div&gt;, Try this : document.getElementById("div1").style.display="initial";
has comment: http://stackoverflow.com/comment/45877262
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28801631

http://stackoverflow.com/comment/45985431
has text: it's seem the problem in this section ````angular .module('blocks.states') .factory('statehelper',statehelper); statehelper.$inject = ['$location', '$rootScope', 'logger', 'statehelperConfig','$injector'];````
comment on: http://stackoverflow.com/q/28856063
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28802850
type: Answer
score: 2
upvote count: 2
has body: Try this: var match = (location.search.match(/(\w+|\w+\/)$/)) ? location.search.match(/(\w+|\w+\/)$/))[0] : "";
answers question: http://stackoverflow.com/q/28802772
downvote count: 0

http://stackoverflow.com/comment/45879340
type: Comment
has text: Thanks for your interest @jdphenix and @Jack, but the question doesn't (or at least shouldn't) give any indication for a desire to detect divisions by zero. As stated as the first point under Assumptions, no equation will have a division by zero (I believe that includes evaluated zeros, `sin(0)`, `cos(1)`, etc.). In other words, *zero will only show up in the dividend of a division operation* `(0/x)`. Sorry if that wasn't clear...
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28802489

http://stackoverflow.com/comment/45901404
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28814169
has text: Ok Great, thanks I see it now, well pointed out, I'am Editing my answer.
type: AnswerComment

http://stackoverflow.com/q/28813103
tagged with: meteor
favorite count: 0
has body: Learning Meteor, I'm still getting stuck in conceptual quagmires. I have a collection in which each item has an array called "props" that holds zero or more property names: loudmouth, fixer, networker, outcast, etc. I also have a collection of property objects, each of which is associated with a single glyph-icon. Right now, my template displays the data items as an unordered list of lines that include the property identifiers. I want to replace the property identifiers with the corresponding icon HTML {name: "loudmouth", icon: "bullhorn", other: "rtgb"} {name: "fixer", icon: "wrench", other: "iun"} {name: "networker", icon: "link", other: "retf"} {name: "outcast", icon: "ban-circle", other: "vcfdds"} So this ... AAA loudmouth fixer outcast BBB fixer networker ... should become this ... AAA BBB This is not a SQL join; I'm adding attributes to each returned result item. What's the best way to do it? I tried a couple of ways, but they got really messy. 1) The first was a crude inner/outer loop job in the client. For each data item in the outer, I'd append tags concatenated from strings from the inner loop. This seemed to give me some kind of race condition, with spurious "undefined"s. (I'm not yet clear about its sychronicity rules). Should I pre-fetch the properties collection into a name/value map object? Also, strangely, my HTML showed the text of the tags rather than icons?!?! Huh? 2) I then tried doing it on the server-side using Meteor.method and Meteor.call. I could not get data back synchronously, and don't really understand how one populates a template asychronously (from a callback). Do you populate an array during Template.mine.created() and then return the array from a Template.mine.helper? Am I right that the Meteor.method / Meteor.call combination is supposed to be used for altering back-end data, NOT for retrieving back-end data? Does anyone know of a good tutorial about this kind of thing? How would you do it? I hope this won't get rejected as 'opinion…
type: UnansweredQuestion
upvote count: 1
tagged with: conceptual
score: 1
type: Question
has answer: http://stackoverflow.com/a/28814678
has title: Meteor : best practice for modifying Mongo query result before template takes it?
tagged with: mongodb
answer count: 2
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28814752
tagged with: templates

http://stackoverflow.com/q/28751384
has title: How may I delete using Titanium with Alloy Framework?
tagged with: sql-delete
possible better answer: http://stackoverflow.com/a/28775301
has answer: http://stackoverflow.com/a/28775301
tagged with: javascript
has answer: http://stackoverflow.com/a/30400748
type: AnsweredQuestion
downvote count: 0
score: 1
favorite count: 0
type: Question
has body: I am trying to delete only one record using Alloy framework: I created in my controller .js this code to show the variables I got from a ListView: var args = arguments[0] || {}; $.titleLabel.text = args.titulo || 'Default Title'; $.authorLabel.text = args.author || 'Default Author'; And I have created this function for deleting: function deleteBook(){ var books = Alloy.createCollection('books'); // The table name is the same as the collection_name value from the 'config.adapter' object. This may be different from the model name. var table = books.config.adapter.collection_name; // use a simple query books.fetch({query:'Delete from ' + table + ' where titulo="' + args.titulo + '"'}); } And I invoke the function with a button, however I get this error: [ERROR] : TiExceptionHandler: (main) [359476,359476] ----- Titanium Javascript Runtime Error ----- [ERROR] : TiExceptionHandler: (main) [0,359476] - In alloy/sync/sql.js:1,69 [ERROR] : TiExceptionHandler: (main) [0,359476] - Message: Uncaught TypeError: Cannot call method 'isValidRow' of null [ERROR] : TiExceptionHandler: (main) [0,359476] - Source: (o)?r.execute(o):r.execute(o.statement,o.params);for(var c=0,u=[];d.isValidRow [ERROR] : V8Exception: Exception occurred at alloy/sync/sql.js:1: Uncaught TypeError: Cannot call method 'isValidRow' of null I just want to be able for deleting records from my db.
answer count: 2
tagged with: android
tagged with: titanium
upvote count: 1
accepted answer: http://stackoverflow.com/a/30400748
tagged with: titanium-alloy

http://stackoverflow.com/q/28853219
has body: I'm trying load json file (from localhost) named questions.json by function: function loadJson() { $.ajax({ dataType: "json", url: "questions.json", succes: function() { console.log("ajax succes"); }, error: function(object, error, errorThrow) { console.log("ajax fail"); console.log(object); console.log(error); console.log(errorThrow); } }); } and i run function in my script $(document).ready(loadJson()); In developer tools in Google Chrome looks everything OK (Status Code 200, preview shows valid json...), but console.log in both functions (succes and error) dont't write nothing. There aren't any other error messages. If I change dataType to nonsense, function in error is fired. What could be wrong?
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45973191
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45972917
type: UnansweredQuestion
has title: jQuery.ajax() don't fire handlers
tagged with: javascript
tagged with: jquery
tagged with: ajax
type: Question
has comment: http://stackoverflow.com/comment/45972909
has comment: http://stackoverflow.com/comment/45972807
has answer: http://stackoverflow.com/a/28853310

http://stackoverflow.com/comment/45902101
has text: @BenjaminGruenbaum Yeah it is bad but I tried to preserve OP's code. null doesn't make much sense, you're right, I've fixed it now.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28803864

http://stackoverflow.com/comment/45904813
type: QuestionComment
has text: @BVernon this was your problem , why do you find it necessary to insult others ?? Spirit of this site is to help those that are willing to accept help
score: 2
type: Comment
comment on: http://stackoverflow.com/q/28816317

http://stackoverflow.com/a/28822916
has body: You need to reference jquery library for the slide out effect checkout this Jsfiddler
has comment: http://stackoverflow.com/comment/45917270
answers question: http://stackoverflow.com/q/28822852
has comment: http://stackoverflow.com/comment/45917281
accepted answer of: http://stackoverflow.com/q/28822852
type: AcceptedAnswer
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45917239
has comment: http://stackoverflow.com/comment/45917315

http://stackoverflow.com/q/28804564
has comment: http://stackoverflow.com/comment/45882261
score: 4
has comment: http://stackoverflow.com/comment/45882589
type: Question
upvote count: 4
accepted answer: http://stackoverflow.com/a/28804873
has body: I am using this JavaScript Code, but it will return only cookies of a particular page. I want to clean all the cookies of Browser function deleteAllCookies() { var cookies = document.cookie.split(";"); for (var i = 0; i &lt; cookies.length; i++) { var cookie = cookies[i]; var eqPos = cookie.indexOf("="); var name = eqPos &gt; -1 ? cookie.substr(0, eqPos) : cookie; document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT"; } };
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has title: Delete all Cookies of browser using javascript
linked to: http://stackoverflow.com/q/595228
has comment: http://stackoverflow.com/comment/45882308
has answer: http://stackoverflow.com/a/28804873
has comment: http://stackoverflow.com/comment/45882557
has comment: http://stackoverflow.com/comment/45882312
has comment: http://stackoverflow.com/comment/45882351
has comment: http://stackoverflow.com/comment/45882664
type: AnsweredQuestion
tagged with: cookies

http://stackoverflow.com/comment/46028213
has text: You can read more on the topic Literals - http://www.ecma-international.org/ecma-262/5.1/#sec-7.8
comment on: http://stackoverflow.com/q/28883426
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45971043
type: QuestionComment
has text: What you would do is query that php file first, then load the correct template into the modal instance. OR, you load the basic template into the modal instance, show the modal, get the controller to query the php file and change the content using `ng-include`.
comment on: http://stackoverflow.com/q/28851913
score: 0
type: Comment

http://stackoverflow.com/comment/45786141
has text: you sure you intended to use `.empty()` and not `.remove()`? or maybe you meant to empty the wrapper. May not be the issue exactly, but you're leaving in all the old squares on populate. Is that deliberate?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28751959
score: 0

http://stackoverflow.com/q/28774420
linked to: http://stackoverflow.com/q/25724015
has title: Node.JS - Q Module - Promises
type: UnansweredQuestion
tagged with: node.js
has body: I'm hoping someone who uses the Q module in Node.js can advise me. So, my question is: Is it typically necessary to create more than one promise if you are trying to perform multiple functions in sequence? For example, I'm trying to create an application that: 1) Read data from a file (then) 2) Opens a database connection (then) 3) Executes a query via the database connection (then) 4) Store JSON dataset to a variable (then) 5) Close Database connection. (then) 6) Perform other code base on the JSON dataset I've stored to a variable. In raw Node.js, each method of an object expects a callback, and in order to do these tasks in the proper order (and not simultaneously -which wouldn't work), I have to chain these callbacks together using an ugly amount of code nesting. I discovered the Q module, which prevents nesting via the Promise concept. However, in my first attempt at using Q, I'm trying to make a promise out of everything, and I think I might be over-complicating my code. I'm think that maybe you only really have to create one promise object to perform the steps mentioned above, and that it may be unnecessary for me to convert every method to a promise via the Q.denodeify method. For example, in my code I will be connecting to a db2 database using the ibm_db module. Probably due to misunderstanding, I've converted all the ibm_db methods to promises like this: var ibmdb = require('ibm_db'); var q = require('q'); var ibmdbOpen = q.denodeify(ibmdb.open); var ibmdbConn = q.denodeify(ibmdb.conn); var ibmdbClose = q.denodeify(ibmdb.close); var ibmdbQuery = q.denodeify(ibmdb.query); Is this really necessary? In order to do one thing after another in Q, is it necessary for me to denodeify each method I'll be using in my script? Or, can I just create one promise at the beginning of the script, and use the q.then method to perform all the asynchronous functions in sequence (without blocking).
type: Question
has comment: http://stackoverflow.com/comment/45831547
tagged with: javascript
tagged with: http://stackoverflow.com/tag/q
has answer: http://stackoverflow.com/a/30914279
score: 0
answer count: 1

http://stackoverflow.com/comment/46031888
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28885165
has text: can you reduce the code to only have the bits that cause the problematic behaviour? There's a lot of functions here that aren't involved in the problem you're asking about.

http://stackoverflow.com/q/28864012
type: UnansweredQuestion
has title: IOS Automation: Is there a way to 'refresh' the Element Tree (Or whatever 'Instruments' thinks it can and cannot access)?
has answer: http://stackoverflow.com/a/29030699
type: Question
tagged with: automation
tagged with: ios
tagged with: javascript
tagged with: ipad
score: 0
answer count: 1
tagged with: objective-c
has body: Ok, this is my first time posting, I hope I can accurately explain what's going on , but here's the deal, I have a page on an iPad app I'm working on that has a set of widgets (they display numbered statistics on one side, and a graphical representation on the other). When I pull up this page and log the element tree, I can see the statistic side of the widgets, but not the graphical side (this is good cause the graphical side isn't seen by the user yet). However, when I switch to the graphical side (via an icon) and log the element tree again, it still only shows the statistics side. Normally, I would think that I need to better identify the graphical side, but, if I restart 'Instruments' and quickly flip over to the graphical side, THEN log the element tree, I see the graphical side, and not the statistics side. A quick visualization could be: Start Instruments > Stats Side > Log Tree = Stats side > Flip to graph side > Log Tree = Stats side Start Instruments > Quickly Flip to Graph Side > Log Tree = Graph Side > Flip to stats side > Log Tree = Graph side So, finally, I need a way to be able to access those elements whenever they appear, so is there a way to refresh the log tree, or is there a cache of the elements that's preventing me from 'seeing' the newly visible elements? Thanks in advance! (ps I tagged 'objective-c' cause that's what the app is written in)

http://stackoverflow.com/a/28862187
downvote count: 0
has comment: http://stackoverflow.com/comment/45990944
score: 1
has comment: http://stackoverflow.com/comment/45991407
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45991025
accepted answer of: http://stackoverflow.com/q/28862132
type: Answer
answers question: http://stackoverflow.com/q/28862132
has body: function BookingFare() { var price = 0; //var ofAdults = getElementById('adults').value; //var ofChildren = getElementById('children').value; var BN1 = document.getElementById('BN1').value; if (BN1) { var price = price + 40; } document.getElementById('priceBox').innerHTML = price; } Bristol - Newcastle Submit

http://stackoverflow.com/comment/45867263
has text: this is missing something you want to add /g
type: AnswerComment
comment on: http://stackoverflow.com/a/28796426
score: 0
type: Comment

http://stackoverflow.com/comment/45985660
has text: At this point you have to learn how to use your browser's developer tools, set breakpoints in your code, inspect variables and network requests. All you need in order to debug your code is there, you just have to use it: https://developer.chrome.com/devtools
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28859431
type: Comment

http://stackoverflow.com/comment/45921139
type: QuestionComment
has text: It's a type="button"
comment on: http://stackoverflow.com/q/28824649
score: 0
type: Comment

http://stackoverflow.com/comment/45880434
type: AnswerComment
has text: still nothing :/ I've done a test with document ready to display an alert and the alert seems to appear, but the scroll bar still nothing, so I think it must be on the code inside of it... I also tried some workaround ways and with this one it works well but the user will always have to scroll a bit for the scrollbar appear: `$(document).scroll(function() {`
comment on: http://stackoverflow.com/a/28800384
score: 0
type: Comment

http://stackoverflow.com/a/28792150
has comment: http://stackoverflow.com/comment/45860471
has comment: http://stackoverflow.com/comment/45860564
has comment: http://stackoverflow.com/comment/45860065
downvote count: 2
has body: Any JS implementations that follow ECMA-262 5.1 standard have to implement String.prototype.toLocaleLowerCase and String.prototype.toLocaleUpperCase And as per the standard toLocaleLowerCase is supposed convert string to it's lower case mapping as per locale specific mapping. Where as toLowerCase converts to lowercase string as defined by unicode mappings. For most languages toLocaleLowerCase and toLowerCase give the same result. But for certain languages, like turkish the case mapping don't follow unicode mapping thus toLowerCase and toLocaleLowerCase give different result. The Library/Framework you use (Jquery, Angular, Node whatever else) does not make any difference whatsoever. It's in what JS implementation you use to run your JS libaries that makes and changes things. For all practical purposes it's accurate to conclude that Node/Angular or any other JS libraries and frameworks all behave exactly the same when dealing with strings (as long as they are used by JS Engine that implements ECMA-262 3 and above). Having said that, I'm sure many frameworks extend the string object to add more functionality, but the basic properties and functions defined by ECMA-262 5.1 always exists and WILL behave exactly the same. To learn more : http://www.ecma-international.org/ecma-262/5.1/#sec-15.5.4.17 As far as browsers are concerned, all modern browsers implement the ECMA-262 5.1 standards in their JS engine. I am not sure about Node, but from what limited exposure I have with Node, I think they too use JS implemented per ECMA-262 5.1 standard.
has comment: http://stackoverflow.com/comment/45859598
type: Answer
upvote count: 15
has comment: http://stackoverflow.com/comment/45859771
has comment: http://stackoverflow.com/comment/77696263
has comment: http://stackoverflow.com/comment/45860530
has comment: http://stackoverflow.com/comment/45860365
score: 13
answers question: http://stackoverflow.com/q/28792027
has comment: http://stackoverflow.com/comment/45860220

http://stackoverflow.com/q/28755867
score: -1
has answer: http://stackoverflow.com/a/28756032
has title: Javascript - Correct username and password to enable another form?
has comment: http://stackoverflow.com/comment/45793087
answer count: 1
downvote count: 1
has body: Alright, so I don't know if this is possible, or if there is an easier way to do what I'm trying to accomplish. Basically I am using a Javascript form to enter in a username and password with a login button. If the username and password are entered correctly and you hit the login button, I would like the page to hide the "login form", and run another form. or if there is a way to disable the "patient info form" until the "login form" has been entered correctly. I am completely lost on how to do this. Any help would be appreciated! This is what I have so far. Receptionist Login Username: Password: Patient Information First Name: Last Name: Javascript Code function validateLogin() { var notValid = true; var username = document.forms["recLogin"]["txtUsername"].value; var password = document.forms["recLogin"]["txtPassword"].value; username = username.toLowerCase(); if(username == "mayo" && password == "Please99!") { /*****COMPLETELY STUCK******/ alert("Entered Correctly"); notValid = false; } else { alert("I'm sorry but the username and password you entered are incorrect, please try again."); } }//End of validateLogin()
type: UnansweredQuestion
tagged with: forms
upvote count: 0
tagged with: javascript
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/45793367
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/45870497
score: 1
comment on: http://stackoverflow.com/a/28798061
type: AnswerComment
type: Comment
has text: That did it, thank you very much!!! Your answer was really helpful and i didn't know what you teached me :)

http://stackoverflow.com/a/28839320
score: 1
upvote count: 1
downvote count: 0
has body: The content after the if statement is always going to run because the function doesn't stop just because the if criteria was true. Also, your statement to set the value to block has the double ='s. It should not. if(which.style.display=="block"){ which.style.display="none"; } else { which.style.display="block"; }
type: Answer
answers question: http://stackoverflow.com/q/28839134

testing
tags question: http://stackoverflow.com/q/28820651
tags question: http://stackoverflow.com/q/28754864
tag name: testing
tags question: http://stackoverflow.com/q/28774117
tags question: http://stackoverflow.com/q/28779037
tags question: http://stackoverflow.com/q/28846543
tags question: http://stackoverflow.com/q/28788781
tags question: http://stackoverflow.com/q/28828306
tags question: http://stackoverflow.com/q/28893436
tags question: http://stackoverflow.com/q/28833844
type: Tag
tags question: http://stackoverflow.com/q/28775469
tags question: http://stackoverflow.com/q/28808463
tags question: http://stackoverflow.com/q/28775989
tags question: http://stackoverflow.com/q/28855004
tags question: http://stackoverflow.com/q/28788253

http://stackoverflow.com/comment/45984589
has text: the Telerik team is investigating this as a control bug: http://feedback.telerik.com/Project/108/Feedback/Details/152532-fix-set-cancel-method-of-the-args-in-radtextbox-onvaluechanging-event-is-taking-e
type: AnswerComment
comment on: http://stackoverflow.com/a/28815419
score: 0
type: Comment

http://stackoverflow.com/comment/46150465
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28809449
has text: What's the problem with calling `myFunction` on submit? Additionally using POST to search is not a good idea. POST is used for creating resources on the server, you will have confusing API and as you said bad UI

http://stackoverflow.com/q/28895193
linked to: http://stackoverflow.com/q/2758608
score: 1
type: Question
has title: Activate a window tab in chrome
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I'm developing web pages using only under google chrome browser. For example, my page is opened in a tab called MyTab. And some times, the user is viewing a page in an other tab OtherTab. Now, I want to trigger an activation on MyTab. Then I tried: &lt;script&gt; // MyTab setTimeout(function() { alert('activated'); }, 5000); &lt;/script&gt; This do works, the MyTab page pops to the front. Problem: But I don't want to produce an alert(); Then I tried to call window.focus(): &lt;script&gt; // MyTab setTimeout(function() { window.focus(); }, 5000); &lt;/script&gt; But with no luck. It seems the window.focus() method do not work. Then I tried to find the problem: window.focus() not working in Google Chrome But it don't quite points out to a solution for me. So, is there any way to pop the window tab to the front, with out using alert()?
has answer: http://stackoverflow.com/a/28896026
linked to: http://stackoverflow.com/q/2704206
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/46050473
duplicate of: http://stackoverflow.com/q/2704206
type: UnansweredQuestion
upvote count: 1
tagged with: google-chrome

http://stackoverflow.com/comment/46038394
has text: yeah. i need to be able to access the database from other sources than the Javascript VM as well. and i don't want to dig too deep into the chrome/V8 API's, maybe it'd be possible, but way more work and complexity than it's worth :p also add that the WebSQL will probably be deprecated and removed in future versions.
type: QuestionComment
comment on: http://stackoverflow.com/q/28888541
type: Comment
score: 0

http://stackoverflow.com/a/28792981
has body: Here's a way to count unique colors: Iterate buffer Create an object to hold key for each color Increment the key var canvas = document.querySelector("canvas"), out = document.querySelector("output"), ctx = canvas.getContext("2d"), w = canvas.width, h = canvas.height, cells = 9, sx = w / cells, sy = h / cells, x, y // random color boxes (will be pretty even in count): for(y = 0; y &lt; h; y += sy) {for(x = 0; x &lt; w; x += sx) { ctx.fillStyle = "hsl(" + (360*Math.random()) + ",60%,50%)"; ctx.fillRect(x|0, y|0, Math.ceil(sx), Math.ceil(sy)); }} // get bitmap var idata = ctx.getImageData(0, 0, w, h), // area to analyze buffer32 = new Uint32Array(idata.data.buffer), // use 32-bit buffer (faster) i, len = buffer32.length, stats = {}; for(i = 0; i &lt; len; i++) { var key = "" + (buffer32[i] &amp; 0xffffff); // filter away alpha channel if (!stats[key]) stats[key] = 0; // init this color key stats[key]++ // count it.. } // you can loop through the keys and convert the key into RGB values later out.innerHTML = JSON.stringify(stats); // convert first key: var keys = Object.keys(stats), count = keys.length, key = keys[0] var r = key &amp; 0xff, g = (key &amp; 0xff00)&gt;&gt;&gt;8, b = (key &amp; 0xff0000)&gt;&gt;&gt;16; alert("First key: " + r + "," + g + "," + b + "=" + stats[key] + "\nUnique colors: " + count); &lt;canvas&gt;&lt;/canvas&gt;&lt;br&gt;&lt;output&gt;&lt;/output&gt; You can now use the statistics (number of keys) to find unique number of colors, then you can reduce the numbers by finding close values - or use ColorThief to do the whole job for you.
accepted answer of: http://stackoverflow.com/q/28792385
answers question: http://stackoverflow.com/q/28792385
type: Answer
upvote count: 4
downvote count: 0
score: 4
type: AcceptedAnswer

http://stackoverflow.com/comment/46015598
comment on: http://stackoverflow.com/q/28876443
score: 0
type: QuestionComment
type: Comment
has text: Could you put this in JSFiddle and share?

http://stackoverflow.com/a/28901711
has body: I'd give a try to draw the image on the canvas in the img.onload callback.
upvote count: 2
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28901554
type: Answer
answers question: http://stackoverflow.com/q/28901554
score: 2

http://stackoverflow.com/comment/45927241
comment on: http://stackoverflow.com/a/28827754
type: Comment
has text: assign your db connection statement in a variable and echo it, if connection fails it returns NULL, you can check the validity of each statement this way
score: 0
type: AnswerComment

http://stackoverflow.com/q/28850984
has body: While I was trying to deal with nested tables using javascript, I got stuck. My css style tr.odd is not getting applied on odd rows after I changed it. When I tried to debug, my innermost table structure itself is not there. Also no exceptions during run time. Previous code was working perfectly. Because of some margin issue, I changed a bit of code on odd rows by creating table inside the existing table, and now CSS style is not getting applied. CSS: tr.odd { background-color:#f3f4f5; \-webkit-font-smoothing: antialiased; font-weight: normal; margin: 10px 20px; padding: 8px; line-height: 1.42857143; vertical-align: top; border-top: 1px solid #ddd; } Previous Script (Working): if(line%2==0) $(obj).find('#abc tr:last').after(" "+emp+" "+eventName+" "+ind+" "+loc +" "); else $(obj).find('#abc tr:last').after(" "+emp+" "+eventName+" "+ind+" "+loc +" "); Current Script (Not Working): if(line%2==0) $(obj).find('#abc tr:last').after(" " + " " + " " + " " + " " + " "+emp+" " + " " + " " + " " + " "+eventName+" " + " " + " " + " " + " "+ind+" " + " " + " " + " " + " "+loc+" " + " " + " " + " " + " "); else $(obj).find('#abc tr:last').after(" "+emp+" "+eventName+" "+ind+" "+loc +" ");
has comment: http://stackoverflow.com/comment/45969103
score: 0
has comment: http://stackoverflow.com/comment/45969160
answer count: 1
accepted answer: http://stackoverflow.com/a/28851124
tagged with: jquery
has title: CSS not applied on nested HTML tables
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/45969213
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28851124
type: Question
tagged with: javascript

google-maps-api-3
tags question: http://stackoverflow.com/q/28837818
tags question: http://stackoverflow.com/q/28839359
tags question: http://stackoverflow.com/q/28864285
tags question: http://stackoverflow.com/q/28791686
tags question: http://stackoverflow.com/q/28757798
tags question: http://stackoverflow.com/q/28889783
tags question: http://stackoverflow.com/q/28849267
tags question: http://stackoverflow.com/q/28791653
tags question: http://stackoverflow.com/q/28880331
tags question: http://stackoverflow.com/q/28796705
tags question: http://stackoverflow.com/q/28802664
tags question: http://stackoverflow.com/q/28811320
tags question: http://stackoverflow.com/q/28798384
tags question: http://stackoverflow.com/q/28800826
tags question: http://stackoverflow.com/q/28831323
tags question: http://stackoverflow.com/q/28753812
tags question: http://stackoverflow.com/q/28814122
tags question: http://stackoverflow.com/q/28803103
tags question: http://stackoverflow.com/q/28823877
tags question: http://stackoverflow.com/q/28899935
tags question: http://stackoverflow.com/q/28776111
tags question: http://stackoverflow.com/q/28775339
tags question: http://stackoverflow.com/q/28751532
tags question: http://stackoverflow.com/q/28867966
tags question: http://stackoverflow.com/q/28768018
tags question: http://stackoverflow.com/q/28772830
tags question: http://stackoverflow.com/q/28814247
tags question: http://stackoverflow.com/q/28896227
tags question: http://stackoverflow.com/q/28772482
tags question: http://stackoverflow.com/q/28860132
tag name: google-maps-api-3
tags question: http://stackoverflow.com/q/28822878
type: Tag
tags question: http://stackoverflow.com/q/28890440
tags question: http://stackoverflow.com/q/28896386
tags question: http://stackoverflow.com/q/28892334
tags question: http://stackoverflow.com/q/28886757
tags question: http://stackoverflow.com/q/28837030
tags question: http://stackoverflow.com/q/28814892
tags question: http://stackoverflow.com/q/28894822
tags question: http://stackoverflow.com/q/28824347
tags question: http://stackoverflow.com/q/28774147
tags question: http://stackoverflow.com/q/28812031
tags question: http://stackoverflow.com/q/28786498
tags question: http://stackoverflow.com/q/28825846

http://stackoverflow.com/q/28807948
has body: I need to attach a custom header to the ajax request of fullcalendar. $('#calendar').fullCalendar({ eventSources: [ { url: '/myfeed.php', } ] }); How do I define that?
tagged with: javascript
tagged with: fullcalendar
has title: How to add custom header to fullcalendar sources
accepted answer: http://stackoverflow.com/a/28808098
answer count: 3
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/68768248
upvote count: 2
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28808098
possible better answer: http://stackoverflow.com/a/28808171
type: Question
has answer: http://stackoverflow.com/a/28808171

http://stackoverflow.com/comment/45855833
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28790209
has text: You can call the function into your js console : `jvAddAttachment2('jvcoverletter', 'qLY9Vfwx')` Then you won't be redirected (I think the faulty function is the `hideDiv()` one)

http://stackoverflow.com/a/28869961
has comment: http://stackoverflow.com/comment/46004123
answers question: http://stackoverflow.com/q/28869930
has comment: http://stackoverflow.com/comment/46003804
has body: hope this helps :) var timestamp = Math.floor( Date.now() / 1000);
has comment: http://stackoverflow.com/comment/46004090
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/46004152

http://stackoverflow.com/a/28792378
has body: It is looking like there are some key combos that cannot be overridden. I tried getting it to work and could not. It works fine for ctrl+r which is reload but I couldn't get it to work with ctrl+PageDown or ctrl+t. I think it is a safety mechanism built into the browser.
accepted answer of: http://stackoverflow.com/q/28792189
score: 0
answers question: http://stackoverflow.com/q/28792189
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/45861188

http://stackoverflow.com/comment/46069241
type: Comment
type: QuestionComment
has text: Do you want the ID of the tab, or the tab content div you insert?
comment on: http://stackoverflow.com/q/28904710
score: 0

http://stackoverflow.com/a/28857805
has body: Jonathan Lonowski directed me in the right direction to use cookies. I now have everything working correctly. I found this resource online as well: http://www.perlscriptsjavascripts.com/js/cookies.html
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28846657

http://stackoverflow.com/comment/45864094
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28794432
has text: @RicardoSilva can you post your controller code and also html where you want this div to append to

http://stackoverflow.com/comment/46054038
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28897169
has text: Can you post `jsfiddle` code so we can help as more expected for you.
score: 0

http://stackoverflow.com/q/28789161
has title: Only JQuery working with FormData?
has body: I am sending form contents via an AJAX call. The form is: &lt;form id="id_of_form" enctype="multipart/form-data"&gt; &lt;input type="text" name="name" id="name" /&gt; &lt;input type="file" name="fileField" id="fileField" /&gt; &lt;br/&gt;&lt;br/&gt; &lt;input class="button" type="submit" value="Upload"/&gt; &lt;/form&gt; My preferred method is the following: Method 1 &lt;script type="text/javascript"&gt; $(document).ready(function(){ $('#id_of_form').on('submit',function(e){ e.preventDefault(); var formdata = new FormData($(this)[0]); var ajax = new XMLHttpRequest(); ajax.open("POST", "testing.php", true); ajax.onreadystatechange = function(){ if(ajax.readyState == 4 &amp;&amp; ajax.status == 200){ var returnVal = ajax.responseText; ... do stuff here ... } } ajax.send(formdata); }); }); &lt;/script&gt; This sorta works. In my PHP, if($_POST) returns TRUE, but if($_FILES) returns FALSE (when both the name and file field contain something). When I do var_dump($_POST) in my PHP, it spits out the following: array(312) { ["------WebKitFormBoundaryoypwTdV9MSCqJC2F Content-Disposition:_form-data;_name"]=&gt; string(5698) ""name" qwert ------WebKitFormBoundaryoypwTdV9MSCqJC2F Content-Disposition: form-data; name="fileField"; filename="carved-coral-beads.jpg" Content-Type: image/jpeg ���� VExifMM* ���=�19(1A2_��s������i ��SA ^ Only an abbreviation - actually MUCH longer. var_dump($_FILES) returns array(0) { } Method 1 only works when I send data in the following way: ajax.send("username=something&amp;var2=somethingelse"); but I can't include any files (specifically, an image) in this way. If I use JQuery to send it: Method 2 &lt;script type="text/javascript"&gt; $(document).ready(function(){ $('#id_of_form').on('submit',function(e){ e.preventDefault(); var formdata = new FormData($(this)[0]); $.ajax({ url: "testing.php", type: "POST", data: formdata, contentType: false, cache: false, processData:false, success: function(data){ ... do stuff here ... } }); }); &lt;/script&gt; …
downvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: ajax
tagged with: form-data
tagged with: php
score: 2
type: AnsweredQuestion
upvote count: 2
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28789277
accepted answer: http://stackoverflow.com/a/28789277

http://stackoverflow.com/a/28840481
has comment: http://stackoverflow.com/comment/45950690
answers question: http://stackoverflow.com/q/28840408
downvote count: 5
score: -4
has comment: http://stackoverflow.com/comment/45950327
has body: You can use the switch statement switch(acs.user.loggedin){ case false: $( "a.navbar-toggle.icon" ).hide(); $( "#my-menu" ).show(); break; }
has comment: http://stackoverflow.com/comment/45950708
type: Answer
has comment: http://stackoverflow.com/comment/45950870
has comment: http://stackoverflow.com/comment/45951103
upvote count: 1
has comment: http://stackoverflow.com/comment/45950978
has comment: http://stackoverflow.com/comment/45950741

http://stackoverflow.com/comment/45870665
type: Comment
has text: @JavierMuñoz, jsfiddle?
type: AnswerComment
comment on: http://stackoverflow.com/a/28790187
score: 0

http://stackoverflow.com/comment/45885204
score: 0
comment on: http://stackoverflow.com/q/28805384
type: Comment
type: QuestionComment
has text: Negative look-ahead with additional matching at the start and end of the subject, i.e. `^''` or `''$`.

http://stackoverflow.com/comment/45946670
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28829356
has text: I've tried to show the flicker in a video: http://youtu.be/poWzOf6x5lo?t=36s - do you see it? Or maybe it's because I haven't specified the width and height of the big image. Will test that.

http://stackoverflow.com/q/28903127
type: AnsweredQuestion
score: 0
type: Question
tagged with: c#
has answer: http://stackoverflow.com/a/28910185
tagged with: javascript
tagged with: jquery
tagged with: webforms
has body: I have an asp:RadioButton and try to manipulate a label according to whether it is selected or not. Using this code: if ($('.rbOpenClient').prop('checked')) $('.openInvLabel').addClass('radioBtnSelected'); else if ($('rbClosedClient').prop('checked')) $('.closedInvLabel').addClass('radioBtnSelected'); $('.openInvLabel').click(function () { $('.rbOpenClient').css('checked', true); $('.openInvLabel').addClass('radioBtnSelected'); $('.rbClosedClient').css('checked', false); $('.closedInvLabel').removeClass('radioBtnSelected'); }); $('.closedInvLabel').click(function () { $('.rbClosedClient').prop('checked', true); $('.closedInvLabel').addClass('radioBtnSelected'); $('.rbClosedClient').prop('checked', false); $('.openInvLabel').removeClass('radioBtnSelected'); }); .rbOpenClient and .rbClosedClient are CssClass in the asp:Button. The other classes are labels. Do you see some problems with the jQUery?
answer count: 1
tagged with: asp.net
accepted answer: http://stackoverflow.com/a/28910185
has title: Cannot select ASP WebForms control with jQuery

http://stackoverflow.com/comment/46044579
score: 1
comment on: http://stackoverflow.com/q/28891835
type: Comment
type: QuestionComment
has text: Help with what exactly? What problem do you experience with your code?

http://stackoverflow.com/comment/46014584
has text: Nice, a duplicate. And my answer is exactly the same, if you read it.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28875773
score: 0

http://stackoverflow.com/a/28879142
downvote count: 0
upvote count: 2
answers question: http://stackoverflow.com/q/28878922
has comment: http://stackoverflow.com/comment/46020611
has body: I suggest you this solution : function generateWeapon() { document.getElementById("result").innerHTML = search(); } function search() { var myArray = ["rope", "axe", "crowbar", "knife", "shovel", "hammer"]; var guess = Math.floor(Math.random() * myArray.length); return myArray[guess]; } Generate a weapon
type: Answer
score: 2

http://stackoverflow.com/a/28881316
upvote count: 2
answers question: http://stackoverflow.com/q/28881033
score: 2
has body: You can use the following regex to only match opening ' /(?!\b)'/g See the demo on your testcases
downvote count: 0
type: Answer

http://stackoverflow.com/q/28769496
favorite count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: php
has title: How to append first, then run ajax in jquery?
has body: I want to append first, then run ajax to update the data and then do the search. See the code below. I want to put a code like if append, then run $.post. How can I do that in jquery, thanks? $('&lt;span /&gt;', { class: 'result_tag', text: href }).insertBefore($input); $('.result_tag').append(' '); //make sure append first and then run .post $.post("member_search.php", { search_text: $(".result_tag").text() }).done(function() { $.post("member_search.php", { search_text: $(".result_tag").text() }, function(data){ $("#find_members").html(data); }); });
has answer: http://stackoverflow.com/a/28771879
type: Question
answer count: 2
linked to: http://stackoverflow.com/q/19125218
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28769575
tagged with: ajax
has comment: http://stackoverflow.com/comment/45817508
score: 1

http://stackoverflow.com/comment/45913950
comment on: http://stackoverflow.com/q/28820960
has text: @naman kalkhuria, please see updated jsfiddle, thanks for catching that
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/28806209
has comment: http://stackoverflow.com/comment/69139419
tagged with: javascript
has title: How to change the format of the LCOV report executed by Karma?
has comment: http://stackoverflow.com/comment/127875191
tagged with: lcov
favorite count: 0
upvote count: 41
has comment: http://stackoverflow.com/comment/127874970
score: 41
tagged with: karma-runner
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/90709818
type: Question
tagged with: karma-coverage
has answer: http://stackoverflow.com/a/42615450
has body: I've configured Karma to report the coverage of my JavaScript code. Here is the part of the configuration in the karma.conf.js file: coverageReporter: { reporters: [ { type: 'html', dir: 'build/karma/coverage' }, { type: 'lcov', dir: 'build/karma/coverage', subdir: '.' }, { type: 'cobertura', dir: 'build/karma/coverage' } ] }, My lcov.info file has the following format: TN: SF:./app/scripts/app.js FN:16,(anonymous_1) FN:26,(anonymous_2) FNF:2 FNH:1 FNDA:1,(anonymous_1) FNDA:0,(anonymous_2) DA:2,1 DA:20,1 DA:29,0 DA:34,0 LF:4 LH:2 BRF:0 BRH:0 end_of_record Unfortunately, the Sonarqube JavaScript plugin only considers the lines that start with SF:, DA: or BRDA: (cf LCOVParser). Due to that, the LCOV HTML report (made by Istanbul) gives me a higher code coverage than Sonar on the same data. Is there a way to change the format of the lcov.info generated? If I look in Istanbul code, I can imagine the meaning of the different labels: BRF, BRH, BRDA are for branches. FN, FNF, FNH, FNDA are for functions. LN, LF, LH are for lines. *F is the total, while *H is the covered information. The difference between the Istanbul and Sonar coverage seems to be due to the fact that the latter completely ignores the Functions and Branches coverage. Any idea to solve that?
has comment: http://stackoverflow.com/comment/68167264
tagged with: sonarqube
has comment: http://stackoverflow.com/comment/71244963
has comment: http://stackoverflow.com/comment/90709689
linked to: http://stackoverflow.com/q/51878860
downvote count: 0
answer count: 1

http://stackoverflow.com/comment/45959918
score: 1
has text: Do you make sure your colorMe function is run after the paragraph element exists? Use an onload event or a delay.
comment on: http://stackoverflow.com/q/28845631
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28791215
possible better answer: http://stackoverflow.com/a/28791341
accepted answer: http://stackoverflow.com/a/28791339
has comment: http://stackoverflow.com/comment/45857647
has answer: http://stackoverflow.com/a/28791341
score: 0
answer count: 2
tagged with: local-storage
tagged with: cookies
has body: I would like to initialize localStorage object every time a user does a refresh by F-5. Can i do such a thing? The localStorage object is working fine by setItem and getItem methods. However, I would like to know if i have the option to init this object every refresh action. For example: I have two different pages in my app. A.js and B.js. When loading B.js i set the localStorage: var id = getId(); window.localStorage.setItem("Id", id ); After that when i clicking on a button for going to A.js i am doing: var selectedId = window.localStorage.getItem("Id"); if (selectedId !== null){ var intSelectedId = parseInt(selectedId ); //DO LOGIC } I would like to delete ("Id", id) key-value pair every refresh. How can i do it?
has answer: http://stackoverflow.com/a/28791339
type: AnsweredQuestion
tagged with: javascript
has title: Init localStorage after every refresh
has comment: http://stackoverflow.com/comment/45857540
type: Question
has comment: http://stackoverflow.com/comment/45857732

http://stackoverflow.com/a/28870777
answers question: http://stackoverflow.com/q/28867920
has body: Edit, because I misread the question : If you can append the svg to your document, and need to use a FileReader, use its readAsText() method, then insert it in an html element. function previewFile() { var file = document.querySelector('input[type=file]').files[0]; var reader = new FileReader(); reader.onloadend = function () { var parent = document.getElementById('container'); parent.innerHTML= reader.result; } if (file &amp;&amp; file.type=="image/svg+xml") { reader.readAsText(file); } else { alert("wrong file type or no file provided"); } } &lt;div id="container"&gt;&lt;/div&gt; &lt;input type="file" onchange="previewFile()"&gt; If you don't need to use a FileReader (e.g if the file is saved on the server), Paul's answer is better. If you don't want to actually append the svg file but only know its width/height, you can refer to my original answer : I don't think you can get the height from the data url. As a workaround, you can use the readAsText()method of the fileReader API, combined with the DOMParser() method, in order to read the viewBox property of the svg. function xlog(msg){ document.getElementById('log').textContent = msg; } function previewFile() { var file = document.querySelector('input[type=file]').files[0]; var reader = new FileReader(); reader.onloadend = function () { var doc = new DOMParser().parseFromString(reader.result, 'application/xml'); var viewBox = doc.documentElement.viewBox.baseVal; xlog('height:'+viewBox.height+' width:'+viewBox.width); } if (file &amp;&amp; file.type=="image/svg+xml") { reader.readAsText(file); } else { xlog("wrong file type or no file provided"); } } &lt;p id="log"&gt;&lt;/p&gt;&lt;br&gt; &lt;input type="file" onchange="previewFile()"&gt; Note that you can append the doc.documentElement into your document and then get the element's BBox.
downvote count: 0
score: 1
type: Answer
upvote count: 1

http://stackoverflow.com/a/54805123
has body: One more decision with the ES2015 arrow function: const isBoolean = val =&gt; typeof val === 'boolean';
answers question: http://stackoverflow.com/q/28814585
type: Answer
upvote count: 2
score: 1
downvote count: 1

http://stackoverflow.com/q/28843517
has body: Here is my navigation menu: Home Gallery Recipies Contact I have a green leaf showing up when li is clicked, jQuery code to make it happen: $(document).ready(function(){ $( "#nav li" ).click(function(event) { event.preventDefault(); $(this).addClass('greenLeaf').siblings('li').removeClass('greenLeaf'); }); }); Now, the problem is, when instead of the "index.html", I have the # - works like charm, if a link is inserted, I need to use the event.preventDefault, which also prevents the browser to follow the link - which is obviously not exactly what I'm after. Any method to get around this problem? I'm sure it's an easy fix, but I can't figure it out...
downvote count: 0
score: 1
accepted answer: http://stackoverflow.com/a/28843704
type: Question
has comment: http://stackoverflow.com/comment/45956298
has comment: http://stackoverflow.com/comment/45956014
has title: Click function of li tag not working with href other than #
has comment: http://stackoverflow.com/comment/45956006
has comment: http://stackoverflow.com/comment/45956107
has comment: http://stackoverflow.com/comment/45956208
has comment: http://stackoverflow.com/comment/45956143
tagged with: javascript
has answer: http://stackoverflow.com/a/28843704
has comment: http://stackoverflow.com/comment/45956027
has comment: http://stackoverflow.com/comment/45956229
answer count: 2
upvote count: 1
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28843734
favorite count: 0
has answer: http://stackoverflow.com/a/28843734
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45956131

http://stackoverflow.com/q/28825231
has title: onclick function not working into .append?
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28825824
has answer: http://stackoverflow.com/a/28825358
answer count: 4
has answer: http://stackoverflow.com/a/28825291
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28826184
type: Question
has body: I try to create the div tag using javascript and jquery. And i try onclick function apply to the div tag but this is not working? var header = ' '; document.body.insertAdjacentHTML('beforeend',header); $("#header").append(' '); IN the code i used onclick function inside the div id="con" tag not worked.? but Instead of i used $("#header").append(' '); function mufunc(){ alert("hello world"); } In this code onclick function is working. I need to alert the code inside the How can i do it? What is the difference between the both function?
accepted answer: http://stackoverflow.com/a/28825291
possible better answer: http://stackoverflow.com/a/28826184
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/28755481
has title: Can't retrieve POST data sent from AJAX, undefined index php
score: 1
has comment: http://stackoverflow.com/comment/45792667
tagged with: forms
linked to: http://stackoverflow.com/q/17887098
has comment: http://stackoverflow.com/comment/45792624
has answer: http://stackoverflow.com/a/28755727
type: Question
has comment: http://stackoverflow.com/comment/45792998
answer count: 2
has comment: http://stackoverflow.com/comment/45792798
has comment: http://stackoverflow.com/comment/45793078
has comment: http://stackoverflow.com/comment/45793018
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: ajax
accepted answer: http://stackoverflow.com/a/28755727
favorite count: 0
has comment: http://stackoverflow.com/comment/45793552
has body: This is my ajax form which works, $.ajax({ type: "POST", url: "update_coordinate.php", data: 'id=' +$id+ 'name=' +$name+ 'wname=' +$wname+ 'xcor=' +$xcor+ 'ycor=' +$ycor+ 'xwid=' +$xwid+ 'yhei=' +$yhei+ 'photo=' +$photo+ 'targeturl=' +$targeturl, success: function(data){ alert( ' id:' +$id+ ' name:' +$name+ ' wname:' +$wname+ ' xcor:' +$xcor+ ' ycor:' +$ycor+ ' xwid:' +$xwid+ ' yhei:' +$yhei+ ' photo:' +$photo+ ' targeturl:' +$targeturl ); alert(data); } }); the alert shows all of the data, the problem is the php side which doesn't seem to read the value, I'm not sure if I am missing something. This is interesting: While messing around, I somehow got the entire concatenated string to be entered in the name field with the equals sign included... how could that have happened? I took out the if(post) argument which is used when submitting an html form to the same page with method post and a submit button. I don't know if that is bad. I tried both of these if(isset($_POST['id'])){ $id = $_POST['id']; }else { $id = ""; } $name = $_POST['name']; Getting errors Undefined index: name which the rest are fine because I specify an arbitrary string value of empty What am I missing?
possible better answer: http://stackoverflow.com/a/28755735
has comment: http://stackoverflow.com/comment/45792775
has answer: http://stackoverflow.com/a/28755735
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/45792867
has comment: http://stackoverflow.com/comment/45793097
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45793207

http://stackoverflow.com/q/28796218
tagged with: javascript
has comment: http://stackoverflow.com/comment/45869814
has comment: http://stackoverflow.com/comment/45866928
linked to: http://stackoverflow.com/q/16497868
has comment: http://stackoverflow.com/comment/45869735
favorite count: 0
has comment: http://stackoverflow.com/comment/45867336
upvote count: 2
has answer: http://stackoverflow.com/a/28856686
accepted answer: http://stackoverflow.com/a/28856686
has comment: http://stackoverflow.com/comment/45884805
has title: PhantomJS cannot open local files of unknown extension
tagged with: phantomjs
type: AnsweredQuestion
score: 2
type: Question
has body: I am using phantomjs to get screenshot of local files. Now I was passing a perfectly valid html file: Title of the document The file name dummy with the file name dummy.hoo PhantomJS seems to be unable to open this. Is this somewhere documented? Local files of the extension .html and .htm are fine, though. Sample call (the path to the page is always converted to Uri scheme) "Phantomjs.exe" --proxy-type=none --ssl-protocol=any --local-to-remote-url-access=true "Scripts\screenshot.js" "file:///D:/dummy.hoo" "base.png" The js is simple: var page = require('webpage').create(); var system = require('system'); if (system.args.length !== 3) { console.log('Usage: script.js <URL> <screenshot destination>'); phantom.exit(); } page.onResourceError = function(resourceError) { page.reason = resourceError.errorString; page.reason_url = resourceError.url; }; page.open(system.args[1], function(status) { if (status !== 'success') { console.log('Failed to load address '+system.args[1]+' ' + page.reason_url + ": " + page.reason); phantom.exit(-1); } page.render(system.args[2]); phantom.exit(); }); I can properly see the html contents of dummy.hoo when I copy the Uri and paste it to firefox etc. Only phantomjs seems to refuse to render this. For dummy.hoo it goes always the error path saying failed to load address, the status is fail and no reason is given via the callback. (When I pass a non-existing url, I get a proper reason) Failed to load address file:///D:/dummy.hoo undefined: undefined I used the link to verbose error output from here: Debugging PhantomJS webpage.open failures and this is the result: = onNavigationRequested destination_url: file:///D:/dummy.hoo type (cause): Other will navigate: true from page's main frame: true = onResourceRequested() request: { "headers": [ { "name": "User-Agent", "value": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.0 Safari/534.34" }, { "name": "Accept", "value": "*/*" } ], "id": 1, "method": "GET…
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/45807907
score: 0
type: Comment
has text: div { text-align: center; max-width: 700px; }
type: AnswerComment
comment on: http://stackoverflow.com/a/28764340

http://stackoverflow.com/q/28775638
favorite count: 0
has body: I develop a simple blog site. There is a list of posts with "view post" button and "remove post" check-box below each post on my page. Also there is a "delete checked posts" at the bottom of the page. I'd like to send to a server a particular id when the "view post" is pressed and to send a list of ids when the "delete checked posts" button pressed. The problem is that I need nested forms for this, but they are not allowed. How to overcome this? I'm thinking of having a form for each post and on "delete checked posts" submit all checked forms via javascript. Is it a good approach? Thanks in advance)
has comment: http://stackoverflow.com/comment/45830293
has answer: http://stackoverflow.com/a/28775769
tagged with: http://stackoverflow.com/tag/html
score: 2
type: AnsweredQuestion
has title: Nested forms in html
upvote count: 2
accepted answer: http://stackoverflow.com/a/28775769
type: Question
tagged with: javascript
tagged with: forms
answer count: 1
downvote count: 0
tagged with: jquery

http://stackoverflow.com/a/28881909
downvote count: 0
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28881870
type: Answer
has body: You have to use a HTTP server such as NodeJS or Apache. You cannot make a ajax call from one website to another. It's blocked by the browser. If you use Chrome, you can launch it with --disable-web-security in order to avoid the error and using it even without a HTTP server

http://stackoverflow.com/q/28762293
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28762658
possible better answer: http://stackoverflow.com/a/47648292
linked to: http://stackoverflow.com/q/18369811
has title: Trigger input file click event in AngularJS
has answer: http://stackoverflow.com/a/47648292
downvote count: 1
type: AnsweredQuestion
has body: I am trying to emulate a click event on a file input in AngularJS. I have seen working jQuery examples, but I don't want to use jQuery. 'use strict'; angular.module('MyApp', []). controller('MyCtrl', function($scope) { $scope.click = function() { setTimeout(function() { var element = angular.element(document.getElementById('input')); element.triggerHandler('click'); $scope.clicked = true; }, 0); }; }); Click me! Clicked Note: For some reason the button needs to be pressed twice in order to trigger the timeout function. I am using setTimeout because of this post. How do I programmatically click a file input with just AngularJS / vanilla JavaScript?
has comment: http://stackoverflow.com/comment/58633283
tagged with: javascript
score: 17
upvote count: 18
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28762658
favorite count: 0
tagged with: angularjs
linked to: http://stackoverflow.com/q/8595389

http://stackoverflow.com/comment/45835810
type: Comment
comment on: http://stackoverflow.com/a/28779014
has text: Tried the new code its not working http://insta-downloads.blogspot.in/2015/02/check-test.html
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45844478
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28780998
has text: @zerkms - As far as I can tell, that doesn't actually generate code that behaves correctly as the compiled JSX will pass the remainder of the `props` as something to render, not as actual `props`.
type: Comment

http://stackoverflow.com/q/28897575
upvote count: 4
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/1004475
favorite count: 0
has comment: http://stackoverflow.com/comment/46055343
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/46055156
has answer: http://stackoverflow.com/a/28897973
type: AnsweredQuestion
has title: Jquery is not retrieving border radius in firefox
has comment: http://stackoverflow.com/comment/46055376
has body: I have a div that has a border radius. I am trying to retrieve the border-radius using Jquery. It is working everywhere except firefox. The file: $('#SelectedDiv').css('border-radius') returns an empty string ( "" ) I tried to do what was instructed in the following stackoverflow page: How do I get the border-radius from an element using jQuery? since they had the same problem. However, nothing worked $('#SelectedDiv').css("MozBorderRadius"); and $('#SelectedDiv').css("-moz-border-radius-topleft"); returned undefined
has comment: http://stackoverflow.com/comment/46054790
type: Question
has answer: http://stackoverflow.com/a/28897771
linked to: http://stackoverflow.com/q/2900812
score: 4
accepted answer: http://stackoverflow.com/a/28897973
possible better answer: http://stackoverflow.com/a/28897771

http://stackoverflow.com/comment/46022070
has text: @Rahul when you connected in SSMS did you use SQL Auth or Windows Authentication?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28857316
type: Comment

http://stackoverflow.com/q/28805223
upvote count: 2
has body: Consider the following scenario. There are two directives which is independent of each other and I want to share the scope between these two directives. Since they are not nested, I cant use a controller in the directives to share the scope. So I have created a service and injected the service to both of these directives. So when the value of the service is changed in one directive, I need the same to be updated in the other directive. How can I achieve this? I want this done right, the angular way, with no anti-patterns. This is what I have tried so far .directive('d1', ['cData', function() { return { link: function() { // this watch is not working scope.$watch( function() { return cData.Value; }, function(newValue, oldValue) { alert(newValue); }) } } }) .directive('d2', ['cData', function() { return { link: function() { element.on('click', function() { cData.Value = false scope.$digest(); }); // A watch here is working, I have commented it out /*scope.$watch( function() { return cd.showStatus; }, function(newValue, oldValue) { alert(newValue) })*/ } } }]) .service('cData', function() { this.Value = false; }) I am updating the value of the service in click event of directive d2 and I need to trigger the watch in the directive d1. May be this is not working as the scopes are different for two directives. How can I achieve this, any help is greatly appreciated. UPDATE Template for directive d1 template : '&lt;div ng-class="{show:cData.Value==true}"&gt;&lt;/div&gt;' To update {show:cData.Value==true} I have to again call scope.$apply() in the event listener of directive d1 Hope this is the right approach.
has answer: http://stackoverflow.com/a/28805533
has answer: http://stackoverflow.com/a/28806976
type: Question
tagged with: angularjs-directive
has title: AngularJS : Watch scope value of a injected service changed in one directive from another directive
tagged with: javascript
tagged with: angularjs-scope
answer count: 2
downvote count: 0
favorite count: 0
tagged with: angularjs
linked to: http://stackoverflow.com/q/19616520
accepted answer: http://stackoverflow.com/a/28805533
possible better answer: http://stackoverflow.com/a/28806976
type: AnsweredQuestion
score: 2

http://stackoverflow.com/q/28796556
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28796601
has answer: http://stackoverflow.com/a/28796809
score: 0
has title: Change part of attribute
answer count: 3
possible better answer: http://stackoverflow.com/a/28796601
has answer: http://stackoverflow.com/a/28796850
has body: i've got the popup window, where i can change icon by attribute: $(this).attr('class', popup.find('i').attr('icon-class')); and html of this element: &lt;i class="small icon-adjustments"&gt;&lt;/i&gt; but you can see that i have two classes small and icon-adjustments that change. The problem is when i change class, my script remove small class too. how i can change only the second part of class?
tagged with: class
accepted answer: http://stackoverflow.com/a/28796850
tagged with: javascript
tagged with: jquery
type: Question

http://stackoverflow.com/q/28824360
type: UnansweredQuestion
tagged with: php
score: 1
upvote count: 1
has body: I have been created subscribe button using php, Html: Get Email Update Now i had been found some click effect of buttons, here is the link, http://tympanus.net/Development/CreativeButtons/ In the above, 7th section[green color section], it has two submit form buttons. One for success and one for error, so i need to use them in my subscribe form, i mean move to my send.php. So when i click subscribe button without enter email, it shows button says, "error" instead, notification. May i know, is it possible to achieve this? Any help would be highly appreciated.
has comment: http://stackoverflow.com/comment/45919845
type: Question
has answer: http://stackoverflow.com/a/28824393
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45920245
answer count: 3
has answer: http://stackoverflow.com/a/28824663
has comment: http://stackoverflow.com/comment/45919809
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45919748
downvote count: 0
has comment: http://stackoverflow.com/comment/45919793
has answer: http://stackoverflow.com/a/28824533
favorite count: 0
has title: How to add button instead of error status and success message in php?

http://stackoverflow.com/comment/45852708
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28788479
has text: You can try copying all the Javascript includes (*.js files) and the embedded Javascript in that page to your test page, then change the links to your local copies.

http://stackoverflow.com/comment/45982033
score: 0
has text: I exactly said that I wouldn't like to use Ajax request with XMLHttpRequest. Isn't there a way to load another HTML from popup.js which is not a content script?
comment on: http://stackoverflow.com/q/28858027
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46002218
score: 0
type: AnswerComment
has text: Yeah, I don't deny the reality of you finding it harder to read. I'm suggesting that this might be something that can become comfortable with minimum effort that could be worth it. As for maintainability, the most important thing for this is communicating to the person coming after you your intention in writing the code. This is simply another tool for enabling this communication.
type: Comment
comment on: http://stackoverflow.com/a/28868838

http://stackoverflow.com/comment/45870726
comment on: http://stackoverflow.com/a/28790187
score: 0
type: AnswerComment
type: Comment
has text: you may want to use `$.when(p2, p1Done)` or double check the arguments that you're receiving in your `then` callbacks.

http://stackoverflow.com/a/28790713
type: Answer
has body: When you do var data = req.query; you are making data refer the same object which req.query also refers. +-----------------+ +----------------------------+ | data |====================&gt;| url:'https://google.com/' | +-----------------+ | width: '500' | | height: '190' | +-----------------+ | ref: 'http://domain.tld' | | req.query |====================&gt;| rnd: '9314871930982' | +-----------------+ +----------------------------+ So, any change to the object, through either data or req.query, will be reflected on all the other references as well. Its more like accessing the same object with two different names. With this understanding, if we look at your code, when you delete things from data, you are actually deleting from the object referred by req.query. If you don't want this to happen, you need to clone req.query with any of the methods mentioned in this thread.
answers question: http://stackoverflow.com/q/28790695
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28790695
score: 1
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28762317
has answer: http://stackoverflow.com/a/28762482
type: AnsweredQuestion
score: 1
upvote count: 1
tagged with: ionic-framework
type: Question
has title: angular service injection in controller with multiple methods
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28762482
answer count: 2
downvote count: 0
has body: I'm trying to build a ionic object-oriented controller properly and am getting trouble with Service Injection... angular.module('app.controllers', ['ionic', 'app.services.myservice']).controller('myCtrl', MyCtrl) function MyCtrl($scope, $ionicLoading, MyService){ this.scope = $scope; this.ionicLoading = $ionicLoading; this.MyService = MyService; } MapCtrl.prototype.method1 = function($scope, $ionicLoading, MyService) { //$scope, $ionicLoading and MyService are undefined } MapCtrl.prototype.method2 = function(){ this.scope.dummy = "A"; //That's ok! this.MyService.aMethodWithCallBack(function(res){ //this.ionicLoading or this.MyService are undefined in this scope ! } } How would you handle it, properly?
has answer: http://stackoverflow.com/a/28762465
favorite count: 0
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/28762465

google-maps
tags question: http://stackoverflow.com/q/28852847
tags question: http://stackoverflow.com/q/28838437
tag name: google-maps
tags question: http://stackoverflow.com/q/28837818
tags question: http://stackoverflow.com/q/28881654
tags question: http://stackoverflow.com/q/28899971
tags question: http://stackoverflow.com/q/28839359
tags question: http://stackoverflow.com/q/28905660
tags question: http://stackoverflow.com/q/28892334
tags question: http://stackoverflow.com/q/28801991
tags question: http://stackoverflow.com/q/28791686
tags question: http://stackoverflow.com/q/28902827
tags question: http://stackoverflow.com/q/28757798
tags question: http://stackoverflow.com/q/28794863
tags question: http://stackoverflow.com/q/28791653
tags question: http://stackoverflow.com/q/28880331
tags question: http://stackoverflow.com/q/28894822
tags question: http://stackoverflow.com/q/28796705
tags question: http://stackoverflow.com/q/28822441
tags question: http://stackoverflow.com/q/28890011
tags question: http://stackoverflow.com/q/28771527
tags question: http://stackoverflow.com/q/28760655
tags question: http://stackoverflow.com/q/28824340
tags question: http://stackoverflow.com/q/28826171
tags question: http://stackoverflow.com/q/28782352
tags question: http://stackoverflow.com/q/28814122
tags question: http://stackoverflow.com/q/28826453
tags question: http://stackoverflow.com/q/28811062
tags question: http://stackoverflow.com/q/28823877
tags question: http://stackoverflow.com/q/28849267
tags question: http://stackoverflow.com/q/28889422
tags question: http://stackoverflow.com/q/28899935
tags question: http://stackoverflow.com/q/28776111
tags question: http://stackoverflow.com/q/28775339
tags question: http://stackoverflow.com/q/28829217
tags question: http://stackoverflow.com/q/28811320
tags question: http://stackoverflow.com/q/28891751
tags question: http://stackoverflow.com/q/28813074
tags question: http://stackoverflow.com/q/28766887
tags question: http://stackoverflow.com/q/28783759
tags question: http://stackoverflow.com/q/28772830
tags question: http://stackoverflow.com/q/28753812
tags question: http://stackoverflow.com/q/28836503
tags question: http://stackoverflow.com/q/28904237
tags question: http://stackoverflow.com/q/28815450
tags question: http://stackoverflow.com/q/28803103
tags question: http://stackoverflow.com/q/28860132
tags question: http://stackoverflow.com/q/28829168
type: Tag
tags question: http://stackoverflow.com/q/28819791
tags question: http://stackoverflow.com/q/28790088
tags question: http://stackoverflow.com/q/28768018
tags question: http://stackoverflow.com/q/28902701
tags question: http://stackoverflow.com/q/28757456
tags question: http://stackoverflow.com/q/28886757
tags question: http://stackoverflow.com/q/28896227
tags question: http://stackoverflow.com/q/28814892
tags question: http://stackoverflow.com/q/28869575
tags question: http://stackoverflow.com/q/28772482
tags question: http://stackoverflow.com/q/28880990
tags question: http://stackoverflow.com/q/28760761
tags question: http://stackoverflow.com/q/28851829
tags question: http://stackoverflow.com/q/28787030
tags question: http://stackoverflow.com/q/28774147
tags question: http://stackoverflow.com/q/28812031

http://stackoverflow.com/q/28779631
has answer: http://stackoverflow.com/a/28779755
type: Question
tagged with: text
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/36568425
has body: I need to insert a space after every four characters while the user is typing a credit card number using JavaScript . &lt;input type="text" size="19" maxlength="19" data-stripe="number" placeholder="1234 5678 9012 3456"&gt; What is the best way to accomplish this ?
upvote count: 9
accepted answer: http://stackoverflow.com/a/28779755
score: 7
has comment: http://stackoverflow.com/comment/45836607
has title: How to insert space after four characters in html input?
has comment: http://stackoverflow.com/comment/45836549
has answer: http://stackoverflow.com/a/69668775
tagged with: javascript
has answer: http://stackoverflow.com/a/40257522
favorite count: 0
has comment: http://stackoverflow.com/comment/45836575
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28779756
has comment: http://stackoverflow.com/comment/45836714
answer count: 4
downvote count: 2
possible better answer: http://stackoverflow.com/a/28779756

http://stackoverflow.com/q/28809531
tagged with: javascript
tagged with: routes
has body: I am writing an app which has many horizontal user flows and we are using a dropdown in the landing page to enable users to choose what they want.. and based on what they select from the dropdown, the submit button must take them to a corresponding view. Something like this: ----value1---------&gt; /userdetails Landing page ----value2---------&gt; /confirm ----value3---------&gt; /moreinfo the number of values might get quite large very soon.They are populated from a RESTful response. I can modify the response to include a type attribute for each option and use a map in JS(attribute:route) to route to dynamic locations. But I think there might be a more robust way to do this.. but cant think of any..Any help ppl?
answer count: 1
downvote count: 0
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/28809635
type: Question
has title: How do I route to a different location based on the values selected from a dropdown in angular?

http://stackoverflow.com/q/28901957
score: 0
accepted answer: http://stackoverflow.com/a/28902328
possible better answer: http://stackoverflow.com/a/28902235
tagged with: cordova
has answer: http://stackoverflow.com/a/28902235
tagged with: sockets
tagged with: node.js
type: AnsweredQuestion
has title: strange thing with timing logic using socket.io, jquery mobile, socket.emit();
has body: I'm working on cordova with node.js socket.io. I found very strange thing happening with socket.emit(); The code below fails, although codings are correct, to enter 'room' client-side jsfile.js //Two global variables which are going to be used for socket connection var deviceUuid =""; var socket =""; $(document).on('pageinit', '#mainPage', function(){ document.addEventListener('deviceready', onDeviceReady, false); }); function onDeviceReady(){ //prepare serverUrl to connect socket to var serverUrl = "http://xxxx:9000"; //prepare device Uuid to send to socket server devceUuid = device.uuid; //should be successful because it's called after the device is ready //connect socket to the server socket = io.connect(serverUrl); //my socket is connected to the server, so I am going to enter the 'room' //Here, I am sending with me the deviceUuid variable. socket.emit('enterRoom', deviceUuid); } server-side Node.js var http= require('http'); var socketio = require('socket.io'); var server = http.createServer(function (request, response){ console.log('server created'); }).listen(9000, function(){ console.log('server running!'); }); //server is ready and it is listening to any incoming client sockets. var io = socketio.listen(server); io.sockets.on('connection', function (socket){ console.log('client entered'); // &lt;------ this shows up in console socket.on('enterRoom', function (deviceUuid){ console.log('client entered a room: ', deviceUuid); &lt;----This doesn't show up in console. socket.join("roomname"); }); }); Since I kept failing to enter room, I thought maybe socket.emit('enterRoom', deviceUuid); is being called too fast that either the variable 'socket' or 'deviceUuid' isn't ready. So I used loops to make sure both of the two variables are set before doing socket.emit(); client-side jsfile.js with LOOP //Two global variables which are going to be used for socket connection var deviceUuid =""; var socket =""; $(document).on('pageinit', '#mainPage', function(){ document.…
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28902328
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/28887353
type: UnansweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/46103053
score: 1
has body: I have a link which, when clicked, opens a kendo UI window. I'd like to align the window with the link. My current logic to do so is: kendoWindow.setOptions({ position: { top: link.position().top + link.height(), left: link.position().left } }); This works in the common case, but doesn't handle things like flowing off the page. Is there a better/more robust way to achieve this?
has answer: http://stackoverflow.com/a/28921583
tagged with: kendo-window
type: Question
tagged with: javascript
tagged with: alignment
upvote count: 1
answer count: 1
has title: How do I align a kendo UI window with another element on the page?
favorite count: 0
tagged with: kendo-ui

http://stackoverflow.com/q/28805377
has answer: http://stackoverflow.com/a/28806278
tagged with: javascript
tagged with: special-characters
has comment: http://stackoverflow.com/comment/45884676
score: 0
has comment: http://stackoverflow.com/comment/45885330
has comment: http://stackoverflow.com/comment/45884053
favorite count: 0
has comment: http://stackoverflow.com/comment/45885447
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45884054
tagged with: php
has title: Javascript variable contains special character
has answer: http://stackoverflow.com/a/28805529
has comment: http://stackoverflow.com/comment/45883955
has comment: http://stackoverflow.com/comment/45884007
tagged with: wordpress
upvote count: 1
has body: I have a Javascript with a variable containing special characters (I'm from DK and we are using three letters æøå). This is the result "fors�ger at skrive det s� langt s�" - so the special characters are replaced with � The content is saved in a variable (b23) in the external javascript and inserted with the following function: document.getElementById("rb-d3-3").innerHTML = b23; Why is this wrong and what is the fix? Maybe I should add that the site is running on a Wordpress Thx
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45884264
answer count: 2
has comment: http://stackoverflow.com/comment/45884345

http://stackoverflow.com/a/28843544
accepted answer of: http://stackoverflow.com/q/28811494
has body: IF you use $('#wpti-product-x').val() and $('#wpti-product-x').val() this will work for you. You may need to edit the unminified version and then minify it again.
answers question: http://stackoverflow.com/q/28811494
score: 1
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0

http://stackoverflow.com/comment/45994899
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28864557
type: QuestionComment
has text: In chrome it seems hold works as long as it isn't preceded by a click. Also doesn't work the first time.

http://stackoverflow.com/a/45339587
upvote count: 11
score: 11
has comment: http://stackoverflow.com/comment/89715850
has body: You can use return { then: function() {} }; .then(function(bool){ if(bool){ deferred.resolve('A'); return { then: function() {} }; // end/break the chain }else{ return checkIf('B'); } }) The return statement returns a "then-able", only that the then method does nothing. When returned from a function in then(), the then() will try to get the result from the thenable. The then-able's "then" takes a callback but that will never be called in this case. So the "then()" returns, and the callback for the rest of the chain does not happen.
downvote count: 0
answers question: http://stackoverflow.com/q/28803287
type: Answer

http://stackoverflow.com/comment/46053265
comment on: http://stackoverflow.com/a/28896754
type: AnswerComment
score: 0
type: Comment
has text: Thank you Joe. What if I insist on using dot?

http://stackoverflow.com/comment/46046316
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28892911
has text: and also change "data.result " to "data"

http://stackoverflow.com/a/28833720
answers question: http://stackoverflow.com/q/28833577
has comment: http://stackoverflow.com/comment/45937440
has comment: http://stackoverflow.com/comment/45937769
has comment: http://stackoverflow.com/comment/45937097
type: AcceptedAnswer
has body: Try this $(".slider").change( function(e){ var b=0; $('.slider').each(function(){ var a=parseInt($(this).val()); b=b+a; }); var avg=b/4; $('#textValue').val(avg); }); Result - Subjektiv eller objektiv? Subjektiv Objektiv Subjektiv eller objektiv? Subjektiv Objektiv Subjektiv eller objektiv? Subjektiv Objektiv Subjektiv eller objektiv? Subjektiv Objektiv
score: 0
has comment: http://stackoverflow.com/comment/45937170
has comment: http://stackoverflow.com/comment/45937229
type: Answer
accepted answer of: http://stackoverflow.com/q/28833577
has comment: http://stackoverflow.com/comment/45937659
has comment: http://stackoverflow.com/comment/45937554
has comment: http://stackoverflow.com/comment/45937378
has comment: http://stackoverflow.com/comment/45937154

http://stackoverflow.com/a/28879306
accepted answer of: http://stackoverflow.com/q/28879153
upvote count: 3
downvote count: 1
has comment: http://stackoverflow.com/comment/46020798
type: AcceptedAnswer
has body: var displayVal = $(textElement).text().replace(/\-?\[s\/c\]/, ""); The code /\-?\[s\/c\]/ is a regular expression, where: / at the start and end are the delimiters of the expression. \ is an escape character, indicating that the following character should be taken literally (in our example we need it in front of -, [, / and ] because those are control character for regular expressions). ? means the previous character is optional. So it replaces an optional dash (-) followed by the text [s/c], with an empty string.
answers question: http://stackoverflow.com/q/28879153
has comment: http://stackoverflow.com/comment/46052142
has comment: http://stackoverflow.com/comment/46051664
type: Answer
score: 2

http://stackoverflow.com/comment/45823047
score: 0
type: AnswerComment
type: Comment
has text: Indeed, `templateUrl` allows to keep the code much more modular.The problem that I am finding with both approaches though is that with respect to the pedantic dummy version, using a directive the binding of the input is not stored. Following the example that I made, the text entered in the device category is not stored in device.category. Same thing for the select...
comment on: http://stackoverflow.com/a/28770190

http://stackoverflow.com/comment/45946453
type: QuestionComment
comment on: http://stackoverflow.com/q/28838352
has text: OK...I am going to make a file demonstrating problem and then post the entire file. Assuming this question does not get closed before then.
score: 0
type: Comment

http://stackoverflow.com/a/28843532
score: 3
upvote count: 3
has body: Based on JavaScript eyedropper (tell color of pixel under mouse cursor), note that each pixel is represented as a 4 element in the array data, i.e. data[0] = red of (0,0), data[1] = green of (0,0), data[2] = blue of (0,0), data[3] = alpha of (0,0), data[4] = red of (0,1), ... var canvas; var x = 200; var y = 200; var dx = 4; var dy = 4; var d = 5; var width, height; function init() { canvasE = document.getElementById('game'); canvas = canvasE.getContext('2d'); width = canvasE.width; height = canvasE.height; canvasE.addEventListener("click", onClick, false); drawCircle(); } function drawCircle() { clear(); canvas.arc(x - 1, y - 1, d, 0, Math.PI * 2, true); canvas.beginPath(); canvas.arc(x - 1, y - 1, d, 0, Math.PI * 2, true); canvas.closePath(); canvas.fill(); canvas.beginPath(); canvas.moveTo(20, 20); canvas.lineTo(150, 100); canvas.stroke(); //check if click coords within current path if (canvas.isPointInPath(x, y)) { document.getElementById("inPath").innerHTML = "yes"; } else { document.getElementById("inPath").innerHTML = "no"; } canvas.closePath(); } function clear() { canvas.fillStyle = "#ffffff"; canvas.fillRect(0, 0, width, height); canvas.fillStyle = "#ff0000"; canvas.strokeRect(0, 0, width, height); } function onClick(e) { var element = canvasE; var offsetX = 0, offsetY = 0 if (element.offsetParent) { do { offsetX += element.offsetLeft; offsetY += element.offsetTop; } while ((element = element.offsetParent)); } x = e.pageX - offsetX; y = e.pageY - offsetY; document.getElementById("info").value = "x: " + x + ", y: " + y; function pixelIndex(x, y) { return 4 * (y * canvasE.width + x); } // data is an array where each 4 elements define a pixed, these are red,green,blue,alpha var data = canvas.getImageData(0, 0, canvasE.width, canvasE.height).data; var pixelIndexStart = pixelIndex(x, y); // only need the first three to see if there's something drawn there var red = 255 - data[pixelIndexStart + 0]; var green = 255 - data[pixelIndexStart + 1]; var blue = 255 - da…
accepted answer of: http://stackoverflow.com/q/28842520
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28842520
type: Answer

http://stackoverflow.com/q/28838656
score: 0
has title: Verify correct port in javascript for wcf service
answer count: 1
tagged with: service
type: UnansweredQuestion
tagged with: wcf
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/28838891
type: Question
tagged with: javascript
has body: I have 10 different port number in for loop in my javascript, and wcf service is hosted on one of port number from listed 10 ports. Is there any way i can check by using loop, on which port number my service responses just fine without any error in javascript using ajax json. Here I have sample code but I want to check this for 10 diff port number:
tagged with: ajax

http://stackoverflow.com/a/28837223
has comment: http://stackoverflow.com/comment/45944066
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28836122
has body: Thanks Bergi for the help. This is how I interpreted your advice and I'll post it as the answer for anyone else who comes along. Please let me know if I'm still doing something wrong here. /********************************* * Constructor *********************************/ function Visualizer( newElement ) { /********************************* * Internal Variables *********************************/ var wrapper, selects, masterSelects; wrapper = $(newElement); selects = wrapper.find( "select" ); masterSelects = wrapper.find( ".master_select" ); /********************************* * Internal Methods *********************************/ this.updatePreview = function( isManual ) { // Default isManual to false if it is not already true if (isManual != true) isManual = false; if(isManual) { masterSelects.css('background-color', 'blue'); console.log(masterSelects); } if(!isManual) { masterSelects = wrapper.find( ".master_select" ); masterSelects.css('background', 'transparent'); masterSelects.css('background-color', 'orange'); //$(".master_select").css('background-color', 'orange'); console.log(masterSelects); } }; // Bind on change events to the select boxes inside the wrapper div this.bindEvents = function() { selects.change( this.updatePreview.bind(this) ); }; } /********************************* * Public Methods *********************************/ // Initialize the Visualizer object Visualizer.prototype.init = function() { this.bindEvents(); this.updatePreview( true ); } /********************************* * Usage *********************************/ $( document ).ready( function() { $( "div.visualizer-wrapper" ).each( function( key, value ) { var vis = new Visualizer( value ); vis.init(); }); });
type: Answer
has comment: http://stackoverflow.com/comment/45944141
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/45944167
accepted answer of: http://stackoverflow.com/q/28836122

http://stackoverflow.com/a/28796473
answers question: http://stackoverflow.com/q/28796318
has comment: http://stackoverflow.com/comment/45867573
type: Answer
accepted answer of: http://stackoverflow.com/q/28796318
upvote count: 1
has comment: http://stackoverflow.com/comment/45867684
has comment: http://stackoverflow.com/comment/45867626
has body: There are two problems I see with your code. 1) you have not put {} brackets around $mysmartyvariable2. This will assign 'undefined' to height2 as smarty will not process this variable at all, and the javascript variable named $mysmartyvariable2 is not defined. 2) you need to use {literal} {/literal} tags anytime you are embedding javascript which uses { } characters, so that smarty does not try to interpret the javascript {} characters as smarty syntax. http://www.smarty.net/docsv2/en/language.function.literal In this case you can start the {literal} tag after the height2 declaration/assignment, as the previous lines SHOULD be interpreted by smarty, but the following lines should NOT be interpreted by smarty. var height2 = {$mysmartyvariable2}; {literal} if (title == 'index') { //code here } // other code {/literal} &lt;/script&gt;
score: 1
has comment: http://stackoverflow.com/comment/45867802
has comment: http://stackoverflow.com/comment/45867561
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/28784471
accepted answer of: http://stackoverflow.com/q/28784254
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45845430
answers question: http://stackoverflow.com/q/28784254
has comment: http://stackoverflow.com/comment/45845638
upvote count: 2
has comment: http://stackoverflow.com/comment/45845753
type: Answer
has body: It would be better to handle each element separately in your case. Here is the code: $("#forenameCheck").change(function() { var isDisabled = !$(this).is(":checked"); $("#forename").prop("disabled", isDisabled); }); $("#surnameCheck").change(function() { var isDisabled = !$(this).is(":checked"); $("#surname").prop("disabled", isDisabled); }); Here is an updated JSFiddle Update I just tried the following code (not in JSFiddle, just in a plain html file) and it works. Forename Surname It seems it is not working in JSFiddle because of how the code is loaded in it. It is giving the following JavaScript error: Uncaught ReferenceError: valueChanged is not defined If you view the source of the JSFiddle output you will see that the JavaScript code is wrapped in window.onload=function(){ and this might be causing issues.
has comment: http://stackoverflow.com/comment/45845838
has comment: http://stackoverflow.com/comment/45845410
score: 1
has comment: http://stackoverflow.com/comment/45845513
has comment: http://stackoverflow.com/comment/45845286
downvote count: 1
has comment: http://stackoverflow.com/comment/45845988

http://stackoverflow.com/a/28827261
accepted answer of: http://stackoverflow.com/q/28826317
type: Answer
answers question: http://stackoverflow.com/q/28826317
downvote count: 0
score: 1
has body: Try this code. var labelr = outerRadius+60; //Draw labels arcs.append("svg:text") .attr("text-anchor", "middle") //center the text on it's origin .style("fill", "Purple") .style("font", "bold 12px Arial") .text(function(d, i) { return dataSet[i].label; }) .attr("x", function(d) { var a = d.startAngle + (d.endAngle - d.startAngle)/2 - Math.PI/2; d.cx = Math.cos(a) * (labelr - 75); return d.x = Math.cos(a) * (labelr - 20); }) .attr("y", function(d) { var a = d.startAngle + (d.endAngle - d.startAngle)/2 - Math.PI/2; d.cy = Math.sin(a) * (labelr - 75); return d.y = Math.sin(a) * (labelr - 20); }) .each(function(d) { var bbox = this.getBBox(); d.sx = d.x - bbox.width/2 - 2; d.ox = d.x + bbox.width/2 + 2; d.sy = d.oy = d.y + 5; }); //Draw pointer lines arcs .append("path") .attr("class", "pointer") .style("fill", "none") .style("stroke", "black") .attr("d", function(d) { if(d.cx &gt; d.ox) { return "M" + d.sx + "," + d.sy + "L" + d.ox + "," + d.oy + " " + d.cx + "," + d.cy; } else { return "M" + d.ox + "," + d.oy + "L" + d.sx + "," + d.sy + " " + d.cx + "," + d.cy; } }); Code refered from d3.js pie chart with angled/horizontal labels
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/q/28892865
has title: real-time html links on github pages?
has body: Is there a way you could render links as a streaming data input w/ css/html or js? Ex: say you have 10 github repos. and you want them all to appear on your webpage in a dropdown(as a series of links). Then user deletes one so only 9 should appear. Is there a name for this or is this possible? *assuming this is being done with github pages.
answer count: 0
type: Question
tagged with: github-pages
tagged with: javascript
score: 0
tagged with: real-time
has comment: http://stackoverflow.com/comment/46046180
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46046271
type: UnansweredQuestion

http://stackoverflow.com/comment/45877609
type: Comment
has text: My php code now looks like this. but the intended functionality is still not achieved. I'm still not getting a response:`$anArray; if (isset($_POST['functionname'])) { $anArray = array('message' => $_POST['functionname']); else $anArray = array('message' => "error"); echo json_encode($anArray);`
score: 0
comment on: http://stackoverflow.com/q/28801644
type: QuestionComment

http://stackoverflow.com/comment/46036658
type: Comment
has text: But then again this function does not return both parts of the string if its dynamic, it will only return the last part. so if I do a replace and prop is an object key that holds content.size and content.price if(group1 ===prop){ return obj[prop]; } then it will only return the price.
comment on: http://stackoverflow.com/a/28851520
type: AnswerComment
score: 0

http://stackoverflow.com/q/28780598
has comment: http://stackoverflow.com/comment/45838415
linked to: http://stackoverflow.com/q/2490825
has title: Color picker dialog in HTML
score: 2
has comment: http://stackoverflow.com/comment/45838287
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45838527
has comment: http://stackoverflow.com/comment/45838449
type: Question
has comment: http://stackoverflow.com/comment/45838465
tagged with: javascript
has answer: http://stackoverflow.com/a/28780667
accepted answer: http://stackoverflow.com/a/28780667
has comment: http://stackoverflow.com/comment/45838253
has body: Using &lt;input type="color"&gt; it is possible to call the system's color picker dialog. That works just fine, but I'd like to use different button for this. Is it possible to manually call the color picker dialog from another element?
downvote count: 0
answer count: 1
favorite count: 0
upvote count: 2
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/45863980
has text: @Bergi - Removing the attribute works just fine in all browsers, it automatically also removes the property as inline `on...` attributes are mapped to the property. Of course, using `addEventListener` is much easier in my opinion
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28793925

d3.js
tags question: http://stackoverflow.com/q/28763300
tags question: http://stackoverflow.com/q/28890714
tags question: http://stackoverflow.com/q/28773281
tags question: http://stackoverflow.com/q/28797761
tags question: http://stackoverflow.com/q/28893630
tags question: http://stackoverflow.com/q/28760079
tags question: http://stackoverflow.com/q/28782799
tags question: http://stackoverflow.com/q/28868093
tags question: http://stackoverflow.com/q/28839161
tags question: http://stackoverflow.com/q/28754842
tags question: http://stackoverflow.com/q/28852757
tags question: http://stackoverflow.com/q/28859545
tags question: http://stackoverflow.com/q/28773458
tags question: http://stackoverflow.com/q/28847443
tags question: http://stackoverflow.com/q/28795977
tags question: http://stackoverflow.com/q/28809862
tags question: http://stackoverflow.com/q/28789176
tags question: http://stackoverflow.com/q/28819463
tags question: http://stackoverflow.com/q/28824152
tags question: http://stackoverflow.com/q/28905993
tags question: http://stackoverflow.com/q/28891115
tags question: http://stackoverflow.com/q/28864595
tags question: http://stackoverflow.com/q/28803576
tags question: http://stackoverflow.com/q/28843420
tags question: http://stackoverflow.com/q/28775198
tags question: http://stackoverflow.com/q/28773113
tags question: http://stackoverflow.com/q/28874957
type: Tag
tags question: http://stackoverflow.com/q/28888510
tags question: http://stackoverflow.com/q/28772965
tags question: http://stackoverflow.com/q/28866366
tags question: http://stackoverflow.com/q/28862914
tags question: http://stackoverflow.com/q/28892649
tags question: http://stackoverflow.com/q/28803811
tags question: http://stackoverflow.com/q/28795771
tags question: http://stackoverflow.com/q/28875479
tags question: http://stackoverflow.com/q/28780813
tags question: http://stackoverflow.com/q/28836275
tags question: http://stackoverflow.com/q/28853717
tags question: http://stackoverflow.com/q/28816605
tags question: http://stackoverflow.com/q/28832428
tags question: http://stackoverflow.com/q/28751167
tags question: http://stackoverflow.com/q/28800895
tags question: http://stackoverflow.com/q/28899650
tags question: http://stackoverflow.com/q/28792925
tags question: http://stackoverflow.com/q/28776283
tags question: http://stackoverflow.com/q/28856090
tags question: http://stackoverflow.com/q/28893129
tags question: http://stackoverflow.com/q/28904585
tags question: http://stackoverflow.com/q/28836035
tags question: http://stackoverflow.com/q/28832618
tags question: http://stackoverflow.com/q/28838835
tags question: http://stackoverflow.com/q/28754247
tags question: http://stackoverflow.com/q/28766504
tags question: http://stackoverflow.com/q/28901098
tags question: http://stackoverflow.com/q/28840104
tags question: http://stackoverflow.com/q/28786562
tags question: http://stackoverflow.com/q/28816009
tag name: d3.js
tags question: http://stackoverflow.com/q/28826317
tags question: http://stackoverflow.com/q/28843210
tags question: http://stackoverflow.com/q/28901742
tags question: http://stackoverflow.com/q/28906126
tags question: http://stackoverflow.com/q/28887697
tags question: http://stackoverflow.com/q/28830088
tags question: http://stackoverflow.com/q/28859177
tags question: http://stackoverflow.com/q/28767904
tags question: http://stackoverflow.com/q/28763928
tags question: http://stackoverflow.com/q/28754273
tags question: http://stackoverflow.com/q/28856544
tags question: http://stackoverflow.com/q/28805119
tags question: http://stackoverflow.com/q/28846982
tags question: http://stackoverflow.com/q/28821168
tags question: http://stackoverflow.com/q/28862587
tags question: http://stackoverflow.com/q/28817137
tags question: http://stackoverflow.com/q/28823152
tags question: http://stackoverflow.com/q/28776942
tags question: http://stackoverflow.com/q/28866587
tags question: http://stackoverflow.com/q/28884446
tags question: http://stackoverflow.com/q/28808114

http://stackoverflow.com/a/28890330
score: 810
has comment: http://stackoverflow.com/comment/93509866
downvote count: 13
has comment: http://stackoverflow.com/comment/89382336
upvote count: 823
has comment: http://stackoverflow.com/comment/64702871
has comment: http://stackoverflow.com/comment/82161004
has comment: http://stackoverflow.com/comment/54380088
has comment: http://stackoverflow.com/comment/84746374
has comment: http://stackoverflow.com/comment/82143377
has comment: http://stackoverflow.com/comment/55777264
accepted answer of: http://stackoverflow.com/q/28889826
type: AcceptedAnswer
has body: You should do it in componentDidMount and refs callback instead. Something like this componentDidMount(){ this.nameInput.focus(); } class App extends React.Component{ componentDidMount(){ this.nameInput.focus(); } render() { return( { this.nameInput = input; }} defaultValue="will focus" /> ); } } ReactDOM.render(<App />, document.getElementById('app'));
has comment: http://stackoverflow.com/comment/46074291
has comment: http://stackoverflow.com/comment/90674436
has comment: http://stackoverflow.com/comment/64623768
answers question: http://stackoverflow.com/q/28889826
has comment: http://stackoverflow.com/comment/99009353
has comment: http://stackoverflow.com/comment/101124696
type: Answer
has comment: http://stackoverflow.com/comment/84701475

http://stackoverflow.com/q/28817166
favorite count: 0
has title: Firefox Addon PKCS#11 API
has answer: http://stackoverflow.com/a/28836473
tagged with: firefox-addon-sdk
score: 2
type: AnsweredQuestion
upvote count: 2
tagged with: pkcs#11
has body: I want to access the currenly connected cryptography modules via an Firefox Addon. I found some interfaces that look like i can access the module, the slot and the token (1 → 2 → 3 → 4) but how can i access the public key of an certificate stored on such a token? Is there an such an API even available to an Addon?
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28836473
has comment: http://stackoverflow.com/comment/45906797
tagged with: firefox-addon
downvote count: 0
answer count: 1

http://stackoverflow.com/a/28774976
has body: I have Uncaught ReferenceError: $ is not defined. jQuery not defined, but you can use $(document).ready(function() { document.getElementsByName('btn_submit')[0].click(); }); in your readyState loop.
has comment: http://stackoverflow.com/comment/45828204
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/45828234
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45828188
answers question: http://stackoverflow.com/q/28774372

http://stackoverflow.com/a/61221943
answers question: http://stackoverflow.com/q/28868071
downvote count: 0
has body: If you are using select as inline to other component, then you can also use like given below. this.handlePeriodChange(val.target.value)} className="btn btn-sm btn-outline-secondary dropdown-toggle"> Today This Week This Month This Year Last Availabe NAV Day And on the component where select is used, define the function to handle onChange like below: handlePeriodChange(selVal) { this.props.handlePeriodChange(selVal); }
type: Answer
score: 4
upvote count: 4

http://stackoverflow.com/comment/46270250
comment on: http://stackoverflow.com/q/28879784
has text: @AsGoodAsItGets I don't have a complete answer (and i doubt very many people will.) Instead, i gave you enough direction to accomplish it on your own.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45910066
has text: thank you alexander but how can i make this with my animation?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28819013

http://stackoverflow.com/q/28859083
tagged with: javascript
has answer: http://stackoverflow.com/a/28895656
has title: How to get composed DOM of Polymer Web Component?
tagged with: web-component
answer count: 1
has comment: http://stackoverflow.com/comment/45985405
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28895656
type: AnsweredQuestion
score: 0
type: Question
tagged with: polymer
has body: I'm using Polymer 0.8-preview. For example, I have the following component: {{s.what}}: Is it possible to get the composed DOM (as JS object or text) at some point of the component life cycle? For the example above I would like to get Hello: GoodBye: In other words, I need the result of processed template.

http://stackoverflow.com/comment/54638844
type: AnswerComment
has text: Learn english and understanding questions - noone said sth. about jQuery, he even explicitly wrote "in CSS". Secondly it's obvious how to do it in jQuery if you know the CSS. ;)
type: Comment
comment on: http://stackoverflow.com/a/28768498
score: 0

http://stackoverflow.com/comment/45812672
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28766628
has text: `world = {}; world[-10] = {}; world[-10][-10] = 0`. You'd have to maintain your own `length` property, and `Array.prototype` methods (if you need anything like `forEach` on your `world`). That could be done at generation or with custom method to add coordinate to `world`, or with setters/getters. I don't think there would be much penalty performance-wise compared to `Array[Array]`, since arrays are basically objects with different prototypes.

http://stackoverflow.com/comment/45988836
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28861488
has text: @Andre Total solution added.
type: Comment

http://stackoverflow.com/a/28903233
score: 3
type: AcceptedAnswer
downvote count: 0
has body: Look at using media queries in your CSS, such as: @media screen and (max-width: 300px) { background-color: red; } @media screen and (max-width: 600px) { background-color: blue; } @media screen and (max-width: 1000px) { background-color: yellow; } These sizes are just examples, for a more detailed description I suggest looking here
type: Answer
accepted answer of: http://stackoverflow.com/q/28903175
upvote count: 3
answers question: http://stackoverflow.com/q/28903175
has comment: http://stackoverflow.com/comment/46066337

http://stackoverflow.com/q/28798465
favorite count: 0
answer count: 3
has answer: http://stackoverflow.com/a/28798604
has comment: http://stackoverflow.com/comment/45958511
possible better answer: http://stackoverflow.com/a/28818312
has answer: http://stackoverflow.com/a/28799204
accepted answer: http://stackoverflow.com/a/28799204
tagged with: instance
upvote count: 1
has comment: http://stackoverflow.com/comment/45873282
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28818312
has body: How can I find how many instances there are for a certain prototype? For example, I define a prototype like so in javascript: var foo = function(config) { this.x = config.x; ... } foo.prototype.update = function() { ... } var f = new foo(...); var c = new foo(...); ... How can I make it so there's a function that returns 2, because there are 2 instances of foo: f and c?
tagged with: prototype
type: Question
downvote count: 0
has title: Finding how many instances there are of a certain prototype, in javascript
tagged with: javascript
has comment: http://stackoverflow.com/comment/45908437

http://stackoverflow.com/q/28814293
tagged with: javascript
has body: Can anyone tell me what am I doing wrong. My HTML Form: Miles Login My Express Route: app.put('/user/:id', function(req, res) { User.findById(req.body.params.id, function(err, user) { if (err) res.send(err); console.log(user.id); User.findByIdAndUpdate( user.id, {$push: {"milesLog": {miles: req.body.miles}}}, {safe: true, upsert: true}, function(err, model) { console.log(err); }, res.json(user) ); Posting from my HTML form I get the following Error: Cannot GET /user?miles=66&activity=asdasd But When I test this through POSTMAN it works: What am I doing wrong. Why doesn't it work from my HTML Form?
tagged with: express
score: 0
answer count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28816392
tagged with: node.js
has answer: http://stackoverflow.com/a/28814504
type: Question
has title: Mongoose $push from HTML Form not working
linked to: http://stackoverflow.com/q/28811905
tagged with: mongodb
tagged with: mongoose

http://stackoverflow.com/q/28761365
tagged with: bluebird
downvote count: 0
linked to: http://stackoverflow.com/q/22519784
has answer: http://stackoverflow.com/a/28762994
has body: Short story: Talking about Promises/A+, what is the proper way to reject a promise - throwing an error? But if I miss the catch - my whole app will blow! How to use promisify and what are the benefits of it (maybe you'll need to read the longer version)? Is .then(success, fail) really an anti-pattern and should I always use .then(success).catch(error)? Longer version, described as real life problem (would love someone to read): I have a library that uses Bluebird (A+ Promise implementation library), to fetch data from database (talking about Sequelize). Every query returns a result, but sometimes it's empty (tried to select something, but there wasn't any). The promise goes into the result function, because there is no reason for an error (not having results is not an error). Example: Entity.find(1).then(function(result) { // always ending here, despite result is {} }).catch(function(error) { // never ends here }); I want to wrap this and check if the result is empty (can't check this everywhere in my code). I did this: function findFirst() { return Entity.find(1).then(function(result) { if (result) { // add proper checks if needed return result; // will invoke the success function } else { // I WANT TO INVOKE THE ERROR, HOW?! :) } }).catch(function(error) { // never ends here }); } findFirst().then(function(result) { // I HAVE a result }).catch(function(error) { // ERROR function - there's either sql error OR there is no result! }); If you are still with me - I hope you will understand what's up. I want somehow to fire up the error function (where "ERROR function" is). The thing is - I don't know how. I've tried these things: this.reject('reason'); // doesn't work, this is not a promise, Sequelize related return new Error('reason'); // calls success function, with error argument return false; // calls success function with false argument throw new Error('reason'); // works, but if .catch is missing =&gt; BLOW! As you can see by my comments (and per spec), throwing …
has comment: http://stackoverflow.com/comment/45804056
has comment: http://stackoverflow.com/comment/45803606
type: Question
has comment: http://stackoverflow.com/comment/45803892
has comment: http://stackoverflow.com/comment/45805161
has title: How to reject (and properly use) Promises?
tagged with: javascript
has comment: http://stackoverflow.com/comment/45804029
score: 12
has comment: http://stackoverflow.com/comment/45802823
has comment: http://stackoverflow.com/comment/45802941
answer count: 2
has comment: http://stackoverflow.com/comment/45804017
favorite count: 0
tagged with: promise
linked to: http://stackoverflow.com/q/23803743
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45804395
linked to: http://stackoverflow.com/q/28709666
has comment: http://stackoverflow.com/comment/45804239
tagged with: node.js
upvote count: 12
has answer: http://stackoverflow.com/a/28763225
linked to: http://stackoverflow.com/q/24662289

http://stackoverflow.com/comment/46008952
comment on: http://stackoverflow.com/a/28873003
type: Comment
has text: if `$('#example')` is a datatable AND is created will work, if not, you must create first datatable and then change css value with `prop`
score: 0
type: AnswerComment

http://stackoverflow.com/a/28868479
score: 0
has comment: http://stackoverflow.com/comment/46001306
type: Answer
answers question: http://stackoverflow.com/q/28868399
has body: If you want to output the two other pictures in a different id, you also need to edit the JavaScript that identifies those HTML elements. For example document.getElementById('list2').insertBefore(span, null); or document.getElementById('files').addEventListener you can add new HTML elements for the outputs to the main HTML page &lt;output id="list2"&gt;&lt;/output&gt;

http://stackoverflow.com/comment/46012967
type: Comment
has text: All right, sound to me that it will work for this too.
type: AnswerComment
comment on: http://stackoverflow.com/a/28875182
score: 0

http://stackoverflow.com/comment/46052700
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28875793
type: QuestionComment
has text: `from smart_selects.db_fields import ChainedForeignKey class Contract(models.Model): person = models.ForeignKey(Person) mod_contratos = ChainedForeignKey( Contract chained_field="person", chained_model_field="person", show_all=False, auto_choose=True )` And I get [this](http://pastebin.com/aVHxebgT) error.

http://stackoverflow.com/comment/45990636
comment on: http://stackoverflow.com/q/28861813
score: 0
type: QuestionComment
type: Comment
has text: You're telling the browser to submit the form on a change, and then ask us how to stop this :) remove the line that submits it: $('form#myForm').submit();

http://stackoverflow.com/comment/46052097
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28874306
has text: I was thinking knowing I'd only query the database and not add anything in it, I wouldn't define the attributes for each model/table.
score: 0

http://stackoverflow.com/comment/45991244
type: AnswerComment
comment on: http://stackoverflow.com/a/28862403
has text: It doesn't work with 1.2.17 plunkr here http://plnkr.co/edit/fzAISgUa7OCQfWoerPz8?p=preview, how you got it worked
type: Comment
score: 0

http://stackoverflow.com/comment/45898073
comment on: http://stackoverflow.com/q/28812805
has text: are you loading the emulator and then clicking it immediately? it might be freezing if there wasn't a previous page to go back to.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28846656
tagged with: jquery
favorite count: 0
has body: I'm kind of new at this and i've been stuck trying to make a web script game. I have twelve cards that randomly generate, and I can't seem to write in javascript or jquery a way to make all three cards disappear and get replaced by three new random images from an array. Looking for a way to add this at the end of my code. Any help will be much appreciated. Thank you in advance! function getRandomImage(imgAr, path) { //getRandomImage is the load script of the twelve random cards generated for (i=1;i&lt;13;i++) { path = path || 'images/'; // default path here var num = Math.floor( Math.random() * imgAr.length ); //generating a random img url var img = imgAr[ num ]; imgAr.splice(num, 1) // so that it won't duplicate the same image var imgStr = '&lt;button type=button id=replacedCards onclick=replacedCards(set_array)&gt;\n' + '&lt;div class=boxNum' + i + '&gt;' + '\n' + '&lt;img src="' + path + img + '" class = "pic"&gt;' + '\n' + '&lt;/div&gt;' + '\n' + '&lt;/button&gt;'; oldCards.push(imgStr); document.write(imgStr); oldCards.splice(0, 12); } } $(document).ready(function() { $('button').click(function() { var url = $(this).find('.pic').attr('src'); new_array.push(url); if ((new_array.length == 3) &amp;&amp; ((color(new_array) == false) || (shape(new_array)== false) || (pattern(new_array)==false) || (quantity(new_array)==false))) { new_array.splice(0, 3); alert('This is not a set!'); } else if ((new_array.length == 3) &amp;&amp; ((color(new_array)==true) &amp;&amp; (shape(new_array)==true) &amp;&amp; (pattern(new_array)==true) &amp;&amp; (quantity(new_array)==true))) { alert('This is a set!'); rps(); new_array.splice(0,3); } }) })
score: 2
answer count: 0
upvote count: 2
type: UnansweredQuestion
type: Question
has title: Replacing images with new random images from an array when user clicks on 3 images
downvote count: 0
tagged with: javascript

ruby-on-rails-4
type: Tag
tags question: http://stackoverflow.com/q/28760633
tags question: http://stackoverflow.com/q/28815164
tags question: http://stackoverflow.com/q/28755540
tags question: http://stackoverflow.com/q/28885133
tags question: http://stackoverflow.com/q/28838011
tags question: http://stackoverflow.com/q/28805312
tags question: http://stackoverflow.com/q/28870567
tags question: http://stackoverflow.com/q/28871686
tags question: http://stackoverflow.com/q/28810378
tags question: http://stackoverflow.com/q/28751532
tag name: ruby-on-rails-4

http://stackoverflow.com/comment/46071877
type: QuestionComment
has text: Panoramio API seems to be deprecated: https://developers.google.com/maps/documentation/javascript/panoramiolayer
comment on: http://stackoverflow.com/q/28899935
score: 1
type: Comment

http://stackoverflow.com/comment/45976276
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28855074
has text: I meant that I would like to add function to existing code, without any changes.

http://stackoverflow.com/a/28787618
answers question: http://stackoverflow.com/q/28787320
has body: I used to have problems with this. Right now, as far as CF is concerned, your availWidth variable contains a string variable which just happens to be a javascript fragment. CF doesn't evaluate this (because it can't) and passes the text as-is to the web server (when you invoke #availWidth#) and thus to the browser. The browser sees that the text is javascript, and evaluates it as 1366; but as far as CF is concerned, it's simply text&mdash;which is why you get an error trying to multiply by 2. The only way to make the CF server aware of the javascript variable is to pass the 1366 back to another page via (e.g.) an Ajax request. But then your current CF template isn't aware of it. Ben Nadel has a great discussion of the problem.
type: AcceptedAnswer
upvote count: 5
score: 4
type: Answer
accepted answer of: http://stackoverflow.com/q/28787320
downvote count: 1

http://stackoverflow.com/q/28864692
has comment: http://stackoverflow.com/comment/45996669
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45995331
has comment: http://stackoverflow.com/comment/45994533
tagged with: javascript
has comment: http://stackoverflow.com/comment/45994552
has answer: http://stackoverflow.com/a/28865188
downvote count: 0
has comment: http://stackoverflow.com/comment/45995079
answer count: 1
has body: Cookies should be created for the following fields: fname, lname, street, city, state, zip, email, and phone1-3. Persistent cookies should be created which are valid for 1 year. When the user returns to the page, cookies should be read and the individual form field values restored to the saved cookie values. Choose ( ) -
has comment: http://stackoverflow.com/comment/45994579
favorite count: 0
has title: creating cookies using raw javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45994765
tagged with: cookies
score: 1

http://stackoverflow.com/q/28889783
downvote count: 0
tagged with: jquery
has comment: http://stackoverflow.com/comment/78511191
favorite count: 0
has comment: http://stackoverflow.com/comment/46113139
has comment: http://stackoverflow.com/comment/46113272
has answer: http://stackoverflow.com/a/55531213
type: AnsweredQuestion
score: 1
linked to: http://stackoverflow.com/q/26771549
upvote count: 1
has comment: http://stackoverflow.com/comment/78539417
has comment: http://stackoverflow.com/comment/65870820
type: Question
tagged with: javascript
has title: Google Maps Javascript API v3 map displays on desktop browser but won't display on mobile browser
accepted answer: http://stackoverflow.com/a/55531213
tagged with: google-maps-api-3
linked to: http://stackoverflow.com/q/16029133
tagged with: google-maps-markers
has body: I'm developing an app that displays a map using Google Maps Javascript API v3, and it displays the way it's supposed to on my desktop browser, but it doesn't on my mobile's browser. So, I've checked this: My Google Map javascript code displays on desktop browser but not my mobile phone browser And this: Javascript Google Maps API loading in Web Browser but not Android Browser It was everything I could find relating to my issue, but both of these had a similar problem which was that they were passing navigator.geolocation.getCurrentPosition() as a parameter to their initialize function or something like that, instead of passing initialize as the callback for getCurrentPosition(). I've also seen someone with the same issue that was being caused because they were asking for the current position before the document had loaded, which is also not my issue, for I'm calling getCurrentPosition() from jQuery's $(document).ready(). Here's my code, any help is greatly appreciated: &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=true"&gt; &lt;/script&gt; &lt;script type="text/javascript"&gt; function initialize(location) { console.log(location); var currentLocation= new google.maps.LatLng(location.coords.latitude, location.coords.longitude); var mapOptions = { center: currentLocation, zoom: 17, disableDefaultUI:true, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions); var marker= new google.maps.Marker({ position:currentLocation, map: map }); } $(document).ready(function(){ navigator.geolocation.getCurrentPosition(initialize); }); &lt;/script&gt;
answer count: 1

http://stackoverflow.com/comment/45808270
comment on: http://stackoverflow.com/a/28764676
type: Comment
score: 0
type: AnswerComment
has text: seems exactly what I need

http://stackoverflow.com/comment/46208005
type: QuestionComment
has text: @Kaiido - yes backgroundImage is better syntax. If I clear the interval it ceases to continue polling the page status, so it won't fire on the next page navigation.
comment on: http://stackoverflow.com/q/28846870
score: 0
type: Comment

http://stackoverflow.com/comment/45833523
type: AnswerComment
score: 0
has text: so instead of function(b) using the parsefloat method? $.get("http://99.236.215.227:7379/hget/Pool_Stats:CurrentShift:WorkerBTC/" + a + ".txt", parseFloat(b).toFixed(8) {$(".payout").text(b)
type: Comment
comment on: http://stackoverflow.com/a/28777785

http://stackoverflow.com/comment/45968749
has text: or to keep the mouse pointer on hover
comment on: http://stackoverflow.com/a/28850406
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/43812565
answers question: http://stackoverflow.com/q/28846814
type: Answer
upvote count: 4
downvote count: 0
score: 4
has body: The webpack2 documentation explains this in a much cleaner way: https://webpack.js.org/guides/public-path/#use-cases webpack has a highly useful configuration that let you specify the base path for all the assets on your application. It's called publicPath.

http://stackoverflow.com/comment/45974363
has text: You need to check the response from `events.php`. Do you have a valid json object? Does that object have the events you're trying to show?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28852189
type: Comment

http://stackoverflow.com/q/28807621
score: 1
type: Question
has comment: http://stackoverflow.com/comment/45888060
has comment: http://stackoverflow.com/comment/45888148
tagged with: javascript
tagged with: jquery
has body: I have an exception when run a jQuery application only on IE8. I get an error "Array.prototype.slice isn´t a Javascript object" at the beginning of the execution of the webpage. I tried to get more information about the object and i got from the debbuger it is an object DispHTMLWindow2. Then i have tried to make breakpoints for all calls of jQuery on the code and i get the same type of object in a jquery ajax call. I tried to fix it without success. function ajax(uri, method, data, username, password) { var request = { url: uri, type: method, contentType: "application/json", accepts: "application/json", cache: false, dataType: 'json', data: JSON.stringify(data), beforeSend: function (xhr) { xhr.setRequestHeader("Authorization", "Basic " + encodeForIE9(username + ":" + password)); }, error: function(jqXHR) { console.log("ajax error " + jqXHR.status); } }; return $.ajax(request); } encodeForIE9 is a function for IE8 and IE9 that code the ajax request in base64. function encodeForIE9(){ if (!window.btoa) { window.btoa = function(mensaje) { return Base64.encode(mensaje); } } } Any idea about how to fix this error ?
tagged with: ajax
has comment: http://stackoverflow.com/comment/45897718
has title: jquery [object DispHTMLWindow2] issue IE8
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46011316
downvote count: 0
tagged with: internet-explorer-8

http://stackoverflow.com/comment/46063021
type: Comment
comment on: http://stackoverflow.com/a/28898927
type: AnswerComment
score: 0
has text: pouchdb:api test-db +13s info { [functions]: , __proto__: { }, outcome: undefined, queue: [ ], state: [[ 0: "PENDING", length: 1 ] }

http://stackoverflow.com/a/28753147
type: Answer
has body: The full calendar during initialization may need some DOM elements that aren't visible. Running fullcalendar after click is correct solution: $('#viewAvailableAppointments').click(function () { $('#page-four').slideUp(500); $('.calendar').show(); $('.calendar').fullCalendar({ header: { left: 'prev,next today', center: 'title', right: 'month,agendaWeek,agendaDay' }, editable: true }) })
answers question: http://stackoverflow.com/q/28752851
score: 0

http://stackoverflow.com/comment/46061491
type: QuestionComment
has text: Do you know in advance which 5 drugs you want in your pie chart ?
comment on: http://stackoverflow.com/q/28882883
score: 0
type: Comment

http://stackoverflow.com/comment/45941123
type: QuestionComment
comment on: http://stackoverflow.com/q/28835271
score: 1
has text: Does this exist anywhere for testing? Are you able to access /Product/storeProductInSession/ directly in a browser and get a result?
type: Comment

http://stackoverflow.com/a/28888413
upvote count: 13
has body: Adding headers: {'Content-Type': 'text/plain;charset=UTF-8'}, To AJAX function ajaxUsingPresignedUrlPut() { $.ajax({ url: presignedURLPUT, type: 'PUT', data: 'blah blah blah', headers: {'Content-Type': 'text/plain;charset=UTF-8'}, success: function () { console.log('Uploaded data successfully.'); } }).done(function (data) { console.log("DONE : " + data); }).fail(function (arg1, arg2) { console.log("FAIL"); }); } And setting content type while generating the URL fixed the issue GeneratePresignedUrlRequest request = new GeneratePresignedUrlRequest(bucketName, KEY); request.setContentType("text/plain;charset=UTF-8"); //...
has comment: http://stackoverflow.com/comment/52244380
has comment: http://stackoverflow.com/comment/85920958
answers question: http://stackoverflow.com/q/28871669
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/61619049
accepted answer of: http://stackoverflow.com/q/28871669
type: Answer
score: 13

handlebars.js
tags question: http://stackoverflow.com/q/28801426
tags question: http://stackoverflow.com/q/28863097
tags question: http://stackoverflow.com/q/28814817
tags question: http://stackoverflow.com/q/28889064
tags question: http://stackoverflow.com/q/28852107
tags question: http://stackoverflow.com/q/28793037
tags question: http://stackoverflow.com/q/28897497
tags question: http://stackoverflow.com/q/28796884
type: Tag
tags question: http://stackoverflow.com/q/28896278
tag name: handlebars.js
tags question: http://stackoverflow.com/q/28892887
tags question: http://stackoverflow.com/q/28802932
tags question: http://stackoverflow.com/q/28871063
tags question: http://stackoverflow.com/q/28845461
tags question: http://stackoverflow.com/q/28796459

http://stackoverflow.com/comment/46051242
comment on: http://stackoverflow.com/q/28895654
score: 0
has text: what is dateDisplay which control's id ? provide html please
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28781146
has title: Load first 15 seconds of vimeo video
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45839216
has body: I have a webpage, where i only need to show the first 15 seconds of a video, inside a bootstrap modal box. I have already made box load the video, but i need it, to only load 15 seconds? I used this example to load the video: http://jsfiddle.net/n90Lexgc/ $('.js-play').click(function(){ var vid_num = $(this).data('vid'); var vid_src = 'https://player.vimeo.com/video/'+vid_num; $('#myModal').modal('show'); $('#myModal iframe').attr('src', vid_src); })
linked to: http://stackoverflow.com/q/19407215
has answer: http://stackoverflow.com/a/63477605
downvote count: 0
tagged with: vimeo
tagged with: twitter-bootstrap
score: 1
type: Question
has comment: http://stackoverflow.com/comment/45881773
tagged with: javascript
tagged with: vimeo-api
tagged with: vimeo-player
upvote count: 1
answer count: 1
favorite count: 0

http://stackoverflow.com/q/28842153
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/11922383
tagged with: http://stackoverflow.com/tag/json
has title: Retrieve a key value from JSON
answer count: 3
possible better answer: http://stackoverflow.com/a/28842320
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28842320
favorite count: 0
has answer: http://stackoverflow.com/a/28842288
has answer: http://stackoverflow.com/a/28842404
score: 2
upvote count: 2
has body: I've got a Calendar. Inside its code there's an Object and a JSON to it, which contains several properties such as [{"Date":"17-3-2015","Event":"Test drive","Participants":"John, George","Description":"Testing a new F30"}, {"Date":"17-3-2015","Event":"Football match","Participants":"FCSM vs FCKK","Description":"New season start"}, {"Date":"25-3-2015","Event":"Jane's Birthday","Participants":"Jane, John, Richard, Alice","Description":"Celebration with my friends"}] But since that data is in localStorage I retrieved it via var existEvents = JSON.parse(localStorage.getItem('events')); for(i=0; i&lt;existEvents.length; i++) { var item = localStorage.getItem(localStorage.key(i)); console.log(item); }; existEvents = every new event in my Calendar console.log(item); returns me the data typed above. What I need is to retrieve every Date value (= key). So I pretend that item.Date must work, but it doesn't. As well as item[0].value I tried it after having read this question + answers Access / process (nested) objects, arrays or JSON What am I doing wrong? Please, help!
tagged with: local-storage
accepted answer: http://stackoverflow.com/a/28842288
type: Question

http://stackoverflow.com/q/28853230
downvote count: 0
tagged with: jquery
favorite count: 0
has body: I have list elements that have no-wrap. These are inside a list that is in a fixed-size div with overflow:hidden;overflow-y:auto so that it is able to scroll. Text is cropped to the right as you would expect. I am trying to show the "long" version of text that overflows a div as you mouse over. This relies pretty much on if (0 &gt; e.target.clientWidth - e.target.scrollWidth) { (where e.target is the LI in a mouseover event). Here's the basic principal working like I want (warning: ugly hack, improvements welcomed). http://jsfiddle.net/h3yzhby0/ However, I'm stuck with scrolling. When I mouse over the element, it's added to the body since that is higher in z-order than the wrapper div (it's after it in dom and has a position:fixed) - it appears above the scrollbar for the div, as I need. When the mouse is over this element, I want the mouse wheel [and keyboard arrows which I haven't yet coded] to continue to scroll the div up and down. The event doesn't "bubble" from the mouse-over div because it's not of the same parent / node (and can't be, because of the overflow requirement). Is there a way to pass or re-trigger the mousewheel event on a specific object (e.g. pass the event) ?
upvote count: 2
has answer: http://stackoverflow.com/a/28853813
type: AnsweredQuestion
score: 2
accepted answer: http://stackoverflow.com/a/28853813
type: Question
has title: show text that is wider than the container, problems scrolling
tagged with: javascript
answer count: 1

http://stackoverflow.com/q/28790458
has body: I have the following html that I like to parse through Cheerios. var $ = cheerio.load(' This works well. So I have been doing this for several hours. How come the space does not split? Thinking that this could be an issue. Testing next paragraph. Im testing with another post. This post should work. This is for test server. ', { normalizeWhitespace: true, }); // trying to parse the html // the goals are to // 1. remove all the 'div' // 2. clean up into // 3. Have all the new 'empty' element added with 'p' var testData = $('div').map(function(i, elem) { var test = $(elem) if ($(elem).has('br')) { console.log('spaceme'); var test2 = $(elem).removeAttr('br'); } else { var test2 = $(elem).removeAttr('div').add('p'); } console.log(i +' '+ test2.html()); return test2.html() }) res.send(test2.html()) My end goals are to try and parse the html remove all the div clean up and change into and finally have all the empty 'element' (those sentences with 'div') remove to be added with 'p' sentence '/p' I try to start with a smaller goal in the above code I have written. I tried to remove all the 'div' (it is a success) but I'm unable to to find the 'br. I been trying out for days and have no head way. So I'm writing here to seek some help and hints on how can I get to my end goal. Thank you :D
tagged with: node.js
upvote count: 13
favorite count: 0
accepted answer: http://stackoverflow.com/a/28791727
score: 13
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28790488
type: Question
tagged with: cheerio
answer count: 2
has title: How to remove and using Cheerio js?
possible better answer: http://stackoverflow.com/a/28790488
downvote count: 0
has answer: http://stackoverflow.com/a/28791727
tagged with: javascript

http://stackoverflow.com/q/28811062
has comment: http://stackoverflow.com/comment/46100395
has comment: http://stackoverflow.com/comment/46027146
score: 0
has comment: http://stackoverflow.com/comment/45896562
has comment: http://stackoverflow.com/comment/45915415
has body: I have a program that allows the user to select multiple items for a trip. Part of the program maps the items in google maps. I am using the lat/long coordinates to generate the waypoints and then the API takes it from there. The final map shows the route and markers. I would like to give each marker a custom name instead of the default street address currently being displayed. Is this possible? //Display the route on the map $.post("processors/getMapWayPoints.php",{ tripID: tripID }, function(e){ console.log("Return is " + e); latlong = JSON.parse(e); //iterate through each locations lat/long and add it to the mappoints array for the route plotting for(var i = 0; i &lt; latlong.length; i+=3){ var name = latlong[i]; var lat = latlong[i+1]; var lng = latlong[i+2]; //create google lat/long point object var pt = new google.maps.LatLng(lat, lng); //add the location to the array for the route mappoints.push({location:pt, stopover:true}); //not being used yet pointNames.push(name); } var mapOptions = { zoom:11, center: home } map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions); directionsDisplay.setMap(map); var request = { origin:home, destination:home, waypoints: mappoints, //optimizeWaypoints: true, travelMode: google.maps.TravelMode.DRIVING }; directionsService.route(request, function(result, status) { if (status == google.maps.DirectionsStatus.OK) { directionsDisplay.setDirections(result); } }); });
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46025497
has comment: http://stackoverflow.com/comment/45915170
answer count: 0
has comment: http://stackoverflow.com/comment/46068663
has title: Google Maps API, Setting a name of marker when getting directions
type: Question
tagged with: google-maps
tagged with: javascript
has comment: http://stackoverflow.com/comment/46100330

http://stackoverflow.com/comment/45883164
score: 0
type: Comment
type: QuestionComment
has text: Not only it is possible, but that's the whole point of AngularJS. But that would be more like website.com/product/product01
comment on: http://stackoverflow.com/q/28804891

http://stackoverflow.com/comment/45841709
has text: Also, the validation logic on the *server* will need to compare against times that are valid for the server's time zone, or UTC. You wont be able to use the same validation logic on both client and server. This answer only addresses client validation.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28771889
type: Comment

http://stackoverflow.com/comment/45983070
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28858425
type: Comment
has text: You add an @media print { } directive in our stylesheet (or set it up as a separate stylesheet file if you want) and apply your styling in there. You can view it in Print Preview without printing. It's only applied during the print operation, so your display styling isn't affected.

http://stackoverflow.com/comment/46010322
comment on: http://stackoverflow.com/q/28873867
score: 0
type: Comment
has text: what is the value of preview
type: QuestionComment

http://stackoverflow.com/comment/46014952
comment on: http://stackoverflow.com/q/28869287
has text: I have write code my [Plunk](http://plnkr.co/edit/17700XE28uBppNatt5CH?p=preview&s=Un96C2bsRS9TwHAD). please for review. Thanks@isherwood
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28848157
has answer: http://stackoverflow.com/a/28848477
tagged with: javascript
has answer: http://stackoverflow.com/a/28848652
answer count: 3
has body: I have an element (#cols) that's 3x wider than the &lt;body&gt;. It has 3 columns, each of which is exactly as wide as &lt;body&gt;. Clicking a button slides the #cols element over by the width of one column and simultaneously focuses the &lt;input&gt; in the column that's sliding into view: http://jsbin.com/puhurakewa/1/edit?html,css,js,output The problem, as you can see from the demo, is that focusing the input causes weird behavior. I believe the browser says, "Crap, the user focused an input that's off-screen. I need to show it!" and then magically scrolls the input into view. This breaks the transition. Is there a way to disable this behavior? It's extremely undesirable. I've noticed it in Chrome, Safari, and Firefox on my Mac. EDIT: Thank you for the answers so far. I should have been more specific with my question. I'm aware that I can "work around" this issue by waiting for the animation to end, but what I'm curious about is how to work through this issue and focus the input immediately. It's a better experience, because users can begin typing before the transition is over.
downvote count: 0
favorite count: 0
tagged with: onfocus
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: How can I focus an input that's sliding in from off the screen?
has answer: http://stackoverflow.com/a/36375551
has comment: http://stackoverflow.com/comment/63968794
has comment: http://stackoverflow.com/comment/63670823
type: Question
score: 5
upvote count: 5

http://stackoverflow.com/a/28859335
downvote count: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28859277
has comment: http://stackoverflow.com/comment/45985457
answers question: http://stackoverflow.com/q/28859277
type: Answer
score: 3
upvote count: 3
has body: The issue is that the scroll event does not bubble up the DOM, so delegation with live(), on() or delegate() won't work. You will have to bind the event handler to the dynamically-created element yourself. Reference

http://stackoverflow.com/comment/57158851
type: AnswerComment
comment on: http://stackoverflow.com/a/28873205
type: Comment
has text: Hmm struggled with this for a good day, still didn't work for me in r71, but updated the library to r73 (newest at this point) at it works.
score: 0

http://stackoverflow.com/q/28826171
has comment: http://stackoverflow.com/comment/45922917
favorite count: 0
type: UnansweredQuestion
has title: Draw google maps polygons
has comment: http://stackoverflow.com/comment/45922889
answer count: 0
type: Question
tagged with: polygon
tagged with: google-maps
tagged with: javascript
linked to: http://stackoverflow.com/q/24047932
score: 0
has body: How I can draw polygons on google maps using javascript. I'm interested to draw some thing like the below polygons on the picture, and avoid drawing the above polygons. My idea is to draw only polygons with lines uncrossed, how i can control that?
upvote count: 1
downvote count: 1

http://stackoverflow.com/q/28904215
upvote count: 0
tagged with: javascript
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
score: -2
has comment: http://stackoverflow.com/comment/46067927
favorite count: 0
has body: im trying to switch the stylesheet.css and the content section at the same time, if the user click on a Section on the Top-menue bar. If I do one of them alone, it works fine, but both together will not work at the moment. In my index.php I have a function that set the Stylesheet: In the Menu.php is the code for changing the section and it also calls the function above. The Categories are in a list. Games With the return false statement the Style switch correct, but not the Content selection. And if I remove the return false statement the Content is correct but the Style switches only for a little moment. Can somebody help me, please!
type: Question
downvote count: 2
tagged with: php
answer count: 1
has comment: http://stackoverflow.com/comment/46067951
has comment: http://stackoverflow.com/comment/46068033
has answer: http://stackoverflow.com/a/28905369
has title: Switch Stylesheet and Content Section with one click

http://stackoverflow.com/comment/45836434
type: Comment
comment on: http://stackoverflow.com/a/28779014
score: 0
type: AnswerComment
has text: Awesome. Its working now . I hope soon you can find me a way to use external cross domain txt file :)

http://stackoverflow.com/a/28890429
has body: The way to resolve this is to use the special option of focusTarget: 'category' Google dev docs However, there also looks to be a bug with this setting on the Materials version of the code ( a fiddle of the bug http://jsfiddle.net/6hzc5wmt/3/ This isn't really a bug, it's a not-yet-implemented feature). I had to use classic version Line Chart: google.load('visualization', '1.1', {packages: ['corechart']}); google.setOnLoadCallback(drawChart); function drawChart() { var userArray = [ 'x', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'k' ]; var data = new google.visualization.DataTable(); for (var i = 0; i &lt; userArray.length ; i++) { data.addColumn('number', userArray[i]); } data.addRows([ [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 1, 0, 0, 1, 2, 0, 1, 0, 0], [2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] ]); var options = { focusTarget: 'category', width: 1000, height: 563, hAxis: { title: 'Date' }, vAxis: { title: 'item' }, series: { 1: { curveType: 'function' } } }; var chart = new google.visualization.LineChart(document.getElementById('ex2')); chart.draw(data, options); } http://jsfiddle.net/6hzc5wmt/1/
type: Answer
score: 2
downvote count: 0
upvote count: 2
answers question: http://stackoverflow.com/q/28885512
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28885512

http://stackoverflow.com/comment/84241914
has text: pls add the relevant node versions to this question, as the behaviour has changed, more than once, on more recent versions
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28828922
score: 1

http://stackoverflow.com/q/28779721
tagged with: activeresource
type: UnansweredQuestion
tagged with: ruby-on-rails
type: Question
tagged with: javascript
has body: I have a rails app that I need to connect to an external RESTful API (not another rails app) and I got the basic get request to work in js which is the following: JavaScript in Body A Paragraph. Try it Now what I have in my rails app is the following for my item.rb class Item < ActiveResource::Base self.site = "https://api.appery.io/rest/1/db/collections/Menu/" end and in my show.html.erb i have: <% provide(:title, @user.name) %> <% require 'active_resource' %> <% item = Item.all %> <%= item.first %> I get the following error: Failed. Response code = 400. Response message = Bad Request. which kind of makes sense since I haven't included the headers but I am not sure how to do that. The activeresource page doesn't have any examples about adding headers and I am not sure if you can just do self.header = "my header here". Should I even be using activeresource or should I use something like restclient or can I just use the javascript I have working and add it in my app? Any help is much appreciated.
has title: How to add headers to ActiveResource to create API request
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28780198
tagged with: ruby
tagged with: rest

http://stackoverflow.com/comment/45962635
has text: ah! It's the class attribute 'active' that needs to be changed, not the checked value. The active attribute shows which button is selected!!
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28845670

http://stackoverflow.com/comment/45857969
type: Comment
type: AnswerComment
has text: @EasyBB - `head6` is defined in the global scope because the element has that ID. I don't like to use those global properties at all, but they are defined in HTML5 and should be fine to use. Inline event handlers suck and should be avoided, and here the OP forgot the parentheses for the function in one of them as well. Also the `language` attribute was deprecated 10 years ago. I don't always change the entire code the OP is posting when it's something really simple like this, as I figure the most important thing is getting it working and showing a newbie where the problem is.
score: 0
comment on: http://stackoverflow.com/a/28791245

http://stackoverflow.com/comment/46012951
type: Comment
has text: Are you doing does because you actually need to monitor a server, or does it have some sort an academic / recreational purpose ?
type: QuestionComment
comment on: http://stackoverflow.com/q/28875330
score: 0

dynamic
tags question: http://stackoverflow.com/q/28903927
tag name: dynamic
tags question: http://stackoverflow.com/q/28764612
tags question: http://stackoverflow.com/q/28755841
tags question: http://stackoverflow.com/q/28775678
tags question: http://stackoverflow.com/q/28768772
tags question: http://stackoverflow.com/q/28893121
tags question: http://stackoverflow.com/q/28803018
tags question: http://stackoverflow.com/q/28901680
type: Tag

http://stackoverflow.com/q/28838555
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45946634
tagged with: drag-and-drop
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45952073
answer count: 0
type: UnansweredQuestion
has body: Can you please let us know if there are there any special cases where HTML5 drop event doest fire. I see a strange issue with drop event of HTML5, which I stuck with. I am sure I must be doing something wrong here. The scenario here is.. Here is the drop zone I defined. This code works Perfectly fine when I drag elements, even files from desktop. But I have one particular widget in our application which has divs, table-td's with draggable set to true, though Im able to drag these elements, the drop event doesnt get fired when I move this dragged element or drop the dragged element on the drop zone. drop here
upvote count: 1
type: Question
score: 1
has title: HTML5 Drag and Drop doesnt work in specifc cases
has comment: http://stackoverflow.com/comment/45947157
downvote count: 0

http://stackoverflow.com/comment/45818065
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28769707
score: 0
has text: @user3323654 Than you did it wrong, show us what you tried.

http://stackoverflow.com/tag/q
tags question: http://stackoverflow.com/q/28887620
tags question: http://stackoverflow.com/q/28798101
tags question: http://stackoverflow.com/q/28905800
type: Tag
tag name: q
tags question: http://stackoverflow.com/q/28903013
tags question: http://stackoverflow.com/q/28757256
tags question: http://stackoverflow.com/q/28844132
tags question: http://stackoverflow.com/q/28774420
tags question: http://stackoverflow.com/q/28881265
tags question: http://stackoverflow.com/q/28769634

http://stackoverflow.com/comment/45823263
type: Comment
has text: that is because of digest cycle of angular, try `` bindonce directive will run only once
comment on: http://stackoverflow.com/q/28772134
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45912008
score: 0
type: Comment
type: QuestionComment
has text: Understood. I guess I could reword my question: Is there any way to separate the Date and the Time portion?
comment on: http://stackoverflow.com/q/28820043

http://stackoverflow.com/comment/45853888
score: 1
type: QuestionComment
has text: @charlietfl so use $(this) instead of the event e?
comment on: http://stackoverflow.com/q/28789098
type: Comment

http://stackoverflow.com/q/28769567
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: Timing for disabling a CSS link
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45817842
tagged with: css
has comment: http://stackoverflow.com/comment/45817846
has answer: http://stackoverflow.com/a/28769704
linked to: http://stackoverflow.com/q/3182840
has comment: http://stackoverflow.com/comment/45818742
type: Question
has body: Long time reader, first time poster. I need to disable an external CSS stylesheet, and am planning on using the technique described in this thread. Removing or replacing a stylesheet (a ) with JavaScript/jQuery My question is, how "early" is safe to do it? I would think that as long as script to disable the link is lower in the HTML, the CSS link (though not necessarily the contents of the external stylesheet) will be in the DOM already. But "the other guys" are saying that's not the case, and to avoid possible race conditions, you shouldn't disable the CSS until "document.ready". (But, if you wait until document.ready, content "flicks" onto the page with the old styles.) In other words, is this code at all risky? Example
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/28834887
type: AnsweredQuestion
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/45961862
type: Question
tagged with: javascript
tagged with: jquery
upvote count: 3
accepted answer: http://stackoverflow.com/a/28851290
has body: i need create to show thumbnail image in poster by using video url for jquery j-player.i have seek in forum.but i didn't got any useful information related to thumbnail.anyone can give me some ideas to do it.. Thanks Advance.. $("#jquery_jplayer_2"+playid).jPlayer({ ready: function () { $(this).jPlayer("setMedia", { /*m4v: "media/tokyo.m4v", ogv: "media/tokyo.ogv", poster: "media/poster.jpg"*/ m4v: playpath, ogv: playpath, poster: playpath }); }, ended: function (event) { $("#jquery_jplayer_2"+playid).jPlayer("play", 0); }, swfPath: "swf", supplied: "m4v, ogv", cssSelectorAncestor: "#jp_interface_2" }) .bind($.jPlayer.event.play, function() { // pause other instances of player when current one play $(this).jPlayer("pauseOthers"); });
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28851290
has title: how to create thumbnail image by using video url for jquery jplayer
tagged with: jplayer
has comment: http://stackoverflow.com/comment/45961962

karma-jasmine
tags question: http://stackoverflow.com/q/28773327
tags question: http://stackoverflow.com/q/28811292
tags question: http://stackoverflow.com/q/28821511
tags question: http://stackoverflow.com/q/28869877
type: Tag
tags question: http://stackoverflow.com/q/28879010
tags question: http://stackoverflow.com/q/28895408
tags question: http://stackoverflow.com/q/28788619
tags question: http://stackoverflow.com/q/28821870
tags question: http://stackoverflow.com/q/28871880
tags question: http://stackoverflow.com/q/28840555
tag name: karma-jasmine

http://stackoverflow.com/comment/45880568
comment on: http://stackoverflow.com/q/28803576
type: QuestionComment
has text: var str='',b=gv_chartDataModel,a=[]; if(selkeyword!=="IF"){ a=gv_contextData; } else{ for (var j = 0; j < 2; j++) { var source = b.children[j]; for (var i = 0; i < source.children.length; i++) { a.push(source.children[i]) } } } var val = this.value; for(var i=0;i<a.length;i++){ var temp_array=[] a[i].children.forEach(function(d){ if(d.description.indexOf(val) !==-1){ temp_array.push(d); } else{ a[i].children.push(d); } }) a[i].children=temp_array; }.
score: 0
type: Comment

http://stackoverflow.com/a/28813022
has body: The post to which you link does contain the solution: "function closure". You just need to extend it to include the infowindow for each marker since you have a unique infowindow for each marker instead of a global infowindow shared among all the markers. for (i = 0; i &lt; locations.length; i++) { var marker = new google.maps.Marker({ position: new google.maps.LatLng(locations[i][1], locations[i][2]), map: map, content: locations[i][0] }); var infowindow = new google.maps.InfoWindow(); google.maps.event.addListener(marker, 'click', (function (marker, i, infowindow) { return function () { console.log('Klick! Marker=' + this.content); infowindow.setContent(this.content); infowindow.open(map, this); }; })(marker, i, infowindow)); bounds.extend(marker.position); google.maps.event.trigger(marker, 'click'); } working fiddle code snippet: function initialize() { var infos = []; var locations = [ ['Marker 1', 54.08655, 13.39234, 2], ['Marker 2', 53.56783, 13.27793, 1] ]; var map = new google.maps.Map(document.getElementById('map-canvas'), { mapTypeId: google.maps.MapTypeId.ROADMAP, zoomControl: true, zoomControlOptions: { style: google.maps.ZoomControlStyle.SMALL } }); var bounds = new google.maps.LatLngBounds(); for (i = 0; i &lt; locations.length; i++) { var marker = new google.maps.Marker({ position: new google.maps.LatLng(locations[i][1], locations[i][2]), map: map, content: locations[i][0] }); var infowindow = new google.maps.InfoWindow(); google.maps.event.addListener(marker, 'click', (function(marker, i, infowindow) { return function() { console.log('Klick! Marker=' + this.content); infowindow.setContent(this.content); infowindow.open(map, this); }; })(marker, i, infowindow)); bounds.extend(marker.position); google.maps.event.trigger(marker, 'click'); } map.fitBounds(bounds); var listener = google.maps.event.addListenerOnce(map, "idle", function() { map.setZoom(8); }); } function loadScript() { var script = document.createElement('script'); script.src = 'https://maps…
score: 6
type: Answer
upvote count: 6
answers question: http://stackoverflow.com/q/28811320
accepted answer of: http://stackoverflow.com/q/28811320
has comment: http://stackoverflow.com/comment/45898553
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/28882790
has body: It will render again in the sense that all of the React Component render functions will run again. It will not necessarily change the DOM at all however because React's diffing algorithm will not do anything if the correct DOM nodes are already in the page.
upvote count: 6
score: 6
has comment: http://stackoverflow.com/comment/64112076
accepted answer of: http://stackoverflow.com/q/28882214
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/73503460
type: Answer
answers question: http://stackoverflow.com/q/28882214

http://stackoverflow.com/a/28768631
has comment: http://stackoverflow.com/comment/46074398
has comment: http://stackoverflow.com/comment/45816321
score: -1
type: Answer
answers question: http://stackoverflow.com/q/28754850
downvote count: 1
has body: Here is the answer, if you leave grade empty it will show all students. Javascript Min Rubik Students:
upvote count: 0

http://stackoverflow.com/comment/45820281
comment on: http://stackoverflow.com/a/28770190
score: 0
type: AnswerComment
has text: Thank you Enzey!! I am trying to make it work, starting from your code but it does not. I believe one problem is that before `function(scope, element, attributes)` you need `return`. Still, it is not clear to me where I get the label from...
type: Comment

http://stackoverflow.com/a/28794658
answers question: http://stackoverflow.com/q/28794583
type: Answer
has comment: http://stackoverflow.com/comment/45863873
has body: This has nothing to do with window.onload. You're invoking this... form.kalkulator.focus(); but form.kalkulator is a function, it doesn't have a .focus() method. form.klalkulator.focus is undefined, and you're attempting to invoke it as a function, hence your error.
score: 0

http://stackoverflow.com/q/28895351
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/11331146
upvote count: 1
tagged with: vb6
type: Question
score: 1
has body: At first I thought that this was possible until it came to my mind that I can't change the code of the webpage. I have read this link and that is exactly what I was looking for with the exception of, I am not the one who developed the html page. What I want to do? - click/call/run a button or a function in VB6 using a "button" from an external webpage. Anyone could give me an idea? It will be highly appreciated. Thank you
tagged with: function
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/46063200
favorite count: 0
tagged with: winforms
tagged with: http://stackoverflow.com/tag/html
has title: Call a button/function in VB6 winforms app from html
has comment: http://stackoverflow.com/comment/46063098
answer count: 0

http://stackoverflow.com/a/28809609
score: 1
upvote count: 1
has body: change php code as told in others answers too and it should be like $rows2 = array(); while($r2 = mysql_fetch_assoc($result2)) { $rows2[$r2['ccode']] = $r2['colour']; } if it does not work then try this: $rows2 = array(); while($r2 = mysql_fetch_assoc($result2)) { $rows2["'".$r2['ccode']."'"] = $r2['colour']; } if it also does not work then try this: $rows2 = array(); while($r2 = mysql_fetch_assoc($result2)) { $rows2[{$r2['ccode']}] = $r2['colour']; }
accepted answer of: http://stackoverflow.com/q/28809293
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28809293
type: Answer

http://stackoverflow.com/q/28758291
tagged with: bluebird
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45815923
type: Question
linked to: http://stackoverflow.com/q/28736452
has title: Convert nested 'for' loops into a Promise, for a Promise? Nested Promises?
tagged with: javascript
has comment: http://stackoverflow.com/comment/45806673
possible better answer: http://stackoverflow.com/a/28758827
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/28758827
has comment: http://stackoverflow.com/comment/45806552
accepted answer: http://stackoverflow.com/a/28768859
favorite count: 0
tagged with: promise
has body: I have an array where the values are sequences separated by '/', and a 'mapSeries' Promise (helper function for serially iteration with mapping) that loops through each value within each of the sequences. Right now, the statement starts with a nested 'for' loop that splits a sequence into strings, and then pushes these values to an empty array to hand off to the 'mapSeries' promise.. After testing, it turns out that this only works if the original array has one sequence because multiple sequences run in parallel. How can this be written as a promise that runs serially for each sequence, and then serially for each element in the given sequence? Here's the attempt at the for loop (works for a single sequence): var sequences = ['one/two/three', 'alpha/beta']; var elements = []; for (i=0; i&lt;sequences.length; i++) { var series = sequences[i].split("/"); for (j=0; j&lt;series.length; j++) { elements.push(series[j]); } var items = mapSeries(elements, function(element) { // do stuff with 'one', then 'two', then 'three' // when done..next series // do stuff with 'alpha', then 'beta' }) elements = []; // reset elements array for next series } // for sequences.length And here's an attempt at a Promise (error at element.charAt..): var sequences = ['one/two/three', 'alpha/beta']; var elements = []; var items = mapSeries(sequences, function(sequence) { sequence = sequence.split("/"); return mapSeries(sequence, function(series) { elements.push(series); return elements; }).then(function(elements) { return mapSeries(elements, function(element){ var element = element.charAt(0).toLowerCase() + element.slice(1); // first letter lowercase // do stuff with 'one', then 'two', then 'three' // when done..next series // do stuff with 'alpha', then 'beta' }); }); elements = []; // reset elements array for next series }); mapSeries helper function: function mapSeries(things, fn) { var results = []; return Promise.each(things, function(value, index, length) { var ret = fn(value, index, lengt…
tagged with: node.js
has answer: http://stackoverflow.com/a/28768859
type: AnsweredQuestion

http://stackoverflow.com/q/28790910
has comment: http://stackoverflow.com/comment/45857782
type: Question
tagged with: javascript
tagged with: gruntjs
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/29098850
type: UnansweredQuestion
has body: I am pulling my hair out. Have been unable to install grunt for like an hour. I keep getting this: npm WARN unmet dependency /usr/local/lib/node_modules/bower/node_modules/tar-fs/node_modules/pump/node_modules/end-of-stream requires once@'~1.3.0' but will load npm WARN unmet dependency /usr/local/lib/node_modules/bower/node_modules/tar-fs/node_modules/pump/node_modules/once, npm WARN unmet dependency which is version 1.2.0 please help
has title: Unmet dependencies while install grunt

http://stackoverflow.com/comment/45903279
comment on: http://stackoverflow.com/q/28815276
has text: No way I'm gonna use eval for absolutely untrusted user data. Also, if there is a syntax error, the whole php script stops executing. I'm asking for an interpreted language like JS or LUA wich can be run by PHP
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28822572
has comment: http://stackoverflow.com/comment/45918552
has answer: http://stackoverflow.com/a/28842292
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/45916754
has answer: http://stackoverflow.com/a/28822623
has comment: http://stackoverflow.com/comment/45920408
has comment: http://stackoverflow.com/comment/45918510
type: UnansweredQuestion
type: Question
has body: I have a nested accordion like so: The content div's contain radio buttons: Yes No What I am trying to do is get them to fire on change using the following code: $('input:radio[name=clause]').change(function() { alert("Test!"); }); But nothing happens when I change the radio buttons.
has answer: http://stackoverflow.com/a/28826563
has title: Firing an event after .slideDown
tagged with: javascript
has comment: http://stackoverflow.com/comment/45916958
tagged with: jquery
has comment: http://stackoverflow.com/comment/45916782

http://stackoverflow.com/q/28804334
accepted answer: http://stackoverflow.com/a/28804559
upvote count: 1
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/36333278
has comment: http://stackoverflow.com/comment/60288256
has title: undefined is not a function in canjs
type: Question
has body: I am trying to fetch data from the json array using canjs in html file with ejs template engine. But when I load the html file on browser It shows the error that "Undefined is not a function". This is my todo.js var Todo = can.Model({ findall : 'GET/todos', findone : 'GET/todos{id}', create : 'POST/todos', update : 'PUT/todos/{id}', remove : 'DELETE/todos/{id}' },{}) (function(){ var TODOS = [{id: 1,name : 'Dipesh'}, {id: 2,name : 'John'}, {id: 3,name : 'Joseph'}]; can.fixture("DELETE/todos/{id}",function(request){ return {}; }); can.fixture("PUT/todos/{id)", function(request){ $.extend(TODOS[(+request.data.id)-1], request.data); return {}; }); can.fixture("POST/todos", function(request){ var id = TODOS.length + 1; TODOS.push($.extend({id:id},request.data)); return {id:id, name: request.data}; }); can.fixture("GET/todos", function(request){ return TODOS; }); can.fixture("GET/todos/{id}", function(request){ return TODOS[(+request.data.id)-1]; }); })(); Todo.findall({}, function(todos){ var frag = can.view('todosEJS', todos) document.getElementById("todos") .appendChild(frag); }) This is my html file: Canjs Its showing an error at line Todo.findall({}, function(todos){ as "undefined is not a function". Anybody have a solution?
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28804475
has answer: http://stackoverflow.com/a/28804559
tagged with: canjs
has answer: http://stackoverflow.com/a/28804475
tagged with: ejs
answer count: 3
downvote count: 0
favorite count: 0

http://stackoverflow.com/q/28827209
has body: I am trying to show pagination of the jq grid. But it is not working. It is not showing any data in the grid. I am new in jqgrid and i have tried, here is my example. My action in controller public ActionResult itemList(string sidx, string sord, int page, int rows) { int pageIndex = Convert.ToInt32(page) - 1; int pageSize = rows; int totalRecords = db.tbl_Item.Count(); int totalPages = (int)Math.Ceiling((float)totalRecords / (float)pageSize); var v = new { total = totalPages, page, records = totalRecords, rows = ( from t in db.tbl_Item select new { i = t.id, cell = new string[]{ t.batchno,t.brand,t.buyingPrice.ToString(), t.catg, t.itemcode, t.name, t.qtyLimit.ToString(), t.Quantity.ToString(), t.sellingPrice.ToString(),t.supplier,t.unitType,t.vat.ToString() } }).ToArray() }; return Json(v, JsonRequestBehavior.AllowGet); } And the javascript code are jQuery("#list").jqGrid({ cache: false, async: false, url: '/Settings/itemList/', datatype: 'json', mtype: 'GET', colNames: ['id','New Item', 'Batch No', 'Supplier', 'Unit', 'B. Price', 'S. Price','Item Code','Vat','Limit'], colModel: [ { name: 'id', index: 'id', width: 110, align: 'center',hidden:true }, { name: 'name', index: 'name', width: 110, align: 'center' }, { name: 'batchno', index: 'batchno', width: 110, align: 'center' }, { name: 'supplier', index: 'supplier', width: 110, align: 'center' }, { name: 'unitType', index: 'unitType', width: 110, align: 'center', editoptions: { readonly: 'readonly' } }, { name: 'buyingPrice', index: 'buyingPrice', width: 110, align: 'center', editoptions: { readonly: 'readonly' } }, { name: 'sellingPrice', index: 'sellingPrice', align: 'center' }, { name: 'itemcode', index: 'itemcode', width: 110, align: 'center'}, { name: 'vat', index: 'vat', width: 110, align: 'center', editoptions: { readonly: 'readonly' } }, { name: 'qtyLimit', index: 'qtyLimit', align: 'center' } ], pager: jQuery('#pager'), rowNum: 2, rowList: [5, 10, 20, 50], sortname: 'id', sortorder: "desc", viewrecords: tru…
has comment: http://stackoverflow.com/comment/45925487
has comment: http://stackoverflow.com/comment/45925084
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45925233
type: Question
has comment: http://stackoverflow.com/comment/45924869
tagged with: entity-framework
tagged with: asp.net-mvc
tagged with: jqgrid
score: 0
has comment: http://stackoverflow.com/comment/45925103
has comment: http://stackoverflow.com/comment/45924770
tagged with: javascript
tagged with: jquery
has title: How to show paginationa in jqgrid?

http://stackoverflow.com/comment/93677871
has text: Note: this sorts the array *in place* (and also returns the array). Which means that after `champions.sort(…)`, `champions` will be modified (sorted).
score: 6
type: Comment
comment on: http://stackoverflow.com/a/28853839
type: AnswerComment

http://stackoverflow.com/q/28776079
tagged with: ecmascript-6
possible better answer: http://stackoverflow.com/a/54112998
has comment: http://stackoverflow.com/comment/45830430
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/54112998
score: 66
has answer: http://stackoverflow.com/a/53635350
upvote count: 66
has comment: http://stackoverflow.com/comment/45832039
accepted answer: http://stackoverflow.com/a/28776236
has body: In JavaScript, var declarations create properties on the global object: var x = 15; console.log(window.x); // logs 15 in browser console.log(global.x); // logs 15 in Node.js ES6 introduces lexical scoping with let declarations that have block scope. let x = 15; { let x = 14; } console.log(x); // logs 15; However, do these declarations create properties on the global object? let x = 15; // what is this supposed to log in the browser according to ES6? console.log(window.x); // 15 in Firefox console.log(global.x); // undefined in Node.js with flag
has comment: http://stackoverflow.com/comment/45831261
tagged with: let
has title: Do let statements create properties on the global object?
favorite count: 0
has comment: http://stackoverflow.com/comment/45830694
has answer: http://stackoverflow.com/a/53608664
answer count: 5
has comment: http://stackoverflow.com/comment/113725836
has comment: http://stackoverflow.com/comment/45830477
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28776193
has answer: http://stackoverflow.com/a/28776236
type: Question

http://stackoverflow.com/a/29307601
answers question: http://stackoverflow.com/q/28799792
has comment: http://stackoverflow.com/comment/84964954
type: Answer
has body: Firstly, I would try a non-secure websocket connection. So remove one of the s's from the connection address: conn = new WebSocket('ws://localhost:8080'); If that doesn't work, then the next thing I would check is your server's firewall settings. You need to open port 8080 both in TCP_IN and TCP_OUT.
downvote count: 1
upvote count: 5
score: 4
has comment: http://stackoverflow.com/comment/84964939
has comment: http://stackoverflow.com/comment/54607172

http://stackoverflow.com/comment/45979615
type: QuestionComment
has text: @CodeBob so how i can ensure that angular done processing the value?
comment on: http://stackoverflow.com/q/28856312
score: 0
type: Comment

http://stackoverflow.com/q/28771782
tagged with: functional-programming
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has title: Why's there no a prototype property on Function.prototype?
tagged with: oop
has body: This question is a bit pedantic. You've been warned beforehand :) I noticed something and I thought of sharing it with you. Let's get straight to it. Since all functions are supposed to have a prototype property that's epicenter of the prototypical inheritance model in js, and since Function.prototype is a function in itself, you'd expect to see a prototype property on the prototype object that all functions in js get their methods and properties from by virtue of inheritance but nothing there. Is there a logical explanation behind this decision to omit the prototype on that particular function or it was dropped just for stylistic reasons since Function.prototype.prototype might look ugly for some, or maybe the prototype prop on the Function constructor is like for the lack of a better term the god of all prototypes in js and thus can't have a prototype property itself? Looking forward to your answers. Happy coding :)
has answer: http://stackoverflow.com/a/28771846
score: 1
upvote count: 1
type: Question
linked to: http://stackoverflow.com/q/4859308
tagged with: javascript
tagged with: prototype
has answer: http://stackoverflow.com/a/28772101
answer count: 2

http://stackoverflow.com/q/28896369
has comment: http://stackoverflow.com/comment/46052589
has answer: http://stackoverflow.com/a/28897808
type: Question
has comment: http://stackoverflow.com/comment/46052455
tagged with: javascript
has comment: http://stackoverflow.com/comment/46055820
has comment: http://stackoverflow.com/comment/46052881
score: 0
has comment: http://stackoverflow.com/comment/46052613
has comment: http://stackoverflow.com/comment/46052585
answer count: 1
tagged with: jquery
has title: JQuery date formatting issue
type: UnansweredQuestion
tagged with: datepicker
has comment: http://stackoverflow.com/comment/46052659
has comment: http://stackoverflow.com/comment/46053713
has body: I have to format date as below using Jquery, I tried with Date.js and some more external JS but unable to do so: Input value: Date val: 20150306 Time :185900 Expected format: time: 6.59 PM Date :Mar 06, 2015

http://stackoverflow.com/a/28821219
has comment: http://stackoverflow.com/comment/45914435
accepted answer of: http://stackoverflow.com/q/28821001
upvote count: 1
type: AcceptedAnswer
type: Answer
has body: this (and hence self) simply refers to the global object (i.e. window). That's why you get the error, there is no global add function. I recommend to read the MDN documentation to learn how this works. One solution is to keep a reference to the object you are returning and use that instead: var fileSelector = (function () { function callback (data,status,xhr) { $("#File_Selector_Container").html(data); utils.setItem ("fileSelector", "TRUE"); } var fileSelector = { refresh : function () { if (utils.getItem ("fileSelector") == "TRUE") { fileSelector.add(); } }, add : function () { $.get(script_name ,"AddFileSelector",callback,"html"); }, remove : function () { $("#File_Selector_Container").html(""); } }; return fileSelector; })();
downvote count: 0
answers question: http://stackoverflow.com/q/28821001
score: 1

http://stackoverflow.com/comment/46071464
has text: Will do that for sure.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28886192

http://stackoverflow.com/q/28799525
tagged with: onload
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45873307
score: 0
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45873526
tagged with: onload-event
answer count: 1
has answer: http://stackoverflow.com/a/28799831
has comment: http://stackoverflow.com/comment/45873719
has body: can anyone help me to convert this following function so that it wont block the page loading. I read that $(window).load function is bad but I'm using FlexiSlider which uses $(window).load. I have no idea how to outrun this. Here is the code: (function ($) { $(window).load(function() { $('.flexslider').flexslider(); }); })(jQuery); Can anyone help me out?
has comment: http://stackoverflow.com/comment/45873893
accepted answer: http://stackoverflow.com/a/28799831
has title: Convert Window Onload function to non blocking

http://stackoverflow.com/comment/45899392
has text: try it in IE, `hide()` will fail...not supported
type: Comment
comment on: http://stackoverflow.com/a/28813783
score: 0
type: AnswerComment

http://stackoverflow.com/q/28855198
score: 2
has comment: http://stackoverflow.com/comment/45976807
has title: POST Blocked even when CORS is enabled
tagged with: angularjs
has answer: http://stackoverflow.com/a/28856431
downvote count: 0
has comment: http://stackoverflow.com/comment/45976599
tagged with: spring-mvc
has answer: http://stackoverflow.com/a/28856755
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45976557
tagged with: java
has comment: http://stackoverflow.com/comment/45976615
possible better answer: http://stackoverflow.com/a/28856755
type: Question
upvote count: 2
answer count: 2
has comment: http://stackoverflow.com/comment/45976649
tagged with: cors
has body: I have created a SimpleCORSFilterbased on the SpringMVC guide to allow CORS: @Component public class SimpleCORSFilter implements Filter { public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { HttpServletResponse response = (HttpServletResponse) res; response.setHeader("Access-Control-Allow-Origin", "*"); response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT"); response.setHeader("Access-Control-Max-Age", "3600"); response.setHeader("Access-Control-Allow-Headers", "x-requested-by"); chain.doFilter(req, res); } } The controller code for the POST and PUT request is the following: @RequestMapping( produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.PUT, value = "admin/tile/{id}" ) public boolean saveNewTile(@PathVariable("id") String id) { ContextEntity contextEntity = new ContextEntity("tile", id); //TODO: USE CUSTOM DATABASE contextEntityDAO.save(contextEntity); return true; } @RequestMapping( produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST, value = "admin/tile/{id}" ) public boolean updateTile(@PathVariable("id") String id, @RequestParam(required = false) ContextAttribute[] atts) { ContextEntity contextEntity = contextEntityDAO.findById(id); contextEntity.addContextAttributes(atts); contextEntityDAO.save(contextEntity); return true; } With AngularJS v1.3.14 I am able to do GET and PUT requests, but when I try to do a POST, Firefox notifies me that the request has been blocked since the same-origin policy... This part works fine, for instance $scope.onTestOnlyClick = function() { $http.put('http://localhost:8080/admin/tile/' + tile.id) }; However, when I do $http.post('http://localhost:8080/admin/tile/' + tile.id, contextAtts); It cannot complete the request, and both lines are in the same controller! This is what I see with Firebug, for some reason, when I perform a POST, Firebug only shows an OPTIONS request, there is no POST afterwards. T…
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45976891
accepted answer: http://stackoverflow.com/a/28856431
has comment: http://stackoverflow.com/comment/45976637
has comment: http://stackoverflow.com/comment/45976950
has comment: http://stackoverflow.com/comment/45977203
has comment: http://stackoverflow.com/comment/45976384
has comment: http://stackoverflow.com/comment/45976886

http://stackoverflow.com/comment/45828692
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28775198
has text: So what's your question?

http://stackoverflow.com/comment/45971802
score: 0
type: AnswerComment
has text: But I need the username or repo name before I can query the api. I can't query the api with the URL
type: Comment
comment on: http://stackoverflow.com/a/28852304

http://stackoverflow.com/q/28858566
has answer: http://stackoverflow.com/a/28859090
tagged with: php
has body: Having some trouble understanding how to mix AngularJS and PHP. I am initially just trying to have an AngularJS factory make a call to a PHP file (which grabs a query), then push it back to my AngularJS factory where a Controller can use the data. Here is what I have so far, and this gives me "undefined" when I try to console.log the result. Factory app.factory("PlantServiceLIVE", function($http) { var mData = {}; $http.get('pages/getplants.php').success(function(data) { mData.data = data; }); return mData; }); Controller app.controller('TestController', function($scope, $http, PlantServiceLIVE) { $scope.Plants = PlantServiceLIVE.mData; console.log(JSON.parse($scope.Plants)); }); PHP (just verified that the below works tooo) $sql = "SELECT * FROM PlantTable"; $result = $conn-&gt;query($sql); echo json_encode($result); Not sure what exactly I am doing wrong, first time doing this. The only developer console errors I get are SyntaxError: Unexpected token u, which from what I read just means the data is undefined.
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/28859090
possible better answer: http://stackoverflow.com/a/28859163
tagged with: javascript
has answer: http://stackoverflow.com/a/28859163
score: 0
tagged with: angularjs
type: AnsweredQuestion
has title: AngularJS Factory call to PHP then back to AngularJS

http://stackoverflow.com/q/28793336
has body: what i want to do is that i want to load a particular div with a class="container" form a site and get its content on my app i did the ajax call to get a site and load up it's content and got the cross-domain origin error.I donot have access to the server files...it is just some site on the web. So i looked it up and found the YQL as a good solution to my problem. I want the data in JSON format i run the following query: select * from html where url="https://in.yahoo.com/" But when i run the query now i get the entire site including the scripts and css... which i don't want..i just want the div.. how do i construct my query then? Or how do i Travers the JSON then Fiddle here
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has answer: http://stackoverflow.com/a/28793382
accepted answer: http://stackoverflow.com/a/28793382
has comment: http://stackoverflow.com/comment/45861398
has title: get contents of a div from another website using JavaScript
type: AnsweredQuestion
type: Question
tagged with: yql
answer count: 1

http://stackoverflow.com/comment/45939531
score: 0
type: Comment
has text: So, why are you using `ng-keypress` ? Please post your code template, controller and directive working together
type: AnswerComment
comment on: http://stackoverflow.com/a/28833803

http://stackoverflow.com/comment/45987699
score: 0
type: Comment
has text: No, all I wanted is to select/choose between disable and enable, once I choose disable it will be automatically disabled the button otherwise enable.
type: QuestionComment
comment on: http://stackoverflow.com/q/28860869

http://stackoverflow.com/comment/46061684
comment on: http://stackoverflow.com/a/28901156
has text: Proxy isn't in V8 yet, think I'll have to go with @Felix Kling's suggestion
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28865543
tagged with: highcharts
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/46025480
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 0
upvote count: 1
type: Question
has title: Highcharts overlapping gauge with legend
has body: I have the following problem. On my webside I am working with highcharts, especially with gauge. I have to use the vertical alignment of the legend and the marginleft property in order to save space between the legend and chart, but unfortunately, if I am resizing the website, e.g. make the window smaller, or print the chart, the legend and the chart are overlapping. The following js fiddle should demonstrate this: http://jsfiddle.net/7sc70zdn/ legend: { allowDecimals:false, itemWidth: 240, itemStyle:{ cursor: 'default' }, align: 'left', verticalAlign: 'top', layout: 'vertical', x: 0, y: 100, useHTML:true }, Here is the part, where I think, that the overlapping is occurred. But this property I need In the jsfiddle the marginleft property can be seen as inappropriate but on the original website, it is very useful. Do you know, how I can prevent this overlapping? Thanks in advance.
tagged with: javascript

http://stackoverflow.com/comment/46134114
type: AnswerComment
has text: Good idea! This can indeed do it. Thanks!
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28904639

http://stackoverflow.com/q/28764364
has body: I have graph constructor written in JavaScript. The documentation is a bit borked. Below is the part of my code and the documentation which does not work as I want: function Graph() { .... var nodes = []; Object.defineProperties(this, { /** * An array of all node handles in the graph * * @return {Array} */ nodes: { get: function() { var ids = []; for (var id in nodes) { ids.push(id); } return ids; } } }); .... } Basically, what I'm trying to do is to make sure the graph can't be manipulated using other means than the methods provided by giving a copy of the node list, not the actual node list. This works well, but in the JsDoc, it is defined as static: &lt;static&gt; Graph.nodes An array of all node handles in the graph Now, this property is not static. It is individual for all instances of graphs. My guess is that JsDoc recognizes the definition of the nodes property to be inside Object.defineProperties(), and claims that all declarations inside here are static. Is there a way to tell JsDoc that this property is in fact not static? I could only find the tag @static, which does the exact opposite.
type: Question
has answer: http://stackoverflow.com/a/28780945
score: 5
has title: JsDoc: Remove "static" tag from property
upvote count: 5
tagged with: javascript
downvote count: 0
answer count: 1
favorite count: 0
tagged with: jsdoc
accepted answer: http://stackoverflow.com/a/28780945
type: AnsweredQuestion

http://stackoverflow.com/a/28753391
answers question: http://stackoverflow.com/q/28753312
has comment: http://stackoverflow.com/comment/45789019
has comment: http://stackoverflow.com/comment/45788919
has body: You can use by.xpath(): element(by.xpath('//input[@ng-model = "column.visible" and following-sibling::text() = "' + label + '"]'));
has comment: http://stackoverflow.com/comment/45788773
has comment: http://stackoverflow.com/comment/45789127
has comment: http://stackoverflow.com/comment/45788815
has comment: http://stackoverflow.com/comment/45813331
has comment: http://stackoverflow.com/comment/45789042
has comment: http://stackoverflow.com/comment/45788835
has comment: http://stackoverflow.com/comment/45789227
has comment: http://stackoverflow.com/comment/45788820
score: 0
has comment: http://stackoverflow.com/comment/45788903
type: Answer

http://stackoverflow.com/q/28878797
score: 0
has comment: http://stackoverflow.com/comment/46020235
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28878948
accepted answer: http://stackoverflow.com/a/28879321
tagged with: http://stackoverflow.com/tag/svg
tagged with: css
linked to: http://stackoverflow.com/q/11228987
type: AnsweredQuestion
has body: Is it possible to make a mouse event not fire on transparent color of an image? I have a big background image and several small images which are shaped in different shapes (for example the shape of a ball). I want to catch mouse events on these small images. The problem is that events fire on the whole rect of an image. I can use image map on the background image but this is not a good idea because the small images will be changing under mouse (sprites).
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28879321
has title: html, svg, css how to make mouse event not fire on transparent color
has comment: http://stackoverflow.com/comment/46019466
tagged with: javascript
has comment: http://stackoverflow.com/comment/46020165
has answer: http://stackoverflow.com/a/28878948

http://stackoverflow.com/q/28884925
tagged with: required
tagged with: rules
has comment: http://stackoverflow.com/comment/46035591
answer count: 0
type: UnansweredQuestion
has title: Can't pass validation with require_from_group method - jQuery Validator
type: Question
has body: My imported scripts: My form: My validation rules: $('#new-contact-form').validate({ rules: { name: { required: true }, title: { required: true }, mobile: { require_from_group: [1, '.contact'] }, tel: { require_from_group: [1, '.contact'] }, email: { require_from_group: [1, '.contact'] }, } }); When validator validates form inputs Im getting error message for each input: Please fill at least 1 of these fields even if I have one or more inputs filled. Did I missed something?
has comment: http://stackoverflow.com/comment/46037420
tagged with: validation
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/q/28773550
has body: I've been looking for an answer for days, but to no avail. I'm making this Cordova app where in IE I need to run all unsafe webcontent in an IFrame. So far everything is going well, but I am running into a problem with Internet Explorer 11 to 9 and Window Phone 8.1 IE. in Firefox and Chrome is works fine. When I press the left-mouse down inside the IFrame and drag it outside the IFrame and release, I can move my mouse inside the IFrame again and it still thinks that my left-mouse button is pressed down. This also happends when using touch controls and makes the problem so much worse. I have this fiddle example that shows the problem. Try dragging the map outside of the Fiddle IFrame release and move back to the map to confirm that mouse/touch is still down. http://jsfiddle.net/pkbkn0me/3/ Thanks in advance. I'm having a hard time debugging this issue but i suspect that it is some mouse/touch event that is not being triggered. &lt;div id="mapdisplay" style="width: 500px; height: 400px; background: grey" /&gt; &lt;script&gt; $(function() { /** * Moves the map to display over Berlin * * @param {H.Map} map A HERE Map instance within the application */ function moveMapToBerlin(map) { map.setCenter({ lat: 52.5159, lng: 13.3777 }); map.setZoom(14); } /** * Boilerplate map initialization code starts below: */ //Step 1: initialize communication with the platform var platform = new H.service.Platform({ app_id: '32pgIHkvuyWtWbBM7LhF', app_code: 'fpwF_cWgzvckmNL12RchNg', useCIT: true }); var defaultLayers = platform.createDefaultLayers(); //Step 2: initialize a map - not specificing a location will give a whole world view. var map = new H.Map(document.getElementById('mapdisplay'), defaultLayers.normal.map); //Step 3: make the map interactive // MapEvents enables the event system // Behavior implements default interactions for pan/zoom (also on mobile touch environments) var behavior = new H.mapevents.Behavior(new H.mapevents.MapEvents(map)); // Create the default UI components …
tagged with: internet-explorer
has comment: http://stackoverflow.com/comment/45827476
tagged with: javascript
downvote count: 0
has comment: http://stackoverflow.com/comment/45825874
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/45826181
has comment: http://stackoverflow.com/comment/45826040
answer count: 0
type: UnansweredQuestion
score: 1
tagged with: iframe
upvote count: 1
type: Question
has title: IE keeps holding mouse/touch down when releasing outside of Iframe window

http://stackoverflow.com/q/28783320
has comment: http://stackoverflow.com/comment/45843435
has comment: http://stackoverflow.com/comment/45843393
tagged with: menu
answer count: 1
accepted answer: http://stackoverflow.com/a/28783655
score: 0
has title: Bootstrap Dropdowns: How to trigger on hover, but only when one is already open
has body: I'd like to emulate the behaviour of a classic main menu in Windows. The process-flow is this: Click on a menu item, such as 'File' - menu opens Move pointer to another menu item, such as 'Edit' - menu opens, 'File' menu closes. I have a normal navbar, with only dropdown menus. How can I emulate this behaviour in Bootstrap 3? I know I'd need to override the click and hover events, but am not sure exactly how to go about this. Edit: I have seen this, but it doesn't appear to work, and seems to be hover only. (At least, the demo doesn't work, which isn't very encouraging.) Edit: My terrible attempt so far: $(function() { $("li.dropdown").hover( function() { if ($('.open').length !== 0) { $('.open').removeClass('.open'); $(this).addClass('open'); } } ); }); It does check first to see if one is already open, but when I close all menus (at this stage, they all remain open - fixing that now) and do it again, it doesn't follow the same process. I'm sure there's something highly obvious I'm missing.
tagged with: navigation
tagged with: javascript
tagged with: jquery
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28783655
type: Question
tagged with: twitter-bootstrap

http://stackoverflow.com/q/28813586
has comment: http://stackoverflow.com/comment/45899248
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/45899427
has body: I have been searching for a way to make a menu rise up from a menu bar underneath an image I want it so when you click on an arrow the menu will open up and partly cover the image without affecting the position of other elements in the page. I'm struggling to find a way to do this. The reason for posting in here is not for a complete solution but thought that maybe someone could point me in the right direction. For example does this have a name? Any jQuery plugins that might help? I have tried to recreate this affect using slideUp() and slideDown() but i am unable to get it to do the desired affect. I also tried using accordion but was unable to get that to produce the desired affect. Any help would be much appreciated.
downvote count: 2
has comment: http://stackoverflow.com/comment/45899479
type: Question
has answer: http://stackoverflow.com/a/28813994
has comment: http://stackoverflow.com/comment/45899292
score: -2
has title: Menu rising from bottom of an image
tagged with: javascript
upvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0

http://stackoverflow.com/q/28846301
has title: Why is Javascript disabled in an SVG?
tagged with: javascript
answer count: 1
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/28846485
tagged with: http://stackoverflow.com/tag/svg
has comment: http://stackoverflow.com/comment/45961320
upvote count: 1
type: AnsweredQuestion
score: 1
has body: Why is having Javascript enabled in an SVG considered insecure? I.e. why was Javascript disabled in SVG (in Gecko)? What are the security implications if it were not disabled?
type: Question
tagged with: gecko
has answer: http://stackoverflow.com/a/28846485

http://stackoverflow.com/comment/45842812
comment on: http://stackoverflow.com/a/28782312
type: AnswerComment
score: 0
has text: I visited your website with mobile and i saw your problem. The code I gave you is correct BUT it is not working because you did not do it right . The css, style must come before the html div but instead, you put the div before the css. Check a demo [**here**](http://usefaith.voiedusucces.net/brouillons-max.php) . I have tested it with windows phone 8.1
type: Comment

http://stackoverflow.com/a/28780628
has comment: http://stackoverflow.com/comment/45838385
downvote count: 0
has comment: http://stackoverflow.com/comment/45838513
has body: I'd personally insert the button inside .basic div element (don't use id, use class instead): Get milliseconds and display under this button onclick: And then: [EDIT] (removed alert as pointed out @mplungjan) var Stopwatch = { init: function(elem, options) { // ... var getTimerBtn = elem.getElementsByClassName("get-timer")[0]; var outputElem = elem.getElementsByClassName("output")[0]; getTimerBtn.onclick = function(){ outputElem.innerText = timer.innerText; } // ... } } That way, you can have multiple timer instances (see demo), without repeating the code for each button separately. DEMO
type: Answer
has comment: http://stackoverflow.com/comment/45843514
upvote count: 1
answers question: http://stackoverflow.com/q/28780114
has comment: http://stackoverflow.com/comment/45843848
score: 1
has comment: http://stackoverflow.com/comment/45844095
has comment: http://stackoverflow.com/comment/45844046

cocoonjs
type: Tag
tags question: http://stackoverflow.com/q/28843583
tag name: cocoonjs

http://stackoverflow.com/q/28766631
tagged with: javascript
tagged with: validation
answer count: 1
downvote count: 0
has body: How can I add a condition at field level in form or at validation rules in model, that the field will remain hidden on action/create and shown on action/update only. for example I have a field, which I want to show only in the update screen and not on create screen. $form-&gt;field($model, 'discharged')-&gt;checkBox(); Ok I have updated the code as suggested in the comments like in the Model public function scenarios() { $scenarios = parent::scenarios(); $scenarios['update'] = ['discharged', 'discharge_date']; return $scenarios; } and then in the rules [['discharged', 'discharge_date'], 'required', 'on' =&gt; 'update'], and in my update action in controller I have added: $model-&gt;scenario = 'update'; But the above code make the fields required in update scenario, what I want that the fields remain hidden in create action and only show on update. update form.php &lt;?php echo Tabs::widget([ 'items' =&gt; [ ..... '&lt;div class="col-lg-6"&gt;'. if(Yii::$app-&gt;controller-&gt;action-&gt;id == 'update') { $form-&gt;field($model, 'discharged')-&gt;checkBox() } .'&lt;/div&gt;'. I am out of Idea, how I should go about it to just show the fields in update screen. Thanks.
favorite count: 0
accepted answer: http://stackoverflow.com/a/28769137
has comment: http://stackoverflow.com/comment/45812886
tagged with: php
type: AnsweredQuestion
score: 2
has comment: http://stackoverflow.com/comment/45816074
upvote count: 2
has title: yii2:Conditional dispaly/show field dependent on Action
type: Question
has answer: http://stackoverflow.com/a/28769137
tagged with: yii2

http://stackoverflow.com/q/28836569
has comment: http://stackoverflow.com/comment/45942826
score: 1
has comment: http://stackoverflow.com/comment/45943214
tagged with: knockout.js
type: Question
has title: Knockout Observable Array increasing memory after updates
has comment: http://stackoverflow.com/comment/45943574
tagged with: javascript
has body: I am having a memory issue when updating a observable array in knockout. Each time, I run my update script, the memory seems to increase like so I feel like I might be updating the wrong way. I have to grab info from the server every minute to keep the list up to date. I am doing so like: var Update = function () { setTimeout(function () { ko.mapping.fromJS(data.Students, vm.students) Update(); }, 5000)} But, like I said, the memory increases every time I grab info and then it eventually crashes the site. The array I am working with is about 110-120 objects. Here is a Jsfiddle showing a small example of what I am doing. I have read that with larger data sets it might be a better idea to stray away from the mapping plugin, is this something I should do? Seems to still happen with small data sets too. Any suggestions would be greatly appreciated!
upvote count: 1
answer count: 1
tagged with: knockout-mvc
has comment: http://stackoverflow.com/comment/45944000
has answer: http://stackoverflow.com/a/28845057
favorite count: 0
has comment: http://stackoverflow.com/comment/45943305
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45943780
tagged with: knockout-mapping-plugin
has comment: http://stackoverflow.com/comment/45942996
downvote count: 0

http://stackoverflow.com/q/28884699
has body: I found and fixed a little bit I am not so good with PHP but any improvements are welcome. The problem is that sometimes in Chrome and Opera but only sometimes after login sucess the script redirect to a welcome page with javascript redirection after 5 secs. But sometimes it just get stuck and does not redirect but just show a white page without error and other times it redirect and worls fine. What can it be? Here is the code &lt;?php session_start();?&gt; &lt;?php include 'inc/connection.php'; $db=mysqli_connect($dbserver, $dbuser, $dbpass, $dbname)or die("DB connection error..."); $username_to_sanitize = $_POST['username']; $password_to_sanitize = $_POST['password']; $sanitized_username = mysqli_real_escape_string($db, $username_to_sanitize); $sanitized_password = mysqli_real_escape_string($db, $password_to_sanitize); $query = "SELECT password, salt, privilege, username FROM members WHERE username = '$sanitize_username'"; $result = mysqli_query($db, $query); if(mysqli_num_rows($result) == 0) // User not found. Redirected to login page. {header('Location:login.php?message=Username not found, please try again');} $userData = mysqli_fetch_array($result, MYSQL_ASSOC); $hash = hash('sha256', $userData['salt'] . hash('sha256', $sanitized_password) ); if($hash != $userData['password']) // Incorrect passw. Redirected to login page. {header('Location:error.php?message=Wrong password, please try again');} else if($userData['privilege']=="ADMIN"){session_start(); $_SESSION['username']=$userData['username']; header('Location:redirection.php?URL=admins/index.php');} else if($userData['privilege']=="MODERATOR"){session_start(); $_SESSION['username']=$userData['username']; header('Location:redirection.php?URL=moderators/index.php');} else if($userData['privilege']=="MEMBER"){session_start(); $_SESSION['username']=$userData['username']; header('Location:redirection.php?URL=members/index.php');} else if($userData['privilegio']=="BANNED"){session_start(); $_SESSION['username']=$us…
has comment: http://stackoverflow.com/comment/46031098
has comment: http://stackoverflow.com/comment/46031303
has comment: http://stackoverflow.com/comment/46031496
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46031029
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46030813
has comment: http://stackoverflow.com/comment/46031051
has comment: http://stackoverflow.com/comment/46030992
tagged with: authentication
has answer: http://stackoverflow.com/a/28885463
has comment: http://stackoverflow.com/comment/46031307
tagged with: php
has comment: http://stackoverflow.com/comment/46030758
type: Question
has comment: http://stackoverflow.com/comment/46032423
has comment: http://stackoverflow.com/comment/46030988
has comment: http://stackoverflow.com/comment/46031587
tagged with: mysql
has comment: http://stackoverflow.com/comment/46030868
score: 0
has comment: http://stackoverflow.com/comment/46031362
has comment: http://stackoverflow.com/comment/46030715
accepted answer: http://stackoverflow.com/a/28885463
answer count: 1
tagged with: javascript
has title: PHP login script redirection not working after login

http://stackoverflow.com/comment/45929305
has text: This should be the answer. History API is the way to go. +1
comment on: http://stackoverflow.com/a/28829537
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28786394
has comment: http://stackoverflow.com/comment/45852166
answer count: 3
upvote count: 0
has answer: http://stackoverflow.com/a/28786450
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/28786425
has comment: http://stackoverflow.com/comment/45849001
downvote count: 2
has comment: http://stackoverflow.com/comment/45848915
type: Question
has comment: http://stackoverflow.com/comment/45849344
has comment: http://stackoverflow.com/comment/45849835
score: -2
has title: How do we KNOW that eliminating whitespace in HTML/JS/CSS files improves page load time?
has body: How can we assume that unless we have the source code for the browser? After all, the browser might have been written in such a way that unnecessary whitespace actually improves the time it takes to parse the files. We can't assume that when browsers read those files they do something like if (thischar == ' ') // do nothing
tagged with: javascript
has answer: http://stackoverflow.com/a/28786437
tagged with: browser

http://stackoverflow.com/q/28853571
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/28853924
upvote count: 1
has answer: http://stackoverflow.com/a/28853927
type: Question
tagged with: angular-ui-router
has body: I thought this would be a really common problem, but I can't find anything about this. I have two states one is accessed on /route and the second one on /route/{name}. It works fine if I call the second route using ui-sref but when I refresh the page or try to access it directly via url I get on the /route page even tough the url in the browser stays the same. How do I fix that? function Routes($stateProvider) { $stateProvider.state("route1", { url: "/route", templateUrl: "js/route/route1.html", controller: "Route1Controller", controllerAs: "vm", resolve: { ... } }) .state("route2", { url: "/route/{name}", templateUrl: "js/route/route2.html", controller: "Route2Controller", controllerAs: "vm", resolve: { ... } }); } Edit: To make it more clear, I would like that route2 acts like any other state with a complete different url. I guess nobody would suggest nested views if the urls where "/route1" and "/route2". If that's not possible I will consider using a nested view in the route1 template. Edit2: The problem was not with the posted code. I had another route "/route/:id" but I didn't define the type. Therefore the routes where actually the same. I defined the types ("/route/{id:int}") and now it works.
possible better answer: http://stackoverflow.com/a/28853927
tagged with: javascript
has comment: http://stackoverflow.com/comment/45973869
answer count: 3
has comment: http://stackoverflow.com/comment/45973784
downvote count: 0
has answer: http://stackoverflow.com/a/28853924
favorite count: 0
has comment: http://stackoverflow.com/comment/45973883
tagged with: angularjs
has title: UI Router: Access route directly using the url
has comment: http://stackoverflow.com/comment/45973741
has answer: http://stackoverflow.com/a/28854955

http://stackoverflow.com/a/28825920
has comment: http://stackoverflow.com/comment/45952208
score: 0
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/45949633
accepted answer of: http://stackoverflow.com/q/28819088
answers question: http://stackoverflow.com/q/28819088
has body: SETLOCAL SET "EnvVar1=&lt;path&gt;" SET "EnvVar2=&lt;path&gt;" C:\Windows\SysWOW64\wscript.exe //e:jscript "&lt;PATH&gt;\JSCRIPT.js" ENDLOCAL setlocal command generates a copy of the environment. Any changes are done inside this copy. endlocal discards this copy, reverting the environment to the previous state.
has comment: http://stackoverflow.com/comment/45949912

http://stackoverflow.com/comment/45833646
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28777568
has text: I added a rough draft how it could work. For the details, you should find out yourself. This is a rather broad thing to answer here.
score: 0

http://stackoverflow.com/a/28831227
has body: This is an improper use of ng-init and you should run your code in controller instead From docs: The only appropriate use of ngInit is for aliasing special properties of ngRepeat, as seen in the demo below. Besides this case, you should use controllers rather than ngInit to initialize values on a scope.
type: Answer
has comment: http://stackoverflow.com/comment/45932192
has comment: http://stackoverflow.com/comment/45932275
score: 0
answers question: http://stackoverflow.com/q/28830840

http://stackoverflow.com/a/28894831
type: Answer
answers question: http://stackoverflow.com/q/28809936
downvote count: 2
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28809936
has body: An option would be to override the styles in reset.css in your site.css. You would only need to include styles you want to change as the rest will still take effect. There are two ways you could do this: use !important .something{ color:red; } /* in reset.css */ .something{ color:blue !important; } /* in site.css */ increase the specificity p{ color:red; } /* in reset.css */ div p{ color:blue; } /* in site.css */ Using specificity is prob the best approach if possible, but using !important will also work. Here are the MDN docs on specificity in css
score: -1
type: AcceptedAnswer

http://stackoverflow.com/q/28889450
favorite count: 0
has answer: http://stackoverflow.com/a/66381306
linked to: http://stackoverflow.com/q/22939130
has body: The new ES6 arrow functions say return is implicit under some circumstances: The expression is also the implicit return value of that function. In what cases do I need to use return with ES6 arrow functions?
has answer: http://stackoverflow.com/a/51207563
score: 209
upvote count: 209
possible better answer: http://stackoverflow.com/a/41602806
has title: When should I use a return statement in ES6 arrow functions
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/49964462
has answer: http://stackoverflow.com/a/41602806
tagged with: javascript
answer count: 6
tagged with: ecmascript-6
tagged with: arrow-functions
downvote count: 0
has answer: http://stackoverflow.com/a/28889451
accepted answer: http://stackoverflow.com/a/28889451
has answer: http://stackoverflow.com/a/54425568

http://stackoverflow.com/comment/46059599
score: 0
type: QuestionComment
type: Comment
has text: What's the data type of parks? DataSet? Custom Entity Class?
comment on: http://stackoverflow.com/q/28900125

http://stackoverflow.com/comment/45997570
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28846598
has text: when i use build task grunt make the minification with ng-annotate and error continue

http://stackoverflow.com/comment/45939909
type: Comment
has text: As I remember this is dependent by operating system/browser. For example, now, I working on windows 7, 8, chrome, and this is not problem. But i remember in past i haves same problem on (propably) older ff versions and other operating systems.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28835188

http://stackoverflow.com/comment/117415617
has text: I was caught by this trap as well. I should have referred to [HTMLScriptElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement#properties)'s doc instead of [` `](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attributes)'s.
type: Comment
comment on: http://stackoverflow.com/a/28907499
score: 1
type: AnswerComment

http://stackoverflow.com/a/28768498
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28763772
has comment: http://stackoverflow.com/comment/56469491
upvote count: 1
has comment: http://stackoverflow.com/comment/54638844
has body: The other answers are correct, but if you want to do it in jquery you can do this: $('selector').css( 'cursor', 'url(cursor.ico)' );
has comment: http://stackoverflow.com/comment/56447447

http://stackoverflow.com/q/28819828
has comment: http://stackoverflow.com/comment/45911769
score: -4
has answer: http://stackoverflow.com/a/28820236
has title: Trying to create a simple sum calculator
has body: Trying to create a simple calculator in javascript with no jquery with one input that expects comma-separated numbers to find the sum and the average. This is my js function getSum() { var Sum = document.getElementById('numb').value; } function sum() { var sumOfNumb = 0, numb = document.getElementById("numb").value.split(","); for (var i = 0; i &lt; numb.length; i++) { sumOfNumb += parseInt(numb[i]); } document.getElementById("sum").innerHTML = sumOfNumb; } Relevant markup: &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head lang="en"&gt; &lt;meta charset="UTF-8"&gt; &lt;title&gt;&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;input id="numb" type="number" /&gt; &lt;input type='button' value="button" onclick='Sum()' /&gt; &lt;script src="js/main.js"&gt;&lt;/script&gt; &lt;/body&gt;
has comment: http://stackoverflow.com/comment/45911450
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45911469
has comment: http://stackoverflow.com/comment/45911883
accepted answer: http://stackoverflow.com/a/28820236
type: Question
has comment: http://stackoverflow.com/comment/45911659
downvote count: 4
upvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45912028

http://stackoverflow.com/q/28824679
has comment: http://stackoverflow.com/comment/45921213
tagged with: javascript
has comment: http://stackoverflow.com/comment/45920781
tagged with: jquery
has comment: http://stackoverflow.com/comment/45920476
score: 0
has body: // Create Reader. var xmlFile = document.getElementById( 'xmlFile' ).files[0]; var reader = new FileReader(); reader.readAsText( xmlFile ); reader.onload = function( event ) { var XMLData = event.target.result; alert(XMLData); jQuery.ajax ({ url: ajaxurl, type: "POST", data: { action: 'upload_products', XMLData: XMLData }, success: function( data ) { }, error: function( data ) { } }); }; sample text file: it contains large number of products in it. &lt;?xml version="1.0"?&gt; &lt;TABLE-RECORDS&gt; &lt;EXPORT-RECORDS&gt; &lt;!-- product 1 --&gt; &lt;PRODUCT&gt; &lt;PRODUCTS_NAME&gt;Panasonic Super Heavy Duty Battery AA - 4 Pack&lt;/PRODUCTS_NAME&gt; &lt;PRODUCTS_DESCRIPTION&gt;fully functional whenever you need them.&lt;/PRODUCTS_DESCRIPTION&gt; &lt;PRODUCTS_IMAGE&gt;1019.jpg&lt;/PRODUCTS_IMAGE&gt; &lt;PRODUCTS_PRICE&gt;1.90&lt;/PRODUCTS_PRICE&gt; &lt;PRODUCTS_MODEL&gt;1019&lt;/PRODUCTS_MODEL&gt; &lt;ITEM_BRANDNAME&gt;Panasonic&lt;/ITEM_BRANDNAME&gt; &lt;ITEM_UPC&gt;073096500235&lt;/ITEM_UPC&gt; &lt;ITEM_HEIGHT&gt;0.500&lt;/ITEM_HEIGHT&gt; &lt;ITEM_LENGTH&gt;4.250&lt;/ITEM_LENGTH&gt; &lt;ITEM_DIAMETER&gt;3.375&lt;/ITEM_DIAMETER&gt; &lt;PRODUCTS_WEIGHT&gt;0.16&lt;/PRODUCTS_WEIGHT&gt; &lt;MANUFACTURERS_NAME&gt;Utm distributing&lt;/MANUFACTURERS_NAME&gt; &lt;ITEM_VENDOR_NUMBER&gt;UM-3NPA/4B&lt;/ITEM_VENDOR_NUMBER&gt; &lt;DATE_RECIEVED&gt;0000-00-00 00:00:00&lt;/DATE_RECIEVED&gt; &lt;PROP_PACKAGING&gt;Blister Card&lt;/PROP_PACKAGING&gt; &lt;PRODUCT_CLASS&gt;BAT&lt;/PRODUCT_CLASS&gt; &lt;PRODUCTS_TYPE&gt;Batteries&lt;/PRODUCTS_TYPE&gt; &lt;/PRODUCT&gt; &lt;!-- product 2 and so on --&gt; &lt;PRODUCT&gt; .... &lt;/PRODUCT&gt; &lt;/TABLE-RECORDS&gt; &lt;/EXPORT-RECORDS&gt; This is my code. The above code is working nicely for small files but for larger files it crashes. how can i read large files? Any help would be appreciated.
has title: read big text file (24mb) using jquery or js
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45921470
has comment: http://stackoverflow.com/comment/45920693
has comment: http://stackoverflow.com/comment/45921324
has comment: http://stackoverflow.com/comment/45921120
has comment: http://stackoverflow.com/comment/45920848
type: Question
linked to: http://stackoverflow.com/q/1122418
has comment: http://stackoverflow.com/comment/45920441

http://stackoverflow.com/comment/46053883
has text: @liquidflo Could you please check again the same link
type: Comment
comment on: http://stackoverflow.com/a/28896357
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46058738
comment on: http://stackoverflow.com/a/28888651
type: AnswerComment
score: 0
type: Comment
has text: You should have a look to the role documentation: http://docs.mongodb.org/v2.6/reference/built-in-roles/ `root does not include any access to collections that begin with the system. prefix.` The error shows an access denied on Auth.system.indexes, so you should try adding the role dbAdmin on the Auth database to your user, even if he has already the root role.

http://stackoverflow.com/q/28862309
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45990030
score: 0
duplicate of: http://stackoverflow.com/q/1664282
has body: I'm attempting to alert the keys (NOT values) of an object specified by a user selected value but I'm having no luck. I can successfully alert the keys if I manually input the object name in the for loop. Heres the snippet of my code: AL AK function populateAirport(selectedValue){ AL = {"Birmingham–Shuttlesworth International Airport":"BHM","Huntsville International Airport":"HSV"} AK = {"Ted Stevens Anchorage International Airport":"ANC","Fairbanks International Airport":"FAI","Juneau International Airport":"JNU","Ketchikan International Airport":"KTN"} for(var i in selectedValue){//if I replaced 'selectedValue' with 'AL' I alert the keys in the object just fine alert(i); } } I just want to be a to dynamically reference an object based on the selected value. Thanks in advance for your help.
linked to: http://stackoverflow.com/q/5117127
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/1664282
tagged with: object
linked to: http://stackoverflow.com/q/724857
has comment: http://stackoverflow.com/comment/45990140
has answer: http://stackoverflow.com/a/28862676
has comment: http://stackoverflow.com/comment/45989956
has comment: http://stackoverflow.com/comment/45989925
type: Question
has title: Reference An Object Name from User Selected Input

kendo-grid
tags question: http://stackoverflow.com/q/28865355
tags question: http://stackoverflow.com/q/28837657
tags question: http://stackoverflow.com/q/28839413
tag name: kendo-grid
tags question: http://stackoverflow.com/q/28884623
tags question: http://stackoverflow.com/q/28898845
tags question: http://stackoverflow.com/q/28837616
type: Tag
tags question: http://stackoverflow.com/q/28784081

http://stackoverflow.com/a/28827091
type: Answer
answers question: http://stackoverflow.com/q/28826792
has body: please try this var data = { "Crime":[ {"id":"1","text":"Number of police"}, { "id":"2","text":"Number of crimes"} ], "Health":[ {"id":"3","text":"Number of doctors"}, {"id":"4","text":"Number of hospital visits"}, {"id":"5","text":"Number of nurses"} ], } window.onload = function () { var themeSel = document.getElementById("theme"), questionSel = document.getElementById("questions"); for (var theme in data) { themeSel.options[themeSel.options.length] = new Option(theme, theme); } themeSel.onchange = function () { questionSel.length = 1; // remove all options bar first if (this.selectedIndex &lt; 1) return; // done for(var i=0;i&lt;data[this.value].length;i++) { questionSel.options[questionSel.options.length] = new Option(data[this.value][i].text, data[this.value][i].id); } } } working fiddle http://jsfiddle.net/tc1f3kup/3/
has comment: http://stackoverflow.com/comment/45929715
score: 0

getjson
tags question: http://stackoverflow.com/q/28826974
tags question: http://stackoverflow.com/q/28897225
type: Tag
tags question: http://stackoverflow.com/q/28879696
tag name: getjson

http://stackoverflow.com/q/28868571
accepted answer: http://stackoverflow.com/a/28868694
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46001583
type: Question
score: 0
has comment: http://stackoverflow.com/comment/46001677
answer count: 1
tagged with: javascript
tagged with: blur
has answer: http://stackoverflow.com/a/28868694
tagged with: http://stackoverflow.com/tag/html
has title: Javascript: trouble with blur
has body: I'm trying to have a navigation item morph into a search bar when clicked upon, and returns to its original state when the user clicks elsewhere. The morphing's going fine but I figured 'blur' would be my best option to trigger the morphing back and it's not working. The markup's this: Search and the scripting: function startSearch() { if(!ifSearch) { var search = document.getElementById("search"); var form = document.createElement("form"); var textfield = document.createElement("input"); var submit = document.createElement("input"); search.innerHTML = ""; form.setAttribute("action", "search.php"); form.setAttribute("method", "get"); textfield.setAttribute("type", "text"); textfield.setAttribute("id", "searchfield"); textfield.setAttribute("name", "searchItem"); submit.setAttribute("type", "submit"); submit.setAttribute("id", "subSearch"); form.appendChild(textfield); form.appendChild(submit); search.appendChild(form); ifSearch = true; search.addEventListener("blur",function() { search.innerHTML = 'Search'; ifSearch = false; }); } } var ifSearch = false; document.getElementById("search").addEventListener("click", startSearch); The "blur" event never triggers. Tried "focusout" with IE and it works one time out of twenty. Not sure what's happening so I'd be really grateful if someone could enlighten me

http://stackoverflow.com/comment/45817040
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28769119
type: Comment
has text: @Mateusz: this is the error that appeared now.. Missing boundary in multipart/form-data POST data

http://stackoverflow.com/comment/46038553
score: 0
has text: @dandavis Sorry but i don't understand, if i don't use jsop it doesn't work.. if i try with cURL could work?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28888395

http://stackoverflow.com/comment/45977040
has text: @amitjoki Yeah, thats what I though. Regex is great for parsing large documents as the performance hit is less noticeable, but when parsing tiny strings its quite heavy. :)
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28854455

http://stackoverflow.com/comment/45919508
has text: no no...any method that works I need.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28824227

http://stackoverflow.com/comment/45972097
type: AnswerComment
has text: the constructor `new Map(a)` doesn't work, it says "_Supplied parameters do not match any signature of call target_". Should it be cause I'm coding in TypeScript and not in JavaScript?
comment on: http://stackoverflow.com/a/28852196
score: 0
type: Comment

http://stackoverflow.com/q/28751669
has title: Sonar analysis for ExtendScript(JSX) files
tagged with: jsx
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/58386402
favorite count: 0
has body: I have a list of files with .jsx extension which needs to be analyzed with Sonar. No plugin is available in Sonarqube for the same. Can anything be done to the existing JavaScript Sonar plugin to analyze .jsx files. Anyone?
type: UnansweredQuestion
tagged with: extendscript
has answer: http://stackoverflow.com/a/28753330
type: Question
score: 5
upvote count: 5
tagged with: javascript
tagged with: sonarqube

http://stackoverflow.com/comment/46415570
type: AnswerComment
score: 0
has text: @cocco I may actually not fully understand what it is you're trying to do. Please just try an experiment using the last two code blocks in my answer and see how that works. It addresses log checking and server load and should be a good start. Streaming will NOT reduce the amount of data you have to send and broadcasting will only work if you have permission to send to the broadcast IP address on a particular sub net.
type: Comment
comment on: http://stackoverflow.com/a/28947496

http://stackoverflow.com/q/28801458
tagged with: javascript
has comment: http://stackoverflow.com/comment/45876747
tagged with: canvas
upvote count: 1
answer count: 1
favorite count: 0
has title: Javascript: how to move a context object in relation with its rotation
type: AnsweredQuestion
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/28801638
accepted answer: http://stackoverflow.com/a/28801638
has body: I want to make game using html canvas. My objective is to move a rectangle up and down, and it will rotate when I press left and right. Think like a car, cars only go forward and backwards but they don't go left and right, they rotate. The only problem is my rectangle rotates but it doesn't move in relation with its rotation, it only moves up and down no matter where it is facing. this.Draw = function() { //this goes inside constructor ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height); ctx.save(); ctx.fillStyle = this.color; ctx.translate(this.x, this.y); ctx.rotate(this.angle * Math.PI / 180); ctx.fillRect( -1* this.width/2 , -1* this.height/2, this.width, this.height); //center context to get a center rotation ctx.restore(); }; I could not figure it out how to move the rectangle forward, so it just moves up and down. For my rectangle movement I used a list with the 4 inputs that I have, and then when they are true, they'll move. Here: this.inputWASD = [false,false,false,false]; //this goes inside constructor //input for ----&gt;[ W , A , S , D ] &lt;--------- switch(keyDown.key){ case 87: //w rect1.inputWASD[0] = true; break; case 83: //s rect1.inputWASD[2] = true; break; case 65: //a rect1.inputWASD[1] = true; break; case 68: //d rect1.inputWASD[3] = true; break; }; switch(keyUp.keyCode){ case 87: rect1.inputWASD[0] = false; break; case 83: rect1.inputWASD[2] = false; break; case 65: rect1.inputWASD[1] = false; break; case 68: rect1.inputWASD[3] = false; break; }; funtion Update() { if(this.inputWASD[0] == true){this.y-= velocity} //UP and DOWN else if(this.inputWASD[2] == true){this.y+= velocity}; if(this.inputWASD[1] == true){this.angle -= angleMovement} //Rotate RIGHT and LEFT else if(this.inputWASD[3] == true) {this.angle += angleMovement}; If you don't know an answer but you know about a library that I can use to move a context object based on its rotation, please tell me.
type: Question
tagged with: rotation
tagged with: vector

http://stackoverflow.com/comment/45826226
comment on: http://stackoverflow.com/q/28773870
type: Comment
type: QuestionComment
score: 0
has text: *covers face*... I don't have one?

http://stackoverflow.com/a/28859445
downvote count: 0
type: Answer
has body: Not sure if this helps $(window).on('scroll', function(){ $("#head").html($(this).scrollTop()); }); JSfiddle
upvote count: 2
score: 2
answers question: http://stackoverflow.com/q/28859277
has comment: http://stackoverflow.com/comment/45985594

http://stackoverflow.com/q/28876845
possible better answer: http://stackoverflow.com/a/28877105
has answer: http://stackoverflow.com/a/28877105
has comment: http://stackoverflow.com/comment/46015703
has comment: http://stackoverflow.com/comment/46015724
type: Question
has comment: http://stackoverflow.com/comment/46015691
has comment: http://stackoverflow.com/comment/46016900
tagged with: javascript
has comment: http://stackoverflow.com/comment/46015657
has comment: http://stackoverflow.com/comment/46015685
score: 0
linked to: http://stackoverflow.com/q/18480550
answer count: 3
has title: Load background.image sequence from folder with Javascript
has body: i'm tring to make a javascript source that load all images in a folder as backgroundImage of my div &lt;script type="text/javascript"&gt; $(document).ready(function() { $('body').css('background-image', 'url(/web/images/001.png)'); }); &lt;/script&gt; How i can load all images (.png) in my folder (web/images) as background-image of a div? Thanks for support, M.
has answer: http://stackoverflow.com/a/28877329
accepted answer: http://stackoverflow.com/a/28877329
has answer: http://stackoverflow.com/a/28877252
tagged with: css
type: AnsweredQuestion

http://stackoverflow.com/q/28866683
tagged with: arrays
tagged with: javascript
answer count: 2
has title: Substitute array values into a loop to create new arrays
downvote count: 0
accepted answer: http://stackoverflow.com/a/28866719
favorite count: 0
possible better answer: http://stackoverflow.com/a/28866745
has answer: http://stackoverflow.com/a/28866745
upvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46489698
score: 1
has comment: http://stackoverflow.com/comment/45998246
has body: I don't program in javascript much so feel free to tell me if this is a crazy idea. I'd like to take values in an array and build arrays off of those values. For example, using the "people" array below, I want to create empty arrays "jack_test", "john_test", "mary_test", etc. var people = ["jack","john","mary"]; for (var i = 0; i &lt; people.length; i++){ //I'd like to execute code here that would create new arrays like jack_test = [], john_test= [], etc. } UPDATE: poor question, sorry about that. I'm really at a beginners level with this stuff so bear with me. Let's try a little different scenario (sorry if it strays from original question too much): Say I have an array like "people", though in reality, it'll be much longer. Then I have another array that has associated body weights, i.e. var weights = [150,180,120] For each person, I'd like to take their starting weight in the array "weights" and add some constant to it to form variables (or as @Pointy points out, form property names) "jack_weight","john_weight" etc. If I've set this up wrong in my mind and there's some more efficient method, please let me know.
has comment: http://stackoverflow.com/comment/45998183
type: Question
has answer: http://stackoverflow.com/a/28866719
has comment: http://stackoverflow.com/comment/45998426

http://stackoverflow.com/q/28868931
possible better answer: http://stackoverflow.com/a/28868982
accepted answer: http://stackoverflow.com/a/28868971
answer count: 4
has title: Select elements with data-attribute date value older than current server date
type: AnsweredQuestion
score: 2
tagged with: custom-data-attribute
has answer: http://stackoverflow.com/a/28869485
type: Question
has answer: http://stackoverflow.com/a/28869141
has body: I have a list of events that each have a custom data attribute containing a date: What I'm trying to do is select all of the li.event-item elements within ul.event-list whose data-event-date attribute is older than the current (server time) date, and then move them to ul.old-event-list. I know i can use appendTo to move the elements, but I have no idea how to select only the elements with an older date attribute than whatever the current server date is. Any advice is greatly appreciated!
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: date
has answer: http://stackoverflow.com/a/28868971
has answer: http://stackoverflow.com/a/28868982
favorite count: 0
upvote count: 2

http://stackoverflow.com/comment/45942578
comment on: http://stackoverflow.com/a/28835633
has text: @AlwaysLearning see my answer for a much cleaner method of comparing times
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45956084
comment on: http://stackoverflow.com/q/28843505
type: Comment
has text: @skroczek please read the full post before commenting.
type: QuestionComment
score: 0

http://stackoverflow.com/comment/49574131
type: AnswerComment
has text: Hey @alecxc. Just got back from vacation. As soon as I finish putting out a few bonfires, so-to-speak, I'll give this a try. Thanks!
type: Comment
comment on: http://stackoverflow.com/a/28864507
score: 0

http://stackoverflow.com/q/28887620
score: 3
answer count: 1
downvote count: 0
linked to: http://stackoverflow.com/q/18386753
favorite count: 0
tagged with: promise
has comment: http://stackoverflow.com/comment/46041221
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/18386753
tagged with: node.js
has title: Sequentially call/execute same function on a array of values using Q promise library in Node; and return a new array/collection with the result
upvote count: 3
type: Question
tagged with: javascript
tagged with: http://stackoverflow.com/tag/q
has body: For the below code, how to call the downloadFile() function sequentially for each of the entry in the arrUrls[] - using the npm Q promise library, so that only one file gets downloaded at a time. var q = require("q"); var arrUrls = ['http://1.com', 'http://2.com']; //content/length of this array will actually be dynamic. var downloadFile = function(link) { var deferred = q.defer(); var requesthandler = function(url, error, response, html) { //format response and return deferred.resolve(response); } request(urloptions, requesthandler.bind(null, link)); return deferred.promise; }; I know this can be done straight forward using npm async library's async.mapSeries(). But, async uses callback approach, and I would prefer a solution using promise if possible.
has answer: http://stackoverflow.com/a/28887730

http://stackoverflow.com/q/28887697
type: UnansweredQuestion
score: 2
downvote count: 0
tagged with: d3.js
has answer: http://stackoverflow.com/a/28888356
has title: Is it possible to use a data.enter() method within a data.enter() method?
type: Question
has comment: http://stackoverflow.com/comment/46036716
tagged with: javascript
has body: I think the title is self-explanatory. Lets say I'm entering some divs like this and using each to create a separate enter cascade: var rects = g.selectAll("rect").data(data); rects.enter() .append("rect") .attr("width","100px") .attr("height","100px") .attr("y",function(d,i){ return margin.top + (i * spacing) + "px"}) .attr("x",margin.left + "px") .attr("fill", function(d) { return "d.color" } .each(function(d,i){ var that = d3.select(this) that.selectAll('circle.timelinefeatures') .data(allevents) .enter() .append('circle') .attr('class',"timelinecircles") }); Is this the correct approach?
upvote count: 2
answer count: 1
favorite count: 0

http://stackoverflow.com/q/28805282
tagged with: linkedin-api
has comment: http://stackoverflow.com/comment/45884881
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45904626
downvote count: 0
score: 1
has title: Cannot authorize with LinkedIn
favorite count: 0
has body: I'm trying to get the first name, surname and email from a user on my website with LinkedIn. This is what I've done: In my LinkedIn App I've set the Default Scope (OAuth User Agreement) to: r_basicprofile r_contactinfo w_share r_emailaddress I've correctly added my domain to Javascript API Domains. I didn't add a link to OAuth 2.0 Redirect URLs. But I don't know if that's mandatory (and which path to insert)? I've also copied my API Key (Consumer Key). Now in my HTML I have: &lt;script type="text/javascript" src="http://platform.linkedin.com/in.js"&gt; lang: en_US api_key: myapikey scope: r_basicprofile r_emailaddress &lt;/script&gt; &lt;input class="apply-with-linkedin" type="button" value="Apply with LinkedIn" id="btn-linkedin-apply"&gt; &lt;script type="text/javascript"&gt; jQuery('#btn-linkedin-apply').click(function (e) { e.preventDefault(); e.stopPropagation(); IN.User.authorize(function () { IN.API.Profile('me').fields([ 'firstName', 'lastName', 'emailAddress' ]).result(function (profiles) { var me = profiles.values[0]; if (me.hasOwnProperty('firstName')) { jQuery('#apply-form #input-firstname').val(me.firstName); } if (me.hasOwnProperty('lastName')) { jQuery('#apply-form #input-lastname').val(me.lastName); } if (me.hasOwnProperty('emailAddress')) { jQuery('#apply-form #input-email').val(me.emailAddress); } }); }); }); &lt;/script&gt; But I always get the javascript error Cannot read property 'authorize' of undefined when I click the button. The IN.User is undefined. What could be wrong with this? ... UPDATE: The javascript code where I specify my API Key, ... I've copied from the "Getting Started with the JavaScript SDK" from LinkedIn. &lt;script type="text/javascript" src="//platform.linkedin.com/in.js"&gt; api_key: [API_KEY] onLoad: [ONLOAD] authorize: [AUTHORIZE] lang: [LANG_LOCALE] &lt;/script&gt;
tagged with: oauth
type: Question
upvote count: 1
has answer: http://stackoverflow.com/a/28816668
answer count: 1
tagged with: oauth-2.0
has comment: http://stackoverflow.com/comment/45883935

http://stackoverflow.com/comment/89715850
type: Comment
has text: Thanks, this worked in my case whereas others didn't apply or didn't work!
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/45339587

http://stackoverflow.com/q/28824652
has answer: http://stackoverflow.com/a/28825551
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/45920247
tagged with: responsive-design
has comment: http://stackoverflow.com/comment/45923307
has answer: http://stackoverflow.com/a/28825107
type: Question
tagged with: mobile
has comment: http://stackoverflow.com/comment/45920275
tagged with: javascript
has title: My mobile responsive website is not resizing properly
has body: i have a website in development phase. The default view looks fine, but when the browser is re-sized, instead of being gracefully responsive, the images and fonts looks too stretched or squeezed. I have attached two images here. Pls advice what is wrong. Thank You.
score: 0
answer count: 2

http://stackoverflow.com/comment/52096061
type: AnswerComment
has text: @shaunjacobsen There is a feature request to [add weighted voronoi to d3](https://github.com/mbostock/d3/issues/1893).
score: 0
comment on: http://stackoverflow.com/a/28866131
type: Comment

http://stackoverflow.com/comment/45952401
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28841209
has text: Btw `` is stripping too.
score: 0

http://stackoverflow.com/a/28816608
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28815905
has body: I found out a way of doing it. in the mainDetail.ascx javascript I added the following: $('#modal-content div').each(function (index) { alert($(this).text()); $(this).html("updated text now"); }); Not only does this loop through each div in the modal window on the mainpage.aspx, but it also updates the text values in the div.
answers question: http://stackoverflow.com/q/28815905

http://stackoverflow.com/comment/46187747
type: QuestionComment
type: Comment
has text: Can you give me example code, i confused :(
score: 0
comment on: http://stackoverflow.com/q/28863330

http://stackoverflow.com/a/28851853
downvote count: 0
upvote count: 2
type: Answer
has body: You can try the following : $(".dropdown-menu li a img").hover(function(){ $(this).attr('src', $(this).attr('src').replace('1','2')); }, function (){ $(this).attr('src', $(this).attr('src').replace('2','1')); }) Hope it works !
score: 2
answers question: http://stackoverflow.com/q/28851487

http://stackoverflow.com/comment/45943655
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28814721
has text: Thanks, have updated my question to make it clearer what I'm after

ruby-on-rails
tags question: http://stackoverflow.com/q/28902607
type: Tag
tags question: http://stackoverflow.com/q/28797317
tags question: http://stackoverflow.com/q/28793650
tags question: http://stackoverflow.com/q/28843787
tags question: http://stackoverflow.com/q/28827252
tags question: http://stackoverflow.com/q/28896091
tags question: http://stackoverflow.com/q/28903927
tags question: http://stackoverflow.com/q/28891281
tags question: http://stackoverflow.com/q/28895748
tags question: http://stackoverflow.com/q/28806932
tags question: http://stackoverflow.com/q/28815164
tags question: http://stackoverflow.com/q/28779721
tags question: http://stackoverflow.com/q/28755540
tags question: http://stackoverflow.com/q/28774286
tags question: http://stackoverflow.com/q/28864079
tags question: http://stackoverflow.com/q/28758820
tags question: http://stackoverflow.com/q/28775675
tags question: http://stackoverflow.com/q/28816617
tags question: http://stackoverflow.com/q/28824561
tags question: http://stackoverflow.com/q/28805312
tags question: http://stackoverflow.com/q/28863054
tags question: http://stackoverflow.com/q/28860276
tags question: http://stackoverflow.com/q/28894322
tags question: http://stackoverflow.com/q/28860709
tags question: http://stackoverflow.com/q/28906658
tags question: http://stackoverflow.com/q/28753166
tags question: http://stackoverflow.com/q/28871686
tags question: http://stackoverflow.com/q/28799049
tags question: http://stackoverflow.com/q/28870860
tags question: http://stackoverflow.com/q/28769492
tags question: http://stackoverflow.com/q/28864324
tags question: http://stackoverflow.com/q/28767773
tags question: http://stackoverflow.com/q/28822730
tag name: ruby-on-rails
tags question: http://stackoverflow.com/q/28841454
tags question: http://stackoverflow.com/q/28890275
tags question: http://stackoverflow.com/q/28895039
tags question: http://stackoverflow.com/q/28794432
tags question: http://stackoverflow.com/q/28768849
tags question: http://stackoverflow.com/q/28752451
tags question: http://stackoverflow.com/q/28873555
tags question: http://stackoverflow.com/q/28870567
tags question: http://stackoverflow.com/q/28792138
tags question: http://stackoverflow.com/q/28827792
tags question: http://stackoverflow.com/q/28783039
tags question: http://stackoverflow.com/q/28869101
tags question: http://stackoverflow.com/q/28764232
tags question: http://stackoverflow.com/q/28895654
tags question: http://stackoverflow.com/q/28751908
tags question: http://stackoverflow.com/q/28773951
tags question: http://stackoverflow.com/q/28866610
tags question: http://stackoverflow.com/q/28878034
tags question: http://stackoverflow.com/q/28904150
tags question: http://stackoverflow.com/q/28751532
tags question: http://stackoverflow.com/q/28798073
tags question: http://stackoverflow.com/q/28773302
tags question: http://stackoverflow.com/q/28756304
tags question: http://stackoverflow.com/q/28821703
tags question: http://stackoverflow.com/q/28857774
tags question: http://stackoverflow.com/q/28752929
tags question: http://stackoverflow.com/q/28774341
tags question: http://stackoverflow.com/q/28854146
tags question: http://stackoverflow.com/q/28820799
tags question: http://stackoverflow.com/q/28754758
tags question: http://stackoverflow.com/q/28843404
tags question: http://stackoverflow.com/q/28877417
tags question: http://stackoverflow.com/q/28760633
tags question: http://stackoverflow.com/q/28762640
tags question: http://stackoverflow.com/q/28818541
tags question: http://stackoverflow.com/q/28866320

http://stackoverflow.com/comment/45943780
comment on: http://stackoverflow.com/q/28836569
score: 1
has text: I have no idea, but let's see: 1) Does this increased memory ever cause the browser to use too-much memory or is it "eventually" capped? Running with a much smaller interval might show a limiting behavior. 2) Does there persist some HTML that maintains a binding to some old observable that has been "replaced" in the VM? (Along with this: which object(s) in the Memory Profile keep having more instances created? The Memory Allocation profile can also be used, which allows "timeslicing".)
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28930716
score: 2
upvote count: 2
has body: this object of your click handler is not the same as this object outside of it. Context is different: inside the handler this object is pointing to $('.chart-button'). You can either define a variable outside the handler and use it: var gridster = $('.gridster ul').gridster(...).data('gridster'); $(".chart-button").click(function () { gridster.add_widget(' heloooooo '); }); or you can bind this (override context for handler) to the handler: this.gridster = $('.gridster ul').gridster(...).data('gridster'); $(".chart-button").click(function () { gridster.add_widget(' heloooooo '); }.bind(this));
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28870075
type: Answer
answers question: http://stackoverflow.com/q/28870075

http://stackoverflow.com/q/28858433
score: -4
has comment: http://stackoverflow.com/comment/45982806
type: AnsweredQuestion
has body: I have list01 like : var list01 = [ { date: **01/01/2015**, statut: [1,2,6], name: '**Name X**' }, { date: **01/01/2015**, statut: [5,6], name: '**Name X**' }, { date: 01/01/2016, statut: [5,6], name: 'Name Y' }, ... ] I want to generate list02 who contains all items that have the same name and date from list01 var list02 = [ { date: 01/01/2015, name: 'Name x', **nbrItem: 2** }, { date: 01/01/2016, statut: [5,6], name: 'Name Y', **nbrItem: 1** }, ... ] I want a better way to solve this problem
has comment: http://stackoverflow.com/comment/45982803
has answer: http://stackoverflow.com/a/28858867
type: Question
answer count: 2
has title: intersection of two array of objects using angularjs or javascript
upvote count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28858538
favorite count: 0
has comment: http://stackoverflow.com/comment/45982724
has comment: http://stackoverflow.com/comment/45982805
has answer: http://stackoverflow.com/a/28858538
linked to: http://stackoverflow.com/q/122102
possible better answer: http://stackoverflow.com/a/28858867
tagged with: angularjs
downvote count: 5

http://stackoverflow.com/q/28860100
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28861272
has comment: http://stackoverflow.com/comment/45985810
has title: .innerHTML is blocked from other function?
tagged with: javascript
type: UnansweredQuestion
type: Question
has body: I want a other text on a button until a validation progress. But the .innerHTML does not change the HTML. var keeybtn = document.getElementById('kyloginbtn'); function checkForm() { keeybtn.innerHTML = 'Go'; var email = document.getElementById("kymail").value; if (email === '') { keeybtn.innerHTML='Fill Email field'; message(); return false; } else { document.getElementById("kyloginform").submit(); validate(email); } } When I comment out the "validate(email)" function it works. function validate(email) { var xmlhttp; if (window.XMLHttpRequest) {// for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState != 4 &amp;&amp; xmlhttp.status == 200) { keeybtn.innerHTML = "Validating.."; } else if (xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200) { keeybtn.innerHTML = xmlhttp.responseText; if(xmlhttp.responseText == "ok") { reloadPage(); } else { message(); } } else { console.log("Error"); } } xmlhttp.open("GET", "pk-login.php?email=" + email, false); xmlhttp.send(); } If everything is valid xmlhttp.Text appear on the button.
has answer: http://stackoverflow.com/a/28873873
has comment: http://stackoverflow.com/comment/45985906

http://stackoverflow.com/q/28794157
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45862927
type: UnansweredQuestion
has title: Unable to set html element value from automatic calculation from javascript function
type: Question
has answer: http://stackoverflow.com/a/28794573
answer count: 1
has body: I have written a simple JavaScript function to calculate date difference in my desired format. It is written in function clt(i). It is printing LoS_days, Los_months and Los_years value very correctly. I am using these calculated values as input of another function called function total(). It is written with to add these three date differences. But is not working properly. The reason is that it is not getting values from html form properly. I am attaching the complete code. &lt;html&gt; &lt;head&gt;&lt;script language="javascript" src="cal2.js"&gt; &lt;/script&gt; &lt;script language="javascript" src="cal_conf2.js"&gt;&lt;/script&gt; &lt;script type='text/javascript'&gt; function total(){ var td; var fd=document.getElementById("LoS_days1").value; var sd=document.getElementById("LoS_days2").value; var ld=document.getElementById("LoS_days3").value; var tm; var fm=document.getElementById("LoS_months1").value; var sm=document.getElementById("LoS_months2").value; var lm=document.getElementById("LoS_months3").value; var ty; var fy=document.getElementById("LoS_year1").value; var sy=document.getElementById("LoS_year2").value; var ly=document.getElementById("LoS_year3").value; td = (fd +sd +ld); var rd = td%30; var cm = Math.floor(td/30); document.getElementById("Totalexp_day").value=rd; tm = (cm + fm +sm +lm); var rm = tm%12; var cy = Math.floor(tm/12); document.getElementById("Totalexp_month").value=rm; ty = (cy + fy +sy +ly); document.getElementById("Totalexp_year").value=ty; //document.write("Difference: "+rd+" remaining days; "+cm+" carry forward months; "+td+" total days; "); } function clt(i){ // start year may be a leap year. if(startYears%4==0) { datesPerMonth[0]=29; } var datesPerMonth=new Array(31,28,31,30,31,30,31,31,30,31,30,31); var x=document.getElementById("PoS_from"+i); var startDate=x.value; var y=document.getElementById("PoS_to"+i); var endDate=y.value; //var startDate='2015/02/21'; //var endDate='2015/03/01'; var startExplode=startDate.split('/'); var star…
tagged with: javascript

http://stackoverflow.com/a/28837133
upvote count: 0
type: AcceptedAnswer
type: Answer
has body: nextEl is a jquery object, not a DOM object, so has no style property. Use jquery .show() and .is() if(!nextEl.is(':visible')) { nextEl.show() } You also appear to be using the same id for every checkbox (chkCheckBox), dont do this, instead use a class and attach your jquery event to that. $('.cb').on('click',function(){ nextID = $(this).attr('target'); nextEl = $('#' + nextID); if(!nextEl.is(':visible')) { nextEl.show(); } }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div&gt;&lt;input id="cb1" type="checkbox" class="cb" target="cb2"&gt;&lt;/div&gt; &lt;div&gt;&lt;input id="cb2" type="checkbox" class="cb" target="cb3" style="display:none"&gt;&lt;/div&gt; &lt;div&gt;&lt;input id="cb3" type="checkbox" class="cb" target="cb4" style="display:none"&gt;&lt;/div&gt;
has comment: http://stackoverflow.com/comment/45945574
downvote count: 1
accepted answer of: http://stackoverflow.com/q/28837017
answers question: http://stackoverflow.com/q/28837017
score: -1

http://stackoverflow.com/comment/45951972
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28841371
has text: @FelixKling Oooh, thanks, I see then! Makes sense now :-) I will accept the answer in about 5 minutes, when I'm allowed to do so by Stackoverflow.
type: Comment

http://stackoverflow.com/comment/45786020
comment on: http://stackoverflow.com/q/28751959
has text: Please add the desired result to your question by editing it
type: QuestionComment
score: 0
type: Comment

http://stackoverflow.com/comment/114962309
type: Comment
comment on: http://stackoverflow.com/q/28822323
type: QuestionComment
has text: The css route. http://jsfiddle.net/8ca2rvd7/3/
score: 0

http://stackoverflow.com/a/28843847
accepted answer of: http://stackoverflow.com/q/28843449
score: 1
answers question: http://stackoverflow.com/q/28843449
has body: You can get an API like the one you want with this: var validator = function(){ this.fields = []; this.rules = new rules(this); } validator.prototype = { addField: function(fieldName){ this.fields.push(fieldName); return this; } }; var rules = function(validator) { this.validator = validator; } rules.prototype = { addField: function(fieldName) { this.validator.addField(fieldName); return this; }, phone: function() { console.log("phone"); } }; v = new validator(); v.rules.addField("hello"); v.rules.phone(); Making rules inherit validator is semantically and practically problematic. Your validator.prototype here: validator.prototype = { addField: function(fieldName){ this.fields.push(fieldName); return this; }, rules: new rules() } will share the same rules object between all validator objects, which is probably not what you want. But then if you fixed this, by making a rules object in the validator constructor, you would have an infinite loop, since the validator constructor would call the rules constructor, and the rules constructor would call the validator constructor (since a rules is a validator).
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45957110
type: Answer
downvote count: 0

http://stackoverflow.com/comment/46061176
has text: It doesn't give me expecting result, I still do not have boundary. I still have lines between and some new lines that connect concatenated polygons. I need a mathematical model which will delete those lines between and give me the boundary.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28897975
type: AnswerComment

lcov
tags question: http://stackoverflow.com/q/28806209
tag name: lcov
type: Tag

http://stackoverflow.com/comment/46044356
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28891689
has text: How would you prevent the browser from covertly saving data (like a cache, which it does)? Also, you can certainly open a url in a new window with javascript and use a content-disposition header to trigger a save... so your question is unclear...
score: 0

http://stackoverflow.com/a/28751217
accepted answer of: http://stackoverflow.com/q/28751186
answers question: http://stackoverflow.com/q/28751186
type: Answer
has body: The property to set is .className, not .class. function makeEnglishPulse() { document.getElementById("english").className = "animated pulse"; }
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/45784512
has comment: http://stackoverflow.com/comment/45784428
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/45856687
comment on: http://stackoverflow.com/a/28771889
type: Comment
has text: What I meant was that in your steps 2 and 4 in the question, you validate with the same time-based logic on the client and again on the server. On the client, you can take Matt K's approach, because the client code is aware of the client's time zone. But on the server, by default you don't know the client's time zone unless you're capturing it somewhere else in the application.
score: 0
type: AnswerComment

http://stackoverflow.com/q/28811495
score: -2
has answer: http://stackoverflow.com/a/28811584
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45894984
has comment: http://stackoverflow.com/comment/45894998
type: Question
upvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28811584
answer count: 1
favorite count: 0
has body: I have the following: if (!program.args.length) { program.help() } else { var filename = program.args[0] fs.readFile(filename, 'utf8', function(err, data) { if (err) throw err var tree = markdown.parse(data); (function update_tree(jsonml) { for (i = 1; i &lt; jsonml.length; i++) { if (jsonml[i][0] === 'hr') { var par = jsonml[i + 1] console.log(par) par.splice(1, 0, { 'class': 'noind' }) } //if (jsonml[i][0] === 'para') { //var par = jsonml[i] //par.splice(1, 0, {'class': 'noind'}) //} } })(tree) var html = markdown.renderJsonML(markdown.toHTMLTree(tree)) console.log(html) }) } Is there a way to get the code inside else out while keeping the if part working? (The reason I want to do this is to remove one level of indentation.)
downvote count: 2
has title: How can I get code inside an else statement out while still making the if part work?

http://stackoverflow.com/q/28795639
score: 1
has answer: http://stackoverflow.com/a/28795767
type: Question
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28795731
has comment: http://stackoverflow.com/comment/45865802
answer count: 3
has answer: http://stackoverflow.com/a/28795731
has answer: http://stackoverflow.com/a/29538556
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
has body: Thank you for taking the time to read this, and help the Internets out with your response(s) in the process. I have a responsive website that runs on WordPress 4.0.1. After creating a Page and posting content to it, I noticed one of the iframes I posted is not responsive and does not look good on mobile devices with small screens (iPhone 4/4S/5/5S). Even though I used the vendor's solution via CSS to make the iframe responsive, it still does not render as nice in mobile devices with small screens. So I went ahead and created different iframes for each mobile device screen. Now I would like the ability to put some code on my page that will detect the user's screen horizontal resolution and load the iframe that would best fit that resolution. For example, IF User Screen is less than 305 THEN IFRAME for iPhone 5S ELSE IF IF User Screen is less than 355 THEN IFRAME for iPhone 6 ELSE IFRAME THAT SUPPORTS ALL OTHER WIDTHS What would be the best way to accomplish this using WordPress? I tried re-using the code in the two resolutions below with my own iframes, and they did not work: http://www.codingforums.com/javascript-programming/198521-help-if-else-statement-loading-iframe-based-resolution.html Load Iframe based on screen width Your help would be greatly appreciated!
tagged with: iframe
upvote count: 1
tagged with: css
accepted answer: http://stackoverflow.com/a/29538556
type: AnsweredQuestion
has title: Load different depending on user's screen width
tagged with: responsive-design

http://stackoverflow.com/q/28870462
has answer: http://stackoverflow.com/a/28870489
type: AnsweredQuestion
tagged with: getelementsbyclassname
has body: I have the following markup which I can't modify: Name I want to select the input and change its value using vanilla JS (assume jQuery is not available). I can't use the input name or ID as these are dynamic and will change. I have tried the following but it doesn't seem to work: (function(){ var listElement = document.getElementsByClassName('campID'); var myInput = listElement.getElementsByTagName('input'); myInput[0].value = 'John'; })();
type: Question
accepted answer: http://stackoverflow.com/a/28870489
has title: Class name to find nested tagname and assign value in Javascript
tagged with: javascript
has answer: http://stackoverflow.com/a/45383052
score: 0
tagged with: getelementsbytagname
answer count: 3
has answer: http://stackoverflow.com/a/28870773
has comment: http://stackoverflow.com/comment/46004599
possible better answer: http://stackoverflow.com/a/28870773

http://stackoverflow.com/a/28813457
answers question: http://stackoverflow.com/q/28813349
type: Answer
has body: Take a Boolean variable like var checkOnce= false; if (myVariable &gt;= 10 &amp;&amp; myVariable &lt;= 30) { checkOnce=true; sound.play("myFirstSound"); } else if (myVariable &gt;= 31 &amp;&amp; myVariable &lt;= 60) { checkOnce=true; sound.play("mySecondSound"); } else { etc etc... In loop check the value of checkOnce. Loop will run till checkOnce=false
upvote count: 4
score: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/45898938

http://stackoverflow.com/comment/46026571
score: 0
type: Comment
type: QuestionComment
has text: Is the number of variables a finite (and known) count or are you looking for a generic solution? Also, what good would it do to have the variable name returned? What is the use case?
comment on: http://stackoverflow.com/q/28882590

http://stackoverflow.com/a/28766237
has comment: http://stackoverflow.com/comment/45814941
has comment: http://stackoverflow.com/comment/45820947
type: Answer
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45817680
has body: This is down to order in which chord path elements appear in the DOM for the different browsers. In FireFox (presumably also in IE), the chords are drawn in the DOM in the same order that they appear in raw data. The first chord path (from the Firebug) is highlighted below: Chrome is different: It reorders two of the chord path elements. The first chord path (from the Chrome Dev Tools) is highlighted here: As you can see from the path data, these are not the same paths. I'm not sure why Chrome renders paths in the DOM in this different (unexpected) order! Where this impacts your example is that you use: svg.selectAll("path.chord")... to select each chord before assigning a color to it. The order of paths in the selection is based on order they appear in the DOM, hence why order is important. I would suggest refactoring the code to you don't need to read data.csv in twice (once to get data for the chord path, and then again just to assign the colors to those paths). Update One solution to this problem is to sort the chordPaths selection, for example on startAngle, before assigning colors. To do this: chordPaths = svg.selectAll("path.chord"); chordPaths.sort(function(a,b) {return a.source.startAngle - b.source.startAngle }) chordPaths.style("fill", ... See this updated plunker: http://plnkr.co/edit/xGKvEVeTLkZZLsTAiUFs?p=preview Documentation on selection.sort() at: https://github.com/mbostock/d3/wiki/Selections#sort
has comment: http://stackoverflow.com/comment/45817879
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28754842
accepted answer of: http://stackoverflow.com/q/28754842

http://stackoverflow.com/comment/45826771
has text: Please provide a [Minimal, Complete, Tested and Readable example](http://stackoverflow.com/help/mcve) that demonstrates the issue. The code you have posted looks like it _should_ work, but it depends on how you are using it whether it does or not.
type: Comment
comment on: http://stackoverflow.com/q/28774147
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45860580
comment on: http://stackoverflow.com/a/28792204
has text: I am still trying to figure how I can add this code to my code. I am getting this error: TypeError: funcModule[fetchRecord] is undefined funcModule[fetchRecord].call(this, page);
type: AnswerComment
score: 0
type: Comment

timer
tag name: timer
tags question: http://stackoverflow.com/q/28835183
type: Tag
tags question: http://stackoverflow.com/q/28903344
tags question: http://stackoverflow.com/q/28779111
tags question: http://stackoverflow.com/q/28780114
tags question: http://stackoverflow.com/q/28812756
tags question: http://stackoverflow.com/q/28858416
tags question: http://stackoverflow.com/q/28892531
tags question: http://stackoverflow.com/q/28864879

http://stackoverflow.com/comment/57795648
score: 0
type: Comment
type: QuestionComment
has text: This has nothing to do with Three.js
comment on: http://stackoverflow.com/q/28903118

http://stackoverflow.com/comment/105192432
type: Comment
comment on: http://stackoverflow.com/a/52948276
has text: @Kavalearun use `node-excel-export` package for easy export or save of excel from json in NodeJS
type: AnswerComment
score: 0

http://stackoverflow.com/a/28895680
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/46145790
has comment: http://stackoverflow.com/comment/46185421
downvote count: 0
answers question: http://stackoverflow.com/q/28825325
has comment: http://stackoverflow.com/comment/46208401
has comment: http://stackoverflow.com/comment/46144432
has comment: http://stackoverflow.com/comment/46143546
has comment: http://stackoverflow.com/comment/46142983
type: Answer
has comment: http://stackoverflow.com/comment/46195241
has body: Given your code, you can add one helper directive, to remove space in link function, once your option got selected. As an example, add an id to your select, and directive &lt;select id="mySelect" option-without-space&gt; &lt;option ng-repeat="(key, value) in headers"&gt; &lt;/option&gt; &lt;/select&gt; And directive might look like, app.directive('optionWithoutSpace', () =&gt; { return { restrict: 'A', link: function(scope, elem, attributes) { var selectedOptionWithoutSpace = function () { var selectedOption = $('#mySelect option:selected'); var optionText = selectedOption.text(); selectedOption.text(optionText.trim()) return false; }; $(elem).on('change', selectedOptionWithoutSpace); } } }) This is with a little help of jQuery, but I assume it is not a big problem. Here is a fiddle.

http://stackoverflow.com/comment/46141071
comment on: http://stackoverflow.com/q/28901098
score: 0
type: Comment
type: QuestionComment
has text: https://jsfiddle.net/Tumaini/8jvqk8Ly/2/

http://stackoverflow.com/q/28874079
has answer: http://stackoverflow.com/a/28876098
has answer: http://stackoverflow.com/a/28874219
answer count: 3
has answer: http://stackoverflow.com/a/28944634
possible better answer: http://stackoverflow.com/a/28944634
tagged with: node-webkit
tagged with: events
has body: I'm trying to make a mini kiosk browser (fullscreen, minimum option, etc) using nodewebkit. The kiosk browser is strutured like this : ... Loading The problem is, once the iframe is loaded and displayed (100% width and height) the event are fired in this iframe and not in my app. I've tried several things using the documentation but I didn't really understand how to make things work the way I want. So any help would be great ! thanks.
accepted answer: http://stackoverflow.com/a/28876098
type: AnsweredQuestion
tagged with: iframe
type: Question
has title: Node Webkit - Fire Event from iframe to the app
tagged with: javascript
tagged with: browser
score: 0

php
tags question: http://stackoverflow.com/q/28800310
tags question: http://stackoverflow.com/q/28906264
tags question: http://stackoverflow.com/q/28769496
tags question: http://stackoverflow.com/q/28795631
tags question: http://stackoverflow.com/q/28856420
tags question: http://stackoverflow.com/q/28851378
tags question: http://stackoverflow.com/q/28901294
tags question: http://stackoverflow.com/q/28840455
tags question: http://stackoverflow.com/q/28874795
tags question: http://stackoverflow.com/q/28815138
tags question: http://stackoverflow.com/q/28903175
tags question: http://stackoverflow.com/q/28884422
tags question: http://stackoverflow.com/q/28778618
tags question: http://stackoverflow.com/q/28764534
tags question: http://stackoverflow.com/q/28786947
tags question: http://stackoverflow.com/q/28831976
tags question: http://stackoverflow.com/q/28874284
tags question: http://stackoverflow.com/q/28874190
tags question: http://stackoverflow.com/q/28789727
tags question: http://stackoverflow.com/q/28818203
tags question: http://stackoverflow.com/q/28837888
tags question: http://stackoverflow.com/q/28756480
tags question: http://stackoverflow.com/q/28779111
tags question: http://stackoverflow.com/q/28905789
tags question: http://stackoverflow.com/q/28805831
tags question: http://stackoverflow.com/q/28834444
tags question: http://stackoverflow.com/q/28764628
tags question: http://stackoverflow.com/q/28834156
tags question: http://stackoverflow.com/q/28796059
tags question: http://stackoverflow.com/q/28780761
tags question: http://stackoverflow.com/q/28830327
tags question: http://stackoverflow.com/q/28821804
tags question: http://stackoverflow.com/q/28822554
tags question: http://stackoverflow.com/q/28878152
tags question: http://stackoverflow.com/q/28853766
tags question: http://stackoverflow.com/q/28760597
tags question: http://stackoverflow.com/q/28789793
tags question: http://stackoverflow.com/q/28880750
tags question: http://stackoverflow.com/q/28851242
tags question: http://stackoverflow.com/q/28805371
tags question: http://stackoverflow.com/q/28883958
tags question: http://stackoverflow.com/q/28770240
tags question: http://stackoverflow.com/q/28780086
tags question: http://stackoverflow.com/q/28783692
tags question: http://stackoverflow.com/q/28816675
tags question: http://stackoverflow.com/q/28795325
tags question: http://stackoverflow.com/q/28789259
tags question: http://stackoverflow.com/q/28770949
tags question: http://stackoverflow.com/q/28825605
tags question: http://stackoverflow.com/q/28888389
tags question: http://stackoverflow.com/q/28901129
tags question: http://stackoverflow.com/q/28857317
tags question: http://stackoverflow.com/q/28809293
tags question: http://stackoverflow.com/q/28824360
tags question: http://stackoverflow.com/q/28839687
tags question: http://stackoverflow.com/q/28872872
tags question: http://stackoverflow.com/q/28886471
tags question: http://stackoverflow.com/q/28784907
tags question: http://stackoverflow.com/q/28788434
tags question: http://stackoverflow.com/q/28888882
tags question: http://stackoverflow.com/q/28896532
tags question: http://stackoverflow.com/q/28811995
tags question: http://stackoverflow.com/q/28808877
tags question: http://stackoverflow.com/q/28829922
tags question: http://stackoverflow.com/q/28805046
tags question: http://stackoverflow.com/q/28816679
tags question: http://stackoverflow.com/q/28903983
tags question: http://stackoverflow.com/q/28755481
tags question: http://stackoverflow.com/q/28897470
tags question: http://stackoverflow.com/q/28809449
tags question: http://stackoverflow.com/q/28844376
tags question: http://stackoverflow.com/q/28831860
tags question: http://stackoverflow.com/q/28871488
tags question: http://stackoverflow.com/q/28816434
tags question: http://stackoverflow.com/q/28791046
tags question: http://stackoverflow.com/q/28864635
tags question: http://stackoverflow.com/q/28812200
tags question: http://stackoverflow.com/q/28884843
tags question: http://stackoverflow.com/q/28764564
tags question: http://stackoverflow.com/q/28751314

http://stackoverflow.com/q/28869255
favorite count: 0
answer count: 3
has comment: http://stackoverflow.com/comment/46002744
has title: Find array element by key in a chain
upvote count: 1
has answer: http://stackoverflow.com/a/28869314
type: AnsweredQuestion
has body: I am using an underscore chain, and am stuck on the last bit of it. I simply need it to look at a array of objects and return the correct object by it's key. here's what I have var item = _.chain(items) .findwhere({module: modulename}) .result('customUrl') //here is where the problem is .find(function(v,k){ return k == stateName }) .value(); So this works find up until that .find . At that point in the object, the find is looking at something this: [{"obj1" : ["1","2"]},{"obj2" : ["3","4"]}] I just want it to return the one with the same key that is stored in that variable stateName that is being passed. So if stateName was "obj1", it would return me ["1","2"]. If there is a better way to do it without underscore, I'm all ears, but I've been using it for now. Thanks Edit: I've made an attempt based on the answers here. Just to be clear this is what my data looks like : [ {"module":"module1", "customUrl":[{"mod1":["1","2"]},{"mod2":["1","2"]}] }, {"module":"module2", "customUrl":[{"mod3":["true","false"]},{"mod4":["5","6"]}] } ] And the attempt : checkitem = _.chain(currentState) .findWhere({module: moduleName}) .result('customUrl') .find(function(v){ return v.hasOwnProperty(stateName)}) .values() .flatten() .value(); So if the var stateName is mod1, I would like it to return me ["1","2"], like in the answers below, I think something is wrong in my chaining though. Thanks!
tagged with: underscore.js
has comment: http://stackoverflow.com/comment/46002743
type: Question
possible better answer: http://stackoverflow.com/a/28869334
accepted answer: http://stackoverflow.com/a/28869314
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28869481
score: 1
has answer: http://stackoverflow.com/a/28869334
has comment: http://stackoverflow.com/comment/46002710

http://stackoverflow.com/comment/45956454
score: 0
has text: @FelixKling As an aside, I was returning json. My actual json response was the success => true, which is what I needed to return for my project. I forgot to delete it before adding the test data used in my question. The answer was to access the value of success using data.success. Thanks for taking the time to bring me around to looking at the file a little closer.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28843505

http://stackoverflow.com/q/28878922
has title: I wrote the function below and i need to capture the string value it generates and assign it to another variable outside the function
answer count: 3
tagged with: function
upvote count: 0
tagged with: arrays
has answer: http://stackoverflow.com/a/28879055
favorite count: 0
tagged with: return
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46019826
has answer: http://stackoverflow.com/a/28879142
has body: var guess = 0; function search () { var myWeapon =""; for (var i = 0; i &lt;1; i++) { var myArray = ["rope","axe","crowbar","knife","shovel","hammer"]; // random number generator guess = Math.floor(Math.random()* 6); // the generator generates just one random sting from six possible string, and passes it to myWeapon myWeapon = (myArray[guess]); } } search();
has comment: http://stackoverflow.com/comment/46019593
has comment: http://stackoverflow.com/comment/46020068
has answer: http://stackoverflow.com/a/28879147
has comment: http://stackoverflow.com/comment/46019676
has comment: http://stackoverflow.com/comment/46019816
downvote count: 1
type: Question
tagged with: javascript
score: -1

http://stackoverflow.com/comment/46016953
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28877501
has text: could i change the width of scroll bar for IE
score: 0

http://stackoverflow.com/q/28876955
has comment: http://stackoverflow.com/comment/46015949
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28877070
favorite count: 0
has answer: http://stackoverflow.com/a/28877070
has comment: http://stackoverflow.com/comment/46015886
upvote count: 8
has answer: http://stackoverflow.com/a/28877053
has comment: http://stackoverflow.com/comment/46016037
tagged with: http://stackoverflow.com/tag/html
score: 8
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/54380623
has body: SCENARIO I have a java JSP view with a long form. This was working nice. I can submit my form by pressing enter in any input field or with submit button. NEW REQUIREMENT In a part, I must add buttons to replace some for to allow editing, nothing hard. WHAT I TRIED This part of the view is created dinamically, cause number of lines depends of the data introduced by user, this parts creates each line: resultadoHTML += " "; resultadoHTML += " " + nomCalidad + " "; resultadoHTML += " "; resultadoHTML += " "; resultadoHTML += " "; resultadoHTML += " "; resultadoHTML += " " + parts[4] + " "; resultadoHTML += " "; resultadoHTML += " "; resultadoHTML += " "; resultadoHTML += " "; resultadoHTML += " "; Resulting HTML of the button PROBLEM When I use onclick to define a function in the new button, this function is called, but after, the click event of the submit button is ALSO called and I dont know why... But as you can see in the code, even when i DON'T catch any event in the button the click event of the form is called. OTHER INFO FORM/BUTTON DEFINITION <form:form class="form-horizontal" role="form" method="post" commandName="contratMercan" action="../contratos/contratosubmit" name="formulario" id="edicionContrato"> <spring:message ... /> // omitted info SUBMIT FUNCTION $("#edicionContrato").submit(function(e){ e.preventDefault(); var form = this; // checks and workarounds... form.submit(); }); Any idea why could happen? Maybe dinamically introduced HTML code has some mistake and brokes javascript or html after?
has title: Onclick on normal button is submitting form
type: Question
accepted answer: http://stackoverflow.com/a/28877053
tagged with: javascript
tagged with: forms
answer count: 3
downvote count: 0

http://stackoverflow.com/q/28898532
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/46058883
has comment: http://stackoverflow.com/comment/46056986
tagged with: php
answer count: 1
has body: I have a simple question , I am trying to use ONE default layout with header and footer to automatically show in other .ctp files when I make them, but for some reason I cannot do it and also I was thinking of using one javascript file to show in all the other pages as well , can someone give me with example on how to make the header and footer from one default file show up on all the other files. Thank you for your help
tagged with: model-view-controller
score: 0
has comment: http://stackoverflow.com/comment/46059918
tagged with: cakephp
tagged with: ctp
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/28904917
has comment: http://stackoverflow.com/comment/46056949
has comment: http://stackoverflow.com/comment/46057814
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46060168
has title: Default layout cakePHP
has comment: http://stackoverflow.com/comment/46060316

http://stackoverflow.com/comment/74081467
type: AnswerComment
has text: If you are using it in asp.net page you can escape it by using this syntax "<\%=datasetLabel%> : <\%=value%>"
score: 0
comment on: http://stackoverflow.com/a/28805682
type: Comment

http://stackoverflow.com/comment/45961398
has text: whether other elements are added dynamically?
comment on: http://stackoverflow.com/q/28846473
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28808098
type: Answer
has body: Looking at the documentation, the following is stated: jQuery $.ajax options You can also specify any of the jQuery $.ajax options within the same object! This allows you to easily pass additional parameters to your feed script, as well as listen to ajax callbacks. Following this, the documentation for $.ajax() has the following option: headers (default: {}) Type: PlainObject An object of additional header key/value pairs to send along with requests using the XMLHttpRequest transport. The header X-Requested-With: XMLHttpRequest is always added, but its default XMLHttpRequest value can be changed here. Values in the headers setting can also be overwritten from within the beforeSend function. (version added: 1.5) So the below code should work: $('#calendar').fullCalendar({ eventSources: [ { url: '/myfeed.php', headers: { myCustomHeader: 'My Custom Value' } } ] });
has comment: http://stackoverflow.com/comment/122517562
score: 4
upvote count: 4
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28807948
accepted answer of: http://stackoverflow.com/q/28807948

http://stackoverflow.com/a/28816132
upvote count: 0
score: -1
has comment: http://stackoverflow.com/comment/45904106
has comment: http://stackoverflow.com/comment/45904466
has comment: http://stackoverflow.com/comment/45904610
type: Answer
has comment: http://stackoverflow.com/comment/45904431
has body: There are couple of things to check. Lets say this is your script: &lt;?php $htmlString= 'testing'; //Lets say this is a snippet of your php ?&gt; &lt;html&gt; &lt;body&gt; &lt;script type="text/javascript"&gt;&lt;!-- And this is the snippet of your JS --&gt; // notice the quotes around the ?php tag var htmlString="&lt;?php echo $htmlString; ?&gt;"; //Make sure there's double //quotes around your php alert(htmlString); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; Make sure you have PHP and JS in a file called .php. If its an external .js file, php inside it will not work (you can rename the JS file to a .php extension if you have it set up that way) Also make sure you have the html, php and js setup the way above. There has to be double quotes around php, for example: var userIDnum = &lt;?php echo json_encode($userIDnum); ?&gt;; change this to below: var userIDnum = "&lt;?php echo json_encode($userIDnum); ?&gt;";
answers question: http://stackoverflow.com/q/28815545
downvote count: 1
has comment: http://stackoverflow.com/comment/45904721

http://stackoverflow.com/q/28848558
has body: I have a JSON file with app 200 calculated values. I need all of these inserted in the javascript that calls the JSON file. Any easy function to 'empty' all variables without having to code every single one? My javascript var values = []; $.getJSON( "data.php", { cid: 17, bid: 33 }, function(json) { [What to put here?] } ); And later I use the variables as this $(document).ready(function () { var bipolar = new RGraph.Bipolar({ id: 'rb-e3-4', left: [b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13,b14,b15,b16,b17,b18], right: [e19,e20,e21,e22,e23,e24,e25,e26,e27,e28,e29,e30,e31,e32,e33,e34,e35,e36], options: { margin: 8, colors: ['rgb(51,128,182)'], noaxes: true, xmax: 9, xlabels: false, gutter: { center: 0, left: 0, right: 0, top: 0, bottom: 0 } } }).draw(); }) My JSON { "b1": 3, "b2": 4 [+ 200 other variables] Thanks
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45964919
downvote count: 1
has comment: http://stackoverflow.com/comment/45965013
has comment: http://stackoverflow.com/comment/45965626
tagged with: http://stackoverflow.com/tag/json
score: -1
has comment: http://stackoverflow.com/comment/45965182
type: Question
has comment: http://stackoverflow.com/comment/45965206
upvote count: 0
tagged with: javascript
tagged with: variables
answer count: 1
has comment: http://stackoverflow.com/comment/45965609
favorite count: 0
has title: Use all json entries in my javascript
has answer: http://stackoverflow.com/a/28848615

http://stackoverflow.com/a/28891829
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/46044657
has comment: http://stackoverflow.com/comment/46044673
has body: You cannot just put a new line character in the middle of the string in js, you must put a slash in the end of every line: var a = 'foo \ bar \ baz'; alternatively you can concatenate several strings, one line each: var a = 'foo ' + 'bar ' + 'baz'; Both examples are equivalent to: var a = 'foo bar baz'; Addiitonally, rows[i][\'title\'] is not a correct syntax either - you must not put slashes there.
answers question: http://stackoverflow.com/q/28891819
score: 5
upvote count: 5
accepted answer of: http://stackoverflow.com/q/28891819
type: AcceptedAnswer

http://stackoverflow.com/comment/45828350
score: 0
type: AnswerComment
has text: Fair enough, I suppose this isn't JSON. Even in javascript objects, however, it's considered best practice to enclose keys in quotes. See [link](http://stackoverflow.com/questions/2788236/single-quotes-in-javascript-object-literal) as well as [Mathias Bynens' comment on the accepted answer](http://stackoverflow.com/questions/4348478/what-is-the-difference-between-object-keys-with-quotes-and-without-quotes) for reference.
type: Comment
comment on: http://stackoverflow.com/a/28774386

http://stackoverflow.com/a/28777406
has comment: http://stackoverflow.com/comment/45832897
has comment: http://stackoverflow.com/comment/45832893
score: 0
has body: It looks to me like you're closing your php tags on the statements, and so its running both because they are both in plain html. You only see the last one because it happens last. Try this: &lt;?php if(is_page('sp')){$the_page = 1;} else { }; if($the_page === 1) { echo "&lt;script type='text/javascript'&gt;". "jQuery(document).ready(function($) {". "$('#form-interest option:first:contains('---')').html('Área De Interés*:');". "});". "&lt;/script&gt;"; &lt;?php } else { echo "&lt;script type='text/javascript'&gt;" . "jQuery(document).ready(function($) {". "$('#form-interest option:first:contains('---')').html('Area of Interest*:');". "});". "&lt;/script&gt;"; } ?&gt; You seem to be a bit confused on syntax, so hope that makes some sense.
type: Answer
answers question: http://stackoverflow.com/q/28777157

http://stackoverflow.com/comment/46522228
type: Comment
type: AnswerComment
has text: hi @pankajparkar: did u get any solution for the cloning of header?
comment on: http://stackoverflow.com/a/28886971
score: 0

http://stackoverflow.com/q/28823196
tagged with: javascript
has comment: http://stackoverflow.com/comment/45917935
has body: I have a step-by-step tutorial of how to setup our product. I have to display lots of sample code in each step. Following is the list of types of code I have to display in the page. What do I use to format everything? Java Code Samples XML samples iOS SDK Files (*.h and *.m) Javascript code samples My product UI is JavaScript based. We are using knockout bindings and MVVM. Edit: This is for our web based product. We display some code samples on our tutorials page so that the user can copy paste the sample code into their IDEs. Code should be displayed on an HTML page.
has comment: http://stackoverflow.com/comment/45917787
has comment: http://stackoverflow.com/comment/45917766
answer count: 1
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28823247
tagged with: http://stackoverflow.com/tag/html
tagged with: http://stackoverflow.com/tag/xml
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45917818
score: 1
tagged with: java
upvote count: 1
type: Question
has title: Pretty-print Java, XML, JavaScript, ... to HTML
accepted answer: http://stackoverflow.com/a/28823247
tagged with: pretty-print

http://stackoverflow.com/tag/svg
tags question: http://stackoverflow.com/q/28874957
tags question: http://stackoverflow.com/q/28887337
tags question: http://stackoverflow.com/q/28847443
tags question: http://stackoverflow.com/q/28867920
tags question: http://stackoverflow.com/q/28780813
tags question: http://stackoverflow.com/q/28810291
tags question: http://stackoverflow.com/q/28792925
tags question: http://stackoverflow.com/q/28776283
tags question: http://stackoverflow.com/q/28878797
tags question: http://stackoverflow.com/q/28893129
tags question: http://stackoverflow.com/q/28836035
tags question: http://stackoverflow.com/q/28832618
tags question: http://stackoverflow.com/q/28772112
tags question: http://stackoverflow.com/q/28838835
tags question: http://stackoverflow.com/q/28843210
tag name: svg
tags question: http://stackoverflow.com/q/28816566
tags question: http://stackoverflow.com/q/28751167
tags question: http://stackoverflow.com/q/28859177
tags question: http://stackoverflow.com/q/28904169
tags question: http://stackoverflow.com/q/28809897
tags question: http://stackoverflow.com/q/28856544
tags question: http://stackoverflow.com/q/28829420
tags question: http://stackoverflow.com/q/28874635
tags question: http://stackoverflow.com/q/28904585
tags question: http://stackoverflow.com/q/28846301
tags question: http://stackoverflow.com/q/28862587
tags question: http://stackoverflow.com/q/28823152
tags question: http://stackoverflow.com/q/28882468
tags question: http://stackoverflow.com/q/28866587
tags question: http://stackoverflow.com/q/28901517
tags question: http://stackoverflow.com/q/28786562
tags question: http://stackoverflow.com/q/28864386
tags question: http://stackoverflow.com/q/28872986
tags question: http://stackoverflow.com/q/28890714
tags question: http://stackoverflow.com/q/28852665
tags question: http://stackoverflow.com/q/28797761
tags question: http://stackoverflow.com/q/28893630
tags question: http://stackoverflow.com/q/28760079
tags question: http://stackoverflow.com/q/28844718
tags question: http://stackoverflow.com/q/28821168
tags question: http://stackoverflow.com/q/28752929
tags question: http://stackoverflow.com/q/28768789
tags question: http://stackoverflow.com/q/28859545
tags question: http://stackoverflow.com/q/28813696
tags question: http://stackoverflow.com/q/28781023
tags question: http://stackoverflow.com/q/28789176
tags question: http://stackoverflow.com/q/28824152
tags question: http://stackoverflow.com/q/28905993
tags question: http://stackoverflow.com/q/28864595
tags question: http://stackoverflow.com/q/28887609
tags question: http://stackoverflow.com/q/28855513
tags question: http://stackoverflow.com/q/28773113
tags question: http://stackoverflow.com/q/28875925
type: Tag

http://stackoverflow.com/comment/45893879
type: Comment
comment on: http://stackoverflow.com/a/28810630
type: AnswerComment
has text: correction: It works also in IE, but not with the code-snippet(IE returns here not the desired value for `location.href`) [jsfiddle](http://jsfiddle.net/doktormolle/hr9ojrwc/)(works in IE)
score: 0

http://stackoverflow.com/q/28814122
type: Question
tagged with: google-maps
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28829033
has body: I am having an issue with the default marker, it seems to be offset when zoomed out. I've had a good look around on here but can only find answers to custom marker images and setting the anchor point on the image. I'm using google's default marker image. http://thecompleteanimaldirectory.com This is the website in question, you will notice that the maps in the book will be inaccurate once you zoom out, for example the customer in the Isle of White will end up in Germany! However, on this page, the maps are accurate. http://www.thecompleteanimaldirectory.com/search.php?category=dog&amp;area= geocoder = new google.maps.Geocoder(); var mapOptions = { center: { lat: 32.00, lng: 15.00}, zoom: 8 }; function initialize() { var map20 = new google.maps.Map(document.getElementById("map_canvas_barrie"), mapOptions); function codeAddress20() { var address20 = "11 Ashey Park, Ashey Road Ryde, I.O.W, PO33 4AL"; geocoder.geocode( { "address": address20}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { map20.setCenter(results[0].geometry.location); var marker20 = new google.maps.Marker({ map: map20, position: results[0].geometry.location, }); } else { map20.setZoom(0); } }); } codeAddress20(); Code is identical for both pages, I have gone as far as to style the maps the same on both pages but no luck. Any help is appreciated!
tagged with: google-maps-api-3
score: 0
favorite count: 0
upvote count: 1
accepted answer: http://stackoverflow.com/a/28829033
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45900374
has title: Google Maps API - Default marker inaccurate when zoomed out
downvote count: 1

http://stackoverflow.com/comment/46255117
has text: Yes, I realized that, too. I'm now testing that `listenTo` is called with the correct arguments instead.
score: 0
comment on: http://stackoverflow.com/q/28806086
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/63321601
type: AnswerComment
comment on: http://stackoverflow.com/a/37893601
type: Comment
score: 0
has text: This will help you in simultaneously popup close and open on marker click in google map.

http://stackoverflow.com/q/28852056
has answer: http://stackoverflow.com/a/28852304
favorite count: 0
has comment: http://stackoverflow.com/comment/45973687
upvote count: 3
has body: I need to be able to get the user, repo and path from a github url (to a file in the repo) that is pasted into a form, to be able to make api requests on it. e.g. https://github.com/HubSpot/BuckyClient/blob/master/README.md I've started writing some regex to try and just locate the parts of the url, but this seems like a brittle solution given there are many formats of github urls. Is there an api method I've not found, something like getRepoFromUrl(), or another more reliable way I can extract this information from the url provided? I'm using node/javascript. Thanks
type: Question
type: AnsweredQuestion
score: 3
accepted answer: http://stackoverflow.com/a/28852304
has title: Find the user, repo and path from a github url
has comment: http://stackoverflow.com/comment/45973636
tagged with: github-api
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: github
has comment: http://stackoverflow.com/comment/45971167
has comment: http://stackoverflow.com/comment/45972000
has comment: http://stackoverflow.com/comment/45973169

http://stackoverflow.com/comment/46916814
has text: Use OnChange event of the input. In that you will get the latest value/date selected.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28883114

http://stackoverflow.com/q/28879436
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: scope
tagged with: angularjs
has title: How to make angularJS $watch to detect changes in style?
tagged with: watch
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28879830
upvote count: 5
tagged with: javascript
has comment: http://stackoverflow.com/comment/46020570
type: Question
score: 5
has body: I am having a rich text box with all the style controls. When I enter a new text in it - it saves. When I make any changes in the content (text) along with some styles like color highlighting and bold text - it saves the changed text and styles. But, when I just make style changes without any content change - it won't save those style changes. I am using $watch to compare new value and old value. How to make it work even for style changes?
answer count: 1

http://stackoverflow.com/a/28838023
has body: You can do this with regular JS: var myObj = {"house" : red, "car" : green, "apple" : blue}; var newObj = {"apple" : green}; var keyToReplace = Object.keys(newObj)[0] //assuming the new object only has 1 key, else, iterate if (myObj.hasOwnProperty(keyToReplace)) { myObj[keyToReplace] = newObj[keyToReplace] }
answers question: http://stackoverflow.com/q/28837989
downvote count: 0
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/comment/45947448
type: QuestionComment
has text: In the Executin Transcipit , It was showing successfully executed !!
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28838768

http://stackoverflow.com/a/28766675
has body: Yes, it is possible: var service = angular.element(document.documentElement).injector().get('my-service'); In above snippet you should pass application root DOM element into angular.element. For this example, I used document.documentElement which is html element. Also note, that you can't use angular.injector() directly, as you need to use the injector instance used for application boostraping. To retrieve this injector instance object you need to call injector method of the corresponding angular.element instance.
score: 1
accepted answer of: http://stackoverflow.com/q/28766581
answers question: http://stackoverflow.com/q/28766581
upvote count: 1
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/45945493
comment on: http://stackoverflow.com/a/28833343
score: 0
type: AnswerComment
type: Comment
has text: No problem. Yes, absolutely. You can use the [stop event](http://api.jqueryui.com/resizable/#event-stop) to run a function after the resize has completed. Here's a quick example: http://jsfiddle.net/e865rerd/16/

http://stackoverflow.com/q/28826955
type: Question
has answer: http://stackoverflow.com/a/28827868
has title: How can I get javascript to write dates in my input boxes?
has body: I made this fiddle http://jsfiddle.net/cyrtx7qw/1/ and I cant figure out how to make these two dates write on page load. I need them to check if the boxes are empty and then I want to write the today's date and today-7 respectively. if ($('#datePickersAppearance').is(':empty')) { var today = new Date(); var curr_date = today.getDate(); var curr_month = today.getMonth(); curr_month++; var curr_year = today.getFullYear(); document.getElementById("to").innerHTML = curr_date + "." + curr_month + "." + curr_year; today.setDate(today.getDate() - 7); var new_date = today.getDate(); var new_month = today.getMonth(); new_month++; var new_year = today.getFullYear(); document.getElementById("from").innerHTML = new_date + "." + new_month + "." + new_year; } Also, is there a way keep another date after page reload in case I change the default ones? I need the if statement to not trigger then...
tagged with: javascript
answer count: 3
tagged with: jquery
has answer: http://stackoverflow.com/a/28826988
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28827144
linked to: http://stackoverflow.com/q/16212347
score: 0
has answer: http://stackoverflow.com/a/28827144
accepted answer: http://stackoverflow.com/a/28826988

http://stackoverflow.com/comment/45999516
comment on: http://stackoverflow.com/q/28866587
type: Comment
type: QuestionComment
has text: I added my js file content now. I am trying to create a fiddle to make it easier for you, but my data is in a tsv file. I am not sure on how to put this data into the fiddle and make it work correctly. I added the contents of my data file aswell.
score: 0

http://stackoverflow.com/q/28763116
has body: I'm trying to rewrite some script. This script takes some data from data attributes and rebuild block with them. All was alright, but I need to do it via AJAX. Here my modified script: (function($){ jQuery.fn.someItem = function() { var make = function() { var _$this = $(this); var $thumb = _$this.find('.thumb'); function init() { $thumb.on('click', function() { if (!$(this).hasClass('active')) setNewActiveItem($(this)); return false; }); } function setNewActiveItem($newItem) { $.ajax({ url: '/ajax-item?id=' + $newItem.data('id'), type: 'GET', success: function(response) { _$this.replaceWith(response); **init();** } }); } init(); }; return this.each(make); }; })(jQuery); All working fine, but after Ajax call and block replaced, I can't apply ajax-call in modified block again. I guess that I need to reinit "init()" function after "replaceWith()", but how to do it? Thank you for help.
answer count: 1
score: 0
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45810352
tagged with: ajax
has answer: http://stackoverflow.com/a/28763240
type: Question
has title: reinit function after ajax

http://stackoverflow.com/comment/45967673
type: Comment
has text: Set the model value representing that field to true.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28849441

http://stackoverflow.com/a/28843655
upvote count: 2
has comment: http://stackoverflow.com/comment/45956755
type: Answer
answers question: http://stackoverflow.com/q/28843595
score: 2
has body: Each time $(".btn") is clicked you are creating another listener on the $(".back_btn") selector. You can use .one which will remove the listener after the back button has been clicked once. $(".back_btn").one("click", function()... $(document).ready(function() { $(".option1, .option2, .option3, .option4").hide(); $(".btn").on("click", function() { $('.menu').hide(); var idName = $(this).attr('id'); switch (idName) { case "option1": $('.option1').show(); $(".back_btn1").one("click", function() { if (confirm("Are you sure you want to go back to the menu?")) { $('.option1').hide(); $('.menu').show(); } else { //Do nothing } }); break; case "option2": $('.option2').show(); $(".back_btn2").one("click", function() { if (confirm("Are you sure you want to go back to the menu?")) { $('.option2').hide(); $('.menu').show(); } else { //Do nothing } }); break; case "option3": $('.option3').show(); $(".back_btn3").one("click", function() { if (confirm("Are you sure you want to go back to the menu?")) { $('.option3').hide(); $('.menu').show(); } else { //Do nothing } }); break; case "option4": $('.option4').show(); $(".back_btn4").one("click", function() { if (confirm("Are you sure you want to go back to the menu?")) { $('.option4').hide(); $('.menu').show(); } else { //Do nothing } }); break; }; }); }); Option 1 Option 2 Option 3 Option 4 Content 1 back Content 2 back Content 3 back Content 4 back
downvote count: 0
has comment: http://stackoverflow.com/comment/45956440
has comment: http://stackoverflow.com/comment/45956568

http://stackoverflow.com/q/28832428
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28854174
possible better answer: http://stackoverflow.com/a/28834974
type: Question
has answer: http://stackoverflow.com/a/28834974
has answer: http://stackoverflow.com/a/28853968
accepted answer: http://stackoverflow.com/a/28854174
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/31364599
tagged with: meteor
has title: MeteorJS : Template rendered & Meteor method call
tagged with: iron-router
tagged with: d3.js
linked to: http://stackoverflow.com/q/28812306
has body: This question follows my previous one : Meteor: How to publish custom JSON data I created a Meteor method building a complex JSON (built with different collections etc.). With those datas I need to build a chart using D3.js. I used to set the data in the Session but as I realized they need to be refreshed each time I am reaching the page, it does not work properly. Obviously there is something I did not understand in the mechanics, but here is my code : Template.myPage.rendered = function(){ var data = Meteor.call('myData'); var svgContainer = d3.select("#svg"); var margin = 40; var width = parseInt(d3.select("#svg").style('width'),10); var height = parseInt(d3.select("#svg").style('height'),10); // ... some more D3 code where I need the data The error I'm getting is : "Exception from Tracker afterFlush function: data is undefined I have already tried to call the Meteor Method outside the Template and put the result in the Session (in the callback function), but it did not work. I've also tried to use reactive var, but I couldn't make it. Thanks a lot.

http://stackoverflow.com/comment/46073942
score: 0
has text: Hehe, true. I guess I wasn't thinking. It would just be interesting to somehow see whether the person was active with a 48 min call or just a call lasting 2 min.. Perhaps another option would be to do 1-hour intervals and then color-code that interval depending on the activity?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28906126

http://stackoverflow.com/comment/46061937
type: AnswerComment
comment on: http://stackoverflow.com/a/28894600
type: Comment
has text: Sorry to bother you again. The clickevent was a bit harder. What is missing to make it work? now it shows the div as default. Thanks again! http://jsfiddle.net/Jerryskate/doxdmxmL/1/ @zeropublix
score: 0

http://stackoverflow.com/comment/45960572
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28845855
type: QuestionComment
has text: This one is the actual directory C:\Users\MicahAaron.CMPHIL\Desktop\Aaron\Bootstrap-Image-Gallery-3.1.1\img Then from there, I want to get all the images from the folder to insert it into to the array. I've tried to use AJAX using the directory as the url. But it doesn't work

http://stackoverflow.com/comment/45993853
has text: I'm pretty sure the intrinsic value is not the value that includes the automation stuff. It's the value that you set using the .value setter (or the default value for the attribute).
comment on: http://stackoverflow.com/a/28860287
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45842572
score: 0
type: AnswerComment
type: Comment
has text: Show the tree structure. Can get it from browser instead of copying from php code
comment on: http://stackoverflow.com/a/28782764

http://stackoverflow.com/a/28857251
score: 2
has comment: http://stackoverflow.com/comment/45985401
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28857086
downvote count: 0
has body: DEMO HTML: before Controller: angular.module('myApp', []); angular.module('myApp').controller('myCtrl', function($scope) { $scope.sometext="stuff here"; }); Directive: angular.module('myApp').directive('myDirective', function() { return { priority: 10, // adjust this value ;) link: function(scope,element,attrs) { scope.$watch(attrs.ngBind, function(newvalue) { console.log("element ",element.text()); }); } }; }); Use priority property inside directive to run your code after mg-bind
accepted answer of: http://stackoverflow.com/q/28857086
upvote count: 2
has comment: http://stackoverflow.com/comment/45987324
type: Answer

http://stackoverflow.com/a/28818247
accepted answer of: http://stackoverflow.com/q/28814524
has comment: http://stackoverflow.com/comment/108191979
has comment: http://stackoverflow.com/comment/45915531
has comment: http://stackoverflow.com/comment/45929509
has comment: http://stackoverflow.com/comment/45932444
has comment: http://stackoverflow.com/comment/45938600
answers question: http://stackoverflow.com/q/28814524
has comment: http://stackoverflow.com/comment/45936861
type: AcceptedAnswer
downvote count: 0
has body: So as I mentioned in the comments, hopefully this answer gives more context of what I mean. So when you do your declaration of html5Mode, also include the hashPrefix: $locationProvider .html5Mode(true) .hashPrefix('!'); Then, in your &lt;head&gt;, include this tag: &lt;meta name="fragment" content="!"&gt; What happens here is that you are providing a fallback measure for the History API, meaning for all users visiting with compliant browsers (basically everything nowadays) they will see this: http://example.com/home/ And only on dinosaur browsers like IE9 would they see this: http://example.com/#!/home/ Now, that is in real life with actual people as visitors. You asked specifically about being indexed by Google, which uses bots. They will try to go to example.com/home/ as an actual destination on your server (meaning /home/index.html), which obviously doesn't exist. By providing the &lt;meta&gt; tag above, you have provided the hint to the bot to instead go to an ?_escaped_fragment version of the site (like index.html?_escaped_fragment=home) and associated it with that URL of /home/ in the actual Google searches. It is entirely on the backend, all visitors to your site will still see the clean URL, and is only necessary because under the hood Angular uses location.hash, which is not seen on server-side. Bottom line, your actual users will be unaffected and not have the ugly URL, unless they're on a browser that does not support the History API. For those users, all you've done is make the site start working for them (as before it would have been broken). Hope this helps! UPDATE Since you are using a MEAN stack, you can also go a different direction which has been around a long time, which is to use HTML snapshots. There are npms that will provide snapshots (meaning static HTML from post-render) that can be served up from your server at the locations shown. That technique is a little outdated, but its been around since like 2012 and is proven to work. Back when I di…
has comment: http://stackoverflow.com/comment/45932225
type: Answer
has comment: http://stackoverflow.com/comment/45936608
score: 2
has comment: http://stackoverflow.com/comment/45937456
upvote count: 2

http://stackoverflow.com/comment/45863971
has text: No, it only has an onmousedown state, when I select a button the appearance doesn't change.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28794601
type: Comment

http://stackoverflow.com/comment/45958416
comment on: http://stackoverflow.com/a/28838184
score: 0
type: AnswerComment
has text: Your regex doesn't catch the value after the colon.
type: Comment

http://stackoverflow.com/a/28851781
has comment: http://stackoverflow.com/comment/45970588
answers question: http://stackoverflow.com/q/28851674
has body: Why don't you do an alert with the element's id on clicking? $(document).on('click', '.block_docmanage', function (event){ cl1ele = $(this).closest('.panel.panel-default.level1').find('.panel-headinglevel1 &gt; h4 &gt; .docmgCategoryBlock').attr("id"); alert(cl1ele) }):
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/45970907
has comment: http://stackoverflow.com/comment/45970826
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45971457

http://stackoverflow.com/comment/50686381
comment on: http://stackoverflow.com/a/31095766
score: 0
has text: I updated the OP with the lines from `package.json` that I use to create the bundle and also to run the tests. Also added the karma config file. Appreciate any help you can provide.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45865705
score: 2
type: AnswerComment
has text: actualy, i have tried it but with no success...always set me todays date. I have tried it with diferent formats strings and moments
type: Comment
comment on: http://stackoverflow.com/a/28795186

http://stackoverflow.com/a/28837592
upvote count: 1
has comment: http://stackoverflow.com/comment/45945343
score: 1
has comment: http://stackoverflow.com/comment/45944684
answers question: http://stackoverflow.com/q/28837427
has body: You could use Array's filter method: ... var filter = data.results.filter(function (el) { return el[searchField].indexOf(searchVal) &gt;= 0; }); if (filter.length) ourResults = filter;
downvote count: 0
has comment: http://stackoverflow.com/comment/45944756
has comment: http://stackoverflow.com/comment/45949775
type: Answer

http://stackoverflow.com/comment/45962466
type: QuestionComment
has text: This is definitely not all of your code because, based on what you've shown, you're not sending any data to Google Analytics. Where is your event tracking code?
comment on: http://stackoverflow.com/q/28846842
score: 0
type: Comment

acrobat
type: Tag
tag name: acrobat
tags question: http://stackoverflow.com/q/28781828
tags question: http://stackoverflow.com/q/28756448

http://stackoverflow.com/comment/46043719
has text: Please provide a [Minimal, Complete, Tested and Readable example](http://stackoverflow.com/help/mcve) that demonstrates the issue, including the values required for `{{ lilguy.current_lat }}`,`{{ lilguy.current_lon}}` and ``
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28890440
score: 1

http://stackoverflow.com/a/28771475
type: Answer
has body: I am afraid you can't do this in a right way. See this link : How to add onload event to a div element? May be somebody should post the ticket to github.
score: 0
answers question: http://stackoverflow.com/q/28771346

http://stackoverflow.com/comment/45818323
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28769867
has text: Once a script has been executed and loaded into memory, removing the script tag does nothing ?
score: 0

http://stackoverflow.com/q/28836668
has comment: http://stackoverflow.com/comment/45947559
has answer: http://stackoverflow.com/a/28836806
has title: Trouble with jquery .append
has answer: http://stackoverflow.com/a/28836791
has answer: http://stackoverflow.com/a/28837027
has comment: http://stackoverflow.com/comment/45943040
answer count: 4
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28836831
possible better answer: http://stackoverflow.com/a/28836791
type: Question
tagged with: javascript
has body: I have this HTML: Academics This is my JavaScript: function processTitle(formID) { $('.form-group').removeClass('has-error'); var formData = { 'SectionTitle' : $('input[name=SectionTitle]').val(), 'SectionID' : $('input[name=SectionID]').val() }; var id = formData['SectionID']; var eg = formID; // process the form $.ajax({ type : 'POST', url : 'editTitle.php', data : formData, dataType : 'json', encode : true }).done(function(data) { // using the done promise callback // log data to the console console.log(data); // handle errors and validation messages if (data.success === false) { $('SectionTitle'+id+'-group').addClass('has-error'); // use CSS to make red input $(eg).append(' ' + data.errors.SectionTitle + ' ' ); $('SectionID'+id+'-group').addClass('has-error'); $(eg).append(' ' + data.errors.SectionID + ' ' ); } else { $(eg).append(' Success! '); document.getElementById('SectionTitle'+id).innerHTML = formData['SectionTitle']; hideAllForms(); } }); event.preventDefault(); return false; } When I click "save", the title changes, the PHP runs exactly right, there are no errors in the console, but no extra div at the end of my form. Any clues? Thank you.
tagged with: jquery
has answer: http://stackoverflow.com/a/28836831
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/45942974

http://stackoverflow.com/q/28793906
has answer: http://stackoverflow.com/a/28793925
upvote count: 1
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28793941
has answer: http://stackoverflow.com/a/28794005
tagged with: dom
has body: I have problem with javascript, in my html code: &lt;input onclick="myFunction();" /&gt; &lt;script&gt; function myFunction(){ //excecution of this fucntion } &lt;/script&gt; After clicking the input, the function runs. But I want myFunction to be disable after the first click, so when I click again, myFunction won't run.
type: Question
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28793941
has title: Disable Function in Javascript event DOM
has answer: http://stackoverflow.com/a/28794161
downvote count: 0
has comment: http://stackoverflow.com/comment/45862383
answer count: 4
favorite count: 0
possible better answer: http://stackoverflow.com/a/28793925

http://stackoverflow.com/a/28812255
type: Answer
has body: $(document).keydown(function(e) { switch(e.which) { case 37: // left var nextPerson = $('#wrapper_h1 div.body').get(personPosition + 1); personPosition += 1; scrollToEl(nextPerson); break; case 39: // right var previousPerson = $('#wrapper_h1 div.body').get(personPosition - 1); personPosition -= 1; scrollToEl(previousPerson); break; default: return; // exit this handler for other keys } e.preventDefault(); // prevent the default action (scroll / move caret) }); Code inspired by this answer
score: 0
answers question: http://stackoverflow.com/q/28812089

http://stackoverflow.com/q/28828296
has comment: http://stackoverflow.com/comment/45926858
has body: I have a ListView that contains details of customers. There are thousands of customer records in this ListView. Whenever I select/click on a customer name, it shows the selected customer's history and all data in right side panel. Everything is in UpdatePanels, and the page does not refresh on any operation. But, when I click on a customer name, it scrolls to the top of the page. So, how do I maintain the scroll position for a page after an UpdatePanel posts back from ListView?
tagged with: listview
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45927384
score: 0
has comment: http://stackoverflow.com/comment/45927451
has title: Maintaining page scroll position after postback in listview
tagged with: updatepanel
tagged with: asp.net
answer count: 0
tagged with: postback
type: UnansweredQuestion

http://stackoverflow.com/a/28822513
downvote count: 2
answers question: http://stackoverflow.com/q/28822479
type: Answer
upvote count: 0
has body: You are redirecting twice. Change it to: Link Link #1
score: -2

http://stackoverflow.com/comment/45856159
type: Comment
comment on: http://stackoverflow.com/q/28790451
type: QuestionComment
has text: It works perfectly fine... print the `config` object to see if you are accessing the right port
score: 0

http://stackoverflow.com/comment/45843968
type: Comment
comment on: http://stackoverflow.com/a/28782601
type: AnswerComment
has text: Actually, on my phone it works fine... Smth with cache perhaps?
score: 0

http://stackoverflow.com/q/28762689
answer count: 1
has comment: http://stackoverflow.com/comment/45805009
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28762963
has title: AngularJS, referencing other DOM items from a Directive
type: Question
tagged with: javascript
has body: I have a navigation bar that uses a ng-repeat from data provided by a REST service. When we click on some of the menu items, we navigate to a new view, when we click other items we perform other tasks like show/hide menu, show information popovers, etc. I want to show and hide the popover that is below my menu (see HTML below), now I could use a simple ng-show but I want to use a directive so I can reuse the functionality, and dynamically determine a position for the popover. However I don't know how to reference the popover in my directive. I am not using jQuery so I can't use a $(#id) selector and Here is my HTML: {{ nav.name }} 0"> {{ nav.value }} Content Holder Here is my directive, you can see I set a timeout so the ng-repeat is finished, I then assign a click event to the children of the directive DIV, determine the data-url value of the clicked it and if there is a match to my requirements I return some positioning properties from the clicked item and then use these in an algorithm (a simple sum) to change the left/top css of the popOver then show the popover - does anyone know how I can reference the popover in my directive or is my approach wrong? .directive('toggleNavPopup', function ($timeout) { 'use strict'; return{ restrict: 'A', priority: 800, link: function (scope, element) { $timeout(function () { var list = angular.element(element); list.children().on('click', function (evt) { // determine if we have clicked the 'div' with data-url === 'message' if(evt.target.getAttribute('data-url') === '/message') { console.log('I would like th use the following to positon the PopOver', evt.target.offsetLeft, evt.target.clientWidth); // position the popOver using value, how do I reference it, no jQuery! } }); }); } }; });
score: 0

http://stackoverflow.com/comment/45966477
type: QuestionComment
comment on: http://stackoverflow.com/q/28849472
has text: What environment/editor?
score: 0
type: Comment

http://stackoverflow.com/comment/45882557
type: QuestionComment
comment on: http://stackoverflow.com/q/28804564
type: Comment
has text: I think what you are trying to do is accessing cross domain cookie.Which is not possible due to security reason. How ever I will look forward to see the answer of this.
score: 0

http://stackoverflow.com/comment/45913623
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28801638
type: Comment
has text: The trigonometric convention is that the angle 0 is aligned to the positive X axis (to the right). You probably assume that the negative Y axis (upwards) is the direction your rectangle is facing. Probably the easiest fix is to draw the rectangle so that it's facing to the right and then initialize it with `this.angle = -90`. Are you sure it is moving in a _random_ direction when you press `a` or `d`? That seems very unlikely. Maybe you left in some of your original updating code which changes `this.x` and `this.y` based on keyboard input.

http://stackoverflow.com/a/28902785
has body: Check out How to tell if a DOM element is visible in the current viewport? for a working isInViewport() function. You can then check if the flexslider element is in viewport, and when it is, just flexslider.start(), I think. Be sure to set slideshow to false so it will be stopped on page load.
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28885197
downvote count: 0
score: 1

http://stackoverflow.com/a/29011911
answers question: http://stackoverflow.com/q/28764901
type: Answer
score: 0
has body: You basically answer the question yourself, you can always mess with any logic in the client use the console to call methods etc. So if there is any critical you should place it on the server side. My recommendation would be to publish (a subset) of the permissions to the client and filter the menu. If you mess with the UI you might be able to get the screen but not the data.

http://stackoverflow.com/comment/46054359
comment on: http://stackoverflow.com/q/28897201
score: 0
has text: @TIMINeutron no, I want the dropdown menu to open regularly and the content of the first item to be shown in the same page. Like in this example [link](http://www.christopherandersonphoto.com/)
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45936561
has text: This sounds like a good solution. Together with iOS check it should provide reliable results.
type: Comment
comment on: http://stackoverflow.com/a/28803653
score: 0
type: AnswerComment

http://stackoverflow.com/a/28866533
has comment: http://stackoverflow.com/comment/45998258
has body: sort expects a callback function which takes two parameters, and also expects a return value based on a comparison between those two parameters. .sort(function(a,b){ return a-b; }); You are sending sort an object from deserialized json, which is not a function that takes two parameters and returns a value based on comparison, so the sort does not work. By default, sort will use a lexicographical comparison. This would be the default call console.log(key_list.sort());
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28866475

http://stackoverflow.com/q/28785060
tagged with: spotify-app
has body: I need to support ECMA script 6 promises in my web application on the client side. I'm using the Spotify Web API, which looks something like this // track detail information for album tracks spotifyApi.getAlbum('5U4W9E5WsYb2jUQWePT8Xm') .then(function(data) { return data.tracks.map(function(t) { return t.id; }); }) .then(function(trackIds) { return spotifyApi.getTracks(trackIds); }) .then(function(tracksInfo) { console.log(tracksInfo); }) .catch(function(error) { console.error(error); }); I know that I can convert these to callbacks for backwards compatibility but that would be so much work and the code wouldn't look as clean.
has title: How do I add support for ECMA Script 6 promises on the client side?
downvote count: 0
tagged with: es6-promise
answer count: 0
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45846466
has comment: http://stackoverflow.com/comment/45846536
score: 1
has comment: http://stackoverflow.com/comment/45846452
favorite count: 0
type: Question
upvote count: 1

http://stackoverflow.com/a/28752008
score: 0
type: Answer
has body: The syntax would need to change to &lt;!-- /* * * The comment * */ //--&gt; &lt; !-- is a valid js comment, but --> is not
has comment: http://stackoverflow.com/comment/45786203
answers question: http://stackoverflow.com/q/28751948

http://stackoverflow.com/comment/45948277
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28839091
has text: Angular has $scope and namespacing for templating which you should probably read (https://docs.angularjs.org/api/) cause that's the hole point of angularjs - otherwise I would suggest using jQuery personally. `event.target.value` is the most direct way to get the value for you without frameworks.
score: 0

http://stackoverflow.com/a/28832469
has body: You can add some javascript that will hide the button when you click on it. Leaving the rest of your UI the same, you could use: column(3, wellPanel( a&lt;-actionButton("action", label="Action"), tags$script(HTML('document.getElementById("action").onclick = function(){$(this).hide() }')), br(), br() )) The jQuery function hide will be called on the button once it is clicked on.
type: AcceptedAnswer
downvote count: 0
score: 1
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28828483
answers question: http://stackoverflow.com/q/28828483

http://stackoverflow.com/a/28887066
type: AcceptedAnswer
downvote count: 0
score: 4
has comment: http://stackoverflow.com/comment/46035743
type: Answer
has comment: http://stackoverflow.com/comment/46035712
has comment: http://stackoverflow.com/comment/46035576
has comment: http://stackoverflow.com/comment/46035687
has body: First select the element whose parent you want to remove using the Attribute Equals Selector, then call remove() on the parent(). $('[data-card-uid="THIS ONE"]').parent().remove();
has comment: http://stackoverflow.com/comment/46035681
accepted answer of: http://stackoverflow.com/q/28886998
upvote count: 4
answers question: http://stackoverflow.com/q/28886998

http://stackoverflow.com/q/28862093
score: 1
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/46001494
tagged with: python
tagged with: selenium-webdriver
tagged with: selenium
has answer: http://stackoverflow.com/a/28864507
upvote count: 1
has comment: http://stackoverflow.com/comment/45993942
answer count: 1
has body: I've come across a scenario that seems to only fail on Firefox under certain conditions. In my code... driver.get(url('/Points/Inputs/')) assertRowTrue(driver, 2, 11, "True") I'm receiving the error... E WebDriverException: Message: u'[JavaScript Error: "e is null" {file: "file:///tmp/anonymous7279155570809486473webdriver-profile/extensions/fxdriver@ googlecode.com/components/command-processor.js" line: 7854}]\'[JavaScript Error: "e is null" {file: "file:///tmp/anonymous7279155570809486473webdriver-profile/e xtensions/fxdriver@googlecode.com/components/command-processor.js" line: 7854}]\ ' when calling method: [nsICommandProcessor::execute]\nBuild info: version: \'2. 43.0\', revision: \'597b76b\', time: \'2014-09-09 20:52:14\'\nSystem info: host: \'8efca6f08729\', ip: \'172.17.0.3\', os.name: \'Linux\', os.arch: \'amd64\', o s.version: \'3.13.0-24-generic\', java.version: \'1.7.0_65\'\nDriver info: drive r.version: unknown' ; Screenshot: available via screen Looking around, this issue was mention and explained in a previous question here. The problem with my particular scenario is that it's NOT the result of an Alert, so when I attempt close the alert... driver.switch_to_alert().dismiss() ...I receive a NoAlertPresentException. Is there a way to get around this error when an Alert is not the culprit until Selenium gets around to fixing this issue? UPDATE (June 6, 2015) Trying the answer listed below worked for a while, but went back to the original error I was seeing. Here's an example of a test I have that's failing. Hey @alecxc. Here's an example that fails. I visit a specific web page to verify that a row [in a table] contains the information that I expected it to. For this, I used my own definition assertRowTrue() assertRowTrue(driver, 2, 11, "Online") The this def, I've created the code. def assertRowTrue(driver, row, column, value): try: WebDriverWait(driver, 30).until( expected_conditions.text_to_be_present_in_element((By.XPATH, "//tr["+str(row)+"]/td["+str(c…
linked to: http://stackoverflow.com/q/25212405
tagged with: javascript
has title: For Python, getting WebDriverException: Message: u'[JavaScript Error: "e is null"
accepted answer: http://stackoverflow.com/a/28864507
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45989833
tagged with: firefox
downvote count: 0

http://stackoverflow.com/q/28775956
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45830587
tagged with: node.js
has comment: http://stackoverflow.com/comment/45830040
has comment: http://stackoverflow.com/comment/45830773
has title: AngularJs and ExpressJs. How are they talking with each other?
answer count: 0
type: Question
has body: I'm currently trying to figure out how to associate back end nodejs with front end angularjs. In my angular controller: $http.get('/api/getPlayer/' + id) .success(function(data) { console.log(data); }) .error(function(data) { console.log('error: '+data); }); Say I want to create an api that gets information on a player called getPlayer with their id. In my routes.js: module.exports = function(app) { app.get('/api/getPlayer/:id', function(req, res) { console.log('hi'); var test = { a: test }; res.json(test) }); } My understanding is that the http.get in angular will call app.get. Am I getting the wrong idea? I'm still fairly new to routing and web applications in general.
tagged with: javascript
tagged with: express
score: 0

http://stackoverflow.com/q/28795476
tagged with: ios
tagged with: javascript
tagged with: mobile-safari
has comment: http://stackoverflow.com/comment/45865756
possible better answer: http://stackoverflow.com/a/30495399
downvote count: 0
has answer: http://stackoverflow.com/a/30495399
linked to: http://stackoverflow.com/q/37591279
tagged with: wkwebview
has comment: http://stackoverflow.com/comment/69421095
linked to: http://stackoverflow.com/q/13455472
has comment: http://stackoverflow.com/comment/45865492
tagged with: uiwebview
favorite count: 0
has answer: http://stackoverflow.com/a/28803653
answer count: 5
has answer: http://stackoverflow.com/a/46476148
score: 25
has title: Detect if page is loaded inside WKWebView in JavaScript
upvote count: 25
has body: How can I reliably detect using javascript that a page is loaded inside a WKWebView? I'd like to be able to detect these scenarios: iOS &amp; WKWebView iOS &amp; Safari not iOS There is a similar question about UIWebView here. But it's quite old and I'm not sure if same still applies to WKWebView.
has comment: http://stackoverflow.com/comment/45865758
linked to: http://stackoverflow.com/q/32771215
has answer: http://stackoverflow.com/a/42222851
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28803653
linked to: http://stackoverflow.com/q/4460205
has answer: http://stackoverflow.com/a/39670671

http://stackoverflow.com/q/28904710
has title: Jquery UI tabs: can't get the correct tab order
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46069241
has comment: http://stackoverflow.com/comment/46070800
has body: I've been trying to get the order of JqueryUI tabs with the following code in the addTab function of the example given here:jqueryUI tab demo function addTab() { var label = tabTitle.val() || "Tab " + tabCounter, id = "tabs-" + tabCounter, li = $( tabTemplate.replace( /#\{href\}/g, "#" + id ).replace( /#\{label\}/g, label ) ), tabContentHtml = tabContent.val() || "Tab " + tabCounter + " content."; tabs.find( ".ui-tabs-nav" ).append( li ); tabs.append( "&lt;div id='" + id + "'&gt;&lt;p&gt;" + tabContentHtml + "&lt;/p&gt;&lt;/div&gt;" ); tabs.tabs( "refresh" ); //code for finding the tab order var tab_order = []; $("#tabs &gt; ul &gt; li &gt; a").each(function(i){ tab_order[i]= this.id.substr(6); }); alert(tab_order); tabCounter++; } the first time a new tab is added, the the order of tabs alerted is 1,3 and not 1,2 which should be the case. here's the fiddle:JS FIDDLE
favorite count: 0
answer count: 0
has comment: http://stackoverflow.com/comment/46069350
upvote count: 2
type: UnansweredQuestion
downvote count: 1
tagged with: jquery-ui
score: 1
type: Question

http://stackoverflow.com/a/28823651
has body: It is always good to separate the process of validating form data and the submitting. In your code, you do them together. The default behavior of submit button is to upload all your form data and clean all the input data, so it behaves correctly as it is meant to be. What you need to do to make it work is to add event onto those fields. You can use jQuery .blur() to do that. .blur() method will be triggered when the field lost focus. So here is where you should trigger your validation process. I hope it helps. Cheers, Update: Add events to the fields which you need to validate. For example, you need to do some validation on the sln textbox. $('input[name="sln"]').on("blur", function(){ .....Your validation here........... }); By the way, where are the IDs for those input components???(they only have names....)
type: Answer
has comment: http://stackoverflow.com/comment/46002783
score: 0
answers question: http://stackoverflow.com/q/28823440

http://stackoverflow.com/comment/45862877
score: 0
type: AnswerComment
type: Comment
has text: `document.write` is a cancer upon JavaScript. By placing it in an example, you're promoting it as a legitimate tool.
comment on: http://stackoverflow.com/a/28794139

http://stackoverflow.com/comment/45995359
comment on: http://stackoverflow.com/q/28864079
has text: @JPlato Let me add the log for Activity.last to help make sense of what I'm working with. And, thanks.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28780967
type: Question
score: 1
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has body: i have a problem with my jQuery script on select tags on my page. I have a select that shows different content according to the selected option. You can run the snippet to understand it... $('#gpm2, #gpm3, #gpm4, #gpm5, #gpm6').hide(); $('#gpm').change(function() { $('#gpm1, #gpm2, #gpm3, #gpm4, #gpm5, #gpm6').hide(); $('#gpm' + $(this).find('option:selected').attr('value')).show(); }); $('#exo_muscle_2, #exo_muscle_3, #exo_muscle_4, #exo_muscle_5, #exo_muscle_6, #exo_muscle_7, #exo_muscle_8, #exo_muscle_9, #exo_muscle_10, #exo_muscle_11, #exo_muscle_12, #exo_muscle_13').hide(); $(function() { $('#gpm1, #gpm2, #gpm3, #gpm4, #gpm5, #gpm6').change(function() { $('#exo_muscle_1, #exo_muscle_2, #exo_muscle_3, #exo_muscle_4, #exo_muscle_5, #exo_muscle_6, #exo_muscle_7, #exo_muscle_8, #exo_muscle_9, #exo_muscle_10, #exo_muscle_11, #exo_muscle_12, #exo_muscle_13').hide(); $('#exo_muscle_' + $(this).find('option:selected').attr('value')).show(); console.log($(this).find('option:selected').attr('value')); }); }); Select an exercise... Epaules Pectoraux Dorsaux Bras Jambes Abdominaux Deltoides Trapezes Pectoraux Dorsaux Avant bras Biceps Triceps Quadriceps Mollets Ischios-jambiers Adducteurs Fessiers Abdominaux Développé assis Développé avant Elévation latérale inclinée Elévation latérale large Elévation latérale à la poulie Développé avant assis Relevé d'épaule Tirage vertical Développé nuque Développé droit en pronation Tirage barre en pronation Tirage avec haltères Développé nuque Relevé d'épaules Haussement d'épaules droit Haussement d'épaules en rotation Développé couché classique Développé couché avec haltères Développé couché prise large Développé couché avec haltères prise marteau Développé couché prise serrée Développé couché décliné à la barre Développé couché aux haltères Développé couché aux haltères prise marteau Développé couché incliné classique Développé couché incliné aux haltères prise marteau Développé couché incliné avec haltères Développé couché incliné p…
has answer: http://stackoverflow.com/a/28781034
favorite count: 0
tagged with: onchange
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
tagged with: select
accepted answer: http://stackoverflow.com/a/28781034
has title: jQuery .change() doesn't react on select with 1 option
upvote count: 1

http://stackoverflow.com/q/28759574
possible better answer: http://stackoverflow.com/a/30697638
has title: get back to the first step in multistep minimal form after settimeout
tagged with: javascript
has answer: http://stackoverflow.com/a/30697638
tagged with: jquery
has body: I'm using copdrops stepsForm.js and I modified it in some way. Everything is fine, but as I'm not familiar that much with javascript I couldn't make it back to the first step (first question) after the form has been submitted. this is the codrops script: https://github.com/codrops/MinimalForm and this is the modification I made to reset the form and get back to the first question(step) after being submitted. http://codepen.io/anon/pen/GgdQgg and this is the modified javascript I used and also has been added to the end of codepen's javascript: var theForm = document.getElementById( 'theForm' ); new stepsForm( theForm, { onSubmit : function( form ) { // hide form classie.addClass( theForm.querySelector( '.simform-inner' ), 'hide' ); var messageEl = theForm.querySelector( '.final-message' ); messageEl.innerHTML = 'Thank you! We\'ll be in touch.'; classie.addClass( messageEl, 'show' ); setTimeout(function(){ form.reset() }, 2500); setTimeout(function(){ classie.removeClass( messageEl, 'show' ) }, 3000); setTimeout(function(){ classie.removeClass( theForm.querySelector( '.simform-inner' ), 'hide' ) }, 3500); } } );
upvote count: 2
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28760756
accepted answer: http://stackoverflow.com/a/28760756
favorite count: 0
tagged with: css
type: AnsweredQuestion
score: 2
tagged with: settimeout
downvote count: 0
type: Question

http://stackoverflow.com/comment/45826516
has text: Great, I've simplified the code and updated my answer.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28769142

http://stackoverflow.com/a/28824860
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45921092
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/28824764
score: 2
accepted answer of: http://stackoverflow.com/q/28824764
has body: !(x AND y) is equal to !x OR !y (and you can pull a NOT out of a boolean x by double negation, for example: x == !!x so x AND !y (your original expression) is equivalent to !(!x OR y) if you remove the negation (!) from the beginning, then you actually get the Negated form and that is why the second and third values of the ternary operator are reversed in your second example.
has comment: http://stackoverflow.com/comment/45963133

http://stackoverflow.com/a/28896380
score: 0
answers question: http://stackoverflow.com/q/28895237
type: Answer
upvote count: 1
downvote count: 1
has body: I'm not 100% sure if I fully understand your question but I'll give it a go. You wouldn't "get express to use this file and then pass it to jade" as you put it, you would just render a jade file with some data on a request to the server. That request could use your module if you wanted it to, but phrasing it this way helps with the concepts behind it. For info on how to use templating engines with express read this: http://expressjs.com/guide/using-template-engines.html And your endpoint will look something like this: var yourModule = require('./modules/yourModuleFile'); //note you don't need .js app.get('/', function (req, res) { yourModule.apiGet().then(function(result){ res.render('yourTemplate', result); }) }) After writing that example I think you might have a slightly different idea of how to actually use promises. You don't "do the work" inside your module you "return the promise that resolves with the result". If you need more explanation on this last point just let me know and i'll expand my answer.

http://stackoverflow.com/a/28752256
has comment: http://stackoverflow.com/comment/54001442
has comment: http://stackoverflow.com/comment/45787402
type: Answer
has comment: http://stackoverflow.com/comment/52585205
has comment: http://stackoverflow.com/comment/45787175
accepted answer of: http://stackoverflow.com/q/28751568
answers question: http://stackoverflow.com/q/28751568
score: 13
upvote count: 13
has body: Here is a demo, I think the variables and functions have names explicit enough to understand everything, but if you have any question or problem, go ahead and ask. One thing I have to mention is that it won't be exact. If your interval gets executed once per second and the user skips a part in the middle of a second, that one might not be counted. To have a more accurate percentage, you can execute your interval more often (100ms here, I got 97% when watching the video back and forth), but be careful not to use too much resources. var player, timer, timeSpent = [], display = document.getElementById('display'); function onYouTubeIframeAPIReady() { player = new YT.Player( 'player', { events: { 'onStateChange': onPlayerStateChange } }); } function onPlayerStateChange(event) { if(event.data === 1) { // Started playing if(!timeSpent.length){ timeSpent = new Array( parseInt(player.getDuration()) ); } timer = setInterval(record,100); } else { clearInterval(timer); } } function record(){ timeSpent[ parseInt(player.getCurrentTime()) ] = true; showPercentage(); } function showPercentage(){ var percent = 0; for(var i=0, l=timeSpent.length; i&lt;l; i++){ if(timeSpent[i]) percent++; } percent = Math.round(percent / timeSpent.length * 100); display.innerHTML = percent + "%"; } JS Fiddle Demo
has comment: http://stackoverflow.com/comment/86053393
has comment: http://stackoverflow.com/comment/45787288
has comment: http://stackoverflow.com/comment/52575024
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/45936075
type: Comment
comment on: http://stackoverflow.com/q/28833133
type: QuestionComment
has text: http://www.w3schools.com/jsref/jsref_obj_date.asp milliseconds);
score: 0

http://stackoverflow.com/comment/46385292
has text: Even if the answer is incomplete as i don't have a proper way to read the logs and the broadcasting apparently has to send the data to each user in a loop this is the most complete answer. i would be happy if you can investigate further about those 2 things.Anyway thx
type: Comment
comment on: http://stackoverflow.com/a/28947496
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45905990
type: Comment
type: QuestionComment
has text: Making an ajax request is the way I'd like to go. The element is not previously loaded prior to this. ( I viewed source to be sure)
comment on: http://stackoverflow.com/q/28816906
score: 0

http://stackoverflow.com/comment/45910430
score: 3
has text: The detailed answer is "Yes, use Jquery's $.ajax(), $.post(), or $.get() methods...." That's it. Oh, and you have to use both JS and PHP, not just one.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28819301

http://stackoverflow.com/q/28817544
has comment: http://stackoverflow.com/comment/45907727
tagged with: javascript
answer count: 2
has comment: http://stackoverflow.com/comment/45907916
tagged with: angularjs
has answer: http://stackoverflow.com/a/28818549
type: UnansweredQuestion
has title: Sharing the $scope value between controller and directive
score: 0
has answer: http://stackoverflow.com/a/28820602
type: Question
has body: I have a directive that toggles a DIV I have using ng-show. Now when the DIV is visible after 5 seconds I wish it to fade out. The ng-show is toggled using a $scope variable in my controller ($scope.showPopover) which is a boolean, it is either true or false. This is my HTML: Hello World, I am content but will go after 5 seconds! You will notice the custom directive is on a child div as in my directive when I tried to use the element it was returning the comment produced by the ng-if. This is my directive .directive('fadeAnimation', function ($animate) { 'use strict'; return{ restrict: 'A', priority: 800, link: function (scope, element) { scope.$watch('showPopover', function (newValue) { console.log(scope.showPopover); // same as scope.showPopover in the controller if (newValue === true) { $animate.addClass(element[0].parentNode, 'fade-animiate').then(function () { $animate.removeClass(element[0].parentNode, 'fade-animiate'); //scope.showPopover = false; // scope.$apply(); // this produces Error: [$rootScope:inprog] $digest already in progress }); } else if (newValue === false) { //scope.showPopover = false; // scope.$apply(); // this produces Error: [$rootScope:inprog] $digest already in progress } }); } }; }); As you can see I add and remove a CSS class (with animation) to the parent element. Once this is done I would like to set the scope.showPopover boolean that is in the controller to false as this prevents me having to double click the original link that toggles the popover (as it is false, we toggle to true, the animation hides the DIV but the scope.showPopover or $scope.showPopover is still true). I have tried setting scope.showPopover = false in my directive but this is not updated in the controller. When I try and force a scope.$apply(); I get an error in my console stating Error: [$rootScope:inprog] $digest already in progress. What am I doing wrong? I have tried setting this in the promise after I remove the css class and when I uncomment the scope.showP…

http://stackoverflow.com/a/28892457
score: 6
answers question: http://stackoverflow.com/q/28892291
has body: The second argument to window.open() must be unique for it to open a new window or must be set to "_blank". From the MDN page for window.open(): var windowObjectReference = window.open(strUrl, strWindowName, [strWindowFeatures]); If a window with the name strWindowName already exists, then strUrl is loaded into the existing window. In this case the return value of the method is the existing window and strWindowFeatures is ignored. Providing an empty string for strUrl is a way to get a reference to an open window by its name without changing the window's location. To open a new window on every call of window.open(), use the special value "_blank" for strWindowName. Note: most browsers these days have popup blockers built in. Those popup blockers will generally allow one new window to be opened when it is the direct result of a mouse click, but they may impose limits if the code is trying to open lots of windows. This popup blocker behavior is not per some specification so it likely varies in detailed implementation from browser to browser.
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28892291
upvote count: 6

http://stackoverflow.com/comment/46062388
has text: Thanks, this is what I need, and I see that your jsfiddle works. Unfortunately, when I do the same thing, the click even does not fire and I see no error. Maybe I am doing something else wrong, I will try to get as close to your solution as possible.
type: AnswerComment
comment on: http://stackoverflow.com/a/28891443
score: 0
type: Comment

http://stackoverflow.com/a/36483974
has body: amplify.js uses jQuery's ajax() method, which in turn limits how data is sent during get requests.
answers question: http://stackoverflow.com/q/28883940
accepted answer of: http://stackoverflow.com/q/28883940
type: AcceptedAnswer
score: 0
type: Answer

http://stackoverflow.com/comment/45935816
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28833043
has text: @Tyranicangel in another module's controller
score: 0

http://stackoverflow.com/a/52438302
type: Answer
has comment: http://stackoverflow.com/comment/139656295
score: 25
has comment: http://stackoverflow.com/comment/107039896
answers question: http://stackoverflow.com/q/28766676
downvote count: 0
has comment: http://stackoverflow.com/comment/122853494
has comment: http://stackoverflow.com/comment/92792881
has comment: http://stackoverflow.com/comment/95299206
upvote count: 25
has body: @Benzi Heler answer is great, but it uses jQuery which seems like is not working in WKWebView anymore, so I have found solution without using jQuery. Here is ViewController implementation that lets you be notified every AJAX request is completed in WKWebView: import UIKit import WebKit class WebViewController: UIViewController { private var wkWebView: WKWebView! private let handler = "handler" override func viewDidLoad() { super.viewDidLoad() let config = WKWebViewConfiguration() let userScript = WKUserScript(source: getScript(), injectionTime: .atDocumentStart, forMainFrameOnly: false) config.userContentController.addUserScript(userScript) config.userContentController.add(self, name: handler) wkWebView = WKWebView(frame: view.bounds, configuration: config) view.addSubview(wkWebView) if let url = URL(string: "YOUR AJAX WEBSITE") { wkWebView.load(URLRequest(url: url)) } else { print("Wrong URL!") } } private func getScript() -&gt; String { if let filepath = Bundle.main.path(forResource: "script", ofType: "js") { do { return try String(contentsOfFile: filepath) } catch { print(error) } } else { print("script.js not found!") } return "" } } extension WebViewController: WKScriptMessageHandler { func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) { if let dict = message.body as? Dictionary&lt;String, AnyObject&gt;, let status = dict["status"] as? Int, let responseUrl = dict["responseURL"] as? String { print(status) print(responseUrl) } } } Pretty standard implementation. There is a WKWebView created programmatically. There is injected script that is loaded from script.js file. And the most important part is script.js file: var open = XMLHttpRequest.prototype.open; XMLHttpRequest.prototype.open = function() { this.addEventListener("load", function() { var message = {"status" : this.status, "responseURL" : this.responseURL} webkit.messageHandlers.handler.postMessage(message); }); open.apply(this, arguments); }; …
has comment: http://stackoverflow.com/comment/105804563

http://stackoverflow.com/comment/45875674
comment on: http://stackoverflow.com/a/28800266
has text: You forgot to add the :first selector, which I didn't realize I needed.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45896439
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28811886
has text: You need to trigger digest anyway somehow. One way is to use $apply on the scope. So you have to use $rootScope, because you don't have controller scope anyway. Other option is to use $timeout service `$timeout(function () { DATA.values = angular.fromJson(msg.data).slice(); });`
type: Comment

http://stackoverflow.com/q/28750738
has title: PHP + Ajax/Javascript + Mysql
favorite count: 0
tagged with: ajax
answer count: 0
score: 0
type: UnansweredQuestion
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/45783695
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45783814
has comment: http://stackoverflow.com/comment/45784506
has body: I trying control a "status" of 3 buttons using HTML/PHP + Ajax/javascript + Mysql. I can click on button and: Button on 'div' tag and go to script java that manager the get to load; Update bd; Change the image that is my button (after query on altered bd); There is my codes: index.php: on head on body: <?php QueryStateButton(1); ?> <?php QueryStateButton(2); ?> <?php QueryStateButton(3); ?> my function: function QueryStateButton($num) { include 'conection.php'; $query = 'SELECT * FROM button WHERE id =' . $num; $result = mysqli_query($link, $query); while ($row = mysqli_fetch_array($result)) { $place = $row['place']; $status = $row['status']; } if ($status == 1) { echo ' ' . $place; } else { echo ' ' . $place; } mysqli_close($link); } another: function changeStatusButton($num) { $status = queryStatus($num); include 'conection.php'; if ($status == 0) { $query = 'UPDATE button SET status = 1 WHERE id =' . $num; } else { $query = 'UPDATE button SET status = 0 WHERE id =' . $num; } $result = mysqli_query($link, $query); mysqli_close($link); QueryStateButton($num); } Just scope: //take the status for button on bd function queryStatus($num) { ... } change.php <?php $num = $_GET['num']; include 'functions.php'; $resul = changeStatusButton($num); ?> My problem is this: I need be able to click image inside div and change the state of this button on bd. Same time I need the return this state via ajax/javascript and change the image on browser "alive". For example: I click the button on my tablet and my son on PC see the change ON to OFF (or OFF to ON) without need to refresh the page. How is this possible? I don't want to use Node.js (because I think a very complex and cannot understood how to do this). I saw for long_polling and comet strategies, but this is possible using php/html + ajax/javascript + mysql?
has comment: http://stackoverflow.com/comment/45783993
has comment: http://stackoverflow.com/comment/45783586
tagged with: mysql
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45784162
has comment: http://stackoverflow.com/comment/45784114

http://stackoverflow.com/comment/45900781
comment on: http://stackoverflow.com/q/28814368
has text: should be working through API of `dzsap_init`. If it doesn't support what you want, find another plugin that does
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28788325
has comment: http://stackoverflow.com/comment/45852450
favorite count: 0
has title: Node undefined is not a function in server.js file
tagged with: node.js
has answer: http://stackoverflow.com/a/28788340
accepted answer: http://stackoverflow.com/a/28788340
type: AnsweredQuestion
upvote count: 0
type: Question
tagged with: javascript
score: -1
answer count: 1
downvote count: 1
has body: Having issues with app.configure: debugger; var appSettings = require('./server/config/settings/MainAppSettings.js'); // ====== DB ============== //var sqlImport = require('./server/dbConnectors/MYSQL/MYSQLMainConn.js'); //var dbConnection = new sqlImport.sqlConn(); var dbConnection = null; // ====== setup basic server ============== var root = __dirname; var express = require('express'); var app = express(); app.configure(function () { app.use(express.json()); app.use(express.urlencoded()); app.use(express.methodOverride()); app.use(app.router); app.use(express.errorHandler({dumbExceptions:true, showStack:true})); }); // ====== SSL ============== var https = require('https'); var fs = require('fs'); // This line is from the Node.js HTTPS documentation. var options = { key: fs.readFileSync(appSettings.key1.key), cert: fs.readFileSync(appSettings.key1.cert) }; // ====== Routes ============== //handle get requests var errors = require('./server/errors/errors.js').errors; require('./server/config/routes/routes.js')(app, dbConnection, errors); //keep server from crashing by catching all exceptions not caught before process.on('uncaughtException', function(err) { console.log(err); }); //launch http server app.listen(appSettings.ports.http); console.log('Express http server listening on port %d in %s mode',appSettings.ports.http, app.settings.env); //launch https server https.createServer(options, app).listen(appSettings.ports.https, function(){ console.log('Express https server listening on port %d in %s mode',appSettings.ports.https, app.settings.env); }); module.exports = app;

http://stackoverflow.com/comment/46098396
type: AnswerComment
has text: This is not at all what I am looking for. I obviously have a very specific use case to why I can't use normal tools like this..
type: Comment
comment on: http://stackoverflow.com/a/28920360
score: 0

http://stackoverflow.com/a/28803494
score: 0
type: Answer
has body: In AngularJs, as far as I know, the scopes are inherited from the parent scope, all the variables, but if u have a sibling scope then those values will not be inherited. The broadcasting is done for events. So, Angular is working as it has to be. If you have set some variable on the $rootScope that will be accesible throughout the App.
answers question: http://stackoverflow.com/q/28803172

http://stackoverflow.com/comment/45884194
score: 0
type: AnswerComment
has text: @RoryPerro it's not "help" actually - you know no more than you did before. You will copy paste the provided solution but next time when you have something similar but not exactly the same - you'll be in stuck.
type: Comment
comment on: http://stackoverflow.com/a/28805268

http://stackoverflow.com/comment/45942444
score: 1
comment on: http://stackoverflow.com/q/28835743
type: Comment
type: QuestionComment
has text: That would be very broad and too long to go into here I think but I'll see what I can come up with.

http://stackoverflow.com/a/28768982
score: 10
upvote count: 10
answers question: http://stackoverflow.com/q/28768952
downvote count: 0
type: Answer
has body: You can use filter method: const array_1 = ["the", "quick", "brown", "fox", "jumped", "over", "the", "lazy", "dog"]; const new_array = array_1.filter((element) =&gt; { return element.length &gt; 3; }); // OR refactor // const new_array = array_1.filter( (element) =&gt; element.length &gt; 3); console.log(new_array) // Output: // ["quick", "brown", "jumped", "over", "lazy"]

http://stackoverflow.com/comment/97522505
has text: This worked well. Before reading this post I had the styles working but sometimes I had problems with the button disappearing due to its absolute positioning (only in private browsing for some reason). Somehow applying the position: relative style to the parent container fixed my similar issue. Thanks!
type: Comment
comment on: http://stackoverflow.com/a/28881618
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45964329
has text: It's a little more complicated than that. What do you suppose happens when the user types `SE.ARC*2*6`?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28848213
type: Comment

http://stackoverflow.com/comment/45860785
has text: what are you expecting to get?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28792966
type: QuestionComment

http://stackoverflow.com/comment/46025062
type: Comment
has text: It's hard to answer what is best in your case without knowing more/all about its use and scope. Go with your guts - what solution makes you feel good? :)
comment on: http://stackoverflow.com/a/28881360
type: AnswerComment
score: 1

http://stackoverflow.com/q/28771591
upvote count: 1
accepted answer: http://stackoverflow.com/a/28771687
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28771793
type: Question
downvote count: 0
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28771680
has answer: http://stackoverflow.com/a/28771687
has answer: http://stackoverflow.com/a/28771680
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has title: Custom href with javascript
has comment: http://stackoverflow.com/comment/45821778
has comment: http://stackoverflow.com/comment/45822052
favorite count: 0
has body: I would like to use a custom href from my javascript models so that the back button for each page footer knows where to go. How would I accomplish this? Thank you. window.APP= { models: { home: { title: 'Home' } , menu: { title: 'Main Menu', url: 'views/home.html' } , cards: { title: 'Cards', url: 'views/home.html' } , } } ; Home Back

http://stackoverflow.com/comment/45957985
type: QuestionComment
comment on: http://stackoverflow.com/q/28843584
has text: Please add your solution as an answer and accept it.
score: 0
type: Comment

http://stackoverflow.com/comment/58386402
score: 1
comment on: http://stackoverflow.com/q/28751669
type: QuestionComment
type: Comment
has text: I agree, this would be very appreciated. Most of our scripts are in .jsx files, and even though we would change them to .js files I reckon it won't work, as it is potentially a different syntax.

http://stackoverflow.com/comment/46214112
has text: This is my last try, I replied in chat too. Check this out http://jsfiddle.net/qxybezd3/11/
type: Comment
comment on: http://stackoverflow.com/a/28944881
score: 0
type: AnswerComment

list
type: Tag
tags question: http://stackoverflow.com/q/28893982
tag name: list
tags question: http://stackoverflow.com/q/28802795
tags question: http://stackoverflow.com/q/28853896
tags question: http://stackoverflow.com/q/28850720

http://stackoverflow.com/comment/45814860
comment on: http://stackoverflow.com/q/28767078
type: Comment
type: QuestionComment
has text: Sorry for the formating issues, they are related to writing the text originaly in Word and copy it. ;-) I use `window.History.pushState( {}, "Espa%C3%B1a", "Espa%C3%B1a" );` in code running on Chrome 40.
score: 0

http://stackoverflow.com/comment/45886650
comment on: http://stackoverflow.com/q/28806086
type: Comment
type: QuestionComment
has text: Aah okay, whether the method `render` was called or not, is the only thing that you need to verify, then would you like to replace the line `spyOn(@view, 'render');` with `spyOn(@view, 'render').andReturn();`, and give it a try ? It may not work though.
score: 0

http://stackoverflow.com/q/28905577
score: 0
has comment: http://stackoverflow.com/comment/46070803
has title: Best Practice - Access to MVC Model and Document Properties from .js Files
answer count: 0
type: UnansweredQuestion
has body: Given that its best to separate Javascript from HTML View files, what is the best practice for accessing: properties of the View Model and properties of the document including things like 'this' where I need to know information about the calling object For the former, I have seen Scott Gu's ToJSON extension method, but wanted to know whether this is the best approach. I've hunted around and not found much other than the above. Is there a good, trustworthy resource? Thanks, Chris.
tagged with: asp.net-mvc
type: Question
has comment: http://stackoverflow.com/comment/46132241
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46071347

dreamweaver
type: Tag
tag name: dreamweaver
tags question: http://stackoverflow.com/q/28875903

http://stackoverflow.com/comment/45792860
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28755759
has text: Hi Clinton: I'm not sure where you are having a problem. Could you please clarify what's going wrong?

http://stackoverflow.com/a/28775978
has body: In a different file, define a service containing the logic and just call it from the controller. app.controller('demoCtrl', ['$scope', function (ServiceFromDifferentFile, $scope) { $scope.msgtxt='Hello World'; ServiceFromDifferentFile.doStuff() }]);
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/45830381
answers question: http://stackoverflow.com/q/28775810
has comment: http://stackoverflow.com/comment/78218247
downvote count: 0
has comment: http://stackoverflow.com/comment/78218288
type: Answer

http://stackoverflow.com/q/28840853
has comment: http://stackoverflow.com/comment/45951070
has answer: http://stackoverflow.com/a/28841390
has title: Getting the text input from a dynamically created javascript text box
upvote count: 2
downvote count: 2
has answer: http://stackoverflow.com/a/28841394
type: Question
tagged with: javascript
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/45951168
favorite count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/26695254
has body: I am using the code from this link. http://www.randomsnippets.com/2008/02/21/how-to-dynamically-add-form-elements-via-javascript/ var counter = 1; var limit = 3; function addInput(divName){ if (counter == limit) { alert("You have reached the limit of adding " + counter + " inputs"); } else { var newdiv = document.createElement('div'); newdiv.innerHTML = "Entry " + (counter + 1) + " &lt;br&gt;&lt;input type='text' name='myInputs[]'&gt;"; document.getElementById(divName).appendChild(newdiv); counter++; } } How do I get the value from the text input?

http://stackoverflow.com/comment/45907893
comment on: http://stackoverflow.com/a/28817133
score: 0
type: Comment
has text: I only get a small part of the network designated for my site. So someone else is managing it. I was thinking, is it possible to have the request from the internet go and the webserver proxy to port 3000? Or have port 3000 open to the web?
type: AnswerComment

coffeescript
tags question: http://stackoverflow.com/q/28871155
tags question: http://stackoverflow.com/q/28891656
tags question: http://stackoverflow.com/q/28806086
tags question: http://stackoverflow.com/q/28764232
tags question: http://stackoverflow.com/q/28878034
tags question: http://stackoverflow.com/q/28806946
tags question: http://stackoverflow.com/q/28797317
type: Tag
tags question: http://stackoverflow.com/q/28889823
tags question: http://stackoverflow.com/q/28891751
tag name: coffeescript
tags question: http://stackoverflow.com/q/28849782
tags question: http://stackoverflow.com/q/28811232
tags question: http://stackoverflow.com/q/28825414
tags question: http://stackoverflow.com/q/28818510
tags question: http://stackoverflow.com/q/28872668
tags question: http://stackoverflow.com/q/28892533
tags question: http://stackoverflow.com/q/28872552
tags question: http://stackoverflow.com/q/28863054

http://stackoverflow.com/comment/45865165
type: QuestionComment
comment on: http://stackoverflow.com/q/28795345
score: 3
has text: Is that your homework ?
type: Comment

http://stackoverflow.com/comment/45985107
has text: geez, it looks like someone posted a template answer there.. regardless.. so you tried removing that line, and the problem still persists... your PHP looks good.. there must be some other problem. Where is your `myurl.php` file sitting? is it in the same directory as your script?
comment on: http://stackoverflow.com/a/28859614
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/46022898
comment on: http://stackoverflow.com/q/28880331
score: 0
type: QuestionComment
has text: Think its a valid questions... yet getting downvoted... ::sigh::
type: Comment

http://stackoverflow.com/a/28860447
type: Answer
answers question: http://stackoverflow.com/q/28841378
has comment: http://stackoverflow.com/comment/45988509
score: 0
has comment: http://stackoverflow.com/comment/45997708
has comment: http://stackoverflow.com/comment/45987787
has body: You may add each of retrieved portions of data (such as 'No:'+result.getInt(1)) to the channel map and put them in a required order in the destination's template box (instead of ${message.encodedData}).
has comment: http://stackoverflow.com/comment/45993379

http://stackoverflow.com/a/28849732
has comment: http://stackoverflow.com/comment/118294705
accepted answer of: http://stackoverflow.com/q/28849500
has body: Try using $scope.$apply() after changing the value. https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$apply
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28849500
type: Answer
has comment: http://stackoverflow.com/comment/118294847
score: 1
upvote count: 1

http://stackoverflow.com/comment/45858375
has text: There is (most likely) a JS function bound to the click event of the `#myToggle4` element. Find what that is and call that function directly.
type: Comment
comment on: http://stackoverflow.com/q/28791604
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45785158
comment on: http://stackoverflow.com/q/28751597
has text: [Don't parse HTML with RegEx](http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454)
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/46013074
type: AnswerComment
score: 0
type: Comment
has text: Yes, but I am talking about typing, not pasting.
comment on: http://stackoverflow.com/a/28875475

http://stackoverflow.com/a/28802277
has comment: http://stackoverflow.com/comment/45878309
accepted answer of: http://stackoverflow.com/q/28802169
score: 0
type: AcceptedAnswer
has body: Use the plus sign to convert to a number. var numStringOne = "1"; var numStringTwo = "2"; var numOne = +numStringOne; var numTwo = +numStringTwo; var sum = numOne + numTwo; if (sum === 3) { console.log("Hooray!"); } Here's some reading about that: http://speakingjs.com/es5/ch01.html#_operators http://speakingjs.com/es5/ch09.html#plus_operator And notes about using parseInt(), as another person suggested: http://speakingjs.com/es5/ch11.html#parseInt
answers question: http://stackoverflow.com/q/28802169
type: Answer
has comment: http://stackoverflow.com/comment/45878293
has comment: http://stackoverflow.com/comment/45878341

http://stackoverflow.com/q/28816634
answer count: 2
has comment: http://stackoverflow.com/comment/45905191
tagged with: php
accepted answer: http://stackoverflow.com/a/28816836
has body: Is there a way I can remove paragraphs with no text in them, but might have empty html tags in them? For example &lt;p&gt;&lt;strong&gt;&lt;br&gt;&lt;/strong&gt;&lt;/p&gt; or &lt;p&gt;&lt;/p&gt; or &lt;p&gt;&amp;nbsp;&lt;/p&gt; would be removed but &lt;p&gt;&lt;strong&gt;hi&lt;br&gt;there&lt;/strong&gt;&lt;/p&gt; or &lt;p&gt;hi there&lt;/p&gt; wouldn't be removed
type: AnsweredQuestion
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28816824
has answer: http://stackoverflow.com/a/28816824
type: Question
tagged with: preg-replace
tagged with: regex
has answer: http://stackoverflow.com/a/28816836
score: 0
has title: Remove paragraphs with no text

http://stackoverflow.com/q/28760633
has answer: http://stackoverflow.com/a/29044420
tagged with: rubygems
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/31601536
tagged with: ruby-on-rails
linked to: http://stackoverflow.com/q/3774925
type: Question
linked to: http://stackoverflow.com/q/18154916
has title: Ruby On Rails errors with javascript_include_tag
tagged with: javascript
has comment: http://stackoverflow.com/comment/45829846
has comment: http://stackoverflow.com/comment/45801795
answer count: 2
tagged with: ruby-on-rails-4
has body: So my issue, from what I can tell, seems to be that ruby is not loading all of its javascript files as I am not getting confirm messages and link_to with method: :delete does nothing for me. With the default set up provided to me rails new views/layouts/application.html.erb head section is as follows. Myrubyblog <%= stylesheet_link_tag 'default', media: 'all', 'data-turbolinks-track' => true %> <%= javascript_include_tag 'default', 'data-turbolinks-track' => true%> <%= csrf_meta_tags %> Which gives me the error Started GET "/posts" for 127.0.0.1 at 2015-02-27 02:14:57 -0600 ActiveRecord::SchemaMigration Load (0.0ms) SELECT "schema_migrations".* FROM "schema_migrations" Processing by PostsController#index as HTML Post Load (1.0ms) SELECT "posts".* FROM "posts" Rendered posts/index.html.erb within layouts/application (11.0ms) Completed 200 OK in 76ms (Views: 54.0ms | ActiveRecord: 4.0ms) Started GET "/stylesheets/default.css" for 127.0.0.1 at 2015-02-27 02:14:58 -0600 ActionController::RoutingError (No route matches [GET] "/stylesheets/default.css"): actionpack (4.1.8) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call' actionpack (4.1.8) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call' railties (4.1.8) lib/rails/rack/logger.rb:38:in `call_app' railties (4.1.8) lib/rails/rack/logger.rb:20:in `block in call' activesupport (4.1.8) lib/active_support/tagged_logging.rb:68:in `block in tagged' activesupport (4.1.8) lib/active_support/tagged_logging.rb:26:in `tagged' activesupport (4.1.8) lib/active_support/tagged_logging.rb:68:in `tagged' railties (4.1.8) lib/rails/rack/logger.rb:20:in `call' actionpack (4.1.8) lib/action_dispatch/middleware/request_id.rb:21:in `call' rack (1.5.2) lib/rack/methodoverride.rb:21:in `call' rack (1.5.2) lib/rack/runtime.rb:17:in `call' activesupport (4.1.8) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call' rack (1.5.2) lib/rack/lock.rb:17:in `call' actionpack (4.1.8) lib/action_dispatch/middlewa…
downvote count: 0
favorite count: 0
score: 2
has comment: http://stackoverflow.com/comment/46126935

http://stackoverflow.com/q/28762327
score: 1
has answer: http://stackoverflow.com/a/28762375
type: Question
accepted answer: http://stackoverflow.com/a/28762366
has title: Add data to object array in javascript
possible better answer: http://stackoverflow.com/a/28762375
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/28762366
answer count: 2
upvote count: 1
favorite count: 0
has body: I know I can do something like that: var data = [ { name: 'test1', value: 1 } ]; But I want to fill data with dynamic values (from HTML). So I will have var data = []; and how can I fill this one? I know, it must be somewhere on the internet, but I don not know the "right words" to search. Note: data have to be array filled with objects.
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/a/28772166
has body: You are listening to the events mouseenter/mouseout. You want the events mouseenter/mouseleave: Example Here $(".parent").on("mouseenter mouseleave", function () { $(this).toggleClass('hovered'); }); As an alternative, you could also add pointer-events: none to the child img element in order to essentially remove mouse events from the element: Updated Example .parent &gt; img { pointer-events: none; } Depending on what you're trying to achieve, you may not even need JS, though. Just use the :hover pseudo class. Example Here .parent { width:400px; height:400px; background:blue; } .parent:hover { background:red; }
has comment: http://stackoverflow.com/comment/45822908
downvote count: 0
type: AcceptedAnswer
upvote count: 6
type: Answer
has comment: http://stackoverflow.com/comment/45823173
accepted answer of: http://stackoverflow.com/q/28772104
answers question: http://stackoverflow.com/q/28772104
score: 6

http://stackoverflow.com/comment/46023977
score: 0
comment on: http://stackoverflow.com/a/28881004
has text: That does handle the middle click, so certainly a step forward, thanks. But using the menu's "open in new tab" is not covered, though it seems to be too hard according to other comments above.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45963777
type: Comment
comment on: http://stackoverflow.com/a/28847559
score: 0
type: AnswerComment
has text: theres no error but the output is still the same, I need is I select any items from dropdown list then it will also load the price and weight of that selected item.

http://stackoverflow.com/q/28862395
has comment: http://stackoverflow.com/comment/45990143
has title: How to use Javascript to call an external library's function inside of a function?
upvote count: 1
downvote count: 1
type: Question
tagged with: javascript
tagged with: jquery
tagged with: scope
score: 0
has body: Hello so I am using the CryptoJS library to do a SHA256 hash. I am having the problem where it allows me to do something like this. but not this This gives me an undefined function error. I am new to JavaScript... so I may just not be that familiar with scopes and external libraries could someone help clarify this for me?
answer count: 1
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29239320
tagged with: sha256

http://stackoverflow.com/q/28764119
type: AnsweredQuestion
score: 3
downvote count: 0
has answer: http://stackoverflow.com/a/28764206
type: Question
tagged with: javascript
tagged with: jquery
upvote count: 3
answer count: 2
possible better answer: http://stackoverflow.com/a/28764563
has title: Elegant solution to conditional AJAX call
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/28764563
has body: I am writing some javascript that includes a series AJAX calls and I am looking for an elegant solution to the following issue: The goal of the script is to gather parameters and then execute an API call with these parameters. The very first time the call is executed there is one parameter that needs to be requested from the server - every subsequent call will use a stored value of this parameter. This is where the issue begins. I want a conditional AJAX call to be made only if this is the first time. I don't want to put the rest of the code into the success function of that AJAX call as that seems convoluted. I would like something like the following but due to the obvious asynchronous nature of the call I realize this is not possible. I also want to avoid having a synchronous call as this would cause the thread to block: var myParameter; if(!params.myParam.isStored) { myParameter = getParamWithAjaxCall(); } else { myParameter = params.myParam; } // Continue with the rest of execution here of which there is a lot of code Sorry if this seems like an obvious question and I have looked into solutions using the following but I am looking for an experienced opinion on what the most elegant solution would be: jQuery: when.done jQuery: async: false Passing a callback to the Ajax call
accepted answer: http://stackoverflow.com/a/28764206

http://stackoverflow.com/q/28783450
has answer: http://stackoverflow.com/a/28783565
answer count: 1
favorite count: 0
has title: Can you match two sets of equal length, and how?
tagged with: regex
type: UnansweredQuestion
upvote count: 1
downvote count: 1
type: Question
has body: Is it possible to create a regex to match two sets with equal length? For example: I would like to match aabb and aaaabbbb but not aaaabb. What I want is something like [a]+[b]+, but with with both of those having equal length, so something like [a]{x}[b]{x} where x is a possible length. Is it possible to do this with one javascript regex, should I use multiple regexes for the multiple possibilities (I dont think I will need to check for length 32 or higher) or should I code it in myself?
tagged with: javascript
score: 0

http://stackoverflow.com/comment/45867953
type: QuestionComment
has text: @CronbachAlpha exactly..but can I use selected value ID used in var to ,So will get on another page in PHP
comment on: http://stackoverflow.com/q/28796511
score: 0
type: Comment

http://stackoverflow.com/a/28852606
has comment: http://stackoverflow.com/comment/45971833
score: 0
has comment: http://stackoverflow.com/comment/45972245
type: Answer
has body: All elements in the DOM with an ID are made available through a variable that is equal to their id name. The second time you call the timeout, in the foo method, you don't include the quotation marks, so instead of passing a variable "countdown" you're passing the variable countdown which is equal to the DOM object. You can change your code as function foo (id_of_dom_element, number){ document.getElementById(id_of_dom_element).innerHTML=number; number = number + 1; setTimeout("foo('" + id_of_dom_element + "'," + number + ")", 1000); }
answers question: http://stackoverflow.com/q/28852420

http://stackoverflow.com/comment/45876367
comment on: http://stackoverflow.com/q/28801272
score: 0
has text: `document.querySelector('#desc textarea').style....`
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45833849
type: Comment
score: 0
type: AnswerComment
has text: Thank you for spending the time to answer that question. I know i included the html part, but what im focusing on is the javascript part, since its a javascript class. Also, there is all that information but the instructor gave a hint to say that the javascript part would only be 5 lines. Im just looking for the most basic option. Thanks again for answering!
comment on: http://stackoverflow.com/a/28777766

http://stackoverflow.com/q/28834406
linked to: http://stackoverflow.com/q/28600238
has comment: http://stackoverflow.com/comment/45938405
has answer: http://stackoverflow.com/a/28835045
has comment: http://stackoverflow.com/comment/45939735
type: AnsweredQuestion
has body: I have the following parent class... function Parent(id, name, parameters) { Object.defineProperty(this, "id", { value: id }); Object.defineProperty(this, "name", { value: name, writable: true }); }; and the corresponding child class: function Child(id, name, parameters) { Object.defineProperty(this, "phone", { value: parameters.phone, writable: true }); }; I tried to apply inheritance by adding something like Child.prototype = Object.create(Parent.prototype); , but this obviously does not work. How can I inherit from the Parent class such that I can use the properties id and name.
has title: Javascript inheritance of properties defined with Object.defineProperty
score: 1
upvote count: 1
accepted answer: http://stackoverflow.com/a/28835045
type: Question
tagged with: javascript
tagged with: inheritance
answer count: 1
downvote count: 0
tagged with: defineproperty
favorite count: 0

http://stackoverflow.com/a/28829760
answers question: http://stackoverflow.com/q/28813696
has body: I think I came to solution. I was thinking right that svg did not load properly when click was not working. So i wrape all code in below block. $('#svg1').load('nejc/bg.svg', null, function() { //here is now my code given in question }); This function load svg and on complete executes code in funtion.
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/28813696
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/45861309
has text: Are the elements from which you retrieve the data inputs, or other HTML-elements? Ergo, could you please post the corresponding HTML.
comment on: http://stackoverflow.com/q/28793263
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/46011514
score: 1
has text: Every object has a prototype in JavaScript whether you like it or not. It may be frowned upon to extend Object.prototype, but even worse to write code that can be broken so easily.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28874353

http://stackoverflow.com/a/28841213
has comment: http://stackoverflow.com/comment/45953230
accepted answer of: http://stackoverflow.com/q/28839687
type: AcceptedAnswer
type: Answer
has body: Polling is resource-heavy. You should consider something like WebSockets. With WebSockets, you basically will have the client chat user apps subscribe the to the WebSocket, and then the back end server application would notify them when they should check for updates, or just push the new message updates out to them right over the WebSocket connection. Here is a demo chat application you can look at. Here's the WebSocket website.
answers question: http://stackoverflow.com/q/28839687
score: 0

http://stackoverflow.com/a/28904267
has body: in Javascript the curly brackets are optional for if/else when you have only one statement after to execute. Note that if you will execute multiple stuff after then you will need to include the {/} or only the first statement will be applied to the condition
type: Answer
score: 6
answers question: http://stackoverflow.com/q/28904140
downvote count: 0
upvote count: 6

http://stackoverflow.com/a/28863444
upvote count: 1
answers question: http://stackoverflow.com/q/28863245
type: Answer
downvote count: 0
score: 1
has body: Shouldn't be a problem: JSfiddle Some text black red blue green Unless you need something else.

http://stackoverflow.com/a/28833848
accepted answer of: http://stackoverflow.com/q/28833794
upvote count: 8
answers question: http://stackoverflow.com/q/28833794
has body: this is the native DOMElement. It has no attr() property. You need to convert it to a jQuery object by using $(this) to access jQuery properties and methods. Try this: $(".card").hover(function () { $('.cardpreview').attr('src', $(this).attr('src')); }, function () { $('.cardpreview').attr('src', 'http://mtgimage.com/card/cardback.jpg'); }); Note I also fixed the typo in the second .cardpreview selector.
type: Answer
type: AcceptedAnswer
downvote count: 0
score: 8

http://stackoverflow.com/q/28811889
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28811987
has answer: http://stackoverflow.com/a/28811987
has title: JavaScript: replace string inside array
type: Question
has answer: http://stackoverflow.com/a/28812106
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/45895686
score: 0
has answer: http://stackoverflow.com/a/28811933
accepted answer: http://stackoverflow.com/a/28811933
has body: Maybe I'm making a very stupid mistake but here it goes. I want to take [ 'hr' ] and turn it into [ '* * *' ] So I did this: var hr = jsonml[i] console.log(hr) // outputs: [ 'hr' ] hr.replace(/hr/g, '* * *') But I get this error: TypeError: Object hr has no method 'replace' What am I doing wrong?
answer count: 4
has answer: http://stackoverflow.com/a/28812055
has comment: http://stackoverflow.com/comment/45895679

http://stackoverflow.com/a/60957910
upvote count: 5
score: 5
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28882552
has body: Starting in Mongo 4.4, the $function aggregation operator allows applying a custom javascript function to implement behaviour not supported by the MongoDB Query Language. For instance, in order to concatenate an array of strings: // { "_id" : "3_0", "values" : [ "1", "2" ] } db.collection.aggregate( { $set: { "values": { $function: { body: function(values) { return values.join('_'); }, args: ["$values"], lang: "js" }} } } ) // { "_id" : "3_0", "values" : "1_2" } $function takes 3 parameters: body, which is the function to apply, whose parameter is the array to join. args, which contains the fields from the record that the body function takes as parameter. In our case "$values". lang, which is the language in which the body function is written. Only js is currently available.

http://stackoverflow.com/comment/45808196
comment on: http://stackoverflow.com/q/28762959
score: 0
type: Comment
type: QuestionComment
has text: @jfriend00 - I don't have 256 functions as some are duplicated, NOPs etc but I can easily expand it to 256 then have an array of anonymous functions called by index - I like the sound of that, thank you.

http://stackoverflow.com/q/28891343
has body: This doesn't work quite well when it reached the last image, I have to click twice to go back to the first image. var i = 1; $('.rightArrow').click(function () { if(i != 4) { $('body').css( 'background', 'linear-gradient(rgba(0, 0, 0, 0.30),rgba(0, 0, 0, 0.30)), url("'+ customerBgs[i]+'") no-repeat center center fixed' ); i++; }else{ i = 0; $('body').css( 'background', 'linear-gradient(rgba(0, 0, 0, 0.30),rgba(0, 0, 0, 0.30)), url("'+ customerBgs[i]+'") no-repeat center center fixed' ); } });
type: AnsweredQuestion
has title: infinite loop a set of images
possible better answer: http://stackoverflow.com/a/28891425
tagged with: jquery
has answer: http://stackoverflow.com/a/28891470
has answer: http://stackoverflow.com/a/28891425
type: Question
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/46043854
has comment: http://stackoverflow.com/comment/46043849
has answer: http://stackoverflow.com/a/28891476
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28891476

http://stackoverflow.com/a/28884870
answers question: http://stackoverflow.com/q/28884654
has body: See the fiddle Replace for (hidden in hide_these) { document.getElementById(hidden).style.display = 'none'; } with for (hidden in hide_these) { document.getElementById(hide_these[hidden]).style.display = 'none'; } The problem with your code was that document.getElementById() was returning null because the values for the variable hidden was actually 0,1,2 etc. you actually had to get the ids from the array hide_these UPDATE Add this in your CSS The messing up of the background image is because you are missing the below given css. add them to solve the issue.. #about, #projects, #contact { width: 100%; height:100%; }
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/46031046
score: 1
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28884654

http://stackoverflow.com/a/28763567
upvote count: 1
score: 1
has body: Omar (https://stackoverflow.com/users/1771795/omar) came up with this, which works well. $(document).on("pagecreate", function (e) { $(".edit", e.target).on("click", function () { $("#purchase", e.target) .one("popupafterclose", function () { $("#edit", e.target) .popup({ transition: "pop" }) .popup("open"); }) .popup("close"); }); }); http://jsfiddle.net/psgu4y9j/
downvote count: 0
answers question: http://stackoverflow.com/q/28756667
type: Answer

http://stackoverflow.com/comment/74635610
score: 0
has text: Won't `queue` be equal to the last `Promise` returned from the loop? What do you mean when in the comment you say `all done here`.
comment on: http://stackoverflow.com/a/28851797
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28813697
has comment: http://stackoverflow.com/comment/45899873
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28813567
answers question: http://stackoverflow.com/q/28813567
type: AcceptedAnswer
downvote count: 0
score: 1
has body: Lets make that subscribe reactive. Tracker.autorun(function(){ Meteor.subscribe('posts'); } Why don't make a simple Publish-Subscribe and use this helper? on the client side. Template.postsExample.helpers({ posts: function() { return Posts.find({}, {sort: {submitted: -1}}); } });
has comment: http://stackoverflow.com/comment/45909240
type: Answer

http://stackoverflow.com/q/28875903
favorite count: 0
has body: I need to create an ID card, using information given to me by a user, using a form. I have created the form, I just want to know how to design the card (with an image) using CSS? Any help would be appreciated!
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: dreamweaver
tagged with: css
downvote count: 3
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28876059
score: -2
has title: HTML - Creating an ID card using CSS and Javascript
tagged with: javascript
answer count: 1

http://stackoverflow.com/q/28754426
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/28761027
type: AnsweredQuestion
tagged with: karma-runner
type: Question
has title: Writing Karma + Mocha tests with both dependency injection and `done`?
accepted answer: http://stackoverflow.com/a/28761027
score: 5
upvote count: 5
tagged with: javascript
has body: What's the most elegant way to write Karma unit tests in mocha that both have dependency injection and done? Dependency injection: describe('cows', function(){ it('farts a lot', inject(function(cow){ // do stuff })) }) Done: describe('cows', function(){ it('farts a lot', function(done){ // do stuff }) }) What if I want both cow and done available in my unit test? Right now, this is what I'm doing, and it's unsatisfactory. beforeEach(inject(function(cow){ this.cow = cow; })) it('farts a lot', function(done){ this.cow // etc })
downvote count: 0
answer count: 1

http://stackoverflow.com/a/28775406
has comment: http://stackoverflow.com/comment/84216291
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/84202190
has comment: http://stackoverflow.com/comment/84215327
has comment: http://stackoverflow.com/comment/45829776
answers question: http://stackoverflow.com/q/28773807
upvote count: 1
downvote count: 1
has body: Listen to the socket disconnect event and when you get a disconnect event, remove the relevant event handler from the myService object. You should be able to do that like this: io.sockets.on("connection", function (socket) { function handler() { socket.emit("myevent", { /* ... */ }); // some stuff happens here of course } myService.on("myevent", handler); socket.on("disconnect", function() { myService.removeListener("myevent", handler); }); }); If what you're trying to do is to broadcast to all connected sockets, you could just install one "myevent" listener (not one per connection) and use io.emit() to broadcast to all sockets too and not have to handle the connect or disconnect events for this purpose.
accepted answer of: http://stackoverflow.com/q/28773807
has comment: http://stackoverflow.com/comment/45829050
has comment: http://stackoverflow.com/comment/84202474
score: 0
has comment: http://stackoverflow.com/comment/45828994

http://stackoverflow.com/comment/45984358
has text: You should at least be aware that delegating all events up to the body isn't very good practice, and should generally be avoided if you have other options or static parent elements that can be used instead.
comment on: http://stackoverflow.com/q/28859277
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28875414
tagged with: http://stackoverflow.com/tag/html
score: 1
has title: Make items draggable with jquery draggable UI
favorite count: 0
upvote count: 1
type: AnsweredQuestion
has body: I have an html page, which has a jQuery draggable function -- function Drag() { $(function () { $($("span")).draggable({ containment: "document" }); }); $(function () { $($("li")).draggable({ containment: "document" }); }); $(function () { $($("a")).draggable({ containment: "document" }); }); $(function () { $($("div")).draggable({ containment: "document" }); }); } But I don't want to add for each elements like that, it will take me much time, and will not be any good for me... Any idea how I can loop throw the elements in the page and do draggable on each one of them. Thanks!
has answer: http://stackoverflow.com/a/28875741
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28875558
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46013169
possible better answer: http://stackoverflow.com/a/28875558
accepted answer: http://stackoverflow.com/a/28875741

http://stackoverflow.com/a/28843243
has body: Your loop tests for j%k == 0, but k is always greater than j because your loop for k starts at j+1 and keeps getting bigger, so j%k will always equal j. I think your loop should be for(var k=j-1; k&gt;1; k--) { if(j%k == 0) { primeArray[j]=0; break; // it's not prime, so move on to the next value for j. } } This isn't optimal prime-finding code, but it will get the right results.
score: 0
accepted answer of: http://stackoverflow.com/q/28843191
answers question: http://stackoverflow.com/q/28843191
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45958345
type: Answer

http://stackoverflow.com/q/28794602
has answer: http://stackoverflow.com/a/28794924
has title: Jquery previous object selector
has comment: http://stackoverflow.com/comment/45864596
has body: I have an issue about prev object on jquery it doesnt give me position ... I have divs with ".post-image" $(".post-image").each(function(){ var div = $(this); var index = div.index(); var odd = index % 2; if(odd == 1){ var sibling = div.next(); sibling.css({ margin:"15px", marginTop:"-165px" }) var bElement= div.prev(".post-image"); console.log(bElement) }) HTML: I cant select prev as an object
has comment: http://stackoverflow.com/comment/45864020
tagged with: javascript
tagged with: jquery
tagged with: selector
has comment: http://stackoverflow.com/comment/45864318
type: Question
has comment: http://stackoverflow.com/comment/45863738
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28794924
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45863855
has comment: http://stackoverflow.com/comment/45863809
has comment: http://stackoverflow.com/comment/45863827
has comment: http://stackoverflow.com/comment/45863899
has comment: http://stackoverflow.com/comment/45863737
answer count: 1
tagged with: object
has comment: http://stackoverflow.com/comment/45864082
has comment: http://stackoverflow.com/comment/45863770
score: 0
has comment: http://stackoverflow.com/comment/45864820

http://stackoverflow.com/comment/45934623
has text: Why don't you just use a config file?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28832102
score: 0

http://stackoverflow.com/comment/45841939
score: 0
comment on: http://stackoverflow.com/q/28782535
type: Comment
type: QuestionComment
has text: I solved this problem. Thank you for your answers. Specially @vohuman . Thanks for your hint.

http://stackoverflow.com/q/28904932
type: Question
has comment: http://stackoverflow.com/comment/46069496
answer count: 2
tagged with: http-post
tagged with: canvas
has comment: http://stackoverflow.com/comment/46069616
downvote count: 0
tagged with: javascript
has body: This is a very specific problem, and I am yet to find anyone else asking it. Basically I have a servlet that accepts some parameters and returns a PNG image. I know the servlet works because if I open the page itself with the given parameters, the file is created and downloaded successfully. I need some way of taking this generated PNG and load it into an HTML5 Canvas. I do NOT have access to changing the servlet and it has to be a POST request as it was not designed by me. My code is essentially just a jQuery post request at this point but here it is: $.post("../dgexport?format=png", { data: localStorage.getItem("dg::export"), responseType: "blob", }, function(res){ loadCanvas(res); }); function loadCanvas(image) { var canvas = document.getElementById('myCanvas'); var context = canvas.getContext('2d'); // load image context.drawImage(image, 0, 0); } When I open up the console and look at the data response of the POST request it looks like in the console: �PNG↵↵IHDR��lD�V pHYs�� IDATx��~---���088'���� IDAT��?��q%� (this is not the whole thing but I'm hoping it's enough to give a hint to anyone willing to help) Any help would be greatly appreciated! I've tried a lot of different methods and I'm really stumped on this one.
score: 1
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28905345
favorite count: 0
has comment: http://stackoverflow.com/comment/46069538
tagged with: ajax
has answer: http://stackoverflow.com/a/28905586
has answer: http://stackoverflow.com/a/28905345
type: AnsweredQuestion
has title: PNG from Post Request loading into Canvas
has comment: http://stackoverflow.com/comment/46069286
linked to: http://stackoverflow.com/q/17657184
upvote count: 1
accepted answer: http://stackoverflow.com/a/28905586

http://stackoverflow.com/comment/45867356
type: Comment
comment on: http://stackoverflow.com/a/28792933
has text: I just want ***simple*** typewriter effect.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45818049
type: AnswerComment
comment on: http://stackoverflow.com/a/28760618
score: 0
type: Comment
has text: Appreciate your feedback on second approach. IanB's solution provides good practise while changing password, but I still not getting the logic when the user logs out. As you explained, when the user logs out, he has to log out only in the current system, how can I achieve that?

http://stackoverflow.com/comment/46019296
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28878591
type: AnswerComment
has text: I don't fully understand why you have to do it by means of low-level DOM manipulation as long as you've got the Angular template mechanics and 2-way data binding, but I suggest you wrap your call to printElement(...) within a `$scope.$apply` call like this: $scope.$apply(function() { printElement($window.document.getElementById('detailPrint')); });

http://stackoverflow.com/a/28823384
type: Answer
has body: Yes it is possible but its extremely hacky using document.elementFromPoint(x,y) So you would iterate through the bounding box of your div query the screen buffer, and collect the elements returned. see http://developer.mozilla.org/En/DOM:document.elementFromPoint for more detailed API documentation
answers question: http://stackoverflow.com/q/28823277
score: 0

http://stackoverflow.com/comment/46046310
has text: @shyama just try use data instead of data.result ?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28892911
score: 0

http://stackoverflow.com/comment/46016273
score: 0
type: Comment
has text: I'm using jquery-1.11.1.js file
type: AnswerComment
comment on: http://stackoverflow.com/a/28843603

http://stackoverflow.com/a/28809245
answers question: http://stackoverflow.com/q/28809100
has comment: http://stackoverflow.com/comment/45890837
type: Answer
score: 2
upvote count: 2
has body: for start of week use this var startDay = 0; var d =today.getDay(); var weekStart = new Date(today.valueOf() - (d&lt;=0 ? 7-startDay:d-startDay)*86400000); //rewind to start day var nextweekStart =new Date(weekStart.valueOf() + (7)*86400000);//get first day of next week var prevweekStart =new Date(weekStart.valueOf() - (7)*86400000);//get first day of prev week if startDay =0; return sunday then use 1 instead of 0 as: //0=sunday, 1=monday etc.
downvote count: 0

http://stackoverflow.com/q/28815941
has title: Best way to get all required inputs
possible better answer: http://stackoverflow.com/a/28816102
type: AnsweredQuestion
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28816102
tagged with: validation
has answer: http://stackoverflow.com/a/28816032
accepted answer: http://stackoverflow.com/a/28816032
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45903659
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I have form, where exist few required fields Example Password * Email * Full name* Nick name Problem, i don't know what is correct way to get all required fields as they don't have required attribute or class. Only labels have required class, which means "this input is required"
has comment: http://stackoverflow.com/comment/45903849

http://stackoverflow.com/comment/45962743
has text: yes "But i need to remove that message, i need only working effects with error button" explain this
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28846908
type: QuestionComment

http://stackoverflow.com/comment/45977104
score: 0
type: AnswerComment
type: Comment
has text: @somethinghere pardon me for using regex, Sir :-)
comment on: http://stackoverflow.com/a/28854455

http://stackoverflow.com/a/28809393
answers question: http://stackoverflow.com/q/28809065
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/58965931
has body: JavaScript is returning the correct result for GMT, but you are expecting another time zone. You have to fix the result yourself. If you are ok with trusting whatever settings JavaScript is using the determine the local time, you can use: (New Date()).getTimezoneOffset() This method returns minutes so you need to multiply the returned value by 60 before subtracting it from the unix timestamp.
accepted answer of: http://stackoverflow.com/q/28809065
has comment: http://stackoverflow.com/comment/45891278

http://stackoverflow.com/comment/46082225
type: Comment
comment on: http://stackoverflow.com/a/28898441
type: AnswerComment
has text: I don't see any external library involved. Anyways it's not a problem at the moment. Was just curious.
score: 0

http://stackoverflow.com/comment/45796536
has text: I'm having a hard time understanding what problem you're trying to solve with this. Could you simplify the problem?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28757901
score: 0

http://stackoverflow.com/q/28792931
score: 0
answer count: 1
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: I'm trying to add bootstrapvalidation to my website signup form but I'm not getting it to work need help please. Here is the form code: If any one can help me fix this I will be really greatful, Thanks. $(document).ready(function() { $('#tryitForm').bootstrapValidator({ feedbackIcons: { valid: 'glyphicon glyphicon-ok', invalid: 'glyphicon glyphicon-remove', validating: 'glyphicon glyphicon-refresh' }, fields: { firstName: { validators: { notEmpty: { message: 'The first name is required and cannot be empty' } } }, lastName: { validators: { notEmpty: { message: 'The last name is required and cannot be empty' } } }, email: { validators: { notEmpty: { message: 'The email address is required' }, emailAddress: { message: 'The input is not a valid email address' } } }, gender: { validators: { notEmpty: { message: 'The gender is required' } } } }, submitHandler: function(validator, form, submitButton) { var fullName = [validator.getFieldElements('firstName').val(), validator.getFieldElements('lastName').val()].join(' '); alert('Hello ' + fullName); } }); }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;form id="tineyForym2" name="form1" method="post" action="#" enctype="multipart/form-data"&gt; &lt;input type="hidden" value="" name="user_id"&gt; &lt;input type='hidden' name='action' value='edit' &gt; &lt;table border="0" cellSpacing="1" cellPadding="3" class="table" id='dynamic_form'&gt; &lt;tr&gt; &lt;td class="dynamic_form_field"&gt; &lt;cite&gt;*&lt;/cite&gt;First Name &lt;/td&gt; &lt;td class="dynamic_form_value"&gt; &lt;input name="FirstName" class="form-control" value="" type="text" id="firstname" data-toggle="tooltip" data-placement="bottom" title="Enter your First name!"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="dynamic_form_field"&gt; &lt;cite&gt;*&lt;/cite&gt;Last Name &lt;/td&gt; &lt;td class="dynamic_form_value"&gt; &lt;input name="LastName" class="form-control" value="" type="text" data-tog…
type: Question
has comment: http://stackoverflow.com/comment/45865801
has title: BootstrapValidation is not working for me please see this code
has answer: http://stackoverflow.com/a/28793928
tagged with: javascript
has comment: http://stackoverflow.com/comment/45860686

http://stackoverflow.com/comment/45905274
has text: Travis I don't care that much as it's to fail fast. It won't run in production env
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28815690
type: Comment

http://stackoverflow.com/comment/45998204
comment on: http://stackoverflow.com/q/28866366
score: 0
type: QuestionComment
has text: Can you show the line in your code, where you have the selection...append("rect")...?
type: Comment

http://stackoverflow.com/comment/46534413
has text: its not inserting the js that is the problem, its just that every thing i've tried does not work for clicking that button.
comment on: http://stackoverflow.com/a/29124135
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/28778181
has body: I am working with Backbone and before I worked with Jquery, before I used HTML Elements attributes as a variable to set data and when I need that information that was accessible in that HTML element. For example: I had a image gallery and as you know each Image should have a title, Alt, src these are originally from HTML but I added a new attribute what called mk-author, mk was a prefix and when user clicked on that a image, The image maximized and the name of author will show beside of Image. sometimes I get the ID and do something maybe on server-side and of curse I validate it from server-side. Questions: 1-Is this a secure, good way? 2-What is the betterway?
tagged with: http://stackoverflow.com/tag/html
upvote count: 0
downvote count: 1
has title: better way to get data from a web page instead of working on DOM and HTML Elements
type: AnsweredQuestion
score: -1
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28786788
accepted answer: http://stackoverflow.com/a/28786788
linked to: http://stackoverflow.com/q/28734575
favorite count: 0
tagged with: backbone.js

http://stackoverflow.com/comment/46146271
score: 0
comment on: http://stackoverflow.com/a/28942519
type: AnswerComment
type: Comment
has text: Thanks for your help. I will try your code in a min and get back to you.

http://stackoverflow.com/comment/47716847
type: Comment
has text: @Manam, Could you solve your problem. I am facing a similar problem and looking for solutions.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28791710

http://stackoverflow.com/q/28782838
type: Question
has title: Reading Text Between Tags
has answer: http://stackoverflow.com/a/28782904
upvote count: 2
answer count: 1
tagged with: dom
accepted answer: http://stackoverflow.com/a/28782904
type: AnsweredQuestion
score: 2
downvote count: 0
tagged with: javascript
favorite count: 0
has body: I am trying to parse some poorly written HTML that follow the below structure. stuff Lets just put text here more stuff And here too!!! even more stuff Essentially, text is between pairs of tags. I am trying to ONLY get the "Lets just put text here" and "And here too!!!" text with JavaScript. Suggestions? Thanks.

http://stackoverflow.com/q/28826002
answer count: 2
tagged with: jquery-selectors
has title: Javascript Selector for Collections?
tagged with: javascript
has answer: http://stackoverflow.com/a/28826082
score: 0
has answer: http://stackoverflow.com/a/28826022
type: UnansweredQuestion
type: Question
has body: I have this Javascript call: SomeFunction('select#UserInformations_0__CountryId', somefunction(0)); SomeFunction('select#UserInformations_1__CountryId', somefunction(1)); SomeFunction('select#UserInformations_2__CountryId', somefunction(2)); Is there any way where I can make the id selector as a template? I currently have a form that gets populated based on a select control selection. Wondering if there's a way to make this more flexible, without exhausting all possible number of indices? I am working on calling a div based on model collection. When there was a 1:1 relationship between the parent and the child object, the call works well. But as we introduced 1:many, this has been a struggle to implement. I am not really a javascript guy, the original call is something like this and I just wanted to make it work. I was thinking if the "UserInformations_CountryId" can be make into a template or regular expression. $(document).ready(function () { SomeFunction('select#UserInformations_CountryId', somefunction()); // above line works before. I just need to make it work for multiple instances }

http://stackoverflow.com/a/41837682
answers question: http://stackoverflow.com/q/28820293
score: 9
downvote count: 0
type: Answer
has body: What I did is kind of a hack but works quite well as a workaround solution. I've got a simple textarea (not contenteditable because of what's next, I'll explain below) and a div which is absolute positioned behind the textarea. Using javascript, I copy the content from the textarea to the div while splitting it at 140 chars and putting all extra characters inside an tag. Well, it's a little bit more complicated because twitter algorithm to compute a tweet length is different (links doesn't count as their real value, because of t.co url shortening). The exact method can be found as part of the official twitter/twitter-txt repository. Step-by-step code. Wrap a simple textarea into a div to simplify the css: This is some text that will be highlight when longer than 20 characters. Like twitter. Type something... CSS is just making the textarea and the div right above each other and highlight the text. .tweet-composer { position: relative; z-index: 1; } .js-keeper-editor, .js-keeper-placeholder-back { background: transparent; border: 1px solid #eee; font-family: Helvetica, Arial, sans-serif; font-size: 14px; /* Same font for both. */ margin: auto; min-height: 200px; outline: none; padding: 10px; width: 100%; } .js-keeper-placeholder-back { bottom: 0; color: transparent; left: 0; position: absolute; top: 0; white-space: pre-wrap; width: 100%; word-wrap: break-word; z-index: -1; } .js-keeper-placeholder-back em { background: #fcc !important; } Now the fun part, this is implemented using jQuery but that's not the important thing. if (0 > remainingLength) { // Split value if greater than var allowedValuePart = currentValue.slice(0, realLength), refusedValuePart = currentValue.slice(realLength) ; // Fill the hidden div. $placeholderBacker.html(allowedValuePart + '' + refusedValuePart + ''); } else { $placeholderBacker.html(''); } Add some event handler on change, and te common document ready and you're done. See the codepen link below. Note that the div placed behind can be c…
has comment: http://stackoverflow.com/comment/70912266
upvote count: 9

http://stackoverflow.com/comment/45898068
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28811565
has text: @NewDev It's only changing views. (Using angular-ui-router btw)
score: 0

http://stackoverflow.com/q/28831263
tagged with: variables
has comment: http://stackoverflow.com/comment/45934339
has answer: http://stackoverflow.com/a/28831379
has answer: http://stackoverflow.com/a/28831332
favorite count: 0
has body: I have two variables that are counting the amount of times two functions are being run. I was wondering whether there is anyway I could work out a percentage from these and then display it on the page? for example var win = 10; var lose = 10; percentage would be 50% but unsure how to do this with javascript?
type: UnansweredQuestion
answer count: 4
score: -5
tagged with: percentage
has title: how to work out percentage from two variables in javascript?
type: Question
has comment: http://stackoverflow.com/comment/45932259
has answer: http://stackoverflow.com/a/28831347
upvote count: 0
has answer: http://stackoverflow.com/a/28831321
downvote count: 5
tagged with: javascript

http://stackoverflow.com/comment/45801225
type: Comment
type: QuestionComment
has text: The identifier is searchId. I was assuming I could pull that out of the view and pass it to the controller, but I'm not sure exactly how to do that. DO I pass an object or just the id? Any ideas of the syntax from the controller where we pass the objects into the view and repeat over them and how to get that id back into the delete method? I'm not sure of how to do that. I wish the tutorials I used would have had some insight into that. BUt they kind of left me hanging even well before the point I'm But I know Im very close.
comment on: http://stackoverflow.com/q/28760281
score: 0

http://stackoverflow.com/q/28753501
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45799869
has title: Binding between parent and child relation directives
score: 1
upvote count: 1
tagged with: angularjs-scope
type: Question
tagged with: angularjs-directive
downvote count: 0
tagged with: javascript
answer count: 1
has answer: http://stackoverflow.com/a/28753654
has body: I have two directives in parent and child relation , each one has link implementation . The parent set a scope variant - name , which is passed to the child as attribute . The order of the links execution is - firstly - the child link and then the parent link . After the parent link finish execution it broadcast to its child , but seems the child doesn't got this scope changes yet . Here Example - var myAppModule = angular.module('myAppModule', []). directive('parent',function($parse){ return { restrict: 'E', link: function(scope) { scope.name = "Dan"; console.log("parent: My name is "+scope.name); scope.$broadcast("ready"); } } }) .directive('child',function($parse){ return { restrict: 'E', scope: { name: '=' }, link: function(scope) { scope.$on("ready",function () { console.log("child: My name is "+scope.name); }) } } }); &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.7/angular.min.js"&gt;&lt;/script&gt; &lt;parent&gt; &lt;child name="name"&gt; &lt;/child&gt; &lt;/parent&gt; it logs - parent: My name is Dan child: My name is undefined Why the child didn't consider the change in name after the broadcast ? Does it because the $digest didn't called yet for this Angular turn ?
favorite count: 0
linked to: http://stackoverflow.com/q/28752567
tagged with: angularjs

http://stackoverflow.com/a/28784911
accepted answer of: http://stackoverflow.com/q/28784562
has body: You can use this sequence: $('.click').on('click', function () { $('.section').slideUp(4500, function () { $(this).find('p').html('two'); $('.section').slideDown(500) }); }); jsFiddle example
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28784562
score: 1
upvote count: 1

http://stackoverflow.com/comment/46011195
has text: Can't believe that. How do you display 2000 Items at once in a view Port? Lets say, one item = one row. One item = 1px height, so your viewport is minimum (X)*2000 height? For sure, your problem is jQuery here.
comment on: http://stackoverflow.com/q/28873796
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28822298
downvote count: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45916283
tagged with: jquery
has title: overflow-y: scroll causing issues with JQuery
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has comment: http://stackoverflow.com/comment/45916346
has comment: http://stackoverflow.com/comment/45916371
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45916312
upvote count: 1
tagged with: css
has comment: http://stackoverflow.com/comment/45916172
has answer: http://stackoverflow.com/a/28822359
score: 1
has body: When I add overflow-y:scroll to the .nav styling the button to open the navigation requires 2 clicks. Change this to overflow: none and it only requires 1 click as intended when using the following jquery: $(function(){ var nav = $('.nav'), navBut = $('.navBut'); navBut.click(function(){ if(nav.width() === 0){ nav.stop().animate({ width: '15%', opacity: '1.0' }, 300); } else { nav.stop().animate({ width: '0', opacity: '0.0' }, 300); } }); Can anybody see why this would be the case or how I can solve this? http://jsfiddle.net/9ubxyw0t/2/
type: Question

http://stackoverflow.com/q/28807016
tagged with: string
possible better answer: http://stackoverflow.com/a/28807143
favorite count: 0
has answer: http://stackoverflow.com/a/28807143
has title: Get duplicate characters count in a string
accepted answer: http://stackoverflow.com/a/28807179
type: AnsweredQuestion
type: Question
score: 5
linked to: http://stackoverflow.com/q/18619785
upvote count: 5
tagged with: javascript
has body: Can anyone help me to get the count of repeated characters in a given string in javascript. For example, "abccdef" -&gt; 1 (Only "c" repeated) "Indivisibilities" -&gt; 2 ("i" and "s" repeated) Thank You
duplicate of: http://stackoverflow.com/q/18619785
has answer: http://stackoverflow.com/a/28807179
answer count: 2
downvote count: 0

http://stackoverflow.com/q/28779697
type: UnansweredQuestion
tagged with: requirejs
type: Question
has title: How to fix the Javascript "anonymous function"
answer count: 1
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28779772
tagged with: reveal.js
has body: I want to design some slides by Javascript, and use the Reveal library and follow the template https://github.com/hakimel/reveal.js/blob/master/index.html and plan to embed a charts into the slides by echarts library and follow this demo http://ecomfe.github.io/echarts/doc/start-en.html I put these two library as follow directory without any change of echarts/reveal library. |--echarts-2.2.0 |--reveal.js \--mySlides.html When I merged these two demo together, I got the "anonymous function" of "require.config". No idea how to debug it. Anyone can help it? Thanks. Uncaught ReferenceError: Reveal is not defined (anonymous function) mySlides.html:36 mySlides.html reveal.js - The HTML Presentation Framework Page2

http://stackoverflow.com/q/28904310
accepted answer: http://stackoverflow.com/a/28931760
possible better answer: http://stackoverflow.com/a/28904848
has title: If React.js is the V, in the MVC, what are the other letters?
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28931760
upvote count: 2
has body: I'm learning React but I'm still unsure on how to grow it up into a full-fledged app. For the M and the C, what frameworks are cool to use with it? What if I want to go functional? Should I just use jQuery? What about Routes, Ajax and the other things that many frameworks offers us?
type: Question
has answer: http://stackoverflow.com/a/28904848
tagged with: javascript
has comment: http://stackoverflow.com/comment/46077096
tagged with: reactjs
answer count: 2
downvote count: 0
favorite count: 0

http://stackoverflow.com/comment/46037754
type: Comment
has text: Or you could create a method for it when you calll `ng-click="setSport(true)"` and in your controller have `$scope.setSport = function(var setting){$scope.sport.checked = setting}`. This is all very basic stuff that is handled in the angularjs tutorial
comment on: http://stackoverflow.com/a/28888061
score: 1
type: AnswerComment

http://stackoverflow.com/q/28816495
type: Question
tagged with: javascript
tagged with: jquery
has body: I want to hide a large number of images on the html page. While using fancybox-thumbnail to show there are other images to view. Goal is to have the page look clean and not cluttered with a bunch of images. But it's not working, not sure if it's something conflicting or does this idea not work and I HAVE to show the other images on the page. HEAD Tags: BODY Tags:
has comment: http://stackoverflow.com/comment/45905377
has comment: http://stackoverflow.com/comment/45905300
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45905220
answer count: 1
tagged with: fancybox
downvote count: 0
has comment: http://stackoverflow.com/comment/45905799
has answer: http://stackoverflow.com/a/28817482
favorite count: 0
has comment: http://stackoverflow.com/comment/45904866
upvote count: 1
has title: Hide other images while running fancybox-thumb
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45905098
score: 1
accepted answer: http://stackoverflow.com/a/28817482

http://stackoverflow.com/comment/45997856
type: Comment
comment on: http://stackoverflow.com/a/28778298
has text: So, What is your currently problem? If you can to read the cookie, the "validateMySecretAsync" method can does check it with JWT.
type: AnswerComment
score: 0

http://stackoverflow.com/q/28835080
accepted answer: http://stackoverflow.com/a/28835222
has comment: http://stackoverflow.com/comment/45939850
score: 0
has comment: http://stackoverflow.com/comment/45940266
answer count: 1
tagged with: google-chrome-extension
has body: Basically, there is a stored primitive I would like to set as a value of a jQuery UI Tab setting: $("#tabs").tabs({ active: chrome.storage.local.get("idx", function(obj){ console.log(obj["idx"])}); // returns primitive integer I want. }), ... }); The standard chrome-storage-get protocol is quite convoluted and I am unsure how I can simply set the object property value itself to be the value of active: rather than the object. active: 3 // chrome.storage.local.get("idx") Any way to do this?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45939758
has answer: http://stackoverflow.com/a/28835222
tagged with: google-chrome-storage
type: Question
tagged with: javascript
has title: Get primitive value from chrome.storage.local

http://stackoverflow.com/comment/45809398
type: QuestionComment
has text: Are you using a transpiler?
comment on: http://stackoverflow.com/q/28760363
score: 0
type: Comment

http://stackoverflow.com/a/28808741
has body: Download these files from the url --> By appending the url http://fancyapps.com/ e.g http://fancyapps.com/fancybox/source/jquery.fancybox.css?v=2.1.5 and then include all these files in your project folder. It will work :)
has comment: http://stackoverflow.com/comment/45890669
has comment: http://stackoverflow.com/comment/45890379
has comment: http://stackoverflow.com/comment/45890721
score: 0
answers question: http://stackoverflow.com/q/28807078
has comment: http://stackoverflow.com/comment/45890519
has comment: http://stackoverflow.com/comment/45890293
type: Answer

http://stackoverflow.com/comment/45849205
comment on: http://stackoverflow.com/q/28784720
score: 0
type: Comment
type: QuestionComment
has text: @Bergi - Thanks. The code in that second block was trying to articulate what I want, not what I think I have.

http://stackoverflow.com/comment/45828790
type: QuestionComment
comment on: http://stackoverflow.com/q/28773807
has text: A singleton what? What type of object is it? What does it do? What methods does it have? What relation does it have to the socket? A singleton ONLY means that there's only one of them. It doesn't tell us what type of object it is and what it's purpose is and how it's used? You're only disclosing about 1/3 of the relevant issue here.
score: 0
type: Comment

http://stackoverflow.com/comment/45913757
type: Comment
comment on: http://stackoverflow.com/a/28820869
has text: Sorry, didn't really understand what you meant until I read it a few more times. What's preventing you from "filtering" with javascript? How are you able to use javascript in the first place?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45807571
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28764280
has text: It is not possible to inject scripts to the pages you don't own. EDIT: You might try to use Bookmarklets - http://en.wikipedia.org/wiki/Bookmarklet - but they can only operate on functions available on the parent page.
type: AnswerComment

jquery-ui
tags question: http://stackoverflow.com/q/28826831
tags question: http://stackoverflow.com/q/28833013
tags question: http://stackoverflow.com/q/28876976
tags question: http://stackoverflow.com/q/28827401
tags question: http://stackoverflow.com/q/28800492
tags question: http://stackoverflow.com/q/28784761
tags question: http://stackoverflow.com/q/28892720
tags question: http://stackoverflow.com/q/28767137
tags question: http://stackoverflow.com/q/28880742
tags question: http://stackoverflow.com/q/28811363
tags question: http://stackoverflow.com/q/28764558
tags question: http://stackoverflow.com/q/28851782
tags question: http://stackoverflow.com/q/28887623
tags question: http://stackoverflow.com/q/28808928
tags question: http://stackoverflow.com/q/28880643
tags question: http://stackoverflow.com/q/28878784
tags question: http://stackoverflow.com/q/28776413
tags question: http://stackoverflow.com/q/28899923
tags question: http://stackoverflow.com/q/28854253
tags question: http://stackoverflow.com/q/28895845
tags question: http://stackoverflow.com/q/28886278
tags question: http://stackoverflow.com/q/28837868
tags question: http://stackoverflow.com/q/28872084
tags question: http://stackoverflow.com/q/28854577
tags question: http://stackoverflow.com/q/28821880
tags question: http://stackoverflow.com/q/28829681
tags question: http://stackoverflow.com/q/28779345
tags question: http://stackoverflow.com/q/28786223
tags question: http://stackoverflow.com/q/28875089
tags question: http://stackoverflow.com/q/28836763
tags question: http://stackoverflow.com/q/28877417
tags question: http://stackoverflow.com/q/28826213
tags question: http://stackoverflow.com/q/28893206
tags question: http://stackoverflow.com/q/28787847
tags question: http://stackoverflow.com/q/28904710
tags question: http://stackoverflow.com/q/28810807
type: Tag
tags question: http://stackoverflow.com/q/28835535
tags question: http://stackoverflow.com/q/28791521
tag name: jquery-ui
tags question: http://stackoverflow.com/q/28801104
tags question: http://stackoverflow.com/q/28753503
tags question: http://stackoverflow.com/q/28889828
tags question: http://stackoverflow.com/q/28902100
tags question: http://stackoverflow.com/q/28814435
tags question: http://stackoverflow.com/q/28806932
tags question: http://stackoverflow.com/q/28808862
tags question: http://stackoverflow.com/q/28761951

http://stackoverflow.com/comment/45805546
score: 0
type: Comment
type: QuestionComment
has text: try ``alert(JSON.stringify(formName))`` to see what is coming
comment on: http://stackoverflow.com/q/28762973

http://stackoverflow.com/comment/46044348
score: 1
comment on: http://stackoverflow.com/q/28891689
has text: Why is an HTML5 (bad term, btw) solution not useful for you?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45831452
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28776610
score: 1
has text: They are testing it. When it becomes available for everyone it will be announced on developers.facebook.com

http://stackoverflow.com/comment/46018841
type: Comment
has text: Thanks for the suggestion. What's the point of having `name="theForm"` then?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28877106

deferred-loading
type: Tag
tag name: deferred-loading
tags question: http://stackoverflow.com/q/28893519

http://stackoverflow.com/q/28825011
tagged with: meteor
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/45920878
has body: I'm curious to know how you would implement something like Twitter's "View x new Tweets" functionality. Tweets being any data (blog posts, news items etc). eg: see here. Meteor by nature will pump any new data from a Subscription straight into your templates. While cool, sometimes you want to user to decide when new information should be shown. My first thought is you would need two subscriptions: Subscription 1: Returns all posts from now (timestamp) backwards. Subscription 2: Returns a counter for all posts from now (timestamp) forwards. So when you output the posts in your template you use subscription 1. which wont change because the timestamp locks it. However to show the number of new posts available "View x number of new Posts" you would use subscription 2. since it is always looking for new posts. When the user clicks "View x new Posts" you simply update the first subscription to use the current timestamp. This would return all the latest in the new posts into your template. Does this approach sound logical?
upvote count: 1
tagged with: mongodb
answer count: 0
downvote count: 0
has title: Meteor implementation of 'View x new Tweets'
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45925801
score: 1

http://stackoverflow.com/comment/100603502
score: 0
comment on: http://stackoverflow.com/a/28878025
type: Comment
has text: It returns me this error :-- Cannot read property 'ColumnChart' of undefined TypeError: Cannot read property 'ColumnChart' of undefined
type: AnswerComment

http://stackoverflow.com/comment/45985507
comment on: http://stackoverflow.com/q/28859926
type: Comment
score: 1
has text: `video_data[link] = data.response;`
type: QuestionComment

http://stackoverflow.com/comment/46058158
score: 0
type: AnswerComment
has text: Would help to see a graph depicting the parent relations you need.
type: Comment
comment on: http://stackoverflow.com/a/28890866

http://stackoverflow.com/comment/45956180
type: Comment
comment on: http://stackoverflow.com/a/28843604
has text: Sorry, my bad. However, `data` is already an object, so it can't be parsed.
score: 0
type: AnswerComment

http://stackoverflow.com/q/28767843
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45814535
upvote count: 0
has title: Using a ternary expression inside append()
type: Question
has comment: http://stackoverflow.com/comment/45814529
score: -1
has comment: http://stackoverflow.com/comment/45814460
has comment: http://stackoverflow.com/comment/45814444
answer count: 1
downvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45814489
has answer: http://stackoverflow.com/a/28767970
accepted answer: http://stackoverflow.com/a/28767970
has body: I trying to using ternary expression inside the jQuery append(). I have checked in the console and no error was showing. The problem is that the tr doesn't append to tbody. $(".invoice table tbody").append(" \ " + price.toFixed(0) == 0 ? Obs : 1 + " \ " + price.toFixed(2) + " \ \ ");
has comment: http://stackoverflow.com/comment/45814377
tagged with: lambda

http://stackoverflow.com/comment/45969668
score: 0
comment on: http://stackoverflow.com/q/28851242
has text: Why need to redirect. Just hide link and show button.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45812233
comment on: http://stackoverflow.com/q/28766628
score: 0
type: Comment
type: QuestionComment
has text: Would it work if you make world an Object with key being `X;Y`: `world = {}; world['-10;-10'] = 0`? Or make objects of objects, so `world[10][10]` would work kind of like an array.

http://stackoverflow.com/a/28766380
answers question: http://stackoverflow.com/q/28766338
downvote count: 0
type: AcceptedAnswer
score: 4
type: Answer
upvote count: 4
accepted answer of: http://stackoverflow.com/q/28766338
has body: It doesn't. When you output an object with console.log, the object is output "by reference"; the values in the console are dynamic, and they will update to reflect the current state of the object. If you want to output a static string of text about the object, use console.dir

http://stackoverflow.com/comment/45859712
type: QuestionComment
has text: With onclick="fetch_records('page1')" it would be so much simpler :-)
score: 0
comment on: http://stackoverflow.com/q/28791968
type: Comment

http://stackoverflow.com/a/28845628
score: 4
answers question: http://stackoverflow.com/q/28836120
upvote count: 4
accepted answer of: http://stackoverflow.com/q/28836120
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: There used to be a section in the manual that explicity stated that DBRef is not supported under the aggregation framework, along with various other BSON types. The old passage read as shown in this google groups archive message: Warning: The pipeline cannot operate on values of the following types: Binary, Symbol, MinKey, MaxKey, DBRef, Code, and CodeWScope. It might still be there somewhere but I just cannot seem to find it right now :) Also as aluded to in that message thread is that aside from this not being supported in the aggregation framework, then your other option ( and only real option for aggregation ) is to use the mapReduce method instead. As a shell example: db.Products.mapReduce( function() { emit( this.model.$id, { "actives": [this.isActive] } ); }, function(key,values) { var result = { "actives": [] }; values.forEach(function(value) { value.actives.forEach(function(active) { result.actives.push( active ); }); }); }, { "out": { "inline": 1 } } ) It doesn't look as nice because of the arbitrary { "_id": "", "value": { } } structure of mapReduce results, but it does allow the sort of aggregation you are looking for. There is also reference to this JIRA Issue: SERVER-14466, but I would not hold out for much movement on that front. So you can use mapReduce but it would be advised to move away from using DBRef and define an alternate form of "manual references" either embedding "collection" and "database" information or relying on external definition of such things in your application schema, depending on your needs. As long as you follow the same rules there then you can use the aggregation framework for anything with valid property names.

http://stackoverflow.com/q/28903369
tagged with: http://stackoverflow.com/tag/html
has body: I have a JS function called getQuery which I call from my HTML, but for some reason the browser can't find the script. I have tried putting it in the and but doesn't seem to want to work. Can someone tell me the proper placement of the script for this web-page, or how the script needs to be loaded? This is how I call the function: The error: Uncaught ReferenceError: getQuery is not defined
has title: Proper script placement for function call in Javascript
has comment: http://stackoverflow.com/comment/46066176
has comment: http://stackoverflow.com/comment/46066430
has comment: http://stackoverflow.com/comment/46066225
has answer: http://stackoverflow.com/a/28903911
type: Question
score: 0
has answer: http://stackoverflow.com/a/28903554
has comment: http://stackoverflow.com/comment/46066478
has comment: http://stackoverflow.com/comment/46066183
has comment: http://stackoverflow.com/comment/46066273
has comment: http://stackoverflow.com/comment/46066700
answer count: 3
has comment: http://stackoverflow.com/comment/46066482
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46066180
has answer: http://stackoverflow.com/a/28903605
has comment: http://stackoverflow.com/comment/46066224

http://stackoverflow.com/comment/45980047
has text: As far as I was aware you cannot cancel an ajax request once it's been sent. Why this is the case I don't know, but I would certainly love to be proved wrong!
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28856967

http://stackoverflow.com/comment/46036283
comment on: http://stackoverflow.com/q/28833403
score: 0
type: Comment
type: QuestionComment
has text: Ymm. I tried your code on Firefox. It`s probably working but i have a security error. Because i can`t send value from inputs to http website. I tried also this code on Chrome. I have a error : Uncaught ReferenceError: GM_xmlhttpRequest is not defined. Functios GM is for Firefox only, right ? Sorry for stupid question but i am new in programming world. Regards

http://stackoverflow.com/a/28851460
has comment: http://stackoverflow.com/comment/45971181
has comment: http://stackoverflow.com/comment/45970024
downvote count: 0
answers question: http://stackoverflow.com/q/28851316
has comment: http://stackoverflow.com/comment/45970557
type: Answer
upvote count: 2
score: 2
has body: Use this Demo here $('.datepicker').datepicker(); $('.datepicker').datepicker('setDate', '1/1/1970'); $('.datepicker').click(function(){ var myDate = new Date() ; $('.datepicker').datepicker('setDate', myDate); });

http://stackoverflow.com/q/28787030
linked to: http://stackoverflow.com/q/16825290
score: -2
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/28787305
upvote count: 0
favorite count: 0
downvote count: 2
has body: I'm trying to add 3 locations to a Google map I have embedded in a website I am working on. Right now the map is working as intended with the single location pin. Is there a way to modify the js file to add the additional points? // ========== START GOOGLE MAP ========== // function initialize() { var myLatLng = new google.maps.LatLng(30.227686, -81.386146); var mapOptions = { zoom: 14, center: myLatLng, disableDefaultUI: true, scrollwheel: false, navigationControl: false, mapTypeControl: false, scaleControl: false, draggable: true, mapTypeControlOptions: { mapTypeIds: [google.maps.MapTypeId.ROADMAP, 'roadatlas'] } }; var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); var marker = new google.maps.Marker({ position: myLatLng, map: map, icon: 'img/location-icon.png', title: '', }); var contentString = ' '+ ' '+ ' Location 1 Ponte Vedra Office ' + ' 103 B Solana Road ' + 'Ponte Vedra, FL 32082 ' + 'Phone: 904-273-2717 '+ ' '+ ' '; var infowindow = new google.maps.InfoWindow({ content: contentString }); google.maps.event.addListener(marker, 'click', function() { infowindow.open(map,marker); }); var styledMapOptions = { name: 'US Road Atlas' }; var usRoadMapType = new google.maps.StyledMapType( roadAtlasStyles, styledMapOptions); map.mapTypes.set('roadatlas', usRoadMapType); map.setMapTypeId('roadatlas'); } google.maps.event.addDomListener(window, "load", initialize); // ========== END GOOGLE MAP ========== // I am trying to include these 3 latitude/longitude sets on my map: (30.227686, -81.386146) (30.650060, -81.455185) (30.056330, -81.535824) Thanks!
type: AnsweredQuestion
has title: Adding multiple locations to google js map
possible better answer: http://stackoverflow.com/a/28787305
has answer: http://stackoverflow.com/a/28787726
accepted answer: http://stackoverflow.com/a/28787726
type: Question
has comment: http://stackoverflow.com/comment/45851085
tagged with: google-maps

http://stackoverflow.com/q/28841330
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/45952072
type: AnsweredQuestion
score: 3
upvote count: 3
type: Question
possible better answer: http://stackoverflow.com/a/49005419
has answer: http://stackoverflow.com/a/28841682
answer count: 2
has answer: http://stackoverflow.com/a/49005419
has title: Get the state of the clicked toolbar button in CKEitor
tagged with: javascript
tagged with: ckeditor
accepted answer: http://stackoverflow.com/a/28841682
has body: I am attempting to disable a button that exists on my JSP page, outside of the CKEditor dialog. Specifically, when the "Source" button on the CKEditor toolbar is clicked I would like to run some code that simply disables a "Publish" button on my web page - don't allow publish to occur if the HTML source code is available for editing. I have tried Event Delegation that was suggested in this SO posting. This would work except that with the CKEditor Source button, the class changes from "cke_button_off" to "cke_button_disabled" to "cke_button_on" as it completes its work. The code presented Manwal in the referenced SO posting queries the hassclass for a specific class to determine if the button is enabled or not. Nice clean solution except, as I stated, there is this intermediate "cke_button_disabled" class that engages once the button is clicked, so that check always fails in my code because I do not check for a "cke_button_disabled" class. I only care about two css classes that are set: cke_button_on and cke_button_off. So that is my dilemma. I have thought about waiting for the click event to complete before querying the css class that been set, but I cannot find a way to do this so that I can query the css class of the Source button once the CKEditor Source button click is complete. I have tried CKEditor's afterCommandExec but that did not work. Here is that code: CKEDITOR.on('instanceReady', function (e) { var editor = e.editor; editor.on('afterCommandExec', handleAfterCommandExec); function handleAfterCommandExec(event) { var commandName = event.data.name; // For 'source' commmand: if (commandName == 'source') { var xxx = $(document.getElementById('cke_15')); if(xxx.hasClass('cke_button_off')) { //cke_button_off when // notdepressed console.log("In handleAfterCommandExec:: CKEDITOR SOURCE BUTTON CLICKED!!!!"); $('#button-publishButton').attr("disabled", "true"); }else { console.log("In handleAfterCommandExec:: CKEDITOR SOURCE BUTTON UNNNNACLICKED!!!!"); $("#butto…
linked to: http://stackoverflow.com/q/9599818
linked to: http://stackoverflow.com/q/27372292

caching
tags question: http://stackoverflow.com/q/28765844
tags question: http://stackoverflow.com/q/28772888
tags question: http://stackoverflow.com/q/28764989
type: Tag
tags question: http://stackoverflow.com/q/28887241
tags question: http://stackoverflow.com/q/28805355
tag name: caching
tags question: http://stackoverflow.com/q/28814046
tags question: http://stackoverflow.com/q/28769936
tags question: http://stackoverflow.com/q/28874578

http://stackoverflow.com/q/28839729
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/45986169
favorite count: 0
tagged with: ajax
type: Question
tagged with: php
upvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/28839800
has body: I'm new to AJAX, and can't get a php function to run. The AJAX post request is working as it should, here's the code: function thumbs(i) { $('.thumbs-up' + String(i)).click(function(){ $(this).addClass('up'); $.ajax({ type:"POST", url:"item.php", data:'act=up&amp;function' + String(i) + '=true&amp;user=' + email, success: function(){ } }); }); for (var i = 1; i &lt;= count; i++) { thumbs(i); } The above works, I receive all the correct values. Then the PHP code that should run is here: for ($i = 1; $i &lt;= $count; $i++) { if ($_POST['function' . $i] == 'true') { //code that should run but does not } } The count variable is the same. Is there anything wrong here?
type: UnansweredQuestion
has title: Call PHP function from Ajax

http://stackoverflow.com/a/28873258
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/119630890
downvote count: 0
has comment: http://stackoverflow.com/comment/46010375
has comment: http://stackoverflow.com/comment/46010887
has comment: http://stackoverflow.com/comment/46011420
answers question: http://stackoverflow.com/q/28873195
has body: You do not draw an image. You give the image to fabric and let fabric draw it. Example: http://fabricjs.com/fabric-intro-part-1#images var imgInstance = new fabric.Image(imgElement, { left: dx, top: dy, width: dwidth, height: dheight, clipTo: function (ctx) { ctx.rect(dwidth / 2 - sx, dheight / 2 - sy, swidth, sheight); } }); fabricCanvas.add(imgInstance);
score: 4
has comment: http://stackoverflow.com/comment/46009573

http://stackoverflow.com/a/28857880
answers question: http://stackoverflow.com/q/28857774
has comment: http://stackoverflow.com/comment/45984807
has comment: http://stackoverflow.com/comment/45986623
has body: If they are entering JavaScript code which you will then store and include when showing a page to other users, then yes, it's a security hole. It means that they can do anything you can do on that page, in the context of someone else's user account; this could be used to steal information from other users, etc. If only they will ever view the page with the embedded JavaScript, no, it doesn't make your page less secure; they coudl easily inject JavaScript into your page via bookmarklets or even just using the console.
has comment: http://stackoverflow.com/comment/45986814
downvote count: 0
has comment: http://stackoverflow.com/comment/45986990
has comment: http://stackoverflow.com/comment/45984443
type: Answer
has comment: http://stackoverflow.com/comment/45985198
score: 1
has comment: http://stackoverflow.com/comment/45983847
upvote count: 1
has comment: http://stackoverflow.com/comment/45981856
has comment: http://stackoverflow.com/comment/45983442

http://stackoverflow.com/comment/45886897
type: AnswerComment
comment on: http://stackoverflow.com/a/28806824
type: Comment
has text: i used another var name ...Now i can iterate all the json object. But unable to append all the json object. I am expecting final result as finalResult: 246 samsung feedback goes here 1485 Moto feedback goes here 6982 iPhone feedback goes here . How to append all the things into one?
score: 0

http://stackoverflow.com/a/28833646
accepted answer of: http://stackoverflow.com/q/28833548
has comment: http://stackoverflow.com/comment/45967376
answers question: http://stackoverflow.com/q/28833548
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45945952
has comment: http://stackoverflow.com/comment/45968431
type: Answer
upvote count: 3
has body: You can put different strings after the value depending on the name: var matr_name = $("input[name*='matr']").map(function() { return $(this).val() + ($(this).attr('name') == 'matr_name[]' ? ': ' : '\n'); }).get().join(''); or: var matr_name = $("input[name*='matr']").map(function() { if ($(this).attr('name') == 'matr_name[]') { return $(this).val() + ': '; } else { return $(this).val() + '\n'; } }).get().join('');
score: 3
has comment: http://stackoverflow.com/comment/45936826
has comment: http://stackoverflow.com/comment/45966467

http://stackoverflow.com/q/28877830
tagged with: fullpage.js
tagged with: css
favorite count: 0
has comment: http://stackoverflow.com/comment/56094703
has answer: http://stackoverflow.com/a/55116142
type: UnansweredQuestion
has title: Horizontal scroll inside section using fullpage js
score: 1
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46021795
has body: I'm trying to add custom slider in the section which has slides, I'm using Fullpage.js plugin, I searched for this but cannot find anything clear, only vertical scroll bar is allowed, but not horizontal .. Is there any way to do this ? the fullpage js plugin using also slimscroll js when to set scrollOverflow true . JSFiddle Code // HTML Some section Slide 1 Slide 2 Slide 3 Slide 4 // JS $('#fullpage').fullpage({ sectionsColor : ['#ccc', '#456'], });
upvote count: 1
answer count: 1

http://stackoverflow.com/a/28860156
has body: You could assign a class say "yes" to all radiobuttons for Yes and a class "no" to all radiobuttons for no. Then using jquery you can find the count as follows: var totalYesAnswers = $(".yes :checked").length; var totalNoAnswers = $(".no :checked").length;
answers question: http://stackoverflow.com/q/28857258
score: 0
type: Answer

http://stackoverflow.com/q/28827349
has answer: http://stackoverflow.com/a/28828153
tagged with: python
type: AnsweredQuestion
upvote count: 3
has comment: http://stackoverflow.com/comment/45925502
type: Question
score: 3
tagged with: server
has body: I have a websocket server running written in Python, (from https://github.com/opiate/SimpleWebSocketServer), and when I try to connect to it from my house, it works fine. However, when I try to connect to it from school, where there is a web proxy in place, it fails to connect with the error "undefined". I believe that it is the proxy that is stopping the connection, but am not sure how to test to see if it definitely is. How can I test this, and if it is the proxy, how can I get round this? Thanks
accepted answer: http://stackoverflow.com/a/28828153
has title: Proxy blocking websockets? How to get round
downvote count: 0
answer count: 1
tagged with: websocket
tagged with: javascript
favorite count: 0
tagged with: proxy

http://stackoverflow.com/comment/46033203
type: AnswerComment
has text: Note: `.bind()` was deprecated in jQuery 1.6 and replaced with `.on()` - but you are correct in pointing out that if the markup is injected after the DOM was rendered, then delegation is necessary.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28885859

http://stackoverflow.com/a/28757774
has comment: http://stackoverflow.com/comment/45796706
has comment: http://stackoverflow.com/comment/45796290
has comment: http://stackoverflow.com/comment/45798945
has comment: http://stackoverflow.com/comment/45796802
has comment: http://stackoverflow.com/comment/45796556
has comment: http://stackoverflow.com/comment/45797809
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45796295
score: 4
has comment: http://stackoverflow.com/comment/45797136
answers question: http://stackoverflow.com/q/28755540
has body: Try adding the format param to the form_for. You're requesting an html response by default and your controller doesn't know how to answer that. Requesting a js response should fix it. = form_for(@artist, format: :js, authenticity_token: true) do |f|
type: Answer
accepted answer of: http://stackoverflow.com/q/28755540
upvote count: 4
downvote count: 0
has comment: http://stackoverflow.com/comment/45796355

http://stackoverflow.com/comment/45833986
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28778095
has text: Hi, I am not worried about hiding and showing DivAdmin section, I want to show Modal dialog first and then based on Yes or No, I want to show or hide DivAdmin section.
type: Comment

http://stackoverflow.com/comment/45794795
score: 0
type: Comment
type: QuestionComment
has text: http://stackoverflow.com/questions/28756691/javascript-for-loop-increment-behaves-strangely/28756710#28756710
comment on: http://stackoverflow.com/q/28756976

http://stackoverflow.com/q/28878157
tagged with: javascript
has answer: http://stackoverflow.com/a/28879366
score: 0
tagged with: reactjs
answer count: 1
type: UnansweredQuestion
has body: I want to show loader when authentication happens. I've got sendAuthCredentials action. On this action I want to do several actions: Show Loader Send auth request to server Handle response and inform UserStore is user authenticated or not Hide Loader. I've got Loader react component, LoaderStore and LoaderAction for working with component. So my sendAuthCredentials method looks like: UserActions = { /** * @param {string} username * @param {string} password */ sendAuthCredentials: function(username, password) { return Q.all( [ LoaderActions.showLoader(), authenticateUser(username, password) .then(function( data ) { if( data ) { AppDispatcher.handleViewAction({ type: ActionTypes.USER_LOGIN_SUCCESS, data: data }); return Q( "succcess" ); } else { AppDispatcher.handleViewAction({ type: ActionTypes.USER_LOGIN_FAIL }); return Q( "failed" ); } }) ] ).then(LoaderActions.hideLoader); } }; It's works but I'm not sure Is it right way to use Actions in Flux. Thanks for the answer.
has title: Can I send several events on action in flux?
type: Question

http://stackoverflow.com/a/28878966
has comment: http://stackoverflow.com/comment/46019681
score: 0
accepted answer of: http://stackoverflow.com/q/28878634
type: AcceptedAnswer
type: Answer
has body: If you call setActiveTab(); inside the click handler it seems to be working fine. $("#add-page").click(function () { if (tabNameCounter &lt; 6) { addTab(); addTabBut(); setActiveTab(); } });
answers question: http://stackoverflow.com/q/28878634

http://stackoverflow.com/q/28872084
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28872178
type: Question
possible better answer: http://stackoverflow.com/a/28872138
answer count: 2
has answer: http://stackoverflow.com/a/28872138
tagged with: jquery-ui
has title: jQueryUI icons are always shown on the top instead of inline
tagged with: javascript
tagged with: jquery
score: 0
has body: I wanted to create some buttons using jQueryUI with some icons for a better style. My problem is that the icons are always shown on the top of the button-text. Is there a possibility to show the icons always inline with the text? HTML Delete Result JS $(function() { $( "input[type=submit], a, button" ) .button() .click(function( event ) { event.preventDefault(); }); }); Here is also a link to jsfiddle with the code so that you can imagine what I mean: http://jsfiddle.net/14sxbj59/ Thank you very much in advance!
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28872178
tagged with: css

http://stackoverflow.com/a/28815027
has comment: http://stackoverflow.com/comment/45933710
type: Answer
has comment: http://stackoverflow.com/comment/45914487
has body: It would seem that the act of returning the value of p.cancel() from the tap handler is causing bluebird to go into some sort of infinite loop. You never see the second 'callback!' because the execution context is stuck in this loop before 100 ms have elapsed. I'm still far from understanding all the factors at play here (see below), but it looks like this can be fixed by not returning p.cancel(): Promise = require 'bluebird' cb = -&gt; console.log 'callback!' p = Promise.resolve(5) .cancellable() .tap -&gt; p.cancel() null setInterval(cb, 100) Edit: Ok, after looking at the source and unknotting my brain a few times, I think it boils down to this: Execution is getting stuck in an infinite loop here, where .cancel() tries to climb up the promise chain: while ((parent = promiseToReject._cancellationParent) !== undefined &amp;&amp; parent.isCancellable()) { promiseToReject = parent; } The salient points are the following: p.cancel() returns p. .tap() returns a promise that resolves whenever the promise returned from its handler resolves (if it returns a promise) p is the promise that .tap() returns In other words, p is a promise that will resolve after p resolves. It is its own ancestor in the promise chain (at least, I think so). When .cancel() tries to climb up the promise chain to find a cancellable promise, it happens upon this incestuous relationship and starts going in circles forever. In the end, it's an unfortunate consequence of CoffeeScript's eagerness to turn almost everything into a return statement. But I would imagine that there's some way Bluebird could detect loops in promise chains and prevent an infinite loop from happening here. I have filed an issue for this on the bluebird GitHub repository, but as the ensuing discussion reveals, this use of .cancel() doesn't really make any sense at all anyway.
score: 4
has comment: http://stackoverflow.com/comment/45914532
accepted answer of: http://stackoverflow.com/q/28811232
answers question: http://stackoverflow.com/q/28811232
has comment: http://stackoverflow.com/comment/45934253
upvote count: 4
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/45918056
comment on: http://stackoverflow.com/q/28823187
score: 0
has text: I tried adding that with `curl`, it still returned the `Access-Control-Allow-Origin` header. But maybe one of the other request headers is doing it. Try adding each header to `curl` to see which one does it.
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45931513
type: Comment
comment on: http://stackoverflow.com/a/28766199
has text: Do you have another level of elements, below this level? ` `
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45993583
has text: The OP did not mention that they are using jQuery.
comment on: http://stackoverflow.com/a/28864217
type: AnswerComment
type: Comment
score: 2

http://stackoverflow.com/comment/46055365
has text: Hi, I have no control over the selected webview since it runs by the app. I'm pretty sure that the app uses the default Android stacked webview.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28886916

indexof
tags question: http://stackoverflow.com/q/28784127
type: Tag
tags question: http://stackoverflow.com/q/28775447
tags question: http://stackoverflow.com/q/28890704
tags question: http://stackoverflow.com/q/28774003
tags question: http://stackoverflow.com/q/28841890
tags question: http://stackoverflow.com/q/28839669
tags question: http://stackoverflow.com/q/28865948
tag name: indexof

http://stackoverflow.com/comment/45991893
has text: Without a CMS system this is going to be a **LOT** of work...I've never seen a site get smaller...
score: 0
comment on: http://stackoverflow.com/q/28862669
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28805579
has body: I have a custom shipping method on WooCommerce that should show a little box with information to user, only when that custom shipping method is chosen. So far I have tried with this little code: jQuery(document).ready(function($) { $(document).on("change", "#shipping_method_0_my_shipping_method", function() { if( $("#shipping_method_0_my_shipping_method").prop('checked') == true ){ $('.custom-box').show(); } else { $('.custom-box').hide(); } }); }); And it shows the .custom-box just fine when that custom shipping method is chosen. But it does not hide it for some reason, when I choose some other shipping method? Also it does not show the box if my custom shipping method is chosen on page load, but if I click on some other shipping method, and then my custom shipping method, it will show the box fine. Working now perfectly. Thanks for the working solution for Томица Кораћ at below!
type: Question
has comment: http://stackoverflow.com/comment/45885245
has title: Woocommerce radio button check on jquery
tagged with: wordpress
upvote count: 1
accepted answer: http://stackoverflow.com/a/28807119
answer count: 1
tagged with: woocommerce
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28807119

http://stackoverflow.com/q/28758520
has comment: http://stackoverflow.com/comment/45833865
accepted answer: http://stackoverflow.com/a/28758665
tagged with: css
possible better answer: http://stackoverflow.com/a/28758623
has answer: http://stackoverflow.com/a/28801380
score: 0
type: AnsweredQuestion
has body: This is my game: (i can't post images yet so I have to explain with words) This is a Connect 4 game. Imagine 7 div columns. The 7 columns have 6 div chip objects stacked in each column element. (7x6 grid with 42 chips) I put each chip (each black circle) as a div object prepended into each column container. that is... each .columncontainer div has nested under it a bunch of .chip div elements. (they're the chips/circles) What I want: I want to be able to click a specific chip object (they're div's.. the black circles) and I want ONLY that one to turn full black. (default opacity I set to 0.5) This is the code I have: $(document).ready(function colorSelectionListener(){ $(".columncontainer").children().click(function() { window.alert("clicked!"); $(this).css("opacity",1); }); What's actually happening: When I click on ANY of the chip objects... NOTHING happens. I can't click the chips at all. What I can do: To test if I can click something I made the alert "clicked!" In this way I am able to click the columncontainers. I am also able to retrieve the index of the column div inside it when I print out the index of 'this', like so: window.alert($(this).index()); instead of the 'clicked!' message. It gives me 6...which doesn't make sense... because 6 is the last element inside columncontainer which is .column. (0-5 elements must be the chips after I prepend them right?) What I tried: I tried making the .click with the chip objects themselves. (the class attached to every chip object is '.chip') Did not work. (Click was not registering... but I think that's another problem) Can someone enlighten me? EDIT 1: Mini Recreation of Problem https://jsfiddle.net/9z916z2u/65/ If anyone could help me I would really really appreciate it! I'm having so much fun coding this right now but this is annoying :/ I learnt jQuery/Javascript around 3 days ago, so I'm not that good. (I have coded in Java/Python before though)
has answer: http://stackoverflow.com/a/28758665
type: Question
has comment: http://stackoverflow.com/comment/45797489
has title: Click event not registering on div element (jQuery/HTML/CSS)
tagged with: javascript
tagged with: jquery
tagged with: click
answer count: 3
has answer: http://stackoverflow.com/a/28758623
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/28892765
type: Answer
upvote count: 15
answers question: http://stackoverflow.com/q/28892720
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28892720
has body: Use the minDate property in JQuery UI datepicker API. $(function() { var $dp1 = $("#datepicker1"); $dp1.datepicker({ changeYear: true, changeMonth: true, minDate:0, dateFormat: "yy-m-dd", yearRange: "-100:+20", }); var $dp2 = $("#datepicker2"); $dp2.datepicker({ changeYear: true, changeMonth: true, yearRange: "-100:+20", dateFormat: "yy-m-dd", }); }); $(function() { var $dp1 = $("#datepicker1"); $dp1.datepicker({ changeYear: true, changeMonth: true, minDate: 0, dateFormat: "yy-m-dd", yearRange: "-100:+20", }); var $dp2 = $("#datepicker2"); $dp2.datepicker({ changeYear: true, changeMonth: true, yearRange: "-100:+20", dateFormat: "yy-m-dd", }); }); p.pfield-wrapper input { float: right; } p.pfield-wrapper::after { content: "\00a0\00a0 "; /* keeps spacing consistent */ float: right; } p.required-field::after { content: "*"; float: right; margin-left: -3%; color: red; } Start Date End Date Equivalent JsFiddle Also note that you need to use only one document ready event in your script.
score: 15
type: AcceptedAnswer

http://stackoverflow.com/comment/45790608
type: AnswerComment
comment on: http://stackoverflow.com/a/28753596
type: Comment
has text: So relying on the browser to fix the problem for you instead of following the age old protocol is the answer. ... doesn't seem like right answer.
score: 1

http://stackoverflow.com/a/28807106
has body: You don't need the inner for loop, you can access your elements directly. I made a couple of other changes as well that can be found below: var res = '[{"ID":"246","mobile":"samsung","feedback":"feedback goes here"},{"ID":"1485","mobile":"Moto","feedback":"feedback goes here"},{"ID":"6982","mobile":"iPhone","feedback":"feedback goes here"}]'; obj = JSON.parse(res); var finalResult = ""; console.log('response length:' + obj.length); for (var i = 0; i &lt; obj.length; i++) { var str1 = "aasd"; var tableRow = "&lt;tr&gt;&lt;td&gt;" + obj[i]["ID"] + "&lt;/td&gt;&lt;td&gt;" + obj[i]["mobile"] + "&lt;/td&gt;&lt;td&gt;" + obj[i]["feedback"] + "&lt;/td&gt;&lt;td&gt;&lt;/tr&gt;"; finalResult += tableRow; } console.log('finalResult:' + finalResult); I hope you find it helpful.
score: 2
answers question: http://stackoverflow.com/q/28806682
downvote count: 0
upvote count: 2
type: Answer

http://stackoverflow.com/a/28864034
has comment: http://stackoverflow.com/comment/45994136
has comment: http://stackoverflow.com/comment/45994041
has comment: http://stackoverflow.com/comment/45994727
has comment: http://stackoverflow.com/comment/45993215
has comment: http://stackoverflow.com/comment/45994233
downvote count: 1
has body: Here is the definition of attributes as defined by the HTML standard: 3.2.3.1 Attributes Except where otherwise specified, attributes on HTML elements may have any string value, including the empty string. Except where explicitly stated, there is no restriction on what text can be specified in such attributes. So, to repeat what was already stated, HTML attributes are always strings.
has comment: http://stackoverflow.com/comment/45993892
upvote count: 0
score: -1
has comment: http://stackoverflow.com/comment/45993844
has comment: http://stackoverflow.com/comment/45993268
answers question: http://stackoverflow.com/q/28863816
has comment: http://stackoverflow.com/comment/45994588
has comment: http://stackoverflow.com/comment/45997848
has comment: http://stackoverflow.com/comment/45994928
has comment: http://stackoverflow.com/comment/45998660
has comment: http://stackoverflow.com/comment/45994367
has comment: http://stackoverflow.com/comment/45994655
type: Answer
has comment: http://stackoverflow.com/comment/45993604
has comment: http://stackoverflow.com/comment/45993798

http://stackoverflow.com/comment/46938970
type: AnswerComment
has text: It's possible if you eject the correct event handler or event triggering inside the function that will change the dom.
type: Comment
comment on: http://stackoverflow.com/a/29317178
score: 0

http://stackoverflow.com/a/28755319
type: Answer
answers question: http://stackoverflow.com/q/28754758
score: 1
upvote count: 1
downvote count: 0
has body: 1) Try to remove / from ... to: 'user_versions/#create' 2) Check URL path use rake routes | grep user_versions.
has comment: http://stackoverflow.com/comment/45793928
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28754758

http://stackoverflow.com/q/28758541
type: Question
has comment: http://stackoverflow.com/comment/47307763
tagged with: javascript
has body: I am trying to create an application for which I have JAVA files at the backend ready. I am trying to create UI for the same project for which I am trying through TideSDK and I am new to it. I need to call a JAVA class method from tideSDK by passing some parameters and get response from the same. Is there any way to connect TideSDK with JAVA ?
upvote count: 1
favorite count: 0
answer count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/16486779
downvote count: 0
score: 1
tagged with: java
tagged with: tidesdk
has title: Call a JAVA class method from TideSDK

polymer
tags question: http://stackoverflow.com/q/28861999
tags question: http://stackoverflow.com/q/28844415
tags question: http://stackoverflow.com/q/28827217
tags question: http://stackoverflow.com/q/28859083
tags question: http://stackoverflow.com/q/28862692
tags question: http://stackoverflow.com/q/28893975
tag name: polymer
tags question: http://stackoverflow.com/q/28830040
tags question: http://stackoverflow.com/q/28752644
tags question: http://stackoverflow.com/q/28878751
tags question: http://stackoverflow.com/q/28876116
tags question: http://stackoverflow.com/q/28820182
tags question: http://stackoverflow.com/q/28796083
tags question: http://stackoverflow.com/q/28821134
tags question: http://stackoverflow.com/q/28888884
tags question: http://stackoverflow.com/q/28824572
tags question: http://stackoverflow.com/q/28890328
type: Tag
tags question: http://stackoverflow.com/q/28866259

http://stackoverflow.com/a/28835955
type: Answer
has comment: http://stackoverflow.com/comment/74409251
has comment: http://stackoverflow.com/comment/74518510
score: 9
answers question: http://stackoverflow.com/q/28835495
upvote count: 9
type: AcceptedAnswer
downvote count: 0
has body: Compare the getTime()'s of the dates specified. The below code sets Opening Time and Closing Time of the current day and checks whether the current time is between those two time stamps. var Now = new Date(), CurrentDay = Now.getDay(), OpeningTime = new Date(Now.getFullYear(), Now.getMonth(), Now.getDate(), 8, 30), ClosingTime = new Date(Now.getFullYear(), Now.getMonth(), Now.getDate(), 17, 30), Open = (Now.getTime() > OpeningTime.getTime() && Now.getTime() < ClosingTime.getTime()); if (CurrentDay !== 6 && CurrentDay !== 0 && Open) { $('.openstatus').toggle(); } .hours { display:none; } We are OPEN We are CLOSED
accepted answer of: http://stackoverflow.com/q/28835495

http://stackoverflow.com/a/28833385
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28832368
upvote count: 1
answers question: http://stackoverflow.com/q/28832368
has body: Based on my answer I gave you in the other thread (https://stackoverflow.com/a/28828842/4569271) I extended my solution to only display unique values: $(function() { $('input[type="checkbox"]').change(function() { // Reset output: $("#output").html(''); // remeber all unique values in this array: var tmpArray = new Array(); // Repeat for all checked checkboxes: var checkboxes = $('input[type="checkbox"]:checked').each(function() { // Get value from checkbox: var textToAppend = $(this).val(); // Check if value from checkbox was added already: if (jQuery.inArray(textToAppend, tmpArray) == -1) { // add entry to array so it will be not added again: tmpArray.push(textToAppend); var existingText = $("#output").html(); // Append seperator (';') if neccessary: if (existingText != '') { existingText = existingText + ";"; } // Print out append value: $("#output").html(existingText + textToAppend); } }); }); }); Select: Jan Jan Jan Feb Feb Feb Mar Mar Mar Output: Based on your description, I am not sure if this is the solution you were looking for? But maybe it helps.
type: AcceptedAnswer

http://stackoverflow.com/a/28788270
score: 0
has body: I think you already know a language you can use. How about javascript? Of course a real serverside language like Java or PHP would be better - maybe as already told: ruby but why not try it with node.js: Node.js could be the first thing you may look at. (http://nodejs.org/) It's really nice &amp; well documented - there is also a big question about node.js with mysql: MySQL with Node.js which also works fine.
type: Answer
upvote count: 1
downvote count: 1
answers question: http://stackoverflow.com/q/28788052

http://stackoverflow.com/comment/45837514
comment on: http://stackoverflow.com/a/28780201
type: Comment
has text: I suggest the first approach, the caller has less knowledge about the internal structure of StopWatch. The third one I would surely stay away from because it assumes a single instance per page.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46027805
comment on: http://stackoverflow.com/q/28820551
has text: It sounds like you are wanting to reproduce mobile style highlighting in the desktop browser. Am I right?
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/q/28843314
tagged with: javascript
has title: how to get started with angular animations
downvote count: 0
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45956331
answer count: 0
type: UnansweredQuestion
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45956928
type: Question
has body: I can't get an ng-view animation to run at all. The application works and changes views, but the view never changes color. It seems the .ng-enter class is never added to the element. I was under the impression that including ngAnimate was all that was needed. Are there more steps? packages angular 1.3.14 angular-route 1.3.14 angular-animate 1.3.14 js angular.module('app', [ 'ngRoute', 'ngAnimate', ]) scss .view { min-height: 600px; &amp;.ng-enter { background: red; } &amp;.ng-leave { background: blue; } } html &lt;section ng-view class="view"&gt;&lt;/section&gt;

http://stackoverflow.com/comment/45923700
type: Comment
comment on: http://stackoverflow.com/a/28820414
has text: @Jonathan — You can't load `commonContent.html` into a div that is on `commonContent.html` and not in the current page. The jQuery website includes instructions on how to set up jQuery for your site.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45957781
comment on: http://stackoverflow.com/q/28844368
has text: No, It would stay with the li. selected blah blah strong ALL in the list, the first item
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28877992
type: UnansweredQuestion
has title: SSO authentication for viewing a HTML page running on Apache Tomcat
upvote count: 1
has comment: http://stackoverflow.com/comment/46148857
has body: We have a Web Application which have HTML 5 page to see the messages in realtime through websocket connection to our servers.Making websocket connection and showing the graphs work well,HTML5 page needs SSO authentication before it gets displayed. What has been completed But for viewing that HTML 5 page we have no file based authentication to read the file with usernames and show a popup to enter username if it is matched then user will be able to see the HTML graphs page.This is not very good approach!!! What needs to be DONE Now some type of SSO-Single Sign On authentication(not sure on what type of authentication our organization is currently using) is needed which will do some magical authentication on the back end and after that user would be able to see the HTML graphs page. Currently the application is running on Apache Tomcat 6 and have couple of javascript files,CSS and one HTML page.Potential solution should be implemented in JAVA,can use any 3rd party API too. Thanks in advance.
score: 1
tagged with: java
type: Question
downvote count: 0
tagged with: javascript
tagged with: tomcat
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: single-sign-on
answer count: 0
has comment: http://stackoverflow.com/comment/46134029

http://stackoverflow.com/q/28843105
type: AnsweredQuestion
tagged with: crm
tagged with: dynamics-crm-2013
type: Question
tagged with: dynamics-crm-2011
answer count: 2
possible better answer: http://stackoverflow.com/a/28843521
has title: CRM Javascript Automatically Populated a Look-up Value with a specific field
tagged with: javascript
has answer: http://stackoverflow.com/a/28843521
has answer: http://stackoverflow.com/a/28844084
accepted answer: http://stackoverflow.com/a/28844084
has body: I'm trying to write a javascript on CRM Phone Call page. We have a custom look-up field called new_department, and we want to automatically populate the field with value "IT" (there should be one) when the form is opened. The thing is we have a separate Dev and Production CRM link therefore I cannot just assign a hard-coded GUID value into this field. So first I wrote a Rest Retrieve Multiple to get the correct department. Then my problem is I'm not sure about the result returned from this Retrieve Multiple. How do I grab just the GUID from Rest? I'm seeing that this is a type of {Object}. Then lastly how do I go about setting the lookup value after retrieving the {Object}? Any help is greatly appreciated. Here is my code. function phonecall() { var formType = Xrm.Page.ui.getFormType(); if (formType == 1) //create { //RetrieveMultiple function var DepartmentId = getITDepartment(); //set the lookup value var ID = DepartmentId.id; var departmentValue = new Array(); departmentValue[0] = new Object(); departmentValue[0].id = DepartmentId; departmentValue[0].name = 'IT'; userValue[0].entityType = "new_department"; Xrm.Page.getAttribute("new_department").setValue(departmentValue); } } function getITDepartment() { XrmServiceToolkit.Rest.RetrieveMultiple("new_departmentSet", "$select=new_departmentId&amp;$filter=new_name eq 'IT'", function (results) { if (results.length &gt; 0) resultList = results; }, function (error) { alert(error); }, function onComplete() { }, false); return resultList; } Thanks much.
score: 0

http://stackoverflow.com/comment/92207292
has text: No idea why this works, but if you want to use the value of `p` as key for the object literal, this is how you do it: `p => ({ [p]: 'bar' })`. Without the `[]`, it'll either be `undefined` or literally the letter `p`.
comment on: http://stackoverflow.com/a/28770578
score: 9
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28813379
answers question: http://stackoverflow.com/q/28813279
type: Answer
score: 1
has body: You can check the location.search property for a value var query = window.location.search; if( query.indexOf('skin=skin_name') === -1 ) { var sign = query.trim().length === 0 ? '?' : ':'; window.location.search = sign + 'skin=skin_name'; } else { /* _optimizely_redirect=http://custom */ }
upvote count: 1
downvote count: 0

http://stackoverflow.com/a/28824663
has comment: http://stackoverflow.com/comment/45920406
type: Answer
has comment: http://stackoverflow.com/comment/45920503
has comment: http://stackoverflow.com/comment/45920395
has comment: http://stackoverflow.com/comment/45920422
upvote count: 1
answers question: http://stackoverflow.com/q/28824360
has body: Download and place component.css in css folder, then add this to : HTML : Get Email Update <?php if (isset($_POST['signup-button']) { ?> <span color="<?=($status=='success')?'green':'red';?>"><?=$message;?> <?php } ?> And place just before closing : <?php if ($status == "error") { ?> <?php } ?> Put the following at the top of your footer.php or index.php (in which you include() the footer.php) <?php if (isset($_POST['signup-button'])) { try { $db = new PDO("mysql:host=$host;dbname=$dbname", $user, $pass); if (empty($email)) { $status = "error"; $message = "The email address field must not be blank"; } else if (!preg_match('/^[^0-9][A-z0-9._%+-]+([.][A-z0-9_]+)*[@][A-z0-9_]+([.][A-z0-9_]+)*[.][A-z]{2,4}$/', $email)) { $status = "error"; $message = "You must fill the field with a valid email address"; } else { $existingSignup = $db->prepare("SELECT COUNT(*) FROM signups WHERE signup_email_address='$email'"); $existingSignup->execute(); $data_exists = ($existingSignup->fetchColumn() > 0) ? true : false; if (!$data_exists) { $sql = "INSERT INTO signups (signup_email_address, signup_date) VALUES (:email, :datetime)"; $q = $db->prepare($sql); $q->execute( array( ':email' => $email, ':datetime' => $datetime )); if ($q) { $status = "success"; $message = "You have been successfully subscribed"; } else { $status = "error"; $message = "An error occurred, please try again"; } } else { $status = "error"; $message = "This email is already subscribed"; } } $data = array( 'status' => $status, 'message' => $message ); echo json_encode($data); $db = null; } catch(PDOException $e) { echo $e->getMessage(); } } ?> Also have a look here : http://jsfiddle.net/8ft0ye6k/3/ Hope it helps.
has comment: http://stackoverflow.com/comment/45925706
score: 1
has comment: http://stackoverflow.com/comment/45920394
has comment: http://stackoverflow.com/comment/45925806
downvote count: 0
has comment: http://stackoverflow.com/comment/45920538

http://stackoverflow.com/comment/46041767
type: AnswerComment
comment on: http://stackoverflow.com/a/28890265
score: 0
type: Comment
has text: The real fix is to ensure that IDs don't get duplicated - it's not legal HTML otherwise.

http://stackoverflow.com/q/28798330
has comment: http://stackoverflow.com/comment/110680866
favorite count: 0
has answer: http://stackoverflow.com/a/28798362
has title: Arrow Functions and This
answer count: 5
possible better answer: http://stackoverflow.com/a/28798419
linked to: http://stackoverflow.com/q/34361379
has answer: http://stackoverflow.com/a/44836029
has answer: http://stackoverflow.com/a/28798419
has comment: http://stackoverflow.com/comment/45870986
accepted answer: http://stackoverflow.com/a/28798362
linked to: http://stackoverflow.com/q/31095710
type: Question
type: AnsweredQuestion
duplicate of: http://stackoverflow.com/q/31095710
tagged with: javascript
has answer: http://stackoverflow.com/a/28798412
score: 43
tagged with: ecmascript-6
upvote count: 43
has body: I'm trying out ES6 and want to include a property inside my function like so var person = { name: "jason", shout: () =&gt; console.log("my name is ", this.name) } person.shout() // Should print out my name is jason However, when I run this code console only logs my name is. What am I doing wrong?
tagged with: arrow-functions
tagged with: this
has answer: http://stackoverflow.com/a/28798435
downvote count: 0

http://stackoverflow.com/comment/45854976
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28789742
type: Comment
has text: Nope. It just keeps going. `for` loops are much more useful for synchronous programming than async.

http://stackoverflow.com/a/36375551
type: Answer
score: 1
upvote count: 1
downvote count: 0
has body: magically scrolls the input into view This is the key. Just change scrollLeft of the container to 0 after focusing. I had to put a wrapper around it though. http://jsbin.com/danarucama/1/edit?html,css,js,output
answers question: http://stackoverflow.com/q/28848157

http://stackoverflow.com/comment/45932774
comment on: http://stackoverflow.com/q/28831410
score: 0
type: Comment
type: QuestionComment
has text: If you want consistency across browsers on mobile devices, you will have to use cookies to pass the data unfortunately. Local/SessionStorage is not supported on Safari's private browsing mode.

http://stackoverflow.com/q/28845489
has answer: http://stackoverflow.com/a/28845518
upvote count: 1
tagged with: google-chrome
downvote count: 1
accepted answer: http://stackoverflow.com/a/28845518
type: Question
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28845531
has answer: http://stackoverflow.com/a/28845531
answer count: 2
has body: I have an issue that only shows up in Chrome running on Windows. How can I detect that the browser is Chrome and the OS is Windows? Thanks
tagged with: javascript
score: 0
tagged with: windows
favorite count: 0
has title: Javascript how to detect Chrome on windows

http://stackoverflow.com/a/28882839
upvote count: 1
downvote count: 1
answers question: http://stackoverflow.com/q/28786562
has body: I was able to get it to work by applying a transform with a scale(). if(size=="small") shape.attr('transform', "scale(.5)"); else if(size=="large") shape.attr('transform', "scale(2)"); Thank you Lars Kotthoff for giving the answer.
score: 0
accepted answer of: http://stackoverflow.com/q/28786562
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/a/28761530
score: 2
upvote count: 2
has body: Add another div or span like this : Hello World Here I am! $(document).ready( function() { $('#h1id #something').text('I can change this'); $('#h1id #smallid').text('But not this'); });
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28761455

css-frameworks
type: Tag
tags question: http://stackoverflow.com/q/28773432
tag name: css-frameworks

http://stackoverflow.com/comment/45799552
type: AnswerComment
has text: just add the same php code inside its tag. <?php echo !empty($out['caption'])? 'disabled' : '' ?>
comment on: http://stackoverflow.com/a/28759064
score: 0
type: Comment

http://stackoverflow.com/comment/45954051
type: Comment
has text: Can we see your code where you create and append the div?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28841081

http://stackoverflow.com/comment/45964281
type: Comment
has text: You're asking what is essentially a challenging technical support question. What makes you think that it has greater chance of being answered here rather than in Sencha forums? No, really. I always wondered why people do that.
type: QuestionComment
comment on: http://stackoverflow.com/q/28805491
score: 0

http://stackoverflow.com/comment/46077809
type: Comment
comment on: http://stackoverflow.com/a/28904262
has text: You have included this what I already know :) . As I wrote in previous comment - the code **shold** work with what you have posted (see [**demo**](http://jsfiddle.net/L6ypfdpm/), it's exactly the same as your HTML). The problem is somewhere else.
score: 0
type: AnswerComment

http://stackoverflow.com/q/28759010
favorite count: 0
has title: Underscore's similar functions: _.contains vs. _.some and _.map vs _.each
upvote count: 4
has body: Is there a reason to use one over the other? It seems that _.some and _.map are easier to use or applicable to more situations (from my very limited experience) but from reading it, they sound as if they should do the same thing. I'm sure there are other instances of this and I'm all ears on learning some of the comparisons.
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28759309
downvote count: 0
has comment: http://stackoverflow.com/comment/45798601
has comment: http://stackoverflow.com/comment/45798377
has answer: http://stackoverflow.com/a/28759507
has comment: http://stackoverflow.com/comment/45798312
type: Question
tagged with: underscore.js
tagged with: javascript
score: 4
has answer: http://stackoverflow.com/a/28759309
answer count: 3
has comment: http://stackoverflow.com/comment/45798250
has answer: http://stackoverflow.com/a/28759114
accepted answer: http://stackoverflow.com/a/28759114

http://stackoverflow.com/comment/45894188
comment on: http://stackoverflow.com/q/28809862
type: Comment
type: QuestionComment
score: 1
has text: Please describe "does not work".

http://stackoverflow.com/comment/45832790
has text: @zzzzBov I am not 100% familiar with V8's hidden class system, but from my understanding even in hidden classes the values of each object's properties should be stored separately for fast mapping and the prototype is still an extra class. What the exact memory consumption of any of these classes would be is above me
type: Comment
comment on: http://stackoverflow.com/a/28777167
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45887852
type: Comment
comment on: http://stackoverflow.com/a/28807446
score: 0
type: AnswerComment
has text: nope didn't work. I need the page operable over which the modal is rendered. i.e, if there is a button on the page over which the modal opens, I need to be able to click that button

http://stackoverflow.com/a/28767449
has body: First for loop just prompts you to add numbers to an array. The second loop just checks each number in the num array, if that number is bigger than the number in the biggest variable then it sets the biggest variable to that number. It's as simple as that.
has comment: http://stackoverflow.com/comment/45814207
score: 0
answers question: http://stackoverflow.com/q/28767330
has comment: http://stackoverflow.com/comment/45814004
type: Answer

http://stackoverflow.com/comment/45986440
score: 0
comment on: http://stackoverflow.com/q/28860335
has text: http://stereobit.github.io/dragend/
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28786593
score: 1
has title: jquery/js - How to create toogle button to change height of box
type: Question
has answer: http://stackoverflow.com/a/28786685
downvote count: 0
tagged with: javascript
tagged with: jquery
answer count: 3
has answer: http://stackoverflow.com/a/28786630
accepted answer: http://stackoverflow.com/a/28786630
favorite count: 0
possible better answer: http://stackoverflow.com/a/28786685
has answer: http://stackoverflow.com/a/28786626
has body: How the correct way to create toggle button to change height of a box(changeHight) $('.toggle').click(function() { $('.changeHight').css('height','65px'); $('.changeHight').css('height','32px'); });
upvote count: 1
has comment: http://stackoverflow.com/comment/45849221
type: AnsweredQuestion

http://stackoverflow.com/comment/46023603
comment on: http://stackoverflow.com/a/28881023
type: AnswerComment
score: 0
type: Comment
has text: I'm not too sure how to go about adding this to my code as my beforeShowDay is already calling the isAvailable function?

http://stackoverflow.com/a/28794265
has comment: http://stackoverflow.com/comment/45863480
has body: Make your regex to do a non-greedy match. And also make the regex to do back-referencing. /&lt;(h[2-4])&gt;([^&lt;&gt;]+)&lt;\/\1&gt;/g OR /&lt;(h[2-4])&gt;((?:(?!&lt;h\d+\b).)+?)&lt;\/\1&gt;/g DEMO
type: Answer
upvote count: 2
score: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45863390
has comment: http://stackoverflow.com/comment/45863324
answers question: http://stackoverflow.com/q/28794249

http://stackoverflow.com/a/28887730
has body: For a purely sequential solution, you could build a promise chain with a recursive function that adds each result. function wrap(func){ return function(results) { var result = func(); results.push(result); return results; }; } var funcs = [loadFile(x),loadFile(y), loadFile(z)]; var wrapped = funcs.map(wrap); wrapped .reduce(q.when, q([])) .then(function(results){ //results array }); basically it builds the standard promise chain, and uses the reduce as a shortcut to unfold the function calls into the "result array". If you don't need exact sequential calls: You can get values returned in sequence by making an array of requests/promises. var requests = [downloadFile('http://blah'), downloadFile('http://blah2')]; q.all(requests).then(function(results) { //results will be an array of your results, in order of index }); See Combination in the doc: You can turn an array of promises into a promise for the whole, fulfilled array using all.
has comment: http://stackoverflow.com/comment/46041720
has comment: http://stackoverflow.com/comment/46037281
has comment: http://stackoverflow.com/comment/46041669
has comment: http://stackoverflow.com/comment/46040141
score: 0
has comment: http://stackoverflow.com/comment/46041333
answers question: http://stackoverflow.com/q/28887620
has comment: http://stackoverflow.com/comment/46036980
type: Answer

http://stackoverflow.com/a/28767573
score: 3
downvote count: 0
answers question: http://stackoverflow.com/q/28767159
upvote count: 3
has body: Since your selector is only grabbing items that are checked, they are all "true". That being the case, you need to change the way you are using "map" to add properties to tagOutput. var tagOutput = {} $(':checkbox[name=gymTags]').map(function() { tagOutput[this.value] = this.checked; }) });
type: Answer

http://stackoverflow.com/comment/45836780
has text: Plain JS version of the code: http://jsfiddle.net/v5d10w42/ (with oninput event).
score: 3
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28779756

http://stackoverflow.com/comment/46040964
comment on: http://stackoverflow.com/a/28866634
score: 0
type: AnswerComment
has text: Can you give me some examples of these queries and what they might return and I'll show you what I mean.
type: Comment

http://stackoverflow.com/a/28806554
upvote count: 11
downvote count: 1
answers question: http://stackoverflow.com/q/28806321
has body: every controller will create a new Scope. Hence the changing the scope in one controller will not reflect in the scope of other controller. If you want to share a property across the controllers create that variable on the $rootScope and use it. In Controller $scope.$root.shouldShow = true; //or false In Markup &lt;div ng-show="$root.shouldShow"&gt;&lt;/div&gt;
type: Answer
score: 10

http://stackoverflow.com/comment/45959385
type: Comment
type: QuestionComment
has text: @Paul S. The submission will cause the second page to open. I'm not totally sure what you mean by same origin?
score: 0
comment on: http://stackoverflow.com/q/28845289

http://stackoverflow.com/q/28887969
has body: I'm using HTML5 videos on our site. I've tried with plain HTML5 and with the Video.js plugin. Both of which, when you click the full screen button in the controls, make the entire page fullscreen but not the video. I can't tell if it's something with my CSS, or some other bug. Does anyone have an idea why it's doing this? Here's a link for an example: example video Here is a code snippet for the video with video.js involved: $title
upvote count: 1
tagged with: html5-video
type: Question
answer count: 1
has comment: http://stackoverflow.com/comment/46038102
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46037696
favorite count: 0
has answer: http://stackoverflow.com/a/28901037
tagged with: http://stackoverflow.com/tag/html
has title: Why is HTML5 video fullscreen making the whole page fullscreen?
tagged with: css
has comment: http://stackoverflow.com/comment/46041222
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/46038292

http://stackoverflow.com/a/28774036
has body: The issue is that your assigning your directiveData in the same scope every time, so you're overwriting the previous object. How about moving the scope creations at the beginning of the loop and assigning the object to that newly created scope ? Also, I inverted the DOM append call and the $compile call. From my experience, it's better to do it that way (I might be wrong though). for(i = 0; i < trueTest.length; i++) { var scope = $scope.$new(); var test = trueTest[i]; scope.directiveData = { blockId: test.blockId, dataType: test.dataType, type: test.type, directiveType: test.directiveType }; var el = $(" "); elem.find('.SomeElement').append(el); $compile(el)(scope); } I have not tested it, but it should be closer to working.
has comment: http://stackoverflow.com/comment/45847410
upvote count: 1
has comment: http://stackoverflow.com/comment/45826372
has comment: http://stackoverflow.com/comment/45874359
has comment: http://stackoverflow.com/comment/45826863
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45834266
score: 1
accepted answer of: http://stackoverflow.com/q/28772822
answers question: http://stackoverflow.com/q/28772822
type: Answer

http://stackoverflow.com/comment/45888620
type: Comment
comment on: http://stackoverflow.com/a/28806971
score: 0
type: AnswerComment
has text: Thanks, got me on the right track found [Guffa's answer](http://stackoverflow.com/questions/8098202/javascript-detecting-valid-dates) worked for me.

http://stackoverflow.com/comment/45940803
type: Comment
has text: Wow!! That works! It does give me back the difference in days. Thank you so much!! Is there any chance you could help me out with how to use this number to display a string?
comment on: http://stackoverflow.com/a/28835534
type: AnswerComment
score: 0

package.json
tag name: package.json
tags question: http://stackoverflow.com/q/28763958
tags question: http://stackoverflow.com/q/28752965
type: Tag

http://stackoverflow.com/comment/45888043
type: AnswerComment
comment on: http://stackoverflow.com/a/28805533
score: 0
type: Comment
has text: Yep that is because element is a jQuery object and is not related to AngularJS.

http://stackoverflow.com/a/28842288
upvote count: 3
type: AcceptedAnswer
has body: A good way to use the Array.ForEach(), where it can be also used to loop on objects having the value as the first parameter and the key (if exists) in the second. In your example the for each takes this array, and loops on it retrieving one object at a time. This object has a Date key in it, so you can access it using the obj.key. However, it is always good to use the .hasOwnProperty to check if the key exists first. You can also use the forEach to loop through the object keys and then you will be able to have the obj/key. For example, looping on every obj from the array loop will give you obj =&gt; 17-3-2015 | key =&gt; Date ... etc. var x = [{"Date":"17-3-2015","Event":"Test drive","Participants":"John, George","Description":"Testing a new F30"}, {"Date":"17-3-2015","Event":"Football match","Participants":"FCSM vs FCKK","Description":"New season start"}, {"Date":"25-3-2015","Event":"Jane's Birthday","Participants":"Jane, John, Richard, Alice","Description":"Celebration with my friends"}]; x.forEach(function(obj,key){console.log(obj.Date) }); Your code can be: JSON.parse(localStorage.getItem('events')).forEach(function(obj,key){console.log(obj.Date) });
has comment: http://stackoverflow.com/comment/46034338
has comment: http://stackoverflow.com/comment/45953900
type: Answer
score: 3
downvote count: 0
answers question: http://stackoverflow.com/q/28842153
accepted answer of: http://stackoverflow.com/q/28842153

http://stackoverflow.com/a/28867419
has comment: http://stackoverflow.com/comment/51789640
upvote count: 20
type: Answer
has body: Surely if all you want to do is strip the &amp;nbsp; entities from your text then you just do a global match and replace: db.tests.find({ "name": /\&amp;nbsp;/g }).forEach(function(doc) { doc.name = doc.name.replace(/&amp;nbsp;/g,""); db.tests.update({ "_id": doc._id },{ "$set": { "name": doc.name } }); }); So there should be no need to write out every combination, the regex will replace very match with the /g option. Possibly also use /m for multi-line is your "name" string contains newline characters. See a basic regexer example. It is also recommended to use $set in order to only modify the field(s) you really want to rather than .save() the whole document back. There is less traffic and less chance of overwriting changes that might have been made by another process since the document was read. Ideally you would use the Bulk Operations API with MongoDB versions 2.6 and greater. This allows the updates to "batch" so there is again less traffic between the client and the server: var bulk = db.tests.initializeOrderedBulkOp(); var count = 0; db.tests.find({ "name": /\&amp;nbsp;/g }).forEach(function(doc) { doc.name = doc.name.replace(/&amp;nbsp;/g,""); bulk.find({ "_id": doc._id }) .updateOne({ "$set": { "name": doc.name } }); count++; if ( count % 1000 == 0 ) { bulk.execute(); bulk = db.tests.initializeOrderedBulkOp(); } }); if ( count % 1000 != 0 ) bulk.execute(); Those are your primary ways to improve this. Unfortunately there is no way for a MongoDB update statement to use an existing value as part of it's update expression in this way, so the only way is looping, but you can do a lot to reduce the operations as is shown.
downvote count: 1
score: 19
answers question: http://stackoverflow.com/q/28866930
accepted answer of: http://stackoverflow.com/q/28866930
type: AcceptedAnswer

http://stackoverflow.com/q/28852837
has title: How to use enter key in bootstrap modal, like tab key
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/28853114
has body: How to use enter key like tab in forms which is in bootstrap3 modal. Below code working properly in html forms, but not working in bootstrap modal &lt;script&gt; function OnKeyPress(field, event) { if (event.keyCode == 13) { for (i = 0; i &lt; field.form.elements.length; i++) if (field.form.elements[i].tabIndex == field.tabIndex + 1) { field.form.elements[i].focus(); if (field.form.elements[i].type == "text") field.form.elements[i].select(); break; } return false; } return true; } &lt;/script&gt; The function is calling like this &lt;input type="text" class="form-control enter modal-count" id="Name" value="" tabindex="1" onKeyPress="return OnKeyPress(this, event)"&gt;
tagged with: twitter-bootstrap
type: UnansweredQuestion
type: Question

http://stackoverflow.com/comment/46060585
type: Comment
comment on: http://stackoverflow.com/a/28900633
score: 0
type: AnswerComment
has text: I do not know what you are testing on.

foreground
type: Tag
tags question: http://stackoverflow.com/q/28764935
tag name: foreground

http://stackoverflow.com/comment/46046221
type: Comment
type: QuestionComment
has text: nielarshi thank for help. this is not the solution for my problem.
comment on: http://stackoverflow.com/q/28892824
score: 0

http://stackoverflow.com/a/28873929
upvote count: 0
has comment: http://stackoverflow.com/comment/46043025
score: -1
answers question: http://stackoverflow.com/q/28873716
has body: Use if(isset($_POST['submit']) != '') before the form. Change your code to this: &lt;?php session_start(); if(isset($_POST['submit']) != '') { $_SESSION['acc_main'] = $_POST['acc1']; $_SESSION['acc_id'] = $_POST['acc2']; $_SESSION['acc_cat'] = $_POST['acc3']; ?&gt; &lt;form name="form1" id="form1" action=""&gt; &lt;input type="text" name="acc1" value="&lt;?php echo $_SESSION['acc_main']" /&gt; &lt;input type="text" name="acc2" value="&lt;?php echo $_SESSION['acc_id']" /&gt; &lt;input type="text" name="acc3" value="&lt;?php echo $_SESSION['acc_cat']" /&gt; &lt;input type="submit" name="submit"&gt; &lt;/form&gt; &lt;?php }else{ ?&gt; &lt;form name="form1" id="form1" action=""&gt; &lt;input type="text" name="acc1" value="&lt;?php echo $_SESSION['acc_main']" /&gt; &lt;input type="text" name="acc2" value="&lt;?php echo $_SESSION['acc_id']" /&gt; &lt;input type="text" name="acc3" value="&lt;?php echo $_SESSION['acc_cat']" /&gt; &lt;input type="submit" name="submit"&gt; &lt;?php } ?&gt;
type: Answer
downvote count: 1

http://stackoverflow.com/comment/46046180
comment on: http://stackoverflow.com/q/28892865
type: Comment
type: QuestionComment
score: 2
has text: "Is there a way you could..." is almost always a lead in to a question that is outside the scope of this format. The answer to that is probably yes, but I think you really want to ask if what you have tried is the right approach, or why what you did try didn't work. see [ask]

http://stackoverflow.com/comment/45875120
comment on: http://stackoverflow.com/a/28800280
has text: @PaulS.: indeed, that's a remnant of an earlier issue in which I used `return el`, and then overlooked. Edited..
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28831598
has comment: http://stackoverflow.com/comment/45933617
answers question: http://stackoverflow.com/q/28831311
has comment: http://stackoverflow.com/comment/45933277
score: 0
has body: Try this.. About Us Rooms Reservation Gallery Contact Us
has comment: http://stackoverflow.com/comment/45932853
type: Answer

http://stackoverflow.com/comment/46059121
comment on: http://stackoverflow.com/q/28899923
has text: Please post some html
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45806508
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28763281
has text: Hm, looks like you went with injecting content scripts through manifest? Then you lose the advantages of `activeTab`, but gain automatic execution instead of clicking on the button. I assume those are the changes you mention.

http://stackoverflow.com/q/28874795
linked to: http://stackoverflow.com/q/6466135
tagged with: php
has title: How to add eight 0 before primary key using php and javascript
has answer: http://stackoverflow.com/a/28875012
type: Question
tagged with: javascript
score: 0
has body: I want to create two separate functions in php and in javascript when I fetch my primary key and I pass it to my php function it adds eight time 0 when value of primary key came up to 10 then 0 numbers should be seven and when it came to 100 then 0 should be six before my primary key of mysql and same separate function in javascript. When I pass it my primary key the same functionality should work in also javascript I try to find at google but there is not any example for it. I know there is an option in mysql called zero filling but I want to do that with php and javascript.
upvote count: 1
has comment: http://stackoverflow.com/comment/46011888
answer count: 1
downvote count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/46012379
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46012293

http://stackoverflow.com/comment/49210663
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28766307
type: QuestionComment
has text: Where do you see this? Not just on facebook.com right?

http://stackoverflow.com/q/28837878
answer count: 1
tagged with: angularjs-ng-repeat
favorite count: 0
has answer: http://stackoverflow.com/a/28838003
tagged with: angularjs
upvote count: 2
has body: How can I ng-repeat this kind of json data? I want to echo game and stats separataly. { "game": [ { "home": "Home Team", "away": "Away Team", "date": "2015-01-13", "result": "2-0" } ], "stats": [ { "event": "Goal", "time": 27, "player": "Player One" }, { "event": "Yellow Card", "time": 52, "player": "Player Two", } ] } Thank you in advance!
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
accepted answer: http://stackoverflow.com/a/28838003
type: Question
score: 2
tagged with: arrays
downvote count: 0
tagged with: javascript
has title: AngularJS ng-repeat json-format

http://stackoverflow.com/q/28823636
score: 0
has title: Difference of $(document) and $('parentSelector') for adding events of dynamically add element?
tagged with: jquery-selectors
has answer: http://stackoverflow.com/a/28823665
type: UnansweredQuestion
has body: I am confused with the $(document) in using this as my selector for a click event? Any difference or cos instead of using only the parent selector? Both of them produces the same output but is there any factor like executing speed? You can test this FIDDLE var counter = 0; Using parent selector $(".parent").on("click", "button.btn", function(){ $(".parent").append(" new button " + (++counter) + " "); }); or $(document) $(document).on("click","button.btn",function(){ $(".parent").append(" new button " + (++counter) + " "); });
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28823688

http://stackoverflow.com/a/28846367
has body: You can updating your datatables, by the code you posted you are using a old version. In the new version you have a column function to get the columns by selectors. Check the API doc
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/28846154
downvote count: 0
has comment: http://stackoverflow.com/comment/45961929
has comment: http://stackoverflow.com/comment/45961644
score: 1

http://stackoverflow.com/q/28901777
has answer: http://stackoverflow.com/a/28901872
accepted answer: http://stackoverflow.com/a/28901830
has comment: http://stackoverflow.com/comment/46063286
linked to: http://stackoverflow.com/q/2769392
answer count: 3
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28901872
favorite count: 0
has comment: http://stackoverflow.com/comment/46063354
linked to: http://stackoverflow.com/q/5466906
has answer: http://stackoverflow.com/a/28902166
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/14317758
tagged with: css
has body: I'm creating a large set of HTML components that works in every browser (where did the idea started anyway :-) ) Now, I want to have a button, and according to this post on StackOverflow, I should not use a button because that one has a 3D push effect on click. In order to remove that one, the advice was to use a a href and style that to the button I like. So here's the HTML: Yes And off course, here's the HTML: a.button { color: #444; border: 1px solid #ababab; cursor: default; padding: 0 5px 0 5px; text-decoration: none; } a.button:hover { background-color: #cde6f7; border: 1px solid #92c0e0; } a:active.button { background-color: #92c0e0; border: 1px solid #2a8dd4; } Nothing really commplicated Now, this does all work in Google Chrome and Firefox as this JsFiddle demonstrates. The button has 3 different states: A normal 'default' button. A style when you hover on it. A style when you click on it. Now, Internet Explorer does not apply a new style when you click on the button, it's the same style as the one on hovering. Unless you click the border (If you manage to click the border, than the correct style does apply). Now, why do I have this behaviour and can it be solved as it is crucial to the development of my Control Suite. I know it's possible to solve with jQuery by adding a removing a class when you click on it, but this seems a very ugly solution and if there's a 'CSS-Friendly' solution, I would like to use that one.
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/28901830
upvote count: 3
has title: Style a a href as a button
type: Question
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/45989141
comment on: http://stackoverflow.com/q/28858145
type: Comment
type: QuestionComment
score: 0
has text: Ok Thanks for your help, I was struggling to figure out how to dialog would be displayed.

http://stackoverflow.com/a/28774524
has comment: http://stackoverflow.com/comment/45869635
has comment: http://stackoverflow.com/comment/45832241
has body: $on only listen for angular event such as $braodcast &amp; $emit only and they will work within bootstrapped app module only. If you want to listen jQuery events then it should use .on/.bind as like we do in jquery like $('selector').on('event',function(){}); If multiple events are associated with single DOM element then prefer Directive would be the better way get track of element event. Directive: app.directive('myCustomer', function() { return { restrict: 'E', compile: function(element,attrs){ element.on('click focus blur',function(){ //code here }); } }; }); Otherwise you can bind event listener on specific element, then you can bind it by taking help of jQLite using $document, $window, $element(Provides controller level element) dependency. Controller $document.find('.myClass').on('click',function(e){ //placing on specific element. //code here }); Plunkr Example Hope this could help you, Thanks.
upvote count: 1
has comment: http://stackoverflow.com/comment/45829371
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28773900

http://stackoverflow.com/q/28804311
downvote count: 0
accepted answer: http://stackoverflow.com/a/28804510
favorite count: 0
tagged with: promise
linked to: http://stackoverflow.com/q/8228281
has title: Calling async functions recursively
possible better answer: http://stackoverflow.com/a/28804517
tagged with: node.js
score: 2
type: AnsweredQuestion
tagged with: bluebird
type: Question
has answer: http://stackoverflow.com/a/28804517
tagged with: javascript
has body: I need to have an async method eg. getWeather called forever with a small delay between the success of previous call and beginning of the next call. I have used a recursive function for the purpose. I am concerned if this can cause a performance hit. Are there any better ways to do this? var request = require('request'); var Promise = require('bluebird'); var delayTwoSecs = function() { return new Promise(function(resolve, reject) { setTimeout(function() { resolve(); }, 2000); }); }; var getWeather = function() { return new Promise(function(resolve, reject) { request({ method: 'GET', uri: 'http://api.openweathermap.org/data/2.5/weather?lat=35&amp;lon=139' }, function(error, response, body) { if (error) { reject(error); } else { resolve(body) } }); }); }; var loopFetching = function() { getWeather() .then(function(response) { console.log(response); return delayTwoSecs(); }).then(function(response) { loopFetching(); }); }; loopFetching();
upvote count: 2
answer count: 2
has answer: http://stackoverflow.com/a/28804510

http://stackoverflow.com/q/28850384
score: 1
has body: Do you know any tool for merging a js file into an other but keep the formatting? ex., merge x({a: 5, b: 6}); into x({ a: 1, b: 2, }); and the resoult would be x({ a: 5, b: 6, }); instead of merging conflict I think a tool which can merge to js ast (the syntax tree that esprima and FF Parser API produces) in the way of refreshing just the values and leave the formatting informations of the existing blocks as it was wouldn't be so complicated but i didn't find one. Do i miss something?
type: Question
tagged with: abstract-syntax-tree
tagged with: javascript
tagged with: esprima
has comment: http://stackoverflow.com/comment/105759735
has title: Merge js files regardless formatting. ex. merging esprima ast's
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/45968093
has comment: http://stackoverflow.com/comment/45968410
answer count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: merge

http://stackoverflow.com/comment/45942414
type: QuestionComment
type: Comment
has text: are storedLinks and storedNodes defined globally?
comment on: http://stackoverflow.com/q/28836275
score: 0

dc.js
tag name: dc.js
tags question: http://stackoverflow.com/q/28882883
tags question: http://stackoverflow.com/q/28855309
type: Tag
tags question: http://stackoverflow.com/q/28810849

http://stackoverflow.com/a/28841974
answers question: http://stackoverflow.com/q/28841454
has comment: http://stackoverflow.com/comment/45973141
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/46355530
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46404112
has comment: http://stackoverflow.com/comment/45989592
type: Answer
has comment: http://stackoverflow.com/comment/46478192
accepted answer of: http://stackoverflow.com/q/28841454
has body: I'm not sure why you need this and which case this is a good idea for, but you can try this (untested): # show.js.haml // some javascript = render file: Rails.root.join('public' , 'js', 'jquery-1.11.2.min.js') // or "#{render file: Rails.root.join('public' , 'js', 'jquery-1.11.2.min.js')}" Of course this will only work for local resources accessible, but hey, that's what &lt;script src= is for. EDIT In case of needing to store the contents of the file in a variable as a string, you can use capture. For remote files you can use open-uri, which is part of Ruby's stdlib. # show.js.haml - content = capture do - render file: Rails.root.join('public' , 'js', 'jquery-1.11.2.min.js') # for remote files - content = open('http://url.to/file.js').read You can print the content later on: = content

http://stackoverflow.com/a/28827923
has comment: http://stackoverflow.com/comment/45946629
upvote count: 3
has body: You can use var sequelize = new Sequelize("postgres://username:password@localhost:5432/jobletics"); for connecting to postgresql database, but sequelize does not create nor user nor database for you. You must do it yourself. Use createuser and createdb postgres utilities to create them, or user -c flag of psql command. You also must have privilege to do it, so in the next example commands run using postgres user: su postgres -c "psql -U postgres -c \"CREATE USER username WITH ENCRYPTED PASSWORD 'password'\"" su postgres -c "psql -U postgres -c \"CREATE DATABASE jobletics WITH OWNER=username ENCODING='UTF8'\""
type: Answer
downvote count: 0
score: 3
answers question: http://stackoverflow.com/q/28825909

http://stackoverflow.com/comment/45955703
has text: Yes, unless I don't understand the question.
comment on: http://stackoverflow.com/a/28842898
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45853445
has text: Check for something that should only exist in the browser (document) or node (exports). This is how underscore does it https://github.com/jashkenas/underscore/blob/master/underscore.js#L45-L55
score: 0
comment on: http://stackoverflow.com/q/28788911
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45801005
comment on: http://stackoverflow.com/a/28760336
has text: Thanks, but I'm not using jQuery, I thought maybe I could use $on ?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45917604
type: QuestionComment
comment on: http://stackoverflow.com/q/28823066
score: 0
has text: What about doing it the opposite...hide with css... if `getItem('toggle') =='hide'` then do nothing, otherwise use something like `slideDown()` to show
type: Comment

http://stackoverflow.com/comment/45911088
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/28819517
has text: should see what's in `xhr.responseText`

http://stackoverflow.com/comment/45898549
has text: Also, On similar lines, Adding a reference to a file works fine, but that adds referenced files to generated output. Is there a way to get around this ?
type: Comment
comment on: http://stackoverflow.com/q/28813326
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45885600
type: Comment
comment on: http://stackoverflow.com/q/28800388
score: 0
has text: so whats the problem that you are facing within it
type: QuestionComment

http://stackoverflow.com/q/28777486
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45833115
score: 0
has body: I'm very frustrated trying to fix the following code. I'm new in Javascript and I'd like a little help here: I have the following code where I've tried to insert all this in Bootstrap-Table but without success. I'm always getting the next error: No matching records found. &lt;script&gt; function showResult(sectoresURL) { $('#info').empty(); // First, remove all child in stack. $.getJSON(sectoresURL, function (json) { if (sectores.getVisible() &amp;&amp; typeof(json.features[0]) != 'undefined') { $('#info').append('&lt;table id=table-javascript&gt;&lt;/table&gt;'); buildSectorTable(sectoresURL); } }); } function buildSectorTable(sectoresURL) { $('#table-javascript').bootstrapTable({ method: 'get', url: sectoresURL, cache: true, height: 400, striped: true, pagination: true, pageSize: 50, pageList: [10, 25, 50, 100, 200], search: true, showRefresh: true, minimumCountColumns: 2, clickToSelect: false, showToggle: true, columns: [{ field: 'type', title: 'Numero', align: 'center', valign: 'bottom', sortable: true }] }); } &lt;/script&gt; Here, I just tried to insert "Numero". By the way, the JSON Data is: { "type": "FeatureCollection", "features": [ { "type": "Feature", "id": "SectoresComunaCurico.34", "geometry_name": "FiguraGeometrica", "properties": { "Numero": 19, "Sector": "Cordillera" } } ], "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:EPSG::32319" } } }
has answer: http://stackoverflow.com/a/28777686
accepted answer: http://stackoverflow.com/a/28777686
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45833069
type: AnsweredQuestion
has title: How to insert the following JSON Data into a table?
tagged with: twitter-bootstrap
type: Question
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45842071
answer count: 1

http://stackoverflow.com/comment/45931096
has text: Hello @RahulVarma, thanks for your answer. Could you please show me how can I do it with an example in my code?
comment on: http://stackoverflow.com/q/28830234
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/28853654
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/45973581
has comment: http://stackoverflow.com/comment/45973780
has title: jQuery Cross-Origin Request Blocked on Wikipedia
linked to: http://stackoverflow.com/q/9310112
type: Question
duplicate of: http://stackoverflow.com/q/9310112
tagged with: javascript
tagged with: jquery
has body: I am developing an application that fetch keywors from wikipedia using the api. I am using getJSON in jquery. My code is jQuery( document ).ready(function($) { console.log( "System Ready" ); $('#searchInput').keypress(function(tval){ if (tval.which !== 0 &amp;&amp; !tval.ctrlKey &amp;&amp; !tval.metaKey &amp;&amp; !tval.altKey) { console.log($(this).val()); var wikiurl = "http://en.wikipedia.org/w/api.php?" $.getJSON( wikiurl, { action: "opensearch", serach: $(this).val(), format: "json" }) .done(function( data ) { console.log(data); }); } }); }); But it is getting error Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://en.wikipedia.org/w/api.php?&amp;action=opensearch&amp;serach=&amp;format=json. This can be fixed by moving the resource to the same domain or enabling CORS. But the Example in http://api.jquery.com/jquery.getjson/ is working fine &lt;script&gt; (function() { var flickerAPI = "http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?"; $.getJSON( flickerAPI, { tags: "mount rainier", tagmode: "any", format: "json" }) .done(function( data ) { $.each( data.items, function( i, item ) { $( "&lt;img&gt;" ).attr( "src", item.media.m ).appendTo( "#images" ); if ( i === 3 ) { return false; } }); }); })(); &lt;/script&gt; No Cross Site Request Errors. How this happens? How can I resolve? I am testing the code on my localhost. and Using Firefox and Firebug.
downvote count: 0
score: 1
favorite count: 0
answer count: 0

http://stackoverflow.com/comment/45999777
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28866556
has text: How is my inner accordion able to accidentally call functions of the parent accordian's scope?
score: 0

http://stackoverflow.com/comment/46023278
score: 2
has text: It isn't really in the right place, given that it has nothing to do with code
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28880602

http://stackoverflow.com/comment/46176407
type: Comment
has text: @Martial Sorry I missed your comment earlier. But the example here was provided in reference to the context of the question you asked. In the case where you wish to "examine" parts of the "related data" as part or your query expression then the best case is to "embed" that data within the "parent document" as per the context of the answer to the question asked. This answers the question asked. Should you have another question with different conditions then you are best to [Ask Another Question](http://stackoverflow.com/questions/ask) which is the purpose of this site.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28890887

http://stackoverflow.com/comment/45897199
comment on: http://stackoverflow.com/q/28812132
score: 0
type: Comment
type: QuestionComment
has text: @epascarello I'm loading more comments into page

http://stackoverflow.com/comment/45887193
type: QuestionComment
has text: use $("#message").style('display','block'); to show the message..
comment on: http://stackoverflow.com/q/28807157
score: 0
type: Comment

http://stackoverflow.com/a/28828642
accepted answer of: http://stackoverflow.com/q/28827977
score: 0
answers question: http://stackoverflow.com/q/28827977
type: Answer
has body: You are mixing up DocumentFragment vs. Node. The content of template is apparently an instance of DocumentFragment: node 1 node 2 etc According to the documentation, Node#appendChild accepts document fragments: Various other methods can take a document fragment as an argument (e.g., any Node interface methods such as Node.appendChild and Node.insertBefore), in which case the children of the fragment are appended or inserted, not the fragment itself. So, what do you expect to be a parent of document fragment? It’s obviously null, since the entity “document fragment” is virtual in this context. So, to achieve what you want you are to create a container at first, and then append nodes to it / clean it’s content up. ... ... There is common approach to add template content involving ShadowDOM: var shadow = document.querySelector('#container').createShadowRoot(); shadow.appendChild(document.querySelector('#tmpl').content, true); or not using ShadowDOM, inserting as is: document.querySelector('#container').appendChild( document.querySelector('#tmpl').content, true ); Hope it helps.
type: AcceptedAnswer

http://stackoverflow.com/q/28798359
has answer: http://stackoverflow.com/a/28798382
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28798565
score: 0
type: Question
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/45871347
has comment: http://stackoverflow.com/comment/45871385
has answer: http://stackoverflow.com/a/28798565
has body: I just started using ui router instead of ng-route and I have the following error: ReferenceError: $location is not defined at new homeController (app.js:345:18) at invoke (angular.js:3762:17) at http://localhost:8080/shop/resources/lib/angular/angular-ui-router.js:3807:21 My controller: function headerController($scope, $location){ var host = $location.host(); } Do I have to include ng-route as dependency in my module? Thanks.
tagged with: angularjs
has title: $location not defined when using only ui.router
has comment: http://stackoverflow.com/comment/45871130
possible better answer: http://stackoverflow.com/a/28798382

http://stackoverflow.com/q/28752589
type: Question
tagged with: phantomjs
has title: How to ouput data to a file in CasperJS?
score: 0
answer count: 1
tagged with: javascript
has body: I'm using CasperJS for a data scraping project I'm working on. I've got it up and running and my initial scripts are starting to work. I have it outputting the table I need to the console. Now I need to figure out how to get it to put the data I need into a file, so that I may import it into my eCommerce management software. Does anyone have any tips on how to get it to spit out the data into a file, preferably CSV or something I can open with Excel. The working code I've got looks like this so far: var casper = require('casper').create(); casper.start('http://www.123FAKE.com/'); casper.then(function(){ this.thenOpen('http://www.123FAKE.com/products/?partNumber=1131180961', function(){ this.echo(this.getHTML('table.partFitmentTable', true)); }); }); casper.run(); Any advice would be greatly appreciated!
has answer: http://stackoverflow.com/a/28754196
tagged with: casperjs
type: UnansweredQuestion

http://stackoverflow.com/a/28885732
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46034781
type: Answer
has comment: http://stackoverflow.com/comment/46034066
score: 2
has comment: http://stackoverflow.com/comment/46044387
downvote count: 2
has body: You can use as selector: $(".person:not(:has(.name))") But i'd suggest you to filter it instead: Because :has() is a jQuery extension and not part of the CSS specification, queries using :has() cannot take advantage of the performance boost provided by the native DOM querySelectorAll() method. $(".person").filter(function(){ return !$(this).find(".name").length; }) -jsFiddle-
upvote count: 4
answers question: http://stackoverflow.com/q/28885646
has comment: http://stackoverflow.com/comment/46033713
accepted answer of: http://stackoverflow.com/q/28885646

http://stackoverflow.com/q/28892727
has comment: http://stackoverflow.com/comment/46049518
has comment: http://stackoverflow.com/comment/46046496
tagged with: arrays
has body: I am trying to build a image gallery for mobile. I have stored image into an array(photos array). It working fine except that it is preloading all images of array. I dont want to preload image, start loading image only after function forward or backward is called. I have try these code into UC browse & google chrome. In UC browser its not preloading the image but in chrome it does. View Code Javascript HTML prev next
answer count: 0
has comment: http://stackoverflow.com/comment/46046024
has comment: http://stackoverflow.com/comment/46083680
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46049609
has comment: http://stackoverflow.com/comment/46080992
has comment: http://stackoverflow.com/comment/46083394
has title: How to stop preloading image of javascript array
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46046350
has comment: http://stackoverflow.com/comment/46046075
type: Question
score: 0

http://stackoverflow.com/q/28819815
possible better answer: http://stackoverflow.com/a/28820016
has answer: http://stackoverflow.com/a/28819979
has answer: http://stackoverflow.com/a/28820016
has body: I'm trying to create a simple px to em converter that automatically calculates the values when one of the input fields is changed. I've got the code to calculate the values but it won't update when a value is changed. Heres the HTML PX to EM converter Enter a base pixel size px px em em px And the js $(document).ready(function() { var baseSize2 = $('#baseSize').val(); var pxInput = $('#pxInput').val(); var emInput = $('#emInput').val(); var emOutput = function() { return pxInput / baseSize2; }; var pxOutput = function() { return emInput * baseSize2; }; $('#baseSize').attr('value', baseSize2); $('#pxInput').attr('value', pxInput); $('#emInput').attr('value', emInput); $('#pxOutput2').html(pxOutput); $('#emOutput2').html(emOutput); }); Any help would be most appreciated
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28819979
answer count: 2
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
score: 1
favorite count: 0
tagged with: var
type: Question
upvote count: 1
has comment: http://stackoverflow.com/comment/45911752
has title: Updating a variable when input changes in jquery

http://stackoverflow.com/comment/45884002
comment on: http://stackoverflow.com/q/28805420
type: Comment
has text: Before set property to Object you should create empty object like so myArray[0] = {}; myArray[1] = {}; myArray[2] = {};
type: QuestionComment
score: 0

http://stackoverflow.com/a/28771795
has body: I don't know why it doesn't work with cloneNode, but you can achieve the same result by copying the innerHTML to a new script node. var clone = document.createElement('script'); clone.innerHTML = document.getElementById('hello').innerHTML; document.body.appendChild(clone); console.log('copied the script'); Copied scripts do execute
answers question: http://stackoverflow.com/q/28771542
score: 5
upvote count: 5
type: Answer
downvote count: 0

http://stackoverflow.com/q/28822425
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28822569
type: UnansweredQuestion
has title: How to write to page in java script DOm model
has body: I am doing a java script application that calculates Miles driven / gallons used and gallons used* price per gallon. I have two problems: 1) when I enter all the values price per gallon adds a another zero automatically. For example 40, becomes 400. 2) I am looking to write the result of both calculations underneath the button. If anyone can give me guidance or help I would really appreciate it. &lt;!DOCTYPE &lt;html&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;title&gt; MPG application &lt;/title&gt; &lt;script&gt; var $ = function(id) { return document.getElementById(id); } /* the user entries will be parsed floats and a if statment is checking to see if the person enters not #*/ var calculateMpg = function () { var miles = parseFloat($("miles").value); //alert(miles); var gallons = parseFloat($("gallons").value); var costGallon = document.getElementById("costGallon").value; if (isNaN(miles) || isNaN(gallons)) { alert("enter a valid number"); } else { var mpg = miles/gallons; var costGallon = gallons*costGallon; $("costGallon").value=costGallon.toFixed(2); //alert("your total is" +mpg ); alert("your total new is " + costGallon); //cost of trip = gallons used * price per gallon } } //write to the page window.onload = function () { $("calculate").onclick = calculateMpg; //focues means brings the window to the front $("costGallon").focus(); } &lt;/script&gt; &lt;/head&gt; &lt;section&gt; &lt;body&gt; &lt;h1&gt; calculate mPG &lt;/h1&gt; &lt;p&gt;Enter the information below&lt;/p&gt; &lt;label for="miles"&gt;Miles Driven: &lt;/label&gt; &lt;!--the code under gives a form box of text--&gt; &lt;input type="text" id="miles"&gt; &lt;br&gt;&lt;br&gt;&amp;nbsp; &lt;label for = "gallons"&gt; Gallons of gas used :&lt;/label&gt; &lt;input = "text" id="gallons"&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &lt;label for = "costGallon"&gt; Price per Gallon: &lt;/label&gt; &lt;input = "text" id="costGallon" &gt;&lt;br&gt;&lt;br&gt; &lt;label&gt;&amp;nbsp;&lt;/label&gt; &lt;input type = …
type: Question

http://stackoverflow.com/q/28784043
has comment: http://stackoverflow.com/comment/45844487
type: AnsweredQuestion
has title: how to get the dataset from string?
type: Question
has answer: http://stackoverflow.com/a/28784242
tagged with: javascript
has body: please help bring an array of data. spring is here: {"news": [{"img": "http://static2.smi2.net/img/160x120/2212764.jpeg", "title": "Усиление слуха в 2 - 3 раза! Уникальная разработка", "url": "http://news.smi2.ru/newdata/news?ad=681120&amp;bl=81060&amp;ct=adpreview&amp;st=16&amp;in=lJUrBQDHL4CgZAoA", "id": "681120"}]} I do the following: var massive = JSON.parse('http://news.smi2.ru/data/js/81060.js'); console.log(massive.news.id); console.log(massive.news.img); console.log(massive.news.title); console.log(massive.news.url); The result is the following error message: Uncaught SyntaxError: Unexpected token h use only the native js
score: 4
possible better answer: http://stackoverflow.com/a/28784109
upvote count: 4
has answer: http://stackoverflow.com/a/28784109
answer count: 2
accepted answer: http://stackoverflow.com/a/28784242
downvote count: 0
has comment: http://stackoverflow.com/comment/45844369
favorite count: 0

http://stackoverflow.com/comment/46006799
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28850803
score: 1
has text: A debugger is something used to pause execution of code so that you can look at values. If you hit f12 in most modern browsers you'll get some way to look at the js code loaded (ie it's called, "debugger", chrome it's called "code" if I remember correctly). If you click next to a line number it'll put in a red dot there and when the page loads next it'll stop there and you can look at variables and objects. If you use Visual Studio or some other tool you can do the same thing as you edit the file! Debuggers are extremely powerful tools for discovering why your code doesn't work.

http://stackoverflow.com/comment/45874080
type: AnswerComment
comment on: http://stackoverflow.com/a/28799173
type: Comment
has text: They problem with this is that hitting enter on a form field also submits the form.
score: 0

http://stackoverflow.com/comment/45873447
has text: `null` and `undefined` are falsy as well, so if you intend to use an if statement to check the value later you don't have to use `false` as a default. Using OR that way is generally done when setting a default value, a truthy one. Unless you explicitly need `false` it doesn't really make sense to use it as a default value, as it's *falsy* anyway if the OR continues.
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28799597

http://stackoverflow.com/comment/45882236
type: Comment
score: 0
has text: pls run it with jquery library .. it should give you the name of that link
type: AnswerComment
comment on: http://stackoverflow.com/a/28804539

http://stackoverflow.com/comment/45988927
has text: The title of this question is wrong. "$parser" is undefined, not "ctrl". If "ctrl" were undefined, the error you'd be getting would be: "TypeError: Cannot read property '$parser' of undefined"
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/28861748

http://stackoverflow.com/a/28843315
score: 2
downvote count: 0
has body: You could use an interval (preferably inside a directive) to check the time and set the visibility but you could also use a filter that is evaluated in every digest cycle. app.directive('hideMeAtNight', function($interval) { return { restrict: "A", link: function(scope, element, attributes) { $interval(function() { var now = new Date(); element.toggleClass('ng-hide', now.getHours() < 6 || now.getHours() > 22); }, 1000) } }; }); app.filter('nightFilter', function() { return function() { var now = new Date(); return now.getHours() < 6 || now.getHours() > 22; } }); And you can use them like: This is a button This is a button Demonstrated at this plnkr http://plnkr.co/edit/tjAVWf
upvote count: 2
answers question: http://stackoverflow.com/q/28842704
type: Answer

http://stackoverflow.com/q/28815837
answer count: 1
has answer: http://stackoverflow.com/a/28860226
tagged with: javascript
tagged with: asp.net
favorite count: 0
has body: I used telerik:RadGrid batch editing; to fill this grid I used below syntax: function GridBind(GridID, GridData) { var TableView = GridID.get_masterTableView(); TableView.set_dataSource(GridData); TableView.dataBind(); } To Invoke batcheditcommand I used below syntax. It’s written under non-postback button Javascript event: function SaveAllChanges(sender,args) { var batchManager = $find('&lt;%=RadGrid1.ClientID%&gt;').get_batchEditingManager(); var tableViews = []; tableViews.push($find('&lt;%=RadGrid1.ClientID%&gt;').get_masterTableView()); batchManager.saveTableChanges(tableViews); } But unfortunately it did not fire server event RadGrid1_BatchEditCommand, so I want to invoke Radgrid batcheditcommand from code behind in C#.net.
duplicate of: http://stackoverflow.com/q/28870389
tagged with: telerik
tagged with: radgrid
has title: invoke method batcheditcommand from C#.net
type: UnansweredQuestion
downvote count: 1
linked to: http://stackoverflow.com/q/28870389
score: -1
tagged with: telerik-grid
type: Question
upvote count: 0

http://stackoverflow.com/comment/57262401
type: AnswerComment
comment on: http://stackoverflow.com/a/33689147
type: Comment
has text: This was actually my issue, so thank you for the answer. However, ironically this does not really answer the question that the OP demonstrated in his situation, but did help with the method I was using to load the modules.
score: 0

http://stackoverflow.com/comment/46093314
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28917803
has text: I think SO provides a better reference for posterity, so I prefer to answer questions here. (But I guess the user group grabs my attention more quickly.)

http://stackoverflow.com/comment/46054847
has text: They son't start with a /
comment on: http://stackoverflow.com/q/28892232
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28828157
score: 0
type: Question
has answer: http://stackoverflow.com/a/28828196
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28828196
answer count: 1
has body: I've a got a lot of user lists in my app, e.g. a list of your followers and followings, lists of followers and followings of other users, lists of users who liked a post, lists of users in search results, lists of users invited through referral program, and so on... If I create a separate store for every list and keep whole user records there, it's possible that the same user record will be in more than one store. Keeping these records in sync between stores doesn't seem like a good idea. I could have a single store with all user records and then the other stores would only need to store IDs of users they need. Is it a good idea to do it like this or are there other better approaches?
has title: In Flux architecture how does one manage stores that store the same type of data?
tagged with: flux
tagged with: frontend
tagged with: facebook
tagged with: architecture
type: AnsweredQuestion

http://stackoverflow.com/q/28812122
type: Question
tagged with: mean-stack
tagged with: javascript
has answer: http://stackoverflow.com/a/28814517
tagged with: express
score: 0
tagged with: pug
answer count: 1
tagged with: angularjs
has title: Not able to route to partial view in MEAN app
type: UnansweredQuestion
has body: I'm doing a tutorial for building single page apps with the MEAN stack. I've been successful with rendering to the index.jade view. However, when I try to list a route to a partial view, the DOM of the page doesn't render the view. Maybe this will be clear with the code server.js var express = require("express"); var stylus = require("stylus"); var logger = require("morgan"); var bodyParser = require('body-parser'); var env = process.env.NODE_ENV = process.env.NODE_ENV || "development"; var app = express(); function compile(str, path) { return stylus(str).set('filename', path); } app.set('views', __dirname + '/server/views'); app.set('view engine', 'jade'); app.use(logger('dev')); app.use(bodyParser()); app.use(stylus.middleware ({ src: __dirname + "/public", compile: compile } )); app.use(express.static(__dirname, 'public')); app.get('/partials/:partialPath', function (req, res) { res.render('partials/'+ req.params.partialPath); }) app.get('*', function (req, res) { res.render('index'); }); var port = 3030; app.listen(port); console.log("Listening on port number " + port); layout.jade doctype html head link(href="/favicon.ico", rel="shortcut icon", type="image/x-icon") link(rel="stylesheet", href="/css/bootstrap.css") link(rel="stylesheet", href="/vendor/toastr/toastr.css") link(rel="stylesheet", href="/css/site.css") body(ng-app='app') h1 Layout block content include scripts index.jade extends ../includes/layout block content section.content div(ng-view) h2 index.jade app.js angular.module("app", ["ngResource", "ngRoute"]); angular.module('app').config(function ($routeProvider, $locationProvider) { $locationProvider.html5Mode(true); $routeProvider .when('/', { templateUrl: '/partials/main', controller: 'mainCtrl' }) }); angular.module('app').controller('mainCtrl', function ($scope) { $scope.myVar = "Hello Anglularz"; }); main.jade extends ../../includes/layout block content section.partial h1 This is a partial h2 {{ myVar }} Have no idea what is going wrong. I sus…

http://stackoverflow.com/comment/45815923
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28758291
has text: @Bergi here's the async call: https://stackoverflow.com/questions/28736452/bluebird-promise-serial-iteration-and-resolve-to-modified-array, and the answer shows the mapSeries helper
type: Comment

http://stackoverflow.com/a/28891082
has comment: http://stackoverflow.com/comment/46094684
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/46086203
upvote count: 1
answers question: http://stackoverflow.com/q/28890880
has body: Did you try your path with POST or just GET? It could be exist for GET requests (pasting the url on a browser) but probably not for POST or other HTTP verbs. You can use REST clients like Postman to be sure, which is also a Chrome extension.
score: 1

http://stackoverflow.com/a/28901872
has comment: http://stackoverflow.com/comment/46063191
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/46063129
has body: This seems to be a simple problem of priority... a.button:hover is more accurate than a:active.button so it has precedence. The reason why the browsers don't all behave exactly the same is simply because they handle ties differently. Making sure that the different pseudo classes are always set at the same level of the selector rule will help counter this problem. So, this means a:active.button should be switched to a.button:active or the others be switched...
answers question: http://stackoverflow.com/q/28901777
downvote count: 0
type: Answer

http://stackoverflow.com/comment/45874759
score: 0
type: Comment
has text: Are you combining this with another script or do you have it by itself? If you are combining it you probably have a traveral issue and `.chat-messages` can't be found in the DOM.
type: AnswerComment
comment on: http://stackoverflow.com/a/28800384

http://stackoverflow.com/q/28864106
score: 1
has comment: http://stackoverflow.com/comment/45996248
accepted answer: http://stackoverflow.com/a/28889730
has comment: http://stackoverflow.com/comment/45996551
tagged with: google-apps-script
tagged with: google-sheets
answer count: 1
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/46040149
favorite count: 0
has title: Copy sheet to new spreadsheet, Add cell value to end of new spreadsheet name
has body: This is now creating the copy and adding the text to the end of the file name. The new file is located in the same directory as the original file. I can't seem to move the new file to the "Timesheet Archive" folder. Seems like I should just be able to specify the location for the new file? var range = sheet.getRange(2,7); var data = range.getValue(); var SSID = '1S3Vj5lYOchh0OJ5ZCamsoMCKtcTHeFd72nyxPHJYofk' var CopyDate = Utilities.formatDate(data , "GMT-8", "yy_MM_dd"); var folder = DriveApp.getFoldersByName('Timesheet Archive'); var id = DriveApp.getFileById(SSID) id.makeCopy(SpreadsheetApp.openById(SSID).getName() + "_" + CopyDate); I am moving to Google's new Sheets and am having trouble with this function which was working fine prior to the move: function exportData() { var sourceSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Timesheet"); var sourceData = sourceSheet.getDataRange().getValues(); sourceData.splice(0,1); // Remove header var targetSS = SpreadsheetApp.openById("1ZKQw9WnAFmJfC6GP_CYmSbQK_820zIR6oQGnLMc1yBM").getSheetByName("Master Time Sheet"); var targetRangeTop = targetSS.getLastRow(); // Get # rows currently in target targetSS.getRange(targetRangeTop+1,1,sourceData.length,sourceData[0].length).setValues(sourceData); var sheet = SpreadsheetApp.getActive().getSheetByName('Timesheet'); var ss = SpreadsheetApp.getActiveSpreadsheet(); var name = ss.getName(); // Not necessary var sheet = ss.getSheetByName('Timesheet'); // or whatever is the name of the sheet var range = sheet.getRange(2,7); var data = range.getValue(); var SSID = '1S3Vj5lYOchh0OJ5ZCamsoMCKtcTHeFd72nyxPHJYofk' var CopyDate = Utilities.formatDate(data , "GMT-8", "yy_MM_dd"); // Function Date + Format var folder = DocsList.getFolder('Timesheet Archive'); //Use this line if you want to get the folder by name var backup = DocsList.getFileById(SSID).makeCopy(SpreadsheetApp.openById(SSID).getName() + "_" + CopyDate); backup.addToFolder(folder); //This line will move the file b…
has answer: http://stackoverflow.com/a/28889730
has comment: http://stackoverflow.com/comment/45996114
upvote count: 1
has comment: http://stackoverflow.com/comment/46040196
type: Question
type: AnsweredQuestion

http://stackoverflow.com/comment/46067163
type: AnswerComment
comment on: http://stackoverflow.com/a/28901340
has text: @user4470749 Ok, added a runnable code snippet. Hope you find it helpful! The filter itself is actually fairly general and reusable - I may use it in my own projects. The controller's watch statements are a little clunky and could be refactored.
score: 0
type: Comment

http://stackoverflow.com/a/28887972
upvote count: 1
answers question: http://stackoverflow.com/q/28887822
score: 1
downvote count: 0
has body: use removeClass('selector'); $('input').on('keyup', function() { $('.red').removeClass('red'); }) .red { color:red; } red
type: Answer
has comment: http://stackoverflow.com/comment/46037199

http://stackoverflow.com/comment/119615227
type: Comment
has text: YES!! Thank you so much! -- My case was focusing the text input in React Native, based on a prop that showed the modal or not. This worked for me! `ref={input => input && this.props.showModal && input.focus()}`
comment on: http://stackoverflow.com/a/40235334
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45787291
score: 0
type: Comment
type: QuestionComment
has text: I think it can't apply to my app.
comment on: http://stackoverflow.com/q/28752424

http://stackoverflow.com/q/28780761
tagged with: ajax
has answer: http://stackoverflow.com/a/28781119
has body: tried to call the Ubergallery through an Ajax I had a lot of problems and I solve them with the following script. Now everything work as I want except one thing I have no navigation buttons. Can you help me solve this problem? You can see the buttons on the page that I call with ajax http://iliaspapantoniou.com/2/gallery.php but when you call it http://iliaspapantoniou.com/2/index.htm menu music the buttons are not there. Thank you in advance $(document).ready(function(){ $(document).on("click", "a[rel='colorbox']", function(e){ e.preventDefault(); var url = this.href; $.colorbox({href: url, maxWidth: "99%", maxHeight: "99%", opacity: ".5"}); }); }); I tried to solve this problem an I realize that the e.preventDefault (); dose not allow all images in the gallery to be readed and the clicked image seems to be the only one in the gallery I think that is the reason I have no navigation buttons. Can someone help me with the code. If I write it without the e.preventDefault (); dose not work normal. Thank you. On index.htm I use this ajax code to call gallery.php the gallery.php create this things with the folowing code <?php include_once('Gallery/resources/UberGallery.php'); $gallery = UberGallery::init()->createGallery('Gallery/gallery-images'); ?> When I open the gallery.php evrything is ok when i call it with ajax script I have no navigation buttons. You need tou include the first script on index.htm to work the gallery Can anyone tell me why this thing hapens
tagged with: php
has title: Ubergallery and ajax
possible better answer: http://stackoverflow.com/a/28781119
has comment: http://stackoverflow.com/comment/45885411
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28945394
accepted answer: http://stackoverflow.com/a/28945394
answer count: 2
upvote count: 1
tagged with: jquery
favorite count: 0

http://stackoverflow.com/q/28816739
tagged with: angularjs
type: UnansweredQuestion
has title: Mocking Angular bootstrap-ui directive for unit tests
has answer: http://stackoverflow.com/a/28840190
has body: I'm trying to write a unit test to ensure that a directive works correctly. The directive's template includes the Angular bootstrap datepicker, so I would like to be able to mock that. This question says I should be able to mock directives by creating new directives with the same name using $compileProvider and setting a high priority and terminal to true: beforeEach(function() { inject([ '$compileProvider', function($compileProvider) { $compileProvider.directive('datePickerOptions', { priority: 100, terminal: true, template: '' }); $compileProvider.directive('datePickerPopup', { priority: 100, template: '' }); }]); }); It also says that you can mock directives by just overriding their factory functions like so: beforeEach(module(function($provide) { $provide.factory('datePickerOptionsDirective', function() { return {}; }); $provide.factory('datePickerPopupDirective', function() { return {}; }); })); Neither of these methods are working for me. I'm using Karma unit tests. Any thoughts?
linked to: http://stackoverflow.com/q/17533052
upvote count: 1
tagged with: unit-testing
type: Question
score: 1
has comment: http://stackoverflow.com/comment/45910623
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45906111

http://stackoverflow.com/q/28802180
has body: I'm stuck at this problem half the day and i'm totally out of options now. I have a form that is submitted via a click handler to a php script that is in the SAME directory BUT everytime I try to send it, i get a cross domain script warning. Please Help, you are my only hope ( since nobody else seem to have that problem according to google and i'm only half a hour from trowing my laptop out of the window). thanks for your help, Error: POST http://mydomain/contactscript.php 500 (Internal Server Error)jquery.js:8625 n.ajaxTransport.k.cors.a.crossDomain.sendjquery.js:8161 n.extend.ajaxcontact.js:12 (anonymous function)jquery.js:4430 n.event.dispatchjquery.js:4116 n.event.add.r.handle My Ajax Call: $('#kontaktformular button.cbp-mc-submit').click(function(event){ event.preventDefault(); var myForm = $("#kontaktform"); var button = $("#kontaktform button.cbp-mc-submit"); if($('#firstname').val() != "" &amp;&amp; $('#firstlast').val() != "" &amp;&amp; $('#email').val() != "") { $.ajax( { url: 'contactscript.php', type: 'POST', dataType: 'html', data: myForm.serialize(), beforeSend: function() { // alert.fadeOut(); button.html('abgesendet....'); // change submit button text }, success:function(result){ button.html('Kontaktanfrage absenden'); } }); } else{ $('#first_name , #last_name, #email1').filter(function() { return $(this).val() == ""; }).css({'background': "#ffa5a5", 'color' : 'white'}); } }); AJAX compiled Message (I guess?) Remote Address:xx.xx.xx.xx.xx:80 Request URL:http://domain/contactscript.php Request Method:POST Status Code:500 Internal Server Error Request Headersview source Accept:text/html, */*; q=0.01 Accept-Encoding:gzip, deflate Accept-Language:de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4 Cache-Control:no-cache Connection:keep-alive Content-Length:90 Content-Type:application/x-www-form-urlencoded; charset=UTF-8 Cookie:_ga=GA1.2.878328721.1423595127 Host:domain.de Origin:http://domain.de Pragma:no-cache Referer:http://domain.de/contact.html User-Agent:Mozilla/5.…
type: AnsweredQuestion
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/31274991
has title: jquery / ajax form - serverside php but get Cross domain warning
type: Question
has comment: http://stackoverflow.com/comment/45878456
has comment: http://stackoverflow.com/comment/45878835
has comment: http://stackoverflow.com/comment/45878613
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45878512
has comment: http://stackoverflow.com/comment/45878877
has comment: http://stackoverflow.com/comment/45878399
accepted answer: http://stackoverflow.com/a/28802651
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45878434
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/28802651
has comment: http://stackoverflow.com/comment/45878139
has comment: http://stackoverflow.com/comment/45879282
tagged with: php
possible better answer: http://stackoverflow.com/a/31274991
has comment: http://stackoverflow.com/comment/45878549

http://stackoverflow.com/q/28904459
score: 1
has answer: http://stackoverflow.com/a/28961387
type: Question
accepted answer: http://stackoverflow.com/a/28961387
has title: Trying to insert jquery-mousewheel pluginin in to jquery cycle2
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I'm trying to integrate jquery-mousewheel plugin (https://github.com/jquery/jquery-mousewheel) with the plugin - jquery cycle2 plugin. Everything was fine until I discovered that mouse scrolling triggers a lot of scrolling events, especially with the new "magic" trackpads and mice that create a lot of inertia in the wheel. On GitHub I found a plugin (https://github.com/amondit/jquery.scrollsteps.js) designed specifically for this plugin to handle with this problem. I used the file jquery.scrollsteps-full-min.js. That's how I call the plugin: $(function() { var $slider = $('.slider_overlay'); // slider initialize $slider.cycle({ fx: 'scrollVert', timeout: 0, pager: '.slider_list', pagerTemplate: '', pagerActiveClass: 'active_slide', slides: '&gt; div', centerHorz: true, centerVert: true, speed: 1000 }); // initialize scrollsteps plugin $slider.scrollsteps({ up: $slider.cycle('prev'), down: $slider.cycle('next') }); }); And, when I start to scroll the page up and down, I get the following error message from firebug console: "TypeError: i.down is not a function" or "TypeError: i.up is not a function" Perhaps someone has any ideas or thoughts why this error may occur? If I use a default mousewheel init (without scrollsteps plugin) - everything worked fine: $slider.mousewheel(function(e) { if (e.deltaY &gt; 0) { $slider.cycle('prev'); } else { $slider.cycle('next'); } }); but as I mentioned it triggers a lot of scrolling events. Maybe I'm solve this problem incorrectly ? If somebody knows other solutions - will be very grateful for the help.
favorite count: 0
upvote count: 1
tagged with: jquery-cycle2
type: AnsweredQuestion
tagged with: mousewheel

http://stackoverflow.com/a/28949220
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/64458238
has comment: http://stackoverflow.com/comment/48149679
type: Answer
accepted answer of: http://stackoverflow.com/q/28827511
answers question: http://stackoverflow.com/q/28827511
upvote count: 23
has body: As far as I know no iOS device supports rendering to a floating point texture (nor do most mobile devices at this point in time 3/2015) My understanding of the WebGL spec is OES_texture_float: Allows you to create and read from 32bit float textures but rendering to a floating point is device dependent. OES_texture_float_linear: Allows linear filter floating point textures. If this doesn't exist and OES_texture_float does then you can only use gl.NEAREST for floating point textures. OES_texture_half_float and OES_texture_half_float_linear are the same as above except for half float textures. The traditional way to see if you can render to a floating point texture in WebGL, assuming OES_texture_float exists, is to create a framebuffer, attach a floating point texture to it, then call gl.checkFramebufferStatus. If it returns gl.FRAMEBUFFER_COMPLETE then you can, if not then you can't. Note: This method should work regardless of the next paragraph. The spec was updated so you could also check WebGL extensions to find out if it's possible to render to a floating point texture. The extension WEBGL_color_buffer_float is supposed to tell you you can render to floating point textures. The extension EXT_color_buffer_half_float is the same for half float textures. I know of no browser that actually shows these extensions though yet they support floating point rendering if the hardware supports it. For example my 2012 Retina MBP on Chrome 41 reports gl = document.createElement("canvas").getContext("webgl").getSupportedExtensions() ["ANGLE_instanced_arrays", "EXT_blend_minmax", "EXT_frag_depth", "EXT_shader_texture_lod", "EXT_sRGB", "EXT_texture_filter_anisotropic", "WEBKIT_EXT_texture_filter_anisotropic", "OES_element_index_uint", "OES_standard_derivatives", "OES_texture_float", "OES_texture_float_linear", "OES_texture_half_float", "OES_texture_half_float_linear", "OES_vertex_array_object", "WEBGL_compressed_texture_s3tc", "WEBKIT_WEBGL_compressed_texture_s3tc", "WEBGL_debug_re…
score: 23
has comment: http://stackoverflow.com/comment/46198412

http://stackoverflow.com/q/28837595
tagged with: loops
accepted answer: http://stackoverflow.com/a/28838359
type: Question
tagged with: mongodb
has body: ScreenShot: https://i.sstatic.net/i2UvF.png I'm trying to make a code to return two arrays, but when the function calls the final part of code, the console gets flooded with dots (screenshot) and stop working, like a crash. I'm using MongoJS driver for database connection. Here's the part of my code: lastcollect.find({from_id: usuario}, {limit: 10, sort: {time: -1}}, function(err, echoData) { if (err || !echoData) { console.log("No messages found"); } else { var users = []; var n = 0; var max = echoData.length; echoData.forEach(function(returnData) { usercollect.findOne({idu: returnData.to_id}, {}, function(err, echoData) { if (err || !echoData) { console.log("Req.Info error", err); n = n + 1; } else { n = n + 1; var r = []; r['name'] = echoData.name; r['avatar'] = echoData.avatar; r['phone'] = echoData.phone; r['idu'] = echoData.idu; users[echoData.idu] = r; console.log('DB exec ' + n); if (n === max) { console.log('DB exec END'); var data = []; data.data = echoData; data.users = users; console.log('users', users); console.log('data', data); io.sockets.emit('return lastusers ' + usuario, data); } } }); }); } }); I'm stuck at this for 4 hours, so if anyone can help i would appreciate. Thanks!
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45945498
has comment: http://stackoverflow.com/comment/45944651
has title: Node.JS Stops working and console gets flooded with dots
tagged with: node.js
has answer: http://stackoverflow.com/a/28838359
upvote count: 1
tagged with: foreach
type: AnsweredQuestion
score: 1

http://stackoverflow.com/q/28774147
has body: I got marker calling marker on a place Search along with grabbing its getDetails on google map v3. Inside of Place Search: Places search box I didn't copy all the code so it looks a bit distorted. My issue is that everytime I do a place search, it'll work fine. BUT if I do additional place searches.. it'll stack. I can't seem to get rid of the existing markers from getDetails.. I removed markers.push(marker); and it is still somehow adding marker and cannot be removed. Suggestions? EDIT: Updated the code. Please note that getDetails also shows a set of markers, and I cannot remove those. I removed markers thats originally from searchbox... but I needed the place_Id, so I kept it to use on getDetails. Please help to remove all markers... EDIT 2: Thanks geocodezip. Please use the fiddle he created to debug... still can't seem to get it working. http://jsfiddle.net/dw7moor5/ Notice how search two different things, and leftovers will still appear.
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45826796
linked to: http://stackoverflow.com/q/1544739
favorite count: 0
has comment: http://stackoverflow.com/comment/45828290
has comment: http://stackoverflow.com/comment/45826840
has comment: http://stackoverflow.com/comment/45827509
has comment: http://stackoverflow.com/comment/45826974
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28775393
has comment: http://stackoverflow.com/comment/45827529
has comment: http://stackoverflow.com/comment/45828248
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45828107
tagged with: google-maps
tagged with: javascript
score: -1
tagged with: google-maps-api-3
has comment: http://stackoverflow.com/comment/45826771
has title: getDetails but cannot remove
accepted answer: http://stackoverflow.com/a/28775393

http://stackoverflow.com/q/28853861
answer count: 2
has answer: http://stackoverflow.com/a/28854078
upvote count: 1
has body: I am using the following directive to show 3 tabs in bottom but I want to know if there is any chance to change "exterior" with "interior" as if I am on exterior page to show only "interior" and "gallery" and when i am on interior page to how "exterior" and "gallery" this is how my HTML code look like
has answer: http://stackoverflow.com/a/28854107
accepted answer: http://stackoverflow.com/a/28854107
favorite count: 0
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
possible better answer: http://stackoverflow.com/a/28854078
score: 1
has comment: http://stackoverflow.com/comment/45973946
has title: How to change a button on angular?
type: AnsweredQuestion
tagged with: javascript
has comment: http://stackoverflow.com/comment/45974273
type: Question

http://stackoverflow.com/comment/46025954
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28881023
score: 0
has text: You should be able to assign the dates into the array, I'm not sure what your "bookedDays" array/object looks like, could you post a JSFiddle with a mockup of the structure of this variable?

http://stackoverflow.com/q/28899286
has comment: http://stackoverflow.com/comment/46058264
has comment: http://stackoverflow.com/comment/46058022
linked to: http://stackoverflow.com/q/203198
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/203198
tagged with: regex
has comment: http://stackoverflow.com/comment/46059798
answer count: 0
has comment: http://stackoverflow.com/comment/46058637
has comment: http://stackoverflow.com/comment/46058192
has comment: http://stackoverflow.com/comment/46059117
has comment: http://stackoverflow.com/comment/46059225
type: Question
has comment: http://stackoverflow.com/comment/46058327
has comment: http://stackoverflow.com/comment/46058231
has comment: http://stackoverflow.com/comment/46059647
has comment: http://stackoverflow.com/comment/46058577
tagged with: javascript
has title: Set click event dynamically at runtime but not just after jQuery loading finished
has comment: http://stackoverflow.com/comment/46059558
tagged with: jquery
tagged with: click
score: 0
has body: My issue is that I want to set a click event dynamically. So imagine I have a button. Clicking that button shows a popup box. In that box I have a text like this: "Men in Bulgaria" But the issue is that I don't have access to the button event. So I would like to set the click event with an regex like this: $("[class*='timelineplace']").click(function () { var object = $(this); alert(object.attr("class").match(/timelineplace-(.*?)(?:\s+|$)/)[1]); }); But yeah this only works when the popup box already existed when jQuery loading finished. So the issue is that the popup is dynamically loaded. And the click event is set when the site has finished the loadings. So Is there a way to set a click event also at runtime to any regex matching class? Or do I really have to go to the button click event and set the onclick there.
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46058866
has comment: http://stackoverflow.com/comment/46059486

http://stackoverflow.com/comment/46029862
has text: Writing `return process();` means that `return process1()` will never be executed (since the handler has already returned to its caller).
score: 0
comment on: http://stackoverflow.com/q/28884324
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/45964844
type: QuestionComment
comment on: http://stackoverflow.com/q/28847884
score: 0
has text: which id ? youre question is unclear
type: Comment

http://stackoverflow.com/comment/45920441
type: QuestionComment
comment on: http://stackoverflow.com/q/28824679
score: 1
has text: What do you mean "it crashes?" - are you getting a timeout error? some other error?
type: Comment

http://stackoverflow.com/comment/118458181
type: Comment
has text: This one is faster than the one of Amit Joki.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28807143

http://stackoverflow.com/comment/45968176
comment on: http://stackoverflow.com/a/28848175
score: 0
type: Comment
has text: My original code is using model pop up and I am facing same behavior there as well.
type: AnswerComment

http://stackoverflow.com/comment/45808172
score: 0
type: AnswerComment
has text: I deleted ";" character but still the same result
type: Comment
comment on: http://stackoverflow.com/a/28764657

http://stackoverflow.com/a/28772023
upvote count: 0
score: -1
has body: It may be very useful for you to use JQuery. function trials() { while (num_trials > 0) { for (var i = 0; i < random.length; i++) { $('#iToWrite').html( $('#iToWrite').html() + random[i]); } } } **TRIALS HERE**
has comment: http://stackoverflow.com/comment/45822574
answers question: http://stackoverflow.com/q/28771967
type: Answer
downvote count: 1

http://stackoverflow.com/comment/46080003
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28868694
has text: @Afunakwa Did you checked my demo... it's working. So you did something different that is not working.

http://stackoverflow.com/comment/45915976
type: Comment
type: QuestionComment
has text: If you're using express, don't use regex in your routes, use [parameters](http://expressjs.com/4x/api.html#app.param) and then use them in your routes, so that in this case you get `app.get("/circle/:radius/:x/:y", ...)` and then handle the validation in the param functions. Answer forthcoming.
comment on: http://stackoverflow.com/q/28821739
score: 0

http://stackoverflow.com/comment/46037791
type: AnswerComment
type: Comment
has text: Thats great! Is there a way to write it directly into an array of objects (make "result" an array)?
comment on: http://stackoverflow.com/a/28887873
score: 0

http://stackoverflow.com/comment/45919469
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28824199
type: QuestionComment
has text: cookie must be destroyed by setting cookie to a previous time.

http://stackoverflow.com/comment/45855604
has text: @Sebas Some would consider using `break` in a loop bad practice. And no, it's not a trick to avoid a few calls to `break`. If you have multiple nested loops, breaking to the outer loop could be extremely convoluted and contrived if you don't use a label, whereas it's one simple line if you have a label.
score: 0
comment on: http://stackoverflow.com/a/28788817
type: Comment
type: AnswerComment

slick.js
tags question: http://stackoverflow.com/q/28820919
tag name: slick.js
type: Tag
tags question: http://stackoverflow.com/q/28862528

http://stackoverflow.com/a/28834919
has body: Your service returns a promise, not the data itself. You need to set a function for when the service resolves the promise: link: function ($scope, $element, $attrs) { // waiting for the service to resolve the promise by using the done method CurrenciesService.getData().then(function(data) { $scope.currencies = data; }); $scope.$watch('currencies', function(newValue, oldValue){ console.log($scope.currencies); }); } Check this fiddle
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/45939695
accepted answer of: http://stackoverflow.com/q/28834811
answers question: http://stackoverflow.com/q/28834811

http://stackoverflow.com/q/28770467
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/7261619
has answer: http://stackoverflow.com/a/28814721
type: Question
has comment: http://stackoverflow.com/comment/45819657
tagged with: javascript
has body: I have the following items laid out in static blocks: Along with a thumbnail navigation block below: At the moment, all of the main twentytwenty blocks appear underneath each other, but what I want to happen is that only the first one is displayed, and whena thumbnail is clicked, the relating slider div, is shown in it's place. It's important that as each thumbnail is clicked, the slider changes from the old one, to the new one. So far I've got this http://jsfiddle.net/96rq4vet/2/ but, when the thumbnails are clicked, the new div isn't showing up, they're staying hidden. What am I doing wrong? UPDATE I'm getting closer with this fiddle: http://jsfiddle.net/96rq4vet/3/ however, I can't get only the first main div to show at first. I tried adding style:display:none; to the second-fourth one, but that doesn't make them show when the thumbnails are clicked. Any ideas?
score: 0
accepted answer: http://stackoverflow.com/a/28814721
has comment: http://stackoverflow.com/comment/45819727
answer count: 1
tagged with: jquery
has title: How can I make javascript change main div depending on what thumbnail is clicked?
has comment: http://stackoverflow.com/comment/45819751
has comment: http://stackoverflow.com/comment/45819627
tagged with: php

sidebar
type: Tag
tag name: sidebar
tags question: http://stackoverflow.com/q/28862673

http://stackoverflow.com/q/28777514
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
tagged with: flask
tagged with: ajax
has body: Ok, so recently i have made this little forum in Flask that takes information from a form an puts it in a .csv or excel file. My problem is that every time i hit the submit button the whole entire page reloads, starting up the animations again,etc. What i want done is that once the page has loaded and i press the submit button, i do not want the page to reload, but still keep displaying the information such as next to the form saying e.g. "thank you for signing in jack". Every time it does reload, it still does keep the information there, nothing has changed, its just the fact that the page reloads every time which is what i want to stop and have everything else run smoothly. I have heard you can use Ajax but i am not so sure how to implement it. Can someone please help Here is my code signin.py import time from collections import deque from flask import Flask, render_template, request import csv import re app = Flask(__name__) history = deque(maxlen=5) def sanitise(string): return re.sub('[<>]', '', string) def valid_login(name, email): try: name.decode('ascii') except: return False else: if len(name) > 0: return True else: return False def log_entry(name, email, filename = "static/attendance.csv"): name = sanitise(name) try: with open(filename, "r") as f: pass except IOError: #file does not exist with open(filename, "w") as f: f.write("SIGNIN TABLE \n") f.write(time.strftime('%Y-%b-%d \n')) finally: with open(filename, "a") as f: f.write("{0}, {1} \n".format(name, email)) history.appendleft("Successfully signed in {0}".format(name)) @app.route('/', methods = ['POST', 'GET']) def show_form(): if request.method == "POST": if valid_login(request.form['name'],request.form['email']): print request.form['name'], request.form['email'] log_entry(request.form['name'], request.form['email']) else: history.appendleft("Please try again") #return render_template('form.jinja', invalid = True, history = history) return render_template('form.html', invalid = False, history = hist…
has answer: http://stackoverflow.com/a/28777568
type: Question
tagged with: python
answer count: 1
score: 0
has title: Forum constantly reloads in flask when submitting data

http://stackoverflow.com/comment/45981374
comment on: http://stackoverflow.com/a/28820916
has text: You passing your client-side data using AJAX. You get this data from inputs etc using jQuery methods like val(). On server it will be accessible in req.body object.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45791919
has text: As a side note, you can also replace `.parent().parent()` by `.closest('div.event-log-entry-wrap')` if you like.
comment on: http://stackoverflow.com/a/28755254
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28846495
answers question: http://stackoverflow.com/q/28846400
has comment: http://stackoverflow.com/comment/45963193
has comment: http://stackoverflow.com/comment/45961899
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45961934
accepted answer of: http://stackoverflow.com/q/28846400
has body: Try the following code. function checkDate(theForm) { var a = theForm.date1.value; var b = theForm.date2.value; var date1 = new Date(a); var date2 = new Date(b); date1.setHours(date1.getHours() - 9); date2.setHours(date2.getHours() - 9); document.getElementById("demo").innerHTML = "Date 1 : " + date1.toString() + "&lt;br/&gt;Date 2 : " + date2.toString(); return false; }
type: Answer

http://stackoverflow.com/a/28770636
answers question: http://stackoverflow.com/q/28770255
type: Answer
score: 0
has body: $user itself could be a promise that resolve to all service methods or you could resolve each service individually. Usage $user.then(function(userService) { userService.logged(); }); Resolution var userDeferred= $q.defer(); userDeferred.resolve({ logged: function() { return false; } }); return userDeferred.promise;

jsonp
tags question: http://stackoverflow.com/q/28901166
tags question: http://stackoverflow.com/q/28789496
tags question: http://stackoverflow.com/q/28860673
type: Tag
tags question: http://stackoverflow.com/q/28854154
tags question: http://stackoverflow.com/q/28820989
tags question: http://stackoverflow.com/q/28755813
tags question: http://stackoverflow.com/q/28819410
tag name: jsonp
tags question: http://stackoverflow.com/q/28888395

http://stackoverflow.com/a/28893107
answers question: http://stackoverflow.com/q/28893063
type: Answer
has body: This will not work. You will either ban way too much (the Scunthorpe problem) or way too little. Even if you could distinguish these words perfectly, you'd still have problems with all the words that are okay in one context and not in another. Someone deliberately trying to get through your filter will just use those. And if you're just trying to catch people doing things by accident, you don't need all these variations. The Royal Society for the Protection of Birds famously upgraded their forum software to find that the words "booby" and "shag" were now banned. Both of these are names for types of birds. Many well-financed, highly motivated groups have tried to do this, and they've all produced very poor results. Instead, just list the words the way they'd normally be written to make sure everyone knows the rules and have humans enforce the rules. This is the kind of decision computers are not yet good at making.
score: 4
upvote count: 4
downvote count: 0

http://stackoverflow.com/q/28849425
tagged with: javascript
favorite count: 0
has body: I am working on a predictive search module which is a Web application. It has a UI(HTML, JS) layer and a Service layer (Java). The idea is to give user a text box wherein he can start typing and start getting the suggestions in a drop down. The user can select an item from the drop down and start typing again and now the drop down should again show suggestions. This time the suggestions are based on earlier selected suggestion. For Example - User Types - What are the Suggestions - 1) What are the paintings 2) What are the flowers 3) What are the monuments The user selects one of the option, lets say "What are the monuments" and starts typing again. Now the suggestions should be based on monuments. Suggestions 1) What are the monuments having colour 2) What are the monuments built during 3) What are the monuments built by Lets say the user selects "What are the monuments having colour" and starts typing again. Now the suggestions should be 1) What are the monuments having colour blue 2) What are the monuments having colour red 3) What are the monuments having colour white So on and so forth. The question is what is the responsibility of the client and the server? 1) Should the client just send the text to the Service layer and expect the suggestions as and when he types? In this case the responsibility of the server is to start parsing the text received, split into words and find out what is missing ([subject like paintings, flowers and monuments][predicate based on the subject like having colour, built during, built by] or [object based on the selected subject and predicate like blue, green and white]), and create suggestions and send them to the client. All text processing is done on the service layer. 2) Should the client while calling the service layer also send what has been already selected apart from the text itself. As in - What is the subject which is selected from the drop down, and the predicate, and the object, so on and so forth. What should be the ideal…
tagged with: ajax
answer count: 0
type: UnansweredQuestion
upvote count: 1
type: Question
score: 1
tagged with: java
has title: Predictive Search - What are the responsibilities of client and the server?
downvote count: 0

http://stackoverflow.com/a/28805760
answers question: http://stackoverflow.com/q/28804988
type: Answer
has comment: http://stackoverflow.com/comment/45886001
has comment: http://stackoverflow.com/comment/45885160
has comment: http://stackoverflow.com/comment/45889295
score: 1
has comment: http://stackoverflow.com/comment/45968439
upvote count: 1
has comment: http://stackoverflow.com/comment/45885085
has comment: http://stackoverflow.com/comment/45886073
has comment: http://stackoverflow.com/comment/45886366
has comment: http://stackoverflow.com/comment/45887678
has body: can you try to remove the first slash? (before the form directory)
downvote count: 0

http://stackoverflow.com/comment/46035169
score: 0
has text: Why not use the mouseup event and remove the class that causes the focus from all the navbar elements?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28886441

http://stackoverflow.com/comment/45806486
score: 0
comment on: http://stackoverflow.com/a/28763617
has text: That will send a valid JSON request. It won't populate `$_POST` though, which is what the question is asking about.
type: AnswerComment
type: Comment

maps
tags question: http://stackoverflow.com/q/28786498
tag name: maps
tags question: http://stackoverflow.com/q/28762640
type: Tag
tags question: http://stackoverflow.com/q/28816957

http://stackoverflow.com/a/28853242
answers question: http://stackoverflow.com/q/28852109
has body: I found The answer. I share It for all. so if somebody stuck, like me. will continue with this help quickly. I create new variable: var showEvery = parseInt(data.getNumberOfRows() / 4); And in the option attribute i add: hAxis: {showTextEvery: showEvery} so the JS code seems like this: var data = google.visualization.arrayToDataTable(&lt;?php echo $str?&gt;); var showEvery = parseInt(data.getNumberOfRows() / 4); var options = { title: 'Title', curveType: 'function', legend: { position: 'bottom' }, width: 1000, backgroundColor: '#efeff0', is3D: true, chartArea: { backgroundColor: { stroke: '#efeff1', strokeWidth: 1}}, hAxis: {showTextEvery: showEvery}, height: 300 }; var chart = new google.visualization.LineChart(document.getElementById('curve_chart')); chart.draw(data, options);
type: Answer
score: 6
downvote count: 0
upvote count: 6
accepted answer of: http://stackoverflow.com/q/28852109
type: AcceptedAnswer

http://stackoverflow.com/a/28839538
type: Answer
answers question: http://stackoverflow.com/q/28838533
has body: Here is another cleaner solution without involving functions, this approach will release you from removing functions from $scope if you are cautious of memory usage. {{item.Code}} Happy Helping!
score: 0

http://stackoverflow.com/a/28949052
accepted answer of: http://stackoverflow.com/q/28865355
score: 1
answers question: http://stackoverflow.com/q/28865355
upvote count: 1
has body: I was able to achieve this by using the following property: data.aggregates.parent().items.length
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/89542844
type: Answer

http://stackoverflow.com/comment/140175363
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28805551
type: Comment
has text: @IcyIcicle Per my reading of that url, minification is allowed, just not obfuscation beyond that.

http://stackoverflow.com/comment/45861761
type: Comment
score: 0
has text: Okay could u send a plnkr on the exact script u use for it to work? since it still does not work in mine?
comment on: http://stackoverflow.com/a/28793563
type: AnswerComment

http://stackoverflow.com/q/28901773
has answer: http://stackoverflow.com/a/28902063
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28902094
score: 0
has body: So I have this http://jsfiddle.net/uzpxjukv/ You have btn1, btn2, btn3 and btn4. I'm trying to make it so that when you press btn1, the div with the class pre1 should then get "display: block;" or something to make it visible. Then when btn2 is clicked, pre1 turns invisible again and pre2 turns visible.
tagged with: jquery
has answer: http://stackoverflow.com/a/28902007
has answer: http://stackoverflow.com/a/28902094
answer count: 5
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/28902168
has answer: http://stackoverflow.com/a/28901875
type: AnsweredQuestion
has title: Edit css of "item" when clicking on corresponding "btn"
possible better answer: http://stackoverflow.com/a/28902007
type: Question
has comment: http://stackoverflow.com/comment/46063055

http://stackoverflow.com/q/28831959
answer count: 2
possible better answer: http://stackoverflow.com/a/28832184
tagged with: javascript
has answer: http://stackoverflow.com/a/28832184
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28832348
has comment: http://stackoverflow.com/comment/45933929
has comment: http://stackoverflow.com/comment/45933995
tagged with: twitter-bootstrap
has body: I have a form I've put together using Bootstrap 3. Some of the fields are for date input, and I'm using Bootstrap 3 Datepicker to pop up calendars. I have put onkeydown="return false;" on the input controls to prevent free text from being inserted. The trouble is, users can still (and will) clear the text box with the little X that bootstrap puts in there. Is it possible to remove this functionality? Here's the datepicker markup. It's enabled depending upon the index value of a drop down list. I'm using webforms: &lt;div class="col-sm-3"&gt; &lt;div class='input-group date' id='dateEnd'&gt; &lt;asp:TextBox ID="datepickerEnd" runat="server" CssClass="form-control datepickerEnd" Enabled="False" placeholder="Specify to date" onkeydown="return false;" /&gt; &lt;span class="input-group-addon"&gt;&lt;span class="glyphicon glyphicon-calendar"&gt;&lt;/span&gt; &lt;/span&gt; &lt;/div&gt; &lt;/div&gt;
has comment: http://stackoverflow.com/comment/45933658
has title: Is there a way to remove the clear text input X in bootstrap?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45933618
accepted answer: http://stackoverflow.com/a/28832348
has comment: http://stackoverflow.com/comment/45933773
type: Question

http://stackoverflow.com/q/28863330
has comment: http://stackoverflow.com/comment/46004975
has comment: http://stackoverflow.com/comment/46187747
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46027543
answer count: 0
has title: Multiple Hightchart Themes in same page
has body: Hello I want to set multiple hight chart themes in a page I have 4 chart. I want chart 1 : default theme chart 2 : sand theme chart 3 : black theme chart 4 : grid_light I already tried from this question but my chart themes do not change. code sand.js http://pastebin.com/66WeFqTs code black.js http://pastebin.com/4yNDamgJ code grid_light.js http://pastebin.com/TgpJutZ8 Thank's :)
type: Question
has comment: http://stackoverflow.com/comment/45999701
tagged with: highcharts
has comment: http://stackoverflow.com/comment/46177041
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46025334
linked to: http://stackoverflow.com/q/15030914
score: 0

http://stackoverflow.com/comment/77067344
type: Comment
comment on: http://stackoverflow.com/a/28827847
score: 1
type: AnswerComment
has text: Thank you! I can't believe the solution was that simple.

wordpress
tags question: http://stackoverflow.com/q/28884422
tags question: http://stackoverflow.com/q/28851110
tags question: http://stackoverflow.com/q/28805579
tags question: http://stackoverflow.com/q/28764600
tags question: http://stackoverflow.com/q/28822375
tags question: http://stackoverflow.com/q/28834156
tags question: http://stackoverflow.com/q/28883958
tags question: http://stackoverflow.com/q/28840506
tags question: http://stackoverflow.com/q/28897470
tags question: http://stackoverflow.com/q/28871488
tags question: http://stackoverflow.com/q/28864635
tags question: http://stackoverflow.com/q/28900376
tags question: http://stackoverflow.com/q/28796095
tags question: http://stackoverflow.com/q/28798967
tags question: http://stackoverflow.com/q/28905367
tags question: http://stackoverflow.com/q/28813788
tags question: http://stackoverflow.com/q/28881654
tags question: http://stackoverflow.com/q/28788223
tags question: http://stackoverflow.com/q/28780659
tags question: http://stackoverflow.com/q/28751547
tags question: http://stackoverflow.com/q/28836290
tags question: http://stackoverflow.com/q/28851823
tags question: http://stackoverflow.com/q/28768505
tags question: http://stackoverflow.com/q/28844340
tags question: http://stackoverflow.com/q/28813721
tags question: http://stackoverflow.com/q/28867989
tags question: http://stackoverflow.com/q/28851145
tags question: http://stackoverflow.com/q/28856988
tags question: http://stackoverflow.com/q/28865882
tags question: http://stackoverflow.com/q/28793315
tags question: http://stackoverflow.com/q/28752226
tags question: http://stackoverflow.com/q/28792114
tags question: http://stackoverflow.com/q/28839123
tags question: http://stackoverflow.com/q/28780071
tag name: wordpress
tags question: http://stackoverflow.com/q/28782415
tags question: http://stackoverflow.com/q/28811494
tags question: http://stackoverflow.com/q/28805377
tags question: http://stackoverflow.com/q/28848203
tags question: http://stackoverflow.com/q/28879934
tags question: http://stackoverflow.com/q/28883143
tags question: http://stackoverflow.com/q/28805703
tags question: http://stackoverflow.com/q/28825310
tags question: http://stackoverflow.com/q/28881540
tags question: http://stackoverflow.com/q/28820049
tags question: http://stackoverflow.com/q/28769996
type: Tag

http://stackoverflow.com/comment/46073788
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28906126
has text: Well you can that, but if you use just 1 pixel width per interval you have a total width of 2016px + let's 30px for labels!

http://stackoverflow.com/a/28891855
has comment: http://stackoverflow.com/comment/46070402
has comment: http://stackoverflow.com/comment/46070408
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28891655
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/28891655
has comment: http://stackoverflow.com/comment/46070377
has body: When you create dialog objects, there are elements which are added to the body which are not under the container main2, so calling $(".main2").empty() will not remove them. In your case since the dialogs are created for elements dialog_content you can call the destroy method of dialog to remove them $('.dialog_content').dialog('destroy'); $(".main2").empty(); Another option is to use a single dialog like Add below html to your body Black Gain: Luma Gain: Chroma Gain: Hue: IP Address: then $(document).ready(function () { setInterval("ajaxd()", 1000); var $dialog = $('.dialog_content').dialog({ modal: true, autoOpen: false, width: 600, title: 'Current Proc Status: ', buttons: [{ text: "OK", click: function () { $(this).dialog("close"); } }] }); $('.main2').on('click', '.dialog_but', function (e) { var $this = $(this), data = $this.data(); e.preventDefault(); $dialog.dialog('option', 'title', 'Current Proc Status: ' + data.machineName); $dialog.find('.hd-black-gain').text(data.hdBlackGain); $dialog.find('.hd-luma-gain').text(data.hdLumaGain); $dialog.find('.hd-chroma-gain').text(data.hdChromaGain); $dialog.find('.hd-hue').text(data.hdHue); $dialog.find('.ip').text(data.ip); //open the dialog $dialog.dialog('open'); }) }); function ajaxd() { "use strict"; $.ajax({ type: "GET", url: "output.xml", dataType: "xml", cache: false, success: xmlParser }); }; function xmlParser(xml) { "use strict"; $(".main2").empty(); //$(".main").html(''); //blank out appended info on each load $('#load').hide(); var count = 1; $(xml).find("proc").each(function () { var ip = $(this).find("ip").text(); var hdBlackGain = $(this).find("hdBlackGain").text(); var hdLumaGain = $(this).find("hdLumaGain").text(); var hdChromaGain = $(this).find("hdChromaGain").text(); var hdHue = $(this).find("hdHue").text(); var machineName = $(this).find("machineName").text(); if (hdBlackGain === '0' && hdLumaGain === '0' && hdChromaGain === '0' && hdHue === '0') {} else { var $proc = $(' ' + machineName + ' ').app…
score: 1

http://stackoverflow.com/comment/71714314
has text: What would have been the downside of making implicit return systematic for arrow functions? Just like coffeescript does... (though I don't like coffeescript)
comment on: http://stackoverflow.com/a/28889451
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28763634
has comment: http://stackoverflow.com/comment/45821270
upvote count: 8
has comment: http://stackoverflow.com/comment/45831716
has comment: http://stackoverflow.com/comment/45893888
type: Answer
score: 8
has body: According to the source code: By default, all file paths are relative to the Gruntfile And, voilá, this line of code shows how grunt actually changes the current directory to the path of the Gruntfile: process.chdir(grunt.option('base') || path.dirname(gruntfile)); However, option --base is there for just that. See docs: http://gruntjs.com/api/grunt.file If you don't need to do it from inside the Gruntfile, simply run a script that captures the process.cwd() and then execs grunt. See: https://www.npmjs.com/package/exec var exec = require('exec'); process.cwd(); // Will have your current path exec(['grunt', 'mytask'], function(err, out, code) { if (err instanceof Error) throw err; process.stderr.write(err); process.stdout.write(out); process.exit(code); });
downvote count: 0
has comment: http://stackoverflow.com/comment/45821471
has comment: http://stackoverflow.com/comment/45811263
answers question: http://stackoverflow.com/q/28755625
has comment: http://stackoverflow.com/comment/45811119
has comment: http://stackoverflow.com/comment/45812908

http://stackoverflow.com/a/28887420
upvote count: 1
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/46150695
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28881392
has body: Is there a possibility to make Node.js to use my own compiled, local OpenSSL version? Yes. On Linux, use LD_LIBRARY_PATH. On OS X use, DYLD_LIBRARY_PATH. Be sure to choose a new OpenSSL that is binary compatible with whatever Node.js is linked against. For example, OpenSSL 0.9.7 and 0.9.8 are binary compatible, but not compatible with others like 1.0.0, 1.0.1, 1.0.2 or 1.1.0. And OpenSSL 1.0.0, 1.0.1 and 1.0.2 are binary compatible. Or, build Node.js from sources and statically link to the OpenSSL version you choose. It will avoid the LD preload tricks. (I'm side stepping -rpath since it does not work on OS X).
has comment: http://stackoverflow.com/comment/139701124
answers question: http://stackoverflow.com/q/28881392
has comment: http://stackoverflow.com/comment/46056132

http://stackoverflow.com/q/28900004
tagged with: jquery
has body: I have two popups on on single date inputfield. One on the right side of the date field to indicate an validation input error to the user. The other one underneath or above the field to show an calendar picker. The problem is that the calendar picker closes immediately after opening if "autoclose" is "true". The popups are of type sap.ui.ux3.ToolPopup. I also tried sap.m.Popup. The behavior is the same, still same problem. How can I solve this problem? Here is what I did for the calendar picker. //called on init this._calendarPopup = new sap.ui.ux3.ToolPopup({ content : [ this._calendar ], //complete calendar control which should be displayed on the popup opener : _self, autoClose : false, openDuration : 1, closeDuration : 1, closed : function() { _self.unselectDates(); }, }) this.attachBrowserEvent("click", function() {//if the field is a date Field attach the calendar picker if (_self.get_dataType() == "date") { _self.onOpenCalendar(); } }); //end called on init onOpenCalendar : function() { var _self = this; if (this.get_changeable()) { _self._calendarPopup.setOpener(_self.getId()); _self._calendarPopup.open(sap.ui.core.Popup.Dock.LeftTop, sap.ui.core.Popup.Dock.LeftBottom); } }, Currently the calendar closes just on date selection. Which is not a user friendly behavior. The calendar should also close when the user clicks outside the calendar (without setting a date). Similar attachBrowserEvent function for the error popup. //called on init in other class tha this.cancelCommentPopup = new sap.ui.ux3.ToolPopup({ content : [ this.cancelCommentText ], autoClose : true, openDuration : 1, closeDuration : 1, }).addStyleClass("CancelCommentPopup"); onOpenCancelCommentPopup : function(openerControl, entity, i, field) { this.cancelCommentPopup.setOpener(openerControl.getId()); this.cancelCommentText.setText(JSON.parse(entity.response.body).error.message.value); this.cancelCommentPopup.open(sap.ui.core.Popup.Dock.BeginCenter); },
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
type: UnansweredQuestion
downvote count: 1
has title: Sapui5/Openui5/Javascript two Popups on one Inputfield: closes one instantly again
tagged with: sapui5
score: -1
type: Question
has answer: http://stackoverflow.com/a/28958534
has comment: http://stackoverflow.com/comment/46150948
upvote count: 0
tagged with: javascript

http://stackoverflow.com/a/28786959
has comment: http://stackoverflow.com/comment/45850455
has comment: http://stackoverflow.com/comment/45850381
upvote count: 9
score: 9
type: AcceptedAnswer
downvote count: 0
has body: Use $timeout() that will get run in the next digest cycle. Don't forget to add $timeout dependency on controller. $timeout(function () { $scope.slideInfos = slideInfos ; setInitialSliderValues(); });
accepted answer of: http://stackoverflow.com/q/28786824
has comment: http://stackoverflow.com/comment/75292972
type: Answer
answers question: http://stackoverflow.com/q/28786824

http://stackoverflow.com/comment/45994552
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28864692
has text: @jp310 If he's getting the alert box, I think the function is being called.

http://stackoverflow.com/comment/46046380
type: AnswerComment
has text: Now that is interesting. I did a document read out line for debug, and when I put the log right above it, it doesn't do the print. Curios? @kylehyde215
type: Comment
comment on: http://stackoverflow.com/a/28892721
score: 0

http://stackoverflow.com/comment/45908228
score: 0
type: Comment
has text: I agree, well looks like I got plans on how to get this working, thanks a bunch!
type: AnswerComment
comment on: http://stackoverflow.com/a/28817133

http://stackoverflow.com/q/28812805
has comment: http://stackoverflow.com/comment/45898267
favorite count: 0
has comment: http://stackoverflow.com/comment/45898343
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/8814472
tagged with: data-binding
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45897714
upvote count: 1
has comment: http://stackoverflow.com/comment/45898073
score: 1
type: Question
has body: I am trying to data-bind a URL from my JavaScript to my HTML. It doesn't work at the moment and I'm not sure why. I cannot find any online guides covering my exact setup. I think I might need a .observable somewhere. Thank you. HTML5 Home Back JavaScript (function () { /*kendo.bind($('body'), mainVM); LoadParameters(mainVM); // initialize data initializeinputs();*/ // store a reference to the application object that will be created // later on so that we can use it if need be var app; // HTML files: create an object to store the models for each view window.APP = { models: { // Menu ------------------------------------- home: { title: 'Home', url: 'views/home.html' }, menu: { title: 'Main Menu', url: 'views/home.html' }, cards: { title: 'Cards', url: 'views/menu.html' }, email: { title: 'Email Settings', url: 'views/menu.html' }, rates: { title: 'Card Rates', url: 'views/menu.html' }, station: { title: 'Station Schedule', url: 'views/menu.html' }, parameters: { title: 'PLC Parameters', url: 'views/menu.html' }, // Reports ---------------------------------- reports: { title: 'Reports', url: 'views/home.html' }, reports_activity: { title: 'Activity Report', url: 'views/reports.html' }, reports_payments: { title: 'Payments Report', url: 'views/reports.html' }, reports_cards: { title: 'Cards Report', url: 'views/reports.html' }, reports_printer_1: { title: 'Volume Dispensed Log', url: 'views/reports.html' }, reports_printer_2: { title: 'Credit Charges Log', url: 'views/reports.html' }, reports_printer_3: { title: 'Accountable Volume Log', url: 'views/reports.html' }, reports_printer_4: { title: 'Card Numbers Log', url: 'views/reports.html' } } } // this function is called by Cordova when the application is loaded by the device document.addEventListener('deviceready', function () { // hide the splash screen as soon as the app is ready. otherwise // Cordova will wait 5 very long seconds to do it for you. navigator.splashscreen.hide(); app = new kendo.mobile.Application(doc…
linked to: http://stackoverflow.com/q/5691302
has comment: http://stackoverflow.com/comment/45897910
has title: data-bind URL from JavaScript object
downvote count: 0
has comment: http://stackoverflow.com/comment/45898788
tagged with: javascript

http://stackoverflow.com/comment/45904992
comment on: http://stackoverflow.com/q/28816566
score: 0
type: QuestionComment
has text: You could use canvas to draw the rect instead of svg. Then get the pixel data from the canvas and it would have the rect on it. If it is just a rect, you wouldn't have any benefit from using svg over canvas.
type: Comment

http://stackoverflow.com/comment/45853386
score: 0
type: Comment
type: QuestionComment
has text: Is that the order in the code? You defined the input first and then the function?
comment on: http://stackoverflow.com/q/28788896

http://stackoverflow.com/comment/45977780
type: Comment
comment on: http://stackoverflow.com/a/28855631
has text: Maybe you're trying to find it in the `data` instead ?
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45911622
type: Comment
comment on: http://stackoverflow.com/a/28818720
score: 0
type: AnswerComment
has text: I tried that as well, I can get one image to display by using this line $(this).parent().next('.target').html(img) but it always selects the first div with class 'target' and never the newly generated ones.

http://stackoverflow.com/comment/46094548
score: 0
has text: Hmm, so it defines the length 0, because that's the []'s length??? What does push do to add and update the length?? I had no idea, i just used push because it required no length!! Guess i was lucky
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28905680

http://stackoverflow.com/comment/46024205
type: AnswerComment
has text: Honestly, I would suggest learning the fundamentals of a language before learning a framework or library built on it. jQuery is a library built on JavaScript to simplify more complex operations. I think it would be fun for you to play with, but probably better you learn core JavaScript first. - My opinion. :)
type: Comment
comment on: http://stackoverflow.com/a/28869793
score: 0

http://stackoverflow.com/a/28867761
downvote count: 0
upvote count: 2
answers question: http://stackoverflow.com/q/28862923
type: Answer
score: 2
has body: You do not need Message API for communication between Popup and Background. Popup in chrome extension can directly call methods of Background . You can do something like this BG = chrome.extension.getBackgroundPage(); And then you can call BG.loadStuff() in your popup js. From within loadStuff, you can pass a callback which can return data to you. So it should look like BG.loadStuff(function(items) { console.log(items); }); background.js function loadStuff(cb) { chrome.storage.sync.get(null, function(superObj) { cb.call(null, superObj); }); } For more understanding, read these http://blog.papersapp.com/chrome-development-parent-and-child-windows/ https://stackoverflow.com/a/17276475/816213 https://stackoverflow.com/a/17378016/816213

http://stackoverflow.com/q/28764523
type: UnansweredQuestion
score: 1
upvote count: 1
has title: Javascript - I can't make the "this" keyword on my html
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45807974
has comment: http://stackoverflow.com/comment/45810048
tagged with: this
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45808102
favorite count: 0
has answer: http://stackoverflow.com/a/28764584
tagged with: http://stackoverflow.com/tag/html
has body: This is currently my simplified code and it's not working. What I would like to do is to have two input(id's nono1 and nono2) calling the same function(nonoto). I cant use document.getElementById() because they different ID's. Untitled Document

http://stackoverflow.com/q/28755759
score: 0
answer count: 1
tagged with: arrays
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28755791
has body: I have a function that changes the border-color of the arrows to match the hover state colour of the buttons. It is working as 3 separate functions but I want to combine them using .each( ) Please tell me where I am going wrong Vars var btnArrowPath = '.btn + .btn-arrow'; var btnName = ['btn-infra ','btn-dev ','btn-anal ']; var btnColor = ['#286090','#449d44','#31b0d5']; var btnRollColor = ['#337ab7','#5cb85c','#5bc0de']; Function $('.btn-wrap').each(function(i, value){ $(btnName[value] + '.btn').hover(function(i, value){ $(btnName[value] + btnArrowPath).css('border-top-color',btnColor[value]); }, function(){ $(btnName[value] + btnArrowPath).css('border-top-color',btnRollColor[value]); }); }); HTML Infrastructure Development Analysis ]
has comment: http://stackoverflow.com/comment/45792837
type: AnsweredQuestion
has title: jQuery loop through .hover( ) function using .each( )
has comment: http://stackoverflow.com/comment/45792888
accepted answer: http://stackoverflow.com/a/28755791
tagged with: each
type: Question
has comment: http://stackoverflow.com/comment/45793747
has comment: http://stackoverflow.com/comment/45792860

http://stackoverflow.com/comment/77613167
has text: http://jsfiddle.net/oqet7pe4/ It is due to start: 'bottom' it is not scrolling. if start: 'bottom' removed nothing work. it stay at top.
comment on: http://stackoverflow.com/a/43343360
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45887853
has text: Thanks but it's not an acceptable solution, This only captures the html which is not the case :)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28807178
type: Comment

http://stackoverflow.com/comment/45965554
has text: How I can get text of any circle in javascript codes? I want access to text of the any circle when all circle has text.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28840505

http://stackoverflow.com/q/28820182
answer count: 1
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/28820344
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28820344
has body: I can't for the love of god get selection (or animated-pages for that matter) to work. I tried following the tutorials, but they don't mention ANYWHERE how to actually perform the transition from one page to another (or there is something I'm totally not understanding), my guess is that I should only need to set the selected value of the core-animated-pages but that doesn't work either. First of all, the detail.item object doesn't seem to contain the correct stuff. I'm probably doing something trivial wrong. When trying to access "detail.item.selectedIndex" from the on-core-select event I only get undefined. If I access the property by id using: this.$.selector.selectedIndex it will work. Also doing the following seems to do nothing: var pages = this.$.pages; pages.selected = selectedIndex; See the code below to understand what I'm trying to do: ... Imports here ... Application {{item.label}} Home page contents Gallery contents
type: Question
tagged with: polymer
has title: Polymer 'detail.item' won't return the correct object

http://stackoverflow.com/comment/46011337
comment on: http://stackoverflow.com/q/28873052
type: QuestionComment
type: Comment
has text: Daenarys: thanks for Your corrections. I haven't got any code unfortunately. I just tried to download the data series, combine with the previous dataset and destroy, reinitialize the dygraphs instance, but it is way too slow.
score: 0

http://stackoverflow.com/q/28819109
has comment: http://stackoverflow.com/comment/45910166
tagged with: reactjs
has title: Swiper.js Error- ReferenceError: window is not defined when installed via npm
tagged with: swiper.js
answer count: 0
downvote count: 0
tagged with: javascript
score: 1
type: Question
tagged with: browserify
tagged with: node.js
favorite count: 0
has comment: http://stackoverflow.com/comment/45949359
has body: When I install 3.0.3 via npm and add the line require('swiper') before defining a React.js component it blows up with with the following: dist/js/swiper.js:20 window.Swiper = function (container, params) { ^ ReferenceError: window is not defined Of course the server doesn't have a window, but I can't figure out how to get around this error. First time diving into node. Using react, gulp, browserify, express. Any ideas?
upvote count: 1
type: UnansweredQuestion

http://stackoverflow.com/comment/45915190
type: Comment
comment on: http://stackoverflow.com/a/28821587
type: AnswerComment
has text: thank you for the update. i understand the function now! very nice :)
score: 0

http://stackoverflow.com/a/28778603
answers question: http://stackoverflow.com/q/28777321
type: Answer
has body: The problem is a slideToggle is triggered for EVERY hover event. What you probably want to do is throttle those events every 500ms. You need to think of exactly how you want it to work. What happens when someone moves across it? Do you want them to rest their cursor on the menu for a little bit before it opens? What happens when they remove their cursor? After how long? setTimeout and clearTimeout will be your friends. PS, how will cell phones use it?
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45846234
upvote count: 1

http://stackoverflow.com/comment/45841383
comment on: http://stackoverflow.com/a/28781677
type: Comment
has text: Sorry you were right your query works like charm . It was my silly mistake.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/95010279
type: Comment
score: 0
type: AnswerComment
has text: Is boolean return true only if value is boolean value
comment on: http://stackoverflow.com/a/54088961

http://stackoverflow.com/comment/45873692
comment on: http://stackoverflow.com/a/28799725
score: 0
type: AnswerComment
type: Comment
has text: As for the first `?` you added, that doesn't matter, because it will always be there in the NodeJS req.url.

http://stackoverflow.com/q/28827395
tagged with: twitter
answer count: 1
tagged with: javascript
tagged with: jquery
has title: How to override onSuggestionMouseEnter for Twitter typeahead
has body: I'm using Twitter Typeahead and have some problems when hovering the suggestions which triggers the hovered suggestion to pop up into my input field. If the user then presses enter the actual hovered value will be chosen and not what the user wrote. I would like it to be selected only if the user clicks the actual suggestion. It seems to be the _onSuggestionMouseEnter() function that is fired when the mouse hovers a suggestion. My question is if it is possible to override this function in my own code? Or to solve this in another way? This is my typeahead code: var suggestions = new Bloodhound({ datumTokenizer: function(d) { return Bloodhound.tokenizers.whitespace(d.value); }, queryTokenizer: Bloodhound.tokenizers.whitespace, limit: 100, remote: { url: 'url/to/suggestions', filter: function(list) { return $.map(list.suggestions, function(word) { return {s: word.title}; }); } } }); suggestions.initialize(); $('.typeahead').typeahead({highlight: true}, { source: suggestions.ttAdapter(), name: 'suggestions', displayKey: 's', hint: false })
score: 0
tagged with: typeahead
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28851981

http://stackoverflow.com/comment/45918090
type: Comment
has text: The title says they aren't being created "properly". I don't know what that means.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28822878

http://stackoverflow.com/comment/45866049
comment on: http://stackoverflow.com/q/28795713
has text: I edited my mistakes above.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45820288
score: 0
type: Comment
type: QuestionComment
has text: Ok. ng-repeat creates a new scope for each item, so outside of the element with ng-repeat, moreItem is not going to be defined, and there isn't really a way around that.
comment on: http://stackoverflow.com/q/28770570

http://stackoverflow.com/comment/46361654
type: Comment
comment on: http://stackoverflow.com/a/29055405
has text: `try { //Your code } catch (e) { // e is exeption object }`
type: AnswerComment
score: 0

http://stackoverflow.com/comment/62735699
has text: Demo isn't working. I can't find `jspdf.plugin.addhtml.js` file. Can you give me cdn link?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28760169
type: AnswerComment

http://stackoverflow.com/q/28807514
tagged with: ibm-mobilefirst
has answer: http://stackoverflow.com/a/28816246
tagged with: blackberry
has comment: http://stackoverflow.com/comment/45894604
type: Question
has comment: http://stackoverflow.com/comment/45895935
has comment: http://stackoverflow.com/comment/45902966
tagged with: ios
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45904194
score: 0
has body: At the launch of an application I need the keyboard to be appear on the screen. I am able to accomplish this in iOS, where I set the focus on a text field and the keyboard is appearing. However in Android and BlackBerry the keyboard is not getting displayed even though the text field is getting focused. I have used the below code to set focus: setTimeout(function(){ document.getElementById("mglTxtEmailAddr").focus(); }, 200);
has comment: http://stackoverflow.com/comment/45895912
type: UnansweredQuestion
tagged with: android
has comment: http://stackoverflow.com/comment/45903216
has title: Keyboard not getting displayed in Android and BlackBerry on element focus

http://stackoverflow.com/comment/45956029
score: 0
type: Comment
has text: Does it log the correct height and width in the `readURL` function?
comment on: http://stackoverflow.com/a/28843233
type: AnswerComment

http://stackoverflow.com/comment/45865476
comment on: http://stackoverflow.com/a/28793114
type: AnswerComment
score: 0
type: Comment
has text: In firefox, it will now go to the html page, and ignore the ajax. in chrome it will load the ajax without styling. If you need to see it better, go check out www.sunto.no/english. The top menu's are html, except the enviroment part, wich is another page embedded.

http://stackoverflow.com/a/28814517
type: Answer
has body: ---write routes for partials also in express ---call that routes inside angular controller and bind that values into scope variables ---use ng-include="" in DOM and call that partial views In the case of templateUrl also express routes will work directly
score: 0
answers question: http://stackoverflow.com/q/28812122

http://stackoverflow.com/comment/46068524
type: Comment
comment on: http://stackoverflow.com/a/28902235
type: AnswerComment
has text: The server is the machine that sends you the files, so the browser knows it. When you make an ajax call, you don't specify the server URL, do you? You just write `$.ajax('file.php')`. That's it. `socket.connect()` does't need a server URL. I know, I've built a chat and it's working fine this way.
score: 0

http://stackoverflow.com/a/28757706
has comment: http://stackoverflow.com/comment/45796254
type: Answer
has body: You can forgo your entire for loop. Everytime you've pushed a name, just add that name to the innerHTML. There is no need to iterate through your entire list everytime. var nameList = []; function addToList(frm) { var list = document.getElementById("list"); if(frm.name.value !== "") { nameList.push(frm.name.value); list.innerHTML += "&lt;div&gt;"+frm.name.value+"&lt;/div&gt;"; } else { alert("Not a name."); }; } Note: I'm keeping your array assuming that it's used elsewhere outside of the provided snippet.
accepted answer of: http://stackoverflow.com/q/28757624
answers question: http://stackoverflow.com/q/28757624
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45796223

http://stackoverflow.com/comment/46059907
type: QuestionComment
comment on: http://stackoverflow.com/q/28900125
has text: Dunno which framework you are using for database access but did you execute the query? If DataBase/Open/Query are your own methods, show the code of it (at least Query)
score: 0
type: Comment

http://stackoverflow.com/q/28796068
score: 0
has title: Set scrollbar opacity while dragging?
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: css
has body: Here's a website that has this feature working: http://www.annexcore.com/ When you click on their scrollbar is changes the opacity of it so it's darker. This is easy to replicate by using :hover in my CSS file. But, when you continue dragging and move the mouse to the left so it isn't hovering anymore, the opacity stays dark as long as you're still dragging it. They are using nicescroll just like I am but I can't figure out how to make it so that the opacity stay dark while dragging (without users being forced to hover over the scrollbar). Can anyone see what they are doing to make this happen?
accepted answer: http://stackoverflow.com/a/28796300
type: AnsweredQuestion
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28796300

http://stackoverflow.com/comment/45843283
comment on: http://stackoverflow.com/a/28782782
type: AnswerComment
score: 0
type: Comment
has text: Can you check your browser console for js errors, what browser are you using?

http://stackoverflow.com/a/29429004
score: 13
has comment: http://stackoverflow.com/comment/56682589
has comment: http://stackoverflow.com/comment/49255813
has comment: http://stackoverflow.com/comment/54320152
accepted answer of: http://stackoverflow.com/q/28861479
has body: Unfortunately, it's not. This is from http://caniuse.com/#feat=clipboard Partial support in IE refers using a non-standard method of interacting with the clipboard. For other browsers it refers to not supporting the ClipboardEvent constructor. Unfortunately, the only browser that properly supports the Clipboard API is FireFox (since 22). All other browsers (if it supports Clipboard API at all), will not support the ClipbordEvent constructor.
answers question: http://stackoverflow.com/q/28861479
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/48825624
has comment: http://stackoverflow.com/comment/49254235
type: Answer
upvote count: 13

http://stackoverflow.com/a/28903049
type: Answer
downvote count: 0
score: 3
has comment: http://stackoverflow.com/comment/46066614
has comment: http://stackoverflow.com/comment/46066715
upvote count: 3
answers question: http://stackoverflow.com/q/28902738
has body: You can do this with CSS General Sibling Selector ~ too. Here is an example : .box { display: inline-block; width: 70px; height: 70px; border: 1px solid; } .box1:hover ~ .box2 { background: red; } .box1:hover ~ .box3 { background: green; } .box1:hover ~ .box4 { background: blue; } Box 1 Box 2 Box 3 Box 4

http://stackoverflow.com/comment/45789505
type: QuestionComment
type: Comment
has text: There is nothing in the net tab that describes this request. But i think i found the problem: Form contains a file input, but is missing method=POST and enctype=multipart/form-data on the form. The file will not be sent. The problem is that I Do have the method set for post. Enctype i don't have because i process the data also in asp from the form. and asp can't get multipart/form-data.
comment on: http://stackoverflow.com/q/28753378
score: 0

http://stackoverflow.com/q/28794764
has comment: http://stackoverflow.com/comment/45864741
linked to: http://stackoverflow.com/q/8672383
has comment: http://stackoverflow.com/comment/45864666
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45864981
has body: I'm using underscore.js on my project and i want to compare two arrays but only their intersection by one field. The first array : [{item: myObject1, label: myObject1.name, ticked: true, disabled: false}] the second array : [{item: myObject1, label: myObject1.name, ticked: false, disabled: false}, {item: myObject2, label: myObject2.name, ticked: true, disabled: false}] I want to return intersection of these arrays by myObject.id and compare it : intersection : {item: myObject1, label: myObject1.name, ticked: true, disabled: false} and {item: myObject1, label: myObject1.name, ticked: false, disabled: false} because myObject1 is the intersection (myObject1.id == myObject1.id). these items are not equals because the first element is ticked and the second no... so, return false; I don't see how can i do that with underscore.js. EDIT: with only isEqual function, i can do that (i use AngularJS): isIOEquals: function(inputs, outputs){ var editedInputs = []; var editedOutputs = []; angular.forEach(outputs, function(outputItem){ angular.forEach(inputs, function(inputItem){ if(_.isEqual(inputItem.item.id, outputItem.item.id)){ editedInputs.push(inputItem); editedOutputs.push(outputItem); } }); }); return _.isEqual(editedInputs, editedOutputs); }
score: 0
has comment: http://stackoverflow.com/comment/45864608
has comment: http://stackoverflow.com/comment/45864747
tagged with: arrays
answer count: 1
has comment: http://stackoverflow.com/comment/45864391
has answer: http://stackoverflow.com/a/28795656
accepted answer: http://stackoverflow.com/a/28795656
has comment: http://stackoverflow.com/comment/45864799
has comment: http://stackoverflow.com/comment/45864731
has title: Intersection and Equals between arrays of objects by only some fields with underscore.js
type: AnsweredQuestion
tagged with: underscore.js
has comment: http://stackoverflow.com/comment/45864509

asp.net-mvc
tags question: http://stackoverflow.com/q/28900125
tags question: http://stackoverflow.com/q/28887962
tags question: http://stackoverflow.com/q/28818229
tags question: http://stackoverflow.com/q/28903466
tags question: http://stackoverflow.com/q/28792384
tags question: http://stackoverflow.com/q/28878304
tags question: http://stackoverflow.com/q/28842422
tags question: http://stackoverflow.com/q/28880699
tags question: http://stackoverflow.com/q/28753183
tags question: http://stackoverflow.com/q/28905408
tags question: http://stackoverflow.com/q/28848743
tags question: http://stackoverflow.com/q/28905577
tags question: http://stackoverflow.com/q/28762010
tags question: http://stackoverflow.com/q/28886308
tags question: http://stackoverflow.com/q/28771161
tags question: http://stackoverflow.com/q/28852193
tags question: http://stackoverflow.com/q/28887453
tags question: http://stackoverflow.com/q/28855763
tags question: http://stackoverflow.com/q/28896678
tags question: http://stackoverflow.com/q/28833832
tag name: asp.net-mvc
tags question: http://stackoverflow.com/q/28835271
tags question: http://stackoverflow.com/q/28813563
tags question: http://stackoverflow.com/q/28832312
tags question: http://stackoverflow.com/q/28900186
tags question: http://stackoverflow.com/q/28762973
tags question: http://stackoverflow.com/q/28842591
tags question: http://stackoverflow.com/q/28761693
tags question: http://stackoverflow.com/q/28851282
tags question: http://stackoverflow.com/q/28859293
tags question: http://stackoverflow.com/q/28896262
tags question: http://stackoverflow.com/q/28880427
tags question: http://stackoverflow.com/q/28777147
tags question: http://stackoverflow.com/q/28827209
tags question: http://stackoverflow.com/q/28766560
tags question: http://stackoverflow.com/q/28875481
tags question: http://stackoverflow.com/q/28765844
tags question: http://stackoverflow.com/q/28837375
tags question: http://stackoverflow.com/q/28869151
tags question: http://stackoverflow.com/q/28880027
tags question: http://stackoverflow.com/q/28820752
tags question: http://stackoverflow.com/q/28751899
type: Tag
tags question: http://stackoverflow.com/q/28764938
tags question: http://stackoverflow.com/q/28869118
tags question: http://stackoverflow.com/q/28861813
tags question: http://stackoverflow.com/q/28792885
tags question: http://stackoverflow.com/q/28795888
tags question: http://stackoverflow.com/q/28886230
tags question: http://stackoverflow.com/q/28797370
tags question: http://stackoverflow.com/q/28887478
tags question: http://stackoverflow.com/q/28817759
tags question: http://stackoverflow.com/q/28782943
tags question: http://stackoverflow.com/q/28763145

http://stackoverflow.com/comment/46062532
type: AnswerComment
comment on: http://stackoverflow.com/a/28900285
score: 0
type: Comment
has text: It works! thanks a lot!!! I have learnt a lot! :) I am newbie and I am a newbie here too (stackoverflow) I need a guide to understand everything about the site.. it is a little bit different from the forums :)

http://stackoverflow.com/q/28814535
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/28818034
has body: I'm using jquery-autocomplete plugin to lookup into an array from suggestions/autocomplete. ref: https://github.com/devbridge/jQuery-Autocomplete PHP (1) $stmt = $dbh-&gt;query("SELECT tag_name FROM tags"); $tags = array(); $tags = $stmt-&gt;fetchAll(PDO::FETCH_COLUMN, 0); echo json_encode($tags); /* var_dump($tags); "array(6) { [0]=&gt; string(1) "tag1" [1]=&gt; string(2) "tag2" [2]=&gt; string(3) "tag3" [3]=&gt; string(4) "tag4" } " */ PHP (2) echo ('["tag1","tag2","tag3","tag4"]'); PHP (3) $a = ["tag1","tag2","tag3","tag4"]; echo json_encode($a); JavaScript $.ajaxSetup({ cache: false, async: false }); var myTags = []; $.get( '/action.php', {action: 'get_tags'}).done( function(data){ console.log(data); myTags = eval(data); //myTags = JSON.parse(data); }); $('#tagInput').autocomplete({ lookup: myTags }); Both PHP v1 and PHP v2 will provide a proper array console.log(data). However, the array coming from PHP v1 json_encode($tags) won't work with the plugin (it simply doesn't recognize the array). While PHP v2 array echo ('["tag1","tag2","tag3","tag4"]'); works just fine. PHP v3 also won't work. What is wrong in this code? Why json_encode() array isn't being recognized?
answer count: 2
has comment: http://stackoverflow.com/comment/45901885
has comment: http://stackoverflow.com/comment/45901638
downvote count: 1
has title: PHP json_encode not working with 1-dimentional array
favorite count: 0
has comment: http://stackoverflow.com/comment/45901368
has comment: http://stackoverflow.com/comment/45901528
has comment: http://stackoverflow.com/comment/45901733
has comment: http://stackoverflow.com/comment/45901668
has comment: http://stackoverflow.com/comment/45901927
has comment: http://stackoverflow.com/comment/45902191
has comment: http://stackoverflow.com/comment/45901795
linked to: http://stackoverflow.com/q/23667086
tagged with: php
possible better answer: http://stackoverflow.com/a/28818034
tagged with: pdo
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/45901297
has comment: http://stackoverflow.com/comment/45901472
has comment: http://stackoverflow.com/comment/45901610
tagged with: http://stackoverflow.com/tag/json
accepted answer: http://stackoverflow.com/a/28816175
has comment: http://stackoverflow.com/comment/45900951
has comment: http://stackoverflow.com/comment/45901158
has comment: http://stackoverflow.com/comment/45900947
type: Question
has comment: http://stackoverflow.com/comment/45901267
has comment: http://stackoverflow.com/comment/45901622
has comment: http://stackoverflow.com/comment/45901114
tagged with: arrays
has answer: http://stackoverflow.com/a/28816175

http://stackoverflow.com/q/28770370
score: 0
has body: I'm trying to load my custom Google Api (Appengine Endpoints) to my frontend project but I receive TypeError: gapi.client.myCustomApi is undefined. I have two projects in Appengine (Frontend and backend project). I have generated the Api Key from the Backend Project. So, I'm following this tutorial: https://cloud.google.com/appengine/docs/python/endpoints/consume_js This is my index.html in code in Frontend project: &lt;script&gt; function loadGapi(){ gapi.client.setApiKey('AIzaSyBvg9bSWGUHhAO-TPIww3KuKhJqC2_BAFk'); gapi.client.load('myCustomApi', 'v1', function() { gapi.client.myCustomApi.list().execute(function(resp) { console.log(resp); }); }, 'https://my-backend-project.appspot.com/_ah/api'); } &lt;/script&gt; &lt;script src="https://apis.google.com/js/client.js?onload=loadGapi"&gt; &lt;/script&gt; Please reply if anyone can help me. Thanks! EDIT1: I have used gapi.client.request for testing, and it works perfect. gapi.client.load doesn't work yet. gapi.client.request({ "path": "/myCustomApi/v1.0/list", "root": "https://my-backend-project.appspot.com/_ah/api" }).execute(function (response) { console.log(response); });
type: Question
tagged with: javascript
tagged with: google-api-js-client
has title: Load my Custom Google API from Javascript Library (remote projects)
answer count: 1
type: UnansweredQuestion
tagged with: google-app-engine
tagged with: google-cloud-endpoints
has answer: http://stackoverflow.com/a/28777010

http://stackoverflow.com/comment/45872077
type: Comment
score: 0
has text: @igorpavlov If you can't change the nginx settings, you can try reducing socket.io heartbeat interval to 10 seconds, and the timeout to 30 seconds.
type: AnswerComment
comment on: http://stackoverflow.com/a/28797650

http://stackoverflow.com/q/28785268
tagged with: javascript
favorite count: 0
duplicate of: http://stackoverflow.com/q/20279484
score: 2
downvote count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45846817
type: Question
has comment: http://stackoverflow.com/comment/45846761
has comment: http://stackoverflow.com/comment/45846780
linked to: http://stackoverflow.com/q/20279484
has comment: http://stackoverflow.com/comment/45846807
has body: I have the charge method defined for MainCharacter class and inside it, another onload function for the image. var MainCharacter = function(canvas, X, Y) { this.canvas = canvas; this.X = (typeof X === "undefined") ? 10 : X; this.Y = (typeof Y === "undefined") ? 10 : Y; this.frameX = 0; this.frameY = 0; this.frameXWidth = this.frameX + 32; this.frameYHeight = this.frameY + 33; this.img = document.createElement('img'); this.img.src = 'assets/img/maincharacter.png'; }; MainCharacter.prototype.charge = function() { this.img.onload = function() { self.canvas.drawImage(self.img, 0, 0, 55, 55, 12, 12, 80, 80); }; } My problem is that this closure is not taking the object, and I am doing the next to solve the problem: MainCharacter.prototype.charge = function () { var self = this; var img = this.img; img.onload = function () { self.canvas.drawImage(self.img, 0, 0, 55, 55, 12, 12, 80, 80); }; } How I can solve this properly?
upvote count: 2
has answer: http://stackoverflow.com/a/28785322
has title: Closure inside Object in JavaScript
has comment: http://stackoverflow.com/comment/45846870
answer count: 1

datetime
tags question: http://stackoverflow.com/q/28752565
tags question: http://stackoverflow.com/q/28891396
tags question: http://stackoverflow.com/q/28779111
tags question: http://stackoverflow.com/q/28846400
tags question: http://stackoverflow.com/q/28818368
tags question: http://stackoverflow.com/q/28809100
tags question: http://stackoverflow.com/q/28855226
tags question: http://stackoverflow.com/q/28869847
tag name: datetime
type: Tag
tags question: http://stackoverflow.com/q/28891618
tags question: http://stackoverflow.com/q/28770151
tags question: http://stackoverflow.com/q/28818874
tags question: http://stackoverflow.com/q/28782688

http://stackoverflow.com/comment/109821345
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/52948276
type: Comment
has text: @Ripon - I tried to use your class to export json array to excel and I am getting error. Unexpected token o in JSON at position 1. Here is sample Json Object- myObj = { "name":"John", "age":30, "car":null };

http://stackoverflow.com/q/28796614
accepted answer: http://stackoverflow.com/a/28796623
answer count: 1
tagged with: jquery
favorite count: 0
score: -2
linked to: http://stackoverflow.com/q/5891840
has comment: http://stackoverflow.com/comment/45867747
has body: This may be a very simple question in syntax but I've been googling and still can't find the answer. I'm trying to set focus to the first SELECT element which has a specific string but the string is held in a dynamic variable. What would be the correct syntax? I thought the below would be correct but it doesn't seem to work. $('SELECT[id*=" + qID"]').focus();
downvote count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/28796623
type: Question
type: AnsweredQuestion
tagged with: javascript
has title: How to find an ID that contains a string if the string is held inside a variable?

http://stackoverflow.com/comment/45967928
score: 0
type: Comment
type: QuestionComment
has text: Well then do that as described. `FormData` has an `append` method.
comment on: http://stackoverflow.com/q/28850087

http://stackoverflow.com/q/28832165
has answer: http://stackoverflow.com/a/28832404
linked to: http://stackoverflow.com/q/18973507
tagged with: javascript
tagged with: controller
answer count: 1
downvote count: 0
favorite count: 0
has title: Angularjs directive call controller function
accepted answer: http://stackoverflow.com/a/28832404
tagged with: angularjs
upvote count: 2
has body: i have a directive which renders a long list. The Rendering works pretty fine and fast, now i would like to call a function on the Controller with Parameters. How can i achieve this? Here is my directive: .directive("slheats", function () { return { restrict: "A", scope: { slheats: "=", }, link: function (scope, element, attrs) { scope.$watch("slheats", function (data) { angular.forEach(data, function (heat, h) { var body = ""; var first = true; var ct = 1; body += "&lt;div class='row heat'&gt;" + heat.Heat + "&lt;/div&gt;"; angular.forEach(heat.Entries, function (entry, e) { var line = ""; ct++; line += "&lt;div class='name'&gt;&lt;button ng-click='showdetails()'&gt;" + entry.Name + "&lt;/button&gt;&lt;/div&gt;"; body += line; }); $(element).append(body); }); }); } } }) .controller('startlistcontroller',['$scope', 'apiservice', 'objectservice', function ($scope, apiservice, objectservice) { $scope.startlists = []; $scope.selected = null; $scope.showdetails = function (x) { alert(x); }; How can i call the showdetails function on my Controller? Thanks Manuel!
score: 2
type: AnsweredQuestion
tagged with: directive
type: Question

http://stackoverflow.com/q/28833559
has answer: http://stackoverflow.com/a/28833836
tagged with: javascript
has title: Gulp.js - Not able to copy generated files from one folder to another
has answer: http://stackoverflow.com/a/28833759
score: 4
linked to: http://stackoverflow.com/q/21699146
answer count: 3
possible better answer: http://stackoverflow.com/a/28833759
tagged with: gulp
favorite count: 0
upvote count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28834029
accepted answer: http://stackoverflow.com/a/28834029
downvote count: 0
has body: gulp.task('minify-css', function () { gulp.src(['src/test/test.css]) .pipe(concat('test1.css')) .pipe(minifyCSS()) .pipe(gulp.dest('src/source/')) .pipe(filesize()) }); gulp.task('copy-css',['minify-css'], function () { gulp.src('src/source/*.css') .pipe(gulp.dest('src/dest/')); }); It seems that the first time I run 'gulp copy-css' Starting 'minify-css'... [18:54:39] Finished 'minify-css' after 61 ms [18:54:39] Starting 'copy-css'... [18:54:39] Finished 'copy-css' after 1.86 ms but the copy operation doesn't execute probably because it executes even before the file to be copied is not generated Even though I have mentioned minify-css as dependency for copy-css task, it seems it is not following that convention in this case. When gulp copy-css is run another time, this time the file is copied because the file is already generated from previously executed command. But this would beat the purpose when the code is being used in production.
type: Question

http://stackoverflow.com/comment/45919059
has text: This code is not working. It doesn't trigger any of the links. Thanks, though.
type: Comment
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28803429

http://stackoverflow.com/comment/46007119
score: 0
has text: I put column type as Enum for mygrid. So it comes as string
type: Comment
comment on: http://stackoverflow.com/q/28871879
type: QuestionComment

http://stackoverflow.com/q/28808624
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28808773
score: 0
has title: get details on page load , and shared in controllers
answer count: 1
has answer: http://stackoverflow.com/a/28808773
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45889757
type: AnsweredQuestion
has body: I need to get Product data as soon as app is initialized, using the same controller I am using in a different section of the page which creates a different instance. HTML: &lt;header class="clearfix" ng-controller="EntityDetailController" ng-init="entity_id={{id}}; get_details('products');"&gt; ... &lt;/header&gt; JS: $scope.result = Products.get({ type : type, id : $scope.entity_id }); $scope.result.$promise.then(function(result) { }); I need to store data in some service so that later on I can share data with all controllers and I also need to notify all controllers once data has been received so that they can fetch data from factory.
type: Question

http://stackoverflow.com/comment/46044877
type: QuestionComment
has text: @Meiloo what about the thumbnails and the arrows left- right?
score: 0
comment on: http://stackoverflow.com/q/28891835
type: Comment

http://stackoverflow.com/comment/46014851
type: Comment
score: 1
has text: So you aren't adding data attribute but setting data object property. You should use `filter()` method instead. That's said, still missing some context regarding your question. If you add yourself these datas, you already know which elements has this data set
comment on: http://stackoverflow.com/q/28876400
type: QuestionComment

http://stackoverflow.com/comment/45928475
type: Comment
has text: Sorry, I misunderstood. I just corrected the code snippet.
comment on: http://stackoverflow.com/a/28828842
type: AnswerComment
score: 0

http://stackoverflow.com/comment/46005253
type: Comment
has text: hi @PaulLeBeau, thanks for the pointer. Still I would like to be able to do that in JavaScript and that question is about Python.
type: QuestionComment
comment on: http://stackoverflow.com/q/28864386
score: 0

http://stackoverflow.com/a/28893932
type: Answer
has body: d3.csv("hip_fake_data.csv", function(error, data) { data.forEach(function(d) { x_value = +d.x_hip; // convert to number y_value = +d.y_hip; });
has comment: http://stackoverflow.com/comment/46049488
upvote count: 4
has comment: http://stackoverflow.com/comment/46049018
answers question: http://stackoverflow.com/q/28892649
type: AcceptedAnswer
downvote count: 0
score: 4
accepted answer of: http://stackoverflow.com/q/28892649

http://stackoverflow.com/q/28830158
has answer: http://stackoverflow.com/a/28830262
has body: While clicking on button I want to add that 4 lables and textboxes below the panel.that 4 controls should recreate in each button by using javascript. I am new to the javascript.Please help me..
answer count: 4
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28830218
has answer: http://stackoverflow.com/a/28830325
has title: How to dynamically add textboxes in a button click using javascript
type: Question
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28830192

http://stackoverflow.com/q/28762357
downvote count: 0
score: 1
has title: Calculate the difference from 2 times
type: Question
tagged with: difference
tagged with: javascript
has body: Today I started working on something with times. I have 2 times. The time from now in a string like 10:10:15 and a date in 27/02/2015 10:05:10. So for this example I need 00:05:05 but I can't figure it out how I have to solve this one and I have searched for hours now.
accepted answer: http://stackoverflow.com/a/28762445
upvote count: 1
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28762445
tagged with: time
type: AnsweredQuestion

http://stackoverflow.com/a/28765010
has body: This link refers to an html page, not directly to the image. The direct link to the images seems to be http://s21.postimg.org/g25v2uno7/newslavorobanner.jpg
downvote count: 1
upvote count: 0
answers question: http://stackoverflow.com/q/28764935
score: -1
type: Answer

http://stackoverflow.com/q/28800492
score: 0
answer count: 1
tagged with: jquery
has body: I'm dynamically creating a table and trying to make each row (tr) sortable. I've followed the various documentation on the jQuery UI site and thought I understood. However, I can't quite seem to figure it out. Where did I go wrong? Thanks! Session Title Start Time End Time Session Title Start Time End Time
has title: jQuery UI Sortable Not Working With Dynamic Table
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28800732
tagged with: jquery-ui
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28800732

http://stackoverflow.com/q/28823808
tagged with: javascript
tagged with: express
score: 0
has title: Posting JSON to a webhook on Parse.com
answer count: 1
has answer: http://stackoverflow.com/a/28829628
tagged with: parse-platform
type: UnansweredQuestion
has body: I am new to webhooks and trying to figure out how to receive a JSON object and save it to Parse.com Here's what my Express.js webhook looks like: // These two lines are required to initialize Express in Cloud Code. var express = require('express'); var app = express(); // Global app configuration section app.set('views', 'cloud/views'); // Specify the folder to find templates app.set('view engine', 'ejs'); // Set the template engine app.use(express.bodyParser()); // Middleware for reading request body app.post('/notify_message', // express.basicAuth('', ''), function(data) { // Use Parse JavaScript SDK to create a new message and save it. var Kenpom = Parse.Object.extend("Kenpom"); var kenpom = new Kenpom(); kenpom.save({ conference : data.results, }).then(function(kenpom) { res.send('Success'); }, function(error) { res.status(500); res.send('Error'); }); }); // Attach the Express app to Cloud Code. app.listen(); This is the JSON object that is getting sent to the webhook: { "name": "REST", "count": 351, "frequency": "Every 15 mins", "version": 198, "newdata": false, "lastrunstatus": "success", "lastsuccess": "Tue Mar 03 2015 02:41:02 GMT+0000 (UTC)", "thisversionstatus": "success", "nextrun": "Tue Mar 03 2015 03:29:21 GMT+0000 (UTC)", "thisversionrun": "Tue Mar 03 2015 02:41:02 GMT+0000 (UTC)", "results": { "collection1": [ { "rank": "1", "team": { "href": "http://kenpom.com/team.php?team=Kentucky", "text": "Kentucky" }, "conference": { "href": "http://kenpom.com/conf.php?c=SEC", "text": "SEC" }, "currentrecord": "29-0", "pyth": ".9790", "offensiveefficiency": "118.7", "defensiveefficiency": "84.9", "tempo": "63.6" }, { "rank": "2", "team": { "href": "http://kenpom.com/team.php?team=Arizona", "text": "Arizona" }, "conference": { "href": "http://kenpom.com/conf.php?c=P12", "text": "P12" }, "currentrecord": "26-3", "pyth": ".9649", "offensiveefficiency": "115.8", "defensiveefficiency": "86.8", "tempo": "66.6" }, .... Parse.com is receiving all the columns, but the ob…
has comment: http://stackoverflow.com/comment/54449636
tagged with: http://stackoverflow.com/tag/json
type: Question

http://stackoverflow.com/comment/45912896
type: Comment
has text: @JessMurray Yes, but that won't help: http://api.jquery.com/load/. Please just start by reading the basics of writing valid HTML.
comment on: http://stackoverflow.com/a/28820414
type: AnswerComment
score: 0

http://stackoverflow.com/a/28888651
score: 0
type: Answer
has body: What roles do your user have on the Auth database? To access the indexes, the readWrite role is not enough, you should have the dbAdmin role.
answers question: http://stackoverflow.com/q/28885943
has comment: http://stackoverflow.com/comment/46058957
has comment: http://stackoverflow.com/comment/46053669
has comment: http://stackoverflow.com/comment/46058738
has comment: http://stackoverflow.com/comment/46053031

http://stackoverflow.com/a/28794267
has body: Inside of your javascript section: xmlhttp.open("GET","some_page_name.xyq",true); More Information
answers question: http://stackoverflow.com/q/28794223
score: 0
type: Answer

http://stackoverflow.com/q/28857340
upvote count: 16
type: AnsweredQuestion
score: 16
type: Question
tagged with: ssl
has answer: http://stackoverflow.com/a/28857457
answer count: 2
downvote count: 0
tagged with: javascript
has body: We have a lot of ajax calls from our web application and the thing is all are https request (our IT team mandates), yes we have opened up the headers to allow cross domain. But the problem is we have our own custom certificate used internally for all of our apps so basically I get error when we call ajax: Failed to load resource: net::ERR_INSECURE_RESPONSE If I open the URL in browser and accept the certificates the ajax calls works fine. So my question is, is there a way to handle this via Javascript? Or would adding trusted certificate would resolve this issue? Also even after we add trusted certificate would again I face any issue in ajax? Note: We are testing all these in chrome browser
tagged with: jquery
has answer: http://stackoverflow.com/a/28858748
favorite count: 0
accepted answer: http://stackoverflow.com/a/28858748
tagged with: ajax
has title: ERR_INSECURE_RESPONSE handing tips in Javascript
possible better answer: http://stackoverflow.com/a/28857457

http://stackoverflow.com/q/28781797
tagged with: php
type: AnsweredQuestion
tagged with: iframe
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28781942
tagged with: javascript
tagged with: jquery
has body: We have developed the IFRAME and we have provided it to other users ,the problem is once the particular user uses that IFRAME in there web pages it works properly but once switched to mobile version IFRAME looses its responsiveness to be more specific, content of the IFRAME remains responsive but IFRAME is not getting specific auto height ......??? kindly suggest ve
accepted answer: http://stackoverflow.com/a/28782312
answer count: 2
downvote count: 4
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has answer: http://stackoverflow.com/a/28782312
has title: How to create responsive iframe in cross domain?
possible better answer: http://stackoverflow.com/a/28781942
score: -3

http://stackoverflow.com/comment/45971940
has text: use style="max-width:inherit"
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28852579
score: 0

http://stackoverflow.com/comment/45925353
type: QuestionComment
has text: Yes, you can use position function and then get top value of div "position.top".
comment on: http://stackoverflow.com/q/28827401
score: 0
type: Comment

android-webview
tags question: http://stackoverflow.com/q/28789989
type: Tag
tags question: http://stackoverflow.com/q/28886916
tag name: android-webview
tags question: http://stackoverflow.com/q/28774855
tags question: http://stackoverflow.com/q/28868443
tags question: http://stackoverflow.com/q/28851032
tags question: http://stackoverflow.com/q/28792989

http://stackoverflow.com/comment/45954818
has text: Same thing, the problem was from my CDN provider, they had issues. I'm now back to the normal webhost and nameservers and everything works flawless. I replied below the solution.
comment on: http://stackoverflow.com/q/28842159
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28781114
has body: im writing a simple canvas game and want to be able to move my character diagonally on the screen. how do I detect two keys pressed say up and right? heres my code so far- function keyHit(evt){ switch (evt.keyCode) { case 38: /* Up arrow was pressed */ if (player2y &gt;= 1){ player2y -= 4; } else {player2y = 0;} break; case 40: /* Down arrow was pressed */ if (player2y &lt;= 364){ player2y += 4; } else { player2y = 365;} break; case 37: /* Left arrow was pressed */ if (player2x &gt;= 1){ player2x -= 4; } else {player2x = 0;} break; case 39: /* Right arrow was pressed */ if (player2x &lt;= 665){ player2x += 4; } else {player2x = 666;} break; } }
has comment: http://stackoverflow.com/comment/45839108
type: Question
tagged with: javascript
score: 0
has title: detecting two keyboard buttons in javascript
answer count: 1
accepted answer: http://stackoverflow.com/a/28781177
linked to: http://stackoverflow.com/q/14087609
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28781177

http://stackoverflow.com/comment/45819973
type: QuestionComment
has text: get the indexOf of second dash and get the substring from 0th position to indexOf(second dash) +1
comment on: http://stackoverflow.com/q/28770702
score: 0
type: Comment

http://stackoverflow.com/comment/45871588
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28798568
score: 0
has text: What does the JavaScript console say? Are there any errors? What if you add `alert($('.chat-messages').length);`? Does it find the element?

http://stackoverflow.com/q/28852745
answer count: 1
tagged with: mongoose
tagged with: javascript
has body: I'm trying to find a way to get myself a clean as possible code for using multiple complex queries. I have 2 documents in MongoDB. First one is followers and second one is events. First query: Get all the followers from a specific user. Second query: Get all the events from all those followers and sort them by date. I have no idea how to do the second query. Maybe something like this: Event.find({ "$or" : [ { 'userId': followers[0].id, }, { 'userId': followers[1].id, }, { 'userId': followers[2].id, }, ]}); But that doesn't feel a very clean code to me.
favorite count: 0
has answer: http://stackoverflow.com/a/28853092
accepted answer: http://stackoverflow.com/a/28853092
has comment: http://stackoverflow.com/comment/45972121
tagged with: node.js
tagged with: mongodb-query
score: 2
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/45972223
type: Question
has comment: http://stackoverflow.com/comment/45972772
upvote count: 2
tagged with: mongodb
has title: Complex multiple queries in mongoose with $or

typescript
tags question: http://stackoverflow.com/q/28844406
tags question: http://stackoverflow.com/q/28777423
tags question: http://stackoverflow.com/q/28793098
tag name: typescript
tags question: http://stackoverflow.com/q/28906505
tags question: http://stackoverflow.com/q/28764814
tags question: http://stackoverflow.com/q/28770765
type: Tag
tags question: http://stackoverflow.com/q/28785465
tags question: http://stackoverflow.com/q/28811176

http://stackoverflow.com/comment/45939716
comment on: http://stackoverflow.com/a/28835089
type: Comment
has text: @Henk , `(function(){ return 'bla'; })()`
score: 1
type: AnswerComment

http://stackoverflow.com/comment/45954091
score: 0
type: Comment
has text: Tried Set IE = WScript.CreateObject("InternetExplorer.Application","objIE_"), and same error. Did the solution you proposed work for you?
comment on: http://stackoverflow.com/a/28841771
type: AnswerComment

button
tags question: http://stackoverflow.com/q/28885853
tags question: http://stackoverflow.com/q/28817759
type: Tag
tags question: http://stackoverflow.com/q/28759531
tags question: http://stackoverflow.com/q/28833489
tags question: http://stackoverflow.com/q/28903678
tag name: button
tags question: http://stackoverflow.com/q/28800039

http://stackoverflow.com/q/28838199
type: Question
has comment: http://stackoverflow.com/comment/45947081
answer count: 2
tagged with: javascript
possible better answer: http://stackoverflow.com/a/79380080
has answer: http://stackoverflow.com/a/79380080
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28881618
has body: I am wanting to have the summary of a detail tag stick to the bottom of the text expanded when the summary is clicked. I can't seem to think of a way to get it there, any ideas? My test block is as follows: The Career Center will host its second “Starting Your Own Business” workshop on Tuesday, February 24, at 10 a.m. Keli Morris from Northwest Enterprise Facilitation will conduct the workshop. Read More The Career Center will host its second “Starting Your Own Business” workshop on Tuesday, February 24, at 10 a.m. Keli Morris from Northwest Enterprise Facilitation will conduct the workshop. Anyone who would like to attend can call 660-582-8980 or email emailGoesHere to get their name on the list. Based upon client feedback, we have changed the day/time for our weekly Job Club workshops at the Career Center. Starting in February, Job Club will meet Wednesday mornings at 9:30. For more information or to reserve a spot, please call the Career Center. i want to avoid Javascript, but that is a fallback by throwing out detail and summary tags and using onclick for 2 links, each hiding the other and showing or hiding the text. I would give more but i'm not sure how else to explain this, in essence i want summary to expand upwards when clicked.
favorite count: 0
has comment: http://stackoverflow.com/comment/45946226
downvote count: 2
tagged with: css
has title: How do I fix the summary tag to the bottom of the expanded detail tag associated with it?
has comment: http://stackoverflow.com/comment/45945892
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45946243
score: 1
upvote count: 3
has answer: http://stackoverflow.com/a/28881618

http://stackoverflow.com/comment/45811601
type: AnswerComment
score: 0
type: Comment
has text: you misunderstand me, i guess, couse i want something else :)
comment on: http://stackoverflow.com/a/28761974

http://stackoverflow.com/comment/54322380
comment on: http://stackoverflow.com/a/32955835
type: AnswerComment
has text: This needs more upvotes! Works perfectly and is super easy to understand! Thanks.
score: 4
type: Comment

http://stackoverflow.com/a/28806178
has body: That's because jQuery is not fully loaded yet. You may need to execute your jQuery code only after jQuery has been loaded by attaching an event handler to the onload event of your dynamically created script element as shown below. script.onload = function() { // Put your jQuery code here. console.log(jQuery); }; Cross-Browser solution for supporting older browsers like IE8 and below: script.onload = script.onreadystatechange = function(event) { event = event || window.event; if (event.type === "load" || (/loaded|complete/.test(script.readyState))) { script.onload = script.onreadystatechange = null; // Put your jQuery code here. console.log(jQuery); } };
score: 0
answers question: http://stackoverflow.com/q/28805588
type: Answer

epub
type: Tag
tags question: http://stackoverflow.com/q/28832778
tag name: epub

http://stackoverflow.com/comment/63869200
type: Comment
has text: @MashukKhan happy to help. :)
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28943502

http://stackoverflow.com/q/28881816
tagged with: javascript
score: -3
has answer: http://stackoverflow.com/a/28882023
has title: How can i submit a form using input type=button
tagged with: http://stackoverflow.com/tag/html
has body: This is my form, before I'm using input type=submit , but now I use a validation state that's why i need to switch on input type=button, my problem is How can i submit this form using button? //HTML CODE Your email address* Message* Enter the code you see* <?=$random_text?> //JS CODE function validateText(id){ if($("#"+id).val()==null || $("#"+id).val()=="") { var div = $("#"+id).closest("div"); div.removeClass("has-success"); $("#gly"+id).remove(); div.addClass("has-error has-feedback"); div.append(''); return false; }else{ var div = $("#"+id).closest("div"); div.removeClass("has-error"); div.addClass("has-success has-feedback"); $("#gly"+id).remove(); div.append(''); return true; } } $(document).ready( function() { $("#question_submit").click(function() { validateText("emailq"); validateText("messageq"); validateText("codeq"); $("form#question_form").submit(); }); } ); //PHP CODE if(isset($_POST['submit'])){ $email = $_POST['email']; $message = $_POST['message']; $captcha = $_POST['captcha']; $user_Input = $_POST['uIcaptcha']; $exists = mysqli_query($con,"SELECT * FROM users WHERE email = '".$email."'"); if(!empty($email) and !empty($message)and !empty($user_Input)){ //check if empty if(mysqli_num_rows($exists) > 0){ //check if email is valid if($captcha == $user_Input){ //check if captcha is correct echo 'Query Here'; } else{ $error_code = 'Please enter correct code.'; //close if captcha checking } }else{ $error_email = 'Please enter the valid email address'; // close if email validation } }else{ $error = 'Please fill up all information!'; //close if empty checking } }
has comment: http://stackoverflow.com/comment/46025017
favorite count: 0
has comment: http://stackoverflow.com/comment/46025072
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/46025494
has comment: http://stackoverflow.com/comment/46025088
has comment: http://stackoverflow.com/comment/46025246
downvote count: 3
type: Question
has answer: http://stackoverflow.com/a/28894333
answer count: 2
upvote count: 0

http://stackoverflow.com/comment/45978803
type: Comment
type: QuestionComment
has text: im pretty new to authentication. So im still trying to learn. The server is storing the token (or i am going to store is as fast as i get the client side going). But my guess is that the client needs to send it so the server know what client wants what.
comment on: http://stackoverflow.com/q/28856199
score: 0

http://stackoverflow.com/q/28818510
has comment: http://stackoverflow.com/comment/46055169
tagged with: graph
tagged with: javascript
tagged with: highcharts
downvote count: 1
has comment: http://stackoverflow.com/comment/45930632
favorite count: 0
has body: I'm working on an interactive graph project using Highcharts and need a way to do the following: note: the screenshots I attached are of photoshop mocks, the points circled in red are what I'm interested in adding to my Highcharts graph. Custom 'point of interest' axis markers: Labels above a plotted series (the two above the dotted lines): In this screenshot it's the "Average Portfolio of..." and "Average Mutual..." that I need to add to my graph. Thanks in advance!
upvote count: 3
has title: Adding custom labels to a Highcharts graph
score: 2
answer count: 0
type: UnansweredQuestion
tagged with: coffeescript
type: Question

http://stackoverflow.com/a/28837820
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28822058
answers question: http://stackoverflow.com/q/28822058
type: Answer
has body: Were you looking for something like this? I've made a simple function to draw an image on a canavs. When you drag the image you simply call the function for both canvas. http://jsfiddle.net/Niddro/96rdnv3L/ var canvasOne = document.getElementById("canvasOne"); var ctxOne = canvasOne.getContext("2d"); var canvasTwo = document.getElementById("canvasTwo"); var ctxTwo = canvasTwo.getContext("2d"); var mouseX=0; var mouseY=0; var imageX=0; var imageY=0; var drag = false; canvasOne.addEventListener("mousedown", function(){drag=true;}, false); canvasOne.addEventListener("mouseup", function(){drag=false;}, false); canvasOne.addEventListener("mousemove", moveImage, false); var myImage = new Image(); myImage.src = "http://home.niddro.com/HTML5/flxprt/img/logo_orange_small.png"; function moveImage(event) { if (drag) { var x = new Number(); var y = new Number(); var canvas = document.getElementById("canvasOne"); if (event.x != undefined &amp;&amp; event.y != undefined) { x = event.x; y = event.y; } else // Firefox method to get the position { x = event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; y = event.clientY + document.body.scrollTop + document.documentElement.scrollTop; } x -= canvas.offsetLeft; y -= canvas.offsetTop; var deltaX = mouseX-x; var deltaY = mouseY-y; drawImage(imageX-deltaX,imageY-deltaY,ctxOne,canvasOne,myImage); drawImage(imageX-deltaX,imageY-deltaY,ctxTwo,canvasTwo,myImage); } } drawImage(imageX,imageY,ctxOne,canvasOne,myImage); drawImage(imageX,imageY,ctxTwo,canvasTwo,myImage); function drawImage(x,y,ctx,canvas,img) { ctx.clearRect(0,0,canvas.width,canvas.height); ctx.drawImage(img,x,y); } canvas { border: 1px solid black; } &lt;canvas id="canvasOne" width="500" height="300"&gt;&lt;/canvas&gt;&lt;br /&gt; &lt;canvas id="canvasTwo" width="500" height="300"&gt;&lt;/canvas&gt;

http://stackoverflow.com/comment/59484210
score: 0
type: AnswerComment
type: Comment
has text: Update a little my answer. Just I had trouble with object property order and I decided to write this.
comment on: http://stackoverflow.com/a/35901794

http://stackoverflow.com/q/28769036
has body: I have a open-container div which contains thumbnails. If the user clicks on that thumbnail div then a div named box with the same index will appear. So basically I have the following structure: Ipsum Lorum Ipsum Lorum Ipsum Lorum Ipsum Lorum Ipsum Lorum Ipsum Lorum Ipsum Lorum Ipsum Lorum Ipsum Lorum To be honest I have not tried anything yet as I am not sure how to set the required connection between the divs. My initial solution was setting 3 click events for each box-open class and target the boxes using nth-of-type. Writing the same code 3 times is not so elegant though. The opacity of the divs is set to 0. Will be set to 1 if a box becomes visible or "will appear". For user j08691: $('div.box-open').click(function () { var timeline = new TimelineMax({paused:true}); timeline.to($('.box').eq($(this).index()), 3, {left:'6%', ease:Back.easeInOut}) timeline.play(); })
has comment: http://stackoverflow.com/comment/45817291
accepted answer: http://stackoverflow.com/a/28769199
score: 0
has answer: http://stackoverflow.com/a/28769221
has comment: http://stackoverflow.com/comment/45816850
has answer: http://stackoverflow.com/a/28769199
answer count: 4
type: AnsweredQuestion
has title: Clicking on Div A triggers Div B and removes siblings of Div B
has answer: http://stackoverflow.com/a/28769462
has comment: http://stackoverflow.com/comment/45816803
has comment: http://stackoverflow.com/comment/45816938
possible better answer: http://stackoverflow.com/a/28769152
has answer: http://stackoverflow.com/a/28769152
type: Question
has comment: http://stackoverflow.com/comment/45816879
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/45850964
comment on: http://stackoverflow.com/q/28787436
score: 0
type: Comment
type: QuestionComment
has text: @FelixKling It's kind of a debounce. With a debounce, if a ton of saves were fired in quick succession (<delay), then only the last call to save would actually fire. The problem is that only the last save is firing. Meaning in that last example, only `obj1` would be saved.

http://stackoverflow.com/comment/45944326
has text: Because you passed response[0]. If you do that you don't pass an array to the script that saves the data in sessionStorage. You need to remove [0] or from where you store the data or from where you want to retrieve it so in your case userDataObject.
comment on: http://stackoverflow.com/a/28831725
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28843787
has title: Uncaught Error: Cannot call `compile` without the template compiler loaded. Please load `ember-template-compiler.js` prior to calling `compile`
answer count: 2
has body: im new to the ember.js framework and using ruby on rails and ember.debug.js -v 1.10.1(latest release). I have been reading online that ember changed this latest patch but i cant figure out how to fix my problem of: Uncaught Error: Cannot call `compile` without the template compiler loaded. Please load `ember-template-compiler.js` prior to calling `compile`. Could someone please nudge me in the direction to getting my compiler to run properly? i wish i knew what code snippets from my project would help determine the answer...
favorite count: 0
type: UnansweredQuestion
score: 6
tagged with: ember.js
has answer: http://stackoverflow.com/a/28852131
upvote count: 7
tagged with: ruby-on-rails
has answer: http://stackoverflow.com/a/32578154
downvote count: 1
has comment: http://stackoverflow.com/comment/45956781
type: Question
tagged with: javascript

http://stackoverflow.com/comment/45785716
type: Comment
has text: yeah i only want to count that for a minute. So overall time the user watched the video, then calculate it as a percentage afterwards i guess
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28751568

http://stackoverflow.com/q/28878766
answer count: 1
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/31528490
tagged with: angularjs
type: UnansweredQuestion
tagged with: date-format
has title: Format date using angular-moment.js
tagged with: momentjs
score: 1
upvote count: 1
has body: I have a date with thi format:"YYYY-MM-DD HH:mm:ss" and I'm trying to format that to: "DD/MM/YYYY às HH:mm" So a date like: 2015-01-22 15:01:45 would be formatted to: 22/01/2015 às 15:01 I'm using angular-moment.js to do that, here is what I tried: amDateFormat:"DD/MM/YYYY 'as' hh:mm" But the output is not what I was expecting: 22/01/2015 am0 12:00 What am I doing wrong?
type: Question
tagged with: javascript
tagged with: ionic-framework

http://stackoverflow.com/comment/45985466
type: AnswerComment
has text: 1.8 and at var up = dijit .... line ... I guess this is because when first time this function is called ; it doesnr find the uploader div
type: Comment
comment on: http://stackoverflow.com/a/28856172
score: 0

http://stackoverflow.com/comment/46032096
has text: Thanks a lot molderek - additionally I had a stupid syntax error. `tx.executeSql('INSERT INTO activity_stream (band, clubID, time, title) VALUES (?, ?, ?, ?)', [Xband, XclubID, Xtime, Xtitle]);`
comment on: http://stackoverflow.com/a/28807014
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28824305
has answer: http://stackoverflow.com/a/28824396
accepted answer: http://stackoverflow.com/a/28824396
type: Question
has title: Plain Javascript: equivalent of jQuery $.data('key',value)?
has answer: http://stackoverflow.com/a/28824948
has body: I am using some functions with jQuery and now I want to make them plain JS. $('#selector').mouseenter( function( e1 ) { var item = $(this); clearTimeout(item.data('hoverTimer')); var timer = setTimeout( function( e1 ) { //do stuff } }, 50 ); item.data('hoverTimer', timer); }).mouseleave( function( e2 ) { var item = $(this); clearTimeout(item.data('hoverTimer')); var timer = setTimeout( function( e2 ) { //do the other stuff }, 300 ); item.data('hoverTimer', timer); }); I need to know how to put it in plain JS for setting the timeout data and how to clear the timeout data.
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/28824948
upvote count: 1
downvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
type: AnsweredQuestion

http://stackoverflow.com/comment/123959063
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28876564
type: AnswerComment
has text: This is the only correct way to do it. The spread operator ( `...object`) and `Oject.assign` solution which are often mentioned on the internet are only working for "top level" values. Child objects which are nested inside the original object are referenced when using the spread operator or `Object.assign` function. This means if the child object values are changing, they are changing in all copies as well.

http://stackoverflow.com/q/28846534
has comment: http://stackoverflow.com/comment/45962639
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45962426
has comment: http://stackoverflow.com/comment/45962327
favorite count: 0
has comment: http://stackoverflow.com/comment/45961633
has comment: http://stackoverflow.com/comment/45961516
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45962595
has comment: http://stackoverflow.com/comment/45962460
upvote count: 0
has comment: http://stackoverflow.com/comment/45967703
has answer: http://stackoverflow.com/a/28847069
accepted answer: http://stackoverflow.com/a/28847069
has comment: http://stackoverflow.com/comment/45962520
type: Question
has body: i have an auto-suggest url from that i need to write a JavaScript code through which i will be able to see the auto-suggest data. i tried the below code but i am not able to get through it. the thing i am getting in response is:- {"suggestions":[{"suggestion":"water","categories":[{"name":"Water & Juice","filter":"category_id%3A4606"},{"name":"Water Dispensers & Filters","filter":"category_id%3A16896"}]},{"suggestion":"water cooler","categories":[{"name":"Water Dispensers & Filters","filter":"category_id%3A16896"},{"name":"Kitchen Storage & Organization","filter":"category_id%3A1303"}]},{"suggestion":"water bottle","categories":[{"name":"Lunch Totes & Water Bottles","filter":"category_id%3A8812"},{"name":"Water & Juice","filter":"category_id%3A4606"}]},{"suggestion":"water cups","categories":[{"name":"Disposable Plates & Cups","filter":"category_id%3A992"},{"name":"Disposable Cups","filter":"category_id%3A13302"}]},{"suggestion":"water bottle labels","categories":[{"name":"Labels","filter":"category_id%3A997"},{"name":"Mailing & Shipping Labels","filter":"category_id%3A6118"}]},{"suggestion":"water dispenser","categories":[{"name":"Water Dispensers & Filters","filter":"category_id%3A16896"},{"name":"All Kitchen","filter":"category_id%3A60479"}]},{"suggestion":"watch","categories":[{"name":"Pedometers & Fitness Trackers","filter":"category_id%3A2554"},{"name":"Smart Watches","filter":"category_id%3A62030"}]},{"suggestion":"watercolor","categories":[{"name":"Abstract Art","filter":"category_id%3A12645"},{"name":"Wall Art/Decor","filter":"category_id%3A26678"}]}]} from that response i need to find all the product name which coming after suggestion not suggstions like suggestion for wat water cooler etc.
has comment: http://stackoverflow.com/comment/45962544
linked to: http://stackoverflow.com/q/28875087
has comment: http://stackoverflow.com/comment/45961541
has comment: http://stackoverflow.com/comment/45962660
tagged with: javascript
score: -1
has title: getting autosuggest from a url using javascript

http://stackoverflow.com/comment/45893976
comment on: http://stackoverflow.com/a/28795767
score: 0
type: AnswerComment
type: Comment
has text: the plugin will adapt your iframe to what ever screen resolution so you don't have to manage this your self

http://stackoverflow.com/a/28751440
type: AcceptedAnswer
has body: the param is search not receivedate return $http.get('https://api.fda.gov/drug/event.json', { params: { search: 'receivedate:' + val }
type: Answer
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28751398
answers question: http://stackoverflow.com/q/28751398
upvote count: 2

http://stackoverflow.com/q/28827101
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/45924816
has body: Hy, I am using jsTree, but I am not an expert in jQuery stuff. What I want is, when using the drag and drop functionality of jsTree, I want that a node cannot be moved to another node's child list. A node can only be dragged to a parent position. I hope the question is clear. Thanks in advance.
type: UnansweredQuestion
answer count: 0
has comment: http://stackoverflow.com/comment/46224580
type: Question
tagged with: jstree
has title: jsTree - dragged node should not become a child
tagged with: javascript

http://stackoverflow.com/a/28905119
accepted answer of: http://stackoverflow.com/q/28772195
has comment: http://stackoverflow.com/comment/46085567
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46094055
has body: As you have noticed, the background frames policy only applies to non-Leap-enabled apps. When another Leap-enabled app is in the foreground, you still don't get frames.
score: 0
answers question: http://stackoverflow.com/q/28772195
type: Answer
has comment: http://stackoverflow.com/comment/46093663

http://stackoverflow.com/q/28905849
upvote count: 10
type: Question
tagged with: nashorn
tagged with: jython
has comment: http://stackoverflow.com/comment/46072583
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/46076352
has comment: http://stackoverflow.com/comment/46071726
score: 10
favorite count: 0
answer count: 0
has title: Limiting memory usage of a Java/Rhino/Nashorn object
type: UnansweredQuestion
has body: I'm extending a server application written in Java to allow user-defined callbacks (written in Javascript) to be run in response to requests. I've done some reading, and while it seems possible to disable Java classes in Nashorn, there is nothing stopping a user from creating Javascript code that allocates an enormous array without using any Java APIs. I'm wondering if there is any way to restrict this, either proactively or reactively. The solution I came up with is to have a process pool of JVMs with small max heap sizes, which are responsible for running the user-defined code. There will be a worker pool manager to spawn new processes when needed. This way, the main process, as well as other user-defined code, will not be affected by a single malicious user. While this solution will likely work, it seems heavy-handed. Is there no better solution for preventing malicious users from using too much memory? I'm not particularly set on Javascript, so if there exists any other scripting language that can be run within a JVM and also has support for memory usage limits, I would be open to using it instead of Nashorn. Unfortunately, it seems like Jython, JRuby, and LuaJava all don't have what I'm looking for. Thanks in advance.
has comment: http://stackoverflow.com/comment/46074342
tagged with: rhino
tagged with: java

http://stackoverflow.com/comment/45948819
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28839351
has text: it's your css doing it, demo doesn't even include jQuery.js

http://stackoverflow.com/comment/45983325
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28858661
has text: ngRoute: `.config(function ($routeProvider) { $routeProvider .when('/', { templateUrl: 'views/login.html', controller: 'LoginCtrl' }) .when('/financial', { templateUrl: 'views/financial.html', controller: 'FinanceCtrl' })`

http://stackoverflow.com/comment/46004052
type: AnswerComment
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28870113
has text: Correct. But, I am little confused about what OP's asking.

http://stackoverflow.com/q/28864812
tagged with: joi
has answer: http://stackoverflow.com/a/76018977
has answer: http://stackoverflow.com/a/73077736
has answer: http://stackoverflow.com/a/60777895
possible better answer: http://stackoverflow.com/a/61212051
has answer: http://stackoverflow.com/a/61212051
favorite count: 0
score: 31
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28883603
has body: If I have two fields, I'd just like to validate when at least one field is a non empty string, but fail when both fields are empty strings. Something like this does not validate var schema = Joi.object().keys({ a: Joi.string(), b: Joi.string() }).or('a', 'b'); When validating against {a: 'aa', b: ''} The or condition only tests for the presence of either key a or b, but does test whether the condition for a or b is true. Joi.string() will fail for empty strings. Here is gist with some test cases to demonstrate http://requirebin.com/?gist=84c49d8b81025ce68cfb
upvote count: 31
has title: Using Joi, require one of two fields to be non empty
has answer: http://stackoverflow.com/a/69666859
accepted answer: http://stackoverflow.com/a/28883603
type: Question
downvote count: 0
tagged with: hapi.js
tagged with: javascript
answer count: 6

http://stackoverflow.com/comment/46043221
comment on: http://stackoverflow.com/q/28891106
type: QuestionComment
type: Comment
score: 2
has text: Because the first is a *function declaration* without the mandatory name, the second is a *function expression* where the name is optional.

http://stackoverflow.com/comment/46071614
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28906051
type: Comment
has text: so you think there is no "invisible" char (Like /n new line) in word wrap?

http://stackoverflow.com/a/28821189
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28820948
has comment: http://stackoverflow.com/comment/45914258
has body: Ok so here is what is happening. Since you are using reader.onloadend which is an external function or plugin, whatever it is. It is missing the internal angular digest process. This is a case where you need to add $scope.$apply() after you push to the array. $scope.files.push({ name: currentFile.name, src : reader.result }); $scope.$apply(); This forces angular to refresh itself. Here is a working plunker just to be safe. http://plnkr.co/edit/w3u3VWMC9e8h1L0Bhkuh?p=preview
accepted answer of: http://stackoverflow.com/q/28820948
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/q/28851992
answer count: 2
tagged with: html5-canvas
has body: I want to learn internet games design. When I looked for that on the internet I was confused between "JS" and "HTML5" games. Are they the same? and if they are not what is the difference between them?
favorite count: 0
accepted answer: http://stackoverflow.com/a/28852247
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28852191
has title: What is the difference between JS games and HTML5 canvas games?
has answer: http://stackoverflow.com/a/28852191
upvote count: 1
downvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28852247
score: 0

http://stackoverflow.com/comment/45919290
has text: it was just a sample, since I don't have enough information to fully diagnose your issue
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28802617
type: Comment

http://stackoverflow.com/comment/45821496
comment on: http://stackoverflow.com/a/28768676
score: 0
type: AnswerComment
type: Comment
has text: post html code. button do some action not bound with timer.day var.

http://stackoverflow.com/q/28796705
has comment: http://stackoverflow.com/comment/45868161
has title: How to check address validity?
favorite count: 0
score: -1
has comment: http://stackoverflow.com/comment/45868044
tagged with: geocoding
has comment: http://stackoverflow.com/comment/45867906
type: Question
tagged with: google-maps
has answer: http://stackoverflow.com/a/28796977
tagged with: javascript
has comment: http://stackoverflow.com/comment/45868179
tagged with: google-maps-api-3
has body: I have wrote following example: http://jsfiddle.net/214190tj/1/ html: Please Insert an address: js: var input = document.getElementById('searchTextField'); var options = {componentRestrictions: {country: 'us'}}; new google.maps.places.Autocomplete(input, options); Now it is working good but I need to check that uset didn't type something like "dsgfdsgfjhfg" when button clicks. Please help to improve my code. P.S. this approximately make what I want but it executes in callback. I need a function which returns true or false. function codeEditAddress(id) { var address = document.getElementById('address' + id).value; isValid = undefined; geocoder.geocode({ 'address': address}, function (results, status) { if (status == google.maps.GeocoderStatus.OK) { map.setCenter(results[0].geometry.location); $("#mapLat" + id).val(results[0].geometry.location.lat()); $("#mapLng" + id).val(results[0].geometry.location.lng()); if (marker) { marker.setMap(null); } marker = new google.maps.Marker({ map: map, position: results[0].geometry.location }); marker.setMap(map); isValid = true; } else { isValid = false; } }); }
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45867960
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45868266
upvote count: 0
duplicate of: http://stackoverflow.com/q/682093

http://stackoverflow.com/q/28801644
favorite count: 0
tagged with: ajax
has title: Calling php script with ajax
has body: I've got this simple page to understand the workings of ajax, but I haven't been able to execute the specified php file and get a success. Here's the code, extra points for explanation: html page: click me! js script: function addToDb() { var source = "SoundCloud"; var partyKey = "4"; var id = "0987654321"; //window.alert("check your db"); // this is called as expected jQuery.ajax({ type: 'POST', // correctly finds the script but never executes it url: 'PHP/functionFilter.php', dataType: "json", data: {functionname: 'addSong'}, success: function(response) { window.alert(response); } }); }; php file: <?php echo "".$_POST['functionname']; ?> note I do not get any errors.
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45877821
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45878115
tagged with: php
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45877609
type: Question
has comment: http://stackoverflow.com/comment/45877938
has comment: http://stackoverflow.com/comment/45877703
has comment: http://stackoverflow.com/comment/45878039
has comment: http://stackoverflow.com/comment/45877666
has answer: http://stackoverflow.com/a/28802270
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28801710
has answer: http://stackoverflow.com/a/28801706
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/45877643
has comment: http://stackoverflow.com/comment/45877846

http://stackoverflow.com/comment/45900244
has text: will also fail in safari I believe
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28813783
type: AnswerComment

http://stackoverflow.com/q/28755433
has answer: http://stackoverflow.com/a/28755836
type: UnansweredQuestion
downvote count: 2
has body: If I have a) console.log("I am faster") and b) var string = "I am faster" console.log(string) Which console.log call would be most likely to execute faster, a or b?
has comment: http://stackoverflow.com/comment/45792256
tagged with: performance
score: -2
tagged with: javascript
has comment: http://stackoverflow.com/comment/45792612
type: Question
answer count: 2
upvote count: 0
has answer: http://stackoverflow.com/a/28755870
favorite count: 0
has title: Which instruction is faster?

http://stackoverflow.com/comment/45835657
type: Comment
has text: Any reason why Replace in Files won't work?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28773523

http://stackoverflow.com/comment/45944585
has text: @ajmajmajma, if this syntax does not come naturally, I highly recommend brushing up on your JSON syntax. It's quite simple and it will prove to be very helpful when writing object oriented javascript.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28837450
type: Comment

http://stackoverflow.com/q/28874014
type: Question
score: 2
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/46010912
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has title: Replace an existing image with another
has comment: http://stackoverflow.com/comment/46010691
has body: I'm trying to build a simple Javascript to drag and drop an image. The dragged image after being dragged and dropped should regenerate in its original position. I'm trying something like this, but it seems to not work; it doesn't regenerate the picture: My js function: var nPedY = 21; var nPedR = 21; var red = new Image(50,50); red.src = "red.png"; function allowDrop(ev) { ev.preventDefault(); } function drag(ev) { ev.dataTransfer.setData("text", ev.target.id); } function drop(ev) { ev.preventDefault(); var data = ev.dataTransfer.getData("text"); ev.target.appendChild(document.getElementById(data)); if (data == "drag1"){ document.getElementById("drag1").src = red.src; console.log(nPedR); } } And my HTML markup: &lt;tr&gt; &lt;td width="50px" height="50px"&gt;&lt;img id="drag1" src="red.png" align="center" draggable="true" ondragstart="drag(event)"&gt;&lt;/td&gt; &lt;td width="50px" height="50px"&gt;&lt;img id="drag2" src="yellow.png" align="center" draggable="true" ondragstart="drag(event)"&gt;&lt;/td&gt; &lt;/tr&gt; Can anyone give me an hint? thanks.
has answer: http://stackoverflow.com/a/28874180
upvote count: 2
accepted answer: http://stackoverflow.com/a/28874180
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46010720
tagged with: javascript
tagged with: image

http://stackoverflow.com/q/28798568
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45871480
has comment: http://stackoverflow.com/comment/45880393
has answer: http://stackoverflow.com/a/28799963
has answer: http://stackoverflow.com/a/28840535
answer count: 3
has comment: http://stackoverflow.com/comment/45871568
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45871588
has comment: http://stackoverflow.com/comment/45886027
has body: I'm trying to implement a scrollbar plugin on a div on my website but I'm facing a few issues with it. first of all it was supposed to be working like this: jQuery(document).ready(function ($) { "use strict"; $('.chat-messages').perfectScrollbar({suppressScrollX: true}); }); But I could only make it work like this: $(window).load(function() { "use strict"; $('.chat-messages').perfectScrollbar({suppressScrollX: true}); }); But with window.load the script doesn't seems to be working all the time, or at least the scroll bar doesn't always appear. I'm not very familiar with js or jquery but I inserted the src file perfect-scrollbar.js in a folder and I'm calling it normally like this: &lt;script src="http://domain.com/javascript/perfect-scrollbar.js"&gt;&lt;/script&gt; on the header and puting the code that I described above with the window.load right after it between &lt;script&gt;&lt;/script&gt;. I'm assuming that this is a conflict with another document ready so I searched online for solutions and other ways to load it and I found the no conflict thingy and tried to implement like this: $.noConflict(); jQuery( document ).ready(function( $ ) { "use strict"; $('.chat-messages').perfectScrollbar({suppressScrollX: true}); }); }); but still no results, the only thing that this does is to stop all jquery of the website from working. Can anyone help me with this? thanks in advance
has comment: http://stackoverflow.com/comment/45871661
accepted answer: http://stackoverflow.com/a/28840535
type: Question
tagged with: perfect-scrollbar
has title: $(window).load(function() not always working
has comment: http://stackoverflow.com/comment/45902256
score: 0
possible better answer: http://stackoverflow.com/a/28800384
has comment: http://stackoverflow.com/comment/45902070
has comment: http://stackoverflow.com/comment/45871494
linked to: http://stackoverflow.com/q/20487472
has answer: http://stackoverflow.com/a/28800384

http://stackoverflow.com/q/28884512
type: Question
tagged with: object
tagged with: function
tagged with: javascript
has comment: http://stackoverflow.com/comment/46030239
score: 0
has comment: http://stackoverflow.com/comment/46030256
answer count: 1
has comment: http://stackoverflow.com/comment/46033166
tagged with: hash
tagged with: requirejs
type: AnsweredQuestion
has body: This question is more about how javascript objects work in general than Require.js specifically. Let's say I have a function called require: var require = function(){/*cool stuff*/}; require is not a javascript object. It does not have a key named "config". Therefore the notion of require.config does not make sense to me. And yet in Require.js, require.config is in fact a function which works. How is this possible?
has comment: http://stackoverflow.com/comment/46030292
has title: In Require.js, if require() is a function, how does require.config() exist?
has answer: http://stackoverflow.com/a/28884693
accepted answer: http://stackoverflow.com/a/28884693

http://stackoverflow.com/q/28751098
has title: Scroll to anchors
has answer: http://stackoverflow.com/a/28751340
type: Question
has body: I'm trying to code a menu for my website that has the possibility to scroll to anchors on the same page and anchors on different pages. The first one is working. The code is: $(function() { $('a[href*=#]:not([href=#])').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { $('html,body').animate({ scrollTop: target.offset().top }, 1000); return false; } } }); }); The menu is the same on every page, I can't edit his code on each page. So the HTML code basically is: Contato Parceiros And I'm using javascript to detect if the user is on the homepage, and if he is, it changes the href behaviour, because it's only on the homepage that the anchors are on the same page of the menu. Look: var url = "http://www.mcsoftware.com.br/sitemc/"; $(function(){ if (location.href==url){ $('#menu #mylink').attr("href","#allcontentcontact"); $('#menu #mylink2').attr("href","#bluecontent"); } }); Now, the problem is the second part of what I've said on the beginning of the post: Scroll to anchors on different pages. So, what script should I use to do the trick and doesn't affect everything that I've already done? Is it possible? (And the code need to hide the "#nameoftheanchor" from the URL, like the first code already do) Thanks!
has answer: http://stackoverflow.com/a/28757749
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
tagged with: anchor

http://stackoverflow.com/comment/45934690
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28830208
has text: Like @blint suggested... you don't have anywhere in your web.xml (or your controller) that handles "/Jobkreisel"

http://stackoverflow.com/a/36589183
answers question: http://stackoverflow.com/q/28790744
upvote count: 0
has comment: http://stackoverflow.com/comment/84593950
type: Answer
score: -5
has body: Here's how you could implement your get orders function function get(name) { return new Promise(function(resolve, reject) { db.find("orders", {customer: name}, function(err, data) { if (err) reject(err); else resolve(data); }); }); } You could call this function like customer.get("John").then(data =&gt; { // Process data here... }).catch(err =&gt; { // Process error here... });
downvote count: 5

http://stackoverflow.com/comment/45808645
score: 5
type: AnswerComment
type: Comment
has text: Also `list.push(new listItem())` could be used.
comment on: http://stackoverflow.com/a/28764860

http://stackoverflow.com/a/52662057
type: Answer
has body: $(document).off('click','.person').on('click','.person',function(){ console.log('hello world'); $(document).ready(function(){ $('.person').click(function(){ alert('helloooo...') }); }); click me });
answers question: http://stackoverflow.com/q/28794467
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/a/28798604
upvote count: 0
has comment: http://stackoverflow.com/comment/45871807
has comment: http://stackoverflow.com/comment/45871651
has body: You could try this var counter = 0; for (prop in foo.prototype) { console.dir(prop); counter++; } console.log('total prototypes in foo: '+counter); UPDATE I think you want to search for instances of foo? f instanceof foo Assuming var foo = function(config) { this.x = config.x; } var config = new Object(); config.x = "1"; var f = new foo(config); then f instanceof foo true So then if you want to find all instances of foo in the global scope... var counter = 0; //set the counter to zero for (name in window) { //for property in global scope iteration if (window[name] instanceof foo) { // if property is an instance of foo then count it counter++; } } console.log('total instances of foo '+counter); //total count I just tried this and swapped foo out for Object and made some new object that added to the count. I had to revise it a little. Hopefully this now makes sense.
type: Answer
has comment: http://stackoverflow.com/comment/45872150
has comment: http://stackoverflow.com/comment/45872644
downvote count: 1
score: -1
answers question: http://stackoverflow.com/q/28798465

http://stackoverflow.com/comment/45817241
type: Comment
type: QuestionComment
has text: *"So the javascript engine simply doesn't care what's inside the function body during definiton? "* Pretty much (except is still has to be syntactically valid). Here is a simpler example: `function foo() { alert(i); }`. It's perfectly OK to define the function, it doesn't throw an error. Only when you **call** the function, it will try to read `i` at which point it throws a reference error.
comment on: http://stackoverflow.com/q/28769266
score: 0

http://stackoverflow.com/comment/46040798
type: QuestionComment
comment on: http://stackoverflow.com/q/28889823
type: Comment
score: 2
has text: `for k, f of Child::` to loop, then you can `Child::[k] = after Parent::myCallback, f`, where `after` is a higher-order function that decorates another function. But again, it is manual, at least if you want to use Coffee classes

http://stackoverflow.com/comment/45957456
score: 0
comment on: http://stackoverflow.com/a/28844241
has text: This won't work if there is a space in the username. In that case I think you would want something that finds the AM or PM and then goes from there until the end. `str.replace(/.*?([AP]M) (.*):/, "$2");`
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/46087679
comment on: http://stackoverflow.com/a/28910233
score: 0
type: Comment
has text: Thanks for responding, I have tried this previously, it almost works but unfortunately it shoves the current row down too (see image). I'm not 100% sure that there is any way using css alone to achieve what I want with what I have. I'm not opposed to changing everything / starting over to achieve this. I'm sure I can add in the fancy hover effects after getting the click expander to work. http://i.gyazo.com/17ec554aec7062a2ddda7bfc0a02a7c2.png
type: AnswerComment

http://stackoverflow.com/q/28864879
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28864962
has answer: http://stackoverflow.com/a/28865027
has title: Reset Javascript Timer for Image Slider
type: Question
score: 0
answer count: 2
tagged with: javascript
tagged with: timer
tagged with: slider
has body: I am creating an image slider and using a JavaScript timer to advance to the next picture. When the user clicks on the forward or back button (see picture below) the time the slide is displayed decreases greatly. I need help making the buttons advance the slide and reset the timer and the same time. I am attaching my JavaScript, HTML, and CSS to cover my code thoroughly. My JavaScript: var imageShown = 1; var total = 7; function autoplay() { var image = document.getElementById('picture'); imageShown = imageShown + 1; if(imageShown &gt; total){imageShown = 1;} if(imageShown &lt; 1){imageShown = total;} picture.src = "Images/img"+ imageShown +".jpg"; console.log("Pic Changed"); } window.setInterval(autoplay, 5000); function pic(x) { var image = document.getElementById('picture'); imageShown = imageShown + x; if(imageShown &gt; total){imageShown = 1;} if(imageShown &lt; 1){imageShown = total;} picture.src = "Images/img"+ imageShown +".jpg"; console.log("Button clicked"); window.clearInterval(autoplay); window.setInterval(autoplay, 5000); } My HTML: &lt;img src="Images/img1.jpg" id="picture" &gt; &lt;div class="left_div"&gt;&lt;img onClick="pic(-1)" class="left_click" src="Images/left.png"&gt;&lt;/div&gt; &lt;div class="right_div"&gt;&lt;img onClick="pic(+1)" class="right_click" src="Images/right.png"&gt;&lt;/div&gt; &lt;/div&gt; My CSS: margin:0px; } #imageslider { height:700px; width:1000px; margin: 50px auto; position:absolute; border-radius:4px; overflow:hidden; padding-right: 5000px; padding-top: 1000px; } #picture { height:750px; width:1000px; position:relative; padding-top: 50px } .left_div { height: 750px; width: 150px; position: absolute; top: 250px; left: 0px; } .right_div { height: 750px; width: 150px; position: absolute; top: 250px; right: 0px; } .left_click { height:50px; width:50px; position:absolute; top:40%; left:20px; opacity:0; transition: all .2s ease-in-out 0s; } .right_click { height:50px; width:50px; position:absolute; top:40%; right:20px; opacity:…

titanium
type: Tag
tags question: http://stackoverflow.com/q/28844883
tag name: titanium
tags question: http://stackoverflow.com/q/28839439
tags question: http://stackoverflow.com/q/28761524
tags question: http://stackoverflow.com/q/28751384

http://stackoverflow.com/comment/45874846
type: AnswerComment
type: Comment
has text: @JamenMarz: I made the first slash optional to meet the "/test/example/" to "test/example" requirement.
comment on: http://stackoverflow.com/a/28799725
score: 0

http://stackoverflow.com/comment/46336227
score: 0
type: Comment
has text: The Q+A in this link doesn't take in the public key (as I have it, DER), and doesn't provide it in the format I need it to be (PEM), but thankyou no less. I'll ask another more specific question on SO. Cheers
comment on: http://stackoverflow.com/a/28928340
type: AnswerComment

http://stackoverflow.com/q/28862586
tagged with: ruby
has comment: http://stackoverflow.com/comment/46017569
has comment: http://stackoverflow.com/comment/45990562
type: AnsweredQuestion
tagged with: popup
type: Question
has body: Can anyone tell me how to handle the pop-up in Watir? I have tried all the ways that have been mentioned in the following site: http://watirwebdriver.com/javascript-dialogs/ I have also gone through the other questions that have been mentioned on StackOverflow but they are not working either. it's a pop-up with the title "Message from webpage" I proceeded in the following way: I manually process through the command prompt, when I hit the button then the 'Message from Webpage' pops-up and I am unable to process any commands through the command prompt. See the below image:
has comment: http://stackoverflow.com/comment/45992119
tagged with: javascript
tagged with: watir
accepted answer: http://stackoverflow.com/a/28882138
has comment: http://stackoverflow.com/comment/45992461
has comment: http://stackoverflow.com/comment/46017495
score: 0
has title: How to Handle 'Message From Webpage' pop-up in Watir
upvote count: 1
answer count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/28882138
favorite count: 0

arrays
tags question: http://stackoverflow.com/q/28819114
tags question: http://stackoverflow.com/q/28757956
tags question: http://stackoverflow.com/q/28798882
tags question: http://stackoverflow.com/q/28841973
tags question: http://stackoverflow.com/q/28790497
tags question: http://stackoverflow.com/q/28810465
tags question: http://stackoverflow.com/q/28816876
tags question: http://stackoverflow.com/q/28832585
tags question: http://stackoverflow.com/q/28852240
tags question: http://stackoverflow.com/q/28892727
tags question: http://stackoverflow.com/q/28761760
type: Tag
tags question: http://stackoverflow.com/q/28775157
tags question: http://stackoverflow.com/q/28826035
tags question: http://stackoverflow.com/q/28863091
tags question: http://stackoverflow.com/q/28800442
tags question: http://stackoverflow.com/q/28905601
tags question: http://stackoverflow.com/q/28755820
tags question: http://stackoverflow.com/q/28825237
tags question: http://stackoverflow.com/q/28820656
tags question: http://stackoverflow.com/q/28878922
tags question: http://stackoverflow.com/q/28775447
tags question: http://stackoverflow.com/q/28798100
tags question: http://stackoverflow.com/q/28801414
tags question: http://stackoverflow.com/q/28845855
tags question: http://stackoverflow.com/q/28866475
tags question: http://stackoverflow.com/q/28756480
tags question: http://stackoverflow.com/q/28878031
tags question: http://stackoverflow.com/q/28874173
tags question: http://stackoverflow.com/q/28860345
tags question: http://stackoverflow.com/q/28801963
tags question: http://stackoverflow.com/q/28811911
tags question: http://stackoverflow.com/q/28771218
tags question: http://stackoverflow.com/q/28753129
tags question: http://stackoverflow.com/q/28820715
tags question: http://stackoverflow.com/q/28862618
tags question: http://stackoverflow.com/q/28888617
tags question: http://stackoverflow.com/q/28857317
tags question: http://stackoverflow.com/q/28790044
tags question: http://stackoverflow.com/q/28899650
tags question: http://stackoverflow.com/q/28867765
tags question: http://stackoverflow.com/q/28754845
tags question: http://stackoverflow.com/q/28822941
tags question: http://stackoverflow.com/q/28761277
tags question: http://stackoverflow.com/q/28789689
tags question: http://stackoverflow.com/q/28754850
tags question: http://stackoverflow.com/q/28769117
tags question: http://stackoverflow.com/q/28866683
tags question: http://stackoverflow.com/q/28816434
tags question: http://stackoverflow.com/q/28815013
tags question: http://stackoverflow.com/q/28792675
tags question: http://stackoverflow.com/q/28802024
tags question: http://stackoverflow.com/q/28866283
tags question: http://stackoverflow.com/q/28841603
tags question: http://stackoverflow.com/q/28802745
tags question: http://stackoverflow.com/q/28838322
tags question: http://stackoverflow.com/q/28842447
tags question: http://stackoverflow.com/q/28784720
tags question: http://stackoverflow.com/q/28882625
tags question: http://stackoverflow.com/q/28791225
tags question: http://stackoverflow.com/q/28901410
tags question: http://stackoverflow.com/q/28756176
tags question: http://stackoverflow.com/q/28797869
tags question: http://stackoverflow.com/q/28879751
tags question: http://stackoverflow.com/q/28758127
tags question: http://stackoverflow.com/q/28777956
tags question: http://stackoverflow.com/q/28811889
tags question: http://stackoverflow.com/q/28750786
tags question: http://stackoverflow.com/q/28861194
tags question: http://stackoverflow.com/q/28857777
tags question: http://stackoverflow.com/q/28800094
tags question: http://stackoverflow.com/q/28852726
tags question: http://stackoverflow.com/q/28877966
tags question: http://stackoverflow.com/q/28785033
tags question: http://stackoverflow.com/q/28821909
tags question: http://stackoverflow.com/q/28827107
tags question: http://stackoverflow.com/q/28832130
tags question: http://stackoverflow.com/q/28797934
tags question: http://stackoverflow.com/q/28811812
tags question: http://stackoverflow.com/q/28833492

http://stackoverflow.com/q/28895679
score: 1
has comment: http://stackoverflow.com/comment/46051415
upvote count: 1
has answer: http://stackoverflow.com/a/28896235
answer count: 1
has body: I have a dynamically generated form with some radio buttons.For each radio button there will be a onClick/onChange Function. The problem is that whenever radio button is clicked ,the onClick of the the first form radio button is called. &lt;form name="a" id="a"&gt; &lt;input type="radio" name="radioa" onclick="func(1);"/&gt; &lt;input type="radio" name="radioa" onclick="func(2);"/&gt; &lt;/form&gt; . . &lt;form name="f" id="f"&gt; &lt;input type="radio" name="radiof" onclick="func(3);"/&gt; &lt;input type="radio" name="radiof" onclick="func(4);"/&gt; &lt;/form&gt; &lt;script&gt; function func(val){ alert(val); } &lt;/script&gt; I tried with onchange function also its not working. Always the first form's radio button function is called and alert(1) is shown everytime. Any help is appreciated. Thanks in advance.
tagged with: forms
has title: Javascript onClick not working on Multiple Forms
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28752374
accepted answer: http://stackoverflow.com/a/28863825
tagged with: zurb-foundation
answer count: 1
has title: Form To Wizard and Zurb Foundation Abide Validation
upvote count: 1
has body: I am using Form To Wizard to create a multi page form (each fieldset is a separate page). I'm also using Foundation Abide Validation to validate my forms, however I am having trouble getting the two to work together. The formToWizard has a "validateBeforeNext" function that I should be able to use to trigger Abide Validation, but how do I get Abide to only validate the current fieldset and not let the user progress until the current page is correctly filled out?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28863825
score: 1
tagged with: forms
type: Question
tagged with: validation
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/45822837
has text: @Veronica, I updated the answer with some code that might work. Try it out and let me know if it works. Don't forget to properly bindParam after you've got it working!
type: AnswerComment
comment on: http://stackoverflow.com/a/28770518
type: Comment
score: 0

http://stackoverflow.com/q/28848723
tagged with: jquery
has answer: http://stackoverflow.com/a/29118542
score: 0
answer count: 1
has body: Is there a way to chain animations together in velocity.js and then reverse back through them in sequence. I know you can reverse the last chained velocity animation but how do you step through the previous calls. For example: // Animate an SVG element with a mix of standard CSS properties and SVG-specific properties. $("#rect") .delay(500) .velocity({ x: "+=200", y: "25%" }) .velocity({ fillGreen: 255, strokeWidth: 2 }) .velocity({ height: 50, width: 50 }) .velocity({ rotateZ: 90, scaleX: 0.5 }) .velocity("reverse", { delay: 250 }); This will only reverse the last step, the rotation. How can you reverse through the others in sequence?
has title: How to reverse steps in Velocity.js
tagged with: velocity.js
type: UnansweredQuestion
tagged with: animation
tagged with: css
type: Question
tagged with: javascript

http://stackoverflow.com/q/28853521
upvote count: 1
type: Question
has title: check all upper checkboxes(parent and chileds) in tree when i check any child
tagged with: javascript
downvote count: 0
tagged with: jquery
favorite count: 0
has body: Hye all, i have a tree of checkboxes with parent child relationship. i just need help that when i check any node of tree, should checked all upper nodes for example: A B C D E are tree nodes. B & C are child of A, E is child of D so, when i select D or E it should select A B C D here is my code. Checkboxes Checkboxes A B C D E
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
answer count: 0
score: 1

http://stackoverflow.com/q/28859159
has title: JSP/Struts2: how to access object bean in selected table row
has comment: http://stackoverflow.com/comment/46260447
has comment: http://stackoverflow.com/comment/46196025
has answer: http://stackoverflow.com/a/29255248
has answer: http://stackoverflow.com/a/28860328
has comment: http://stackoverflow.com/comment/46195996
type: Question
answer count: 2
linked to: http://stackoverflow.com/q/17226664
linked to: http://stackoverflow.com/q/5440809
tagged with: jsp
tagged with: javascript
tagged with: struts2
score: 0
linked to: http://stackoverflow.com/q/25758348
has body: In my Struts2 application, I have a table that is dynamically populated with data, coming from the database (via Eclipselink JPA). Below that table there's a button that became enabled as soon as a row is selected in the table (jQuery). Now, when that button is clicked, I need to know which row is currently selected, so I can access the corresponding object bean, since I need to pass the bean ID (target_id) into the next page (createexperiment2 action). So, in short, the question is: How can I access the Struts2 object bean that is contained in the selected (clicked) table row? 1. Screenshots: Before row selection -> After row selection 2. JSP code: &lt;table id="targets" class="ink-table grey tableSection"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th colspan="5" class="align-left"&gt;Select your target:&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;s:if test="targets.size &gt; 0"&gt; &lt;s:iterator value="targets"&gt; &lt;tr id="row_&lt;s:property value="i"/&gt;"&gt; &lt;td class="all-100"&gt;&lt;a href="&lt;s:url action="showtarget"&gt;&lt;s:param name="id"&gt;&lt;s:property value="target_id"/&gt;&lt;/s:param&gt;&lt;/s:url&gt;"&gt;&lt;s:property value="name"/&gt;&lt;/a&gt;&lt;/td&gt; &lt;td class="all-15"&gt;&lt;a href="&lt;s:url action="edittarget"&gt;&lt;s:param name="id"&gt;&lt;s:property value="target_id"/&gt;&lt;/s:param&gt;&lt;/s:url&gt;"&gt;edit&lt;/a&gt;&lt;/td&gt; &lt;td class="all-5"&gt;|&lt;/td&gt; &lt;td class="all-15"&gt;&lt;a href="&lt;s:url action="deletetarget"&gt;&lt;s:param name="id"&gt;&lt;s:property value="target_id"/&gt;&lt;/s:param&gt;&lt;/s:url&gt;"&gt;delete&lt;/a&gt;&lt;/td&gt; &lt;td class="all-5"&gt;&lt;a href="help.jsp"&gt;?&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/s:iterator&gt; &lt;/s:if&gt; &lt;/tbody&gt; &lt;/table&gt; [...] &lt;a href="createexperiment2" class="ink-button double-vertical-space all-25 buttonSection" id="next" disabled&gt;Next &amp;gt;&lt;/a&gt; 3. jQuery code: $(document).ready(function(){ $('.tableSection tbody tr').…
linked to: http://stackoverflow.com/q/28275323
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46195573

http://stackoverflow.com/comment/45965954
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28848319
score: 0
has text: Do you really have an element with ID `{{ target_input }}-text`? That seems rather unusual. I assume `{{ target_input }}` is part of some template system... which might not get resolved?

http://stackoverflow.com/comment/45792262
comment on: http://stackoverflow.com/a/28754507
score: 0
type: AnswerComment
has text: Are you saying that I cannot attach a click event without using the marker directive?
type: Comment

http://stackoverflow.com/comment/58753216
has text: `TypeError: 'append' called on an object that does not implement interface FormData.`. well - ..
score: 12
type: AnswerComment
comment on: http://stackoverflow.com/a/28872952
type: Comment

http://stackoverflow.com/a/28795925
has body: You are not using Class Selector (".class") properly. Use el.closest('div.fsc-comp-flipcard') instead of el.closest('div[class|="fsc-comp-flipcard"]')
downvote count: 0
score: 2
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/28795888

http://stackoverflow.com/comment/46044239
comment on: http://stackoverflow.com/q/28891618
has text: Welcome to StackOverflow! We will expect you to show us what you've tried already so that we can suggest improvements; we will not provide a complete solution for you without any work on your own. See http://stackoverflow.com/help/how-to-ask
type: QuestionComment
type: Comment
score: 2

http://stackoverflow.com/q/28760981
tagged with: ajax
has answer: http://stackoverflow.com/a/28761183
score: 0
tagged with: asynchronous
accepted answer: http://stackoverflow.com/a/28761220
type: AnsweredQuestion
tagged with: oop
has body: I'm building a javascript object for handling my ajax functionality (error handling, dealing with response). My problem is that it is only working when I set async: false inside the ajax request. In every other case the result is undefined. Some others advised here, that using async: false is a bad thing. So my question is: can I rewrite my code to avoid using async: false (without adding lots of lines just for that). {extends file="full.tpl"} &lt;!-- SMARTY STUFF --&gt; {block name=content} &lt;!-- SMARTY STUFF --&gt; &lt;script type="text/javascript"&gt; function contentManager(options){ this.O = options; // var for options this.Q; // var for the ajaxresponse this.R; // var for the ajaxresponse object JSON.parse(response); this.SetupPost = function(){ //[#3] Method which loads the Ajax method this.Q = this.AjaxPost(); //[#4] Pass the AjaxPost() return response to this.Q this.Q.done(function(response){ this.R = JSON.parse(response); //[#5] Convert the result to Object }); return this.R; //[#6] Return the result object }, this.AjaxPost = function(){ return $.ajax({ type: "POST", url: this.O.output_url, dataType: this.O.datatype, async: false, context: this }); }, } var details = { //Object for parameters - will use inside the contentManager object output_url: '{$base}gallery/ajaxadd/', //url uf the ajax call data: $(document.getElementById('gallery_name')).serialize(), //data what we want to post (i dont use it now) dataType: 'json', //datatype output_area: 'apple', //where to put the results if there are any errorMsg: { //where to put the error messages if there are any Visible: true, //visibility Area: 'top' //area to put error messages } }; // details WILL GO INSIDE contentManager -&gt;&gt; see below $( document ).ready(function() { //evrything has been loaded var cm = new contentManager(details); //[#1] create the object(contentManager) AS (cm) when the page loads var result = cm.SetupPost(); //[#2] call the SetupPost method (will return an object, containing th…
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28761220
tagged with: javascript
tagged with: jquery
has title: Ajax async inside a javascript object
possible better answer: http://stackoverflow.com/a/28761183

http://stackoverflow.com/comment/45958349
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28844703
has text: `setTimeout(rotate,3500);`
score: 0

http://stackoverflow.com/comment/45824196
score: 1
has text: What does your answer look like? Is it HTML or JSON? Do you have a AJAX Error function setup as well? And could you please define what you see as an 'error': is that an AJAX error (e.g. a timeout or PHP error) or your PHP returning some property defining a semantic error? Have you looked at your Javascript console for errors?
comment on: http://stackoverflow.com/q/28772868
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/46065026
type: AnswerComment
comment on: http://stackoverflow.com/a/28895424
has text: you need to load chosen after jquery.turbolinks
score: 0
type: Comment

http://stackoverflow.com/comment/45838460
comment on: http://stackoverflow.com/a/28780070
score: 0
type: AnswerComment
has text: I need to disable the grid after initialization. But just once and not always after every server request.
type: Comment

http://stackoverflow.com/comment/45812103
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28765856
has text: A working plunk would be more helpful
score: 0

http://stackoverflow.com/a/28819353
score: 2
downvote count: 0
upvote count: 2
answers question: http://stackoverflow.com/q/28770778
type: Answer
has body: I use the bootstrap $modal directive with code like this... clickFunction: function (event, row) { event.stopPropagation(); // prevents the current row from appearing as selected var modalInstance = $modal.open({ templateUrl: 'views/modalcontent.tpl.html', controller: 'ModalMessageController', size: 'lg', resolve: { message: function () { return row.entity.serial_number; } } } ); Then I just refer to {{message}} in the template. Of course you could pass in any other piece of data too.

http://stackoverflow.com/q/28876092
has comment: http://stackoverflow.com/comment/46014492
has title: Get value from attribute with JavaScript
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/5371047
tagged with: attributes
has comment: http://stackoverflow.com/comment/46014288
has comment: http://stackoverflow.com/comment/46014298
answer count: 0
type: Question
linked to: http://stackoverflow.com/q/5371047
tagged with: javascript
score: 0
has body: I have the following code: echo "&lt;div class='hp_container'&gt;&lt;div id='hp' val=".$warrior_row[8]."&gt;&lt;/div&gt;&lt;/div&gt;"; In this case, val has the value 8. I want to access this value with JavaScript. I have tried the following method, but it keeps saying that txt is null. &lt;script type='text/javascript'&gt; var txt = document.getElementById("hp"); var f = txt.getAttribute('val'); alert(f); &lt;/script&gt; How can I resolve this? Edit I solved the problem by placing the code inside window.onload: window.onload = function() { var txt = document.getElementById("hp"); var f = txt.getAttribute('val'); alert(f); };

http://stackoverflow.com/comment/45893121
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28810449
has text: Maybe it is that some event listeners applied by some_script.js are applied before the table is loaded? This would explain some... Try to append the script on success of the load() function (second parameter). If this works that means you need to load script in good order, or call a function from script when the DOM changes

http://stackoverflow.com/q/28881824
answer count: 1
downvote count: 0
tagged with: jquery
has title: How to trigger Angular to recompile a template from JQuery?
favorite count: 0
has answer: http://stackoverflow.com/a/28881958
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46028920
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/46028857
type: Question
has body: I understand that the solution will be non-ideal -- I'm working with legacy code and have many constraints. On a page in my app, the user choose between one of several forms they want to fill out. When selected, we use JQuery to load the selected form into the DOM. In this newly loaded form, we need to use an angular directive, but angular doesn't know that anything has changed (since JQuery handled the state change), so it doesn't recompile the markup that contains our directive. How can I let angular know that it needs to make another pass through the DOM?
tagged with: javascript
has comment: http://stackoverflow.com/comment/46024984

http://stackoverflow.com/comment/110841108
has text: @BenCarp I am posting the link to my code: https://codesandbox.io/s/busy-hill-ydgx7?file=/src/App.js Here you can see that I am trying to use onKeyDown to change the focus but it doesn't change and shows the error. Codesandbox somehow doesn't show, however button doesn't change focus
comment on: http://stackoverflow.com/a/54159564
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28858047
type: AcceptedAnswer
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28857777
accepted answer of: http://stackoverflow.com/q/28857777
has comment: http://stackoverflow.com/comment/45982575
has body: You need to pass a reference of array instead of value in ng-model check this working plunker

http://stackoverflow.com/q/28769030
has title: Javascript/JSON output doesn't show
has comment: http://stackoverflow.com/comment/45816813
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45816855
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/28769197
type: Question
answer count: 2
has body: I am doing an exercise related with JSON and JavaScript. However, I just could not figure out that what's wrong with my syntax. It should show the links on the ordered list part in HTML, but I got only H2 tag. Here is the syntax: Javascript and jason Links
tagged with: javascript
has comment: http://stackoverflow.com/comment/45816925
has answer: http://stackoverflow.com/a/28769285
score: 0

http://stackoverflow.com/comment/45834919
type: QuestionComment
comment on: http://stackoverflow.com/q/28778546
score: 0
type: Comment

http://stackoverflow.com/a/29071807
has comment: http://stackoverflow.com/comment/47112494
has comment: http://stackoverflow.com/comment/46411967
accepted answer of: http://stackoverflow.com/q/28822049
upvote count: 1
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28822049
has body: Actually isotope has a combo filter example http://isotope.metafizzy.co/filtering.html#combination-filters And this is how you would add items: http://isotope.metafizzy.co/methods.html#additems
type: Answer
score: 1

http://stackoverflow.com/q/28773200
tagged with: javascript
has answer: http://stackoverflow.com/a/28773266
downvote count: 0
tagged with: variables
favorite count: 0
tagged with: css
possible better answer: http://stackoverflow.com/a/28773221
answer count: 4
accepted answer: http://stackoverflow.com/a/28773266
score: 2
has answer: http://stackoverflow.com/a/28773221
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28773456
upvote count: 2
has answer: http://stackoverflow.com/a/28773476
has body: I am trying to set the div 'changebox' with the color of the rgb which is the result of the three randoms. The rgbs are changing, (i can tell by the document.writes), but the div just stays white no matter what the rgb is. Please help get the box to change to the correct color of the rgb.
has title: changing css background color with javascript variables
type: Question

http://stackoverflow.com/comment/45795169
has text: The polar coordi\nates given by sin and cos assume the center is at (0,0) so you need to do 2 things first move the center of the rotation to the center of rotation (i asume this to be the "earth") get the polar coordinates then translate the sun by half its radius so its center lies exactly at the polare point, remember that the css coordinates ar given by top-left corner. Finally examine css animations and css-transforms which can do same thing with much better efficiency
comment on: http://stackoverflow.com/q/28755841
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46059711
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28900125
has text: @EhsanSajjad - I Edited the post with the JSON stringify reponse.

http://stackoverflow.com/q/28767069
tagged with: css
score: 1
tagged with: internet-explorer-10
tagged with: scriptcam
type: Question
tagged with: javascript
has body: I'm using scriptcam and I have a problem with screenshot size only in IE10. I init my webcam div with: $("#webcam").scriptcam({ path: 'js/', width: 640, height: 480, cornerRadius: 0 }); When I take a screenshot with var image = new Image(); image.src = "data:image/png;base64," + $.scriptcam.getFrameAsBase64(); image.onload = function () { ctx.drawImage(image, 0, 0); }; my canvas has the photo resized at original value "320 pixels wide and 240 pixels high" and the other part is black. How can I fix this problem?? Thanks for your help! [UPDATE] The problem is in the type of webcam: changing the webcam whit a HD cam, the size of the screenshot is ok. Is this a bug?
downvote count: 0
favorite count: 0
answer count: 0
type: UnansweredQuestion
has title: scriptcam - scriptcam screenshot size not work
upvote count: 1

http://stackoverflow.com/q/28811601
has body: I have the following line of code $product_list="$product_list $id - $product_name - $date_added &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href='inventory_edit.php?pid=$id'&gt;edit&lt;/a&gt; &amp;bull; &lt;a href='inventory_list.php?deleteid=$id'&gt;delete&lt;/a&gt;&lt;br/&gt;" and if(isset($_GET['deleteid'])) { echo 'Do you really want to delete this item with ID of '.$_GET['deleteid']. '? &lt;a href = "inventory_list.php?yesdelete='.$_GET['deleteid']. '"&gt; Yes&lt;/a&gt; | &lt;a href="inventory_list.php"&gt; No&lt;/a&gt;'; exit(); } How can I make it appear as a dialog box and do you think using a dialog box instead of going to the confirmation page will be a good option? UPDATE I tried the following but when ever deleteid gets set it creates another new delete link how can I make the existing delete link show the confirm box? if(isset($_GET['deleteid'])) { echo '&lt;a href="inventory_list.php?yesdelete='.$_GET['deleteid']. '" onClick="return confirm(\'Do you want to delete?\');"&gt;Delete&lt;/a&gt;'; } UPDATED try $product_list="$product_list $id - $product_name - $date_added &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href='inventory_edit.php?pid=$id'&gt;edit&lt;/a&gt; &amp;bull; &lt;a href='inventory_list.php?deleteid=$_GET[deleteid]' onClick='return confirm(\'Do you want to delete?\');'&gt;Delete&lt;/a&gt;&lt;br/&gt;" Doesn't seem to be working.
tagged with: php
has title: Confirm Deletion Dialog Box
tagged with: box
has comment: http://stackoverflow.com/comment/45895437
type: UnansweredQuestion
type: Question
tagged with: dialog
has answer: http://stackoverflow.com/a/28812057
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45895185
tagged with: javascript

http://stackoverflow.com/a/28815234
type: Answer
has body: It seems to me you can use the native Array.prototype.sort() for primary/secondary grouping since the objects in the array are the same object used multiple times. The approach I've come up with does not modify the objects, but does use a temporary array and create a new, grouped array based on both the primary and secondary "sort" items. I'm not sure how true sorting can be accomplished when the object is opaque since you have to have some criteria by which you can sort by. //object setup //inner objects, note that "name" is a convention only used to identify sort order (secondary grouping) var innerObjA = { "name": "a" }; var innerObjB = { "name": "b" }; var innerObj1 = { "name": "1" }; var innerObj2 = { "name": "2" }; var innerObj3 = { "name": "3" }; //parenting objects (primary grouping) var obj1 = { "first": innerObjA, "second": innerObj1 }; var obj2 = { "first": innerObjA, "second": innerObj2 }; var obj3 = { "first": innerObjA, "second": innerObj1 }; var obj3 = { "first": innerObjB, "second": innerObj1 }; var obj4 = { "first": innerObjB, "second": innerObj1 }; var obj5 = { "first": innerObjB, "second": innerObj2 }; var obj6 = { "first": innerObjB, "second": innerObj3 }; //out of order array var original = [obj6, obj2, obj4, obj1, obj5, obj3]; //helper to show the order of these objects function showOrder(myArray){ myArray.forEach(function(index) { console.log(index.first.name, index.second.name); }); console.log('-----------'); } //helper to handle the native sort function doNativeSort(myArray, sortBy) { myArray.sort(function(a, b) { return a[sortBy]===b[sortBy]?0:1; }); return myArray; //returns so we can use in-line } showOrder(original); //primary sort is done by the property "first" within the objects // in our array, since the OP states that many instances of an // object are in the array more than once, the native JS sort will // work to GROUP items which is what we do here. doNativeSort(original, "first"); showOrder(original); //secondary sort is more c…
score: 0
answers question: http://stackoverflow.com/q/28775157

http://stackoverflow.com/comment/45822465
type: QuestionComment
comment on: http://stackoverflow.com/q/28771895
score: 0
type: Comment
has text: @JiFus can you post the answer, cause it's not working.

http://stackoverflow.com/comment/45836373
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28779036
score: 0
has text: @GregHornby yeah ! Previously the right side image used to show options on right clicking but those options are now gone and only shows up for the left image. Maybe some script is manipulating it

http://stackoverflow.com/comment/46008591
type: QuestionComment
comment on: http://stackoverflow.com/q/28872668
has text: @Optimus, @Jeremy Thille I use the `href` element, as I initiate some JS, based on the value of the hash upon page loan. What's more I need to be able to send direct links to people, so that these events can be triggered automatically when they load the page.
score: 0
type: Comment

http://stackoverflow.com/a/28818878
has comment: http://stackoverflow.com/comment/45914638
has comment: http://stackoverflow.com/comment/45911643
type: Answer
has body: If you're certain that a given object is no longer needed, then setting it to null is the way to go (be aware that this does not imply that any linked objects will also be garbage-collected to). Only when all references to that given object are set to null (the object becomes inaccessible from anywhere on your code), then it will be collected. Since node.js uses the V8 engine under the hood, you can get some hints on how to improve garbage collection A tour of V8: Garbage Collection. If that's not enough, you can force GC by following these instructions.
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45911760
has comment: http://stackoverflow.com/comment/45917150
upvote count: 2
has comment: http://stackoverflow.com/comment/45910946
accepted answer of: http://stackoverflow.com/q/28818611
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28818611
has comment: http://stackoverflow.com/comment/45911372

http://stackoverflow.com/comment/45790660
type: Comment
has text: But this answer is very close to the exact javascript code you need to get get it working. Just copy and paste it below jquery on your page and adjust the element selectors as needed.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28754398

http://stackoverflow.com/comment/45787612
score: 0
type: QuestionComment
type: Comment
has text: Just how old are these scripts? Are they etched in stone perhaps?
comment on: http://stackoverflow.com/q/28751948

http://stackoverflow.com/q/28811269
has comment: http://stackoverflow.com/comment/45894547
has answer: http://stackoverflow.com/a/28812083
type: Question
has body: I'm working on a JavaScript script that makes AJAX requests to another server (my own domain). The JavaScript script is added to the page using a plugin. It should retrieve data from a PHP file on my domain. I've added the following header to the PHP file: &lt;?php header("Access-Control-Allow-Origin: *"); but the AJAX request still throws an error. Changing the * to the actual domain I plan to use it on doesn't work either. I've searched stack overflow for answers, and came across the following: // Allow from any origin if (isset($_SERVER['HTTP_ORIGIN'])) { header("Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}"); header('Access-Control-Allow-Credentials: true'); header('Access-Control-Max-Age: 86400'); // cache for 1 day } // Access-Control headers are received during OPTIONS requests if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') { if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD'])) header("Access-Control-Allow-Methods: GET, POST, OPTIONS"); if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS'])) header("Access-Control-Allow-Headers: {$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']}"); exit(0); } which doesn't work, either. I thought my .htaccess file may have somehow affected things, so I deleted it temporarily, but the AJAX request still said no Access-Control-Allow-Origin header was set in the PHP file. I've found this on daniweb.com: https://www.daniweb.com/web-development/php/threads/461902/php-header-is-not-working-for-access-control-allow-origin which was unresolved. If the headers have definitely been set (in multiple ways), how come the AJAX request still throws an error, stating the headers haven't been set?
tagged with: javascript
tagged with: ajax
tagged with: cors
has comment: http://stackoverflow.com/comment/45894630
answer count: 1
downvote count: 0
favorite count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/45894768
type: UnansweredQuestion
tagged with: php
has title: PHP Access-Control-Allow-Origin header not working
score: 2
has comment: http://stackoverflow.com/comment/45894663

http://stackoverflow.com/comment/45922268
type: AnswerComment
type: Comment
has text: That is a good point. I will try that out. Thanks for the help. I will let you know.
comment on: http://stackoverflow.com/a/28825230
score: 0

http://stackoverflow.com/a/28872477
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/58223281
has comment: http://stackoverflow.com/comment/58287010
has comment: http://stackoverflow.com/comment/46008523
accepted answer of: http://stackoverflow.com/q/28872211
upvote count: 2
answers question: http://stackoverflow.com/q/28872211
type: AcceptedAnswer
type: Answer
has body: When you assign the value of SomeService.value to your scope variable, you are creating a copy of the variable which is a distinct object from the value inside SomeService. By adding the watch expression you were simply keeping the two variables (the one in the scope and the one in SomeService) synchronised. The easiest way to go about this is not to copy the value, but create a reference to the service itself. So in MainCtrl $scope.someService = SomeService; and in your html Value: {{someService.value}} this way you are actually binding to the value inside SomeService.

http://stackoverflow.com/q/28787847
tagged with: jquery
answer count: 1
has answer: http://stackoverflow.com/a/31351038
favorite count: 0
has body: declare (function ($) { $.widget('my.popup', $.ui.dialog, { 'create': function (event, ui) { // this one is NOT called console.debug('create'); }, '_create': function () { // OK console.debug('_create'); return this._super(); } }); }(jQuery)); call var div = jQuery('&lt;div&gt;').appendTo('body'); div.on('widgetcreate', function (event, ui) { // this one is NOT called console.debug('widgetcreate'); }); div.on('popupcreate', function (event, ui) { // OK console.debug('popupcreate'); }); div.popup(); I can understand why 'widgetcreate' does not work, but 'create' in options? jQuery.Widget has create (http://api.jqueryui.com/jquery.widget/#event-create) and I guess dialog should inherit it and fire it internally with proper new name. What is the problem?
type: UnansweredQuestion
upvote count: 1
tagged with: extend
tagged with: widget
score: 1
type: Question
tagged with: jquery-ui
downvote count: 0
has title: Create event handler is not called. Extending jQueryUI Dialog
tagged with: javascript

http://stackoverflow.com/comment/45946114
score: 0
type: Comment
type: QuestionComment
has text: how to concatenate the results though? @J.Wells
comment on: http://stackoverflow.com/q/28838263

http://stackoverflow.com/q/28849201
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/24309803
score: 1
tagged with: http://stackoverflow.com/tag/json
has body: The idea is that I want to use the json from a route (scala.html) then draw it with D3. Unfortunately, when the string is handed to javascript, it contains a quotes in the original JSON. @(userId: Int, advertiserId: Int, json: String) @main { } This is from Javascript console console.log([{"id":1,"campaignId":1}]; Am I missing something here?
type: Question
tagged with: playframework
upvote count: 1
tagged with: javascript
linked to: http://stackoverflow.com/q/24309803
favorite count: 0
has comment: http://stackoverflow.com/comment/45966334
has title: Play JSON variable in scala.html contains quotes when passing to JavaScript
downvote count: 0
answer count: 0

http://stackoverflow.com/comment/46443954
type: Comment
comment on: http://stackoverflow.com/q/28808146
score: 0
type: QuestionComment
has text: thanks. I didn't do that because it doesn't solve your problem!

html-table
tags question: http://stackoverflow.com/q/28893385
tags question: http://stackoverflow.com/q/28842607
tag name: html-table
tags question: http://stackoverflow.com/q/28760971
tags question: http://stackoverflow.com/q/28787791
tags question: http://stackoverflow.com/q/28887214
tags question: http://stackoverflow.com/q/28771583
type: Tag
tags question: http://stackoverflow.com/q/28774306
tags question: http://stackoverflow.com/q/28816429
tags question: http://stackoverflow.com/q/28905484
tags question: http://stackoverflow.com/q/28830052

http://stackoverflow.com/comment/45812079
has text: A module is an independent entity that can be used to construct more complex systems. Just because there is a "community term" for it doesn't mean I cannot use the English definition for it.
score: 0
comment on: http://stackoverflow.com/q/28766468
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28779111
has body: On my php website I have many various countdowns. These are only updated when the user refreshes the page. I want to change it so that the countdown is continous. I have found many javascript codes that perform this, however I'm unsure how to implement my php code into there script. Please see below scripts: My php function for timer: function countup ($online){ global $time; $difference=$online-$time; $num = $difference/86400; $days = intval($num); $num2 = ($num - $days)*24; $hours = intval($num2); $num3 = ($num2 - $hours)*60; $mins = intval($num3); $num4 = ($num3 - $mins)*60; $secs = intval($num4); if($days != 0){echo"$days days, ";} if($hours != 0){echo"$hours hours, ";} if($mins != 0){echo"$mins minutes and ";} echo"$secs seconds"; } where I show the timer I have the following.. &lt;?=countup($set[ends])?&gt; Ends = future unix timestamp. The javascript countdown I came across was from http://keith-wood.name/countdown.html but I have no understanding of java and am not sure how to put $set[ends] into it! All help would be greatly appreciated!
has answer: http://stackoverflow.com/a/28779235
type: AnsweredQuestion
has title: Turn php countdown into javascript
type: Question
score: 0
answer count: 1
tagged with: javascript
tagged with: countdown
tagged with: timer
tagged with: datetime
tagged with: php
accepted answer: http://stackoverflow.com/a/28779235

wifi
tag name: wifi
type: Tag
tags question: http://stackoverflow.com/q/28762559

contains
tags question: http://stackoverflow.com/q/28898612
tag name: contains
type: Tag

http://stackoverflow.com/comment/45821073
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28771098
has text: Can't you just add a method that after mounting, is called every 15 seconds? Just move the code that you have in the body of `setInterval` into a function, and in the `componentDidMount`, start it. And repeat. You'd want to check `isMounted()` potentially.
score: 0

http://stackoverflow.com/comment/45813573
score: 0
has text: okay thanks. Am i still able to use my own javascript for other aspects then?
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28767363

http://stackoverflow.com/comment/45896008
type: Comment
type: QuestionComment
has text: add a condition that if the button is enabled only, then push the click events
score: 0
comment on: http://stackoverflow.com/q/28811431

http://stackoverflow.com/a/28788869
answers question: http://stackoverflow.com/q/28788619
score: 0
has comment: http://stackoverflow.com/comment/45853718
has body: $q promises are resolved on the next digest... so you need to trigger a digest: $rootScope.$digest();
has comment: http://stackoverflow.com/comment/45853672
type: Answer
has comment: http://stackoverflow.com/comment/45853744
has comment: http://stackoverflow.com/comment/45853764

http://stackoverflow.com/comment/45797988
has text: In the fiddle you havent selected the jquery and I think in your project also you might have not added jquery.Check in the browser console and find out if you get any errors
comment on: http://stackoverflow.com/q/28758806
score: 2
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28769037
tagged with: http://stackoverflow.com/tag/html
answer count: 4
score: 2
type: AnsweredQuestion
upvote count: 2
possible better answer: http://stackoverflow.com/a/28769186
has answer: http://stackoverflow.com/a/28769390
type: Question
accepted answer: http://stackoverflow.com/a/28769301
has answer: http://stackoverflow.com/a/28769186
downvote count: 0
has answer: http://stackoverflow.com/a/28769292
tagged with: javascript
tagged with: jquery
has title: Add Spaces to a Textarea
favorite count: 0
has answer: http://stackoverflow.com/a/28769301
has body: I am trying to add 4 spaces to my textarea. However, it only adds 1 space. $(document).delegate('#test', 'keydown', function(e) { var keyCode = e.keyCode || e.which; if (keyCode == 9) { e.preventDefault(); var start = $(this).get(0).selectionStart; var end = $(this).get(0).selectionEnd; $(this).val($(this).val().substring(0, start) + " " + " " + " " + " " + $(this).val().substring(end)); $(this).get(0).selectionStart = $(this).get(0).selectionEnd = start + 1; } }); Edit: I've already tested &amp;nbsp;and it gets outputted as is "&nbsp;&nbsp;" does output: "&nbsp;&nbsp;" to the tetarea. How can I force it to add 4 spaces?

http://stackoverflow.com/a/28827961
downvote count: 0
has comment: http://stackoverflow.com/comment/45926573
type: Answer
upvote count: 3
has comment: http://stackoverflow.com/comment/45926287
has body: This outputs EXACTLY what you said you wanted in your Output/HTML SHOULD look like this: section document.getElementById('add').onclick = function () { var collegediv = document.getElementById('collegediv'); // Make first div var div_form_group = document.createElement('div'); div_form_group.setAttribute("class","form-group"); // Make label var label = document.createElement('label'); label.setAttribute('for','college') label.setAttribute('class','col-sm-3 control-label input-sm'); // Make inner div var div_inner = document.createElement('div'); div_inner.setAttribute('class','col-sm-5'); // Make input var input = document.createElement('input'); input.type = 'text'; input.setAttribute('name', 'college[]'); input.setAttribute('class', 'form-control input-sm'); input.setAttribute('placeholder','Name of College/University'); input.setAttribute('required','required'); // Attach elements div_inner.appendChild( input ); div_form_group.appendChild( label ); div_form_group.appendChild( div_inner ); collegediv.appendChild( div_form_group ); };
answers question: http://stackoverflow.com/q/28827332
score: 3

http://stackoverflow.com/comment/45802623
comment on: http://stackoverflow.com/q/28761242
score: 0
type: Comment
type: QuestionComment
has text: Also, how and when is the function being called?

http://stackoverflow.com/q/28850679
has comment: http://stackoverflow.com/comment/45968902
tagged with: javascript
linked to: http://stackoverflow.com/q/3781406
tagged with: jquery
favorite count: 0
duplicate of: http://stackoverflow.com/q/3781406
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45968585
has body: I've been looking at the jquery source code. It first declares a bunch of variables like this: var deletedIds = []; var slice = deletedIds.slice; var concat = deletedIds.concat; then it start declaring a comma separated list of functions and variables: var version = "1.11.2", // Define a local copy of jQuery jQuery = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' // Need init if jQuery is called (just allow error to be thrown if not included) return new jQuery.fn.init( selector, context ); }, My question is why doesn't it declare all of them as a comma separated list? Or why use the comma separated list method, why not just declare all the functions and variable like the first 3?
answer count: 0
upvote count: 2
score: 1
has title: Why are jquery variables not all declared together?
downvote count: 1
type: Question

http://stackoverflow.com/q/28882809
has comment: http://stackoverflow.com/comment/46049141
has body: The question itself may seem a bit confusing, but I'll try to explain it below. So I have multiple queries that have to be executed, all depending on the previous one. Let's say I'm executing query A, when that's done, query B has to be executed by using the data query A retrieved. After query B retrieved it's data, query C has to be executed with that specific data. But while query B is executing, a FOR-loop is doing it's job and executing query C multiple times (query B finds 3 results, so query C has to be executed 3 times during the life duration of query B). In the code below, I can try to simulate the situation with a more simplified form of my existing code (less details): first function to be executed is QueryA() with a click on a button: function QueryA() { db.transation( function(tx) { tx.executeSql('SELECT * FROM TableA', function(tx, results) { QueryB(results); }); }); } function QueryB(results) { for(var i = 0; i &lt; results.rows.length; i++) { db.transaction( function(tx) { tx.executeSql('SELECT * FROM TableB WHERE FIELDB = ?, [results.rows.item(i)], function(tx, result) { QueryC(result); }); }); } } function QueryC(result) { for(var i = 0; i &lt; result.rows.length; i++) { console.log(results.rows.item(i).description); //description being a field } } The real problem is that all these function are asynchronous .. meaning they will be executed before the data has been retrieved and resulting in errors (I have left out the errorhandlers in this example, they are present in my current code, I just wanted to explain my problem). I have no clue how the callback functions work, because I need to pull this off. Any advice is welcome! (and please show it with some code, so I can understand how the solution might work). Thank you! And just for a reminder, I'm working with Javascript and SQLite. I know Javascript can be tough sometimes to work with, especially working with functions that take quite some time and executing others that are dependant on the previ…
has answer: http://stackoverflow.com/a/28920970
has comment: http://stackoverflow.com/comment/46027109
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46027004
accepted answer: http://stackoverflow.com/a/28920970
type: Question
has comment: http://stackoverflow.com/comment/46027116
tagged with: javascript
score: 0
has title: SQLite + Javascript: execute multiple queries within each others functions
tagged with: sqlite
answer count: 1

http://stackoverflow.com/q/28880723
has title: jquery setTimeout few questions about it
has body: i have a website with tags system like kind of the system that work on stackoverflow. my questions about it is: $("#area1 ul li").hover(function(){ var width= $(this).offset(); $(".flyout").css({"top":width.top+19,"left":width.left}); $(".flyout").toggle(); setTimeout(function() { $.ajax({ url: web + "sources/queans/sql.php", type: "POST", data: { action: "taginfo", tag: $(this).text(), token: t, ajax: "1" }, success: function (output) { $(".flyout").html(output); } }); }, 2000); $(".flyout").html('&lt;center&gt;&lt;img style="margin-top:20px;" src="http://www.cloudynights.com/public/style_images/master/ajax_loading.gif" /&gt; &lt;/center&gt;'); }); Do this Jquery script is wait 2 seconds while the mouse are hover the element? if user remove the mouse hover the element do the query will still running and execute the code? if no how can i stop the code before it require from sql.php file data?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46022924
has comment: http://stackoverflow.com/comment/46022832
has answer: http://stackoverflow.com/a/28881832
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28881535
score: 0
has comment: http://stackoverflow.com/comment/46022768
has answer: http://stackoverflow.com/a/28881535
possible better answer: http://stackoverflow.com/a/28881832

http://stackoverflow.com/a/28878985
answers question: http://stackoverflow.com/q/28878031
has body: Thanks kasoban & Sphaso, as you could see I'm new at Angular, yesterday I spent many hours to figure it, THANKS! Both solved my issue Usuario: {{user.user}} Clave: {{user.pass}}
score: 0
type: Answer

http://stackoverflow.com/comment/46023318
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28879620
type: AnswerComment
has text: .on()s were first in the queue, so to say :)

http://stackoverflow.com/comment/45927725
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28828719
has text: @musefan could you provide an example code of how I can fix this?

http://stackoverflow.com/a/28854852
answers question: http://stackoverflow.com/q/28854772
type: Answer
has body: In Python 2, use the unichr() function to convert an integer to a Unicode codepoint; In Python 3, replace unichr() with chr(). Demo: &gt;&gt;&gt; from ast import literal_eval &gt;&gt;&gt; s = """eval(String.fromCharCode(102,117,110,99,116,105,111,110,32,99,104,101,99,107,40,41,123,13,10,09,118,97,114,32,97,32,61,32,39,100,52,103,39,59,13,10,09,105,102,40,100,111,99,117,109,101,110,116,46,103,101,116,69,108,101,109,101,110,116,66,121,73,100,40,39,116,120,116,39,41,46,118,97,108,117,101,61,61,97,41,123,13,10,09,09,119,105,110,100,111,119,46,108,111,99,97,116,105,111,110,46,104,114,101,102,61,97,43,34,46,112,104,112,34,59,13,10,09,125,101,108,115,101,123,13,10,09,09,97,108,101,114,116,40,34,23494,30721,38169,35823,34,41,59,13,10,09,125,13,10,125));""" &gt;&gt;&gt; codes = literal_eval(s.split('(', 2)[-1].rsplit(')', 2)[0].replace(',0', ',')) &gt;&gt;&gt; print u''.join(unichr(c) for c in codes) function check(){ var a = 'd4g'; if(document.getElementById('txt').value==a){ window.location.href=a+".php"; }else{ alert("密码错误"); } } Note that I had to replace the 09 integer literals with 9; leading zeros in Python 3 are a syntax error, in Python 2 they are interpreted as octal literals (and 09 is not a valid octal number). I used the ast.literal_eval() function to convert from a string representation to a list of integers.
score: 2
downvote count: 0
upvote count: 2

http://stackoverflow.com/q/28889943
tagged with: servlets
downvote count: 2
has body: For example I have javascript function in my index.jsp: How can I call it from servlet?
answer count: 1
tagged with: jsp
favorite count: 0
has comment: http://stackoverflow.com/comment/46051977
has answer: http://stackoverflow.com/a/28905204
accepted answer: http://stackoverflow.com/a/28905204
has comment: http://stackoverflow.com/comment/46046104
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/46051462
has comment: http://stackoverflow.com/comment/46050105
has comment: http://stackoverflow.com/comment/46051648
type: Question
has comment: http://stackoverflow.com/comment/46040933
score: -2
has title: How to call function defined in jsp from servlet?
tagged with: javascript

http://stackoverflow.com/a/28842021
upvote count: 2
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/28841797
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28841797
downvote count: 0
has body: $('.remove-member').click(function () { var toRemove = $(this).parent().text().slice(0, -1); var members = $(this).parent().siblings('input[name=group-members]').val().split(' '); $(this).parent().remove(); removeElement(members, toRemove); members = members.join(' '); $(this).parent().siblings('input[name=group-members]').val(members); }); You are removing the parent.. $(this).parent().remove(); So the call.. $(this).parent().siblings('input[name=group-members]').val(members); Shouldn't work anymore because you just killed the containing DOM node.
has comment: http://stackoverflow.com/comment/45953176

http://stackoverflow.com/comment/47551413
comment on: http://stackoverflow.com/a/28824810
score: 1
has text: OP want to show next 30 days dates starting with current date, not current months remaining dates.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45833145
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28776610
has text: If you search developers.facebook.com it is not documented there. And I work at Facebook
type: Comment

http://stackoverflow.com/a/28855312
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28811547
accepted answer of: http://stackoverflow.com/q/28811547
has body: For an unknown reason to me the ModalWindow is opened with JavaScript timeout of 0 seconds. So you need to execute your custom JavaScript again with a timeout, e.g.: target.appendJavaScript("setTimeout(function() {$('.wicket-modal').css('width', 888+'px');}, 10);");
upvote count: 1
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/a/76323388
type: Answer
has body: Since most of the answers on this page don't work anymore, this is the latest way as of May 2023: Step 1: Install the necessary packages In your project directory, run the following command to install the required packages: npm install --save-dev @babel/core @babel/cli @babel/preset-env This will install Babel core, the command line interface, and the preset for compiling modern JavaScript code. Step 2: Configure Babel Create a file named `babel.config.json` in the root directory of your project and add the following contents to it: { "presets": ["@babel/preset-env"] } This tells Babel to use the @babel/preset-env preset, which includes support for the latest JavaScript syntax. Step 3: Update your `package.json` file Open your package.json file and add the following script to the scripts section: "dev": "babel -w src -d lib | nodemon lib", This is just an example and it can change based on your project structure. This script compiles your JavaScript files from the /src directory to the /lib directory, and then runs nodemon on the compiled files. Note that this script assumes that your main entry file is named index.js. A more general script would be: " : "babel -w -d <final/dist directory> | <other scripts for running the server>"
score: 0
answers question: http://stackoverflow.com/q/28782656

http://stackoverflow.com/q/28795036
upvote count: 1
has answer: http://stackoverflow.com/a/71857497
possible better answer: http://stackoverflow.com/a/28795101
answer count: 5
tagged with: javascript
has body: I'm using JQuery and bootstrap, and when I try to click the button that should invoke the function, it doesn't work. I've looked in the developer console and there is nothing there, anyone know? Bill welcome to opposition clicker, its amazing. it has one upgrade. "opposition" when you get this, you will get +100 0Cs' every second. aasasa 0Cs'
has comment: http://stackoverflow.com/comment/45864572
has answer: http://stackoverflow.com/a/28795105
has title: jquery, javascript not working in bootstrap
has comment: http://stackoverflow.com/comment/45864878
has comment: http://stackoverflow.com/comment/45864831
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28795252
downvote count: 0
accepted answer: http://stackoverflow.com/a/28795252
score: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45864985
type: Question
has comment: http://stackoverflow.com/comment/45864948
has comment: http://stackoverflow.com/comment/45864924
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28795226
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/28795101

http://stackoverflow.com/comment/45996434
has text: Thank you Alvaro Montoro, great answer ! Going to use unique device ID
comment on: http://stackoverflow.com/a/28834696
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28827797
downvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/28827341
has body: In first moment i tried two things: Change the function to "doAlert()" Change the button to a normal link " test" It's worked! But few minutes after the link not fired anymore the alert box. I tried just in CodePlen. Please do it outside there and send a feed back.
upvote count: 0
score: -2

http://stackoverflow.com/comment/45957408
type: QuestionComment
score: 0
has text: @adamdc78 Better now? LOL
comment on: http://stackoverflow.com/q/28844156
type: Comment

http://stackoverflow.com/a/28824566
has comment: http://stackoverflow.com/comment/45920242
has body: Try changing your statement to: $update_course = update courses set course_updated='".$course_editor."', course_priceFinal='".$course_tax*$course_price."', course_tax='".$course_tax."', course_prereq='".$course_prereq."', course_sdesc='".$course_sdesc."' where course_id2 ='".$update_id."'
upvote count: 0
answers question: http://stackoverflow.com/q/28824475
type: Answer
score: -1
has comment: http://stackoverflow.com/comment/45920292
downvote count: 1

http://stackoverflow.com/comment/45968410
type: Comment
comment on: http://stackoverflow.com/q/28850384
has text: ^ I meant "You could try..."
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45994707
has text: But there are no calls to `.toFixed()` in your code ???
score: 1
comment on: http://stackoverflow.com/q/28864811
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46042852
score: 0
type: QuestionComment
has text: Your fiddle and code contradict each other. Are you trying to draw a triangle with `d3.svg.line()` or use `d3.symbol.type()`?
type: Comment
comment on: http://stackoverflow.com/q/28890714

http://stackoverflow.com/q/28795844
upvote count: 1
answer count: 1
tagged with: google-sheets
tagged with: javascript
has body: I have an html file bound to a google spreadsheet that creates a small gui. There are buttons on the gui, and I want to buttons to do things that involve the spreadsheet, so I want to make calls to things like SpreadsheetApp. For example, just so that I understand how to properly do this, let's say I want to just change one cell in a spread sheet, or log a value to the logger. Here is the html file that is served. Select an option below Let's assume this is the googlescript that serves the html function openDialog() { var html = HtmlService.createHtmlOutputFromFile('TeacherView') .setSandboxMode(HtmlService.SandboxMode.IFRAME); SpreadsheetApp.getActive().show(html); } When the html file runs, shouldn't I see the range in the spreadsheet change values? Or see the logger log a value? Am I misunderstanding how the combination of the scripts and html work? Sort of new to creating html/javascript things together, so any help is appreciated.
accepted answer: http://stackoverflow.com/a/28797130
tagged with: google-apps-script
type: AnsweredQuestion
downvote count: 0
score: 1
favorite count: 0
has title: Use googlescript api in html
type: Question
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28797130

http://stackoverflow.com/a/28780935
has body: The Web Audio API does not directly interface with MIDI devices, including the software MIDI synthesizers on your computer. For that, you'd need to use the (not very well supported) Web MIDI API. However, if you just want to play a simple monophonic note based on the parameters of a single MIDI note, you can convert those parameters to use with the Oscillator source: audio = new (window.AudioContext || window.webkitAudioContext)() function playNote(frequency, volume, duration) { var halfPeriod = 1/frequency/2 if(duration &gt; halfPeriod) duration -= duration % halfPeriod else duration = halfPeriod var g = audio.createGain() var o = audio.createOscillator() o.connect(g) g.connect(audio.destination) // so you actually hear the output o.frequency.value = frequency g.gain.value = volume o.start(0) o.stop(audio.currentTime + duration) } The three first lines of the function are there to adjust the duration to avoid cutting the oscillator while the wave is not at zero, since that would cause an unpleasant pop. Updated with latest (December 2015 draft) WebAudio spec
has comment: http://stackoverflow.com/comment/70320035
upvote count: 4
answers question: http://stackoverflow.com/q/28778163
downvote count: 0
score: 4
has comment: http://stackoverflow.com/comment/45840155
type: Answer
has comment: http://stackoverflow.com/comment/45862179

http://stackoverflow.com/comment/45827046
has text: Hmmm... looks interesting. I'll take a look! Thank you!
score: 0
comment on: http://stackoverflow.com/a/28772668
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28801500
accepted answer of: http://stackoverflow.com/q/28774119
answers question: http://stackoverflow.com/q/28774119
score: 0
type: AcceptedAnswer
has body: I have found the solution to my problem and thought I would share it. &lt;script&gt; function checkTimer(){ var ben = parent.document.getElementById('bench').style.height = "340px"; // resize the list var inv = parent.document.getElementById('invoice').style.height = "340px"; //Resize the Invoice var id = [ parent.document.getElementById('timer1'), parent.document.getElementById('timer2'), parent.document.getElementById('timer3'), parent.document.getElementById('timer4') ]; for(var i = 0; i &lt; 4; i++){ if(!id[i].style.display){ id[i].style.display = 'block'; id[i].style.visibility = 'visible'; value="" ; var a = i; $("a").attr('target','timer'+(a+1)); return; } } } I used a hyperlink instead of a form and then used the javascript above to minipulate the target attribute of the hyperlink and it works so I guess it is good. If someone sees a potential problem doing this please feel free to let me know.
type: Answer

http://stackoverflow.com/q/28826033
duplicate of: http://stackoverflow.com/q/203198
tagged with: php
has body: i had some problem with my code where i'm trying to separate my form function to another php files and use ajax function to call the form depend on the ids. But however after i separate the form function, the submit button can't call the ajax function. Here is the sponsor.php sample code where i use to trigger the ajax function and show up the form from another php into sponsor.php : After the result return success then it will show the form in the here: Please Select Sponsor Edit Button To Start. Whereby here is the form that retrieve from getSponsorForm.php in order to show in the : <?php $q = intval($_GET['sponsor']); include 'dbConnection.php'; global $dbLink; $query="SELECT * FROM sponsor_item WHERE sponsor_item_id = '".$q."'"; $result = $dbLink->query($query); // Numeric array while($row=mysqli_fetch_array($result,MYSQLI_ASSOC)){ echo ' Edit Sponsor No.'.$row["sponsor_item_id"].' 编辑器 Sponsor Title 赞助称号 Sponsor Description 赞助描述 File input Your picture size not more than 2MB. (Only JPEG or JPG is allowed) Update '; } mysqli_free_result($result); // Close the mysql connection $dbLink->close(); ?> When i do so, everything is working except once the form is showing up and i filled up the input field and want to press the submit button, it just won't trigger the ajax function on sponsor.php which is here: //File and text upload with formDATA function $("form#form").submit(function(){ var formData = new FormData($(this)[0]); $.ajax({ url:'sponsorItem.php', type: 'POST', data: formData, async: false, beforeSend: function(){ if(confirm('Are you sure?')) return true; else return false; }, cache: false, contentType: false, processData: false }).done(function () { //do something if you want when the post is successfully if(!alert('Banner Had Successfully Updated.')){document.getelementbyclassname('form').reset()} }); return false; }); Anything i did wrong? Please guide me through.Thanks :)
has comment: http://stackoverflow.com/comment/45922710
type: Question
linked to: http://stackoverflow.com/q/203198
tagged with: javascript
tagged with: jquery
has title: Submit button won't trigger ajax function
tagged with: ajax
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45922763
has answer: http://stackoverflow.com/a/28826160
type: UnansweredQuestion

http://stackoverflow.com/comment/45918577
score: 0
type: Comment
has text: for browser sake, use parent selector. :) Thanks
comment on: http://stackoverflow.com/a/28823688
type: AnswerComment

http://stackoverflow.com/comment/98425781
score: 5
comment on: http://stackoverflow.com/a/49964462
type: Comment
has text: This should be the correct answer, albeit needing a bit more explanation. Basically when the function body is an expression, not a block, that expression's value is returned implicitly. Correct me if I'm wrong.
type: AnswerComment

http://stackoverflow.com/q/28837043
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28837268
has title: Hide/Unhide DIV with JQuery
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28837139
accepted answer: http://stackoverflow.com/a/28837139
type: Question
possible better answer: http://stackoverflow.com/a/28837268
has body: I'm pulling the variables from a database and the values could either be Manual or Automatic. Users can also use a dropdown to change the values. If the value is already Manual I need it to unhide a DIV or if it was Automatic and the user switches to Manual I need to unhide a DIV. What I have currently only unhides if it was Automatic and user selects Manual. Here is a JSFiddle: http://jsfiddle.net/DTcHh/5031/ Any help would be appreciated. Thanks! HTML: Method: Automatic Manual Manual Activity Complete: False True Update Back JQuery: $(document).ready(function () { $('#method').change(function () { $('#manual').toggle(500); }); //$("#method").val('Manual'); });
answer count: 2
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/a/29187053
has comment: http://stackoverflow.com/comment/46589220
downvote count: 3
has comment: http://stackoverflow.com/comment/46589440
upvote count: 0
has body: You can easily create an inline rich text editor by using contenteditable property and some imagination. Just click on the dashed div an write a period '.' at the end of the sentence. $('#editor').bind("DOMSubtreeModified", function() { //alert($('#editor').html); var texto = $('#editor').html(); var pos = texto.search('perro'); if (pos != -1) { //alert('perro hallado en '+pos); var tam = 5; var inicio = texto.slice(0, pos); var urlperro = "http://cdns2.freepik.com/foto-gratis/_318-57958.jpg"; var fin = texto.slice(pos + tam, texto.length); $('#editor').html(inicio + ' ' + fin); } }); #editor { border=1px; border-style: dashed; } Custom HTML5 inline rich text editor Instructions Try editing the text inside the dashed container it will replace some special combination of characters to rich text in html format. Tengo un pequeño perro que vive conmigo
has comment: http://stackoverflow.com/comment/46589406
has comment: http://stackoverflow.com/comment/46589472
answers question: http://stackoverflow.com/q/28856693
has comment: http://stackoverflow.com/comment/46589508
score: -3
type: Answer

http://stackoverflow.com/q/28864324
downvote count: 0
tagged with: javascript
tagged with: ajax
accepted answer: http://stackoverflow.com/a/28880306
answer count: 1
favorite count: 0
tagged with: gmaps4rails
tagged with: ruby-on-rails
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28880306
upvote count: 1
type: Question
has body: I have been working through writing a small app with a lot of help from stackoverflow. The basic premise is simple, and I've seen this sort of functionality all over the web: I am trying to plot a list of locations onto a searchable/pannable google map. The locations are stored on the backend, and the controller feeds these locations to the view. AJAX is involved because I don't want to reload the entire page. Here are the scenarios: a) User searches for a location via zipcode => map loads new location, a search get is sent to server and map loads any markers if there are any within set radius, map sets a default zoom level; b) User pans/zooms around => map stays wherever the user has left it, a search with the viewport bounding box is sent to the server and the results are mapped. The map will default to Seattle on initial load and the first thing it tries is to geolocate the user... Using the gmaps4ails wiki and mostly a modified version of the answer from this question: Google Maps for Rails - update markers with AJAX I have gotten very close. It works, actually, just with a hitch. Here is what it looks like: sightings_controller.rb def search if params[:lat] @ll = [params[:lat].to_f, params[:lng].to_f] @sightings = Sighting.within(5, origin: @ll).order('created_at DESC') @remap = true elsif search_params = params[:zipcode] geocode = Geokit::Geocoders::GoogleGeocoder.geocode(search_params) @ll = [geocode.lat, geocode.lng] @sightings = Sighting.within(5, origin: @ll).order('created_at DESC') @remap = true elsif params[:bounds] boundarray = params[:bounds].split(',') bounds = [[boundarray[0].to_f, boundarray[1].to_f], [boundarray[2].to_f, boundarray[3].to_f]] @ll = [params[:center].split(',')[0].to_f, params[:center].split(',')[1].to_f] @sightings = Sighting.in_bounds(bounds, origin: @ll).order('created_at DESC') @remap = false else search_params = '98101' geocode = Geokit::Geocoders::GoogleGeocoder.geocode(search_params) @ll = [geocode.lat, geocode.lng] @sightings…
has title: Google Maps For Rails - updating markers via ajax only when search result changes
linked to: http://stackoverflow.com/q/28456641

http://stackoverflow.com/a/28824232
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28824090
has body: Internally, ng-repeat works by adding elements to the parent element of the directive ng-repeat is called on. Your compiled ng-repeat has no parent to add it's elements to, so it can't work. Add a parent div (Plunk) var html = '&lt;div&gt;&lt;div ng-repeat="number in numbers"&gt;{{ number }}&lt;/div&gt;&lt;/div&gt;'; var html2 = '&lt;div&gt;{{ numbers }}&lt;/div&gt;'; var returnObject = $compile(html)(myScope); $timeout(function () { myScope.$digest(); console.log(returnObject.children());
type: Answer
score: 7
upvote count: 7
answers question: http://stackoverflow.com/q/28824090
type: AcceptedAnswer

jquery-validate
tags question: http://stackoverflow.com/q/28852704
type: Tag
tag name: jquery-validate
tags question: http://stackoverflow.com/q/28889558
tags question: http://stackoverflow.com/q/28886981
tags question: http://stackoverflow.com/q/28815172
tags question: http://stackoverflow.com/q/28836727

http://stackoverflow.com/comment/45793209
comment on: http://stackoverflow.com/a/28752117
score: 0
type: AnswerComment
type: Comment
has text: @Aaron So when one of the five items (Hospitality "thru" Private Equity) is clicked, a child of the .tuckinfo element will be shown, and its siblings hidden. Is that a true statement?

http://stackoverflow.com/a/28865930
answers question: http://stackoverflow.com/q/28865868
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/45997577
has body: In short.. apostrophes: $("header").html('&lt;img src="resources/banner.png" /&gt;&lt;nav&gt;&lt;ul&gt;...&lt;/ul&gt;&lt;/nav&gt;');
has comment: http://stackoverflow.com/comment/45997478
accepted answer of: http://stackoverflow.com/q/28865868
score: 0

http://stackoverflow.com/a/28881612
score: 0
has body: @Gvee: Hi the connection string problem is solved. I am using windows authentication. I changed the part "Trusted_Connection=True" to "Integrated Security=SSPI;" and its working now. But I am now facing problem with getting the recordset output in the alert box. This is now an entirely different problem I suppose. The code rs.Open(runThisQuery, connection); runs correctly but the code alert(rs); does not run and I am getting the error "String is undefined". I will try and figure out the reason for this. But If you have to add anything to solve that problem too, I would be more than Grateful.
type: Answer
answers question: http://stackoverflow.com/q/28855694

http://stackoverflow.com/a/28895268
has comment: http://stackoverflow.com/comment/72303518
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28894650
score: 3
has comment: http://stackoverflow.com/comment/46053448
upvote count: 3
type: AcceptedAnswer
has body: var app = angular.module('app', ['ui.bootstrap']); app.controller('homeCtrl', function($scope) { $scope.tabs = [{ name: "Tab 1", active: true }, { name: "Tab 2", active: false }, { name: "Tab 3", active: false }]; $scope.addTab = function($event) { //$event.praventDefault();//not working //$event.stopPropagation();//not working console.log($event); console.log("do some stuff and call addNewTab()") }; }); {{tab.name}}
type: Answer
answers question: http://stackoverflow.com/q/28894650

http://stackoverflow.com/comment/101595135
score: 0
type: AnswerComment
has text: this wont be responsive!
type: Comment
comment on: http://stackoverflow.com/a/54131130

http://stackoverflow.com/q/28832313
has title: Possible to edit images dynamically and on the fly?
has comment: http://stackoverflow.com/comment/45934579
has comment: http://stackoverflow.com/comment/45934397
has comment: http://stackoverflow.com/comment/45934231
type: Question
has answer: http://stackoverflow.com/a/28832411
tagged with: javascript
has comment: http://stackoverflow.com/comment/45934957
has body: For example: Take a look at a character for my RPG browser game: I want to add an attack weapon animation. But, I need to manipulate this .png image, and cut out a square box out of it, and then apply some css animations. (So it has the effect of swinging a weapon). I know how to do that part, but the problem is trying to cut out the image with Javascript and then use it as an individual, or it's own separate div. All the image character files are the same dimensions btw. So, is it possible to manipulate images with Javascript?
score: 0
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/28832411
has comment: http://stackoverflow.com/comment/45934990
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/45934802
has comment: http://stackoverflow.com/comment/45934313
type: AnsweredQuestion

http://stackoverflow.com/comment/45801815
type: Comment
comment on: http://stackoverflow.com/a/28760543
has text: OK, function is working now.. but when I try ti alert(arrayData), it displays weird values like: [object Object], [object Object]
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45944723
score: 0
has text: @James the actual Function constructor.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28837363

http://stackoverflow.com/a/28846020
type: Answer
answers question: http://stackoverflow.com/q/28845651
upvote count: 1
has body: Here is a good tutorial on how to create a JQuery plugin: http://learn.jquery.com/plugins/basic-plugin-creation/
has comment: http://stackoverflow.com/comment/45960966
downvote count: 0
score: 1

if-statement
tags question: http://stackoverflow.com/q/28813349
tags question: http://stackoverflow.com/q/28865857
tags question: http://stackoverflow.com/q/28899493
tag name: if-statement
type: Tag
tags question: http://stackoverflow.com/q/28865781
tags question: http://stackoverflow.com/q/28775939
tags question: http://stackoverflow.com/q/28852715
tags question: http://stackoverflow.com/q/28871409
tags question: http://stackoverflow.com/q/28752987
tags question: http://stackoverflow.com/q/28777157
tags question: http://stackoverflow.com/q/28762045
tags question: http://stackoverflow.com/q/28905364
tags question: http://stackoverflow.com/q/28820919
tags question: http://stackoverflow.com/q/28904140
tags question: http://stackoverflow.com/q/28781290
tags question: http://stackoverflow.com/q/28835823
tags question: http://stackoverflow.com/q/28800039
tags question: http://stackoverflow.com/q/28771148

http://stackoverflow.com/a/53511893
upvote count: 2
has body: function getLastColNum(rowNum) { // Get the values of the row's (unbounded by column number) range. var vals = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet() .getRange(rowNum +":"+ rowNum) .getValues()[0], lastColNum = vals.length ; // Decrement while popping off any trailing empty text ("") cells. while(!vals.pop()) { --lastColNum; } return(lastColNum); }
score: 2
answers question: http://stackoverflow.com/q/28768178
downvote count: 0
type: Answer

http://stackoverflow.com/q/28843505
score: 4
has answer: http://stackoverflow.com/a/28843604
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/45956109
has comment: http://stackoverflow.com/comment/45955957
has body: This is probably something simple that I'm missing, but I've been googling around looking for an answer, and haven't gotten anything to work. What I'm trying to do: I'm making an ajax call to my server to get some simple data returned as json The issues I'm having: I've tried a few methods to access the json data, but have gotten errors ranging from "undefined", "Uncaught TypeError: Cannot read property...", to "Uncaught SyntaxError: Unexpected token o". What I've tried: Here's the jquery (v1.11.1) ajax call: $.getJSON(ajax_url, function(data){ // I've tried the commented out items below // var data = $.parseJSON(data); // var data = JSON.parse(data); // var data = data[0]; alert(data.test); }); To make things super simple, I've tried and failed to get access to the very simple json returned by the following php: header('Content-Type: application/json'); $test = array('test' =&gt; 'test data'); echo json_encode($test); exit; Before anyone asks, I've double checked to make sure that the ajax_url is accessing the proper page by logging the url to the js console and also logging the access on the php side by making an error log entry when the script is called. What I'd like: I'd love it if someone could let me know what I'm doing wrong, and how I can easily get the "test data" from the "test" key being returned. Edit: Running console.log(data) gives the following info: Object {success: "true"} Edit Edit: The issue was echoing the success => true array higher in my actual script. I forgot to delete it before adding the test => test data.
has comment: http://stackoverflow.com/comment/45956061
upvote count: 4
has comment: http://stackoverflow.com/comment/45955983
has comment: http://stackoverflow.com/comment/45955914
has title: Can't access returned json in jquery
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45955949
has comment: http://stackoverflow.com/comment/45956065
has comment: http://stackoverflow.com/comment/45956031
tagged with: php
possible better answer: http://stackoverflow.com/a/28843604
has comment: http://stackoverflow.com/comment/45956127
has comment: http://stackoverflow.com/comment/45956466
type: Question
has comment: http://stackoverflow.com/comment/45956053
has comment: http://stackoverflow.com/comment/45956371
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45956084
has answer: http://stackoverflow.com/a/28843624
accepted answer: http://stackoverflow.com/a/28843624
has comment: http://stackoverflow.com/comment/45955963
has comment: http://stackoverflow.com/comment/45955980
has comment: http://stackoverflow.com/comment/45956085
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45956454
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/28791079
has comment: http://stackoverflow.com/comment/45857516
type: Answer
has body: Fiddle: http://jsfiddle.net/q1w1fk5t/ HTML: D1 D2 D3 JQuery: var myData = {}; $("div").each(function () { myData[$(this).attr("id")] = $(this).html(); }); alert(JSON.stringify(myData)); OUTPUT: You will get a JSON string as the output. {"a1":"D1","a2":"D2","a3":"D3"}
accepted answer of: http://stackoverflow.com/q/28790984
answers question: http://stackoverflow.com/q/28790984
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45857947
has comment: http://stackoverflow.com/comment/45858180
has comment: http://stackoverflow.com/comment/45867241

http://stackoverflow.com/q/28877887
has comment: http://stackoverflow.com/comment/46017769
has body: I am passing an array to the directive which is used for an ng-repeat. I also would like to pass a variable which is bound to an input field. The way i am doing it, isn't showing a thing. Here is the HTML code: (The part where I call my directive is on the bottom) Persons99 Projects15 Construction yards32 Containers85 Vehicles66 Dispatched to Collective Unique Inspections Unused Here is the directive: define(['dashboard/module', 'lodash'], function (module) { 'use strict'; return module.registerDirective('dispatch', function () { return { controller: 'DashboardCtrl', restrict: 'E', scope: { data: '=', search: '@' }, template: ' ' + '{{name}}' + ' {{search}} ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' } }); }); So, my data is being passed to the directive but the search doesn't. Here is the data which listToDispatch contains: $scope.dataVehicles = { "Xavier": [ [ { value: 70, color: "#1675a9", highlight: "#1675a9", label: "is in use" }, { value: 36, color: "#7eb3cf", highlight: "#1675a9", label: "is used" } ], [ { value: 40, color: "#1675a9", highlight: "#1675a9", label: "is unique" }, { value: 30, color: "#7eb3cf", highlight: "#1675a9", label: "is unique" } ], [ { value: 70, color: "#1675a9", highlight: "#1675a9", label: "is in use" }, { value: 30, color: "#7eb3cf", highlight: "#1675a9", label: "is used" } ], [ { value: 70, color: "#1675a9", highlight: "#1675a9", label: "is in use" }, { value: 30, color: "#7eb3cf", highlight: "#1675a9", label: "is used" } ] ], "Tarek": [ [ { value: 70, color: "#1675a9", highlight: "#1675a9", label: "is in use" }, { value: 30, color: "#7eb3cf", highlight: "#1675a9", label: "is used" } ], [ { value: 76, color: "#1675a9", highlight: "#1675a9", label: "is in use" }, { value: 30, color: "#7eb3cf", highlight: "#1675a9", label: "is used" } ], [ { value: 70, color: "#1675a9", highlight: "#1675a9", label: "is in use" }, { value: 30, color: "#7eb3cf", highlight: "#1675a9", label: "is used" } ], [ { value: 70, color: "#1675a9", highlight: "#1675a9",…
downvote count: 0
type: UnansweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28878497
type: Question
tagged with: angularjs-directive
tagged with: javascript
answer count: 2
upvote count: 1
has title: pass variable to directive AngularJS
tagged with: variables
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/28878078

http://stackoverflow.com/q/28839860
score: 1
type: Question
tagged with: javascript
upvote count: 1
has comment: http://stackoverflow.com/comment/45950051
has body: On initial page load, there are audio elements on the page which have preload="metadata". Dynamically, I update that preload attribute to "Auto", and I am wondering, does it actually preload the audio file when doing it this way? (or if you don't know maybe you know of a way I can verify it?)
has comment: http://stackoverflow.com/comment/45949840
favorite count: 0
has comment: http://stackoverflow.com/comment/45950164
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: Dynamic preload of Audio elements
answer count: 0
downvote count: 0

http://stackoverflow.com/a/28853596
type: AcceptedAnswer
type: Answer
has body: I suspect your image is in binary format, which cannot be used as value in "src", what you should do is using it in base64. Here an example: Embedding Base64 Images Plan B is to update just the link, but as you said probably the browser won't show an image during the fetching process.
answers question: http://stackoverflow.com/q/28852414
accepted answer of: http://stackoverflow.com/q/28852414
score: 0

http://stackoverflow.com/comment/45998614
score: 0
type: Comment
type: QuestionComment
has text: @Nit, so I have been told. I see '{' and '[', and I mistake it for JSON. Could you explain what would make this "JSON"? The only thing I changed from http://json.org/example was the `var styles = []' (Swapped the `{''s for a '['. I see '[ & ]' used in "JSON" tutorials. How would this be reworked to be "JSON"?
comment on: http://stackoverflow.com/q/28866300

http://stackoverflow.com/a/28874425
type: Answer
has body: PHP Code: &lt;?php if(isset($_POST['submit']) != '') { $_SESSION['acc_main'] = $_POST['acc1']; $_SESSION['acc_id'] = $_POST['acc2']; $_SESSION['acc_cat'] = $_POST['acc3']; echo '&lt;script type="text/javascript"&gt;' , 'jsfunctionToPrintUpdatedValues();' , '&lt;/script&gt;' ; } ?&gt; Javascript Sample Code function jsfunctionToPrintUpdatedValues() { /* retrieve the updated session variables in javascript variables */ var acc_main_js = &lt;?php echo $_SESSION['acc_main']?&gt; var acc_id_js = &lt;?php echo $_SESSION['acc_id']?&gt; var acc_cat_js = &lt;?php echo $_SESSION['acc_cat']?&gt; document.getElementById("main").value=acc_main_js; document.getElementById("id").value=acc_main_js; document.getElementById("cat").value=acc_main_js; }
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28873716
upvote count: 1

http://stackoverflow.com/comment/45905111
comment on: http://stackoverflow.com/a/28815978
has text: Depends, if you're doing it in a loop sure, but if you're just doing once per click it's fine and a relatively simple way of doing it.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/72483783
score: 0
type: AnswerComment
has text: This ajaxHandler is not working for me. I keep getting errors saying unknown variable $. Any ideas?
type: Comment
comment on: http://stackoverflow.com/a/28828451

http://stackoverflow.com/comment/46053164
comment on: http://stackoverflow.com/a/28896275
type: AnswerComment
has text: @DavidHeffernan, for extracting result use Example2 method :)
score: 0
type: Comment

http://stackoverflow.com/comment/45816586
has text: In your button's data-detail attribute.
type: Comment
comment on: http://stackoverflow.com/q/28768777
score: 0
type: QuestionComment

http://stackoverflow.com/q/28901294
score: 1
favorite count: 0
upvote count: 1
tagged with: php
has body: I want to call a javascript function from a button in php this is the php code: //the view <?php $form = yii\widgets\ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]); ?> <?= $form->field($msubs, 'id_subespecifica', ['options' => ['class' => 'col-md-12']]) ->widget(Select2::classname(),[ 'data' => ArrayHelper::map($vectorConsul,'sesp', 'sesp'), 'options' => ['id' => 'prueba'], ]) ->label(false); ?> Add New <?php yii\widgets\ActiveForm::end(); ?> And this is the Javascript code: //Javascript function myFunction() { $.ajax({ url:'partidaasociada/get-linea', type:'POST', dataType:'json', data:{pruebaId:$('#prueba').val()} // alert(pruebaId); }); In the javascript function, i need to send the $('#prueba').val() to a php function in the controller: //Controller public function actionGetLinea($pruebaId) { $model = new PartidaAsociada(); log($pruebaId); } But i am getting some errors, i think the button is reloading the whole form and don't recognize the previous data y sent to the form. Note: The 'alert()' in the javascript function is on commentary because it wont let me use, the form stay loading when i put the alert. thanks beforehand.
type: AnsweredQuestion
has title: Yii2: call javascript function with a button
has answer: http://stackoverflow.com/a/28901734
type: Question
has comment: http://stackoverflow.com/comment/46062235
tagged with: yii2
downvote count: 0
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28901734
tagged with: http://stackoverflow.com/tag/html
answer count: 1

http://stackoverflow.com/q/28770078
type: AnsweredQuestion
downvote count: 0
answer count: 1
score: 1
has comment: http://stackoverflow.com/comment/45819440
favorite count: 0
has comment: http://stackoverflow.com/comment/45820028
tagged with: angularjs
type: Question
has comment: http://stackoverflow.com/comment/45819058
has answer: http://stackoverflow.com/a/28771595
upvote count: 1
has body: Prior to updating Angular to 1.3, I was using Angular 1.2. I was filtering my list of categories using this filter. What it does is remove a category that is a duplicate of what is passed in (me). app.filter('CategorySelectFilter', function() { return function(cats, me) { var filteredCats = angular.copy(cats); for (var index in filteredCats) { if (me.id == filteredCats[index].id) { filteredCats.splice(index, 1); } } return filteredCats; }; }); Using this in my HTML, everything worked dandy. ng-options="c as c.name for cat in filtered = (cats | CategorySelectFilter: cat) track by cat.id" After updating to Angular 1.3, I started getting Infdig errors from this. I do not know what is happening. EDIT: Added Plnkr http://plnkr.co/edit/X2cAvRyd3pdjMDOOQKfI?p=preview It seems to work fine in the Plnkr code, but still getting Infdig errors from the console. Try comparing the code from 1.2.13 and 1.3.13 of AngularJS. 1.3.13 throws a bunch of infdig errors.
linked to: http://stackoverflow.com/q/18747643
accepted answer: http://stackoverflow.com/a/28771595
tagged with: javascript
has title: Filtering ng-options

http://stackoverflow.com/q/28845855
has comment: http://stackoverflow.com/comment/45960572
has comment: http://stackoverflow.com/comment/45960678
type: Question
has comment: http://stackoverflow.com/comment/45960484
has body: I want to dynamically insert the images inside a folder into an array to be used as a thumbnail. I have read some questions like this one. Dynamically add images jquery However, what I want to do is not to declare the content of the array. I don't want to do it this way var images = {'image1':'assets/img/linkedin_30px.png','image2':'assets/img/twitter_30px.png'} instead what I want is var images = []; and then I want to fill the array, or possibly JSON when the page loads. I've read that I can use AJAX but I do not how to use it. so if array is possible please help. Thanks.
has comment: http://stackoverflow.com/comment/45960670
linked to: http://stackoverflow.com/q/7230579
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28846208
has comment: http://stackoverflow.com/comment/45960626
has title: jQuery: Fill array with images from a folder. or use AJAX to load images from a folder
tagged with: arrays
has comment: http://stackoverflow.com/comment/45960645
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery

http://stackoverflow.com/q/28885367
tagged with: autoplay
has title: Add Auto Play to Tilted Content Slider
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: joomla3.0
has body: I have been trying to add autoplay to a tilted content slider that I have loaded on Joomla. I found a similar post and took their code, put in a Jquery file which I have been able to successfully load but it is now causing an error in the main .js file for the slider. I have figured that is probably because the main code is not numbering the slides but just assigning a nav button to each slide which then needs to be clicked to load the specific slide. Here is the pertinent part of the main .js file for the current navigation. TiltSlider.prototype._init = function() { this._addNavigation(); this._initEvents(); } // add the navigation to the DOM TiltSlider.prototype._addNavigation = function() { // add nav "dots" this.nav = document.createElement( 'nav' ) var inner = ''; for( var i = 0; i &lt; this.itemsCount; ++i ) { inner += i === 0 ? '&lt;span class="current"&gt;&lt;/span&gt;' : '&lt;span&gt;&lt;/span&gt;'; } this.nav.innerHTML = inner; this.el.appendChild( this.nav ); this.navDots = [].slice.call( this.nav.children ); } TiltSlider.prototype._initEvents = function() { var self = this; // show a new item when clicking the navigation "dots" this.navDots.forEach( function( dot, idx ) { dot.addEventListener( 'click', function() { if( idx !== self.current ) { self._showItem( idx ); } } ); } ); } I am a hopeless coder! I know enough to be able to start understanding what it is doing but no idea how to actually write something to do what I want!! I am really hoping that someone will be able to show me what to add so that I can get this to run automatically. The file I tried prior was: ( function($) { $(document).ready(function(){ new TiltSlider(document.getElementById( 'vina-tilted-content-slideshow' )); window.setInterval(function(){ $('nav&gt;.current').next().trigger('click'); if($('nav &gt; .current').next().index() == '-1'){ $('nav &gt; span').trigger('click'); } }, 10000); }); })(jQuery); This called the following error in a line in the main.js that was related to t…
type: UnansweredQuestion
tagged with: slider
answer count: 0
score: 1
upvote count: 1
type: Question
tagged with: javascript

http://stackoverflow.com/q/28879784
upvote count: 6
has comment: http://stackoverflow.com/comment/46259713
accepted answer: http://stackoverflow.com/a/29077884
score: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46273576
has comment: http://stackoverflow.com/comment/46298527
has comment: http://stackoverflow.com/comment/46259776
has body: I have a page with 2 iframes, side by side, both from the same domain. I want to drag'n'drop an element from a specific drag-zone (e.g. a table) of one iframe to a specific dropzone (e.g. a list) on the other. I checked all related questions on stackoverflow and elsewhere, but I can't find an appropriate solution. I tried it with jQuery UI draggable, but the problem is that the returned draggable element is contained within the iframe. I cannot drag it out of the iframe boundaries. So, my next thought was to create the draggable element on top (parent) window, but then I guess I'd have to somehow trigger a drag event on the parent window from the dragstart event on the iframe. But then, how would I detect the drop event when I mouse over the appropriate elements on the drop-frame? Oh, and if that's not hard enough already, I'd like to make it work on IE8 too :) But for now, let's just say that I will find a fallback solution for IE8 that will not involve drag'n'drop.
type: Question
linked to: http://stackoverflow.com/q/3075696
answer count: 2
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46276838
has comment: http://stackoverflow.com/comment/46253004
has answer: http://stackoverflow.com/a/29077884
has comment: http://stackoverflow.com/comment/46232557
has comment: http://stackoverflow.com/comment/46298681
has comment: http://stackoverflow.com/comment/46270250
favorite count: 0
has title: JavaScript/jQuery drag and drop element between two iframes
has comment: http://stackoverflow.com/comment/46269247
possible better answer: http://stackoverflow.com/a/29006353
tagged with: drag-and-drop
has comment: http://stackoverflow.com/comment/46276972
has comment: http://stackoverflow.com/comment/46271727
tagged with: iframe
downvote count: 2
has answer: http://stackoverflow.com/a/29006353
tagged with: draggable

http://stackoverflow.com/comment/46083709
has text: The error was that i'd added another class attribute, like this: `class="field" class="sub-category-select"`. When you do this it will just take one of them, usually the first, so the sub-category-select class wasn't present. I've edited my answer.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28902912
type: Comment

ratchet
type: Tag
tag name: ratchet
tags question: http://stackoverflow.com/q/28799792
tags question: http://stackoverflow.com/q/28862517

http://stackoverflow.com/a/29055135
upvote count: 3
accepted answer of: http://stackoverflow.com/q/28901436
has body: Using the HTML5 canvas drawing methods is not possible in Duktape. Duktape is a Javascript engine, what means that it allows you to execute ES5/5.1 compliant code. Displaying a HTML canvas is a task Duktape can't do. If you ultimately want to achieve this, try searching for a library to achieve such a task, maybe look at the Firefox source. If you want to do it completely from scratch you would need to add C function bindings (Example at duktape.org/) for every draw method you want. An example would be like this: // C/C++ code: // C function to be used in the Javascript engine int js_draw_rect(duk_context *ctx) { // get parameters from javascript function call int pos_x = duk_get_number(ctx, -4); int pos_y = duk_get_number(ctx, -3); ... // C/C++ code to draw the rectangle (in your case probably GLUT) draw_rectangle(pos_x, pos_y, ...); return 0; } int main(void) { duk_context *ctx; ... // this snippet adds a binding for the function 'js_draw_rect' so it can be called from Javascript code duk_push_global_object(ctx); duk_push_c_function(ctx, js_draw_rect, 4/*number of args the JS function has*/); duk_put_prop_string(ctx, -2 /*idx:global*/, "drawRect"/*name of function in JS environment*/); duk_pop(ctx); } // Javascript code: drawRect(50, 50, 100, 200); ... This method allows you to create C/C++ functions which handle all drawing and later bind them all to the Javascript engine so they can be called in JS.
answers question: http://stackoverflow.com/q/28901436
score: 3
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/45900747
score: 0
type: Comment
has text: No. The problem is that IE can't hide option element in select. So you can delete option instead `$(ids).remove();`.
type: AnswerComment
comment on: http://stackoverflow.com/a/28813783

http://stackoverflow.com/a/28837085
upvote count: 1
score: 1
downvote count: 0
type: Answer
has body: var theString = $(".trimmed-words").html(); //the string should be outside the trimWords() function. It's not working during resize because the theString becomes "" empty. JSBIN DEMO
answers question: http://stackoverflow.com/q/28836779

http://stackoverflow.com/comment/46028963
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28846835
has text: @JonCursi I'd put it after you handle the response inside the `if` statement

http://stackoverflow.com/q/28829747
tagged with: javascript
tagged with: jquery
tagged with: asp.net
has answer: http://stackoverflow.com/a/28829845
tagged with: http://stackoverflow.com/tag/html
has title: Count the most clicked video in a website
type: UnansweredQuestion
type: Question
tagged with: c#
has body: In my asp.net website I have several videos and I want to store the click count on each video in to a database for the purpose of getting the most clicked(viewed) video in the website. Can any one help me how can we done this. here is my html &lt;div class="row"&gt; &lt;video id="video1" controls width="100%"&gt; &lt;source src="&lt;%=mp4 %&gt;" type="video/mp4"&gt; &lt;source src="&lt;%=ogv %&gt;" type="video/ogg"&gt; &lt;source src="&lt;%=webm %&gt;" type="video/webm"&gt; Your browser does not support HTML5 video. &lt;/video&gt; &lt;/div&gt; Thanks in advance for help.
score: 0
answer count: 1

http://stackoverflow.com/comment/45794665
has text: You probably don't want to replace *all* text on *every* website with something else. that wouldn't be useful, or would it?
score: 0
comment on: http://stackoverflow.com/q/28756022
type: Comment
type: QuestionComment

transition
tags question: http://stackoverflow.com/q/28760620
tags question: http://stackoverflow.com/q/28893630
tags question: http://stackoverflow.com/q/28872807
tag name: transition
type: Tag

http://stackoverflow.com/a/28769625
upvote count: 1
has comment: http://stackoverflow.com/comment/45817959
has comment: http://stackoverflow.com/comment/45821800
has comment: http://stackoverflow.com/comment/45817867
downvote count: 0
has body: So why doesn't this throw a ReferenceError: var obj = { a: 23, b: obj }; after all, obj still doesn't exist yet! It would throw a ReferenceError if I was trying to access a not-yet-defined thing elsewhere! The variable obj exists because of hoisting. It just doesn't have a value yet. Your example is equivalent to var obj; // declaration is hoisted to the top of the scope obj = { a: 23, b: obj }; obj exists but has the (default) value undefined.
type: Answer
score: 1
answers question: http://stackoverflow.com/q/28769266

http://stackoverflow.com/q/28871779
has answer: http://stackoverflow.com/a/28871934
favorite count: 0
has answer: http://stackoverflow.com/a/28871876
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/4961072
accepted answer: http://stackoverflow.com/a/28871934
has answer: http://stackoverflow.com/a/28871901
upvote count: 1
has answer: http://stackoverflow.com/a/28872526
downvote count: 1
has answer: http://stackoverflow.com/a/28871881
type: Question
possible better answer: http://stackoverflow.com/a/28871901
answer count: 6
has body: I want to be able to run the below function continuously while the mouse is down. At the moment the function excecutes once per click. I want to be able to continue running the function while mousedown and stop when the mouse is released. $('#md').mousedown(function(e){ var pCords = e.pageY +e.pageY; var max = $(document).height()+$(document).width(); var dg = 2*( pCords / max ); $('#div').css({ 'transform':'rotate('+dg+'deg) '}); });
has comment: http://stackoverflow.com/comment/46007065
has answer: http://stackoverflow.com/a/28871982
score: 0
has title: Continue function until mouse is released
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/45870316
comment on: http://stackoverflow.com/q/28797931
has text: You must not add fields with the same id. Id attribute has to be unique
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45863686
type: Comment
score: 0
has text: Can you create a fiddle to figure out your issue ?
type: AnswerComment
comment on: http://stackoverflow.com/a/28794526

http://stackoverflow.com/comment/46000105
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28867200
type: Comment
has text: I don't know anything about how tumblr works, I just answered the question about wrapping up the functionality. Sorry.

http://stackoverflow.com/q/28872077
has answer: http://stackoverflow.com/a/28872269
has body: I have two small examples code: // example 1: var x; ... x = x || 'some value'; //assign some value to x if x has no value ... // example 2: var y; ... y || (y = 'some value'); //assign some value to y if y has no value ... My question is: 1. Will x be reassign it's value in example 1 when x already has value? 2. Is example 2 better then example 1? (My english isn't good. Thanks for your reading and answering :D)
has answer: http://stackoverflow.com/a/28872160
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46007222
possible better answer: http://stackoverflow.com/a/28872269
type: Question
has answer: http://stackoverflow.com/a/28872163
tagged with: javascript
score: 4
accepted answer: http://stackoverflow.com/a/28872163
upvote count: 4
has title: Javascript: || operator for variable assignment
answer count: 3
downvote count: 0
favorite count: 0

http://stackoverflow.com/comment/96530404
has text: I expect your code to print None. I adapted the code above and added the last 4 lines. What do you think? The point is that the code of selenium can never run at the same time as the browser handles keyboard input. As such, events need to be handled in javascript, the result saved, e.g. in an array and then when selenium is asked, the array is returned to python.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/29592696
type: Comment

http://stackoverflow.com/a/28893604
downvote count: 0
has comment: http://stackoverflow.com/comment/46053908
answers question: http://stackoverflow.com/q/28893387
has body: Because JavaScript in index.html can't change className in color.html Try this: Index.html Red Blue Green color.html:
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/comment/46299056
comment on: http://stackoverflow.com/q/28881124
score: 0
type: QuestionComment
type: Comment
has text: That's perfect!!! I can't thank you enough ... :-)

http://stackoverflow.com/a/28903819
score: 1
upvote count: 1
downvote count: 0
has body: Without knowing what the desired layout is, you can use media queries to specify when you want the layout to change. To change the flow of the document you can use either the position property to move the divs around manually (an OK solution if the container has a fixed width that you can move your divs around in) or the float property to move the divs around a bit. The "solution" below shows the three divs stacked on mobile. When viewed in full-screen they should be side-by-side with the second div on the end. /** * Default / mobile */ div { width:100%; height:5em; } #fun1 { background:red; } #fun2 { background:blue; } #fun3 { background:green; } /** * Greater than 700 pixels. * Place divs next to each other */ @media (min-width:700px) { div { float:left; width:32%; color:#fff; text-align:center; } div + div { margin-left:1%; } /** * Move #fun2 to the right */ #fun2 { float:right; } } Fun 1 Fun 2 Fun 3
type: Answer
answers question: http://stackoverflow.com/q/28903175

http://stackoverflow.com/q/28763958
type: Question
upvote count: 12
tagged with: javascript
has title: NodeJS unsafe-perm not working on package.json
score: 12
answer count: 2
has body: I'm trying to run a npm install command with a preinstall script at my package.json. I know it's antipattern but I need to run some scripts as root. It's working fine by adding a .npmrc file containing unsafe-perm = true to my root directory. But it's not working by add a config property in my package.json file: { "name": "foo", "version": "1.4.4", "config": { "unsafe-perm":true }, "scripts" : { "preinstall" : "npm install -g bower" } } // It is not working According with NPM config docs it's ok adding this property in my package file. I want to understand why it's not working.
has answer: http://stackoverflow.com/a/28787942
possible better answer: http://stackoverflow.com/a/28766649
downvote count: 0
has answer: http://stackoverflow.com/a/28766649
favorite count: 0
accepted answer: http://stackoverflow.com/a/28787942
tagged with: npm
tagged with: node.js
type: AnsweredQuestion
tagged with: package.json

http://stackoverflow.com/q/28773458
type: UnansweredQuestion
tagged with: line
type: Question
has title: d3.js link seperation in tree layout
has comment: http://stackoverflow.com/comment/45828782
tagged with: javascript
has comment: http://stackoverflow.com/comment/45829468
score: 0
answer count: 1
has body: what I'm trying to do is to have a gap in between the links of a d3.js tree layout in which the node name fits (See image). http://s15.postimg.org/xn1eenxh7/linesplit.jpg My graph looks similar to this example: http://bl.ocks.org/mbostock/4063550 What I tried to change is the d.y in the projection. var diagonal = d3.svg.diagonal.radial() .projection(function(d) { return [d.y, d.x / 180 * Math.PI]; }); Which results in a change of both parent and child links. I'm sure there is a simple solution to this, but I don't get it right now. Thanks for any help.
tagged with: d3.js
has answer: http://stackoverflow.com/a/28775417
tagged with: tree

http://stackoverflow.com/a/28833215
score: 0
has body: Simply add this to the bottom of your existing script $("#paytype").bind('change', function(){ $(insProviderTable); }); Add between main body and $(insProviderTable); Hope this helps, let me know how you get on!
has comment: http://stackoverflow.com/comment/45936017
type: Answer
answers question: http://stackoverflow.com/q/28833095

http://stackoverflow.com/a/28767744
upvote count: 15
score: 15
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/118303421
accepted answer of: http://stackoverflow.com/q/28767137
has comment: http://stackoverflow.com/comment/67023506
type: Answer
answers question: http://stackoverflow.com/q/28767137
has body: The tooltip is triggered on hover. In your code, it is not being bound to the element until the 'click' event occurs, so it's not really the click causing it to display... it's the hover following the click. I believe what you need to do is use enable and disable. Here is an example fiddle. http://jsfiddle.net/ecropolis/bh4ctmuj/ Anchor text $('a').tooltip({ position: { my: 'center bottom' , at: 'center top-10' }, tooltipClass: "myclass", disabled: true, close: function( event, ui ) { $(this).tooltip('disable'); /* instead of $(this) you could also use $(event.target) */ } }); $('a').on('click', function () { $(this).tooltip('enable').tooltip('open'); });

http://stackoverflow.com/q/28758889
tagged with: javascript
favorite count: 0
score: 0
has answer: http://stackoverflow.com/a/28760013
has body: I have this jsfiddle which hide and show the according to keyword input (#search-criteria). Most are working fine but there is this bug which I am not sure where it is coming from (even after looking at console.log). Problem: when search result should be "0", it shows as "1" example A: keyword="apple", search result="2" example B: keyword="applee", search result="0" example C: keyword="appleee", search result="1" *this should be "0", and there is no row showing but it counts "1"!? NOTE: I append a new row when search is not found but remove it later. $("#search-criteria").on("keyup", function () { var keyword = $(this).val().replace(/[Ａ-Ｚａ-ｚ０-９]/g, function (td_word) { return String.fromCharCode(td_word.charCodeAt(0) - 0xFEE0); }).toLowerCase(); var row = "table#table-body tbody>tr"; if (keyword !== "") { $(row).each(function () { var td_word = $(this).text().toLowerCase(); var srowCount = $(row).filter(":visible").length; //shorthand if function $(this).closest(row)[td_word.indexOf(keyword) !== -1 ? 'show' : 'hide'](); document.getElementById('count').innerHTML = srowCount; console.log(srowCount); if (srowCount === 0) { $("table#table-body tbody").last().append(' Search not found '); $("tr.s_empty").show(); } else { $("tr.s_empty").remove(); } }); } else { $(row).show(); document.getElementById('count').innerHTML = $(row).length; } }); Thank you in advance.
upvote count: 1
downvote count: 1
accepted answer: http://stackoverflow.com/a/28760013
type: AnsweredQuestion
has title: Row count error after filter(with if statement)
has comment: http://stackoverflow.com/comment/45798417
has answer: http://stackoverflow.com/a/28759541
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/28759541

http://stackoverflow.com/comment/81594442
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28779556
type: AnswerComment
has text: Typo on ` request(requestSettings, function(error, response, body) { res.set('Content-Type', 'image/png'); res.send(body); };` no close bracket.

http://stackoverflow.com/q/28883217
answer count: 2
has title: Recover Reference to Browser Window Once Lost?
tagged with: javascript
has body: My software allows users to Chat in a new browser window: chatWindow = window.open(url, "chatWindow"); I can store a reference to this window in a collection and use it as needed. The main thing I do with this reference is checking to prevent more than one chat window from being opened at a time. My question is that once the chatWindow is open, the user can navigate the original browser window to, say, www.google.com. In this case, the chatWindow is still open and chatting fine. My issue is that the user can then return to my application and open another chatwindow, since I have lost my original reference to it. Is there a way to regain this reference once it has been lost? Perhaps referencing the Window by name? Thanks for your help.
score: 0
possible better answer: http://stackoverflow.com/a/28883358
accepted answer: http://stackoverflow.com/a/28883400
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28883358
has answer: http://stackoverflow.com/a/28883400
type: Question

http://stackoverflow.com/q/28823103
tagged with: javascript
tagged with: jsonpath
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/29401072
has title: JSONPath - Flow vs. Goessner
downvote count: 0
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45997333
type: Question
has body: I've got a JSON payload like this: { "food": [ { "sections": [ { "extras": [ { "_id": "test" } ] } ], "stub": "pizza" } ] } That array of food is actually quite long, and I want to filter the array by the value of 'stub'. I was using this JSONPath expression and I swear it was working, but now it appears it isn't? I'm testing it here, and when selecting Flow's JSONPath implementation, it works, but using Goessner's, it's returning just false. $.food[?(@.stub=='pizza')]
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/45945997

http://stackoverflow.com/q/28780657
tagged with: javascript
linked to: http://stackoverflow.com/q/14019341
has title: Tail recursion in javascript
has answer: http://stackoverflow.com/a/53817255
has comment: http://stackoverflow.com/comment/45838456
downvote count: 0
linked to: http://stackoverflow.com/q/3583724
has comment: http://stackoverflow.com/comment/45838648
favorite count: 0
tagged with: tail-recursion
answer count: 4
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/28780765
has comment: http://stackoverflow.com/comment/80061097
possible better answer: http://stackoverflow.com/a/28780857
upvote count: 2
has answer: http://stackoverflow.com/a/28780990
has answer: http://stackoverflow.com/a/28780857
has comment: http://stackoverflow.com/comment/45838452
has comment: http://stackoverflow.com/comment/45838579
type: Question
accepted answer: http://stackoverflow.com/a/28780990
tagged with: recursion
has body: I'm not very experienced in JS. But as most people I sometimes have the need to add some extra functionality to a browser. When looking for answers to other questions I came upon this answer at SO. The answer and the responder are highly upvoted, and by SO standards it means they are pretty reliable. What caught my attention is that in the "neatened up" variation it uses tail recursion to loop the function: (function myLoop (i) { setTimeout(function () { alert('hello'); // your code here if (--i) myLoop(i); // decrement i and call myLoop again if i &gt; 0 }, 3000) })(10); From my perspective this looks like bad engineering. Using recursion to solve non recursive problems in an imperative/OO language is to ask for trouble. Ten or 100 iterations should be safe. But what about 10000 or an infinite loop? In purely functional languages as Erlang and Haskell I know that tail recursions are converted to loops during compile time and will not add an extra frame to the stack. That is as far as I know not the case for all compilers of for example C/C++ or Java. How about JS? Is it safe to use tail recursion there without the risk of an SO? Or will this depend on the actual interpreter the script runs on?
has comment: http://stackoverflow.com/comment/45838727
has comment: http://stackoverflow.com/comment/45838702

http://stackoverflow.com/comment/46044742
has text: Did my best... a little design advice, a little naming advice and a little coding advice.
type: Comment
comment on: http://stackoverflow.com/q/28883295
type: QuestionComment
score: 0

http://stackoverflow.com/comment/46053870
has text: it works thanks, i don't know how i didn't think about a simple solution like this, thanks mate.
comment on: http://stackoverflow.com/a/28897077
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28895555
has answer: http://stackoverflow.com/a/28895958
type: Question
has title: What happends if I set "listenToOnce" triggers multiple times for the same event
answer count: 2
upvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: When using Backbone, if I set same listener in a view multiple times (using listenToOnce), does it create multiple one-time-listeners for that same event, or just override the one? eventThatMightHappenMultipleTimes: function () { this.listenToOnce(this, 'someEvent', this.someEventHandler); }, ... foo: function () { this.trigger('someEvent'); } I want to be sure that I don't leave any useless listeners behind.
possible better answer: http://stackoverflow.com/a/28895958
tagged with: backbone.js
has answer: http://stackoverflow.com/a/28895905
accepted answer: http://stackoverflow.com/a/28895905
downvote count: 0
type: AnsweredQuestion
score: 1

http://stackoverflow.com/comment/46001494
has text: I once ran into an issue where the error was caused by an alert that came up just as `quit()` was executing. I would not actually *see* the alert because everything was happening too fast. I added code to close the alert but then I found that sometimes this code would execute too fast: the alert was created asynchronously but `dismiss()` would sometimes execute before the alert existed. A quick way to *check* whether maybe you're running into a race condition would be to add `time.sleep(<a few seconds>)` just before `driver.switch_to_alert().dismiss()`.
score: 1
comment on: http://stackoverflow.com/q/28862093
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28792825
answers question: http://stackoverflow.com/q/28792640
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45860542
downvote count: 0
type: Answer
has body: You can try to use fopen. if your text from yout post form example : $_POST['nameoftextarea'] you can add on variable. Maybe like this &lt;?php $myfile = fopen("newfile.txt", "w") or die("Unable to open file!"); $txt = $_POST['nameoftextarea']; fwrite($myfile, $txt); fclose($myfile); ?&gt; try to explore with the path of your text result too. here some other example i found to make txt file on php create txt file using php CMIWW

http://stackoverflow.com/comment/45909943
comment on: http://stackoverflow.com/q/28818749
type: Comment
type: QuestionComment
has text: what is selectedDevices?
score: 0

http://stackoverflow.com/a/28814833
answers question: http://stackoverflow.com/q/28814564
has comment: http://stackoverflow.com/comment/45902909
has comment: http://stackoverflow.com/comment/45923524
has comment: http://stackoverflow.com/comment/45904525
score: 0
has body: You are saying the object is { rid : { rid : {} } } it is probably not nested like that. Drop the rid if(restaurantNameArr.length == 1){ return restaurantNameArr[0]; //.rID; } else {
type: Answer
has comment: http://stackoverflow.com/comment/45901787
has comment: http://stackoverflow.com/comment/45901631
has comment: http://stackoverflow.com/comment/45902374

http://stackoverflow.com/q/28871879
has comment: http://stackoverflow.com/comment/46007119
score: 0
has answer: http://stackoverflow.com/a/28872193
accepted answer: http://stackoverflow.com/a/28872193
has body: For example I have enumtype like: "SampleEnum" SampleEnum: { Day: 0, Week: 1, Month: 2 }, But for one spesific stuff, it comes me as string like "SampleEnum" I have to convert it ------> type directly it should be SampleEnum so I can use Enums.SampleEnum. I need this. How can I do ??
has comment: http://stackoverflow.com/comment/46007095
tagged with: typeconverter
type: AnsweredQuestion
has title: How can I convert my string to type for enums?
tagged with: enums
type: Question
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/28840183
tagged with: arcgis
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: css
upvote count: 1
has comment: http://stackoverflow.com/comment/45957389
has title: Get a Class Nested inside multiple Div Tags
has comment: http://stackoverflow.com/comment/45949680
has body: I am trying to get a class called .layerTile, however it is nested inside multiple div tags. The parent div id is mapDiv. The end game is to apply a CSS filter like grayscale to the class. Otherwise other layers in the parent div tag will also render with the grayscale filter applied which is not my intention. I'm using var el = document.querySelector(".layerTile"); which is returning a null value when I pass the variable into Console.log. If I replace the nested class with the parent var el = document.querySelector(".layerTile"); then I can apply my filters but it applies to every child element inside the Div, like the zoom buttons and the watermark in the lower right corner...! CSS Map Tile Filtering Here is a JS Fiddle of my code. Line 99 in the HTML is where I'm struggling....the class is call layerTile. If you open Chrome Developer tools or Firebug the layerTile class will be nested deep inside the mapDiv tag found in the article section of the app.
has comment: http://stackoverflow.com/comment/45958344
tagged with: javascript
tagged with: esri
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45949801
answer count: 0
downvote count: 0
has comment: http://stackoverflow.com/comment/45952087
score: 1
favorite count: 0

http://stackoverflow.com/a/28821919
type: Answer
has comment: http://stackoverflow.com/comment/45915916
answers question: http://stackoverflow.com/q/28821859
score: 0
has body: The line where you do: if (getElementsByClassName("buttons")[1] == "5px blue solid") Should be: if (getElementsByClassName("buttons")[1].style.border == "5px solid blue")

http://stackoverflow.com/comment/45870923
type: Comment
comment on: http://stackoverflow.com/a/28798220
has text: @TravisMichaelHeller - this code does grab all the images.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45906377
score: 0
comment on: http://stackoverflow.com/q/28817084
has text: if class exists remove class attribute and add class attribute after add classes overlay__inner overlayActive clearfix
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28806701
has title: Cannot read property 'jqmData' of undefined
tagged with: jquery-mobile
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/34053471
has body: please your help in my code i want to make select with filter in J Query Mobile i tried the below code and it success to filter the data but when choosing an option it does not return any thing and return this error Cannot read property 'jqmData' of undefined this is the code that i used with the java-script Long list: Alabama Alaska Arizona Arkansas California and this is the java-script ( function( $ ) { function pageIsSelectmenuDialog( page ) { var isDialog = false, id = page && page.attr( "id" ); $( ".filterable-select" ).each( function() { if ( $( this ).attr( "id" ) + "-dialog" === id ) { isDialog = true; return false; } }); return isDialog; } $.mobile.document .on( "selectmenucreate", ".filterable-select", function( event ) { var input, selectmenu = $( event.target ), list = $( "#" + selectmenu.attr( "id" ) + "-menu" ), form = list.jqmData( "filter-form" ); if ( !form ) { input = $( " " ); form = $( " " ).append( input ); input.textinput(); list .before( form ) .jqmData( "filter-form", form ) ; form.jqmData( "listview", list ); } selectmenu .filterable({ input: input, children: "> option[value]" }) .on( "filterablefilter", function() { selectmenu.selectmenu( "refresh" ); }); }) .on( "pagecontainerbeforeshow", function( event, data ) { var listview, form; if ( !pageIsSelectmenuDialog( data.toPage ) ) { return; } listview = data.toPage.find( "ul" ); form = listview.jqmData( "filter-form" ); data.toPage.jqmData( "listview", listview ); listview.before( form ); }) .on( "pagecontainerhide", function( event, data ) { var listview, form; if ( !pageIsSelectmenuDialog( data.toPage ) ) { return; } listview = data.prevPage.jqmData( "listview" ), form = listview.jqmData( "filter-form" ); listview.before( form ); }); })( jQuery );
has answer: http://stackoverflow.com/a/77208673
answer count: 3
downvote count: 0
favorite count: 0
type: UnansweredQuestion
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/45887030
type: Question
has answer: http://stackoverflow.com/a/36631531

http://stackoverflow.com/comment/45926117
score: 3
comment on: http://stackoverflow.com/q/28827941
has text: You know, punctuation characters are not just for writing code.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28767509
type: Question
accepted answer: http://stackoverflow.com/a/28767656
tagged with: c#
tagged with: code-behind
tagged with: javascript
has comment: http://stackoverflow.com/comment/45813883
has comment: http://stackoverflow.com/comment/45814002
has title: Calling a C# method from JavaScript
answer count: 1
tagged with: asp.net
tagged with: ajax
has answer: http://stackoverflow.com/a/28767656
type: AnsweredQuestion
score: 0
linked to: http://stackoverflow.com/q/18610042
has body: I want to to call a method GetAccount from my controller AccountController.cs, in my JavaScript factory LoginFactory.js. Something like this: AccountController.cs: public Account GetAccount(string userName) { ... } LoginFactory.js: if(x&gt;y) { var account = &lt;%AccountController.GetAccount(someParam);%&gt; } I've tried using [WebMethod] and Ajax, but I can't get it to work: I get a 404 response.
has comment: http://stackoverflow.com/comment/45814056

http://stackoverflow.com/comment/46030515
comment on: http://stackoverflow.com/q/28884453
has text: What happens if you remove the `parseHTML` function? Doesn't seem necessary to me.
type: QuestionComment
type: Comment
score: 1

transclusion
type: Tag
tags question: http://stackoverflow.com/q/28843522
tags question: http://stackoverflow.com/q/28871841
tag name: transclusion

http://stackoverflow.com/q/28828972
tagged with: ajax
type: UnansweredQuestion
score: 0
tagged with: java
has comment: http://stackoverflow.com/comment/45928355
has title: I need to make a ajax call from jsp page to struts action class to get some data like name search
type: Question
has comment: http://stackoverflow.com/comment/45928256
tagged with: javascript
has comment: http://stackoverflow.com/comment/45928496
has body: I need to make a ajax call from jsp page to struts action class to get some data like name ,search .I have to show names if and only if thy have entered at least three characters.if the three characters are less than three we don't have to make ajax call.i used autocomplete api for this .i tried by using code: function f1{ var x = document.getElementById("name").value; alert("hey it is inside on change function"); if(x.length&gt;=3){ $( "input#name" ).autocomplete({ source: 'getVehicletrACstatusQuery.status' }); } here it is not calling ajax x.length is showing null i invoked this function onchange() and even i tried with document ready function..but no use please help me out....
has comment: http://stackoverflow.com/comment/45932867
has comment: http://stackoverflow.com/comment/45928216
answer count: 1
tagged with: jsp
has answer: http://stackoverflow.com/a/28829313
tagged with: jquery

http://stackoverflow.com/comment/45907725
has text: for not advocating inline event handling, have my vote!
type: AnswerComment
comment on: http://stackoverflow.com/a/28817965
type: Comment
score: 1

http://stackoverflow.com/comment/47653075
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28891876
has text: @mohoff Have you figured this one out?
score: 0

http://stackoverflow.com/comment/45873331
type: Comment
comment on: http://stackoverflow.com/a/28799035
has text: My mistake, `window.location.hash` includes the hash character. I will edit the answer.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/46051085
comment on: http://stackoverflow.com/a/28813730
type: Comment
has text: I cannot use inverse logic as David show, because declare some modules after return. And module declaration cannot be into if.
score: 0
type: AnswerComment

http://stackoverflow.com/a/28811439
type: Answer
accepted answer of: http://stackoverflow.com/q/28811363
score: 3
has body: You can use min and max values which equate to the ASCII keycodes for A and Z respectively, then use String.fromCharCode() in the slide event to display them. Try this: $("#slider").slider({ min: 65, max: 90, slide: function(event, ui) { $('#display').text(String.fromCharCode(ui.value)); } }); body { margin: 20px; } #display { margin: 20px 0 0; text-align: center; } Alternatively, if you need the values sent to the server to be between 1 and 26, you can amend the ASCII code within the slide func: $("#slider").slider({ min: 1, max: 26, slide: function( event, ui ) { $('#display').text(String.fromCharCode(ui.value + 64)); } });
upvote count: 3
answers question: http://stackoverflow.com/q/28811363
downvote count: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/45861558
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28793130
has text: @K.Toress In your JSFiddle, when I click the button, everything should disappear, since it's all contained in the `ng-if` div. But it's not
score: 0

http://stackoverflow.com/a/28894832
has comment: http://stackoverflow.com/comment/46049914
has comment: http://stackoverflow.com/comment/46059454
has comment: http://stackoverflow.com/comment/46068538
has comment: http://stackoverflow.com/comment/46057845
has body: Just simple check: window.history.pushState(null, null, extra+ ( extra.indexOf("?")&gt;-1 ? "&amp;" : "?" ) +MainElement+'='+ChildElement); Edit: Regexp fixed: var clicked = "[&amp;\\?]"+MainElement+'='+ChildElement; And: var extra = extra.replace(re, ""); // you can replace by regex Edit2: Clean up function childboxes(MainElement, ChildElement){ var extra = window.location.pathname + window.location.search; var regex = new RegExp("[&amp;\\?]"+MainElement+'='+ChildElement, 'g'); extra = extra.replace(regex, ""); extra = extra+ ( extra.indexOf("?") &gt; -1 ? "&amp;" : "?" ) +MainElement+ '=' +ChildElement; window.history.pushState(null, null, extra); } Edit3: replaceState function childboxes(MainElement, ChildElement){ var extra = window.location.pathname + window.location.search; var regex = new RegExp("[&amp;\\?]"+MainElement+'='+ChildElement, 'g'); var isReplace = extra.match(regex); extra = extra.replace(regex, ""); extra = extra+ ( extra.indexOf("?") &gt; -1 ? "&amp;" : "?" ) +MainElement+ '=' +ChildElement; window.history[isReplace?'replaceState':'pushState'](null, null, extra); }
accepted answer of: http://stackoverflow.com/q/28894614
has comment: http://stackoverflow.com/comment/46062455
has comment: http://stackoverflow.com/comment/46068692
has comment: http://stackoverflow.com/comment/46056715
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/28894614

http://stackoverflow.com/comment/46059139
type: QuestionComment
has text: Are you sure hidden jqgrid 'pages' are part of the DOM? update: i quick check tell me they aren't. Now you should tell why would you need that?
comment on: http://stackoverflow.com/q/28899923
score: 0
type: Comment

http://stackoverflow.com/comment/45930237
has text: You will have to submit forms with AJAX if you want two submissions.
comment on: http://stackoverflow.com/q/28830186
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/28819342
has body: Knockout.js is designed for "one global viewmodel for application". You can make root ViewModel, which will handle page routing and loading/initializing child models. Simplest way to do this is to define &lt;div data-bind="template: { name: activePage().template, data: activePage().data } &gt;&lt;/div&gt; in your main html file and create observable with fields template(id of template) and data(child viewmodel) in viewmodel. Or, if you just want to make two "instances" of knockout running at the same time but for different DIVs, you could use ko.applyBindingsToNode or ko.applyBindingAccessorsToNode specifying different HTML elements as containers
score: 1
answers question: http://stackoverflow.com/q/28819190
downvote count: 0
type: Answer
upvote count: 1

http://stackoverflow.com/a/31528490
downvote count: 0
score: 1
has body: You are still using format character in 'as'. 'a' means displaying AM or PM in lowercase format. 's' means displaying seconds. To achieve what you want, escape the 'as' character. So your format should look like: amDateFormat:"DD/MM/YYYY [as] hh:mm" See the reference I also not sure what 'as' means in Thai, perhaps you also want to check the internationalization part.
answers question: http://stackoverflow.com/q/28878766
upvote count: 1
type: Answer

http://stackoverflow.com/comment/46034997
type: QuestionComment
comment on: http://stackoverflow.com/q/28881181
has text: Edit my question with a completely revamped way of doing this. A lot less code but getting a SQL error now for unknown reasons.
type: Comment
score: 0

http://stackoverflow.com/a/28897756
downvote count: 0
answers question: http://stackoverflow.com/q/28897460
has body: Using a timeout with Angular's $timeout service will fix it: function PrintCtrl($scope, $window, $q, $timeout) { $scope.items = [ {Name: "Soap", Price: "25", Quantity: "10"}, {Name: "Shaving cream", Price: "50", Quantity: "15"} ]; $scope.newitems = [ {Name: "Shampoo", Price: "100", Quantity: "5"} ]; $scope.printOverallReport = function () { $scope.items = $scope.newitems; console.log($scope.items.length); $timeout($window.print, 0); console.log($scope.items.length); }; } Fiddle For a comprehensive explanation as to why, please see DVK's answer (2nd one) here: Why is setTimeout(fn, 0) sometimes useful? TL:DR; When you call $window.print() the old HTML is still present since the browser hasn't rendered it yet. It's waiting to finish the javascript function run. setting a $timeout 0 will queue the print at the end of execution queue and will guarantee it happens after the HTML has been rendered. (I still strongly recommend to read his answer)
score: 6
has comment: http://stackoverflow.com/comment/46179696
type: AcceptedAnswer
upvote count: 6
has comment: http://stackoverflow.com/comment/46142474
has comment: http://stackoverflow.com/comment/46140451
type: Answer
accepted answer of: http://stackoverflow.com/q/28897460

http://stackoverflow.com/a/28822233
answers question: http://stackoverflow.com/q/28821739
score: 2
type: AcceptedAnswer
downvote count: 0
has body: Don't use this kind of regex in your routes, use parameters and then use those in your routes, so that in this case you get: app.get("/circle/:r/:x/:y", function(req, res) { var r = req.params.r, x = req.params.x, y = req.params.y, res.json({......}); }); With three parameter handlers: app.param("r", function(req, res, next, r) { if(r does not validate) next(new Error("bad radius")); req.params.r = r; }); app.param("x", function(req, res, next, x) { if(x does not validate) next(new Error("bad x coordinate")); req.params.x = x; }); app.param("y", function(req, res, next, y) { if(y does not validate) next(new Error("bad y coordinate")); req.params.y = y; }); So you handle the validation in your param handlers. Do they not match what they need to be? Call next(err) and let the universal error handler take care of it. If they do match, you automatically fall through to your next middleware, ending in the function that forms the actual response.
type: Answer
accepted answer of: http://stackoverflow.com/q/28821739
upvote count: 2

http://stackoverflow.com/q/28844354
has answer: http://stackoverflow.com/a/28844463
score: 1
upvote count: 1
type: Question
tagged with: javascript
tagged with: mongodb
answer count: 2
downvote count: 0
tagged with: mongoose
favorite count: 0
has answer: http://stackoverflow.com/a/28844466
has title: mongoDB insert and process.nextTick
tagged with: node.js
possible better answer: http://stackoverflow.com/a/28844463
accepted answer: http://stackoverflow.com/a/28844466
type: AnsweredQuestion
has body: I have a list of 50k entries that I am entering into my db. var tickets = [new Ticket(), new Ticket(), ...]; // 50k of them tickets.forEach(function (t, ind){ console.log(ind+1 + '/' + tickets.length); Ticket.findOneAndUpdate({id: t.id}, t, {upsert: true}, function (err, doc){ if (err){ console.log(err); } else { console.log('inserted'); } }); }); Instead of the expected interleaving of 1 / 50000 inserted 2 / 50000 inserted I am getting all of the indices followed by all of the inserted confirmations 1 / 50000 2 / 50000 ... 50000 / 50000 inserted inserted ... inserted I think something is happening with process.nextTick. There is a significant slow down after a few thousand records. Does anyone know how to get the efficient interleaving?

http://stackoverflow.com/a/28847559
has comment: http://stackoverflow.com/comment/45963777
has comment: http://stackoverflow.com/comment/46001606
has body: <?php $sql = "SELECT part_description FROM parts"; $result = mysql_query($sql); echo " "; echo " --Select Part Name-- "; while ($row = mysql_fetch_array($result)) { $op1=$row['part_description']; $op2=$op1.$row['price']; $op3=$op2.$row['weight']; echo " " .$op3 ." "; } echo " "; ?> This is for print three value in single option tag. And let me know Is this your expectation.
upvote count: 1
has comment: http://stackoverflow.com/comment/45965099
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45963354
has comment: http://stackoverflow.com/comment/46101936
has comment: http://stackoverflow.com/comment/46004481
type: Answer
has comment: http://stackoverflow.com/comment/45963949
answers question: http://stackoverflow.com/q/28845753

http://stackoverflow.com/comment/46054712
type: AnswerComment
comment on: http://stackoverflow.com/a/28897501
score: 0
type: Comment
has text: `The method accepts URL, not a local path` While you're correct that a local path is not allowed, the OP is using a relative path which is entirely acceptable, and arguably better for maintenance.

http://stackoverflow.com/comment/45899872
has text: @LShetty 400 ms is there indeed http://jsfiddle.net/Rayjax/fxLf8s62/1/. The timestamp displays between 405 and 415 on my env, so the real show() must take around 15ms max. it's sad to wait 400 ms for nothing. There must be away to trigger the toggleClass just when the display is done. Opacity is not a solution because the div will still be displayed and it will take up some place at the bottom of the page
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28813386
type: Comment

dom
tags question: http://stackoverflow.com/q/28842298
type: Tag
tags question: http://stackoverflow.com/q/28822803
tags question: http://stackoverflow.com/q/28793906
tags question: http://stackoverflow.com/q/28830982
tags question: http://stackoverflow.com/q/28786632
tags question: http://stackoverflow.com/q/28756043
tags question: http://stackoverflow.com/q/28756159
tags question: http://stackoverflow.com/q/28811565
tags question: http://stackoverflow.com/q/28823511
tags question: http://stackoverflow.com/q/28836991
tags question: http://stackoverflow.com/q/28782795
tags question: http://stackoverflow.com/q/28782027
tags question: http://stackoverflow.com/q/28861282
tags question: http://stackoverflow.com/q/28796247
tags question: http://stackoverflow.com/q/28902386
tags question: http://stackoverflow.com/q/28877528
tags question: http://stackoverflow.com/q/28778109
tags question: http://stackoverflow.com/q/28875310
tags question: http://stackoverflow.com/q/28821008
tags question: http://stackoverflow.com/q/28849743
tags question: http://stackoverflow.com/q/28841157
tags question: http://stackoverflow.com/q/28803931
tags question: http://stackoverflow.com/q/28866319
tags question: http://stackoverflow.com/q/28900884
tags question: http://stackoverflow.com/q/28829342
tags question: http://stackoverflow.com/q/28877701
tags question: http://stackoverflow.com/q/28889065
tags question: http://stackoverflow.com/q/28768772
tags question: http://stackoverflow.com/q/28870973
tags question: http://stackoverflow.com/q/28807157
tags question: http://stackoverflow.com/q/28881160
tags question: http://stackoverflow.com/q/28851674
tags question: http://stackoverflow.com/q/28858540
tags question: http://stackoverflow.com/q/28826714
tags question: http://stackoverflow.com/q/28811268
tags question: http://stackoverflow.com/q/28847752
tags question: http://stackoverflow.com/q/28834353
tags question: http://stackoverflow.com/q/28797931
tags question: http://stackoverflow.com/q/28782838
tags question: http://stackoverflow.com/q/28844476
tags question: http://stackoverflow.com/q/28811669
tags question: http://stackoverflow.com/q/28776267
tags question: http://stackoverflow.com/q/28753787
tags question: http://stackoverflow.com/q/28800201
tag name: dom
tags question: http://stackoverflow.com/q/28810745
tags question: http://stackoverflow.com/q/28876947
tags question: http://stackoverflow.com/q/28842210
tags question: http://stackoverflow.com/q/28781169
tags question: http://stackoverflow.com/q/28771542
tags question: http://stackoverflow.com/q/28766468
tags question: http://stackoverflow.com/q/28887211

http://stackoverflow.com/a/28843687
has body: You could something like: <--! place your default form here --> .... The first li will only be shown when the array is empty. In any case you should place the form outside the ng-repeat.
answers question: http://stackoverflow.com/q/28843354
score: 0
type: Answer

http://stackoverflow.com/q/28836580
type: Question
score: 5
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has body: I'm using angular and fullcalendar. I have (surprise) timezone-issues, and I can't seem to get it right. If in the weekview I click on 08.00 hours, I open a modal and show the time, I see 09.00 hours. timezone: "Europe/Brussels", ignoreTimezone: false, This is (atm) a +0100 timezone, and during summer a +0200 timezone The click-event: dayClick: function (date, jsEvent, view) { $scope.newEventDate = date; var modalInstance = $modal.open({ templateUrl: 'newRosterEvent', controller: 'NewEventModalController', backdrop: "true", resolve: { event: function () { return $scope.newEventDate; }, stage: function () { return $scope.stage; } } }); To display the time: stagewebApp.controller('NewEventModalController', ["$scope", "$modalInstance","$filter", "event", "stage", function ($scope, $modalInstance, $filter,event, stage) { $scope.stage = stage; $scope.day = new Date($filter('date')(event._d, "yyyy-MM-dd")); $scope.start = event.toDate(); ....more code.... } In this case $scope.start displays the clicked time +1 So it seems that fullcalendar takes the time I clicked and converts it to the timezone selected, but I would expect it to interpret the clicked time as being in the timezone I selected. Apparently I am tackling this wrong, so what is the correct way to do this? ( $scope.start should show the time I clicked (preferably in my timezone)). Afterwards I send it to the server where it is stored as UTC.
accepted answer: http://stackoverflow.com/a/28867755
has title: Fullcalendar wrong time in on click event
tagged with: angularjs
tagged with: timezone
type: AnsweredQuestion
upvote count: 5
has answer: http://stackoverflow.com/a/28867755
tagged with: fullcalendar

http://stackoverflow.com/q/28838322
tagged with: javascript
has answer: http://stackoverflow.com/a/28838476
answer count: 3
downvote count: 0
favorite count: 0
has title: With javascript, remove all but last object based on value
has body: I have an object. [ { "name":"keith", "skill":"kool", "job" :"rapper" },{ "name":"mike", "skill":"killer", "job" :"rapper" },{ "name":"Alan", "skill":"js", "job" :"slacker" },{ "name":"Dre", "skill":"Dr", "job" :"rapper" },{ "name":"Garth", "skill":"Guitar", "job":"singer" } ] I only need the last object of each job. All other jobs can be deleted. I need to keep the order as well, so the expected object will look like this: [{ "name":"Alan", "skill":"js", "job" :"slacker" },{ "name":"Dre", "skill":"Dr", "job" :"rapper" },{ "name":"Garth", "skill":"Guitar", "job":"singer" } ] The "job" value may be any string, it's unknown. How do I delete all but the last duplicate objects based only on a certain field?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28838606
has comment: http://stackoverflow.com/comment/45946130
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/45946093
type: Question
has answer: http://stackoverflow.com/a/28838741
tagged with: arrays

http://stackoverflow.com/q/28790338
answer count: 1
duplicate of: http://stackoverflow.com/q/1973647
has comment: http://stackoverflow.com/comment/45889156
tagged with: javascript
tagged with: jquery
score: 0
linked to: http://stackoverflow.com/q/1973647
has comment: http://stackoverflow.com/comment/45888980
tagged with: http://stackoverflow.com/tag/html
has body: I need jQuery.js, so because I don't know how to declare an "include" or "require" within my custom.js, I just paste the whole jQuery.js inside my custom.js, above my code. That makes a pretty huge custom.js script and is most likely redundant if the client already has jQuery.js loaded. Is there a way to "include" or "require" jQuery.js at the top of my custom.js? I have never found an single-file answer to referencing one .js file from another .js file. Here is the pseudocode for the functionality sought: Contents of original custom.js: $(document).ready(do stuff); Pseudocode of contents of custom.js modified to test if jQuery.js is loaded, and if not, load it: if !jQuery { includeAndOrLoadEtc jQuery.js; } $(document).ready(do stuff);
favorite count: 0
type: UnansweredQuestion
upvote count: 1
downvote count: 1
has title: How to Include jQuery.js within One's Own .js Before $(document).ready?
has answer: http://stackoverflow.com/a/28815484
type: Question
linked to: http://stackoverflow.com/q/4101394

http://stackoverflow.com/comment/45964192
has text: Thanks @Lepanto: It worked :) But I am not sure why my code should not work..! Can you please explain?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28848124
type: Comment

http://stackoverflow.com/comment/46045208
has text: Can you post the content of sportsStore.js or make a plunker?
comment on: http://stackoverflow.com/a/28892256
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/104599674
type: Comment
comment on: http://stackoverflow.com/a/28827847
has text: It's not just buttons. Any `ng-click` inside label may not work properly. I had one `ng-click` inside `button` and another inside `anchor` tag and both were wrapped by a `label`. Once it is changed to `div`, the click event worked.
score: 0
type: AnswerComment

http://stackoverflow.com/q/28859397
tagged with: filter
has comment: http://stackoverflow.com/comment/45984590
has body: I'm building app using AngularJs and Restangular for REST services. Now I have a form where I must allow user to add o a multiple objects from object list, using select. But every time the user chooses one object from select I need to filter out that object from the list for the next select. I've tried to create a copy of an object array and remove items I've added in previous selects but I can't access $scope.purpose.purpose inside my controller, only in template. Here is my code: HTML: Namjena: {{i}} {{item.name}} Controller: app.controller('AddHardwareCtrl', function HardwareListCtrl($scope, PurposeService, $location, $route, $routeParams) { $scope.purpose = PurposeService.one().get().$object; $scope.hardware = { name: "", description: "", laboratory: "", organization: "", owner: "", purposes: [""], contact_person: "", purchase_value: "", acquisition_date: Date.now() }; $scope.addNewPurpose = function() { $scope.hardware.purposes.push(""); if($scope.hardware.purposes.length == $scope.purpose.purpose.length){ $scope.addMoreDisabled = true; } else{ $scope.addMoreDisabled = false; } }; }); Can somebody please help me? I'm trying to solve this problem for the last 5 days it's driving me crazy.
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45984729
type: UnansweredQuestion
tagged with: restangular
answer count: 0
upvote count: 1
has title: AngularJS: How to filter an object on every loop
downvote count: 1
type: Question
tagged with: javascript
tagged with: controller
score: 0

http://stackoverflow.com/a/28860021
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28859940
has body: Pass it into the function in the reapater, example: $scope.numbers = [1,2,3] $scope.myFunc = function(num) { console.log(num); } And the HTML Click me! {{num}}
answers question: http://stackoverflow.com/q/28859940
has comment: http://stackoverflow.com/comment/45985762
type: Answer
score: 1
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/45978835
type: QuestionComment
comment on: http://stackoverflow.com/q/28855694
type: Comment
score: 0
has text: @user_0: what would be the syntax for that? I'll also try and look google in the mean time

http://stackoverflow.com/a/28867848
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/46166496
has comment: http://stackoverflow.com/comment/46129201
answers question: http://stackoverflow.com/q/28867577
upvote count: 3
downvote count: 1
has comment: http://stackoverflow.com/comment/46120341
has comment: http://stackoverflow.com/comment/46163276
has comment: http://stackoverflow.com/comment/46120455
has body: You can use some JavaScript on the client to get the day and based on this add a certain class to the body or parent element of your choice. It will look something like this (using jQuery for simplicity): var d = new Date(), styleType = d.getDay()%2, //Returns the day of the week (0-6), mod can be changed accordingly based on number of different "themes" you want to support //this is a setup for 2 different themes $body = $('body'); if(styleType === 0){ $body.addClass('inverted'); } else { $body.addClass('not-inverted'); } You can use these classes now to specify CSS selectors to get the styles you want for example: body.inverted .someClass { background: white; } body.not-inverted .someClass { background: black; }

http://stackoverflow.com/comment/100494754
score: 0
has text: Javascript is isomorphic so it run on server too
comment on: http://stackoverflow.com/a/28890818
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/45990547
comment on: http://stackoverflow.com/q/28859363
score: 0
has text: Worked a treat :D Thanks very much @AlvarFinSoftSoome
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46086195
comment on: http://stackoverflow.com/q/28890880
score: 0
type: Comment
type: QuestionComment
has text: @chapinkapa Yes, it's running locally becouse is managed by the editor (TideSDK). The code il simply $jsonString = $_POST('jsonString'); return {};

http://stackoverflow.com/a/28847235
type: Answer
has body: Instead of odd/even combination, you can create your json like below (array of objects) var json = [{"X":"100","Y":"100"},{"X":"200","Y":"200"},{"X":"300","Y":"300"}]; and then process it using loop on it and access proper coordinates. $(json).each(function(i){ var x = json[i].X; var y = json[i].Y; }); If you're using MVC with C# at Server side, you can create that json like below Coordinate class public class Coordinates { public string X { get; set; } public string Y { get; set; } } your controller action code would be something like:- List&lt;Coordinates&gt; lst = new List&lt;Coordinates&gt;(); lst.Add(new Coordinates { X = "100", Y = "100" }); lst.Add(new Coordinates { X = "200", Y = "200" }); lst.Add(new Coordinates { X = "300", Y = "300" }); lst.Add(new Coordinates { X = "400", Y = "400" }); var json = new JavaScriptSerializer().Serialize(lst); ViewBag.Coordinates = json; then in view part, access this json like below; //var json = [{"X":"100","Y":"100"},{"X":"200","Y":"200"},{"X":"300","Y":"300"}]; var json = JSON.parse('@ViewBag.Coordinates');
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/28846682
has comment: http://stackoverflow.com/comment/45963094
downvote count: 0
has comment: http://stackoverflow.com/comment/45963454

http://stackoverflow.com/q/28766887
tagged with: javascript
tagged with: ionic-framework
score: 0
tagged with: google-maps
answer count: 1
has answer: http://stackoverflow.com/a/28767594
accepted answer: http://stackoverflow.com/a/28767594
tagged with: angularjs
has title: Angular refresh after $scope change
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45815703
has body: In my app, I am using google maps API v3 so as to show the info window on a map. Info windows are filled with $scope values. After the map is loaded, the $scope is changed due to an event, however, the content of my info window is still the same. How can I make it refresh? I've already try to call $scope.$apply() at the end of my event callback function but it didn't work. Controller.js this.fillingMethod = function(){ info = MyService.getInformation(); $scope.fillingInfo = info; } this.changeAnInfo = function(){ var info = $scope.fillingInformation; var info = MyService.changeInfo(info); $scope.fillingInformation = info; $scope.$apply(); }//Google InfoWindow is not refreshed. View.html {{fillingInformation}}
type: Question

http://stackoverflow.com/a/28782306
has body: My bet is that your Hamster callback does not trigger a digest. Try using $scope.$apply(): hammer1.wheel(function(event, delta){ $scope.$apply(function () { if (delta &gt; 0) { $scope.zoomOut(); // this function not working } else if (delta &lt; 0) { $scope.zoomIn(); } } });
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28781982
upvote count: 1
type: Answer

http://stackoverflow.com/comment/45914325
type: Comment
type: QuestionComment
has text: this.add() did work, however, looking at the 2nd suggestion.......
comment on: http://stackoverflow.com/q/28821001
score: 0

http://stackoverflow.com/a/28807915
downvote count: 0
answers question: http://stackoverflow.com/q/28807711
type: Answer
score: 1
upvote count: 1
has body: Please can you find closest('.container') like $(document).ready(function(){ $('.rdbtn').click(function(){ $(this).closest('.container').find('.first').show() ; }); }); JSFIDDLE Link check here

http://stackoverflow.com/comment/45924670
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28827055
score: 0
has text: I did go through it, but i didn't find a way to loop though the urls that i have . I might have use JS but i'm not sure about that.

http://stackoverflow.com/comment/45923360
has text: @Jelle add the latest version of jquery file like 1.11`
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28813462
type: Comment

http://stackoverflow.com/q/28896884
has comment: http://stackoverflow.com/comment/46053845
type: Question
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/46053910
tagged with: javascript
has comment: http://stackoverflow.com/comment/46053796
has comment: http://stackoverflow.com/comment/46053645
has answer: http://stackoverflow.com/a/28897073
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/46053607
favorite count: 0
tagged with: angularjs
has title: AngularJS + Angular Strap - How to add dynamic content to modals depending on button clicked?
has comment: http://stackoverflow.com/comment/46053922
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46053449
type: AnsweredQuestion
has body: There is a working jsfiddle that shows table + modal by using AngularJS + AngularStrap (please see external resources in jsFiddle or take a look here for angular-strap modals http://mgcrea.github.io/angular-strap/#/modals) My question is: How to add more dynamic to the buttons? They show static content, right? I need it to show the content of the first column (first name) of exactly the same raw where the button was clicked. What's the best way to do that? Also, the problem is that the rows of the table can be sorted by any column asc or desc so I don't think I can use id attributes. Any ideas? And here is the code: HTML code: {{ person.firstName }} {{ person.lastName }} {{ person.age }} js code: 'use strict'; var app = angular.module('myApp', ['mgcrea.ngStrap']); app.controller('ModalDemoCtrl', function($scope) { $scope.modal = { "title": "only one name of Manuela or Mark or Jane should be displayed here", "content": "only one name of Manuela or Mark or Jane should be displayed here" }; $scope.persons = [ { "firstName": "Manuela", "lastName": "Smith", "age": 44 }, { "firstName": "Mark", "lastName": "Johnson", "age": 25 }, { "firstName": "Jane", "lastName": "Doe", "age": 33 } ]; }); Thank you.
tagged with: twitter-bootstrap-3
accepted answer: http://stackoverflow.com/a/28897073
score: 1
upvote count: 1

http://stackoverflow.com/q/28858382
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
tagged with: css
favorite count: 0
answer count: 0
type: UnansweredQuestion
tagged with: iframe
has title: Getting absolute position of an element in javascript
has body: I am trying to create an overlay effect on mouseover of all elements. I wrote this js code, it works for most of the scenarios and fails under some conditions. JS Code $(function() { var overlay = $("&lt;div id='overlay'&gt;&lt;/div&gt;").css({position:"absolute","display":"none","background":"red"}); $("body").append(overlay); $("body").on("mouseover", function(e) { var t = e.target; var offset = $(t).offset(); var top = offset.top; var left = offset.left; var scrollx = $(window).scrollTop(); var scrolly = $(window).scrollLeft(); top -= scrolly; left -= scrollx; console.log(overlay); overlay.css({"top":top,"left":left,"width":"50px","height":"2px"}); overlay.show(); }); }); JS Fiddle https://fiddle.jshell.net/go2j4fk7/12/show/light/ Failure Conditions Trying to mouseover element inside an iframe. I use $("iframe").contents().mouseover() to bind event. If parent element has scroll If element is in fixed position. How to create an overlay for any element?
type: Question
has comment: http://stackoverflow.com/comment/45983297
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45988516
score: 0

http://stackoverflow.com/a/29057070
downvote count: 1
has comment: http://stackoverflow.com/comment/46571727
has comment: http://stackoverflow.com/comment/46615108
upvote count: 0
has comment: http://stackoverflow.com/comment/46614194
has comment: http://stackoverflow.com/comment/46531443
answers question: http://stackoverflow.com/q/28795228
has comment: http://stackoverflow.com/comment/46656401
has comment: http://stackoverflow.com/comment/46536034
has comment: http://stackoverflow.com/comment/46614142
has body: Other items are stealing focus after you set it... Try this: window.onload = function() { document.getElementById('twotabsearchtextbox').focus() };
type: Answer
has comment: http://stackoverflow.com/comment/46535993
score: -1

http://stackoverflow.com/comment/112493883
score: 0
has text: The inspector example now generates error messages.
type: AnswerComment
comment on: http://stackoverflow.com/a/28800008
type: Comment

http://stackoverflow.com/q/28866374
type: Question
score: 1
has answer: http://stackoverflow.com/a/28866481
has title: ng-show doesnt hide my element when value is set to false
has answer: http://stackoverflow.com/a/28866422
answer count: 3
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: scope
tagged with: angularjs
tagged with: ng-show
has body: I am working on a web page that shows a certain piece of text and then hides it. The show part is working, the hide part is not: HTML Upload Complete Javascript $http.post('/rest/upload-data', {msg:'hello word!'}). success(function(data, status, headers, config) { console.log(data + " " + status) $scope.uploadInProgress = false; $scope.uploadComplete = true; setTimeout(function() {$scope.uploadComplete = false; console.log($scope.uploadComplete);}, 3000); }). error(function(data, status, headers, config) { console.log(data + " " + status) $scope.uploadInProgress = false; $scope.uploadFailed = true; setTimeout(function() {$scope.uploadFailed = false}, 3000); }); The label shows up correctly upon requesting the endpoint, but it never goes away. The console logs the set of the variable to false. What am I doing wrong?
accepted answer: http://stackoverflow.com/a/28866422
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28866468
has answer: http://stackoverflow.com/a/28866468
upvote count: 1

http://stackoverflow.com/a/28842366
upvote count: 1
has body: You need to get he data from the result, like: $row = $result-&gt;fetch_assoc() Also, yes, Jim G is right, you need to escape that POST variable.
has comment: http://stackoverflow.com/comment/45953852
has comment: http://stackoverflow.com/comment/45953959
has comment: http://stackoverflow.com/comment/45954284
has comment: http://stackoverflow.com/comment/45957584
downvote count: 0
has comment: http://stackoverflow.com/comment/45954015
type: Answer
has comment: http://stackoverflow.com/comment/45954687
score: 1
answers question: http://stackoverflow.com/q/28842092

http://stackoverflow.com/q/28766834
tagged with: ng-pattern
tagged with: javascript
has body: Is there any pattern that will allow only '-' in the input text box and deny entering other special characters like @, #, $ etc.I tried with the pattern ng-pattern="/^[a-zA-Z0-9]*$/" which will deny all special characters from being entered in the field. Special Characters are not allowed
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28766883
downvote count: 0
favorite count: 0
has title: ng pattern for allowing only '-' in input text box
tagged with: angularjs
type: Question
accepted answer: http://stackoverflow.com/a/28766883
upvote count: 2
tagged with: forms
answer count: 1

http://stackoverflow.com/q/28756043
tagged with: dom
type: Question
score: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/28756107
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28756094
duplicate of: http://stackoverflow.com/q/6026645
has body: Is always the code written at the bottom of the doc executed after the DOM ready ? Is listening to the ready event of the document Equivalent to writing the code at the bottom of the document ?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28756058
has title: Is always the code written at the bottom of the doc executed after the DOM ready?
linked to: http://stackoverflow.com/q/6026645
has comment: http://stackoverflow.com/comment/45793315
tagged with: javascript

http://stackoverflow.com/comment/45995229
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28864954
type: Comment
has text: Ah! Dang, I really do need to get some coffee. Thanks @FelixKling

http://stackoverflow.com/comment/45792167
type: QuestionComment
comment on: http://stackoverflow.com/q/28755287
has text: Done and working. Thank you
score: 0
type: Comment

http://stackoverflow.com/comment/45938743
comment on: http://stackoverflow.com/q/28834622
has text: possible duplicate of [JavaScript checking for null vs. undefined and difference between == and ===](http://stackoverflow.com/questions/5101948/javascript-checking-for-null-vs-undefined-and-difference-between-and)
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28878053
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: how to check that click event done by mouse Scroll click while form submit?
has comment: http://stackoverflow.com/comment/46018222
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
type: Question
has answer: http://stackoverflow.com/a/28878100
score: 1
has body: In my simple form, js_submit_loading is assigned to &lt;form&gt; and btn-loading is assigned to SEND &lt;button&gt; Here is my js code: $('.js_submit_loading').on('submit',function (){ $(this).find('#btn-loading').button('loading'); }); Now, how can i detect that button was clicked by left mouse button or scroll button i only know that which==2 stands for scroll click. thanks in adv. for help

http://stackoverflow.com/a/28818454
type: Answer
answers question: http://stackoverflow.com/q/28816374
has comment: http://stackoverflow.com/comment/46204243
has body: You won't be able to dynamically change the manifest once the extension has been installed. Per Google https://developer.chrome.com/extensions/contentSecurityPolicy#relaxing-remote-script : Generic wildcards such as https:, https://* and https://.com are not allowed; subdomain wildcards such as https://.example.com are allowed. If you could ensure that the CI machines are all on same domain then it could work.
has comment: http://stackoverflow.com/comment/46036922
score: 0

http://stackoverflow.com/a/28762247
has body: Add disabled attribute to email and enable/disable on name keyup HTML First Name Email address Submit jQuery $(function () { $('input.name').keyup(function () { if ($(this).val()) { $('input.email').removeAttr('disabled'); } else { $('input.email').attr('disabled', true); } }); }); Fiddle http://jsfiddle.net/m2h5fc9b/
answers question: http://stackoverflow.com/q/28762071
score: 0
has comment: http://stackoverflow.com/comment/45804311
has comment: http://stackoverflow.com/comment/45806142
type: Answer
has comment: http://stackoverflow.com/comment/45804042
has comment: http://stackoverflow.com/comment/45804080

http://stackoverflow.com/q/28781212
tagged with: jsp
has comment: http://stackoverflow.com/comment/45840003
tagged with: jquery
has title: Could not able to get jsp table row values from one page and display the values in text box of another page
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45839918
answer count: 0
has comment: http://stackoverflow.com/comment/45851421
tagged with: java
has body: I need to get the values from my rows inside the table of a jsp page and display it in textbox of another jsp page i tried to do but i could manage to just call my another page but could not able to get the values from one page to another My Jquery $('tr').click(function () { $('tr').removeClass('selected'); $(this).addClass('selected'); selectedRow = $(this); }); $("tr").dblclick(function () { var td = $(selectedRow).children('td'); for (var i = 0; i < td.length; ++i) { /* alert(i + ': ' + td[i].innerText); */ } var customer =td[0].innerText alert('customer :' +customer); window.location = "InternalConversion.jsp?customer="+customer; }); JSP page Branch City Country Branch Number Entity Type <% BranchSearch b1= null; int rownum = 1; Iterator<BranchSearch> i = l1.iterator(); while (i.hasNext()) { b1 = (BranchSearch)i.next(); String rowStyle = "TIRowAlt"; if (rownum % 2 == 0) { rowStyle = "TIRow"; } else { rowStyle = "TIRowAlt"; } %> <tr class="link1 <%=rowStyle%>" onclick="click()"> <%=b1.getBranch()%> <%=b1.getCity()%> <%=b1.getCountry()%> <%=b1.getBranchnumber()%> <%=b1.getEntitytype()%> <% rownum++; } %>
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45839698
score: 0

http://stackoverflow.com/comment/46062708
score: 2
comment on: http://stackoverflow.com/q/28901687
type: Comment
type: QuestionComment
has text: Probably related: http://stackoverflow.com/questions/10863092/why-is-string-11-less-than-string-3

http://stackoverflow.com/a/28902425
type: Answer
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28902344
answers question: http://stackoverflow.com/q/28902344
upvote count: 2
type: AcceptedAnswer
has body: The main problem is here: arg.pop(elm); pop removes the last element in the array and doesn't take any arguments. You may have meant: arg.splice(j, 1); ...but then you need to not increment j if you do that. So that gives us: function uniqueObjects() { var seen = []; for (var i=0; i&lt;arguments.length; i++) { var arg = arguments[i]; var j = 0; // ** while (j&lt;arg.length) { // ** Made this a while loop var elm = arg[j]; var key = elm['id']; if (seen.indexOf(key) &gt; -1) { arg.splice(j, 1); // ** Remove this entry } else { seen.push(key); ++j; // ** Increment j } } } return arguments; } However, there is a much more efficient way to track which id values you've seen: Using an object: function uniqueObjects() { var seen = {}; for (var i=0; i&lt;arguments.length; i++) { var arg = arguments[i]; var j = 0; while (j&lt;arg.length) { var elm = arg[j]; var key = " " + elm['id']; // ** Note the space if (seen[key]) { // ** Updated check arg.splice(j, 1); } else { seen[key] = true; // ** Set the flag ++j; } } } return arguments; } Why put the space before the id when creating key? On the off-chance that you have id values with names that exist on objects, like toString or valueOf. (ES6 will introduce Map objects and we won't have to do that anymore.) I'd also recommend not returning the pseudo-array arguments, but instead using a real array. So: function uniqueObjects() { var seen = {}; var args = Array.prototype.slice.call(arguments, 0); // &lt;== Make real array for (var i=0; i&lt;args.length; i++) { var arg = args[i]; var j = 0; while (j&lt;arg.length) { var elm = arg[j]; var key = " " + elm['id']; // ** Note the space if (seen[key]) { // ** Updated check arg.splice(j, 1); } else { seen[key] = true; // ** Set the flag ++j; } } } return args; } Live Example: function uniqueObjects() { var seen = {}; var args = Array.prototype.slice.call(arguments, 0); for (var i=0; i&lt;args.length; i++) { var arg = args[i]; var j = 0; while (j&lt;arg.length) { var elm = arg[j]; var key …

http://stackoverflow.com/a/28848213
has comment: http://stackoverflow.com/comment/45964538
type: Answer
answers question: http://stackoverflow.com/q/28848180
has comment: http://stackoverflow.com/comment/45964329
has body: Just replace * with .* to match zero or more characters in regex. Or .+ to match one or more characters. And also add anchors, because SEARC*2*6 glob pattern will match the strings only if it's starts with SEARC, so we need to use a starting anchor ^ here. SEARC*2*6 - ^SEARC.*2.*6$ SEARC*9* - ^SEARC.*9.* *123* - .*123.* *834 - .*834$ SE.ARC*2*6 - ^SE\.ARC.*2.*6$ ?E.ARC*2*6 - ^.E\.ARC.*2.*6$
has comment: http://stackoverflow.com/comment/45964467
downvote count: 0
score: 8
upvote count: 8

http://stackoverflow.com/a/51161024
downvote count: 2
score: 6
has comment: http://stackoverflow.com/comment/109407353
has body: The pure JS solutions are nice. But if your project is set up via npm, you can also use Lodash or Underscore. In many cases those are already sub-dependencies so no extra weight is incurred. Combining ES6 and _.orderBy provided by lodash _.orderBy(champions, [c =&gt; c.level], ['desc']).slice(0,3) This is a powerful little utility. You can provide multiple tie-breaking sort keys to orderBy, and specify an order for each individually.
upvote count: 8
type: Answer
has comment: http://stackoverflow.com/comment/90787852
answers question: http://stackoverflow.com/q/28853686

http://stackoverflow.com/a/28757492
upvote count: 1
answers question: http://stackoverflow.com/q/28757441
score: 1
has body: I problem that is there is this inside the click handler is not the same as the clicked button var approved = false; $('.confirm').on('click', function (e) { var type = $(this).attr("data-confirm"), //use a closure variable since `this` inside the confirm callback is not the button $this = $(this); if (approved === false) { bootbox.confirm("Are you sure would like to " + type + "?", function (result) { if (result) { approved = true; $this.trigger('click'); } }); e.preventDefault(); } }); Note: This still may not work in all cases. ie if the original click had an default action like anchor element click that may not trigger, also if there is another click handler registered that may will get still triggered.
downvote count: 0
type: Answer

http://stackoverflow.com/q/28770086
type: UnansweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/45818853
has comment: http://stackoverflow.com/comment/45819198
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/42410630
answer count: 2
has comment: http://stackoverflow.com/comment/45841466
has comment: http://stackoverflow.com/comment/45819036
upvote count: 3
has comment: http://stackoverflow.com/comment/45819642
has comment: http://stackoverflow.com/comment/46035143
linked to: http://stackoverflow.com/q/20577007
has answer: http://stackoverflow.com/a/28886849
tagged with: internet-explorer
has body: Hi Im trying to preview image before uploading using &lt;Input&gt; but gives me error on FileReader(). I thought it is supported on the IE10? function PreviewImage() { var oFReader = new FileReader(); oFReader.readAsDataURL(document.getElementById("uploadImage").files[0]); oFReader.onload = function (oFREvent) { document.getElementById("uploadPreview").src = oFREvent.target.result; }; };
downvote count: 0
tagged with: javascript
has title: line: 654 error: 'FileReader' is undefined internet explorer 10

http://stackoverflow.com/a/28870121
answers question: http://stackoverflow.com/q/28869882
type: Answer
score: 0
has body: What you are returning is simply a plain object from JS now go back and log the real jQuery, It's returning the object of the self that helps in chaining. so you need to wrap the object in your context. that's all.

http://stackoverflow.com/comment/45893999
has text: is options a Backbone Collection because it looks like it is trying to go through the listening methods that a collection view setups by default on the collection and failing because the object is not a backbone collection
comment on: http://stackoverflow.com/q/28801155
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46069710
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28904875
has text: @FelixKling ohh, sorry, totally misunderstood that. SeanO Thanks. I'll keep remember that from next time
type: Comment

http://stackoverflow.com/comment/45793858
has text: ok what have you tried already?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28756176
score: 0

http://stackoverflow.com/comment/46214882
comment on: http://stackoverflow.com/a/28981811
type: Comment
has text: If you look in their guides, then they show as an example that you should use cordova.file.dataDirectory (http://ngcordova.com/docs/plugins/file/)
score: 0
type: AnswerComment

http://stackoverflow.com/q/28866144
favorite count: 0
tagged with: promise
has answer: http://stackoverflow.com/a/28943960
tagged with: parse-platform
linked to: http://stackoverflow.com/q/28523313
has title: beforeSave causes Queries to return nothing
accepted answer: http://stackoverflow.com/a/28943960
type: AnsweredQuestion
upvote count: 3
type: Question
has comment: http://stackoverflow.com/comment/46069717
tagged with: javascript
tagged with: parse-cloud-code
has body: I have a cloud function that takes in a request and creates objects as well as associates them in a chain of promises. Without a beforeSave this function works fine but the beforeSave exists to prevent duplicate entries of email addresses in the Email Class. REQUEST { "projectDescription": "Testing saveProject", "projectTitle": "This is only a test, in the event of a real post this will have an actual description", "isEmailEnabled": true, "shareEmails": [ "test1@gmail.com", "test2@gmail.com", "test3@gmail.com" ], "userId": "1234" } FUNCTION Parse.Cloud.define("saveProject", function(request, response) { var emails = request.params.shareEmails; var user = request.params.userId; var projectDescription = request.params.projectDescription; var projectTitle = request.params.projectTitle; var emailStatus = request.params.isEmailEnabled; var ProjectClass = Parse.Object.extend("Project"); var EmailsClass = Parse.Object.extend("Email"); var EmailsClassAssignment = Parse.Object.extend("EmailAssignment"); var project = new ProjectClass(); var projectO; var emailQueryArray; project.set("title", projectTitle); project.set("createdBy", { "__type": "Pointer", "className": "_User", "objectId": user }); project.set("description", projectDescription); project.set("status", true); project.set("emailShareEnabled", emailStatus); project.save().then(function(projectObject) { projectO = projectObject; }).then(function() { emails.forEach(function(emailAddress) { var email = new EmailsClass(); email.set("address", emailAddress); email.save(); }); }).then(function() { emails.forEach(function(emailQuery) { var queryEmail = new Parse.Query("Email"); queryEmail.equalTo("address", emailQuery); queryEmail.find().then(function(results) { emailObject = results; console.log(emailObject); }); }); }); }); beforeSave Code Parse.Cloud.beforeSave("Email", function(request, response) { var query = new Parse.Query("Email"); // Gets the email key value (string) before object is saved query.equalTo("address"…
score: 3
has comment: http://stackoverflow.com/comment/45997482
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/46139761

http://stackoverflow.com/comment/45913876
type: Comment
comment on: http://stackoverflow.com/a/28820927
has text: OMG! You are amazing thank you so much! I'm so happy! I'm just a designer so js is not my thing! But could you help me with the different color filling "onComplete" ?
type: AnswerComment
score: 0

http://stackoverflow.com/q/28756968
type: Question
tagged with: javascript
tagged with: express
upvote count: 2
answer count: 3
downvote count: 0
tagged with: jquery
has title: router.get('/') on expressjs not working
favorite count: 0
type: UnansweredQuestion
has body: i can't access to my express application's home page by '/' route pattern. it's working on /index e.g. My express version is 4.6. I tried app.use('/*', router), but my application is not responding or 503 service temporarily unavailable. It's now working by '/index' pattern and other routes is working correctly. only '/' pattern is not working. :) Here is my code snippet. var http = require('http'); var express = require('express'); var app = express(); var router = express.Router(); app.use('/', router); app.set('view engine', 'ejs'); app.set('views', './views'); app.use(express.static('./public')); var bodyParser = require("body-parser"); app.use(bodyParser()); var fs = require('fs'); var clientSessions = require("client-sessions"); var form = require('express-form'); var field = form.field; var sha1 = require('sha1'); var mysql = require('mysql'); var connection = mysql.createConnection({ host: process.env.OPENSHIFT_MYSQL_DB_HOST, port: process.env.OPENSHIFT_MYSQL_DB_PORT, user: process.env.OPENSHIFT_MYSQL_DB_USERNAME, password: process.env.OPENSHIFT_MYSQL_DB_PASSWORD, database: process.env.OPENSHIFT_GEAR_NAME }); var multer = require('multer'); var done = false; app.use(clientSessions({ secret: 'xxxxx' })); app.use(function(req, res) { res.status(400); res.render('pages/404'); }); // Handle 500 app.use(function(error, req, res, next) { res.status(500); res.render('pages/500'); }); //--- app.use(multer({ dest: 'public/uploads/', rename: function(fieldname, filename) { return filename + Date.now(); }, onFileUploadStart: function(file) { console.log(file.originalname + ' is starting ...') }, onFileUploadComplete: function(file) { console.log(file.fieldname + ' uploaded to ' + file.path) done = true; } })); //// --------------- start app routes --------------// // ----- GET ----- router.get('/', function() { // THIS PATTERN IS NOT WORKING console.log('hello world'); // this line is not working connection.query(strQuery, function(err, rows) { // res.render('pages/ind…
tagged with: node.js
has answer: http://stackoverflow.com/a/28758805
has answer: http://stackoverflow.com/a/28757249
score: 2
has answer: http://stackoverflow.com/a/28762001

http://stackoverflow.com/comment/46053915
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28895943
has text: A better method is to get rid of `onkeyup="autocomplet()"` and replace the `function autocomplet() {` with `$('#Name').on('keyup', function() {`

http://stackoverflow.com/comment/45930085
comment on: http://stackoverflow.com/q/28829578
type: Comment
has text: what exactly you're trying to do with the youtube playlist?
type: QuestionComment
score: 0

http://stackoverflow.com/q/28775318
downvote count: 1
has body: I have a mildly transparent sticky footer that I've taken from CSS bootstrap and I was wondering how to make specific properties within various css selectors have values that make them opacity=0 or similar, (i.e., so that they are hidden) when the transparent sticky footer floats over. Is there a tried and tested method for this...? Perhaps a javascript method...? I was perhaps thinking we could select the sticky-bar class: .sticky-bar {} And then implement what classes it can hide when over, hypothetically "something" like: .sticky-bar: over { hide: .class_1, .class_2; } I'm just not sure on the variables or if such variables even exist! If someone could point me in the right direction or give me a started for 10 that would be much appreciated. .border { border: 1px solid #000000; height: 3000px; } .sticky-bar { background: #000000; bottom: 0; color: #D3D3D3; font-weight: 300; left: 0; margin: 0; opacity: 0.9; padding: 0em; position: fixed; width: 100%; z-index: 99999; } .sticky-bar-inner { margin: 0 auto; text-align: center; width: 100%; background-color: #D3D3D3; padding: 3px; font-family: 'Roboto', sans-serif; font-size: 11px; color: #000000; } .sticky-bar-inner p { margin: 0 auto; padding: 3px; text-align: center; width: 100%; font-size: 11px; } #footerlist { padding-left: 0; } #footerlist li { display: inline; list-style-type: none; } &lt;!-- Border --&gt; &lt;div class="border"&gt;&lt;/div&gt; &lt;!-- Footer --&gt; &lt;div class="sticky-bar"&gt; &lt;div class="sticky-bar-inner"&gt; &lt;p&gt;&amp;#169;2015 The astrobox.io Project &lt;p&gt; &lt;ul id="footerlist"&gt; &lt;li class="social"&gt; &lt;a href="https://twitter.com/astroboxio"&gt; &lt;img src="https://dl-web.dropbox.com/get/astroboxio_twitter_circle_black-512.png?_subject_uid=209608449&amp;w=AABCg-2Bh2udLb-vzQz3ryyFfhfEAOtcU2apWFBOG6GHlw" height="42" width="42"&gt;&lt;/img&gt; &lt;/a&gt; &lt;/li&gt; &lt;li class="social"&gt; &lt;a href="https://github.com/astroboxio"&gt; &lt;img src="https://dl-web.dro…
has comment: http://stackoverflow.com/comment/45864373
score: 1
type: Question
has comment: http://stackoverflow.com/comment/46109986
answer count: 1
tagged with: javascript
tagged with: sticky-footer
has comment: http://stackoverflow.com/comment/45843577
favorite count: 0
has comment: http://stackoverflow.com/comment/45843582
has title: How to make certain objects hidden when CSS Sticky footer bar floats over
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45829238
tagged with: css
has comment: http://stackoverflow.com/comment/45864311
has answer: http://stackoverflow.com/a/28795442
has comment: http://stackoverflow.com/comment/45840617
has comment: http://stackoverflow.com/comment/45864957
upvote count: 2
tagged with: twitter-bootstrap
type: UnansweredQuestion

http://stackoverflow.com/q/28800643
has title: How would I activate a modal using JavaScript only for Mobile Browsers?
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28800689
linked to: http://stackoverflow.com/q/11381673
tagged with: javascript
type: AnsweredQuestion
tagged with: jquery
has body: OK So I need to detect if someone is using mobile and then politely ask them to rotate the screen so that it is a landscape window, not a vertical one. I found this answer for detecting a mobile browser. Using Bootstrap, I would like to make a modal appear for to tell them to rotate the screen. I also found this from the Bootstrap JavaScript guides: &lt;button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal"&gt; Launch demo modal &lt;/button&gt; As you can see they use data-toggle="modal" data-target="#myModal" to call forth the modal. How would I go about implementing that so it runs when a Javascript value is returned? Something like if ( mobile == 1 ) { // open modal else { // ignore modal (do nothing) } would suffice for the detection, but how would I go about the //open modal part? jQuery can be used as well, if that helps anyone (removes some restrictions). Thanks!
accepted answer: http://stackoverflow.com/a/28800689
type: Question
tagged with: twitter-bootstrap

http://stackoverflow.com/comment/45905098
has text: Not all images, I'll have one main image on the page. When you click that one image, it'll run fancybox-thumb to show there are other images. similar to what is here: http://jsfiddle.net/uZCC6/ but that doesn't even work :/
score: 0
comment on: http://stackoverflow.com/q/28816495
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28822329
tagged with: visualforce
tagged with: salesforce
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: In my Salesforce record, I have an object that has a picklist called "Type" with 3 options: Alpha, Beta, Charlie. In a custom Visualforce page, I want to have: Alpha Sample Text Sample Text Sample Text Sample Text ALPHA button/link Beta Sample Text Sample Text Sample Text Sample Text BETA button/link Charlie Sample Text Sample Text Sample Text Sample Text CHARLIE button/link where each of the "button/link" sections is a separate HTML button or can be an anchor link. Is there a way so that if I click on one of these buttons/links I can have it update (quicksave) "Type" with the corresponding value? Note: At the top of the page I have an apex:inputField tag for the picklist and a "quicksave" button already. I just want to also be able to update it with these potential buttons/links. The only way I can think of to do it is to use JavaScript to simulate picking an option from the generated dropdown list and simulating a buttonclick of "quicksave" which seems rather gimmicky.
type: UnansweredQuestion
has title: Assigning an HTML link/button in visualforce to update field
has answer: http://stackoverflow.com/a/28836708
type: Question
tagged with: apex

http://stackoverflow.com/a/34274441
upvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28821178
has body: It doesnt work because the OBJMTLLoader creates a Three.Group The Group does not have a raycaster.intersectObjects (I just finished tracing it down and it went to a non implemented function This REALLY limits the the use of OBJ objects. I have tried JSON but since you can not load materials and have to create UVmap I find that I need a person that can 3D model or not be able to use the intersectObjects. Not sure if this is a bug
downvote count: 1
score: -1

http://stackoverflow.com/a/28825536
answers question: http://stackoverflow.com/q/28822557
upvote count: 2
downvote count: 0
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/45989389
has body: As stated earlier it just simply is not possible to have the aggregation framework generate arbitrary key names from data. It's also not possible to do this kind of analysis in a single query. But there is a general approach to doing this over your whole collection for an undetermined number of tag names. Essentially you are going to need to get a distinct list of the "tags" and process another query for each distinct value to get the "siblings" to that tag and the counts. In general: // Get a the unique tags db.collection.aggregate([ { "$unwind": "$tags" }, { "$group": { "_id": "$tags.tagname" }} ]).forEach(function(tag) { var tagDoc = { }; tagDoc[tag._id] = {}; // Get the siblings count for that tag db.collection.aggregate([ { "$match": { "tags.tagname": tag._id } }, { "$unwind": "$tags" }, { "$match": { "tags.tagname": { "$ne": tag._id } } }, { "$group": { "_id": "$tags.tagname", "count": { "$sum": 1 } }} ]).forEach(function(sibling) { // Set the value in the master document tagDoc[tag._id][sibling._id] = sibling.count; }); // Just emitting for example purposes in some way printjson(tagDoc); }); The aggregation framework can return a cursor in releases since MongoDB 2.6, so even with a large number of tags this can work in an efficient way. So that's the way you would handle this, but there really is no way to have this happen in a single query. For a shorter run time you might look at frameworks that allow many queries to be run in parallel either combining the results or emitting to a stream.
has comment: http://stackoverflow.com/comment/45998611

http://stackoverflow.com/q/28841643
tagged with: javascript
has title: Type safety between JS and iOS
has body: Right now we have javascript application that gets pulled into a WKWebView. This application fires out messages via events. We wrote an intermediary layer that listens for those events, does some parsing and delivers the result to iOS to do some native work. This works pretty well; however, we are a little worried (and have already seen) type safety issues arise. If the JS API changes then iOS needs to adapt and there is no contract in place really to confirm everything will remain working. We came up with 2 ideas: more unit tests to enforce the contract using some sort of protocol buffer type strategy to ensure schema Is there a better way? Is there a good protocol buffer example that does something like this?
upvote count: 1
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45953456
tagged with: protocol-buffers
has comment: http://stackoverflow.com/comment/45952948
type: UnansweredQuestion
downvote count: 0
score: 1
tagged with: hybrid-mobile-app
type: Question
has answer: http://stackoverflow.com/a/28842726
tagged with: ios

http://stackoverflow.com/a/28815035
answers question: http://stackoverflow.com/q/28814960
upvote count: 3
type: AcceptedAnswer
type: Answer
score: 3
downvote count: 0
has body: The buttons don't exist when your code runs, wrap the code in a ready handler so they exist when it does run. JSfiddle does this automatically for you ... see the option onload selected in dropdown at top left $(function(){ /* your code here */ });
accepted answer of: http://stackoverflow.com/q/28814960

http://stackoverflow.com/a/28797650
has comment: http://stackoverflow.com/comment/45872214
type: Answer
has comment: http://stackoverflow.com/comment/45872077
has comment: http://stackoverflow.com/comment/45872019
answers question: http://stackoverflow.com/q/28795681
has body: I had a similar issue with nginx running in front of node, and it was because proxy_read_timeout and proxy_send_timeout were set too low. Socket.io sends heartbeats every 25 seconds, so make sure you set those timeouts to something greater than 25s.
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28795681
has comment: http://stackoverflow.com/comment/45872463
has comment: http://stackoverflow.com/comment/106305865
upvote count: 2
has comment: http://stackoverflow.com/comment/45872158
type: AcceptedAnswer

http://stackoverflow.com/comment/45827794
has text: Thanks. I tried the following http://pastebin.com/6zMr2ZZs, but keep getting the following error message `Uncaught TypeError: Cannot set property '0' of undefined` at `journey.waypointsArrayItem[i] = waypointsArray[i] + ", Windy City";`. Any idea what could be causing it? My code looks fine. I must be missing something obvious *covers face*
type: Comment
comment on: http://stackoverflow.com/a/28774616
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46031310
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28884846
has text: not sure, but I am using ntwitter, express and nodejs. I created a developer account with twitter and I have my credentials in a .js file as well. I am just not sure how to convert the ids into usernames
score: 0

http://stackoverflow.com/q/28871841
type: Question
tagged with: transclusion
tagged with: javascript
has body: How are parent controller scope variables updated from within a transcluded directive scope's function? I am embedding directives into another directive using a transclusion in the following manner: The code for my-table and my-getter-button follows: my-table template: my-table directive: .directive('myTable', function () { return { transclude: true, restrict: 'E', templateUrl: 'views/mytable.html', scope: false }; }); my-getter-button directive (with template): app.directive('myGetterButton', function () { function link(scope, element) { scope.finalizeGet = function () { var id = element.parent().data('id'); scope.clear(); // <-- works fine (from parent controller) scope.get(id) // <-- works fine (from parent controller) .success(function (data) { // The line below was supposed to // update the variables within the parent controller: scope.$parent.instance = data; // or scope.instance = data; angular.element('#detailsModal').modal('show'); }) .error(function (data) { scope.errors = data; }); }; }; return { restrict: 'E', template: ' ' + '' + ' ', scope: false, link: link }; }); I was expecting scope.$parent.instance = data; // or scope.instance = data; to change the parent controller's scope.instance but it did not.
score: 0
tagged with: angularjs-ng-transclude
answer count: 1
accepted answer: http://stackoverflow.com/a/28873497
has title: AngularJS - Updating variables within the parent controller scope from a function in a transcluded directive scope
tagged with: angularjs
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28873497

http://stackoverflow.com/comment/45851349
score: 0
type: AnswerComment
type: Comment
has text: What's `makePromise()`?
comment on: http://stackoverflow.com/a/28752842

http://stackoverflow.com/a/73683319
has body: For Node.js This will use the jsdom library, since node.js doesn't have dom features as in browser. import * as jsdom from "jsdom"; const html = " Testing "; const text = new jsdom.JSDOM(html).window.document.textContent; console.log(text);
type: Answer
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/28899298
downvote count: 0

http://stackoverflow.com/a/28771687
score: 2
has comment: http://stackoverflow.com/comment/45823494
downvote count: 0
has body: Since your back button is used to go back to the previous page, you can use Javascript to accomplish this. (history.go(-1)) Back
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45822097
answers question: http://stackoverflow.com/q/28771591
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28771591
has comment: http://stackoverflow.com/comment/45822517
type: Answer
has comment: http://stackoverflow.com/comment/45823347

http://stackoverflow.com/q/28859926
type: UnansweredQuestion
has body: I don't understand why I get video_data = {link: "example"} instead of video_data = {123: "example"}? How I can fix it? var video_data = {}; var get_info = function(link) { video_data.link = data.response; }; get_info(123);
linked to: http://stackoverflow.com/q/5481302
type: Question
tagged with: javascript
duplicate of: http://stackoverflow.com/q/2241875
has comment: http://stackoverflow.com/comment/45985772
score: 0
linked to: http://stackoverflow.com/q/2241875
has title: Use variable how key of hash
tagged with: hash
has comment: http://stackoverflow.com/comment/45985507
answer count: 0

http://stackoverflow.com/a/28847815
accepted answer of: http://stackoverflow.com/q/28754379
has comment: http://stackoverflow.com/comment/46057199
has body: The most likely cause is that the objects returned by the server are not entity data ... at least not from the point of view of the Breeze client. Perhaps you can show us your query. Check out the "Query Result Debugging" topic in the Breeze documentation.
type: Answer
has comment: http://stackoverflow.com/comment/45966471
has comment: http://stackoverflow.com/comment/45989970
score: 0
answers question: http://stackoverflow.com/q/28754379
type: AcceptedAnswer

http://stackoverflow.com/q/28827977
tagged with: clone
has title: WebComponents: Remove cloned template
has body: I'm using the webcomponentsjs polyfill. No x-tag, polymer, etc. preferably vanilla JS. After cloning a template and appending it to the document I'm not able to remove it again since it's missing a parentNode. var tmpl = document.getElementById('tmpl'); var clone = document.importNode(tmpl.content, true); document.body.appendChild(clone); console.log(clone.parentNode); // parentNode is null (not undefined!) clone.parentNode.removeChild(clone); // fails! You may see yourself in this jsbin My Question is: How do I remove the element again. Am I missing something?
answer count: 1
has answer: http://stackoverflow.com/a/28828642
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: web-component
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28828642
score: 1
upvote count: 1
type: Question

http://stackoverflow.com/comment/45988735
has text: is there anyway we can take a look at the `html`?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28861281

http://stackoverflow.com/q/28904671
type: UnansweredQuestion
tagged with: javascript
has title: How can I make a custom line type in high charts
type: Question
score: 0
has answer: http://stackoverflow.com/a/28941663
answer count: 1
tagged with: highcharts
has body: http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/plotoptions/series-allowpointselect-column/ $(function () { $('#container').highcharts({ chart: { type: 'spline' }, xAxis: { categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] }, plotOptions: { series: { allowPointSelect: true } }, series: [{ data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4] }] }); // the button action $('#button').click(function () { var chart = $('#container').highcharts(), selectedPoints = chart.getSelectedPoints(); if (chart.lbl) { chart.lbl.destroy(); } chart.lbl = chart.renderer.label('You selected ' + selectedPoints.length + ' points', 100, 60) .attr({ padding: 10, r: 5, fill: Highcharts.getOptions().colors[1], zIndex: 5 }) .css({ color: 'white' }) .add(); }); }); using high charts i can set the chat type to 'spline' creating a carved line however I would really like to make my own line type which goes straight for about 80% then curves up or down close to the point. Any help is much appreciated

http://stackoverflow.com/a/28814004
answers question: http://stackoverflow.com/q/28813815
downvote count: 0
upvote count: 2
has body: Just make two css classes "correct" and "wrong". Then assign these classes to the corresponding li elements. Jsfiddle demo li.correct{ color:green; } li.wrong{ color:red; }
type: Answer
score: 2

http://stackoverflow.com/q/28888882
tagged with: http://stackoverflow.com/tag/html
tagged with: php
tagged with: css
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/46039157
has comment: http://stackoverflow.com/comment/46038850
has comment: http://stackoverflow.com/comment/46038874
has comment: http://stackoverflow.com/comment/46040803
has title: Navigation Bar On The Same Page
type: Question
score: -2
tagged with: javascript
has answer: http://stackoverflow.com/a/28890310
accepted answer: http://stackoverflow.com/a/28890310
has body: I'm sure that my problem is simple, but I have poor experience on designing in general. I'm working on a simple PHP website project, and I have a navigation bar and want when click on one of the bars don't go to another page, rather just change a specified panel content according what the clicked button. I think this could be done by using ajax and div but I think also there is a convenient and clear way to do that professionally. Just ignore the unrelated lines or code, assuming that I want when click on one of the tab write a message of that tab or button without reloading. My html file: <?php include('session.php'); ?> Main view bla bla1 bla2 bla3 MainAdminStyle.css #menu { width: 800px; height: 35px; font-size: 16px; font-family: Tahoma, Geneva, sans-serif; font-weight: bold; text-align: center; text-shadow: 3px 2px 3px #333333; background-color: #8AD9FF; border-radius: 8px; } #menu ul { height: auto; padding: 8px 0px; margin: 0px; } #menu li { display: inline; padding: 20px; } #menu a { text-decoration: none; color: #00F; padding: 8px 8px 8px 8px; } #menu a:hover { color: #F90; background-color: #FFF; }
downvote count: 2
answer count: 1
favorite count: 0
tagged with: ajax

http://stackoverflow.com/q/28896856
has comment: http://stackoverflow.com/comment/71162900
upvote count: 1
has comment: http://stackoverflow.com/comment/46054244
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/46054915
has comment: http://stackoverflow.com/comment/47683727
downvote count: 0
has title: "Network Information" cordova plugin not working
tagged with: phonegap-plugins
tagged with: cordova-plugins
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/47718443
tagged with: android
has body: I am currently working on a rather large PhoneGap project using a handful of cordova plugins and I'm experiencing dificulties using the Network Information plgin to retrieve the connection type of the device. It should be noted that I'm using the command line tool to build my PhoneGap project, not Adobe's "Build" service. The versions of the phonegap and cordova cli tools are the following: % phonegap -v 4.2.0-0.23.0 % cordova -v 4.2.0 Here is the list of plugins currently in use: % phonegap plugins com.darktalker.cordova.screenshot 0.1.0 "Screenshot" nl.x-services.plugins.socialsharing 4.3.14 "SocialSharing" org.apache.cordova.console 0.2.13 "Console" org.apache.cordova.device 0.3.0 "Device" org.apache.cordova.inappbrowser 0.6.0 "InAppBrowser" org.apache.cordova.network-information 0.2.15 "Network Information" Here is the code responsible for using the plugin, it's located in a much larger object and is only called when I open to a certain page of the project: checkDeviceConnexion:function(){ require(['cordova', 'cordova_plugins'], function(cordova){ checkConnexion(); }); function networkConnexion(){ if (navigator.connection.type == 'none'){ //Connection.NONE return false; } return true; } function checkConnexion(){ if (!networkConnexion()){ app.showMsgError(tradu[lang]['msg-error-connexion']); } } } I'm doing my tests on android therefor I'm using adb as a mean to debug the application. When I run the code above, this is what I get: I/chromium(12465): [INFO:CONSOLE(1145)] "Uncaught TypeError: Cannot read property 'type' of undefined", source: file:///android_asset/www/js/app.js (1145) I scrapped and rebuilt the android project several times to make sure that all plugins were properly copied but it didn't help. What's even more puzzling is that the output of the adb hints that somehow somewhere the network manager should be working properly as shown here: D/CordovaNetworkManager(21764): Connection Type: wifi D/CordovaNetworkManager(21764): Connection Extra Info: "a…
tagged with: cordova
answer count: 0
score: 1

http://stackoverflow.com/comment/45930073
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28822860
score: 0
has text: Surely you want to test if the image has at least one *non*-white pixel in the top row?

http://stackoverflow.com/q/28812958
has title: Adding the HTML sign-in button to your page
has comment: http://stackoverflow.com/comment/45897757
score: 0
tagged with: javascript
has body: I'm trying to add a HTML sign-in button to my website using Google+ but when I click on the button nothing happens. I've followed the instructions given by Google on this page. here's my code: The button appears when previewed in a browser but doesn't appear to work. Can anyone offer any insight?
has comment: http://stackoverflow.com/comment/45898273
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45901077
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45910381
type: Question

http://stackoverflow.com/q/28883213
favorite count: 0
upvote count: 2
has body: I was hoping someone would be able to tell me why calling TestProtObj.init isn't working as expected - the listener is not working all. $(document).ready(function () { //set TestProtObj properties in the constructor var TestProtObj = function (string, target, button) { this.testValue = string; this.target = $(target); this.button = $(button); } //add methods to the object prototype TestProtObj.prototype = { init: function () { this.button.on('click', function (e) { e.preventDefault; this.returnTest(); }); }, returnTest: function () { this.target.append(this.testValue); } } //initialize client code var testString = 'It worked!', targetDiv = '#target', button = 'button.text-button'; //call the returnTest() method and pass in params above var TestConcObj = new TestProtObj(testString, targetDiv, button); TestConcObj.init(); }); Strangely, the following code works: $(document).ready(function () { var bindListener = function () { $('.test').on('click', function (e) { e.preventDefault; $('.target').append('It works!'); }) } bindListener(); }) It seems that putting the function into an object literal is for some reason, causing it to fail. No errors are being thrown in the Chrome debug toolbar. Help greatly appreciated. JSFiddles: #1 #2
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28883336
has answer: http://stackoverflow.com/a/28883465
has answer: http://stackoverflow.com/a/28887296
type: Question
has comment: http://stackoverflow.com/comment/46027848
downvote count: 0
possible better answer: http://stackoverflow.com/a/28883465
tagged with: javascript
tagged with: jquery
has title: Event Listener Not Binding
answer count: 3
accepted answer: http://stackoverflow.com/a/28883336

http://stackoverflow.com/comment/45879117
comment on: http://stackoverflow.com/a/28802559
has text: @Carpetfizz No it's just a demonstration and a simple way to pass through values without nesting code blocks.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45982632
comment on: http://stackoverflow.com/q/28838263
type: Comment
type: QuestionComment
has text: Also, your `if (!!response.data)` can just be `if (response.data)`. There's no reason to convert `response.data`'s truthiness to a boolean for that evaluation.
score: 0

http://stackoverflow.com/comment/45944590
comment on: http://stackoverflow.com/q/28837419
type: Comment
type: QuestionComment
has text: Please show the code that causes "Javascript's typeof returns **String** for both of them." - as this not a valid return value for `typeof`.
score: 1

http://stackoverflow.com/comment/46025480
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28865543
has text: Have you tried to modify `pane.center` option? Like this: http://jsfiddle.net/7sc70zdn/2/ - center can have values in pixels or percentage. Or just set `marginLeft` to `180` instead of `-180`. But as you said it may not work for you for some reasons.
score: 0

http://stackoverflow.com/comment/45875181
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28790793
has text: I'm pretty new to Javascript and already using jQuery one way or another (I'm using jQuery mobile, and it's a requirement of the project), and maximum speed is not an issue to me. I am fine with jQuery solutions.
type: AnswerComment

http://stackoverflow.com/comment/45987498
has text: I want to replicate the functionality of the working example, but in a more dynamic environment (i.e. I would retreieve the validation state of the form)
type: Comment
comment on: http://stackoverflow.com/a/28859945
score: 0
type: AnswerComment

http://stackoverflow.com/a/28885894
accepted answer of: http://stackoverflow.com/q/28885853
score: 2
has comment: http://stackoverflow.com/comment/46034261
upvote count: 2
answers question: http://stackoverflow.com/q/28885853
has comment: http://stackoverflow.com/comment/46034405
has comment: http://stackoverflow.com/comment/46034575
has comment: http://stackoverflow.com/comment/46033172
type: AcceptedAnswer
downvote count: 0
has body: Using the brackets, you’re immediately invoking the startGame function. Its return value is then assigned to the onClick property. You most likely want to assign the function itself, so it’s executed when the onClick event fires. To do so, change this b1.onClick = startGame(); to this b1.onClick = startGame;
type: Answer

http://stackoverflow.com/comment/46069806
comment on: http://stackoverflow.com/q/28905264
score: 5
has text: Because it is not an array.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28822719
has comment: http://stackoverflow.com/comment/45917053
score: 0
answer count: 1
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45916988
has comment: http://stackoverflow.com/comment/45917101
has comment: http://stackoverflow.com/comment/45916973
has title: trouble with accordion I am making
has body: I am building an accordion for school and I feel like it should work. I know I have everything right up until the if else statement. Any suggestions appreciated $(document).ready(function () { // // Set up a click event handler for clicked &lt;li&gt; // $('#accordion li').click(function() { // find first ul that is a child of this (the clicked &lt;li&gt;) var $nextUL = $(this).children('ul:first-child'); // Select all siblings of the clicked &lt;li&gt; and then // select any direct children &lt;ul&gt;'s // that are visible - this is so we can close any visible // &lt;ul&gt; before opening the &lt;ul&gt; for the clicked &lt;li&gt; var $visibleSiblings = $(this).siblings().children('ul:visible'); // If any other &lt;ul&gt;s are visible, slide the visible &lt;ul&gt; // up and then, after the slide up is complete, slide down // the clicked &lt;li&gt;'s &lt;ul&gt; into view if ($visibleSiblings.length &gt; 0) { $visibleSiblings.slideUp('normal', function() { $nextUL.fadeIn('normal'); }); } else { // either no &lt;ul&gt;s were open (open the clicked item) // or the user clicked on the currently open one so close it $nextUL.slideToggle('normal'); } }); });
type: Question
has answer: http://stackoverflow.com/a/28823058
tagged with: javascript
has comment: http://stackoverflow.com/comment/46067493
has comment: http://stackoverflow.com/comment/45917042

http://stackoverflow.com/q/28866734
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I want to reload the page when a user closes a dropdown menu that is controlled by "bootstrap-multiselect" UI. Here is what I have tried so far $('#ts_client_id').multiselect({ enableFiltering: true, enableCaseInsensitiveFiltering: true, selectedClass: null, nonSelectedText: 'All Clients', includeSelectAllOption: true, buttonWidth: '100%', maxHeight: 250 }).on('blur', function () { console.log($('#ts_client_id').val()); window.location.reload(); }); also $('#ts_client_id').multiselect({ enableFiltering: true, enableCaseInsensitiveFiltering: true, selectedClass: null, nonSelectedText: 'All Clients', includeSelectAllOption: true, buttonWidth: '100%', maxHeight: 250 }).on('hide.bs.dropdown', function () { console.log($('#ts_client_id').val()); window.location.reload(); }); I have also tried this and it is not working $('#ts_client_id').multiselect({ onDropdownHidden: function(event){ console.log('hi'); window.location.reload(); }, enableFiltering: true, enableCaseInsensitiveFiltering: true, selectedClass: null, nonSelectedText: 'All Clients', includeSelectAllOption: true, buttonWidth: '100%', maxHeight: 250 }); here is my HTML code Option 1 Option 2 Option 3 But for some reason nothing is printed to the console neither the page is reloading. what can I do to detect when the menu is closed so I can reload the page.
has comment: http://stackoverflow.com/comment/45998376
linked to: http://stackoverflow.com/q/2405117
answer count: 4
upvote count: 5
type: UnansweredQuestion
has title: How to fire an event when a drop down menu is closed using jQuery?
has answer: http://stackoverflow.com/a/77278311
tagged with: bootstrap-multiselect
has answer: http://stackoverflow.com/a/28867190
has answer: http://stackoverflow.com/a/28866848
type: Question
score: 5
has answer: http://stackoverflow.com/a/28866820
tagged with: jquery-ui-multiselect

http://stackoverflow.com/comment/46965344
score: 0
type: Comment
comment on: http://stackoverflow.com/a/29394164
type: AnswerComment
has text: It might have to do with one of their permissions, and if that doesn't work, both your background.js and popup pages can access cross-origin pages without issues.

http://stackoverflow.com/a/28887399
type: Answer
upvote count: 1
has body: 1) Wrap your .people and .projects in a div. 2) Give position:relative to this wrapper. 3) Give position:absolute to .projects and .people. Why? Because when you give position:absolute to a div it will position with respect to a parent div having position or else body if no such parent is found. So it is safe to give position:relative to a wrapper. Here is a fiddle.
score: 1
accepted answer of: http://stackoverflow.com/q/28887109
answers question: http://stackoverflow.com/q/28887109
downvote count: 0
type: AcceptedAnswer

http://stackoverflow.com/q/28817789
has title: html passing an input to a function with user input
accepted answer: http://stackoverflow.com/a/28817965
type: Question
has body: So I've been working in html/javascript for the first time and I need to get user input through boxes/buttons and use that data to call a function, something like this: &lt;input id="xstart" type="number" min="0" max = "100"/&gt; &lt;input id="ystart" type="number" min="0" max = "100"/&gt; &lt;input id="zstart" type="number" min="0" max = "100"/&gt; &lt;input id="clickit" type="button" value="click" onclick="myfunc(xstart, ystart, zstart);" /&gt; function myfunc(num0, num1, num2) { do things with it } I cannot figure out how to get this to work, it does seem to call myfunc but it crashes because the values in xstart, ystart and zstart are not actually numbers, I think they are strings but I am not sure. Any help or links to tutorials on things like this for a first time programmer would be helpful. Thank you.
tagged with: javascript
has comment: http://stackoverflow.com/comment/45907413
has answer: http://stackoverflow.com/a/28817965
linked to: http://stackoverflow.com/q/5871640
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
score: -4
has comment: http://stackoverflow.com/comment/45907334
downvote count: 4
type: AnsweredQuestion
upvote count: 0

http://stackoverflow.com/comment/45980836
comment on: http://stackoverflow.com/q/28857379
score: 1
has text: This is not to fix the problem, but an idea: since they are unique, have you considered using an object structure like `currentState.module2.mod2 = ["true", "false"]`?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46056884
has text: @prudviraju: Each `get` call returns a `Deferred` object that you can use to handle the responses. By calling the `$.when` method with all the `Deferred` objects and call the `done` method, it will wait until all requests are done and you get a parameter with a response for each request that was made. In the example above the responses are concatenated into a single array, but if you want an array of responsed instead you can just use `arguments` instead, that's an array with the parameters sent to the function.
comment on: http://stackoverflow.com/a/28827638
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45955212
type: AnswerComment
score: 0
has text: @Donal IT WORKS! I Changed the DataType: JSON back to HTML and it now returns the desired string! Thanks dude, you're awesome!
type: Comment
comment on: http://stackoverflow.com/a/28835800

http://stackoverflow.com/comment/46069577
comment on: http://stackoverflow.com/q/28904875
type: Comment
type: QuestionComment
has text: My question is not about why this code isn't working, the question is about how to implement form submit trigger which can be catched by reactjs events.
score: 0

http://stackoverflow.com/comment/46072717
comment on: http://stackoverflow.com/a/28863601
score: 0
type: AnswerComment
has text: Good point re: creating multiple timers. Fixed that up but it's still not working. I've actually had to skip this test altogether because I just can't get it to work.
type: Comment

http://stackoverflow.com/a/28840550
has body: stop the event propagation: $('body').on('click', '.saved-search-delete', function(event) { event.stopPropagation(); }); UPDATE: i was under the impression that you want to stop the event from reaching the #save-search-name element, in which case stopping propagation will work. however, it occurred to me that you might be wanting to stop the default action of the parent anchor &lt;a&gt;, in which case you need to prevent the default action from happening as clicking an element wrapped by an anchor will activate the anchor by default: $('body').on('click', '.saved-search-delete', function(event) { event.stopPropagation(); event.preventDefault(); }); Also, if stopping propagation does not work for you, you can check at the parent's click handler if the target of the click is that parent himself, or a child element and perform the action as needed: $('#save-search-name').click(function (event) { if(event.target==this){ alert("parent Clicked"); } });
type: AcceptedAnswer
score: 4
has comment: http://stackoverflow.com/comment/45986121
has comment: http://stackoverflow.com/comment/45951311
accepted answer of: http://stackoverflow.com/q/28840490
type: Answer
upvote count: 4
answers question: http://stackoverflow.com/q/28840490
downvote count: 0

http://stackoverflow.com/comment/46034178
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28885772
score: 0
has text: I'm not sure what needs clarifying. I thought I had provided all necessary information.

http://stackoverflow.com/a/28764349
type: AcceptedAnswer
downvote count: 0
has body: a, b in this context, is an expression whose value is the value of b (see the comma operator). That's why the uglified test if(null!=h&amp;&amp;h.close(),$(t.target).hasClass("crud_create")) is the same as null!=h &amp;&amp; h.close(); if ($(t.target).hasClass("crud_create")) which is equivalent, due to the short-circuit behavior of &amp;&amp;, to if (null!=h) h.close(); if ($(t.target).hasClass("crud_create")) So there doesn't seem to be any problem in this uglyfication.
has comment: http://stackoverflow.com/comment/45807852
has comment: http://stackoverflow.com/comment/45808010
has comment: http://stackoverflow.com/comment/45807956
upvote count: 2
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/28764232
answers question: http://stackoverflow.com/q/28764232

http://stackoverflow.com/q/28872931
linked to: http://stackoverflow.com/q/958997
downvote count: 0
tagged with: javascript
tagged with: dom-events
favorite count: 0
linked to: http://stackoverflow.com/q/4084152
tagged with: onbeforeunload
has comment: http://stackoverflow.com/comment/46549929
score: 2
has body: I do have a site where several iframes get loaded which's content I can't control. These iframed pages may cause redirects. I do prevent these redirects by using this iframe-busting-busting-busting code: &lt;script&gt; // Code from here: // https://stackoverflow.com/questions/958997/frame-buster-buster-buster-code-needed var prevent_bust = 0 window.onbeforeunload = function(){ prevent_bust++; }; setInterval(function(){ if (prevent_bust &gt; 0){ prevent_bust -= 2; window.top.location = '/204-NoContentResponse.php'; } }, 1); &lt;/script&gt; This works great for the iframes, but now the user can't change the url by hand and is unable to leave the page manually. If he enters a different URL in his omnibox/url bar this redirection is prevented, too. So this post: Disable onbeforeunload for links doesn't apply here, unfortunatelly. Is there a way to let the user leave the page by entering an url, clicking a bookmark or hitting F5, but prevent iframes from redirecting? Update I forgot to mention that this site is run in an environment where users are forced to use IE9. So the sandbox attribute is no option unfortunatelly.
has title: How to differentiate between iframe redirection and manual redirection
answer count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: iframe
tagged with: http-redirect
linked to: http://stackoverflow.com/q/369498
has comment: http://stackoverflow.com/comment/46631544
type: Question

http://stackoverflow.com/comment/46017124
comment on: http://stackoverflow.com/a/28877223
has text: Hehe, like the minified one
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/66081457
score: 0
type: AnswerComment
type: Comment
has text: This approach is not working for my case. I have Bootstrap tabbed form, and I am watching the style attribute 'display' of the last tab which has a canvas. If the value of 'display' changes from 'none' to 'block' then I want to trigger resize event to redraw the canvas living inside this tab. I think I need to call $scope.$digest() to make it work, but I don't know how. I am using custom directive for to control the last tab and watch the display css attribute. During debug I can see that watch but it seems it's running too early and not function all the times.
comment on: http://stackoverflow.com/a/28879830

http://stackoverflow.com/a/28817482
has comment: http://stackoverflow.com/comment/45906764
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45910417
has comment: http://stackoverflow.com/comment/45909137
accepted answer of: http://stackoverflow.com/q/28816495
has comment: http://stackoverflow.com/comment/45908812
has comment: http://stackoverflow.com/comment/45908383
has body: EDIT: DEMO The problem was actually straight forward. You were missing two vital libraries for the thumbnails to work. jquery.fancybox-thumbs.js jquery.fancybox-thumbs.css That's all there was to it. Your code was good. $(".fancybox-thumb").fancybox({ prevEffect: 'none', nextEffect: 'none', helpers: { title: { type: 'outside' }, thumbs: { width: 50, height: 50 } } });
score: 0
has comment: http://stackoverflow.com/comment/45907861
type: Answer
has comment: http://stackoverflow.com/comment/45908429
has comment: http://stackoverflow.com/comment/45909001
has comment: http://stackoverflow.com/comment/45906912
has comment: http://stackoverflow.com/comment/45908121
has comment: http://stackoverflow.com/comment/45906812
has comment: http://stackoverflow.com/comment/45909491
has comment: http://stackoverflow.com/comment/45908736
has comment: http://stackoverflow.com/comment/45910473
answers question: http://stackoverflow.com/q/28816495

http://stackoverflow.com/comment/45960543
comment on: http://stackoverflow.com/q/28845711
has text: when debug, right click on Inspect Elemnt in chrome, then go to console, see what errors
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28896532
accepted answer: http://stackoverflow.com/a/28896692
upvote count: 2
has title: JavaScript Jquery stoping each function, blocked buttons
has body: I try to do email sender with jQuery and I want to start and break sending by click button. var arr; function loadArray(table){ arr = table.data;} function init(){ $('#start').click(function(){ $.each(arr, function( key, value ){ if(value !== null){ var emailTemplate = value['emailTemplate']; var email = value['email']; var campaign = value['campaign']; sendAnEmail(emailTemplate, email, campaign, key); arr[key] = null; } console.log(arr); $(this).click(function(){ return false; }); }); }); } function sendAnEmail(template, email, campaign, num){ $.ajax({ type: "POST", dataType: "json", async: false, data: { template: template, email: email, num: num, campaign: campaign }, url: Routing.generate('wyslij_email'), success: function(msg){ if(msg.status == 'success'){ var count = parseInt($('.sended').text()); $('.sended').text(count+1); }else{ var count = parseInt($('.error').text()); $('.error').text(count+1); } } }); } I created simple function init, it work fine. After click #start it start each function. When each function loop I can't click any button. I thing that AJAX block it by async = false; Is it true? My question is simple. Why it doesn't work?
type: AnsweredQuestion
tagged with: javascript
type: Question
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/28896692
has comment: http://stackoverflow.com/comment/46053061
tagged with: php
has comment: http://stackoverflow.com/comment/46052753
has comment: http://stackoverflow.com/comment/46052898
score: 2

http://stackoverflow.com/q/28809897
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/29348363
has comment: http://stackoverflow.com/comment/46843081
has comment: http://stackoverflow.com/comment/46636888
has comment: http://stackoverflow.com/comment/45892357
accepted answer: http://stackoverflow.com/a/29263155
type: Question
has comment: http://stackoverflow.com/comment/46830460
has answer: http://stackoverflow.com/a/29260520
tagged with: clip-path
tagged with: javascript
has comment: http://stackoverflow.com/comment/45892234
has comment: http://stackoverflow.com/comment/45892080
possible better answer: http://stackoverflow.com/a/29260520
has comment: http://stackoverflow.com/comment/46637096
has body: I try to write a little plugin, to open modal boxes in a more organic fashion, therefore I have decided to animate the clip-path property. Now this code only works in chrome: http://codepen.io/meodai/pen/GgGzYo?editors=011 It looks like firefox does not support polygon() in the clip-path property. Safari & Mobile Safari do struggle with it as well. Is there a similarly easy way to make this work in Firefox and Safari and Mobile Safari as well? Any idea how I could approach this problem? Here is a working example: var $ov = $('.overlay'); $(document).on('click touchstart', '.inner', function(){ var coords, coordArray, coordsString; coords = this.getBoundingClientRect(); coordArray = [ Math.floor(parseInt(coords.left)) + 'px ' + Math.floor(parseInt(coords.top)) + 'px', Math.ceil((parseInt(coords.left) + parseInt(coords.width))) + 'px ' + Math.ceil(parseInt(coords.top)) + 'px', Math.ceil((parseInt(coords.left) + parseInt(coords.width))) + 'px ' + Math.ceil((parseInt(coords.top) + parseInt(coords.height) )) + 'px', Math.ceil(parseInt(coords.left)) + 'px ' + Math.floor((parseInt(coords.top) + parseInt(coords.height) )) + 'px' ]; coordsString = 'polygon(' + coordArray[0] + ',' + coordArray[1] + ',' + coordArray[2] + ',' + coordArray[3] + ')'; $ov.css({ '-webkit-clip-path': coordsString, 'clip-path': coordsString }); setTimeout(function(){ $ov.addClass('show'); },50); setTimeout(function(){ coordsString = 'polygon(0% 0%,' + coordArray[1] + ',' + coordArray[2] + ',' + coordArray[3] + ')'; $ov.css({ '-webkit-clip-path': coordsString, 'clip-path': coordsString }); },100); setTimeout(function(){ coordsString = 'polygon(0% 0%,100% 0%,' + coordArray[2] + ',' + coordArray[3] + ')'; $ov.css({ '-webkit-clip-path': coordsString, 'clip-path': coordsString }); },180); setTimeout(function(){ coordsString = 'polygon(0% 0%,100% 0%,100% 100%,' + coordArray[3] + ')'; $ov.css({ '-webkit-clip-path': coordsString, 'clip-path': coordsString }); },260); setTimeout(function(){ coordsString = 'po…
has comment: http://stackoverflow.com/comment/46637351
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/29263155
tagged with: http://stackoverflow.com/tag/svg
upvote count: 8
has answer: http://stackoverflow.com/a/51298413
has title: How to use clip-path polygons in FF and IOS
tagged with: css
answer count: 4
score: 8

http://stackoverflow.com/comment/45919859
type: AnswerComment
has text: It's still hard to get my head around the scoping rules in JS.
type: Comment
comment on: http://stackoverflow.com/a/28824250
score: 0

flux
tag name: flux
tags question: http://stackoverflow.com/q/28837492
tags question: http://stackoverflow.com/q/28881534
tags question: http://stackoverflow.com/q/28759728
tags question: http://stackoverflow.com/q/28828157
tags question: http://stackoverflow.com/q/28822881
type: Tag

http://stackoverflow.com/q/28872668
has comment: http://stackoverflow.com/comment/46008187
has comment: http://stackoverflow.com/comment/46008236
type: AnsweredQuestion
tagged with: coffeescript
has comment: http://stackoverflow.com/comment/46008618
type: Question
score: 0
has comment: http://stackoverflow.com/comment/46008406
has comment: http://stackoverflow.com/comment/46008172
has title: How to prevent jQuery from changing href attriute on click?
has body: I have a collection of anchor tags, which look like so: &lt;a href='#123'&gt;&lt;/a&gt; I use the #123 as an id, which I supply to an AJAX call. I make the call on click of a link. After a link is clicked, besides the displaying of the results of the AJAX call, two things happen: the url in the address bar gets the hash like so: www.localhost.com/foo#123. The href attribute of the clicked link gets changed from #123 to the AJAX address www.localhost.com/bar#123. If I don't make an AJAX call (for test purposes), then it changes to the current url in the address bar: www.localhost.com/foo#123. If I use event.preventDefault, than both of these things don't happen. I want to keep 1. (changing of the hash value in the address bar), but I don't won't to keep the value of the href, as otherwise, a subsequent click on the same link results in an error. How can I do this? My code I will include a simplified version of my code, which still produces the same effect. makeAjaxCall = (brandId) -&gt; alert 'OK' $ -&gt; $('.box-trigger').on 'click', (e) -&gt; makeAjaxCall($(this).attr('href')) This code gets loaded on page www.localhost.com/foo. If I click on the link, than I gen an alert with 'OK', the address changes to www.localhost.com/foo#123 and the href of the link also changes to www.localhost.com/foo#123. Clarification regarding foo and bar In the makeAjaxCall function, if I really make an ajax call to the url www.localhost.com/bar, then the href changes to www.localhost.com/bar#123. However, I removed the Ajax call to try to debug the problem. In that case the href changes to the current url, in this case www.localhost.com/foo#123. Solution I ended up using event.prevenDefault + manually appending the hash to the address bar url like so: $ -&gt; $('.lightbox-trigger').on 'click', (e) -&gt; e.preventDefault() makeAjaxCall $(this).attr('href') window.location.hash = $(this).attr('href')
answer count: 1
has comment: http://stackoverflow.com/comment/46008191
has comment: http://stackoverflow.com/comment/46008731
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46008120
has comment: http://stackoverflow.com/comment/46008316
has answer: http://stackoverflow.com/a/28873778
tagged with: ajax
has comment: http://stackoverflow.com/comment/46008549
has comment: http://stackoverflow.com/comment/46008591
accepted answer: http://stackoverflow.com/a/28873778
has comment: http://stackoverflow.com/comment/46008399
has comment: http://stackoverflow.com/comment/46008479

http://stackoverflow.com/comment/45942013
type: Comment
type: QuestionComment
has text: It would be helpful if you provided the HTML in question and then somebody could help by just filling in the blanks rather than having to create the entire scenario to illustrate how the solution would be implemented.
comment on: http://stackoverflow.com/q/28835717
score: 0

http://stackoverflow.com/q/28813815
has comment: http://stackoverflow.com/comment/45900501
score: -1
has title: How do i change the color of the text in a radio input field
type: Question
answer count: 2
upvote count: 0
has body: Ok so I am making a test that has a list of questions that contains a list of answers. Im trying to make the test change the color of the users wrong answers to highlight red and have the correct answers highlighted green. I understand how to change the background color of elements. However i do not understand how to change the background color of the inner html of a input element of the radio type. When i run this code i think its trying to change the actual radio input. Any help is appreciated. A sample for HTML test: What are the three main areas of the Standard User Interface? Header, Banner, Frame, Application Window Content Frame, Homepage, Form Application Navigator, Banner Frame, Content Frame Larry, Moe, and Curly In the User interface, what is the gray toolbar called which allows you to add bookmarks? Gauge Edge Remedy Banner What can be captured in an update set? Modified CI Rules Business Rules Scheduled Jobs None of these Submit Test Try Again? My javascript Code: function finishTest(){ //There are actually 37 questions on the test so far only included 3 var score = 0; var totalQuestions = 37; for(var questionNum = 1; questionNum<=totalQuestions; questionNum++) { var radios = document.getElementsByName('q'+questionNum); var uQuestion = document.getElementById("question "+questionNum).innerHTML; for (var i = 0, length = radios.length; i < length; i++) { if (radios[i].checked && radios[i].value=="1"){ score++; alert(radios.innerHTML); radios.innerHTML.style.backgroundColor = "lawngreen"; }else if (radios[i].checked && radios[i].value=="0"){ alert(radios.innerHTML); radios.innerHTML.style.backgroundColor = "red"; } } } score = parseFloat(score*100/totalQuestions).toFixed(1); alert("You scored "+score+"%"); document.getElementById('finish').style.visibility='hidden'; }
has comment: http://stackoverflow.com/comment/45899999
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28814169
has comment: http://stackoverflow.com/comment/45899881
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45899597
has comment: http://stackoverflow.com/comment/45901246
has comment: http://stackoverflow.com/comment/45900107
favorite count: 0
has comment: http://stackoverflow.com/comment/45900685
possible better answer: http://stackoverflow.com/a/28814004
has comment: http://stackoverflow.com/comment/45899922
has answer: http://stackoverflow.com/a/28814004
has comment: http://stackoverflow.com/comment/45901405
downvote count: 1
has comment: http://stackoverflow.com/comment/45900411
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45900852
has answer: http://stackoverflow.com/a/28814169
has comment: http://stackoverflow.com/comment/45899804

http://stackoverflow.com/comment/45818210
type: AnswerComment
has text: It doesn't start the autoplay, and when I click on my arrow I get an error: Uncaught TypeError: undefined is not a function. I think the error is normal (cause we change the code) but why it doesn't autoplay?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28769696

http://stackoverflow.com/q/28843354
has answer: http://stackoverflow.com/a/28910179
accepted answer: http://stackoverflow.com/a/28910179
has body: There is most likely a simple solution to my question, but Im new to angularJS. What I'm doing is adding new form to DOM with a "add new button". This works fine, but if there is no data to iterate through with ng-repeat, i need to show one default form.How can this be achieved? Here is my code: feeCollectCtrl.addMoreFees = function () { if (!feeCollectCtrl.feeCollectData.fees) { feeCollectCtrl.feeCollectData.fees = []; } feeCollectCtrl.feeCollectData.fees.push({ "id": null, "paymentName": "", "fee": "", "deadlineDate": "" }); }; and the html is: {{'Payment ' + ($index +1)}} The Fee for {{fee.paymentName}} is ${{fee.fee | number:2}} To change, input a new charge below. Payment Name required field Fee $ <valid-number name="fee" required="required" id="fee" data-ng-model="fee.fee" placeholder="Fee Amount" cssclass="form-control currencyInput" /> required field Deadline <input name="deadlineDate" id="deadlineDate" type="text" class="form-control" show-button-bar="true" datepicker-popup="{{format}}" ng-model="fee.deadlineDate" is-open="fee.opened" min-date="minDate" datepicker-options="dateOptions" date-disabled="disabled(date, mode)" required="required" close-text="Close" ng-change="feeCollectCtrl.validateDate('deadlineDate',feeCollectForm.deadlineDate.$viewValue)" ng-keyup="feeCollectCtrl.validateDate('deadlineDate',feeCollectForm.deadlineDate.$viewValue)" /> required field delete
has title: AngularJS push data into an object array, but show a default element if the object array is empty
has answer: http://stackoverflow.com/a/28843687
tagged with: angularjs
type: AnsweredQuestion
type: Question
possible better answer: http://stackoverflow.com/a/28843687
tagged with: javascript
score: 0
answer count: 2
tagged with: arrays

http://stackoverflow.com/comment/45841635
type: Comment
comment on: http://stackoverflow.com/a/28782334
type: AnswerComment
has text: Now I get: "Uncaught TypeError: undefined is not a function"
score: 0

http://stackoverflow.com/q/28755639
has body: Ok, I've tried everything I can think of and perused all the existing questions, but none of them have any actual answers. I have an angularjs front end and java/REST backend, running on Tomcat. I have an XMLHttpRequest and a progress event listener that looks like this: xhr.upload.addEventListener('progress', function(e) { console.log(e.loaded); console.log(e.total); }, false); If I'm uploading a 100MB file, the progress event listener fires repeatedly, but reports 100% within the first second. The xhr then returns that it's loaded roughly 30 seconds to a minute later, as would be expected. I have tried setting different headers, using sendAsBinary() instead of send, and a number of other techniques that I cannot recall off the top of my head. The angular app is running on localhost, the Tomcat app server acts the same way whether I use my local dev instance or a hosted dev instance. I'm looking for any ideas I can get, whether they be Tomcat settings, code changes, or anything else. I know that the problem is not in the java backend code itself because the progress event has stopped firing at 100% done before the file processing code even begins running. This happens on Chrome 40/FF 35/Safari 6.
type: Question
downvote count: 0
tagged with: javascript
tagged with: tomcat
favorite count: 0
tagged with: ajax
tagged with: angularjs
type: UnansweredQuestion
has title: XHR Upload Progress claims immediate completion
score: 2
answer count: 0
upvote count: 2

http://stackoverflow.com/comment/45925369
has text: Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/72124/discussion-between-rashadb-and-kamituel).
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28826513
score: 0

http://stackoverflow.com/comment/46151369
type: Comment
has text: Tell you what, I'll switch that error into a warning, and just continue w/ the first `<more-routing-config>` - any additional ones will be completely ignored
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28906272

http://stackoverflow.com/comment/57022331
comment on: http://stackoverflow.com/a/32407071
type: AnswerComment
score: 0
type: Comment
has text: Awesome! I'm glad I could help.

http://stackoverflow.com/a/28870640
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28869118
has body: try with html.beginform @using (Html.BeginForm("Generate", "MyController","name=Joe&amp;age=22&amp;weight=200", FormMethod.Post, new { id = "frmMyForm" })) { // Your form elements }
downvote count: 0

http://stackoverflow.com/comment/45938600
has text: I'm fairly certain it goes to the former, although there is a trailing underscore ... `example.com/?_escaped_fragment_=/portfolio`. Something like that
type: Comment
comment on: http://stackoverflow.com/a/28818247
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45956598
comment on: http://stackoverflow.com/q/28843785
has text: @mkaatman the html has data-company_id or data-user_id. not both
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/28785059
answers question: http://stackoverflow.com/q/28785031
type: Answer
has comment: http://stackoverflow.com/comment/45846539
upvote count: 3
has comment: http://stackoverflow.com/comment/45846459
has comment: http://stackoverflow.com/comment/45846370
has comment: http://stackoverflow.com/comment/45846394
has body: What you've written should work. However, you should note that by not using the var keyword, you're still creating global variables inside of your function. I would suggest... function onloadHandler() { document.getElementById("standard").onclick = function() { // Do something }; document.getElementById("fancy").onclick = function() { // Do something else }; };
has comment: http://stackoverflow.com/comment/45846439
has comment: http://stackoverflow.com/comment/45846503
score: 3
downvote count: 0

http://stackoverflow.com/comment/46033192
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28872554
score: 0
has text: @shahharsh2603 check out [Simple one-time reqeusts](https://developer.chrome.com/extensions/messaging#simple)

http://stackoverflow.com/q/28785863
score: 2
tagged with: mathematical-optimization
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28786245
tagged with: algorithm
tagged with: math
type: Question
has title: algorithm to scale an image to best fit a frame (div)
answer count: 1
downvote count: 0
tagged with: javascript
has body: I am very weak in Math. I am a web programmer, and usually my work does not involve too much math - its more of putting records into database, pulling out reports, making those fancy web pages etc etc. So, I got a task that is "mathy" for me, but I am hoping its child's play for some of you Math guys out there, and you will help me out...It might even be an interesting problem for you, its just too complex for me. So recently I got this task, where I am given an image with an area marked on top of it. This area would be marked as top left pixels (x1,y1) and bottom right pixels (x2,y2) So for the image I have the following information: Image Width (iw) Image Height (ih) Image Area Top Left (x1,y1) Image Area Bottom Right (x2,y2) Now there are a collection of frames, each frame will have Frame Width (fw) and Frame Height (fh). My job is to find optimal way to fit Image Area inside frame without having any blank area inside frame, using image scaling if required. So I broke it down to following tasks: Image Area (not fill image) has to fit inside Frame. If Image Area &gt; Frame, I should scale Image down (to a %). If Image Area &lt; Frame I should scale Image Up. The aspect ratio of the image should not be disturbed when I scale. I should scale Image based on the longer side of Image Area to make sure that whole Image Area comes inside Frame. However when scaling Image down, sometimes this may cause the other side to have blank space inside Frame because of extreme aspect ratios. In such case, I should only scale down until one side hits Image Height or Image Width. This means that the Image Area is not fully shown inside the Frame, but that is fine because the first priority is to not have blank space inside Frame. Now that I have written all these rules, I am unable to wrap my head around formalizing this into a mathematical "formula"/"procedure"/"rule-set" that I can then recreate in my software. For scaling, I found that this formula works well (in programming pseu…
favorite count: 0
has comment: http://stackoverflow.com/comment/45848437
has comment: http://stackoverflow.com/comment/45848650
tagged with: php

http://stackoverflow.com/q/28835717
tagged with: lazy-loading
type: UnansweredQuestion
tagged with: youtube
has comment: http://stackoverflow.com/comment/45942013
tagged with: embed
tagged with: performance
has answer: http://stackoverflow.com/a/28838940
type: Question
has title: Lazy Load YouTube on Resize
answer count: 2
tagged with: javascript
has body: I have 2 different YouTube videos for 2 specific screen widths. I'd like to load each video dynamically, exclusively when a visitor hits that screen size, as opposed to loading them when the document is loaded. css #size1000, #size500{ display:none; } @media(width:1000px){ #size1000{ display:block; } } @media(width:500px){ #size500{ display:block; } } Is this possible? If so, how is this done?
score: 0
has answer: http://stackoverflow.com/a/28838366
has comment: http://stackoverflow.com/comment/45945868

http://stackoverflow.com/a/28939944
has body: thanks a lot for the help.. after spending couple of mins searching for the solution i came up with this solution.. and its working. (function () { var bar = $('.bar'); var percent = $('.percent'); var status = $('#status'); var percentVal = '0%'; var x = 1; var y = null; // To keep under proper scope $('form').ajaxForm({ beforeSend: function (xhr) { status.empty(); $('#cancel').click(xhr.abort) // for cancel button percentVal = '0%'; bar.width(percentVal) percent.html(percentVal); }, uploadProgress: function (event, position, total, percentComplete) { percentVal = percentComplete + '%'; bar.width(percentVal) percent.html(percentVal); if (percentVal == '100%') { $("#cancel").hide(); } }, success: function (xhr) { $("#cancel").hide(); $('#cancel').click(xhr.abort) }, complete: function () { location.reload(); } }); })();
answers question: http://stackoverflow.com/q/28847507
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28847507
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/q/28891434
upvote count: 2
has comment: http://stackoverflow.com/comment/46044665
has comment: http://stackoverflow.com/comment/46044399
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/46044382
has comment: http://stackoverflow.com/comment/46044292
has comment: http://stackoverflow.com/comment/46044359
has answer: http://stackoverflow.com/a/28891463
has body: How reliable is document.referrer in determining the source? I want a website (A) to only work if the visitor came from a specific other website (B). I am planning to use document.referrer in website A to check whether website B is the source (check is done server-side). Is it safe and reliable way? If not, what are my alternatives? I have looked at this, but the use case is exact opposite of mine.
type: AnsweredQuestion
tagged with: javascript
score: 1
linked to: http://stackoverflow.com/q/8893269
type: Question
has comment: http://stackoverflow.com/comment/46044434
accepted answer: http://stackoverflow.com/a/28891463
favorite count: 0
tagged with: referrer
tagged with: spoofing
has title: how reliabile is document.referrer, can it be spoofed/ faked?
tagged with: http-referer

http://stackoverflow.com/a/28768335
type: Answer
downvote count: 0
score: 1
has body: Here's one approach. Step 1 would be to fix the existing Delete click function. You are going to end up assigning multiple click event handlers this way. Step 2 would be to adjust your change method. Here's how I got it working: // remove your other `.dbutton` click handler $('#retc').on('click', 'button.dbutton', Delete); // add a proper change event $('#retc').on('change', 'select[name^="clang"]', function() { var lang = $(this).val(); var year = $(this).parents('tr').find('[name^="cyear"]').val(); //alert('lang: ' + lang + ', year = ' + year); var $myweek = $(this).parents('tr').find('[name^="cweek"]'); $.post("/chairs-dev/jqf/returncurric_processajax.php", {LANG: lang, YEAR: year}, function (data) { $myweek.html(data); }); }); jsFiddle Demo
has comment: http://stackoverflow.com/comment/45818098
accepted answer of: http://stackoverflow.com/q/28767355
answers question: http://stackoverflow.com/q/28767355
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45817815
has comment: http://stackoverflow.com/comment/45817656
has comment: http://stackoverflow.com/comment/45816746

http://stackoverflow.com/comment/46013786
type: Comment
score: 0
has text: you need to wrap the elements from success(html) to create jquery objects as i have done . That might be problem
type: AnswerComment
comment on: http://stackoverflow.com/a/28875463

http://stackoverflow.com/q/28830052
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45931722
type: UnansweredQuestion
score: -4
has answer: http://stackoverflow.com/a/28895631
has body: Can I add an "Add to Cart" and "Checkout" buttons here? I think I need to re-write all of this in order for me to create this buttons because I think it will require more PHP contents. Any tips or answers? var Cost; function tally() { Cost = 0; if (document.orderform.item1.checked) { val = document.getElementById("Item1").value; Cost = Cost + (val * 1765.00); } if (document.orderform.item2.checked) { val = document.getElementById("Item2").value; Cost = Cost + (val * 1765.00); } if (document.orderform.item3.checked) { val = document.getElementById("Item3").value; Cost = Cost + (val * 9900.00); } if (document.orderform.item4.checked) { val = document.getElementById("Item4").value; Cost = Cost + (val * 5060.00); } if (document.orderform.item5.checked) { val = document.getElementById("Item5").value; Cost = Cost + (val * 6600.00); Cost = peso(Cost); document.orderform.Total.value = "P" + Cost; } function peso(amount) { amount = parseInt(amount * 100); amount = parseFloat(amount / 100); var x = Math.floor(amount); if (amount == x && (amount - x) == 0) { amount = amount + ".00"; return amount; } if ((amount * 10) - (x * 10) == 0) { amount = amount + "0"; return amount; } if ((amount * 100) - (x * 100) == 0) { amount = amount; return amount; } return amount; } function CalculateTotal(orderform) { Cost = 0; if (document.orderform.item1.checked) { val = document.getElementById("Item1").value; Cost = Cost + (val * 1765.00); } if (document.orderform.item2.checked) { val = document.getElementById("Item2").value; Cost = Cost + (val * 1765.00); } if (document.orderform.item3.checked) { val = document.getElementById("Item3").value; Cost = Cost + (val * 9900.00); } if (document.orderform.item4.checked) { val = document.getElementById("Item4").value; Cost = Cost + (val * 5060.00); } if (document.orderform.item5.checked) { val = document.getElementById("Item5").value; Cost = Cost + (val * 6600.00); } Cost = peso(Cost); document.orderform.Total.value = "P" + Cost; } Nike Home Products …
type: Question
downvote count: 4
upvote count: 0
tagged with: javascript
has title: ADD TO CART & CHECKOUT in html
tagged with: html-table
has comment: http://stackoverflow.com/comment/45930013

http://stackoverflow.com/q/28903927
tagged with: dynamic
tagged with: ruby-on-rails
downvote count: 1
has title: How can I know email is duplicated with devise dynamically
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46067460
tagged with: devise
score: -1
has comment: http://stackoverflow.com/comment/46067239
answer count: 2
possible better answer: http://stackoverflow.com/a/28926030
upvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I made sign_up page with devise. In this page, inputed email can be checked valid or not. And it output the message dynamically with jQuery like this. // Output_email-message dynamically $('#user_email').focusin(function () { $('#user_email').keyup(function () { $('#output-email').text(''); }) }); $('#user_email').focusout(function () { $('#output-email').removeClass('field-output-comple').addClass('field-output'); if ($('#user_email').val().length &lt; 1) { $('#output-email').text('&lt;%= t 'devise.registrations.output_email_blank' %&gt;'); } else if (!isValidEmailAddress($('#user_email').val())) { $('#output-email').text('&lt;%= t 'devise.registrations.output_email_uncomple' %&gt;'); } else { $('#output-email').text('&lt;%= t 'devise.registrations.output_email_comple' %&gt;'); $('#output-email').removeClass('field-output').addClass('field-output-comple'); } }) But I don't know how can I check this inputed email is duplicated or not dynamically. Is there any function can be useful in devise? Thanks for reading.
has answer: http://stackoverflow.com/a/28925666
has answer: http://stackoverflow.com/a/28926030
accepted answer: http://stackoverflow.com/a/28925666

http://stackoverflow.com/comment/45859605
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28791727
has text: @bosslee - I'm not quite sure what you mean ?

http://stackoverflow.com/comment/46103941
score: 0
type: Comment
has text: @Anthony glad you found it helpful :)
comment on: http://stackoverflow.com/a/28879359
type: AnswerComment

http://stackoverflow.com/comment/45974716
has text: @tramp-man do you want something like this http://jsfiddle.net/0mt1ruvh/
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28854070

http://stackoverflow.com/a/28890333
has body: these: var Par1 = document.getElementById("para1"); var Frame1 = document.getElementById("iframe1"); shoud be done on load, i.e.: // Global declaration, thos I don't think this matter as much as.... var Par1 ; var Frame1 ; // ...this. Your calls to getElementById() may be executing before // the page has finished loading. Making the assignment in OnLoad // guarantees the elements are available an I'm thinking should fix // the issue with it not working first time through. function init() { Par1 = document.getElementById("para1"); Frame1 = document.getElementById("iframe1"); } html: &lt;body onload="init();"&gt;
answers question: http://stackoverflow.com/q/28890213
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/46076814

http://stackoverflow.com/q/28815276
has comment: http://stackoverflow.com/comment/45903279
favorite count: 0
has comment: http://stackoverflow.com/comment/45903641
possible better answer: http://stackoverflow.com/a/48133849
has answer: http://stackoverflow.com/a/48133849
type: Question
has comment: http://stackoverflow.com/comment/45903449
tagged with: php
accepted answer: http://stackoverflow.com/a/28827617
tagged with: lua
has comment: http://stackoverflow.com/comment/45903316
linked to: http://stackoverflow.com/q/12692727
has comment: http://stackoverflow.com/comment/45915478
answer count: 3
upvote count: 1
has comment: http://stackoverflow.com/comment/45902646
has answer: http://stackoverflow.com/a/28817503
tagged with: javascript
has comment: http://stackoverflow.com/comment/45903112
has answer: http://stackoverflow.com/a/28827617
type: AnsweredQuestion
downvote count: 0
score: 1
has title: Intepreted language inside PHP for running user scripts
has comment: http://stackoverflow.com/comment/45902407
has body: My application need to do some math operations on some data. Since theese operations are going to change very often, I was thinking of using an interpreted language and let the user write them. I see that PHP has both LUA and a sort of JS parser, however the documentations is very poor. Are there any interpreted languages that can be parsed from PHP? I only need basic if-then-else and math operators

http://stackoverflow.com/q/28853379
tagged with: express
has comment: http://stackoverflow.com/comment/45974122
has comment: http://stackoverflow.com/comment/45987573
tagged with: node.js
favorite count: 0
answer count: 0
has body: I'm trying to create a simple login application, for which i wanna store session of logged in user. But everytime i'm trying to access the req.session in another module it says undefined where as the values are set to it already. Following is my code. app.js var express = require('express') , routes = require('./routes') , login = require('./routes/login') , userInfo = require('./routes/userInfo') , MemoryStore = new express.session.MemoryStore() , http = require('http') , path = require('path'); var app = express(); // all environments app.set('port', process.env.PORT || 7272); app.set('views', __dirname + '/views'); app.set('view engine', 'ejs'); app.use(express.favicon()); app.use(express.logger('dev')); app.use(express.bodyParser()); app.use(express.cookieParser()); app.use(express.session({ store : MemoryStore, secret: 'random_string_goes_here', duration: 30 * 60 * 1000 })); app.use(routes); app.use(express.methodOverride()); app.use(express.static(path.join(__dirname, 'public'))); app.use(function(req, res, next) { res.header('Access-Control-Allow-Origin', '*'); res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept, Authorization'); next(); }); app.use(app.router); // development only if ('development' === app.get('env')) { app.use(express.errorHandler()); } app.get('/', routes.index); app.post('/login', login.afterLogin); app.get('/userInfo', userInfo.userInfo); http.createServer(app).listen(app.get('port'), function(){ console.log('Express server listening on port ' + app.get('port')); }); login.js var usrname, paswd; var ejs = require("ejs"); var mysql = require("./mysql"); var jwt = require('jwt-simple'); function afterLogin (req, res) { var getU = "SQL Query"; mysql.fetch(function(err,results){ if(err) { throw err; } else { if (results.length &gt; 0){ req.session.usrname = req.param("username"); res.send({ "login":"Success", "error" : "none" }); } else { res.json({ "login":"Fail", "error" : "User Not Valid" }); } } }, …
type: UnansweredQuestion
has title: req.session is undefined in another module
upvote count: 1
score: 1
tagged with: session
type: Question
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/28854293
has comment: http://stackoverflow.com/comment/45975317
score: 0
has body: ready() is not valid on iframe as a selector, use load event $('#frame').on('load',function () { console.log("laddad"); test(); });
has comment: http://stackoverflow.com/comment/45976266
has comment: http://stackoverflow.com/comment/45976342
answers question: http://stackoverflow.com/q/28854109
type: Answer
has comment: http://stackoverflow.com/comment/45976153
has comment: http://stackoverflow.com/comment/45975119
has comment: http://stackoverflow.com/comment/45975683
has comment: http://stackoverflow.com/comment/45976945
has comment: http://stackoverflow.com/comment/45975620

http://stackoverflow.com/a/28873084
upvote count: 5
score: 5
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/83107116
accepted answer of: http://stackoverflow.com/q/28872720
type: Answer
answers question: http://stackoverflow.com/q/28872720
has body: I was able to accomplish what I wanted with a ng-click function. app.run(function($rootScope, $state) { $rootScope.navigate = function($event, to, params) { // If the command key is down, open the URL in a new tab if ($event.metaKey) { var url = $state.href(to, params, {absolute: true}); window.open(url,'_blank'); } else { $state.go(to, params); } }; }); Usage &lt;tr ng-repeat="item in items" ng-click="navigate($event, 'view-item',{itemId:item.id})"&gt;

http://stackoverflow.com/q/28767811
tagged with: ajax
score: 0
answer count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: widget
upvote count: 1
has answer: http://stackoverflow.com/a/29015451
downvote count: 1
type: Question
has body: Lets imagine that I have some widget: Widget1; I call this widget in view file. &lt;?= Widget1::widget() ?&gt; When you click on some element, a new instance of the widget should be called and execute js scripts of this widget. I can not realize the script execution after ajax call;
has title: yii2: Dynamically call widget
tagged with: yii2
tagged with: javascript

http://stackoverflow.com/comment/45808353
type: QuestionComment
comment on: http://stackoverflow.com/q/28764164
has text: Reading the error and seeing your code, my guess is that is related with a missing attribute on the tag `<hx:inputHelperAssist id="assist1" promptCharacter="" errorClass="inputText_Error" />` Change it to `<hx:inputHelperAssist id="assist1" promptCharacter="" errorClass="inputText_Error" length="10"/>` Just to test. You will need to see the docs of this tag if it is the case.
score: 0
type: Comment

http://stackoverflow.com/comment/45996934
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28853924
type: Comment
has text: The mistake was somewhere else - see above.

http://stackoverflow.com/q/28858830
linked to: http://stackoverflow.com/q/36077391
type: Question
score: 10
tagged with: javascript
has answer: http://stackoverflow.com/a/51134811
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/37565319
favorite count: 0
has title: How to render heatmap.js on an image?
type: UnansweredQuestion
has body: I am using heatmap.js to overlay a heatmap using the GoogleMaps plugin. I would like to be able to download the picture as an image along with the heatmap overlay. I tried the method heatmapInstance.getDataURL() only returns the overlay region and not along with the image on which it is overlayed.
upvote count: 10
tagged with: heatmap
has comment: http://stackoverflow.com/comment/45984368

http://stackoverflow.com/comment/45985772
has text: I recommend to the read the [**MDN JavaScript tutorial about objects**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects#Objects_and_properties).
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28859926
score: 1

http://stackoverflow.com/comment/45803872
type: AnswerComment
comment on: http://stackoverflow.com/a/28761741
type: Comment
has text: True, however the browser will cache the result, so its not quite the same as doing two separate regex tests. I guess in reality you'd need to know if the results should fail more frequently then it passes
score: 0

http://stackoverflow.com/a/33603011
answers question: http://stackoverflow.com/q/28812504
score: 0
has body: Try this function getCurrentTime(date) { var hours = date.getHours(), minutes = date.getMinutes(), ampm = hours &gt;= 12 ? 'pm' : 'am'; hours = hours % 12; hours = hours ? hours : 12; // the hour '0' should be '12' minutes = minutes &lt; 10 ? '0'+minutes : minutes; return hours + ':' + minutes + ' ' + ampm; } var timeOptions = { 'timeFormat': 'h:i A', 'disableTimeRanges': '12am', getCurrentTime(new Date()) }; &amp; you can use this var timeOptions = { 'timeFormat': 'h:i A', 'minTime': getCurrentTime(new Date()) };
type: Answer

http://stackoverflow.com/comment/45795711
type: QuestionComment
score: 0
has text: already try remove e.preventDefault() code??
comment on: http://stackoverflow.com/q/28757441
type: Comment

http://stackoverflow.com/a/42172578
type: Answer
has body: I had been using JSEncrypt JavaScript file to achieve conversation between JavaScript and Python using pycrypto however during encryption in JavaScript it uses a random pad in the function pkcs1pad2 which needed to be removed and it started working. It had been a hack but it worked out. Following are the lines are commented out from function pkcs1pad2(s,n) while(n &gt; 2) { // random non-zero pad x[0] = 0; while(x[0] == 0) rng.nextBytes(x); ba[--n] = x[0]; } ba[--n] = 2; ba[--n] = 0;
answers question: http://stackoverflow.com/q/28792966
score: 0

http://stackoverflow.com/comment/46030804
type: AnswerComment
type: Comment
has text: @AdamBoustead could you close your question so that it won't become one of those zombie questions here on SO? Thanks
comment on: http://stackoverflow.com/a/28865354
score: 0

http://stackoverflow.com/q/28878180
score: 1
has title: How to get the index of a tr when traversing the table and when adding a new element
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28878226
upvote count: 1
answer count: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28878226
has body: I'm traversing a table with jquery, but I want to get the index of the tr at specific moments of the tranvers table: $('table#tabla_materia tr').each(function() { if(typeof ($(this).find('input.cep').val()) !== 'undefined'){ // get the index here rowIndex } // get the index of the new element var nuevoRegistro = tbl_materia.insertRow(rowIndex+1); nuevoRegistro.setAttribute('class', 'cep'); } Can you help me please.
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/q/28905800
has answer: http://stackoverflow.com/a/28906153
has comment: http://stackoverflow.com/comment/46094223
has comment: http://stackoverflow.com/comment/46094032
type: AnsweredQuestion
score: 2
type: Question
accepted answer: http://stackoverflow.com/a/28906153
downvote count: 0
has comment: http://stackoverflow.com/comment/46088343
tagged with: javascript
tagged with: http://stackoverflow.com/tag/q
has comment: http://stackoverflow.com/comment/46099863
has comment: http://stackoverflow.com/comment/46071160
has title: Don't include q promise result in sequentially chained promises
answer count: 1
has comment: http://stackoverflow.com/comment/46072464
favorite count: 0
tagged with: promise
has body: I have the following sequentially chained Q promise that fills in a hierarchy of user->properties->tenants->reminders: return getAllUsers() // get all users of the system .then(function(users) { return Q.all(users.map(function(user) { return getUserProperties(user) // foreach user of the system get their properties .then(function(properties) { user.properties = properties; return Q.all(properties.map(function(property) { return getPropertyTenants(property) // foreach property get active tenants .then(function(tenants) { property.tenants = tenants; return Q.all(tenants.map(function(tenant) { return getTenantReminders(property, tenant) // foreach tenant get their payment reminders .then(function(reminders) { // if reminders.length == 0 we don't want to include this user tenant.reminders = reminders; }); })); }); })); }).thenResolve(user); })); }); The point of this promise chain is to get all payment reminders for a tenant and then send an email to each user with a list of the tenant reminders (per user). If there are no reminders resolved from getTenantReminders() then ideally the user from the top-level getAllUsers() would not be included in the result. I thought about throwing a special error from getTenantReminders().then() handler that goes up the chain and is handled in thenResolve(user) which then does NOT return the user. Not sure if this is the proper way. Appreciate any advice.
upvote count: 2

http://stackoverflow.com/comment/45851997
type: QuestionComment
comment on: http://stackoverflow.com/q/28787954
has text: Can you share a link to a copy of the spreadsheet?
score: 0
type: Comment

http://stackoverflow.com/q/28905111
has comment: http://stackoverflow.com/comment/46069573
has comment: http://stackoverflow.com/comment/46070262
answer count: 1
tagged with: angularjs-ng-repeat
favorite count: 0
has body: I have two with their own controllers. The first div has a ng-model="listEntries". I initialize listEntries in this 's controller. app.controller('firstController', function($scope,serviceForFirst){ serviceForFirst.init(); serviceForFirst.getList($scope); }); Html {{each.name}} I pass the $scope to the getList() and set the $scope.listEntries value in serviceForFirst. I then use listEntries as ng-model. app.service('serviceForFirst',function(){ var list=[]; var init=function(){ list = [{....}]; }; var getList=function($scope){ $scope.listEntries = list; }; var update=function(newEntity){ list.push(newEntity); }; return{ init:init, getList:getList, update:update }; }); This is my second controller and the service associated to it. I intend to push new elements into listAll every time I invoke addNew(). This is how I'm trying to do it. app.controller('secondController', function($scope,serviceForSecond){ serviceForSecond.init(); $scope.addNew=function(newEntity){ serviceForSecond.addNew(newEntity); }; }); app.service('serviceForSecond',function(serviceForFirst){ var entities=[]; var init=function(){ entities=[{....}]; }; var addNew=function(newEntity){ entities.push(newEntity); serviceForFirst.update(newEntity); return{ init:init, addNew:addNew }; }); The HTML for this .... .... But the list is not getting updated in the first . If I try to do $scope.$apply() in getList() before setting $scope.listEntries then I get $digest already in progress error. When I do console.log(), I see that the appropriate function in each the services are getting invoked but the list is not being updated. How should I update the list?
has title: How to update the ng-repeat model of controller from another controller?
tagged with: angularjs
upvote count: 2
has answer: http://stackoverflow.com/a/28905672
type: AnsweredQuestion
score: 2
tagged with: angularjs-digest
tagged with: angularjs-scope
type: Question
has comment: http://stackoverflow.com/comment/46070116
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28905672

http://stackoverflow.com/q/28901778
tagged with: javascript
has answer: http://stackoverflow.com/a/28902626
has comment: http://stackoverflow.com/comment/46063508
answer count: 3
has comment: http://stackoverflow.com/comment/46063447
has comment: http://stackoverflow.com/comment/46064269
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46063131
has comment: http://stackoverflow.com/comment/46063091
possible better answer: http://stackoverflow.com/a/28902198
tagged with: http://stackoverflow.com/tag/xml
favorite count: 0
has answer: http://stackoverflow.com/a/28902198
has comment: http://stackoverflow.com/comment/46063669
has comment: http://stackoverflow.com/comment/46064185
downvote count: 2
accepted answer: http://stackoverflow.com/a/28902626
upvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46063328
has body: this is my first post, sorry if i have made any mistakes, i am trying to populate xml data from a local xml file into a html table, below is the html content: Type Gender Age (xmldata) (xmldata) (xmldata) (xmldata) (xmldata) (xmldata) (xmldata) (xmldata) (xmldata) This is the javascript: < script > if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.open("GET", "/xmltest.xml", false); xmlhttp.send(); xmlDoc = xmlhttp.responseXML; document.write(" Type Gender Age "); var x = xmlDoc.getElementsByTagName("test"); for (i = 0; i < x.length; i++) { document.write(" "); document.write(x[i].getElementsByTagName("Type")[0].childNodes[0].nodeValue); document.write(" "); document.write(x[i].getElementsByTagName("Gender")[0].childNodes[0].nodeValue); document.write(" "); document.write(x[i].getElementsByTagName("Age")[0].childNodes[0].nodeValue); document.write(" "); } document.write(" "); < /script> This is my XML file: <?xml version="1.0" encoding="UTF-8"?> <test Type="S" Gender="Male" Age="11"/> <test Type="S" Gender="Female" Age="54"/> <test Type="M" Gender="Female" Age="37"/> <test Type="M" Gender="Female" Age="35" /> <test Type="M" Gender="Male" Age="22"/> <test Type="A" Gender="Female" Age="29"/> <test Type="Unknown"/> <test Type="I" Gender="Female" Age="72"/> any comment/suggestions would be greatly appreciated. Many thanks
score: -1
has title: Javascript, XML to HTML
type: Question
has answer: http://stackoverflow.com/a/28903795

http://stackoverflow.com/q/28900545
duplicate of: http://stackoverflow.com/q/4234619
upvote count: 1
downvote count: 1
has title: how to avoid nodejs callback hell?
linked to: http://stackoverflow.com/q/18095107
has comment: http://stackoverflow.com/comment/46060568
has comment: http://stackoverflow.com/comment/46060535
has body: I am new to node/Mongo, and I have already run what I gather is "callback hell". Here's a simple example I copied from the book. It simply connects to mongo, adds and drops a collection and logs these operations: var MongoClient = require('mongodb').MongoClient; MongoClient.connect("mongodb://dbadmin:da@localhost:27017/", function(err, db) { var newDB = db.db("newDB"); newDB.collectionNames(function(err, collectionNames) { console.log("Initial collections: "); console.log(collectionNames); newDB.createCollection("newCollection", function (err, collection){ newDB.collectionNames( function (err, collectionNames) { console.log("Collections after creation: "); console.log(collectionNames); newDB.dropCollection("newCollection", function (err, results) { newDB.collectionNames( function (err, collectionNames) { console.log("Collections after deletion: "); console.log(collectionNames); db.close(); }); }); }); }); }); }); This code works, but it already seems really hard to read and maintain. I have been researching what to do about this, and there seems to be differing opinions out there. If someone could offer an alternative way to code this, which library dependency, if any, does the best job, and a re-write of this example, it would be greatly appreciated!!!
type: Question
tagged with: mongodb
has comment: http://stackoverflow.com/comment/46060525
tagged with: javascript
has comment: http://stackoverflow.com/comment/46060714
tagged with: callback
score: 0
tagged with: asynchronous
tagged with: node.js
favorite count: 0
linked to: http://stackoverflow.com/q/4234619
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/45999478
score: 0
type: QuestionComment
has text: You haven't actually asked a question.
type: Comment
comment on: http://stackoverflow.com/q/28867372

http://stackoverflow.com/comment/46027686
type: Comment
comment on: http://stackoverflow.com/q/28880990
has text: @geocodezip :).. obviously I was looking for an _out-of-the-box_ solution. GoogleMaps has a very powerful geocode library I was expecting it to support CountryCodes as well as CountryNames.
score: 0
type: QuestionComment

http://stackoverflow.com/q/28797213
tagged with: html-frames
has title: How to force a HTML frame content to use specific browser version?
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45868875
has comment: http://stackoverflow.com/comment/45868860
tagged with: http://stackoverflow.com/tag/html
answer count: 1
linked to: http://stackoverflow.com/q/12641511
type: UnansweredQuestion
has body: My web application was running fine till IE 10 and Firefox. I'm facing script issues while trying to use it in IE 11. My entire application comes under a frame of another HTML document whose meta header can't be changed to support specific version i.e IE 8. &lt;meta http-equiv="X-UA-Compatible" content="IE=8" or ("EmulateIE8")&gt; I would like to force my frame alone to use IE 8 version irrespective of the parent document's browser version. When i try to use this inside my frame and check the document.documentMode() in JS, i'm getting only the parent's mode and not the IE 8 which i want the frame to be.
tagged with: internet-explorer-11
has answer: http://stackoverflow.com/a/28797248
type: Question

http://stackoverflow.com/comment/45898750
type: QuestionComment
has text: Sorry. I´m not yet familiar with the exact meaning of loop. Excuse me for my dilettant expression. I thought it might be a loop because the commands within the if are executed over and over again. Doesn´t it qualify as a loop then?
comment on: http://stackoverflow.com/q/28813349
score: 0
type: Comment

http://stackoverflow.com/q/28840149
linked to: http://stackoverflow.com/q/28799419
tagged with: node.js
tagged with: http://stackoverflow.com/tag/xml
answer count: 0
has title: Lightweight library to create XML strings from javascript?
type: Question
tagged with: javascript
has body: Need to generate OpenOffice XML strings on node.js and browser environments including Chrome and IE 10/11. It seems like writing XML would be a solved problem and a library would exist. Many people upvoted @Jason's advice to use a library not invent ones own. On Node.js cheerio.js is great. Ok, so you have to add a couple arguments to create a node, as in var $el = cheerio(&lt;'patternFill/&gt;',null,null,{xmlMode:true}) but that's okay. On the browser, you'd thing jQuery would have this. But I'm going crazy: $('&lt;patternFill') lower cases tag names on creation, so you have to use $el = jQuery.parseXML('') to keep the camel case as XML is case sensitive. jQuery $el.html() lower cases tagnames and includes only the inner HTML, so you have to use $el[0].outerHTML with XMLSerializer instead jQuery outerHTML isn't defined in IE 10 or IE11 (How to reliably convert XML to String in IE 10/11?) So fine. Writing an XML string seems simple enough. But then I have to escape quotes and such which brought me to this post, in which What characters do I need to escape in XML documents? Then it turns out there are different kinds of quotes. What about embedded escaped quotes, such as "\"" -- do I turn that into "\&amp;quot;" or "&amp;quot;"? Etc. So now it feels like I'm reinventing jQuery and cheerio. This can't be right. Is there a simple Javascript library for writing XML programmatically?
linked to: http://stackoverflow.com/q/1091945
score: 0
has comment: http://stackoverflow.com/comment/45949586
tagged with: jquery
has comment: http://stackoverflow.com/comment/45949824
type: UnansweredQuestion

http://stackoverflow.com/q/28803287
has comment: http://stackoverflow.com/comment/45880088
tagged with: selenium-webdriver
has answer: http://stackoverflow.com/a/28803864
tagged with: selenium-chromedriver
linked to: http://stackoverflow.com/q/20714460
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28803739
has answer: http://stackoverflow.com/a/45339587
score: 13
has answer: http://stackoverflow.com/a/34195822
has title: how to break promise chain
has answer: http://stackoverflow.com/a/43166532
type: Question
has comment: http://stackoverflow.com/comment/45880473
accepted answer: http://stackoverflow.com/a/28832276
answer count: 8
has answer: http://stackoverflow.com/a/55948790
tagged with: javascript
upvote count: 13
possible better answer: http://stackoverflow.com/a/32032344
has comment: http://stackoverflow.com/comment/45891241
has answer: http://stackoverflow.com/a/28832276
has answer: http://stackoverflow.com/a/32032344
downvote count: 0
has comment: http://stackoverflow.com/comment/45880197
favorite count: 0
has comment: http://stackoverflow.com/comment/45880240
has body: I a promise in such fashion, function getMode(){ var deferred = Promise.defer(); checkIf('A') .then(function(bool){ if(bool){ deferred.resolve('A'); }else{ return checkIf('B'); } }).then(function(bool){ if(bool){ deferred.resolve('B'); }else{ return checkIf('C'); } }).then(function(bool){ if(bool){ deferred.resolve('C'); }else{ deferred.reject(); } }); return deferred.promise; } checkIf returns a promise, and yes checkIf cannot be modified. How do I break out of the chain at the first match? (any way other than explicitly throwing error?)
tagged with: promise
linked to: http://stackoverflow.com/q/28250680
linked to: http://stackoverflow.com/q/23803743
linked to: http://stackoverflow.com/q/43159752
has comment: http://stackoverflow.com/comment/45886918

http://stackoverflow.com/comment/115546466
score: 0
type: Comment
has text: Thank you. I wanted to open a new tab instead so I used `chrome.tabs.create` instead of `chrome.windows.create` :)
comment on: http://stackoverflow.com/a/28800008
type: AnswerComment

concurrency
tag name: concurrency
type: Tag
tags question: http://stackoverflow.com/q/28856509

http://stackoverflow.com/comment/45984616
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28859430
score: 0
has text: Do you mean use filter outside of an ng-repeat? That is possible to do.

http://stackoverflow.com/a/28839809
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/45952352
has comment: http://stackoverflow.com/comment/45955119
has comment: http://stackoverflow.com/comment/45954362
downvote count: 0
answers question: http://stackoverflow.com/q/28839512
has comment: http://stackoverflow.com/comment/45955490
upvote count: 1
has comment: http://stackoverflow.com/comment/45955441
has body: We have almost the same setup in our project. The .net/c# backend, and a lot of client stuff (JS, scss, html). We run our build/test through Gulp.js. Gulp is a streaming build system, very fast - and easy to configure. Also has lots of plugins for common tasks. To kick off the karma runner from gulp, you can create a task in your gulpfile like this: var gulp = require('gulp'); var karma = require('karma').server; /** * Run test once and exit */ gulp.task('test', function (done) { karma.start({ configFile: __dirname + '/karma.conf.js', singleRun: true }, done); }); Then we use a Visual Studio extension called Task Runner Explorer. This extension lets you execute any Gulp task or target inside Visual Studio. You can also bind any Gulp task or target to a Visual Studio event, such as Build and Solution Open. That way you can run certain tasks when you build your project or run Gulp Watch when the solution is opened.

http://stackoverflow.com/a/28863308
type: Answer
has body: Starting with Angular 1.3, there is native Bind Once support. when iterating over a large number of items, you can eliminate the watchers on static elements which will not change. For Example: &lt;li ng-repeat="product in ::all_products track by product.cat_id"&gt; Will iterate through the all_products array once to populate the ngRepeat, but will not continue to be bound to $watch for change tracking. Smart use of :: can drastically improve performance. Also, converting ng-class= to a function instead of an inline expression evaluation can improve performance and give you greater control over your output.
score: 0
answers question: http://stackoverflow.com/q/28863091
has comment: http://stackoverflow.com/comment/45993588

http://stackoverflow.com/comment/136613718
comment on: http://stackoverflow.com/q/28790744
type: QuestionComment
has text: it's simpler than it looks, just wrap the value in Promise.resolve in setter (Promises gets flattened) and use await keyword on getter. That's all.
score: 0
type: Comment

http://stackoverflow.com/q/28840414
has comment: http://stackoverflow.com/comment/45990426
downvote count: 0
answer count: 7
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/36258179
has answer: http://stackoverflow.com/a/68116188
has answer: http://stackoverflow.com/a/30052028
has comment: http://stackoverflow.com/comment/45990826
has comment: http://stackoverflow.com/comment/45952069
has body: I'm trying to allow all html tags /* etc */ and html attributes like below (class, id) for eg: SOME COOL CONTENT HERE in ckeditor. I found something like in docs.ckeditor.com config.allowedContent = { $1: { // Use the ability to specify elements as an object. elements: CKEDITOR.dtd, attributes: true, styles: true, classes: true } }; config.disallowedContent = 'script; *[on*]'; and added it to config.js in ckeditor's root folder. But nothing changed. When i'm trying to add some html tags on ckeditor's source code block it's erasing all of html contents. What am i missing? Thanks in advance. Version: ## CKEditor 4.4.7 EDIT & UPDATE: After @Eelke and @Necreaux answers i added allowedContent = true in my config.js. Now basic html elements such working perfectly. But ckeditor still striping tags. Completely Config JS CKEDITOR.editorConfig = function( config ) { config.allowedContent = true; config.removeFormatAttributes = ''; // Define changes to default configuration here. // For complete reference see: // http://docs.ckeditor.com/#!/api/CKEDITOR.config // The toolbar groups arrangement, optimized for two toolbar rows. config.toolbarGroups = [ { name: 'clipboard', groups: [ 'clipboard', 'undo' ] }, { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] }, { name: 'links' }, { name: 'insert' }, { name: 'forms' }, { name: 'tools' }, { name: 'document', groups: [ 'mode', 'document', 'doctools' ] }, { name: 'others' }, '/', { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] }, { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] }, { name: 'styles' }, { name: 'colors' }, { name: 'about' } ]; // Remove some buttons provided by the standard plugins, which are // not needed in the Standard(s) toolbar. config.removeButtons = 'Underline,Subscript,Superscript'; // Set the most common block elements. config.format_tags = 'p;h1;h2;h3;pre;'; // Simplify the dialog windows. config.removeDialogTabs = 'image:advanced;link:advanced'; };
has comment: http://stackoverflow.com/comment/45990710
tagged with: regex
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45990886
has answer: http://stackoverflow.com/a/28873957
has answer: http://stackoverflow.com/a/53932759
has comment: http://stackoverflow.com/comment/45952131
has title: How to allow all html tags and attributes with CKeditor?
has answer: http://stackoverflow.com/a/28841209
type: Question
has comment: http://stackoverflow.com/comment/45990825
tagged with: ckeditor
has comment: http://stackoverflow.com/comment/45951639
score: 27
possible better answer: http://stackoverflow.com/a/28840673
linked to: http://stackoverflow.com/q/18250404
has answer: http://stackoverflow.com/a/28840673
upvote count: 27
accepted answer: http://stackoverflow.com/a/28873957
linked to: http://stackoverflow.com/q/15659390

http://stackoverflow.com/q/28858983
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28859307
has answer: http://stackoverflow.com/a/28859034
tagged with: http://stackoverflow.com/tag/html
tagged with: css
favorite count: 0
has title: Change text of anchor once it is clicked with jQuery
possible better answer: http://stackoverflow.com/a/28859034
has body: I am using the following code to show/hide a div when an anchor is clicked. $(document).ready(function(){ $(".slidingDiv").hide(); $(".show_hide").show(); $('.show_hide').click(function(){ $(".slidingDiv").slideToggle(); }); }); So, when the 'show_hide' div is clicked, 'slidingDiv' shows. But, how can I change the text of the 'show_hide' div once it is clicked. E.g. I want 'show_hide' to read 'Toggle Open', how can i change it once it is clicked to 'Toggle Close' ? Thanks!
accepted answer: http://stackoverflow.com/a/28859307
type: AnsweredQuestion
score: 3
upvote count: 3
type: Question
answer count: 2

http://stackoverflow.com/q/28883660
has comment: http://stackoverflow.com/comment/46029269
answer count: 2
upvote count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/46030233
has answer: http://stackoverflow.com/a/28883795
has answer: http://stackoverflow.com/a/28883874
accepted answer: http://stackoverflow.com/a/28883874
tagged with: http://stackoverflow.com/tag/html
has title: Replacing text on web page using HTML or Javascript
tagged with: css
type: AnsweredQuestion
has body: I am customizing an HTML page provided and hosted by a third-party, so I am severely restricted in what I can do to the page. On the page there is a navigation menu that looks like this. Home Page ... Question: How can I make the above snippet display the text "Home" instead of "Home Page", if all I am allowed to do is add a element in the page ; and add some HTML code (which may include Javascript) near the start of the page? I have a considered going down one of these two paths, but both paths are problematic. 1) Use CSS to hide their text ("Home Page"). Add my own text ("Home") using :before or :after pseudo-selectors. display: none is probably not a good way to hide the text, because browsers that don't understand :before and :after will still understand display: none and I will end up with no text at all. Are there better CSS alternatives for me? Change font size to 0? change text color? Manipulate z-index somehow? It is OK if some older browsers display the text "Home Page". It is not OK if some browsers display "Home Page Home", or if some browser do not display any text at all. -- OR -- 2) Use Javascript to manipulate the DOM The difficulty with Javascript is that I can only insert it near the start of the page body before the elements that I want to modify. I could hook an event that fires after the entire page is loaded, but I want to avoid the page text flashing (the text "Home Page" being displayed briefly and then changing to "Home"). Is there such an event and how would I hook it? Thank you for you help.
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/46044514
type: Question
possible better answer: http://stackoverflow.com/a/28883795
tagged with: javascript

http://stackoverflow.com/a/33946844
has comment: http://stackoverflow.com/comment/96835225
upvote count: 3
type: Answer
has body: If you need a solution for IE9 (since it does not support the defer attribute), I have created a small loader script: https://github.com/mudroljub/js-async-loader It loads all your scripts asynchronously and then executes them in order.
has comment: http://stackoverflow.com/comment/96768401
downvote count: 0
answers question: http://stackoverflow.com/q/28893519
score: 3
has comment: http://stackoverflow.com/comment/96794177

http://stackoverflow.com/q/28859277
type: Question
has answer: http://stackoverflow.com/a/33374155
has answer: http://stackoverflow.com/a/28859445
has answer: http://stackoverflow.com/a/28859335
accepted answer: http://stackoverflow.com/a/28859335
answer count: 3
tagged with: javascript
tagged with: jquery
tagged with: events
has comment: http://stackoverflow.com/comment/45984358
has body: I have an application with a lot ajax actions going on. So pretty much all my events are handled like this: jQuery( 'body' ).on( 'click', '#id', function ( event ) { // Do something }); instead of: jQuery( '#id' ).click( function() { // Do something }); This works with all events pretty well except the scroll event like this doesn't work: jQuery( 'body' ).on( 'scroll', '#id', function ( event ) { // Do something }); With the mousewheel event it works great. Is there anything wrong or is there no scroll event?
type: AnsweredQuestion
score: 0
has title: jQuery on scroll event not firing
tagged with: scroll
possible better answer: http://stackoverflow.com/a/28859445

http://stackoverflow.com/q/28853843
has comment: http://stackoverflow.com/comment/45976464
score: 1
has comment: http://stackoverflow.com/comment/45975322
upvote count: 1
type: Question
tagged with: javascript
has title: Calling property from an object set to prototype
has comment: http://stackoverflow.com/comment/45974276
answer count: 2
has answer: http://stackoverflow.com/a/28854245
downvote count: 0
has comment: http://stackoverflow.com/comment/45974359
linked to: http://stackoverflow.com/q/436120
has comment: http://stackoverflow.com/comment/45976362
has answer: http://stackoverflow.com/a/28855523
favorite count: 0
has comment: http://stackoverflow.com/comment/45974956
type: UnansweredQuestion
has body: var Foo = function() { this.message = "Hi"; } Foo.prototype = { say: { hi: function() { console.log(this.message); } } } [edit]I know "this" in hi() refers say, is there any way to achieve this? var he = new Foo(); he.say.hi(); //"Hi" to console
has comment: http://stackoverflow.com/comment/45976086

http://stackoverflow.com/comment/45837033
type: QuestionComment
has text: yea i'll edit the post
score: 0
comment on: http://stackoverflow.com/q/28779945
type: Comment

http://stackoverflow.com/q/28799709
tagged with: http://stackoverflow.com/tag/html
has title: JavaScript Variables and User Input
tagged with: css
accepted answer: http://stackoverflow.com/a/28799817
tagged with: user-input
type: AnsweredQuestion
score: 0
has answer: http://stackoverflow.com/a/28799876
type: Question
possible better answer: http://stackoverflow.com/a/28799876
tagged with: javascript
has body: Situation: Currently I have a search box utilizing jQuery’s autocomplete plugin that allows the user to search for a sport’s team and then once found select on a submit button where it appends the team as a list item (preferable functionality would be when the user clicks on the actual team to append the item but at this point I am unsure of how to apply an on click function to the autocomplete drop down – suggestions welcome). I am looking for a way to associate the newly appended list item to a predefined class or id so that certain formatting and displays are applied to the appended list item as soon as it is appended.Basically the user can search for any team in the NHL, NFL, etc. and I need to pair text colors and logos with them depending on which team they select - but the logos will appear separately in the body not in the list. Example Code: TEST I have tried using a combination of if statements and document.getElementById to try and alter the html content but I cannot piece my thoughts together. My thoughts: if (tags == "Boston Red Sox") { Then append "Boston Red Sox" with specific formatting as a list Item and corresponding logo below. } else { dont do anything } http://jsfiddle.net/kumcav30/ (ideally when appended it would resemble something like the fiddle). Any input is greatly appreciated.
has answer: http://stackoverflow.com/a/28799817
answer count: 2
tagged with: jquery

http://stackoverflow.com/q/28880699
tagged with: textbox
favorite count: 0
has body: When "Other" is selected from the DDL all I want is for the textbox to appear. However it always displays instead of being hidden until called. My view markup is: &lt;div class="form-group"&gt; @Html.LabelFor(model =&gt; model.SelectType, "Select Type", new { @class = "control-label col-md-5" }) &lt;div class="col-md-1"&gt; @Html.DropDownList("SelectType", null, new { @id = "Other" }) @Html.TextBoxFor(model =&gt; model.OtherSpecify, new { @id = "OtherSpecify" }) @Html.ValidationMessageFor(model =&gt; model.SelectType) &lt;/div&gt; I tried the following two javacript codes without any success &lt;script&gt; document.addEventListener("DOMContentLoaded", function () { $("SelectType").trigger("change"); }) $("#SelectType").on("change", function () { if ($("#SelectType option:selected").val() == 3) { $("#OtherSpecify").hide(); } else { $("#OtherSpecify").show(); } }); &lt;/script&gt; &lt;script&gt; document.addEventListener("DOMContentLoaded", function () { $("SelectType").trigger("change"); }) $(function () { $('.OtherSpecify').show(); $("Other").change(function () { if ($(this).is(":selected")) { $(this).parent().next().hide(); } else { $(this).parent().next().show(); } }); }) &lt;/script&gt;
has answer: http://stackoverflow.com/a/28883062
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28883062
upvote count: 3
has comment: http://stackoverflow.com/comment/46023030
has comment: http://stackoverflow.com/comment/46022827
has title: Make a textbox appear when a value is selected from a dropdown list in MVC
type: Question
has comment: http://stackoverflow.com/comment/46022884
score: 3
tagged with: asp.net-mvc
answer count: 2
possible better answer: http://stackoverflow.com/a/28881325
has comment: http://stackoverflow.com/comment/46023075
has answer: http://stackoverflow.com/a/28881325
downvote count: 0
tagged with: javascript
tagged with: drop-down-menu

http://stackoverflow.com/a/28876668
has body: You have to use .html() which you previously used to count value. $.cookie("mycookie", $('.item_count').html()); Instead Of $.cookie("mycookie", $('.item_count').text);
type: Answer
accepted answer of: http://stackoverflow.com/q/28876468
score: 1
answers question: http://stackoverflow.com/q/28876468
upvote count: 1
has comment: http://stackoverflow.com/comment/46015399
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28864478
has answer: http://stackoverflow.com/a/28865029
answer count: 3
has body: My problem consist in that I have some data in REST service and I want to get them and then send to rest of controllers. But I don't know how to do correctly because service $http.get() is perform asynchronously. I will show you piece of my code in order to better represent problem. I created controller which is responslible for get data from REST service. MyApp.controller("AppController", ["$scope", "$http", function($scope,$http) { $http.get("http://localhost:8080/library/book").success(function(data) { $scope.bookList = data; }); $http.get("http://localhost:8080/library/author").success(function(data) { $scope.authorList = data; }); $http.get("http://localhost:8080/library/publisher").success(function(data) { $scope.publisherList = data; }); }]); BookList, authorList, publisherList are building materials for rest of controllers. Ok, I show other piece of code. MyApp.service("BookListModel", function() { this.createBookList = function(bookList, authorList, publisherList) { var i = 0, j = 0, authorName, publisherName, bookListItems = []; for(; i &lt; bookList.length; i++) { for(; j &lt; authorList.length; j++) { if(bookList[i].authorId == authorList[j].authorId) { authorName = authorList[j].name; } } j = 0; for(; j &lt; publisherList.length; j++) { if(bookList[i].publisherId == publisherList[j].publisherId) { publisherName = publisherList[j].name; } } j = 0; bookListItems.push({'title' : bookList[i].title, 'author' : authorName, 'publisher' : publisherName}); authorName = "", publisherName = ""; } return bookListItems; }; }); For example this is one of my serivces. It create book list with authors and publishers and it take three arguments and I don't know how pass data from AppController to createBookList function.
tagged with: angularjs
has answer: http://stackoverflow.com/a/28864756
accepted answer: http://stackoverflow.com/a/28864756
has answer: http://stackoverflow.com/a/28864690
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28865029
type: Question
has comment: http://stackoverflow.com/comment/45994383
has title: How share data from rest service between controllers
tagged with: javascript
score: 0

http://stackoverflow.com/comment/46063948
type: QuestionComment
has text: Scripts should go right before the end body tag, when applicable.
comment on: http://stackoverflow.com/q/28901913
score: 0
type: Comment

http://stackoverflow.com/comment/46007189
comment on: http://stackoverflow.com/q/28871240
type: Comment
type: QuestionComment
score: 0
has text: @self, that is nor my code , i found it while searching about my problem.

http://stackoverflow.com/comment/45907146
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28817625
type: Comment
has text: This will probably enable leading zero's which seem - for some reason - not to be allowed.

http://stackoverflow.com/comment/45936356
comment on: http://stackoverflow.com/q/28833095
score: 0
type: Comment
type: QuestionComment
has text: Are you using jqueryUI library ?

http://stackoverflow.com/a/28869339
accepted answer of: http://stackoverflow.com/q/28868977
type: Answer
score: 1
has body: I would recommend using a .json file since you are working with JSON{Objects}. I've made a demo of the file here and I've made a demo of the data analysis here. Note: Demo file is hosted in a personal server, so it may not work later on. Now the file isn't proper JSON Syntax, so it needs some parsing. entries.json {"id":"8f546dcf-b66a-4c53-b3d7-7290429483b8","price":"247.96000000","size":"0.03121005","product_id":"BTC-USD","side":"sell","stp":"dc"} {"id":"0ec4b63a-b736-42af-a0aa-b4581bf12955","price":"247.90000000","size":"0.03910014","product_id":"BTC-USD","side":"sell","stp":"dc"} (..) JavaScript Req = new XMLHttpRequest(); Req.onload = process_entries; Req.open("get", "http://butler.tk/entries.json", true); Req.send(); function process_entries() { var response = Req.responseText; var arrayed = "[" + response .split("}") .join("},") .slice(0,-1) + "]"; var entries = JSON.parse(arrayed); for (var i = 0, l = entries.length; i &lt; l; i++) { var entry = entries[i]; //entry.id,entry.size,etc. } } We fetch the file with a XMLHttpRequest(). We parse the file so that it's valid JSON Syntax, the file will now look like this. entries.json (parsed) [ {"id":"8f546dcf-b66a-4c53-b3d7-7290429483b8","price":"247.96000000","size":"0.03121005","product_id":"BTC-USD","side":"sell","stp":"dc"}, {"id":"0ec4b63a-b736-42af-a0aa-b4581bf12955","price":"247.90000000","size":"0.03910014","product_id":"BTC-USD","side":"sell","stp":"dc"}, (..) ] We parse the file into a JSON{Object} We iterate through the array of objects and access their properties. Note: If you have control over how the data is saved, you can save the data in the array format instead of parsing it. Hope it helps! :)
upvote count: 1
answers question: http://stackoverflow.com/q/28868977
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/28816540
accepted answer of: http://stackoverflow.com/q/28816318
downvote count: 0
answers question: http://stackoverflow.com/q/28816318
has body: I found another method here without the lazyload plugin. Use the option "fnRowCallback": customFnRowCallback and then this function will replace the first column with an image tag. function customFnRowCallback( nRow, aData, iDisplayIndex ) { $('td:eq(0)', nRow).html( '&lt;img class="" src="http://aaaaa/'+ aData.attribute+'" alt="" /&gt;' ); return nRow; }
score: 4
type: AcceptedAnswer
type: Answer
upvote count: 4

pdo
tags question: http://stackoverflow.com/q/28789199
tag name: pdo
type: Tag
tags question: http://stackoverflow.com/q/28814535
tags question: http://stackoverflow.com/q/28775626
tags question: http://stackoverflow.com/q/28831302

http://stackoverflow.com/a/28890472
answers question: http://stackoverflow.com/q/28890280
score: 0
has body: You should use an event handler/listener. There's no need to recompute the data when it hasn't been changed - that's needless work the browser is doing. But it certainly doesn't have to be on the entire body. Instead of firing an event based on how the user interacts with the entire page, you can fire an event for when the user interacts with specific elements (the boxes you refer to). For example, I'll assume you use &lt;input&gt; fields: you can bind the 'input' event using jQuery to each field and run the computation function each time it fires. See the various answers to this question here for more details. Attaching an event handler to the body can be useful in some instances, but for your case, appears to only add needless overhead. The MDN has a page on event listeners in modern browsers - jQuery isn't absolutely necessary for this either.
type: Answer
has comment: http://stackoverflow.com/comment/46042052

http://stackoverflow.com/a/39074330
score: 3
upvote count: 3
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/28828306
has body: If you want to scroll to an element you can use browser.actions().mouseMove(element).perform(); After that the browser will be focusing the element.

http://stackoverflow.com/comment/46008956
type: QuestionComment
has text: Soorry that my reaction is late because i felt sick.. My user value has something in it if i console.log(user) I get my email address but my function doesn't do anything.. :( @LShetty
score: 0
comment on: http://stackoverflow.com/q/28813872
type: Comment

http://stackoverflow.com/comment/45920244
score: 0
type: AnswerComment
type: Comment
has text: then you can download it and add to your file make sure it cannot effect to your another js
comment on: http://stackoverflow.com/a/28824533

http://stackoverflow.com/comment/45906305
score: 0
comment on: http://stackoverflow.com/a/28817322
has text: @vks: no it doesn't. The `|` is bounded less tight than the concat.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46135738
type: Comment
comment on: http://stackoverflow.com/a/28894005
type: AnswerComment
has text: I add new question http://stackoverflow.com/questions/28940540/displaying-values-in-row-of-table-from-existing-item-in-new-row
score: 0

http://stackoverflow.com/comment/46068380
has text: Can you post screenshot of how your photos look?
type: QuestionComment
comment on: http://stackoverflow.com/q/28899935
score: 0
type: Comment

http://stackoverflow.com/comment/45957808
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28844368
has text: Can you copy the output of the jade code with script and place in jsfiddle?
score: 0

http://stackoverflow.com/comment/46011485
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28873293
has text: Thanks,I have tried this way its working ,but its blocking me from getting the entire object.Currently in the selected option am getting the entire object and i am extracting id,name,fullname from that object.I know without optionsvalue setting values is not possible.Is there any way to get the entire object ?

http://stackoverflow.com/comment/46028811
has text: have a look: http://stackoverflow.com/questions/24710503/how-do-i-post-urlencoded-form-data-with-http-in-angularjs
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28883723

http://stackoverflow.com/comment/45879108
type: AnswerComment
comment on: http://stackoverflow.com/a/28801833
type: Comment
has text: Yea, ultimately it's just a pidgeonhole issue: Javascript basically has five types that make sense in the database: Number, String, Boolean, Array, and Object. Databases can have hundreds of types, custom types, you name it. So any `5-->(n > 5)` mapping will involve some weirdness here and there.
score: 1

http://stackoverflow.com/comment/45840036
type: Comment
type: QuestionComment
has text: @NewToJS exactly! that is what am looking for, could you explain how to do? Basically am trying to do is T9 typing keyboard in JavaScript.
comment on: http://stackoverflow.com/q/28781353
score: 0

http://stackoverflow.com/q/28785465
has answer: http://stackoverflow.com/a/28786454
tagged with: amd
has body: I'm using an existing js library that uses AMD modules in my typescript code. I want to use a Javascript class as the base for my Typescript class. This is what I'm trying to do: famous.js define('famous/core/View',['require','exports','module'],function(require, exports, module) { function View() { ... } ... module.exports = View; }); View.d.ts declare module "famous/core/View" { } AppView.ts import View = require('famous/core/View'); class AppView extends View { } export = AppView; But it says "Cannot find name 'View'". I suppose it's logical it doesn't work since a module is not a class, but I don't know another way.
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/28786454
score: 2
upvote count: 2
possible better answer: http://stackoverflow.com/a/28785661
has answer: http://stackoverflow.com/a/28785661
has title: Typescript, require module as class
type: AnsweredQuestion
tagged with: typescript

http://stackoverflow.com/comment/45923590
type: QuestionComment
comment on: http://stackoverflow.com/q/28826513
score: 0
has text: I'm a bit of a noob, what is the content-type header?
type: Comment

http://stackoverflow.com/comment/45992869
type: QuestionComment
comment on: http://stackoverflow.com/q/28863599
score: 1
has text: The code in your jsFiddle example doesn't match the code you posted
type: Comment

http://stackoverflow.com/a/28809674
answers question: http://stackoverflow.com/q/28809584
type: Answer
score: 3
has body: Simple as this: /^[१-९][०-९]*$/ Check the working here:https://regex101.com/r/lA6rS5/2
downvote count: 1
has comment: http://stackoverflow.com/comment/45899384
upvote count: 4

http://stackoverflow.com/a/28799309
has comment: http://stackoverflow.com/comment/57806769
has comment: http://stackoverflow.com/comment/45965660
answers question: http://stackoverflow.com/q/28793529
type: Answer
has comment: http://stackoverflow.com/comment/45952083
has comment: http://stackoverflow.com/comment/45895461
downvote count: 1
has comment: http://stackoverflow.com/comment/53531617
has comment: http://stackoverflow.com/comment/45884819
upvote count: 5
has body: Yup there is a simple solution if you're using a custom renderer already. I posted the solution in this question here. Essentially, you can have an array with the column indeces you want to hide and in the custom renderer (since it gets called for every cell in your table) do td.hide() if col is a column you want hidden. After checking in IE, it turns out this solution still works. If anything you can use td.style.display = 'none' and 'auto' to hide/display the div. But the problem is not with the hiding, it's with the onkeydown event that I quickly wrote for teaching purposes. I'm sure you can figure out that part on your own as it is out of the scope of this question. To hide the column header, use jQuery to find the &lt;th&gt; that you want to hide. One way is to ask for all of them, then use a filter function on the text until it matches the header you want. It's an expensive, O(n) solution so if I were you I'd do this once at the beginning of the script, save a map from column index to &lt;th&gt;, and then work off of that. New Technique: Look to this jsFiddle for more info. You were right in that this method is messy and not too efficient so I coded something less messy though still hacky. Instead of changing the rendering, we can hide columns by updating the columns option. If you look the the new code, what it now does is update the columns array, and column headers. This gets closer to a real column hiding feature with the only setback that it doesn't keep sorting or rearranged rows/columns. If this was also a requirement for your application then I'll keep an eye with you on the issue you raised on the git project and hope for the best :) Let me know if this new method works for you.
score: 4
has comment: http://stackoverflow.com/comment/45932979
has comment: http://stackoverflow.com/comment/45889634
has comment: http://stackoverflow.com/comment/45933390
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28793529

c++
tags question: http://stackoverflow.com/q/28878973
tags question: http://stackoverflow.com/q/28791536
tags question: http://stackoverflow.com/q/28861335
type: Tag
tags question: http://stackoverflow.com/q/28901436
tags question: http://stackoverflow.com/q/28893063
tags question: http://stackoverflow.com/q/28847204
tag name: c++

http://stackoverflow.com/comment/46536489
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28759015
score: 0
has text: The ember code from comment when entered in console does seem to select the right element, but without being able to set it / update the Ember model (sorry, it may actually update the UI, just not the rest of the model which usually updates from manually inputting into the field). It has no unique identifiers to target via css/xpath, only ember generated ids...

http://stackoverflow.com/comment/45894282
has text: We're do you think I should add a closure..?
comment on: http://stackoverflow.com/q/28802874
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28822058
type: AnsweredQuestion
tagged with: fabricjs
type: Question
tagged with: canvas
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28837820
tagged with: html5-canvas
score: 1
has comment: http://stackoverflow.com/comment/45924711
favorite count: 0
has title: how to move a image when i drag the other image in the other canvas at same time
has body: I am using fabric.js to handle two canvases. I also set two canvases to compare two images in a same page. like this: I want to move a image when i drag the other image in the other canvas. I mean when I drag a image to change the position in firstImg canvas, I also move the other image in secondImg canvas at same time. Is it possible??
upvote count: 1
accepted answer: http://stackoverflow.com/a/28837820

http://stackoverflow.com/comment/45843940
type: Comment
comment on: http://stackoverflow.com/a/28783772
score: 0
type: AnswerComment
has text: thanks, I was hoping there was a better way, but I guess I was correct assuming it's not possible.

http://stackoverflow.com/q/28827663
type: Question
tagged with: for-loop
upvote count: 0
tagged with: javascript
score: -1
has title: Javascript code breaks with loop
has comment: http://stackoverflow.com/comment/45925634
answer count: 1
has answer: http://stackoverflow.com/a/28827851
has comment: http://stackoverflow.com/comment/45925766
favorite count: 0
has body: I have been trying to do this for class, but I cannot seem to get it to work. I need to have radio buttons to choose one of 4 coins. q,d,n,p. Then a select box with value up to 10. When I change the select, Java needs to add the selected amount of coins, and show total, and display that many coins. I have the add part down, but when I add the loop, it breaks the addition part of the project. I don't know if I have the loop right, but right now I would like to know why my code breaks when I add the loop? Code I have so far. &lt;script type="text/javascript"&gt; function doCalculate() { //Variable for calculation Q = document.getElementById('txtMoney').value; //If statements for selecting the correct radiobutton if (document.getElementById('rbQ').checked) { answer = Q * .25; } if (document.getElementById('rbD').checked) { answer = Q * .10; } if (document.getElementById('rbN').checked) { answer = Q * .05; } if (document.getElementById('rbP').checked) { answer = Q * .01; } //show results document.getElementById('results').innerHTML = "$ " + answer + "&lt;br&gt;Dollars and Cents" //variables for coins using ID txtMoney from Select loopCounter = document.getElementById('txtMoney').value //If radio of coin is checked and loopcounter is higher then 0 run for loop if (document.getElementById('rbQ').checked &amp;&amp; loopCounter &gt; 0;) { document.getElementById('quarter').src = "quarter.gif"; } resultsString = "" //for loop to count via select box value, and display that many images // of which ever coins radio is checked. for (x = 0; x &lt; loopCounter; x++) { resultsString = loopCounter + quarter.gif //write to results2 via innerHTML document.getElementById('results2').innerHTML = resultsString; } } &lt;/script&gt;
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45969638
tagged with: loops
has comment: http://stackoverflow.com/comment/45925856
downvote count: 1

http://stackoverflow.com/q/28755387
answer count: 1
tagged with: angularjs
has body: So i am saving my Session user into a $localStorage however since my system is used in the marketing business my users wont be using their own private computer each time they need to access the application. Because of this if a user choose not to log out before exiting the application i will have to remove the session value from the $localStorage My question is how?
tagged with: local-storage
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/2858057
type: Question
has title: Angular delete localStorage value on close
tagged with: javascript
has comment: http://stackoverflow.com/comment/45792326
score: 0
has answer: http://stackoverflow.com/a/28755561
accepted answer: http://stackoverflow.com/a/28755561
has comment: http://stackoverflow.com/comment/45792244

http://stackoverflow.com/q/28865153
has body: I am trying to use ace editor in my nodejs app which utilizes angular-ui-ace. I am not able to see the ace editor on the screen, even though i see the div filled out in the html. I am following instructions from here:ui-ace index.html: ... ... app.js: 'use strict'; angular.module('plsdiffApp', [ 'ngCookies', 'ngResource', 'ngSanitize', 'ngRoute', 'btford.socket-io', 'ui.ace', 'ui.bootstrap' ]) main.html: ... main.less: .ace_editor { height: 200px; } main.controller.js: $scope.aceLoaded = function(_editor){ // Editor part var _session = _editor.getSession(); var _renderer = _editor.renderer; alert('inside aceLoaded'); // Options _editor.setReadOnly(true); _session.setUndoManager(new ace.UndoManager()); _renderer.setShowGutter(false); _session.setValue('<?xml version="1.0" encoding="UTF-8"?><dummy_xml id="1"></dummy_xml>'); // Events _editor.on("changeSession", function(){ alert('changeSession'); }); _session.on("change", function(){alert('change');}); }; Rendered html: But i don't see the ace editor at all. What am i doing wrong? Thanks.
tagged with: angularjs
tagged with: ace-editor
upvote count: 3
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45995411
has title: Can't see ace editor when using angular-ui-ace
has answer: http://stackoverflow.com/a/32858817
has comment: http://stackoverflow.com/comment/45995652
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
score: 3
has answer: http://stackoverflow.com/a/29443446
tagged with: css
tagged with: node.js

http://stackoverflow.com/comment/45837143
comment on: http://stackoverflow.com/q/28778618
score: 0
type: Comment
type: QuestionComment
has text: @Quentin, could tell me good one,

http://stackoverflow.com/comment/46006886
comment on: http://stackoverflow.com/q/28774855
has text: Then it must be something with your web sever.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28762640
tagged with: ruby-on-rails
tagged with: maps
type: Question
has answer: http://stackoverflow.com/a/28782610
tagged with: javascript
score: 0
has body: I did a map on rails 4.2. Javascript to add pins, and some information when mouse-over the pin, like so; marker = new google.maps.Marker({ position: position, map: map, title: "title_x", .. also, i added an infowindow for each marker, like so: google.maps.event.addListener(marker, 'click', (function(marker, i) { return function() { infoWindow.setContent("contentx"); infowindow.open(map, marker.serviceObject);} })(marker, i)); Problem 1: When i do 'mouseover' over the pins, it shows me the TITLE. That's good. But, it does so only one or two or three times - then nothing. When reloading the page, or - opening another tab or, after going back to another program (changing the window) - it works, again, once or twice. Problem 2: the infowindow does not open at all, say, when i 'click' onto the pin, nothing happens. not sure if these are the same problems or two issues. Reading a lot of answers in SO, i tried these things, but not change. a/ delete the turbolinks-line in application.js Also: adding this: data-no-turbolink (into the navigation-link, into the div that contains the map) b/ in the 'main' javascript file: $(document).on('ready page:load', function () { loadScript(); }); c/ in this file that shows the map): &lt;script type="text/javascript"&gt; $(document).on('ready page:load', function () {initialize();}); // ADDED window.nearbys= &lt;%=raw @myparams.to_json %&gt;; google.maps.event.addDomListener(window, 'load', initialize); &lt;/script&gt; When i added the line (ADDED), at least, it showed the map and pins (before, no reaction). Even that it seems for me, that two times the same instruction is executed - anyhow, it works. Such, my problem: - what i can read in SO, it seems, that people disabled the turbolinks - i did, no change. - also, it seems that something is executed once after reloading (for me, it is happening a few times? but that maybe depends on other issues?) For any link (besides the solutions that i tried and described above) i would be very gla…
answer count: 1
accepted answer: http://stackoverflow.com/a/28782610
type: AnsweredQuestion
has title: maps, rails 4.2, javascript, mouse-over, only working once (or twice) .. then after reload

http://stackoverflow.com/q/28836278
type: UnansweredQuestion
upvote count: 1
linked to: http://stackoverflow.com/q/2490825
has comment: http://stackoverflow.com/comment/46180458
score: 1
has answer: http://stackoverflow.com/a/28836425
type: Question
has body: Lets say I have two hidden form field inputs: &lt;input id="val1" name="val1" value="0"/&gt; &lt;input id="val2" name="val2" value="0"/&gt; Lets say I have a warning DIV with a message that I want to display if both of these inputs have a value of "1" &lt;div id="myWarningDiv" style="display: none;" class="clswhatever"&gt; You have done something wrong comrade! &lt;/div&gt; Now suppose there are many ways to trigger a change one or both of these hidden field values. What I don't want to do is change code on each of these triggers to check if both of these values are "1". Is there a way I can just add a custom event that would just listen for this to happen, without using setInterval or anything clugy like that? This is a simple example. What I am really looking for is NOT a way to attach an event to a single DOM element, but to create a custom condition that might span mutiple DOM objects, but when triggered would call an event handler function. Heres some pseudo code: public Boolean onBothTrue() { if (document.getElementById("val1").value == "1" &amp;&amp; document.getElementById("val2").value == "1") { return true; } else { return false; } } document.addEventListener('onBothTrue',myEventHandler); function myEventHandler() { var elem = document.getElementById("myWarningDiv"); elem.style.display = "block"; }
has answer: http://stackoverflow.com/a/28911003
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46195769
linked to: http://stackoverflow.com/q/25083201
has comment: http://stackoverflow.com/comment/45942607
has title: Custom Event for HTML form
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28941977
favorite count: 0
has comment: http://stackoverflow.com/comment/45942789
has answer: http://stackoverflow.com/a/28922114
has answer: http://stackoverflow.com/a/28911065
answer count: 5

http://stackoverflow.com/a/28874694
type: Answer
upvote count: 6
has comment: http://stackoverflow.com/comment/63385795
has body: MVC Bundling provides a solution to this problem. To take advantage of it, add this to your App_Start\BundleConfig.cs file: bundles.Add( new ScriptBundle("~/bundles/filename") .Include("~/Scripts/filename.js")); Then in your view: @section Scripts{ @Scripts.Render("~/bundles/filename") } Why this helps In a Release build, all the Javascript files in a bundle will be served from a unique URL which contains a hash of their content. This means that if the Javascript files change between builds then the URL of the bundle will change, and so browsers will download the new version. The bundle is also served with an Expires HTTP header 1 year in the future - improving the response speed of the site on future user visits/page requests. It can safely do this because the URL changes when the bundle content changes. Even if you're only including a single Javascript file in a page, I'd still create a bundle for it - to take advantage of the cache control, and also the minification. See the section on "Bundle Caching" in the linked article for a more detailed explanation.
downvote count: 1
score: 5
has comment: http://stackoverflow.com/comment/70544256
answers question: http://stackoverflow.com/q/28874578

http://stackoverflow.com/comment/45910644
comment on: http://stackoverflow.com/q/28819370
has text: Take a close look at the syntax for `button.onclick`. You're missing something...
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28840369
type: Answer
answers question: http://stackoverflow.com/q/28840185
upvote count: 1
score: 1
has body: PHP is server side so the php value will only be set once.You have to use javascript to loop the id's. function checkform() { for (i = 1; i &lt; &lt;?php echo $MaxValueOfSelects+1); ?&gt;; i++) { var a=document.getElementById("selectcell"+i); alert(a.options[a.selectedIndex].value); } }
has comment: http://stackoverflow.com/comment/45950047
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28840185

http://stackoverflow.com/comment/45885987
type: Comment
type: QuestionComment
has text: in the second line data = 10; you are just reassigning data variable to hold the value 10..
comment on: http://stackoverflow.com/q/28806425
score: 0

http://stackoverflow.com/comment/46053186
comment on: http://stackoverflow.com/q/28896262
score: 0
has text: So you have some sort of Ajax that populates the DDL?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45917053
has text: i basically want a item to slideDown open and when another item is clicked that one slides up then the next slides down.
comment on: http://stackoverflow.com/q/28822719
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28897561
answers question: http://stackoverflow.com/q/28897027
upvote count: 1
type: Answer
has body: As regards as euro problem, you can also use a filter to display the value. This filtre is currency and put all value in this format : $0.00. Moreover you can also change the currency symbol. You can do it like this : You can find more information here : http://docs.angularjs.org/api/ng.filter:currency
downvote count: 0
score: 1

http://stackoverflow.com/q/28853199
has answer: http://stackoverflow.com/a/28853720
tagged with: reactjs
downvote count: 0
has comment: http://stackoverflow.com/comment/45977350
favorite count: 0
type: Question
score: 4
has title: ReactJs: callback function is not called in case of this.setState
answer count: 1
has body: As in this fiddle http://jsfiddle.net/69z2wepo/3535/ this.setState is called in componentWillMount with callback this.loadData. But the function this.loadData is never called as callback.
tagged with: javascript
type: UnansweredQuestion
upvote count: 4

http://stackoverflow.com/comment/45978594
comment on: http://stackoverflow.com/q/28777894
score: 0
has text: Sounds like the encoding in Opera is screwed up...only playing keyframes.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45896450
has text: It seems to me that all of these issues are caused because you do not understand the code which you are using. If you are using code which you found (on the internet for example), you should always try to understand it all and learn how it works. That way you will avoid issues like this in the future and learn new things while you're at it. Next time, you won't need to use code from the internet and you will be able to write it yourself (which is usually better).
score: 0
comment on: http://stackoverflow.com/q/28812021
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45795672
type: QuestionComment
comment on: http://stackoverflow.com/q/28757441
has text: try http://jsfiddle.net/arunpjohny/61cnx24z/1/
type: Comment
score: 0

http://stackoverflow.com/q/28806262
has answer: http://stackoverflow.com/a/28806509
accepted answer: http://stackoverflow.com/a/28806509
type: AnsweredQuestion
has body: Why does window.requestAnimFrame must be called like this: window.requestAnimFrame(this.__proto__.animate.bind(this)); and not like window.requestAnimFrame(this.__proto__.animate);. My js-class looks like: Game = function (moduleConfig, gameConfig) { this.moduleConfig = moduleConfig; this.gameConfig = gameConfig; // Game-Commands this.keyCommands = { moveLeft: false, moveRight: false }; // Some init stuff requestAnimFrame(this.animate.bind(this)); return this; } /** * Init the game system * @param {moduleConfig} moduleCongif - Module-Config instance */ Game.prototype = { // General member self: null, moduleConfig: null, gameConfig: null, // Game member renderer: null, catcher: null, stage: null, // Nested 'static' objects keyCommands: { moveLeft: false, moveRight: false }, // Some more stuff /** * Main loop */ animate: function () { window.requestAnimFrame(this.__proto__.animate.bind(this)); // Some more things to do } } If i do not use bind, i get the following error message: Failed to execute 'requestAnimationFrame' on 'Window': The callback provided as parameter 1 is not a function.. Thank you!
possible better answer: http://stackoverflow.com/a/28806557
type: Question
tagged with: bind
has title: Why requestAnimFrame need bind(this)
tagged with: requestanimationframe
tagged with: prototype
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28806557
tagged with: javascript

http://stackoverflow.com/q/28802489
has answer: http://stackoverflow.com/a/28825504
answer count: 2
has comment: http://stackoverflow.com/comment/45878772
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28811573
possible better answer: http://stackoverflow.com/a/28825504
has title: Regex to remove redundant multiplication/division involving zero or one?
score: 3
has body: I have an odd problem where I am receiving computer generated equations (as a string) where multiplications/divisions with zero or one and lone zeros are occasionally present. These equations are to be presented to a user in string form. I know that I can remove these redundant parts of the equation by implementing a kind of parser, but I was curious as to whether a regular expression could be used to remove them. I came up with the following before I finally gave up on my (quite limited) regex skills: /([^\+\-]*(?:0|0\*|\*0){1,}[^\+\-]*)|(?:1\*|\*1)/g It seems to work only if: there are no non-zero numbers with a zero in them (ie. no 10's,20's,etc.) there are no negations. It also doesn't work well with parentheses. Unfortunately parentheses are quite common. Note that removing the redundant portions stated above may result in redundant parentheses or "zero" parentheses (ie it could turn out like ()*x, which is equivalent to 0*x). The redundant parentheses are not as much of an issue, but I assume the "zero" parentheses could be removed by a second pass similar to the first looking for (). If either of these could be done in the same regex as the one that solves the problem I would be extremely impressed. So I turn to you regex gurus of Stack Overflow. Can it be done? Assumptions The following can be assumed true about the stringified equations: There are no divisions by zero, equations will not have any occurrence of [expr]/0or even expressions that evaluate to [expr]/0 such as [expr]/sin(0). The only operators within the equations themselves are + - * and /. Minus operator (-) includes both subtraction and negation, although negation is always surrounded by parentheses. Any operation other than the above (sin,cos, pow, etc.) will appear as a function call. (no ^ %, etc.) Sample Equation "(0+(0/0.5+(0+1*cos(p)+0*0+0*sin(p))*cos(k)+(0+1*0+0*1+0*0)*(-sin(k))+(0+1*(-sin(p))/0.5+0*0+0*cos(p))*0)*x+(0+(0+1*cos(p)+0*0+0*sin(p))*sin(k)+(0+1*0+0*1+0*0)*cos(k)+(0+1*(-sin(p…
favorite count: 0
has comment: http://stackoverflow.com/comment/45879254
tagged with: regex
has comment: http://stackoverflow.com/comment/45879340
downvote count: 1
has answer: http://stackoverflow.com/a/28811573
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45888324
type: Question
upvote count: 4

http://stackoverflow.com/q/28766468
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28766842
has comment: http://stackoverflow.com/comment/45812079
has comment: http://stackoverflow.com/comment/45811906
has title: Building jQuery DOM elements from a module
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28766842
tagged with: dom
type: Question
score: 0
has body: I really like to modularize my code into separate files, usually because I am writing something that should be able to take some parameters and then easily end up attaching to a DOM element on anyone's page. These modules are usually graphical representations of something like a network topology, and this requires a lot of divs and a decent amount of parameters. My question is when building up the DOM structure, (and when NOT talking about 100s of rows for tables, as an example) what is the best method? These are my own routes and I still struggle to determine which one is best. As String Pieces var myModule1 = function (options) { this.userContainer = options.container; this.wrapper = '&lt;div class = "mm1-wrapper"/&gt;'; this.piece1 = '&lt;div class = "mm1-piece1"/&gt;'; this.piece2 = '&lt;div class = "mm1-piece2"/&gt;'; this.piece3 = '&lt;div class = "mm1-piece3"/&gt;'; } myModule1.prototype.build = function () { var wrap = $(this.wrapper).append(this.piece, this.piece2, this.piece3, ); this.userContainer.append(wrap); } As jQuery pieces in a collection var myModule2 = function (options) { this.userContainer = options.container; this.wrapper = $('&lt;div class = "mm1-wrapper"/&gt;'); this.peices = { 1: $('&lt;div class = "mm1-piece1"/&gt;'), 2: $('&lt;div class = "mm1-piece2"/&gt;'), 3: $('&lt;div class = "mm1-piece3"/&gt;') } } //Using an each loop to append myModule2.prototype.build = function () { $.each(this.piece, function (i, e) { this.wrapper.append(e); }); this.userContainer.append(this.wrapper); } I'm just looking for some insight about 1) Is it resource heavy to store things as jQuery objects? 2) Is it resource heavy to store large pieces in a collection? 3) This is how I have been creating my modules, but I am obviously insecure about them. Does any of this structure make sense?
has comment: http://stackoverflow.com/comment/45812927
answer count: 1

http://stackoverflow.com/a/28812106
type: Answer
answers question: http://stackoverflow.com/q/28811889
has body: Just for the sake of providing an answer that actually does what OP asks for (no more, no less): hr = [hr[0].replace('hr', '* * *')]; No need to use a regular expression when replacing in this case.
score: 0

http://stackoverflow.com/comment/45922167
type: Comment
has text: @RobSands you have to process the reviewmonth on the form processing as well, it'll only be populated after its submitted, you could just use the reviewdate to extract the month on the form processing before db insertion
comment on: http://stackoverflow.com/a/28825230
type: AnswerComment
score: 0

http://stackoverflow.com/q/28887795
linked to: http://stackoverflow.com/q/17838914
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/28889757
tagged with: javascript
has comment: http://stackoverflow.com/comment/46047742
tagged with: http://stackoverflow.com/tag/pdf
has body: I want to embed a javascript snippet inside of a pdf file so that it will immediately print when it's opened from a browser window. To try and achieve this I'm following this example here. I have created a helper class that has a static method to handle this task. I already have the pdf file path string ready to pass into the method. What I don't understand is how the output stream portion of this works. I would like the updated pdf to be saved to my servers hard drive. I do not want to stream it back to my browser. Any guidance would be greatly appreciated. public class PdfHelper { public static void AddPrintFunction(string pdfPath, Stream outputStream) { PdfReader reader = new PdfReader(pdfPath); int pageCount = reader.NumberOfPages; Rectangle pageSize = reader.GetPageSize(1); // Set up Writer PdfDocument document = new PdfDocument(); PdfWriter writer = PdfWriter.GetInstance(document, outputStream); document.Open(); //Copy each page PdfContentByte content = writer.DirectContent; for (int i = 0; i &lt; pageCount; i++) { document.NewPage(); // page numbers are one based PdfImportedPage page = writer.GetImportedPage(reader, i + 1); // x and y correspond to position on the page content.AddTemplate(page, 0, 0); } // Inert Javascript to print the document after a fraction of a second to allow time to become visible. string jsText = "var res = app.setTimeOut(‘var pp = this.getPrintParams();pp.interactive = pp.constants.interactionLevel.full;this.print(pp);’, 200);"; //string jsTextNoWait = “var pp = this.getPrintParams();pp.interactive = pp.constants.interactionLevel.full;this.print(pp);”; PdfAction js = PdfAction.JavaScript(jsText, writer); writer.AddJavaScript(js); document.Close(); } }
linked to: http://stackoverflow.com/q/1268766
favorite count: 0
has comment: http://stackoverflow.com/comment/46042105
accepted answer: http://stackoverflow.com/a/28889757
tagged with: itext
upvote count: 1
has comment: http://stackoverflow.com/comment/46040362
type: AnsweredQuestion
tagged with: c#
score: 1
type: Question
has title: Add javascript to pdf file using iTextSharp

http://stackoverflow.com/comment/45883620
comment on: http://stackoverflow.com/a/28803493
score: 0
type: AnswerComment
has text: Yes. If you want to execute your script after your DOM is loaded.
type: Comment

http://stackoverflow.com/a/28863878
upvote count: 3
score: 3
answers question: http://stackoverflow.com/q/28863599
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46036228
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28863599
has body: You could use CSS3 transitions instead: Example Here document.getElementById('next1').addEventListener('click', function () { document.getElementById('div').style.left = '-100%'; }); document.getElementById('next2').addEventListener('click', function () { document.getElementById('div').style.left = '0%'; }); #div { height:100px; width:100%; position:relative; left: 0; transition: left 400ms ease-in-out; }
type: Answer

http://stackoverflow.com/comment/46241136
type: Comment
has text: [Class Sheet](https://developers.google.com/apps-script/reference/spreadsheet/sheet), [Class Range](https://developers.google.com/apps-script/reference/spreadsheet/range)
comment on: http://stackoverflow.com/a/28868161
score: 0
type: AnswerComment

http://stackoverflow.com/q/28827196
linked to: http://stackoverflow.com/q/28828260
answer count: 4
has comment: http://stackoverflow.com/comment/46127392
has comment: http://stackoverflow.com/comment/46051715
possible better answer: http://stackoverflow.com/a/28827390
has answer: http://stackoverflow.com/a/28827816
has answer: http://stackoverflow.com/a/28827390
score: 16
has comment: http://stackoverflow.com/comment/46127482
has comment: http://stackoverflow.com/comment/46051844
upvote count: 16
tagged with: c#
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28827816
has comment: http://stackoverflow.com/comment/46052027
has comment: http://stackoverflow.com/comment/45931389
has comment: http://stackoverflow.com/comment/45925014
linked to: http://stackoverflow.com/q/5731224
has comment: http://stackoverflow.com/comment/46051918
has answer: http://stackoverflow.com/a/28830617
type: Question
has answer: http://stackoverflow.com/a/28936165
has title: How to call a codebehind function from javascript in asp.net?
downvote count: 0
tagged with: javascript
tagged with: asp.net
favorite count: 0
has comment: http://stackoverflow.com/comment/46073317
has body: I want to call a function from my code behind using javascript. I used the below code: function fnCheckSelection() { some script; window["My"]["Namespace"]["GetPart"](null); } ...where "GetPart" is the function name. However, this is not working. Please help me on this.
has comment: http://stackoverflow.com/comment/45924785
has comment: http://stackoverflow.com/comment/46127366
has comment: http://stackoverflow.com/comment/45927944

http://stackoverflow.com/comment/45961403
has text: It will fire for all that exist at the time the code is run. If you are adding elements after it runs you need to use event delegation
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28846473

http://stackoverflow.com/comment/45949765
has text: Because changing the HTML of the parent ` ` removes the handles that jQuery-UI inserts. The best way to do this would be to make a repeatable function to add the resize ability back to the div. I've added a `makeResizable()` function to the code. I also changed the event handler to `.change()` http://jsfiddle.net/e865rerd/19/
type: Comment
comment on: http://stackoverflow.com/a/28833343
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45954493
type: QuestionComment
has text: Clicking the submit button *submits the form*, which reloads the page.
score: 1
comment on: http://stackoverflow.com/q/28842607
type: Comment

http://stackoverflow.com/comment/45886918
has text: http://stackoverflow.com/questions/23803743/what-is-the-deferred-antipattern-and-how-do-i-avoid-it
comment on: http://stackoverflow.com/q/28803287
type: Comment
score: 1
type: QuestionComment

http://stackoverflow.com/q/28868369
has comment: http://stackoverflow.com/comment/48182717
downvote count: 0
has comment: http://stackoverflow.com/comment/46205741
tagged with: javascript
has answer: http://stackoverflow.com/a/29024964
tagged with: tdd
has comment: http://stackoverflow.com/comment/46121464
favorite count: 0
has comment: http://stackoverflow.com/comment/46133008
has title: Jest not auto mocking common js modules
upvote count: 2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28982249
has comment: http://stackoverflow.com/comment/46058625
tagged with: jestjs
has body: I am trying to wrap my head around testing Flux and React applications using Jest. I started using Scotch.io tutorial as my starting point and will be creating a full test suite to gain knowledge in how to structure my first real react and flux app. You can find my code on github to see where I am at. The test that does not run is FluxProduct-test.jsx jest.dontMock('../FluxProduct'); var React , TestUtils , FluxProduct , FluxCartActions; describe('FluxProduct', function() { var SAMPLE = { product: { id: '1', name: 'Name', image: 'image.png', description: 'this description', variants: [ { sku: '123', type: 'First', price: 1.99, inventory: 1 }, { sku: '456', type: 'Second', price: 2.99, inventory: 3 }, { sku: '789', type: 'Third', price: 3.99, inventory: 2 } ] }, }; function getElement(product, className) { return product.getDOMNode().getElementsByClassName(className)[0]; } function getElementByTag(product, tagName) { return product.getDOMNode().getElementsByTagName(tagName)[0]; } function selectIsActive(select, text) { for( var i = 0; i < select.options.length; i++) { if (select.options[i].textContent == text) { return true } } return false; } beforeEach(function(){ React = require('react/addons') , TestUtils = React.addons.TestUtils , FluxProduct = require('../FluxProduct') , FluxCartActions = require('../../actions/FluxCartActions'); }); it('should have the display all of the fields', function() { var cartItems = []; var selected = SAMPLE.product.variants[1]; var product = TestUtils.renderIntoDocument( <FluxProduct selected={selected} product={SAMPLE.product} cartitems={cartItems} /> ); expect(getElement(product, 'name').textContent).toEqual(SAMPLE.product.name); expect(getElement(product, 'description').textContent).toEqual(SAMPLE.product.description); expect(getElement(product, 'price').textContent).toEqual('Price: $' + selected.price); expect(selectIsActive(getElementByTag(product, 'select'), selected.type)).toEqual(true); }); it('should allow to add another var…
score: 2
tagged with: unit-testing
type: Question
tagged with: reactjs
answer count: 2

http://stackoverflow.com/q/28897461
has body: How can I detect, that value in my textareaId has changed when the change was caused by javascript? eg. $("#buttonID").on("click, function(){ $("#textareaID").val("lorem ipsum"); }); $("#textareaID").change(function(){ //not working }); $("#textareaID").bind('input propertychange', function(){ //not working });
has answer: http://stackoverflow.com/a/28897483
type: Question
has comment: http://stackoverflow.com/comment/46054589
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28897483
answer count: 2
score: 2
tagged with: onchange
tagged with: textarea
downvote count: 0
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/28898728
has title: Detection of textarea value change
upvote count: 2
has comment: http://stackoverflow.com/comment/46055644
has answer: http://stackoverflow.com/a/28898728
type: AnsweredQuestion

http://stackoverflow.com/comment/45831301
has text: Yes @Dia. I do realize how to use .toLowerCase, but I want to learn how to use them.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28776573

http://stackoverflow.com/comment/45955996
comment on: http://stackoverflow.com/q/28839580
has text: It look like the string was being double escaped. @meagar if you want to post your comment as an answer i will accept it. Thanks all!
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28763057
score: 10
tagged with: javascript
has title: Memoization of promise-based function
has answer: http://stackoverflow.com/a/28766851
has answer: http://stackoverflow.com/a/28763603
downvote count: 0
favorite count: 0
tagged with: promise
linked to: http://stackoverflow.com/q/23803743
answer count: 5
tagged with: memoization
has answer: http://stackoverflow.com/a/28766363
accepted answer: http://stackoverflow.com/a/28763603
has body: How can I memoize a promise-based function? Would straightforward memoization of the function suffice? function foo() { return new Promise((resolve, reject) =&gt; { doSomethingAsync({ success: resolve, fail: reject }); }); }; Would this suffice? var fooMemoized = memoize(foo); Note: this question has been updated to remove the deferred anti-pattern.
type: AnsweredQuestion
upvote count: 10
has answer: http://stackoverflow.com/a/45879547
type: Question
possible better answer: http://stackoverflow.com/a/41024899
has comment: http://stackoverflow.com/comment/45805728
has answer: http://stackoverflow.com/a/41024899

http://stackoverflow.com/q/28826465
tagged with: angularjs
has comment: http://stackoverflow.com/comment/46917740
tagged with: watch
downvote count: 0
answer count: 0
type: UnansweredQuestion
has body: I use UI router's resolve object to add a dependency (a promise) to a controller. On initial page load, this gets resolved as intended and the object in the controller is populated with the data from the dependency. I use this object in the view to output a ng-repeat directive. In another state, I have a function that adds to the model (the same that is getting resolved on the previous state). Once added, I transition the state back to the previous state with $state.go(). As the resolve's method fetches the model and injects the dependency into the previous controller, I expect that the ng-repeat output should include the newly added item. But it doesn't. Only when refreshing does the view get updated. From console.loging in the resolve method, I can see that the method is being called and that the data has been fetched. I placed a $watch on the dependency to update the controller's object with the new values, but that watch doesn't get called. Why does the $watch not see the change in the dependency, when it has clearly changed? Route angular.module('app') .config(function($stateProvider, $urlRouterProvider) { $stateProvider .state('tab', { url: "/tab", abstract: true, templateUrl: "templates/tabs.html" }) .state('tab.queries', { url: '/queries', views: { 'tab-queries': { templateUrl: 'templates/tab-queries.html', controller: 'QueriesCtrl as ctrl' } }, resolve: { allTemplates: function(Templates) { return Templates.all().then(function(templates) { console.log(templates); // This outputs with the correct data every time the state is entered return templates; }); } } }) .state('tab.guide', {...}); // controller: GuideCtrl as ctrl }); QueriesCtrl function queriesCtrl($scope, allTemplates) { var vm = this; vm.queries = allTemplates; $scope.$watch('allTemplates', function() { // Called on first load, not on subsequent state changes console.log('templates changed'); vm.queries = allTemplates; }); } GuideCtrl function myCtrl($state) { var vm = this; vm.goToQueries = funct…
type: Question
tagged with: angular-ui-router
score: 1
has title: Updating object on controller from UI router's resolve method, called by $state.go()
upvote count: 1
tagged with: javascript
favorite count: 0

http://stackoverflow.com/q/28774221
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45841355
has comment: http://stackoverflow.com/comment/45829744
upvote count: 2
type: UnansweredQuestion
has title: Google Plus icon not showing - “Display forbidden by X-Frame-Options”
has comment: http://stackoverflow.com/comment/45826951
type: Question
score: 2
tagged with: google-plus-one
linked to: http://stackoverflow.com/q/6666423
has body: I've been trying to add a google plus icon to my webpage but I haven't been able to make it work. I use HTML5 and I have tried doing this: I added the following &lt;script&gt; before the &lt;/body&gt; &lt;script src="https://apis.google.com/js/plusone.js"&gt;&lt;/script&gt; and this in the place I want it to be shown. &lt;g:plusone size="tall" count="true"&gt;&lt;/g:plusone&gt; but I get the following error Refused to display 'https://apis.google.com/u/0/se/0/_/+1/fastbutton?usegapi=1&amp;size=tall&amp;count=…refresh&amp;id=I0_1425069928860&amp;parent=file%3A%2F%2F&amp;pfname=&amp;rpctoken=36362517' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'. I also checked this question but the &amp;output=embed solution isn't working for me. I was able to use the facebook and twitter share using iframe but I can't find an example for doing the same for the google +1. NOTE: The page I'm making is part of an assignment and it's not supposed to be online until after the deadline. I don't know if the problem is because the page is still local on my computer.
has answer: http://stackoverflow.com/a/28777863
has comment: http://stackoverflow.com/comment/45833585
downvote count: 0
answer count: 1
tagged with: google-plus
tagged with: javascript

http://stackoverflow.com/comment/45821428
type: Comment
comment on: http://stackoverflow.com/q/28767471
has text: What is the absolute path to _contacts.html_ and _table.js_ ?
score: 0
type: QuestionComment

http://stackoverflow.com/q/28800800
has comment: http://stackoverflow.com/comment/45875397
favorite count: 0
type: UnansweredQuestion
tagged with: php
has title: Need a script that continues to refresh a page even when user leaves Browser in Android or phone screen goes blank
answer count: 0
has comment: http://stackoverflow.com/comment/45909052
has comment: http://stackoverflow.com/comment/45916126
has body: I have use: $page = $_SERVER['PHP_SELF']; $sec = "3"; header("Refresh: $sec; url=$page"); and &lt;script&gt; setTimeout(function(){ window.location.reload(1); }, 5000); &lt;/script&gt; to refresh my page on an android device. However, it stops refreshing if I leave the browser or my phone screen turns off. How can I keep refreshing?
type: Question
has comment: http://stackoverflow.com/comment/45875520
score: 0
upvote count: 1
downvote count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/28888884
type: Question
tagged with: polymer
has answer: http://stackoverflow.com/a/28889022
tagged with: javascript
has title: In a Polymer-based game: how to display an image depending on the total score
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: web-applications
has body: I'm building a game using javascript and HTML with the Polymer framework. Currently the user gets points when completing a task. When the round ends the screen shows them the total score. What I would like to do is show the user an image as a "badge" depending on the total score. For example: If the total score is 50 or more (but less than 100) show badge1.png If the total score is 100 or more (but less than 200) show badge2.png etc. The following code handles the scoring system. I've got a div that shows all this info when the round is done. What do I need to add for it to show images depending on the total score? I'm a bit puzzled here, thanks. loadScores: function() { var pts = 0; try { this.allScores = JSON.parse(localStorage.getItem('game-scores')); if (!this.allScores) { this.resetScores(); } else { for (var n in this.allScores) { pts += this.sumPts(this.allScores[n]); } this.user.score = pts; } } catch (e) { this.resetScores(); } }, computeScore: function() { if (this.user) { var pts = 0; for (var n in this.allScores) { pts += this.sumPts(this.allScores[n]); } this.user.score = pts; localStorage.setItem('game-scores', JSON.stringify(this.allScores)); } }, resetScores: function() { localStorage.removeItem('game-scores'); if (this.user) { this.user.score = 0; } this.allScores = {}; }, sumPts: function(s) { var pts = 0; for (var i = 0; i &lt; s.length; i++) { pts += (s[i] || 0); } return pts; },
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28889022

webfonts
tags question: http://stackoverflow.com/q/28854796
tag name: webfonts
type: Tag
tags question: http://stackoverflow.com/q/28766532

http://stackoverflow.com/comment/45931571
type: QuestionComment
has text: Use single quote :- init({"test":' "My Test Input " '})
score: 0
comment on: http://stackoverflow.com/q/28830840
type: Comment

http://stackoverflow.com/q/28753812
upvote count: 5
tagged with: javascript
score: 4
tagged with: ng-map
has comment: http://stackoverflow.com/comment/45792291
tagged with: google-maps-api-3
tagged with: google-maps
has answer: http://stackoverflow.com/a/28754507
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/28754507
has body: I'm using Allenhwkim's wonderful ngMap in a project. I know that I need to use Maps Javascript v3 API to manipulate the map, which is going well except that I can't get any event listeners, e.g., $google.maps.event.addListener(markers[i], 'click', function()... to work Specifically, I'm trying to create an onClick event on my markers. Here's an example: http://plnkr.co/edit/HAcEfWl5LR9SGGqbcXcW?p=preview Here, I try to use an ng-click attribute on a marker directive. Still, I get nothing. http://plnkr.co/edit/FqwNhqEgDe75il8nU0sC?p=preview
type: AnsweredQuestion
has title: Using Event listeners with ngMap
downvote count: 1
type: Question

http://stackoverflow.com/comment/45946392
type: Comment
comment on: http://stackoverflow.com/q/28838352
has text: One thing I'd recommend (other than removing the second version of jQuery, unless you need it) is updating the `src` of your first script. Remove the 'http' protocol ` ` - Handles both secure/non-secure sites.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45979840
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28853798
type: Comment
has text: Its working fine now as expected. Thank you so much :)

http://stackoverflow.com/comment/87818790
comment on: http://stackoverflow.com/a/44092250
type: AnswerComment
score: 0
type: Comment
has text: I was trying to do something similar with THREE.Point. But unfortunately, the updateMorphTargets() is not available on THREE.Point. I guess Point is not really a mesh? I will post it as a separate question

http://stackoverflow.com/q/28890880
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/46086195
has body: I'm developing an app with TideSDK and I need to send some data to a PHP script that will create a file to store it on the pc. I'm pretty new to AJAX and to send data I do: var jsonString = JSON.stringify(GW2.items); $.ajax({ url: "/assets/scripts/save.php", type: "post", dataType: "json", data: { jsonString: jsonString } }).done(function(data){ console.log(data); }); Where GW2.items is a JSON object, "save.php" is my script and jsonString is the variable I want to send. But, when I try to execute the program it returns me: POST http://127.0.0.1:52432/assets/scripts/save.php 404 Not Found And the answer is: Cannot POST /assets/scripts/save.php This is the PHP script: &lt;?php $jsonString = $_GET['jsonString']; return {}; ?&gt; I checked the path and it's correct so why it can't find my file?
has comment: http://stackoverflow.com/comment/46086129
has title: JQuery $.ajax request returns me "Error 404" even if the resource exists
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46042794
has answer: http://stackoverflow.com/a/28891082
upvote count: 1
tagged with: php
downvote count: 1
has comment: http://stackoverflow.com/comment/46042952
score: 0
has comment: http://stackoverflow.com/comment/46043325

file
type: Tag
tag name: file
tags question: http://stackoverflow.com/q/28808146
tags question: http://stackoverflow.com/q/28862765
tags question: http://stackoverflow.com/q/28762150
tags question: http://stackoverflow.com/q/28781628

http://stackoverflow.com/comment/45983904
type: AnswerComment
type: Comment
has text: when I used below code, it gave be "undefined" error.
comment on: http://stackoverflow.com/a/28856172
score: 0

http://stackoverflow.com/comment/46023532
comment on: http://stackoverflow.com/a/28878926
score: 0
type: AnswerComment
has text: @Emoyaki, you can fix that by calling show(): http://jsfiddle.net/ezanker/u5nw3bhz/5/
type: Comment

http://stackoverflow.com/comment/46019157
type: QuestionComment
has text: i copied code from Stackoverflow and jsfiddle too can you please write a simple code and make request from that url renault.twobulls.com/?code=waeuhh i am adding code that i used
comment on: http://stackoverflow.com/q/28878554
score: 0
type: Comment

http://stackoverflow.com/a/28776465
answers question: http://stackoverflow.com/q/28776318
accepted answer of: http://stackoverflow.com/q/28776318
score: 0
type: AcceptedAnswer
type: Answer
has body: Consider to use addClass and removeClass. jQuery $(".main-nav ul li ul").each(function() { $(this).mouseover(function() { $(this).parent().addClass('hover'); }); $(this).mouseout(function() { $(this).parent().removeClass('hover'); }); ); CSS .main-nav ul li.hover { background-color: #000; /* bgcolor */ } .main-nav ul li.hover a { color: #fff; } .main-nav ul li.hover ul a { color: #000; /* bgcolor */ }

http://stackoverflow.com/a/28789141
accepted answer of: http://stackoverflow.com/q/28789022
has body: A lot of different ways to do it. One way would be to load the iframes and have CSS have it hidden until a button is pressed which changes the CSS to show the iframe. Example Code https://jsfiddle.net/9og3subh/3/ HTML Click to show CSS #frame { display: none; } JavaScript $( "#button" ).click(function() { $("#frame").css({"display":"inline"}); }); Hope this helped and answered your question.
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28789022
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/45942625
type: AnswerComment
comment on: http://stackoverflow.com/a/28836417
type: Comment
has text: Very nice. Thanks. I was confused initially since of course each carrier has its own countries array. I didn't think of making a function and passing the array.
score: 1

http://stackoverflow.com/q/28789689
has body: So, I made a container div, inside of that div I had a script dynamically create 113 divs with the class name of 'fragment'. Now, everything was in order, I specifically made those 113 divs very tiny, about 5X5 pixels. Then I placed them in container so they spelled out a title. All the divs are in an array called divs. So divs is an array with 113 elements. Now here is where things got confusing, I wanted to make those divs hide behind the browser's invisible area, I achieved this by giving the 'fragments' absolute positioning and styled them to hide eg: divs[45].style.left = -600';, after that, I created a script that would run a for-loop and inside of that for-loop I wanted each little element to go back to it's spot after a delay. However, I had to use closures for that because inserting a SetTimeout()inside of a for-loop is weird. for (i = 0; i &lt; divs.length; i++) { (function(j) { setTimeout(function () { divs[j].style.left = divs[j].offsetLeft + 550; }, Math.floor(Math.random() * 1000)); })(i); //Pass current value into self-executing anonymous function } I can't wrap my head around the code above. I thought that the area whereMath.floor(Math.random() * 1000) is written is to specify the delay in ms. However, if I enter 1000, it will move all 113 elements at once. I don't understand this, shouldn't it wait 1 second before moving unto the next element in the array? By the way, the code is working fine, what ends up happening is that the elements move in randomly giving the title a very cool effect HOWEVER. Closures to me is confusing enough and to me it seems like really odd behavior. Would someone be so kind as to explain this why this happens, why do all elements move in at once if I take out Math.floor(Math.random() * 1000), as opposed to simply having one element move in every second or so... * EDIT My question is not about closures, it is about why does taking out Math.floor(Math.random() * 1000) and replacing it with say '1000', cause all of the elemen…
has answer: http://stackoverflow.com/a/28789841
has answer: http://stackoverflow.com/a/28789724
has comment: http://stackoverflow.com/comment/45854943
accepted answer: http://stackoverflow.com/a/28789742
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28789724
has comment: http://stackoverflow.com/comment/45854846
has title: Confusing For-loop with timeout inside and closure
type: Question
has comment: http://stackoverflow.com/comment/45854903
tagged with: for-loop
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/28789809
has answer: http://stackoverflow.com/a/28789742
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 4

http://stackoverflow.com/a/28869544
has body: So basically, as mentioned by @isherwoord, I used Bootstrap carousel available events, in this case the "slide" event. Here's the answer: $('#slideshow').on('slide.bs.carousel', function () { $('.caption-wrapper').removeClass('scrollpoint sp-effect3 animated fadeInDown'); }); This a lot more elegant solution to what I originally had.
upvote count: 1
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/28869396
accepted answer of: http://stackoverflow.com/q/28869396
downvote count: 0
score: 1

http://stackoverflow.com/comment/46007653
type: Comment
has text: you can view the view source of about & index in broswer and check the there style css path is matched if yes then click on it check it exist for both files
type: QuestionComment
comment on: http://stackoverflow.com/q/28872369
score: 0

http://stackoverflow.com/a/28902080
type: Answer
answers question: http://stackoverflow.com/q/28901955
score: 2
downvote count: 0
upvote count: 2
has body: Select all the checkboxes with JQuery and add an event handler on change event: jQuery("input[type=checkbox]").change(function(){ jQuery(this).toggleClass("calcButtonOn", this.checked); }); Example JSFiddle
has comment: http://stackoverflow.com/comment/46064066

http://stackoverflow.com/q/28906175
type: Question
downvote count: 2
has body: I'm looking for an example of code in javascript language to makes you when you're writing a text in any textarea in any website and pressed enter it makes two enter(two breaks) automatically. for example extension is off (default) Hello world 1 &lt;br&gt; Hello world 2 extension is on Hello world 1 &lt;br&gt; &lt;br&gt; Hello world 2
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/46071730
accepted answer: http://stackoverflow.com/a/28906294
upvote count: 0
linked to: http://stackoverflow.com/q/263743
has answer: http://stackoverflow.com/a/28906294
has comment: http://stackoverflow.com/comment/46071843
type: AnsweredQuestion
score: -2
has comment: http://stackoverflow.com/comment/46071707
has title: Code example about javascript extension

http://stackoverflow.com/a/28906555
type: Answer
answers question: http://stackoverflow.com/q/28906136
has body: If you're trying to get a JSON object from a PHP page through ajax, it's better not to rely on setTimeout. Instead, use the server to echo a JSON, retrieve it client side and use for whatever you need. // server.php header('Content-Type: application/json'); echo "{\"a\": 1}"; And, on client side, // client.html &lt;script&gt; // avoid the use of eval, it's evil. Pass a function as a parameter. function setTimer(func) { setTimeout(function() {return func()}, 2000) } var request = new XMLHttpRequest(); request.open('GET', 'server.php', true); request.onreadystatechange = function() { if(this.readyState === 4 &amp;&amp; this.status === 200){ var response = this.response; // do what you intended. setTimer(function() { console.log(response) }) } } &lt;/script&gt; More info: https://developer.mozilla.org/pt-BR/docs/Web/API/XMLHttpRequest
score: 0

http://stackoverflow.com/q/28757951
score: 0
has comment: http://stackoverflow.com/comment/45796806
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45797228
tagged with: ember.js
answer count: 0
tagged with: http://stackoverflow.com/tag/json
has body: I'm capturing information from a form in my app and then saving that in a JSON array of objects. Here's a link to the pertinent code: http://emberjs.jsbin.com/vuvivu/1/edit?html,js inputSubmit is the name of the method being run on form submission. the variables are getting the values stored in each text input from the form. the for in statement checks to see if the item already exists in the userList JSON array, which is where i store all the items the user is adding. it only contains user-submitted items and is empty by default. as you can see from the snippet i've included, i'm able to pass the name added through the form to its own details page. on that page i want to simply show the user what information they've submitted. the question is how do i pass the name, description and other info related to the unique item that i've created a page for. right now all i can get it to do is spit out a list of names of all the items and their information even though it creates the unique page correctly. thanks!
type: Question
has title: Ember JS pass object as transitionTo parameter
has comment: http://stackoverflow.com/comment/45797047
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/46074674
has text: I didnt want to use a plugin because i wanted build it from scratch (sorta).. and why rely so heavily on plugin seriously what am i learning about php, jquery, and everything by always using plugins. Id like to learn the stuff so i can do things myself occasionally
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28902915

http://stackoverflow.com/q/28816773
upvote count: 3
linked to: http://stackoverflow.com/q/14049084
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: Making an image appear after scrolling past header - attempts not working?
tagged with: scroll
has body: I've recently taken over work on a friend's website, here. I want to get the small logo above the description box to only show up once the user has scrolled past (and subsequently hidden) the large header at top, and disappear again if the user scrolls back up past it. I've tried the methods recommended in these other posts here and here, which seem like the same basic idea but I can't get any of them to work. I'm new to anything and everything scripting (which I'm entirely sure is the biggest problem here, I know.) So any help is appreciated as what I'm apparently doing wrong.
type: AnsweredQuestion
score: 3
downvote count: 0
has answer: http://stackoverflow.com/a/28820902
accepted answer: http://stackoverflow.com/a/28820902
type: Question
linked to: http://stackoverflow.com/q/19010535
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/q/28820405
answer count: 1
tagged with: jquery
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: iframe
has comment: http://stackoverflow.com/comment/45912526
type: Question
has answer: http://stackoverflow.com/a/28820544
has comment: http://stackoverflow.com/comment/45912967
has title: How can I create a function and parent.function in jquery?
has body: The form will automatically send when page load, it will send to the iframe. But I want get the iframe content in the main page, so I create a function to test, parent.function. But I don't know where I should put this function and the parent.function. Firebug TypeErroe: parent.incomingValue is not a function. Help, appreciate. $('#frame_form').submit(); parent.incomingValue("Hello world"); function incomingValue(val) { alert(val) } &lt;form target="iframe"&gt; &lt;input type="hidden" value="send"/&gt; &lt;/form&gt; &lt;iframe name="iframe"&gt; &lt;/iframe&gt;
tagged with: javascript
score: 0

http://stackoverflow.com/comment/45976393
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28854906
score: 0
has text: Yes, using the same POST data that I used - meaning data could change in different tabs so it has to be dynamic.

http://stackoverflow.com/q/28898526
has answer: http://stackoverflow.com/a/28900786
accepted answer: http://stackoverflow.com/a/28900786
upvote count: 11
favorite count: 0
has answer: http://stackoverflow.com/a/50454972
linked to: http://stackoverflow.com/q/30850030
tagged with: lambda
has title: QML: Lambda function works unexpectedly
tagged with: qt
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/50454972
has body: I thought QML supported lambda functions because of JavaScript's support of anonymous functions and the fact that functions are first class objects, but they don't work how I expected. Take this code: Item { property var items: [] function handler( item ) { console.log( item ); } Component.onCompleted: { for ( var i = 0; i &lt; 3; ++i ) { var item = someObj.createObject(); item.someValueChanged.connect( function() { handler( item ); } ); items.push( item ); console.log( "Adding:", item ); } } Component { id: someObj Item { property bool someValue: false Timer { running: true onTriggered: { parent.someValue = true; } } } } } I'm trying to use the lambda function() { handler( item ); } so that when the someObj::someValueChanged signal is emitted the emitting item is passed to the handler( item ) function. I assumed that each loop would create a new instance of the lambda and that the item reference would carry the reference of the someObj instance created in that loop (i.e. item would be captured by the lambda). But that doesn't seem to be the case as the output is: qml: Adding: QQuickItem_QML_1(0x2442aa0) qml: Adding: QQuickItem_QML_1(0x2443c00) qml: Adding: QQuickItem_QML_1(0x2445370) qml: QQuickItem_QML_1(0x2445370) qml: QQuickItem_QML_1(0x2445370) qml: QQuickItem_QML_1(0x2445370) As you can see, either the whole function is being replaced on each loop or just the item reference, so that ultimately only the last created someObj is referred to. Can someone explain to me why lambdas (if that's even what it is) don't work the way I expect? And is this a QML issue, or a general JavaScript one?
tagged with: qml
score: 11
type: Question
answer count: 2
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/28905855
type: UnansweredQuestion
upvote count: 1
type: Question
score: 1
tagged with: java
tagged with: eclipse
has comment: http://stackoverflow.com/comment/46072580
has body: My team and I often exchange patches created in eclipse when working on the same parts of code. I just made a patch for my teammate that includes our changes he had just given me and a function I just added. When I save the patch in a txt file and open it, I see that function. (I created the patch by right clicking on my project folder, Team -> Create Patch) He is taking the patch and he has all the same changes in his code except for that one function. He right clicks on the project folder and Team->Apply Patch. He sees a lot of conflicts in the Apply Patch wizard because the wizard is seeing all the same code already in the patch in his workspace (minus that one function I added). He applies and gets no errors. HOWEVER, the one function doesn't go into his code. Why is this? I thought maybe he had to revert all of his code first and then apply the patch, but it should work regardless, right? So to be clear here was the process we just did:
downvote count: 0
tagged with: javascript
tagged with: patch
favorite count: 0
has comment: http://stackoverflow.com/comment/46072241
has comment: http://stackoverflow.com/comment/46074089
tagged with: synchronization
has comment: http://stackoverflow.com/comment/46072725
has title: Eclipse is not applying part of my patch but no errors
answer count: 0

http://stackoverflow.com/comment/45805625
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28762852
has text: like this? webSocket.onmessage = function(event) { console.log('onmessage: ' + event.data); webSocket.close(); }; and how i get next message from Websocket?

http://stackoverflow.com/comment/45975245
comment on: http://stackoverflow.com/a/28839284
has text: I changed it to 'GridView1_' + 'TextBoxQty_' + (i - 1) because it generates id like id="GridView1_TextBoxQty_0"
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/33657304
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28785101
has body: Your 'bower' task must return its built pipe, otherwise it cannot signal when it's done and so the tasks are run in parallel. See second example in https://github.com/gulpjs/gulp/blob/master/docs/recipes/running-tasks-in-series.md var gulp = require('gulp'); var del = require('del'); // rm -rf gulp.task('clean', function() { return del(['output']); }); gulp.task('templates', ['clean'], function() { var stream = gulp.src(['src/templates/*.hbs']) // do some concatenation, minification, etc. .pipe(gulp.dest('output/templates/')); return stream; // return the stream as the completion hint });
upvote count: 1
type: Answer

http://stackoverflow.com/a/28895741
score: 4
accepted answer of: http://stackoverflow.com/q/28895101
answers question: http://stackoverflow.com/q/28895101
type: AcceptedAnswer
type: Answer
has body: If you need to send data via a HttpGet, you can add [FromUri] you can edit your controller action as follows and your JavaScript should work as is: [HttpGet] public string HireRocco([FromUri] string[] hitList) { string updateList = string.Empty; return updateList; }
upvote count: 4
downvote count: 0

this
tags question: http://stackoverflow.com/q/28843185
tags question: http://stackoverflow.com/q/28764523
type: Tag
tags question: http://stackoverflow.com/q/28889303
tags question: http://stackoverflow.com/q/28833794
tags question: http://stackoverflow.com/q/28761630
tags question: http://stackoverflow.com/q/28798330
tags question: http://stackoverflow.com/q/28870275
tag name: this
tags question: http://stackoverflow.com/q/28825677

http://stackoverflow.com/q/28903118
type: Question
has title: ThreeJS motion - move in a circle over fixed time period
tagged with: javascript
accepted answer: http://stackoverflow.com/a/32065679
tagged with: trigonometry
downvote count: 0
answer count: 1
favorite count: 0
tagged with: time
has comment: http://stackoverflow.com/comment/57795648
tagged with: three.js
has answer: http://stackoverflow.com/a/32065679
type: AnsweredQuestion
score: 1
has body: I'm attempting to get an object to move along a circular path in a fixed time period. The application of this is a 'smooth motion' clock. So, instead of moving the position to a fixed co-ordinate everytime .getSeconds() updates, I want to use a combination of ( .getSeconds() + ( .getMilliseconds()/1000 ) in order to accurately represent the motion of the second hand at all times. For doing circular motion in the past I have used the following pair of functions: var OrbitCalculationX = function(velocityPartial, orbitalRadius) { return (Math.sin(Date.now() / 16000 * velocityPartial) * orbitalRadius); }; var OrbitCalculationZ = function(velocityPartial, orbitalRadius) { return (Math.cos(Date.now() / 16000 * velocityPartial) * orbitalRadius); };` The 16000 in that calculation controlled the orbital time. However, this is not accurate. Is there a way to control a x-axis sin vs z-axis cos equation set that has accurate time constraints? If not, is there a way to set an animation path to complete in an exact time period in THREEjs?
upvote count: 1

http://stackoverflow.com/comment/46037823
comment on: http://stackoverflow.com/a/28888061
score: 0
type: AnswerComment
type: Comment
has text: @VeldMuijz that's what I mentioned, perfect. just something else, why ```(var setting)``` as a params ?

http://stackoverflow.com/q/28845450
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/21097389
tagged with: javascript
has title: adding the link that makes the paragraph collapse to the last visbile line of the paragraph
has answer: http://stackoverflow.com/a/28848387
type: Question
score: 0
answer count: 1
tagged with: jquery
has body: I have this code to make a paragraph collapse but I would like to add the link (View More/Less) to the last visible line of the paragraph. Currently it is adding it after the collapsed paragraph. $(document).ready(function() { var maxheight = 35; var showText = "More"; var hideText = "Less"; $('.text').each(function() { var text = $(this); if (text.height() > maxheight) { text.css({ 'overflow': 'hidden', 'height': maxheight + 'px' }); var link = $('' + showText + ''); var linkDiv = $(''); linkDiv.append(link); $(this).after(linkDiv); link.click(function(event) { event.preventDefault(); if (text.height() > maxheight) { $(this).html(showText); text.css('height', maxheight + 'px'); } else { $(this).html(hideText); text.css('height', 'auto'); } }); } }); }); Photography has long been shaped by the desire to understand and explore the medium’s essential materials. Taking that spirit of invention and discovery as its point of departure, this exhibition features the work of seven artists—Matthew Brandt, Marco Breuer, John Chiara, Chris McCaw, Lisa Oppenheim, Alison Rossiter, and James Welling—who focus their investigations on the light sensitivity and chemical processing of photographic papers, challenging us to see the medium anew.
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28848387
tagged with: css

http://stackoverflow.com/comment/46030465
type: AnswerComment
score: 0
has text: Thank you, Mouser. For your CSS solution, is there a danger that a browser will support "display: none", but not the :before pseudo-element? If so, can I use Javascript to test for browser support for these two features and then conditionally add the CSS styles (before the DOM is available)? Any idea how?
type: Comment
comment on: http://stackoverflow.com/a/28883795

http://stackoverflow.com/q/28763920
tagged with: node.js
tagged with: twitter-bootstrap
type: UnansweredQuestion
upvote count: 1
downvote count: 1
has body: I'm using angularjs. What i want to do is when user click button , angularjs will checking item id in database. If item id exist in database, #modal will be showed instead of alert like this question. Is it possible to do this with angularjs? If possible how.. HTML Nutrition Scheduling List LOAD SCHEDULE Item Name Scheduled Time Run Time Create Time Status Response {{data.searchitem}} {{data.Scheduledtime}} {{data.runt}} {{data.CurrentTime}} {{data.STATUS}} Controller more.js var app=angular.module('two_way', ['ui.bootstrap']); app.controller('aa',function($scope,$http){ $scope.loadsched=function(){ $http.post("http://localhost:3000/a").success(function(data){ //console.log(data); $scope.load=angular.fromJson(data); }).error(function(){alert("Error");}); } });
has comment: http://stackoverflow.com/comment/45807689
tagged with: javascript
has comment: http://stackoverflow.com/comment/45808227
type: Question
has comment: http://stackoverflow.com/comment/45807892
score: 0
has title: how to use modal pop up in angularjs-ui bootstrap
answer count: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45808127
tagged with: angularjs
has answer: http://stackoverflow.com/a/28764978

http://stackoverflow.com/comment/45850756
comment on: http://stackoverflow.com/q/28787494
has text: You can echo every html or things you want when calling the php function, and then append the data you've echoed, to a div on your page. Getting the echoed / reponse data from a php site is easy, that's already being sent to your "msg" variable in success: function(msg). Maybe try to make an example of what you think your code could looks like, and then post it if you have issues, it's always good to start by your self, and learn by doing ^^
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/28885232
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46035087
type: Question
has body: I'm trying to access an external API, but I always get the error XMLHttpRequest cannot load https://www.warcraftlogs.com/v1/rankings/character/porkiz/blackmoore/EU?metric=dps&amp;limit=5000&amp;api_key=xxx. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. I have found many questions on this topic, but couldn't find a solution. Obviously, I don't have access to the server, so I can't modify anything there. Apparantly, the API also doesn't support JSONP. However, I could make it work by installing the CORS extension in Google Chrome. Any idea on how to solve the problem without any external extensions? I'm using a simple AJAX request: $.ajax({ type: 'GET', url: url, contentType: 'application/json', success: function(result) { _processData(result); } })
has comment: http://stackoverflow.com/comment/46034680
tagged with: header
tagged with: javascript
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/46031791
tagged with: xmlhttprequest
has title: Access-Control-Allow-Origin header (JavaScript)
answer count: 0

http://stackoverflow.com/a/28776844
has comment: http://stackoverflow.com/comment/45831785
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28776813
has body: You could just use Object.keys() method available on the native Object constructor , Which outputs the original objects own enumerable properties. Object.keys(obj);
has comment: http://stackoverflow.com/comment/45831763
answers question: http://stackoverflow.com/q/28776813
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/52908497
has text: You'll also need this other properties: sonar.dynamicAnalysis=reuseReports sonar.junit.reportsPath=build/test-results sonar.java.coveragePlugin=jacoco sonar.jacoco.reportPath=build/jacoco/test.exec I will edit the answer
comment on: http://stackoverflow.com/a/29124140
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28816876
has answer: http://stackoverflow.com/a/28816918
has answer: http://stackoverflow.com/a/28816994
type: Question
has comment: http://stackoverflow.com/comment/45905596
has comment: http://stackoverflow.com/comment/45906725
has comment: http://stackoverflow.com/comment/45905657
tagged with: arrays
tagged with: javascript
has body: Doesn't the addition of an array element by push increase the length of the array by 1 ? var parameters = []; if (parameters.length == 0) { // join select menu and option then add to parameters array var parameterSelected = nameOfSelectBox + " " + ":" + " " + $i + ","; parameters.push(parameterSelected); } else { var parameterSelected = "," + " " + nameOfSelectBox + " " + ":" + " " + $i; parameters.push(parameterSelected); } // check for repeats // does a select input exist? // add to appropriate indexes then add new or modify existing parameters console.log(parameters.length); });
has comment: http://stackoverflow.com/comment/45906071
has comment: http://stackoverflow.com/comment/45905746
answer count: 2
has comment: http://stackoverflow.com/comment/45905605
has comment: http://stackoverflow.com/comment/45906391
favorite count: 0
has comment: http://stackoverflow.com/comment/45905532
has comment: http://stackoverflow.com/comment/45905795
has title: why is my array.length not increasing?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45905693
tagged with: increment
downvote count: 4
upvote count: 0
score: -4
has comment: http://stackoverflow.com/comment/45906204

http://stackoverflow.com/q/28868858
has body: I want to compute the distance between two figures drawn in two canvases, actually i'm doing the following, iterating through the data of the canvases (canvases have the same size): var computeDifference = function() { var imgd1 = bufferCtx.getImageData(0, 0, w, h).data; var imgd2 = targetCtx.getImageData(0, 0, w, h).data; var diff = 0; for(var i=0; i&lt;imgd1.length; i+=4) { var d = (imgd1[i]-imgd2[i]); var tot = d &gt; 0 ? d : -d; diff += tot } return diff; } this is not very efficient. Is there a better method? I read about composite operations, but I'm not sure if that could help in this case. I've purposely considered only the R channel because for now I'm operating with black and white images, but I'm probably going to consider the other channels later.
answer count: 1
downvote count: 0
has title: Javascript canvas: how to efficiently compute distance of two canvases
favorite count: 0
accepted answer: http://stackoverflow.com/a/28869672
type: AnsweredQuestion
score: 3
upvote count: 3
type: Question
tagged with: canvas
has answer: http://stackoverflow.com/a/28869672
tagged with: javascript

http://stackoverflow.com/comment/45931972
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28829397
type: AnswerComment
has text: Check the example of directive with injected $parse service: http://plnkr.co/edit/XEsj78I5k49ira2cp1X4?p=info

http://stackoverflow.com/comment/45876046
score: 0
type: Comment
has text: but I can't access the "this" instance inside the click
comment on: http://stackoverflow.com/a/28801071
type: AnswerComment

http://stackoverflow.com/a/77790188
type: Answer
score: 0
has body: You can do this: a.filter(Boolean).length
answers question: http://stackoverflow.com/q/28811911

http://stackoverflow.com/comment/46028256
comment on: http://stackoverflow.com/q/28883433
type: Comment
type: QuestionComment
has text: Can you please share the code where dropdown list is being populated?
score: 0

http://stackoverflow.com/a/28896534
type: Answer
answers question: http://stackoverflow.com/q/28896494
has body: $('#' + TabContainerID + ' a[href="#' + SecondTabID + '"]').tab('show')
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/comment/45916065
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28777051
type: Comment
has text: I will wait for you ...as I want to understand more on this array and how to set the logic. (designer in me does not want to be logical)

http://stackoverflow.com/comment/45989547
has text: yes, positive. I've gone back and double checked and definitely changed, both in the HTML and also in the script.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28862023

http://stackoverflow.com/q/28882952
tagged with: mobile
has body: UPDATE I have some code that checks if the user is visiting my site via a mobile device. If they do, then I do a simple redirect. However, when the code executes I am not redirected. I know the code runs but no redirect occurs. Instead, some of my javascript code breaks, though no errors appear on my console. You would think Moore's law would have mercy on me. What's wrong and how could I fix this? // device.mobile() give me true on false on whether device is mobile if (device.mobile()) { window.location.href = "https://itunes.apple.com"; }
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/46027131
answer count: 1
has title: Window location href change does not reload
has comment: http://stackoverflow.com/comment/46027110
tagged with: http-redirect
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46027258
type: Question
has answer: http://stackoverflow.com/a/28882999
accepted answer: http://stackoverflow.com/a/28882999

http://stackoverflow.com/q/28759201
has title: Add loop to HTML5 audio with Javascript
score: 0
has body: How would I change this: to this using getElementById ? Normally I'd use setAttribute but there's no category name here.
has answer: http://stackoverflow.com/a/28759266
tagged with: http://stackoverflow.com/tag/html
tagged with: getelementbyid
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28759266
type: Question
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/28759535
type: Answer
upvote count: 2
score: 2
has body: You have several options. Global value. You can use your constants in form of the javascript object which would be globally accessible across the application. For example, your file could look something like this: config = { host: 'domain', port: '1234' }; Obvious disadvantage is that those values are not really a constants and can be easily changed, so it's error prone. Angular config module. More reliable and cleaner option is to create a separate module to be used as a dependency for main app module. You would still have separate file for your constants but instead of some global variable this file would hold angular module with constant service. Something like this: angular.module('app.config', []).constant('config', { host: 'domain', port: '1234' }); Then in main application you would configure app like angular.module('app', ['app.config']).config(function(config) { // console.log(config); });
answers question: http://stackoverflow.com/q/28759354
downvote count: 0

http://stackoverflow.com/q/28789350
has answer: http://stackoverflow.com/a/28789433
has comment: http://stackoverflow.com/comment/45854336
score: 2
type: AnsweredQuestion
has body: I have a radio button and a text field. I want the text field to be required only if the radio button is ticked. &lt;label class="radio"&gt; &lt;input type="radio" value="createNewCollection" ng-model="selectedCollection" /&gt; &lt;/label&gt; &lt;input type="text" ng-model="collectionName" placeholder="Create new Collection"/&gt; So, collectionName is only required if createNewCollection is selected.
type: Question
accepted answer: http://stackoverflow.com/a/28789433
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/13466133
answer count: 1
downvote count: 0
favorite count: 0
tagged with: angularjs
upvote count: 2
has title: Angularjs: Text field is only required of radio button is ticked.
has comment: http://stackoverflow.com/comment/45854361

http://stackoverflow.com/comment/45846336
comment on: http://stackoverflow.com/a/28784649
score: 0
type: AnswerComment
type: Comment
has text: @Nicolai it looks like your `li` elements are added dynamically, please see my edit above

http://stackoverflow.com/comment/46040563
type: QuestionComment
has text: `### (` tries to match `###` followed by a space. However in your example text, `###` is followed by a line break, so no match. Why do you have the spaces in the expression?
score: 0
comment on: http://stackoverflow.com/q/28889767
type: Comment

razor
tags question: http://stackoverflow.com/q/28833832
tags question: http://stackoverflow.com/q/28813563
tags question: http://stackoverflow.com/q/28849600
tags question: http://stackoverflow.com/q/28819190
tags question: http://stackoverflow.com/q/28880427
type: Tag
tag name: razor
tags question: http://stackoverflow.com/q/28852193
tags question: http://stackoverflow.com/q/28807021
tags question: http://stackoverflow.com/q/28887962
tags question: http://stackoverflow.com/q/28834736
tags question: http://stackoverflow.com/q/28905408
tags question: http://stackoverflow.com/q/28837375

express
tags question: http://stackoverflow.com/q/28901323
tags question: http://stackoverflow.com/q/28841791
tags question: http://stackoverflow.com/q/28788523
tags question: http://stackoverflow.com/q/28794715
tags question: http://stackoverflow.com/q/28884503
tags question: http://stackoverflow.com/q/28890219
tags question: http://stackoverflow.com/q/28779503
tags question: http://stackoverflow.com/q/28820738
tags question: http://stackoverflow.com/q/28777230
tags question: http://stackoverflow.com/q/28793098
tags question: http://stackoverflow.com/q/28843358
tags question: http://stackoverflow.com/q/28845947
tags question: http://stackoverflow.com/q/28775956
tags question: http://stackoverflow.com/q/28751248
tags question: http://stackoverflow.com/q/28757646
tags question: http://stackoverflow.com/q/28851776
tags question: http://stackoverflow.com/q/28755157
tags question: http://stackoverflow.com/q/28874334
tags question: http://stackoverflow.com/q/28823808
tags question: http://stackoverflow.com/q/28894074
tags question: http://stackoverflow.com/q/28817497
tags question: http://stackoverflow.com/q/28826193
tags question: http://stackoverflow.com/q/28756968
tags question: http://stackoverflow.com/q/28787518
tags question: http://stackoverflow.com/q/28895237
tags question: http://stackoverflow.com/q/28775051
tags question: http://stackoverflow.com/q/28846335
tags question: http://stackoverflow.com/q/28759149
tags question: http://stackoverflow.com/q/28839532
tags question: http://stackoverflow.com/q/28892418
tags question: http://stackoverflow.com/q/28804411
tags question: http://stackoverflow.com/q/28773206
tags question: http://stackoverflow.com/q/28789327
tags question: http://stackoverflow.com/q/28789857
tags question: http://stackoverflow.com/q/28822954
tags question: http://stackoverflow.com/q/28863097
tags question: http://stackoverflow.com/q/28836674
tags question: http://stackoverflow.com/q/28816583
tag name: express
tags question: http://stackoverflow.com/q/28772888
tags question: http://stackoverflow.com/q/28853379
tags question: http://stackoverflow.com/q/28821739
tags question: http://stackoverflow.com/q/28812122
type: Tag
tags question: http://stackoverflow.com/q/28855790
tags question: http://stackoverflow.com/q/28787332
tags question: http://stackoverflow.com/q/28814293
tags question: http://stackoverflow.com/q/28812329
tags question: http://stackoverflow.com/q/28818256
tags question: http://stackoverflow.com/q/28803408
tags question: http://stackoverflow.com/q/28803459
tags question: http://stackoverflow.com/q/28764437

http://stackoverflow.com/a/28786950
score: 0
answers question: http://stackoverflow.com/q/28785781
type: Answer
has body: I know this isn't efficient programming but after a lot of research I got it to work. Here is what I came up with. <div id="prevBtn" pageNum="<?=$pageNum?>" pageType="description" style="background-color: grey; padding: 5px; color: #fff; width: 100px;">Previous <div id="nextBtn" pageNum="<?=$pageNum?>" pageType="description" style="background-color: grey; padding: 5px; color: #fff; width: 100px;">Next This is Title 1 This is description # 1

http://stackoverflow.com/a/28758995
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28758894
has body: This will the button: This will be your javascript: function disableFields(){ document.getElementById('gtext').disable; document.getElementById('caption').disable; }

http://stackoverflow.com/comment/45860686
type: QuestionComment
has text: And.... what is not working according to you? Because we need general directions, we're not debugging whole pieces of code.
comment on: http://stackoverflow.com/q/28792931
type: Comment
score: 1

http://stackoverflow.com/q/28809825
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/34075546
downvote count: 0
score: 12
type: Question
has title: Angular ng messages show errors on ng repeat form
has body: I want to generate inputs with ng repeat, the problem is when i have an error this is only apply on the last element, how can i make this apply per element? This field is required
has answer: http://stackoverflow.com/a/28810856
tagged with: javascript
has answer: http://stackoverflow.com/a/35217932
favorite count: 0
answer count: 3
upvote count: 12
tagged with: angularjs

http://stackoverflow.com/q/28787954
tagged with: javascript
tagged with: google-apps-script
accepted answer: http://stackoverflow.com/a/28788149
type: AnsweredQuestion
downvote count: 0
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45852045
has comment: http://stackoverflow.com/comment/45851997
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: parsing
has body: I'm getting HTML from a forum url, and parsing the post count of the user from their profile page. I don't know how to write the parsed number into the Google spreadsheet. It should go account by account in column B till last row and update the column A with count. The script doesn't give me any errors, but it doesn't set the retrieved value into the spreadsheet. function msg(message){ Browser.msgBox(message); } function onOpen() { var ui = SpreadsheetApp.getUi(); ui.createMenu("Update") .addItem('Update Table', 'updatePosts') .addToUi(); } function getPostCount(profileUrl){ var html = UrlFetchApp.fetch(profileUrl).getContentText(); var sliced = html.slice(0,html.search('Posts Per Day')); sliced = sliced.slice(sliced.search(' Total Posts '),sliced.length); postCount = sliced.slice(sliced.search(" ")+" ".length,sliced.search(" ")); return postCount; } function updatePosts(){ if(arguments[0]===false){ showAlert = false; } else { showAlert=true; } var spreadSheet = SpreadsheetApp.getActiveSpreadsheet(); var accountSheet = spreadSheet.getSheetByName("account-stats"); var statsLastCol = statsSheet.getLastColumn(); var accountCount = accountSheet.getLastRow(); var newValue = 0; var oldValue = 0; var totalNewPosts = 0; for (var i=2; i<=accountCount; i++){ newValue = parseInt(getPostCount(accountSheet.getRange(i, 9).getValue())); oldValue = parseInt(accountSheet.getRange(i, 7).getValue()); totalNewPosts = totalNewPosts + newValue - oldValue; accountSheet.getRange(i, 7).setValue(newValue); statsSheet.getRange(i,statsLastCol).setValue(newValue-todaysValue); } if(showAlert==false){ return 0; } msg(totalNewPosts+" new post found!"); } function valinar(needle, haystack){ haystack = haystack[0]; for (var i in haystack){ if(haystack[i]==needle){ return true; } } return false; } The is the first time I'm doing something like this and working from an example from other site. I have one more question. In function getPostCount I send the function profileurl. Where do I declare that ?
has title: Google script - parse HTML from Website Forum - and Write Data to Sheet
upvote count: 1
answer count: 1
tagged with: google-sheets
has comment: http://stackoverflow.com/comment/45852292
has answer: http://stackoverflow.com/a/28788149

http://stackoverflow.com/comment/46176183
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28880961
type: AnswerComment
has text: it seems i can't add soething like that. But i may have a workaround using jQuery. I'll try it some more and post it here.

http://stackoverflow.com/comment/45789237
comment on: http://stackoverflow.com/a/28753596
has text: @BradChristie Actually, now they are automatically encoded by the browser. Try it on chrome. `mailto:someone@example.com?subject=subject&body=http://example.com?parameter={'test':'test'}`
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46037045
has text: possible duplicate of [cakephp-2.4:Image directory not sending after applying jshelper ajax submission](http://stackoverflow.com/questions/26647018/cakephp-2-4image-directory-not-sending-after-applying-jshelper-ajax-submission)
comment on: http://stackoverflow.com/q/28886471
score: 0
type: Comment
type: QuestionComment

animation
tags question: http://stackoverflow.com/q/28768789
tags question: http://stackoverflow.com/q/28800685
tags question: http://stackoverflow.com/q/28812240
tags question: http://stackoverflow.com/q/28837011
tags question: http://stackoverflow.com/q/28874804
tags question: http://stackoverflow.com/q/28905390
tags question: http://stackoverflow.com/q/28894889
tags question: http://stackoverflow.com/q/28874191
type: Tag
tags question: http://stackoverflow.com/q/28839664
tags question: http://stackoverflow.com/q/28829283
tags question: http://stackoverflow.com/q/28899074
tags question: http://stackoverflow.com/q/28885393
tags question: http://stackoverflow.com/q/28834191
tag name: animation
tags question: http://stackoverflow.com/q/28833251
tags question: http://stackoverflow.com/q/28887263
tags question: http://stackoverflow.com/q/28867772
tags question: http://stackoverflow.com/q/28861703
tags question: http://stackoverflow.com/q/28803931
tags question: http://stackoverflow.com/q/28776663
tags question: http://stackoverflow.com/q/28819780
tags question: http://stackoverflow.com/q/28838531
tags question: http://stackoverflow.com/q/28751186
tags question: http://stackoverflow.com/q/28852665
tags question: http://stackoverflow.com/q/28848723
tags question: http://stackoverflow.com/q/28771979
tags question: http://stackoverflow.com/q/28851110

http://stackoverflow.com/a/28866634
type: Answer
has comment: http://stackoverflow.com/comment/46025320
has comment: http://stackoverflow.com/comment/45998906
has comment: http://stackoverflow.com/comment/45998172
has comment: http://stackoverflow.com/comment/46043510
has comment: http://stackoverflow.com/comment/45998196
has comment: http://stackoverflow.com/comment/46043505
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28865395
answers question: http://stackoverflow.com/q/28865395
has comment: http://stackoverflow.com/comment/45998259
has body: You should be using AJAX to do this. Below is a very rough usage. You'll note that the function getDataFromDataBaseOrWhatever in the PHP I expect to return HTML formatted correctly to simply display on the client. This is one way to do it, however you could consider simply returning an object with the values you want, and then use the success function in the JS to use that object to then build the HTML itself. This is usually the better approach as the PHP should be simply handling data, and the client should be in control of the view (HTML). However I've done it the first way below so its not so much of a jump for you. If you want an example of the other way, also, let me know. // JS $.ajax({ url: 'script.php', type:'POST', dataType: "json", data: { action: 'search', startDate: startDate, endDate: endDate // other filters }, success: function(res){ if(res.success) { $('#results-container').html(res.html); } else { // error with script or server } }, error: function(err){ error with request/server }, }); // PHP $data = $_POST['data']; if($data['action'] != 'search') { die('wrong action'); } // make sure params are what you might expect for security // setup our query function // using HTML output by server function getDataFromDataBaseOrWhatever() { return $html; } // create return object $return = new stdClass(); // use data from POST $startDate = $data['startDate']; // get return values/HTML $return-&gt;html = getDataFromDataBaseOrWhatever(); // if everything is okay, set the res property to true $return-&gt;success = true; die(json_encode($return));
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46043397
has comment: http://stackoverflow.com/comment/46040964
has comment: http://stackoverflow.com/comment/45998466

http://stackoverflow.com/q/28764030
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28764137
tagged with: regex
possible better answer: http://stackoverflow.com/a/28764175
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28764175
upvote count: 1
type: Question
has body: https://domain.com/indexes('prod-logs')/docs I have the above which I am trying to get it to display like below https://domain.com/indexes/prod-logs/docs I cannot grasp how Regex works and have tried a fiddle but cannot seem to get it working jsFiddle
has title: Javascript Regex to replace bracket and single quote to slashes
accepted answer: http://stackoverflow.com/a/28764137
score: 1
has answer: http://stackoverflow.com/a/28764149
answer count: 3

http://stackoverflow.com/a/28902023
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28901700
upvote count: 2
type: Answer
has body: Ok I've figured out your problem. What you wrote would have worked if you didn't use .then(), which returns a new promise. If you used .success and .error your code would work. In your case, all the values you need are in the first data argument, so you just need to change to: function (data) { if (data.status == 404) { $scope.invalidUser = true; $scope.credentials = {}; } else if (data.status == 401) { $scope.invalidPass = true; $scope.credentials = {}; } else { alert(data.status); } } Fiddle
score: 2
answers question: http://stackoverflow.com/q/28901700

http://stackoverflow.com/comment/46004115
type: QuestionComment
comment on: http://stackoverflow.com/q/28870017
type: Comment
score: 1
has text: document.querySelector("a[href='#sent']").innerHTML ?

http://stackoverflow.com/comment/54320152
type: Comment
comment on: http://stackoverflow.com/a/29429004
score: 2
has text: What does 'Chrome 42+ and Opera 29+ support clipboard reading/writing only when part of a user action (click, keydown, etc)' mean in this case? What should be done instead of using the constructor? I can't find info on that.
type: AnswerComment

http://stackoverflow.com/q/28882278
has answer: http://stackoverflow.com/a/28882466
has body: How do you create a button that toggles between to events? This is the code I've tried function button (text, callback) { var but = document.createElement('BUTTON'); var t = document.createTextNode(text); but.appendChild(t); var clicks = 0; but.onclick = function () { clicks += 1; if (clicks % 2 !== 0) { but.addEventListener('click', callback); } else { but.removeEventListener("click", callback); } }
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46025908
type: Question
has comment: http://stackoverflow.com/comment/46025864
answer count: 1
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
has title: Toggle Event Button

http://stackoverflow.com/comment/45901891
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28815033
type: Comment
has text: This is a duplicate I think, I'm sure this is referenced somewhere..I'll try and dig it out

http://stackoverflow.com/q/28851515
favorite count: 0
type: Question
tagged with: basic-authentication
tagged with: client
answer count: 1
has title: Hide basic auth credentials in Javascript client
score: 0
upvote count: 1
has answer: http://stackoverflow.com/a/28858942
downvote count: 1
tagged with: javascript
tagged with: security
has body: I need to make from my client side javascript code an ajax request posting some data to the backend with jQuery. $.ajax({...}); The Javascript code can be embedded by various client so I enabled CORS on my backend and the requests go fine. The backend is protected by an Basic Auth and the auth header is stored in the javascript client. How can I protect my backend so only my client can post data and prevent any other people from doing this.
tagged with: api
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28858942

http://stackoverflow.com/comment/45980546
comment on: http://stackoverflow.com/a/28857306
has text: Why submit in the first place if you know you are gonna edit it? Why not just wait with the initial submit?
type: Comment
type: AnswerComment
score: 0

http://stackoverflow.com/a/29503628
has body: Someone posted issue CB-8738 at Jira that sounds similar. Does this resolve your issue?
type: Answer
answers question: http://stackoverflow.com/q/28903739
score: 0

http://stackoverflow.com/comment/45937900
type: AnswerComment
score: 0
has text: Just tried urldecode with _POST and didn't work either.
type: Comment
comment on: http://stackoverflow.com/a/28833356

http://stackoverflow.com/q/28763257
has comment: http://stackoverflow.com/comment/101704017
tagged with: documentation-generation
type: AnsweredQuestion
has body: How can I tell JSDoc about the structure of an object that is returned. I have found the @return {{field1: type, field2: type, ...}} description syntax and tried it: /** * Returns a coordinate from a given mouse or touch event * @param {TouchEvent|MouseEvent|jQuery.Event} e * A valid mouse or touch event or a jQuery event wrapping such an * event. * @param {string} [type="page"] * A string representing the type of location that should be * returned. Can be either "page", "client" or "screen". * @return {{x: Number, y: Number}} * The location of the event */ var getEventLocation = function(e, type) { ... return {x: xLocation, y: yLocation}; } While this parses successfully, the resulting documentation simply states: Returns: The location of an event Type: Object I am developing an API and need people to know about the object that they will get returned. Is this possible in JSDoc? I am using JSDoc3.3.0-beta1.
tagged with: jsdoc3
upvote count: 264
type: Question
score: 264
tagged with: code-documentation
possible better answer: http://stackoverflow.com/a/56366427
downvote count: 0
has answer: http://stackoverflow.com/a/56366427
has answer: http://stackoverflow.com/a/28763616
tagged with: javascript
has answer: http://stackoverflow.com/a/36759658
answer count: 3
has title: JSDoc: Return object structure
favorite count: 0
accepted answer: http://stackoverflow.com/a/28763616
tagged with: jsdoc

http://stackoverflow.com/comment/45979114
type: AnswerComment
score: 0
has text: Right, but I think this is too hard. It should be simpler.
comment on: http://stackoverflow.com/a/28794311
type: Comment

http://stackoverflow.com/comment/45870165
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28797934
has text: My browser does not have any native `Array.remove` method.
score: 0

http://stackoverflow.com/q/28882625
possible better answer: http://stackoverflow.com/a/28882776
has comment: http://stackoverflow.com/comment/46026673
favorite count: 0
linked to: http://stackoverflow.com/q/1510778
has answer: http://stackoverflow.com/a/28883331
answer count: 5
score: 3
has body: Consider the following code: var arr = []; arr["abc"] = 1; arr["bcd"] = 2; console.log(arr.length); // outputs 0 arr["1"] = "one"; // notice the subscript content is in quotes console.log(arr.length); // outputs 2 console.log(arr); // outputs [undifined, "one"] console.log(arr["abc"]); // outputs 1 In the above program, I have defined the array arr which is first assigned with string indexes, so the array length stays 0. I read somewhere that when string value is used for subscript, the array object is treated as an ordinary object. So, I can understand if the length is zero (Should probably be undefined). Then, when I use a subscript of "1", which should be of string type is taken as a Number and the length is incremented. Then when the array is printed there is a value of undefined for the index 0 and index 1 has the value "one" ( Note that the indexes "abc" and "bcd" are not shown when printed. Finally, when I try to access the "abc" value, I get the value. So my questions are the following: What happens when an array is assigned with a string index and why does the length remain the same? Does the javascript interpreter tries convert the index to a Number before using it? Where are the values of the array string indexes stored and why are they not shown when I try to print the array? Finally, can someone point me to a good article which explains the implementation details of javascript's features. Thanks in advance.
has answer: http://stackoverflow.com/a/28882819
upvote count: 3
has title: How does Javascript store arrays
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28882936
accepted answer: http://stackoverflow.com/a/28882819
has answer: http://stackoverflow.com/a/28882776
has answer: http://stackoverflow.com/a/28883094
tagged with: arrays
downvote count: 0
has comment: http://stackoverflow.com/comment/46027236
tagged with: javascript

http://stackoverflow.com/a/28800471
has comment: http://stackoverflow.com/comment/45874765
has body: don't know why we make it null Probably just to make it clear that the initialized value is null (as apposed to undefined). Assigning null is not necessary either way. why -1 on the length? Because length is 1-based (array with 4 items has a length of 4) but indexing into an array is 0-base (array[0] returns the 1st item). clueless This step is creating a nested list object. The first loop creates a list with a value at that array position, the second loop creates a wrapper list with a value at that position and a pointer to the previous list, and so forth.
score: 0
answers question: http://stackoverflow.com/q/28800442
has comment: http://stackoverflow.com/comment/45875048
type: Answer
has comment: http://stackoverflow.com/comment/45874877
has comment: http://stackoverflow.com/comment/45875253

http://stackoverflow.com/q/28876405
has body: Im working on a web application that can use uploaded csv file and generate graph based on them. (for graphs im using zingchart). Im having trouble with understanding how to use uploaded file. this is function that i use for upload button &lt;form&gt; &lt;div class = "uploaddat" &gt; &lt;input type="file" name="file"/&gt; &lt;/div&gt; &lt;/form&gt; and this is where i need to put uploaded file "csv":{ "url":"input/datasample.csv", "smart-scales":true, "vertical-labels":true } Im beginner, so i would really appreciate if somebody could help me Thank you.
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/28876563
has answer: http://stackoverflow.com/a/28877192
has title: How to use uploaded file in html?
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/46015186
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/28877192
linked to: http://stackoverflow.com/q/5593473
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28876563
has comment: http://stackoverflow.com/comment/46015673
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/q/28874613
answer count: 4
has answer: http://stackoverflow.com/a/28875639
type: UnansweredQuestion
tagged with: dynamics-crm-2013
type: Question
tagged with: crm
has answer: http://stackoverflow.com/a/28881786
has answer: http://stackoverflow.com/a/28875275
has answer: http://stackoverflow.com/a/28875450
tagged with: javascript
score: 0
has body: I want to change a section name if my checkbox is checked their is my code I was trying to use a loop but I still had the same error !! and I got this Error Message Champ :cac_is_demande_mere Événement onchange Erreur :Unable to get property 'controls' of undefined or null reference function Demande_Type() { if (Xrm.Page.getAttribute("cac_is_demande_mere").getValue()) { Xrm.Page.getControl("parentcaseid").setLabel("new Field"); Xrm.Page.ui.tabs.get("general").sections.get("ChildCasesGrid").controls.setLabel("new Field"); /* var ctrlName = Xrm.Page.ui.controls.get(); for(var i in ctrlName) { var ctrl = ctrlName[i]; var ctrlSection = ctrl.getParent().getName(); if (ctrlSection == "ChildCasesGrid") { ctrl.setLabel("new Field"); } } */ } else { Xrm.Page.getControl("parentcaseid").setLabel("Demande Parente"); Xrm.Page.ui.tabs.get("general").sections.get("ChildCasesGrid").controls.setLabel("Demandes Filles"); /* var ctrlName = Xrm.Page.ui.controls.get(); for(var i in ctrlName) { var ctrl = ctrlName[i]; var ctrlSection = ctrl.getParent().getName(); if (ctrlSection == "ChildCasesGrid") { ctrl.setLabel("Demandes Filles"); } }*/ } }
has title: How to change a section name in dynamics crm 2013

http://stackoverflow.com/a/28838366
has comment: http://stackoverflow.com/comment/45946587
has comment: http://stackoverflow.com/comment/45946637
type: Answer
answers question: http://stackoverflow.com/q/28835717
has comment: http://stackoverflow.com/comment/45946729
has body: What about this? Only display the first if the screen is from 500 to 999px in width, the other only when 1000px or greater? #size1000, #size500{ display:none; } @media(min-width:500px) and (max-width: 999px) { #size500{ display:block; } } @media (min-width:1000px){ #size1000{ display:block; } } Note that this is loading both, but only displaying only the one (or none for small screens). If the videos are auto-play, that might be an issue. Here's a working Plunk demo of it.
has comment: http://stackoverflow.com/comment/45946564
has comment: http://stackoverflow.com/comment/45946856
score: 0

http://stackoverflow.com/q/28774372
has answer: http://stackoverflow.com/a/28774574
possible better answer: http://stackoverflow.com/a/28774976
type: Question
has answer: http://stackoverflow.com/a/28774976
answer count: 2
has comment: http://stackoverflow.com/comment/45827206
has comment: http://stackoverflow.com/comment/45827264
accepted answer: http://stackoverflow.com/a/28774574
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45827242
score: 0
has comment: http://stackoverflow.com/comment/45827414
has title: Onload submit not working
has comment: http://stackoverflow.com/comment/45827477
has body: I'm trying to submit this form when the page loads. But for some reason it doesn't work. I checked the console for errors and nothing seems to be wrong there. Here's the html plus javascript(added the jquery) New Ticket Subject: Select one ... '; Confirm Delivery Appointment '; Reschedule Delivery Appointment Summary: Your Message: This is a test disregard
has comment: http://stackoverflow.com/comment/45827233
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45827193
linked to: http://stackoverflow.com/q/3303874
has comment: http://stackoverflow.com/comment/45827320

http://stackoverflow.com/a/28851430
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46030849
accepted answer of: http://stackoverflow.com/q/28851111
score: 4
answers question: http://stackoverflow.com/q/28851111
has comment: http://stackoverflow.com/comment/46030786
type: Answer
has comment: http://stackoverflow.com/comment/46030821
upvote count: 4
has body: The easiest way to load a JSON file in node/io.js is to use require directly: var config = require('json/config.json'); This can substitute any readJSON calls you have and also works generally. Node/io.js have the ability to synchronously require json files out of the box.

http://stackoverflow.com/comment/132344795
score: 0
has text: Thank you for showing an example with `useEffect()` for a functional component. This was the most helpful answer for me!
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/66814471

http://stackoverflow.com/q/28751948
has comment: http://stackoverflow.com/comment/45785938
has comment: http://stackoverflow.com/comment/45786132
has comment: http://stackoverflow.com/comment/45786786
has comment: http://stackoverflow.com/comment/45785922
has comment: http://stackoverflow.com/comment/45787612
linked to: http://stackoverflow.com/q/808816
has comment: http://stackoverflow.com/comment/45794912
type: Question
has answer: http://stackoverflow.com/a/28752028
has answer: http://stackoverflow.com/a/28752008
tagged with: javascript
tagged with: jquery
has title: Comment styles in javascript
has body: I have a couple scripts I've inherited to say the least. These scripts work flawlessly in Chrome and FireFox but IE not so much Today I noticed something while trying to figure it out. I noticed that at the top of the scripts are some comments but they look like &lt;!-- /* * * The comment * */ --&gt; Is the HTML style comments potentially breaking the scripts in IE? the &lt;!-- --&gt; part
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/45786115
type: UnansweredQuestion

http://stackoverflow.com/comment/45938378
type: Comment
score: 0
has text: Hi - thanks again for your help here. I have updated the Gist with my models.py - https://gist.github.com/joefusaro/25b6221536291c1ba0d1#file-models-py
type: AnswerComment
comment on: http://stackoverflow.com/a/28824084

http://stackoverflow.com/comment/46033763
comment on: http://stackoverflow.com/q/28886198
has text: When/where is the for loop used?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28895646
type: Answer
accepted answer of: http://stackoverflow.com/q/28894967
answers question: http://stackoverflow.com/q/28894967
score: 0
type: AcceptedAnswer
has body: Some logic to get the desired result: var points = [40, 100, 1, 5, 25, 10], temp1 = [], temp2 = [], anotherArray; points.forEach(function(val){ if(val &lt; 10 ) { temp1.push(val) } else { temp2.push(val); } }); anotherArray = temp1.sort().concat(temp2.sort(function(a,b){return b- a})); alert(anotherArray); It's not possible via shift or splice. Unless manually creating the array.

http://stackoverflow.com/q/28800850
has title: jQuery off() is not unbinding events when using bind
has body: function bubble(content, triggerElm){ this.element = $('&lt;div class="bubble" /&gt;').html(content); this.element.css(.....) // here is positioned based on triggerElm } bubble.prototype.show = function(){ $(document).on('click', this._click.bind(this)); this.element.css(....) }; bubble.prototype.hide = function(){ $(document).off('click', this._click.bind(this)); this.element.css(....) }; bubble.prototype._click = function(event){ console.log('click', this); if(this.element.is(event.target) || (this.element.has(event.target).length &gt; 0)) return true; this.hide(); }; var b = new bubble(); b.show(); b.hide(); I keep seeing click in the console, so the click does not unbind. But if I remove the bind() call the click is unbinded. Does anyone know why? I need a way to be able to change "this" inside my test function, that's why I'm using bind().
score: 11
has answer: http://stackoverflow.com/a/28801071
upvote count: 11
tagged with: bind
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28801048
possible better answer: http://stackoverflow.com/a/28800863
has answer: http://stackoverflow.com/a/28800871
downvote count: 0
accepted answer: http://stackoverflow.com/a/28801071
tagged with: javascript
has answer: http://stackoverflow.com/a/28800863
answer count: 6
tagged with: jquery
tagged with: jquery-events
has answer: http://stackoverflow.com/a/76752840
has answer: http://stackoverflow.com/a/63043233
favorite count: 0

http://stackoverflow.com/q/28826224
has title: How to create graph in an HTML file using the jOrgChart?
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28964716
tagged with: http://stackoverflow.com/tag/html
has body: Is it possible to draw a graph in an HTML file using the jOrgChart jQuery plugin, as in the example below? If that's not possible then what are other options are available for drawing such chart, without using Drupal?
score: 1
possible better answer: http://stackoverflow.com/a/29074208
has answer: http://stackoverflow.com/a/29074208
upvote count: 1
accepted answer: http://stackoverflow.com/a/28964716
tagged with: charts
type: AnsweredQuestion
tagged with: jquery-plugins
type: Question

http://stackoverflow.com/comment/45960645
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28845855
has text: I'm using none, just client-side JS and jQuery. Is it possible for AJAX to load these images that I want from my local folder?
score: 0

http://stackoverflow.com/comment/45808794
score: 0
has text: BTW, your checking code is wrong. LS always store strings and boolean `false` will become string `"false"` and will be considered `true` when you check it.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28764872

http://stackoverflow.com/q/28863654
has answer: http://stackoverflow.com/a/28863731
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28863698
accepted answer: http://stackoverflow.com/a/28863698
has title: Parsing $(this) to function within setTimeout
type: Question
tagged with: javascript
tagged with: jquery
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28863734
has body: I have a function that requires $(this) to be parsed to it. It is located within an each loop. This works as expected. The problem comes when I need to access $(this) when used in conjunction with setTimeout() DEMO http://jsfiddle.net/6e937r1b/2/ To simplify and demonstrate my issue I have put together a basic fiddle. You will notice that the text is not output. $("li").each(function(i) { /* below example outputs value if i only */ setTimeout(function() { alertThis($(this).text() + i); }, 1000 * i); /* below example works as you'd expect outputting the text and value of i */ alertThis($(this).text() + i + ' outside of timeout'); }); function alertThis(text) { alert(text); }
possible better answer: http://stackoverflow.com/a/28863731

http://stackoverflow.com/q/28773199
answer count: 1
accepted answer: http://stackoverflow.com/a/28773408
tagged with: angularjs
linked to: http://stackoverflow.com/q/23585065
type: AnsweredQuestion
has body: I have sort of a strange question, I'm just trying to see if this is possible. What I am looking for is a way to update the url as the user is using the app - when they click a few different items on the page I would like it to almost "bind" to the urlParameters I have set up. So I have like - url: 'app/:mod1/:mod2', in my route and as the user interacts with buttons on the page, 2 of them are binded to scopes in the controllers, lets say $scope.mod1 = true; $scope.mod2 = false; And then as the user interacts with them it would change the url accordingly. So if they clicked the buttons and made mod1 = false and mod2 = true, the url would change to /app/false/true Here is the catch - I would love to be able to do this without refreshing the page each time (if it's even possible in the first place). The idea is so that the user can then copy the url and use it later - kind of like a save state. Any advice on this matter would be much valued, as I am not sure where to look. Thank you for taking the time to read!
tagged with: angular-ui-router
score: 0
has answer: http://stackoverflow.com/a/28773408
type: Question
has title: Angular, ui-router "binding" to url, also without refreshing
tagged with: javascript

http://stackoverflow.com/q/28879755
has body: I am trying to solve one problem with reading json object sent via ajax request in php file and I am keep gettin null in the console. Javascript file //create function to send ajax request function ajax_request(){ console.log("hello"); var post_data = { "news_data" : 'hello', "news_date" : '1st march' } $.ajax({ url : 'index.php', dataType : 'json', type : 'post', data : post_data, success : function(data){ console.log(data); } }); } //on click event $('#news_post_button').on('click', ajax_request); and php file which is only for testing to see what i get &lt;?php header('Content-Type: application/json'); $aRequest = json_decode($_POST); echo json_encode($aRequest[0]-&gt;news_data); ?&gt;
tagged with: javascript
has answer: http://stackoverflow.com/a/28880081
has answer: http://stackoverflow.com/a/33002539
downvote count: 0
score: 1
linked to: http://stackoverflow.com/q/19004783
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/28880071
tagged with: php
answer count: 4
has answer: http://stackoverflow.com/a/28879947
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
type: Question
has title: Reading json object sent via ajax in php file
linked to: http://stackoverflow.com/q/6255344

http://stackoverflow.com/comment/45958069
type: Comment
type: QuestionComment
score: 0
has text: I only need the first row, that's actually intentional. For some reason "SELECT FIRST (pageLocation)" didn't seem to work.
comment on: http://stackoverflow.com/q/28844376

http://stackoverflow.com/comment/45880170
has text: I think you should start with a simpler project
type: QuestionComment
type: Comment
score: 2
comment on: http://stackoverflow.com/q/28803362

http://stackoverflow.com/q/28849069
answer count: 2
tagged with: ng-options
score: 2
has body: I'm making a playlist option in the project I'm working on and I'm trying to get a dropdown for all the videos in the list. which is easy but this shows a drop down of the Id's, but now I want it to show the position in the list +1; So when playing video 5/15 the drop down should show 1 to 15 (so not 0 to 14) and 5 should be selected. any idea on how to accomplish this?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28849467
downvote count: 0
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/28849226
possible better answer: http://stackoverflow.com/a/28849467
type: Question
tagged with: angularjs
upvote count: 2
tagged with: angularjs-ng-options
has answer: http://stackoverflow.com/a/28849226
has title: AngularJS ng-option get index

http://stackoverflow.com/comment/45932040
type: AnswerComment
comment on: http://stackoverflow.com/a/28831111
has text: @RahulDesai What if we both post the answer at same time? and there is only one answer for this question.
score: 0
type: Comment

http://stackoverflow.com/comment/46440843
has text: no it is not like that. i really appreciate your work. i think there is some misunderstanding. i am sorry if i did a mistake
comment on: http://stackoverflow.com/a/28886971
score: 0
type: AnswerComment
type: Comment

iscroll
tags question: http://stackoverflow.com/q/28764879
type: Tag
tag name: iscroll

vb6
type: Tag
tag name: vb6
tags question: http://stackoverflow.com/q/28895351

http://stackoverflow.com/comment/45879038
has text: yes @WillReese it will be the same request
score: 0
comment on: http://stackoverflow.com/q/28802608
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28807711
has title: Click radio button then show submit button
has body: I am trying to make a click to show submit button using radio button. But i have one question.. I have created this DEMO from codepen.io In this demo you can see there is a six radio button. (for example:)The first tree radio button is for xx, and second tree radio button is for yy . I made a submit button for the two parts.When you change any one of the three radio buttons in the first part then the first submit button is automatically display:block; but at the same time the second part submit button is display:block; i don't want to it. I want to make when first part radio buttons clicked then first part submit button display:block; also same think for second part. How can i do that anyone can help me in this regard ? HTML Yes No Maybe Yes No Maybe CSS .container { width:500px; margin:0px auto; margin-top:50px; } .yesno { -webkit-appearance: none; -moz-appearance: none; width: 30px; height: 20px; border-radius: 14px; outline: 0; background: #9da6b0; -webkit-transition: all 0.15s ease-in-out; cursor: pointer; } .yesno:after { content: ""; display: block; width: 14px; height: 14px; background: #fff; border-radius: 11px; position: relative; top: 3px; left: 3px; -webkit-transition: all 0.15s ease-in-out; } .yesno:checked { background: #529ecc; } .yesno:checked:after { left: 13px; } .radio_wrp { float:left; width:500px; height:auto; } .submitbutton { float:left; width:50px; height:50px; } .first {display:none;} .second{display:none;} javascript $(document).ready(function(){ $('.rdbtn').click(function(){ $('.first').show(); }); }); Note: I know if i change the class name for second part submit button is not display:block; when clicked first part radio buttons.
has answer: http://stackoverflow.com/a/28807915
accepted answer: http://stackoverflow.com/a/28807922
has answer: http://stackoverflow.com/a/28808295
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/28807922
downvote count: 0
type: Question
has answer: http://stackoverflow.com/a/28809111
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28808295
upvote count: 3
tagged with: css
answer count: 4
favorite count: 0

http://stackoverflow.com/comment/45921732
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28825015
has text: @jerith2 you're welcome. Since the problem is solved, you can delete the question, or I can post my comment as an answer, if you are ready to accept it.
score: 0

http://stackoverflow.com/comment/45938716
comment on: http://stackoverflow.com/q/28834622
has text: Put a console.log right before that if...are you positive it's `null`?
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45898869
has text: Are you trying to call the method? It has no return value. Are you trying to use the method to construct an object? You haven't used the `new` keyword.
type: QuestionComment
comment on: http://stackoverflow.com/q/28813490
score: 0
type: Comment

http://stackoverflow.com/q/28820724
has title: JS Circular countdown
has comment: http://stackoverflow.com/comment/45913454
type: Question
tagged with: javascript
score: -1
has body: So i have a question! I want the below circle to be filling with different color "onComplete" and also if it's possible to not start with autoplay but onclick. Could you please someone help me????? The main idea is when you click the circle it begins a countdown-waiting to submit your answer, so i want the circle to turn the same color as the progress bar. (function ($, window, document, undefined) { var pluginName = "countdown360", defaults = { radius: 15.5, // radius of arc strokeStyle: "#477050", // the color of the stroke strokeWidth: undefined, // the stroke width, dynamically calulated if omitted in options fillStyle: "#8ac575", // the fill color fontColor: "#477050", // the font color fontFamily: "sans-serif", // the font family fontSize: undefined, // the font size, dynamically calulated if omitted in options fontWeight: 700, // the font weight autostart: false, // start the countdown automatically seconds: 3, // the number of seconds to count down label: ["second", "seconds"], // the label to use or false if none startOverAfterAdding: true, // Start the timer over after time is added with addSeconds onComplete: undefined }; function Plugin(element, options) { this.element = element; this.settings = $.extend({}, defaults, options); if (!this.settings.fontSize) { this.settings.fontSize = this.settings.radius/1.2; } if (!this.settings.strokeWidth) { this.settings.strokeWidth = this.settings.radius/4; } this._defaults = defaults; this._name = pluginName; this._init(); } Plugin.prototype = { extendTimer: function (value) { var seconds = parseInt(value), secondsElapsed = Math.round((new Date().getTime() - this.startedAt.getTime())/1000); if ((this._secondsLeft(secondsElapsed) + seconds) <= this.settings.seconds) { this.startedAt.setSeconds(this.startedAt.getSeconds() + parseInt(value)); } }, addSeconds: function (value) { var secondsElapsed = Math.round((new Date().getTime() - this.startedAt.getTime())/1000); if (this.settings.startOverAfterAdding) { this.setting…
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
answer count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: css
upvote count: 0
has answer: http://stackoverflow.com/a/28820927

http://stackoverflow.com/comment/45806194
type: AnswerComment
has text: @EricB Thanks for the credit at the end, kind words :)
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28760875

http://stackoverflow.com/comment/45986294
type: Comment
comment on: http://stackoverflow.com/a/28860085
type: AnswerComment
score: 0
has text: This just send the string `testForm1` to the `validate` function.

http://stackoverflow.com/a/31258818
downvote count: 4
answers question: http://stackoverflow.com/q/28832083
has body: From my research this appears to be a defect in the $cordovaFile.removeFile method. I have not found any solution as of yet.
type: Answer
upvote count: 0
score: -4

http://stackoverflow.com/comment/107542745
type: Comment
has text: @CHANist, `new` syntax is to create an instance from the `constructor`. Without `new`, the context of `this` would be the global context. You can try creating an instance without `new` to see the effect.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/36759658

http://stackoverflow.com/q/28886990
possible better answer: http://stackoverflow.com/a/28888012
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/46036740
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/46035499
has comment: http://stackoverflow.com/comment/46035424
has comment: http://stackoverflow.com/comment/46035557
has body: Here is the plunkr: http://plnkr.co/edit/CzcVzKSvpKJTuTKARVJz?p=preview and this is my simple code: .directive('ngB', [function () { return { 'restrict': 'A', 'scope': { 'ngB': '=' }, 'link': function($scope, el) { var clss = 'b' , go = function () { if ($scope.ngB) { el.removeClass('a'); el.addClass(clss); } else { el.removeClass(clss); } }; $scope.$watch('ngB', function () { go(); }); } }; }]) .directive('ngF', [function () { return { 'restrict': 'A', 'scope': { 'ngF': '=' }, 'link': function($scope, el) { var clss = 'f' , go = function () { if ($scope.ngF) { el.removeClass('a'); el.addClass(clss); } else { el.removeClass(clss); } }; $scope.$watch('ngF', function () { go(); }); } }; }]); //view.html 1" ng-a="1 > 2">here It returns this error in console: https://docs.angularjs.org/error/$compile/multidir How can i fix this without removing one of the directives from the elmeent thank you a lot.
has comment: http://stackoverflow.com/comment/46036377
favorite count: 0
has answer: http://stackoverflow.com/a/28889248
tagged with: angularjs
upvote count: 2
has comment: http://stackoverflow.com/comment/46035740
has comment: http://stackoverflow.com/comment/46036176
has comment: http://stackoverflow.com/comment/46037554
has comment: http://stackoverflow.com/comment/46035631
has title: AngularJS multiple directives on same element, $compile:multidir ERROR
tagged with: angularjs-directive
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/28888012
linked to: http://stackoverflow.com/q/27485848
accepted answer: http://stackoverflow.com/a/28889248
has comment: http://stackoverflow.com/comment/46035615

http://stackoverflow.com/comment/129450554
has text: this leads to _"method returns Object OR String OR Boolean"_ - every `@returns` adds a new return-option, instead of descriptions for fields of the returned object.
score: 3
type: AnswerComment
comment on: http://stackoverflow.com/a/56366427
type: Comment

http://stackoverflow.com/comment/45798469
has text: where is your script file located? Check you define script file path properly.
comment on: http://stackoverflow.com/a/28758875
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28819661
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/45911349
has comment: http://stackoverflow.com/comment/45911285
score: 0
has comment: http://stackoverflow.com/comment/45911187
has comment: http://stackoverflow.com/comment/45911312
linked to: http://stackoverflow.com/q/8612498
has comment: http://stackoverflow.com/comment/45911206
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has body: I'm trying to show the contents of one div into a different div on my screen. The div I want to copy has a set of buttons, and I want to literally mirror the contents, so all the javascript funcitons/listeners will still work. I've tried: $("#copy").appendTo("#target"); $(#copy).clone().appendTo("#target"); Both lines above copy the buttons and classes, but none of the javascript attached to the original buttons work. Has anyone got any ideas of how I can do this? It may sound an odd thing to be doing but it's necessary for what I want to do.
has answer: http://stackoverflow.com/a/28819805
has title: How can I mirror the contents of one div inside another?
has answer: http://stackoverflow.com/a/28819735

http://stackoverflow.com/comment/45787258
score: 0
has text: I can't add full fledged code right now, but I've added a skeleton that should clear things up.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28752258

http://stackoverflow.com/q/28837467
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28838022
tagged with: popup
type: Question
tagged with: browser-cache
tagged with: internet-explorer
tagged with: javascript
tagged with: browser
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/45944362
has title: Internet Explorer Opening Same Page for Different URLs of same website
has answer: http://stackoverflow.com/a/28837651
has body: I have an application where i am doing new tab pop-ups in internet explorer(8,10,11) using window.open(myurl) The pop-up triggered by a website contains a URL which is another page of that website. Problem here is that when the pop-up takes place, same webpage opens as the one from where the pop-up is being initiated. If i copy the URL from address bar of the pop-up window and close all windows and than open that URL in new window of internet explorer only than my required page opens in the pop-up window/tab. (Note: Same application works perfectly fine in Mozila Firefox without any issue, but it is clients requirement to run my application in IE) Following is a method which is doing the pop-up: function handlePhonecallScreenpop(callF, callT, callA, custid, entityN) { var extraqs = "cf=" + callF; extraqs += "&amp;ct=" + callT; extraqs += "&amp;cd=outd"; extraqs += "&amp;ca=" + callA; extraqs += "&amp;cid=" + custid; extraqs += "&amp;en=" + entityN; var url = webUrl() + "/main.aspx?etn=phonecall&amp;pagetype=entityrecord&amp;extraqs=" + encodeURIComponent(extraqs); window.open(url, "callpop"); }
has comment: http://stackoverflow.com/comment/45944804

http://stackoverflow.com/comment/45930923
type: Comment
score: 0
type: AnswerComment
has text: i appreciate your quick response but it doesnt work it doesn't create any paragraph element or nothing .-.
comment on: http://stackoverflow.com/a/28830429

http://stackoverflow.com/comment/45933958
score: 2
comment on: http://stackoverflow.com/q/28832130
type: Comment
has text: Put the gauss() source in the question. This surely comes from that function.
type: QuestionComment

http://stackoverflow.com/a/28899416
score: 2
has comment: http://stackoverflow.com/comment/46059730
has comment: http://stackoverflow.com/comment/46062479
downvote count: 0
has comment: http://stackoverflow.com/comment/46059539
has comment: http://stackoverflow.com/comment/46060002
accepted answer of: http://stackoverflow.com/q/28898793
upvote count: 2
answers question: http://stackoverflow.com/q/28898793
type: AcceptedAnswer
has body: Here is plunker for you. Key thing is giving same name for radio groups so I give name with using their parent product. &lt;input type="radio" name="group-{{product.Code}}" ng-model="subProduct.Selected"&gt;{{subProduct.Code}} for function call you can use ng-click. &lt;input type="radio" ng-click="displayFullPricing()" name="group-{{product.Code}}" ng-model="subProduct.Selected"&gt;{{subProduct.Code}}
type: Answer

http://stackoverflow.com/comment/46002922
has text: It's not clear to me what you're doing. What sort of animation and when? Based on your 2 second timeout, I'd guess you'd want to use the events available instead. http://getbootstrap.com/javascript/#carousel-events
comment on: http://stackoverflow.com/q/28869396
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45811906
comment on: http://stackoverflow.com/q/28766468
has text: Do you know what a "module" is? As commonly used, it's not a synonym for "function" or even for "constructor".
type: QuestionComment
type: Comment
score: 0

windows-store-apps
tags question: http://stackoverflow.com/q/28789627
tags question: http://stackoverflow.com/q/28873766
tags question: http://stackoverflow.com/q/28897616
tag name: windows-store-apps
type: Tag

http://stackoverflow.com/q/28880196
has title: Does <!DOCUMENT html> trigger "use strict" in JS scripts?
has comment: http://stackoverflow.com/comment/46022405
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28880234
has comment: http://stackoverflow.com/comment/46021894
score: 1
upvote count: 1
type: Question
type: AnsweredQuestion
tagged with: javascript
has answer: http://stackoverflow.com/a/28880234
has body: My primitive (practice) JS script stops working when I add tag at the top of the html file. The html file itself is very simple and it is HTML5 compliant. My script uses methods unsupported by JS strict mode though - methods like eval(). My question is - does the html5 tag enforce strict mode on my JS scripts? If no, what does the tag change functionally-wise? My html body looks like this: ... ... ... Go! The script itself is pretty messy and I don't want to burn your brains sharing it with you. ;) Thanks for any hints guys! Cheers, greg
answer count: 1
downvote count: 0
favorite count: 0

http://stackoverflow.com/comment/46048469
score: 0
has text: your regex works https://regex101.com/r/pW3cT7/2
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28894116

hudson
type: Tag
tag name: hudson
tags question: http://stackoverflow.com/q/28834365

variables
tag name: variables
tags question: http://stackoverflow.com/q/28871919
tags question: http://stackoverflow.com/q/28845061
tags question: http://stackoverflow.com/q/28809759
tags question: http://stackoverflow.com/q/28793494
tags question: http://stackoverflow.com/q/28853777
tags question: http://stackoverflow.com/q/28877887
tags question: http://stackoverflow.com/q/28878894
type: Tag
tags question: http://stackoverflow.com/q/28831263
tags question: http://stackoverflow.com/q/28874173
tags question: http://stackoverflow.com/q/28898592
tags question: http://stackoverflow.com/q/28808877
tags question: http://stackoverflow.com/q/28787026
tags question: http://stackoverflow.com/q/28890783
tags question: http://stackoverflow.com/q/28788709
tags question: http://stackoverflow.com/q/28848558
tags question: http://stackoverflow.com/q/28861285
tags question: http://stackoverflow.com/q/28846563
tags question: http://stackoverflow.com/q/28888013
tags question: http://stackoverflow.com/q/28833492
tags question: http://stackoverflow.com/q/28773200
tags question: http://stackoverflow.com/q/28870567

http://stackoverflow.com/a/28885634
upvote count: 4
downvote count: 0
score: 4
answers question: http://stackoverflow.com/q/28881534
type: Answer
has body: I use an AppBootstrap.js module to (1) instantiate the stores, (2) dispatch an initialization action, with the initial data from the server, and (3) render the root React component(s). Example: // AppBootstrap.js var AppConstants = require('AppConstants'); var AppDispatcher = require('AppDispatcher'); var AppRoot = require('AppRoot.react'); var React = require('React'); require('FriendStore'); require('LoggingStore'); require('MessageStore'); module.exports = (initialData, elem) =&gt; { AppDispatcher.dispatch({ type: AppConstants.ActionTypes.INITIALIZE, data: initialData }); React.render(&lt;AppRoot /&gt;, elem); };

http://stackoverflow.com/comment/45999953
has text: Ugh... you're totally right. I should have read the whole post.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28867532

http://stackoverflow.com/comment/45787606
type: Comment
has text: yes I have $locationProvider.html5Mode(true); and in my index.html. But even in my laptop browser $locationChangeStart doesn't work.
comment on: http://stackoverflow.com/q/28752424
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45883089
comment on: http://stackoverflow.com/a/28803883
has text: After 2nd true value these can't execute ? Am i right ?
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28782799
answer count: 1
tagged with: d3.js
has title: Connecting data and pop up in the map using D3
type: AnsweredQuestion
type: Question
has body: I am trying to connect the data to the map and pop up on mouse hover. I used only 3-4 rows from dataset for testing.. http://jsfiddle.net/2emnt8m3/1/ Here is : d3.select("body").selectAll("path").each(function(d,i){ state_id = d3.select(this.parentNode).attr("entity_id"); title = d3.select(this).attr("title"); }); when mouse hover on states or union territory, data of the crime would pop up. Here is complete dataset I collected in json/js http://pastebin.com/mZ6zc5CB
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28784057
accepted answer: http://stackoverflow.com/a/28784057
score: 0

http://stackoverflow.com/q/28840598
has body: I have been struggling to get a very simple feature working using jqxGrid and a cell rendered with a jqxNumberInput editor.jqxNumberInput({ decimalDigits: 2, spinButtonsStep: 0.1, spinMode: "simple", decimalSeparator: decimalSeparator, groupSeparator: groupSeparator }); Basically when the user clicks on the cell the cursor is placed all the way to the right of the text (number), my boss wants the contents of the cell to be highlighted (text selected) so the user does not have to move the cursor to the left in order to start typing I have been digging through the jqx grid docs for quite some time and there doesnt seem to be anything I can find to achieve this. http://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxgrid/jquery-grid-api.htm I attempted to tie into the cellbeginedit event and assumed I could use the event to get the target element and selected it that way, but the event.target value is the entire grid, not the cell itself. $(element).on('cellbeginedit', function (event) { // event.target == grid not cell }); I also attempted to get the cell by using the getcell method, but this returns the data for that cell not the element itself. var cell = $(element).jqxGrid("getcell", args.rowindex, args.datafield); // cell then equals the data for the row not with no reference to the element in question To reiterate, i need to modify, hack update do something so when a user clicks on a jqxNumberInput and the cell goes into edit mode all the text in the cell is selected (highlighted) any help on this issue would be greatly appreciated
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28848887
type: Question
has title: Needing to highlight the contents of a jqxNumberInput on click
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28848887
score: 0
answer count: 1
tagged with: jquery
tagged with: jqxgrid

http://stackoverflow.com/comment/45788625
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28753062
type: AnswerComment
has text: Wouldn't this delay the calculations further? I'm already up to 13 seconds for some of the calculations, and that is only with 10 ms resolution - I would like to go to 1 ms resolution!

http://stackoverflow.com/comment/45933228
score: 0
type: AnswerComment
type: Comment
has text: I definitely could, but student payments and hiring people does not always work well together for the economy ;) Thank you for you're time.
comment on: http://stackoverflow.com/a/28831274

http://stackoverflow.com/a/28887017
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28886835
has comment: http://stackoverflow.com/comment/46035590
has comment: http://stackoverflow.com/comment/46036246
score: 1
has comment: http://stackoverflow.com/comment/46035523
downvote count: 0
type: AcceptedAnswer
has body: You don't need to eval anything, let browser execute it. For this create script element, set its content and append it to DOM: success: function(data) { $("#my-table").html(data.html); $('&lt;script&gt;').html(data.script).appendTo('body'); }, Another, probably better option is to make script a part of the returned HTML.
answers question: http://stackoverflow.com/q/28886835

http://stackoverflow.com/comment/45982519
has text: You are not using exactly the code I suggested you. Once again, it works in the snippet, so you just have to write the exact same thing in your code and there is no reason it won't work. If you still have problems to implement this solution in your code, accept this answer and create another question with more details so that community can actually help you.
type: AnswerComment
comment on: http://stackoverflow.com/a/28834815
score: 0
type: Comment

http://stackoverflow.com/a/28889022
upvote count: 1
has comment: http://stackoverflow.com/comment/46046002
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46039110
accepted answer of: http://stackoverflow.com/q/28888884
has body: Pretty straightforward. Use the hidden expression for this. First create a badge component that handles the display, e.g. &lt;polymer-element name="badge" attributes="score"&gt; &lt;image src="/images/badge1.png" hidden?="" /&gt; &lt;image src="/images/badge2.png" hidden?=" " /&gt; &lt;/polymer-element&gt; Then include your badge component as followed: &lt;badge id="badge" /&gt; To update the badge, you just assign the user score to it: this.$.badge.score = this.user.score; Or if you keep it within the data binding then you can also do: &lt;badge score="{{ score }}" /&gt; and your main code in your component is something like this: this.score = 163; Hope that helps.
type: Answer
score: 1
answers question: http://stackoverflow.com/q/28888884

http://stackoverflow.com/q/28889461
has comment: http://stackoverflow.com/comment/46040120
has comment: http://stackoverflow.com/comment/46039941
downvote count: 0
tagged with: iframe
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/46040399
score: 4
has answer: http://stackoverflow.com/a/28890866
answer count: 1
favorite count: 0
has body: I´m trying to access a few elements from a child iframe to another... I´ve tried to reference childNodes with no luck (alert 0): alert(window.parent.document.getElementById('framechildidonparent').childNodes.length); Also tried to go upward to parent and then down to child with no luck: function getParentFrameProperties(idframe,idobject){ var myframe = window.parent.document.getElementById(idframe).contentWindow; var insideobject = myframe.document.getElementById(idobject).value; alert(insideobject); } Any clues? Thanks in advance.
type: UnansweredQuestion
has title: javascript page element access from one child iframe to another child
upvote count: 4
has comment: http://stackoverflow.com/comment/46040069

http://stackoverflow.com/a/28765413
downvote count: 0
has comment: http://stackoverflow.com/comment/45810083
has body: I would suggest to handle this in your logic : do three functions, it is less ressource intensive, and more maintainable, if you need more "layers" just create new functions. Don't mess your dom up. var drawBackground = function(){ //works with images canvas2d.globalAlpha = 1; //draw background elements. }; var drawTrans = function(){ //works with images canvas2d.globalAlpha = 0.5; //draw Transparent elements. }; var drawForeground = function(){ canvas2d.globalAlpha = 1; //draw foreground elements. }; In each of them, you draw only the items of that layer you can set the transparency of an image by setting the globalAlpha parameter BEFORE you draw the image. For shapesn use canvas2d.fillStyle = "rgba(255, 255, 255, 0.5)"; for example.
answers question: http://stackoverflow.com/q/28765227
upvote count: 2
type: Answer
score: 2

http://stackoverflow.com/a/28830262
type: Answer
answers question: http://stackoverflow.com/q/28830158
score: 0
has body: I usually save things like this as templates and then add them to the page... var template = ""+ " " + " One "+ ... " " then just add them to the page $("#button").click(function(){ $( template ).appendTo($("#thedivyouwant") ); });

http://stackoverflow.com/comment/46064131
comment on: http://stackoverflow.com/q/28890011
has text: @geocodezip — Yes the code that is inside `boxText.innerHTML` works on the normal web page: http://jsfiddle.net/nm5s42k1/1/ How do I make the domready event fire when opening the infoBox?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28873989
upvote count: 1
has body: Presumably escape() takes a string whereas you are providing a jQuery object. When you try and cast an object to a string javascript gives you "[object Object]". Instead, you need to retrieve the HTML value of the table, like this: var value = $('.planning-table').clone().wrap('&lt;div /&gt;').parent().html();
score: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/46010560
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28873949
answers question: http://stackoverflow.com/q/28873949
type: Answer

http://stackoverflow.com/q/28825015
has answer: http://stackoverflow.com/a/28825751
type: Question
has title: Vertical menu expanding is not working for dynamic content
answer count: 1
has comment: http://stackoverflow.com/comment/45921245
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/45920915
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45920815
accepted answer: http://stackoverflow.com/a/28825751
tagged with: css
favorite count: 0
has comment: http://stackoverflow.com/comment/45921458
has comment: http://stackoverflow.com/comment/45921550
upvote count: 1
type: AnsweredQuestion
has body: I have tried a sample of Vertical menu from CSSmenu site, sample source code working and menu is expanding as per the sample, when i try to add the menu dynamically, those menu's are not expanding even i have verified the final object structure. Code with dynamic menu: Home Products Product 1 Product 2 Product 3 Contact About Company Contact
has comment: http://stackoverflow.com/comment/45921595
has comment: http://stackoverflow.com/comment/45921732

http://stackoverflow.com/comment/79222709
comment on: http://stackoverflow.com/a/40826789
score: 3
type: AnswerComment
has text: I think you meant npm install --save-dev @types.chrome? --save will result in it being added to dependencies, not devDependencies.
type: Comment

http://stackoverflow.com/comment/45790084
type: Comment
has text: You are welcome. Actually you can also use this.querySelector('paper-action-dialog') also if you don't set an id.
comment on: http://stackoverflow.com/a/28753929
score: 0
type: AnswerComment

extjs
tags question: http://stackoverflow.com/q/28849186
tags question: http://stackoverflow.com/q/28853733
tags question: http://stackoverflow.com/q/28877698
tags question: http://stackoverflow.com/q/28899336
tags question: http://stackoverflow.com/q/28888397
tags question: http://stackoverflow.com/q/28753781
tags question: http://stackoverflow.com/q/28773721
tags question: http://stackoverflow.com/q/28801305
type: Tag
tags question: http://stackoverflow.com/q/28896723
tags question: http://stackoverflow.com/q/28903311
tags question: http://stackoverflow.com/q/28805371
tags question: http://stackoverflow.com/q/28874381
tags question: http://stackoverflow.com/q/28751118
tags question: http://stackoverflow.com/q/28898344
tags question: http://stackoverflow.com/q/28871540
tags question: http://stackoverflow.com/q/28831815
tags question: http://stackoverflow.com/q/28751831
tags question: http://stackoverflow.com/q/28882691
tags question: http://stackoverflow.com/q/28865625
tags question: http://stackoverflow.com/q/28902129
tags question: http://stackoverflow.com/q/28858953
tag name: extjs
tags question: http://stackoverflow.com/q/28754748
tags question: http://stackoverflow.com/q/28862449
tags question: http://stackoverflow.com/q/28877732
tags question: http://stackoverflow.com/q/28859607
tags question: http://stackoverflow.com/q/28805491
tags question: http://stackoverflow.com/q/28783458
tags question: http://stackoverflow.com/q/28810667
tags question: http://stackoverflow.com/q/28900390

http://stackoverflow.com/comment/45890807
comment on: http://stackoverflow.com/a/28809160
type: AnswerComment
score: 0
type: Comment
has text: Oh yeah. I was not aware of string and int. Thanks. You made my day!

http://stackoverflow.com/q/28834654
type: Question
has answer: http://stackoverflow.com/a/28834865
linked to: http://stackoverflow.com/q/15455451
tagged with: javascript
has body: I have a form which is wrapped like so: ... Dog Cat ... So one thing I have to do is run a quick check before submitting the form, to make sure that the person has clicked one of those 2 buttons. I can stick this code inside my processForm code, but I feel like it would be nicer to be able to just do a quick validation inside the html file and leave the processForm to not handle visually displaying this error and whatnot. Is there a way or am I wrong?
score: 0
answer count: 1
tagged with: angularjs
type: UnansweredQuestion
has title: Validate a form before it goes to ng-submit in Angular

http://stackoverflow.com/a/28774004
score: 1
has body: declare javascript variable to sum all input values when user fill them or leave them, look at the example. http://jsfiddle.net/xb8gb8pm/2/ var cart = { total: 0 }; $('.offered-price').blur(function () { cart.total = 0; $('.offered-price').each(function (i, idx) { price = $(idx).val().trim(); cart.total += parseFloat(price !== '' ? price : 0); }); $('.totalPrice').html('Total:'+cart.total); });
answers question: http://stackoverflow.com/q/28773568
upvote count: 1
type: Answer
downvote count: 0

http://stackoverflow.com/q/28810679
has body: I want to using javascript to make a light switch. When the background color is: "white" => turn on "black" => turn off Question: My code can turn off the light, but I don't know how to turn it on. I have a idea to the last, but it dosen't work. How to fix it? Here is my code. HTML <mate charset="utf-8" /> light Switch The switch CSS body{ background-color: white; margin: 0; padding: 0; } #lightSwitch{ width: 300px; height: 25px; text-align: center; border: 1px solid black; padding: 5px; text-decoration: none; position: absolute; top: 50%; left: 50%; margin: -15px 0 0 -152.5px; } javascript function lightSwitch(){ var light = document.getElementById("lightSwitch"); var BGcolor = document.body.style.backgroundColor; if (BGcolor != "black"){ light.innerHTML = "The light is open! Click here to close."; light.onclick = function(){ document.body.style.backgroundColor = "Black"; light.innerHTML = "The light is close! Click here to open."; } } } lightSwitch(); I have a idea, look: function lightSwitch(){ var light = document.getElementById("lightSwitch"); var BGcolor = document.body.style.backgroundColor; if (BGcolor != "black"){ light.innerHTML = "The light is open! Click here to close."; light.onclick = function(){ document.body.style.backgroundColor = "Black"; light.innerHTML = "The light is close! Click here to open."; }else{ light.onclick = function(){ document.body.style.backgroundColor = "white"; } } } } lightSwitch();
has title: using javascript to make a light switch
type: Question
answer count: 2
downvote count: 2
upvote count: 1
tagged with: javascript
favorite count: 0
linked to: http://stackoverflow.com/q/7738219
has comment: http://stackoverflow.com/comment/45893587
has comment: http://stackoverflow.com/comment/45893505
has answer: http://stackoverflow.com/a/28811006
accepted answer: http://stackoverflow.com/a/28811006
possible better answer: http://stackoverflow.com/a/28810762
has comment: http://stackoverflow.com/comment/45893687
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45893503
has answer: http://stackoverflow.com/a/28810762
score: -1

http://stackoverflow.com/comment/45929268
type: Comment
comment on: http://stackoverflow.com/a/28827632
has text: im gonna try what you suggested now
score: 0
type: AnswerComment

http://stackoverflow.com/q/28813696
has body: i have an svg image inside object element of HTML document. &lt;object id="svg1" data="nejc/bg.svg" type="image/svg+xml"&gt; Your browser doesn't support SVG &lt;/object&gt; And i have javascript code. Inside of it i added click event which execute when svg is done loading. Code look for id in .svg file which i added on groups of elements. Everything is working. But i am having problem now and then when i load page the svg elements cant be clicked, but if i refresh it then the click is working just fine. $( document ).ready(function() { //button where are you var a = document.getElementById("svg1"); //it's important to add an load event listener to the object, as it will load the svg doc asynchronously a.addEventListener("load",function(){ var svgDoc = a.contentDocument; //get the inner DOM of svg var delta = svgDoc.getElementById("right"); //get the inner element by id delta.addEventListener("click",function(){ this.style.fill = '#DC7827'; setTimeout("document.location.href = '_mobile_whereareyou.php';",200); },false); //add behaviour },false); //button place ID var b = document.getElementById("svg1"); //it's important to add an load event listener to the object, as it will load the svg doc asynchronously b.addEventListener("load",function(){ var svgDocB = b.contentDocument; //get the inner DOM of svg var beta = svgDocB.getElementById("left"); //get the inner element by id beta.addEventListener("click",function(){ this.style.fill = '#DC7827'; setTimeout("document.location.href = '_mobile_placeID.php';",200); },false); //add behaviour },false); }); I am guessing that when svg elements could not be clicked then the svg image did not load correctly. Is there any way how to make sure that svg element is loaded and click is working ?
score: 0
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28829760
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/svg
has title: SVG in object problems with click event inside JS
type: Question
tagged with: object
has answer: http://stackoverflow.com/a/28829760

http://stackoverflow.com/comment/45895365
type: AnswerComment
has text: `scrollBy` and `scrollTo` might work on the **current** page but not on **another** linked page.
type: Comment
comment on: http://stackoverflow.com/a/28811648
score: 0

http://stackoverflow.com/comment/45890293
has text: Please show me your project structure..I think your path used in scripts not correct
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28808741

http://stackoverflow.com/comment/45946045
comment on: http://stackoverflow.com/a/28826828
type: Comment
has text: Certainly, but I won't do it. ;-) Here's what I would do. **Hint 1:** Add a `data-required-if="foo"` to any input element on the page that you want to link to the checkbox with ID "foo". Modify the above function: When a checkbox is clicked, it selects *all* input elements on the page, filters them down to those that have their "required-if" equal to the checkbox ID (use jQuery's `.filter()` and `.data()` functions for that). Eventually, the remaining inputs that can easily be made required/not required. **Hint 2:** This is possible without using any explicit loops (no `$.each`, no `for`, etc)
score: 0
type: AnswerComment

http://stackoverflow.com/a/34195822
score: 0
type: Answer
has body: i like a lot of the answers posted so far that mitigate what the q readme calls the "pyramid of doom". for the sake of discussion, i'll add the pattern that i plunked out before searching around to see what other people are doing. i wrote a function like var null_wrap = function (fn) { return function () { var i; for (i = 0; i &lt; arguments.length; i += 1) { if (arguments[i] === null) { return null; } } return fn.apply(null, arguments); }; }; and i did something totally analogous to @vilicvane's answer, except rather than throw new BreakSignal(), i'd written return null, and wrapped all subsequent .then callbacks in null_wrap like then(null_wrap(function (res) { /* do things */ })) i think this is a good answer b/c it avoids lots of indentation and b/c the OP specifically asked for a solution that doesn't throw. that said, i may go back and use something more like what @vilicvane did b/c some library's promises might return null to indicate something other than "break the chain", and that could be confusing. this is more a call for more comments/answers than a "this is definitely the way to do it" answer.
answers question: http://stackoverflow.com/q/28803287

http://stackoverflow.com/a/28892630
type: Answer
answers question: http://stackoverflow.com/q/28892602
upvote count: 3
score: 3
has body: The problem you're facing is because setTimeout (and setInterval) works on another thread. Your look finishes is an instant, so essentially all your timers are started at the same time. What you want to do is chain them together recursively, so that each timer calls the next one, and keeps the count. function count(num){ setTimeout(function(){ mySwiper.update(); console.log("Test"); if(num &gt; 0) count(num - 1); }, 500); } Then, instead of a loop, you'd just do count(20); As a note, if you want it to fire every half a second no matter how long everything else takes, move use what @Arun suggested. My method makes it take another 500ms after everything is finished.
downvote count: 0

http://stackoverflow.com/q/28906435
has answer: http://stackoverflow.com/a/32834933
has body: I have been working with the HTML5 FormData object and I can't seem to figure out how to find what data it holds. I need to access it for debugging purposes. https://developer.mozilla.org/en-US/docs/Web/API/FormData1 There are functions like FormData::get([name]); but I don't know the names. It would be nice to have something like the following: FormData::dumpData(); What is a good way to view all of the data in a FormData object? Update Here is an example of the FormData object:
answer count: 1
has comment: http://stackoverflow.com/comment/46072367
has comment: http://stackoverflow.com/comment/46073591
has comment: http://stackoverflow.com/comment/46072407
type: UnansweredQuestion
downvote count: 0
tagged with: javascript
score: 6
favorite count: 0
has comment: http://stackoverflow.com/comment/46072982
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: form-data
has title: Get All Items from HTML5 FormData Object - HTML5
has comment: http://stackoverflow.com/comment/46074043
upvote count: 6

http://stackoverflow.com/q/28877194
tagged with: xmlhttprequest
answer count: 0
upvote count: 1
type: Question
has body: I'm sending requests to web server periodically. If I send one request every x seconds works as expected. But if send four requests every x seconds just get in responses 'xmlhttp.readyState = 1' function send(value) { if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { console.log("Resp from " + value + ":='" + xmlhttp.responseText + "' readyState="+xmlhttp.readyState + " status=" + xmlhttp.status); if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200) { //Process response } } xmlhttp.open("GET", "http://localhost:8080?"+value, true); xmlhttp.send(); } Example OK: Here I get xmlhttp.readyState = 1,2,3,(4 + response) setInterval( function() { send("cmd=0"); }, 1000 ); Example fail: Here I get 'xmlhttp.readyState = 1' in all responses. setInterval( function() { send("cmd=0"); }, 1000 ); setInterval( function() { send("cmd=1"); }, 1000 ); setInterval( function() { send("cmd=2"); }, 1000 ); setInterval( function() { send("cmd=3"); }, 1000 ); Request are correctly processed in server Info: readyState = 1 -- > OPENED readyState = 2 -- > HEADERS_RECEIVED readyState = 3 -- > LOADING readyState = 4 -- > DONE
tagged with: javascript
has title: XMLHttpRequest response fail if multiple asynchronous request
downvote count: 0
score: 1
favorite count: 0
type: UnansweredQuestion

asp.net
tags question: http://stackoverflow.com/q/28815837
tags question: http://stackoverflow.com/q/28857258
tags question: http://stackoverflow.com/q/28779144
tags question: http://stackoverflow.com/q/28833382
tags question: http://stackoverflow.com/q/28848743
tags question: http://stackoverflow.com/q/28765367
tags question: http://stackoverflow.com/q/28880967
tags question: http://stackoverflow.com/q/28811684
tags question: http://stackoverflow.com/q/28886308
tags question: http://stackoverflow.com/q/28872104
tags question: http://stackoverflow.com/q/28880585
tags question: http://stackoverflow.com/q/28849660
tags question: http://stackoverflow.com/q/28771161
tags question: http://stackoverflow.com/q/28844485
tags question: http://stackoverflow.com/q/28844398
tags question: http://stackoverflow.com/q/28814735
tags question: http://stackoverflow.com/q/28828372
tags question: http://stackoverflow.com/q/28880602
tags question: http://stackoverflow.com/q/28903127
tags question: http://stackoverflow.com/q/28895946
tags question: http://stackoverflow.com/q/28828133
tags question: http://stackoverflow.com/q/28896703
tags question: http://stackoverflow.com/q/28896865
tags question: http://stackoverflow.com/q/28826757
tags question: http://stackoverflow.com/q/28813667
tags question: http://stackoverflow.com/q/28802903
tags question: http://stackoverflow.com/q/28849454
tags question: http://stackoverflow.com/q/28875861
tags question: http://stackoverflow.com/q/28895101
tags question: http://stackoverflow.com/q/28827196
tags question: http://stackoverflow.com/q/28904905
tags question: http://stackoverflow.com/q/28761591
tags question: http://stackoverflow.com/q/28794848
tags question: http://stackoverflow.com/q/28839098
tags question: http://stackoverflow.com/q/28887358
tags question: http://stackoverflow.com/q/28761791
tags question: http://stackoverflow.com/q/28806519
tags question: http://stackoverflow.com/q/28822131
tags question: http://stackoverflow.com/q/28826830
tags question: http://stackoverflow.com/q/28817335
tags question: http://stackoverflow.com/q/28842591
tags question: http://stackoverflow.com/q/28791690
tags question: http://stackoverflow.com/q/28851282
tags question: http://stackoverflow.com/q/28893689
tags question: http://stackoverflow.com/q/28888713
tags question: http://stackoverflow.com/q/28843362
tags question: http://stackoverflow.com/q/28863067
tags question: http://stackoverflow.com/q/28804829
tags question: http://stackoverflow.com/q/28841228
tags question: http://stackoverflow.com/q/28859238
tags question: http://stackoverflow.com/q/28833406
tags question: http://stackoverflow.com/q/28901268
tags question: http://stackoverflow.com/q/28846447
tags question: http://stackoverflow.com/q/28894408
tags question: http://stackoverflow.com/q/28840991
tags question: http://stackoverflow.com/q/28765472
tags question: http://stackoverflow.com/q/28779158
tags question: http://stackoverflow.com/q/28879922
tags question: http://stackoverflow.com/q/28838409
tags question: http://stackoverflow.com/q/28829747
tags question: http://stackoverflow.com/q/28876443
tags question: http://stackoverflow.com/q/28758621
type: Tag
tags question: http://stackoverflow.com/q/28820983
tags question: http://stackoverflow.com/q/28764938
tags question: http://stackoverflow.com/q/28903078
tags question: http://stackoverflow.com/q/28805977
tags question: http://stackoverflow.com/q/28752690
tags question: http://stackoverflow.com/q/28809529
tags question: http://stackoverflow.com/q/28886230
tags question: http://stackoverflow.com/q/28893636
tags question: http://stackoverflow.com/q/28883433
tags question: http://stackoverflow.com/q/28846870
tags question: http://stackoverflow.com/q/28828296
tags question: http://stackoverflow.com/q/28855025
tags question: http://stackoverflow.com/q/28858145
tags question: http://stackoverflow.com/q/28757813
tags question: http://stackoverflow.com/q/28805650
tags question: http://stackoverflow.com/q/28893025
tags question: http://stackoverflow.com/q/28900125

http://stackoverflow.com/a/28906894
accepted answer of: http://stackoverflow.com/q/28906527
score: 6
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 6
answers question: http://stackoverflow.com/q/28906527
has body: There's a lot going on here, but to break it down: countAncestors returns the number of ancestors of person (including the person themself) that match the criteria in a provided test function (test) longLivingPercentage first uses the countAncestors function to count all ancestors of the specified person (by using a test that always returns true), and then uses it again to count all ancestors of the specified person that died at age 70 or above. reduceAncestors fans out through the family tree by recursively seeking out each parent and then using the provided function f (which in this case is combine) to merge together the results. combine, as stated above, is used to merge the values recursively obtained by reduceAncestors. It adds together the total number of matched ancestors for the current person's father and mother, and then adds in the current person to that total if they match the test. Presuming a family tree where the initial person (G) passed in had exactly one father and mother (E and F), and two grandparents on each side (A, B, C, and D), and a test that always returns true, the recursive calls to combine would look like this: combine(A,0,0) = 1 combine(B,0,0) = 1 combine(C,0,0) = 1 combine(D,0,0) = 1 | | | | ---------------------- --------------------- | | combine(E,1,1) = 3 combine(F,1,1) = 3 | | -------------------------------------------- | combine(G, 3, 3) = 7

http://stackoverflow.com/a/60353546
downvote count: 0
type: Answer
score: 12
answers question: http://stackoverflow.com/q/28866930
upvote count: 12
has body: Nowadays, starting Mongo 4.2, db.collection.updateMany (alias of db.collection.update) can accept an aggregation pipeline, finally allowing the update of a field based on its own value. starting Mongo 4.4, the new aggregation operator $replaceAll makes it very easy to replace parts of a string. // { "name" : "AA&amp;nbsp;aa" } // { "name" : "AA&amp;nbsp;&amp;nbsp;aa" } // { "name" : "AA&amp;nbsp;AA&amp;nbsp;aaaaaaaa" } db.collection.updateMany( { name: { $regex: /\&amp;nbsp\;/ } }, [{ $set: { name: { $replaceAll: { input: "$name", find: "&amp;nbsp;", replacement: "" } }} }] ) // { "name" : "AAaa" } // { "name" : "AAaa" } // { "name" : "AAAAaaaaaaaa" } The first part ({ name: { $regex: /\&amp;nbsp\;/ } }) is the match query, filtering which documents to update (the ones containing "&amp;nbsp;") The second part ($set: { name: {...) is the update aggregation pipeline (note the squared brackets signifying the use of an aggregation pipeline): $set is a new aggregation operator (Mongo 4.2) which in this case replaces the value of a field. The new value is computed with the new $replaceAll operator. Note how name is modified directly based on the its own value ($name).

http://stackoverflow.com/q/28765496
score: 0
tagged with: pug
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45848881
has comment: http://stackoverflow.com/comment/45822863
answer count: 0
has comment: http://stackoverflow.com/comment/45848581
has comment: http://stackoverflow.com/comment/45824164
has title: How to loop through attribute values in Jade?
has body: I've made a mixin for the picture element (uses Picturefill.js) but would like to now create one to use img srcset with sizes. &lt;img srcset=”large.png 1200w, medium.png 600w, small.png 350w” sizes=”(min-width: 600px) 600px, 100vw” alt=”My mug”&gt; How can I loop through the object I'm passing into the mixin and use each image as a value for srcset? Thanks in advance.
type: Question
tagged with: javascript

http://stackoverflow.com/a/28855631
has body: this inside the success function is not the clicked element, but the ajax object $('form').submit(function(e) { e.preventDefault(); var self = this; $.ajax({ url: '../../ctrl_amouzesh/ajax_students_final_record_action', type: 'POST', data: $(this).serialize() , success: function(data) { $('#res').html(data); $(self).find('[type="submit"]').fadeOut(); } }); }); $.ajax also has a setting called context that can be used to set the value of this inside the callbacks
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45977749
has comment: http://stackoverflow.com/comment/45977818
has comment: http://stackoverflow.com/comment/45977674
has comment: http://stackoverflow.com/comment/45977780
type: Answer
has comment: http://stackoverflow.com/comment/45980767
accepted answer of: http://stackoverflow.com/q/28855589
downvote count: 0
answers question: http://stackoverflow.com/q/28855589
score: 1
has comment: http://stackoverflow.com/comment/45979512

http://stackoverflow.com/comment/46397380
comment on: http://stackoverflow.com/a/28839535
score: 0
type: AnswerComment
has text: If I don't use JS, *prova()* runs (I see it from eclipse) while if I use JS, the button changes but the function *prova()* does **not run**. Maybe I misunderstood what *redirect = reverse('name_of_home_user_view') return JsonResponse({'redirect': redirect})* means
type: Comment

http://stackoverflow.com/q/28862194
tagged with: google-sheets
answer count: 1
tagged with: google-forms
downvote count: 0
tagged with: javascript
favorite count: 0
score: 1
has answer: http://stackoverflow.com/a/28868161
has body: I wrote some macro code to send an email to a manager based on form submissions (to be used in a expense/approval process), this is my first project using google forms/spreadsheets so maybe i might be missing something simple, but i looked through 2 tutorials for this and my code matches those where it matters. the first part, SendEmail, works perfectly and emails the manager provided with the few needed columns needed to make a decision. as well as 2 links to approve or deny. these links are built by using the URL generated when i published the code and appending approval=true and the email of the person who submited the form request. the next part, doGet(e), is supposed to trigger when the link in the manager email is clicked and then generate an email to send to the requester, however, when the link is clicked it just brings me to a page that says "Invalid email: undefined" even though the URL at the top has all the right information. what am i missing here? edit: I was using this video to get the layout of most of the code: https://www.youtube.com/watch?v=eduG0XZ9mDs code: function sendEmail(e){ /** var email = e.values[1]; var item = e.values[2]; var cost = e.values[3]; */ var serviceInformation = e.values[1]; var language = e.values[2]; var meetingType = e.values[3]; var eventDate = e.values[4]; var clientName = e.values[5]; var detailedDirections = e.values[6]; var onSitePOCName = e.values[7]; var onSitePOCNumber = e.values[8]; var department = e.values[9]; var contactPhoneNumber = e.values[10]; var approval = e.values[11]; //the one we need to modify var requestorEmail = e.values[12]; var managerEmail = e.values[13]; var Language2 = e.values[14]; var interpreterName = e.values[15]; var interpreterAgency = e.values[16]; var dateConformationSent = e.values[17]; var specialNotes = e.values[18]; var url = 'https://script.google.com/a/macros/richmond.k12.va.us/s/AKfycbwuRr1boKTH0v1mprWmc7PE66_mQ_dmPE0lyWb7vkfiyW3pn31b/exec'; /**might be that the & needs to be a ?…
upvote count: 1
type: AnsweredQuestion
has title: google script email form accept/reject
accepted answer: http://stackoverflow.com/a/28868161
type: Question
tagged with: google-apps-script

http://stackoverflow.com/a/28761518
answers question: http://stackoverflow.com/q/28760932
type: Answer
has comment: http://stackoverflow.com/comment/45851851
has body: Here is a silly piece of code to change the color of every black element of your page: var sourceColors = ["black", "#000000", "#000", "rgb(0,0,0)"]; var targetColor = "orange"; var elements = document.querySelectorAll("*"); for (var i = 0 ; i &lt; elements.length ; i++) { var e = elements[i]; if (sourceColors.indexOf(e.style.color)) { e.style.color = targetColor; } } I'm not sure this is what you want and it is not a ver fast method, but it works.
score: 0

http://stackoverflow.com/a/28925697
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28899336
answers question: http://stackoverflow.com/q/28899336
type: Answer
upvote count: 1
has body: To retrieve your stores, you can use the following code within your controller: var viewModel = this.getViewModel(); var todo = viewModel.getStore('todoAccountsStore'); var skip = viewModel.getStore('skipAccountsStore'); Based on this thread they state that the getStores method was intended to be private. I presume the docs have still has not been updated to represent this.
score: 1

http://stackoverflow.com/q/28803150
downvote count: 0
type: AnsweredQuestion
score: 1
has body: I would like a function to return an array of start and end ranges given a string and a regular expression. I would like it to behave something like the below: var sometext = "abc1 abc2 abc3 abc2"; var re = /abc2/; var range_array = match_range(sometext, re) [[5,8],[15,18]] I imagine there is an elegant function to do this, but a solution escapes me. Edit: I put improper desired ranges in my original example
accepted answer: http://stackoverflow.com/a/28803179
type: Question
upvote count: 1
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28803179
favorite count: 0
has title: Return array of text ranges given regex in Javascript
tagged with: regex

http://stackoverflow.com/comment/45822686
type: Comment
type: QuestionComment
has text: Did you reference the jQuery script? That works on my end.
comment on: http://stackoverflow.com/q/28771895
score: 0

http://stackoverflow.com/q/28757798
answer count: 2
has answer: http://stackoverflow.com/a/28762907
tagged with: google-maps
upvote count: 1
tagged with: javascript
tagged with: jquery
tagged with: google-maps-api-3
score: 0
downvote count: 1
has answer: http://stackoverflow.com/a/55842423
favorite count: 0
type: Question
has body: Inside &lt;head&gt;&lt;/head&gt; placed &lt;script src="http://maps.google.com/maps/api/js?sensor=true"&gt;&lt;/script&gt; Sometimes it takes too long time to open page. When page loads see Read maps.gstatic.com. When removed &lt;script src="http://maps.google.com/maps/api/js?sensor=true"&gt;&lt;/script&gt; page loads fast. So decided to start to load &lt;script src="http://maps.google.com/maps/api/js?sensor=true"&gt;&lt;/script&gt; only when other part of document loaded. Tried $(document).ready(function() { $.getScript("http://maps.google.com/maps/api/js?sensor=true"); }); But get error uncaught exception: Google Maps API is required. Please register the following JavaScript library http://maps.google.com/maps/api/js?sensor=true. Tried also this https://developers.google.com/maps/documentation/javascript/examples/map-simple-async outside document ready function loadScript() { var script = document.createElement('script'); script.type = 'text/javascript'; script.src = 'http://maps.google.com/maps/api/js?sensor=true'; document.body.appendChild(script); } window.onload = loadScript; Got the same error What to change to get to load google maps script only after other content loaded?
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28762907
has title: jquery get maps.google.com only when document ready
possible better answer: http://stackoverflow.com/a/55842423

http://stackoverflow.com/a/36502238
score: 18
has comment: http://stackoverflow.com/comment/66715632
answers question: http://stackoverflow.com/q/28822089
has comment: http://stackoverflow.com/comment/66688851
has comment: http://stackoverflow.com/comment/66715033
upvote count: 18
type: Answer
downvote count: 0
has body: I know this question is old - but in case someones fall in here (as I did) here it's how you should do it nowdays.. You import the react addon you want separately import Perf from 'react-addons-perf' and then you can do whatever you want with it.. Example: Assign it to the window object so you can use it in the console. window.Perf = Perf
has comment: http://stackoverflow.com/comment/66345068

http://stackoverflow.com/a/28830235
accepted answer of: http://stackoverflow.com/q/28830098
type: AcceptedAnswer
score: 0
type: Answer
has body: First of all change your html code from rgd�� to rgd. and then change your css for #right, remove absolute positioning and make it float left as: #right { width: 158px; border: #000000 1px solid; background-color: #339999; text-align: center; padding: 0px 2px 7px 2px; visibility: visible; left: 100px; top: 100px; z-index:3; float:left; }
answers question: http://stackoverflow.com/q/28830098

http://stackoverflow.com/q/28881181
tagged with: cfc
has comment: http://stackoverflow.com/comment/46034997
has comment: http://stackoverflow.com/comment/46040397
tagged with: ajax
has body: I am trying to populate a DIV with coldfusion query data based on a selection from a drop-down lsit. I am currently doing it by binding a CFDIV to a CFM action page but I am trying to do it via a pure JAVASCRIP solution instead. So via an AJAX call to a CFC I am recieving the following error: 500 (Error Executing Database Query.) The details of the error are: Error Executing Database Query. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE customer_id = 211 AND alert_status = 'on'' at line 4 It doesn't like my last query in my CFC for some reason yet that query work in my other code where I bind to a CFDIV. Here is my AJAX: Here is my DIV that I want to dynamically populate: Here is my SelectBox: ---Make A Selection--- Here is my CFC: <cfargument name="company_name" type="any" required="true"> <cfset var dataDetail = ""> select customer_id from customer_table where company_name = <cfqueryparam value="#ARGUMENTS.company_name#" cfsqltype="cf_sql_varchar"> SELECT ID, alert, alert_priority FROM customer_alerts WHERE WHERE customer_id = #getID.customer_id# AND alert_status = 'on' <cfreturn dataDetail.alert> </cfcomponent>
has comment: http://stackoverflow.com/comment/46035153
has comment: http://stackoverflow.com/comment/46039237
type: UnansweredQuestion
has title: Populating a DIV Based On ColdFusion Dynamic Dropdown List
linked to: http://stackoverflow.com/q/18792320
has comment: http://stackoverflow.com/comment/46025563
has comment: http://stackoverflow.com/comment/46024508
tagged with: coldfusion
has comment: http://stackoverflow.com/comment/46035845
answer count: 0
has comment: http://stackoverflow.com/comment/46035261
type: Question
has comment: http://stackoverflow.com/comment/46034380
tagged with: javascript
score: 0

http://stackoverflow.com/comment/45915371
type: Comment
score: 1
has text: The free one of these has the state information - http://www.unitedstateszipcodes.org/zip-code-database/
comment on: http://stackoverflow.com/q/28821804
type: QuestionComment

http://stackoverflow.com/q/28894822
favorite count: 0
tagged with: google-maps-api-3
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/28897252
has title: Can't click on KML Layer inside a polygon
has answer: http://stackoverflow.com/a/28897252
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/28837030
has answer: http://stackoverflow.com/a/28897509
has body: My problem is kind of simple, but I can't find how to fix it. I'm using AngularJS with Angular Google Maps (https://github.com/angular-ui/angular-google-maps) I have a simple map, with just a polygon and a KML layer, which displays a single marker inside the polygon. But I don't know why, I can't click on the marker. I put two different KML layers on the map, so you can see that the one outside the polygon is clickable while the second one, inside, is not. You can see the code below : 'use strict'; angular.module("map", ['uiGmapgoogle-maps']) .controller("MapController",['$scope', '$http', function ($scope, $http) { $scope.map = { center: { latitude: 48.80913908755741, longitude: 3.0915678394317014 }, zoom: 12, bounds: {} }; $scope.polygons = [{ id: 1, path: [ { latitude: 48.825218, longitude: 3.050508 }, { latitude: 48.823409, longitude: 3.101664 }, { latitude: 48.792885, longitude: 3.111105 }, { latitude: 48.793224, longitude: 3.060465 } ], stroke: { color: '#584885', weight: 2 }, editable: false, draggable: false, geodesic: false, visible: true, clickable: false, zindex: -1, fill: { color: '#E6E6E6', opacity: 0.6 } }]; $scope.kmlLayerOptions1 = { url: "http://nanakii.fr/up/ligne_bus.kml", preserveViewport: true }; $scope.kmlLayerOptions2 = { url: "http://nanakii.fr/up/ligne_bus2.kml", preserveViewport: true }; $scope.showKml = true; }]); * { margin: 0; padding: 0;} body, html { height:100%; } .angular-google-map-container { position:absolute; width:100%; height:100%; } I've tried many options, with no results. I found an old question here with the same problem but the answer didn't solve it. (Can't click point from KML if inside Polygon) Any help would be great ! Thanks ! Edit : I've also tried without Angular, so the problem comes directly from Google Maps. You can click on the bus line outside the polygon, but not inside. You can test the code here (the snippet was not working correctly) : http://nanakii.fr/dev/test/gmap.php
type: Question
linked to: http://stackoverflow.com/q/9289008
upvote count: 5
tagged with: angular-google-maps
answer count: 2
score: 5
tagged with: google-maps
accepted answer: http://stackoverflow.com/a/28897509
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/28891751
has comment: http://stackoverflow.com/comment/46044787
has body: I am displaying a Google Map with a fixed set of markers that I have stored in an array. The particular markers that are displayed are dependent on a date selected by the user. After the date is selected, I display the appropriate markers and also update each marker's info window for an event being held at the location. The issue I'm running into is the following. There are two markers relatively close together, call them M1 and M2. I select a date where M2 should be shown and everything works as expected. The correct marker is shown and the correct information is shown in the info window. I then select a date where M1 should be shown. Stepping through the code indicates the appropriate marker (M1) is shown. However, the info window still shows M2's information from the previous time it was displayed. The odd thing is, if I zoom in to focus on the area where the marker lies, then click on the marker to show the info window, the appropriate information for M1 is displayed. If I zoom back out, the information for M2 is displayed. If I repeat the initial steps above with the map already zoomed in, the info windows always display the appropriate information. There are no handlers registered with a zoom event and all markers are initialized with the optimized property set to false. I'm at a loss as to why this is happening. Any ideas? class ottb.Map constructor: () -&gt; @map = new google.maps.Map(document.getElementById("schedule-map"), gMapOptions) @gameMarkers = {} @displayedGames = {} @lastInfoWindow = null # Updates the map to show the games for the currently selected date. displayGames: (newGames) -&gt; @lastInfoWindow.close() if @lastInfoWindow isnt null # Fade out currently displayed games if they are not in the new list of # games to display for own teamAbbr, displayedGame of @displayedGames hasIt = newGames.some( (newGame) -&gt; newGame.home_team_abbr == displayedGame.home_team_abbr) if not hasIt @fadeOutMarker(@gameMarkers[displayedGame.home_team_abbr]) delete…
score: 0
has answer: http://stackoverflow.com/a/28892039
answer count: 1
type: UnansweredQuestion
has title: Google Maps bug? Displayed marker changes depending on zoom level
tagged with: coffeescript
type: Question
has comment: http://stackoverflow.com/comment/46044423
tagged with: google-maps
tagged with: javascript
has comment: http://stackoverflow.com/comment/46044638

http://stackoverflow.com/a/28900630
has body: .live() has been deprecated since jQuery v.1.7, so you need to use .on() instead
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28899900
answers question: http://stackoverflow.com/q/28899900

http://stackoverflow.com/a/28820544
answers question: http://stackoverflow.com/q/28820405
score: 0
has comment: http://stackoverflow.com/comment/45912854
has body: You should declare 'parent' as an object and set 'incomingValue' as a property like this: var parent = {}; parent.incomingValue = function(val) {...}
type: Answer

http://stackoverflow.com/comment/45887390
comment on: http://stackoverflow.com/q/28807038
score: 4
has text: What you mean by going off..
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28787556
has answer: http://stackoverflow.com/a/28787613
has body: How I can isolate value of string (00010111001101000001011100011001) on strings by number of characters(8) use jquery and javascript? I want this: Result: [ "00010111", "00110100", "00010111", "00011001" ]
score: 1
has answer: http://stackoverflow.com/a/28787609
upvote count: 1
linked to: http://stackoverflow.com/q/7033639
type: Question
has title: Isolate value of string by number of characters
duplicate of: http://stackoverflow.com/q/7033639
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28787613
answer count: 2
downvote count: 0
tagged with: jquery
favorite count: 0
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28787609

http://stackoverflow.com/q/28806904
tagged with: http://stackoverflow.com/tag/pdf
tagged with: node.js
type: UnansweredQuestion
upvote count: 1
score: 1
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/28807630
type: Question
tagged with: export
answer count: 2
has body: I've been looking for a way to export json data to 3 main formats which is [docx, xlsx and pdf]. so far i've been able to simply do this in node: var data = req.body["exportData"]; var headers = req.body["exportHeaders"]; var delimitedHeaders = ""; headers.forEach(function(item, index) { if ((headers.length - 1) != index) { delimitedHeaders += item + ','; } else { delimitedHeaders += item + '\r\n'; } }); var excelData = ""; data.forEach(function (item) { var keyCount = Object.keys(item).length; var lastProp = Object.keys(item)[keyCount - 1]; for (var prop in item) { if (item.hasOwnProperty(prop)) { if (prop != lastProp) { excelData += item[prop] + ','; } else { excelData += item[prop] + '\r\n'; } } } }); fs.writeFile('file.xls', '\ufeff ' + headers + '\r\n' + excelData, {encoding: 'utf8'}, function (err) { if (err) throw err; res.end(); }); The problem is that it's too simple and there is no way of adding any design related features also it only works with xls and csv but can't use it for doc and pdf even in xls i want it to appear as data table with headers but i can't specify that. Please help me :).
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28807178
has title: Is there a way to export json data to docx, pdf and excel in node or client javascript?

http://stackoverflow.com/comment/45966717
score: 0
has text: you have to use .NET SDK client for facebook https://facebook.codeplex.com/
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28849660

http://stackoverflow.com/a/28842486
type: Answer
accepted answer of: http://stackoverflow.com/q/28842417
has comment: http://stackoverflow.com/comment/45957745
upvote count: 3
score: 3
answers question: http://stackoverflow.com/q/28842417
has body: You can put a regex on your route parameters. Here's a working example: var app = angular.module('myApp', [ 'ui.router', ]) app.config(['$urlRouterProvider', '$stateProvider', function($urlRouterProvider, $stateProvider) { $stateProvider .state('table', { // this is the important bit. // it will restrict this route to only 'products' and 'customers url: '/{table:products|customers}' }) .state('table.edit', { url: '/edit/:id', template: " TABLE " }) .state('home', { url: '/*path', // special 'catch all route', template: " HOME " }); $urlRouterProvider.otherwise('/home'); }]); app.run(['$rootScope', '$state', function($rootScope, $state) { $rootScope.$state = $state; }]) Hello Plunker! /products/edit/5 /customers/edit/5 /not-a-table/edit/5 /this-is-a-random-url $state = {{$state.current.name}} $params = {{$state.params}} $state full url = {{ $state.$current.url.source }} https://github.com/angular-ui/ui-router/wiki/URL-Routing#regex-parameters
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/28864573
answers question: http://stackoverflow.com/q/28864360
score: 0
type: Answer
has body: This is the regex you are looking for: \$\{[^}]*\} This way, it matches with the first ocurrence of '}', because [^}] means "match any character but '}'".

http://stackoverflow.com/a/28886971
has comment: http://stackoverflow.com/comment/46439192
accepted answer of: http://stackoverflow.com/q/28883528
has comment: http://stackoverflow.com/comment/46054853
score: 3
has comment: http://stackoverflow.com/comment/46108220
answers question: http://stackoverflow.com/q/28883528
has comment: http://stackoverflow.com/comment/46397040
downvote count: 0
has body: The angular-datatables also provides plugin to FixedHeader works with datatables. You need to add the filesangular-datatables.fixedheader.min.jsto your HTML. You also need to add the dependencydatatables.fixedheader` to your Angular app. then your code will look like below. HTML Name {{item.name}} CODE var app = angular.module('app', ['datatables', 'datatables.fixedheader']) app.controller("SampleController", function($scope, DTOptionsBuilder, DTColumnBuilder) { $scope.dtOptions = DTOptionsBuilder.fromSource('data.json') .withPaginationType('full_numbers') .withDisplayLength(25) .withFixedHeader({ bottom: true }); $scope.dtColumns = [ DTColumnBuilder.newColumn('id').withTitle('ID'), DTColumnBuilder.newColumn('Name').withTitle('Name'), DTColumnBuilder.newColumn('Address').withTitle('Address') ]; }); No need of adding directive, because there is already directive created inside angular-datatables.fixedheader.min.js (Reference Link) Update: Below changes need to be done in code. Replace FixedHeader js code & jquery code to new $.fn.dataTable.FixedHeader($element.find('#example')) Call that method which will set FixedHeader Controller (function(angular) { angular.module('showcase.angularWay', ['datatables']) .controller('AngularWayCtrl', AngularWayCtrl); function AngularWayCtrl($http, $element) { var vm = this; $http.get('data.json').then(function(res) { vm.persons = res.data; vm.setFixedHeader(); //call method to set glass. }); vm.setFixedHeader = function(){ //var table = $element.find('#example').DataTable(); new $.fn.dataTable.FixedHeader($element.find('#example')) }; } })(angular); You can also move this code to directive, only you need to remove header column which is appended as extra header. I referred this link for above updated solution Working Plunkr
has comment: http://stackoverflow.com/comment/46045172
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46522228
has comment: http://stackoverflow.com/comment/46045147
upvote count: 3
has comment: http://stackoverflow.com/comment/46385305
has comment: http://stackoverflow.com/comment/46356898
type: Answer
has comment: http://stackoverflow.com/comment/46440964
has comment: http://stackoverflow.com/comment/46523663
has comment: http://stackoverflow.com/comment/46440775
has comment: http://stackoverflow.com/comment/46440843

http://stackoverflow.com/comment/45926314
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28827868
has text: close, but something is wrong here, now I dont need the `if ($('#datePickersAppearance').val(''))` since you introduced the session storage. But even when I remove it, I still don't get the changed dates after refresh

http://stackoverflow.com/comment/45854441
type: QuestionComment
score: 3
has text: A JSON response is not the same as a JSONP response. If your server is emitting the JSON you've listed then it's not JSONP
comment on: http://stackoverflow.com/q/28789496
type: Comment

http://stackoverflow.com/q/28899524
tagged with: mongodb
tagged with: mongoose
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28899688
upvote count: 1
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28899688
has title: MongoDB Query with multiple conditions and slice
tagged with: node.js
type: AnsweredQuestion
downvote count: 0
score: 1
has body: I have this Mongoose Query: return Domain.find({domain:req.params.domain}) .where('date').equals(date) .exec(function (err, domain) { if (!err) { if (!isEmpty(domain[0].visitors)) { domain[0]['visitors'] = domain[0].visitors.slice(0,99); } } I want to slice directly in the database and not after retrieving object. Mongoose cannot do this or it is not documented or I did not find documentation. So I fall back to node.js native MongoDB Driver by using the collection keyword. My code looks now as follow and fails: return Domain.collection.find( { "domain":req.params.domain }, { "date":date }, { "visitors": { $slice:100 } }, function(err,domain){ if (!err) { res.status(200).send({ domain:domain }); } Full code: https://gist.github.com/nottinhill/b3837d4c913b9e5dd879 I tried in MongoDB console to construct a query that will work, but cannot get this simple query to work. MongoDB documentation does not show how to query with two conditions. I want to: Pseudo-Code of what I want: find giveBack wholeDomainObject where domain == domain where date == date also slice visitorsArray
type: Question

http://stackoverflow.com/a/28850563
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28850489
type: AcceptedAnswer
type: Answer
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/28850489
has body: Change p.setAttribute("class", "wonp"); to p.className = "wonp"; Some versions of IE have a bug in that they expect you to use "className" with setAttribute, even though the attribute's name is class, not className. But all versions of IE and other browsers use className for the reflected property name, so the change above will solve the problem. It's rare to actually need to use setAttribute. Virtually all of the attributes you might set (with the obvious exception of data-* attributes) have reflected properties on the element instance that are more useful. class and for (as in, on label elements) have slightly odd names (className and htmlFor) because class and for are reserved words in JavaScript and when this was being defined, JavaScript didn't let you use reserved words as property name literals (it does now), but most other reflected properties have the same name as the attribute they reflect: element.setAttribute("class", x) => element.className = x labelElement.setAttribute("for", x) => labelElement.htmlFor = x element.setAttribute("id", x) => element.id = x formElement.setAttribute("target", x) => formElement.target = x linkElement.setAttribute("rel", x) => linkElement.rel = x element.setAttribute("src", x) => element.src = x (script, img, ...) Sometimes there are slight differences. For instance, element.getAttribute("href") will give you the actual text of the href attribute, but element.href will give you the resolved version (e.g., relative paths expanded to full ones). Similarly, the value property of input elements is only initialized from the "value" attribute, after which it takes on a life of its own (usually, but not always, reflected as defaultValue).

http://stackoverflow.com/comment/46050246
type: Comment
score: 0
has text: An old one, but worth reading: [model binding to a list.](http://haacked.com/archive/2008/10/23/model-binding-to-a-list.aspx/)
type: AnswerComment
comment on: http://stackoverflow.com/a/28894005

http://stackoverflow.com/a/37269043
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28782415
has body: this answer may be a bit too late now but I am currently working on an inherited project of which I continued working on. I found that they were using a Divi theme on an updated Wordpress which triggers all the errors above. I inspected the source error and I found that this selector was incorrect: $( 'a[href*=#]:not([href=#])' ) I fixed this by changing it to this without compromising any functionality: $( 'a[href*=\\#]:not([href=\\#])' ) It also works with this: $( 'a[href*="#"]:not([href="#"])' ) The issue was fixed and the functionality for that block of code is still working.

http://stackoverflow.com/comment/46011076
type: Comment
score: 0
has text: you code is working Fine But backspace function not working for me.Please guide me
comment on: http://stackoverflow.com/a/28872603
type: AnswerComment

http://stackoverflow.com/comment/46585211
type: AnswerComment
type: Comment
has text: My expectation is that the image file is shown in the browser in the browser's native image display format. This happens, but the user is now no longer in the page.js app. Navigating back, the URL *should* get picked up by Apache and there should be a redirect back to /index.html, where page.js should fire back up and route the viewer accordingly. Instead, the navigation event is just swallowed, nothing changes but the URL.
comment on: http://stackoverflow.com/a/29159951
score: 0

http://stackoverflow.com/q/28873332
has answer: http://stackoverflow.com/a/71783413
possible better answer: http://stackoverflow.com/a/28999075
has comment: http://stackoverflow.com/comment/46181266
linked to: http://stackoverflow.com/q/28813523
tagged with: node.js
has answer: http://stackoverflow.com/a/66813167
has comment: http://stackoverflow.com/comment/46212146
has answer: http://stackoverflow.com/a/77824070
score: 74
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28917980
has comment: http://stackoverflow.com/comment/103695785
tagged with: google-chrome-devtools
has comment: http://stackoverflow.com/comment/46211794
has comment: http://stackoverflow.com/comment/46211977
linked to: http://stackoverflow.com/q/3246792
has body: When developing client side javascript applications, the developer network panel is invaluable for debugging network issues: How does a developer creating a NodeJS application monitor the network traffic from the nodejs application to a http/https server? For example how to debug the following network traffic? var http = require('http'); var req = http.request ... req.write ... req.send() My code is making a call to a third party https server, so I am unable to use wireshark or similar packet sniffing tools. For more information, the problem I am trying to investigate is here. EDIT: Here are similar questions asking how to do the same thing in other languages: PYTHON: How can I see the entire HTTP request that&#39;s being sent by my Python application? JAVA: How to enable logging for apache commons HttpClient on Android
downvote count: 1
tagged with: https
type: Question
has comment: http://stackoverflow.com/comment/46124929
linked to: http://stackoverflow.com/q/10588644
has answer: http://stackoverflow.com/a/45620856
tagged with: javascript
has answer: http://stackoverflow.com/a/73224673
has comment: http://stackoverflow.com/comment/46211614
upvote count: 75
accepted answer: http://stackoverflow.com/a/28917980
has answer: http://stackoverflow.com/a/78640271
answer count: 10
has answer: http://stackoverflow.com/a/57639033
has comment: http://stackoverflow.com/comment/129779421
has answer: http://stackoverflow.com/a/28999075
favorite count: 0
linked to: http://stackoverflow.com/q/10985350
has title: how to monitor the network on node.js similar to chrome/firefox developer tools?
has answer: http://stackoverflow.com/a/30661584
has comment: http://stackoverflow.com/comment/46211550

http://stackoverflow.com/q/28776258
tagged with: javascript
has answer: http://stackoverflow.com/a/28776658
has title: How to execute if statement after page has been loaded?
score: 0
has comment: http://stackoverflow.com/comment/45830623
tagged with: jquery
has answer: http://stackoverflow.com/a/28776279
has answer: http://stackoverflow.com/a/28776722
has answer: http://stackoverflow.com/a/28776411
type: UnansweredQuestion
answer count: 4
linked to: http://stackoverflow.com/q/10779076
has comment: http://stackoverflow.com/comment/45830728
type: Question
has body: see it in action here: http://jsbin.com/relamiqeru/1/ I am trying to make it so that if a user enters "idh4" into the coupon code field, my "booyah" div gets filled with that html provided. The issue I feel, is that the javascript is only executed when the page is loaded, so even if idh4 is entered into the field, its not checking it anymore. Perhaps an if statement is not the right thing to use in this case? At request, here is the jsbin code: Coupon Code? $("#couponcode").change(function(){ if ($("#couponcode").val() === 'idh4') { console.log('it got called'); $( "#booyah" ).html(" That code gets you free snappie stickers! "); } });

http://stackoverflow.com/comment/45965331
comment on: http://stackoverflow.com/a/28834029
type: Comment
score: 1
has text: lets say you have another task to minify another set of css files, then you would have copy-css depend on both those tasks... that would do it
type: AnswerComment

http://stackoverflow.com/comment/45867909
comment on: http://stackoverflow.com/q/28790903
score: 0
type: Comment
type: QuestionComment
has text: What georg said. If the API key is individual per user, then you can store it on the users machine - it's his anyway and other people can't get it from there. If it's the same key for everybody, what's the point of the key?

http://stackoverflow.com/q/28883528
has comment: http://stackoverflow.com/comment/46315994
has answer: http://stackoverflow.com/a/28886971
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/28886971
has body: I am using the stable build version Stable release v2.1.2 of the fixed header jquery plugin. I am trying to fix my table header. I have created the table using Angular datatables as mentioned over here. In my controller class I have written the following code, app.controller("SampleController", function ($scope) { $(document).ready( function () { var table = $('#example').DataTable(); new $.fn.dataTable.FixedHeader( table ); }); }); My HTML is as follows, Name {{item.name}} However when i run my application, i get the following error, TypeError: Cannot read property 'childNodes' of undefined I also tried using the following directive as I am aware that DOM manipulations should not be done in Controller but I get the following error. TypeError: Cannot set property '_oPluginFixedHeader' of undefined UPDATE: my directive app.directive('fixHeader', function () { return { restrict: 'AE', //attribute or element replace: true, link: function ($scope, elem, attr) { $scope.table = elem.find("#example"); console.log($scope.table); var table= $scope.table.dataTable(); new $.fn.dataTable.FixedHeader(table); } }; }); Please can someone suggest a better solution? I am using version 2.1.2 of dataTables.fixedHeader.js and my error comes in below line var dt = $.fn.dataTable.Api ? new $.fn.dataTable.Api( mTable ).settings()[0] : mTable.fnSettings(); dt._oPluginFixedHeader = this; //error over here
type: AnsweredQuestion
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/46348430
type: Question
answer count: 1
has title: Fix header plugin not working in Angular datatables
tagged with: javascript
tagged with: jquery
tagged with: fixed-header-tables
favorite count: 0
upvote count: 3
tagged with: datatable

http://stackoverflow.com/q/28846235
type: UnansweredQuestion
tagged with: vimeo
type: Question
has title: Pause Vimeo when a div is set to display: none
tagged with: javascript
has comment: http://stackoverflow.com/comment/45963258
tagged with: jquery
has comment: http://stackoverflow.com/comment/45961118
score: 0
tagged with: froogaloop
has body: I'm trying to figure out how to write the script to pause a Vimeo video when a div is set to display none. I have the froogalop Vimeo API script linked. I have the following code for on click but I would like to adjust it so that instead of clicking stop it is automatic on display: none. jQuery(document).ready(function( $ ) { var iframe = $('#vimeo-player')[0]; var player = $f(iframe); $('#stop').click(function(){ player.api('stop'); }); }); Any insight would be appreciated
answer count: 0

http://stackoverflow.com/a/36899383
score: 28
upvote count: 28
has comment: http://stackoverflow.com/comment/114125146
type: Answer
answers question: http://stackoverflow.com/q/28889826
has body: I just ran into this issue and I'm using react 15.0.1 15.0.2 and I'm using ES6 syntax and didn't quite get what I needed from the other answers since v.15 dropped weeks ago and some of the this.refs properties were deprecated and removed. In general, what I needed was: Focus the first input (field) element when the component mounts Focus the first input (field) element with an error (after submit) I'm using: React Container/Presentation Component Redux React-Router Focus the First Input Element I used autoFocus={true} on the first &lt;input /&gt; on the page so that when the component mounts, it will get focus. Focus the First Input Element with an Error This took longer and was more convoluted. I'm keeping out code that isn't relevant to the solution for brevity. Redux Store / State I need a global state to know if I should set the focus and to disable it when it was set, so I don't keep re-setting focus when the components re-render (I'll be using componentDidUpdate() to check for setting focus.) This could be designed as you see fit for you application. { form: { resetFocus: false, } } Container Component The component will need to have the resetfocus property set and a callBack to clear the property if it ends up setting focus on itself. Also note, I organized my Action Creators into separate files mostly due to my project is fairly large and I wanted to break them up into more manageable chunks. import { connect } from 'react-redux'; import MyField from '../presentation/MyField'; import ActionCreator from '../actions/action-creators'; function mapStateToProps(state) { return { resetFocus: state.form.resetFocus } } function mapDispatchToProps(dispatch) { return { clearResetFocus() { dispatch(ActionCreator.clearResetFocus()); } } } export default connect(mapStateToProps, mapDispatchToProps)(MyField); Presentation Component import React, { PropTypes } form 'react'; export default class MyField extends React.Component { // don't forget to .bind(this) constructor(pr…
downvote count: 0

http://stackoverflow.com/q/28876552
has comment: http://stackoverflow.com/comment/46015456
has body: I've got a page with a div, and if it's clicked upon then a text input box should appear. Here's a minimal code: a The problem is that although the text input box appears, no chars are shown there. However, if I use: $( this ).replaceWith( " " ); it works as expected. Also, it works as expected if I'm adding the html to another element, for example $("#some_other_element").html( " " ); Is this a bug or is there something I'm missing here? Thanks
has answer: http://stackoverflow.com/a/28876660
has comment: http://stackoverflow.com/comment/46016113
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28876655
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46015124
has title: unexpected behavior when adding a text input with .html()
has comment: http://stackoverflow.com/comment/46015368
has comment: http://stackoverflow.com/comment/46015270
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46017134
type: Question

http://stackoverflow.com/a/28911599
answers question: http://stackoverflow.com/q/28893025
score: 0
type: Answer
has body: Actually I tried to use json script to get the Ip of the viewers and I was able to show it in alert but was no able to capture it ina label or textbox.I fetched the ip of the viwers in an alternative manner now not with json. Went for sever side code and it did my pupose. ipAddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (string.IsNullOrEmpty(ipAddress)) { ipAddress = Request.ServerVariables["REMOTE_ADDR"]; } else { Response.Write(ipAddress); } In this way I saved the Ip of the viewers in my database and it is successfully working. Thank you all for helping with answers

http://stackoverflow.com/comment/129621618
score: 0
type: AnswerComment
type: Comment
has text: how it will be looking combining n videos and without audio? Is it possible?
comment on: http://stackoverflow.com/a/65373659

http://stackoverflow.com/q/28858176
type: AnsweredQuestion
tagged with: build
has title: What does webpack mean by XX hidden modules
type: Question
score: 86
accepted answer: http://stackoverflow.com/a/28899351
upvote count: 86
tagged with: webpack
tagged with: javascript
has body: I've been playing with webpack and during the build I see it output: + 27 hidden modules. What does it mean by this? Is it detecting global constants that I'm using without requiring them?
answer count: 1
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28899351

http://stackoverflow.com/comment/45872581
type: QuestionComment
has text: Downvoted for the lack of code. You should provide the code that "can't access" to let us check it out. It seems to me you are pretty free to play around; [see this example for instance](http://pastebin.com/embed_js.php?i=spETQJYE).
comment on: http://stackoverflow.com/q/28792809
type: Comment
score: 0

http://stackoverflow.com/comment/112494017
comment on: http://stackoverflow.com/a/28858020
has text: This did not work for me. I can open dev tools, but I don't see anything that looks like my client-side apps script listed there. If I add 'debugger;' to my code, it stops in userCodeAppPanel, but again, it looks nothing like my code (not even a compressed/obfuscated version of it).
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28825677
type: AnsweredQuestion
score: 1
tagged with: this
answer count: 1
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28825730
has title: How do I gain the context I want when using a method from an object in a method of another object?
favorite count: 0
has body: First Object and method: objectOne.prototype.getData = function (id, callback) { this._sendRestRequest({ method: "GET", path: /accounts/ + id + "/data" }, function (error, body, statusCode) { if (error) { if (body &amp;&amp; body.message) { console.error("[ERROR]", statusCode + " Error: " + body.message + " (error code " + body.code + ")"); return callback(body.message); } return callback(error); } if (body &amp;&amp; body.trades) { callback(null, body.trades); } else { callback("Unexpected response"); } }); }; Second Object and method: function dataManip = function () { this.data; this.getData = function () { if(some condition) { objectOne.getData("31313", function (error, data) { this.data = data; }); } If I were to console.log this.data it would be undefined since this refers to the first object and not the second object. So I've been trying apply, bind, and call; however, I can't seem to get it to work so that "this" refers to dataManip and not ObjectOne. What is the best way to gain the context I need? EDIT: Using bind, apply, and call causes an error since "this" is used inside the first object.
accepted answer: http://stackoverflow.com/a/28825730
upvote count: 1
type: Question

http://stackoverflow.com/a/28869314
has comment: http://stackoverflow.com/comment/46022828
type: Answer
has body: If you are certain that there will be only one match, then you can use find, because it will return after getting the first match. var items = [{ "obj1": ["1", "2"] }, { "obj2": ["3", "4"] }, { "obj3": ["5", "6"] }]; var stateName = "obj1"; var item = _.chain(items) .find(function(currentObject) { return _.has(currentObject, stateName); }) .values() .flatten() .value(); console.log(item); # [ '1', '2' ] In the find function, we return true only if the current object being processed has a property with the name in the stateName, with the _.has function. At this point the result will be like this { obj1: [ '1', '2' ] } If that is true, then only that object will be returned. Since you need only the values, we call the values function on it. At this point, the result will be like this [ [ '1', '2' ] ] And then values actually returns an array of values. So, we flatten it with flatten function to get the actual value. And here, the final result would be [ '1', '2' ]
accepted answer of: http://stackoverflow.com/q/28869255
answers question: http://stackoverflow.com/q/28869255
upvote count: 1
has comment: http://stackoverflow.com/comment/46023152
type: AcceptedAnswer
downvote count: 0
score: 1

http://stackoverflow.com/a/28893185
score: 1
has body: var data = []; var arrayLength = answers.length; data[0] = ['Answer', 'Votes']; for (var i = 1; i &lt; arrayLength; i++) { data.push([answers[i], votes[i]]); /*It's not += but .push()*/ }
downvote count: 0
answers question: http://stackoverflow.com/q/28893121
type: Answer
has comment: http://stackoverflow.com/comment/46046777
upvote count: 1
has comment: http://stackoverflow.com/comment/46063196

http://stackoverflow.com/q/28761277
answer count: 3
has comment: http://stackoverflow.com/comment/45802719
has answer: http://stackoverflow.com/a/28761974
has answer: http://stackoverflow.com/a/28762425
type: Question
tagged with: object
type: AnsweredQuestion
has title: how do find duplicate values in a multidimensional array
has comment: http://stackoverflow.com/comment/45802817
possible better answer: http://stackoverflow.com/a/28761645
has answer: http://stackoverflow.com/a/28761645
has body: Im in trouble here; I want to collect all values from array which are duplicates. modified Example: Array [ { first: array[ 24, 58], last: array[ 25, 59 ] }, { first: array[ 25, 59], last: array[ 23, 57] }, { first: array[ 25, 59], last: array[ 26, 54] }, { first: array[ 23, 58], last: array[ 22, 58] }, { first: array[ 22, 58], last: array[ 23, 54] }, Object, Object, Object, Object, Object, /*98 more…*/ ] And if the script finds similar values they should be pushed to another array. var arrayCollect = [] arrayCollect.push([similar values]); And the result example arrayCollect=[[similar values], [similar values]]; and similar value is an entire collection of similar values ([Object, Object...]) I've tried this: var array =[]; for(var i=0; i &lt; arrayLastFirst.length; i++){ if(arrayLastFirst[i].first[0] &amp;&amp; arrayLastFirst[i].first[1] == arrayLastFirst[i].last[0] &amp;&amp; arrayLastFirst[i].last [1]) { array.push(arrayLastFirst[i].first, arrayLastFirst[i].last); } } but that is not correct and I don't know what is wrong, I suspect incorrect logic. i modified my code for better understanding for what i want for in the end. So my output need to be like this: Array[ [ { first: array[ 24, 58], last: array[ 25,59] }, { first: array[ 25, 59],//its inside that array couse the first value is the same like the last value before that. last: array[ 23,57] }, { first: array[ 25, 59], last: array[ 26, 54] } ], [ { first: array[ 23, 58], last: array[ 22, 58] }, { first: array[ 22, 58], last: array[ 23, 54] }//and these are similar values couse last and the first are the same ] ] maybe this is more understandable what i need in the end.
accepted answer: http://stackoverflow.com/a/28761974
tagged with: arrays
tagged with: javascript
tagged with: sorting
has comment: http://stackoverflow.com/comment/45802640
score: 0

http://stackoverflow.com/comment/45830083
has text: @DaveNewton I also find suggesting specific resources (nothing to in-depth on my part) is often helpful. I would suggest [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript). Also, Zack, consider whether or not you need to attempt to cast the input as a number (whether or not that actually provides the validation that you need)
comment on: http://stackoverflow.com/q/28775939
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28892720
has answer: http://stackoverflow.com/a/28892792
answer count: 4
has comment: http://stackoverflow.com/comment/46046056
has answer: http://stackoverflow.com/a/28892750
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28892765
score: 7
has answer: http://stackoverflow.com/a/49400057
tagged with: jquery-ui-datepicker
type: Question
accepted answer: http://stackoverflow.com/a/28892765
has title: Disable date before current date in JQuery UI datepicker
tagged with: jquery-ui
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46052464
favorite count: 0
has body: I want to disable the date before current date in date picker. How to do this? $(function() { var $dp1 = $("#datepicker1"); $(document).ready(function() { $dp1.datepicker({ changeYear: true, changeMonth: true, dateFormat: "yy-m-dd", yearRange: "-100:+20", }); }); }); $(function() { var $dp2 = $("#datepicker2"); $(document).ready(function() { $dp2.datepicker({ changeYear: true, changeMonth: true, yearRange: "-100:+20", dateFormat: "yy-m-dd", }); }); }); p.pfield-wrapper input { float: right; } p.pfield-wrapper::after { content: "\00a0\00a0 "; /* keeps spacing consistent */ float: right; } p.required-field::after { content: "*"; float: right; margin-left: -3%; color: red; } Start Date End Date Equivalent JsFiddle
upvote count: 7
possible better answer: http://stackoverflow.com/a/28892750

http://stackoverflow.com/comment/45905532
type: QuestionComment
score: 1
has text: Please indent your code properly.
comment on: http://stackoverflow.com/q/28816876
type: Comment

http://stackoverflow.com/comment/46048505
type: AnswerComment
has text: @underscore: For the "homepage" of the server (so, probably for your `index.html`), yes. Then you'll need another route for serving .js and other files (CSS, pages other than `/`, etc.). Again, the routing guide has the details.
comment on: http://stackoverflow.com/a/28894102
type: Comment
score: 0

http://stackoverflow.com/comment/45829050
type: Comment
comment on: http://stackoverflow.com/a/28775406
has text: @miho - I added a code example, now that I know `myService` is an `EventEmitter`.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45830484
comment on: http://stackoverflow.com/a/28776169
score: 1
has text: Good one! I was going to hack it with: `$('.foo').html($('.bar'));` But your answer is exactly what he's asking for
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45948077
comment on: http://stackoverflow.com/q/28824478
has text: Thanks for the tip. I updated the question with a link to jsfiddle.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45946617
comment on: http://stackoverflow.com/q/28838631
score: 0
type: Comment
has text: Why does it surprise you that different browsers have different performance?
type: QuestionComment

http://stackoverflow.com/tag/csv
type: Tag
tags question: http://stackoverflow.com/q/28831323
tag name: csv
tags question: http://stackoverflow.com/q/28835993
tags question: http://stackoverflow.com/q/28772608
tags question: http://stackoverflow.com/q/28814184
tags question: http://stackoverflow.com/q/28892342
tags question: http://stackoverflow.com/q/28850720

http://stackoverflow.com/a/28902007
answers question: http://stackoverflow.com/q/28901773
downvote count: 0
has body: Maybe something like this? If there will be more buttons, it should be more optimalized. $('.btns').find('div').click(function(){ $('.prevs').find('div').eq($(this).index()).toggle(); }); $('.btns').find('div').click(function(){ $('.prevs').find('div').eq($(this).index()).toggle(); }); .prevs div:not(.pre1) { display:none; } Button 1 Button 2 Button 3 Button 4 Previews 1 Previews 2 Previews 3 Previews 4
score: 1
upvote count: 1
type: Answer

http://stackoverflow.com/comment/45910834
type: Comment
score: 0
has text: You'll also want to use `"_blank"` for the second argument instead of the title of it. And for getting the right URL, there are four different ways. Without a slash (like you used) would mean if you're on a page like http://stackoverflow.com/questions/28819006, links would go to http://stackoverflow.com/questions/x12Display.cshtml. To go to http://stackoverflow.com/x12Display.cshtml, the URL should be `/x12Display.cshtml` or `../x12Display.cshtml`. The other two types are specific to linking to resources of other domains/websites.
comment on: http://stackoverflow.com/q/28819006
type: QuestionComment

http://stackoverflow.com/a/43514024
type: Answer
has body: If you are using it in aspx page you can escape it by using this syntax. adding backslash in front of % "&lt;\%=datasetLabel%&gt; : &lt;\%=value%&gt;"
downvote count: 0
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28805312

http://stackoverflow.com/comment/72368248
has text: Can you provide a full fiddle on this?
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28850684

http://stackoverflow.com/a/28825504
upvote count: 2
has comment: http://stackoverflow.com/comment/45924979
has comment: http://stackoverflow.com/comment/45938391
downvote count: 0
has body: I ended up implementing a completely non-regex, recursive approach to the problem. The cleanupEqn() function essentially splits each string by operators (top level parentheses are grouped as a single operand), recursively operates on each sub part, then does another run through on the way back up the function call chain. Comparing this with funkwurm's regex solution in jsperf shows it is significantly faster (at least in my personal chrome and firefox browsers). It hasn't been thoroughly tested yet, and I'm sure there could be improvements made so I welcome any feedback. Stealing funkwurm's snippet display to show my solution: var sEq = "(0+(0/0.5+(0+1*cos(p)+0*0+0*sin(p))*cos(k)+(0+1*0+0*1+0*0)*(-sin(k))+(0+1*(-sin(p))/0.5+0*0+0*cos(p))*0)*x+(0+(0+1*cos(p)+0*0+0*sin(p))*sin(k)+(0+1*0+0*1+0*0)*cos(k)+(0+1*(-sin(p))/0.5+0*0+0*cos(p))*0)*y+(0+(0+1*cos(p)+0*0+0*sin(p))*0+(0+1*0+0*1+0*0)*0+(0+1*(-sin(p))/0.5+0*0+0*cos(p))*1)*z)"; var operators = ['+','-','*','/']; var level = 0; var result = cleanupEqn(sEq); document.getElementById('solution').innerHTML = result; function cleanupEqn(eqn){ var parts = removeRedundant(splitByParen(eqn)); level++; document.getElementById('output').value += 'Level ' + level + ': Processing ' + eqn + '\n'; for(var i=0; i < parts.length; i++){ document.getElementById('parts').value += parts[i] + '\n'; if(parts[i].charAt(0) === '('){ // Clean up the expression inside the parentheses var tmp = cleanupEqn(parts[i].substring(1,parts[i].length-1)); // If it was reduced to a zero, don't add the parentheses back if(tmp === '0'){ parts[i] = '0'; } else { parts[i] = '(' + tmp + ')'; } } } // Finally, remove redundancies again, since some might have bubbled up. removeRedundant(parts); document.getElementById('output').value += 'Level ' + level + ': Completed ' + eqn + '\n' + JSON.stringify(parts, null, '\t') + '\n'; level--; // Join it all into a string and return return parts.join(''); } function splitByParen(str){ var out = []; var exprStart = 0; var…
answers question: http://stackoverflow.com/q/28802489
type: Answer
score: 2

http://stackoverflow.com/comment/45877435
comment on: http://stackoverflow.com/q/28801414
score: 0
has text: I tried a version of Will's example from below. The submit button wasn't working and with his it's still not working. I'll try the other answer too.
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/46045993
score: 0
type: AnswerComment
has text: @AndrewL If it's on the same page it doesn't matter what script tag it's in.
type: Comment
comment on: http://stackoverflow.com/a/28892721

http://stackoverflow.com/a/28801638
type: Answer
has comment: http://stackoverflow.com/comment/45917636
has comment: http://stackoverflow.com/comment/104674828
has body: What you need is to express the velocity in terms of polar coordinates. That means instead of storing and X and Y velocity you store an angle and a speed. Then in your update function you convert these into X and Y velocities to update the position. You can convert from polar to cartesian coordinates using trigonometry: So in your code you would do something like this: // In the Constructor this.angle = 0; this.speed = 0; // ... // function Update() { this.speed = 0; // Do this if you want the rectangle to have no momentum // Input handling if(this.inputWASD[0]) this.speed += acceleration; if(this.inputWASD[2]) this.speed -= acceleration; if(this.inputWASD[1]) this.angle -= angleMovement; if(this.inputWASD[3]) this.angle += angleMovement; // Position update this.x += this.speed * Math.cos(this.angle); this.y += this.speed * Math.sin(this.angle); } Note: I renamed velocity to acceleration to be more consistent with Physics terminology. Also I reset the speed to 0 on every tick so the rectangle has no momentum. If you want more realism you could remove that line and instead just decrease the velocity by a little bit (say 10% or so) on each update to simulate friction.
score: 3
has comment: http://stackoverflow.com/comment/45913737
upvote count: 3
has comment: http://stackoverflow.com/comment/45917390
has comment: http://stackoverflow.com/comment/45951119
has comment: http://stackoverflow.com/comment/45913623
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28801458
has comment: http://stackoverflow.com/comment/45910603
answers question: http://stackoverflow.com/q/28801458

http://stackoverflow.com/q/28813001
has answer: http://stackoverflow.com/a/28813462
has answer: http://stackoverflow.com/a/28845160
has title: Horizontal scroll not working in Chrome
tagged with: google-chrome
tagged with: horizontal-scrolling
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45897894
score: 0
answer count: 2
has body: I have a website with horizontal scroll. It works in Firefox but not in Chrome. http://jellekok.com/customers/udiverse/ Any idea why it's not working in Chrome? Main JS file: jquery1.8.2.min.js horizontal scroll javascript: /* jQuery.ScrollTo - Easy element scrolling using jQuery - Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com - Dual licensed under MIT and GPL - Date: 3/9/2009 - @author Ariel Flesler - @version 1.4.1 - http://flesler.blogspot.com/2007/10/jqueryscrollto.html */ ;(function($){var m=$.scrollTo=function(b,h,f){$(window).scrollTo(b,h,f)};m.defaults={axis:'xy',duration:parseFloat($.fn.jquery)>=1.3?0:1};m.window=function(b){return $(window).scrollable()};$.fn.scrollable=function(){return this.map(function(){var b=this,h=!b.nodeName||$.inArray(b.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!h)return b;var f=(b.contentWindow||b).document||b.ownerDocument||b;return $.browser.safari||f.compatMode=='BackCompat'?f.body:f.documentElement})};$.fn.scrollTo=function(l,j,a){if(typeof j=='object'){a=j;j=0}if(typeof a=='function')a={onAfter:a};if(l=='max')l=9e9;a=$.extend({},m.defaults,a);j=j||a.speed||a.duration;a.queue=a.queue&&a.axis.length>1;if(a.queue)j/=2;a.offset=n(a.offset);a.over=n(a.over);return this.scrollable().each(function(){var k=this,o=$(k),d=l,p,g={},q=o.is('html,body');switch(typeof d){case'number':case'string':if(/^([+-]=)?\d+(.\d+)?(px)?$/.test(d)){d=n(d);break}d=$(d,this);case'object':if(d.is||d.style)p=(d=$(d)).offset()}$.each(a.axis.split(''),function(b,h){var f=h=='x'?'Left':'Top',i=f.toLowerCase(),c='scroll'+f,r=k[c],s=h=='x'?'Width':'Height';if(p){g[c]=p[i]+(q?0:r-o.offset()[i]);if(a.margin){g[c]-=parseInt(d.css('margin'+f))||0;g[c]-=parseInt(d.css('border'+f+'Width'))||0}g[c]+=a.offset[i]||0;if(a.over[i])g[c]+=ds.toLowerCase()*a.over[i]}else g[c]=d[i];if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],u(s));if(!b&&a.queue){if(r!=g[c])t(a.onAfterFirst);delete g[c]}});t(a.…
type: UnansweredQuestion

http://stackoverflow.com/q/28893736
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46047720
has title: How do I load a webpage inside a div using Javascript without IFRAME?
linked to: http://stackoverflow.com/q/9963799
has answer: http://stackoverflow.com/a/28893800
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46047747
has answer: http://stackoverflow.com/a/28893878
type: Question
has answer: http://stackoverflow.com/a/28893931
has comment: http://stackoverflow.com/comment/46047733
answer count: 3
has comment: http://stackoverflow.com/comment/46052359
tagged with: javascript
tagged with: jquery
has body: I need to load an external webpage into a div. I don't want to use an iFrame. And I want this done with plain Javascript or Jquery. I'm not sure how to go about it.
has comment: http://stackoverflow.com/comment/46047883

http://stackoverflow.com/q/28840204
tagged with: java
tagged with: playframework
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28840832
has body: I recently start working with play framework. I'm trying to use jQuery with my templates in play, and I don't know how to pass value from jQuery to play. Here is my controller: public static Result createProduct() { String usernameSes = session("username"); String name = newProduct.bindFromRequest().get().name; String desc = newProduct.bindFromRequest().get().desc; Double price = newProduct.bindFromRequest().get().price; **String category = newProduct.bindFromRequest().get.category;** Product.create(name, desc, price); return ok(showProduct.render(usernameSes, name, desc, price)); And here is my jQuery: Kategorija Vozila Nekretnine Mobilni uređaji Kompjuteri Tehnika Nakit i satovi Moj dom Biznis i industrija Životinje Odjeća i obuća Ostale kategorije Thank you in advance for your answers!
has title: How to pass value from jQuery menu to Play framework
upvote count: 2
type: UnansweredQuestion
downvote count: 1
type: Question
score: 1

http://stackoverflow.com/a/28889890
type: Answer
has body: Javascript has no Dot-Matches-All-Option - therefore just use: dot OR whitespace. (first \s* to make sure your match does not start with a linebreak - not mandatory ofc.) ^###\s*((?:.|\s)*)###$ Debuggex Demo
answers question: http://stackoverflow.com/q/28889767
score: 0

http://stackoverflow.com/q/28797170
type: AnsweredQuestion
has title: Set background-color of first word in textbox?
tagged with: javascript
has answer: http://stackoverflow.com/a/28797503
type: Question
has body: I have an text box input in my HTML. I know how to set the background color of the whole thing with CSS (background-color) but is it possible to only set the background-color of the first word? I want it so that if someone types in, for example, "hello there", the background color of the word 'hello' will turn orange, but if they type in "how are you", the word 'how' will turn blue. I have gotten it to style the whole textbox in this JSFiddle here with jQuery and CSS, but is it possible to make it only set the background color of the first word?
has comment: http://stackoverflow.com/comment/45868750
possible better answer: http://stackoverflow.com/a/28797503
downvote count: 1
tagged with: jquery
favorite count: 0
upvote count: 9
has answer: http://stackoverflow.com/a/28798137
answer count: 3
has comment: http://stackoverflow.com/comment/45868890
has comment: http://stackoverflow.com/comment/45868813
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45868763
tagged with: css
has comment: http://stackoverflow.com/comment/45868830
has comment: http://stackoverflow.com/comment/45869116
score: 8
has comment: http://stackoverflow.com/comment/45868802
has comment: http://stackoverflow.com/comment/45870219
has comment: http://stackoverflow.com/comment/45868806
has comment: http://stackoverflow.com/comment/45868871
has comment: http://stackoverflow.com/comment/45869357
has answer: http://stackoverflow.com/a/28797925
has comment: http://stackoverflow.com/comment/45868919
accepted answer: http://stackoverflow.com/a/28797925

http://stackoverflow.com/a/28819730
type: Answer
has comment: http://stackoverflow.com/comment/45944974
has comment: http://stackoverflow.com/comment/45948589
has body: Sure. Assuming all of your objects only have one key: var myArr = [ { "car" : "red" }, { "tree": "green" } ]; // First, find out the name of the key you're going to replace var newObj = { "car": "blue" }; var newObjKey = Object.keys(newObj)[0]; // =&gt; "car" // Next, get the index of the array item that has the key var index = _.findIndex(myArr, function(obj) { return newObjKey in obj; }); // =&gt; 0 // Finally, replace the value myArr[index][newObjKey] = newObj[newObjKey]; FYI findIndex is an Underscore.js 1.8 feature. If you're using an older version of Underscore, you'll need to replace that line with something like this: var index; _.find(myObj, function(obj, idx) { if("car" in obj) { index = idx; return true; } });
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28819510
has comment: http://stackoverflow.com/comment/45911580
answers question: http://stackoverflow.com/q/28819510
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45911326

http://stackoverflow.com/a/28859937
score: 2
accepted answer of: http://stackoverflow.com/q/28859856
answers question: http://stackoverflow.com/q/28859856
upvote count: 2
has body: Use the value of location.hash to identify the correct a element, then click it: //Wait for the document to be ready $(function() { //Check if we have a hash, if so try to click an element that links to it if (location.hash.length &gt; 0) { $('a[href="' + location.hash + '"]').click(); } });
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/45839601
score: 0
comment on: http://stackoverflow.com/a/28781373
type: Comment
has text: please kindly refer following url it may be help to you!!! http://tech.zumba.com/2014/08/02/angularjs-forget-jquery/
type: AnswerComment

http://stackoverflow.com/a/28772535
has comment: http://stackoverflow.com/comment/45824641
has comment: http://stackoverflow.com/comment/45824785
downvote count: 0
has body: You can access row and its properties on row selection or ng-click of that row using externalscopes ng-click="getExternalScopes().onRowClick(row)" onRowClick: function (row) { row.entity.Property1; /// and so on for all row properties }
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28770778
score: 1

http://stackoverflow.com/comment/45906653
type: Comment
has text: But, you forget it is the difference between being INSIDE a tag, and OUTSIDE a tag. If it's OUTSIDE a tag then it will just be displayed as text. If it's INSIDE a tag then it throws an error. But, an easy way to end the argument is to have the OP just post the ENTIRE code snippet.
type: AnswerComment
comment on: http://stackoverflow.com/a/28817448
score: 0

http://stackoverflow.com/q/28767105
has answer: http://stackoverflow.com/a/28785382
tagged with: bpg
upvote count: 2
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: llvm
has title: BPG Emscripten compile error
has body: I am trying to compile the BPG decoder in order to get a Javascript equivalent (yes, I know one is already provided by the author); this is done via Emscripten. Unfortunately, I get the following error: emcc -Os -Wall -MMD -fno-asynchronous-unwind-tables -fdata-sections -ffunction-sections -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_REENTRANT -I. -DCONFIG_BPG_VERSION=\"0.9.5\" -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DHAVE_AV_CONFIG_H -std=c99 -D_GNU_SOURCE=1 -DUSE_VAR_BIT_DEPTH -c -o libavutil/buffer.js.o libavutil/buffer.c In file included from libavutil/buffer.c:22: In file included from libavutil/atomic.h:29: libavutil/atomic_gcc.h:54:12: error: cannot compile this atomic library call yet return __atomic_add_fetch(ptr, inc, __ATOMIC_SEQ_CST); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. ERROR root: compiler frontend failed to generate LLVM bitcode, halting Makefile:202: recipe for target 'libavutil/buffer.js.o' failed make: *** [libavutil/buffer.js.o] Error 1 Any ideas on how to solve it?
score: 2
downvote count: 0
type: UnansweredQuestion
tagged with: clang
tagged with: emscripten
type: Question

http://stackoverflow.com/comment/45879019
score: 1
comment on: http://stackoverflow.com/q/28802617
type: Comment
type: QuestionComment
has text: The page provided does not contain those links

http://stackoverflow.com/comment/46075756
comment on: http://stackoverflow.com/a/28906931
score: 0
type: AnswerComment
has text: Hi thanks that works fine but is there a way for me to open the page with JUST the login form being shown and the register form being hidden?
type: Comment

http://stackoverflow.com/a/28762026
type: Answer
answers question: http://stackoverflow.com/q/28761585
score: 1
has comment: http://stackoverflow.com/comment/45803963
upvote count: 1
has body: Your custom-ang.js file should look like this: (function() { angular.module('categories', [ 'ngResource' ]) .factory('Category', function($resource) { return $resource('http://localhost:8080/test/categories/:id'); }) .controller('CatController', function($scope, Category) { $scope.categories = Category.query(); // this is the key }); })(); And modify your html: &lt;div ng-repeat="category in categories"&gt;
has comment: http://stackoverflow.com/comment/45805740
downvote count: 0
has comment: http://stackoverflow.com/comment/45803641

http://stackoverflow.com/q/28896540
possible better answer: http://stackoverflow.com/a/74518510
has title: Populating Textboxes/DDls in Kendo Window on Click of Edit Of kendo Grid
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/74518510
type: Question
score: 0
answer count: 2
has body: Im using Kendo Grid And Kendo Window.. On click of Edit in Kendo Grid, Need to populate a kendo window which consists of Textboxes.. Im not using the editable"popup" because there is a grid in Kendo Window. Anyways.. Here Is my Window if (!window.data("kendoWindow")) { window.kendoWindow({ visible: true , resizable: false //, content:' /api/Info/' , modal: true , actions: ["Close"], close: function (e) { } }); } window.data("kendoWindow").title(header); window.data("kendoWindow").center(); window.data("kendoWindow").open(); } Im currently getting Data from the selected Row of Kendo Grid. What I need to do is just populate the Kendo Window with the data.. I tried using the - content:"api/foo" But its not working.. I think I need to explicitly set the textBox values..How Do I do that?! Please Help ! Thanks!
tagged with: javascript
tagged with: kendo-ui
has answer: http://stackoverflow.com/a/28898903
accepted answer: http://stackoverflow.com/a/28898903

http://stackoverflow.com/a/28759070
has body: Use a within to build two columns Some tds before Foo V1 Foo v2 {{ foo.v1 }} {{ foo.v2 }} Some tds after
type: Answer
answers question: http://stackoverflow.com/q/28758174
score: 0

http://stackoverflow.com/comment/46007890
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28814981
has text: Your fiddle has several issues and doesn't show best practices. No validation, etc.

http://stackoverflow.com/comment/45902803
score: 0
type: Comment
type: QuestionComment
has text: @Arikael Is "Ads" in your object equal to an array? Can you take the length of "Ads" with Ads.length?
comment on: http://stackoverflow.com/q/28814817

http://stackoverflow.com/a/28772404
has body: I'm going to go with Nicholas Smith's solution above. From the docs Here, 'translations' is an array of objects with 'translatedText', each of which is the translation of a query in the order the user provided.
type: Answer
score: 0
accepted answer of: http://stackoverflow.com/q/28769941
answers question: http://stackoverflow.com/q/28769941
type: AcceptedAnswer

http://stackoverflow.com/comment/46035687
type: AnswerComment
type: Comment
has text: use `a` in the selector to improve performance. `$('a[data-card-uid="THIS ONE"]')` Otherwise the JS engine needs to look at every element on the page.
comment on: http://stackoverflow.com/a/28887066
score: 1

http://stackoverflow.com/comment/45831398
comment on: http://stackoverflow.com/q/28776614
type: QuestionComment
has text: My apologies, here is the error in the console Uncaught TypeError: undefined is not a function
score: 0
type: Comment

http://stackoverflow.com/comment/46150619
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28883494
has text: It's still hard to tell. It sounds like maybe you think calling sourcenode.start() inside a loop, with the same arguments each time, should result in the sound being played several times in succession, rather than all at once. But since you don't show any calls to sourcenode.start(), I can't be sure. Instead you show calls to functions like playLead, first with two arguments, then six, then four, and I can't tell what they're all supposed to mean.
score: 0

http://stackoverflow.com/q/28860835
has comment: http://stackoverflow.com/comment/45987142
has answer: http://stackoverflow.com/a/28861593
has comment: http://stackoverflow.com/comment/45987341
type: Question
tagged with: vb.net
answer count: 1
score: 0
tagged with: asp-classic
has comment: http://stackoverflow.com/comment/45987197
tagged with: google-analytics
tagged with: .net
tagged with: javascript
type: UnansweredQuestion
has title: Google Analytics, jQuery Magnific Popups, .NET master page implementation
has body: I will start with admitting that although I have been researching, reading, and trouble-shooting my issue I think I am missing something fundamental with my site. I apologize for my ignorance in advance but this is the only way to learn--by admitting you don't know what to do. I'm running a VB.NET site which has a master page and content pages. I am still very much in development of the entire site trying to add features. What I'd like to do: I would like to add google analytics and jquery magnific popup. I've followed all the instructions from google and from magnific pop-up and I'm still having issues. What I've done to try and make this work so far: My head on masterpage: My footer on masterpage: Added class to image: My issues: Google script fails to find script. It's definitely there, it was copy/pasted directly from google's site into a file I am calling. jquery and magnific pop-up only load on my root pages. "/products/product1.aspx" pages for example refuse to load scripts. Although they load on root pages, the script does not appear to work for the image pop up. I've followed magnific-popup's instructions word for word for "initializing in html" Instructions for magnific-popup: http://dimsemenov.com/plugins/magnific-popup/documentation.html#mfp-build-tool Lastly, before I tried adding the image pop-up google analytics appeared to be working as I was getting reporting on the web analytics page. Any help would be appreciated.

http://stackoverflow.com/q/28899176
type: AnsweredQuestion
has title: How to set custom icon for Leaflet Realtime plugin with Leaflet?
tagged with: leaflet
tagged with: markers
tagged with: geojson
type: Question
has answer: http://stackoverflow.com/a/28900293
has body: I'm new to Leaflet JS. I'm trying to figure out a way to change the default style for a L.Geojson marker used in Leaflet Realtime plugin. I don't know what property to change so that I can change the style of the markers. Here is my code so far: var map = L.map('map', {center: [46.4337, 23.4532], zoom: 8}), realtime = L.realtime({ url: 'get_points.php', crossOrigin: true, type: 'json' }, { interval: 500 }).addTo(map); var osm = new L.TileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'); map.addLayer(osm); function update(e) { realtime.update(JSON.parse(e.data)); } function remove(e) { realtime.remove(JSON.parse(e.data)); } realtime.on('update', function(e) { popupContent = function(fId) { var feature = e.features[fId], my_number = feature.properties.number; mystatus = feature.properties.mystatus; return ('My number is: '+ my_number + '&lt;br /&gt;' + 'Status: ' + mystatus) ; }, bindFeaturePopup = function(fId) { realtime.getLayer(fId).bindPopup(popupContent(fId)); }, updateFeaturePopup = function(fId) { realtime.getLayer(fId).getPopup().setContent(popupContent(fId)); }; Object.keys(e.enter).forEach(bindFeaturePopup); Object.keys(e.update).forEach(updateFeaturePopup); }); I've tried setting a pointToLayer function with a custom icon marker but that didn't work. Thanks.
upvote count: 5
downvote count: 0
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/28899678
accepted answer: http://stackoverflow.com/a/28900293
favorite count: 0
possible better answer: http://stackoverflow.com/a/28899678
score: 5

http://stackoverflow.com/a/35022914
has body: You have many options. This is a good link to understand pros and cons https://stormpath.com/blog/where-to-store-your-jwts-cookies-vs-html5-web-storage/ Store it in local browser storage. As described in the previous link it has some risks. Store it in a cookie in client side, it can be safer than local browser storage. Don't store the token but store username and password in the browser or client-side cookie, and then retrieve a new token by sending credentials silently. Use a client side javascript library like https://github.com/IdentityModel/oidc-token-manager to rely on its token management features. By default it stores the retrieved token in localStorage (available throughout all the tabs) and it can be configured with silent_renew:true so that it automatically refreshes the token prior to its expiration using an iframe (without explicit browser redirection).
downvote count: 0
score: 4
has comment: http://stackoverflow.com/comment/137326815
answers question: http://stackoverflow.com/q/28856199
type: Answer
upvote count: 4

http://stackoverflow.com/q/28828834
tagged with: javascript
tagged with: jquery
score: 0
possible better answer: http://stackoverflow.com/a/28828945
answer count: 2
has answer: http://stackoverflow.com/a/28829082
has body: I use something similar to this for my menu - the red line in reality has an image background and should underline the whole content or go to the full width. It works fine on large screen, but on small (here simulated by setting width), the red line ends before the actual content. Any way to make it expand to the full width? (I can use javascript (even jquery), but I'd prefer not to) .outer { font-size: 16pt; } .menu { width: 100%; overflow-x: auto; white-space: nowrap; position:relative; } .menu:after { content:''; background-color:red; position: absolute; bottom: 0; left: 0; width: 100%; height: 2px; } &lt;div class="outer"&gt; &lt;div class="menu"&gt; This is on desktop and everything is fine. &lt;/div&gt; &lt;/div&gt; &lt;div class="outer" style="width: 200px"&gt; &lt;div class="menu"&gt; This is on phone, the content overflows as you can see. &lt;/div&gt; &lt;/div&gt;
has title: Make :after element expand to full width if parent overflows
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28829082
type: Question
has answer: http://stackoverflow.com/a/28828945

http://stackoverflow.com/comment/46049353
type: AnswerComment
has text: Yes I am doing DOM manipulation. I think I will try to use PhantomJS after all. Can you please provide an example of how I can get a javascript variable in C#?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28879265

http://stackoverflow.com/a/28881261
has body: If I got your needs correctly (you want to add/remove connection between input value and displayed value by clicking the btns) you can implement it like this: &lt;div ng-controller="MyCont" ng-app&gt; &lt;form&gt; &lt;input type="number" min="0" max="50" value="{{value}}" data-ng-model="value"/&gt; {{displayValue}} &lt;br /&gt; &lt;br /&gt; &lt;input type="submit" value="bind the data" data-ng-click="bindVal()" /&gt; &lt;input type="reset" value="reset back to 15" data-ng-click="resetVal()" /&gt; &lt;/form&gt; function MyCont($scope) { var isValueReallyBinded = true, initialValue = 15; $scope.value = initialValue; $scope.$watch('value', function (newVal, oldVal) { if(isValueReallyBinded) { $scope.displayValue = $scope.value; } else { $scope.displayValue = initialValue; } }); $scope.bindVal = function () { isValueReallyBinded = true; $scope.displayValue = $scope.value; }; $scope.resetVal = function () { isValueReallyBinded = false; $scope.displayValue = initialValue; }; };
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28872090

http://stackoverflow.com/comment/46159483
type: AnswerComment
has text: This answer was on the right path, but I had to end up modifying it a bit with another answer I found. You helped me get there though, so thank you!
type: Comment
comment on: http://stackoverflow.com/a/28859090
score: 0

http://stackoverflow.com/comment/46012214
comment on: http://stackoverflow.com/q/28874798
type: QuestionComment
type: Comment
has text: If your code is as it is written here there's the multi-line string problem: http://stackoverflow.com/questions/805107/creating-multiline-strings-in-javascript which could result in a syntax error. Or is that just SO formatting? Other than this it looks okay
score: 0

http://stackoverflow.com/q/28858416
tagged with: oop
answer count: 0
has comment: http://stackoverflow.com/comment/45984600
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45982807
score: 0
has body: Well the title already says it. I am working on a timer, but when I let it run for around 10 secs, press space (space = keycode 13), then it stops and then if I press space again to start, it resumes but then +2 secondes. (started at e.g. 18 sec and resumes from 20 sec) which comes from the clearInterval ID it return I think... not sure. If you guys could help me out, that'd be great. If you have any suggesstions to do things differently, let me know too! I'm open for all the feedback I get and improvement / tips on my code! :) Javascript var Timer = function() { var self = this, div = document.querySelector('.timer'), hours, minutes, seconds, millsecs; this.oldDate = new Date().getTime(); this.newDate; this.isRunning = false; this.time; this.timerId = 0; this.start = function() { self.isRunning = true; if (self.isRunning) { self.timerId = setInterval(function() { self.time = new Date().getTime() - self.oldDate; self.time = self.time.toString(); millsecs= self.time.substr(-3); seconds = (Math.floor(self.time / 1000) % 60) + '.'; minutes = (self.time &gt;= 60000) ? (Math.floor(self.time / (1000*60)) % 60) + ':' : ''; hours = (self.time &gt;= 86400) ? (Math.floor(self.time / (1000*60*60)) % 24) + ':' : ''; div.innerHTML = hours + minutes + seconds + millsecs; }, 10); } } this.stop = function() { self.isRunning = false; clearInterval(obj.timerId); self.timerId = 0; } }; var obj = new Timer(); window.addEventListener('keyup', function(e) { if(e.keyCode == 32 &amp;&amp; obj.isRunning == false) { obj.start(); } else if (e.keyCode == 32 &amp;&amp; obj.isRunning == true) { obj.stop(); } });
tagged with: timer
type: UnansweredQuestion
has title: JS Timer, clearInterval() doesn't clear the timer. When restart, it resumes instead of restarting at zero

http://stackoverflow.com/comment/45950026
type: QuestionComment
comment on: http://stackoverflow.com/q/28840207
score: 0
type: Comment
has text: Essentially what's happening is the argument to the function (`l_amt`) is being multiplied by 100 (that's the effect of the `e+2`). Then that string is passed to `Math.round()` which will convert its argument to a number and either round it to the next highest or lowest integer. Then THAT result is *divided* by 100 (`e-2`). The `+` in front of the whole thing coerces the final result to a number.

http://stackoverflow.com/a/28917803
upvote count: 1
has body: As answered on the user group: Use the functions of the Cap Mixin, which is a base of the pie chart: var pie = dc.pieChart("#pie-chart"); [...] pie.cap(5);
has comment: http://stackoverflow.com/comment/46093314
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28882883
type: Answer
accepted answer of: http://stackoverflow.com/q/28882883
score: 1

http://stackoverflow.com/a/28794359
has comment: http://stackoverflow.com/comment/45863893
has comment: http://stackoverflow.com/comment/45863601
has comment: http://stackoverflow.com/comment/45863829
score: 0
has comment: http://stackoverflow.com/comment/45863565
has body: That's because all your field you have defined is of static type. Now when you call reset on panel1, you call: void reset() { dobDay.setSelectedIndex(0); dobMonth.setSelectedIndex(0); dobYear.setSelectedIndex(0); } You reset day, month, year. Then you set it back and then for second panel you call reset which means you have just one instance of dobDay, dobMonth, dobYear and all your panel play around with just one that instance.
has comment: http://stackoverflow.com/comment/45863930
has comment: http://stackoverflow.com/comment/45863544
type: Answer
answers question: http://stackoverflow.com/q/28794298

http://stackoverflow.com/q/28802343
favorite count: 0
has comment: http://stackoverflow.com/comment/45878366
has comment: http://stackoverflow.com/comment/45878712
has body: Having a lot of trouble with this for some reason even with examples, what am I doing wrong here? HTML Add JavaScript function appendList() { var ul = document.getElementById('listitems'); var li = document.createElement('li'); var item = document.getElementById('item'); li.appendChild(document.createTextNode(item.value)); ul.appendChild(li); } Here is a JSFiddle. I must be tired or something, I'm following the tutorials as closely as possible.
downvote count: 1
has comment: http://stackoverflow.com/comment/45878466
has title: appending an li to ul with user input
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45878506
score: -1
has comment: http://stackoverflow.com/comment/45878347
has answer: http://stackoverflow.com/a/28803022
type: Question
upvote count: 0
has comment: http://stackoverflow.com/comment/45878624
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28803022
has comment: http://stackoverflow.com/comment/45878597
has comment: http://stackoverflow.com/comment/45878390
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/q/28844752
upvote count: 0
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28844823
tagged with: jquery
favorite count: 0
tagged with: android
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: How do I fix my nav menu?
type: UnansweredQuestion
has body: I am working on a site and after I loaded light box on the gallery page, Nivo slider on the home page and html 5 Lightbox for video on the about me page the nav menu doesn't show up on Android stock browser or chrome from android. It works fine on iPhones that I have tested. Here is the link - http://www.madisonderousse.com/MED/MED/index.html. It works fine on all browsers on a PC.
downvote count: 1
score: -1
type: Question

http://stackoverflow.com/a/28902870
type: Answer
answers question: http://stackoverflow.com/q/28902465
has body: If you just want your container element to sit at the top of your page then use: #view2 { position:fixed; top:0; left:0; width:100%; box-sizing:border-box; padding:10px; } Just an example - obviously if you didn't need padding etc just remove them, the above is just a typical use for a fixed header.
score: 0

http://stackoverflow.com/q/28851210
has comment: http://stackoverflow.com/comment/45969568
tagged with: css
has title: update div with jquery
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45969633
has answer: http://stackoverflow.com/a/28851263
has body: I have the following script. With that I am trying to update the div "right" in the jsp page. It's contained in a single file. It does not seem to update. Thanks for your help. Updated Moved to file score.jsp
tagged with: http://stackoverflow.com/tag/html
type: Question

http://stackoverflow.com/q/28816087
linked to: http://stackoverflow.com/q/7077770
has body: In the following code when the if condition is true then it should go to google.com but is isn't. I wanted the window to go to google.com as the ok in the alert box is pressed why this isn't working? What is the best way to do it? if(("admin"===userid)&amp;&amp;("admin"===psw)) { window.alert("Logged in Successfully!!!"); window.location.href="https://www.google.co.in"; x=x+1; }
type: UnansweredQuestion
score: -3
upvote count: 0
linked to: http://stackoverflow.com/q/8395536
has title: How to redirect the page when some condition reached in JavaScript?
has comment: http://stackoverflow.com/comment/45904030
has comment: http://stackoverflow.com/comment/45904130
type: Question
has comment: http://stackoverflow.com/comment/45903960
tagged with: javascript
downvote count: 3
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/28816543

http://stackoverflow.com/a/28753596
has body: This is actually related to accepted characters on URL. You should check this answer here: Characters allowed in a URL So your link will work if you change this " to this ': window.location = "mailto:someone@example.com?subject=subject&amp;body=http://example.com?parameter={'test':'test'}"; Check out this Fiddle to replace quotation marks
has comment: http://stackoverflow.com/comment/45789060
has comment: http://stackoverflow.com/comment/45790608
downvote count: 0
has comment: http://stackoverflow.com/comment/45789163
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/28753346
has comment: http://stackoverflow.com/comment/45789237
score: 2
has comment: http://stackoverflow.com/comment/45790973
has comment: http://stackoverflow.com/comment/45789280

http://stackoverflow.com/comment/45972675
has text: No, not really. This is a fairly basic concept. You have a process executing on the server-side, which your template knows nothing about, unless it communicates with the server-side through Ajax.
type: Comment
comment on: http://stackoverflow.com/a/28839535
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45899818
comment on: http://stackoverflow.com/q/28811565
score: 0
type: Comment
type: QuestionComment
has text: @katmanco Added a link to the projects github repo.

openlayers-3
type: Tag
tags question: http://stackoverflow.com/q/28893129
tag name: openlayers-3
tags question: http://stackoverflow.com/q/28889720

http://stackoverflow.com/comment/45839108
has text: Read my answer [here](http://stackoverflow.com/a/14087726/645956) - different language, but same idea.
score: 0
comment on: http://stackoverflow.com/q/28781114
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28780813
has answer: http://stackoverflow.com/a/28820717
accepted answer: http://stackoverflow.com/a/28820717
has body: Is there an example floating around of collision detection that avoids collision by manipulating radius rather than x,y coordinates? I'm aware of the examples Mike Bostock and others have put together, but I'm not using a force graph and my points are geographic and can't have their coordinates manipulated. My best-guess implementation would be to begin with circles of radius 0, iterate over them and increase their individual radii as long as they don't collide with another circle. I think this would make a fantastic visualization, but I'm not sure how to efficiently determine whether one circle collides with another. JSBin of my map with inline D3js (JavaScript tab is simply holding a 600kb GeoJSON dataset): http://jsbin.com/tapuhefamu/1/edit?html,output Notice how the markers overlap when zoomed, it doesn't seem like a big deal in the fiddle (just zoom in further, right?) but the map I'm working with has ~2,000 pins clustered in only a few counties which need to display an informative DIV when clicked. Some pins are almost completely obscured and aren't able to be interacted with because of the overlap.
upvote count: 1
has comment: http://stackoverflow.com/comment/45840260
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
downvote count: 0
tagged with: d3.js
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/45855236
has comment: http://stackoverflow.com/comment/45838912
type: Question
has comment: http://stackoverflow.com/comment/45854887
has title: D3js map marker collision detection
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45872505

http://stackoverflow.com/a/28864507
has comment: http://stackoverflow.com/comment/49280725
has comment: http://stackoverflow.com/comment/48555170
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46275679
upvote count: 2
has comment: http://stackoverflow.com/comment/49625664
has comment: http://stackoverflow.com/comment/46275098
has comment: http://stackoverflow.com/comment/45995063
type: Answer
has comment: http://stackoverflow.com/comment/48584648
accepted answer of: http://stackoverflow.com/q/28862093
has comment: http://stackoverflow.com/comment/45995091
score: 2
has comment: http://stackoverflow.com/comment/46315084
has comment: http://stackoverflow.com/comment/49574131
has comment: http://stackoverflow.com/comment/48555313
answers question: http://stackoverflow.com/q/28862093
downvote count: 0
has comment: http://stackoverflow.com/comment/45998953
has comment: http://stackoverflow.com/comment/46023222
has comment: http://stackoverflow.com/comment/48900610
has body: You are experiencing compatibility issues between selenium 2.43 and firefox 36. The easiest option right now would be to upgrade selenium to 2.45: pip install --upgrade selenium
has comment: http://stackoverflow.com/comment/49280234

http://stackoverflow.com/a/28805139
has body: This will work Link In your case About Us Rooms Reservation Gallery Contact Us
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28805069
upvote count: 1
score: 1

http://stackoverflow.com/q/28824570
has answer: http://stackoverflow.com/a/28826261
type: Question
has title: Scrolling marquee Uncaught TypeError: Cannot read property 'style' of undefined
has comment: http://stackoverflow.com/comment/45920228
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28824684
tagged with: typeerror
answer count: 3
has body: So Im keep coming up with typeError: Cannot read property 'style' undefined. It situated on the last line of javascript. Anyone any suggestions. The finished piece is to be a marquee with vertically scrolling text. window.onload = defineMarquee; var timeID; var marqueeTxt = new Array(); var marqueeOff = true; /* defineMarquee() Initializes the contents of the marquee, determines the top style positions of each marquee item, and sets the onclick event handlers for the document */ function defineMarquee() { var topValue var allElems = document.getElementsByTagName("*"); for (var i = 0; i &lt; allElems.length; i++) { if (allElems[i].className == "marqueeTxt") marqueeTxt.push(allElems[i]); } //Extract the "top" CSS class from marqueeTxt for (var i = 0; i &lt; marqueeTxt.length; i++) { if (marqueeTxt[i].getComputedStyle) { topValue = marqueeTxt[i].getPropertyValue("top") } else if (marqueeTxt[i].currentStyle) { topValue = marqueeTxt[i].currentStyle("top"); } marqueeTxt[i].style.top = topValue; } document.getElementById("startMarquee").onclick = startMarquee; document.getElementById("stopMarquee").onclick = stopMarquee; } /* startMarquee() Starts the marquee in motion */ function startMarquee() { if (marqueeOff == true) { timeID = setInterval("moveText()", 50); marqueeOff = false; } } /* stopMarquee() Stops the Marquee */ function stopMarquee() { clearInterval(timeID); marqueeOff = true; } /* moveText () move the text within the marquee in a vertical direction */ function moveText() { for (var i = 0; i &lt; marqueeTxt.length; i++) { topPos = parseInt(marqueeTxt[i].style.top); } if (topPos &lt; -110) { topPos = 700; } else { topPos -= 1; } marqueeTxt[i].style.top = topPos + "px"; } * { margin: 0px; padding: 0px } body { font-size: 15px; font-family: Arial, Helvetica, sans-serif } #pageContent { position: absolute; top: 0px; left: 30px; width: 800px } #links { display: block; width: 100%; margin-bottom: 20px; border-bottom: 1px solid rgb(0, 153, 102); float: left } #links {…
accepted answer: http://stackoverflow.com/a/28824684
has comment: http://stackoverflow.com/comment/45920218
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28824984
has answer: http://stackoverflow.com/a/28824984

http://stackoverflow.com/a/31459638
has body: Here's what worked for me given the following directory structure (I simplified a bit to focus on just getting the files in the right place) assets/article1/1.jpg assets/article2/2.jpg with a desired outcome of assets/article1/1.jpg assets/article1/thumbs/1.jpg assets/article2/2.jpg assets/article2/thumbs/2.jpg Here's what worked for me (modified from this recipe https://github.com/gulpjs/gulp/blob/master/docs/recipes/running-task-steps-per-folder.md) var gulp = require('gulp'), rename = require('gulp-rename'), path = require('path'), fs = require('fs'); var scriptsPath = 'assets'; // folder to process function getFolders(dir) { return fs.readdirSync(dir) .filter(function(file) { return fs.statSync(path.join(dir, file)).isDirectory(); }); } gulp.task('thumbs', function() { var folders = getFolders(scriptsPath); return folders.map(function(folder) { return gulp.src(path.join(scriptsPath, folder, '/**/*.jpg')) .pipe(rename({dirname: folder + '/thumbs/'})) .pipe(gulp.dest(scriptsPath)); }); });
score: 2
upvote count: 2
downvote count: 0
answers question: http://stackoverflow.com/q/28838091
has comment: http://stackoverflow.com/comment/58496857
type: Answer

http://stackoverflow.com/comment/45831542
has text: Ok, I'm having trouble wrapping my head around what you are saying. Is (0,0) at the center of the page or a corner?
score: 0
comment on: http://stackoverflow.com/a/28772421
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28831665
has comment: http://stackoverflow.com/comment/45933182
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/123337175
upvote count: 13
score: 13
answers question: http://stackoverflow.com/q/28831391
has body: If I understand you correct this should do the trick, I'm pretty sure this is always the object JSON.stringify is currently iterating over: var json = JSON.stringify(obj, function(key, value) { if (key === "d") { snippet.log(getType(this[key])); } return value; });
accepted answer of: http://stackoverflow.com/q/28831391

http://stackoverflow.com/q/28846563
accepted answer: http://stackoverflow.com/a/28846634
possible better answer: http://stackoverflow.com/a/28846625
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: for-loop
has answer: http://stackoverflow.com/a/28846634
tagged with: javascript
has title: Javascript looped nested variable
answer count: 2
has answer: http://stackoverflow.com/a/28846625
downvote count: 0
tagged with: nested
tagged with: variables
has body: Bit confused how this piece of code actually works, mainly because I have never seen a variable being used like this in my first language (Python) function arrayToList(array) { var list = null; for (var i = array.length - 1; i &gt;= 0; i--) list = {value: array[i], rest: list}; return list; } console.log(arrayToList([10, 20])); // → {value: 10, rest: {value: 20, rest: null}} I am specifically confused about how list is being used with the for-loop. I understand that the first pass through, the list would look like this list = {value: array[i], rest: null};, but how is another list being nested within the first one on the second pass of the for-loop?
favorite count: 0

http://stackoverflow.com/comment/46052531
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28896262
score: 0
has text: Thanks. How is the DDL populated?

http://stackoverflow.com/comment/46065688
score: 0
comment on: http://stackoverflow.com/a/28903133
type: AnswerComment
has text: Thank you, i was looking for something like this. However, i also found that domNodeInserted is deprecated and will not be supported much longer.
type: Comment

http://stackoverflow.com/comment/45826405
comment on: http://stackoverflow.com/a/28773526
type: AnswerComment
has text: Simplified the example with an alert statement now and working URLs. The issue is that I don't see the alert popup in the snapshot.
type: Comment
score: 1

http://stackoverflow.com/q/28788223
score: -3
type: AnsweredQuestion
upvote count: 0
has body: I program a plugin where I use javascript, for example this line : $( "input:radio[name=base]:checked" ).val(); When I put the shortcode on page and click the button to display an alert with the value obtained is not working but if I add the javascript script (cdn) if it works but the menu page generated Worpress stops working, I supposed that my plugin work with javascript that comes in the template. What is the problem?
accepted answer: http://stackoverflow.com/a/28790140
has comment: http://stackoverflow.com/comment/45852289
tagged with: wordpress
has comment: http://stackoverflow.com/comment/45852242
type: Question
has answer: http://stackoverflow.com/a/28790140
tagged with: javascript
answer count: 2
has title: wordpress and javascript plugin compatibility
downvote count: 3
has answer: http://stackoverflow.com/a/28788303
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/28788303

http://stackoverflow.com/comment/45885725
has text: Thnx that you have to approch my question i.e what I exactly want :-) pls help!
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28804966

http://stackoverflow.com/comment/45946156
comment on: http://stackoverflow.com/q/28838263
type: Comment
type: QuestionComment
has text: i added code that i currently have in handleSuccess()
score: 0

http://stackoverflow.com/comment/46035113
comment on: http://stackoverflow.com/q/28886835
type: Comment
type: QuestionComment
score: 0
has text: Do you see any errors in developer tools' console?

http://stackoverflow.com/a/28883452
score: 2
has comment: http://stackoverflow.com/comment/46028053
downvote count: 0
answers question: http://stackoverflow.com/q/28883338
has comment: http://stackoverflow.com/comment/46028484
upvote count: 2
type: Answer
has body: The response of your ajax call is not an object, it is evaluated as null. Add a condition to the beginning of your function to test this value function handleLupGoBrowseResponse(response){ if(response) { // execute your code } else { console.log(response); } }

http://stackoverflow.com/q/28790685
type: Question
linked to: http://stackoverflow.com/q/2450954
has comment: http://stackoverflow.com/comment/45857148
has title: Randomize player list with ng-repeat
tagged with: javascript
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45856762
has comment: http://stackoverflow.com/comment/45857187
answer count: 0
type: UnansweredQuestion
score: 0
has body: I have an Angular app that displays a list of players in different sets. Within each set I would like to display the list randomly each time. I am using an ng-repeat, how can I randomize them? Controller: $scope.players = ["p1", "p2"]; Page: &lt;dig ng-repeat="player in players"&gt;{{player}}&lt;\div&gt;
linked to: http://stackoverflow.com/q/20789373

http://stackoverflow.com/a/28895997
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28826830
answers question: http://stackoverflow.com/q/28826830
has body: The code behind method needs to be static Simple solution: [System.Web.Services.WebMethod] public static string ExtractToPDF(string FSID) { return FSID; }
type: AcceptedAnswer

factory
tags question: http://stackoverflow.com/q/28873931
tag name: factory
tags question: http://stackoverflow.com/q/28865266
type: Tag

http://stackoverflow.com/comment/45975486
has text: Ok. With this I am starting to understand this `Parse.Promise` thing. The problem is that I am still not able to get the `product` itself. Maybe this is not a Parse problem, I am not sure. I mean, instead of `console.log(...)` the `product`, I want to return it and use it; say, I want to use its attributes to show them in a page. I still can't do that.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28854002
type: Comment

http://stackoverflow.com/a/28880280
accepted answer of: http://stackoverflow.com/q/28875651
answers question: http://stackoverflow.com/q/28875651
has comment: http://stackoverflow.com/comment/46023530
score: 1
has comment: http://stackoverflow.com/comment/46051979
has comment: http://stackoverflow.com/comment/46050530
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46086689
downvote count: 0
has body: It seems that your HTTP's server configuration regarding caching is not properly configured to work with GWT. According to the documentation: *.nocache.* should not be cached .cache. can be safely cached There's an example configuration for Apache HTTP server in the documentation too. The *.nocache.js file is a bootstrap script: This file is responsible for choosing the correct version of your application to load for your client based on their browser and locale (...). The various versions of your application compliant to each browser / locale are the &lt;md5&gt;.cache.html application files. In short: the bootstrap file changes every compile and is a "gateway" to your application. It selects which &lt;md5&gt;.cache.* application version to load. Its name has to be constant because you are referencing it from your host page. Since &lt;md5&gt;.cache.* files' names change with every source code change (because its name is its content's MD5 hash), they can be safely cached. So what is happening is that an old bootstrap script is cached (and loaded instead of the new one) and it's trying to load an old version of your application (one of the *.cache.* files). However, those files have been probably removed by the compilation/redeploy, hence the 404.
type: Answer
has comment: http://stackoverflow.com/comment/46053222
upvote count: 1

http://stackoverflow.com/q/28893154
upvote count: 3
has answer: http://stackoverflow.com/a/28893261
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46046681
tagged with: ajax
has comment: http://stackoverflow.com/comment/46046690
has body: jQuery.ajax ({ url: ajaxurl, type: "POST", xhr: function() { var xhr = new window.XMLHttpRequest(); xhr.upload.addEventListener( 'progress', function( e ) { if( e.lengthComputable ) { // Append progress percentage. var loaded = e.loaded; var total = e.total; var progressValue = Math.round( ( loaded / total ) * 100 ); // Bytes received. jQuery( '.recievedValue' ).html( '' ); jQuery( '.recievedValue' ).append( formatFileSize( loaded ) + ' / ' ); // Total bytes. jQuery( '.totalValue' ).html( '' ); jQuery( '.totalValue' ).append( formatFileSize( total ) ); // Percentage. progressElement.find( 'input' ).val( progressValue ).change(); } }, false ); return xhr; }, success: function( data ) {} }); This is my ajax function. I can get loaded bytes, total bytes and percentage value. But I also need to get the remaining time and upload file speed in (kb/sec). is there any way i can get these two values. Any help would be appreciated.
accepted answer: http://stackoverflow.com/a/28893261
favorite count: 0
has title: Get remaining time and upload file speed - ajax jquery/js
type: AnsweredQuestion
score: 3

http://stackoverflow.com/q/28826619
tagged with: game-maker-studio-1.4
has body: Hi I'm looking to add javascript functions to game maker, but the format of them is like this: companyname.initialize({ soundMuteCallback: muteSound, // optional soundUnmuteCallback: unmuteSound // optional }); And in the file they look like this this.initialize = function(params) { companyname.getSharedEventCenter().postEvent(SharedEventKeys.API_INITIALIZE); _isInitialized = true; if (typeof params !== "undefined") { var muteSoundCallback = ("soundMuteCallback" in params &amp;&amp; typeof params["soundMuteCallback"] === "function") ? params["soundMuteCallback"] : undefined; var unmuteSoundCallback = ("soundUnmuteCallback" in params &amp;&amp; typeof params["soundUnmuteCallback"] === "function") ? params["soundUnmuteCallback"] : undefined; _adsManager.setSoundCallbacks(function() { typeof muteSoundCallback === "function" &amp;&amp; muteSoundCallback(); [].forEach.call(document.getElementsByTagName("audio"), function(element){ element.muted = true; }); }, function() { typeof unmuteSoundCallback === "function" &amp;&amp; unmuteSoundCallback(); [].forEach.call(document.getElementsByTagName("audio"), function(element){ element.muted = false; }); }); } _tryShowAd(); }; Does anyone have any idea how to do this in game maker? I don't know what information to put in the extension function properties. Thanks, Mitchell.
accepted answer: http://stackoverflow.com/a/30310393
type: Question
type: AnsweredQuestion
score: 0
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/30310393
has title: Game Maker JS Extension
tagged with: game-maker-language
tagged with: game-maker

http://stackoverflow.com/comment/110198762
comment on: http://stackoverflow.com/a/61212051
type: Comment
has text: I have just realised that this will return the message ```"b" is required``` rather than ```either "a" or "b" is required``` but don't know how to fix that.
score: 2
type: AnswerComment

http://stackoverflow.com/q/28750786
tagged with: arrays
tagged with: javascript
score: -1
answer count: 1
has title: Issues in my if and else if logic and clash of 2 functions
has answer: http://stackoverflow.com/a/28750877
favorite count: 0
type: UnansweredQuestion
downvote count: 1
type: Question
has body: I am newbee and this is my first if and else statement. I am trying to make the user enter a name of animal based on the sounds he or she sees on the page. New sounds are generated on refresh through an array.(this part worked fine) The issues I am facing: If I ADD my checkGuess function, then my makeSound function does not work. Is my if and else condition wrong or my logic? I want to compare what the user entered with the array and then show an alert accordingly. Would appreciate some guidance. The user has to enter the name of the animal based on the sounds like woof and moo which are inside an array. What animal says
linked to: http://stackoverflow.com/q/6340874
upvote count: 0

http://stackoverflow.com/comment/46059982
score: 0
type: Comment
type: QuestionComment
has text: I tried concatenating within variable as seen at the bottom of the code, however I disregarded this with //
comment on: http://stackoverflow.com/q/28900376

http://stackoverflow.com/q/28783584
upvote count: 1
tagged with: google-chrome
has body: Say I want to make a chrome extension that plays audio or video that you can play/pause. Extension page is being open from a popup. It should be available on any tab that you go to. As I understand chrome limits you to the background page that is being run like a separate tab, but cannot be visible and a popup page that gets displayed once you click on the icon. So I wanted to know how would you go on about it. Insofar I see it in hackish ways like: background -> event -> popup (audio context + "fake" audio buffer player) background -> localStorage -> popup (same thing) Are there alternative solutions to this?
type: AnsweredQuestion
type: Question
downvote count: 0
has answer: http://stackoverflow.com/a/28783772
answer count: 1
tagged with: javascript
favorite count: 0
has title: Chrome extension background page in popup
tagged with: google-chrome-extension
score: 1
tagged with: html5-audio
accepted answer: http://stackoverflow.com/a/28783772

http://stackoverflow.com/a/28784689
score: 0
has body: The function to load the html is called as the success function, i.e. after the animation completes. You can probably try this: $('.section').hide(); // hide the section $('.section').html(html); // populate.. $('.section').slideDown(500); // Slide Down Hope it helps.. :) Edit: Arguments for the slideDown can be checked here ...
has comment: http://stackoverflow.com/comment/45845559
type: Answer
answers question: http://stackoverflow.com/q/28784562

http://stackoverflow.com/a/28802637
answers question: http://stackoverflow.com/q/28801800
type: AcceptedAnswer
upvote count: 3
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/46228089
score: 3
has body: Protractor uses the webdriverjs API to "drive" the browser, so it won't have access to any more information than any other Selenium webdriver app would have. See the docs here: http://docs.seleniumhq.org/docs/03_webdriver.jsp#selenium-webdriver-api-commands-and-operations Outside of some APIs for controlling the browser (adding cookies, opening new tabs), most of the functionality in Protractor and WebdriverJS comes from running snippets of JavaScript in the browser (e.g., to inspect the DOM). So, I don't think any of that qualifies for intercepting communications between the browser and the server. I think you might have luck using the Protractor infrastructure for injecting code/modules into the app start (this is the best doc I can find for this feature). You should be able to inject a module that can interpose on the $http calls an log them as they go (or, of course, fully mock them out).
accepted answer of: http://stackoverflow.com/q/28801800

http://stackoverflow.com/comment/45922199
has text: Thanks for your answer. I am trying to store two variables with different formats using id="datepicker". One of the input fields are hidden and the other is not. Thanks.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28825217
type: Comment

http://stackoverflow.com/comment/45788873
type: AnswerComment
comment on: http://stackoverflow.com/a/28753205
type: Comment
has text: Nevermind, I figured out why. I need to use the hash fragment URL. /#/hello works.
score: 0

jquery-file-upload
tags question: http://stackoverflow.com/q/28799624
type: Tag
tag name: jquery-file-upload

http://stackoverflow.com/a/28912711
answers question: http://stackoverflow.com/q/28884897
score: 0
has body: Here's how I do it in my idle service. It uses some other services, but you should get the idea. Basically, I start tracking user activity in observable when he sings in and reset the timeout for idle handler everytime observable changes. //idle.js define(function (require) { var ko = require('knockout'), $ = require('jquery'), router = require('lib/router'), config = require('lib/config'), dialog = require('lib/dialog'), auth = require('auth/auth'), lastActionDate = ko.observable(), signoutHandle = null, onIdle = function () { console.log('user has been idle, signing out'); return auth.signOut() .then(function () { router.navigate(''); dialog.show('auth/idle'); }); }, init = function () { var userActionHandler = function () { lastActionDate(new Date()); }; auth.on('signin:success').then(function (user) { $(document).on('click keydown scroll', userActionHandler); userActionHandler(); }); auth.on('signout:success').then(function (using) { $(document).off('click keydown scroll', userActionHandler); }); lastActionDate.subscribe(function () { if (signoutHandle) { clearTimeout(signoutHandle); } signoutHandle = setTimeout(onIdle, config.get('idleTimeout') * 1000); }); }; return { init: init }; }); Then I just call idle.init() my main.js file before app.start()
type: Answer

http://stackoverflow.com/q/28795665
tagged with: google-chrome
type: Question
has body: I'm making a website which only works on the latest Chrome (above 40) and not on in-app browser such as Facebook's. I'd like to redirect or show a kind of deeplink to Chrome if people access to the website from Facebook app or other possible apps. What the best way to redirect people from in-app browser to Chrome? I checked useragents On Chrome: Mozilla/5.0 (Linux; Android 4.4.3; Nexus 5 Build/KTU84M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.109 Mobile Safari/537.36 On Facebook in-app browser: Mozilla/5.0 (Linux; Android 4.4.3; Nexus 5 Build/KTU84M) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/33.0.0.0 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/27.0.0.25.15;] Facebook has some "FB**" inside useragents, is it possible to show a link to open the URL in Chrome? Thanks in advance.
tagged with: javascript
tagged with: user-agent
downvote count: 0
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45866684
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28796231
tagged with: android
tagged with: facebook
score: 2
has title: The best way of redirecting to Chrome from in-app browser on Android?
upvote count: 2

http://stackoverflow.com/a/28859212
has comment: http://stackoverflow.com/comment/45984462
has comment: http://stackoverflow.com/comment/45985792
answers question: http://stackoverflow.com/q/28859143
score: 0
type: Answer
upvote count: 1
downvote count: 1
has body: as an option you can try load() . you'll have to put the desired HTML in a external HTML file . Heres an example : create an external HTML file , with the desired content : load.html Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perferendis animi suscipit, repellendus enim voluptates, fuga et vero ea! Voluptas voluptatem voluptates distinctio, iste debitis beatae, autem natus aperiam aliquid similique? Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quae cupiditate dolorem, laborum rerum, nostrum veniam? Nobis reprehenderit, nostrum velit aliquam optio dolore ab odio minima perferendis. Ex, nesciunt reiciendis corporis. and then in ur main file : Load and the Jquery to load the contents : $('#load').click(function(){ $('#para').fadeIn( 500 , function(){ $(this).load('load.html'); }); }); EDIT :: Try this excercise . make an empty html file load.html , insert only the following content : link to snippet. make another empty HTML file and insert only this content : link to snippet . See how the load function works , and then implement it in your live project . Simple and effective . cheers.

http://stackoverflow.com/q/28815545
has comment: http://stackoverflow.com/comment/45904265
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45912208
tagged with: http://stackoverflow.com/tag/json
has title: Passing a PHP variable into Javascript returns NULL
upvote count: 1
has comment: http://stackoverflow.com/comment/45902847
downvote count: 1
has answer: http://stackoverflow.com/a/28822677
has answer: http://stackoverflow.com/a/28816132
type: Question
has comment: http://stackoverflow.com/comment/45904498
possible better answer: http://stackoverflow.com/a/28822677
tagged with: javascript
has comment: http://stackoverflow.com/comment/45907176
has body: I know there are a lot of questions covering something similar, but I've tried the answers without any luck. Snippet of PHP: $usernum_query = "SELECT numPersonID FROM tbllogins WHERE txtUserName='$currentuser'"; if(!$usernumber = $db1-&gt;query($usernum_query)){ die('There was an error running the usernumber query [' . $db1-&gt;error . ']'); } while($row = $usernumber -&gt; fetch_assoc()) { $userIDnum = $row['numPersonID']; $userIDnum = utf8_encode($userIDnum); } Snippet of Javascript: $(function(){ $("#0").click(function(){ var userIDnum = &lt;?php echo json_encode($userIDnum); ?&gt;; alert(userIDnum); The most common answer I've come across says to UTF_encode my variable, which I think I've done correctly. I've also tried: var userIDnum = &lt;?php echo $userIDnum; ?&gt;; Which doesn't work. In my HTML outside of the script, &lt;?php echo json_encode($userIDnum); ?&gt; return "90" (with the quotes) &lt;?php echo $userIDnum; ?&gt; returns 90 (without the quotes). Within the script, I get null and no alert box, respectively. Any ideas as to why the variable isn't passed into the script? Thanks! edit: tried with quotes and got the same result
has comment: http://stackoverflow.com/comment/45906875
score: 0
has comment: http://stackoverflow.com/comment/45902760
answer count: 3
has comment: http://stackoverflow.com/comment/45910702
has comment: http://stackoverflow.com/comment/45904300
has answer: http://stackoverflow.com/a/28820317
has comment: http://stackoverflow.com/comment/45906789
has comment: http://stackoverflow.com/comment/45907284
favorite count: 0
has comment: http://stackoverflow.com/comment/45905753
has comment: http://stackoverflow.com/comment/45902853
accepted answer: http://stackoverflow.com/a/28820317
tagged with: php

http://stackoverflow.com/comment/46007950
type: Comment
type: QuestionComment
has text: Thank you Neil, using geoNear worked! I'll probably just use that. Though I'm still curious as to why those sample queries did not work...
comment on: http://stackoverflow.com/q/28872291
score: 0

http://stackoverflow.com/comment/45937378
type: AnswerComment
comment on: http://stackoverflow.com/a/28833720
has text: It works when I refresh the page, but I want it to update the textfield live? Think I need to listen for some kind of change/event?
type: Comment
score: 0

http://stackoverflow.com/comment/45927861
type: QuestionComment
comment on: http://stackoverflow.com/q/28807546
has text: @ma08 i tried that i used aync series at start of for loop just after ` for(var i=0;i<dev_id.length;i++){ ` here is the code 'async.series([ function(cb){ console.log("in callback"); var temp=dev_details(dev_id[i]); cb('done'); }], function (err,results){ console.log("callback"); console.log(results); }//function(err,results) );//async.series` but it gives me undefined for `console.log(results);` maybe not using it correctly
type: Comment
score: 0

svg.js
tags question: http://stackoverflow.com/q/28829420
tag name: svg.js
type: Tag

http://stackoverflow.com/q/28807031
has title: Creating Emoji-like keyboard using Javascript
type: Question
has answer: http://stackoverflow.com/a/28807248
score: -1
answer count: 1
downvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
upvote count: 0
has body: I am trying to create a custom on-screen keyboard for my website using JavaScript. So far I have the keys have ASCII values associated with them like: { value: 71 },{ value: 72 },{ value: 74 }, etc. This shows the letter on the key seen by the user and echoes on the screen when the user clicks it.I have associated JavaScript functions with each key, which converts the keystroke into a string. My question is how can I replace text on the key visible to the user with a smiley or a emoji-like graphic?:
type: UnansweredQuestion

http://stackoverflow.com/comment/46038487
has text: hmm, why would anyone prefer the (deprecated and mostly unsupported) WebSQL over the (portable and supported) emscripten/sql.js though? the resource issues maybe?
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28888541

http://stackoverflow.com/comment/45803899
comment on: http://stackoverflow.com/q/28761425
type: Comment
has text: ?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45940002
has text: Super, thanks!, I'll choose your answer in 10 minutes :)
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28835210

http://stackoverflow.com/comment/46527722
score: 0
type: Comment
has text: Check this: http://www.atomicjetpacks.com/blog/8/how-to-detect-if-a-webfont-really-loaded-ii - https://github.com/JenniferSimonds/FontDetect And here you have explanation of it works: http://stackoverflow.com/a/12316349/2247124
type: QuestionComment
comment on: http://stackoverflow.com/q/28877001

http://stackoverflow.com/comment/46001201
type: AnswerComment
type: Comment
has text: could we write into the textbox a letter that is different from the button tag says?
score: 0
comment on: http://stackoverflow.com/a/28868150

http://stackoverflow.com/comment/45956445
has text: Since you will be navigating away from the page you would need it to be a static rule that will be preserved across page loads. jQuery is a javascript run on the client-side. If you wanted, you could use localStorage to store a value that link X was clicked, then every page load you would check the localStorage and set the class via jQuery. However in older browsers that do not support localStorage you would need a cookie. I would say the CSS option is best. Plus it can be cached and would be the fastest method.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28843704

http://stackoverflow.com/a/33505920
accepted answer of: http://stackoverflow.com/q/28754887
has body: Well, 10 months later and I just had the same question for a different project. Assuming this is not possible and that a file-exclusion regexp should be used. However, that's scary because it could possibly exclude files which are not being loaded via text!
type: Answer
answers question: http://stackoverflow.com/q/28754887
score: 0
type: AcceptedAnswer

http://stackoverflow.com/a/28804827
has body: Try this code. var cookie = document.cookie; var cookieArray = cookie.split('; '); // Parse the cookies: get the stored cookie variable for(var loop=0; loop &lt; cookieArray.length; loop++) { var nameValue = cookieArray[loop].split('='); // Get the cookie if( nameValue[0].toString() == 'YourCookieName' ) { var Mycookie = nameValue[1] ; alert(Mycookie); } }
score: 0
answers question: http://stackoverflow.com/q/28804735
type: Answer
has comment: http://stackoverflow.com/comment/45889470

http://stackoverflow.com/comment/45788867
type: AnswerComment
type: Comment
has text: it works for me, on the meteor pad it dosnt work idk why, but i made a simple repo on my pc with `swipe left` and it works, you should know that you need to replace `events` to `gestures` and `'tap'` should have a css selector
comment on: http://stackoverflow.com/a/28751857
score: 0

http://stackoverflow.com/q/28905993
has comment: http://stackoverflow.com/comment/46071513
type: Question
accepted answer: http://stackoverflow.com/a/28906240
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/46072106
has comment: http://stackoverflow.com/comment/46071469
tagged with: javascript
has title: Multiple text-anchor styles for d3.axis text
has comment: http://stackoverflow.com/comment/46071925
tagged with: css
has answer: http://stackoverflow.com/a/28906240
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js
has body: I have a straightforward axis setup: var timelines = g2.selectAll(".timelines").data(data); var xScale = d3.scale.ordinal() .domain(dataset) .range([0,axisSpacing.width]); var xAxis = d3.svg.axis() .scale(xScale) .orient("bottom") .ticks(1) .tickFormat(axisTicks) .outerTickSize(0) .tickSize(0); timelines.enter().append("g") .attr("class", "axis") .attr('transform',function(d,i) { return "translate(" + axisSpacing.left + "," + (axisSpacing.top + (i * spacing)) + ")"}) .call(xAxis) .selectAll("text") .attr("dy","20px") .attr('class',"axis-text") I'd like to apply multiple styles to the tick texts. One style for the first tick; another style, for ticks thereafter. How can I achieve this?

http://stackoverflow.com/comment/45889385
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28807446
score: 0
has text: Let me see, if I can find some directive easy to use.

http://stackoverflow.com/q/28849186
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28851435
tagged with: global-variables
has answer: http://stackoverflow.com/a/42818017
type: Question
tagged with: javascript
tagged with: extjs
has title: How to use custom Vtypes in separate file to use them globally in EXT.JS
score: 0
answer count: 2
tagged with: validation
has body: I am using EXT JS as a front end framework for a project. I have wrote a custom field validation function that can be accessed by "vtype" property. The functions work ok when they are in the same file that are used locally on that file for field validation. For example in vtype that I want to check the textfield value is English or not, The below code works Ok using validation in the same file that form is created //create a custom vtype for english text fields var engTest = /^[a-zA-Z0-9\s]+$/; Ext.apply(Ext.form.field.VTypes, { // vtype validation function eng: function(val, field) { return engTest.test(val); }, // vtype Text property: The error text to display when the validation function returns false engText: 'Write it in English Please', // vtype Mask property: The keystroke filter mask engMask: /[a-zA-Z0-9_\u0600-\u06FF\s]/i }); . . layout: 'form', border: false, items: [{ xtype: 'textfield', fieldLabel: 'Title (en)', name: 'title', vtype: 'eng', msgTarget: 'under', . . . The problem is when I want to use this functions globally in whole project forms I can not use them anymore for forms field validations. I have a file name Utility that I defined my global functions as static variables in it. global static functions in Utilities.js file var statics = { /* these are js functions can be used all over the project */ func1: function(input) { }, func2: function(input) { }, . . . valEng: function(val) { var engTest = /^[a-zA-Z0-9\s]+$/; Ext.apply(Ext.form.field.VTypes, { // vtype validation function eng: function(val, field) { return engTest.test(val); }, // vtype Text property: The error text to display when the validation function returns false engText: 'Write it in English Please', // vtype Mask property: The keystroke filter mask engMask: /[a-zA-Z0-9_\u0600-\u06FF\s]/i }); } }; Ext.define('smp.utility.Utilities', { alternateClassName: 'smp.Utilities', statics: statics }); calling the custom defined vtype in form layout: 'form', border: false, items: [{ xtype: '…

http://stackoverflow.com/q/28776061
downvote count: 0
has body: I'm an HTML/CSS/PHP/MYSQL programmer, now trying to learn some javascript. I'm doing that by digging trough the code of the webmail I'm currently using (open source) and trying to understand how it works. I'm trying to understand how the different parts of the page are getting loaded (without the page reload you would get in PHP). If I'm not wrong it's using webpack to do that. Every part of the page is loaded as a module if I'm not wrong. /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; /******/ /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ exports: {}, /******/ id: moduleId, /******/ loaded: false /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.loaded = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = "webmail/v/0.0.0/static/js/"; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(0); /******/ }) This seems to be (part of) the code that makes that magic possible. Now, later on in the code webpack is used like this: AbstractSystemDropDownUserView.prototype.settingsClick = function () { __webpack_require__(/*! Knoin/Knoin */ 5).setHash(Links.settin…
linked to: http://stackoverflow.com/q/26851120
type: Question
has answer: http://stackoverflow.com/a/28776378
accepted answer: http://stackoverflow.com/a/28776378
tagged with: webpack
score: 18
tagged with: javascript
has title: Trying to understand Webpack
answer count: 1
favorite count: 0
upvote count: 18
tagged with: module
type: AnsweredQuestion

http://stackoverflow.com/comment/46065352
score: 0
comment on: http://stackoverflow.com/q/28899347
has text: Oh. I added `body {margin: 0;}` to my CSS fixing the right side of the bar. Thanks!
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46072768
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28904412
has text: Is that error generated in your `js` file or does it come from `parse-1.3.0.min.js` ?

http://stackoverflow.com/q/28888013
score: 0
has title: How to compare two before / after input values using jquery data
has body: I'm working on a form where I need to compare values of an input. Let's say for example, I have an input which comes from the server with value name1 and then the user changes it to name2. How can I get the initial value and the new value? My script below shows my attempt at resolving this, but when I look at the console output oldAddressNameValue does not have the old value and neither does newAddressNameValue. What am I doing wrong? var $el = $('#inputAddressName'); var oldAddressNameValue = $el.data('oldVal', $el.val()); console.log(oldAddressNameValue); var newAddressNameValue = $el.change(function () { var $this = $(this); var newValue = $this.data('newVal', $this.val()); }); console.log(newAddressNameValue); Thanks
has comment: http://stackoverflow.com/comment/46037363
has answer: http://stackoverflow.com/a/28888637
has answer: http://stackoverflow.com/a/28888222
has answer: http://stackoverflow.com/a/28888233
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28888304
type: Question
has comment: http://stackoverflow.com/comment/46037582
has answer: http://stackoverflow.com/a/28888198
has answer: http://stackoverflow.com/a/28888213
tagged with: javascript
answer count: 6
tagged with: variables
tagged with: jquery

http://stackoverflow.com/a/28758187
score: 1
has body: Don't put question mark in formparams var formparams = "username={email}&amp;password={password}";
accepted answer of: http://stackoverflow.com/q/28758010
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28758010
type: Answer
has comment: http://stackoverflow.com/comment/45796941
upvote count: 1

http://stackoverflow.com/comment/45875105
type: QuestionComment
comment on: http://stackoverflow.com/q/28800639
type: Comment
score: 3
has text: Use radio buttons instead of checkboxes. They will automatically handle this.

http://stackoverflow.com/comment/46028693
type: QuestionComment
type: Comment
has text: The falsy definition is what trips me up because I understood that the `==` did not check types and only checks values (or representation). Since `'1' == 1` evaluates to true I expected similar results here.
comment on: http://stackoverflow.com/q/28883426
score: 0

http://stackoverflow.com/comment/46037579
type: Comment
comment on: http://stackoverflow.com/a/28888061
score: 0
type: AnswerComment
has text: @NietzscheProgrammer That should happen automatically with the angular databinding. You're essentially doing that in your ng-click on that ion-item that you have.

http://stackoverflow.com/a/28855301
has comment: http://stackoverflow.com/comment/45977150
has body: You have to post as a complement parameter the timezone offset var d = new Date(mydate); var timezone = d.getTimezoneOffset();
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28855226
has comment: http://stackoverflow.com/comment/45976919
type: Answer
upvote count: 1

http://stackoverflow.com/comment/46082469
comment on: http://stackoverflow.com/a/28889025
has text: Okay I will try this tomorrow and report.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/28836122
has comment: http://stackoverflow.com/comment/45943045
has comment: http://stackoverflow.com/comment/45942495
has comment: http://stackoverflow.com/comment/45942619
linked to: http://stackoverflow.com/q/13418669
has comment: http://stackoverflow.com/comment/45942124
has comment: http://stackoverflow.com/comment/45942677
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45942622
has answer: http://stackoverflow.com/a/28837223
has comment: http://stackoverflow.com/comment/45942401
linked to: http://stackoverflow.com/q/20279484
has comment: http://stackoverflow.com/comment/45942724
has title: Losing reference to a jQuery stored select element
has comment: http://stackoverflow.com/comment/45942957
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/45942342
has comment: http://stackoverflow.com/comment/45943368
has comment: http://stackoverflow.com/comment/45943906
has comment: http://stackoverflow.com/comment/45942937
has answer: http://stackoverflow.com/a/28838006
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28837223
score: 0
possible better answer: http://stackoverflow.com/a/28838006
has comment: http://stackoverflow.com/comment/45942173
has body: I am somehow losing reference to a select element on the page. I'm working with legacy code and I'm trying to rebuild a portion of it. There is other code besides the code I am posting here that changes the value of the select element I am trying to work with. I create a new object for each visualizer div element on the page. I select all of the select elements with class master_select and store them in masterSelects like this: masterSelects = wrapper.find( ".master_select" ); Then whenever any select box on the page changes I call updatePreview and it should be able to make changes to the masterSelects. When the page is first loaded, updatePreview is manually fired and I call: masterSelects.css('background-color', 'blue') which works and changes the bg-color of these select boxes as would be expected. However, if I change a select option and updatePreview is called by the event, using this: masterSelects.css('background-color', 'orange'); fails to update the bg-color. I printed out the masterSelects object to the console log and it still contains the information I would expect. It's like the elements I want to change on the page are no longer the ones I have saved a reference to. However, trying to re-select it also doesn't work. Could the other legacy code somehow be breaking my reference to these elements despite the console log printing out the expected information? I'm sorry I haven't posted that code, it's a 1000 lines and is a mess since I didn't write it, I'm going to start weeding through it, but I wanted to know if this is even possible before I start. var Visualizer = (function() { /********************************* * Internal Variables *********************************/ var wrapper, selects, masterSelects; /********************************* * Constructor *********************************/ function Visualizer( newElement ) { wrapper = $(newElement); selects = wrapper.find( "select" ); masterSelects = wrapper.find( ".master_select" ); }; /*****************…

http://stackoverflow.com/comment/45980922
type: Comment
type: QuestionComment
has text: It seems to work in IE11 : [This works](http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_namednodemap_getnameditem).
comment on: http://stackoverflow.com/q/28857438
score: 0

http://stackoverflow.com/q/28765856
has comment: http://stackoverflow.com/comment/45810501
possible better answer: http://stackoverflow.com/a/28766173
score: -1
has answer: http://stackoverflow.com/a/28766173
has comment: http://stackoverflow.com/comment/45810800
type: Question
answer count: 2
downvote count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/45812024
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45812103
has body: For sample: please check the link http://plnkr.co/edit/Q3Z669FeRHqMORcQ9v6K?p=preview. I am working in Visual studio 2013. I am trying to hide or based on authentication, I want to show the menu. But ng-if not working outside the ng-view. Actually ng-if is not coming with the intellisense. Though I pasted the code, I didn't get. But ng-hide is working. I am getting the ng-hide. But I don't like to use ng-hide, because this will just hide the element. So using inspect element, we can enable the menu. Why I am not getting ng-if? Am I doing in the wrong way NoteReport
has title: ng-if not found or not working outside ng-view
has comment: http://stackoverflow.com/comment/45810968
has comment: http://stackoverflow.com/comment/45810683
has answer: http://stackoverflow.com/a/28765881
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28765881

http://stackoverflow.com/comment/45955719
score: 0
type: Comment
has text: It also ended up that window.location seemed to give me the implementation I want.
type: QuestionComment
comment on: http://stackoverflow.com/q/28842591

http://stackoverflow.com/q/28778048
accepted answer: http://stackoverflow.com/a/28778194
favorite count: 0
has answer: http://stackoverflow.com/a/28778194
score: 2
has body: I'm really unsure what I'm doing wrong here. My code makes sense to me, but then again I guess I'm just a beginner. Seems so simple yet I can't figure it out. Any help would be great, please and thank you. Please read code comments for specifications of what I'm trying to do. JSON code: {"images":[ { "bannerImg1":"./images/effy.jpg" }]} JavaScript: $.getJSON('data.json', function(data) { // Get data from JSON file for (var i in data.images) { var output+=data.images[i].bannerImg1; // Place image in variable output } document.getElementById("banner-img").innerHTML=output;}); // Display image in the img tag placeholder HTML: &lt;div class="banner-section"&gt; &lt;!-- Image should load within the following img tag --&gt; &lt;img class="banner-img" alt="effy"&gt; &lt;/div&gt;
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28778286
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: javascript
has title: Get image from JSON file using JavaScript and display in HTML img tag
upvote count: 3
answer count: 3
possible better answer: http://stackoverflow.com/a/28778286
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
has answer: http://stackoverflow.com/a/28778144

postback
tag name: postback
type: Tag
tags question: http://stackoverflow.com/q/28828296

http://stackoverflow.com/comment/45818954
has text: Yes, as you suspect, when the old stylesheet is removed inside the document.ready function, you can see (1) the old design, (2) the unstyled content, and (3) the new design, in rapid succession.
comment on: http://stackoverflow.com/a/28769704
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45898459
comment on: http://stackoverflow.com/q/28812932
type: Comment
has text: @JosephMarikle Potentially, though the examples given are all 1 character in length
score: 0
type: QuestionComment

http://stackoverflow.com/a/74609513
type: Answer
score: 0
has body: In dart you can: var number = 143; var result = (number / 100).round() * 100
answers question: http://stackoverflow.com/q/28761020

http://stackoverflow.com/q/28752226
has answer: http://stackoverflow.com/a/28752523
upvote count: 1
tagged with: css
answer count: 1
tagged with: wordpress
has comment: http://stackoverflow.com/comment/45786721
has title: Wordpress: Adding a Custom HTML file
accepted answer: http://stackoverflow.com/a/28752523
has comment: http://stackoverflow.com/comment/45786730
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45786742
type: Question
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
score: 1
tagged with: wordpress-theming
has body: A friend asked me to create a webpage for their wordpress website. I've created the page using raw HTML, CSS, and Javascript. However, when I log in to their wordpress account online I cannot figure out how to upload the file or even make a link to it? Help would be appreciated. Thank you so much. NOTE I don't know if this helps, but they are also using SEO Yoast
favorite count: 0

http://stackoverflow.com/comment/45910163
has text: possible duplicate of [youtube api v3 search by keyword javascript](http://stackoverflow.com/questions/26975365/youtube-api-v3-search-by-keyword-javascript)
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28817846

http://stackoverflow.com/comment/45914113
score: 0
type: Comment
has text: that's true is not running in the example let me fixed that (but is working in my environment
type: QuestionComment
comment on: http://stackoverflow.com/q/28820948

http://stackoverflow.com/comment/45921731
comment on: http://stackoverflow.com/a/28825465
type: AnswerComment
score: 1
has text: @Jofran dynamically created element wasn't part of the dom, so the event bound on a static button/dom node won't be registered for new ones.
type: Comment

http://stackoverflow.com/q/28864635
has comment: http://stackoverflow.com/comment/45994371
has body: I am trying to link numerous images on my site to other internal pages using the method described by Wordpress employing the Custom URL target in Image Details. When the image is clicked on website, an error message is received indicating the image cannot load (which I don't want anyway) and the resulting page URL suddenly has a "#!prettyPhoto" appended to the page URL. How do I get the link to work and get rid of the append?
tagged with: wordpress
has title: Trying to link Wordpress media image getting error message and /#prettyphoto added to URL
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46001969
tagged with: image
score: 0
has comment: http://stackoverflow.com/comment/46020497
has comment: http://stackoverflow.com/comment/46046362
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46041144
tagged with: php
has comment: http://stackoverflow.com/comment/46038911

http://stackoverflow.com/comment/46057817
type: Comment
type: QuestionComment
has text: thnku @ndm for answering. I think so that js handler not working for ajax submit in file uploading .... but i try this with jquery ajax then it's working fine ...
comment on: http://stackoverflow.com/q/28886471
score: 0

http://stackoverflow.com/q/28818626
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28819181
has title: jQuery i-Check plugin same class name - retrieving two different values
answer count: 1
downvote count: 0
has body: I'm using I-check plugin and I'm trying to retrieve the value from two input fields that represents two different fields. Html: Hotel 1 star jQuery.ajax $('.i-check input').on('ifChanged', function(event){ $('.searchtable').addClass('hide'); $('.spinner').removeClass('hide'); $.ajax({ type: 'GET', data: {'name':'<?php echo strval($_GET['name']); ?>','arrival':'<?php echo strval($_GET['arrival']); ?>','departure':'<?php echo strval($_GET['departure']);?>','guests':'<?php echo strval($_GET['guests']);?>','propertyCategory':$(".i-check input[type='checkbox']:checked").val(),'minStarRating':$(".i-check input[type='checkbox']:checked").val(),'order_by':$('#order_by').val()}, url: '<?php echo $baseUrl ?>/hotels/hotelFilterResult.php', success: function (data) { //alert('data loaded succesfully'); alert(this.url); $('.searchtable').replaceWith(data); $('.spinner').addClass('hide'); $('.searchtable').removeClass('hide'); }, error: function (xhr) { alert('data not loaded'); } }); }); The issue is not to retrieve the value, the problem is to separate the values, as I cannot change the classname. I retrive the value by 'minStarRating':$(".i-check input[type='checkbox']:checked").val() 'hoteltype':$(".i-check input[type='checkbox']:checked").val() The problem is now that I get the same value in two different representations. So e.g if star rating is selected - value I get here is in both 1.0, but really it should be empty in hoteltype. The issue lies within the identifier ".i-check". I have tried to add an ID class to both so one has id="starrating" and the other id="hoteltype" and then do it like this: 'minStarRating':$(".i-check#starrating input[type='checkbox']:checked").val() 'hoteltype':$(".i-check#hoteltype input[type='checkbox']:checked").val() This dosen't seem to work with I-Check plugin, how can I solve this so I can get the two values separated?
accepted answer: http://stackoverflow.com/a/28819181
tagged with: jquery
favorite count: 0
type: AnsweredQuestion
tagged with: icheck
score: 1
upvote count: 1

http://stackoverflow.com/q/28822503
type: Question
has title: Retrieve Username instead of ObjectID in Parse
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
tagged with: parse-platform
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28822560
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28822560
has body: Using angular and Parse for JavaScript, I have a search field when an admin types the objectid of the user, upon clicking submit the details of the user are populated in their respective field. My problem is that instead of using the objectid as a reference point, I would like to use the username. Where instead of typing out the objectid, he would enter the username instead, and their respective information would be populated. Below is how I display user information based on the objectid provided (want to change that to username). Script //To search and display user information $scope.userIdChanged = function () { $scope.loading = true; // now access $scope.userId here var query = new Parse.Query(Parse.User); query.get($scope.userId, { success: function(userInfo) { // The object was retrieved successfully. var address = userInfo.get("address"); $scope.address = address; var email = userInfo.get("username"); $scope.email = email; var fullName = userInfo.get("fullName"); $scope.fullName= fullName; var number = userInfo.get("phoneNumber"); $scope.number= number; var mailingAddress = userInfo.get("mailingAddress"); $scope.mailingAddress = mailingAddress; var plan = userInfo.get("plan"); $scope.plan = plan; var phone = userInfo.get("Phone"); $scope.phone = 'Phone: ' + phone; var scanURL = 'Scan'; $scope.scanURL = scanURL; $scope.loading = false; }, error: function(object, error) { // The object was not retrieved successfully. // error is a Parse.Error with an error code and message. $scope.loading = false; } }); html SEARCH Update: //To search and display user information $scope.userIdChanged = function () { $scope.loading = true; // now access $scope.userId here var query = new Parse.Query(Parse.User); query.equalTo("username", $scope.userId); query.find({ success: function(userInfo) { // The object was retrieved successfully. var address = userInfo.get("address"); $scope.address = address; var email = userInfo.get("username"); $scope.email = email; var fullName = userI…

http://stackoverflow.com/a/28945394
type: Answer
accepted answer of: http://stackoverflow.com/q/28780761
has body: finaly I found the solution I call the gallery.php with an iframe &lt;iframe id="iframeResult" frameborder="0" src="gallery.php" scrolling="no" height="100%" width="100%"&gt;&lt;/iframe&gt; and i call the page with the iframe (music.html) with AJAX &lt;script&gt; function Music() { var xmlhttp; if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200) { document.getElementById("myDiv").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","files/Music.html",true); xmlhttp.send(); } &lt;/script&gt; The only problem is that the photos growth as big as the iframe
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28780761
score: 0

amazon-ec2
tags question: http://stackoverflow.com/q/28766587
type: Tag
tags question: http://stackoverflow.com/q/28772157
tags question: http://stackoverflow.com/q/28804393
tag name: amazon-ec2
tags question: http://stackoverflow.com/q/28865662

http://stackoverflow.com/comment/46021894
has text: JS strict mode is not triggered by the HTML5 doctype. Any error messages of your script?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28880196
score: 0

http://stackoverflow.com/comment/45900612
score: 0
type: Comment
type: QuestionComment
has text: Thank you both! Most of it is now working, though there is a minor issue with modifying the div contents. Please see my EDIT above.
comment on: http://stackoverflow.com/q/28813563

http://stackoverflow.com/comment/45949295
comment on: http://stackoverflow.com/q/28839439
has text: Step through the application using the debugger, keep checking the apptsData value as you step through it. I know some like to depend on Ti.API.info for debugging. There probably isn't enough source code here to determine the problem. I know on some projects it is difficult to give just the right amount of code, but when it is all chopped up like this, you can't really help determine where it went wrong.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46072544
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28906493
score: 1
has text: is `$ scope` just a typo in your example code here? Or is that your actual code?

http://stackoverflow.com/a/28814865
score: 49
answers question: http://stackoverflow.com/q/28814585
has comment: http://stackoverflow.com/comment/79815395
has comment: http://stackoverflow.com/comment/45901897
downvote count: 0
has comment: http://stackoverflow.com/comment/45901683
type: Answer
has comment: http://stackoverflow.com/comment/45901763
has body: If you just want to check for a primitive value: typeof variable === 'boolean' If for some strange reason you have Booleans created with the constructor, those aren't really Booleans but objects containing a primitive Boolean value, and one way to check for both primitive Booleans and objects created with new Boolean is to do: function checkBool(bool) { return typeof bool === 'boolean' || (typeof bool === 'object' &amp;&amp; bool !== null &amp;&amp; typeof bool.valueOf() === 'boolean'); } function checkBool(bool) { return typeof bool === 'boolean' || (typeof bool === 'object' &amp;&amp; bool !== null &amp;&amp; typeof bool.valueOf() === 'boolean'); } console.log( checkBool( 'string' )); // false, string console.log( checkBool( {test: 'this'} )); // false, object console.log( checkBool( null )); // false, null console.log( checkBool( undefined )); // false, undefined console.log( checkBool( new Boolean(true) )); // true console.log( checkBool( new Boolean() )); // true console.log( checkBool( true )); // true console.log( checkBool( false )); // true
upvote count: 49
has comment: http://stackoverflow.com/comment/45901804

http://stackoverflow.com/a/28857179
accepted answer of: http://stackoverflow.com/q/28857100
score: 0
answers question: http://stackoverflow.com/q/28857100
type: AcceptedAnswer
type: Answer
has body: For future reference you should probably provide some code of what you've attempted. Here's my solution: javascript: $scope.options = []; for(var x = 0; x < 10; x++){ $scope.options.push(x); } $scope.selectedOption = 0; html jsFiddle: http://jsfiddle.net/mujem4zf/

http://stackoverflow.com/q/28858572
has answer: http://stackoverflow.com/a/28858624
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has body: I have been making print layouts and I understand how to use @media print tags. What i am trying to do is to use a different header/footer for my print layouts than on the actual page. I am putting the different header/footer on the original page but i am having an issue trying to hide the additional fields on the actual page itself. HTML: Different content Different content CSS: .different_header, .different_footer { display: none; } @media print{ .different_header { position: fixed; top: 0; } .different_Footer { position: fixed; bottom: 0; } } I've tried this....but nothing so far
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28858624
score: 0
answer count: 1
tagged with: jquery
has title: hiding certain fields in html page to use for header/footer in print layout

http://stackoverflow.com/q/28787791
has comment: http://stackoverflow.com/comment/45851769
type: UnansweredQuestion
tagged with: iframe
type: Question
tagged with: html-table
has body: I'd like to insert this piece of code without of an iframe: I have the following HTML and JQUERY code and it works perfectly: $('#info').append(' ' + 'Sectores de la comuna de Curicó' + ' ' + ' ' + ' ' + ' ' + ' Número ' + ' Sector ' + ' ' + ' ' + ' ' + ' ' + ' '); But now, I want to insert this table within of an Iframe, I have tried to insert a table tag within of append but It doesn't work.
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45851611
has answer: http://stackoverflow.com/a/28787827
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: How to insert a table within of a iframe?

http://stackoverflow.com/comment/50204391
type: Comment
has text: regardless of the answer's clarity, it did fix my problem getting babel to compile my mocha tests. Thank you Juan!
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/30554448

http://stackoverflow.com/a/28817894
has comment: http://stackoverflow.com/comment/45937272
answers question: http://stackoverflow.com/q/28817387
has comment: http://stackoverflow.com/comment/45928506
type: Answer
score: 0
has comment: http://stackoverflow.com/comment/45949814
has comment: http://stackoverflow.com/comment/45941201
has body: In assuming that question is "How do I add a click handler to elements after a submit event?" then the answer could be that your success call back has several syntax errors and your indentation suggests that you are managing the DOM in the incorrect order. To illustrate here is some annotated code: $('form.ajax').on('submit', function(e) { // Prevent an actual submission in favor of AJAX e.preventDefault(); // Spawn an AJAX request to http://ecample.com/api/form_validator $.ajax({url: 'http://example.com/api/form_validator'}) // Once we have a success response *then* do the following. .then(function(response) { // Use the response from the server to iterate of the keys array. $.each(response.keys, function(i, key) { // add the missing class to the element that matches the key. $('#element-' + key).addClass('missed'); }); }); }); // Assign a click event to the entire form but filter it by 'input.missing' // this way whe an input does have the missingf class the click will happen // otherwise it is ignored. This is call event delegation. $('form.ajax').on('click', 'input.missed', function(e) { alert('Clicked'); }); This is call event delegation.

http://stackoverflow.com/comment/46062860
has text: there is a jQuery plugin, thank google!
comment on: http://stackoverflow.com/q/28901735
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/46009573
score: 0
type: AnswerComment
type: Comment
has text: I need to crop an image from a source image. Check this link. https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage. Similar thing i need to do with fabric js.
comment on: http://stackoverflow.com/a/28873258

http://stackoverflow.com/a/28844215
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/28844156
has comment: http://stackoverflow.com/comment/45958146
accepted answer of: http://stackoverflow.com/q/28844156
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45957588
has comment: http://stackoverflow.com/comment/45957665
type: Answer
has body: I'll assume the hour is always displayed this way and the final : is always present : /\d:\d\d\S\S (.*?):/g should capture the username and store it in first capture group properly. Demo 1 : https://www.regex101.com/r/pR7eT5/1 Demo 2 : https://www.debuggex.com/r/NSlFDyt9toMCu7nJ
has comment: http://stackoverflow.com/comment/45958011
has comment: http://stackoverflow.com/comment/45958238
has comment: http://stackoverflow.com/comment/45957612
has comment: http://stackoverflow.com/comment/45957794

http://stackoverflow.com/comment/45864246
type: AnswerComment
comment on: http://stackoverflow.com/a/28794699
type: Comment
has text: history.js is jQuery, is it not? Will look it up ;)
score: 0

http://stackoverflow.com/comment/45823054
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28771135
has text: @Aaron, you right.. that shouldn't be an issue. I mistakenly thought you were implying that you were doing a script src reference to the jsp page. At any rate, check for the error messages in your browser, not the IDE. Do F12 (usually) to invoke the developer tools.. refresh the page. and see if there are any errors on page load for the scripts.
score: 0

http://stackoverflow.com/q/28770240
has comment: http://stackoverflow.com/comment/45820078
has title: javascript validation on textboxt for a column and todays date before insert into sql
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28770518
tagged with: sql-server
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45819106
downvote count: 2
upvote count: 1
tagged with: php
has comment: http://stackoverflow.com/comment/45819169
linked to: http://stackoverflow.com/q/15800250
type: AnsweredQuestion
has body: I have an issue where I want it to check if a user submitted a data with a dept key like dept Outbound would be key O and today's date so that the next day the user would be allowed to enter the data again. I am not sure how this would be done. Here is the create form Create Form Lighting Schedule Form Department Area Code Off Time Grave Yard On Time First Shift OnTime Comments Or Date By Initials Please select ... Upstairs Hang East Upstairs Hang West RDR Hang Sortation RACK WAREHOUSE HANG TO FLAT RACK SHOES FLAT 2 FLAT 1 Claims INBOUND OUTBOUND Please select ... Upstairs Hang East Upstairs Hang West RDR Hang Sortation RACK WAREHOUSE HANG TO FLAT RACK SHOES FLAT 2 FLAT 1 Claims INBOUND OUTBOUND Please select ... Upstairs Hang East Upstairs Hang West RDR Hang Sortation RACK WAREHOUSE HANG TO FLAT RACK SHOES FLAT 2 FLAT 1 Claims INBOUND OUTBOUND Please select ... Upstairs Hang East Upstairs Hang West RDR Hang Sortation RACK WAREHOUSE HANG TO FLAT RACK SHOES FLAT 2 FLAT 1 Claims INBOUND OUTBOUND Weekend Scheduling Request Department Saturday On Time Saturday Off Time Comments or Date By Signature Please select ... Upstairs Hang East Upstairs Hang West RDR Hang Sortation RACK WAREHOUSE HANG TO FLAT RACK SHOES FLAT 2 FLAT 1 Claims INBOUND OUTBOUND Please select ... Upstairs Hang East Upstairs Hang West RDR Hang Sortation RACK WAREHOUSE HANG TO FLAT RACK SHOES FLAT 2 FLAT 1 Claims INBOUND OUTBOUND <input type="hidden" value ="<?php echo date("m/d/Y",time())?>"name="Requestdate" id="Requestdate"> Insert_Process.php <?php $serverName = "localhost"; $db= new PDO( "sqlsrv:server=$serverName ; Database=lightingschedule", "test", "test"); $db->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION ); $stmt= $db->prepare("INSERT INTO tbl_lighting(Department, areaCode, offtime, gytime, ftime, ini, sat_ob_department, sat_ib_department, sat_ob_onTime,sat_ib_onTime, sat_ob_offTime, sat_ib_offTime, ob_signature,ib_signature, deptkey, comments,ib_comments,ob_comments,Requestdate ) V…
score: -1
type: Question
has answer: http://stackoverflow.com/a/28770518

http://stackoverflow.com/comment/45939665
has text: Notice that you shouldn't asynchronously "export" `self.responses.query = responsesQuery;`, but rather **`return`** promises from all you asynchronous functions (both `changeJob` and the `then()` callback).
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28834498

http://stackoverflow.com/a/28787827
upvote count: 1
has body: If the iframe is on a different domain than your domain, this is very probably not possible, unless the iframe contents explicitly grant permission. If the iframe is on the same domain, you can do it like this. $(document.getElementById("iframeID").contentDocument.body).append(' ' + 'Sectores de la comuna de Curicó' + ' ' + ' ' + ' ' + ' ' + ' Número ' + ' Sector ' + ' ' + ' ' + ' ' + ' ' + ' '); The trick here is that you have to access the contentDocument before you can append anything.
downvote count: 0
has comment: http://stackoverflow.com/comment/45852962
answers question: http://stackoverflow.com/q/28787791
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/45852422

http://stackoverflow.com/comment/52514228
score: 0
type: Comment
has text: This isn't valid anymore on >= Polymer 1.0, is it?
type: AnswerComment
comment on: http://stackoverflow.com/a/28825186

http://stackoverflow.com/a/28810996
has comment: http://stackoverflow.com/comment/45897570
has comment: http://stackoverflow.com/comment/45897194
has comment: http://stackoverflow.com/comment/45897667
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/28810014
score: 2
downvote count: 0
has body: So I have created this plnkr extracted most of it from Angular Docs. It also shows how to put it all together, rather than just a excerpt, even though Angular does give this as well. http://docs.angularjs.org/api/ngAnimate http://docs.angularjs.org/api/ng/directive/ngShow#animations So its the css3 that does all the work: .animate-show { line-height: 20px; opacity: 1; padding: 10px; border: 1px solid black; background: white; } .animate-show.ng-hide-add.ng-hide-add-active, .animate-show.ng-hide-remove.ng-hide-remove-active { -webkit-transition: all linear 0.5s; transition: all linear 0.5s; } .animate-show.ng-hide { line-height: 0; opacity: 0; padding: 0 10px; } Then it is merely using the directive: Sometext and the js: vm.showText = false; $timeout(function () { vm.showText = true; }, 2000); The $timeout just represents some async function. like a $http call. Obviously it doesn't matter whether you do this from a controller or a directive, they both achieve the same result. A cool tip, if you extend the time of the animation, and view the elements in the chrome or firebug console, you can watch the css classes as they change. This will give you a close look at what is exactly happening and how to modify your css to give the proper result.

http://stackoverflow.com/comment/46008406
comment on: http://stackoverflow.com/q/28872668
has text: At `2.` you say it changes to `bar#123`, at the end of your question you say it changes to `foo#123`. Is `bar` a typo?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28862060
has comment: http://stackoverflow.com/comment/45993206
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28883032
has comment: http://stackoverflow.com/comment/45993337
has body: I have a link on a page that toggles the search form on and off. For example you search for Spring term classes and then you want to search for a new term and click Start a new Search. The link works great and toggles just fine...EXCEPT the toggle automatically closes again. I can't figure out why this is happening, I have searched the stack overflow site and none of the solutions seems to work (Or maybe I am still doing something wrong) Any help you can give me would be greatly appreciated. Here is the part that calls the function &lt;div class="course-schedule-wrapper"&gt; &lt;span &lt;?= ($show_form) ? 'style="display:none;"' : null ?&gt; class="toggle-search"&gt;&lt;a href="#"&gt;Start a new schedule search&lt;/a&gt;&lt;/span&gt; &lt;div id="course-schedule-search" &lt;?= ($show_form) ? null : 'style="display:none;"' ?&gt;&gt; &lt;form name="form" method="post" action="/schedules/"&gt; &lt;input type="hidden" name="search" value="1" /&gt; &lt;table summary="Course schedule search options" id="course-schedule-form"&gt; &lt;tbody&gt; &lt;tr valign="top"&gt; &lt;td nowrap="nowrap"&gt; &lt;label for="area_id" class="label"&gt;Semester:&lt;/label&gt; &lt;/td&gt; &lt;td&gt; &lt;!--&lt;input type="radio" name="semester" value="2014SP" id="S2014SP" checked="checked"&gt; &lt;label class="inline" for="S2014SP"&gt;Spring 2014&lt;/label&gt; &lt;br /&gt; --&gt; &lt;? $sflag = FALSE; $fflag = FALSE; if ($_POST['semester'] == '2014SU'){ $sflag = "checked=checked"; } if ($_POST['semester'] == '2014FA'){ $fflag = "checked=checked"; } if(!$sflag &amp;&amp; !$fflag) { $fflag = "checked=checked"; } ?&gt; &lt;input type="radio" name="semester" value="2014FA" id="S2014FA" &lt;?= $fflag; ?&gt;&gt; &lt;label class="inline" for="S2014FA"&gt;Fall 2014&lt;/label&gt; &lt;br /&gt; &lt;input type="radio" name="semester" value="2015SP" id="S2015SP" &lt;?= $sflag; ?&gt;&gt; &lt;label class="inline" for="S2014SU"&gt;Spring 2015&lt;/label&gt; &lt;br /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr valign="m…
possible better answer: http://stackoverflow.com/a/28862283
has comment: http://stackoverflow.com/comment/45995249
has comment: http://stackoverflow.com/comment/45994201
has comment: http://stackoverflow.com/comment/45990581
has answer: http://stackoverflow.com/a/28862283
tagged with: php
has comment: http://stackoverflow.com/comment/45996598
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28883032
tagged with: toggle
type: Question
has title: Why is the javascript slidetoggle function not staying open?
has comment: http://stackoverflow.com/comment/45991902
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/28903639
type: Answer
answers question: http://stackoverflow.com/q/28903528
upvote count: 2
has comment: http://stackoverflow.com/comment/46066964
has comment: http://stackoverflow.com/comment/46066782
score: 2
has body: Try to delegate the event in order to target more precisely the element, but want You are trying to achieve could cause really bad performance issues. Try this: $(document).on('click', '*', function(event) { $(this).css({'position': 'relative'}); });
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46066838
accepted answer of: http://stackoverflow.com/q/28903528

http://stackoverflow.com/q/28791268
tagged with: javascript
favorite count: 0
has body: I'm trying to create a range of numbers in a dropdown form using JavaScript. However, it looks like …and it does not show any options and clicking on the arrow does not pop up more options. I already checked that my path is correct. I tried it in JSFiddle and it works but not when I put it in my HTML. I'm going crazy on why this is not working. index.html <p >Word Size main.js var select = document.getElementById('length'); for (var i = 0; i<= 24; i++){ var option = document.createElement('option'); option.value = i; option.innerHTML = i; select.options.add(option); }
has title: Dropdown form Javascript create a range of numbers
type: Question
tagged with: http://stackoverflow.com/tag/html
score: -1
downvote count: 2
has comment: http://stackoverflow.com/comment/45857667
upvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/28791295
accepted answer: http://stackoverflow.com/a/28791295
type: AnsweredQuestion

http://stackoverflow.com/q/28821432
accepted answer: http://stackoverflow.com/a/28821464
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45914632
has comment: http://stackoverflow.com/comment/45914654
type: AnsweredQuestion
has body: I'm fairly stuck on this, I'm playing catchup on course work. How do I go about adding values to an array using string from text boxes on the page? var book = [ { "name":"Book 1", "publisher":"Publisher 1", "isbn":"ISBN 1" }, { "name":"Book 2", "publisher":"Publisher 2", "isbn":"ISBN 2" }, { "name":"Book 3", "publisher":"Publisher 3", "isbn":"ISBN 3" }, ]; book.push({"name":"Moby Dick","publisher":"Ryan Spain","isbn":"00147097"}); I know I can push it into the array but I want to add values to name, publisher and isbn from values attained from text boxes in HTML.
has answer: http://stackoverflow.com/a/28821464
has title: How to add data to an array from text box/s?
upvote count: 1
downvote count: 1
type: Question
tagged with: javascript
score: 0

http://stackoverflow.com/a/28810917
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28810807
score: 3
upvote count: 3
has body: Listen delegated click on inner .delete elements and remove corresponding li when that happens: $("#sortable").sortable({ placeholder: "ui-state-musichighlight" }) .on('click', '.delete', function() { $(this).closest('li').remove(); }); Demo: http://jsfiddle.net/1htxLzm2/

http://stackoverflow.com/comment/46071580
comment on: http://stackoverflow.com/a/28905434
has text: This is exactly what i want but how do i close the others? for example if i click Open 3 the content of open 1 remains open but i need to close before the new one opens https://jsfiddle.net/jcghdLt1/3/
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28844402
has comment: http://stackoverflow.com/comment/47505024
has comment: http://stackoverflow.com/comment/47495852
upvote count: 3
has comment: http://stackoverflow.com/comment/47504282
has body: You're receiving this error because at the point you call: connect.static("../angularjs") you do not have a valid connect server instance to reference because it is created when you call: connect.createServer(...).listen(5000); Before you call connect.createServer(), connect is a reference to a function and not a server instance with a .static() function. You need to create the server instance before you call call any of its functions, as in: var server=connect.createServer(); // now connect is a server instance server.static('../angularjs'); server.listen(5000); See the senchalabs/connect github repo for more about connect. UPDATE As of connect@3.3.5, connect no longer exports the createServer() function. Rather the actual export of connect is the createServer function itself. So instead of calling: var server=connect.createServer(); you should call: var server=connect(); which will return the same result as the previous call. The other (big) change to connect in its 3.X.X release is the extraction of its middleware components into separate modules. This is why calling connect.static() will no longer work. There are two ways to solve your current problem: First, assuming you still wish to explore the examples in your, now somewhat outdated, book as they are written, you could npm install connect@2.29.1 which will revert your current version of connect to the last stable version before the new internal reorganization occurred. After you do this, the examples in the book should work as advertised. Or, you could refactor your example to use the new, modularized middleware modules by installing the required module (using npm install serve-static) and making the following changes to your code: var connect=require('connect'), serveStatic=require('serve-static'); var server=connect(); server.use(serveStatic('../angular.js')); server.listen(5000); See Connect Middleware for the list of the now modularized middleware components. My advice would be to understand why the main…
downvote count: 0
has comment: http://stackoverflow.com/comment/47414779
has comment: http://stackoverflow.com/comment/47503310
score: 3
answers question: http://stackoverflow.com/q/28830902
has comment: http://stackoverflow.com/comment/47382109
has comment: http://stackoverflow.com/comment/50574651
has comment: http://stackoverflow.com/comment/47429202
type: Answer

http://stackoverflow.com/comment/45789385
comment on: http://stackoverflow.com/a/28752885
has text: i changed that line to this - if ( $(res[index]).val() !== '' ) - and it works better, but it alerts every time for every field. i just need it to alert if all of the visible fields have a value in them.
type: Comment
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45853672
type: AnswerComment
has text: Calling $rootScope.$digest() at the bottom of the spec seems to have no effect. Is that where you meant to call it from?
type: Comment
comment on: http://stackoverflow.com/a/28788869
score: 0

http://stackoverflow.com/comment/45828654
type: Comment
type: QuestionComment
has text: Any other message logged out other than those you pasted?
comment on: http://stackoverflow.com/q/28773327
score: 0

http://stackoverflow.com/q/28902827
has comment: http://stackoverflow.com/comment/46065364
type: AnsweredQuestion
has title: Creating Google Maps markers from cities in a database
linked to: http://stackoverflow.com/q/20165059
tagged with: mysql
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/46068551
tagged with: javascript
score: 0
has body: I'm currently trying to build my own Google Map that will display each of the locations of where students are from, similar to one like this. I've looked into Zeemaps, but it seems to only accept imports from a CSV file. My first question would be whether it is possible to create a marker with just the City, State and Country (I wouldn't be able to use Zip for international students, and I want to avoid having a specific address for privacy reasons), rather than the Lat and Long. I see this example for creating the marker from W3schools var myCenter=new google.maps.LatLng(51.508742,-0.120850); var marker=new google.maps.Marker({ position:myCenter, }); Is there a similar way to create a point with City, [State], Country? And if not, are there any in-between functions from the Google Maps API that could do the conversions in another function?
tagged with: google-maps
has comment: http://stackoverflow.com/comment/46067313
answer count: 1
has answer: http://stackoverflow.com/a/28903228
favorite count: 0
accepted answer: http://stackoverflow.com/a/28903228
tagged with: php

http://stackoverflow.com/comment/45949742
score: 0
has text: not good with raw js, but can you use getElementById with a wildcard?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28840185

http://stackoverflow.com/comment/45996523
score: 0
type: Comment
type: AnswerComment
has text: Ok I've got it working but I had to use the original $.get request. It's updating but now that problem is that if Account1 clicks the button activity on Account2 disappears because activity is tied to my ID. Hmmmm. This will need to be a new question but I'm not sure how I'd sort this one out.
comment on: http://stackoverflow.com/a/28865209

http://stackoverflow.com/q/28809386
tagged with: internet-explorer
has title: Quickblox on IE-8/IE-9
has body: Does quickblox's javascript library works on IE8/IE9? I am getting "No Transport" error while creating the session. As per few suggestions on SO, I am using following scripts But I am not having any luck. The other option I tried was, setting following property: jQuery.support.cors = true; This gives me "Access Denied" error. I would appreciate any help or pointers to get this right on IE.
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45973437
score: 0
answer count: 1
tagged with: quickblox
has answer: http://stackoverflow.com/a/28819416
accepted answer: http://stackoverflow.com/a/28819416
type: AnsweredQuestion

http://stackoverflow.com/comment/46004090
comment on: http://stackoverflow.com/a/28869961
type: AnswerComment
has text: you doing this? http://stackoverflow.com/questions/8297369/guint32-date-to-timestamp-in-php
score: 0
type: Comment

http://stackoverflow.com/comment/60445391
score: 8
has text: So the sub-items within groups would retain their original ordering, but the grouped key ordering may change, because they are object properties.
comment on: http://stackoverflow.com/a/28860793
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28820317
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/28815545
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28815545
has body: [Taken from comments as requested] If I can make a recommendation, put your value in a data-attribute in the HTML (e.g. &lt;body data-user-id="&lt;?php echo $userId ?&gt;"&gt;. This keeps you from mixing code languages together which is hard to read, and would allow your external script to run correctly without making it a PHP page. As far as IE9, I'll take a quick look. You might want to see how jQuery manages the data attributes. You should, at the least, have access to domObject.getAttribute('data-user-id'). Yep, just did a quick lookup, and even IE10 doesn't support the dataset feature. So, you'll need to use getAttribute for IE &lt;= 10.
score: 1
has comment: http://stackoverflow.com/comment/45916783
type: AcceptedAnswer

http://stackoverflow.com/comment/45926528
type: AnswerComment
type: Comment
has text: But a `switch` is exactly a simple implementation of `if..else`. The only difference is that a switch can more easily (in terms of syntax) combine similar cases.
comment on: http://stackoverflow.com/a/28828136
score: 0

http://stackoverflow.com/comment/48229996
type: AnswerComment
comment on: http://stackoverflow.com/a/30053155
score: 0
type: Comment
has text: as I already mentioned in comments I used this but it also doesn't work.

http://stackoverflow.com/comment/45949512
comment on: http://stackoverflow.com/q/28822320
type: Comment
type: QuestionComment
score: 0
has text: Why this was tagged 'bootstrap' I don't know.

http://stackoverflow.com/comment/45810048
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28764523
has text: this is nonoto() now. I calls getMonthNum() which returns the numeric equivalent of the months of the year. nonoto will called from two different id textboxes. `var hnino; function nonoto() { hnino = document.getElementById("nono").value; alert(getMonthNum()); } function getMonthNum() { var mon = /[a-zA-Z][a-zA-Z][a-zA-Z]+/.exec(hnino); var month = ["january","february","march","april","may","june","july","august","september","october","november","december"]; var i = 0; do { var n = month[i].search(mon); i++; } while (n != 0 && i < 12); return i; }`

http://stackoverflow.com/q/28868835
has comment: http://stackoverflow.com/comment/46005964
accepted answer: http://stackoverflow.com/a/28934673
tagged with: sockets
tagged with: node.js
type: AnsweredQuestion
score: 0
tagged with: google-chrome
tagged with: socket.io
type: Question
has title: why can't I inject socket.io using a chrome extension
has comment: http://stackoverflow.com/comment/46031780
has answer: http://stackoverflow.com/a/28934673
tagged with: javascript
has comment: http://stackoverflow.com/comment/46031937
answer count: 1
has body: I have a really basic socket.io application that listens on the server side for a button click on an html page. index.html: click</buton> index.js: var socket = io('http://localhost:3000'); socket.on('connect',function(){ $(document).ready(function(){ $('#asdf').click(function(){ socket.emit('0.1'); }); }); }); This part works. What I'd like to do is put this functionality into a chrome extension so that I can have my node app respond to events in the DOM. Right now, I have a background page that injects a script when the extension icon is clicked. background.js: chrome.browserAction.onClicked.addListener(function(tab) { chrome.tabs.executeScript({ file: 'script.js' }); }); script.js: console.log('test'); So this works too, but when I copy and paste the socket.io.js code into the script.js file, nothing is logged to the console, which I assume means that the script isn't working. Why doesn't this work, and is there a better way to integrate socket.io.js into a browser extension?

http://stackoverflow.com/q/28879153
possible better answer: http://stackoverflow.com/a/28879258
has answer: http://stackoverflow.com/a/28879306
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28879258
has title: remove some text after - from string
has answer: http://stackoverflow.com/a/28879264
tagged with: javascript
tagged with: jquery
score: 0
answer count: 3
has body: I want to remove some text from string or integer using javascipt or jquery.. I have string "flow-[s/c]", "flow-max[s/c]","flow-min[s/c]", "Usage-[s/c]", "temperature" And I want for each : "flow", "flow-max","flow-min", "Usage", "temperature" As you can see. I want to remove all the data after - found expect flow-max and flow-min What I am doing : var legendName = $(textElement).text().toLowerCase().replace(" ", "-"); Taking the legend Name example : "flow-[s/c]", "flow-max[s/c]" var displayVal = legendName.split('-')[0]; remove all the data after - found But I am not able to add condition for flow-max because at this case I will be having two - and two place like flow-min-[s/c]
accepted answer: http://stackoverflow.com/a/28879306

http://stackoverflow.com/q/28770151
has comment: http://stackoverflow.com/comment/45823127
tagged with: datetime
answer count: 1
tagged with: meteor
tagged with: momentjs
has answer: http://stackoverflow.com/a/28771889
tagged with: timezone
accepted answer: http://stackoverflow.com/a/28771889
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45825654
has comment: http://stackoverflow.com/comment/45824240
type: Question
has comment: http://stackoverflow.com/comment/45831648
has comment: http://stackoverflow.com/comment/45822311
has title: What is the scope of moment.tz.setDefault() when used in Meteor?
tagged with: javascript
has comment: http://stackoverflow.com/comment/45824160
score: 0
has body: TL;DR What is the scope of moment.tz.setDefault()? I'm sure my problem here stems from my inexperience with both JavaScript and Meteor but I've been struggling with the problem for several straight days now. I'm working on an app that must take into account the client's timezone but I'm having significant difficulty in forcing the server code to use the client's timezone. Somewhere along the way--that being from the moment the client presses "Submit" to the moment Meteor inserts--my timezone setting is getting lost and local time (of the server) is being used. The app flow is like this: (client) user submits form (client) validation of data is performed (server) Meteor method is called (server) validation of data is performed (same code as earlier) (server) business logic is applied (server) insert into DB I capture the timezone at step 1 and try to pass it along through all the steps but I must be missing something because between 4 and 5 the timezone is (seemingly) lost. The fast is, I'm not seeing why. I've checked this 100 times and tried all manner of different permutations but can't figure out where the gap is (I've used soooo many console.log()s it's crazy.) So instead of trying to set the timezone at every point Moment() is used (because it defaults to calculating in local time) I discovered moment.tz.setDefault() and tried using that at least once on each .js file in my app. But it didn't work. Reading this it might sound like I'm not doing enough testing but that is not the case. I have spent 10s of hours on this and I'm just not getting it. I'd love to share the code but I think it's just too long and complicated to properly share so I've done my best to explain the problem.

http://stackoverflow.com/comment/69381403
type: Comment
has text: Do you know if it is possible to set this `--display-modules` flag via the webpack config file?
comment on: http://stackoverflow.com/a/28899351
score: 12
type: AnswerComment

http://stackoverflow.com/q/28826757
has comment: http://stackoverflow.com/comment/45925812
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/45924137
tagged with: jquery
has comment: http://stackoverflow.com/comment/45923961
score: 0
has comment: http://stackoverflow.com/comment/45924085
has comment: http://stackoverflow.com/comment/45924022
answer count: 1
has answer: http://stackoverflow.com/a/28826987
has comment: http://stackoverflow.com/comment/45924106
tagged with: asp.net
has comment: http://stackoverflow.com/comment/45923980
has comment: http://stackoverflow.com/comment/45923946
has body: I have button in my page as you can see here : <asp:Button ID="btnFinal" runat="server" Text="دانلود مقاله" CssClass="buttonBlue" OnClick="btnFinal_Click"/> The click event of this button is : protected void btnFinal_Click(object sender, EventArgs e) { int count = dbcontext.tblJurorArticles.Where(i => i.articleid == articleId && i.jurorUsername == Session["juror"]) .Count(); if (count == 1) { Response.Redirect("../AdminPortal/DownloadArticleHandler.ashx?File=" + obj.Return_filelocation_article(articleId.ToString())); } else { Response.Redirect("asda"); } } But when i click on the button it doesn't work .the important things is all my buttons in the page are disabled . If the html code is needed ,i can include it in my question. The webconfig <?xml version="1.0"?> <add name="DB-Conference-CivilConstruction" connectionString="Data Source=176.9.90.204,9992;Initial Catalog=DB-Conference-CivilConstruction;User ID=DB-Conference-CivilConstruction-user; password=123qweQWE@;" providerName="System.Data.SqlClient" /> <!--<add name="DB-Conference-CivilConstruction" connectionString="Data Source=192.168.223.75;Initial Catalog=DB-Conference-CivilConstruction;User ID=DB-Conference-CivilConstruction-user; password=123qweQWE@;" providerName="System.Data.SqlClient" />--> <system.webServer> <requestLimits maxAllowedContentLength="1073741824" /> </system.webServer> <system.web> <compilation debug="true" targetFramework="4.0"/> <httpRuntime maxRequestLength="1048576" /> <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/> </system.web> Best regards
has comment: http://stackoverflow.com/comment/45924141
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45924422
has title: The click event of button isn't trigged in asp.net
has comment: http://stackoverflow.com/comment/45924227
has comment: http://stackoverflow.com/comment/45928560

http://stackoverflow.com/q/28828242
tagged with: knockout.js
type: Question
has body: I got two different view models and I need to call a function in one view model from other. To acheive this i try to use ko.subscribable() var postbox=new ko.subscribable();// global variable EmployeeViewModel postbox.subscribe(function (showAlert) { return that.ValidateEmployees(showAlert); }, that, 'ValidateEmps'); that.ValidateEmployees=function(){ //validation logic return true/false; } TaxCalculatorViewModel var isEmpValid = postbox.notifySubscribers(true, "ValidateEmps"); if (!isEmpValid ) { return false; } The prioblem is I am always getting isEmpValid=undefined instead of getting the return value of ValidateEmployees How to get the return value of a function when we pass using notifySubscribers?
tagged with: javascript
score: 0
has title: Get return value of a function using notifySubscribers
has comment: http://stackoverflow.com/comment/45929706
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45926930
has comment: http://stackoverflow.com/comment/45931861
answer count: 0
linked to: http://stackoverflow.com/q/6847697

http://stackoverflow.com/comment/94298710
score: 0
comment on: http://stackoverflow.com/a/32243857
type: Comment
type: AnswerComment
has text: it('some spec', async () => { `await browser.switchTo().window(handles[1]);` // do your stuff });

http://stackoverflow.com/q/28753392
has body: I am trying to get a https loopback server up and running protected by OAuth. I am using the loopback gateway sample project as a reference. But for some reason I can't get the OAuth piece to work. What I mean is, even after adding in the OAuth bits and pieces, the APIs don't seem to be protected. I get a response back even if there is no token in my request. This is what my server.js looks like var loopback = require('loopback'); var boot = require('loopback-boot'); var https = require('https'); var path = require('path'); var httpsRedirect = require('./middleware/https-redirect'); var site = require('./site'); var sslConfig = require('./ssl-config'); var options = { key: sslConfig.privateKey, cert: sslConfig.certificate }; var app = module.exports = loopback(); // Set up the /favicon.ico app.middleware('initial', loopback.favicon()); // request pre-processing middleware app.middleware('initial', loopback.compress()); app.middleware('session', loopback.session({ saveUninitialized: true, resave: true, secret: 'keyboard cat' })); // -- Add your pre-processing middleware here -- // boot scripts mount components like REST API boot(app, __dirname); // Redirect http requests to https var httpsPort = app.get('https-port'); app.middleware('routes', httpsRedirect({httpsPort: httpsPort})); var oauth2 = require('loopback-component-oauth2')( app, { // Data source for oAuth2 metadata persistence dataSource: app.dataSources.pg, loginPage: '/login', // The login page url loginPath: '/login' // The login processing url }); app.set('view engine', 'ejs'); app.set('views', path.join(__dirname, 'views')); // Set up login/logout forms app.get('/login', site.loginForm); app.get('/logout', site.logout); app.get('/account', site.account); app.get('/callback', site.callbackPage); var auth = oauth2.authenticate({session: false, scope: 'demo'}); app.use(['/protected', '/api', '/me', '/_internal'], auth); app.get('/me', function(req, res) { // req.authInfo is set using the `info` argument sup…
has answer: http://stackoverflow.com/a/28768321
tagged with: loopbackjs
tagged with: node.js
tagged with: strongloop
type: UnansweredQuestion
score: 1
tagged with: oauth-2.0
upvote count: 1
has title: Loopback IO OAuth not working
tagged with: javascript
type: Question
answer count: 1
downvote count: 0
favorite count: 0

webforms
tags question: http://stackoverflow.com/q/28903127
tags question: http://stackoverflow.com/q/28875861
tags question: http://stackoverflow.com/q/28859238
type: Tag
tag name: webforms
tags question: http://stackoverflow.com/q/28820983
tags question: http://stackoverflow.com/q/28809529

http://stackoverflow.com/a/28827628
score: 0
type: Answer
has body: No there isn't. JavaScript doesn't support multi-threading because the JavaScript interpreter in the browser itself is single-threaded.
answers question: http://stackoverflow.com/q/28827459

http://stackoverflow.com/comment/45825847
comment on: http://stackoverflow.com/a/28773578
score: 0
type: AnswerComment
type: Comment
has text: For http and https protocols, this shows `http:` and `https:`, respectively - should it not be `http/2:`, then? Also, a link to some official documentation would be much valuable for future readers.

http://stackoverflow.com/q/28799077
type: Question
tagged with: javascript
tagged with: jquery
tagged with: sorting
has comment: http://stackoverflow.com/comment/45872641
accepted answer: http://stackoverflow.com/a/28799488
score: 0
has body: I have an unordered list as follows abb dbb zbb abb ybb abb zbb zab zbb xbb cbb bbb cbb abb This is a grand parent > parent > child relationship and I wish to alphabetically order them whilst maintaining the individual relationship structure. The markup can not be changed on import unfortunately as it is generated elsewhere. Desired output: abb dbb abb zbb ybb abb zab zbb cbb bbb abb cbb xbb zbb I have never encountered this issue before. Whenever I have had to order a list it has been a case of ordering the list in it's entirety. Has anybody got any clever suggestions or advice on how I could approach this problem. Current Fiddle http://jsfiddle.net/p70Lagyp/
answer count: 1
has comment: http://stackoverflow.com/comment/45872646
has comment: http://stackoverflow.com/comment/45872558
has title: Sort different li elements with same class level
has comment: http://stackoverflow.com/comment/45872725
has comment: http://stackoverflow.com/comment/45872706
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28799488
has comment: http://stackoverflow.com/comment/45872680
has comment: http://stackoverflow.com/comment/45872751
has comment: http://stackoverflow.com/comment/45872548

http://stackoverflow.com/a/28843518
upvote count: 2
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/45976127
downvote count: 0
has body: Considering that your iframe loads a src on the same domain, the following should do it : Notice I removed the fixed height you set on the iframe element and setted it to auto instead. See this fiddle
answers question: http://stackoverflow.com/q/28841784

http://stackoverflow.com/comment/45885013
score: 1
type: AnswerComment
has text: @BetaRide that's the reason crowder asked at very first. Why you failed to interact at the mean time?
type: Comment
comment on: http://stackoverflow.com/a/28805477

css-sprites
type: Tag
tags question: http://stackoverflow.com/q/28798396
tag name: css-sprites

http://stackoverflow.com/comment/45817957
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28769472
has text: @pal most likely then as the page reloads the dropdown is set to the correct value and 'change' is triggered, so hide() is actually working but show() is happening too right after
score: 0

currency
tag name: currency
tags question: http://stackoverflow.com/q/28867751
type: Tag

http://stackoverflow.com/q/28861689
linked to: http://stackoverflow.com/q/2166540
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28876123
type: Question
linked to: http://stackoverflow.com/q/22651334
has body: In a website I visit, there is a bit of code that checks the User Agent and if it is not IE, it will redirect to another website. if( ! window.navigator.appVersion.match(/MSIE ([0-9]+.)[A-Za-z0-9.]+;/) || new Number(parseFloat (RegExp.$1)) &lt; 5.5 ){ window.location.replace("/iedownload.htm"); } Is there a way to make a quick greasemonkey script to spoof the User Agent? I tried GM_xmlhttpRequest({ method: 'GET', url: window.location.href, headers: { 'User-Agent': 'Mozilla/4.0 (compatible; MSIE 9.0;) Greasemonkey', 'Accept': '*/*', }, }); But it did not work.
answer count: 2
tagged with: greasemonkey
tagged with: javascript
has title: Greasemonkey Spoof User Agent
score: 0
has answer: http://stackoverflow.com/a/28888641

http://stackoverflow.com/comment/45787079
type: Comment
type: QuestionComment
has text: it's working but I want to add that class only in which iframe I want ,
score: 0
comment on: http://stackoverflow.com/q/28752090

http://stackoverflow.com/q/28756561
tagged with: ajax
tagged with: php
has body: $.ajax({ url: '../ajax/deletestudent.php', type: 'POST', dataType: "json", data: formData, processData: false, // tell jQuery not to process the data contentType: false, // tell jQuery not to set contentType success: function(data) { console.log(data); alert(data); window.location.reload(true); }, error: function(data) { alert(data); // Optional window.location = '../pages/studentdata.php'; } }); $deletedstudent = "Deleted"; echo json_encode(array( 'message' =&gt; $deletedstudent )); I have this ajax above and the echo from php file. From the ajax i have an alert and a console.log both of them uses data as parameter. My question is why does in the console.log the output is Object {message: "Deleted."} but in alert the output is [object Object]. But they both use same parameter. I am expecting both of them will return Deleted.. Why is this happening any ideas are appreciated
score: 0
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28756576
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45794219
tagged with: javascript
has title: ajax datatype json jquery success
has comment: http://stackoverflow.com/comment/45794174
has comment: http://stackoverflow.com/comment/45794190
accepted answer: http://stackoverflow.com/a/28756576
answer count: 2
possible better answer: http://stackoverflow.com/a/28756645
has answer: http://stackoverflow.com/a/28756645
tagged with: jquery

http://stackoverflow.com/comment/46049365
score: 0
comment on: http://stackoverflow.com/q/28885307
type: Comment
has text: That wold explain what I'm seeing, although I don't see how this particular JQuery could fire before the page has loaded. I've added in the HTML structure into my question. Cheers.
type: QuestionComment

http://stackoverflow.com/comment/46066574
type: Comment
has text: Is the `load` event triggered if `src` is empty? Why are you having `javascript:` there? It's completely useless (and confusing) at that position.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28903605

http://stackoverflow.com/q/28906278
type: Question
has comment: http://stackoverflow.com/comment/46072403
has comment: http://stackoverflow.com/comment/46072675
tagged with: javascript
tagged with: angularjs-scope
has comment: http://stackoverflow.com/comment/46072712
has comment: http://stackoverflow.com/comment/46072080
score: 0
has answer: http://stackoverflow.com/a/28906514
has comment: http://stackoverflow.com/comment/46072145
answer count: 1
has comment: http://stackoverflow.com/comment/46072212
tagged with: angularjs
has comment: http://stackoverflow.com/comment/46072884
has comment: http://stackoverflow.com/comment/46072435
has comment: http://stackoverflow.com/comment/46072557
has comment: http://stackoverflow.com/comment/46072233
has comment: http://stackoverflow.com/comment/46072069
has body: We are making multiple HTTP requests using Angular: $scope.GetTest1 = function () { $http.get("/test/GetTest1/").success(function (response) { $scope.res = response.aaData; }); } $scope.GetTest2 = function () { $http.get("/test/GetTest2/").success(function (response) { $scope.res = response.aaData; }); } $scope.GetTest3 = function () { $http.get("/test/GetTest3/").success(function (response) { $scope.res = response.aaData; }); } // This is called from an onclick of a button $scope.LoadAll = function () { $scope.GetTest1(); $scope.GetTest2(); $scope.GetTest3(); } We assumed that these were all called async, however, we have log4net enabled and we log the datetime when the 'gets' are received, and the times for all 3 are: 19:05:26 19:05:27 19:05:28 This was an unexpected surprise as we assumed the time would all be within 1 second. ie async. Not sure if we're missing something, Sorry, question is, how do we make these async calls?
accepted answer: http://stackoverflow.com/a/28906514
type: AnsweredQuestion
has title: Async calls using AngularJS

http://stackoverflow.com/comment/45896308
type: Comment
type: QuestionComment
has text: That float, int line is wrong. Pick one, not both.
comment on: http://stackoverflow.com/q/28812132
score: 0

http://stackoverflow.com/comment/45929096
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28829217
has text: can you show your included google map api js file?

http://stackoverflow.com/a/28864316
upvote count: 1
score: 1
has body: Your code is assigning callback function result to onclick event instead of function itself. Besides, you are also trying to run a while loop which will consume guessCount on first click event. I edited code, following should work: function partC(){ var guessCount = 10; var random = Math.round(Math.random()*100); var button = document.createElement('input'); button.type = "button"; button.value = " Guess! "; document.getElementById('myForm').appendChild(button); var textbox = document.createElement('input'); textbox.type = 'number'; document.getElementById('myForm').appendChild(textbox); button.onclick = function(){ var check = textbox.value*1; if (check == random){ alert("Correct!"); } else if (check &gt; random) { alert("Try Again. Guess to High. " + guessCount + " tries left."); } else if (check &lt; random) { alert("Try Again. Guess to Low. " + guessCount + " tries left."); } guessCount--; } }
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45993906
type: Answer
accepted answer of: http://stackoverflow.com/q/28864095
answers question: http://stackoverflow.com/q/28864095

http://stackoverflow.com/comment/45812143
type: Comment
comment on: http://stackoverflow.com/q/28766581
score: 0
type: QuestionComment
has text: angular.injector is a method not a property. Check this for the proper usage of injector. https://docs.angularjs.org/api/auto/service/$injector use `ng-inspect` or `ng-console` chrome extensions to debug services from console

http://stackoverflow.com/comment/45882261
score: 1
comment on: http://stackoverflow.com/q/28804564
type: Comment
has text: look at this http://stackoverflow.com/questions/595228/how-can-i-delete-all-cookies-with-javascript?rq=1
type: QuestionComment

http://stackoverflow.com/q/28855505
upvote count: 3
has comment: http://stackoverflow.com/comment/45977384
type: Question
tagged with: arrays
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28855762
has answer: http://stackoverflow.com/a/43093026
answer count: 2
has title: Nested _.max() with lodash
downvote count: 0
has comment: http://stackoverflow.com/comment/45977093
favorite count: 0
possible better answer: http://stackoverflow.com/a/43093026
has body: I am trying to get max and min values of arrays values inside objects array which looks like this: [ { id: 1, enabled: false, layer: 'Mood', color: '#f16c63', points: [ {date: '2013-01-02', value: 20}, {date: '2013-02-02', value: 15}, {date: '2013-03-12', value: 24}, {date: '2013-03-23', value: 18}, {date: '2013-03-24', value: 22}, {date: '2013-04-09', value: 12}, {date: '2013-06-13', value: 16}, {date: '2013-06-14', value: 20}, ] }, { id: 2, enabled: true, layer: 'Performance', color: '#698bfc', points: [ {date: '2013-01-02', value: 15}, {date: '2013-02-02', value: 24}, {date: '2013-03-12', value: 29}, {date: '2013-03-23', value: 21}, {date: '2013-03-24', value: 20}, {date: '2013-04-09', value: 17}, {date: '2013-06-13', value: 25}, {date: '2013-06-14', value: 21}, ] }, { id: 3, enabled: false, layer: 'Fatigue', color: '#e1fc6a', points: [ {date: '2013-01-02', value: 32}, {date: '2013-02-02', value: 27}, {date: '2013-03-12', value: 30}, {date: '2013-03-23', value: 31}, {date: '2013-03-24', value: 27}, {date: '2013-04-09', value: 15}, {date: '2013-06-13', value: 20}, {date: '2013-06-14', value: 18}, ] }, { id: 4, enabled: true, layer: 'Hunger', color: '#63adf1', points: [ {date: '2013-01-02', value: 12}, {date: '2013-02-02', value: 15}, {date: '2013-03-12', value: 13}, {date: '2013-03-23', value: 17}, {date: '2013-03-24', value: 10}, {date: '2013-04-09', value: 14}, {date: '2013-06-13', value: 12}, {date: '2013-06-14', value: 11}, ] }, ] I need to get the max and the min values from the points arrays. Seems like I can do something like this for max and similar for min values: var maxDate = _.max(dataset, function (area) { return _.max(area.points, function (point) { console.log(new Date(point.date).getTime()) return new Date(point.date).getTime() }) }); But for some reason this returns me -Infinity. Is it legit at all to use nested _.max() runs? I used this approach with D3.js library which worked just fine. Please advise.
tagged with: lodash
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/28855762

http://stackoverflow.com/comment/45808538
type: QuestionComment
score: 0
has text: $("#body").css(backgroundPosition, '-250px 50px');
comment on: http://stackoverflow.com/q/28764605
type: Comment

http://stackoverflow.com/comment/45962717
has text: thankyou for the quick reply ,but how do i handle duplicate id's , if i occur duplicate id's i want to do a summation and enter only one entry for that id
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28835451
type: Comment

http://stackoverflow.com/comment/45986383
type: Comment
type: QuestionComment
has text: @Mars no difference. When I press 'save' I also output to JSON. When I press restore all my nodes freeze, I can't drag them any more. I am reading an article on JS variable scoping to see if the problem might lie there. My code isn’t long, only 150 lines.
comment on: http://stackoverflow.com/q/28836275
score: 0

http://stackoverflow.com/comment/46361334
type: AnswerComment
score: 0
has text: `send e.toString() and e.stack` - how to do this? There is no e variable in answer
type: Comment
comment on: http://stackoverflow.com/a/29055405

http://stackoverflow.com/comment/46046271
comment on: http://stackoverflow.com/q/28892865
score: 0
type: Comment
type: QuestionComment
has text: https://developer.github.com/v3/repos/

http://stackoverflow.com/comment/45851508
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28752842
type: AnswerComment
has text: Your Promise/A comment isn't correct. Promise/A only describes the `.then()` behavior which is in ES6. Oddly, Promises/A never described how one creates a promise.

http://stackoverflow.com/comment/45810829
comment on: http://stackoverflow.com/q/28765671
type: Comment
type: QuestionComment
has text: check out the performance of the two methods: http://jsperf.com/closure-vs-bind-9000
score: 0

http://stackoverflow.com/comment/46057688
type: AnswerComment
type: Comment
has text: @Wordpress-Man Okay, so i edited my answers a bit. Try them now :)
comment on: http://stackoverflow.com/a/28844021
score: 0

http://stackoverflow.com/comment/45793155
has text: Works fine for me: http://jsfiddle.net/barmar/0s47u9r4/
score: 1
comment on: http://stackoverflow.com/q/28755910
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28761248
answers question: http://stackoverflow.com/q/28761083
type: Answer
has body: You must include your JS file on the page your &lt;input&gt; is on like &lt;script type="text/javascript" src="path/to/your/file.js"&gt;&lt;/script&gt; Edit: What probably happens is that you include your JS file after the &lt;input&gt; is loaded in the DOM. This way HTML tries to access your function before it's even there. Try to put your &lt;script&gt; in the &lt;head&gt; of your HTML and make sure it isn't in a .ready() function or something similar to it. Source of above: Uncaught ReferenceError: myFunction is not defined
score: 1
has comment: http://stackoverflow.com/comment/45802800
upvote count: 2
has comment: http://stackoverflow.com/comment/45802754
has comment: http://stackoverflow.com/comment/45803057
type: AcceptedAnswer
downvote count: 1
accepted answer of: http://stackoverflow.com/q/28761083

http://stackoverflow.com/comment/46262915
comment on: http://stackoverflow.com/a/28850605
type: AnswerComment
has text: John, I have updated the code. Previous version didn't have the getDirectory function which selects the folder in device
score: 0
type: Comment

http://stackoverflow.com/q/28843449
has answer: http://stackoverflow.com/a/28843847
has comment: http://stackoverflow.com/comment/45955975
has comment: http://stackoverflow.com/comment/45956145
answer count: 2
possible better answer: http://stackoverflow.com/a/28843712
has answer: http://stackoverflow.com/a/28843712
has comment: http://stackoverflow.com/comment/45955887
tagged with: prototypal-inheritance
score: 0
accepted answer: http://stackoverflow.com/a/28843847
has comment: http://stackoverflow.com/comment/45956333
has title: javascript chainable nested subclass
has comment: http://stackoverflow.com/comment/45955946
has comment: http://stackoverflow.com/comment/45956049
tagged with: javascript
tagged with: prototype
has body: I'm effectively trying to build a chainable object that contains sub objects or other functions. It should be used like this: val().rules.phone("someValue"); So far: var val = function(){ var validator = function(){ this.fields = []; return this; } validator.prototype = { addField: function(fieldName){ this.fields.push(fieldName); return this; }, rules: { phone: function(){ //RETURNING THIS DOES NOT RETURN THE PARENT SCOPE //IT RETURNS SCOPE OF PHONE FUNCTION return this; } } } return new validator(); } I also tried a circular reference via prototype chaining: var val = function(){ var validator = function(){ this.fields = []; return this; } var rules = function(){ validator.call(this); } rules.prototype = Object.create(validator.prototype); rules.prototype.constructor = rules; rules.prototype.phone = function(){ console.log('hone'); } validator.prototype = { addField: function(fieldName){ this.fields.push(fieldName); return this; }, rules: new rules() } return new validator(); } var z = val().rules; //no 'addFields' function exists on the validator object in the chain. console.log(z); Problems: In the first val().rules.phone() returns the scope of its function rather then the parent scope. It should return the validator scope. In the second example, val().rules DOES have validator as parent on its prototype chain, however addFields prints undefined, and does not exist in console when tracing the chain. I know I am over complicating the issue by adding the rules literal. I could just implement chaining with functions directly placed on the prototype object. This is for my own clarification. Is there any other possible way to implement this with the same style usage?
type: Question
type: AnsweredQuestion

http://stackoverflow.com/comment/45924441
has text: Yes, that was it, so is there a way to get a newly typed date to stick after page reload? Because, right now, it will always revert to the default...
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28826988
type: Comment

http://stackoverflow.com/a/28772103
score: 1
answers question: http://stackoverflow.com/q/28771981
upvote count: 1
has body: Set your img src strings in a JavaScript array and get a random element from the array on page load. Assuming they are all the same width. var image = images[Math.floor(Math.random()*images.length)];
type: Answer
downvote count: 0

http://stackoverflow.com/q/28835535
tagged with: jquery-ui
has answer: http://stackoverflow.com/a/28835682
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has body: I am trying to display the selected value from a dropdown menu using jquery. The options in the jquery are loaded dynamically. for(i=0;i&lt;data.length;i++){ $('.daysofWeek').append('&lt;option&gt;' + data[i].days +'&lt;/option'); } Now Im trying to display the options selected using the following code. $('.daysofWeek').on("change" ,function() { var daySelected= $('.daysofWeek').children("option:selected").text(); alert(daySelected); }); The problem is that the display returns the first value in the dropdown along with the value selected. For example, if the selected value were Monday it is returning SundayMonday. Please advice.
accepted answer: http://stackoverflow.com/a/28835682
type: AnsweredQuestion
has title: How to display the selected value from the dropdown menu using JQuery?
type: Question

http://stackoverflow.com/q/28833809
has answer: http://stackoverflow.com/a/28833954
type: Question
type: AnsweredQuestion
tagged with: javascript
has comment: http://stackoverflow.com/comment/45937397
score: 2
accepted answer: http://stackoverflow.com/a/28833954
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45937299
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45937564
has body: http://jsfiddle.net/55Lht7hu/ I am trying to add a attribute (dynamically created) to a div. But it is not working here. var style3=createElement('style'); style3.type="text/css"; var target3=document.getElementById('target3'); target3.addEventListener('click',function(){ style3.innerHTML='.target4{background-color:#444;}'; document.getElementsByTagName('head')[0].appendChild(style3); target3.setAttribute('class','target4'); }); Also, is it possible to set pseudo elements dynamically to that div?.
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45937321
linked to: http://stackoverflow.com/q/524696
has title: set attribute for dynamically created class not working in javascript
has comment: http://stackoverflow.com/comment/45937523
upvote count: 2

http://stackoverflow.com/comment/46027385
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28883119
has text: http://stackoverflow.com/questions/8584902/get-closet-number-out-of-array
type: Comment

http://stackoverflow.com/comment/45933202
comment on: http://stackoverflow.com/q/28831753
has text: What kind of random character is it?
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/46025119
comment on: http://stackoverflow.com/q/28880643
has text: Check my answer again, I've improved it, this time it should be pretty clear what you need to do with your code :)
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/46040943
comment on: http://stackoverflow.com/q/28887234
has text: Well, actually it's not. In my understanding of course. I want to translate this DOM's tree alike stuff into an object. And use it like a regular object. I don't want to use operations on DOM. It's meaningless in Angular.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/28984484
has comment: http://stackoverflow.com/comment/46229617
answers question: http://stackoverflow.com/q/28901068
downvote count: 0
has body: Good news is, you do are sending your headers to the server. Bad news is, that with DOC-proper code like this: client.connect(headers, connectCallback, errorCallback); I received: 11 Mar 11:34:07 - server is connected to 127.0.0.1:8080 11 Mar 11:34:07 - { command: 'CONNECT', header: { login: '[object Object]', passcode: 'undefined', 'accept-version': '1.1,1.0', 'heart-beat': '10000,10000' }, body: '' } what clearly suggests, that stompjs is sending headers object in login field. Anyway with your piece of code i can see a proper frame: { command: 'CONNECT', header: { login: 'mylogin', passcode: 'mypasscode', 'accept-version': '1.1,1.0', 'heart-beat': '10000,10000' }, body: '' } So probably - I guess - having a good code, you are watching at wrong (parts of) packages in your wireshark. Some clues may be in here. What I have used for tests is here.
score: 4
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46230177
type: Answer
accepted answer of: http://stackoverflow.com/q/28901068
upvote count: 4

http://stackoverflow.com/comment/46024779
has text: like magic.... now to read up on Deferred objects. Do you find you use them a lot? New to me
type: Comment
comment on: http://stackoverflow.com/a/28881626
score: 0
type: AnswerComment

http://stackoverflow.com/q/28778492
has comment: http://stackoverflow.com/comment/45887497
score: 0
has title: Handle r.js error while spawning process in node.js
tagged with: node.js
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45842450
tagged with: r.js
type: Question
tagged with: javascript
has body: I've been trying to spawn a new child process running require.js optimizer r.js using the below code var fs = require('fs'); var spawn = require('child_process').spawn; var prc = spawn('node', ['r.js', '-o', 'build.js']); prc.on('close', function(exitCode, signal) { if (exitCode) { console.log("something bad happened"); } console.log("Exit Code is::-" + exitCode); }); prc.on('exit', function(exitCode, signal) { if (exitCode) { console.log("something bad happened"); } console.log("Child Process Exit with code::-" + exitCode); }); prc.on('error', function(exitCode, signal) { if (exitCode) { console.log("something bad happened"); } console.log("Error Occurred"); }); prc.on('uncaughtException', function(err) { console.log('Caught exception during build: ' + err); }); prc.stdout.on("data", function(data) { console.log( "stdout::-" + data ); }); prc.stderr.on("data", function(data) { console.log( "stderr::-" + data ); }); process.on("exit", function() { console.log("main Process is killed"); console.log("Main process ID is::-" + this.pid); }); process.on('uncaughtException', function(err) { console.log('Caught exception in parent process: ' + err); }); The child process spawned using above snippet always exit with exit code 0 even if r.js encounters some error. Running the same command node r.js -o build.js from console gives the exit code 1 when r.js encounters some error which helps to identify that the command was unsuccessful 1. How to detect the child process does not run successfully ? 2. If child process does not run successfully, how to kill parent process ?

http://stackoverflow.com/comment/46003211
has text: I believe you do not need to *hide*. Just start your list with the current hour.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28869591
score: 0

http://stackoverflow.com/a/28771507
has body: If you have some sort of server-side language you can build a filter in (.NET, Rails, Java or whatever), and pass along a version number with your template requests. If the version requested by the client is older than what's deployed, you'd send an error to the client. Your client would watch for that error ($http interceptor) and force a page-refresh to pull down the newer javascript code. (Maybe show an alert to the user first so they know what's going on).
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28768720

http://stackoverflow.com/comment/46138954
score: 0
comment on: http://stackoverflow.com/q/28826071
type: Comment
type: QuestionComment
has text: the issue here was multiple instances of jquery messing with each other. I was able to fix this by encapsulating the datatables scripts with jQuery.noConflict(); (function( $ ) { .... }

http://stackoverflow.com/comment/45831687
comment on: http://stackoverflow.com/a/28774435
type: AnswerComment
has text: @ntonnelier it seems i missed your first comment. My first code will give only the checked values. It won't submit all the values to the backend..
score: 0
type: Comment

http://stackoverflow.com/comment/46042077
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28887157
has text: Yes, keep the question that has been answered here, delete the other one and ask it as a separate question.
score: 0

http://stackoverflow.com/q/28792899
type: Question
type: AnsweredQuestion
tagged with: 16-bit
upvote count: 5
possible better answer: http://stackoverflow.com/a/28793017
accepted answer: http://stackoverflow.com/a/28792998
has answer: http://stackoverflow.com/a/28793017
has comment: http://stackoverflow.com/comment/45860701
score: 5
answer count: 3
has title: Masking a 16-bit value with 0xFFFF
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45860685
tagged with: bit
tagged with: masking
has answer: http://stackoverflow.com/a/28792998
has answer: http://stackoverflow.com/a/28793036
has body: I am following a guide on Gameboy emulation and, in a snippet of code I saw the following: while(true) { var op = MMU.rb(Z80._r.pc++); // Fetch instruction Z80._map[op](); // Dispatch Z80._r.pc &amp;= 65535; // Mask PC to 16 bits Z80._clock.m += Z80._r.m; // Add time to CPU clock Z80._clock.t += Z80._r.t; } Where pc is a 16-bit program counter register and 65535 in hexadecimal is 0xFFFF , what is the purpose of masking a 16-bit value with 0xFFFF? As far as I know this does nothing? Or is it something to do with the sign bit?

http://stackoverflow.com/comment/45851611
score: 0
type: Comment
type: QuestionComment
has text: That is invalid code. I'm amazed it works, ` ` is table format. Inside the all of those tags except ` `, ` ` can have ` ` and ` ` Elements. ` ` just needs its `src` attribute set. If that code is dynamic there is no need for an `iframe`. Of course, you will have to get rid of the unnecessary ` ` and ` ` tags.
comment on: http://stackoverflow.com/q/28787791

http://stackoverflow.com/comment/45878332
has text: I love the Internet Exploder XD and would accept this answer because of humor XD
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28802333
type: Comment

http://stackoverflow.com/q/28780288
has comment: http://stackoverflow.com/comment/45838765
has answer: http://stackoverflow.com/a/28780937
favorite count: 0
has answer: http://stackoverflow.com/a/28781168
tagged with: angularjs
type: UnansweredQuestion
has title: ng-repeat not working but can get item of $scope.items on th page
upvote count: 1
has body: I write a web apps use angular.js and require.js. But ng-repeat doesn't work! Chroem just show comments when using developer tools. HTML Code: {{item}} {{title}} 参考: jenkov.com {{items[0].title}} JS Code: app.controller('HomeCtrl', function ($scope) { // 文章目录 $scope.index = 0; $scope.title = '开始学习SVG'; $scope.items = [ { 'title': '开始学习SVG', 'hash': 'home' }, { 'title': 'svg与g标签', 'hash': 'svg-el-and-g' } ]; $scope.MAX = $scope.items.length; $('.bt-menu-trigger').toggle(function(){ $(this).parent().addClass('bt-menu-open'); $('.over-layout').addClass('active'); },function(){ $(this).parent().removeClass('bt-menu-open'); $('.over-layout').removeClass('active'); }); $scope.select = function($e,item){ $scope.title = $scope.list[item].title; } }); chrome shows: Thanks!!
has comment: http://stackoverflow.com/comment/45839017
score: 1
type: Question
has comment: http://stackoverflow.com/comment/45838726
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28781013
answer count: 3

http://stackoverflow.com/comment/45956557
type: AnswerComment
has text: no, you just need create your regular expression smarter
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28843307

http://stackoverflow.com/a/28817183
accepted answer of: http://stackoverflow.com/q/28816147
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/45913570
has comment: http://stackoverflow.com/comment/45923171
has comment: http://stackoverflow.com/comment/45951765
score: 1
has comment: http://stackoverflow.com/comment/45914537
has comment: http://stackoverflow.com/comment/45951028
has comment: http://stackoverflow.com/comment/45908452
has comment: http://stackoverflow.com/comment/45908606
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45906670
has comment: http://stackoverflow.com/comment/45906867
downvote count: 0
has body: So, I think you might be overthinking this a little. Why not use existing packages for these libraries? Aside from being significantly easier to use, some of that 3rd party code would get minified into the main app js file instead of making additional HTTP requests to download them. For example, dburles:google-maps gets you the Google Maps API and extra libs of your choice (with the option to only load on specific routes) and jeremy:geocomplete gets you Geocomplete (which automatically installs that maps package as a dependency). See the jeremy:geocomplete README for implementation. As for Fancy Input, why not create a simple Meteor package wrapper for that so you can just meteor add fancy-input? Also, your Template.landing.rendered callback should not be in an onBeforeAction. Ideally, it should be in its own file with other code for the landing template.
answers question: http://stackoverflow.com/q/28816147

http://stackoverflow.com/comment/46024026
comment on: http://stackoverflow.com/q/28881381
type: QuestionComment
has text: asked and answered n number of times.
type: Comment
score: 1

http://stackoverflow.com/comment/45958316
score: 0
type: AnswerComment
has text: i now got it working in chrome, by using jquery v1.3.2 + removing the other content slider. now i guess i have to find a slider that doesn't conflict and works with this jquery version
type: Comment
comment on: http://stackoverflow.com/a/28813462

http://stackoverflow.com/q/28865490
type: Question
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/45996225
has body: if ((location.search.indexOf('page=') < 0) || (location.search.indexOf('page=1') > 0) { if (($('select.sort-by option:selected').text() == "Most Popular") || ($('select.sort-by option:selected').text() == "Best Selling")) { $('li.collection-indv-product:first').css('border', '#ffc000 solid 10px'); $("li.collection-indv-product:first").find('div.collection-product').before(' Customer Favorite in {{collection.title}} '); } } I'm having issues with this. I want to add a border around the first item in the list on our category pages, but only on the first page, not the following pages. Am I doing this right? I can't get it to work and it seems like this would work.
has comment: http://stackoverflow.com/comment/45996636
type: UnansweredQuestion
has title: Adding a Class to first item in a list using javascript
has comment: http://stackoverflow.com/comment/45997638
has answer: http://stackoverflow.com/a/28866363

http://stackoverflow.com/a/33136303
score: 4
has body: I'm faced with this same question and I thought I would share my thoughts. I'm going with https://github.com/krispo/angular-nvd3. As of today, the most recent push on github was 15 days ago. The other choice hasn't been pushed for 8 months. In addition, angular-nvd3 has great examples and more documentation. As Vincent said, they both use nvd3 as the engine, so you'll probably get the same amount of performance. But for usability, I'll take recently updated and lots of examples.
answers question: http://stackoverflow.com/q/28766504
upvote count: 4
downvote count: 0
type: Answer

http://stackoverflow.com/comment/137125231
has text: Note: The npm package hasn't been updated since 2020
type: Comment
comment on: http://stackoverflow.com/a/45321378
score: 1
type: AnswerComment

http://stackoverflow.com/comment/45985860
type: QuestionComment
has text: @NiettheDarkAbsol Absol I've tried that and it still doesn't seem to work, I've changed it in the JS, PHP and HTML.
score: 0
comment on: http://stackoverflow.com/q/28859900
type: Comment

http://stackoverflow.com/comment/45944066
comment on: http://stackoverflow.com/a/28837223
score: 0
type: AnswerComment
has text: That seems fine. Only [one minor obstacle](https://stackoverflow.com/questions/20279484/how-to-access-the-correct-this-context-inside-a-callback): You should use `selects.change( this.updatePreview.bind(this) )` in case you're going to the `this` keyword (e.g. for a method call) inside the `updatePreview` method.
type: Comment

http://stackoverflow.com/comment/45852095
score: 0
type: Comment
has text: What a terrible mess. Why is the indentation _all over the place_? What is `$.get()` supposed to do? Why do you have a commented-out line? Where is the explanation of your proposed solution? It truly baffles me that this nonsense has an upvote.
comment on: http://stackoverflow.com/a/28788101
type: AnswerComment

http://stackoverflow.com/a/28843446
type: Answer
upvote count: 2
has body: Use window.location to manually redirect in the browser rather than use a server redirect.
score: 2
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28842591
accepted answer of: http://stackoverflow.com/q/28842591

http://stackoverflow.com/comment/45880528
comment on: http://stackoverflow.com/a/28781109
score: 0
type: AnswerComment
has text: So my hint would be _not_ to use the document-wide styles at all. It should be considered a good practice in general. Whether you are stuck with 3rd party css or like, simply clear everything by ` ` inside your template.
type: Comment

http://stackoverflow.com/comment/46053485
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28880426
type: Comment
has text: can you give an idea how could it be ? Thanks

http://stackoverflow.com/a/28853232
score: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45973498
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/45973788
has comment: http://stackoverflow.com/comment/45973440
accepted answer of: http://stackoverflow.com/q/28852718
has comment: http://stackoverflow.com/comment/45973600
answers question: http://stackoverflow.com/q/28852718
has body: Edit: My bad, played around a bit with the findle and that module value is being observed, looks like the problem is here: self.handleSharedCheckboxClick = function (module) { if (self.isSharedModule(module)) { module.MenuId(null); } If the module is shared the value is already null so the value is not being changed, modifying that code adding a ! like this: self.handleSharedCheckboxClick = function (module) { if (!self.isSharedModule(module)) { module.MenuId(null); } make it work as you wanted, shared status saved between menu item value updates (click the checked checkbox and the line is no more shared but binded to the current menu item, click it again and it goes back to shared) jsfindle: http://jsfiddle.net/yj1s9qod/
has comment: http://stackoverflow.com/comment/45974233

http://stackoverflow.com/comment/45833512
has text: This solution is very static. I want something dynamic which can find any child node, may it be multiple levels down the tree. Something like the "find" function in jQuery.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28775773
type: Comment

http://stackoverflow.com/comment/45958880
type: Comment
has text: most elegant solution I must admit, however I accepted the above one, because it clarified what was wrong in my original post.. thanks, and no hard feelings ;)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28844964

http://stackoverflow.com/q/28830982
has body: This function is run every time an item is added to an array. It simply creates a list item element, appends some text to that item, and then appends it to a list element (#requestList). function UpdateListOnScreen(NewListItem){ var grabList = document.getElementById('requestList'); var text = ""+ GetCalendarName(NewListItem.calChoice) +" For "+ GetLessonSlot(NewListItem.lessonChoice) + " On " + GetDateInTextForm(NewListItem.date) + ""; var entry = document.createElement('li'); entry.id = list.length-1; entry.className = "ItemNotChecked"; entry.appendChild(document.createTextNode(text)); grabList.appendChild(entry); } Something I'm struggling to figure out is how do I add a button element onto that list item? I want every list item to have its own button element, but can't seem to figure out how I append a button to the list item after appending the text to the list item. Thanks.
answer count: 2
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
accepted answer: http://stackoverflow.com/a/28831176
favorite count: 0
has title: How do I append a button to a list item with JavaScript?
tagged with: append
type: AnsweredQuestion
score: 3
upvote count: 3
tagged with: dom
has answer: http://stackoverflow.com/a/28831176
type: Question
possible better answer: http://stackoverflow.com/a/28831063
has answer: http://stackoverflow.com/a/28831063
tagged with: javascript

http://stackoverflow.com/a/28767517
has body: dont use $scope.$apply(). $ionicPlatform is a angular module, no need of "apply" here. please debug with console.log if the ready function are really called on ionic ready.
downvote count: 1
upvote count: 0
score: -1
answers question: http://stackoverflow.com/q/28766447
type: Answer

http://stackoverflow.com/q/28805215
has title: Angular Route Controller Infinite Loop
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: ngroute
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
downvote count: 0
score: 1
tagged with: angularjs-ng-route
type: Question
tagged with: javascript
has body: First off, I am just a beginner at angularJS. I have these files App.js 'use strict'; var app = angular.module('testApp', [ 'ngRoute', 'ngCookies' ]) app.config(['$routeProvider', function($routeProvider) { $routeProvider .when('/login', { controller: 'LoginController', templateUrl: '../app/login/login.html', hideMenus: true }) .when('/main', { templateUrl: '../app/main/main.html', controller: 'MainController' }) .when('/sales', { controller: 'SalesController', templateUrl: '../sales/sales.html', hideMenus: true }) .otherwise({ redirectTo: '/login' }); } ]) .run(['$rootScope', '$location', '$cookieStore', '$http', function($rootScope, $location, $cookieStore, $http) { // keep user logged in after page refresh var checkStorage; if ($cookieStore.get('testToken') != null) { checkStorage = $cookieStore.get('testToken'); } else if (sessionStorage.testToken!= null) { checkStorage = $.parseJSON(sessionStorage.testToken); } $rootScope.globals = checkStorage || {} $rootScope.$on('$locationChangeStart', function(event, next, current) { // redirect to login page if not logged in if ($location.path() !== '/login' && !$rootScope.globals.username) { $location.path('/login'); } else if ($location.path() == '/login' && $rootScope.globals.username) { $location.path('/main'); } }); } ]); Index.html testApp login.html {{error}} Username is required Password is required Remember Me Login login.controller.js 'use strict'; angular.module('testApp') .controller('LoginController', ['$scope', '$rootScope', '$location', 'AuthenticationService', function($scope, $rootScope, $location, AuthenticationService) { // reset login status AuthenticationService.ClearCredentials(); $scope.login = function() { $scope.dataLoading = true; var rem = 0; if ($scope.remember) { var rem = 1 } AuthenticationService.Login($scope.username, $scope.password, rem, function(response) { if (response.success) { AuthenticationService.SetCredentials($scope.username, response.token, rem); $location.path('/main'); } else {…
has answer: http://stackoverflow.com/a/28805424

http://stackoverflow.com/a/28863413
has comment: http://stackoverflow.com/comment/45996810
has comment: http://stackoverflow.com/comment/46199655
has comment: http://stackoverflow.com/comment/46200758
downvote count: 0
has comment: http://stackoverflow.com/comment/45996672
has comment: http://stackoverflow.com/comment/46145241
has comment: http://stackoverflow.com/comment/46151473
has comment: http://stackoverflow.com/comment/46197942
upvote count: 2
answers question: http://stackoverflow.com/q/28863121
has body: You need to wire-up your code to DOM events. You'll want to change SN2 into a Function (instead of a Sub) which returns the computer name, and then call it in the window.load event (or do it all inline) VBScript has no inherent or intrinsic notion of events (technically neither does Javascript), so the platform designers decided to use a "magic" naming convention to handle events, it's clunky. It uses underscores in names to bind functions/subs to DOM object events, the same way how VB6 worked by binding Button1_Click to the Click event of Button1. There are other ways of binding event-handlers in IE VBScript, none of them pretty. This is documented here: https://msdn.microsoft.com/en-us/library/ms533023(v=vs.85).aspx Anyway, you'll want this: &lt;html&gt; &lt;head&gt; &lt;script language="VBScript"&gt; Option Explicit Sub Window_onload Dim computerNameStr, wmiService, biosRows, biosRow, serialNumber computerNameStr = "." Set wmiService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &amp; computerNameStr &amp; "\root\cimv2") Set biosRows = objWMIService.ExecQuery("SELECT * FROM Win32_BIOS") For Each biosRow in biosRows serialNumber = biosRow.SerialNumber If Len( serialNumber ) &gt; 0 Then window.computerName.value = serialNumber Exit For End If Next End Sub &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;input type="text" id="computerName" /&gt; &lt;/body&gt; &lt;/html&gt;
type: Answer
has comment: http://stackoverflow.com/comment/45996839
score: 2
has comment: http://stackoverflow.com/comment/46200491
has comment: http://stackoverflow.com/comment/46223925

http://stackoverflow.com/a/34595991
answers question: http://stackoverflow.com/q/28887962
type: Answer
has comment: http://stackoverflow.com/comment/57568901
has body: Here is another option: &lt;script&gt; $('#CountryID').change(function() { var value = $('#CountryID').val(); &lt;script&gt; Just make sure you give your dropdown name= or id=
score: 0

http://stackoverflow.com/q/28869121
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28869212
score: 0
tagged with: angularjs
type: UnansweredQuestion
tagged with: node.js
has title: Multiple part form - update database each submission
has comment: http://stackoverflow.com/comment/46018431
has body: I'm sure this isn't the hardest issue to overcome, but I have a lack of understanding on how to handle this particular situation. Learning MongoDB, Express, Angular, Node to create a web application for learning purposes. I have a 2 stage submission form. Step 1: Pet info is collected. text based input (pet name, pet description... ). Submission of this info goes through my client side controller. Processed and saved to mongo as a new entry. Step 2: Using ng-show/ng-hide, the first form is hidden and a second input form is shown for submitting an image. Step 2 upload doesn't use a client side controller. Instead I make a direct method=post call to my express route. Multer module is called as middleware to upload my picture to a server side directory and generate JSON image info. All I want to do is follow up with an update to mongoDB to insert the multer image_path into my previous mongodb collection, so that I can later render the image directly from the upload folder. My issue is that I can't figure out how to pass the "_id" of the first steps submission to the 2nd step, so that I can perform the update. How does one go about passing data that I have in my client side controller to my server side controller. Can I use my view or do I need to call another express route to pass the data? My project resides at https://github.com/astemborskim/anidopt.git Currently working out of the temp branch. Also posting the view, client side and server side controllers in the following gist. https://gist.github.com/astemborskim/edc5d4a80dfe6e154c99
type: Question
tagged with: client-server

http://stackoverflow.com/q/28756304
score: 0
accepted answer: http://stackoverflow.com/a/28757961
tagged with: ruby-on-rails
answer count: 1
has title: AJAX not loading without page refresh in Rails app
type: AnsweredQuestion
has body: I added an AJAX script to my Rails app so that my form would automatically add a car object to the car feed. Behind the scenes the car is posting to the feed like it should. However, nothing happens on the webpage until I refresh and then the new car pops up. How can I make this happen without a page refresh? The AJAX script create.js.rb $('#car_feed').replace("<%= escape_javascript(render 'shared/feed') %>"); $('#new_car').replace("<%= escape_javascript(render 'shared/car_form') %>"); $('#car_errors').html("<%= escape_javascript(render 'shared/error_messages', object: @car) %>"); Here's the form: _car_form.html.erb <%= form_for(@car, html: {multipart: true, remote: true}) do |f| %> <%= render 'shared/error_messages', object: f.object %> Add Your Car <%= f.text_area :year, placeholder: "Year i.e. '1993" %> <%= f.text_area :brand, placeholder: "Brand i.e. 'Ford'"%> <%= f.text_area :model, placeholder: "Model i.e. 'Mustang'" %> <%= f.text_area :vin, placeholder: "17 digit VIN number" %> <%= f.text_area :mileage, placeholder: "Current Car Mileage" %> Add a Photo <%= f.file_field :picture, accept: 'image/jpeg,image/gif,image/png' %> <%= f.submit "Add Car", class: "btn btn-add btn-primary" %> <% end %> Hide Form and the feed that should be added to through AJAX: _feed.html.erb <% if @feed_items.any? %> <%= render @feed_items %> <% else %> You haven't added any cars yet. Add one in the sidebar! <% end %> Everything looks good in the rails logs: Started POST "/login" for 128.252.110.217 at 2015-02-27 01:16:38 +0000 Processing by SessionsController#create as HTML Parameters: {"utf8"=>"✓", "authenticity_token"=>"gFDS0iSBZl38m/LMPXulLCxvNgsjMQWMA3P/K+VEVzzTvQfTShKud3UaCRRlz6jL4JFtnwFiA6jukBfxZ7WpIw==", "session"=>{"email"=>"andrew@example.com", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Log in"} User Load (1.0ms) SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 "email", "andrew@example.com" (0.2ms) begin transaction (0.1ms) commit transaction…
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28757961
tagged with: ajax
type: Question
tagged with: ruby

http://stackoverflow.com/a/29010866
type: Answer
score: 0
has body: I don't think it's an issue with Flexslider that's causing this. As far as I can tell, it is caused by the wallpaper swatch displaying at 100% width before the amazing carousel plugin kicks in and wraps the image to a smaller width. Try adding this to your stylesheet .amazingcarousel-item { float: left; width: 150px; } This will give the carousel item a width by default, which in turn causes the image inside it to be a smaller width.
has comment: http://stackoverflow.com/comment/46310553
answers question: http://stackoverflow.com/q/28881986

http://stackoverflow.com/comment/45803040
comment on: http://stackoverflow.com/a/28761645
score: 0
has text: Maybe you can make example or something?
type: Comment
type: AnswerComment

http://stackoverflow.com/q/28842270
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45954009
tagged with: css
has answer: http://stackoverflow.com/a/28842738
score: 1
has comment: http://stackoverflow.com/comment/45953809
has answer: http://stackoverflow.com/a/28842412
upvote count: 1
type: Question
has body: I have a simple ul/li navigation menu in my wordpress site. It looks good on Chrome, Firefox but when website opened in Internet Explorer, it behaves strangely and pushes the "Blog" menu item on next line where as it's fine and on same line on other browsers. Link: http://construction.windoverdevelopment.xyz/construction/ I understand that this is not an upto mark question but please support with this issue - I haven't been able to resolve it. Thanks in advance Screenshot 1: (in Chrome - whole menu in same line) Screenshot 2: (in IE - BLOG is moved on next line) The css for navigation is: .main-navigation { background: rgba(0, 70, 127, 0.95); margin: 0; padding: 0; -webkit-box-shadow: 0 17px 14px -8px rgba(0, 0, 0, 0.75); -moz-box-shadow: 0 17px 14px -8px rgba(0, 0, 0, 0.75); box-shadow: 0 17px 14px -8px rgba(0, 0, 0, 0.75); /* border-top: 2px solid #fff; border-bottom: 2px solid #fff; */ } .main-navigation li { margin: 0; padding: 5px 0; font-size: 16px; } .main-navigation li:last-child { position: absolute; top: 95px; right: 30px; background-color: rgba(255, 255, 255, 0.75); } #menu-main-menu&gt;li.menu-item:last-child&gt;a { color: #00447C; font-family:"Open Sans", Helvetica, Arial, sans-serif; font-weight: bold; font-size: 14px; text-transform: none; padding-top: 10px; } .main-navigation li ul li { padding: 0; } .main-navigation li ul li:last-child { position: relative; top: 0; right: 0; background-color: transparent; } .main-navigation li &gt; a { display: block; padding: 0 35px; }
tagged with: javascript
answer count: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/45953653
favorite count: 0
has comment: http://stackoverflow.com/comment/45953897
has title: Strange behavior - menu item moving to next line in Internet Explorer, good on other browsers
has comment: http://stackoverflow.com/comment/45953953
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28842461

http://stackoverflow.com/comment/46028780
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28881986
has text: @dowomenfart didn't work, it's still acting the same

http://stackoverflow.com/a/28832452
has body: Better to create that elelemnt using jQuery in that case: var element = $( '&lt;li&gt;&lt;a href="#"&gt;' + obj.name + '&lt;br&gt;&lt;/a&gt;&lt;/li&gt;' ); element.click(function(){ showDetails(obj); }); $('#list-canvas .elementList').append(element);
downvote count: 0
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28832417
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28832417
type: Answer
score: 2

game-development
tags question: http://stackoverflow.com/q/28788052
type: Tag
tag name: game-development

http://stackoverflow.com/q/28753071
type: Question
has answer: http://stackoverflow.com/a/28760280
accepted answer: http://stackoverflow.com/a/28760280
tagged with: javascript
tagged with: ionic-framework
score: 0
answer count: 1
tagged with: android
has body: Sorry if my english isn't perfect at all. I am using $ionicPlatform.onHardwareBackButton to use with the Screen Orientation Plugin to change the orientation to portrait when you go back from a view when is playing a Youtube video, here is an example of what i am doing: app.controller('nameCtrl', ['$ionicPlatform', function('$ionicPlatform') { $scope.openVideo = function(id) { var isVideoPlaying = true; // some stuff here if(isVideoPlaying) { $ionicPlatform.onHardwareBackButton(function() { screen.lockOrientation('portrait'); isVideoPlaying = false; alert('going back'); }); } // in this line i get an error "TypeError: object is not a function" from GapDebug } }]); onHardwareBackButton detection works perfect, but when i am not playing a video the callback function is called too. Don't know why is not working with the boolean part. Any help? Sorry if is an stupid question. I tried using semicolon in the line of the error based on GapDebug but nothing. Thanks in advance
has title: How to stop callback function for onHardwareBackButton? Ionic
type: AnsweredQuestion
tagged with: cordova

http://stackoverflow.com/comment/45892521
type: Comment
has text: Glad I could help :) Well, I sure would appreciate if you'd accept and upvote my answer :)
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28807119

http://stackoverflow.com/q/28751234
tagged with: javascript
type: Question
has title: sessionStorage won't work
score: 0
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/28751348
tagged with: http://stackoverflow.com/tag/html
has body: Ok so i have this input "textmoney" that takes the users input and shows how much money they can make a year. When the user presses enter a link will pop up that goes to another page that gives a more precise estimate of the first answer. I want to have the second page to have a sessionStorage of "textmoney" from the first page, so that the user will not have to type in the data again. I coded this and i just can't seem to work at all. What did i do wrong? First page: Second page: How many days a week do you work? What percent of taxes does the Government take? What's your average yearly bonus? Calculate Back to calculator
type: UnansweredQuestion
tagged with: session

http://stackoverflow.com/comment/45983502
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28858090
score: 2
has text: do it the same way you do trigger in jqyery... element.trigger('click')

http://stackoverflow.com/comment/45966806
type: AnswerComment
has text: How do you set model? Can you share some code maybe here: http://plnkr.co/edit/0RNYkctZCu9n4PpekFVf?p=preview
type: Comment
comment on: http://stackoverflow.com/a/28849226
score: 1

http://stackoverflow.com/q/28776548
has comment: http://stackoverflow.com/comment/45831554
type: Question
accepted answer: http://stackoverflow.com/a/28777280
linked to: http://stackoverflow.com/q/18204473
has title: Single page, scrolling site with fixed dynamic footer
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/45831607
linked to: http://stackoverflow.com/q/16781742
has body: I am trying to create a single page, scrolling site with an array of images and corresponding captions. I would like to fix the captions to the bottom of the page. I imagine the solution will involve assigning an id to each image that will trigger a hide/show event when it comes within a certain distance from the top of the window. In this example, each caption is written within the table that houses the image it corresponds too. I am using tables to display the images because I have not found a suitable way to responsively center the images vertically and horizontally on the page; this is a separate issue I am working on. Here is the relevant code: Cover for a book of photographs UpDown Title and double-page spread for a book of photographs UpDown ...
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28777280

http://stackoverflow.com/q/28841162
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
type: UnansweredQuestion
tagged with: css
has comment: http://stackoverflow.com/comment/46014713
has comment: http://stackoverflow.com/comment/45986365
has comment: http://stackoverflow.com/comment/46153148
type: Question
upvote count: 4
has body: I have a large set of Highcharts graphics that all use the exporting.js library for downloading in various formats. I would like to customize the context button on these charts to match the native styles of the application. Although I have found several examples of how to achieve this within the confines of the Highcharts chart-level script (i.e. THIS EXAMPLE ) it seems rather repetitive to implement these styles in every chart knowing that I have a large set to be affected. I realize this could potentially be achieved using a global theme in Highcharts, however I am still limited by the configuration options of the library itself. For instance this would be the suggested path: var chartingOptions = { exporting: { buttons: { 'myButton': { id: 'myButton', symbol: 'circle', x: -62, symbolFill: '#B5C9DF', hoverSymbolFill: '#779ABF' } } } But unfortunately it does not provide a lot of expressivity. Am I able to define a css style and pass it to the global theme or chart set using its ID or CLASS somehow?
tagged with: highcharts
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
score: 4
has answer: http://stackoverflow.com/a/46053407
has comment: http://stackoverflow.com/comment/45952429
has title: Highcharts applying custom style to context button using css class
has comment: http://stackoverflow.com/comment/45975591

http://stackoverflow.com/q/28869148
downvote count: 0
has answer: http://stackoverflow.com/a/28869373
accepted answer: http://stackoverflow.com/a/28869373
upvote count: 8
type: Question
tagged with: javascript
has title: knex.js db call does not complete
answer count: 1
favorite count: 0
score: 8
has body: I am learning node.js and came across knex.js and bookshelf.js to interface with different databases. I am trying to run a simple knex program but somehow the program doesnt quit. Below is the program: 'use strict'; console.log('Getting knex'); var knex = require('./knex')({ client: 'mysql', connection: { host: '127.0.0.1', user: 'shankhoneer', password: 'password', database: 'knex_test' } }); debugger; console.log('got knex'); knex.schema.createTable('users', function(table) { console.log('creating tables'); table.increments('id'); table.string('user_name'); }).then (function(msg){ console.log('Completed creation'); console.log(msg); return {inserted: true}; }); I tried to debug and found that knex uses bluebird promises. Is my problem due to incomplete exit from a promise? Thanks
tagged with: knex.js
tagged with: node.js
type: AnsweredQuestion

http://stackoverflow.com/a/28779105
has comment: http://stackoverflow.com/comment/45835607
has comment: http://stackoverflow.com/comment/45835756
score: 0
has body: In javascript, this how you can strip a file's basename from a path. &lt;script type="text/javascript"&gt; function getFilename(string,include_extension){ // Looks for a forwardslash followed by a valid filename followed by a dot and then a valid file extention var matches = string.match(/\/\w+\.[a-z]{3,4}/) if( matches.length ){ // Strips off starting slash and file extension var my_filename_without_extention = matches[0].replace(/(^\/|\.\w+$)/g,'') // Strips off starting slash only var my_filename_with_extention = matches[0].replace(/^\//g,'') }else{ return false } if(include_extension) return my_filename_with_extention; return my_filename_without_extention } alert( getFilename(window.location.href,true) ) &lt;/script&gt;
answers question: http://stackoverflow.com/q/28778679
type: Answer
has comment: http://stackoverflow.com/comment/45835851
has comment: http://stackoverflow.com/comment/45835818

web-services
type: Tag
tags question: http://stackoverflow.com/q/28900136
tags question: http://stackoverflow.com/q/28832610
tags question: http://stackoverflow.com/q/28811684
tags question: http://stackoverflow.com/q/28862201
tag name: web-services
tags question: http://stackoverflow.com/q/28782581

http://stackoverflow.com/q/28753129
has comment: http://stackoverflow.com/comment/45788150
tagged with: arrays
has comment: http://stackoverflow.com/comment/45788172
has answer: http://stackoverflow.com/a/28753213
tagged with: javascript
answer count: 3
has body: I want to split my multidimensional array into objects. I have made a array: var arrayFirstLast = [ [58.94142647682763][23.5423357], [59.94142647682765][24.5423357], ]; I know only how do deal with array like: var arrayFirstLast=[58.94142647682763],[23.5423357]; and I want: var arrayLongLat= [ { "long":58.94142647682763, "lat":23.5423357 }, { "long":59.94142647682763, "lat":24.5423357 } ];
has title: Multidimensional Array splitting into objects javascript
possible better answer: http://stackoverflow.com/a/28753401
has answer: http://stackoverflow.com/a/28753401
accepted answer: http://stackoverflow.com/a/28753213
score: 0
has answer: http://stackoverflow.com/a/28753215
tagged with: dictionary
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/46441969
type: Comment
comment on: http://stackoverflow.com/q/28877793
has text: What's the reason for keeping data in an object — and then using `with` to allow access to it via variables — instead of just using variables in the first place?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45857274
type: Comment
score: 0
type: AnswerComment
has text: As in edit and mentioned by @Jenish. Looks like would be "global_attachment_vshare" does not exist on your page, so it fails to set the html against it
comment on: http://stackoverflow.com/a/28791032

http://stackoverflow.com/q/28813835
has comment: http://stackoverflow.com/comment/45903982
tagged with: javascript
tagged with: inheritance
tagged with: prototype
has comment: http://stackoverflow.com/comment/45901050
upvote count: 1
answer count: 1
has body: var Main = function(){}; Main.prototype = { 'times' : 0, 'request': function(){}, ... }; var SubA = function(){}; SubA.prototype = new Main() // same with Object.create(Main.prototype); SubA.prototype.constructor = SubA; var SubB = function(){}; SubB.prototype = new Main() // same with Object.create(Main.prototype); SubB.prototype.constructor = SubB; Now: var sub_a = new SubA(); sub_a.times = 1; var sub_b = new SubB(); // Here sub_b.times is already 1, how? When I change the properties of sub classes, properties of Main are also changing, shouldn't it stay at 0?
favorite count: 0
has title: Javascript class inheritance. Subclass changes main class's properties?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45899697
linked to: http://stackoverflow.com/q/4425318
downvote count: 0
tagged with: prototypal-inheritance
score: 1
has answer: http://stackoverflow.com/a/28814638
accepted answer: http://stackoverflow.com/a/28814638
type: Question

http://stackoverflow.com/a/28896761
has body: The data type should read "json" not "jsonp" I would suggest that you use "text" instead of "json" since you are returning normal text results and not json encoded data.
has comment: http://stackoverflow.com/comment/46053256
upvote count: 1
has comment: http://stackoverflow.com/comment/46053486
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/28896636
score: 1

http://stackoverflow.com/q/28861044
tagged with: countdown
favorite count: 0
type: UnansweredQuestion
score: -4
has comment: http://stackoverflow.com/comment/45988235
has answer: http://stackoverflow.com/a/28861488
has answer: http://stackoverflow.com/a/28938937
tagged with: momentjs
has title: Countdown script
has body: I have a countdown script which is only showing hours minutes and seconds like this: 29:30 54 But I want to have it like this 1 day and 4:30:54 This is the script what do I have to change I tried several things but it want work: 0:00:00
type: Question
has comment: http://stackoverflow.com/comment/45987597
upvote count: 0
has comment: http://stackoverflow.com/comment/45987950
tagged with: javascript
has answer: http://stackoverflow.com/a/28862075
downvote count: 4
answer count: 3

http://stackoverflow.com/q/28874334
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46011504
has title: MongoDB find query params
type: Question
tagged with: mongodb
accepted answer: http://stackoverflow.com/a/28874640
tagged with: javascript
tagged with: express
has answer: http://stackoverflow.com/a/28874640
score: 0
has body: I have a mongo query on a collection. It looks like this: common.db.collection('vb.vbStats').find({uid:uid, "vbs.vbNID":vbNID}, {"vbs.$":1}).toArray(function(err, result) {....} vb.vbstats is my collection. vbs is a field of the collection that is an array of arrays of ducoments. My question is what does {"vbs.$":1} in the query.
answer count: 1

http://stackoverflow.com/comment/46050644
has text: it to all users veiwing posts, so after a user have posted the post upon click.. i want it to slideDown or fadeIn
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28887263

http://stackoverflow.com/a/28784463
has body: Your code is far too complicated. Replace onchange="valueChanged()" with onchange="valueChanged(this)" and use this javascript: function valueChanged(button) { button.parentNode.nextElementSibling.childNodes[1].disabled=!button.checked; } Result: function valueChanged(button) { button.parentNode.nextElementSibling.childNodes[1].disabled=!button.checked; } Forename Surname
score: 0
answers question: http://stackoverflow.com/q/28784254
type: Answer

http://stackoverflow.com/a/75834140
upvote count: 1
answers question: http://stackoverflow.com/q/28860728
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/136561143
has body: You can use the below method to read an excel file in NodeJs: Install and import xlsx. const xlsx = require('xlsx'); Write a method to read file: export const readExcelFile = async (path, filePath) =&gt; { try { const file = xlsx.readFile(`${path}/${filePath}`); let data = [] const sheets = file.SheetNames for (let i = 0; i &lt; sheets.length; i++) { const temp = xlsx.utils.sheet_to_json( file.Sheets[file.SheetNames[i]]) temp.forEach((res) =&gt; { data.push(res) }) } return data; } catch (err) { console.log(err); } }; How to use: const result = await readExcelFile(PATH_DOWNLOADED_FILE, sourceFileName); console.log(`Result: ${JSON.stringify(result)}`);
score: 1

http://stackoverflow.com/comment/45974276
comment on: http://stackoverflow.com/q/28853843
type: Comment
type: QuestionComment
has text: Actually `this` in that context refers to the `say` object. If you add `this.say.message = "Hi";` to the constructor function your `console.log` call will log "Hi".
score: 1

http://stackoverflow.com/comment/46022289
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28880387
has text: I have spent the whole day thinking about others solutions and didn't come up with a good one so now I needed to rule this "solution" out. :)

http://stackoverflow.com/a/28817133
type: Answer
has comment: http://stackoverflow.com/comment/45906572
accepted answer of: http://stackoverflow.com/q/28816583
has comment: http://stackoverflow.com/comment/45908228
has body: This is really done at the router level. You'll need a public IP that routes traffic to your local machine. Then you set up DNS for the IP (through a domain registrar). Though, typically, serving a site is a big security risk. You'll want to have a dedicated server set up, away from your local development machine... and keep it patched.
has comment: http://stackoverflow.com/comment/45908026
has comment: http://stackoverflow.com/comment/45906265
score: 0
has comment: http://stackoverflow.com/comment/45907893
has comment: http://stackoverflow.com/comment/45906888
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45906385
answers question: http://stackoverflow.com/q/28816583

header
type: Tag
tags question: http://stackoverflow.com/q/28867445
tags question: http://stackoverflow.com/q/28795555
tags question: http://stackoverflow.com/q/28783069
tag name: header
tags question: http://stackoverflow.com/q/28901783
tags question: http://stackoverflow.com/q/28885232

http://stackoverflow.com/comment/45841940
comment on: http://stackoverflow.com/a/28782312
score: 0
type: AnswerComment
type: Comment
has text: Again height issue remains the same in mobile while i am applying your code. Any other suggestion ....? help me out in this . attaching the link as an example kindly check it out in mobile version,height issue remains the same http://krishnanetwork.rapidowebs.com/demoiframe/

http://stackoverflow.com/a/28874808
has body: If you've got a lot of L.mapbox.TileLayer instances and you don't want to add the eventhandler manually to each instance like Alexandru Pufan suggests in his answer you could still use a loop and Object's instanceof method: map.eachLayer(function (layer) { if (layer instanceof L.mapbox.TileLayer) { layer.on('tileload', function(e) { console.log(e); }); } }); After reading your comment on Alexandru's answer i'm guessing you only have one layer, then it would be best to add it manually to the instance, which is possible with L.mapbox.TileLayer like this: var layer = L.mapbox.tileLayer(YOUR MAP ID); layer.on('tileload', function(e) { console.log(e); }); var map = L.mapbox.map('mapbox', null, { 'center': [0, 0], 'zoom': 0, 'layers': [layer] });
accepted answer of: http://stackoverflow.com/q/28873713
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 3
score: 3
answers question: http://stackoverflow.com/q/28873713

http://stackoverflow.com/q/28886887
has title: Error using Phantom.js with Meteor.js: Meteor code must always run within a Fiber
type: Question
downvote count: 0
tagged with: meteor
favorite count: 0
tagged with: node.js
answer count: 0
type: UnansweredQuestion
score: 1
tagged with: node-fibers
upvote count: 1
tagged with: phantomjs
has body: When using Phantom.js and the phantom NPM package in Meteor.js, I'm getting an error stating that Meteor code must always run within a Fiber. Try wrapping callbacks that you pass to non-Meteor libraries with Meteor.bindEnvironment. I tried wrapping the findOne function with Meteor.wrapAsync and Phantom's callback functions with Meteor.bindEnvironment but the error persists. What can we do? var phantom = Meteor.npmRequire('phantom') phantom.create(Meteor.bindEnvironment( function (ph) { ph.createPage(function (page) { page.open('http://www.google.com', function (status) { console.log('Page Loaded'); page.evaluate( function () { return document.documentElement.outerHTML; }, function (html) { // ERROR OCCURS HERE Animals.findOneAsync = Meteor.wrapAsync(Animals.findOne) var animals = Animals.findOneAsync({city:'boston'}) }); ph.exit(); }); }); }) ); Error: Error: Meteor code must always run within a Fiber. Try wrapping callbacks that you pass to non-Meteor libraries with Meteor.bindEnvironment.
tagged with: javascript

http://stackoverflow.com/a/28948948
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28868627
type: Answer
accepted answer of: http://stackoverflow.com/q/28868627
has body: As per Angular the GitHub issue in Angular project, solution is to use $browser.cookies() instead of $cookies which will be deprecated in future 1.4 version.

http://stackoverflow.com/a/28906581
answers question: http://stackoverflow.com/q/28906264
upvote count: 1
has comment: http://stackoverflow.com/comment/46072948
type: Answer
downvote count: 0
score: 1
has body: Try using : if(!empty($_POST)): //your submission process code goes here endif; You doesn't seem to have name attribute to submit button, and therefore $_POST['formSubmit'] is not set.

http://stackoverflow.com/q/28821178
tagged with: three.js
has body: I have a object that I'm adding into my scene. I also have various other cubes in the scene. I'm using the following code to fire a Ray and see if I can detect a collision: var ray = new THREE.Raycaster(camera.position, vec); var intersects = ray.intersectObjects( scene.children ); For some reason, the regular shapes (cubes) are detected, but the objects that loaded from the obj files are not. var loader = new THREE.OBJMTLLoader(); loader.load( 'models/technicalTable1.obj', 'models/technicalTable1.mtl', function ( obj ) { obj.scale.set(0.4, 0.4, 0.4); obj.position.x = - roomWidth/2 + 100; obj.position.y = 36; obj.position.z = - roomLength/2 + 25; scene.add( obj ); }, onProgress, onError ); Thanks for any help!
linked to: http://stackoverflow.com/q/28675875
type: Question
tagged with: javascript
has title: intersectObjects not returning obj from OBJMTLLoader
score: 0
has answer: http://stackoverflow.com/a/34274441
answer count: 2
has answer: http://stackoverflow.com/a/28822116
type: UnansweredQuestion

http://stackoverflow.com/comment/45798336
has text: can you print the output of `@categories.length.fdiv(3)` in your console ?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28758820

http://stackoverflow.com/comment/45884881
type: QuestionComment
type: Comment
score: 0
has text: @JeremyThille, Then why are they placing this in the Getting Started topic??
comment on: http://stackoverflow.com/q/28805282

http://stackoverflow.com/comment/45918433
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28823428
has text: Looks like the port in which you are starting the server is already opened by another process.

http://stackoverflow.com/q/28868358
has comment: http://stackoverflow.com/comment/46001317
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/46009909
has comment: http://stackoverflow.com/comment/46009570
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28868911
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46001425
has comment: http://stackoverflow.com/comment/46001450
type: UnansweredQuestion
has body: So my class assignment is to take a previous assignment and make it take the string from an HTML input field. Here is that previous assignment. http://jsfiddle.net/ekj947kg/2/ var line = prompt("Enter the sentence to be turned into an acronym."); var words = line.split(" "); var result = ""; for (var i = 0; i < words.length; i += 1) { result += words[i].charAt(0).toUpperCase(); } alert(result); This is my first ever coding class and we are still early in. The two blocks that follow are copied from the book so I am not sure how they actually work yet. I have tried making the input field in my code (linked last) work by copying from these sections, but I just cant seem to figure out what I am doing wrong. The section recommends we look to this specific exercise for help, but part of the problem there is that it used 2 text files (.html & .js), while this assignment needs to be completed and saved in JSfiddle so we can just send the teacher a link. Any advice that can help me figure it out would be GREATLY appreciated. Bare in mind though that my knowledge of the terminology is entry level, so the simpler the better. lol Here is the exercise that we are supposed to look too. html JavaScript Temperature Converter Temperature Conversion js var report = function (celsius, fahrenheit) { document.getElementById("result").innerHTML = celsius + "\xb0C = " + fahrenheit + "\xb0F"; }; document.getElementById("f_to_c").onclick = function () { var f = document.getElementById("temperature").value; report((f - 32) / 1.8, f); }; document.getElementById("c_to_f").onclick = function () { var c = document.getElementById("temperature").value; report(c, 1.8 * c + 32); }; And finally, here is a link to my train wreck. http://jsfiddle.net/ekj947kg/6/ p.s. The teacher recommended we look to stackoverflow for advice when we are having trouble.
has answer: http://stackoverflow.com/a/28869793
has title: Having difficulty linking JS to HTML. -intro level student-
type: Question

http://stackoverflow.com/q/28763272
score: 9
type: Question
has answer: http://stackoverflow.com/a/28763762
upvote count: 9
tagged with: javascript
tagged with: angularjs-scope
has comment: http://stackoverflow.com/comment/45806293
has comment: http://stackoverflow.com/comment/45805938
has comment: http://stackoverflow.com/comment/45805843
answer count: 2
has title: "Cannot read property 'id' of undefined" when parsing an array declared in a factory
has comment: http://stackoverflow.com/comment/45806422
downvote count: 0
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28764115
favorite count: 0
accepted answer: http://stackoverflow.com/a/28763762
has answer: http://stackoverflow.com/a/28764115
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45806355
has body: I am building a basic app (with MEAN web frameworks and node webkit) in order to understand angularjs better. Here is the content of my notificationFactory.js function notificationFactory() { var fooMessages = [ { id: 4, dismissable: true, name: "fooooBaaar", function: '', showInTopBar: false, priority: "high", icon: 'fooIconBarBarBar', topBarIcon: 'fooIconIconIcon' }, { id: 3, dismissable: true, name: "foofooBarBar", function: '', showInTopBar: false, priority: "high", icon: 'fooIconfooIcon', topBarIcon: 'IconIconIcon' }, { id: 2, dismissable: true, name: "foo foo", function: '', showInTopBar: false, priority: "high", icon: 'fooBaaaaaar', topBarIcon: 'IconFooIcon' }, { id: 1, dismissable: true, name: "foo", function: '', showInTopBar: false, priority: "high", icon: 'fooIcon', topBarIcon: 'fooIconIcon' }, ] fooMessages.TopBarDismiss = function (message) { $.each(fooMessages, function (i, v) { if(v.id = message.id) { fooMessages.splice(i,1); } }); } return fooMessages; } angular.module('fooDemo').factory('notificationFactory', notificationFactory); I call the TopBarDismiss() function in an HTML template using: Dismiss When I check out the console after pressing my Dismiss "button", I get this: TypeError: Cannot read property 'id' of undefined at notificationFactory.js:94 at Function.m.extend.each (jquery.min.js:2) at Array.fooMessages.TopBarDismiss (notificationFactory.js:93) at fb.functionCall (angular.js:10847) at angular-touch.js:472 at k.$get.k.$eval (angular.js:12702) at k.$get.k.$apply (angular.js:12800) at HTMLDivElement.<anonymous> (angular-touch.js:471) at angular.js:3097 at r (angular.js:325)angular.js:10072 (anonymous function)angular.js:7364 $getangular.js:12802 $get.k.$applyangular-touch.js:471 (anonymous function)angular.js:3097 (anonymous function)angular.js:325 rangular.js:3096 r.triggerHandlerangular.js:3111 S.(anonymous function)angular-touch.js:453 (anonymous function)angular.js:2853 (anonymous function)angular.js:325 rangular.js:2852 c so it must …
has comment: http://stackoverflow.com/comment/45806199
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45805890
has comment: http://stackoverflow.com/comment/45805954
has comment: http://stackoverflow.com/comment/45805873
has comment: http://stackoverflow.com/comment/45805847

http://stackoverflow.com/q/28851487
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28851629
linked to: http://stackoverflow.com/q/905033
upvote count: 1
has answer: http://stackoverflow.com/a/57338376
has title: Jquery - How to change img src on hover?
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28851658
answer count: 8
tagged with: javascript
has answer: http://stackoverflow.com/a/28851661
has body: Is it possible to change src of image on hover and then back to original ? For example "name of file is always same" what is changing is number. 1 is for original and 2 is for hover. Thank you very much for advice. Code: Featured Meet ATS
score: 0
has answer: http://stackoverflow.com/a/28851809
has answer: http://stackoverflow.com/a/28851853
has comment: http://stackoverflow.com/comment/45970092
tagged with: jquery
has comment: http://stackoverflow.com/comment/45970102
has answer: http://stackoverflow.com/a/28851675
favorite count: 0
possible better answer: http://stackoverflow.com/a/28851853
has comment: http://stackoverflow.com/comment/45970059
has answer: http://stackoverflow.com/a/28851645
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/28851629

http://stackoverflow.com/comment/45967783
comment on: http://stackoverflow.com/a/28833803
type: AnswerComment
score: 0
type: Comment
has text: tried it, but nothing was working. I was able to solve by overriding on keydown event of the editor and adjusting height of iframe based on body of tinymce.

linker
tags question: http://stackoverflow.com/q/28878973
type: Tag
tag name: linker
tags question: http://stackoverflow.com/q/28855640

http://stackoverflow.com/comment/45925055
type: Comment
type: QuestionComment
has text: @JeremyThille Is it really? why would it?
score: 0
comment on: http://stackoverflow.com/q/28827256

http://stackoverflow.com/comment/45802941
type: Comment
has text: It's about productivity, working with multiple developers and not at last - reliability. It's easier for any dev to just write `incrementInDB();` than to surf the code, read that this is a promise which will fire error, so you **must** catch it. As I stated - I don't want exception - I just can't figure out another way to do it without blowing up my whole app :)
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28761365

http://stackoverflow.com/comment/45857940
has text: `this` inside of `$.each()` would refer to `data` object , not an DOM element where `.innerHTML` , `.append()` are called.
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28790735

http://stackoverflow.com/comment/45817132
comment on: http://stackoverflow.com/q/28768217
has text: Have you tried `gulpFilter('**/*.js.coffee')`?
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28779394
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/28779805
has comment: http://stackoverflow.com/comment/45836161
has body: Creating HTML Forms, So here's what i needed. I want to input text on the box then Show the inputted text to the bottom of submit button. http://www.w3schools.com/html/html_forms.asp - Site of the Code I just want to have the inputted text show on the bottom so that i could copy it. But instead when i click submit it redirects me to an url, Im gonna need multiple forms like name,age,date of birth,phone number,status. Forms. Please kindly help me thanks!
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/45836285
answer count: 2
upvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28779594
has title: HTML/Javascript Forms Input text then generate at bottom
type: UnansweredQuestion

http://stackoverflow.com/a/30344968
answers question: http://stackoverflow.com/q/28872807
has body: use $stateChangeStart instead of $routeChangeStart there are some differences between Angularjs ngRoute and ui-router. http://www.amasik.com/angularjs-ngroute-vs-ui-router/
downvote count: 0
upvote count: 2
type: Answer
score: 2

http://stackoverflow.com/a/28788704
score: 0
has body: Not 100% sure this is what you want. Expected output shown is not valid syntax and details provided are very open to interpretation var arr = [] for (var i=0; i &lt; x; i++){ var num = i &gt; 0 ? arr[i-1].num : 0; num= num + randomNumber; // is this an existing variable? arr.push({ num: num}); // used object with property `num` based on example `previousArrayElement.num ` }
answers question: http://stackoverflow.com/q/28788629
type: Answer

http://stackoverflow.com/a/28830439
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45931042
has comment: http://stackoverflow.com/comment/45933873
upvote count: 2
has comment: http://stackoverflow.com/comment/45931237
has body: I think the below code can help you get started, cos I didn't understood correctly what you're trying to achieve. But I understood that you need to play and pause the video. So below is the code which I used somewhere in my project- function toggleVideo(state) { if(state == 'pause'){ document.getElementById('movie_player').contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*'); } else { document.getElementById('movie_player').contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*'); } } UPDATE I have completely understood now, below are the steps how you can achieve this- 1) Get Json data for the playlist using the code below- var playlistId = 'PL1HIp83QRJHRbmJl0sS0CLOuIKCBCB76L'; $.getJSON('https://gdata.youtube.com/feeds/api/playlists/'+ playlistId +'?v=2&amp;alt=jsonc',function(data,status,xhr){ // save json data of the playlist }).error(function() { alert("404 Error"); }); See the XML format in the below url, you can get the same data in JSON format by using "&amp;alt=jsonc" in the API url- https://developers.google.com/youtube/2.0/developers_guide_protocol_playlists#Retrieving_a_playlist 2) Create two iframes or containers in which you need to keep two youtube players. First one will be the player which you should pause after each 10 minutes or so and when paused you should hide the first container. The second instance should hold the player which should have the second video which should play till completed, on complete hide this container and again show the first container. See this post on how to play and pause youtube videos- How to pause a YouTube player when hiding the iframe? 3) After each 10 minutes or so, get the next video link and details from the JSON data of the playlist and link it to the second container pausing &amp; hiding the first one and playing &amp; showing the second one. I hope in this way you can achieve what you require.
type: Answer
has comment: http://stackoverflow.com/comment/45962302
score: 2
accepted answer of: http://stackoverflow.com/q/28829578
answers question: http://stackoverflow.com/q/28829578

http://stackoverflow.com/q/28755402
has answer: http://stackoverflow.com/a/28755734
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/40346050
has body: I'd like to know whether it's possible to change the value of a variable defined in ng-repeat from the controller or not ? I'm trying to initialize a simple variable "opened" used for toggling in a ng-repeat, inside the controller. {{item.title}} {{item.title}} Here is a plunker showing an example. http://plnkr.co/edit/lebA2dokhq2W4AsbjKWB?p=preview Thank you,
score: 1
upvote count: 1
tagged with: toggle
type: Question
possible better answer: http://stackoverflow.com/a/40346050
has comment: http://stackoverflow.com/comment/45792336
accepted answer: http://stackoverflow.com/a/28755734
has title: Change state of variable defined in ng-repeat in controller
tagged with: javascript
answer count: 2
downvote count: 0
tagged with: angularjs-ng-repeat
favorite count: 0
has comment: http://stackoverflow.com/comment/45800916
tagged with: angularjs

http://stackoverflow.com/a/28766571
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28766424
type: Answer
score: 3
has body: It is because you are using new Date().getTime(). The twister function finishes very quickly, to two successive calls to new Date().getTime() give the same value, thus the same seed. If you add a different number, e.g. such as this: http://jsfiddle.net/vcpjdo94/3/ it works as expected. The changes are: $scope.genRandom=function(){ $scope.inputs1= getRandomArray(6, 1); $scope.inputs2= getRandomArray(6, 2); }; and: var getRandomArray=function(length, add){ var casuals=[]; var mersenneTwister = new MersenneTwister(new Date().getTime()/2 + add); ... } i.e. addition of add parameter.
upvote count: 3
has comment: http://stackoverflow.com/comment/45888073
accepted answer of: http://stackoverflow.com/q/28766424
has comment: http://stackoverflow.com/comment/45814507

http://stackoverflow.com/q/28890562
accepted answer: http://stackoverflow.com/a/28890679
type: Question
tagged with: javascript
tagged with: jquery
score: 0
tagged with: datatables
answer count: 1
has body: I am experiencing a strange issue with DataTables. In the docs sometimes it shows the class name with a capital D: var table = $('#example').DataTable(); Other times with a lowercase D: var table = $('#example').dataTable(); Both work.. most of the time. My issue is two functions are conflicting. One needs the class to be lowercase and one needs uppercase. For example, the search function needs uppercase (works): https://jsfiddle.net/362cz1z7/ If I use lowercase (breaks): https://jsfiddle.net/362cz1z7/1/ I also want to use the fnSettings function on the same table... And of course it needs lowercase so it breaks my search code. Uppercase (breaks): https://jsfiddle.net/362cz1z7/2/ Lowercase (works): https://jsfiddle.net/362cz1z7/3/ Both give an error 'Uncaught TypeError: undefined is not a function'. I am totally confused. If you look at their examples in the docs, some are uppercase and some are lowercase.
type: AnsweredQuestion
has title: Strange class name issue in DataTables when using different functions
has answer: http://stackoverflow.com/a/28890679

http://stackoverflow.com/a/28758665
has comment: http://stackoverflow.com/comment/45834164
has comment: http://stackoverflow.com/comment/45834468
answers question: http://stackoverflow.com/q/28758520
type: Answer
has comment: http://stackoverflow.com/comment/45834200
has comment: http://stackoverflow.com/comment/45834475
has comment: http://stackoverflow.com/comment/45833693
has comment: http://stackoverflow.com/comment/45834956
has comment: http://stackoverflow.com/comment/45834565
accepted answer of: http://stackoverflow.com/q/28758520
has comment: http://stackoverflow.com/comment/45834833
has comment: http://stackoverflow.com/comment/45834270
has comment: http://stackoverflow.com/comment/45834204
has comment: http://stackoverflow.com/comment/45834360
score: 0
has body: Try this: $('.columncontainer .cheap').click(function(){ $(this).css('opacity', 1) }) Or, if you want to add .cheap blocks dynamically, you can use this variant: $('.columncontainer').on('click', '.cheap', function(){ $(this).css('opacity', 1) })
type: AcceptedAnswer

http://stackoverflow.com/comment/45945535
comment on: http://stackoverflow.com/a/28838022
type: AnswerComment
has text: thank you, i have tried this and the result is still the same.
score: 0
type: Comment

http://stackoverflow.com/q/28810745
upvote count: 2
tagged with: ios
tagged with: javascript
tagged with: jquery
tagged with: ipad
favorite count: 0
has comment: http://stackoverflow.com/comment/45895770
has comment: http://stackoverflow.com/comment/45894065
has comment: http://stackoverflow.com/comment/45897713
has title: How to avoid DOM redraw when setting text with .html()
score: 2
downvote count: 0
answer count: 0
type: UnansweredQuestion
type: Question
has body: I have a clock on my web application which gets updated every few seconds with a call to $("#date").html(newTime); My problem being that when using the site on mobile safari, if the user is attempting to correct their spelling when entering text into an input box - the list of corrections displays correctly but then disappears and switches to the 'copy/paste/define' options. Making it extremely difficult to make spelling corrections. The problem happens everytime the clock is updated so I suspect its related to when the DOM is redrawn on .html() being called. The following jsfiddle illustrates the problem: http://www.jsfiddle.net/dadviegas/8x6mz/ function AddClock(element) { $(document).ready(function () { refreshIntervalId = setInterval(function () { var now = new Date(); var outStr = checklength(now.getHours()) + ':' + checklength(now.getMinutes()) + ':' + checklength(now.getSeconds()); $(element).html(outStr); }, 1000); }); } Go there on ipad/iphone, write a word in the HTML section and attempt to correct the spelling. Any solutions to get around this problem??
tagged with: dom

http://stackoverflow.com/comment/101986147
comment on: http://stackoverflow.com/a/57775218
score: 1
has text: please explain how this answers the question
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45839245
has text: The situation is i am adding tags i don't how many tags will be there like assume close1 ...close20 as a example .so how to write the single dynaminc event action for all of them.
type: QuestionComment
comment on: http://stackoverflow.com/q/28781138
score: 0
type: Comment

http://stackoverflow.com/a/28848985
has body: You can log with xuser by specifying the database. I created the same user that you have and tried logging in from the console and it works just fine. mongo --username xuser --pasword xuser123 --authenticationDatabase x Once logged in, I also ran the connectionStatus command to see the current user: db.runCommand({connectionStatus: 1}); //output { "authInfo" : { "authenticatedUsers" : [ { "user" : "xuser", "db" : "x" } ] }, "ok" : 1 }
type: Answer
upvote count: 3
score: 3
answers question: http://stackoverflow.com/q/28848840
has comment: http://stackoverflow.com/comment/45968048
downvote count: 0

forms
tags question: http://stackoverflow.com/q/28791679
tags question: http://stackoverflow.com/q/28805949
tags question: http://stackoverflow.com/q/28818728
tags question: http://stackoverflow.com/q/28785855
tags question: http://stackoverflow.com/q/28772493
tags question: http://stackoverflow.com/q/28796175
tags question: http://stackoverflow.com/q/28877476
tags question: http://stackoverflow.com/q/28769961
tags question: http://stackoverflow.com/q/28905442
tags question: http://stackoverflow.com/q/28755340
tags question: http://stackoverflow.com/q/28860276
tags question: http://stackoverflow.com/q/28818625
tags question: http://stackoverflow.com/q/28766834
tags question: http://stackoverflow.com/q/28811905
tags question: http://stackoverflow.com/q/28857526
tags question: http://stackoverflow.com/q/28784172
tags question: http://stackoverflow.com/q/28762687
tags question: http://stackoverflow.com/q/28795325
tags question: http://stackoverflow.com/q/28816901
tags question: http://stackoverflow.com/q/28804569
tags question: http://stackoverflow.com/q/28866027
tags question: http://stackoverflow.com/q/28800513
tags question: http://stackoverflow.com/q/28765716
type: Tag
tags question: http://stackoverflow.com/q/28755867
tags question: http://stackoverflow.com/q/28795145
tags question: http://stackoverflow.com/q/28878190
tags question: http://stackoverflow.com/q/28842607
tags question: http://stackoverflow.com/q/28899405
tags question: http://stackoverflow.com/q/28843150
tags question: http://stackoverflow.com/q/28771817
tags question: http://stackoverflow.com/q/28761690
tags question: http://stackoverflow.com/q/28861784
tags question: http://stackoverflow.com/q/28775638
tags question: http://stackoverflow.com/q/28796689
tags question: http://stackoverflow.com/q/28765383
tags question: http://stackoverflow.com/q/28876955
tags question: http://stackoverflow.com/q/28784654
tags question: http://stackoverflow.com/q/28872248
tags question: http://stackoverflow.com/q/28783039
tags question: http://stackoverflow.com/q/28817728
tags question: http://stackoverflow.com/q/28845289
tags question: http://stackoverflow.com/q/28876252
tags question: http://stackoverflow.com/q/28752586
tags question: http://stackoverflow.com/q/28788765
tags question: http://stackoverflow.com/q/28895679
tags question: http://stackoverflow.com/q/28815172
tags question: http://stackoverflow.com/q/28817904
tags question: http://stackoverflow.com/q/28790209
tags question: http://stackoverflow.com/q/28775678
tags question: http://stackoverflow.com/q/28859143
tags question: http://stackoverflow.com/q/28791810
tags question: http://stackoverflow.com/q/28832920
tags question: http://stackoverflow.com/q/28867748
tags question: http://stackoverflow.com/q/28781969
tags question: http://stackoverflow.com/q/28836727
tags question: http://stackoverflow.com/q/28858731
tags question: http://stackoverflow.com/q/28822883
tags question: http://stackoverflow.com/q/28771926
tags question: http://stackoverflow.com/q/28880895
tags question: http://stackoverflow.com/q/28823608
tags question: http://stackoverflow.com/q/28905620
tags question: http://stackoverflow.com/q/28754003
tags question: http://stackoverflow.com/q/28777523
tags question: http://stackoverflow.com/q/28855589
tags question: http://stackoverflow.com/q/28827256
tags question: http://stackoverflow.com/q/28849988
tags question: http://stackoverflow.com/q/28849348
tags question: http://stackoverflow.com/q/28833641
tags question: http://stackoverflow.com/q/28903144
tags question: http://stackoverflow.com/q/28828516
tags question: http://stackoverflow.com/q/28806774
tags question: http://stackoverflow.com/q/28878019
tags question: http://stackoverflow.com/q/28830186
tags question: http://stackoverflow.com/q/28792640
tags question: http://stackoverflow.com/q/28774306
tags question: http://stackoverflow.com/q/28873864
tags question: http://stackoverflow.com/q/28857003
tags question: http://stackoverflow.com/q/28855576
tags question: http://stackoverflow.com/q/28756448

http://stackoverflow.com/a/28794273
downvote count: 1
accepted answer of: http://stackoverflow.com/q/28794249
answers question: http://stackoverflow.com/q/28794249
has body: Do not use regex on HTML. You can use Element.querySelectorAll. Replace Element with a reference to the DOM-element from which you like to select the headings. var heading = document.querySelectorAll("h2, h3, h4"); QuerySelectorAll (and his brother querySelector) use CSS selectors to select elements from the DOM. You can supply multiple selectors using commas. This will select all h2-4 elements. You can loop them with this code: Array.prototype.map.call(heading , function(element){ //do something with the element here. console.log(element.textContent); //EXAMPLE, display the text in the element. }); Since querySelectorAll returns a node list (which is an arrayish object) we can pass it to Array.map (though not directly). We use Array.prototype.map.call to pass the node list to the map function as array. Map loops over every element in the node list.
score: 2
type: AcceptedAnswer
type: Answer
upvote count: 3

http://stackoverflow.com/comment/45842263
type: Comment
comment on: http://stackoverflow.com/a/28782724
score: 0
has text: I should have also added, I have used future to make my function seem synchronous. I then run the functions one after the other passing the return result form the previous function into the next. Technically, I am not using callback functions but simply passing the result from one function to the next. Is good practice to handle errors? My previous question demonstrates this with try/catch but I am not using callback... I "return future.return(resultObj)" http://stackoverflow.com/questions/28703715/how-do-you-stop-a-function-when-an-error-object-is-received
type: AnswerComment

http://stackoverflow.com/comment/46001045
type: QuestionComment
comment on: http://stackoverflow.com/q/28822131
has text: @AlexeiLevenkov Next time I need to ask a question like this, which SE site should I use?
score: 0
type: Comment

http://stackoverflow.com/comment/45855291
score: 2
comment on: http://stackoverflow.com/a/28787800
type: AnswerComment
has text: Should not be needed anymore I don't think.
type: Comment

http://stackoverflow.com/comment/45848340
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28786044
has text: I tried that and its still increasing the amount of white space between the 2 divs.

http://stackoverflow.com/comment/45795989
has text: You are looping over the entire array every time you add a new item. What are you trying to do?
score: 0
comment on: http://stackoverflow.com/q/28757624
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46037393
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28846996
has text: Actually I noticed when changing the full list it doesn't animate out only in

http://stackoverflow.com/comment/45928736
score: 1
comment on: http://stackoverflow.com/q/28829208
type: Comment
type: QuestionComment
has text: You dont have to call the API again. All you have to do is to put filter on your displayed products.

meteor-helper
tag name: meteor-helper
tags question: http://stackoverflow.com/q/28897828
type: Tag

http://stackoverflow.com/comment/45807002
comment on: http://stackoverflow.com/q/28762959
type: Comment
type: QuestionComment
has text: What is the value of `addr` in your `setup`???
score: 0

http://stackoverflow.com/a/28862140
downvote count: 0
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28852886
has body: This seem to be an issue with the Firefox and had been reported as bug already: https://bugzilla.mozilla.org/show_bug.cgi?id=893020
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28852886

http://stackoverflow.com/comment/45939850
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28835080
score: 1
has text: @Teepeemm I can get the value of the key inside the callback, I simply want to get that value as a primitive instead of returning the object as right now it is active: [object]

http://stackoverflow.com/comment/45976953
score: 0
type: Comment
has text: sure it is a good solution, but i just started to learn and i saw in tutorial solution with fadeToggle and it works but i don't have a whole code only piece with jQuery
comment on: http://stackoverflow.com/a/28855110
type: AnswerComment

http://stackoverflow.com/comment/45833715
type: AnswerComment
comment on: http://stackoverflow.com/a/28777924
score: 0
type: Comment
has text: @RaselAhmed just for testing... can't wait for 2 min

http://stackoverflow.com/q/28847875
has title: async nature in node.js
has comment: http://stackoverflow.com/comment/45964309
has answer: http://stackoverflow.com/a/28848956
tagged with: asynchronous
tagged with: node.js
type: UnansweredQuestion
type: Question
score: 0
answer count: 1
tagged with: javascript
has body: I am newbie to node.js , i cant figure out how to solve this. As node.js is async nature i cant predict the result in a structured manner... My scenario is as follows: aysnc.foreach(Object.keys(req.body), function(elem){ if(elem !== aaaa){ client.search(Query).then(function(Data){ //----------&gt; For every query is a callback, so after // sending the result to front-end this callback is returning. // I have to make this query executed and return result and // after that only the next loop should start. //some logic here arr1;--------------&gt;populating result for each query }); } else { aysnc.foreach(Object.keys(req.body.xxxx), function(elem){ client.search(Query).then(function(Data){ //some logic here arr2; }); }); }); Finally what i have to do is: if(--Object.keys(req.body).length === 0){ intersect arr1 an arr2 } I have to intersect arr1 and arr2. But before populating arr1 and arr2, the async nature completes the loop and arr1 and arr2 is empty. I have to make everything sync. Please share your ideas. Thanks in advance.
has comment: http://stackoverflow.com/comment/45964004

http://stackoverflow.com/a/28905672
upvote count: 5
has comment: http://stackoverflow.com/comment/46076567
has comment: http://stackoverflow.com/comment/46072505
score: 5
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46073106
accepted answer of: http://stackoverflow.com/q/28905111
type: Answer
has body: You just need one service, which holds the data you intend to share among the different controllers. Demo template {{item}} Add controllers and service var app = angular.module('myApp', []); app.controller('Ctrl1', function($scope, myListService){ $scope.items = myListService.getList(); }); app.controller('Ctrl2', function($scope, myListService){ $scope.addNew = myListService.add; }); app.service('myListService',function(){ var list=[]; init(); function init(){ list = ['one', 'two', 'three']; }; var getList=function(){ return list; }; var add=function(newEntity){ list.push(newEntity); }; return{ getList: getList, add: add }; });
answers question: http://stackoverflow.com/q/28905111
has comment: http://stackoverflow.com/comment/46071926
has comment: http://stackoverflow.com/comment/46070778

http://stackoverflow.com/comment/75533615
type: AnswerComment
score: 0
type: Comment
has text: It does indeed. set an interval running logs in your console and you'll see logs poping even when switching tab
comment on: http://stackoverflow.com/a/28867335

http://stackoverflow.com/q/28827511
type: AnsweredQuestion
tagged with: webgl
upvote count: 10
has comment: http://stackoverflow.com/comment/46053581
type: Question
has answer: http://stackoverflow.com/a/28949220
has comment: http://stackoverflow.com/comment/46051283
answer count: 1
downvote count: 0
tagged with: ios
tagged with: javascript
favorite count: 0
has body: I'm trying to get rendering to a floating point texture working in WebGL on iOS Safari (not in a native app). I have managed to get iOS to read a manually (e.g. from JavaScript) created floating point texture, however when I create a framebuffer of floating point type and use the GPU to render into it, it does not work. I've isolated the issue to code that renders to a floating point texture, which is then passed to another shader to be displayed. Here is what the result looks like applied to a cube: The render to texture draws a green square, half the size of the texture, which is then applied to each side of the cube. This all works perfectly fine on both desktop and iOS WebGL as long as the type of the texture that the green square is rendered to is the standard unsigned byte type. However, changing the type to floating point causes the render to texture to fail on iOS devices (while continuing to work on desktop browsers). The texture is empty, as if nothing had been rendered to it. I have created an example project here to demonstrate the issue: https://github.com/felixpalmer/render-2-texture Changing the precision of the shaders using the THREE.Renderer.precision setting does not make a difference
score: 10
has title: WebGL iOS render to floating point texture
tagged with: opengl-es
accepted answer: http://stackoverflow.com/a/28949220

http://stackoverflow.com/q/28840503
type: Question
has comment: http://stackoverflow.com/comment/45951967
tagged with: javascript
has body: If the reset button is pressed, I want that the canvas get's white again and it draw's the lines again. I can't figure out why it isn't working. Can somebody help me? var mouseX; var mouseY; var player1 = true; var slots = new Array(false, false, false, false, false, false, false, false, false); function doFirst() { var x = document.getElementById('canvas'); canvas = x.getContext('2d'); canvas.fillRect(250,0,33,816); canvas.fillRect(533,0,33,816); canvas.fillRect(0,250,816,33); canvas.fillRect(0,533,816,33); canvas.font="bold 150px Tahoma"; canvas.textAlign="center"; x.addEventListener('mousemove', function(event) { mouseX = event.clientX; mouseY = event.clientY; var status = document.getElementById('status'); status.innerHTML = mouseX+" | "+mouseY; return mouseX + mouseY; }); } /*------------------------------------------------------------*/ window.addEventListener("click", change, false); function change() { if(mouseX>=0 && mouseX<=250 && mouseY>=0 && mouseY<=250){ if(player1==true && slots[0]==false){ canvas.fillText("X", 125, 170); player1=false; slots[0]=true; } else if(player1==false && slots[0]==false){ canvas.fillText("O", 125, 170); player1=true; slots[0]=true; } } if(mouseX>=283 && mouseX<=533 && mouseY>=0 && mouseY<=250){ if(player1==true && slots[1]==false){ canvas.fillText("X", 408, 170); player1=false; slots[1]=true; } else if(player1==false && slots[1]==false){ canvas.fillText("O", 408, 170); player1=true; slots[1]=true; } } if(mouseX>=566 && mouseX<=816 && mouseY>=0 && mouseY<=250){ if(player1==true && slots[2]==false){ canvas.fillText("X", 691, 170); player1=false; slots[2]=true; } else if(player1==false && slots[2]==false){ canvas.fillText("O", 691, 170); player1=true; slots[2]=true; } } if(mouseX>=0 && mouseX<=250 && mouseY>=283 && mouseY<=533){ if(player1==true && slots[3]==false){ canvas.fillText("X", 125, 453); player1=false; slots[3]=true; } else if(player1==false && slots[3]==false){ canvas.fillText("O", 125, 453); player1=true; slots[3]=true…
has answer: http://stackoverflow.com/a/28840758
score: 0
tagged with: html5-canvas
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/45950673
accepted answer: http://stackoverflow.com/a/28840758
has title: Reset button for canvas not working
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45966763

http://stackoverflow.com/comment/45993748
type: Comment
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28820902
has text: This works perfectly; exactly what I was looking for. The explanation behind is an appreciated bonus. Thank you so much!

http://stackoverflow.com/q/28904161
type: Question
tagged with: javascript
score: 0
has body: I have a custom widget to which I pass data from backend. Grid shown on the correct place but not showing data on it. I tried with hardcoded data but only the headers are shown. Grid has height and width set. Here is the code snippet. I would appreciate any help. thanks. define(["dojo/_base/declare", "dijit/_WidgetBase", "dijit/_TemplatedMixin", "dijit/_WidgetsInTemplateMixin", "dijit/_OnDijitClickMixin", GridWidget.js define(["dojo/_base/declare", "dijit/_WidgetBase", "dijit/_TemplatedMixin", "dijit/_WidgetsInTemplateMixin", "dijit/_OnDijitClickMixin", "dojo/text!./templates/GridWidget.html", "dgrid/Grid","dgrid/Keyboard", "dgrid/Selection", "dgrid/extensions/DijitRegistry", "dstore/Memory", "dstore/Trackable"], function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, _OnDijitClickMixin, template, Grid, Keyboard, Selection, DigitRegistry, Memory, Trackable) { return decalare("GridWidget", [_WidgetBase, _OnDijitClickMixin, _TemplatedMixin, _WidgetsInTemplateMixin], { widgetsInTemplate: true, baseClass: 'GridWidget', templateString: template, data: null, store: null, grid: null, columns: null, constructor: function(data) { this.data = data; }, _setData: function(input) { if (input) { this._set("data", input); } }, getData: function() { return this.data; }, postCreate : function() { this.inherited(arguments); var StandardGrid = declare([Grid, Selection, Keyboard, DijitRegistry]); this.store = new (declare([Trackable, Memory]))({ data : this.data, idProperty : "isbn" }); this.columns = { bookTitle : "Title", first : "First Name", last : "Last Name", releaseDate : "Release Date" }; this.grid = new StandardGrid({ collection : this.store, columns : this.columns, cellNavigation : false, noDataMessage : "No results.", loadingMessage : "Loading Data...", }, this.gridNode); } startup: function() { if (this._started) return; this.inherited(arguments); if (this.grid) { this.grid.startup(); } } }); }); GridWidget.html testGridWidget.html Test: Dgrid 0.4 Test: Dgr…
has comment: http://stackoverflow.com/comment/46239871
answer count: 1
has title: dgrid in a custom widget
has answer: http://stackoverflow.com/a/28904891
tagged with: http://stackoverflow.com/tag/html
tagged with: dojo
type: AnsweredQuestion
tagged with: dgrid
accepted answer: http://stackoverflow.com/a/28904891

http://stackoverflow.com/q/28859262
tagged with: iframe
tagged with: facebook
has answer: http://stackoverflow.com/a/28859878
has body: The way I see it, every user event that is relayed to the browser can also be raised programmatically. You can trigger click, mouseover, or really, pretty much anything sane: document.getElementById('mylink').click(); document.getElementById('mylink').dispatchEvent('mouseover'); I know that most social networks - Facebook included - serve their &nbsp;cookie-dispensers&nbsp; social plugins through within iframe elements that are placed via JavaScript. But what's stopping anyone from triggering an event into that iFrame? document.getElementById('myframe').contentDocument.getElementById('likebtn').click(); I've found multiple articles that suggest an approach by intercepting clicks (that is, when you click anywhere on the page, you actually click the like button), but none of them detail or examine a way where the click is raised programmatically. http://geekhmer.github.io/blog/2013/10/02/facebook-fan-page-auto-like/ http://www.makingdifferent.com/automatically-increase-facebook-fans-using-javascript/ If there is a defense mechanism in place that prevents artifical click events from actually registering on elements, what's stopping anyone from modifying the frame contents with a script, or by relaying through a webserver (though the latter might be complicated due to separate authentication and HTTPS)? Disclaimer: I do not - in any way - seek for a concrete solution that accomplishes this task. I understand and fully support that this - as well as click intercepting - would be a rude, forcing, and horrible behaviour even for Voldemort to pull off. It is one's last mortyfing and pathetic attempt at gaining more publicity before failing mercillesly. I'm merely interested in the behind-the-curtain workings.
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28859844
has title: How does Facebook prevent triggering automatic clicks on Like buttons?
type: Question
possible better answer: http://stackoverflow.com/a/28859844
answer count: 2
accepted answer: http://stackoverflow.com/a/28859878
tagged with: javascript
score: 0

http://stackoverflow.com/q/28814577
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45902253
accepted answer: http://stackoverflow.com/a/28819808
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28819808
has body: I'm trying to dynamically generate a popup in mobile app I'm working on, but I'm experiencing an issue that I can figure out. I added a control-group with a couple of buttons, but the buttons are added twice (see image below). I'm sure it is very simple, but I can't see it. What am I missing here. Thansk! This is the jQuery code: var $popUp = $("&lt;div&gt;&lt;div/&gt;").popup({ dismissible: false, theme: "a", overlyaTheme: "a", transition: "pop", positionTo: "window" }).on("popupafterclose", function () { //remove the popup when closing $(this).remove(); }).css({ 'width': '270px', 'height': '200px', 'padding': '5px' }); $("&lt;h2/&gt;", { text: "Location Details" }).appendTo($popUp); $("&lt;label/&gt;", { text: "Location: " + locationName }).appendTo($popUp); $("&lt;label/&gt;", { text: "Note:" }).appendTo($popUp); $("&lt;p/&gt;", { text: locationNote }).appendTo($popUp); $("&lt;div data-role='controlgroup' data-type='horizontal' class='myGroup'/&gt;").trigger("create").appendTo($popUp); $("&lt;a&gt;", { text: "Submit" }).buttonMarkup({ inline: false, mini: true, icon: "check", }).on("click", function () { $popUp.popup("close"); }).appendTo('.myGroup'); $("&lt;a&gt;", { text: "Back", "data-rel": "back" }).buttonMarkup({ inline: false, mini: true, theme: "e", icon: "back", }).appendTo('.myGroup'); $popUp.popup('open').trigger("create");
type: AnsweredQuestion
has title: Issue generating dynamically a popup in jQuery mobile
type: Question
has comment: http://stackoverflow.com/comment/45903193
has comment: http://stackoverflow.com/comment/45902873
tagged with: jquery-mobile

http://stackoverflow.com/comment/45967252
has text: Are you using `$http` to get the data? if not try `$scope.$apply()` after populating your data.
score: 0
comment on: http://stackoverflow.com/q/28849943
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45906442
score: 1
type: Comment
has text: ...and missing `});` on ajax call
type: QuestionComment
comment on: http://stackoverflow.com/q/28817387

http://stackoverflow.com/comment/45930719
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28830347
type: Comment
has text: @Leon: Naturally I didn't mean to use them both for the same form, but as two different ways of keeping the page from being replaced. I hope that the changed formatting made that clearer.

http://stackoverflow.com/comment/45955021
type: Comment
type: AnswerComment
has text: To avoid unnecessary debate, and because this check is mega-lightweight, I edited the example to use a once-per-minute check.
score: 0
comment on: http://stackoverflow.com/a/28842843

http://stackoverflow.com/comment/45825035
comment on: http://stackoverflow.com/q/28773275
type: Comment
has text: @adeneo I'm not sure I follow. this is a fairly common practice in other languages I think. You want to ensure setting a private/protected property is done only through a setter and you want those accessing it to have both fluent and literal assignment operators.
score: 0
type: QuestionComment

http://stackoverflow.com/q/28763243
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
accepted answer: http://stackoverflow.com/a/28763381
tagged with: http://stackoverflow.com/tag/html
answer count: 4
upvote count: 1
has body: With this AJAX script, I'm trying to send the content of contentText and contentID. Just sending contentTEXT works, but I want to send the ID as well, so I can comment on the original post. But it doesn't work! myData looks like this when it semi works: > var myData = '?content_txt='+$("#contentText").val(), > '&content_id='+$("#contentId").val(); //build a post data structure But i want it to be something like this, i think My form I'm trying to use <?php echo WORDING_ADD_A_COMMENT; ?> <textarea name="content_txt" id="contentText" cols="45" rows="5" placeholder="<?php echo WORDING_COMMENT_PLACEHOLDER; ?>"> <input type="hidden" name="content_id" id="contentId" value="<?php echo $_GET['topic_id']; ?>"/> <?php echo WORDING_BUTTON_COMMENT_BOX; ?>
tagged with: php
has answer: http://stackoverflow.com/a/28763358
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28763381
score: 1
possible better answer: http://stackoverflow.com/a/28763354
has answer: http://stackoverflow.com/a/28763354
type: Question
has title: Send a hidden ID input field with AJAX
has answer: http://stackoverflow.com/a/29275560
downvote count: 0

charts
tags question: http://stackoverflow.com/q/28900010
tags question: http://stackoverflow.com/q/28848146
tags question: http://stackoverflow.com/q/28767407
tags question: http://stackoverflow.com/q/28862073
tags question: http://stackoverflow.com/q/28872986
type: Tag
tags question: http://stackoverflow.com/q/28873376
tags question: http://stackoverflow.com/q/28799602
tags question: http://stackoverflow.com/q/28751118
tags question: http://stackoverflow.com/q/28826224
tags question: http://stackoverflow.com/q/28774728
tags question: http://stackoverflow.com/q/28786521
tags question: http://stackoverflow.com/q/28879123
tag name: charts
tags question: http://stackoverflow.com/q/28820906
tags question: http://stackoverflow.com/q/28752744
tags question: http://stackoverflow.com/q/28765320
tags question: http://stackoverflow.com/q/28787536
tags question: http://stackoverflow.com/q/28853616
tags question: http://stackoverflow.com/q/28814735
tags question: http://stackoverflow.com/q/28882883

http://stackoverflow.com/a/28794972
answers question: http://stackoverflow.com/q/28794848
has comment: http://stackoverflow.com/comment/45864603
has body: You have specified Target="_blank" which means "open in a new window". You also say that if you copy the URL it works. This can mean only one thing - the problem is your pop-up blocker. Check top-right corner of your browser to see whether the pop-up was blocked. There is a nice walkthrough for all browsers. EDIT: During the chat we've discovered that user1698232 is generating links to files. file://192.168.1.1/Logs/file.xml Those links just don't open for security reasons. Here are the related articles: How to create a hyperlink to shared network directory or file? HTML links to local network shares
has comment: http://stackoverflow.com/comment/45864488
has comment: http://stackoverflow.com/comment/45864575
score: 0
has comment: http://stackoverflow.com/comment/45864682
has comment: http://stackoverflow.com/comment/45864697
has comment: http://stackoverflow.com/comment/45864692
has comment: http://stackoverflow.com/comment/45864547
type: Answer
has comment: http://stackoverflow.com/comment/45864664

http://stackoverflow.com/comment/46072455
comment on: http://stackoverflow.com/q/28906360
type: Comment
type: QuestionComment
score: 1
has text: i tried debuggin too. it went into the jquery library but when it reloaded the page nothing happened again

http://stackoverflow.com/a/28881719
score: 0
type: Answer
has body: Use the function Trigger with the event click $(document).ready(function(){ $("#reset").trigger('click'); });
answers question: http://stackoverflow.com/q/28881540

http://stackoverflow.com/q/28849574
has comment: http://stackoverflow.com/comment/45967259
type: Question
has comment: http://stackoverflow.com/comment/45966665
tagged with: http://stackoverflow.com/tag/html
tagged with: encryption
linked to: http://stackoverflow.com/q/6965107
score: 0
has title: ArrayBuffer and Uinit8Array Values ( Typed Arrays Values )
has comment: http://stackoverflow.com/comment/45967249
has body: How can i print the values of [object ArrayBuffer] and [object Uint8Array] . I have a variable which i on printing gives me the above objects but i am not able to retrieve their values. encryptedBytes = toSupportedArray(e.target.result); where , console.log("to send for encryption - e.target.result : "+e.target.result); gives me the result : to send for encryption - e.target.result : [object ArrayBuffer] and console.log("encryptedBytes : "+encryptedBytes); gives me the result : encryptedBytes : [object Uint8Array] but how can i retrieve the values of the same.
answer count: 0
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/a/28796396
has body: Try $("table tr") .on("click", function(e) { if ($(this).is("tr:last")) { e.preventDefault(); e.stopPropagation(); return false }; // do stuff }); $("table tr") .on("click", function(e) { if ($(this).is("tr:last")) { e.preventDefault(); e.stopPropagation(); return false } console.log($(this).text()) }) a b c 123
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28796309
answers question: http://stackoverflow.com/q/28796309
type: Answer
has comment: http://stackoverflow.com/comment/45867268
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45867226

http://stackoverflow.com/a/28886276
type: Answer
answers question: http://stackoverflow.com/q/28884898
has comment: http://stackoverflow.com/comment/46066907
has body: You're basically there. All you would need to do is wrap the logic you have in the content script as a callback to the window focus event. window.onfocus = function(){ if (test == "OK") { // Setting OK Icon chrome.runtime.sendMessage({"message": "Existing"}); } else { // Setting NOK Icon chrome.runtime.sendMessage({"message": "Not existing"}); } } When user changes focus the background script will receive the runtime message from the context script and change the extension icon accordingly.
score: 0

http://stackoverflow.com/q/28796302
tagged with: php
has comment: http://stackoverflow.com/comment/45875049
has comment: http://stackoverflow.com/comment/45867188
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45867063
has comment: http://stackoverflow.com/comment/45867639
has comment: http://stackoverflow.com/comment/45867104
has title: How to send an image to php through AJAX
type: Question
tagged with: javascript
has body: I am getting an image from file with javascript, then I am attempting to send the image to a PHP script for processing, but I am unable to decipher it inside the php file here is my JavaScript code. var image_file; function getPhoto(){ var file = document.getElementById('ad_photo'); var image = document.getElementById('ad_photo_upload'); var fReader = new FileReader(); fReader.readAsDataURL(file.files[0]); image_file = file.files[0]; fReader.onloadend = function(event){ image.src = event.target.result; } } function update_profile(){ var file = document.getElementById('ad_photo_upload'); var data = new FormData(); data.append('file', image_file); var url = "profile/update/"; HTTP.open("POST", url, true); HTTP.setRequestHeader("Content-type","application/x-www-form-urlencoded"); HTTP.onreadystatechange = function() { if(HTTP.readyState == 4 &amp;&amp; HTTP.status == 200){ document.getElementById("df").innerHTML = HTTP.responseText; } } HTTP.send(data); } PHP public function update(){ var_dump($_POST); } Var_dump result array (size=657) '------WebKitFormBoundary67r2AtAPnklDtBm5 Content-Disposition:_form-data;_name' =&gt; string '"file"; filename="1420338105027.jpg" Content-Type: image/jpeg �����JFIF���������C� ���C �����"�������������� �������}�!1AQa"q2���#B��R��$3br� %' (length=342) ''()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz��������������������������������������������������������������������������' =&gt; string '��i�q' (length=5) '�#��7�u]�ϛ����1D��~���' =&gt; string 'vo����ǃ,|/k�I����Oo�L����_' (length=30) '����N�' =&gt; string '���}z����K�j��3�ى�M5�Z��.k����j{{��_to��e' (length=47) '�j�ZW���FzS�y���-����9_fHߝ:ӢVy1]������O���um;K�˴k��t������ڎ���W��V�KC' =&gt; string '���߻��:��������Z�N��&gt;�&lt;'�6�m���&gt; ����l&lt;?��_�̰��Rl���j���&gt;���p�����L�s{�������."��iWKp���9-|ϻ�����R�q'��' (length=117) '�c�� _X�Z��u��cʻ&gt;O�eV6�F���U��n�r�#����Wf�(&lt;�/�F�' =&gt; string '��4'��S���ce��]���ޯ���@ f������' (length=35) '������6�n�R����2�t�����_�' =&gt; string 'C��s�O���?ܪ�…
has answer: http://stackoverflow.com/a/28800655
has comment: http://stackoverflow.com/comment/45875039
score: 0
has comment: http://stackoverflow.com/comment/45867457
has comment: http://stackoverflow.com/comment/45867719
answer count: 1
has comment: http://stackoverflow.com/comment/45867055
tagged with: ajax
has comment: http://stackoverflow.com/comment/45867122
has comment: http://stackoverflow.com/comment/45867080
has comment: http://stackoverflow.com/comment/45874996

http://stackoverflow.com/q/28862692
score: 1
upvote count: 1
has title: Capturing core-transitionend from core-transition-css
type: Question
tagged with: polymer
tagged with: javascript
has answer: http://stackoverflow.com/a/29019181
has body: I'm trying to use a core-transition-css element to slide a div offscreen and then capture the transition end event. In the code below the animation works but the callback never fires. Can anyone tell me what I'm missing? Test page Animate It's a div
answer count: 1
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/29019181
type: AnsweredQuestion

http://stackoverflow.com/comment/66899770
type: AnswerComment
type: Comment
has text: You just saved me from a big headache..ty +1
comment on: http://stackoverflow.com/a/31929313
score: 2

http://stackoverflow.com/a/28845184
has body: You got mispelling of set variable. In example 2 i assume you're getting error var not defined. That is because you set value to DayOfShow and below you set inner html to DayofShow. Javascript is case sensitive. Here you can read more about JS.
type: Answer
answers question: http://stackoverflow.com/q/28845061
score: 0

http://stackoverflow.com/comment/46316859
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28999918
has text: If you want to ask continue this discussion, I'm usually on the #tablesorter channel on freenode.net
score: 0

http://stackoverflow.com/a/75567419
type: Answer
has body: const session = require('express-session'); app.use(session({ secret: 'your-secret-key', resave: false, // or true if you want to save the session even if it wasn't modified saveUninitialized: false // or true if you want to save a new session that hasn't been modified }));
has comment: http://stackoverflow.com/comment/133391069
answers question: http://stackoverflow.com/q/28839532
score: 0

http://stackoverflow.com/comment/46036638
score: 0
has text: @Roamer-1888 - the script isn't static: it's delivered by my Django backend which pulls content on some of the >1000 possibilites from a database.
comment on: http://stackoverflow.com/q/28886835
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28810449
has comment: http://stackoverflow.com/comment/45893121
has comment: http://stackoverflow.com/comment/45893153
answer count: 1
has comment: http://stackoverflow.com/comment/45893088
has title: Script not working on .load 'ed DIV in IE
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28810577
has body: On my main page I run a jQuery to load another page on document ready like this. $(document).ready(function(){ $("#function-content").load(pagefunction + ".php?machineid=" + machineid); }); This works perfect and loads the page content to #function-content. On the other page I need to load a .js to make things on this page work. I do it by appending the script source to the header with som jQuery. &lt;script type="text/javascript"&gt; $('head').append('&lt;script src="../../js/some_script.js" type="text/javascript"&gt;'); &lt;/script&gt; Chrome loads this javacript file very well (IE also seems to load it) but the script is not working on the #function-content element in IE. (the script is for sorting inside tables - but I don't think it's relevant - the script works perfect in IE when the table and the script is loaded directly on a page)
tagged with: internet-explorer
has comment: http://stackoverflow.com/comment/45893321
type: Question
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/a/28887325
upvote count: 2
has comment: http://stackoverflow.com/comment/46179690
type: AcceptedAnswer
has body: First you need to create one factory that will responsible for $http.post call which has been exposed to other, and it will return promise object. You can call that service method by adding dataService factory as reference on controller dependency. Controller will call the service function like dataService.getData(url, data) &amp; on each promise resolved it will increament counter, update the data and then call the next post if arrayItems count doesn't exceeds by counter. Factory var myModule = angular.module('myModule', []); myModule.factory('dataService', function($http) { var getData = function(url, data) { return $http.post(url, { data }).then(function(res) { return res.data; }); }; return { getData: getData } }); Controller myModule.controller('mainCtrl', function($scope, dataService) { //other code $scope.counter = 0; $scope.makeANewHttpRequest = function(id) { dataService.getData(url+id, data).then(function(data) { $scope.data = data; //updated the data each time when response received ++$scope.counter; //increment counter if ($scope.counter &gt;= $scope.arrayItems.length) //check counter should not exceed limit $scope.makeANewHttpRequest(id); }); } }); HTML ng-click="counter=0;$scope.makeANewHttpRequest(id)" //clear count and call method Hope this could help you, Thanks.
answers question: http://stackoverflow.com/q/28887104
has comment: http://stackoverflow.com/comment/46174495
accepted answer of: http://stackoverflow.com/q/28887104
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/46174387
downvote count: 0
has comment: http://stackoverflow.com/comment/46073551

http://stackoverflow.com/q/28896885
has answer: http://stackoverflow.com/a/28897000
tagged with: regex
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28897000
has body: Say I have this string: This is a test sentence. Actually, it is a paragraph really. Lets see how this goes And I want to chunk it on individual words (including punctuation). For example, 2 words at a time: This is a test sentence. Actually, it is a paragraph really. Lets see how this goes I can get individual words using: /\w*(\D)\s*/g Thats great, but when I try 3 words using something like this: /(\w*\D)\s(\w*\D)\s(\w*\D)/g It doesn't feel right, and doesn't look very elegant. Some words are left "dangling" too.
has answer: http://stackoverflow.com/a/28896928
type: Question
possible better answer: http://stackoverflow.com/a/28896928
tagged with: javascript
score: 0
answer count: 2
has title: Looking for a regex to chunk a string into 2,3,4... words

http://stackoverflow.com/comment/45941260
type: QuestionComment
has text: It seems that Nginx doesn't do much, it just proxies the connection. So NodeJS has to listen on TCP: http://www.hacksparrow.com/tcp-socket-programming-in-node-js.html Then you have to implement the WebSocket protocol according to rules posted in the SO thread above (with handshake, masking, etc.). That's assuming you don't want to use any library which I guess you should. That stuff although not hard it is time consuming and error prone.
score: 1
comment on: http://stackoverflow.com/q/28831331
type: Comment

http://stackoverflow.com/q/28759438
has comment: http://stackoverflow.com/comment/45799057
type: Question
tagged with: internet-explorer-8
linked to: http://stackoverflow.com/q/9353798
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has body: I have created Svg country footprint map.its Working Well all Google chrome and Mozilla Firebox.Finally when run my code browser internet explorer working well above version IE 9+ all working.But Not at all working Below version of Internet Explorer 8 and Internet Explorer 7.how to fix my error ?how to run my code in IE8?
has answer: http://stackoverflow.com/a/28803531
accepted answer: http://stackoverflow.com/a/28803531
has title: Svg Tag Not working In IE8?
type: AnsweredQuestion

http://stackoverflow.com/comment/45845286
comment on: http://stackoverflow.com/a/28784471
type: AnswerComment
has text: Thanks a lot! It works :) I'm just wondering if you know why it doesn't work my way? (using onchange etc).
type: Comment
score: 0

http://stackoverflow.com/q/28854460
score: 0
answer count: 3
has title: How to catch model value in Angular which appended with click?
tagged with: jquery
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/28854573
has answer: http://stackoverflow.com/a/28856502
has answer: http://stackoverflow.com/a/28854573
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28854816
tagged with: javascript
has body: I have a simple question. But I can't figured it out. I'm trying to catch value of my model(textbox) which I append with click. If I type manually, I can catch value. But otherwise... This is my code Thank you!
has answer: http://stackoverflow.com/a/28854816
type: Question
has comment: http://stackoverflow.com/comment/45975740

http://stackoverflow.com/q/28818142
has comment: http://stackoverflow.com/comment/45908073
tagged with: javascript
has title: How to send a variable var from javascript to java app
answer count: 1
tagged with: web
favorite count: 0
has comment: http://stackoverflow.com/comment/45907968
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28818244
downvote count: 2
has comment: http://stackoverflow.com/comment/45908200
has body: I'm working on an application that i need to send a javascript variable value to an java application by js function. I thought make it changing an local json file, and read it in my java app, but i didn't suceeded. This parse could be throught HttpRequest method or something like this. I'm kind lost in this part of the project, and waiting for a answer. Thank you everybody since now!
tagged with: java
tagged with: http://stackoverflow.com/tag/json
tagged with: httprequest
type: Question
upvote count: 0
score: -2

http://stackoverflow.com/q/28887430
tagged with: jasmine
tagged with: angularjs
has title: How test controller who gets data from promise object
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28888123
accepted answer: http://stackoverflow.com/a/28888123
has body: I have controller who gets data from promise object. Controller look like this: MyApp.controller("BookListController", ["$scope", "BookListModel","LibraryService", function($scope, BookListModel, LibraryService) { LibraryService.getLibraryData().then(function(result) { $scope.books = BookListModel.createBookList(result.bookList.data, result.authorList.data, result.publisherList.data); }); }]); This is my factory who gets data from REST service. MyApp.factory("LibraryService", function($http, $q) { var service = {}; var libraryDataPromise = $q.defer(); $q.all({ books : $http.get("http://localhost:8080/library/service/books"), authors : $http.get("http://localhost:8080/library/service/authors"), publishers : $http.get("http://localhost:8080/library/service/publishers") }).then(function(response) { libraryDataPromise.resolve({ bookList : response.books, authorList : response.authors, publisherList : response.publishers }); }); service.getLibraryData = function() { return libraryDataPromise.promise; } return service; }); Ok, that is all. Now is time to show my test who I wrote. describe("Book_App Controllers", function() { describe("BookListController Test", function() { var BookListModelMock, LibraryServiceMock, scope = {}, controller ,deferred, promise; beforeEach(function() { module("MyApp"); BookListModelMock = new function() { this.createBookList = function(a, b, c) { return [{},{},{}]; }; }; }); beforeEach(inject(function($rootScope, $controller ) { scope = $rootScope.$new(); controller = $controller("BookListController", {$scope : scope, BookListModel : BookListModelMock}); })); beforeEach(inject(function($q) { deferred = $q.defer(); promise = deferred.promise; deferred.resolve([ { data : [{}, {}, {}]} ]) LibraryServiceMock = function() { var service = {}; service.getLibraryData = function() { return promise; } }; })); it("should contains three books", inject(function($rootScope) { $rootScope.$apply(); expect(scope.books.length).toBe(3); })); }); }); When I run t…
type: Question
tagged with: ngmocke2e
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/comment/45902588
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28815007
has text: If you do find yourself needing to write some CSS in jQuery, it's better to do it all in one call, e.g. `$('.navbar-static-top').css({'position': 'fixed', 'top': '0'});` etc (but @Popnoodles is correct: don't write all that CSS in jQuery.)

http://stackoverflow.com/comment/46220862
has text: Its in HTML, JavaScript. not drupal
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28964716
type: Comment

http://stackoverflow.com/a/28768103
has comment: http://stackoverflow.com/comment/45837017
accepted answer of: http://stackoverflow.com/q/28766508
type: AcceptedAnswer
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28766508
has body: I see you posted the question also in the plugin's Github. While you wait for a reply from the creator(s). Here are two "hacky" options that you can go with: Modify a local version of the plugin and remove the alert() towards the end of the code: ... error:function(a){"undefined"!=typeof console&amp;&amp;console.log(a),alert(a)} ... or replace it with the a function that will show the validation text message: ... error:function(a){"undefined"!=typeof console&amp;&amp;console.log(a),myFunction(a)} ... function myFunction(errorMessage) { // PLACE YOUR CODE HERE } Stop the event propagation if the file fails: use the validation events provided by the plug-in to stop the execution of the alert (in particular the onFileInvalid event). $('#WithEvents').MultiFile({ max: 2, max_size: 100, accept: 'jpg', onFileInvalid: function (element, value, master_element, event) { // PLACE YOUR CODE HERE event.preventDefault(); return false; }, }); Truly, this event.preventDefault() doesn't work as it should, but it creates an error that stops the execution of the alert (I know it's not the best solution, but it kind of works). Also, as part of the code that you run, you'll have to reset the value of the input to an empty file or the incorrect one will still be selected (something like $("#myInput").val(""). About making the field as required, you don't have to make changes in the plugin or anything, just indicate that your field is required, then thanks to the magic of HTML5 and your browser, the trick will be done: &lt;input multiple type="file" id="WithEvents" required /&gt; You can see an example working here: http://jsfiddle.net/8ma0vmxd/ (I copied the code of the plugin directly on the JS window so you can easily see where the alert() is towards the end).
downvote count: 0

http://stackoverflow.com/q/28829418
tagged with: javascript
has comment: http://stackoverflow.com/comment/45929233
has answer: http://stackoverflow.com/a/28829537
tagged with: jquery
favorite count: 0
answer count: 3
has body: I am using javascript to load my desired path and i want to do some codes after changing the url. here is my simple code. $(".addfr").click(function(){ var pathname = window.location.pathname; if ((pathname == "/index.php") || (pathname == "/")) { $( "#tabbtn3" ).trigger( "click" ); $('html, body').animate({ scrollTop: $(".sideBaricons").offset().top }, 600); } else{ window.location.href = '/index.php'; $( "#tabbtn3" ).trigger( "click" ); $('html, body').animate({ scrollTop: $(".sideBaricons").offset().top }, 600); } }); When i clicked .addfr when I'm not in index.php I redirect to index.php and I want to focus on specific element after that. But what happens is that my code redirects and focuses on my previous page not after the page loads. advance thanks for the help.
upvote count: 1
has comment: http://stackoverflow.com/comment/45929013
accepted answer: http://stackoverflow.com/a/28829563
has comment: http://stackoverflow.com/comment/45929407
has title: After change URL do something
has answer: http://stackoverflow.com/a/28829557
has answer: http://stackoverflow.com/a/28829563
type: AnsweredQuestion
score: -1
type: Question
downvote count: 2
possible better answer: http://stackoverflow.com/a/28829537

http://stackoverflow.com/q/28775864
tagged with: javascript
favorite count: 0
tagged with: http-status-codes
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45829976
has comment: http://stackoverflow.com/comment/45830228
has body: I'm playing around with implementing a JavaScript server ping tool based on the accepted answer given on this question: Is it possible to ping a server from Javascript?. This essentially works by assuming the pinged server is down if no response has been given after n milliseconds. That's great, and it's a pretty cool way of doing it, however there are two rather large pitfalls: Not all servers do respond within the allocated time. Sometimes an ERR_CONNECTION_TIMED_OUT error is thrown before our timeout timer has finished. Both of these things cause incorrect results. The former suggests that the server is offline when it's possibly online and responding slowly, and the latter suggests the server is online when it's (likely) offline. In an ideal world this code would capture what type of error thrown was thrown and handle this appropriately. After all, if the error thrown is a 404 Not Found error, this counter-intuitively means the server is online and has responded. If we log the image error event, the only thing we see surrounding the error is: Event { ... type: "error" } There's no message or anything hinting at what the error thrown was, and both the 404 and ERR_CONNECTION_TIMED_OUT errors give identical information. What can I do to capture the ERR_CONNECTION_TIMED_OUT error I see in Chrome's JavaScript console, rather than relying on a fixed-speed timer? Update The best way I can replicate this issue is by altering Trante's JSFiddle demo (as linked to in the question I've linked above) to use a 30000ms timer rather than a 1500ms timer: this.timer = setTimeout(function () { if (_that.inUse) { _that.inUse = false; _that.callback('timeout'); } }, 30000); The 'unknown' server should obviously not respond, but instead we see this: In Chrome's console, the following error has been thrown: Failed to load resource: net::ERR_NAME_NOT_RESOLVED As the Image's onerror function has been fired with the generic error as given above, the function believes this to mean that 1.…
answer count: 0
tagged with: error-handling
downvote count: 1
type: Question
upvote count: 5
score: 4
linked to: http://stackoverflow.com/q/4282151
has comment: http://stackoverflow.com/comment/45830342
has comment: http://stackoverflow.com/comment/45830593
has title: Differentiate between different error types on image load

http://stackoverflow.com/a/28797458
has body: Use $compile and $set for this like :- attrs.$set("ng-pattern", "/^([0-9]{5})$|^([0-9]{9})$/"); $compile(element)($scope);
has comment: http://stackoverflow.com/comment/45877545
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45871896
answers question: http://stackoverflow.com/q/28797370

http://stackoverflow.com/a/30721935
type: Answer
has body: Refer to my answer on ngImgCrop not working inside UI Modal. The basic problem is that you are trying to bind an event on a DOM element that might not exist at the time you do the binding. The work around is to wrap the binding in a timeout as shown in the linked answer.
answers question: http://stackoverflow.com/q/28901483
score: 0

http://stackoverflow.com/comment/45847388
score: 0
type: Comment
type: QuestionComment
has text: Nope, nothing still. Tried it with both with preventDefault() and without it. I will craft a plunker ( may take some time, never done so )
comment on: http://stackoverflow.com/q/28785491

http://stackoverflow.com/a/28805533
answers question: http://stackoverflow.com/q/28805223
accepted answer of: http://stackoverflow.com/q/28805223
has comment: http://stackoverflow.com/comment/45884186
score: 5
upvote count: 5
downvote count: 0
has comment: http://stackoverflow.com/comment/45888483
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45890381
has body: You are on the right path but, I would recommend using $broadcast instead of adding a new $watch. Adding a new watcher is more of a local scope solution (in my point of view at least). So it all boils down to sharing data between two independent objects. You can achieve this like so: .directive('d1', ['cData', function() { return { link: function(scope) { // this watch is not working scope.$on('data:changed', function(e, data) { alert(data); } /* scope.$watch( function() { return cData.Value; }, function(newValue, oldValue) { alert(newValue); }) */ } } }) .directive('d2', ['cData', '$rootScope', function() { return { link: function() { element.on('click', function() { $rootScope.$broadcast('data:changed', { value: false }); // cData.Value = false // scope.$digest(); }); // A watch here is working, I have commented it out /*scope.$watch( function() { return cd.showStatus; }, function(newValue, oldValue) { alert(newValue) })*/ } } }]) From my point of view it's the cleanest way to achieve communication between independent objects/directives without much hassle. And the code is pretty clean and decoupled. What do you think?
has comment: http://stackoverflow.com/comment/45887392
type: Answer
has comment: http://stackoverflow.com/comment/45888043

http://stackoverflow.com/comment/129779421
type: QuestionComment
score: 0
has text: I have installed all the third parties and none of them work ... Other than setting NODE_DEBUG=http as environment variable. Is such a shame for nodejs to leave such a vital inspection off
comment on: http://stackoverflow.com/q/28873332
type: Comment

http://stackoverflow.com/q/28786947
tagged with: php
type: AnsweredQuestion
score: 0
has body: I have an interval check thats returning and unexpected token error. I'm doing a call to admin-ajax.php every second and I'm expecting to get an integer value + 1 on each check. I've checked the output of the session variable that I'm using to transfer across from another function and that works fine. I know I'm close to nailing this - just failing at the last hurdle. Any help would be great. Jquery post call function is: var cjd_interval = null; function cjd_interval_checker(){ var cjd_email_fans_nonce = $("#cjd_email_nonce").val(); var data = { 'action': 'cjd_update_progress_bar', nonce: 'cjd_email_nonce' }; $.post(cjdAjax.ajaxurl, data, function(response) { var result = jQuery.parseJSON(response); console.log(result); $("#cjd-progressbar").attr('value', result); }); }; And the PHP function is: function cjd_update_progress_bar() { /** * Check Permissions */ if( current_user_can( 'manage_options' ) ) { $count = $_SESSION['counter']; echo json_encode( $count ); } wp_die(); } add_action( 'wp_ajax_nopriv_cjd_update_progress_bar', 'cjd_update_progress_bar' ); add_action( 'wp_ajax_cjd_update_progress_bar', 'cjd_update_progress_bar' );
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28786999
has comment: http://stackoverflow.com/comment/45849843
has title: Jquery unexpected token <
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/45849827
has comment: http://stackoverflow.com/comment/45850091
tagged with: ajax
accepted answer: http://stackoverflow.com/a/28786999
has comment: http://stackoverflow.com/comment/45849829

http://stackoverflow.com/a/28759181
has body: Just add flex:1 to your bar text box config. As its being managed by a hbox layout this is required to tell the item to fill up as much space (width) as possible
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28754748

http://stackoverflow.com/a/28845122
upvote count: 1
answers question: http://stackoverflow.com/q/28845061
has comment: http://stackoverflow.com/comment/45959084
downvote count: 0
has body: JavaScript is case-sensitive. = DayofShow should be = DayOfShow in example 2.
type: Answer
score: 1

http://stackoverflow.com/a/28794422
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/45864733
score: 2
accepted answer of: http://stackoverflow.com/q/28794296
answers question: http://stackoverflow.com/q/28794296
has comment: http://stackoverflow.com/comment/45865146
has comment: http://stackoverflow.com/comment/45865251
has comment: http://stackoverflow.com/comment/45865354
has comment: http://stackoverflow.com/comment/45864909
type: AcceptedAnswer
downvote count: 0
has body: Map is just a fancy way to say "apply this function to every element in the list" so it could be easily implemented in a for loop. Something like this: (Not perfect or tested, but should give you an idea) function getScrollContainer(c) { c = Object.prototype.toString.call( c ) === '[object Array] ? c : [c]; for (var i = 0; i &lt; c.length; i++) { var cnt = c[i], isWin = !cnt.nodeName || indexOf(cnt.nodeName.toLowerCase(), ['iframe','#document','html','body'] ) != -1; if (!isWin) return cnt; var doc = (cnt.contentWindow || cnt).document || cnt.ownerDocument || cnt; return /webkit/i.test(navigator.userAgent) || doc.compatMode == 'BackCompat' ? doc.body : doc.documentElement; } }
has comment: http://stackoverflow.com/comment/45865070

http://stackoverflow.com/comment/45889570
type: QuestionComment
has text: When I select any option my code redirect But not show selected name in redirect page. Always show "home".
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28808504

http://stackoverflow.com/comment/45799658
type: Comment
type: QuestionComment
has text: also missing a semicolon after x=xmlDoc.getElementsByTagName("title")[0]
score: 0
comment on: http://stackoverflow.com/q/28759719

http://stackoverflow.com/a/28752742
has comment: http://stackoverflow.com/comment/45790181
answers question: http://stackoverflow.com/q/28752586
type: Answer
has comment: http://stackoverflow.com/comment/45788480
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/45787487
has comment: http://stackoverflow.com/comment/45789742
has body: This is wrong xcor: $('#xcor').val(xcor), ycor: $('#ycor').val(ycor), xwid: $('#xwid').val(xwid), yhei: $('#yhei').val(yhei), Those object are holding jQuery objects, not a value. Looks like you want to set the value and use the new value. This makes me cringe, but it would do the job xcor: $('#xcor').val(xcor).val(), ycor: $('#ycor').val(ycor).val(), xwid: $('#xwid').val(xwid).val(), yhei: $('#yhei').val(yhei).val(), You would be better off updating them before the call and just using the variable when setting the object. Or just use jQuery serialize() and don't deal with grabbing the elements.
has comment: http://stackoverflow.com/comment/45787465
downvote count: 0

http://stackoverflow.com/comment/45903397
type: AnswerComment
comment on: http://stackoverflow.com/a/28815258
type: Comment
has text: Yes, if you're appending multiple inputs with the same name, ` `. When you submit, `$_POST['test']` will contain an array of all the values in your input element with the name `test`.
score: 0

http://stackoverflow.com/a/28779014
has comment: http://stackoverflow.com/comment/45836445
has comment: http://stackoverflow.com/comment/45835581
type: Answer
has comment: http://stackoverflow.com/comment/45836260
has comment: http://stackoverflow.com/comment/45836120
has comment: http://stackoverflow.com/comment/45835785
has comment: http://stackoverflow.com/comment/45844305
score: 0
has body: Try this: // Make sure the file is on the same server. var file = "http://example.com/url100.txt"; $.get(file,function(txt) { // Split data and convert it into array var lines = txt.responseText.split("\n"); var link = lines[Math.floor(Math.random() * lines.length)]; // Apply plugin here $('#default-usage .to-lock').sociallocker({ buttons: {order:["facebook-like","twitter-tweet","google-plus"]}, twitter: {url:link}, facebook: {url:link}, google: {url:link}, text: { header: "Like us To Unlock This Content", message: "This content is locked. Like us on Twitter, Facebook or Google plus to unlock it." }, locker: {close: false, timer: 0,}, theme: "secrets" }); }); As you said you have use it on BLOGSPOT, and text file exists on another server. Then use this solution. Solution 2: jQuery(document).ready(function ($) { // Add link one by one in "" var social_links = ["link1", "link2", "link3", "link4", "link5", "link6"]; var link = social_links[Math.floor(Math.random() * social_links.length)]; console.log(link); // Apply plugin here $('#default-usage .to-lock').sociallocker({ buttons: {order:["facebook-like","twitter-tweet","google-plus"]}, twitter: {url:link}, facebook: {url:link}, google: {url:link}, text: { header: "Like us To Unlock This Content", message: "This content is locked. Like us on Twitter, Facebook or Google plus to unlock it." }, locker: {close: false, timer: 0,}, theme: "secrets" }); });
has comment: http://stackoverflow.com/comment/45835558
has comment: http://stackoverflow.com/comment/45836319
has comment: http://stackoverflow.com/comment/45835810
has comment: http://stackoverflow.com/comment/45835461
accepted answer of: http://stackoverflow.com/q/28778796
answers question: http://stackoverflow.com/q/28778796
has comment: http://stackoverflow.com/comment/45836434
has comment: http://stackoverflow.com/comment/45844121
has comment: http://stackoverflow.com/comment/45835759
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45835870
has comment: http://stackoverflow.com/comment/45835929
has comment: http://stackoverflow.com/comment/45835655
has comment: http://stackoverflow.com/comment/45836223

http://stackoverflow.com/q/28756638
tagged with: jquery
has title: Add command to jQuery typing effect function
type: UnansweredQuestion
answer count: 0
has comment: http://stackoverflow.com/comment/45797262
type: Question
has body: I've started using jQuery and am trying to implement some sound effects into the page, specifically, typing sounds to match the typing algorithm. I want it automatically turning off the typing sound sound on and off when it's finished typing the text (using document.getElementById('Type').pause()) Where do I insert the code? Placing a line of code after the jQuery simply executes it as it starts typing, not what I need. Here's what I've got: Test
has comment: http://stackoverflow.com/comment/45794253
tagged with: javascript
score: 0

http://stackoverflow.com/q/28850720
tagged with: list
has body: I have 4 javascript variables: a = 'first'; b = 'second'; c = 'third'; d = 'fourth'; What i want to achieve is to get them separated by comma, BUT. Sometimes where could be situations that some variables could be empty. Here is some of examples: EXAMPLE1: a = 'first'; b = ''; c = 'third'; d = ''; OUTPUT should be: first, third EXAMPLE2: a = ''; b = 'second'; c = ''; d = 'fourth'; OUTPUT should be: second, fourth Maybe someone could help me to solve this?
has title: Check variables and add them to comma separated list
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28850787
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28850806
accepted answer: http://stackoverflow.com/a/28850806
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28850787
tagged with: http://stackoverflow.com/tag/csv

dialog
tag name: dialog
tags question: http://stackoverflow.com/q/28811601
tags question: http://stackoverflow.com/q/28816906
type: Tag
tags question: http://stackoverflow.com/q/28847895

http://stackoverflow.com/comment/45868150
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28796860
type: QuestionComment
has text: You should pass the arguments when you call the functions.

http://stackoverflow.com/comment/45834795
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28778480
has text: I wanted to stay away from JQuery AJAX. I've never used it before. How, in my PHP, can I upload the file to a specific folder on the server? Likewise, how can I send a string from the PHP back to the `success: function(data)`?

http://stackoverflow.com/comment/45905605
has text: parameters array will always be zero. there's no push on it before you validate it.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28816876

http://stackoverflow.com/comment/45968301
comment on: http://stackoverflow.com/a/28850297
has text: @Amit - he wants counts for **section** not article :) ;)
score: 0
type: AnswerComment
type: Comment

inheritance
tags question: http://stackoverflow.com/q/28816740
tag name: inheritance
tags question: http://stackoverflow.com/q/28834406
tags question: http://stackoverflow.com/q/28863097
tags question: http://stackoverflow.com/q/28858767
tags question: http://stackoverflow.com/q/28904664
type: Tag
tags question: http://stackoverflow.com/q/28882791
tags question: http://stackoverflow.com/q/28841318
tags question: http://stackoverflow.com/q/28806631
tags question: http://stackoverflow.com/q/28816840
tags question: http://stackoverflow.com/q/28807045
tags question: http://stackoverflow.com/q/28778767
tags question: http://stackoverflow.com/q/28813835

http://stackoverflow.com/q/28783544
answer count: 1
has comment: http://stackoverflow.com/comment/45843438
favorite count: 0
has body: im trying add into local storage variable new line but im not sure how to do that. I have this function: function showHistory() { if (!localStorage.history) { localStorage.history = ""; } localStorage.history = localStorage.history +"something"+"XX"; document.getElementById('history').textContent = localStorage.history; } but if i replace XX with "\n" or "&lt; br>" or something like that if i use this function a still get output like "something something something" instead of something something something
has title: Add new line into localStorage variable
accepted answer: http://stackoverflow.com/a/28783600
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/45843717
downvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28783600
upvote count: 4

http://stackoverflow.com/a/28852412
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28852322
answers question: http://stackoverflow.com/q/28852322
upvote count: 1
type: Answer
has body: Typically you extend default option with custom settings. For this, move settings intialization into renderData function and call it from renderSvg like: this.renderData(options); So the code will become: $.fn.renderData = function (options) { var options = $.extend({}, { renderTo: 'body', width: 800, height: 900, url: 'miserables.json', zoom: true, loadingText: "loading...", margin: { top: -5, right: -5, bottom: -5, left: -5 } }, options); console.log(options.url); // ... }; and $.fn.renderSvg = function (options) { this.renderData(options); // ... };
score: 1
has comment: http://stackoverflow.com/comment/45972384

http://stackoverflow.com/a/28889887
upvote count: 1
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28889824
accepted answer of: http://stackoverflow.com/q/28889824
type: Answer
score: 1
has body: You should have looked at the document you created. That is not how you notate an empty array for serializing in JSON notation. You should have done: var post = { yak: $(e.target).find('[name=yak]').val(), submitted: new Date(), score: 0, users: [] }; Because right now, your "users" field looks like this: "users" : { } Or possibly better yet don't even initialize the field at all and $addToSet will just take care of it for you and create the element when there is something new to add. Schema-less data-stores like MongoDB usually don't require you to go an pre-initialize things like this.

http://stackoverflow.com/comment/45931949
comment on: http://stackoverflow.com/a/28830687
type: AnswerComment
score: 0
type: Comment
has text: Getting a type error on line 9 where i entered: var user = e.user();

http://stackoverflow.com/comment/45845315
has text: I'm sure I read this somewhere and it duly stayed in mind - hacked with traceur (ref. link above).
comment on: http://stackoverflow.com/q/28784375
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28787990
tagged with: javascript
linked to: http://stackoverflow.com/q/27923388
has title: how to update the mouseposition on screen event on window resize?
score: 0
tagged with: trackball
has body: What i need is to update the trackball controls to detect the mouse position event to a different screen size. I have an on click event which shows the position clicked point on screen with a yellow mark. If i refresh and try this event everything works fine, the event.x and event.y coordinates are correct referring at the window.innerWidth - window.innerHeight. When i resize the window the mark has an offset similar with the distortion of the resizing. If i resize the width only the mark has an offset at the axe(x). everything works using trackball controls. I am aware of the handleResize() function but it does not solved my problem.
has comment: http://stackoverflow.com/comment/46029434
answer count: 0
type: UnansweredQuestion
tagged with: three.js
type: Question
has comment: http://stackoverflow.com/comment/45861533

http://stackoverflow.com/a/28889370
score: 0
answers question: http://stackoverflow.com/q/28889215
has comment: http://stackoverflow.com/comment/46040055
type: Answer
has body: This has nothing to do with server-side. But you may achieve what you want with a built-in angular filter, like this: {{ item }} http://plnkr.co/edit/llLirkqIJmEWAue0QdVk?p=preview If you have complex objects, you can also use the same bult-in filter, like this: {{ item.name }} http://plnkr.co/edit/L7DMn0xncHDQqyXDD0TR?p=preview

http://stackoverflow.com/a/28902999
has comment: http://stackoverflow.com/comment/46068106
has comment: http://stackoverflow.com/comment/46066579
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46067789
type: Answer
has comment: http://stackoverflow.com/comment/46068199
has comment: http://stackoverflow.com/comment/46066877
has comment: http://stackoverflow.com/comment/46068035
score: 0
answers question: http://stackoverflow.com/q/28902895
has comment: http://stackoverflow.com/comment/46068259
accepted answer of: http://stackoverflow.com/q/28902895
has body: No, they're separate things. All the gory details are in the spec in §10.4.3 and the sections it links to (particularly §10.5), but fundamentally an execution context has a variable binding object, but it has other things as well, like a reference to its containing context (which is what gives us the scope chain) and the value of this within the context.

app-store-connect
type: Tag
tags question: http://stackoverflow.com/q/28777429
tag name: app-store-connect

http://stackoverflow.com/a/28849589
score: 0
answers question: http://stackoverflow.com/q/28849454
type: Answer
has comment: http://stackoverflow.com/comment/67387149
has comment: http://stackoverflow.com/comment/67386783
has comment: http://stackoverflow.com/comment/67387129
has body: You can Use Hidden Fields to Save your List as Comma Separated Values &lt;asp:HiddenField runat="server" id="hdf" /&gt; In JS $('&lt;%#hdf.CliendID%&gt;').value="1,2,3,4,5,6,7,8,9"; width,height,length,width,height,length....

http://stackoverflow.com/q/28786498
has comment: http://stackoverflow.com/comment/45879272
has comment: http://stackoverflow.com/comment/45849676
has comment: http://stackoverflow.com/comment/45872577
has title: Google maps not full size unless you refresh page with jquery mobile
has comment: http://stackoverflow.com/comment/45849612
has comment: http://stackoverflow.com/comment/45849815
tagged with: jquery-mobile
tagged with: javascript
favorite count: 0
tagged with: google-maps-api-3
score: 0
has comment: http://stackoverflow.com/comment/45849448
has comment: http://stackoverflow.com/comment/45881458
tagged with: http://stackoverflow.com/tag/html
has body: I am using jquery mobile to create a webpage and I followed the tutorial found here: https://www.youtube.com/watch?v=yANtE1b8cLc Basically in a nutshell the video is about adding multiple markers on a google maps and then making sure all the markers are shown on the map at the same time. MY problem is that when i load the page whether on my phone or my computer the map is not the correct size BUT the height and width of what the map SHOULD be is visible Now if i refresh the page the map becomes full size. I am just guessing but maybe the page is loading without finishing loading the google maps api BUT i am just guessing Here is the code I used to create the map function init() { var mapDiv = document.getElementById("map_canvas3"); var mapOptions = { center: new google.maps.LatLng(48.8582, 2.2945), zoom: 13, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(mapDiv, mapOptions); var locations = []; locations.push ( {name:"Eifel Tower", latlng: new google.maps.LatLng(48.8582, 2.2945)} ); locations.push ( {name:"The Louvre", latlng: new google.maps.LatLng(48.8611, 2.3364)} ); var bounds = new google.maps.LatLngBounds (); for (var i=0;i<locations.length;i++ ) { var marker = new google.maps.Marker({position: locations[i].latlng, map:map, title:locations[i].name}); bounds.extend (locations[i].latlng); } map.fitBounds (bounds); } window.onload = init; Here is the html Back And here is what it looks like for me now !https://www.flickr.com/photos/rubberducky/16487881658/ Is there a line of code that I can enter to fix this problem?
answer count: 0
has comment: http://stackoverflow.com/comment/45894814
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/7816645
upvote count: 1
tagged with: maps
downvote count: 1
has comment: http://stackoverflow.com/comment/45849584
has comment: http://stackoverflow.com/comment/45884413
has comment: http://stackoverflow.com/comment/45905457
type: Question
has comment: http://stackoverflow.com/comment/45853359

http://stackoverflow.com/comment/45906343
has text: Im using EJS. So it would look like:
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28817348
type: Comment

http://stackoverflow.com/comment/46192756
has text: Using an array guarantees you the order of the data. Please don't forget to mark the answer as accepted if it fixed your problem.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28825574

http://stackoverflow.com/comment/46141800
comment on: http://stackoverflow.com/a/28941459
type: Comment
score: 0
type: AnswerComment
has text: yea, that was just an example. check out: http://socket.io/demos/chat/ which is what you want.

http://stackoverflow.com/comment/45946721
type: Comment
type: QuestionComment
has text: @NateW http://jsbin.com/civeluxuzi/1/edit?html,css,js,output
score: 0
comment on: http://stackoverflow.com/q/28837875

http://stackoverflow.com/q/28865929
type: Question
tagged with: internet-explorer
tagged with: javascript
has answer: http://stackoverflow.com/a/28907462
tagged with: ajax
downvote count: 0
answer count: 1
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
upvote count: 1
tagged with: xmlhttprequest
has title: XMLHttpRequest missing body for PATCH in IE9
has body: I'm trying to call an API using the PATCH http method from IE9, every time the XMLHttpRequest is sent it drops the actual request body. The actual request is coming from an AngularJS application. Angular just uses the native xhr under the covers in it's $http service. I've verified the behavior is not Angular-specific running the snippet below in the IE console and inspecting the network traffic - no body gets sent with the request var request = new XMLHttpRequest(); request.open('PATCH', '/api/v1/fake/404/', false); request.setRequestHeader("Content-type","application/json"); request.send('{"isActive": 1}'); if you change PATCH to PUT or POST it sends the json request body just fine. Is PATCH just not supported in IE9 XHR? Is there any workaround?
score: 1

http://stackoverflow.com/comment/45971803
score: 0
type: Comment
has text: I think that the link has to redirect you to a php script, create a $_SESSION with the form's data and redirect with header("location: advertisementPage.php"), show the advertisement. generate the button after the countdown, and with that button come back to form and fill the form's data with the $_SESSION variables cretaed in your script and show de submit button after checking if the $_SESSION variables exist. It's easy, but you need to have knowledges of PHP or another server-side languages .
type: AnswerComment
comment on: http://stackoverflow.com/a/28851547

ecmascript-harmony
tag name: ecmascript-harmony
type: Tag
tags question: http://stackoverflow.com/q/28829775
tags question: http://stackoverflow.com/q/28756928

http://stackoverflow.com/q/28884876
type: UnansweredQuestion
upvote count: 1
has title: Parse Cloudcode: putting functions into different files
score: 1
type: Question
answer count: 1
tagged with: javascript
has body: Hi I am very new to Parse Cloudcode and JS. In Cloudcode we need to put functions inside main.js in order to use them. Is there anyway I can organize them into different files and import within main.js so that I can keep main.js clean and short? If so, how to do it? Also question regarding to debugging: Is there anything like NSLog (Printing out anything on the console) in Cloud code or break point so that I can easily debug my code on cloudcode? Thanks
downvote count: 0
has comment: http://stackoverflow.com/comment/46031324
has answer: http://stackoverflow.com/a/28890707
favorite count: 0
tagged with: parse-platform

http://stackoverflow.com/comment/46052698
type: AnswerComment
score: 0
type: Comment
has text: @DimitrisPapageorgiou Thanks for the link but I don't understand how to use it. Can you explaine me how to use it with the code i've writed on my first post please ?
comment on: http://stackoverflow.com/a/28877689

http://stackoverflow.com/comment/46032453
comment on: http://stackoverflow.com/a/28885385
score: 0
type: AnswerComment
has text: Nope. That doesn't work. The problem is Safari, for some reason, processes it's events differently than every other browser and wants to handle the submit before everything else. The setTimeout was a hack some people had said worked. It didn't. Unfortunately, neither did your suggestion.
type: Comment

http://stackoverflow.com/comment/45802079
type: QuestionComment
has text: I installed jsdom and required it, but then it gives me this mistake `c:\xampp\htdocs\calculator\node_modules\jsdom\lib\jsdom\living\helpers\validate-names.js:2 const xnv = require("xml-name-validator"); ^^^^^ SyntaxError: Use of const in strict mode`
score: 0
comment on: http://stackoverflow.com/q/28760568
type: Comment

http://stackoverflow.com/comment/45920987
score: 0
has text: @Bamar thanks, but its only for testing. I would like to get the colDATA for a new SQL Select. It should display more details to the selected data item in the grid. How can I do this - I am totally newbee. Thanks a lot!
type: QuestionComment
comment on: http://stackoverflow.com/q/28825060
type: Comment

http://stackoverflow.com/comment/45923171
has text: @Ethaan after some try-error, I finally found that the problem is the global layout used at the Iron Router. If I remove it and use the route template without a layout, it works. I will try to update this evening the question adding the layout code, just in case I made some terrible mistake, but it is so simple that it's strange. Isn't it legit using a layout and a then also a template? I thought that was what the Discover Meteor book taught.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28817183
type: AnswerComment

http://stackoverflow.com/a/28838597
has body: You probably want to use findOneByIdAndUpdate. In terms of working with Arrays in mongodb, for adding the item to an array you want to use $push and to remove an item from an array, you want to use $pull. http://docs.mongodb.org/manual/reference/operator/update/push/
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28836674
has comment: http://stackoverflow.com/comment/45961086
accepted answer of: http://stackoverflow.com/q/28836674
downvote count: 0
has comment: http://stackoverflow.com/comment/46020375
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/47280111

http://stackoverflow.com/a/28901416
score: 3
downvote count: 0
type: Answer
has body: for (i;i&lt;=res.items.length;i++){ should be for (i;i&lt;res.items.length;i++){
answers question: http://stackoverflow.com/q/28901335
upvote count: 3

http://stackoverflow.com/q/28887250
has comment: http://stackoverflow.com/comment/46035883
upvote count: 10
downvote count: 1
answer count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: garbage-collection
has body: So, I heard you can supposedly do all fancy real-time games using JS these days. And I'm no beginner at it, so I though I should give it a try. Wrote some micro (incomplete) physics engine with some collision detection, all sweet. Somewhat laggy though, expected GC interrupts. So tried to minimize any allocation, till I was unable to see anything that should allocate memory in game loop. No allocations => no cleanup I though. But here is what I get: Now, this is not neat at all. So I tried removing my stuff from game loop in various ways. Still SAW. So no I present you the complete code that generates this: Amazing? Well this uses requestAnimationFrame as it seems this is what should be used for smooth performance. At first I tried set interval like so: Exactly the same thing! This seems completely unacceptable, but I have no ideas how to stop this SAW. I looked a lot about debugging memory and stuff, that was while I though that problem was in my drawing and updating functions. But these to snippets, have basically nothing, and yet they produce that memory patter. Maybe it is my browser? Or is it inescapable, and JS is unusable for anything real-time? I would like to believe that someone on the web knows something I don't as there are lot's of people promising wonders with JS. What am I doing wrong in these snippets? EDIT: by the way removing console log changes nothing, in case anyone thinks thats the problem.
has comment: http://stackoverflow.com/comment/46097659
has title: What is eating my memory? (The SAW, JS mem usage edition)
tagged with: memory
has comment: http://stackoverflow.com/comment/46098095
score: 9
type: Question
has comment: http://stackoverflow.com/comment/46035968
has comment: http://stackoverflow.com/comment/46097530
has answer: http://stackoverflow.com/a/28920488
tagged with: javascript
has comment: http://stackoverflow.com/comment/46035867

http://stackoverflow.com/comment/45914861
comment on: http://stackoverflow.com/a/28821464
score: 0
type: AnswerComment
type: Comment
has text: Sorry for the lack of clarity. @Grimbode has the idea. I want to take in 3 pieces of information. The book name, publisher and ISBN from 3 separate text boxes. Then apply the strings in these text boxes to a new object in this JS array.

http://stackoverflow.com/q/28826453
answer count: 1
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/28826939
tagged with: polygons
has title: How to except area from polygon in google maps api
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/28826939
tagged with: google-maps
tagged with: javascript
has body: I have coordinates of two polygons (P1 and P2) to create it on google maps. How cut P2 from P1 when P2 is located in P1? For example http://quality.iro38.ru/CI/question_about_map.php This is my js: var triangleCoords = [ new google.maps.LatLng(25.774252, -80.190262), new google.maps.LatLng(18.466465, -66.118292), new google.maps.LatLng(32.321384, -64.75737), new google.maps.LatLng(25.774252, -80.190262) ]; var triangleCoords1 = [ new google.maps.LatLng(29,-69), new google.maps.LatLng(23,-72), new google.maps.LatLng(25,-70), new google.maps.LatLng(29,-69) ]; bermudaTriangle = new google.maps.Polygon({ paths: [triangleCoords, triangleCoords1], strokeColor: '#FF0000', strokeOpacity: 0.8, strokeWeight: 2, fillColor: '#FF0000', fillOpacity: 0.35 }); bermudaTriangle.setMap(map);

http://stackoverflow.com/a/28888061
has body: Here is an example of what you could use. This is very bareboned. All the $http fucntions work with promises. The controller will get the settings from the service when, if that is empty it requests new settings from the service angular.module('app').controller('appctrl',['appsrv','$scope',function(appsrv, $scope){ $scope.settings = service.settings; if(!$scop.settings){ //retrieve data from server when it's not in the service appsrv.getSettingsRemote().then($scope.settings = service.settings); } }]).service('appsrv',[$http, function($http){ return { getSettings : function (){ // get settings from localstorage }, setSettings : function (){ // store settings to localstorage }, getSettingsRemote : function () { $http.get('url').then(//set things locally); } } }]); Then from your view you could just assign the controller to the view and then reference to your settings like {{settings.propname}} I don't want to write all your code but maybe this has given you insight in what you could do
type: AcceptedAnswer
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/28887601
has comment: http://stackoverflow.com/comment/46037754
score: 2
accepted answer of: http://stackoverflow.com/q/28887601
has comment: http://stackoverflow.com/comment/46037646
has comment: http://stackoverflow.com/comment/46037579
has comment: http://stackoverflow.com/comment/46037440
downvote count: 0
has comment: http://stackoverflow.com/comment/46037823
has comment: http://stackoverflow.com/comment/46037959

http://stackoverflow.com/comment/45883075
has text: why i most post it here?
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/28804795
type: Comment

http://stackoverflow.com/a/28803322
type: Answer
answers question: http://stackoverflow.com/q/28802259
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28802259
has body: It looks like you may need to wrap the <?php echo ...; ?> statements in the javascript in quotes: '<?php echo ...; ?>' or "<?php echo ...; ?>" As it stands now, assuming each $ssimageX contains a string looking something like "X.jpg", the javascript ends up looking like {image : X.jpg, title : ' ', thumb : '', url : ''} Which would result in a ReferenceError unless X is defined, and could be a SyntaxError if the url has a / in it. My guess is you want it to look more like {image : 'X.jpg', title : ' ', thumb : '', url : ''}
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/45830683
score: 0
type: Comment
has text: Thanks! Have you tried putting a breaking on the `userCount = members.count;` line to make sure it is being hit?
type: QuestionComment
comment on: http://stackoverflow.com/q/28776267

http://stackoverflow.com/comment/45983179
type: QuestionComment
has text: @KevinB, thanks for replying, Quentin's answer below solved the problem. Obviously you are right about the header. The key for me was that return false. Thanks again!
comment on: http://stackoverflow.com/q/28858411
score: 0
type: Comment

http://stackoverflow.com/a/28778585
answers question: http://stackoverflow.com/q/28778549
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45834814
has body: The thing is, when you get the inputText value from your dom, it is a string. For example, "12" is a string, vs. a 12 What you can do is to check if it is not a number: function alertType() { var someStr = document.getElementById("inputText").value; if(isNaN(someStr)){ //it's not a number! } else { //it's a number! } }

http://stackoverflow.com/q/28891141
score: 1
accepted answer: http://stackoverflow.com/a/28911306
tagged with: amd
upvote count: 1
type: Question
has body: I have done a lot of research but can't find the answer I am looking for, so here goes. I have a bower component which has its own dependencies: /vendor/bower_components/my_module/my_module.js /vendor/bower_components/my_module/dependency_1.js /vendor/bower_components/my_module/dependency_2.js Inside of my_module.js, it loads its dependencies using relative paths: define(["./dependency_1", "./dependency_2"], function (dep1, dep2) { ... }); But when my requirejs config.paths is set up: paths: { my_module: "/vendor/bower_components/my_module/my_module" } ... now the relative paths are relative to the base requirejs path and not the full path for my_module. I understand why this is happening (because the module id is no longer the full path, but rather the shortened name), I just don't know how to solve it. I am pretty sure packages is the right direction, I'm just not having any luck. How should I go about this? my_module is a third party module btw and would rather not edit it. Thanks. UPDATE - Example uses of code within my application: Scenario 1 (without config.paths): define(["/vendor/bower_components/my_module/my_module"], function(myModule) { // This works. No issues here. // The reason this works is because the module ID for myModule is: // "/vendor/bower_components/my_module/my_module" // Therefore, the relative paths "./dependency_1" and "./dependency_2" // are resolved against that module ID. }); Scenario 2 - now my_module is defined in config.paths (see above): define(["my_module"], function(myModule) { // Error, cannot load files dependency_1.js or dependency_2.js // This is because relative paths are resolved against a module's ID. // Now the module ID is "my_module", not "/vendor/bower_components/my_module/my_module" // As such, the paths for ./dependency_1 and ./dependency_2 are resolved against "/" }); Unfortunately (or not?) this happens by design: http://requirejs.org/docs/api.html#modulenotes-relative-names. We should be able to use packages to res…
has comment: http://stackoverflow.com/comment/46048461
tagged with: javascript
has comment: http://stackoverflow.com/comment/46076284
has title: requirejs + bower, paths and dependencies within bower components
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/28911306
favorite count: 0
tagged with: requirejs
tagged with: bower
type: AnsweredQuestion

http://stackoverflow.com/q/28814585
has comment: http://stackoverflow.com/comment/45901217
has answer: http://stackoverflow.com/a/54088961
type: Question
has answer: http://stackoverflow.com/a/45079295
has comment: http://stackoverflow.com/comment/45901162
has comment: http://stackoverflow.com/comment/134315628
has comment: http://stackoverflow.com/comment/45924730
has answer: http://stackoverflow.com/a/54015067
has answer: http://stackoverflow.com/a/54805123
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/43718478
has answer: http://stackoverflow.com/a/66916744
has comment: http://stackoverflow.com/comment/45901185
upvote count: 462
has answer: http://stackoverflow.com/a/40492432
has title: How to check if type is Boolean
has answer: http://stackoverflow.com/a/48788480
tagged with: types
has answer: http://stackoverflow.com/a/51170732
has answer: http://stackoverflow.com/a/43718478
answer count: 18
favorite count: 0
has answer: http://stackoverflow.com/a/47074621
has body: How can I check if a variable's type is of type Boolean? I mean, there are some alternatives such as: if(jQuery.type(new Boolean()) === jQuery.type(variable)) //Do something.. But that doesn't seem pretty to me. Is there a cleaner way to achieve this?
linked to: http://stackoverflow.com/q/4059147
has answer: http://stackoverflow.com/a/28814695
has answer: http://stackoverflow.com/a/28814831
score: 461
has answer: http://stackoverflow.com/a/28814865
has answer: http://stackoverflow.com/a/69216399
downvote count: 1
has answer: http://stackoverflow.com/a/64364757
has answer: http://stackoverflow.com/a/48515271
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/45508651
has comment: http://stackoverflow.com/comment/45901099
has answer: http://stackoverflow.com/a/28814615
accepted answer: http://stackoverflow.com/a/28814615
has comment: http://stackoverflow.com/comment/45940451

http://stackoverflow.com/comment/46008796
type: Comment
comment on: http://stackoverflow.com/q/28873058
score: 5
type: QuestionComment
has text: Do you understand this code?

http://stackoverflow.com/a/28859081
answers question: http://stackoverflow.com/q/28858316
downvote count: 0
type: Answer
has body: Something like: var checkedIds = []; for(var i = 1; i &lt;= 10; i++) { var elem = $("input#a" + i); if(elem.is(":checked")) { checkedIds.push(i); } }
upvote count: 1
score: 1

http://stackoverflow.com/q/28862259
upvote count: 7
answer count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/28862830
favorite count: 0
has comment: http://stackoverflow.com/comment/45991232
score: 6
has comment: http://stackoverflow.com/comment/45989808
type: AnsweredQuestion
has title: setInterval() that pauses when user leaves the tab?
linked to: http://stackoverflow.com/q/5766263
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28862830
linked to: http://stackoverflow.com/q/15871942
has body: Is there any method in javascript that would behave like setInterval() and would stop when user leave the tab and resume when user enter the tab again?

http://stackoverflow.com/q/28841454
answer count: 2
has comment: http://stackoverflow.com/comment/45952600
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
possible better answer: http://stackoverflow.com/a/28841886
has body: I'm using Ruby on Rails framework and I love it. Until now I was using the show.html.haml for my views and everything worked fine. We wanted to add another option of supporting a GET request which consists the post-fix .js. For this purpose we added to the controller another parallel view named show.js.haml. The "magic" of Rails knows to route .html post-fix requests to the first and .js post-fix requests to the latter. The problem is when a request gets routed to the show.js.haml view, I can't find a way to write the content of external .js files. All I get is the text itself (i.e. &lt;script src="myscripts.js" type="text/javascript"&gt;&lt;/script&gt;) but not the actual content of the file. I've found a solution, which surely isn't optimal (performance, robustness etc): downloading the file to the server and use the following function: != File.open(Rails.root.join('public' , 'js', 'jquery-1.11.2.min.js'), 'rb').read This is the only way I found to actually write the content of a .js file. There must be a Ruby's elegant way to write the content of external .js files into a .js.haml file. Any help would be appreciated here. Thanks!
accepted answer: http://stackoverflow.com/a/28841974
tagged with: haml
has answer: http://stackoverflow.com/a/28841886
tagged with: external
tagged with: view
upvote count: 1
tagged with: ruby-on-rails
type: Question
has comment: http://stackoverflow.com/comment/45973119
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28841974
has title: How to write the content of external .js files in a js.haml file (Ruby on Rails)

http://stackoverflow.com/comment/45999680
type: QuestionComment
has text: Could you make it so the scripts are only loaded/initialized if the object doesn't already exist?
comment on: http://stackoverflow.com/q/28867547
score: 0
type: Comment

http://stackoverflow.com/q/28777939
has comment: http://stackoverflow.com/comment/45833778
has comment: http://stackoverflow.com/comment/45833772
type: UnansweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/45833922
has title: Javascript code some times don't execute when step into (F11)?
has comment: http://stackoverflow.com/comment/45834212
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28778022
score: 0
has body: The code is as below: There are breakpoints setting beside the lines (Break Point 1, Break Point 2). if (!TestSolution) { var TestSolution= {}; } TestSolution.Utils = TestSolution.Utils || {}; var dummy_ = (function () { // Sometimes step into the line just pop out. // The following lines will not run. **var self = this;** // Break point 1. // Subscribe to event optionally unsubscribing first. **this.Subscribe = function(source, eventName, handler, unsubscribe)** // Break point 2. { // By default - always unsubscribe first - there is hardly a reason to have // multiple subscriptions for the same combination of controls and events. if (!(unsubscribe === false)) $(source).off(eventName, handler); $(source).on(eventName, handler); } }).call(TestSolution.Utils); The question is that some times when it goes to break point 1, and when press F11, it doesn't go to break point 2. I feel that "var self = this;" is not running. It just pop out of the function. Edit: This is debugged in Chrome(Version 41.0.2243.0 (64-bit)).

http://stackoverflow.com/q/28890630
type: UnansweredQuestion
score: 1
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/46043049
type: Question
upvote count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/46043059
has title: Javascript fails to fetch Json data from url
favorite count: 0
tagged with: jqxhr
has comment: http://stackoverflow.com/comment/46042269
has body: I am trying to fetch json data from my server using Javascript, and I followed the solution provided here. But It doesn't work for me. And I found out that xhr.onload = function() not run in my case. How to figure it out? &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;body&gt; &lt;div id="result" style="color:red"&gt;&lt;/div&gt; &lt;script&gt; var getJSON = function(url) { return new Promise(function(resolve, reject) { var xhr = new XMLHttpRequest(); xhr.open('get', url, true); xhr.responseType = 'json'; xhr.onload = function() { var status = xhr.status; if (status == 200) { resolve(xhr.response); } else { reject(status); } }; xhr.send(); }); }; getJSON('http://qlin.parseapp.com/version2/myres.txt').then(function(data) { alert('Your Json result is: ' + data.result); //you can comment this, i used it to debug result.innerText = data.result; //display the result in an HTML element }, function(status) { //error detection.... alert('Something went wrong.'); }); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt;
linked to: http://stackoverflow.com/q/9922101
answer count: 0
downvote count: 0

http://stackoverflow.com/comment/45901856
has text: @RoryMcCrossan I believe the question is about the fact that "jQuery" is passed as an argument, with the formal parameter having the name "$".
type: QuestionComment
comment on: http://stackoverflow.com/q/28815011
score: 0
type: Comment

http://stackoverflow.com/q/28830208
has comment: http://stackoverflow.com/comment/45934079
has comment: http://stackoverflow.com/comment/45934690
has comment: http://stackoverflow.com/comment/45930429
has comment: http://stackoverflow.com/comment/45934261
has title: PUT method HTTP Status 400 in Spring MVC - AngularJS
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45934670
tagged with: spring
tagged with: spring-mvc
tagged with: java
type: Question
answer count: 1
tagged with: javascript
has body: I am trying to update the Company object, as you can see in company.js below. When I try to call the put method from company.js, it gives me the 400 Status error and the execution does not enter in the put method in CompanyController.java. Company object is also available in $scope. While executing the final URL in company.js is: http://localhost:8080/Jobkreisel/protected/company/50 but it does not even enter in the update method in CompanyController.java, just move to the error block in $http.put(url, $scope.company, config) method. company.js $scope.updateCompany = function (updateCompanyForm) { if (!updateCompanyForm.$valid) { $scope.displayValidationError = true; return; } $scope.lastAction = 'update'; var url = '/Jobkreisel/protected/company/' + $scope.company.companyID; var config = {}; alert("Company scope "+$scope.company.companyID); alert("Company config "+config); $http.put(url, $scope.company, config) .success(function (data) { alert('In update success'); }) .error(function(data, status, headers, config) { console.debug(data); alert('data:' + data); alert('status: ' + status); alert('update error'); }); }; CompanyController.java @Controller @RequestMapping(value = "/protected/company") public class CompanyController extends UserBaseController { @Autowired private CompanyService companyService; @RequestMapping(value = "/{companyID}", method = RequestMethod.PUT, produces = "application/json") public ResponseEntity<?> update(@PathVariable("companyID") int companyId, @RequestBody Company company, Locale locale) { if (companyId != company.getCompanyID()) { return new ResponseEntity<String>("Bad Request", HttpStatus.BAD_REQUEST); } companyService.save(company); return null; } } Please tell me why its not executing the success block. web.xml <?xml version="1.0" encoding="UTF-8"?> dispatcher org.springframework.web.servlet.DispatcherServlet contextConfigLocation /WEB-INF/spring/spring.xml 1 dispatcher / org.springframework.web.context.ContextLoaderListener contex…
score: 0
has comment: http://stackoverflow.com/comment/45934312
has answer: http://stackoverflow.com/a/28832810

http://stackoverflow.com/a/28767721
upvote count: 2
answers question: http://stackoverflow.com/q/28767678
score: 2
has body: Did you try $(this).closest('tr').find('&gt;td'); The > only select direct descendants (first level children)
downvote count: 0
type: Answer

http://stackoverflow.com/q/28860850
has comment: http://stackoverflow.com/comment/45987396
has title: use javascript function in xslt 1.0
tagged with: javascript
score: 0
tagged with: xslt-1.0
has comment: http://stackoverflow.com/comment/46008597
has comment: http://stackoverflow.com/comment/46003356
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45987587
answer count: 0
has body: I have a problem calling javascript function in xslt 1.0. here my code: &lt;xsl:stylesheet version="1.0" exclude-result-prefixes="x d xsl msxsl cmswrt user" xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:cmswrt="http://schemas.microsoft.com/WebParts/v3/Publishing/runtime" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:user="http://mycompany.com/mynamespace"&gt; &lt;msxsl:script language="JScript" implements-prefix="user"&gt; function datetimezone() { return "A B C"; } &lt;/msxsl:script&gt; and &lt;xsl:value-of select="user:datetimezone()" /&gt; my webpartcrashed and I can't see where. I search in this forum some answers like my problem but I can't see any error. Someone can write a simple example or a way to do this? In fact, I have to convert 06/03/2015 22:00 to local time zone. Thanks.
tagged with: web-parts
tagged with: xslt
type: Question

http://stackoverflow.com/comment/65889605
type: AnswerComment
type: Comment
has text: Force the request for the font file, works like a charm, thanks a lot @Bernardo :D
score: 1
comment on: http://stackoverflow.com/a/31929313

http://stackoverflow.com/q/28817842
tagged with: javascript
tagged with: jquery
score: 0
has body: I am a beginer trying to make a gallery for my site, but I am failing somewhere. What I am trying to do is create a page with menu on the top and then under it boxes of small pictures. When you click on one of them, the picture should be loaded under those boxes. So far I have my menu done, and I have the boxes with the pictures, but the problem is that when you first load the page all of the pictures in the small boxes are loaded under and when you click on any boxes - they disapear and only the selected picture is loaded, as it should be. So my problem is that I can't make the page not load all those pictures when loaded for a first time. I don't mind if it just loads one of them, but not all. I've been trying to fix it for 3 days now, but no luck, so I have no choice, but to ask you for help. Here's the HTML: MENU BLOG MUSIC PHOTOGRAPHY QUOTES & THOUGHTS ABOUT ME Here's the CSS: html{ background:url(BACKGROUND.jpg) no-repeat center center; min-height:100%; background-size:cover; } img { border: none; } #gallery { margin: 0 auto; width: 100%; } #thumbs { margin: 10px auto 10px auto; width: 100%; } #bigimages { width: 100%; float: left; } #thumbs img { width: 50px; height: 50px; } #bigimages img { border: 4px solid #555; margin-top: 5px; height: 500px; } #thumbs a:link, #thumbs a:visited { width: 50px; height: 50px; border: 6px solid #555; margin: 6px; float: left; } #thumbs a:hover { border: 6px solid #888; } And finally here's my simple JavaScript: function changeImage(current) { var imagesNumber = 5; for (i=1; i<=imagesNumber; i++) { if (i == current) { document.getElementById("normal" + current).style.display = "block"; } else { document.getElementById("normal" + i).style.display = "none"; } } }
tagged with: http://stackoverflow.com/tag/html
tagged with: css
possible better answer: http://stackoverflow.com/a/28817974
has answer: http://stackoverflow.com/a/28817974
has answer: http://stackoverflow.com/a/28818076
type: AnsweredQuestion
has title: Simple gallery loading all pictures when opened for a first time
type: Question
accepted answer: http://stackoverflow.com/a/28818076
answer count: 2

http://stackoverflow.com/q/28882262
has comment: http://stackoverflow.com/comment/46035859
tagged with: webstorm
type: UnansweredQuestion
tagged with: jsdoc
has comment: http://stackoverflow.com/comment/63563249
has body: config/default.json { "somevar": "sometext" } SomeModule.js /** * From the configuration file * @typedef {Object} config * @property {string} somevar */ var config = require('config'); var someObject = { somevar: config.somevar // Webstorm doesn't know what this is! }; Webstorm places a bumpy line under the somevar property of config. How can I have it not do that and actually recognize it with jsdocs? Edit: This question is not a duplicate of How to annotate core Node.js modules with JSDoc to have code hinting in IntelliJ?
answer count: 0
tagged with: annotations
type: Question
has comment: http://stackoverflow.com/comment/63599799
has title: How to write JSDocs for npm config when its required in a module using webstorm?
tagged with: javascript
tagged with: comments
has comment: http://stackoverflow.com/comment/46032383
linked to: http://stackoverflow.com/q/23876604
score: 0

http://stackoverflow.com/a/28811006
has comment: http://stackoverflow.com/comment/45898910
score: 0
has comment: http://stackoverflow.com/comment/45899790
type: Answer
has body: I simplified the code. DEMO HTML: Switch JS: var swit = document.getElementById('lightSwitch'); var container = document.getElementById('container'); swit.onclick = function(){ var color = container.style.backgroundColor; if(color === 'white'){ container.style.backgroundColor = 'black'; }else{ container.style.backgroundColor = 'white'; } };
has comment: http://stackoverflow.com/comment/45895581
accepted answer of: http://stackoverflow.com/q/28810679
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45894804
answers question: http://stackoverflow.com/q/28810679

http://stackoverflow.com/q/28820651
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: How do I click a div with a specific text using Selenium Webdriver?
has body: I am using Selenium Webdriver to test a program in JavaScript. I want to click on an element that I get after I input some data in a search box. The problem is that, as I don't create that object, I can not give it an id in and refer to it while I'm testing. Is there a way to refer to a tag containing a specific text? it('Should select a song', function(done) { client .setValue('#email', 'partygoer@email.com') .setValue('#query', 'superstition') .click('#search') .waitFor('.cover', 5000) .click('Here I have to click on the element with the specific text') .click('#submit') .waitFor('#thank-you') .getText('#thank-you', function(err, text) { expect(text).to.include('hello partygoer@email.com, your song id is') }) .call(done); });
tagged with: selenium
type: Question
tagged with: testing
tagged with: javascript
has answer: http://stackoverflow.com/a/28851429
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28824589

http://stackoverflow.com/comment/45990054
comment on: http://stackoverflow.com/a/28853924
has text: Yes I am very interested, but I created a plunker - http://plnkr.co/edit/aClMVdnrmr7M5hz2OPkN?p=preview to show it doesn't work in my case, but I don't know how to test it, because I can't see the url, reload the page or access it directly.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45987112
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28847897
has text: Do you have any console errors?
score: 0

http://stackoverflow.com/q/28798856
downvote count: 0
has answer: http://stackoverflow.com/a/28798893
accepted answer: http://stackoverflow.com/a/28798893
type: AnsweredQuestion
has body: I'd like to preface this with the fact that I cannot emphasize how new I am to jQuery, so this is going to be a very simple question. I am trying to get a little familiar with jQuery and am making a toy application that just replaces some HTML on mouseover and mouseleave. I have the following code that I borrowed from w3schools. City Gallery London Paris Tokyo London London is the capital city of England. It is the most populous city in the United Kingdom, with a metropolitan area of over 13 million inhabitants. Standing on the River Thames, London has been a major settlement for two millennia, its history going back to its founding by the Romans, who named it Londinium. Copyright © W3Schools.com I am using jquery 2.1.3. I expect to see "I mousedover london-btn" when my mouse hovers over london-btn, "I mousedover paris-btn" when my mouse hovers over paris-btn, and "I moused over tokyo-btn" when my mouse hovers over tokyo-btn, and "City Gallery" any other time. It almost works, but when I hover over any button, it always says "I mousedover london-btn". This is just a small exercise in DRY development and jQuery. Any suggestions? Thanks, erip
score: 1
has title: Getting id from HTML with jQuery giving unexpected results
type: Question
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45872002

http://stackoverflow.com/comment/46067368
type: Comment
has text: You're using the link as a dynamic property of a jQuery object. It doesn't exist.
type: QuestionComment
comment on: http://stackoverflow.com/q/28903983
score: 0

http://stackoverflow.com/comment/120873686
has text: I am following your logic, I am getting below error : FetchError: request to https://www.googleapis.com/oauth2/v4/token failed, reason: getaddrinfo ENOTFOUND 808
type: AnswerComment
comment on: http://stackoverflow.com/a/67163329
score: 0
type: Comment

http://stackoverflow.com/comment/46258744
has text: Dear Ken, you really explain in such a way so that anyone even a fresher can understand. Thanks Ken Fyrstenberg.Now i become your fan. Can you please advice me how can i read these types of things in jquery and java script. Because i only know basic things that is why i faces some problem sometimes.
comment on: http://stackoverflow.com/a/28866943
score: 0
type: AnswerComment
type: Comment

focus
tags question: http://stackoverflow.com/q/28894728
tags question: http://stackoverflow.com/q/28758344
tags question: http://stackoverflow.com/q/28826437
type: Tag
tag name: focus
tags question: http://stackoverflow.com/q/28757476

http://stackoverflow.com/comment/45804017
score: 0
type: Comment
type: QuestionComment
has text: @AndreyPopov I started to rewrite my answer to target your points. But might take a while.
comment on: http://stackoverflow.com/q/28761365

http://stackoverflow.com/comment/45957455
comment on: http://stackoverflow.com/q/28822375
score: 0
type: Comment
type: QuestionComment
has text: now it is working for me, not for you?

http://stackoverflow.com/a/40246912
has body: Don't forget tooltip option shared! options = { tooltip: { shared: true, ....
answers question: http://stackoverflow.com/q/28848146
score: 0
type: Answer

http://stackoverflow.com/comment/45850148
type: QuestionComment
type: Comment
has text: i want to see the variable be displayed once i click on the two buttons.
score: 0
comment on: http://stackoverflow.com/q/28787026

http://stackoverflow.com/comment/45874891
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28800494
has text: Try `.clone(true)` to clone data and events as well
score: 1

http://stackoverflow.com/q/28870567
has comment: http://stackoverflow.com/comment/46005193
score: 10
has comment: http://stackoverflow.com/comment/46004863
has answer: http://stackoverflow.com/a/28870878
upvote count: 10
type: Question
has body: I've tried numerous methods and followed Ryan Bates' guide but no matter what I do I still get undefined. application.html.erb &lt;body&gt; &lt;%= content_tag :div, id: 'trackers', data: {trackers: User.count} do %&gt; &lt;% end %&gt; &lt;/body application.js.erb var datadump = ($('#trackers').data('trackers')) console.log(datadump) //returns undefined in console Viewing page source I can see the variable &lt;div data-trackers="2" id="trackers"&gt; I'm passing User.count for now just to keep it simple but I'll need to be passing @trackers_count which is instantiated in a before_action in the application controller. I should be able to sort that out though once I figure out the problem here. Any suggestions? UPDATE - I've simplified all variables down to just trackers, instead of trackers_count to prevent any errors from syntax and updated code here to reflect that. ANSWER UPDATE - I selected the correct answer because if you want to pass any variables ASIDE FROM CURRENT_USER those methods worked perfectly. However, you can't access anything with current_user in JS because it loads before the window, so it can't know who the current_user is. It's a real pain but I just did it the long way and accessed the info I need through passing in json and an ajax requests.
tagged with: ruby-on-rails-4
accepted answer: http://stackoverflow.com/a/28870878
has answer: http://stackoverflow.com/a/53732688
downvote count: 0
tagged with: javascript
tagged with: variables
has comment: http://stackoverflow.com/comment/46005046
has comment: http://stackoverflow.com/comment/46005006
answer count: 4
favorite count: 0
has title: Rails 4: Passing variables to javascript
has comment: http://stackoverflow.com/comment/46007947
has comment: http://stackoverflow.com/comment/46004910
has answer: http://stackoverflow.com/a/50156771
has comment: http://stackoverflow.com/comment/46004812
has comment: http://stackoverflow.com/comment/46004946
tagged with: ruby-on-rails
has comment: http://stackoverflow.com/comment/46005179
possible better answer: http://stackoverflow.com/a/28877313
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28877313

http://stackoverflow.com/comment/46062835
comment on: http://stackoverflow.com/a/28901560
score: 0
type: AnswerComment
has text: So bad just that normal browsers like chrome doesn't support it
type: Comment

http://stackoverflow.com/comment/45821869
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28768377
has text: I edited my answer to display a snippet. I noticed two things : It works ! And why do you have `restaurant[1]+" "` ? Why ` ` ?
score: 0

http://stackoverflow.com/comment/46023350
has text: I'm loading content using Ajax so it would become unbound. Thank you for the suggestion though.
comment on: http://stackoverflow.com/a/28881013
score: 0
type: AnswerComment
type: Comment

sqlite
tags question: http://stackoverflow.com/q/28888541
tags question: http://stackoverflow.com/q/28803858
type: Tag
tags question: http://stackoverflow.com/q/28882809
tag name: sqlite
tags question: http://stackoverflow.com/q/28817347

http://stackoverflow.com/q/28885829
favorite count: 0
tagged with: mqtt
tagged with: node.js
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/28885986
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/46032828
has comment: http://stackoverflow.com/comment/46033039
has body: It it no where in the readme file: MQTTJS mqtt sub -t 'hello' -h 'test.mosquitto.org' -v Question: What does the -v stand for in the subscribe line of mqttjs?
score: 0
has title: What does the -v stand for in mqttjs subscribe command
has comment: http://stackoverflow.com/comment/46033002
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/46033091

timepicker
tags question: http://stackoverflow.com/q/28812504
type: Tag
tag name: timepicker

http://stackoverflow.com/a/28784620
type: Answer
upvote count: 2
has comment: http://stackoverflow.com/comment/45845600
has body: Possible have to use the link element and use e.preventDefault(); $("#test li a").click(function(e) { e.preventDefault(); alert($(this).parent().id); // get id of clicked li }); Hope this helps.
score: 2
answers question: http://stackoverflow.com/q/28784537
downvote count: 0
has comment: http://stackoverflow.com/comment/45845420

http://stackoverflow.com/q/28804890
tagged with: http://stackoverflow.com/tag/pdf
has answer: http://stackoverflow.com/a/28805052
has answer: http://stackoverflow.com/a/28805003
has title: Converting the data in a Database into a downloadable PDF file
possible better answer: http://stackoverflow.com/a/28805052
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28805893
tagged with: java
tagged with: database
has body: How can we convert the required data in the database into a pdf file, like getting the details of person (when we enter his name) into a downloadable pdf file using java or javascript ?
accepted answer: http://stackoverflow.com/a/28805003
has comment: http://stackoverflow.com/comment/45882958
type: Question
has comment: http://stackoverflow.com/comment/45890833
tagged with: javascript
score: 0
answer count: 3
linked to: http://stackoverflow.com/q/26056485

http://stackoverflow.com/q/28810014
possible better answer: http://stackoverflow.com/a/28810996
has title: javascript/angularjs - fade out
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28810255
accepted answer: http://stackoverflow.com/a/28810255
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28810996
type: Question
tagged with: javascript
score: 0
answer count: 2
has body: I have a picture with an icon in the middle that indicates the ability to scroll for the user. When the user scrolls, I would like to fade the icon out. Right now I can hide the picture but would like the fade effect. Here is my view: &lt;div style="overflow: scroll;"&gt; &lt;img id="fullImage" ng-src="{{imageUrl}}" imageonload&gt; &lt;img id="drag-arrows" class="drag-arrows" ng-src="images/icon-drag.png"/&gt; &lt;h3 id="optionName" class="optionName"&gt;{{ optionName }}&lt;/h3&gt; &lt;a class="close-reveal-modal" ng-click="cancel()"&gt;&lt;img class="cancel-icon" ng-src="images/icon-close-fullscreen.png"&gt;&lt;/a&gt; &lt;/div&gt; Here is my directive that listens on the touchmove event to hide the drag arrows icon: modalController.directive('imageonload', function() { return { restrict: 'A', link: function(scope, element, attrs) { element.bind('load', function() { var img = document.getElementById("fullImage"); var w = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); var h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); var imageWidth = img.width; var imageHeight = img.height; var aspectRatio = imageWidth / imageHeight; if (w &lt; imageWidth &amp;&amp; h &lt; imageHeight){ // scale image down var widthDiff = imageWidth - w; var heightDiff = imageHeight - h; if(widthDiff &lt;= heightDiff){ imageWidth = w; imageHeight = w / aspectRatio; } else{ imageHeight = h; imageWidth = h * aspectRatio; } } else if (w &lt; imageWidth &amp;&amp; h &gt; imageHeight) { // fill image vertically imageHeight = h; imageWidth = h * aspectRatio; } else if (w &gt; imageWidth &amp;&amp; h &lt; imageHeight) { // fill image horizontally imageWidth = w; imageHeight = w / aspectRatio; } else { // fill image in both directions var widthDiff = w - imageWidth; var heightDiff = h - imageHeight; if(widthDiff &gt;= heightDiff){ imageWidth = w; imageHeight = w / aspectRatio; } else{ imageHeight = h; imageWidth = h * aspectRatio; } } img.style.width =…

http://stackoverflow.com/q/28865965
tagged with: http://stackoverflow.com/tag/html
has body: I have a list of images in divs that i'm trying to call by their data attribute. What I want to do is find out if the img tag has a data attribute called "data-source", for now an alert is called. else run the rest of my code. HTML: script: $('.product_details img').click(function() { var mainImg = $('.main_img_switch img'); var test = $(this).attr('data-source'); if (test.length > 0) { alert("check"); } else { var tempSrc = mainImg.attr("src"); mainImg.attr("src", this.src); this.src = tempSrc; } });
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45997101
has answer: http://stackoverflow.com/a/28866082
type: Question
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/28866082
has title: Calling the Data-Attribute of a Image
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/45966778
type: QuestionComment
has text: @anpsmn sorry my mistake , it is ID. i will update the Fiddle now
comment on: http://stackoverflow.com/q/28849564
score: 0
type: Comment

http://stackoverflow.com/comment/45987595
type: Comment
type: QuestionComment
has text: If this question is still unanswered later I will post the full code when I get back to my computer. I'm typing this on an iPad :(
comment on: http://stackoverflow.com/q/28860602
score: 0

http://stackoverflow.com/comment/45853314
type: Comment
has text: Thanks for the help, I did a few changes to deal with duplicate function names
comment on: http://stackoverflow.com/a/28786918
score: 0
type: AnswerComment

http://stackoverflow.com/q/28883426
has comment: http://stackoverflow.com/comment/46028808
has title: Why doesn't empty string == null in JavaScript
has comment: http://stackoverflow.com/comment/46028055
type: Question
has answer: http://stackoverflow.com/a/28883615
tagged with: javascript
has comment: http://stackoverflow.com/comment/46028046
downvote count: 2
has answer: http://stackoverflow.com/a/28883522
accepted answer: http://stackoverflow.com/a/28883522
answer count: 2
has comment: http://stackoverflow.com/comment/46028213
favorite count: 0
possible better answer: http://stackoverflow.com/a/28883615
has comment: http://stackoverflow.com/comment/46028290
has comment: http://stackoverflow.com/comment/46028693
has body: I understand that both empty string and null are falsy according to the ECMAScript. If both are falsy then why doesn't the following evaluate to true? var emptyString = ''; if (emptyString == null) { console.log('emptyString == null'); } else { console.log('emptyString does not == null'); // but why? }
upvote count: 4
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46028034
has comment: http://stackoverflow.com/comment/46028024

http://stackoverflow.com/comment/138127902
type: Comment
comment on: http://stackoverflow.com/a/28835460
score: 0
has text: `Buffer` is deprecated.
type: AnswerComment

http://stackoverflow.com/q/28863707
has title: Turn multiple separate objects into 1 array of objects
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/28863793
accepted answer: http://stackoverflow.com/a/28863793
has answer: http://stackoverflow.com/a/28863830
tagged with: javascript
has comment: http://stackoverflow.com/comment/45992766
has comment: http://stackoverflow.com/comment/45992580
score: 0
downvote count: 2
answer count: 3
has body: I have the two Hash objects. One: {"name" : "one" , "color" : "red" } Two: {"name" : "two" , "color" : "blue" } I am trying to take those two objects and turn them into something looking like this: [{"name" : "one" , "color" : "red" }, {"name" : "two" , "color" : "blue" } ] How can I achieve this with javascript? I'm also using underscore. Also - When i have new object, I will receive more single objects I would like to push in like - Three : {"name" : "three" , "color" : "red" } Result being - Result : [{"name" : "one" , "color" : "red" }, {"name" : "two" , "color" : "blue" }, {"name" : "three" , "color" : "red" } ] Thanks!
favorite count: 0
has comment: http://stackoverflow.com/comment/45992663
has comment: http://stackoverflow.com/comment/45992746
possible better answer: http://stackoverflow.com/a/28863739
type: AnsweredQuestion
tagged with: underscore.js
has answer: http://stackoverflow.com/a/28863739

http://stackoverflow.com/a/28826273
answers question: http://stackoverflow.com/q/28826176
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45923493
has comment: http://stackoverflow.com/comment/45924007
upvote count: 1
type: AcceptedAnswer
type: Answer
has body: When you set width with css method twice in a row the second simply overwrites previous. In your case to mimic 100% - 90px width you need to actually calculate this difference in px and apply the result. Now, percentage width 100% is calculated relatively to a parent container, it means that for 100% value you need to do something like this: var paxWidth = $('.pax').width() + 10; $('.datetime, .placeholder').css('width', function() { var parentWidth = $(this).parent().width(); return parentWidth - paxWidth; }); Demo: http://jsfiddle.net/02cxqpzq/ UPD. Looking at duplicated answer, I can confirm that my above solution makes little sense since it can be as simple as $('.datetime, .placeholder').css('width', '100%').css('width', '-=90px'); Demo: http://jsfiddle.net/02cxqpzq/1/
accepted answer of: http://stackoverflow.com/q/28826176

http://stackoverflow.com/comment/45802662
type: AnswerComment
score: 0
type: Comment
has text: OP wants the return false
comment on: http://stackoverflow.com/a/28761440

regex
tags question: http://stackoverflow.com/q/28896885
tags question: http://stackoverflow.com/q/28899286
tags question: http://stackoverflow.com/q/28797836
tags question: http://stackoverflow.com/q/28820768
tags question: http://stackoverflow.com/q/28776889
tags question: http://stackoverflow.com/q/28814847
tags question: http://stackoverflow.com/q/28791490
tag name: regex
tags question: http://stackoverflow.com/q/28771654
tags question: http://stackoverflow.com/q/28857067
tags question: http://stackoverflow.com/q/28757956
tags question: http://stackoverflow.com/q/28815013
tags question: http://stackoverflow.com/q/28904532
tags question: http://stackoverflow.com/q/28894116
tags question: http://stackoverflow.com/q/28799659
tags question: http://stackoverflow.com/q/28844222
tags question: http://stackoverflow.com/q/28844156
tags question: http://stackoverflow.com/q/28794249
tags question: http://stackoverflow.com/q/28835724
tags question: http://stackoverflow.com/q/28804514
tags question: http://stackoverflow.com/q/28881381
tags question: http://stackoverflow.com/q/28865223
tags question: http://stackoverflow.com/q/28794556
tags question: http://stackoverflow.com/q/28806609
tags question: http://stackoverflow.com/q/28897354
tags question: http://stackoverflow.com/q/28876076
tags question: http://stackoverflow.com/q/28754242
tags question: http://stackoverflow.com/q/28881033
tags question: http://stackoverflow.com/q/28848180
tags question: http://stackoverflow.com/q/28764030
tags question: http://stackoverflow.com/q/28757901
tags question: http://stackoverflow.com/q/28751597
tags question: http://stackoverflow.com/q/28751997
tags question: http://stackoverflow.com/q/28850286
tags question: http://stackoverflow.com/q/28884013
tags question: http://stackoverflow.com/q/28772460
tags question: http://stackoverflow.com/q/28785637
tags question: http://stackoverflow.com/q/28838169
tags question: http://stackoverflow.com/q/28816861
tags question: http://stackoverflow.com/q/28817284
tags question: http://stackoverflow.com/q/28871141
tags question: http://stackoverflow.com/q/28780476
tags question: http://stackoverflow.com/q/28829827
tags question: http://stackoverflow.com/q/28755910
tags question: http://stackoverflow.com/q/28768307
tags question: http://stackoverflow.com/q/28760366
tags question: http://stackoverflow.com/q/28879480
tags question: http://stackoverflow.com/q/28886707
tags question: http://stackoverflow.com/q/28834313
tags question: http://stackoverflow.com/q/28889373
tags question: http://stackoverflow.com/q/28768036
tags question: http://stackoverflow.com/q/28851220
tags question: http://stackoverflow.com/q/28816634
tags question: http://stackoverflow.com/q/28837408
tags question: http://stackoverflow.com/q/28864360
tags question: http://stackoverflow.com/q/28812932
tags question: http://stackoverflow.com/q/28828577
tags question: http://stackoverflow.com/q/28840414
tags question: http://stackoverflow.com/q/28817751
tags question: http://stackoverflow.com/q/28849472
tags question: http://stackoverflow.com/q/28809584
tags question: http://stackoverflow.com/q/28852975
tags question: http://stackoverflow.com/q/28826848
tags question: http://stackoverflow.com/q/28805384
tags question: http://stackoverflow.com/q/28889767
tags question: http://stackoverflow.com/q/28884729
tags question: http://stackoverflow.com/q/28840447
tags question: http://stackoverflow.com/q/28840285
tags question: http://stackoverflow.com/q/28843263
tags question: http://stackoverflow.com/q/28878380
tags question: http://stackoverflow.com/q/28776508
tags question: http://stackoverflow.com/q/28802772
tags question: http://stackoverflow.com/q/28801812
tags question: http://stackoverflow.com/q/28774832
tags question: http://stackoverflow.com/q/28874898
tags question: http://stackoverflow.com/q/28866930
tags question: http://stackoverflow.com/q/28904685
tags question: http://stackoverflow.com/q/28783450
tags question: http://stackoverflow.com/q/28879865
tags question: http://stackoverflow.com/q/28802489

http://stackoverflow.com/comment/45818000
has text: Tried to do a for loop but it didn't work on me. Didn't draw the images.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28769707
score: 0

http://stackoverflow.com/comment/45848007
score: 0
type: AnswerComment
type: Comment
has text: Thank you. I only put the js code because that is what I want to accomplish in rails but i didn't know how to do it. I could do the same for a get correct? something like this `response = RestClient.get...` ??
comment on: http://stackoverflow.com/a/28780198

http://stackoverflow.com/comment/45986365
type: Comment
type: QuestionComment
has text: Thanks. Amending the css file with an id (i.e. #myButton) does not work in this case. @PawełFus - appreciate it. I will likely go his route assuming there are no alternative suggestions; would prefer to use inherent positioning of the library if I can and just style the elements as needed.
comment on: http://stackoverflow.com/q/28841162
score: 0

http://stackoverflow.com/q/28785855
has title: simplest method to clear text field after submit
tagged with: ajax
accepted answer: http://stackoverflow.com/a/28785944
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has body: I've been searching all over the place to try and get my text field to clear after submit. Keep in mind that I want to stay on the same page when data is being submitted (I have a jquery code for staying on the same page after submission). I figured that it would be a lot easier if I just posted my code so that I can get help in my specific case. The following is what I tried, the .reset(), java onclick, onsubmit, jquery and ajax methods and none of them have produced the result that I am looking for. The closest I have gotten was a form getting cleared before submit and this leaves a blank submission. Here's my form code for getting test info from the user. Here I tried the onclick, onsubmit methods without much luck: &lt;form id=\"msg\" method=\"post\" action=\"topage.php\" style=\"text-align: center; font-size: 26px; font-weight: bold; color: white; position: relative; top: -45px\"&gt; MESSAGE&lt;br&gt;&lt;input type=\"text\" style=\"font-size: 22px;width:90%; height:50px; resize: none; \" name=\"msg\" &gt; &lt;input class=\"submit\" type=\"submit\" value=\"Send\" style=\"width:90%; height: 40px; \"&gt; &lt;div id=\"message\"&gt;&lt;/div&gt; &lt;/form&gt; Here's my stay on page after submit code. I am using a script include to allow my stay on the same page after submit to work. It took me awhile to find a way to stay on same page after submit. If there is a better method for staying on the same page that works with clearing a form after submission by all means please share: &lt;script type="text/javascript" &gt; $(document).ready(function() { $('#msg').ajaxForm({ target: '#message', success: function() { $('#message').fadeIn('slow'); } }); }); &lt;/script&gt;
tagged with: forms
type: Question
has answer: http://stackoverflow.com/a/28785944
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery

http://stackoverflow.com/comment/45946739
has text: @Sparky sadly, when I remove the the jquery call in the position I need it (above validation), it tells me that jquery is undefined. The first jquery call is a vendor version, which carries edits (for whatever reason). I don't see where the validate script is called/active twice. I do see it being called, then required for use in the function. .validate method is listed in: var validator = $("#myForm").validate({ $.validator.setDefaults({ submitHandler: function() { alert("submitted!"); } });
score: 0
comment on: http://stackoverflow.com/q/28836727
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/46031445
type: QuestionComment
has text: Actually I don't get any error. Nothing happens when I click submit button, but input forms get red border if empty.
comment on: http://stackoverflow.com/q/28885125
score: 0
type: Comment

http://stackoverflow.com/comment/45828372
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28774439
type: Comment
has text: Exceptional work! The funny thing is that this polyfill comes straight from Mozzilla's developer network. Surprised I haven't seen this issue come up before. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys

http://stackoverflow.com/a/28796053
downvote count: 0
has body: I struggled over this for a long time, and I was able to find a similar question posted here: Google OAuth2 - Using externally generated Access Token - With JS Client Library However, this person already knew what had to be done, just not how to make the appropriate call, so it was fairly lucky that I found it. Solution In order to make gapi requests using an existing access token, you must call: gapi.auth.setToken({ access_token: "token_string" }); before making a client request. In Meteor, you can use Meteor.user().services.google.accessToken in place of the "token_string" above. Documentation on the method is here: https://developers.google.com/api-client-library/javascript/reference/referencedocs#gapiauthsetToken
score: 5
answers question: http://stackoverflow.com/q/28796052
accepted answer of: http://stackoverflow.com/q/28796052
type: AcceptedAnswer
upvote count: 5
type: Answer

http://stackoverflow.com/q/28826513
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45924740
has comment: http://stackoverflow.com/comment/45925150
has comment: http://stackoverflow.com/comment/45925369
answer count: 0
tagged with: http
type: Question
has comment: http://stackoverflow.com/comment/45925042
has comment: http://stackoverflow.com/comment/45923716
tagged with: javascript
has comment: http://stackoverflow.com/comment/45924703
has comment: http://stackoverflow.com/comment/45924083
has comment: http://stackoverflow.com/comment/45924077
has comment: http://stackoverflow.com/comment/45925090
score: 0
has comment: http://stackoverflow.com/comment/45924368
has comment: http://stackoverflow.com/comment/45923516
tagged with: http-status-code-400
has body: I keep getting response 400 bad JSON when I send in $scope.result when $scope.result = result.id. I get 404, not found when I pass result.id or $scope.result when $scope.result = result. I'm trying to post from Angular to my Express server with the following code: angular.module('startupApp') .controller('stripeCtrl', function ($scope, $http) { $scope.stripeCallback = function (code, result) { if (result.error) { window.alert('it failed! error: ' + result.error.message); } else { window.alert('success! token: ' + result.id); $scope.result = result.id; $http.post('api/stripe', $scope.result) .success(function (response) { // not sure if anything goes here; not looking for a response. }) } }; }); The object I want to pass in looks like this in the JS console: Object {id: "tok_15cAbpL4TQAw2alUSkdXzIN5", livemode: false, created: 1425368309, used: false, object: "token"…} card: Object client_ip: "76.126.66.106" created: 1425368309 id: "tok_15cAbpL4TQAw2alUSkdXzIN5" livemode: false object: "token" type: "card" used: false proto: Object I'm using Angular Payments with Stripe. ??????????????????????????????????????????? UPDATE: This is what I'm getting in the JS console in entirety for the previous code. GET http://localhost:9000/bower_components/lodash/lodash.js 404 (Not Found) stripe.controller.js:15 Object {id: "tok_15cBUlL4TQAw2alUb8yGnalO"} stripe.controller.js:16 Object {id: "tok_15cBUlL4TQAw2alUb8yGnalO"} angular.js:9814 POST http://localhost:9000/api/stripe 404 (Not Found) and the headers: Remote Address:[::1]:9000 Request URL:http://localhost:9000/api/stripe Request Method:POST Status Code:404 Not Found Request Headersview source Accept:application/json, text/plain, */* Accept-Encoding:gzip, deflate Accept-Language:en-US,en;q=0.8 Connection:keep-alive Content-Length:37 Content-Type:application/json;charset=UTF-8 Host:localhost:9000 Origin:http://localhost:9000 Referer:http://localhost:9000/stripe User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebK…
has comment: http://stackoverflow.com/comment/45923591
tagged with: stripe-payments
has title: Angular $http.post 404 and 400 but why?
has comment: http://stackoverflow.com/comment/45923590

http://stackoverflow.com/a/28904848
has body: For the M part I think Play Framework has a very simple way to create models. Your controller implementation depends on how you want to do it but it would definitely be a mix of both front end javascript to transfer data from the view (if you plan on using ajax) and a back end component. Play would help you out with the backend part of the controller.
type: Answer
answers question: http://stackoverflow.com/q/28904310
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/comment/45798847
type: AnswerComment
comment on: http://stackoverflow.com/a/28759383
has text: the reason not using p.p1 is because i have a lot of fields in object and i have to put conditions on each attribute so i wanna loop though it
score: 0
type: Comment

http://stackoverflow.com/comment/45847618
has text: Makes total sense. But, that is what I am not actually able to figure out, after trying a loooot. Could you please help me with a code snippet?
comment on: http://stackoverflow.com/q/28775651
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46071988
comment on: http://stackoverflow.com/a/28877689
score: 0
type: Comment
has text: @Geoffrey...it may be normal to you but not to fullcalendar...when fcal see s an ID in the response assumes that this is used to identify an event and as such every object must have a unique ID-and not other things.So you must use the ID for identifying the event and create another attribute for the personell ID...persID for example...try these and will see how things will go
type: AnswerComment

http://stackoverflow.com/comment/45786379
type: Comment
has text: Thank you! Today I learned about `siblings()` and `closest()` =)
comment on: http://stackoverflow.com/a/28751386
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45817580
score: 0
type: AnswerComment
has text: $('.parent_container').each(function(i) { var pindex = $(this).index(); var mainfrm=$(this); var orgname=""; mainfrm.find('.parent_container_inner').each(function(j) { $(this).find('input, select, textarea').each(function(k){ orgname = $(this).attr('name'); orgname = orgname.replace(/[\[\]\d]+/g,""); $(this).attr('name', orgname+"["+pindex+"]["+j+"]["+k+"]"); }); }); });
comment on: http://stackoverflow.com/a/28766199
type: Comment

http://stackoverflow.com/a/28826168
has body: Assuming you are referring it as data, You can use data.entities[0].username to access username. var data = { "action": "get", "application": "2c5ca3b0-be74-11e4-8ff3-f7af49a474ef", "params": { "ql": [ "select * where username='pqr'" ] }, "path": "/logs", "uri": "https://api.usergrid.com/serv-d/demo1/logs", "entities": [ { "uuid": "97b0fd0a-be74-11e4-9324-b3bd8af7859e", "type": "log", "created": 1425036869840, "modified": 1425036869840, "metadata": { "path": "/logs/97b0fd0a-be74-11e4-9324-b3bd8af7859e" }, "password": "pqr", "username": "pqr" } ], "timestamp": 1425359738746, "duration": 15, "organization": "serv-d", "applicationName": "demo1", "count": 1 }; alert(data.entities[0].username) alert(data.entities[0].password)
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28826070

http://stackoverflow.com/a/28772147
score: 0
type: Answer
has body: Already answered in here: How to reload/refresh an element(image) in jQuery Changing img src through jQuery: image won&#39;t refresh How to refresh the src of &lt;img /&gt; with jQuery? Force refresh an image in jquery mobile But basically, every time you refresh a page, you should call your backend image server with an appended random number to it (like: img_1, img_2, img_3...)
answers question: http://stackoverflow.com/q/28771981

http://stackoverflow.com/comment/45893248
has text: It sounds like you need to add a `preventDefault()` somewhere. If you can add your full code we can offer more useful help.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28810488
type: QuestionComment

http://stackoverflow.com/comment/45983891
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28859070
score: 8
has text: Probably, your browser is trying to load `/favicon.ico` from your server.

http://stackoverflow.com/comment/45971567
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28852272
has text: It just get it worst. and i cants use some of the functions in the API like: dataView.setColumns([{calc: function(data, row) { return ''; }, type:'string'}, 0, 1]);

http://stackoverflow.com/comment/45874823
type: QuestionComment
comment on: http://stackoverflow.com/q/28788106
score: 0
type: Comment
has text: This was my main issue. Thank you. Once I took out setting the other driver then went back to using browser.driver after a few iterations I was able to get it to work.

http://stackoverflow.com/comment/45811798
score: 0
type: Comment
type: QuestionComment
has text: @Ondkloss I don't think you understood my problem. I'll update the question in about 1 hour, with better explanations.
comment on: http://stackoverflow.com/q/28765320

http://stackoverflow.com/a/45119549
upvote count: 1
answers question: http://stackoverflow.com/q/28751568
downvote count: 0
type: Answer
has body: Youtube iframe player api provide a function to turn the current played time of the video player.getCurrentTime():Number. That can be used to track how much the user watched the video. You can also make use of player.getDuration() api to get the total video time and calculate the percentage of the progress here is the alternation of the exampled shared by first answer http://jsfiddle.net/ndbseftp/
score: 1

http://stackoverflow.com/comment/45970527
has text: i have jquery/1.4.2/jquery.min.js // jqueryui/1.8.1/jquery-ui.min.js and jquery-1.11.2.min.js
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28849869
type: Comment

http://stackoverflow.com/comment/46056835
has text: @Fergoso: see my new demo link in my answer.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28897900
type: QuestionComment

http://stackoverflow.com/a/28827825
downvote count: 0
type: Answer
has body: You can change the format to look like _xmlviewX--myviewX, then simply substring from -- and navigate to that link.
score: 1
answers question: http://stackoverflow.com/q/28827702
upvote count: 1
has comment: http://stackoverflow.com/comment/45926622

http://stackoverflow.com/q/28831940
has body: at first : I had problem to read image ina javascript like this: var image = "/images/my_image.png" so I try another way. But is this way of how to check the real path correct? Thank you for your comments. var string = location.port; var full_url = ""; if(string != ""){full_url = document.domain + ":" + string;} else{full_url = document.domain;} var image = "http://"+full_url+"/images/my_image.png"
has comment: http://stackoverflow.com/comment/45933960
has comment: http://stackoverflow.com/comment/45933661
has comment: http://stackoverflow.com/comment/45933764
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45933818
has title: How to correct find domain and port in javascript?
has comment: http://stackoverflow.com/comment/45933574
answer count: 0
has comment: http://stackoverflow.com/comment/45933737
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/6941533
score: 0

http://stackoverflow.com/comment/47247839
type: Comment
type: QuestionComment
has text: I think this is a useful question, even if the format of the question is different. Inline images would work ( @NiCkNewman ).
comment on: http://stackoverflow.com/q/28789398
score: 0

http://stackoverflow.com/q/28903546
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46066595
possible better answer: http://stackoverflow.com/a/28903866
score: 0
has answer: http://stackoverflow.com/a/28903866
has comment: http://stackoverflow.com/comment/46066823
type: Question
answer count: 2
has body: I have written a simple function to build a form using the same code base I have used many times. In this form I am adding a select object. Everything works except for the select object is not not working. I am using an ajax function to call the data from a database table. When troubleshooting, I am getting the data back when looking at network on chrome but in the console I am getting the error: Uncaught TypeError: Cannot read property 'length' of undefined. Here is the data returned from the ajax call. {"oshadaytype":[ {"oshadaytypeid":3,"oshadaytype":"Job Transfer"}, {"oshadaytypeid":2,"oshadaytype":"Light Days"}, {"oshadaytypeid":1,"oshadaytype":"Lost Days"} ]} Here is the jquery function. Everything is working except I am getting the empty select object. $(function(){ $("#addoshadaysbutton").click(function(){ $.ajax({type: "GET",url: '../posttimetosession.php'}).done(); $("#addoshadaysdiv").empty(); $.ajax({type: "GET",url: '../json/getoshadayjson.php'}).done(function(data){ $("#addoshadaysdiv").append( $('&lt;div&gt;').append( $('&lt;label&gt;').text("OSHA Days").addClass("rmargin3 subtitle") ).addClass("paddingbottom3") ).append( $('&lt;div&gt;').append( $('&lt;input&gt;').prop({type:"submit",name:"addoshadayssubmit",value:"Save OSHA Days"}).addClass("button") ).addClass("paddingbottom3") ).append( $('&lt;div&gt;').append( $('&lt;label&gt;').prop({for:"oshastartdate"}).text("Start Date:").addClass("rmargin3") ).append( $('&lt;input&gt;').attr({type: 'text',id: 'oshastartdate',name: 'oshastartdate'}).addClass("datepick eighth rmargin10") ).append( $('&lt;label&gt;').prop({for:"oshaenddate"}).text("End Date:").addClass("rmargin3") ).append( $('&lt;input&gt;').attr({type: 'text',id: 'oshaenddate',name: 'oshaenddate'}).addClass("datepick eighth rmargin10") ).append( $('&lt;label&gt;').prop({for:"oshadaytypeid"}).text("OSHA Days Type:").addClass("rmargin3") ).append( $('&lt;select&gt;').attr({id: "oshadaytypeid",name: "oshadaytypeid"}) ) ) $.each(data.oshadaytype,…
accepted answer: http://stackoverflow.com/a/28903925
tagged with: javascript
tagged with: jquery
tagged with: ajax
has answer: http://stackoverflow.com/a/28903925
has comment: http://stackoverflow.com/comment/46066905
has comment: http://stackoverflow.com/comment/46066871
has comment: http://stackoverflow.com/comment/46066813
has comment: http://stackoverflow.com/comment/46066846
has title: Getting an error on an each in my jquery function

http://stackoverflow.com/a/28936838
score: 1
upvote count: 1
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28884846
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28884846
has body: I figured it out on my own! In case someone in the future needs to know how though: //Get Screen_Name from tweet object. function getPosition(str,m, i) { //special helper function to find the nth position of a string. return str.split(m, i).join(m).length; } var snStartingPos = getPosition(tweetObject, "screen_name", 2); //starting position of "screen_name" in tweet object. var snEndingPos = snStartingPos + 14; //ending position of "screen_name" in tweet object (where we actually want to start). var unStartingPos = getPosition(tweetObject, "location", 1); //starting position of the word after where we want to end. var unPrePos = unStartingPos - 3; //subtract that by 3 characters to exclude the unnecessary characters var snLength = unPrePos - snEndingPos; //this is now the length of the screen_name we want var screen_name = "@" + tweetObject.substr(snEndingPos, snLength); //get the sub-str that we want (the "screen_name") from tweet object. //End Get Screen_Name from tweet Object tweetObject is just tweet converted as a string. the function getPosition, I got off another stackOverflow question page: How to get the nth occurrence in a string?
type: Answer

http://stackoverflow.com/comment/45931879
has text: http://brackets.clementng.me/post/24150213014/example-of-a-javascript-closure-settimeout-inside
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28830853
score: 0

http://stackoverflow.com/q/28849981
possible better answer: http://stackoverflow.com/a/28850834
accepted answer: http://stackoverflow.com/a/28850317
type: AnsweredQuestion
downvote count: 2
has comment: http://stackoverflow.com/comment/45967303
has comment: http://stackoverflow.com/comment/45967274
type: Question
has comment: http://stackoverflow.com/comment/45967716
score: -2
has comment: http://stackoverflow.com/comment/45967594
has comment: http://stackoverflow.com/comment/45967353
has comment: http://stackoverflow.com/comment/45967665
has comment: http://stackoverflow.com/comment/45967277
answer count: 2
has answer: http://stackoverflow.com/a/28850317
upvote count: 0
has comment: http://stackoverflow.com/comment/45967430
tagged with: javascript
tagged with: jquery
has body: I have write this cause to show and hide select component with jQuery, but it doesn't function, can you tell me where is the problem? Here is CSS part to display.hide The jQuery code But all the select component appears and no display or dynamic show!
has comment: http://stackoverflow.com/comment/45967992
has answer: http://stackoverflow.com/a/28850834
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/45967610
tagged with: http://stackoverflow.com/tag/html
has title: Jquery Doesn't function

http://stackoverflow.com/comment/46066944
has text: for running a function every 5 minutes, you can use `setInterval(f,t)`, where `f ` is the function to run and `t` is the number of milliseconds to wait for. https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setInterval This might help you at least not relying on date computations. I don't have a better right now.
comment on: http://stackoverflow.com/q/28903344
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45997259
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28866178
type: Comment
has text: You can also add rounded corders and edit it as you need it to look like. Good luck

http://stackoverflow.com/q/28832744
score: 1
has comment: http://stackoverflow.com/comment/45935028
type: Question
has comment: http://stackoverflow.com/comment/45935017
has answer: http://stackoverflow.com/a/28833195
has answer: http://stackoverflow.com/a/28832775
downvote count: 0
has answer: http://stackoverflow.com/a/28833354
tagged with: javascript
has body: At least i want to count how many sections are in one article. If this doesn´t work with this elements, I also could use normal "div" tags instead. Sorry for my bad english. text example
tagged with: jquery
favorite count: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
upvote count: 1
has title: Count how many sections in a article

http://stackoverflow.com/q/28852414
accepted answer: http://stackoverflow.com/a/28853596
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has title: How can jQuery fancy refresh an image div?
linked to: http://stackoverflow.com/q/1207190
type: Question
has answer: http://stackoverflow.com/a/28853596
has answer: http://stackoverflow.com/a/28853564
tagged with: javascript
has comment: http://stackoverflow.com/comment/45972913
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/28853564
tagged with: jquery
has comment: http://stackoverflow.com/comment/45973080
has body: I have a few camera that uploading images trougth FTP connection. I whould like to show the latest image with javascript, but I don't want to see white screens while the next image is loading. I have this code: &lt;script type="text/javascript" src="https://code.jquery.com/jquery-2.1.3.min.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function() { var $img = $('#image1'); setInterval(function() { $.get('https://alarmstudio.hu/&lt;?php print($scriptfolder); ?&gt;funkciok/kamerakep.php?ui=&lt;?php print($_SESSION['userData']['user_id']); ?&gt;&amp;ci=&lt;?php print($_REQUEST['kamera']); ?&gt;&amp;t='+ new Date().getTime(), function(data) { var $loader = $(document.createElement('img')); $loader.one('load', function() { $img.attr('src', $loader.attr('src')); }); $loader.attr('src', data); if($loader.complete) { $loader.trigger('load'); } }); }, 5000); }); &lt;/script&gt; &lt;div id="load"&gt; &lt;img id="image1" src="https://alarmstudio.hu/&lt;?php print($scriptfolder); ?&gt;funkciok/kamerakep.php?ui=&lt;?php print($_SESSION['userData']['user_id']); ?&gt;&amp;ci=&lt;?php print($_REQUEST['kamera']); ?&gt;" alt="kamerakep"/&gt;&lt;/div&gt; My problem is: The image is not showing at refresh. The refreshing response appears as such: ÿØÿàJFIFÿÛC %# , #&amp;')*)-0-(0%()(ÿÛC (((((((((((((((((((((((((((((((((((((((((((((((((((ÿÀÐ"ÿÄ ÿÄµ}!1AQa"q2¡#B±ÁRÑð$3br %&amp;'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖ×ØÙÚáâãäåæçèéêñòóôõö÷øùúÿÄ ÿÄµw!1AQaq"2B¡±Á #3RðbrÑ $4á%ñ&amp;'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖ×ØÙÚâãäåæçèéêòóôõö÷øùúÿÝÿÚ? uÝG?ññÿ/øQý»¨ÿÏÏþ8¿á]ÂBæßÅPYÃ&amp;Ëk½ÞrmvÔr¼éGÅmBæãÅsÙÍ.ëkM¾JmfèÐ·8ÉÉõ®e^cÙÇçÿ·u/ùøÿÇü(ö¥ÿ?&lt;¸¿á^¥ý¿©ÿÂªþØûOüLç·¿óßgÝÆ&gt;ï+/\ÿçÂ¸5S÷ú;¼¹¾î38Sò®ÝtªtcÓ×aû I dont know what is this. It gives me code 200, but no new image. First time the image is showing...

http://stackoverflow.com/q/28806932
has comment: http://stackoverflow.com/comment/45888061
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/30107984
tagged with: jquery-ui-tooltip
type: UnansweredQuestion
has body: I am trying to add a jQuery-ui tooltip to my rails application. By following the given example, I configured my javascript. I am trying to use below mentioned two options. But none seems working. $(document).tooltip({ track: true, position: { my: "center", at: "center bottom" } }); I got a tooltip but it was very simple tooltip with a simple black background and the options i specified was not making any affect on tooltip.
tagged with: ruby-on-rails
has title: Options in the jquery-ui tooltip function does not having any affect on tooltip
type: Question
tagged with: jquery-ui
tagged with: javascript
has comment: http://stackoverflow.com/comment/45887560
score: 0

http://stackoverflow.com/q/28838352
has comment: http://stackoverflow.com/comment/45946391
type: Question
has comment: http://stackoverflow.com/comment/45946392
tagged with: javascript
has answer: http://stackoverflow.com/a/28838544
has comment: http://stackoverflow.com/comment/45946206
has title: What is the correct syntax to load jQuery via CDN?
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/45946164
tagged with: undefined
tagged with: jquery
linked to: http://stackoverflow.com/q/2194992
has comment: http://stackoverflow.com/comment/45946453
has comment: http://stackoverflow.com/comment/45946338
favorite count: 0
has comment: http://stackoverflow.com/comment/45947417
linked to: http://stackoverflow.com/q/28839143
has comment: http://stackoverflow.com/comment/45946401
score: -3
has comment: http://stackoverflow.com/comment/45946154
has body: I have the following line of code in my head: &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"/&gt; I have the following lines of code at the beginning of my body: &lt;script&gt; $(function () { alert("JQUERY!"); }); &lt;/script&gt; My JavaScript Console gives the following error: Uncaught ReferenceError: $ is not defined I am using Google Chrome. I have read all of the answers at JQuery - $ is not defined, but as far as I can tell, I am obeying everything there. I have confirmed that the link in the first script is valid. I would expect jQuery to load, but it is failing to do so (silently). What is the correct syntax to make jQuery load from the CDN?
has comment: http://stackoverflow.com/comment/45946381
downvote count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45946225
tagged with: syntax
has comment: http://stackoverflow.com/comment/45946273
has comment: http://stackoverflow.com/comment/45946269
accepted answer: http://stackoverflow.com/a/28838544

http://stackoverflow.com/q/28775079
has comment: http://stackoverflow.com/comment/45828468
possible better answer: http://stackoverflow.com/a/28775135
type: Question
has answer: http://stackoverflow.com/a/28775156
has answer: http://stackoverflow.com/a/28775127
accepted answer: http://stackoverflow.com/a/28775127
score: -2
has body: Currently taking a course in treehouse on javascript. I understand when the instructor changes the value of a variable with just the = sign. But sometimes the instructor uses += and never really explained why. Im having a hard time understanding the difference between the two signs and on what instance would I use either of them. I would like your input on it to help me better understand, thank you. ie : var message = "hello"; message = "Whats up"; console.log(message); //Will log: Whats up var anotherMessage = "Hey"; anotherMessage += "How are you doing?" console.log(anotherMessage) //What would happen here, and why?
has comment: http://stackoverflow.com/comment/45828384
tagged with: javascript
has comment: http://stackoverflow.com/comment/45828487
has title: What is the difference between += and = when changing the value of a variable?
has comment: http://stackoverflow.com/comment/45828510
has comment: http://stackoverflow.com/comment/45828465
answer count: 3
downvote count: 3
upvote count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45828675
has comment: http://stackoverflow.com/comment/45828444
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28775135

http://stackoverflow.com/q/28853686
has title: Sort Array by attribute
has answer: http://stackoverflow.com/a/51161024
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28853839
tagged with: reactjs
has body: I right now just get the first 3 Object of an Array and map over them: { champions.slice(0,3).map(function(champ){ return ( {champ.name} something ) }) } Each champ has a level attribute (champ.level). How can I sort my output to champ.level descending and slice the first 3?
downvote count: 0
score: 61
favorite count: 0
upvote count: 61
answer count: 4
has answer: http://stackoverflow.com/a/28853817
has answer: http://stackoverflow.com/a/28853839
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/75188370
possible better answer: http://stackoverflow.com/a/28853817
type: Question

http://stackoverflow.com/comment/45798701
type: Comment
has text: thank you...it works partially...field will be read only after submission but once i refresh the page it becomes editable..
comment on: http://stackoverflow.com/a/28759064
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45879272
comment on: http://stackoverflow.com/q/28786498
has text: I didn't vote for the duplicate, regardless of what the system says, I voted to close because the code provided doesn't exhibit the issue. His link to a picture in the comments isn't helpful (I can't run a picture and this is a very common problem; the div has zero size when the map renders, so I know very well what it looks like, the posted code doesn't do that...).
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28789403
accepted answer: http://stackoverflow.com/a/28789415
tagged with: node.js
type: AnsweredQuestion
tagged with: socket.io
type: Question
upvote count: 4
downvote count: 0
tagged with: javascript
score: 4
has answer: http://stackoverflow.com/a/28789415
has title: Websockets transport only in Socket.io 1.3.4
answer count: 1
favorite count: 0
has body: When I used Socket.io 0.9.16 I could set up the desired and the only transport (websockets). No I upgraded to version 1 (1.3.4) and cannot understand, how to restrict the transport. Looks like it starts a connection with polling and then upgrades to websockets if "it" wants. I want it start and always work on websockets only.
has comment: http://stackoverflow.com/comment/45854437

http://stackoverflow.com/q/28878152
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28878230
has title: Earn from direct link
type: Question
score: -2
tagged with: javascript
has body: Is there any way to earn from direct links? For example, someone will search for a specific file, as soon as he finds it, he will click in download link (which will be direct link), when he clicks in direct link, he will be redirected in a page with advertisements and a download button. Is it possible to be automatically applied to every file in specific folder or subfolder inside mysite.com/directory/downloads/
tagged with: .htaccess
favorite count: 0
downvote count: 2
answer count: 1
upvote count: 0
accepted answer: http://stackoverflow.com/a/28878230
tagged with: php

http://stackoverflow.com/a/28819721
has body: It is possible, but your question is very broad.Check out the tutorials that W3 Schools provide, in my experience these are a great way to get started and provide great tutorials on PHP, SQL and jQuery.
has comment: http://stackoverflow.com/comment/45911581
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45948365
type: Answer
accepted answer of: http://stackoverflow.com/q/28819301
answers question: http://stackoverflow.com/q/28819301
upvote count: 3
score: 3
has comment: http://stackoverflow.com/comment/45911435

http://stackoverflow.com/a/28861433
type: Answer
answers question: http://stackoverflow.com/q/28833641
score: 0
has body: In the end it turned out to get it working i had to use var usrDate = new Date(uniqueID.value); thanks for all your helpful suggestions guys!

http://stackoverflow.com/a/39857630
answers question: http://stackoverflow.com/q/28870039
score: 0
type: Answer
has body: I encountered the same issue. It works in my hands only if I use a dict for the dates. This works: $scope.daterangepicker = { dates : { startDate: null, endDate: null } }; $scope.$watch("daterangepicker.dates", function(newDates, oldDates) { console.log("New date set: ", newDates); }, false);

http://stackoverflow.com/a/28814678
has comment: http://stackoverflow.com/comment/45937421
score: 0
has body: You can do this with a parametrised template: &lt;template name="glyph"&gt; &lt;span class="glyphicon glyphicon-{{icon this}}" aria-hidden="true"&gt;&lt;/span&gt; &lt;/template&gt; Add a helper function like: Template.glyph.helpers({ icon: function(name) { return &lt;Iconcollection&gt;.findOne({name:name}).icon } }); And then you can do something like this in your template: {{&gt; glyph 'fixer'}} or, if the argument comes from your iterator object {{&gt; glyph name}} (assuming your object has a .name property) In any case, I'd suggest you re-read and experiment with helpers and reactivity in Meteor. Since you already have the collection in the client, you'd usually solve this sort of problem with just a helper function. Meteor (re)calculates as the collections get updated, so you never really have to worry about it.
answers question: http://stackoverflow.com/q/28813103
has comment: http://stackoverflow.com/comment/45902119
type: Answer

http://stackoverflow.com/a/28843871
has body: You could add data-category that was set to 'company' or 'user' and switch on that.
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45956757
upvote count: 5
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28843785
answers question: http://stackoverflow.com/q/28843785
score: 5

http://stackoverflow.com/comment/46303940
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28851172
has text: Please help. I'm not able to find any solution.
type: Comment

http://stackoverflow.com/a/28869788
upvote count: 3
type: Answer
has comment: http://stackoverflow.com/comment/46003858
has body: That's because Array.forEach is an iterator. It always returns undefined. MDN: forEach() executes the callback function once for each array element; unlike every() and some() it, always returns the value undefined. What you need is Array.map The map() method creates a new array with the results of calling a provided function on every element in this array. function transformArray (aFunction) { return function(array) { return array.map(aFunction); }; } (Emphasis mine)
accepted answer of: http://stackoverflow.com/q/28869770
downvote count: 0
answers question: http://stackoverflow.com/q/28869770
score: 3
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46003720

http://stackoverflow.com/a/28830687
has comment: http://stackoverflow.com/comment/45931949
score: 0
has body: You could use the event object passed to the function So change the definition to function onEdit(e) { and then you can use e.user to get to the user Something like this if( r.getColumn() != 2 ) { //checks the column var row = r.getRow(), time = new Date(), user = e.user; time = Utilities.formatDate(time, "GMT", "dd-MM-yy' , 'HH:mm:ss"); SpreadsheetApp.getActiveSheet().getRange('J1').setValue(time); SpreadsheetApp.getActiveSheet().getRange('K1').setValue(user); };
type: Answer
answers question: http://stackoverflow.com/q/28830462
has comment: http://stackoverflow.com/comment/47400167

http://stackoverflow.com/comment/45911848
type: QuestionComment
comment on: http://stackoverflow.com/q/28820022
type: Comment
has text: You set it right here: `var dLastUpdate = new Date;`. So of course it has a value. Presumably you meant to just do `var dLastUpdate;` and leave it undefined?
score: 1

http://stackoverflow.com/comment/46006484
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28871521
score: 0
has text: this is the original JSON response

http://stackoverflow.com/a/28905680
has comment: http://stackoverflow.com/comment/46094662
has comment: http://stackoverflow.com/comment/46094548
downvote count: 0
has body: This is happening because the [] operator has special behavior for actual arrays. The objects you are creating are not arrays. If you try to an extend an array using a prototype, you will basically have an ordinary object with an Array's methods and default property values. Assigning values to it with [] will just result in adding properties to it and will have no effect on its length. Note that with some finagling it is possible to extend an array in such a way that assigning values to it with brackets updates the length. It basically involves instantiating actual arrays and appending your own methods to each new instance. See that here: http://www.bennadel.com/blog/2292-extending-javascript-arrays-while-keeping-native-bracket-notation-functionality.htm Additional reading: http://perfectionkills.com/how-ecmascript-5-still-does-not-allow-to-subclass-an-array/
answers question: http://stackoverflow.com/q/28905601
type: Answer
upvote count: 4
score: 4

http://stackoverflow.com/a/28771846
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45845709
has comment: http://stackoverflow.com/comment/45823087
has comment: http://stackoverflow.com/comment/45955497
has body: Even if your browser reports "function", prototypes are objects, or null.
answers question: http://stackoverflow.com/q/28771782
has comment: http://stackoverflow.com/comment/45839240
upvote count: 1
has comment: http://stackoverflow.com/comment/45822773
has comment: http://stackoverflow.com/comment/45822242
type: Answer
has comment: http://stackoverflow.com/comment/45867812
has comment: http://stackoverflow.com/comment/45828428
has comment: http://stackoverflow.com/comment/45848668

http://stackoverflow.com/comment/45932266
comment on: http://stackoverflow.com/a/28830429
type: Comment
has text: just use `div` instead of body try that got it ?
type: AnswerComment
score: 0

http://stackoverflow.com/q/28802179
tagged with: javascript
score: 56
favorite count: 0
has answer: http://stackoverflow.com/a/28893944
type: Question
answer count: 8
has answer: http://stackoverflow.com/a/36571084
has answer: http://stackoverflow.com/a/29711328
has answer: http://stackoverflow.com/a/46433192
possible better answer: http://stackoverflow.com/a/29711328
has answer: http://stackoverflow.com/a/28823590
linked to: http://stackoverflow.com/q/26787198
upvote count: 56
has body: There is a modal in this answer https://stackoverflow.com/a/26789089/883571 which is creating a React-based Modal by appending it to &lt;body&gt;. However, I found it not compatible with the transition addons provided by React. How to create one with transitions(during enter and leave)?
tagged with: css-transitions
has answer: http://stackoverflow.com/a/40706580
has title: How to create a React Modal (which is appended to ) with transitions?
has answer: http://stackoverflow.com/a/45291662
has answer: http://stackoverflow.com/a/50802105
tagged with: reactjs
accepted answer: http://stackoverflow.com/a/28823590
type: AnsweredQuestion
tagged with: modal-dialog
downvote count: 0

http://stackoverflow.com/comment/46053800
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28896797
has text: What version of PouchDB? AFAIK destroy is deprecated. (see Docs at http://pouchdb.com/api.html#delete_database)
score: 0

http://stackoverflow.com/q/28888389
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46038080
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/28890035
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has comment: http://stackoverflow.com/comment/46039618
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46038010
downvote count: 3
score: -3
has comment: http://stackoverflow.com/comment/46037923
type: Question
has title: can't use jQuery code after grabbing it by php?
has comment: http://stackoverflow.com/comment/46038630
upvote count: 0
has comment: http://stackoverflow.com/comment/46038400
has comment: http://stackoverflow.com/comment/46039658
answer count: 1
has body: I used jQuery ajax to grab jQuery scripts and javascript codes and put it in the head: $(document).ready(function(){ $("#SignUpBtn").click(function(){ $.ajax({ url: "ajax/signupfrm.php", type: "POST", data: "do=getScript", success: function(data){ $("head").append(data); } }); return false; }); The JavaScript works but not the jQuery. Here is the jQuery code grabbed from the PHP File: &lt;script type='text/javascript'&gt; $(document).ready(function(){ $('#username').change(function(){ var unameVal = $('#username').val(); $.ajax({ url: 'ajax/unameCheck.php', type: 'POST', data: {'do':'submit','uname':unameVal}, beforeSend: function() { $('#unameCheck').html('&lt;img src='img/giphy.gif'/&gt;').slideDown(500); }, success: function(data){ if(data == '0'){ $('#unameCheck').css({'background-color':'#FFBAA4','color':'#f00','border':'1px solid #f00'}); $('#unameCheck').html(unameVal + ' is already exist'); }else if(data == '1'){ $('#unameCheck').css({'background-color':'#AAFFAA','color':'#00B600','border':'1px solid #0f0'}); $('#unameCheck').html(unameVal + ' is available'); }else{ $('#unameCheck').slideUp(500); } } }) }); }); &lt;/script&gt;

http://stackoverflow.com/comment/45990366
comment on: http://stackoverflow.com/a/28841682
score: 0
type: AnswerComment
has text: I thought the solution would be something simple. Now why could I not find this simple solution within the CKEDitor documentation? Thank you.
type: Comment

http://stackoverflow.com/comment/45899479
has text: Yeah sorry. Thanks for your response though, I will play around with absolute positioning and see what i can do. I think this is gonna help me solve this issue so thanks very much - i will also have a look at bottom-up menus, cheers for the terminology.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28813586
score: 0

http://stackoverflow.com/comment/45822242
type: Comment
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28771846
has text: See also http://stackoverflow.com/questions/4859308/in-javascript-why-typeof-function-prototype-is-function-not-object-like-ot?rq=1

http://stackoverflow.com/q/28838945
type: UnansweredQuestion
has body: Any idea on how to integrate CakePHP 2.6 and ViewerJS into an iFrame? The code below shows an empty ViewerJS frame. If I try to show only the resource, it works. I have the right paths to ViewerJS and the file, but it still doesn't work. &lt;iframe src="&lt;?php echo $this-&gt;webroot; ?&gt;ViewerJS/#../&lt;?php echo $atividade['Atividade']['caminho'] ?&gt;" width='400' height='300' allowfullscreen webkitallowfullscreen&gt;&lt;/iframe&gt;
has title: CakePHP and ViewerJS
type: Question
has answer: http://stackoverflow.com/a/28858681
answer count: 2
tagged with: cakephp
tagged with: javascript
tagged with: viewer
score: 0
has answer: http://stackoverflow.com/a/28841983

macos
tags question: http://stackoverflow.com/q/28777429
tags question: http://stackoverflow.com/q/28879223
type: Tag
tag name: macos

file-upload
tags question: http://stackoverflow.com/q/28856729
tags question: http://stackoverflow.com/q/28780614
type: Tag
tags question: http://stackoverflow.com/q/28753905
tags question: http://stackoverflow.com/q/28762150
tags question: http://stackoverflow.com/q/28855572
tag name: file-upload
tags question: http://stackoverflow.com/q/28871732
tags question: http://stackoverflow.com/q/28808886

http://stackoverflow.com/comment/46051568
comment on: http://stackoverflow.com/q/28895738
type: Comment
type: QuestionComment
has text: I m confusing with code. I clear all. :D I can't twists
score: 0

http://stackoverflow.com/q/28840809
has comment: http://stackoverflow.com/comment/45952383
has comment: http://stackoverflow.com/comment/45950960
has answer: http://stackoverflow.com/a/28842082
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45950800
tagged with: http://stackoverflow.com/tag/json
type: Question
score: 0
has body: I'm using an ajax call to get a JSON file using jQuery. While I am successful in doing so and can reach the values of the file, the next challenge is to get a value of the object array and compare it to an input source. If true then print it out in a span or div... Here is the script using jQuery: jQuery.getJSON demo the JSON file is: { "zipcodes": [ { "zip": "20002", "city": "Washington", "state": "DC" }, { "zip": "10001", "city": "New York", "state": "NY" } ] } The JSON file is valid but I guess I'm trying to figure out a comparison in values of zip e.g. if a var text = '10001' == value.zip within the array return the city and state within the HTML I can implement that part but in the jQuery portion I do not know how to get an index. I tried using .eq and .get and it won't work. Thanks!
has comment: http://stackoverflow.com/comment/45950874
answer count: 1
tagged with: javascript
tagged with: jquery
has title: Comparing an input value to an array value using jquery
tagged with: ajax
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28872872
has answer: http://stackoverflow.com/a/28872952
accepted answer: http://stackoverflow.com/a/28872952
possible better answer: http://stackoverflow.com/a/32955835
type: AnsweredQuestion
downvote count: 0
score: 23
has title: Error in Sending Form file with form using AJAX
tagged with: php
type: Question
has answer: http://stackoverflow.com/a/28872972
has comment: http://stackoverflow.com/comment/84490351
has comment: http://stackoverflow.com/comment/46008524
has answer: http://stackoverflow.com/a/50712469
upvote count: 23
tagged with: javascript
has body: I am trying to submit form using AJAX that contains CSV File. So the idea is sending the form using ajax, process it in different file by generating a table and call back the processed table back into the page. What i Have is this, SHOW FILE CONTENT and the JavaScript is, $("#btnSubmit").click(function(){ $.ajax({ type: 'POST', url: '../../content/maindiv_content/drawing/divpages/process_xls_file.php', data: new FormData(this), contentType: false, cache: false, processData: false, success: function (response, textStatus, jqXHR) { $("#showFileContentTable").html(data); } }); }); and im getting this kind of error in firebug, TypeError: Argument 1 of FormData.constructor does not implement interface HTMLFormElement. http://infserver/WeltesTankage/dist/js/jquery-1.10.2.min.js line 4 > eval Line 14 What am i doing wrong here ? Please help me
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/32955835
has answer: http://stackoverflow.com/a/40758484
answer count: 5

http://stackoverflow.com/a/28755250
score: 1
downvote count: 0
has body: It seems you are not iterating the computer array. Try changing the inner loop something like this: for (var prop in data[obj]) { console.log(prop); if (prop == "Computer") { for( var cmp in data[obj][prop] ) { console.log(prop + ':' + cmp.ID[0]); console.log(prop + ':' + cmp.LastReportTime[0]); } } } Update Added the array notation to the ID and LastReportTime as well per your JSON
type: Answer
has comment: http://stackoverflow.com/comment/45793797
upvote count: 1
answers question: http://stackoverflow.com/q/28755072

http://stackoverflow.com/comment/45801627
comment on: http://stackoverflow.com/a/28760107
type: Comment
has text: ozi , I agree with @Mayhem. If you're planning on hosting the file on your own server to access via XHR, the code I offered is intended for that. If w3schools.com had a 'Access-Control-Allow-Origin: *' header on the XML file your are requesting, it would also work. But they don't. The only options to accomplish your project are the ones we mentioned in these comments... or the pretty genius method offered in PHP by 'Mayhem' if that is in your ability. You have two really excellent coders working on your question and I believe we have taken your answer as far as it will go. Again, good luck.
score: 2
type: AnswerComment

http://stackoverflow.com/comment/46027110
score: 1
type: Comment
type: QuestionComment
has text: you clearly have a syntax error
comment on: http://stackoverflow.com/q/28882952

http://stackoverflow.com/a/28875556
answers question: http://stackoverflow.com/q/28875522
type: Answer
has body: Use this function check() { $.ajax({ url : '/check', datatype : 'json', async : false, success : function(status) { $(".medium-10 &gt;p").html(status); }, }); }
score: 0

http://stackoverflow.com/comment/45807890
score: 0
type: Comment
type: QuestionComment
has text: You are right @tiny I think that it is not. It is really missing. Thanks
comment on: http://stackoverflow.com/q/28764164

http://stackoverflow.com/comment/45885781
has text: Okay, the edit addresses **half** of the feedback. Again: What do you want to do with the results?
comment on: http://stackoverflow.com/q/28805384
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/28778532
has answer: http://stackoverflow.com/a/28778937
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/2946656
type: Question
has body: I want to append num amount of img elements to the DOM, and give each image an id according to which num it is. I know I need a loop, so this is what I have so far: window.onload = function makeImage(){ for(i=0;i&lt;num;i++){ document.getElementById('test').innerHTML="&lt;img id='i' src='img/image.jpg'/&gt;"; } }; &lt;div id="test"&gt;&lt;/div&gt;
has comment: http://stackoverflow.com/comment/45834973
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28778937
possible better answer: http://stackoverflow.com/a/28778610
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28778610
has title: How to create and add elements to the DOM in a loop
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/28872248
answer count: 2
has answer: http://stackoverflow.com/a/28872301
has title: How would you make a request when you created a form?
tagged with: request
has comment: http://stackoverflow.com/comment/46007607
type: AnsweredQuestion
has body: I am trying to hack a page that requires a "username" and "password". I have created a form and I think it looks good; People have told me that my form looks good and that I need to create a request in javascript. I don't know how to create one because I just started learning javascript yesterday. I have searched on how to create a request of submit, and all I see is functions that look like they are making a form, which I already have, so am confused. How would I send a request to log me into a website, assuming that url exists, and both name and password are correct. EDIT: I have formatted the code below because I don't want the page to show any text at all even though am logged in, it should just be blank. But a test page shows that I didn't get logged in; Test page for your custom form
has answer: http://stackoverflow.com/a/28872348
accepted answer: http://stackoverflow.com/a/28872348
possible better answer: http://stackoverflow.com/a/28872301
tagged with: forms
tagged with: http
type: Question
tagged with: javascript
tagged with: post
score: 0
has comment: http://stackoverflow.com/comment/46007417

http://stackoverflow.com/q/28776149
score: 0
accepted answer: http://stackoverflow.com/a/28828415
answer count: 1
tagged with: canvas
has title: Drawing/Moving/Deleting strokes on HTML5 Canvas
tagged with: javascript
has comment: http://stackoverflow.com/comment/45926341
has comment: http://stackoverflow.com/comment/45831983
type: AnsweredQuestion
tagged with: html5-canvas
has answer: http://stackoverflow.com/a/28828415
tagged with: cordova
type: Question
has body: I am developing a drawing app using HTML5 Cordova. I need to implement drawing ,move strokes, delete ink strokes on HTML5 Canvas. I am exploring best ways to achieve the following: 1) Draw a stroke 2) Select a stroke and move it 3) Select a stroke and delete it. It would be something similar to this: https://software.intel.com/en-us/html5/articles/touch-drawing-app-using-html5-canvas But I need to select/move/delete strokes which is not supported in above library. Any pointers/samples would be really appreciated. Thanks in advance.
tagged with: drawing

http://stackoverflow.com/q/28905342
tagged with: jquery
has comment: http://stackoverflow.com/comment/46070254
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/46070319
has comment: http://stackoverflow.com/comment/46070701
has answer: http://stackoverflow.com/a/28905389
has comment: http://stackoverflow.com/comment/46070126
tagged with: php
has comment: http://stackoverflow.com/comment/46070584
has body: I am making a call to a jQuery Mobile form to a simple PHP mailing file. I have tested the PHP file using the same data I am passing from the ajax call, which works just fine. However, when using ajax, the email is not sent and the address bar contains the query string. I really need more sets of eyes looking a this, since my mine seem permanently crossed. Form Excerpt Name:* JavaScript $('#hipaa-form').on('submit', function (e) { var data = $(this).serialize(); $.ajax({ type: "GET", url: email.php, data: data, dataType: "text", success: function (result) { alert(result); }, error: function(xhr, status, error) { var err = eval("(" + xhr.responseText + ")"); alert("Error: " + +err.Message) } }); }); Note the data variable is set correctly, and is the string that winds up in the address bar. The alert from the success function displays the entire web page, but again the email is not sent. I tried setting custom error handlers in PHP, but they were no help at all. PHP $body = "Full Name: " . $_GET["name"] . "\r\n"; $body = $body . "email: " . $_GET["email"] . "\r\n"; $body = $body . "Phone: " . $_GET["phone"] . "\r\n"; $body = $body . "website: " . $_GET["Website-URL"] . "\r\n"; $body = $body . "app. type: " . $_GET["pgm-type"] . "\r\n"; $body = $body . "uses DB: " . $_GET["uses-db"] . "\r\n"; $body = $body . "saves data: " . $_GET["stores-patient-data"] . "\r\n"; $body = $body . "db vendor: " . $_GET["database-vendor"] . "\r\n"; if (isset($_GET["db-other"])) $body = $body . "other db: " . $_GET["db-other"] . "\r\n"; $to = "contact.us@bunkerhill.com"; $subject = "HIPAA Form Submission"; mail($to, $subject, $body, "From: contact.us@text.bunkerhill.com"); echo "Form Submitted" ?> My test site is : http://test.bunkerhill.com/ TIA
type: AnsweredQuestion
downvote count: 0
score: 1
has title: Why does a simple ajax call to php exhibit such strange behavior?
has comment: http://stackoverflow.com/comment/46070669
has answer: http://stackoverflow.com/a/28905956
accepted answer: http://stackoverflow.com/a/28905956
type: Question
possible better answer: http://stackoverflow.com/a/28905389
tagged with: jquery-mobile
tagged with: javascript
answer count: 2
has comment: http://stackoverflow.com/comment/46071022
linked to: http://stackoverflow.com/q/504947
upvote count: 1
has comment: http://stackoverflow.com/comment/46069923
has comment: http://stackoverflow.com/comment/46070825

http://stackoverflow.com/q/28904361
has answer: http://stackoverflow.com/a/28905571
accepted answer: http://stackoverflow.com/a/28905571
answer count: 1
tagged with: javascript
tagged with: bootstrap-tour
has body: HTML: button JS: var tour = new Tour({ steps: [{ element: "#enrol-btn1", title: "Exam Enrolment", content: "First let's enrol to an exam" }] }).init().start(true); I cannot get it to initialize on this JSFiddle: http://jsfiddle.net/P5fJ2/20/ What else do I need in order to get a basic example going? I looked through a few other questions on SO but couldn't fix this fiddle
type: AnsweredQuestion
tagged with: twitter-bootstrap
type: Question
has title: Bootstrap-tour not initializing
score: 0

http://stackoverflow.com/a/28887486
has body: The regex you provided is made out of 5 major parts: The pattern validating the length: [A-Za-z\d$@$!%*?&amp;]{8,24} A positive lookahead for at least one lowercase: (?=.*[a-z]) A positive lookahead for at least one uppercase: (?=.*[A-Z]) A positive lookahead for at least one number: (?=.*\d) A positive lookahead for at least one special char: (?=.*[$@$!%*?&amp;]) Now, you only want to apply 3 out of the 4 positive lookaheads. Since lookaheads are non-consuming matches, the cursor of the regex-engine will remain unchanged, as the matching is going on. (Using positive Lookaheads this way is often used to generate AND-Patterns) So, you now have 4 conditions and you want that only 3 of them are matched. As described, it would be easy to use independent expressions and check if 3 apply. However, some native features (for instance jsf's f:validateRegex) only work with a single pattern. Regular Expressions are supporting OR in a native way: | - hence to turn your expression 1 AND 2 AND 3 AND 4 into a minimum requirement of matching 3 of them, you could use an expression like (1 AND 2 AND 3) OR (1 AND 2 AND 4) OR (1 AND 3 AND 4) OR (2 AND 3 AND 4), which would cover all usecases required: 1 2 3 4 1 1 1 0 1 1 0 1 1 0 1 1 0 1 1 1 So, to match all this within a single pattern, just rearange your lookaheads as required: ^(?:(?=.*[a-z])(?=.*[A-Z])(?=.*\d)|(?=.*[a-z])(?=.*[A-Z])(?=.*[$@$!%*?&amp;])|(?=.*[a-z])(?=.*\d)(?=.*[$@$!%*?&amp;])|(?=.*[A-Z])(?=.*\d)(?=.*[$@$!%*?&amp;]))[A-Za-z\d$@$!%*?&amp;]{8,24}$ Drilldown: ^(?: - non matching group (?=.*[a-z])(?=.*[A-Z])(?=.*\d) - one lower, one upper, one number | - or (?=.*[a-z])(?=.*[A-Z])(?=.*[$@$!%*?&amp;]) - one lower, one upper, one special | - or (?=.*[a-z])(?=.*\d)(?=.*[$@$!%*?&amp;]) - one lower, one number, one special | - or (?=.*[A-Z])(?=.*\d)(?=.*[$@$!%*?&amp;]) - one upper, one number, one special ) [A-Za-z\d$@$!%*?&amp;]{8,24}$ - 8 to 24 chars. (Debuggex is using javascript) ^(?:(?=.*[a-z])(?=.*[A-Z])(?=.*\d)|(?=.*[a-z…
downvote count: 0
has comment: http://stackoverflow.com/comment/46036894
answers question: http://stackoverflow.com/q/28886707
has comment: http://stackoverflow.com/comment/46036502
type: Answer
has comment: http://stackoverflow.com/comment/46036250
has comment: http://stackoverflow.com/comment/46036218
score: 4
has comment: http://stackoverflow.com/comment/114655542
has comment: http://stackoverflow.com/comment/46036417
upvote count: 4

http://stackoverflow.com/q/28766628
answer count: 1
tagged with: game-engine
downvote count: 0
accepted answer: http://stackoverflow.com/a/28772653
favorite count: 0
has comment: http://stackoverflow.com/comment/45814357
has comment: http://stackoverflow.com/comment/45812482
type: AnsweredQuestion
score: 2
upvote count: 2
has answer: http://stackoverflow.com/a/28772653
type: Question
has comment: http://stackoverflow.com/comment/45812233
has comment: http://stackoverflow.com/comment/45812672
has title: Negative coordinates in a grid based game
tagged with: path-finding
tagged with: arrays
tagged with: javascript
tagged with: canvas
has body: I have written a small 2D game in javascript that uses a grid where the player starts at position [0,0] and can move an almost infinite distance in either direction. Now I want to implement A* pathfinding, but I'm having some problems finding the best way to store the world with all it's different obstacles, enemies and terrain. This is what I have tried or thought about so far. Array of arrays Here I store the world in an array of arrays [x][y]. var world = [[]]; world[312][11] = 0; world[312][12] = 0; world[312][13] = 1; world[312][14] = 1; ... This works great with A* pathfinding! It's easy and very fast to access a specific coordinate and populate the world. In the example above I just store passable (0) or impassable (1) terrain, but I can store pretty much whatever I want there. However, this doesn't work very well with negative coordinates like if my players is at [-12][-230]. Negative keys in a javascript array isn't actually part of the array, they won't be included in world.length or world[3].length and from what I understand, it's overall bad practice and might have some impact on the performance as well. I read somewhere that if you are using negative keys in your array, you are doing it wrong. I would still not pass the entire world into the A* function for obvious reasons. Just a small part close to my player, but the coordinates would correspond to the positions in the array which is easy to work with. A separate array of arrays just for A* pathfinding This is where I'm at right now. I have a separate 50x50 grid called pathMap = [[]], that is only used for pathfinding. var pathMap = [[]]; pathMap[0][0] = 0; pathMap[0][1] = 0; pathMap[0][2] = 1; pathMap[0][3] = 1; ... It starts at pathMap[0][0] and goes to pathMap[50][50] and is working as an overlay on my current position where I (as the player) will always be in the center position. My real coordinates may be something like [-5195,323], but it translates to pathMap[25][25] and everything close to me …

http://stackoverflow.com/q/28825669
has answer: http://stackoverflow.com/a/28825886
type: UnansweredQuestion
tagged with: css
upvote count: 1
type: Question
has body: This is the div that creates the description field, The first field has autocomplete function but the other problem is that i can add the fields dynamically but the added fields doesn't have autocomplete jquery. Immediate Cause <?php echo form_error('immediate_cause'); ?> <?php endif; ?> <?php if (!empty($result)){ $get_cause_Data = array(); foreach ($result as $row_data) { $get_cause_Data[] = $row_data->icd.','.$row_data->description; } $raw_data = implode('","',$get_cause_Data); } ?>
has title: autocomplete dynamic input field failed
has comment: http://stackoverflow.com/comment/48445877
tagged with: autocomplete
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
score: 1
favorite count: 0

http://stackoverflow.com/comment/45900388
type: Comment
score: 1
comment on: http://stackoverflow.com/q/28814299
has text: Can you include a sample of the html structure, or similar structure which exhibits the behavior, that correlates to this code?
type: QuestionComment

http://stackoverflow.com/comment/46051364
type: AnswerComment
comment on: http://stackoverflow.com/a/28895701
score: 0
type: Comment
has text: If that was the only issue, the error message would be different. The other problem seems to be that the element is not found.

http://stackoverflow.com/comment/45957204
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28843555
has text: Note to reviewers: If you see this crop up in the queue its because the asker vandalised the answer.
score: 0

http://stackoverflow.com/comment/45897407
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28812699
score: 0
has text: Yes there is. Use a class name instead of writing out lots code with different IDs.

http://stackoverflow.com/comment/45835756
comment on: http://stackoverflow.com/a/28779105
has text: I do not require file name without extension I just want to remove last extension from the URL only. so that It will be more readable.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45956104
has text: `$.getJSON` is asynchronous. It returns a promise.
type: AnswerComment
comment on: http://stackoverflow.com/a/28843604
type: Comment
score: 1

http://stackoverflow.com/a/28846290
downvote count: 0
has comment: http://stackoverflow.com/comment/45992197
type: Answer
has comment: http://stackoverflow.com/comment/46029878
score: 1
upvote count: 1
has body: I think you can firstly fetch content using ajax, search for keyword, then highlight the url if necessary. But this comes with limitation: The url you want to highlight should allow cross-site ajax fetching. performance will not be so good, since you need to fetch each url if there are many. If the targeting url is client-side rendering, fetching its html simply won't see the content since its not render yet. Normally we won't solve this using front-end approach, but using search-engine indexing method instead.
accepted answer of: http://stackoverflow.com/q/28846146
answers question: http://stackoverflow.com/q/28846146
has comment: http://stackoverflow.com/comment/46008980
type: AcceptedAnswer

http://stackoverflow.com/a/28866723
score: 0
has body: Example: SP.SOD.executeFunc("clienttemplates.js", "SPClientTemplates", function() { SPClientTemplates.TemplateManager.RegisterTemplateOverrides({ OnPreRender: function(ctx) { var field = getFieldByDisplayName(ctx,"Task Name"); if(field) field.DisplayName = "Task Name:::"; } }); }); function getFieldByDisplayName(ctx,name) { var result = ctx.ListSchema.Field.filter(function(f){return f.DisplayName == name;} ); //find field by display name return result.length &gt; 0 ? result[0] : null; } Result
type: Answer
accepted answer of: http://stackoverflow.com/q/28797086
answers question: http://stackoverflow.com/q/28797086
type: AcceptedAnswer

http://stackoverflow.com/comment/45825537
type: Comment
has text: I think it would be easier to make your own.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28773432

http://stackoverflow.com/a/28905121
type: Answer
has comment: http://stackoverflow.com/comment/46069709
downvote count: 1
upvote count: 0
score: -1
has body: To append data to the value, get the old value, append the data to the string, then assign the new value back. $("#quickLinksURLs").val( $("#quickLinksURLs").val() + $("#quickLinksSave").val() ); You will probably want to add + "\n" somewhere in that string to get your new line.
answers question: http://stackoverflow.com/q/28905022

http://stackoverflow.com/q/28860728
type: Question
possible better answer: http://stackoverflow.com/a/45321378
has answer: http://stackoverflow.com/a/56578300
has answer: http://stackoverflow.com/a/45321378
downvote count: 1
answer count: 7
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28862951
accepted answer: http://stackoverflow.com/a/28862951
has comment: http://stackoverflow.com/comment/45987848
has title: Reading Excel file using node.js
has answer: http://stackoverflow.com/a/75834140
has answer: http://stackoverflow.com/a/59751856
tagged with: angularjs
has answer: http://stackoverflow.com/a/44886483
score: 89
has comment: http://stackoverflow.com/comment/45989822
tagged with: node.js
type: AnsweredQuestion
tagged with: import-from-excel
has comment: http://stackoverflow.com/comment/45989484
has body: Okay so i am using the FileUploader module to upload my file from angular to my REST API: var uploader = $scope.uploader = new FileUploader({ url: api.getUrl('uploadCompetence',null) }); This is sent to the following POST function: router.route('/api/uploadCompetence') .post(function (req, res) { // This is where i want to read the file var competence = Competence.build(req.body.location); competence.add(function (success) { res.json({message: 'quote created!'}); }, function (err) { res.status(err).send(err); }); }) Now my goal is to read the excel file and then add each row to my database. However im not quite sure how i can read the file from Node.js i have debugged my server and couldnt find the file anywhere but the the api is being called from my Angular application Can anyone push me in the right direction? :)
upvote count: 90
has answer: http://stackoverflow.com/a/51096128
has comment: http://stackoverflow.com/comment/45987749

http://stackoverflow.com/q/28775317
type: Question
has body: I implement HorizontalScrollView using this sample code and this . I have fetch data from server but i cant find way to implement onclick listener , How can I make horizontalscrollview click event ? ArrayList&lt;star&gt; actorsList; actorsList = new ArrayList&lt;Actors&gt;(); new JSONAsyncTask().execute("http://microblogging.wingnity.com/JSONParsingTutorial/jsonActors"); centerLockHorizontalScrollview = (CenterLockHorizontalScrollview) findViewById(R.id.scrollView); adapter = new ActorAdapter(getApplicationContext(), R.layout.row, actorsList); centerLockHorizontalScrollview.setAdapter(MainActivity.this, adapter); getView method : @Override public View getView(int position, View convertView, ViewGroup parent) { View v = convertView; if (v == null) { holder = new ViewHolder(); v = vi.inflate(Resource, null); /// //// ///// v.setTag(holder); } else { holder = (ViewHolder) v.getTag(); } //// //// ///// return v; } CenterLockHorizontalScrollview class public class CenterLockHorizontalScrollview extends HorizontalScrollView { Context context; int prevIndex = 0; public CenterLockHorizontalScrollview(Context context, AttributeSet attrs) { super(context, attrs); this.context = context; this.setSmoothScrollingEnabled(true); } public void setAdapter(Context context,ActorAdapter mAdapter) { try { fillViewWithAdapter(mAdapter); } catch (ZeroChildException e) { e.printStackTrace(); } } private void fillViewWithAdapter(ActorAdapter mAdapter) throws ZeroChildException { if (getChildCount() == 0) { throw new ZeroChildException( "CenterLockHorizontalScrollView must have one child"); } if (getChildCount() == 0 || mAdapter == null) return; ViewGroup parent = (ViewGroup) getChildAt(0); parent.removeAllViews(); for (int i = 0; i &lt; mAdapter.getCount(); i++) { parent.addView(mAdapter.getView(i, null, parent)); } } public void setCenter(int index) { ViewGroup parent = (ViewGroup) getChildAt(0); View preView = parent.getChildAt(prevIndex); preView.setBackgroundColor(Color.parseColor("#64C…
downvote count: 0
tagged with: javascript
tagged with: click
tagged with: android
favorite count: 0
answer count: 0
type: UnansweredQuestion
tagged with: horizontalscrollview
upvote count: 1
has title: horizontalscrollview click event not working
score: 1

http://stackoverflow.com/comment/46072621
type: Comment
score: 0
has text: Is it possible to use vba?
type: AnswerComment
comment on: http://stackoverflow.com/a/28906562

http://stackoverflow.com/a/45441539
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/28898839
has body: I'm experienced this in lodash-core 4.17.4. The solution was to use the full build instead of the core build.
score: 2
downvote count: 0

http://stackoverflow.com/q/28856693
has answer: http://stackoverflow.com/a/29187053
downvote count: 7
type: Question
tagged with: rich-text-editor
tagged with: javascript
answer count: 2
has title: A single-line text editor with procedural formatting in HTML5
upvote count: 0
has answer: http://stackoverflow.com/a/28857351
score: -7
favorite count: 0
has body: I need to let user to enter a series of identifiers in a input box on my web-page. For example: trains cars planes. If user enters an identifier that I recognize, I need to render an icon to the left of it, and change the formatting of an identifier (font-weight, color, background color, corner radius, padding etc.). For example: [fa-train]trains [fa-car]cars [fa-plane]planes. The widget must automatically adjust its height to fit the text if it becomes too long to fit. User should not be able to directly change the formatting of the text in any way, or, say remove an icon. If user copies or pastes the text, only plain text is to be copied or pasted, without information about icons. Is there an easy way to implement this widget?
tagged with: http://stackoverflow.com/tag/html
tagged with: twitter-bootstrap
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45994596

http://stackoverflow.com/q/28840841
has title: Retrieving a users password in Cloud Code
downvote count: 0
type: UnansweredQuestion
has body: Is it possible to retrieve a users password in Cloud Code by using myUser.get("password")? I'm even using the master key and I still can't retrieve it. Update: PFCloud.callFunctionInBackground("updateUser", withParameters: ["username" : username, "newPassword" : newPasswordText.text, "currentPassword" : currentPasswordText.text, "operation" : 2]) { (positions: AnyObject!, error: NSError!) -&gt; Void in if error == nil { self.navigationController?.popToRootViewControllerAnimated(true) } else { let errorAlert = UIAlertController (title: "Error", message: "Invalid current password", preferredStyle: UIAlertControllerStyle.Alert) let actionCancel = UIAlertAction (title: "Dismiss", style: .Cancel, handler: nil) errorAlert.addAction(actionCancel) self.presentViewController(errorAlert, animated: true, completion: nil) } } Parse.Cloud.define("updateUser", function(request, response) { // Set up to modify user data Parse.Cloud.useMasterKey(); var query = new Parse.Query(Parse.User); query.equalTo("username", request.params.username); query.first({ success: function(myUser) { var password = myUser.get("password"); if (request.params.operation == 1) { myUser.set("password", request.params.newPassword); } else if (request.params.operation == 2 &amp;&amp; password == request.params.currentPassword) { myUser.set("password", request.params.newPassword); } else { response.error(password); } myUser.save(null, { success: function(myUser) { // The user was saved successfully. response.success("Successfully updated user."); }, error: function(myUser, error) { // The save failed. // error is a Parse.Error with an error code and description. response.error("Could not save changes to user."); } }); }, error: function(error) { alert("Error: " + error.code + " " + error.message); } }); });
score: 3
has comment: http://stackoverflow.com/comment/45951333
has comment: http://stackoverflow.com/comment/45951235
tagged with: javascript
has comment: http://stackoverflow.com/comment/45951204
type: Question
answer count: 1
has answer: http://stackoverflow.com/a/28841295
favorite count: 0
tagged with: parse-cloud-code
has comment: http://stackoverflow.com/comment/45951642
upvote count: 3
tagged with: parse-platform
has comment: http://stackoverflow.com/comment/45950925
tagged with: swift

http://stackoverflow.com/comment/45970955
type: Comment
score: 1
comment on: http://stackoverflow.com/q/28851738
has text: @FabrizioMorello Dictionary is in your tags
type: QuestionComment

http://stackoverflow.com/comment/46012797
type: QuestionComment
has text: @Nitish no answer image div is example. The real posts not have same height. But developer console code is same like my question image.
comment on: http://stackoverflow.com/q/28874932
score: 0
type: Comment

http://stackoverflow.com/comment/55234683
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28861379
has text: Hi @user3366357 did you find a work around for this at all?
score: 0

http://stackoverflow.com/comment/45835222
has text: Sorry about that, I read the first few lines and saw POST and no headers being set, and then skimmed the rest of your post, as well as the replies. I didn't realize the real problem you needed help with was at the end of your post. I'll take another look and edit my post to try and get you a better answer.
comment on: http://stackoverflow.com/a/28778736
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28821366
tagged with: javascript
favorite count: 0
type: UnansweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28821399
has comment: http://stackoverflow.com/comment/45914587
has title: javascript check if JSON key exists and display the value
type: Question
linked to: http://stackoverflow.com/q/11922383
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45914631
has answer: http://stackoverflow.com/a/28821383
answer count: 2
upvote count: 1
has body: I've been tinkering with Z-Wave lately and I'm trying to make a page to include/exclude their products. But it's not going too well. I'm trying to check if a JSON key exists then display it on the page. I get TypeError: data.controller is undefined Here is the code: window.setInterval(function(){ getData(); }, 2000); function getData() { var milliseconds = (new Date).getTime(); var time = milliseconds.toString().substr(0, milliseconds.toString().length - 3) ; $.postJSON( "http://192.168.1.102:8083/ZWaveAPI/Data/" + time, function( data ) { if(data.controller.lastExcludedDevice.value) alert("EXCLUDED SOMETHING"); if(data.controller.lastIncludedDevice.value) alert("INCLUDED SOMETHING"); }); } $.postJSON = function(url, data, callback, sync) { // shift arguments if data argument was omited if ( jQuery.isFunction( data ) ) { sync = sync || callback; callback = data; data = {}; }; $.ajax({ type: 'POST', url: url, data: data, dataType: 'json', success: callback, error: callback, async: (sync!=true) }); }; Json: { "controller.data.controllerState": { "value": 0, "type": "int", "invalidateTime": 1424781697, "updateTime": 1425338938 }, "controller.data.lastIncludedDevice": { "value": 42, "type": "int", "invalidateTime": 1424781697, "updateTime": 1425338938 }, ...... Any help is greatly appreciated.
downvote count: 0

http://stackoverflow.com/a/28922804
type: Answer
score: 3
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28802603
answers question: http://stackoverflow.com/q/28802603
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/86064093
upvote count: 3
has body: I ended up solving my problem by using Chai as Promised. It allows you to make assertions about the resolution and rejections of promises: return promise.should.become(value) return promise.should.be.rejected

http://stackoverflow.com/a/28834764
upvote count: 1
has comment: http://stackoverflow.com/comment/45939226
has body: You wont be able to convert JavaScript variable/function call to a Razor variable. Razor variable is handled by Razor engine on server where as JavaScript on the other hand is a client side language running on the client. Razor is a view engine used by the ASP.NET MVC framework running on the server to produce some HTML template.
answers question: http://stackoverflow.com/q/28834736
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/comment/45849096
comment on: http://stackoverflow.com/a/28786437
type: Comment
has text: As unlikely as it is. Also, you could run an apple ][ on a Gigabit Ethernet, for that matter.
type: AnswerComment
score: 0

http://stackoverflow.com/q/28874924
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28875039
has title: Timeout for first slide in slideshow not working (lasts almost double other slides)
has body: I am using a responsive slideshow (http://responsiveslides.com/) for some testimonials on a website with the following settings: jQuery(".rslides").responsiveSlides({ auto: true, // Boolean: Animate automatically, true or false speed: 100, // Integer: Speed of the transition, in milliseconds timeout: 10000, // Integer: Time between slide transitions, in milliseconds pager: false, // Boolean: Show pager, true or false nav: true, // Boolean: Show navigation, true or false random: false, // Boolean: Randomize the order of the slides, true or false pause: true, // Boolean: Pause on hover, true or false pauseControls: true, // Boolean: Pause when hovering controls, true or false prevText: "Previous", // String: Text for the "previous" button nextText: "Next", // String: Text for the "next" button maxwidth: "", // Integer: Max-width of the slideshow, in pixels navContainer: "", // Selector: Where controls should be appended to, default is after the 'ul' manualControls: "", // Selector: Declare custom pager navigation namespace: "rslides", // String: Change the default namespace used before: function(){}, // Function: Before callback after: function(){} // Function: After callback }); However, the first slide lasts almost double the other slides. Does anyone know how to fix this or why it is happening? Any help would be really appreciated! You can see the error at this page: http://www.hbprojectsltd.co.uk/testimonials
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28875039
tagged with: responsive-slides
type: Question
answer count: 1
tagged with: slideshow
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/comment/126953461
comment on: http://stackoverflow.com/a/45585839
has text: Arrow functions implicitly return the expression on the right side of the arrow. eg `p => p * 2` will return the result of `p * 2`. The exception to this rule is when the expression on the right side is wrapped in curly braces, then you have to return yourself.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/50508242
comment on: http://stackoverflow.com/a/28821717
has text: The big question is, if you don't the same functionality in every test, why have a global spy at all? If you want to set the spy for every test, then set the spy for every test.
score: 4
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45872924
type: QuestionComment
score: 2
has text: This is not Java, you have to use `this.weight` explicitly.
comment on: http://stackoverflow.com/q/28799363
type: Comment

http://stackoverflow.com/comment/45826911
type: Comment
comment on: http://stackoverflow.com/a/28771092
has text: I firmly believe that assuming every user is using one implementation is lazy and generally bad advice. Whether you like it or not, other browsers **are** used and should be accounted for.
type: AnswerComment
score: 1

http://stackoverflow.com/q/28814817
answer count: 0
type: Question
has title: Handlebars.js: Find object by Index
tagged with: javascript
score: 0
has body: I'm new to handlebars.js here's my data structure (pseudo-Code) { News = list of news; Ads = list of add; } What I try to do is access the Ads by the News' index (I made sure the indexes exists, no problem there). An add consists of multiple properties Link Source Title When I call {{../Ads.[0]} It works, I can access the ad but as soon as I use @key {{../Ads.[@key]} handlebars.js doesn't find anything. I assume that is because @key is a string and not an integer. But I found no way to convert it to an integer. Tried a helper which converts @key to an integer but I have no idea how to use it because //template markup {{../Ads.[numericIndex @key]}} doesn't yield a result too. So, what I came up with is the following (which works) {{#ad../Ads index = @@key}}{{this}}{{/ad}} //the helper, just a basic example Handlebars.registerHelper('ad', function (ads, options) { return "&lt;strong&gt;" + options.fn(ads[parseInt(options.hash.index)].Source) + "&lt;/strong&gt;"; }); But I wonder what would be the best way to achieve what I want. Sure, my solution works but it feels kinda clumsy. Ideas? EDIT As requested by Jivings here is what I want to achieve. This what I want to output as an ad (I used handlebars' template tags to show want I want to display. All the properties here belong to "ad") This should be outputted for every news I loop through. Hope this helps &lt;div class="ad col-sm-12" title="{{Title}}"&gt; &lt;a href="{{Link}}"&gt;{{Source}}&lt;/a&gt; &lt;/div&gt; END EDIT
has comment: http://stackoverflow.com/comment/45902803
has comment: http://stackoverflow.com/comment/45903010
type: UnansweredQuestion
tagged with: handlebars.js
has comment: http://stackoverflow.com/comment/45901798

http://stackoverflow.com/comment/45819059
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28769998
has text: Well, you are calling `Plugin` when the instance is created. At which point the callback doesn't exist yet. You don't explain what the purpose of the code is, so I can't really provide a suggestion for a solution.

http://stackoverflow.com/comment/45945904
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28837207
has text: If you change "if(runned==false)" to "if(!runned)", does it work? Also, do you have error reporting on?

http://stackoverflow.com/q/28762751
has answer: http://stackoverflow.com/a/28763805
has answer: http://stackoverflow.com/a/28762852
tagged with: javascript
has body: $('#ws-show-log').click(function(){ var webSocket = new WebSocket('ws://myhost.loc:8080'); webSocket.onopen = function() { console.log('onopen'); }; webSocket.onmessage = function(event) { console.log('onmessage: ' + event.data); }; webSocket.onclose = function() { console.log('onclose'); }; webSocket.onerror = function() { console.log('onerror'); }; }); when i click #ws-show-log - i see all messages from webSocket canal: onopen onmessage message1 onmessage message2 But when i click second time on #ws-show-log in console all messages are duplicated, i see: onopen onmessage message1 onmessage message1 onmessage message2 onmessage message2
answer count: 2
score: 2
downvote count: 0
tagged with: websocket
favorite count: 0
type: UnansweredQuestion
has title: WebSocket collect callbacks
upvote count: 2
type: Question

http://stackoverflow.com/comment/45863628
comment on: http://stackoverflow.com/q/28794511
score: 1
has text: "NetworkError: 404 Not Found - http://mc.us9.list-manage.com/subscribe/form-settings?u=changedforsecurereasons&id=changedforsecurereasons2&u=changedforsecurereasons&id=changedforsecurereasons2&c=dojo_request_script_callbacks.dojo_request_script0"
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28901277
has body: I am using this open source captioning project. It comes with a handy demo page here. My use case is that I want the captions playing EXTREMELY LARGE over a blank video. So I've been trying to increase the size of the subtitles according to the documentation using the minimumFontSize directive and a few other attempts, but am finding the font stays stubbornly the same size. I've boiled the demo video down to the essentials for this question and remain mystified. What am I doing wrong? My code is below and I've put it here so you can see the live thing.
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: Javascript Captionator: font size will not adjust
downvote count: 0
answer count: 0
score: 1
tagged with: closed-captions
type: Question
tagged with: javascript
tagged with: captions
upvote count: 1

http://stackoverflow.com/q/28869979
tagged with: intellij-idea
downvote count: 0
favorite count: 0
tagged with: asset-pipeline
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/55447446
upvote count: 7
has body: I would like to know how does one go about setting up language injection in IntelliJ IDEA for the following block of code. I want the content within &lt;asset:script/&gt; to be treated as JavaScript: &lt;body&gt; &lt;asset:script type="text/javascript"&gt; console.debug("javascript here"); &lt;/asset:script&gt; &lt;/body&gt; Thanks in advance.
has title: Language injection in IntelliJ IDEA for Grails asset-pipeline plugin
score: 7
tagged with: javascript
tagged with: grails
type: Question

http://stackoverflow.com/q/28751856
score: 2
type: AnsweredQuestion
upvote count: 2
accepted answer: http://stackoverflow.com/a/28753022
tagged with: directive
type: Question
tagged with: jquery-animate
has body: I have been trying to Dynamically Animate a background between 2 colours on click using AngularJs Directives and Controllers (with no success so far). Does anyone know how to do this? I have been trying to store the currCol (stored as an array var pushed into ng-class), but then I can not retrieve the value from ng-class and use it. I have css transitioned from clear to the colour, but I cannot figure out how to get the transition between 2 dynamic colour vars. Any help will be great. Thanks. Some code so far: index.html set bg controllers.js .controller('BgCtrl', ['$scope', function ($scope) { $scope.colorPane = 'whiteBg'; $scope.colorVal = ''; var colCount = 0; var colorArr = ['redBg', 'greenBg', 'blueBg', 'whiteBg']; var currColor = ''; $scope.test3 = function () { if (colCount < colorArr.length) { $scope.colorVal = colorArr[colCount]; colCount ++; } else { colCount = 0; $scope.colorVal = colorArr[colCount]; } } }]) .directives.js .directive('animateOnChange', ['$animate', function($animate) { return function (scope, elem, attrs) { //var container = angular.element(document.querySelector('#bgCont') ); //var currCol = container[0].attributes[1]; scope.$watch(attrs.animateOnChange, function (nv, ov) { //var colVar = attrs.ngClass; //colVar = nv; }); }; }]); app.css .greenBg { transition: background-color 1s ease; background-color: #00ff00; } .redBg { transition: background-color 1s ease; background-color: #ff0000; }
tagged with: javascript
downvote count: 0
answer count: 1
has answer: http://stackoverflow.com/a/28753022
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45787897
tagged with: colors
has title: AngularJs animate background color / colour

http://stackoverflow.com/comment/46071030
type: QuestionComment
comment on: http://stackoverflow.com/q/28905793
has text: I'm not sure it was intentional, but this is the first time I've ever seen "JSON Object" written in a post that didn't make me flare up with the need to get all pedantic about JSON strings vs JavaScript objects. Bravo.
score: 0
type: Comment

http://stackoverflow.com/comment/45979782
comment on: http://stackoverflow.com/q/28856090
score: 0
has text: Check the second link, it shows how to sort the data and pass it into the chart.
type: Comment
type: QuestionComment

weinre
type: Tag
tag name: weinre
tags question: http://stackoverflow.com/q/28903739

http://stackoverflow.com/a/29709508
upvote count: 1
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28752644
has body: In addition to the other answers, you can used the "opened" attribute on the tag: &lt;paper-action-dialog opened="{{dialogOpen}}"&gt;&lt;/paper-action-dialog&gt; then inside any of your Polymer function calls in your js, just say: foo: function(){ this.dialogOpen = true; } I like this method because to me it seems more "Polymerish" as it involves using attributes. Whatever works though. Additionally, another way similar to a previous answer is to use Polymers magical $ stuff in any of your functions: this.$.firstRun.toggle(); You can use this.$.id to access any polymer elements and their methods.

responsive-design
tags question: http://stackoverflow.com/q/28824652
tags question: http://stackoverflow.com/q/28795639
tags question: http://stackoverflow.com/q/28800523
tags question: http://stackoverflow.com/q/28861400
tags question: http://stackoverflow.com/q/28806174
tags question: http://stackoverflow.com/q/28803085
tag name: responsive-design
type: Tag

http://stackoverflow.com/q/28848733
answer count: 1
tagged with: javascript
score: 0
has body: At autopublish.meteor.com, we're trying to retrieve some external data about a package, namely its latest release tag from GitHub or the NPM registry: var version; try { var packageJson = JSON.parse(Npm.require('fs').readFileSync('package.json')); version = packageJson.version; } catch (e) { // package.json won't be found when running the example with the local copy // of the package because the current directory isn't the package dir // ... so fall back to other methods of getting the version version = HTTP.get('...').data.version; } Package.describe({ name: 'foo', summary: 'bar', version: version, }); The problem is that the HTTP package isn't available in package.js. I've tried using the request module, via Npm.require('request'), but that module is async and... request.get('http://registry.npmjs.org/summernote/latest', function (err, res, body) { ... Package.describe({ ... }); }); ... fails because Package.describe needs to be run in a Fiber: Error: Meteor code must always run within a Fiber. Try wrapping callbacks that you pass to non-Meteor libraries with Meteor.bindEnvironment. The problem with that is that the Meteor singleton isn't available in package.js either. Is there a way to do this? Other things I've tried: using the NPM api, e.g. npm.view('summernote'); - doesn't work because you can't Npm.require('npm'): In package.js, Npm.require can only find built-in modules. using execFileSync to call the npm binary, but that doesn't work because execFileSync is only available in Node v0.12.0, which Meteor doesn't use yet.
tagged with: meteor
has answer: http://stackoverflow.com/a/28850116
tagged with: node.js
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/28850116
has title: HTTP request in Meteor's package.js

http://stackoverflow.com/a/28834696
answers question: http://stackoverflow.com/q/28834143
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28834143
upvote count: 2
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/45996434
has body: What you want will probably require more than just JavaScript, and some back-end code (with the language of your choice). If it's a website, you can try to identify a user by the IP/MAC address of his/her computer. But the problem is that it is not going to be reliable (e.g.: users could hide behind fake addresses, or multiple users could use the same IP). You can read about some methods on this question (PHP). If it's a mobile application, use the unique device ID (but again, that will require more than plain JavaScript). On Android: Settings.Secure#ANDROID_ID (read more on this question) On iPhone: [UIDevice currentDevice] uniqueIdentifier (read more on this question) On Windows Phone: DeviceExtendedProperties.GetValue("DeviceUniqueId") (read more on this question) If you are using Cordova/PhoneGap to create a web app, you can use the device.uuid to get a unique identifier (read more here) With the unique device ID (UDID), you can identify what device voted, without knowing who is the owner of that device and without forcing your users to create an account/log in.

http://stackoverflow.com/comment/45863886
type: AnswerComment
comment on: http://stackoverflow.com/a/28793262
type: Comment
has text: Just imagine a situation where you can't use any external files or make request to any HTTP server and the size of the html+js is extremely limited to exact amount of bytes (don't ask me where this situation can appear :)). In this situation you want compress everything to the maximum. PNG encoded in base64 is 30-50% larger than the original PNG file, but if you gzip this file first you can win some bytes out of it... Unless the code that will be handling unzipping will be larger than saved bytes...
score: 0

http://stackoverflow.com/a/28786017
answers question: http://stackoverflow.com/q/28785164
score: 1
has comment: http://stackoverflow.com/comment/45848862
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45848722
has body: You can remove the hover effect while its doing the display update, then restore it once the display update finishes. You can get the table element containing the td with $(element).closest('table') and then remove the hover effect with removeClass('table-hover') and then put it back with addClass('table-hover'), so var trueColor; //remove hover $(element).closest('table').removeClass('table-hover'); //get original color trueColor = $(element).css('backgroundColor'); //restore hover $(element).closest('table').addClass('table-hover'); //..rest of your original code
type: Answer
has comment: http://stackoverflow.com/comment/45848743
has comment: http://stackoverflow.com/comment/45862528
accepted answer of: http://stackoverflow.com/q/28785164
has comment: http://stackoverflow.com/comment/45848924
upvote count: 1

http://stackoverflow.com/a/28790577
has body: Try $("#mobilenumber").on("input", function(e) { return $(this).prop("value", function(_, val) { return val.replace(/[^\d]/, "").slice(0, 15) }) }); $("#mobilenumber").on("input", function(e) { return $(this).prop("value", function(_, val) { return val.replace(/[^\d]/, "").slice(0, 15) }) }) &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;input id="mobilenumber" class="form-control" type="text" value="" placeholder="Your Mobile Number" name="MobileNumber" data-val-maxlength-max="15" data-val-maxlength="Mobile number can not be longer then 15 characters" data-val="true"&gt;
type: Answer
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/28790293
answers question: http://stackoverflow.com/q/28790293
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28818967
tagged with: javascript
score: 0
answer count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28819007
has title: Nature of the call method on Function.prototype
has body: Is the Call function on function objects the very same call function used for controlling the receiver of function invocations?
type: Question
accepted answer: http://stackoverflow.com/a/28819007

http://stackoverflow.com/a/28844084
score: 1
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28843105
answers question: http://stackoverflow.com/q/28843105
has body: You are setting the lookup value correctly, you just need to get the Id correctly. The results variable is an array of new_department records, so try something like this: var resultId = null; XrmServiceToolkit.Rest.RetrieveMultiple("new_departmentSet", "$select=new_departmentId&amp;$filter=new_name eq 'IT'", function (results) { if (results.length &gt; 0) resultId = results[0].new_departmentId; //gets the first record's Id }, function (error) { alert(error); }, function onComplete() { }, false); return resultId;
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/28792925
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28865824
tagged with: google-chrome
has body: I am building an application in D3.js where I render several index cards (svg's) as one SVG. The user should be able to rotate those cards. For test purposes I used the drag behaviour for rotation dragListener = d3.behavior.drag().on("dragstart", function(d){ originX = parseInt(d3.select(this).select("image").attr("x")); originY = parseInt(d3.select(this).select("image").attr("y")); }) .on("drag", function(d){ counter++; if(counter &gt; 360){ counter = 0; } d3.select(this).attr("transform", "rotate("+counter.toString()+","+(originX+150).toString()+","+(originY+90).toString()+")"); }); which I provide to all index cards var grp = svg.selectAll("g").data(arr); var card = grp.enter().append("g") //.attr("transform", function(d){ return "rotate(30,"+(d.x+150)+","+(d.y+90)+")";}) .call(dragListener); card.append("svg:image") .attr("xlink:href", "http://images.clipartlogo.com/files/images/22/227702/index-card_p") .attr("x", function(d){return d.x;}) .attr("y", function(d){return d.y;}) .attr("width", "300") .attr("height", "180"); The problem is, the more cards are already rotated the lower the performance when the user rotates a card . The FPS are around 8 in Chrome when all cards are rotated. Here is the example: http://jsfiddle.net/45hdjkk0/6/ You can give all cards an initial rotation by removing the comments in line 32. Am I doing something wrong or did I choose the wrong approach? UPDATE: After testing the same example on the Internet Explorer and on Firefox I have found out that Internet Explorer is the fastest among those three. Firefox is also very fast compared to Chrome. Is this a Chrome issue?
score: 3
has title: SVG low performance with rotated images
downvote count: 0
type: Question
tagged with: javascript
upvote count: 3
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0

http://stackoverflow.com/comment/45842604
comment on: http://stackoverflow.com/q/28782277
type: QuestionComment
has text: There is no change event in your code. Please either correct your title/question or complete your code.
score: 0
type: Comment

http://stackoverflow.com/q/28879937
has comment: http://stackoverflow.com/comment/46045314
tagged with: javascript
answer count: 1
has comment: http://stackoverflow.com/comment/46021503
has answer: http://stackoverflow.com/a/28880246
favorite count: 0
accepted answer: http://stackoverflow.com/a/28880246
has body: I use "Editable" to "inline edit" my table. When i save my changes it's posted to a php file. The php file is then updating my db. My problem is that the php script need some error checking. I need to somehow echo or alert a variable to see what it contains. But if i echo or alert my variable, it never shows. I cannot use "xDebug" because i use an external server?! Is there a way?
has comment: http://stackoverflow.com/comment/46021604
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46022622
has comment: http://stackoverflow.com/comment/46021738
score: 0
has title: How to read a php file, behind "Editable"
upvote count: 1
has comment: http://stackoverflow.com/comment/46022229
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/46021468

http://stackoverflow.com/q/28804718
has answer: http://stackoverflow.com/a/28804818
score: 0
has answer: http://stackoverflow.com/a/28804790
has body: I have created an application in AngularJS with a drop down with space in option using a filter. The application is working fine but the &amp;nbsp; which I have put for space is not getting compiled. My code is as given below JSFiddle html &lt;select&gt; &lt;option ng-repeat="(key, value) in headers"&gt; &lt;/option&gt; &lt;/select&gt; script app.filter('space', function() { return function(text) { if(_.isUndefined(text.mainId)) { console.log('entered mainId'); return text.value; } else { console.log('entered'); return '&amp;nbsp;&amp;nbsp;&amp;nbsp;'+text.value; } };
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28804790
has comment: http://stackoverflow.com/comment/45882676
linked to: http://stackoverflow.com/q/12431125
type: Question
accepted answer: http://stackoverflow.com/a/28804818
answer count: 2
tagged with: javascript
tagged with: html-select
tagged with: angularjs
tagged with: angular-filters
has title: &nbsp; in script is not getting compiled

http://stackoverflow.com/comment/45830381
type: AnswerComment
comment on: http://stackoverflow.com/a/28775978
type: Comment
has text: I think I get what your saying, but I'm not entirely sure where I would put the external file. Would I just link it in the main view 'index.html' and then call it up using ServiceFromDifferentFile or would I need to link the external file to a service or factory?
score: 1

http://stackoverflow.com/comment/45890624
comment on: http://stackoverflow.com/q/28809133
score: 3
type: QuestionComment
has text: Have you included your code in a `$(document).ready(){` in your script?
type: Comment

http://stackoverflow.com/comment/45900387
comment on: http://stackoverflow.com/q/28814299
type: QuestionComment
type: Comment
score: 1
has text: Maybe you want "background-color" instead of color? or what is the expected result?

http://stackoverflow.com/comment/45867359
type: Comment
type: QuestionComment
has text: JavasScript evaluates arguments first. So if you have `foo(bar())`, `bar` is called first and its return value is passed to `foo`. Is btw is how most programming languages work.
score: 1
comment on: http://stackoverflow.com/q/28795684

http://stackoverflow.com/a/28783975
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45844408
has comment: http://stackoverflow.com/comment/45844473
accepted answer of: http://stackoverflow.com/q/28783759
answers question: http://stackoverflow.com/q/28783759
upvote count: 1
type: AcceptedAnswer
has body: The google.maps.Icon is not valid with a url of ''. var image = { url: beach[4], size: new google.maps.Size(20, 32), origin: new google.maps.Point(0, 0), anchor: new google.maps.Point(0, 32) }; There is a javascript error generated in that case: Uncaught TypeError: Cannot read property 'dx' of undefined Change the code to pass in a null for image in that case: if (beach[4] != '') { var image = { url: beach[4], size: new google.maps.Size(20, 32), origin: new google.maps.Point(0, 0), anchor: new google.maps.Point(0, 32) }; } else { var image = null; } working fiddle code snippet: function initialize() { var mapOptions = { zoom: 10, center: new google.maps.LatLng(-33.9, 151.2) } var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); setMarkers(map, beaches); } var beaches = [ ['Bondi Beach', -33.890542, 151.274856, 4, ''], ['Coogee Beach', -33.923036, 151.259052, 5, 'https://google-developers.appspot.com/maps/documentation/javascript/examples/full/images/beachflag.png'], ['Cronulla Beach', -34.028249, 151.157507, 3, 'https://google-developers.appspot.com/maps/documentation/javascript/examples/full/images/beachflag.png'], ['Manly Beach', -33.80010128657071, 151.28747820854187, 2, 'https://google-developers.appspot.com/maps/documentation/javascript/examples/full/images/beachflag.png'], ['Maroubra Beach', -33.950198, 151.259302, 1, 'https://google-developers.appspot.com/maps/documentation/javascript/examples/full/images/beachflag.png'] ]; function setMarkers(map, locations) { for (var i = 0; i &lt; locations.length; i++) { var beach = locations[i]; if (beach[4] != '') { var image = { url: beach[4], size: new google.maps.Size(20, 32), origin: new google.maps.Point(0, 0), anchor: new google.maps.Point(0, 32) }; } else { var image = null; } var myLatLng = new google.maps.LatLng(beach[1], beach[2]); var marker = new google.maps.Marker({ position: myLatLng, map: map, icon: image, title: beach[0], zIndex: beach[3] }); } } google.maps.event.addDomListe…
type: Answer
has comment: http://stackoverflow.com/comment/45844390

http://stackoverflow.com/q/28755625
has answer: http://stackoverflow.com/a/50757911
favorite count: 0
has answer: http://stackoverflow.com/a/28763634
tagged with: node.js
type: UnansweredQuestion
has body: If I have Grunt installed in some folder /foo, but my current folder is /foo/bar/baz, and I run "grunt sometask" from within my current folder, how can I get Grunt (or NodeJS for that matter) to determine my current path? That is to say, how can I programmatically GET the folder I was in when I called grunt? When I use process.cwd(), I get the path of the gruntfile, ie, "foo", which is not what I want. I don't have to do this in Grunt specifically, any nodejs-based solution would work.
has comment: http://stackoverflow.com/comment/45801244
type: Question
score: 5
upvote count: 5
tagged with: javascript
tagged with: gruntjs
has title: Grunt - get current calling folder, and not gruntfile current folder
answer count: 2
has comment: http://stackoverflow.com/comment/45796814
downvote count: 0

http://stackoverflow.com/comment/46023075
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28880699
has text: Yep, you should select that with `$('#Other')` because that's the ID you gave it using Razor :)
type: Comment

http://stackoverflow.com/comment/46156952
score: 0
type: AnswerComment
type: Comment
has text: Yes it is Angular page which gets loaded.
comment on: http://stackoverflow.com/a/28889025

http://stackoverflow.com/comment/45949175
score: 0
type: Comment
type: QuestionComment
has text: @jlowcs does anybody actually still care about ie8? Must users that actually care about what you're doing will be using a modern browser. I also think the same way for app, I'm not making my apps hard to maintain because there are some still using android 2.3. Too bad, upgrade your device. :)
comment on: http://stackoverflow.com/q/28839449

http://stackoverflow.com/comment/46911744
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/29360022
has text: I had a number being treated as an infinite number which is what angular didn't like. As there were some strings that started with E180 they were treated as huge numbers by the API and an error was being thrown

http://stackoverflow.com/q/28839091
type: Question
has body: Short overview: i need to do autofocus, with the help of it i could after click on enter key go to the next input and with key - seems that i done: but now i try to get input's attribute, as i'm new to angularjs i want to know: how to do it in the best way? &lt;div modal-focus&gt; &lt;div&gt; &lt;input type="text" class="on-input" name="name" modal-focus-order="1"/&gt; &lt;/div&gt; &lt;div&gt; &lt;input type="text" class="on-input" name="jobTitle" modal-focus-order="2"/&gt; &lt;/div&gt; &lt;/div&gt; how with this code in modal-focus directive link function: angular.element('.on-input').on('click', function(event) { console.log(element.find(this)); // how to get modal-focus-order value like 1 or two? }); element.bind("keypress", function(event) { if (event.which === 13) { /* some magic is here */ } }); i could get modal-focus-order value when i click on input?
has answer: http://stackoverflow.com/a/28839631
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45947626
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/45948317
has comment: http://stackoverflow.com/comment/45947914
tagged with: angularjs
type: UnansweredQuestion
has title: angularJS get inner elements of directive
has comment: http://stackoverflow.com/comment/45948277

http://stackoverflow.com/q/28765343
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
has title: slow down webpage via javascript for a test
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/45810421
tagged with: performance
answer count: 0
has comment: http://stackoverflow.com/comment/45810492
has comment: http://stackoverflow.com/comment/45810569
has body: To measure the impact of a slower webpage on the CTR of a button I'm trying to slow down the page in an optimizely test. I can't find a proper way to do that with JavaScript, which would be needed for optimizely. To simulate a slower page (perceived performance) my first shot was hiding the page body { visibility: hidden } for 1 second. But, it resulted in a better CTR, since the browser kept loading the rest of the page and displayed the page with less flickering (all content was ready). Then I tried the solution suggested here: How do I write a blocking synchronous method in Javascript? with no satisfying result. Any other ideas how I could set up the test (without using php sleep())?
type: Question
linked to: http://stackoverflow.com/q/10527503
has comment: http://stackoverflow.com/comment/45810837

http://stackoverflow.com/q/28876840
tagged with: javascript
tagged with: multiview
tagged with: jquery
has title: JQuery Mobile 1.4.5 splitview/multiview plugins - best 2015 solution for prototyping?
score: 0
answer count: 1
type: UnansweredQuestion
has body: I'm a student working an a prototype of a hybrid app. I'm using JQuery Mobile and three.js to (hopefully) provide a proof-of-concept web app to assist people in storyboarding. The target device is desktop and tablet (horizontal and landscape). Here's a sample wireframe, and a non-interactive concept demo screenshot. So far JQuery Mobile has been working excellent for me in terms of UI design. Heavier frameworks like Sencha Touch are too complex for my goal. I need to have the renderer (WebGL canvas) visible at all times, while menus and options are selected/tweaked. I thought a splitview/multiview solution would be best, like on the wireframe I linked to. So I found: Multiview (Stokkers) - seemed perfect, but required a very outdated fork of JQM. The project's been dead since 2012 and couldn't get it to load. Splitview by asyraf9 - that plugin was so old that even the demo didn't work anymore. SimpleSplitView - also from 2012, fortunately didn't require a custom JQM script but by following the instructions I never got the panels to float left or right. Also puts constraints on navigation. As all of these projects are very outdated I'm not sure if there's even any point in troubleshooting them specifically. So I'm asking all the experienced people here, how would you go around building a multiview? Any good plugins I'm missing? I'm a designer, not a coder, so the focus here is to be able to produce this quickly and efficiently without bloat, and then progressively iterate on that concept. Messy code is alright as long as it does the job and I can stash it somewhere in the corner without interference. Having more than two panels (e.g. multiview solution) is most welcome, but even a two-panel splitview would be good; I can work around that. This question is somewhat similar to "jquerymobile 1.3.X - Any latest plugins for splitview" from a year ago, but my requirements are not as specific and I need up-to-date solutions for an experience prototype. And the custom code i…
tagged with: splitview
type: Question
has answer: http://stackoverflow.com/a/28941945
tagged with: jquery-mobile

apache
tag name: apache
tags question: http://stackoverflow.com/q/28822963
tags question: http://stackoverflow.com/q/28763657
tags question: http://stackoverflow.com/q/28905998
type: Tag

http://stackoverflow.com/q/28775308
has answer: http://stackoverflow.com/a/28775400
tagged with: css
type: AnsweredQuestion
has body: http://jsfiddle.net/L11h2b50/3/ I'm trying to write a lightbox script, which can open images when clicked. As you can see in the fiddle, that part works. But closing the image by clicking the lightbox in order to execute the function .remove() doesn't quite work out. Why is that? $(".discuss-entry img").each(function() { var image = $(this); var src = image.attr("src"); var windowWidth = $(window).width(); var windowHeight = $(window).height(); var imageWidth = image.outerWidth(); var imageHeight = image.outerHeight(); var left = ((windowWidth-imageWidth)/2) var top = ((windowHeight-imageHeight)/2) if(image.closest("a")[0]===undefined) { image.on("click",function(){ $("&lt;div class='lightbox'&gt;&lt;img src='"+src+"' style='top: "+top+"px; left: "+left+"px' /&gt;&lt;/div&gt;").appendTo("body"); }); $(".lightbox").on("click", "img", function() { $(this).remove(); }); } });
downvote count: 1
linked to: http://stackoverflow.com/q/9484295
type: Question
has comment: http://stackoverflow.com/comment/45829074
has comment: http://stackoverflow.com/comment/45829881
answer count: 2
has comment: http://stackoverflow.com/comment/45829497
has comment: http://stackoverflow.com/comment/45829231
upvote count: 0
accepted answer: http://stackoverflow.com/a/28775400
has comment: http://stackoverflow.com/comment/45828983
tagged with: javascript
tagged with: jquery
score: -1
has comment: http://stackoverflow.com/comment/45828935
has title: .remove() doesn't achieve desired effect
possible better answer: http://stackoverflow.com/a/28775449
has comment: http://stackoverflow.com/comment/45828886
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28775449
favorite count: 0
has comment: http://stackoverflow.com/comment/45828848

http://stackoverflow.com/a/28859677
upvote count: 1
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28859293
type: Answer
has body: Think of an iFrame like a window into another tab on your browser... opening a page within a page. What you're doing, is trying to transmit the data via json, generate the page on the client-side, and then put that page in the iframe... if that's the case, then you could just eliminate the iframte all together and put your generated HTML into a div or something using jQuery. $.ajax({ url: '/Home/Submitta/', type: 'POST', dataType: 'json', contentType: "application/json; charset=utf-8", data: JSON.stringify(paket), success: function (data) { // take "data" and do what you gotta do to // get it into HTML... var resulthtml = ""; // put that HTML generated above into // your results div like this: $("#resultsdiv").html(resulthtml); }, error: function (err) { $("#resultsdiv").html("Something went wrong."); } });
accepted answer of: http://stackoverflow.com/q/28859293
score: 1

http://stackoverflow.com/a/28843604
type: Answer
upvote count: 1
downvote count: 1
has body: so your if it returns a json as string so your data is ok try this code var tempData = $.parseJSON(data); $.each(tempData, function(k, v) { //display the key and value pair alert("key= " + k + "and value= "+ v); });
has comment: http://stackoverflow.com/comment/45956173
score: 0
has comment: http://stackoverflow.com/comment/45956104
answers question: http://stackoverflow.com/q/28843505
has comment: http://stackoverflow.com/comment/45956180

http://stackoverflow.com/comment/45822534
type: Comment
has text: @ajmajmajma It really depends on how you structure your code, but with the info that you provided on the question `$emit` was the first thing I thought. If you want you can provide a bit more code :) if there is a more specific use case.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28771635

http://stackoverflow.com/comment/45822510
type: QuestionComment
has text: It's `document.getElementById()`, not `getElementFromId()`.
type: Comment
score: 1
comment on: http://stackoverflow.com/q/28771967

http://stackoverflow.com/q/28764437
accepted answer: http://stackoverflow.com/a/28764836
score: 0
answer count: 1
has title: resend response after request.end()
has body: I am experiencing difficulty in writing the correct callback. When a user makes a request to "/city" server must make a request to a third-party service to query the data. For this I do http.request(), to request and receive data (there is no problem). And then I need to transfer the data to the res.send() outside getCity() function. I have no idea. Please, explain me the solution and working principle. Thank you! var getCity = function(response) { var str = '' response.on('data', function (chunk) { str += chunk; }); response.on('end', function () { //what to do? }); } app.get('/city', function (req, res) { var request = http.request(options, getCity); request.end(); res.send("ok"); //need sending str from getCity instead of "ok"; });
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28764836
tagged with: http
type: Question
tagged with: javascript
tagged with: express

http://stackoverflow.com/a/28806364
downvote count: 0
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28806295
has body: var thedate - new Date(); ? Change it to: var thedate = new Date();

http://stackoverflow.com/comment/45859897
type: QuestionComment
has text: Questions on StackOverflow about problems with code should include the code IN THE QUESTION. Please edit your question and edit in an [MCVE](/help/mcve).
comment on: http://stackoverflow.com/q/28792469
score: 1
type: Comment

http://stackoverflow.com/q/28881052
has answer: http://stackoverflow.com/a/28895416
accepted answer: http://stackoverflow.com/a/28895416
type: AnsweredQuestion
downvote count: 0
tagged with: prestashop-1.5
score: 1
type: Question
tagged with: prestashop
has title: prestashop next and previous image buttons on product page
tagged with: javascript
has body: I'd like to add next and previous buttons to the product image on product page, so that the user can look through all pictures with these buttons, exactly like when the image is opened to fancybox. How can I get the next and previous images in javascript? Im sure it's simple because all the product images must be called and arranged already since we are on the product page, I just dont know how to get them. I was thinking about something like this: function nextImage(){ document.getElementById('bigpic').src = next image (id?) } Thanks!
upvote count: 1
answer count: 1
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/46079991
has text: As commented your either connecting to the wrong database or more likely you are making the common mistake because your collection is actually called "card" and not "cards" as mongoose expects. Correct with `mongoose.model( "Card", cardschema, "card" )` where the actual collection name is the third argument. Using that optional argument overrides what mongoose chooses as a default.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28905263
score: 1

http://stackoverflow.com/q/28837408
answer count: 2
has answer: http://stackoverflow.com/a/28838184
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45945365
has answer: http://stackoverflow.com/a/28837790
has comment: http://stackoverflow.com/comment/45944404
tagged with: regex
has body: I proceed to these two replace queries (called by javascript), to handle the case in which the color css style would be placed at the end of style attribute, with no semicolon... replace(/\bstyle=["|'](.*)(?:color:.*?;)(.*)["|']/gi, 'style="$1$2"' ) replace(/\bstyle=["|'](.*)(?:color:.*["|'])/gi, 'style="$1"' ) It would be more pretty to merge them... However I spent hours with no success ! EDIT : here's a sample text : Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
upvote count: 1
accepted answer: http://stackoverflow.com/a/28837790
has title: Is it possible to merge two regex queries?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45960483
score: 1
type: Question
possible better answer: http://stackoverflow.com/a/28838184

http://stackoverflow.com/q/28792246
type: Question
upvote count: 0
has answer: http://stackoverflow.com/a/28792651
answer count: 1
tagged with: javascript
tagged with: asp.net
favorite count: 0
downvote count: 2
type: AnsweredQuestion
score: -2
has comment: http://stackoverflow.com/comment/45860458
accepted answer: http://stackoverflow.com/a/28792651
has comment: http://stackoverflow.com/comment/45860237
has title: How to exchange value between an input and and asp:textbox controler
has body: how to use something like this : &lt;asp:TextBox ID="txt_place_name" CssClass="form-control ltr" ValidationGroup="add" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;input type="text" id="txt_newpl" value="placeName" runat="server" /&gt; and javascript code is : &lt;script&gt; var tmp = document.createElement("input"); tmp.appendChild(document.getElementById('txt_newpl')); google.maps.event.addListener(marker, "click", function (e) { var infoWindow = new google.maps.InfoWindow({ content: '&lt;div&gt;'+tmp.innerHTML+'&lt;/div&gt;' }) }); document.getElementById("&lt;%= txt_place_name.ClientID%&gt;").value = txt_java.value; &lt;/script&gt; I want to transfer the value of the txt_newpl to the txt_place_name. What is my wrong?

http://stackoverflow.com/a/28770368
has body: As I see it you basically have two options here: 1. Change the database to camelCase snake_case is just Laravel's convention it not required to have your column names like that. So you could simply change the names to camelCase and set the $snakeAttributes option in your model(s) to false: class MyModel extends Eloquent { public static $snakeAttributes = false; } Then you should be able to create() and get() your model with camelCase attribute names. 2. Override some methods If you want to keep your db tables like they are you will have to override some methods in your model: First, for array/JSON conversion: public function toArray(){ $array = parent::toArray(); $renamed = []; foreach($array as $key =&gt; $value){ $renamed[camel_case($key)] = $value; } return $renamed; } Then for setting and getting single attributes: public function getAttribute($key){ $key = snake_case($key); return parent::getAttribute($key); } public function setAttribute($key, $value){ $key = snake_case($key); parent::setAttribute($key, $value); }
answers question: http://stackoverflow.com/q/28769546
accepted answer of: http://stackoverflow.com/q/28769546
upvote count: 2
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2

http://stackoverflow.com/comment/46040036
type: QuestionComment
has text: You are essentially asking about creating an async filter - it's possible, but not a good idea. I've answered a similar question sometime ago: http://stackoverflow.com/a/27632022/968155
comment on: http://stackoverflow.com/q/28889215
score: 0
type: Comment

http://stackoverflow.com/q/28844376
has comment: http://stackoverflow.com/comment/45958195
tagged with: php
has answer: http://stackoverflow.com/a/28844747
has body: I am trying to make an image take a value in as a source, after the image tag (and a related radio button) has been created using JavaScript. I have discerned the following from testing and alert outputs: If the image src is provided at the creation of the image tag using an exact filepath, it will show the image correctly (e.g. src='images/0.jpg'). However, this is not helpful since I need it to work for any given image, not a specific one. If the image src is provided at the creation of the image tag using a variable containing a filepath, it fails to generate the image tag or the radio button at all (e.g. src='" + result + '"). NOTE: The last example is not present in the code below. The result was found by moving the '$.post' section to the line directly under the 'out +=' line within the for loop. If the image src is left blank at the creation of the image tag, the image tag and radio button are created, though the image is blank as expected. If I then try to use 'getElementByID(imgID).src' to change the image source after this, it fails to do anything. ('imgID' here is an example, not what the code says). On top of the above, using alerts and dumping info into divs indicate that the comicID is being correctly posted, and the filepath of the image src is definitely being found, and is being copied into the variable 'result' correctly, even one line before the creation of the tag or the attempt to edit it using 'getElementById'. At this point I'm stumped, I don't know what could logically be stopping the src from reading in. -- Javascript: &lt;script&gt; // Loads the user's comic list from the database. function loadComic() { var xmlhttp = new XMLHttpRequest(); var getID = '&lt;?php echo $_SESSION["userID"]; ?&gt;'; var url = "loadCom.php?userID="+getID; xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200) { loadComicJSON(xmlhttp.responseText); } } xmlhttp.open("GET", url, true); xmlhttp.send(); } // JSON parsing …
has title: Image tag won't accept src
has comment: http://stackoverflow.com/comment/45958453
has comment: http://stackoverflow.com/comment/45957953
has comment: http://stackoverflow.com/comment/45958398
has comment: http://stackoverflow.com/comment/45957708
tagged with: image
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/45957691
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45958280
has comment: http://stackoverflow.com/comment/45957797
tagged with: ajax
has comment: http://stackoverflow.com/comment/45958069
score: 0
has comment: http://stackoverflow.com/comment/45957754
has comment: http://stackoverflow.com/comment/45958309
has comment: http://stackoverflow.com/comment/45958547
has comment: http://stackoverflow.com/comment/45958256
has answer: http://stackoverflow.com/a/28882827
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45957970

http://stackoverflow.com/q/28896689
possible better answer: http://stackoverflow.com/a/28896803
answer count: 2
has answer: http://stackoverflow.com/a/28896804
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: How to return to previous page and refresh it in php or javascript?
has body: How can user return to the page he came from, and refresh its content, using PHP or javascript. I've used this to get back to the page : header("Location: javascript:history.back(-1)"); but it needs to be refreshed after that.
accepted answer: http://stackoverflow.com/a/28896804
score: 1
upvote count: 1
tagged with: php
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28896803

http://stackoverflow.com/q/28872090
has body: I have a form, I wan to bind its values only when the user click on a button. And when the user choose to reset / cancel, I want to go back to original model data. How can it be done? http://jsfiddle.net/1y9ft817/ Thanks &lt;div ng-controller="MyCont" ng-app&gt; &lt;form&gt; &lt;input type="number" min="0" max="50" value="{{value}}" ng-model="value" /&gt;{{value}} &lt;br /&gt; &lt;input type="submit" value="bind the data" /&gt; &lt;input type="reset" value="reset back to 15" /&gt; &lt;/form&gt; function MyCont($scope) { $scope.value = 15; };
score: 1
has comment: http://stackoverflow.com/comment/46007370
downvote count: 0
has title: angularjs bind data only on events
has answer: http://stackoverflow.com/a/28872325
tagged with: javascript
has answer: http://stackoverflow.com/a/28873060
has comment: http://stackoverflow.com/comment/46007504
favorite count: 0
has answer: http://stackoverflow.com/a/28881261
tagged with: angularjs
answer count: 4
has comment: http://stackoverflow.com/comment/46007824
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28872292
upvote count: 1
type: Question

http://stackoverflow.com/a/28912148
score: 0
accepted answer of: http://stackoverflow.com/q/28889001
type: Answer
answers question: http://stackoverflow.com/q/28889001
has body: The problem is that when you zoom using mousescroll it is done relatively to the point of mouse pointer position. Thus you don't just scroll, you also pan. In your example only prevents zooming but panning is still working when scrolling using mousescroll. A solution would be to also cancel panning if it is right after zooming: beforeZoom: function(){ isZooming = true; if(zoomed) { return false; } else { zoomed = true; } }, beforePan: function(){ if(isZooming) { isZooming = false; return false; } }
type: AcceptedAnswer

http://stackoverflow.com/comment/45786933
type: Comment
has text: I also tried this but that's not working.
comment on: http://stackoverflow.com/q/28752424
score: 0
type: QuestionComment

http://stackoverflow.com/comment/46038102
type: Comment
type: QuestionComment
has text: Added my code snippet, was assuming you didn't mean for video.js to be pasted on here since that's a full plugin.
score: 0
comment on: http://stackoverflow.com/q/28887969

http://stackoverflow.com/comment/45916589
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28822353
has text: Thanks @jfriend00 I've updated a portion of the script, would something like that work? This way it runs each function individually first?
score: 0

http://stackoverflow.com/a/28879022
score: 4
has comment: http://stackoverflow.com/comment/46019903
type: AcceptedAnswer
has body: The problem is, you need to return promise from the start method return { other: function () {}, start: function () { var dfd = $.Deferred(); el.filter.animate({ "opacity": "0.6", "filter": "alpha(opacity=60)" }, 2000, "easeInOutCirc", function () { el.share.removeClass('fa-spin'); setTimeout(function () { el.share.removeClass('fa-cog').addClass('fa-bars'); }, 1000); setTimeout(function () { el.scroll.animate({ "opacity": "1", "bottom": "40px" }, 1200, "easeOutBounce", function () { var pulseOptions = { opacity: "0" }; setTimeout(function () { el.scroll.pulse(pulseOptions, { duration: 400, pulses: 3, interval: 500, returnDelay: 800 }); }, 2000); dfd.resolve(); }); }, 2000); }); //need to return from start return dfd.promise(); } } // end return
type: Answer
upvote count: 4
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28878963
answers question: http://stackoverflow.com/q/28878963

http://stackoverflow.com/q/28808877
has title: Passing a variable to JavaScript function
possible better answer: http://stackoverflow.com/a/28808923
has comment: http://stackoverflow.com/comment/45890090
tagged with: php
has answer: http://stackoverflow.com/a/28808923
type: AnsweredQuestion
tagged with: parameter-passing
has answer: http://stackoverflow.com/a/28808933
type: Question
accepted answer: http://stackoverflow.com/a/28808933
has body: I would like to call a JavaScript function from my php page, which looks like this: xyz.php for ($i = 0; $i < count($temp2a); $i++) { $URL = "xyz.php?eingabe=".$temp2a[$i]."&eingabe2=".$datei; echo ' link '; } java.js function test(para){ alert(para); alert("Para"); } Calling the function without a variable works. test() outputs two alerts: Undefined Para Whenever I try to pass a variable, the function does not get called at all. No alert or anything else.
tagged with: javascript
score: 0
answer count: 2
tagged with: function
tagged with: variables
has comment: http://stackoverflow.com/comment/45890123

http://stackoverflow.com/comment/45821471
comment on: http://stackoverflow.com/a/28763634
type: Comment
has text: If you don't need to get the path from inside grunt, you can call grunt with exec. I added to the answer.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45838869
comment on: http://stackoverflow.com/a/28774271
has text: Ah I see, that explains it. It may not be the prettiest fix, as you say, but I agree, a whole lot cleaner than fitting setTimeout in the middle of it. Thanks a lot meetamit!!!
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45856130
has text: the code was working fine until I removed the ng-init and added the ng-controller.............
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28790207

http://stackoverflow.com/q/28793083
has comment: http://stackoverflow.com/comment/48744039
has comment: http://stackoverflow.com/comment/45884639
upvote count: 8
linked to: http://stackoverflow.com/q/32377522
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/50067549
tagged with: jsf
linked to: http://stackoverflow.com/q/7221495
has comment: http://stackoverflow.com/comment/46062076
type: Question
has body: Caution : Although this question covers long textual information with a mess of Java code snippets, it is merely targeted to JavaScript/jQuery and a bit of PrimeFaces stuff (just &lt;p:remoteCommand&gt;) as mentioned in the introductory part in the beginning. I am receiving a JSON message from WebSockets (Java EE 7 / JSR 356 WebSocket API) as follows. if (window.WebSocket) { var ws = new WebSocket("wss://localhost:8181/ContextPath/AdminPush"); ws.onmessage = function (event) { jsonMsg=event.data; var json = JSON.parse(jsonMsg); var msg=json["jsonMessage"]; if (window[msg]) { window[msg](); //It is literally interpreted as a function - updateModel(); } }; } In the above code, event.data contains a JSON string {"jsonMessage":"updateModel"}. Thus, msg will contain a string value which is updateModel. In the following segment of code, if (window[msg]) { window[msg](); //It is literally interpreted as a JavaScript function - updateModel(); } window[msg](); causes a JavaScript function associated with a &lt;p:remoteCommand&gt; to be invoked (which in turn invokes an actionListener="#{bean.remoteAction}" associated with the &lt;p:remoteCommand&gt;). &lt;p:remoteCommand name="updateModel" actionListener="#{bean.remoteAction}" oncomplete="notifyAll()" process="@this" update="@none"/&gt; update="@none" is not necessarily needed. After receiving this message, I need to notify all the associated clients about this update. I use the following JavaScript function to do so which is associated with the oncomplete handler of the above &lt;p:remoteCommand&gt;. var jsonMsg; function notifyAll() { if(jsonMsg) { sendMessage(jsonMsg); } } Notice that the variable jsonMsg is already assigned a value in the first snippet - it is a global variable. sendMessage() is another JavaScript function that actually sends a notification about this update to all the associated clients through WebSockets which is not needed in this question. This works well but is there a way to do some magic in the fo…
tagged with: primefaces
has title: Invoking a JavaScript function from oncomplete handler of p:remoteCommand - simulating the same using some JavaScript code
has comment: http://stackoverflow.com/comment/46062326
tagged with: javascript
tagged with: jsf-2.2
has answer: http://stackoverflow.com/a/31041321
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45880866
has comment: http://stackoverflow.com/comment/50107948
tagged with: jquery
has comment: http://stackoverflow.com/comment/46064096
has comment: http://stackoverflow.com/comment/46064068
favorite count: 0
score: 8

http://stackoverflow.com/a/28755385
has body: its solved! I_NEED_A_CHECK_BOX_VAR = '&lt;input type="checkbox" name="checkbox" id="checkbox_' + shift.ID + '" class="r1" /&gt;' hope it helps anyone
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28755149

http://stackoverflow.com/a/28899162
score: 1
has body: try this (allows for any number of question blocks): var containers = $('.question-block-container'); $(window).scroll(function () { var windowpos = $(window).scrollTop(); containers.each(function () { var container = $(this), title = container.find('.question-title'), contOffsetTop = container.offset().top, conOffsetBottom = contOffsetTop + container.outerHeight() + 60; // 60 is margin bottom if (windowpos &gt;= contOffsetTop &amp;&amp; windowpos &lt;= conOffsetBottom) { if (!title.hasClass("sticky")) { title.addClass("sticky"); } } else if (title.hasClass("sticky")) { title.removeClass("sticky"); } }); }); Example
has comment: http://stackoverflow.com/comment/46057707
downvote count: 0
answers question: http://stackoverflow.com/q/28898795
type: Answer
upvote count: 1

http://stackoverflow.com/a/28798529
has body: success should be a function. success: window.alert("check your db"); }); ought to be: success: function() { window.alert("check your db"); } });
score: 4
upvote count: 4
accepted answer of: http://stackoverflow.com/q/28798469
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28798469
type: Answer

http://stackoverflow.com/comment/45849887
has text: @Nicolai How you actually update the files on your server will depend on how you are storing them. You'll probably want to use something like an `ajax` call to a `php` script to do that part.
comment on: http://stackoverflow.com/a/28784649
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46059862
comment on: http://stackoverflow.com/a/28900158
has text: Yes, of course I was going to, just posted a script first for him to test.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45861683
type: Comment
has text: @ArtjomB. exactly. I want clear decrypted text which does not have dummy
score: 0
comment on: http://stackoverflow.com/q/28792966
type: QuestionComment

http://stackoverflow.com/q/28823277
accepted answer: http://stackoverflow.com/a/28824534
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45918208
favorite count: 0
possible better answer: http://stackoverflow.com/a/28823384
has comment: http://stackoverflow.com/comment/45918152
has comment: http://stackoverflow.com/comment/45918416
has answer: http://stackoverflow.com/a/28823384
tagged with: http://stackoverflow.com/tag/html
has body: I have a &lt;div&gt; with overflow: auto; and enough content to require vertical scrolling. Is there a way, using PLAIN JAVASCRIPT, to extract only the visible content (HTML) in the &lt;div&gt;? (that is, only what is visibile on the screen based on the current scollbar position). Note - the container doesn't have to be a &lt;div&gt;.
has title: Is it possible to extract only the visible contents of a scroll-able div?
upvote count: 1
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45918248
score: 1
has answer: http://stackoverflow.com/a/28824534
answer count: 2

http://stackoverflow.com/comment/45828442
type: AnswerComment
comment on: http://stackoverflow.com/a/28774435
type: Comment
has text: Thanks @Coderhs but the thing is i intended to spare the iteration through all HealthCareInsurance objects. Maybe there's just no simple way arount it.
score: 0

http://stackoverflow.com/comment/46013032
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28875467
score: 3
has text: Please consider providing a live demo of the code (JSFiddle, Plnkr...)

http://stackoverflow.com/comment/46140891
type: QuestionComment
has text: maybe this post helps: http://stackoverflow.com/questions/23571852/protractor-scroll-down/23573893#23573893. the snippet shows the use of `window.scrollTo(0,0);` instead of `scollIntoView` (which currently only is supportet by firefox 36 and is experimental)
score: 0
comment on: http://stackoverflow.com/q/28828306
type: Comment

http://stackoverflow.com/a/28754376
has body: I don't believe there is a renderComplete event or anything like that in angular; you may have to use $timeout as suggested here. // i'm taking assumptions with your code, but... $scope.slides = []; $http.get('/data/slides.json').success(function(data){ $scope.slides = data; $timeout(function(){ $("#flipbook").turn({ width: 1724, height: 772, autoCenter: true }); }, 0); });
score: 0
has comment: http://stackoverflow.com/comment/45813263
type: Answer
answers question: http://stackoverflow.com/q/28752950

http://stackoverflow.com/q/28782277
type: Question
possible better answer: http://stackoverflow.com/a/28786609
tagged with: cakephp
tagged with: javascript
has body: I dont get any output for my onchange event for a radio button. I want to select 3 out of 4 a radio buttons and disable a text input field and the other enables the text input. Currently I cant get it to output anything. echo $this->Form->input('startDate',array('id'=>'startdatebox','label' => 'Start Date','class'=>'datepicker', 'type'=>'text','style'=>'width:100px;height:30px','value' => $datestart)); .. echo $this -> Form -> input('dateRange', array('id'=>'dateRange2','label' => ' Date Range ','type' => 'radio', 'value' =>$dateSelect,'name'=>'dateRange2' ,'options' => $selectoption)) ; $("input[name='data[User][dateRange2]']").on("click",function() { $('#startdatebox, #enddatebox').prop('disabled', $(this).val() != 3); alert( 'aasda'); });
answer count: 2
accepted answer: http://stackoverflow.com/a/36875097
has title: cant get radio button onchange to work in cakephp
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/45842604
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28786609
score: 1
has answer: http://stackoverflow.com/a/36875097
upvote count: 1

http://stackoverflow.com/comment/45840684
type: QuestionComment
comment on: http://stackoverflow.com/q/28781353
has text: @JaganG, this is too broad of a question. Break it down. Do you know how to add values of multiples buttons without the single/double/triple click? Do you know how to build custom input controls without adding them together? Do you know how to detect a double click from a single click, or a triple from a double?
score: 0
type: Comment

http://stackoverflow.com/q/28794101
has comment: http://stackoverflow.com/comment/45969473
tagged with: ajax
has comment: http://stackoverflow.com/comment/45887446
has comment: http://stackoverflow.com/comment/45967223
has comment: http://stackoverflow.com/comment/45924231
has comment: http://stackoverflow.com/comment/45894955
type: Question
has comment: http://stackoverflow.com/comment/45969171
linked to: http://stackoverflow.com/q/15996779
has comment: http://stackoverflow.com/comment/45863935
has title: Java MVC and Ajax weird cookie behaviour
tagged with: model-view-controller
has comment: http://stackoverflow.com/comment/45968219
has comment: http://stackoverflow.com/comment/45943941
has comment: http://stackoverflow.com/comment/45967486
has comment: http://stackoverflow.com/comment/45864155
score: 0
tagged with: java
has comment: http://stackoverflow.com/comment/45969605
has comment: http://stackoverflow.com/comment/45960835
has comment: http://stackoverflow.com/comment/45863449
has comment: http://stackoverflow.com/comment/45967920
has comment: http://stackoverflow.com/comment/45954702
has comment: http://stackoverflow.com/comment/45967596
has comment: http://stackoverflow.com/comment/45968979
has comment: http://stackoverflow.com/comment/45929095
has comment: http://stackoverflow.com/comment/45919214
answer count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45945081
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45863274
has comment: http://stackoverflow.com/comment/45930000
has comment: http://stackoverflow.com/comment/45913581
has comment: http://stackoverflow.com/comment/45863831
has comment: http://stackoverflow.com/comment/45970632
has comment: http://stackoverflow.com/comment/45863689
has body: I have a Java Website using Spring's MVC pattern. The frontend views are JSP files which use Java-Script and jQuery in numerous cases to allow for some smooth design, I guess. Now, I realised a very specific bug that i wanted to get rid off the last few days but I cannot seem to understand how the given factors are causing it. It is really weird. What causes the bug On any JSP that contains ajax-Javascript idle until Session-Timeout is reached Trigger the timeout by calling one of the ajax-Scripts (doesnt matter which, only matters that is is ajax) An automatic redirect to the login-page happens, as the server realises that the session was timed out by the time the request was done I logg back into the site and go back to where i previously had called the ajax-script I try to run that ajax-Script again and now am returned a wrong view. I basically have my mainpage returned instead of the usual desired view I found where in my code this is caused. Each ajax-Script basically makes a POST or GET request to the server using a specific URL. And then i have a typcial Controller on the server that catches this request and procceses it (retrieving necessary data and then return the view supplied with Model-Data). In all of those Controllers it is first checked whether or not a user is currently logged in. This is because basically all of the ajax-actions retrieve user-specific data and it wouldnt make sense to do so if there is no user logged in anymore. Apparently this check fails, as the result of this check failing explains why i get my mainpage returned. Instead of returning the right view with the right data i am returned a RedirectView onto "/login.html". The reason i am now shown the Login-Page but my mainPage instead is most likely explained by the fact that the Controller listning to "/login.html" actually realises that a user IS infact logged in and thus returns my mainPage instead of the loginPage. Note that each and every other controller other than the controll…
has comment: http://stackoverflow.com/comment/45968200
has comment: http://stackoverflow.com/comment/45924756

http://stackoverflow.com/comment/45990170
comment on: http://stackoverflow.com/a/28862283
score: 0
type: AnswerComment
type: Comment
has text: Now the code has been changed, maybe I focused on wrong events. A demo would help

http://stackoverflow.com/comment/48154862
has text: Acturely, I just ended up doing `var m1 = str.match(/a+/)[0]; var m2 = str.match(new RegExp("b{"+ m1.length +"}"))` (If I remember correctly didnt use new RegExp but just a substring but thats the general idea behind the solution)
type: AnswerComment
comment on: http://stackoverflow.com/a/28783565
score: 0
type: Comment

http://stackoverflow.com/a/28844747
score: 0
has comment: http://stackoverflow.com/comment/45958665
type: Answer
has body: I copied your code and tweaked it a little so I could run it without the web services and it works great. Here is the HTML page I created: Try it As you can see, I created an array of JSON objects that hold the comicID and am statically creating the image as 'monkey.jpeg'. The code works so there is either an issue with the 'response' that you pass into your loadComicJSON method or the result from your POST method. Add a couple of console.log statements and look at the two values I mentioned and you will likely see the issue.
has comment: http://stackoverflow.com/comment/45958783
has comment: http://stackoverflow.com/comment/45958742
has comment: http://stackoverflow.com/comment/45958492
answers question: http://stackoverflow.com/q/28844376
has comment: http://stackoverflow.com/comment/45958459
has comment: http://stackoverflow.com/comment/45958601
has comment: http://stackoverflow.com/comment/45958432

http://stackoverflow.com/q/28813785
has answer: http://stackoverflow.com/a/28814142
has comment: http://stackoverflow.com/comment/45899854
upvote count: 8
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28814138
score: 7
downvote count: 1
has comment: http://stackoverflow.com/comment/45899767
type: Question
has comment: http://stackoverflow.com/comment/45899446
has answer: http://stackoverflow.com/a/28826950
has body: Does anybody knows how can I get all the HTML tags that exist in a page? I need to get only the tags without their IDs or other attributes, and create a kind of tree-structure of them. Prefer to do that with Javascript or JQuery. For example, This HTML code: Example Page < body> Blabla should return return: html head title body h1 div table tr td
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45899970
has title: Get all html tags with Javascript
answer count: 3
has comment: http://stackoverflow.com/comment/45923913
tagged with: http://stackoverflow.com/tag/html
favorite count: 0

http://stackoverflow.com/q/28834976
answer count: 1
has title: my jquery calender is not aligning correctly
has comment: http://stackoverflow.com/comment/45942472
tagged with: clock
tagged with: javascript
tagged with: jquery
has body: Below is the javascript for my clock on my website, it is set 2 weeks into the future however for some reason I am now getting an alert and the letterspacing (to make the calender look more square) is not working either. Can somebody please tell me why this would be? Nothing has changed and it was working perfectly grrrrrrrrrrrrr. I repeat it worked perfectly and the letters were nicely spaced to make the whole time and date block look like a minimalist square. It is obviously something to do with this line if(date &gt; day &amp;&amp; date &gt; time){ but I do not know how to fix it. I also have a livelink here. this will be removed for future posterity of the post. THE JAVASCRIPT IS BELOW tday = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"); tmonth = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); function GetClock() { var d = new Date(+new Date + 12096e5); var dx = d.toGMTString(); dx = dx.substr(0, dx.length - 3); d.setTime(Date.parse(dx)) d.setSeconds(d.getSeconds() + 0); var nday = d.getDay(), nmonth = d.getMonth(), ndate = d.getDate(), nyear = d.getYear(), nhour = d.getHours(), nmin = d.getMinutes(), nsec = d.getSeconds(), ap; if (nhour == 0) { ap = " AM"; nhour = 12; } else if (nhour &lt; 12) { ap = " AM"; } else if (nhour == 12) { ap = " PM"; } else if (nhour &gt; 12) { ap = " PM"; nhour -= 12; } if (nyear &lt; 1000) nyear += 1900; if (nmin &lt;= 9) nmin = "0" + nmin; if (nsec &lt;= 9) nsec = "0" + nsec; document.getElementById('day').innerHTML = "" + tday[nday].toUpperCase() + ""; document.getElementById('time').innerHTML = "" + nhour + ":" + nmin + ":" + nsec + ""; document.getElementById('hour').innerHTML = "" + ap + ""; document.getElementById('date').innerHTML = "" + tmonth[nmonth].toUpperCase() + " " + ndate + ", " + nyear + ""; } window.onload = function () { GetClock(); setInterval(GetClock, 1000); var day = $('#day').width()…
type: AnsweredQuestion
tagged with: text-alignment
has answer: http://stackoverflow.com/a/28836458
accepted answer: http://stackoverflow.com/a/28836458
type: Question
score: 0
tagged with: calendar

http://stackoverflow.com/q/28810807
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has answer: http://stackoverflow.com/a/28810872
favorite count: 0
type: UnansweredQuestion
answer count: 4
has title: jQueryUI Sortable - Remove a li from the sortable list
has body: What i need is the ability to have an X either a text link, or button, I'm to remove an item from the sortable list. How do I write a function to do so within this code? $(function() { $("#sortable").sortable({ placeholder: "ui-state-musichighlight" }); }); X X X update Still not working, but it does on JSfiddle...Help? X1 X2 X3 update I have now fixed it with... // window.onload=function(){ however its not working within my jQuery function...help? jQuery("#sortable").append(' X
upvote count: 3
has answer: http://stackoverflow.com/a/28810926
type: Question
has answer: http://stackoverflow.com/a/28810931
tagged with: jquery-ui
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28810917
score: 3

http://stackoverflow.com/q/28802603
has answer: http://stackoverflow.com/a/29437649
tagged with: es6-promise
tagged with: javascript
tagged with: mocha.js
score: 4
has answer: http://stackoverflow.com/a/28922804
has comment: http://stackoverflow.com/comment/45900575
answer count: 3
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/46079816
has title: ES6 Promises in Mocha
accepted answer: http://stackoverflow.com/a/28922804
has comment: http://stackoverflow.com/comment/45900493
has answer: http://stackoverflow.com/a/28803416
type: AnsweredQuestion
tagged with: chai
has comment: http://stackoverflow.com/comment/45878860
has comment: http://stackoverflow.com/comment/45879213
has body: I'm using this polyfill for ES6 promises and Mocha / Chai. My assertions for the promises are not working. The following is a sample test: it('should fail', function(done) { new Promise(function(resolve, reject) { resolve(false); }).then(function(result) { assert.equal(result, true); done(); }).catch(function(err) { console.log(err); }); }); When I run this test it fails due to timeout. The assertion failure that was thrown in the then block is caught in the catch block. How can I avoid this and just throw it straight to Mocha? I could just throw it from the catch function, but then how would I make assertions for the catch block?
possible better answer: http://stackoverflow.com/a/28803416
type: Question
upvote count: 4
tagged with: ecmascript-6

http://stackoverflow.com/comment/45903551
comment on: http://stackoverflow.com/a/28814831
has text: I agree that the code isn't clean or pretty, but AFAIK there is no pretty and at the same time reliable option in case if both boolean primitives and Boolean objects at the scene.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46006423
comment on: http://stackoverflow.com/q/28870647
has text: you can also pass the x value into a scope function like this https://jsfiddle.net/4j1hrtcw/9/
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/68741225
comment on: http://stackoverflow.com/a/40706580
score: 0
type: AnswerComment
has text: what if I'll delete the links to the library? A can delete it from all my topics, not a big deal to me. If ppl will ask, I could share with them privately, no problem )
type: Comment

http://stackoverflow.com/a/28861969
has comment: http://stackoverflow.com/comment/45990192
has body: Here is a basic implementation using toggleClass: $('button').on('click', function () { var button = $(this); button.toggleClass(button.data('effect')); }); button { left: 0px; top: 0px; height: 56px; } button.st-effect-12 { background: red; }
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28861792
answers question: http://stackoverflow.com/q/28861792
type: Answer
score: 0
has comment: http://stackoverflow.com/comment/45990338

http://stackoverflow.com/q/28822554
has body: Select color <?php $hn = new product(); $get_color = $hn->get_color_id_nullval($gg['id_product']); while($fetch_color = mysql_fetch_array($get_color)){ ?> <a class="color" title="<?=$fetch_color[1]?>" onClick="chkcolor(this , <?=$gg['id_product']?> , <?=$fetch_color[0]?>)" style="background-color:<?=$fetch_color[2]?>" > <?php } ?> function chkcolor(obj,p_id,clr_id){ if($(obj).hasClass("active") ) { $(obj).removeClass("active"); $('.tovar_color_select a').removeClass("active"); } else { $(obj).addClass('active'); } } Listen carefully about my query .I am already successfully in getting active class and also have remove active class of current object but I need to remain active other select DOM element which is select by user .Currently my code remove from all DOM element active class.I just want remain select class active other DOM elements should have to removed from active class.if currently i have any syntax mistake you can mentioned but also you have give me some logical implementation of my query. Thanks in Advance for help
has comment: http://stackoverflow.com/comment/45916871
type: UnansweredQuestion
upvote count: 1
tagged with: php
type: Question
has answer: http://stackoverflow.com/a/28822686
has comment: http://stackoverflow.com/comment/45916793
has comment: http://stackoverflow.com/comment/45916734
has title: Find object jquery remove class of current object But not to remove other active object
has comment: http://stackoverflow.com/comment/45916814
answer count: 2
has answer: http://stackoverflow.com/a/28822739
downvote count: 0
tagged with: javascript
tagged with: jquery
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/45916688

http://stackoverflow.com/a/28878858
has body: You have mis-matched brackets, and $this should be $(this): $("#menu a").each(function(){ console.log($(this).attr("href")); });
accepted answer of: http://stackoverflow.com/q/28878841
upvote count: 4
downvote count: 0
score: 4
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/28878841

http://stackoverflow.com/comment/46052942
score: 0
comment on: http://stackoverflow.com/a/28896275
type: AnswerComment
has text: I am on the admin account of the pc, and i also have UAC turned off ( i hate the damn thing ) so yeah this would work, just need a way to feed in the input and extract the output
type: Comment

http://stackoverflow.com/a/28759096
answers question: http://stackoverflow.com/q/28758894
type: Answer
score: 0
has body: You can do it by following way ...... ...... ......

http://stackoverflow.com/q/28894486
has comment: http://stackoverflow.com/comment/46049236
tagged with: javascript
has comment: http://stackoverflow.com/comment/46049611
has title: if i click 2nd child div i have to change first child div class
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: Toggle navigation Home test Home test When my child div class as "collapse in" I have to add the class above button class as a "navbar-toggle-active". When my child div class as "collapse" I have to add the class above button class as a "navbar-toggle".
answer count: 0
tagged with: twitter-bootstrap
score: 0
type: Question
has comment: http://stackoverflow.com/comment/46051002

http://stackoverflow.com/q/28851469
tagged with: angularjs
has answer: http://stackoverflow.com/a/28851505
accepted answer: http://stackoverflow.com/a/28851505
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: angularjs-scope
type: Question
has comment: http://stackoverflow.com/comment/45970481
has title: How can I understand like this "var vm = $scope.vm = {}" in AngularJS?
tagged with: javascript
upvote count: 1
answer count: 1
has body: When I read the angularJS api, I found the code like this: myApp.controller('MyController', ['$scope', function($scope) { var vm = $scope.vm = {name:'savo'}; } ]); This multiple assignments seems easy to understand. But when I code like this: myApp.controller('MyController', ['$scope', function($scope) { var vm = $scope.vm = {name:'savo'}; vm.age = 18; } ]); And the HTML like this: &lt;div ng-controller="MyController"&gt; &lt;pre&gt;{{vm}}&lt;/pre&gt; &lt;pre&gt;{{vm.name}}&lt;/pre&gt; &lt;pre&gt;{{vm.age}}&lt;/pre&gt; &lt;/div&gt; The results in the browser here: Here is my question: The controller give the vm a attribute age, why the vm in the $scope has it too? When I use native JavaScript, this can not happen. I can also change the two vm into different names,it won't change anything. I'm new in angularJS,this just confusing me,Thanks for help! By the way,why is angular use the name vm,does vm refer to some words abbreviation?
favorite count: 0

http://stackoverflow.com/comment/45941131
has text: Checked it out; its perfect. I was not aware one could load a template into an abstract. so this is just what I was looking for.
comment on: http://stackoverflow.com/a/28833131
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28772485
accepted answer of: http://stackoverflow.com/q/28772200
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/45823862
has comment: http://stackoverflow.com/comment/45823717
downvote count: 0
has comment: http://stackoverflow.com/comment/45823473
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28772200
has body: I would simply create an empty hidden iframe and append stylesheet there. This way it would not affect anything and you would still be able to read its cssRules. For example: stylesheet = document.createElement('style'); stylesheet.type = 'text/css'; stylesheet.innerHTML = data; var iframe = document.createElement('iframe'); iframe.style.display = 'none'; document.body.appendChild(iframe); var iframeDoc = iframe.contentWindow.document || iframe.contentDocument; iframeDoc.body.appendChild(stylesheet); stylesheet = iframeDoc.styleSheets[0]; rules = stylesheet.rules || stylesheet.cssRules; Demo: http://plnkr.co/edit/hlNlpzfRmLP8IYYwePeC?p=preview
has comment: http://stackoverflow.com/comment/45823535
type: Answer

http://stackoverflow.com/a/28844466
type: Answer
upvote count: 1
has body: Instead of the expected interleaving That would be the expected behavior only for synchronous I/O. Remember that these operations are all asynchronous, which is a key idea of node.js. What the code does is this: for each item in the list, 'start a function' // &lt;-- this will immediately look at the next item output a number (happens immediately) do some long-running operation over the network with connection pooling and batching. When done, call a callback that says 'inserted' Now the code will launch a ton of those functions that, in turn, send requests to the database. All that will happen long before the first request has even reached the database. It is likely that the OS doesn't even bother to actually send the first TCP packets before you're at, say ticket 5 or 10 or so. To answer the question from your comment: No, the requests will be sent out relatively soon (that is up to the OS), but the results won't reach your single-threaded javascript code before your loop hasn't finished queuing up the 50k entries. This is because the forEach is your currently running piece of code, and all events that come in while it's running will be processed only after it's finished - you'll observe the same if you use setTimeout(function() { console.log("inserted... not") }, 0) instead of the actual DB call, because setTimeout is also an async event. To make your code fully async, your data source should be some kind of (async) iterator that provides data, instead of a huge array of items.
score: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28844354
answers question: http://stackoverflow.com/q/28844354
has comment: http://stackoverflow.com/comment/45957871

http://stackoverflow.com/q/28861087
answer count: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/45987808
has title: Having issues with a javascript for loop += decimal variable
has comment: http://stackoverflow.com/comment/45988067
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45988048
downvote count: 2
type: Question
accepted answer: http://stackoverflow.com/a/28861412
score: -2
tagged with: javascript
has body: Hi guys I am building a for loop which basically generates a dynamic select options form. Everything works fine until I try and use a decimal value as an incrementer. for instance a normal loop would be this: for(i =0; i <= 10; i++){ // do some code } The issue I am facing is that everything that is being put in is dynamic including the increment which may need to increment with decimal figures! For instance it may need this: for(i =0; i <= 10.5;i+= 1.5){ //do some code } Now the thing is that again everything is dynamic so the actual end code looks like this: for(thei = 0; thei <= calchours; thei += +thetype){ } Everything works 100% if the "thetype" is just 1, but as soon as its a 1.5 it only loops a few times before exiting. Here is the Example code of what I am trying to do: Example Html Code: Hourly Bookings 1 Hour Bookings With 30 Minute Intervals N/A 00:00 01:00 02:00 03:00 04:00 05:00 06:00 07:00 08:00 09:00 10:00 11:00 12:00 13:00 14:00 15:00 16:00 17:00 18:00 19:00 20:00 21:00 22:00 23:00 N/A 00:00 00:30 01:00 01:30 02:00 02:30 03:00 03:30 04:00 04:30 05:00 05:30 06:00 06:30 07:00 07:30 08:00 08:30 09:00 09:30 10:00 10:30 11:00 11:30 12:00 12:30 13:00 13:30 14:00 14:30 15:00 15:30 16:00 16:30 17:00 17:30 18:00 18:30 19:00 19:30 20:00 20:30 21:00 21:30 22:00 22:30 23:00 23:30 Select Which Hour You Would Like To Have Off? Example Javascript jQuery(document).read(function(){ jQuery('#dinnerswitch').change(function(){ if(jQuery(this).is(':checked')) { jQuery(this).val(1); }; if(jQuery(this).is(':checked') == false) { jQuery(this).val(0); }; var dinnerid = jQuery('#dinnerswitch').val(); var thestart = jQuery('#timefrom').val(); var theend = jQuery('#timeto').val(); var thetype = jQuery('#bookingtype').val(); var thei = 0; var doi = ''; var calchours = ((theend - thestart) / thetype); var calstart = ''; var calend = ''; var enterhours = ''; var addingnumbers = 0; for(thei = 0; thei <= calchours; thei+= +thetype){ calstart = +thestart + +thei; if(calstart < 12){ …
has comment: http://stackoverflow.com/comment/45987976
tagged with: for-loop
has answer: http://stackoverflow.com/a/28861412
upvote count: 0

http://stackoverflow.com/comment/45817354
score: 0
type: AnswerComment
type: Comment
has text: At least that's how it is in JS.
comment on: http://stackoverflow.com/a/28769416

http://stackoverflow.com/comment/46060002
type: AnswerComment
comment on: http://stackoverflow.com/a/28899416
type: Comment
has text: @Josethehose I updated plunker for your wishes check it please
score: 1

http://stackoverflow.com/comment/46067441
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28903869
type: AnswerComment
has text: @A.Wolff: But that's only when initializing from `data-*` attributes. `foo.data("bar", "23")` will give you back a string if you ask for it back (which is what we want, of course).

http://stackoverflow.com/q/28788052
tagged with: database
tagged with: javascript
tagged with: game-development
has answer: http://stackoverflow.com/a/28788172
score: 0
answer count: 3
has title: How do I connect a sql server to my Javascript game?
linked to: http://stackoverflow.com/q/5818312
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28788165
has body: I'm working on a project and I just need a holistic overview on how to go about it. I'm going to use HTML/CSS canvas to make the game. However, the game involves visualization of large amounts of data that is best served in a database. What I do not know how to do is: Link my HTML/CSS game to a SQL database Parse a text file to populate the database. I don't have specific issues I just don't even know where to start? Some people have said AJAX? Others have said parse.com?
tagged with: css
tagged with: web-applications
has answer: http://stackoverflow.com/a/28788270
type: Question

http://stackoverflow.com/a/28795226
answers question: http://stackoverflow.com/q/28795036
has body: try this: $(function(){ $(document).on('click','#ocs',function(e){ // do somethign here }); });
score: 0
type: Answer

http://stackoverflow.com/comment/45826602
comment on: http://stackoverflow.com/a/28774133
has text: Yes It is the same. Could you provide more background on the require('...')(app) syntax? Is it very used, is it a good practice = ]... Ps* I can only accept within 7 minutes.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45811004
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28766069
has text: Is the method a JavaScript one or a php one?

http://stackoverflow.com/a/28886913
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/46036197
accepted answer of: http://stackoverflow.com/q/28885702
answers question: http://stackoverflow.com/q/28885702
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46036552
has body: Setting the annotations.alwaysOutside to true will make them show up. See jsfiddle alwaysOutside: true, textStyle: { fontSize: 17, auraColor: 'none', color: '#555' }
type: Answer

http://stackoverflow.com/comment/46055346
has text: possible duplicate of [Is JavaScript a pass-by-reference or pass-by-value language?](http://stackoverflow.com/questions/518000/is-javascript-a-pass-by-reference-or-pass-by-value-language)
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28894197

http://stackoverflow.com/comment/45851688
comment on: http://stackoverflow.com/q/28777641
score: 0
type: Comment
type: QuestionComment
has text: Hi and thanks for your reply, the ajax function is able to switch off and on the leds on the yun, quit fine. That code is located in a localhost html page, and it comunicates with the yun. What i need is to recive in the sucess the json data as described above, to manipulate data, and i think it could be a browser limitation, as it is a cross domian request... Wich kind of approach could i use to get that json data in my html page?

http://stackoverflow.com/a/28859199
has comment: http://stackoverflow.com/comment/45986525
type: Answer
has comment: http://stackoverflow.com/comment/45984395
has comment: http://stackoverflow.com/comment/45986860
has comment: http://stackoverflow.com/comment/45985487
score: 1
has body: You need to interrupt the click event: $("#btn_blue_refresh").on('click', function(event){ event.preventDefault(); $("#div_captcha").replaceWith("&lt;div id='div_captcha'&gt;&lt;script type='text/javascript'&gt;sjcap();&lt;/script&gt;&lt;/div&gt;"); }); Edit to respond to comment: You probably need to break that up a bit as it's incomprehensible for mere mortals like myself! I'm not sure this syntax is perfect, but something along the lines of $('#div_captcha').html('&lt;div class="captcha_img"&gt;&amp;nbsp;&lt;img src="' + decodeURIComponent(imgdir) + imgid + '.jpg" width="180px" height="50px" alt="" &gt;&lt;/div&gt;&lt;div class="request_input"&gt;&lt;input type="text" name="captchaBox" value="Enter Word Above" id="' + jfldid + '" name="' + jfldid + '" class="' + jfldcls + '" size="' + jfldsz + '"&gt;&lt;/div&gt;'); $('#div_captcha').on('focus', function(){ if(this.value=='Enter Word Above') this.value=''; }); $('#div_captcha').on('blur', function(){ if(this.value==''){ this.value='Enter Word Above'; } if(this.value==' '){ this.value='Enter Word Above'; });
upvote count: 1
has comment: http://stackoverflow.com/comment/45984987
has comment: http://stackoverflow.com/comment/45986465
has comment: http://stackoverflow.com/comment/45984364
has comment: http://stackoverflow.com/comment/45985863
downvote count: 0
has comment: http://stackoverflow.com/comment/45987269
has comment: http://stackoverflow.com/comment/45986864
answers question: http://stackoverflow.com/q/28859143

http://stackoverflow.com/a/28824065
has comment: http://stackoverflow.com/comment/45925016
has body: I see that you use listContents while creating the form, but listContent while accessing it after parsing it. When I tried generating the form with the same code you showed, the input name for listContents is listContents itself in the generated HTML form.
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45926210
type: Answer
has comment: http://stackoverflow.com/comment/45924927
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45923887
has comment: http://stackoverflow.com/comment/45926084
accepted answer of: http://stackoverflow.com/q/28822954
answers question: http://stackoverflow.com/q/28822954
has comment: http://stackoverflow.com/comment/45926010

http://stackoverflow.com/comment/46059788
type: Comment
score: 0
has text: The rule is generally the simplest the better :)
type: QuestionComment
comment on: http://stackoverflow.com/q/28900134

http://stackoverflow.com/a/28874882
has comment: http://stackoverflow.com/comment/46012218
has comment: http://stackoverflow.com/comment/46012302
has body: Your problem is in your calculate function total = 100 + parseFloat(option_checkbox_return); 100 must be declared as global variable and initialised to 100 var x=100; var optionCheckbox = function optionCheckbox() { var checkbox_price_prefix; var checkbox_price = 0; // Loop Checkbox $('.type_checkbox input[type="checkbox"]').each(function (index) { if ($(this).is(':checked')) { checkbox_price_prefix = $(this).data('prefix-checkbox'); checkbox_price = checkbox_price_prefix + $(this).data('price-checkbox'); } }); return checkbox_price; } function calculateTotal() { var option_checkbox_return = optionCheckbox(); total = x + parseFloat(option_checkbox_return); x=total; result = parseFloat(Math.round(total * 100) / 100).toFixed(2); // Convert to 2 decimal places $('.price_placeholder').html('RM' + result); } $('.type_checkbox input[type="checkbox"]').on('click', function () { calculateTotal(); });
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28874634

http://stackoverflow.com/a/28886126
has comment: http://stackoverflow.com/comment/46068531
has body: Plunker isn't working at the moment, but this seems to work: var myapp = angular.module('myapp', ["ui.router", "ngAnimate"]); function dummyResolve(data) { return function ($timeout, $q) { var defer = $q.defer(); $timeout(function () { defer.resolve(data); }, 500); return defer.promise; }; } myapp.config(function ($stateProvider, $urlRouterProvider) { $stateProvider .state("foo", { url: "/foo", template: '&lt;h1&gt;{{ data }}&lt;/h1&gt;', controller: 'FooBarCtrl', resolve: { data: dummyResolve('foo') } }) .state("bar", { url: "/bar", template: '&lt;h1&gt;{{ data }}&lt;/h1&gt;', controller: 'FooBarCtrl', resolve: { data: dummyResolve('bar') } }) $urlRouterProvider.otherwise("/foo"); }); myapp.controller('FooBarCtrl', function ($scope, data) { $scope.data = data; }); Animations happen after the data is resolved.
has comment: http://stackoverflow.com/comment/46037388
answers question: http://stackoverflow.com/q/28885393
has comment: http://stackoverflow.com/comment/46046076
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/46058036
has comment: http://stackoverflow.com/comment/46073584

http://stackoverflow.com/q/28767837
type: AnsweredQuestion
upvote count: 17
type: Question
has answer: http://stackoverflow.com/a/31032795
tagged with: javascript
score: 17
has body: Using nodejs and only javascript, how do I extract a public key from a private key pem? The private key that I have in hand is a PEM formatted private key; I'd like to extract the public key so I can distribute it to collaborators. I regularly use the pure javascript node-forge module but have not yet discovered how to extract the public key from the private key. I am also aware of, and presently use the ursa module to accomplish this; but I would like a pure javascript or pure nodejs solution if available.
tagged with: pem
answer count: 2
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/31032795
has title: Extract public key from private key pem using only nodejs/javascript
possible better answer: http://stackoverflow.com/a/64492227
tagged with: node.js
has answer: http://stackoverflow.com/a/64492227

http://stackoverflow.com/comment/45793405
type: Comment
type: QuestionComment
has text: Ha, i spend an hour doing the logic on this and dude disappears.
score: 1
comment on: http://stackoverflow.com/q/28753166

session
tags question: http://stackoverflow.com/q/28751234
tags question: http://stackoverflow.com/q/28801564
tags question: http://stackoverflow.com/q/28823066
tags question: http://stackoverflow.com/q/28848410
tags question: http://stackoverflow.com/q/28789857
tags question: http://stackoverflow.com/q/28839532
tags question: http://stackoverflow.com/q/28904150
type: Tag
tags question: http://stackoverflow.com/q/28885943
tags question: http://stackoverflow.com/q/28824199
tags question: http://stackoverflow.com/q/28853379
tags question: http://stackoverflow.com/q/28785881
tags question: http://stackoverflow.com/q/28752524
tag name: session
tags question: http://stackoverflow.com/q/28844415

http://stackoverflow.com/comment/46073665
score: 0
has text: See updated text. Do you think 5 min intervals across a week is too ambitious?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28906126

http://stackoverflow.com/comment/45862952
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28791725
has text: The question refers to “html entities”, then “html tags”. They are two different things. The question should be edited to make it unambiguous which one is meant (or whether you mean *both* tags and entities).

http://stackoverflow.com/a/28799777
answers question: http://stackoverflow.com/q/28799567
has body: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/naturalHeight element.naturalWidth element.naturalHeight
has comment: http://stackoverflow.com/comment/45873990
score: 0
has comment: http://stackoverflow.com/comment/45873833
type: Answer

http://stackoverflow.com/q/28767471
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45814154
has answer: http://stackoverflow.com/a/28805505
accepted answer: http://stackoverflow.com/a/28805505
has comment: http://stackoverflow.com/comment/45814116
has comment: http://stackoverflow.com/comment/45814010
has body: I have a javascript file which contains some data array and a function. I am using this function to display a table on the html page when it loads and on the click of a button. The error I am getting is: GET http://localhost:3000/views/table.js contracts.html:84 Uncaught ReferenceError: addTable is not defined contracts.html:84 onclick My contracts.html file looks like this: &lt;!DOCTYPE html&gt; &lt;html lang = "en"&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"&gt; &lt;link rel="stylesheet" href="/css/portalstyle.css"&gt; &lt;link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"&gt; &lt;/head&gt; &lt;body id="contracts"&gt; &lt;div id="wrapper"&gt; &lt;!-- Some Header code here --&gt; &lt;div id="mytable"&gt;&lt;/div&gt; &lt;div id="footer"&gt; &lt;table id="footer" style="width: 100%"&gt; &lt;tr&gt; &lt;td valign="bottom"&gt;Company Name &lt;br /&gt;Tel Num &lt;br /&gt;Location, Postcode&lt;/td&gt; &lt;td&gt; &lt;button onclick="addTable(ORDER.orders)"&gt;Click me&lt;/button&gt; &lt;/td&gt; &lt;td align="right" valign="bottom"&gt; &lt;a href="#"&gt;Home&lt;/a&gt; &amp;nbsp;&lt;a href="#"&gt;About&lt;/a&gt; &amp;nbsp;&lt;a href="#"&gt;Help&lt;/a&gt; &amp;nbsp;&lt;a href="#"&gt;Contact&lt;/a&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; &lt;/div&gt; &lt;hr /&gt; &lt;script src="http://getbootstrap.com/dist/js/bootstrap.min.js"&gt;&lt;/script&gt; &lt;script src="../views/table.js"&gt;&lt;/script&gt; &lt;/body&gt; &lt;/html&gt; My javascript function file is called table.js and contains: var ORDER = { orders: [] }; function Order(ref, grower, item) { this.order_reference = ("o" + ref); this.grower_reference = grower; this.item_ordered = item; } var order1 = new Order(1, "grower2", "item"); ORDER.orders.push(order1); function addTable(orders) { var table = document.createElement("TABLE"); table.setAttribute("id", "myTable"); doc…
has title: HTML & JavaScript Uncaught ReferenceError: addTable is not defined
downvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45821428
has comment: http://stackoverflow.com/comment/45813761
has comment: http://stackoverflow.com/comment/45814037
type: Question
score: 0
upvote count: 1
answer count: 1
tagged with: javascript
favorite count: 0

http://stackoverflow.com/comment/58633283
type: Comment
comment on: http://stackoverflow.com/q/28762293
type: QuestionComment
score: 1
has text: The code in the question as well as the proposed answer is a well-known anti-pattern in Angular.js - don't do DOM manipulation in your controllers, unless it's in a directive controller.

http://stackoverflow.com/q/28760296
type: Question
downvote count: 0
has title: Reversing ng-repeat's order, iterating over anglefire array
accepted answer: http://stackoverflow.com/a/28760349
tagged with: javascript
answer count: 1
has answer: http://stackoverflow.com/a/28760349
tagged with: angularjs-ng-repeat
favorite count: 0
upvote count: 2
linked to: http://stackoverflow.com/q/15266671
tagged with: firebase
type: AnsweredQuestion
score: 2
has body: Being new to Angular and Firebase, naturally AngleFire is giving me troubles. I'm using ng-repeat to iterate over a synced array, and I'd like to reverse the order it's displaying. I've tried '| reverse' as well as variations of that, sorting the array on the FireBase side, and copying the array into a local only array then reversing it; among more things than I can remember at this point. JS adding data to array ctrl.go = function() { console.log(ctrl.localArray); ctrl.localArray.$add( { name: ctrl.name, content: ctrl.content, time: new Date().getTime(), } ); console.log(ctrl.localArray); HTML w/ ng-repeat &lt;span ng-repeat="localArray in ctrl.localArray"&gt; {{localArray.content}}&lt;br&gt; &lt;p class="right"&gt;- {{localArray.name}} at &lt;/p&gt; &lt;/span&gt; What needs to be done to have the ng-repeat display reversed to how it is? Solution: &lt;span ng-repeat="localArray in ctrl.localArray.reverse()"&gt;

http://stackoverflow.com/comment/45930240
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28810290
score: 0
has text: I think I missed to add this in my answer, but anyways, just try. Add this line of code in your `dspace.cfg`: `authority.controlled.dc.subject.ddc= true`. Hopefully, your configuration will work.

http://stackoverflow.com/comment/80474475
score: 1
type: AnswerComment
has text: @NoahFreitas, Isn't that the same as with sharedworkers?
type: Comment
comment on: http://stackoverflow.com/a/28909021

http://stackoverflow.com/comment/46062582
type: AnswerComment
score: 0
type: Comment
has text: Plz see above the solution I found.
comment on: http://stackoverflow.com/a/28900444

http://stackoverflow.com/comment/46004841
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28870647
type: QuestionComment
has text: Can't you just combine those external values in your controller?

http://stackoverflow.com/comment/45906262
comment on: http://stackoverflow.com/a/28795512
type: Comment
score: 1
type: AnswerComment
has text: I like memoize, but it's the opposite of what I need. I'd like the LAST call to save in a given timeframe to run, not the first. Then more saves in future to run as well. Imagine save is posting something to a server via an xhr request. The purpose is to keep the server up to date with the most recent changes to obj in a few calls as possible.

camera
tags question: http://stackoverflow.com/q/28872583
type: Tag
tag name: camera

http://stackoverflow.com/comment/45869429
score: 0
type: AnswerComment
type: Comment
has text: You need to have only in which has-error or has-success will be added by bootstrap validator. Your form should be working if you make changes as per seregaka and for sure you need to add form-group to visually see the results.
comment on: http://stackoverflow.com/a/28793928

http://stackoverflow.com/q/28864285
accepted answer: http://stackoverflow.com/a/28864350
tagged with: javascript
tagged with: google-maps-api-3
answer count: 1
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28864350
has title: Uncaught TypeError: Cannot read property 'length' of undefined Google Map V3
type: AnsweredQuestion
has body: I know this been asked a tons of time, but I can't seem to find the correct answer to my problem. Its actually very straight forward: service.getDetails(request, function(place, status) { if (status == google.maps.places.PlacesServiceStatus.OK) { Was used prior to using getDetails on its photos, so we know it actually fetches non-empty data. Next, for (var i = 0; i &lt; place.photos.length; i++) { .... } Afterwards I used photos length. Please NOTE: It works fine, UNLESS the place actually has NO pictures to pull.... now it is throwing it off with the "Uncaught TypeError: Cannot read property 'length' of undefined". Is there a condition I can put prior to calling the place.photos.length so I can eliminate this error message? Thanks for reading! Please help out.
upvote count: 1
type: Question

http://stackoverflow.com/comment/45887030
type: QuestionComment
has text: can you console.log your selectmenu and list vars after you defined it ?
comment on: http://stackoverflow.com/q/28806701
score: 0
type: Comment

http://stackoverflow.com/q/28757456
tagged with: google-maps
has comment: http://stackoverflow.com/comment/45797787
upvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/28758763
type: AnsweredQuestion
has body: I am working with the Googlemaps API. I'm trying to update the response in the infowindow of a marker with an ajax call but it requires two clicks to fetch the content with the following code: google.maps.event.addListener(marker, 'click', (function(marker, i) { //infowindow.setContent("Loading..."); return function() { var abb = locations[i][3]; var line = locations[i][4]; var to1 = locations[i][5]; //console.log(abb); getTimes(abb, line, to1, function(result) { html1 = ""; html1 += result; //alert(html1); //console.log(html1); }); //console.log(html1); infowindow.setContent(locations[i][0] + "&lt;br&gt;" + html1); infowindow.open(map, this); } }) (marker, i)); Does anyone know a fix for this? Thanks.
downvote count: 1
accepted answer: http://stackoverflow.com/a/28758763
type: Question
tagged with: javascript
score: -1
has title: Marker requires two clicks to get the right info from ajax call

http://stackoverflow.com/a/35605243
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28885337
has body: This works for me. It's not "clean" but it works :) var someForm = $('.someform'); var someOverlay = $('.someOverlay'); someForm.on('submit', function(e) { e.preventDefault(); someForm.off('submit'); someOverlay.fadeIn('fast', function(){ someForm.submit(); }); });

http://stackoverflow.com/q/28899726
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46074969
has body: I have automated my Internet Explorer to fill out a lot of information throughout the webform. When my VBA script clicks the transfer htmlelement it runs the Javascript which opens a new msgbox where I need to click "ok" or "Cancel". I want my script to click "ok" to this. This stops code untill any further action is made to the popup window created by the javascript, hence Sendkeys will not work. The below element is from the HTML of the webpage which i am trying to interact with: <input type="image" name="ctl00$PlaceHolderMain$TestControl$ CertificateSearchControl$cmdTransfer" id="ctl00_PlaceHolderMain_TestControl1_CertificateSearchControl_cmdTransfer" class="kantele-small-icon" src="../../_layouts/Images/Empty.gif" alt="Transfer" onclick="return confirmOnTransfer();WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$PlaceHolderMain$TestControl1 $CertificateSearchControl$cmdTransfer", "", true, "Transfer", "", false, false))" style="border-width:0px;" /> I use the following command to call the Transfer button: Set HTMLDoc = ie.document HTMLDoc.all.Item("ctl00_PlaceHolderMain_TestControl1_CertificateSearchControl_cmdTransfer").Click Can anyone help me find a solution to this issue? A similar question has been answered in another post, but I cant seem to get the solution to work in my script. Handle Pop-Up While Navigating with IE All help will be greately appriciated. Update 08032015: function confirmOnTransfer() { if (typeof (Page_ClientValidate) == "function" && Page_ClientValidate()) { var volume = document.getElementById('ctl00_PlaceHolderMain_TestControl1_CertificateSearchControl_txtCertificateCount').value.trim(); var oDDL = document.getElementById('ctl00_PlaceHolderMain_TestControl1_CertificateSearchControl_ddlTransferDomain'); var oDDL2 = document.getElementById('ctl00_PlaceHolderMain_TestControl1_CertificateSearchControl_ddlTransferActor'); var oDDL3 = document.getElementById('ctl00_PlaceHolderMain_TestControl1_CertificateSearchControl_ddlTran…
has title: VBA - Handle Javascript pop up with IE automation
score: 2
type: AnsweredQuestion
upvote count: 2
has comment: http://stackoverflow.com/comment/46107338
has answer: http://stackoverflow.com/a/28931528
tagged with: excel
type: Question
linked to: http://stackoverflow.com/q/17773523
accepted answer: http://stackoverflow.com/a/28931528
answer count: 1
downvote count: 0
tagged with: vba
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/a/28905784
type: Answer
answers question: http://stackoverflow.com/q/28904904
has body: Try this. $('button').on('click',function(){ $(".florence").addClass("animate"); }); You have a dot which you dont need in addClass(".animate"). And its click insted of onClick or alternativetly on('click',function(){})
score: 0

http://stackoverflow.com/a/28795935
score: 0
has body: This is a cool project. I did the following: tmp_data.txt (generated via java on the raspi after measurements): {"labels" : ["January","February","March","April","May","June","July"], "datasets" : [ { "label": "My First dataset", "fillColor" : "rgba(220,220,220,0.2)", "strokeColor" : "rgba(220,220,220,1)", "pointColor" : "rgba(220,220,220,1)", "pointStrokeColor" : "#fff", "pointHighlightFill" : "#fff", "pointHighlightStroke" : "rgba(220,220,220,1)", "data" : [1.1,2.2,3.3,4.4,5.5,6,5] } ] } tmp_data.html: The 'fields' in the data file has to be surrounded with quotes. The onload function is called when the site is loaded. The txt file will be read via a httprequest and has to be in the same directory as the html page. I would recommend that some webserver on the raspi will deliver the html. As far as i know js cannot load a local file on the client without user interaction because this could be a serious security issue.
type: Answer
accepted answer of: http://stackoverflow.com/q/28794156
answers question: http://stackoverflow.com/q/28794156
type: AcceptedAnswer

http://stackoverflow.com/q/28900390
type: AnsweredQuestion
has body: I am trying to get the range between two dates. This is the code I use: var startDateStr = Ext.getCmp('startDateFoi').getSubmitValue(); //console.log(startDateStr); // 10-Mar-2015 var endDateStr = Ext.getCmp('endDateFoi').getSubmitValue(); //console.log(endDateStr); // 12-Mar-2015 allDates = []; while (startDateStr &lt;= endDateStr) { allDates.push(new Date(startDateStr)); startDateStr.setDate(startDateStr.getDate() + 1); } console.log(allDates); What am I missing here? Does the format have to be in some specific type?
type: Question
accepted answer: http://stackoverflow.com/a/28901304
tagged with: javascript
tagged with: date
score: 0
has answer: http://stackoverflow.com/a/28901301
answer count: 2
possible better answer: http://stackoverflow.com/a/28901301
tagged with: extjs
has title: Get the dates between start/end date in ExtJS
has answer: http://stackoverflow.com/a/28901304

http://stackoverflow.com/comment/45826318
comment on: http://stackoverflow.com/q/28773851
score: 0
type: QuestionComment
has text: Which line throws that error?
type: Comment

http://stackoverflow.com/comment/45939717
score: 0
type: Comment
has text: Try it out! ` `
type: AnswerComment
comment on: http://stackoverflow.com/a/28807020

http://stackoverflow.com/q/28808502
has comment: http://stackoverflow.com/comment/46600851
has body: I'm making an AngularJS directive for a jQuery date picker plugin which should update a ng-model when the datepicker date has changed. Here is the code so far: angular.module('bootstrap-timepicker', []).directive('timepicker', [ function() { var link; link = function(scope, element, attr, ngModel) { element.datetimepicker(); element.on('dp.change', function(event) { // update ngModel ? }); }; return { restrict: 'A', link: link, require: 'ngModel' }; } ]); How can I update ngModel in the 'dp.change' event considering that scope, element, attr, ngModel are not available when the event is called? Thanks!
type: Question
has comment: http://stackoverflow.com/comment/45889498
tagged with: angularjs-directive
has answer: http://stackoverflow.com/a/29194068
upvote count: 4
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
score: 4
favorite count: 0
tagged with: angularjs
tagged with: datetimepicker
has answer: http://stackoverflow.com/a/29259274
accepted answer: http://stackoverflow.com/a/29194068
has title: How to make a directive update ng-model on jquery on event?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45889443
has comment: http://stackoverflow.com/comment/46600168
possible better answer: http://stackoverflow.com/a/29259274

http://stackoverflow.com/comment/45859762
type: QuestionComment
comment on: http://stackoverflow.com/q/28792469
has text: What is the code you use for creating the top half? SO is a place where we fix small problems for you, not some magical code writing machine
score: 4
type: Comment

size
type: Tag
tags question: http://stackoverflow.com/q/28867086
tag name: size

http://stackoverflow.com/q/28755144
has comment: http://stackoverflow.com/comment/45816788
has answer: http://stackoverflow.com/a/28755924
has comment: http://stackoverflow.com/comment/45791915
upvote count: 9
has answer: http://stackoverflow.com/a/31573770
has title: How can I destroy a datatable
has comment: http://stackoverflow.com/comment/45791875
has answer: http://stackoverflow.com/a/40806726
downvote count: 0
linked to: http://stackoverflow.com/q/29073255
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45792175
has comment: http://stackoverflow.com/comment/45791800
has comment: http://stackoverflow.com/comment/45791753
tagged with: http://stackoverflow.com/tag/html
tagged with: datatables
has body: I have datatable and table have ID example. Now I need to destroy datatable and I write: $('#example').dataTable().fnDestroy(); but I get: Uncaught TypeError: Cannot read property 'style' of undefined also this I get in console log: What is the problem here? Why can't I destroy the datatable? How to solve this?
tagged with: datatable
favorite count: 0
has comment: http://stackoverflow.com/comment/45791716
type: Question
score: 9
answer count: 3
has comment: http://stackoverflow.com/comment/45803027

http://stackoverflow.com/comment/46018039
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28866219
type: Comment
has text: The code is not working. Chrome says `TypeError: Cannot set property 'Module' of undefined`

http://stackoverflow.com/q/28875925
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/28876152
has comment: http://stackoverflow.com/comment/46014164
type: Question
tagged with: javascript
has body: I am creating a sort of a time line chart where I am creating rectangles using SVG DOM and then dynamically displaying them in of a table in html. The problem is that each time a table cell contains two SVG objects, it automatically shifts the second one to the next line . I want them to display on the same line without any space and possibly overlap where I require them to. I have tried all things like line-spacing, height, float, padding, margins but nothing seems to work here. I am writing a part of my code below. This part of the code is inside a loop and repeats a number of time creating multiple SVG Dom objects at multiple instances: var rect=function(h,w,fill){ var NS="http://www.w3.org/2000/svg"; SVGObj.width.baseVal.value=w; SVGObj.height.baseVal.value=h; SVGObj.setAttribute("height",h); SVGObj.style.fill=fill; return SVGObj; } var td1 = document.getElementById(date.toString()+start_hour.toString()); var newdiv = document.createElement('div'); var NS="http://www.w3.org/2000/svg"; var svg=document.createElementNS(NS,"svg"); svg.style.width=wid; svg.style.paddingLeft = pad.toString()+"px"; newdiv.appendChild(svg); td1.appendChild(newdiv); var r= rect(100,wid,"green"); svg.appendChild(r)
score: 0
has title: SVG DOM Objects spacing/Overlapping
answer count: 1
tagged with: http://stackoverflow.com/tag/svg
type: UnansweredQuestion

http://stackoverflow.com/comment/45828665
type: Comment
has text: Are you looking for something like a spring graph (e.g. getspringy.com)?
score: 0
comment on: http://stackoverflow.com/q/28775198
type: QuestionComment

http://stackoverflow.com/comment/46247210
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28911392
has text: Hi Jonathan, the XML I used is not the actual code or JSX. It is supposed to convey the structure of the UI and what data is needed by each component. @BinaryMuse goes into much more detail of pretty much the same solution.

http://stackoverflow.com/a/28882196
accepted answer of: http://stackoverflow.com/q/28880967
has body: Google information on the ASP.NET page lifecycle. There's a Page_OnUnload event that fires when the user navigates away from the page. I think there's a way to hook into this in all the pages in the app, in Global.asax or the master pages, perhaps? (You'd just need to do this in all the masterpages if you have more than one)
has comment: http://stackoverflow.com/comment/46026208
answers question: http://stackoverflow.com/q/28880967
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46025914
score: 0
type: Answer

http://stackoverflow.com/a/28895780
type: Answer
has body: Try to load it in a &lt;iframe&gt; with the URL of the PDF as src. But it might fail because of the client's browser's security policy. So this is brittle at best. Maybe you can use HTML5 localstorage to upload the file to a "safe" location ("safe" as far as the browser is concerned). PDFJS.getDocument() supports "a typed array (Uint8Array) already populated with data or parameter object." So upload to local storage, get the document as bytes from there and then pass it to pdf.js. Related: https://hacks.mozilla.org/2012/02/saving-images-and-files-in-localstorage/
answers question: http://stackoverflow.com/q/28895539
score: 0

http://stackoverflow.com/a/28868161
answers question: http://stackoverflow.com/q/28862194
has comment: http://stackoverflow.com/comment/46202760
has comment: http://stackoverflow.com/comment/46202515
has comment: http://stackoverflow.com/comment/46241136
has comment: http://stackoverflow.com/comment/46225640
score: 0
has comment: http://stackoverflow.com/comment/46202762
type: AcceptedAnswer
has body: UPDATED ANSWER Oh, that video was made before the UI Service service was deprecated, that's what you're calling on the first line of the doGet(). Google stopped supporting this in favor of a different service, HTML Service So this doGet() portion may not be workable even if perfectly transcribed from the video.
type: Answer
has comment: http://stackoverflow.com/comment/46223921
accepted answer of: http://stackoverflow.com/q/28862194
has comment: http://stackoverflow.com/comment/46241099
has comment: http://stackoverflow.com/comment/46235806

http://stackoverflow.com/a/28895905
accepted answer of: http://stackoverflow.com/q/28895555
has body: Yes, it creates the same listener multiple times. You can test it easily: var SomeView = Backbone.View.extend({ initialize: function() { this.listenToOnce(this, 'someEvent ', this.logEvent); this.listenToOnce(this, 'someEvent ', this.logEvent); this.listenToOnce(this, 'someEvent ', this.logEvent); this.listenToOnce(this, 'someEvent ', this.logEvent); }, logEvent: function() { console.log("'someEvent' has been fired!"); } }); var view = new SomeView(); view.trigger('someEvent'); Here is a working demo on JS Bin.
answers question: http://stackoverflow.com/q/28895555
score: 3
upvote count: 3
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/106305865
has text: Setting in the connectionOption the value: `transports: ["polling"]` did it for me. Hope it helps someone.
type: Comment
comment on: http://stackoverflow.com/a/28797650
score: 0
type: AnswerComment

http://stackoverflow.com/a/28894598
type: Answer
has comment: http://stackoverflow.com/comment/46050324
has comment: http://stackoverflow.com/comment/46051137
answers question: http://stackoverflow.com/q/28894155
has comment: http://stackoverflow.com/comment/46052420
score: 0
has body: I assume that somewhere in attendee.html is present something like: var UID_USER = "Some Value"; in that case you're able to access this value only after the page is loaded; $('body').load('attendee.html', function(){ alert(UID_USER); }); Checkout load function
has comment: http://stackoverflow.com/comment/46050949

http://stackoverflow.com/q/28881540
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28881707
answer count: 6
type: Question
has comment: http://stackoverflow.com/comment/46027347
has answer: http://stackoverflow.com/a/28881719
tagged with: javascript
tagged with: jquery
has body: I'm working with a wordpress theme and I need to activate a button when the page loads, but none of the following has worked for me (my button has the ID "reset"): $(document).ready(function() { $("#reset")[0].click(); }); -- $(document).ready(function(){ $("#reset").click(); }) -- $(window).load(function(){ $('#reset').click(); }); I put the code in the header or in the page where i need to activate the button, but does not work. Thanks!
tagged with: click
score: 0
accepted answer: http://stackoverflow.com/a/28881707
possible better answer: http://stackoverflow.com/a/28881748
has answer: http://stackoverflow.com/a/51913136
has answer: http://stackoverflow.com/a/28881685
has answer: http://stackoverflow.com/a/28881748
has answer: http://stackoverflow.com/a/33902311
tagged with: wordpress
has title: Trigger click after load page
tagged with: triggers
has comment: http://stackoverflow.com/comment/46028712

http://stackoverflow.com/comment/46045172
comment on: http://stackoverflow.com/a/28886971
has text: When I tried it. I get another clone of my header which is fixed. The normal table header is still there.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/46036871
type: Comment
comment on: http://stackoverflow.com/a/28887359
score: 1
has text: Updated the above to be less vague. Also made use of $q.all so that arrayItems will only be assigned after all the data needed is available.
type: AnswerComment

http://stackoverflow.com/q/28757593
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28757635
has body: I have a textfield in which users have to enter their name. The problem I'm having is stopping the users from only entering spaces. I want users to be able to use spaces but only if they have other characters (abc, ABC, 1-9, etc.). How can I stop them from only entering spaces? And can this be done onkeyup or onkeypress?
upvote count: 1
has comment: http://stackoverflow.com/comment/45962691
type: AnsweredQuestion
has title: Blocking ONLY spaces from being entered into a from textfield
score: 1
has answer: http://stackoverflow.com/a/28757635
type: Question

http://stackoverflow.com/comment/45950870
score: 0
type: AnswerComment
type: Comment
has text: @zerkms that's true. I should have said "potentially insecure".
comment on: http://stackoverflow.com/a/28840481

http://stackoverflow.com/comment/45856180
comment on: http://stackoverflow.com/q/28790326
has text: how did you know the value of `link` is not updating? it's just a local variable defined in a self-executed function, the returned object (saved into `someVar`) exposes only one method `add`.
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/q/28854146
type: UnansweredQuestion
upvote count: 1
tagged with: ruby-on-rails
score: 1
has body: I have options disabled and enabled for some options in rails admin panel. I am updating the panel titles on the select and disselect of checkboxes and radio buttons. so when the option is disabled for a particular checkbox, I want to display a "-" instead of its value. say for checkbox image "suraj", I have disabled "gon250" so when I click on "suraj", the title for "gon250" should become " - " // Disable related options disables = JSON.parse(elem.attr("data-option-disables")); alert(disables); for(i = 0; i &lt; disables.length; i++) { elem_to_be_disabled = $("input[data-option-subid='option_subid_" + disables[i] + "']"); elem_to_be_disabled.prop("disabled", true).addClass("c_disabled"); elem_to_be_disabled.closest(".part_option_wrapper").prepend("&lt;div class='option_overlay'/&gt;"); } $("#selected_part_" + elem.attr("data-option-part")).find(".selected_part_option").html(elem.attr("data-option-name")); // Enable related options enables = JSON.parse(elem.attr("data-option-enables")); for(i = 0; i &lt; enables.length; i++) { elem_to_be_enabled = $("[data-option-subid='option_subid_" + enables[i] + "']"); console.log(elem_to_be_enabled); elem_to_be_enabled.prop("selected", true); elem_to_be_enabled.prop("checked", true); } }); Please Help. Thanks
type: Question
downvote count: 0
tagged with: javascript
favorite count: 0
has title: Add a "-" when the option is disabled
answer count: 0

http://stackoverflow.com/comment/46052279
type: QuestionComment
comment on: http://stackoverflow.com/q/28896260
has text: Try placing the scripts right before the closing tag
score: 0
type: Comment

http://stackoverflow.com/comment/46094684
score: 0
type: AnswerComment
has text: Are you making the ajax call from the same domain? There's a security restriction on cross-domain ajax calls. Do you know what CORS (Cross-Origin Resource Sharing) is? This is a good link to get started if this is your case: http://enable-cors.org/
type: Comment
comment on: http://stackoverflow.com/a/28891082

http://stackoverflow.com/a/28840316
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28840089
has body: jsFiddle Demo First, JSON is a string notation used for serializing information. It can be deserialized (parsed in JavaScript) into an object or array. What you have is the deserialized format, and as a result it is simply a plain array of objects. As a result, the native .mapMDN api function will work to map the .title from each object into an array of just those titles. var titles = result.map(function(obj){ return obj.title; });
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/45950198
accepted answer of: http://stackoverflow.com/q/28840089
upvote count: 1

http://stackoverflow.com/comment/45814570
score: 0
comment on: http://stackoverflow.com/q/28766424
type: Comment
type: QuestionComment
has text: None of them, after almost three calls to genRandom. You'll find it in the fiddle I created.

http://stackoverflow.com/comment/46024995
comment on: http://stackoverflow.com/q/28879278
has text: I get `Unable to connect to any application instances.` when opening your plunkr
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28762038
has body: value = 2345; log_10 = parseInt(Math.log(value) / Math.log(10)); basePower = Math.pow(10, log_10); result = ((((value/basePower)).toFixed(0))* basePower); alert(result);
type: Answer
upvote count: 0
answers question: http://stackoverflow.com/q/28761020
score: -1
accepted answer of: http://stackoverflow.com/q/28761020
type: AcceptedAnswer
downvote count: 1

http://stackoverflow.com/comment/45989293
type: QuestionComment
has text: Check out http://stackoverflow.com/questions/5871040/how-to-dynamically-set-a-function-object-name-in-javascript-as-it-is-displayed-i
score: 1
comment on: http://stackoverflow.com/q/28861941
type: Comment

http://stackoverflow.com/comment/45792495
score: 0
type: Comment
type: QuestionComment
has text: Yes. It can be done. How much programming experience do you have?
comment on: http://stackoverflow.com/q/28751471

http://stackoverflow.com/comment/45815631
type: Comment
has text: what is the output of `day` and `shifts` in the loop?
type: QuestionComment
comment on: http://stackoverflow.com/q/28768494
score: 0

http://stackoverflow.com/a/28970993
score: 2
upvote count: 2
has body: After a LOT more digging and thanks to the jsfiddle from Jey Dwork, I figured out where the issue is here. My CKEditor config file adds a couple of plugins that referenced lang files that were improperly named. For some reason, when these plugins were included together they caused the editor to not fully load during a second initialization. Removing the lang files and reference to them in the plugin definitions resolved the issue. It's too bad that there wasn't some error that was triggered around this. All's well that ends well though.
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28818099
answers question: http://stackoverflow.com/q/28818099
type: Answer

http://stackoverflow.com/a/28890208
type: Answer
accepted answer of: http://stackoverflow.com/q/28890150
answers question: http://stackoverflow.com/q/28890150
has body: https://jsfiddle.net/rqkt58L1/ You could just disable min-height during the animation, and then turn it back on when the animation is over: $(document).ready(function () { $(".toggle-display").click(function () { var minHeight = $("#selected-display").css('min-height'); $("#selected-display").css('min-height',0).slideToggle("slow", function() { $(this).css('min-height', minHeight); }); }); });
upvote count: 5
score: 5
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/45951261
has text: `var re = new RegExp(typedVal, "ig");`
score: 0
comment on: http://stackoverflow.com/q/28841045
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45806770
type: QuestionComment
comment on: http://stackoverflow.com/q/28763822
has text: and what about li elements?
score: 0
type: Comment

http://stackoverflow.com/a/28846233
has comment: http://stackoverflow.com/comment/45961806
type: Answer
downvote count: 0
score: 1
has body: You should try to be more general. For instance, de-DE-u-co-phonebk is also a valid language code (the stuff starting with -u... represents Unicode options for collation order etc.). I'm assuming you want to strip off everything starting from the country code, which by the standard is supposed to be uppercase. If you want to do this with a regexp, then function strip_country_code(lang) { return lang.replace(/[-_][A-Z][A-Z].*$/, ''); } Of course, this will fail on en-us, which is invalid; it should be en-US. You have to decide if and how to handle invalid language codes such as this. That's just one reason that you would be better off using available libraries to process language codes if possible. Take a look at the JS internationalization API, which has several ways to parse locale codes and find the "best" one. However, browser support is limited. So you might want to look for something off the shelf. But I can't put my finger on anything at the moment. The JED library uses the following regexp to extract segments: str.match(/[a-z]+/gi) but then assumes that the second segment if present is always the country, so this logic would fail on zh-hans-TW. You should also consider who is going to be consuming the result of your string manipulation. Are you saying that there is some library, or API, that can only handle the part of the locale string preceding the country code? You should ensure that that is in fact the case. For instance, I believe that moment.js also will handle different locale strings properly.
answers question: http://stackoverflow.com/q/28843263
upvote count: 1

http://stackoverflow.com/a/28761568
score: 1
answers question: http://stackoverflow.com/q/28750789
type: Answer
has comment: http://stackoverflow.com/comment/47945212
upvote count: 1
has body: The thing going on is that before the chart changes the selected state of that point, it will run your code therefore it brings you the previous selected state of the point. That's why the selected property is the opposite every time, that is why returning false cancels the operation because it has not yet been triggered. I don't know any workarounds in the API, but you could check the states and return the opposites to your liking: var state = (this.state == "hover")? "selected" : "hover"; var selected = (this.selected == true) ? "false" : "true"; $("#pointState").html("State: " + state + "&lt;br&gt;" + "Selected? " + selected); Here's the fiddle.
downvote count: 0

http://stackoverflow.com/q/28858427
upvote count: 1
has answer: http://stackoverflow.com/a/28860144
downvote count: 1
type: Question
tagged with: javascript
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/28860144
has body: I am trying to get the value of a textbox without pass through form actions (because i cannot neither redirect to another page or refresh the current one). index.php into head into body MyButton Button is before input just for UI stuffs script.php $prev = $_SESSION['prev']; $fname = $_POST['fname']; $lname = $_POST['lname']; [....do something....] echo 'You used '.$fname.' and '.$lname; Well.. the script.php doesnt receive the value of the inputs fname and lname.
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28860438
tagged with: http://stackoverflow.com/tag/html
tagged with: php
possible better answer: http://stackoverflow.com/a/28860438
has comment: http://stackoverflow.com/comment/45984185
type: AnsweredQuestion
has title: PHP/JS - pass values with AJAX

date
tags question: http://stackoverflow.com/q/28762869
tags question: http://stackoverflow.com/q/28829540
tags question: http://stackoverflow.com/q/28835781
tag name: date
tags question: http://stackoverflow.com/q/28868931
tags question: http://stackoverflow.com/q/28835396
tags question: http://stackoverflow.com/q/28811812
tags question: http://stackoverflow.com/q/28859363
tags question: http://stackoverflow.com/q/28870258
tags question: http://stackoverflow.com/q/28781497
tags question: http://stackoverflow.com/q/28889493
type: Tag
tags question: http://stackoverflow.com/q/28820043
tags question: http://stackoverflow.com/q/28851782
tags question: http://stackoverflow.com/q/28897455
tags question: http://stackoverflow.com/q/28903418
tags question: http://stackoverflow.com/q/28900390
tags question: http://stackoverflow.com/q/28754003

http://stackoverflow.com/a/28800437
answers question: http://stackoverflow.com/q/28798687
has comment: http://stackoverflow.com/comment/45874704
has body: This will check for an exact match of all arguments against the values in the input array. And then return an array stripped of those values. It does not use .filter() .slice() .call() or Object.keys() so it is fully compliant with ancient web-browser versions. &lt;script type="text/javascript"&gt; function result(input_array) { // Breakpoint if input is not an array... return the object inside an array for consistency of return type if( !(input_array instanceof Array) ) return [].push(input_array); // Gather list of arguments to reject. var reject_list = []; for(var i in arguments) if(i &gt; 0) reject_list.push(arguments[i]); // check each element in the input array if it is a value to reject. var output_array = [] for(var i = 0; i &lt; input_array.length; i++){ var value_is_ok = true for(var r = 0; r &lt; reject_list.length; r++){ if( input_array[i] == reject_list[r] ){ value_is_ok = false break }//endif }//endfor if( value_is_ok ) output_array.push(input_array[i]); }//endfor return output_array } var my_array = [1, 2, 3, 1, 2, 3] console.log( result(my_array, 2, 3) ) // result is [1,1] &lt;/script&gt;
type: Answer
score: 0

http://stackoverflow.com/comment/45932120
comment on: http://stackoverflow.com/q/28829420
has text: Where did you read that the same thing would happen ? You don't need to change the flow. Just don't create the objects every time, change their attributes.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28789494
has comment: http://stackoverflow.com/comment/45854557
has comment: http://stackoverflow.com/comment/45855127
type: Answer
accepted answer of: http://stackoverflow.com/q/28789409
downvote count: 0
has body: You are doing a post with Ajax and in the php you are using $_GET to read the variables. You should use $_POST instead of $_GET.
has comment: http://stackoverflow.com/comment/45854883
score: 1
answers question: http://stackoverflow.com/q/28789409
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45854637
has comment: http://stackoverflow.com/comment/45855181

http://stackoverflow.com/q/28870217
has title: Is using if/else if/else this way a good practice?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46004675
downvote count: 0
score: 1
type: Question
linked to: http://stackoverflow.com/q/2922948
answer count: 1
has body: I am working on an app we inherited from a previous vendor and many places in the client side javascript I see something like this: if (self.DESIGNEE_TYPE_SCREEN_ROUTE_REGEX.test(url)) { goToSelectDesigneeType.call(self); } else if (self.FUNCTION_CODES_SCREEN_ROUTE_REGEX.test(url)) { goToSelectFunctionCodes.call(self); } else if (self.DISCIPLINE_SCREEN_ROUTE_REGEX.test(url)) { goToSelectDiscipline.call(self); } else { goToSelectDesigneeType.call(self); } else ... This is used to to go to the next step in a workflow, and it works fine but something about it just does not sit right with me. Is this pretty common, or is there a better way to do the same thing?
tagged with: javascript
has comment: http://stackoverflow.com/comment/46004193
linked to: http://stackoverflow.com/q/10029089
upvote count: 1
has comment: http://stackoverflow.com/comment/46004594
has answer: http://stackoverflow.com/a/28870588
has comment: http://stackoverflow.com/comment/46004190
accepted answer: http://stackoverflow.com/a/28870588
favorite count: 0
has comment: http://stackoverflow.com/comment/46004207
has comment: http://stackoverflow.com/comment/46004259

http://stackoverflow.com/a/28891068
answers question: http://stackoverflow.com/q/28890816
score: -1
has comment: http://stackoverflow.com/comment/46068732
downvote count: 1
type: Answer
upvote count: 0
has body: You can't use .value for image tags. To get "src" attribute, use getAttribute() method: document.getElementById('ID').getAttribute("src")

http://stackoverflow.com/q/28867577
has comment: http://stackoverflow.com/comment/45999914
score: -2
has answer: http://stackoverflow.com/a/28867848
tagged with: javascript
downvote count: 2
answer count: 1
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has body: I want everyday, the color background and text (caption+title) to invert from black to white. I know it can be done with Java. Here is my Tumblr page: http://recherches.nicolaspauly.com
tagged with: css
upvote count: 0
has title: Change color attributes everyday on my Tumblr Theme
type: Question

http://stackoverflow.com/comment/46009693
comment on: http://stackoverflow.com/a/28814352
type: AnswerComment
type: Comment
has text: if I console.log(user) than i get in my console.. =test123@live.nl @Grimbode
score: 0

http://stackoverflow.com/q/28771355
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28771790
has answer: http://stackoverflow.com/a/28771431
tagged with: html-heading
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/28771431
has body: I have a header in my index file defined as follows: Title I manage to get it static always at the top while scrolling with: $(function() { console.log('Stick bar at top. . . '); // Stick the #nav to the top of the window var nav = $('#header'); var navHomeY = nav.offset().top; var isFixed = false; var $w = $(window); $w.scroll(function() { var scrollTop = $w.scrollTop(); var shouldBeFixed = scrollTop > navHomeY; if (shouldBeFixed && !isFixed) { nav.css({ position: 'fixed', top: 0, left: nav.offset().left, width: nav.width(), //z-index: 1; }); isFixed = true; } else if (!shouldBeFixed && isFixed) { nav.css({ position: 'static' }); isFixed = false; } }); }); The problem is that any views I load into the index.html file appear over the header. I need the header to be over all other elements. Is there a way to do this ? Or should I be reloading the header after I reload all the views ? Thanks, Filipe
tagged with: javascript
has title: Keeping Static Header Over All Other Elements
type: AnsweredQuestion
tagged with: jquery
has answer: http://stackoverflow.com/a/28771790
tagged with: backbone.js
type: Question

http://stackoverflow.com/a/28789905
type: Answer
has body: In TypeScript/ES6 arrow function, this refer to the instance of the class. So you may just use yourInstance.id to get the id.
score: 0
answers question: http://stackoverflow.com/q/28764814

http://stackoverflow.com/a/28894563
score: 0
has body: Use .toggleClass() Description: Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the state argument. $("#megamenu_button").togleClass(class, vaulue);
has comment: http://stackoverflow.com/comment/46049432
has comment: http://stackoverflow.com/comment/46049200
answers question: http://stackoverflow.com/q/28894507
type: Answer

http://stackoverflow.com/comment/45785725
type: Comment
has text: The problem is not handling multiple classes--it's that the target element won't have the same classes itself.
type: AnswerComment
comment on: http://stackoverflow.com/a/28751777
score: 0

http://stackoverflow.com/comment/46038043
type: Comment
has text: @user3351652: see edit for a version producing the result in an array.
comment on: http://stackoverflow.com/a/28887873
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45985135
score: 0
type: Comment
has text: Yeah I realised, I posted it below
comment on: http://stackoverflow.com/a/28839185
type: AnswerComment

http://stackoverflow.com/comment/46029709
has text: Is the ternary operator better for execution time/resources? (Real question.) Anyway I agree it would have been more readable here, thanks.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28884218

http://stackoverflow.com/comment/46024830
type: Comment
type: QuestionComment
has text: @somethinghere You could be right about what you are saying however it's not exactly helpful to the problem in hand. If you can offer an example of how to achieve this in a better and simpler way (the overall picture) I'm more than happy to look at it!
comment on: http://stackoverflow.com/q/28881317
score: 0

http://stackoverflow.com/a/28800633
answers question: http://stackoverflow.com/q/28796459
upvote count: 3
type: AcceptedAnswer
has body: So I just figured out that the problem is in the namespace option in the gruntfile. Removing the namespace, which results in the default namespace 'JST' and then inspecting the JST object in the console gave the first hint: Object {assets/src/templates/test.hbs: function} So the correct way to call the template would then be: var testTemplate = JST['assets/src/templates/test.hbs']; So with a namespace the gruntfile would read: module.exports = function(grunt) { 'use strict'; grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), handlebars: { compile: { options: { namespace: 'tpl', }, files: { "assets/build/templates/alltemplates.js": "assets/src/templates/*.hbs" } } }, (etc.) And the way to call the template: var testTemplate = tpl['assets/src/templates/test.hbs'];
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28796459
score: 3

http://stackoverflow.com/comment/46062732
type: QuestionComment
type: Comment
has text: your while loop keeps overwritting the data... do var_dump($numtoken) you will see... I think you'd want to remove the quotes from that $a inside the brakets
comment on: http://stackoverflow.com/q/28901129
score: 0

http://stackoverflow.com/comment/45897659
type: Comment
has text: You could remove spaces from option values ("==" instead of "= ="). Then you can take the value of the resuted filed. Split it by spaces ( var values = $("#input").val().split(" ") ) and you would get an array of values for your inputs. Then you just need set these values to your fileds. Example: $("#rules").val(values[0])
score: 1
comment on: http://stackoverflow.com/a/28812589
type: AnswerComment

http://stackoverflow.com/a/28858538
has comment: http://stackoverflow.com/comment/45982987
upvote count: 2
has comment: http://stackoverflow.com/comment/45983767
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/45983838
has body: Please see if this fiddle does what you want. The basic idea is to create an empty list at the start, then loop through the original list. For each item in the original list, see if a matching item is already in your new list. If so, increment the nbrItem property. Otherwise, create a new object. The guts of the linked fiddle are shown below: var len = list01.length; var list02 = []; for (var i = 0; i &lt; len; i++) { var foundMatch = false; var len2 = list02.length; for (var j = 0; j &lt; len2; j++) { if (list02[j].date == list01[i].date &amp;&amp; list02[j].name == list01[i].name) { foundMatch = true; list02[j].nbrItem++; break; } } if (!foundMatch) { list02.push( { date: list01[i].date, name: list01[i].name, nbrItem: 1 }); } } Array.prototype.map turned out not to be a good fit in this case because you want an output with different lengths than the input. The method shown here just uses plain old for loops, which work in all browsers, even the really old ones that don't have map.
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28858433
has comment: http://stackoverflow.com/comment/45983192
accepted answer of: http://stackoverflow.com/q/28858433

http://stackoverflow.com/q/28880750
has comment: http://stackoverflow.com/comment/46023506
tagged with: php
tagged with: cookies
tagged with: http
type: Question
has comment: http://stackoverflow.com/comment/46023137
has body: A website, let's call it customerwebsite.com, loads a script from our domain. Let's call our domain trackingwebsite.com. This script calls a web service on the server (written in PHP) that logs some things and then sets a cookie to identify the user later. The Set-Cookie header gets returned correctly. So far so good. However, on the next request that the script makes to the web service, the cookie is not sent back. I'm setting the cookie with an expire time of 10 years, with the domain set to .customerwebsite.com (I've also tried this with .trackingwebsite.com to be sure) After some googling and reading through various vague answers I think I've distilled that this set-up is not possible. Am I correct in assuming that the web service cannot set cookies, and that the script calling the web service has to take care of getting and setting cookies and sending this to the web service if required?
tagged with: javascript
score: 0
has title: Setting cookies in external domains in a web service
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/a/28813530
type: Answer
has body: That function doesn't return anything. It is in fact running the function successfully. But because you don't have a return statement the return value will be undefined. To change that put a return statement in your function.
score: 0
answers question: http://stackoverflow.com/q/28813490

http://stackoverflow.com/comment/46064102
score: 1
has text: can you put this in a fiddle.
type: Comment
comment on: http://stackoverflow.com/q/28902344
type: QuestionComment

http://stackoverflow.com/q/28886832
favorite count: 0
has title: Underscore, find and change value in object
downvote count: 1
has body: I am trying to find and replace a value in a function in an object My object looks like this : var testStates = [{ "module": "module1", "customUrl": [ { "mod1": "2" }, { "mod2": "1" } ] }, { "module": "module2", "customUrl": [ { "mod3": "false" }, { "mod4": "5" } ] } ]; And my function is like this : myFunction = function(mod, name, replace){ //replace item in testStates } And basically what i'm trying to do is use those vars to search inside where mod is a "module" value, name is a "mod"'s key (like mod1 or mod2 in the exampels), and replace is the value to replace on that selected mod. So if i said myfunction(module1, mod1, 5); I would then want the object to look like var testStates = [{ "module": "module1", "customUrl": [ { "mod1": "5" }, ////Changed { "mod2": "1" } ] }, { "module": "module2", "customUrl": [ { "mod3": "false" }, { "mod4": "5" } ] } ]; Kind of like a find and replace on an object. I'm not sure how to tackle this with underscore, would love some help! Thanks for reading!
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28887603
accepted answer: http://stackoverflow.com/a/28887603
tagged with: underscore.js
score: 1
has answer: http://stackoverflow.com/a/28887621
type: Question
upvote count: 2
answer count: 2
possible better answer: http://stackoverflow.com/a/28887621
tagged with: javascript

http://stackoverflow.com/a/28813916
score: 1
has body: Well Both are same when coming to the pushing part but there is a big difference between both as you are pushing a observable in Case-1 were as in other case you trying to assign a value to name . Performance perspective i don't think it makes a difference . Case-1 is readable and maintainable . View : Type 1: Not a observable (Two way binding doesn't exist) &lt;div data-bind="foreach:tags1"&gt; &lt;input type="text" data-bind="value:name" /&gt; &lt;/div&gt; Type 2: Observable ( Two way binding ) &lt;div data-bind="foreach:tags2"&gt; &lt;input type="text" data-bind="value:name" /&gt; &lt;/div&gt; ViewModel: var vm = function(){ var self=this; self.tags1=ko.observableArray(); self.newTagName=ko.observable('Hi there'); self.tags1.push({name: self.newTagName()}); //you just pushing plane text var Tag = function (data) { this.name = ko.observable(data.name); } self.tags2=ko.observableArray(); self.tags2.push(new Tag({name: self.newTagName()})); } ko.applyBindings(new vm()); Working fiddle here Quick fix to make first case to work do something like this self.tags1.push({name: ko.observable(self.newTagName())})
upvote count: 1
has comment: http://stackoverflow.com/comment/45899740
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28812429
type: Answer
has comment: http://stackoverflow.com/comment/45900302
answers question: http://stackoverflow.com/q/28812429
downvote count: 0

http://stackoverflow.com/q/28763840
has body: I have an AngularJS form which looks like this: .. fields Add .. more fields When I click submit it works as expected - update() method is called. When I click the button it calls addCluster() but after that the form gets submitted and update() is called automatically. Why does it do It and how can I prevent this?
has title: Angular js form submits when it shouldn't
tagged with: javascript
answer count: 2
tagged with: ng-submit
possible better answer: http://stackoverflow.com/a/28763921
downvote count: 0
has answer: http://stackoverflow.com/a/28763921
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/28763868
type: AnsweredQuestion
tagged with: angularjs-ng-click
score: 1
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/28763868

http://stackoverflow.com/comment/46024775
type: AnswerComment
has text: Thanks Paul, it is very appreciated. This is my first time using AJAX so trying to get used to it. Seems I miss the obvious from time to time!
comment on: http://stackoverflow.com/a/28881667
type: Comment
score: 0

http://stackoverflow.com/a/28762876
type: Answer
upvote count: 1
score: 1
has body: If you dont want to change anything in your markup, you could simply axtract the values with document.querySelector : function callFunc() { func1(parseInt(document.querySelector('[y="Y"]').value), parseInt(document.querySelector('[x="X"]').value)); } call callFunc() instead : Try it demo -> http://jsfiddle.net/s2z13q14/
answers question: http://stackoverflow.com/q/28762562
downvote count: 0

http://stackoverflow.com/comment/46079096
comment on: http://stackoverflow.com/a/28904262
type: AnswerComment
score: 1
type: Comment
has text: finally got it. I didn't link my jquery library first in my header tag. Apparently it has to be the first linked file. once again i appreciate all your help!

http://stackoverflow.com/comment/46011696
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/28846952
has text: All being well, I'll update this thread once it's fixed.

http://stackoverflow.com/q/28768912
has answer: http://stackoverflow.com/a/28769142
accepted answer: http://stackoverflow.com/a/28769142
score: 2
downvote count: 0
has answer: http://stackoverflow.com/a/28769312
tagged with: spiral
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/13894715
tagged with: javascript
type: Question
upvote count: 2
answer count: 2
possible better answer: http://stackoverflow.com/a/28769312
tagged with: jquery
has body: I am trying to draw a spiral from divs using jquery. I have done a regular spiral so far and seems to work fine for me. However the next step is that I need this to have big distance between divs when it starts and smaller one as it goes. I know that I should add an extra variable that will do this but I do not know how to implement this. Here is my code so far var radius = 50; var x0 = 300; var y0 = 300; var segment = 50; var angle = 0; for (var i=0; i&lt;=segment; i++){ angle = angle + (Math.PI * 2) / 30; var x=x0+radius*Math.sin(angle); var y=y0+radius*Math.cos(angle); $("#terrain").append("&lt;div class='drag' style='top:"+ y +"px;left:"+ x +"px;'&gt;&lt;/div&gt;") radius = radius + 5; } jsfiddle
favorite count: 0
has title: drawing spiral using jquery - spot distance

http://stackoverflow.com/comment/46024892
score: 0
type: AnswerComment
type: Comment
has text: Thanks. The speed is instant when creating the form. But I am an insecure perfectionist and never really know if I'm doing the right thing. There are so many pros/cons. HTML form is easy to follow, but harder to maintain (let's say I wanted to add a new class to all labels). JS is harder to follow but easy to maintain (just add the class attr to the label generator)
comment on: http://stackoverflow.com/a/28881360

http://stackoverflow.com/comment/45889498
type: QuestionComment
has text: Thanks but I want to use a very specific version of a specific date picker for my application.
comment on: http://stackoverflow.com/q/28808502
score: 0
type: Comment

http://stackoverflow.com/q/28820768
has comment: http://stackoverflow.com/comment/45913474
tagged with: javascript
has comment: http://stackoverflow.com/comment/45915262
answer count: 2
has answer: http://stackoverflow.com/a/28820869
has answer: http://stackoverflow.com/a/28820947
has comment: http://stackoverflow.com/comment/45913538
downvote count: 0
has comment: http://stackoverflow.com/comment/45913589
favorite count: 0
possible better answer: http://stackoverflow.com/a/28820869
has comment: http://stackoverflow.com/comment/45913445
has comment: http://stackoverflow.com/comment/45913514
has title: regex101 Conditional statement is always else
has comment: http://stackoverflow.com/comment/45913486
tagged with: regex
has comment: http://stackoverflow.com/comment/45913522
accepted answer: http://stackoverflow.com/a/28820947
type: AnsweredQuestion
has body: I am using http://www.regexr.com/ and https://regex101.com/ to learn regex regex101's Quick reference shows Conditional statement: (?(...)|) If the given pattern matches, matches the pattern before the vertical bar. Otherwise, matches the pattern after the vertical bar. I can't get it to work at all /(^(?!no)if|else)/gm no if else yes if else looks like its broken /(?:(yes)true|false)/g yes true false I need to return a single match using string.match so I stay compatible with a third party. I don't have the option to do anything with the results myself so I won't be able to do multiple regex nor filter results with javascript. what I would like to achive is a regex that asks for if the sentence starts with the word 'name' or the sentence contains '.classX' then return nothing else return '.classA' returning eather [""] or [".classA "] Is this possible at all or am I completly waisting my time?
upvote count: 3
type: Question
has comment: http://stackoverflow.com/comment/45913426
score: 3

http://stackoverflow.com/comment/45927006
comment on: http://stackoverflow.com/a/28827550
score: 0
type: Comment
has text: How can i know if it is relative to the input box or some other element?
type: AnswerComment

http://stackoverflow.com/q/28773083
tagged with: angularjs
type: Question
type: AnsweredQuestion
has body: I am trying to set up a calendar of events using Angular in Wordpress. Files are all connecting correctly, I am just not sure how to set up the template so that I have two views one showing data under a Saturday heading, while the rest is under Sunday. Here is what I am looking to recreate (this is the same site, using an older setup): http://events.latimes.com/festivalofbooks/the-festival/schedule/ My Angular template works for all the fields, I just dont know how to have that large Saturday show just once with all its related events underneath, followed by another set for Sunday. i tried to create a fiddle but it would not work, I am sorry but I just dont have time to troubleshoot it: http://jsfiddle.net/roob/vxfbmsr8/2/ The controller in the fiddle is written so it reads everything right there, alas to no avail. Below are are my actual code, much abbreviated. Sorry if this is lengthy, just want to be clear about the logic, which is why I included a few of the options filter. The choice of table tags are not mine so please ignore. template/view: Event Directory search: ALL VENUES LA Times Stage Cooking Stage Hoy Stage BOTH DAYS Saturday Sunday ALL TIMES 10 a.m. - 11 a.m. 11 a.m. - Noon <h2 id="saturdayWrap" style="background-color:#FFFFFF; text-transform:uppercase;" ng-repeat="item in artists | filter:{value='Saturday'}" {{item.day}} {{item.stage}} Presented by Natural History Museum of Los Angeles {{item.time}} {{item.day}}, {{item.date}}, 2015 {{item.first_name}} {{item.last_name}}, Author of " {{item.work_title}}" {{item.stage}} controller: var myApp = angular.module('myApp', []); myApp.controller('fobSchContr', ['$scope', '$http', function($scope, $http) { $http.get('wp-content/themes/2015-Festival-of-Books/angular/js/data.json').success(function(data) { $scope.artists = data; //$scope.artistOrder = 'first_name'; $scope.artistStage = '!!'; $scope.artistDay = '!!'; $scope.artistTime = '!!'; }); }]);
has answer: http://stackoverflow.com/a/28773555
accepted answer: http://stackoverflow.com/a/28773555
answer count: 1
tagged with: javascript
score: 0
has title: Multiple templates in Angular

http://stackoverflow.com/a/28793868
answers question: http://stackoverflow.com/q/28793696
type: AcceptedAnswer
has body: UPDATE: this function will now get you all the checkbox elements inside of your form and if you want to access their values you can just use the line from console.log() function Archive(){ var inputs = [document.getElementsByTagName("input")]; var obj = inputs[0]; for(var i= 0; i &lt; obj.length; i++){ if(obj[i].type == "checkbox"){ console.log(obj[i].value); } } }
has comment: http://stackoverflow.com/comment/45867944
type: Answer
has comment: http://stackoverflow.com/comment/45867778
has comment: http://stackoverflow.com/comment/45868008
has comment: http://stackoverflow.com/comment/45868443
score: 0
accepted answer of: http://stackoverflow.com/q/28793696

http://stackoverflow.com/a/28814142
type: Answer
has body: Its a very simple piece of Javascript document.querySelectorAll('*') Try it out in the console log and it will show you all the tags in the document. Another example is to getElementsByTagName These do print out into an array, so you can then loop through the elements and doing different things on different elements. Example: var items = document.getElementsByTagName("*"); for (var i = 0; i &lt; items.length; i++) { //do stuff }
answers question: http://stackoverflow.com/q/28813785
has comment: http://stackoverflow.com/comment/45901360
score: 0

http://stackoverflow.com/a/28774158
score: 2
upvote count: 2
has body: As @SLaks pointed out, this is might be pointless, however here’s an answer to your question. Browsers do not have a uncompress method that is accessible from JavaScript, so there’s no equivalent. When you want to decompress gzipped data in JavaScript, you will need to use a JavaScript implementation of the gzip algorithm. There’s zlib.js which seems to be capable of doing this.
has comment: http://stackoverflow.com/comment/45828609
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28773908
type: Answer
answers question: http://stackoverflow.com/q/28773908

http://stackoverflow.com/comment/45822932
type: Comment
has text: It still doesn't work :(
type: AnswerComment
comment on: http://stackoverflow.com/a/28771959
score: 0

http://stackoverflow.com/q/28771967
has title: Print from JavaScript function to HTML without document.write()
answer count: 3
accepted answer: http://stackoverflow.com/a/28772293
has answer: http://stackoverflow.com/a/28772023
has body: I searched everywhere on here on an alternative on printing to HTML from a JavaScript function to HTML without using document.write() but document.getElementById() doesn't seem to work and I'm really not sure how to go about doing this. I have this so far JavaScript function trials() { while (num_trials > 0) { for (var i = 0; i < random.length; i++) { document.write(random[i]); } } } Where "random" is an array of letters HTML **TRIALS HERE** I'm also looking for a way to hide each letter after each iteration of the for-loop so that it doesn't just print as a long string of letters.
has comment: http://stackoverflow.com/comment/45822522
has comment: http://stackoverflow.com/comment/45823210
has comment: http://stackoverflow.com/comment/45822643
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45822510
has answer: http://stackoverflow.com/a/28772293
type: Question
has comment: http://stackoverflow.com/comment/45822758
possible better answer: http://stackoverflow.com/a/28772315
has answer: http://stackoverflow.com/a/28772315
tagged with: javascript
tagged with: document.write
score: 0

http://stackoverflow.com/comment/45954342
type: Comment
comment on: http://stackoverflow.com/a/28842412
score: 1
has text: It very well may be as simple as how each renders a font. I've noticed major and subtle differences in browsers rendering different fonts. This could be minor differences in letter spacing, weight, etc. which could be a factor.
type: AnswerComment

http://stackoverflow.com/a/28753004
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28752690
has comment: http://stackoverflow.com/comment/45789769
type: Answer
has comment: http://stackoverflow.com/comment/45789476
has comment: http://stackoverflow.com/comment/45789813
upvote count: 5
downvote count: 0
has comment: http://stackoverflow.com/comment/45789332
accepted answer of: http://stackoverflow.com/q/28752690
has comment: http://stackoverflow.com/comment/45789577
has body: You can use CustomValidator: &lt;asp:CustomValidator ID="CustomValidator1" runat="server" EnableClientScript="true" ForeColor="Red" ErrorMessage="Error: max users must be between 100 and 1,000 users per batch" ClientValidationFunction="validateRange" ControlToValidate="maxNumUsersTextBox"&gt;&lt;/asp:CustomValidator&gt; Then, validate the range with Javascript: function validateRange(sender, args){ var cant = document.getElementById("maxNumUsersTextBox"); if(cant&gt;=100 &amp;&amp; cant&lt;=1000){ args.IsValid = true; }else{ closeLoading(); args.IsValid = false; } }
score: 5

http://stackoverflow.com/comment/45911580
score: 1
has text: If `newObj` has one more key, then you cannot predict which one of them `Object.keys(newObj)[0]` will return ([more information here](http://stackoverflow.com/questions/5525795/does-javascript-guarantee-object-property-order)). If the objects in `myArr` have more than one key, then the first one with a matching key will be updated. If you want to update all of the objects with matching keys, you could use [`where`](http://underscorejs.org/#where) (or just [`each`](http://underscorejs.org/#each)) instead.
comment on: http://stackoverflow.com/a/28819730
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45875819
score: 0
type: Comment
has text: Bergi, it's server side javascript. Bill had to clear it up though. But great you found out for yourself.
comment on: http://stackoverflow.com/a/28800979
type: AnswerComment

http://stackoverflow.com/q/28816061
has comment: http://stackoverflow.com/comment/45911562
type: Question
has body: I have a feature that allows the user to search the database for an item that matches the string they type in. For example, if they type in "Superman" it'll return whatever is in the database that is associated with Superman. Next to each item in the resulting list is a checkbox. If the user selects a checkbox, they can then press the "delete" button to remove that item from their list. I want to be able to select all of the checkboxes by pressing a "select all" button. Sometimes the lists are really long and if the user wants to delete all of the items, it would be time consuming to select and delete each one individually. The checkbox is an asp:checkbox inside of an asp:TemplateField. The asp:TemplateField is inside an asp:GridView. Here is the checkbox code: <asp:TemplateField HeaderText="Select"> <asp:CheckBox ID="uxSelectAdd" runat="server" /> For the "select all" button, I'm using a regular input type: Here are the contents of the js file I'm using in my resources folder(I'm using the alert function for debugging. For some reason, the alert pops up when the page loads, rather than when I click on the button. Clicking the button doesn't do anything): $(document).ready(function () { $('#uxSelectAll').click(function (e) { $(searchCheckBoxSelector).prop('checked', true); alert("helloooo"); }); }); This is the js that is included in the front-end code at the top inside of a script tag: I know that .live is no good since it's been removed in the version of javascript that we're now using, so I tried changing .live to .click instead. That didn't work. I also tried adding this js to the front-end instead of what was already there, just to experiment and see if this works: For some reason, that didn't work either. Am I missing something obvious? I wanted to at least get an alert to work before I tried adding in code to check all of the checkboxes for me but not even the alert works. I'd appreciate any help or nudges in the right direction. Here are the .js files I'm us…
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45903820
score: 0
tagged with: binding
accepted answer: http://stackoverflow.com/a/28881988
has title: Using JavaScript or JQuery to automatically check asp:checkbox when a button is pressed
answer count: 1
has comment: http://stackoverflow.com/comment/45904219
has comment: http://stackoverflow.com/comment/45904905
has answer: http://stackoverflow.com/a/28881988
tagged with: checkbox
has comment: http://stackoverflow.com/comment/45907394
type: AnsweredQuestion
tagged with: event-delegation

http://stackoverflow.com/comment/45919487
type: QuestionComment
score: 0
has text: My intention is to store user-defined CSS as a string in a database, and subsequently wrap that CSS string in ` ` tags on another site. I'm not looking to use the bulk of the Caja library; only the HTML/CSS sanitizer. Here is a jsfiddle that shows the sanitizer in action on a simple client application; I want to perform the same sort of sanitization in my Java API. http://jsfiddle.net/sscovil/e4pzdLuf/
comment on: http://stackoverflow.com/q/28771789
type: Comment

http://stackoverflow.com/a/35391015
has body: for constant order the tooltips Highcharts.wrap(Highcharts.Tooltip.prototype, 'refresh', function (proceed) { var args = arguments, points = args[1], point = points[0], chart = point.series.chart; // Loop over all the series of the chart Highcharts.each(chart.series, function (series) { // This one already exist if (series == point.series || series.visible == false) return; var current, dist, distance = Number.MAX_VALUE; // Loop over all the points Highcharts.each(series.points, function (p) { // use the distance in X to determine the closest point dist = Math.abs(p.x - point.x); if (dist &lt; distance) { distance = dist; current = p; return; } }); // Add the closest point to the array if (points.indexOf(current) == -1) points.push(current); }); // for not changing the tooltip series order var tt = [].slice.call(args, 1); tt[0].sort(function (a, b) { if (a.color &lt; b.color) return -1; if (a.color &gt; b.color) return 1; return 0; }); proceed.apply(this, tt); });
type: Answer
answers question: http://stackoverflow.com/q/28848146
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/comment/45917824
has text: You mean so it adds items to the content area as you click the buttons? I'm not sure how you could press 2 buttons at the same time on a webpage.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28822300
score: 1

http://stackoverflow.com/q/28777719
tagged with: tofixed
score: 0
has comment: http://stackoverflow.com/comment/45833434
tagged with: http://stackoverflow.com/tag/html
answer count: 1
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28777785
has title: Looking for help adding a .toFixed to jquery.
has body: Hey everyone looking for a bit of help adding a .toFixed to a variable in jquery. &lt; script type = "text/javascript" &gt; $(document).ready(function() { var a = $("#address").text(); $.get("http://99.236.215.227:7379/hget/Pool_Stats:CurrentShift:WorkerBTC/" + a + ".txt", function(b) { $(".payout").text(b) }); $.get("http://99.236.215.227:7379/hget/Pool_Stats:CurrentShift:WorkerNEOSCoin/" + a + ".txt", function(b) { $(".payout2").text(b) }); $.get("http://99.236.215.227:7379/hget/Pool_Stats:CurrentShift:WorkerFUELCoin/" + a + ".txt", function(b) { $(".payout3").text(b) }) }); $(function() { var a = $("#address").text(); $.get("http://99.236.215.227:7379/ZSCORE/Pool_Stats:Balances/" + a, function(b) { $(".owed").append(b.ZSCORE) }) }); &lt; /script&gt;
type: Question
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/28852363
has body: You can pass data through QueryString as shown :- @Html.ActionLink("Home","Index","Main",new{ @onclick="OnIndexCall(this)" }); function OnIndexCall(elem){ var a=10; var b=a+20; $(elem).attr('href', $(elem).attr('href') + '?a=' + a + '&amp;b=' + b); } Fiddle
upvote count: 5
score: 5
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28852193
type: Answer
accepted answer of: http://stackoverflow.com/q/28852193

http://stackoverflow.com/comment/48261716
has text: @JoséToy did anyone seem to resolve this in the end I am having the exact same issue
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28895424
type: AnswerComment

http://stackoverflow.com/comment/45832450
comment on: http://stackoverflow.com/a/28777167
score: 0
type: Comment
has text: @Nope Foo.prototype is itself an object and b and c only reference Foo.prototype. When you look for a property it looks in the object itself first and then goes up the prototype chain and sees that it exists in Foo.prototype
type: AnswerComment

http://stackoverflow.com/comment/45996312
type: AnswerComment
has text: I used your code, changing the second line also to console.log(model.get("first")); Which resulted in undefined. The first console.log shows the populated model that console.log(daryl) would have shown previously. Thanks for the quick fetch lesson though. Much appreciated!!!
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28865539

http://stackoverflow.com/comment/45941564
comment on: http://stackoverflow.com/a/28835802
has text: still getting undefined this way
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28828967
score: 19
answers question: http://stackoverflow.com/q/28828922
has comment: http://stackoverflow.com/comment/76436210
has comment: http://stackoverflow.com/comment/81179067
downvote count: 1
accepted answer of: http://stackoverflow.com/q/28828922
has comment: http://stackoverflow.com/comment/124355870
upvote count: 20
type: AcceptedAnswer
type: Answer
has body: There's no console.debug() method in NodeJS. Here is the documentation for the console object, so you can choose the best method for you to use.

remote-debugging
tag name: remote-debugging
tags question: http://stackoverflow.com/q/28903739
type: Tag

http://stackoverflow.com/comment/46059296
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28899982
has text: Can you copy the output that you see in the console?
score: 3

http://stackoverflow.com/comment/45845559
has text: You can increase time argument in the `slideDown` call. Check the link to the function API in the answer edit..
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28784689
score: 0

http://stackoverflow.com/a/28760637
has comment: http://stackoverflow.com/comment/45801455
score: 1
answers question: http://stackoverflow.com/q/28760456
downvote count: 0
has comment: http://stackoverflow.com/comment/45801697
type: Answer
upvote count: 1
has body: Use console.log($("#email").val()); for seeing what value the email field have. What kind of formfield is #email? If there is a value in #email try $.ajax({ url: "login.php", type: "POST", data: { email : $("#email").val() } });

http://stackoverflow.com/comment/45922148
comment on: http://stackoverflow.com/q/28817347
type: Comment
score: 1
type: QuestionComment
has text: You can use WebSQL on desktop browser. The interface(API) is the same whether you use it in cordova or desktop browser. The underlying database used can be SQLite, but it depends on the browser. Check this [link](http://caniuse.com/#feat=sql-storage) for WebSQL support among desktop browsers.

http://stackoverflow.com/comment/45875334
score: 0
type: Comment
has text: Yes, by "point" I'm referring to a circle, which usually only appears when mousing over an area of the line. I wish to be able to have the circles visible selectively, without having to mouse over them. Also, it is possible to use straight D3 from within NVD3, so that shouldn't be a problem.
type: QuestionComment
comment on: http://stackoverflow.com/q/28772965

http://stackoverflow.com/q/28779399
tagged with: css
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28779592
has answer: http://stackoverflow.com/a/28779592
has title: Drop Down Menu Goes Away To Quick
has answer: http://stackoverflow.com/a/28779470
has body: When I go to a sub menu on my Parent Link when I try and go to the grand child link the menu goes away to quick and does not allow me some times to click on the grand child link. How can I make it so that can stay open until I click on a sub menu link or grand child link. Codepen Example Here: http://codepen.io/riwakawebsitedesigns/pen/PwaemX a.menu-link { float: right; display: block; padding: 1em; } .menu, .menu &gt; ul ul { clear: both; -webkit-transition: all 0.3s ease-out; -moz-transition: all 0.3s ease-out; -ms-transition: all 0.3s ease-out; -o-transition: all 0.3s ease-out; transition: all 0.3s ease-out; } .js .menu, .js .menu &gt; ul ul { overflow: hidden; max-height: 0; background: rgba(0,0,0,0.1); } .menu.active, .js .menu &gt; ul ul.active { max-height: 55em; } .menu &gt; ul { border-top: 1px solid #808080; } .menu li a { color: #000; display: block; padding: 0.8em; border-bottom: 1px solid #808080; position: relative; } .menu li.has-subnav &gt; a:after { content: '+'; position: absolute; top: 0; right: 0; display: block; font-size: 1.5em; padding: 0.25em 0.5em; } .menu li.has-subnav &gt; a.active:after { content: "-"; } /* Start Mobile */ @media screen and (min-width: 48.25em) { .pattern { overflow: visible; } a.menu-link { display: none; } .js .menu, .js .menu &gt; ul ul { max-height: none; overflow: visible; background: none; } .js .menu &gt; ul ul { background: #808080; display: none; } .js .menu &gt; ul li:hover &gt; ul { display: block; } .menu ul { margin: 0 0 0 -0.25em; border: 0; } .menu li a { border: 0; } .menu li.has-subnav &gt; a { padding-right: 2em; } .menu li.has-subnav &gt; a:after { content: "&gt;"; font-size: 1em; padding: 0.8em 0.5em; } .menu .level-1 &gt; li.has-subnav &gt; a:after { content: "▼"; } .menu &gt; ul li { margin: 0 0.25em; } .menu &gt; ul &gt; li { display: inline-block; position: relative; } .menu &gt; ul ul { position: absolute; top: 0; left: 12em; width: 12em; } .menu &gt; ul ul li { position: relative; } .menu &gt; ul…
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
score: 0
accepted answer: http://stackoverflow.com/a/28779470

http://stackoverflow.com/q/28784865
has comment: http://stackoverflow.com/comment/45847295
has title: how to communicate with desktop application from web page loaded over https
upvote count: 3
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/82845906
has comment: http://stackoverflow.com/comment/45846118
has comment: http://stackoverflow.com/comment/45846069
type: Question
has comment: http://stackoverflow.com/comment/45846600
has comment: http://stackoverflow.com/comment/45846482
score: 3
has comment: http://stackoverflow.com/comment/45846272
has body: I'm trying to make desktop application that receives messages from a page running in the browser. The desktop application can be written in any way, i just need to be able to talk to it from the browser. The web site is written in angular. I don't care about the response from the desktop application or need to communicate back to the browser in any way. Serving the website over https is causing issues though (but a requirement), and I was wondering what a good way around those would be. The ideal solution was to make the app a web server and just have the website post to localhost:PORT and the server would get the request and do what it needed to do. however, since the website is served over https, it blocks the http request to localhost due to mixed content rules. i tried submitting a form on the page and having the target be a hidden iframe, but that also gets blocked due to it not being https. I tried changing the target to be _blank, and that "worked" but it opens a new tab with the response in it, which would be really annoying while you're using the website (it's supposed to be in the background). I set up the response to have a window.close in it, but the window still flickers for a second each time and it's something i would like to avoid. I tried making a self signed certificate for the desktop application's server but the browser blocks that until you accept it for the first time, and I don't want people to have to go to "https://localhost:1234" in their browser and accept the insecure. I'm imagining getting a valid certificate for a localserver isn't possible too. Is there any to accomplish this? Thanks
tagged with: ssl
tagged with: ssl-certificate
has comment: http://stackoverflow.com/comment/45846584
linked to: http://stackoverflow.com/q/21397809
tagged with: browser
answer count: 1
downvote count: 0
tagged with: desktop-application
linked to: http://stackoverflow.com/q/6793174
tagged with: javascript
has comment: http://stackoverflow.com/comment/45846546
has comment: http://stackoverflow.com/comment/45845942
has comment: http://stackoverflow.com/comment/45848041
has comment: http://stackoverflow.com/comment/45846532
has comment: http://stackoverflow.com/comment/45846448
favorite count: 0
has answer: http://stackoverflow.com/a/28786127

http://stackoverflow.com/q/28788911
type: Question
has answer: http://stackoverflow.com/a/29055415
score: 1
answer count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/28789039
tagged with: javascript
favorite count: 0
has body: I have a script.js that I either use on client side html page. Either via nodejs. How can I get a function to fire only if the script is run via nodejs ?
has title: How to fire code only when script.js is ran via node.js?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45853445
tagged with: node.js
downvote count: 0

http://stackoverflow.com/comment/46032401
type: Comment
has text: So something like: "SELECT pageLocation FROM page WHERE comicID IN (1,2,3) " Also, I'd specifically just want the first page from each comicID, though not necessarily 'pageNum = 1' because that specific number may be deleted and 'page 2' is the first chronologically.
comment on: http://stackoverflow.com/a/28883337
type: AnswerComment
score: 0

http://stackoverflow.com/a/28892561
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46045812
type: Answer
has body: You are loosing context this inside setTimeout. You can use Function.prototype.bind to bind callback function to proper context: $.data(this, 'timer', setTimeout(function () { $(this).stop(true, true).animate({ width: "150%" }, 270, function () {}); }.bind(this), 400)); If you care about IE8 support, use $.proxy - simple bind implementation. $.data(this, 'timer', setTimeout($.proxy(function () { $(this).stop(true, true).animate({ width: "150%" }, 270, function () {}); }, this), 400));
accepted answer of: http://stackoverflow.com/q/28892531
score: 3
downvote count: 0
answers question: http://stackoverflow.com/q/28892531
upvote count: 3

http://stackoverflow.com/comment/45987142
comment on: http://stackoverflow.com/q/28860835
type: Comment
type: QuestionComment
has text: please fix your title to make it relevant to the problem so others having a similar issue in the future can find it. might save you a few DVs as well. You **do** want those with relevant expertise to be interested enough to read it, no?
score: 3

http://stackoverflow.com/comment/46070590
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28904415
has text: are you passing whole date object through url? it will pass as `[Object][Object]`
score: 0

http://stackoverflow.com/a/28777969
answers question: http://stackoverflow.com/q/28777956
accepted answer of: http://stackoverflow.com/q/28777956
has comment: http://stackoverflow.com/comment/45834038
type: AcceptedAnswer
downvote count: 0
has body: Your object needs to be an object, not a string: if (size.length &gt; 0) { datasets[cnt] = { value: size, color: color, highlight: hlight, label: label }; }
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/comment/46007768
score: 0
comment on: http://stackoverflow.com/a/28872093
type: Comment
has text: Thank you. I love the simplicity of the solutions.
type: AnswerComment

http://stackoverflow.com/q/28901517
score: 1
type: Question
tagged with: canvas
has body: Well i have this SVG canvas element, i've got to the point so far that once a user clicks and drags the canvas is moved about and off-screen elements become on screen etc.... However i have this is issue in which when ever the user then goes and click and drags again then the translate co-ords reset to 0, which makes the canvas jump back to 0,0. Here is the code that i've Got for those of you whio don't wanna use JS fiddle Here is the JSfiddle demo - https://jsfiddle.net/2cu2jvbp/2/ edit: Got the solution - here is a JSfiddle DEMO https://jsfiddle.net/hsqnzh5w/ Any and all sugesstion will really help. var states = '', stateOrigin; var root = document.getElementById("svgCanvas"); var viewport = root.getElementById("viewport"); var storeCo =[]; function setAttributes(element, attribute) { for(var n in attribute) //rool through all attributes that have been created. { element.setAttributeNS(null, n, attribute[n]); } } function setupEventHandlers() //self explanatory; { setAttributes(root, { "onmousedown": "mouseDown(evt)", //do function "onmouseup": "mouseUp(evt)", "onmousemove": "mouseMove(evt)", }); } setupEventHandlers(); function setTranslate(element, x,y,scale) { var m = "translate(" + x + "," + y+")"+ "scale"+"("+scale+")"; element.setAttribute("transform", m); } function getMousePoint(evt) { //this creates an SVG point object with the co-ords of where the mouse has been clicked. var points = root.createSVGPoint(); points.x = evt.clientX; points.Y = evt.clientY; return points; } function mouseDown(evt) { var value; if(evt.target == root || viewport) { states = "pan"; stateOrigin = getMousePoint(evt); console.log(value); } } function mouseMove(evt) { var pointsLive = getMousePoint(evt); if(states == "pan") { setTranslate(viewport,pointsLive.x - stateOrigin.x, pointsLive.Y - stateOrigin.Y, 1.0); //is this re-intializing every turn? storeCo[0] = pointsLive.x - stateOrigin.x storeCo[1] = pointsLive.Y - stateOrigin.Y; } else if(states == "store") { setTranslate(viewpo…
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28902560
has title: SVG Camera Pan - Translate keeps resetting to 0 evertime?
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
accepted answer: http://stackoverflow.com/a/28902560
upvote count: 1
tagged with: css
type: AnsweredQuestion

http://stackoverflow.com/a/28812053
has comment: http://stackoverflow.com/comment/45896351
type: Answer
has comment: http://stackoverflow.com/comment/98414697
upvote count: 29
score: 28
has body: What you are looking for is not the length of an array but the number values allocated in that array. Array.length will NOT give you that result but the total number of values allocated. A workarround is to count the properties of the object behind the array, with: Object.keys(a).length https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array#Relationship_between_length_and_numerical_properties But with some caveats: It will also count literal properties, like a.a_property. I do not think that is what you want. So, you will have to filter that result: !(+el % 1) which check if el can be considered as numerical property even if it has a type of string. you want count only positive integers, so you have to filter them with: +el&gt;=0 finally, as array size is limited to 2^32, you will to also filter positive integers greater than that: +el &lt; Math.pow(2,32) Functionally, you will have your result with this filter: Array.realLength= Object.keys(a).filter(function(el){return !(+el % 1) &amp;&amp; +el&gt;=0 &amp;&amp; +el &lt; Math.pow(2,32) ;}).length
has comment: http://stackoverflow.com/comment/45897929
downvote count: 1
has comment: http://stackoverflow.com/comment/45896612
answers question: http://stackoverflow.com/q/28811911
has comment: http://stackoverflow.com/comment/45901407
has comment: http://stackoverflow.com/comment/79962536
accepted answer of: http://stackoverflow.com/q/28811911
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45897555

http://stackoverflow.com/comment/45845614
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28777919
has text: If you noticed, he's not running this in a browser, so whether IE likes it or any other browser creates a DOM around it is immaterial. Nor is this really a jquery question. The OP is running this in cheerio.js in node.js, which is on the server side.

http://stackoverflow.com/comment/47493024
comment on: http://stackoverflow.com/a/28839613
type: AnswerComment
type: Comment
has text: "The express-session readme is assuming you have already implemented that." Why in the world would they *assume* that!? Then why not call it something like `write_your_uuid_func_here()` ? Anyway, if you don't have a specific reason to *need* the UUID format, this does uniqueness just fine: `require('crypto').randomBytes(48).toString('hex');` You can also install various `npm` packages to do UUIDs.
score: 10

http://stackoverflow.com/comment/46059214
score: 3
has text: you are missing the `=` in here: `ng-repeat"x in songs"`
comment on: http://stackoverflow.com/q/28899761
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28785636
accepted answer of: http://stackoverflow.com/q/28784720
has comment: http://stackoverflow.com/comment/45849308
has body: Underscores' _.delay function just wraps the original setTimeout. So you can collect all of the timeouts and then cancel them with clearTimeout: var cancels = _.map(array, function(element, index) { return _.delay(processElement, index * 1000, element); }); function cancel() { // you can also track the current element from processElement and cancel // only the timeouts that follow that one, but it might be an overkill. _.each(cancels, function(cancel) { clearTimeout(cancel); }); } Unfortunately with the current implementation I dont see a way to get the promise from processElement.
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/28784720

mustache
tags question: http://stackoverflow.com/q/28802932
tag name: mustache
type: Tag
tags question: http://stackoverflow.com/q/28866319
tags question: http://stackoverflow.com/q/28769383
tags question: http://stackoverflow.com/q/28814606

http://stackoverflow.com/q/28813572
type: Question
tagged with: javascript
has body: Hi I'm familiar with using onsubmit and onclick as I have used them before, but for some reason it refuses to work this time around. I've looked at my old code and tried everything to make it exactly the same yet it still will not run. function verifypass() { var password = "Testpass"; var string = document.getElementByID("verifybadge"); if(string!=password) { alert("Wrong password!"); window.location="about:blank"; } } Please Enter Password to Verify Closure of Ticket:
accepted answer: http://stackoverflow.com/a/28813602
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28813602
has title: Onclick element of Submit Button Not Calling JS Function
tagged with: http://stackoverflow.com/tag/html
tagged with: php
type: AnsweredQuestion
tagged with: onclick

http://stackoverflow.com/comment/45795342
has text: @coderasd - a common mistake with `.replace()` is that it does not modify the existing string (strings are immutable in Javascript), it returns a new string. People often forget this and they call `str.replace(...);` and expect `str` to change. Instead it has to be `result = str.replace(...);`.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28756976
type: Comment

http://stackoverflow.com/q/28853222
favorite count: 0
has body: Let's say I do the following: String.prototype.myFunc = function(){ /* code here */ } I have just created a new method, myFunc, that will be available for each string ("This is a test".myFunc()). My question is: Is it possible, and if it is, how, to get the source code of myFunc programatically? (This is inside Node)
tagged with: node.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28853281
accepted answer: http://stackoverflow.com/a/28853281
score: 1
type: Question
has title: Get source code of a functions prototype
tagged with: javascript
upvote count: 1
downvote count: 0
answer count: 1

http://stackoverflow.com/a/30540868
has body: I solved this problem so: you need to change file clips.js remove array from item variable, and assign this: var items= this.opts.clips; now you can to set options for clips like this: $(function() { $('#redactor').redactor({ plugins: ['clips'], clips:[['Your data...' , 'Your data is wonderful'], ['Another...','Another data is bad']] }); }); and so on. if you using JSON it will be like this: $settings['plugins'][]='clips'; $settings['clips'][]=array('Your data...', 'Your data is wonderful'); $settings['clips'][]=array('Another...', 'Another data is bad'); $settings= Json_encode($settings);
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28874810
has comment: http://stackoverflow.com/comment/50440591

http://stackoverflow.com/q/28753346
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45788673
has comment: http://stackoverflow.com/comment/45788695
has answer: http://stackoverflow.com/a/28753596
type: AnsweredQuestion
has body: I have an object literal var object = { test: "test"; } I call JSON.stringify on this object and append it to a query string http://example.com?parameter={"test":"test"} But when I append this query string into the mailto body, only this part http://example.com?parameter= got wrapped as an hyperlink while the rest is showed as plain text. what I did was this: window.location = "mailto:someone@example.com?subject=subject&amp;body=http://example.com?parameter={"test":"test"}"; And when the email client view showed, only the part before '=' got wrapped as hyperlink.
score: 1
has comment: http://stackoverflow.com/comment/45788793
has comment: http://stackoverflow.com/comment/45789029
has comment: http://stackoverflow.com/comment/45788877
type: Question
linked to: http://stackoverflow.com/q/1856785
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28753633
has title: Why mailto body does not recognize object literal as part of the url?
answer count: 2
has comment: http://stackoverflow.com/comment/45789032
upvote count: 1
downvote count: 0
tagged with: jquery
possible better answer: http://stackoverflow.com/a/28753596
favorite count: 0
has answer: http://stackoverflow.com/a/28753633

http://stackoverflow.com/a/28879359
has body: As an alternate solution: You can just make use of this logic: Calculate the number of alphabets and number of alphabets with + on either side. If they're both equal, return true else false function SimpleSymbols(str) { return str.match(/[a-z]/gi).length == str.match(/\+[a-z]\+/g).length }
has comment: http://stackoverflow.com/comment/46103941
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28879269
score: 1
has comment: http://stackoverflow.com/comment/46020708
downvote count: 0
has comment: http://stackoverflow.com/comment/46103742

http://stackoverflow.com/comment/45790622
score: 0
comment on: http://stackoverflow.com/a/28754398
type: Comment
type: AnswerComment
has text: you're going to have to look at the HTML that rails renders and then write the javascript.... rails won't help you here my friend. Just look at the html it puts out and write the javascript for it.

http://stackoverflow.com/comment/45881773
comment on: http://stackoverflow.com/q/28781146
type: Comment
type: QuestionComment
has text: Thanks - i will try take a look at it, and return!
score: 0

http://stackoverflow.com/comment/46060294
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28900422
has text: HI Wolf, would you mind putting that in an answer and I will accept that? that works great!

click
tags question: http://stackoverflow.com/q/28758520
tags question: http://stackoverflow.com/q/28902609
tags question: http://stackoverflow.com/q/28787970
tags question: http://stackoverflow.com/q/28787123
type: Tag
tags question: http://stackoverflow.com/q/28893110
tags question: http://stackoverflow.com/q/28901149
tags question: http://stackoverflow.com/q/28899286
tags question: http://stackoverflow.com/q/28848002
tags question: http://stackoverflow.com/q/28886198
tags question: http://stackoverflow.com/q/28848474
tag name: click
tags question: http://stackoverflow.com/q/28759531
tags question: http://stackoverflow.com/q/28855443
tags question: http://stackoverflow.com/q/28881540
tags question: http://stackoverflow.com/q/28775317

http://stackoverflow.com/a/28884228
type: Answer
has body: Try this (wrap data in curly braces): data_array.push( {"2011":{"name":"Team Leaders","total":93,"drilldown":"true"} })
answers question: http://stackoverflow.com/q/28884035
score: 0
has comment: http://stackoverflow.com/comment/46029678

http://stackoverflow.com/q/28839664
has comment: http://stackoverflow.com/comment/45975950
favorite count: 0
has body: I have a simple animation which shows a gas meter moving from green to red. I am simply drawing, clearing and then redrawing the image on a timer to try and simulate animation. Although it kind of works, the animation lags and sometimes just goes back and forward after it should have been completed. Heres the code: function meter(){ requestAnimationFrame(meter); setTimeout(function() { var radius = 40; ctx.clearRect(500, 200, 100, 100); ctx.beginPath(); ctx.arc(550, 250, radius, 0, 2 * Math.PI, false); ctx.fillStyle = 'rgba(192, 192, 192, 0.4)'; ctx.fill(); ctx.lineWidth = 2; ctx.strokeStyle = '#000000'; ctx.stroke(); ctx.fillStyle = "#ffcc4a"; ctx.fillRect(525, 220, 50, 60); ctx.fillStyle = "#ffffff"; ctx.fillRect(528, 225, 44, 45); var grd = ctx.createLinearGradient(510, 0, 670, 0); grd.addColorStop(0, "black"); grd.addColorStop(0.25, "yellow"); grd.addColorStop(0.5, "red"); ctx.fillStyle = grd; ctx.fillRect(530, 228, 40, 30); ctx.beginPath(); ctx.fillStyle = "#000000"; ctx.arc(550, 264, 5, 0, 2 * Math.PI, false); ctx.moveTo(549, 260); ctx.lineTo(548, 240); ctx.fill(); ctx.lineWidth = 2; ctx.strokeStyle = '#000000'; ctx.stroke(); ctx.closePath(); ctx.closePath(); //ctx.clearRect(500, 200, 100, 100); }, 2000); setTimeout(function() { var radius = 40; ctx.clearRect(500, 200, 100, 100); ctx.beginPath(); ctx.arc(550, 250, radius, 0, 2 * Math.PI, false); ctx.fillStyle = 'rgba(192, 192, 192, 0.4)'; ctx.fill(); ctx.lineWidth = 2; ctx.strokeStyle = '#000000'; ctx.stroke(); ctx.fillStyle = "#ffcc4a"; ctx.fillRect(525, 220, 50, 60); ctx.fillStyle = "#ffffff"; ctx.fillRect(528, 225, 44, 45); var grd = ctx.createLinearGradient(510, 0, 670, 0); grd.addColorStop(0, "black"); grd.addColorStop(0.25, "yellow"); grd.addColorStop(0.5, "red"); ctx.fillStyle = grd; ctx.fillRect(530, 228, 40, 30); ctx.beginPath(); ctx.fillStyle = "#000000"; ctx.arc(550, 264, 5, 0, 2 * Math.PI, false); ctx.moveTo(549, 260); ctx.lineTo(558, 240); ctx.fill(); ctx.lineWidth = 2; ctx.strokeStyle = '#000000'…
tagged with: animation
upvote count: 1
accepted answer: http://stackoverflow.com/a/28857333
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28857333
has comment: http://stackoverflow.com/comment/45951685
type: Question
downvote count: 0
tagged with: javascript
has title: Drawing and redrawing an image to simulate animation doesnt work
tagged with: html5-canvas
tagged with: http://stackoverflow.com/tag/html
answer count: 1

http://stackoverflow.com/a/28756130
type: Answer
score: 0
has body: Unfortunately you are using JavaScript which does not support regex conditionals. There is only 2 ways this can be done in a single regex. 1. Do all the permutations on X of Y 2. Use an engine that supports conditionals. Since 2. is out of the question for JavaScript, you are left with only 1. which I get confused when it gets past order 3. This is how it could be done if the engine supports conditionals. But it doesn't, so ignore this. For reference, if you could use conditionals, any X of Y is easily done. Examine the output match positions for the capture groups and notice how they are out of order. Example: # ^(?:.*?(?:((?(1)(?!))[a-z]+)|((?(2)(?!))[A-Z]+)|((?(3)(?!))[0-9]+)|((?(4)(?!))[_!@#$%^&amp;*?/]+))){3,4}.*$ ^ (?: .*? (?: ( # (1) (?(1) (?!) ) [a-z]+ ) | ( # (2) (?(2) (?!) ) [A-Z]+ ) | ( # (3) (?(3) (?!) ) [0-9]+ ) | ( # (4) (?(4) (?!) ) [_!@#$%^&amp;*?/]+ ) ) ){3,4} .* $ Output: ** Grp 0 - ( pos 0 , len 15 ) B,B_+&amp;*%#a0AaaP ** Grp 1 - ( pos 9 , len 1 ) a ** Grp 2 - ( pos 0 , len 1 ) B ** Grp 3 - ( pos 10 , len 1 ) 0 ** Grp 4 - ( pos 3 , len 1 ) _
answers question: http://stackoverflow.com/q/28754242

http://stackoverflow.com/comment/45894647
score: 0
type: Comment
type: QuestionComment
has text: @ Amit Joki No, the array. Updated the question.
comment on: http://stackoverflow.com/q/28811285

http://stackoverflow.com/a/28947037
type: Answer
has body: I have found what I was looking for, it was innerHTML This way I can simply type an HTML code inside javascript which is then inputted into the included php as I wanted. Example; document.getElementById('databox').innerHTML = ' ' + ' ' + ' ' + ' Opvragen '+ ' ' + ' '; Thank you for your suggestions and effort, though.
accepted answer of: http://stackoverflow.com/q/28831244
answers question: http://stackoverflow.com/q/28831244
type: AcceptedAnswer
score: 0

http://stackoverflow.com/a/28887991
score: 0
has body: Not directly. However, you can set it as a property of window, thus making it a global variable. But using global variables is not recommendable, specially if they are secret. var makeAModule = function() { var priv = {}; priv._secret = 'Ssh!'; Object.defineProperty(window, '_secretLength', { get: function() { return priv._secret.length; } }); return { tellMeYourSecret: function() { return _secret; }, howLongIsYourSecret: function() { return _secretLength; } }; }; document.body.innerHTML = "Secret length: " + makeAModule().howLongIsYourSecret(); Alternatively, you can define your getters as properties of an object, and use a with statement. Note that the with statement can't be used in strict mode. var makeAModule = function() { var priv = {}; priv._secret = 'Ssh!'; Object.defineProperty(priv, '_secretLength', { get: function() { return priv._secret.length; } }); with(priv) { return { tellMeYourSecret: function() { return _secret; }, howLongIsYourSecret: function() { return _secretLength; } }; } }; document.body.innerHTML = "Secret length: " + makeAModule().howLongIsYourSecret();
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/28887517
accepted answer of: http://stackoverflow.com/q/28887517

http://stackoverflow.com/comment/46056132
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28887420
has text: Yes, thanks. To build Node.js from source and statically link to OpenSSL run: ./configure --openssl-use-sys --shared-openssl-includes=INCLUDEPATH --shared-openssl-libpath=LIBPATH
score: 0

unit-testing
tags question: http://stackoverflow.com/q/28857527
tags question: http://stackoverflow.com/q/28868369
tags question: http://stackoverflow.com/q/28826974
tags question: http://stackoverflow.com/q/28821511
tags question: http://stackoverflow.com/q/28904174
tags question: http://stackoverflow.com/q/28840114
tags question: http://stackoverflow.com/q/28839512
tags question: http://stackoverflow.com/q/28864454
tags question: http://stackoverflow.com/q/28794283
type: Tag
tags question: http://stackoverflow.com/q/28791797
tag name: unit-testing
tags question: http://stackoverflow.com/q/28759157
tags question: http://stackoverflow.com/q/28754998
tags question: http://stackoverflow.com/q/28812974
tags question: http://stackoverflow.com/q/28870999
tags question: http://stackoverflow.com/q/28816739

http://stackoverflow.com/comment/46053473
type: AnswerComment
score: 0
type: Comment
has text: Same var name and same regex, but you are too quick :) +1
comment on: http://stackoverflow.com/a/28896928

http://stackoverflow.com/q/28883723
has title: Angular, encode and decode object from url
answer count: 1
favorite count: 0
upvote count: 5
tagged with: angularjs
has comment: http://stackoverflow.com/comment/46028811
has comment: http://stackoverflow.com/comment/46028947
has comment: http://stackoverflow.com/comment/46031481
downvote count: 0
type: Question
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/24710503
tagged with: javascript
has comment: http://stackoverflow.com/comment/46031196
has comment: http://stackoverflow.com/comment/46031170
has comment: http://stackoverflow.com/comment/46031422
score: 5
has answer: http://stackoverflow.com/a/28885431
has body: I have an object I'm trying to pass by url - something like $location.search(myObject) However when this object becomes an array of objects I have a problem getting it there. I'm wondering how I can put up a large object (right now it's an array of objects, I don't know if that needs to change), and then pull it back down into a controller with an $location.search() This works fine if my object is just 1 small object, right now its an array of objects with levels inside like so var testIt = [{ "module1" : [ { "name1" : ["option1", "option2", "option3"] }, { "name2" : ["option1", "option2", "option3"] } ] }, { "module2" : [ { "name3" : ["option1", "option2", "option3"] }, { "name4" : ["option1", "option2", "option3"] } ] }]; $location.search(testIt); How can I work with something like this, (it's ok if the url is huge right now, but if there is a way to shrink it - even better!) Thanks!
accepted answer: http://stackoverflow.com/a/28885431

http://stackoverflow.com/comment/46040878
type: AnswerComment
type: Comment
has text: @Pluto EcmaScript 6 introduces the `let` keyword to reduce the scope of a variable to its block-level instead of function-level (as in many other languages). Read more https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let
score: 1
comment on: http://stackoverflow.com/a/28889920

mongoose
tags question: http://stackoverflow.com/q/28844354
tags question: http://stackoverflow.com/q/28818256
type: Tag
tags question: http://stackoverflow.com/q/28890752
tags question: http://stackoverflow.com/q/28904380
tags question: http://stackoverflow.com/q/28848840
tags question: http://stackoverflow.com/q/28832102
tags question: http://stackoverflow.com/q/28899524
tags question: http://stackoverflow.com/q/28775051
tags question: http://stackoverflow.com/q/28811905
tags question: http://stackoverflow.com/q/28849936
tag name: mongoose
tags question: http://stackoverflow.com/q/28849237
tags question: http://stackoverflow.com/q/28887304
tags question: http://stackoverflow.com/q/28815720
tags question: http://stackoverflow.com/q/28872291
tags question: http://stackoverflow.com/q/28812948
tags question: http://stackoverflow.com/q/28892379
tags question: http://stackoverflow.com/q/28852745
tags question: http://stackoverflow.com/q/28789036
tags question: http://stackoverflow.com/q/28814293
tags question: http://stackoverflow.com/q/28777907
tags question: http://stackoverflow.com/q/28843727
tags question: http://stackoverflow.com/q/28802125
tags question: http://stackoverflow.com/q/28776825
tags question: http://stackoverflow.com/q/28800062

http://stackoverflow.com/a/28835045
score: 3
accepted answer of: http://stackoverflow.com/q/28834406
has body: I tried to apply inheritance by adding something like Child.prototype = Object.create(Parent.prototype); Yes, you should do that, to create a prototype chain between your .prototype objects. You have your methods defined on them, don't you? How can I inherit from the Parent class such that I can use the properties id and name. You basically need a "super" call to the Parent constructor so that it sets up your properties on Child instances: function Child(id, name, parameters) { Parent.call(this, id, name, parameters); Object.defineProperty(this, "phone", { value: parameters.phone, writable: true }); }
upvote count: 3
has comment: http://stackoverflow.com/comment/45939630
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28834406

http://stackoverflow.com/comment/45989408
type: QuestionComment
has text: You should accept an answer if it worked for you. Press the green check mark on your choice answer.
comment on: http://stackoverflow.com/q/28860602
score: 0
type: Comment

http://stackoverflow.com/a/28923010
downvote count: 1
has comment: http://stackoverflow.com/comment/86569151
type: Answer
upvote count: 4
score: 3
answers question: http://stackoverflow.com/q/28904875
has body: It's your component, so you don't need to worry about passing actual events around. You have some event handlers, and then you have the actual action. sendMessage: function(){ console.log('message:', this.state.message); }, handleFormSubmit: function(event){ event.preventDefault(); this.sendMessage(); }, handleTextareaKeypress: function(event){ if (event.which == 13 &amp;&amp; !event.shiftKey){ this.sendMessage(); } }

http://stackoverflow.com/comment/46069536
has text: you can use the split function.. post your html
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28905108

http://stackoverflow.com/a/28776563
answers question: http://stackoverflow.com/q/28776508
type: Answer
upvote count: 1
has body: \w will only match a-z, A-Z, 0-9, _, cf. http://www.w3schools.com/jsref/jsref_regexp_wordchar.asp. Use this regular expression to include an arbitrary number of points as well: /{{([\w\.]*)}}/g
downvote count: 0
score: 1

http://stackoverflow.com/q/28821840
has answer: http://stackoverflow.com/a/28821945
has answer: http://stackoverflow.com/a/28821985
favorite count: 0
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45915724
accepted answer: http://stackoverflow.com/a/28821945
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/45915717
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: How do I use jQuery to click and option and have it populate a field
has comment: http://stackoverflow.com/comment/45915459
has body: I'm using the following code to have jQuery handle the click of an option and put that value in a field. The code works except for the part I have in the tag. I can't figure out why the part within the bold tag isn't doing anything when clicked, while the text after it does. Here's the HTML: This text doesn't work when clicked This text works when clicked 113096G And Here's the jQuery: // When clicking an option, the value populates the #projectsearchid field jQuery("#result").live("click",function(e){ var $clicked = $(e.target); var $name = $clicked.find('.name').html(); $('#projectsearchid').val($name); }); Possibly there's a simpler way to accomplish this?
possible better answer: http://stackoverflow.com/a/28821985

http://stackoverflow.com/q/28785839
has title: Firebase limit deprecated, how to use limitToLast or limitToFirst?
score: 0
answer count: 1
tagged with: angularjs
has body: I'm getting this console message in my firebase application: "FIREBASE WARNING: Query.limit() being deprecated. Please use Query.limitToFirst() or Query.limitToLast() instead." But when I change from: fbutil.syncArray('messages', {limit: 10, endAt: null}); To this: fbutil.syncArray('messages', {limitToLast: 10, endAt: null}); I get all the messages. Btw, I'm using the angularfire-seed, and I have updated the firebase scripts to the latest ("firebase": "~2.2.x", "angularfire": "~0.9.x",). What am I doing wrong?
tagged with: firebase
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/28786114
accepted answer: http://stackoverflow.com/a/28786114
tagged with: javascript

http://stackoverflow.com/q/28882353
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28882543
accepted answer: http://stackoverflow.com/a/28882543
downvote count: 0
type: Question
has body: I have two columns &amp; I want to drag &amp; drop div between these columns. I making this drag function work using the following var _dragStart =function(event){ console.log("Method Executing:dragDrop.dragStart") var x=event.dataTransfer.setData('draggable',event.target); } Here event.target is an html div element having children. Where as for dropping var _dropOver = function(event){ console.log("Method Executing:dragDrop.dropOver"); event.preventDefault(); var getTask = event.dataTransfer.getData('draggable'); event.target.appendChild(getTask); } But it is throwing an error as Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.
upvote count: 2
answer count: 1
tagged with: javascript
has title: Not able to appendChild in HTML5 Drag & drop,No jquery please

http://stackoverflow.com/q/28800531
linked to: http://stackoverflow.com/q/23073947
tagged with: three.js
upvote count: 1
has comment: http://stackoverflow.com/comment/45880532
has comment: http://stackoverflow.com/comment/45908780
score: 1
tagged with: http://stackoverflow.com/tag/json
has body: I have several working Three.js WebGL web pages. See here: https://lpplmarketwatch.com/3d-contour-examples/ However, the JSON files, which I am hosting from a static ftp server, have file sizes around 4 - 6MB. They are large because there many "vertices" in the JSON object. I can compress the files on my own computer to tar.gz to around 1MB. Is there a way to compress these files and have the user's browser uncompress the file with javascript to be loaded by the Three.js JSONLoader?
type: Question
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45993805
has comment: http://stackoverflow.com/comment/45875046
has title: three.js JSON File compression
answer count: 1
has answer: http://stackoverflow.com/a/28821230
favorite count: 0
has comment: http://stackoverflow.com/comment/45911391
has comment: http://stackoverflow.com/comment/45875063
type: UnansweredQuestion

http://stackoverflow.com/q/28781265
has comment: http://stackoverflow.com/comment/45839540
has body: I have to implement a 'range' function in javascript like the one in python. function range (x, y, i){ i = i || 1; j = [x]; while (y &gt; (x+i)) { j.push(x += i); } return j; } function range2 (x, y, i){ i = i|| 1; j = []; for (x ; x &lt; y; x += i) { j.push(x); }; return j; } Seems the second one works better. Always, there is a better approach to a problem in many scenarios but why is it so ? What is making the first range function slower , or what's making the second one faster ?
has comment: http://stackoverflow.com/comment/45839870
has answer: http://stackoverflow.com/a/28781329
has title: Why algorithm performance differs
downvote count: 1
type: Question
tagged with: algorithm
upvote count: 0
tagged with: javascript
score: -1
answer count: 2
has answer: http://stackoverflow.com/a/28781383
has comment: http://stackoverflow.com/comment/45839390
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/28899956
tagged with: zlib
tagged with: gzip
tagged with: javascript
score: 0
answer count: 1
has body: My script takes file data, interprets it, and spits it out in a different format. The user can input a URL or upload a file, and the file refence for either of these can be XML or GZIP (which I then decompress). What works: Parsing XML + GZIP from URL Uploading files Parsing XML body from uploaded files What doesn't work Decompressing + parsing GZIP'd body from uploaded files Whilst zlib.gunzip(fileX_bodyFromUpload) fails, zlib.gunzip(fileX_bodyFromURL) works perfectly. Weirdly, ZLIB gets pissy with the file upload version of the same file, claiming [Error: incorrect header check]. So, how can I get ZLIB to decompress file contents correctly? Functions: var tmp_path = req.files.file.path; fs.readFile(tmp_path, 'utf8', function(err, body) { fs.unlink(tmp_path, function(err) { if (err) throw err; }); prepareBody(req, res, body); }); function prepareBody(req, res, body) { if (req.body.isGzip == 'on') { zlib.gunzip(body, function(err, dezipped) { if (typeof dezipped != 'undefined') { var xmlData = dezipped.toString('utf-8'); parseAndOffload(req, res, xmlData); } else { console.log(err); console.error("TERMINATING: Could not decompress as GZIP file."); res.status(400).send('Could not decompress as GZIP file.') } }); } else { parseAndOffload(req, res, body); } } Upload GZIP file -> console log: { file: { fieldname: 'file', originalname: '0c8fae64645fef5bf6f32c494cdde6b2.gz', name: 'b95686fb9f205e253c41dd96ccd41c24.gz', encoding: '7bit', mimetype: 'application/x-gzip', path: 'uploads/b95686fb9f205e253c41dd96ccd41c24.gz', extension: 'gz', size: 35898, truncated: false, buffer: null } } loadFile: 78ms { [Error: incorrect header check] errno: -3, code: 'Z_DATA_ERROR' } TERMINATING: Could not decompress as GZIP file.
has answer: http://stackoverflow.com/a/28900130
tagged with: fs
tagged with: node.js
type: AnsweredQuestion
has title: NodeJS: zlib.gunzip() on file contents returns Error: incorrect header check
accepted answer: http://stackoverflow.com/a/28900130
type: Question

http://stackoverflow.com/q/28750755
upvote count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45876992
favorite count: 0
has comment: http://stackoverflow.com/comment/46070494
score: 0
downvote count: 1
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45811117
has comment: http://stackoverflow.com/comment/45877053
has comment: http://stackoverflow.com/comment/46023925
tagged with: sapui5
has body: I'm trying to build a custom time sheet calculator fiori app with a calendar on top that displays 2 weeks at a time and a table below that calculate the number of hours and the amount payed... I'm trying to figure out the best approach to do this?... if anyone has a good example to follow or some guidance to do this please help. Any kind of help is appreciated. Thanks.
has title: SAPUI5 Time sheet calculator with a calendar
type: Question

http://stackoverflow.com/a/28775576
type: Answer
answers question: http://stackoverflow.com/q/28775191
has comment: http://stackoverflow.com/comment/45830726
downvote count: 0
has body: This is a valid concern, but should not be addressed from within ADF framework. You may use Oracle Web Tier for controlling your cache expiration policies. Bringing few more clarifications: First of all: Oracle Web Tier is conveniently built on top of Apache Web Server. This is important because the knowledge base (docs, forums, blogs etc) on how to work with Apache is obviously larger and is easy to find expert advice. What you are describing here is known as "Browser Cache Busting" where you need to 'force' the browser to clear static cache (css and javascript) after an website upgrade. The only way of doing it is to change the URL of the cached resource, but implementing this inside your application logic - although a common practice - is wrong design and bad separation of concerns. This should be controlled globally from your Web Server and not from your Web Application Server. Provided you are fronting your Weblogic with an Oracle Web Tier (Apache), you can use mod_rewrite for controlling the caching of updated files .
score: 1
has comment: http://stackoverflow.com/comment/45829906
upvote count: 1

http://stackoverflow.com/comment/45825467
comment on: http://stackoverflow.com/a/28773511
has text: Yes, the strings need to be quoted as they will be seen as variables otherwise.
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/q/28809152
downvote count: 0
accepted answer: http://stackoverflow.com/a/28810898
type: Question
upvote count: 2
tagged with: canvas
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28810898
favorite count: 0
has comment: http://stackoverflow.com/comment/45892125
has title: Draw vertical line between circles in canvas
linked to: http://stackoverflow.com/q/28842157
has body: I want draw a vertical line between circles in my project. and these are my codes: html: and theses are js code: var canvas = document.getElementById('col111'); var context = canvas.getContext('2d'); var centerX = canvas.width / 2; var centerY = canvas.height / 2; var radius = 70; context.beginPath(); context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false); context.fillStyle = 'green'; context.fill(); context.lineWidth = 5; context.strokeStyle = '#003300'; context.stroke(); var canvas = document.getElementById('col112'); var context = canvas.getContext('2d'); var centerX = canvas.width / 2; var centerY = canvas.height / 2; var radius = 70; context.beginPath(); context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false); context.fillStyle = 'green'; context.fill(); context.lineWidth = 5; context.strokeStyle = '#003300'; context.stroke(); var canvas = document.getElementById('col113'); var context = canvas.getContext('2d'); var centerX = canvas.width / 2; var centerY = canvas.height / 2; var radius = 70; context.beginPath(); context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false); context.fillStyle = 'green'; context.fill(); context.lineWidth = 5; context.strokeStyle = '#003300'; context.stroke(); var canvas = document.getElementById('col221'); var context = canvas.getContext('2d'); var centerX = canvas.width / 2; var centerY = canvas.height / 2; var radius = 70; context.beginPath(); context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false); context.fillStyle = 'green'; context.fill(); context.lineWidth = 5; context.strokeStyle = '#003300'; context.stroke(); var canvas = document.getElementById('col222'); var context = canvas.getContext('2d'); var centerX = canvas.width / 2; var centerY = canvas.height / 2; var radius = 70; context.beginPath(); context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false); context.fillStyle = 'green'; context.fill(); context.lineWidth = 5; context.strokeStyle = '#003300'; context.stroke(); var canvas = document.getElement…
has comment: http://stackoverflow.com/comment/45890749
tagged with: html5-canvas
has comment: http://stackoverflow.com/comment/45893795
score: 2
type: AnsweredQuestion

http://stackoverflow.com/a/28933399
accepted answer of: http://stackoverflow.com/q/28865128
has body: Finally using the content in this answer and modifying the code in the soap-node module i was able to obtain the code i needed. I needed something like this: uuid {XXXXXX} so I used this for creating the parameters: var arrayToSend= {auth : [ { 'attributes' : {'xsi:type':"ns2:Map"}, 'item': [ {'key' : {'attributes' : { 'xsi:type': 'xsd:string'}, $value: 'uuid' } }, {'value' : {'attributes' : { 'xsi:type': 'xsd:string'}, $value: uuid } } ] } ] }; and sent it like this: soap.createClient(url, myFunction); function myFunction(err, client) { client.ListaBancosPSE(arrayToSend,function(err, result) { console.log('\n' + result); }); } Then the tricky part was modyfing the wsd.js so it didn't add a extra tag everytime i used and array. I went to line 1584 and changed the if for this: if (Array.isArray(obj)) { var arrayAttr = self.processAttributes(obj[0]), correctOuterNamespace = parentNamespace || ns; //using the parent namespace if given parts.push(['<', correctOuterNamespace, name, arrayAttr, xmlnsAttrib, '>'].join('')); for (var i = 0, item; item = obj[i]; i++) { parts.push(self.objectToXML(item, name, namespace, xmlns, false, null, parameterTypeObject, ancXmlns)); } parts.push(['</', correctOuterNamespace, name, '>'].join('')); } basically now it does not push the open and close tag in every iterarion but instead only before and after the whole cycle. Also i needed to add the definitions for the xlmns of the message. Client.js:186 xml = "<soap:Envelope " + "xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" " + 'xmlns:xsd="http://www.w3.org/2001/XMLSchema"' + 'xmlns:ns2="http://xml.apache.org/xml-soap"' + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " + Hopefully this could be of help for people using this library and being in this situation.
upvote count: 5
score: 5
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28865128

http://stackoverflow.com/comment/45912730
type: Comment
comment on: http://stackoverflow.com/a/28820360
type: AnswerComment
has text: +1 Thanks for pulling out the spec. The milliseconds I did not realize - this actually gives me an idea, will add my own answer
score: 0

http://stackoverflow.com/comment/46181566
comment on: http://stackoverflow.com/a/28910022
score: 0
type: AnswerComment
has text: It looks like your fonts are self hosted? That was another thought I had... try to reduce as many latency variables as possible. My other thought would be to try a different font. The goal there is to merely find where the issue might be - could be something unique to that specific font? All looks correct to me. I haven't worked with IText much yet though, so maybe there is something unique to how IText loads custom fonts.
type: Comment

http://stackoverflow.com/q/28800094
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28820891
has body: I'm having trouble getting data to display in my Vue components. I'm using Vueify and I'm trying to load an array of listings from the listings.vue component and I keep getting errors. Also, I don't understand how to pull in the data via the computed method. Any help would be appreciated. This is the error I'm getting in the console: [Vue warn]: The "data" option should be a function that returns a per-instance value in component definitions. [Vue warn]: $mount() should be called only once. Here is my app.vue // app.vue Here is my listings.vue component {{title}} {{description}}
type: Question
score: 12
upvote count: 12
tagged with: vue.js
answer count: 1
tagged with: arrays
downvote count: 0
tagged with: javascript
has title: How do I display data through components with Vue.js (using Vueify)?
tagged with: node.js
favorite count: 0

http://stackoverflow.com/q/28818749
possible better answer: http://stackoverflow.com/a/28819341
tagged with: css
tagged with: html-datalist
favorite count: 0
has answer: http://stackoverflow.com/a/28819341
has comment: http://stackoverflow.com/comment/45909203
has comment: http://stackoverflow.com/comment/45909331
has title: datalist get selected value and custom attribute (without events)
accepted answer: http://stackoverflow.com/a/29488713
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45910685
score: 1
has body: I have a datalist with options and a custom attribute. &lt;input list="selectedItems" class="selectedItemsList"&gt;&lt;/input&gt; &lt;datalist id="selectedItems"&gt; &lt;option value="test11" oldvalue="f1"&gt;&lt;/option&gt; &lt;option value="test12" oldvalue="f2"&gt;&lt;/option&gt; &lt;/datalist&gt; It is displayed on a popup. When a popup closes the value and custom attribute value must be used in a function... I tried: alert($("#selectedItems option:selected").val()); alert($("#selectedItems option:selected").attr("oldvalue")); $('.selectedItemsList option').each(function() { if($(this).is(':selected')){ alert($(this).val()); } }); for (var i=0; i&lt;document.getElementById('selectedItemsList').options.length; i++) { if (document.getElementById('selectedItemsList').options[i].value == document.getElementsByName("selectedItems")[0].value) { alert(document.getElementById('selectedItemsList').options[i].value); break; } } Nothing works. I can get the values using on-event but that is not an option for me. $('.selectedItemsList').on('input', function() { ... alert($(this).val());
type: Question
has answer: http://stackoverflow.com/a/29488713
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45909458
has comment: http://stackoverflow.com/comment/45909943
upvote count: 1
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/45927441
has text: It does output all three matching items: http://jsfiddle.net/uL03nwwu/
score: 1
comment on: http://stackoverflow.com/q/28828577
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28838437
favorite count: 0
tagged with: google-places-api
upvote count: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28838438
type: Question
accepted answer: http://stackoverflow.com/a/28838438
tagged with: google-maps
tagged with: javascript
score: 2
downvote count: 0
answer count: 1
has body: When using the Google Maps Places API you can create an Autocomplete element attached to a map in order to search their library. When you select a place you can call autocomplete.getPlace() to retrieve a JSON object describing the place. One field of this is the place_id, Google's unique reference. Google actually allow these to be stored: Place IDs are exempt from the caching restrictions stated in Section 10.1.3 of the Google Maps APIs Terms of Service. You can therefore store place ID values indefinitely. However it's not clear from the documentation how you can use this stored value to retrieve the details of a place. Are there any methods, and how should these be used?
has title: How do I retrieve place details from the Google Places JS API using a place ID?

http://stackoverflow.com/comment/45922582
has text: Try to use debugger (Ctrl+Shift+J in Chrome -> Source tab). Just place breakpoint at the `query.find` line and update the page (or click a button, I do not know when your code should be runned, actually).
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28825513
type: Comment

http://stackoverflow.com/a/28850297
has comment: http://stackoverflow.com/comment/45968586
has body: Just use $("article section").length Fiddle Demo
type: Answer
answers question: http://stackoverflow.com/q/28849901
has comment: http://stackoverflow.com/comment/45968301
has comment: http://stackoverflow.com/comment/45968342
score: 0

http://stackoverflow.com/comment/45856311
score: 1
type: AnswerComment
has text: If that's the case, then your actual code is different from your question code in an important way - in your question's code, it is impossible for `link` to be accessed outside of the IIFE that creates `someVar`
type: Comment
comment on: http://stackoverflow.com/a/28790492

http://stackoverflow.com/comment/46061762
comment on: http://stackoverflow.com/a/28889025
has text: I tried this but still protractor cannot identify object. Can we use class instead of ui-tree-handle? If yes, can you please share an example?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28785735
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28797893
tagged with: nodemailer
answer count: 1
tagged with: email
score: 1
favorite count: 0
has title: Sending delayed emails with node-mailer on Heroku
upvote count: 1
tagged with: node.js
tagged with: heroku
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28797893
has body: I have a MEAN stack web app being hosted on Heroku. I'm using node-mailer (https://github.com/andris9/Nodemailer) to send emails when people create a form, sign up for a form, and a few other things. Ideally, I would like to send a reminder email one week prior to the date specified on the form. I have no idea how to accomplish this with node-mailer, and have been scouring google looking for a solution, but come up short. Is there a good way to send delayed emails with node-mailer? I don't want to switch mailing services if I can avoid it. Thanks in advance.
type: Question

http://stackoverflow.com/a/28866004
answers question: http://stackoverflow.com/q/28865762
downvote count: 0
has comment: http://stackoverflow.com/comment/45997016
has body: function f(n){ return n/(Math.pow(10, Math.floor(Math.log10(n)))); } You need to divide n by 10^x, where x is how "long" the number is. Turns out the length of the number is just the floor of the logarithm of the number.
type: Answer
upvote count: 3
score: 3

http://stackoverflow.com/comment/45787836
score: 0
type: Comment
type: QuestionComment
has text: you're using a `class` in your HTML and targeting an `id` in your javascript
comment on: http://stackoverflow.com/q/28752950

http://stackoverflow.com/q/28804269
upvote count: 1
has answer: http://stackoverflow.com/a/28804438
favorite count: 0
tagged with: cordova
has body: This issue is on Phonegap. I want to apply the maxlength on an input box. But in the input box of the email type maxlength does not work. (In the other type, such as password type or tel type works well.) Of course, it works well on the web. The issue only occurs Phonegap. Why Do you know? My code &lt;input type="email" data-role="none" placeholder="ID" maxlength="20"/&gt; +) I found this question but did not give me an answer. And attr('maxlength','5') is can't help me too.. EDIT I found this question. and tasted both 4.2 version, 4.4.2 version. This issue certainly does not work only on the 4.4.2 version of the device. SOLVED To see the answers, I was trying to solve by using the following code: var eInput = document.getElementById('Email-input'); var maxLength = eInput.maxLength; eInput.onkeyup = function(e){ if( eInput.value.length &gt; maxLength ){ eInput.value = eInput.value.substring(0, maxLength ); } }; However, if I use this code should try more delete button of keyboard when try to erase after enter exceeds maxlength. And the answer of this bug was found in this link. The need to complete the word using spaces or focus out, than properly cleared. (The issue occurs only on some versions. - I think maybe 4.4.2 or higher..) So I use this code: eInput.value += '&amp;nbsp'; And it works Perfectly! All code: var eInput = document.getElementById('Email-input'); var maxLength = eInput.maxLength; eInput.onkeyup = function(e){ if(eInput.value.length &gt; maxLength){ eInput.value += '&amp;nbsp'; eInput.value = eInput.value.substring(0, maxLength); } };
has title: Phonegap - input type email maxlength is not working
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question
has answer: http://stackoverflow.com/a/43511438
possible better answer: http://stackoverflow.com/a/28804438
tagged with: javascript
has answer: http://stackoverflow.com/a/28804441
accepted answer: http://stackoverflow.com/a/28804441
answer count: 3
has comment: http://stackoverflow.com/comment/45881938
linked to: http://stackoverflow.com/q/11754575

http://stackoverflow.com/comment/45988371
comment on: http://stackoverflow.com/q/28861479
has text: I currently use a workaround where I create a CustomEvent and add the function evt.clipboardData.getData().
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/a/28875015
has body: I've been struggling with this myself for a while and I've finally figured it out. The trick is to define the series and give them an id. After that you can link the errorbars to the right series. $(function () { $('#container').highcharts({ chart: { type: 'column' }, title: { text: 'Data input as row arrays' }, tooltip: { shared: true }, data: { rows: [ [null, 'Ola', 'Kari'], // series names ['Apples', 1, 5], // category and values ['Pears', 4, 4], // category and values ['Oranges', 3, 2] // category and values ] }, series: [ { id: '0' }, { id: '1' }, { type: 'errorbar', data: [[0, 3], [1, 3],[2, 1]], linkedTo: '0' }, { type: 'errorbar', data: [[0, 6], [2, 5],[3, 2]], linkedTo: '1' } ] }); }); See the updated the fiddle for the example: http://jsfiddle.net/6k7ee0cu/1/
accepted answer of: http://stackoverflow.com/q/28873376
type: AcceptedAnswer
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28873376

http://stackoverflow.com/q/28798428
possible better answer: http://stackoverflow.com/a/28798657
type: Question
score: 0
answer count: 2
has title: Change background color of a box when an element is dropped on top of it
tagged with: javascript
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/28798769
tagged with: http://stackoverflow.com/tag/html
has body: Using jQuery, I have a draggable element called dropblock whose revert parameter is set to true. When dropblock is dropped on a list of boxes called blocks, I would like the box onto which it is dropped - and its two immediate neighbors - to change their background color (say to red) before dropblock reverts back to its original position. But being a JavaScript beginner, I don't know how to get started on doing this. Is there some way to tell which box the mouse was hovering over when dropblock gets dropped? Here is what my code looks like after stripping off everything not relevant to this question: MVCE.html: Stackexchange MVCE MVCE.css: #blocks { list-style-type: none; display: inline-block; width: 300px; } #blocks li { margin: 3px 3px 0px 0; width: 30px; height: 30px; } #dropblock { list-style-type: none; display: inline-block; vertical-align: top; position: relative; width: 150px; } #dropblock li { margin: 3px 3px 0px 0; float: left; width: 30px; height: 30px; font-size: 4em; text-align: center; } MVCE.js: $(function() { $( "#dropblock" ).draggable({ revert: true}); });
has answer: http://stackoverflow.com/a/28798657
has answer: http://stackoverflow.com/a/28798769
upvote count: 1
downvote count: 1
type: AnsweredQuestion

http://stackoverflow.com/comment/45995871
has text: And actually you don't need m modificator. It only affects start of text (^) and end of text ($) symbols, but you don't have tham in expressions.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/28865406
type: Comment

http://stackoverflow.com/a/29244875
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: Solved with the addition of a function to bind to the first element of your group: var firstAnchor = document.getElementById("first"), lastAnchor = document.getElementById("last"); function keydownHandler(f) { var evt = f || window.event; var keyCode = evt.which || evt.keyCode; if(keyCode === 9) { // TAB pressed if(evt.preventDefault) evt.preventDefault(); else evt.returnValue = false; firstAnchor.focus(); } } function keydownHandlerFirst(f) { var evt = f || window.event; var keyCode = evt.which || evt.keyCode; if(keyCode === 9 &amp;&amp; evt.shiftKey) { // TAB+SHIFT pressed if(evt.preventDefault) evt.preventDefault(); else evt.returnValue = false; lastAnchor.focus(); } } if(lastAnchor.addEventListener) lastAnchor.addEventListener('keydown', keydownHandler, false); else if(lastAnchor.attachEvent) lastAnchor.attachEvent('onkeydown', keydownHandler); if(firstAnchor.addEventListener) firstAnchor.addEventListener('keydown', keydownHandlerLast, false); else if(firstAnchor.attachEvent) firstAnchor.attachEvent('onkeydown', keydownHandlerLast); And I've been reminded why I use frameworks... Can you believe we used to write all our javascript like this?!
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/28763555
accepted answer of: http://stackoverflow.com/q/28763555

http://stackoverflow.com/comment/45902647
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28815172
has text: I still don't see a `submit` button ***inside*** the `form` container. What triggers this?
type: Comment

http://stackoverflow.com/a/28894633
upvote count: 2
answers question: http://stackoverflow.com/q/28893726
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0
has body: You don't need to remove the class open as bootstrap does it after selection. $('.dropdown-menu li a').on('click', function () { var id = $(this).attr('id'); executeAction(id); }); executeAction = function (id) { switch (id) { case "addnewlist": addNewList(); break; case "renamelist": renameList(); break; case "exportlist": exportList(); break; case "importlist": importList(); break; case "emptylist": emptyList(); break; case "deletelist": deleteList(); break; } } Fiddle demo
accepted answer of: http://stackoverflow.com/q/28893726

http://stackoverflow.com/comment/45919560
score: 1
comment on: http://stackoverflow.com/a/28824250
type: AnswerComment
has text: I'm not sure that closure is the right term here actually, but you want to make sure the variables are in the right scope...
type: Comment

http://stackoverflow.com/q/28899347
has comment: http://stackoverflow.com/comment/46065352
type: Question
has title: Scrolling navigation bar loses some formatting when in a fixed position
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46058600
has body: I'm new to Javascript, and I'm trying to learn how to do a scrolling navigation bar. It appears I have the scrolling part nailed down, but, for some reason, the left offset seems to change once the navigation bar is set to fixed. Originally, the bar would snap to the left. Setting the containing div's width to 100% makes the bar more centered, but it's still off. Furthermore, I can't seem to get centering the buttons right. // Javascript window.onload = function() { var navbar = document.getElementById("navbar"); var navbarY = navbar.offsetTop; window.onscroll = function() { if (window.scrollY >= navbarY) { navbar.style.position = "fixed"; navbar.style.top = "0"; } else if (window.scrollY < navbarY) { navbar.style.position = "static"; } } }; /***CSS***/ /*HEADER*/ #header { border: 1px solid; height: 150px; margin: 0 200px 0 200px; } /*NAVIGATION BAR*/ #navbar { width: 100%; } #navbar ul { background: none; border: 1px solid; border-radius: 5px; height: 50px; list-style: none; margin: 0 200px 0 200px; position: static; top: auto; } #navbar ul li { margin: 0; } #navbar ul li a { background: white; border: 1px solid black; border-radius: 5px; color: black; float: left; font: bold 1em Arial, san-serif; margin: 0; padding: 10px 30px; text-decoration: none; } #navbar ul li a:hover { background: black; border: 1px solid black; border-radius: 5px; color: white; font: bold 1em Arial, san-serif; padding: 10px 30px; text-decoration: none; } /*CONTAINER*/ #container { border: 1px solid; height: 2000px; margin: 0 200px 0 200px; } Test Home Content About
tagged with: css
has comment: http://stackoverflow.com/comment/46058648
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46065274

http://stackoverflow.com/comment/113409467
type: Comment
has text: it's not a normal behaviour to get one value through .src and another through .getAttribute("src") ...
score: 0
comment on: http://stackoverflow.com/a/28892032
type: AnswerComment

http://stackoverflow.com/a/40346050
answers question: http://stackoverflow.com/q/28755402
downvote count: 0
score: 1
has body: I solved my case in that way: Declared on js controller: $scope.opened = []; On the item in html put that: ng-click="opened[$index].valor = (rotateImg[$index] = !rotateImg[$index])" And on the img class that: ng-class="opened[$index].valor ? 'rotate': ''" The CSS is that: .rotate { -ms-transform: rotate(180deg); -webkit-transform: rotate(180deg); -moz-transform: rotate(180deg); -webkit-transform: rotate(180deg); -o-transform: rotate(180deg); transform: rotate(180deg); }
type: Answer
upvote count: 1

http://stackoverflow.com/q/28859715
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45985249
has answer: http://stackoverflow.com/a/28859927
has answer: http://stackoverflow.com/a/28859934
tagged with: css
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28859927
score: 0
has answer: http://stackoverflow.com/a/28860544
has title: Styles apply just to first two slides
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45985307
has body: I 'm trying to do kind of slideshow on the background using two img tags. I have a couple of random images, so I have a javascript function to get a random name. But the main problem is: when I zoom or resize window first two slides crop well and display without any problem, but after that every slide is changing if I try to resize the window or zoom in-out. Here you can see that bug: cullycross.github.io(nevermind about big images, im gonna resize them) Here is my code: function randomBackground () { var active = $('#background .active'); var next = ($('#background .active').next().length &gt; 0) ? $('#background .active').next() : $('#background img:first'); next.attr('src', getRandomName()); var imgHeight = next.height(); var windowHeight = $(window).height(); var diff = imgHeight - windowHeight; if(diff &gt; 0) { next.css('top', -diff*0.6); } next.css('z-index', 2); active.fadeOut(1500, function() { active.css('z-index', 1).show().removeClass('active'); next.css('z-index', 3).addClass('active'); }) } window.onload = function() { $('#background .active').attr('src', getRandomName()); $('#background').fadeIn(1500); setInterval(randomBackground, 5000) } Here is css: #background { padding: 0; margin: 0; width: 100%; height: 100%; position: absolute; top: 0; left: 0; z-index: -1; overflow: hidden; } #background img { position: absolute; z-index: 1; float: left; bottom: 0px; left: 0px; top: 0px; height: auto; width: 100%; } #background img.active { z-index: 3; } Here is part of html: &lt;div id="background"&gt; &lt;img id="current-image" class="active" /&gt; &lt;img id="next-image" /&gt; &lt;/div&gt;
answer count: 3
accepted answer: http://stackoverflow.com/a/28860544

http://stackoverflow.com/comment/45817335
has text: If uglify fails because it encounters coffeescript then it means that your filter is not catching all of them.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28768217

http://stackoverflow.com/comment/45847469
comment on: http://stackoverflow.com/q/28785491
has text: You are inside promise, so you may need to run digest cycle `$scope.$apply()`
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28840583
score: 0
type: Answer
has body: You could add a parent directive which will collect the dirty elements, and will add new element once it detects all of the other elements are dirty: Check this plunker. HTML: &lt;div collect-input&gt; &lt;div class="form-group" ng-repeat="(i, name) in name_list track by $index"&gt; &lt;div class="row"&gt; &lt;div class="col-xs-12"&gt; &lt;input class="form-control" type="text" ng-model="data.name_list[i]" add-input/&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; Once addInput detects it is dirty, call parent directive controller: if (dirty) collectInput.reportInput(); JS: directive('collectInput', function() { return { restrict: 'A', controller: function($scope) { var dirtyCount = 0; this.reportInput = function() { var count = $scope.name_list.length; dirtyCount++; if (count === dirtyCount) { $scope.name_list.push('aaa'); } } }, } }). directive('addInput', ['$compile', '$sce', function ($compile, $sce) { return { restrict: 'A', require: ['^collectInput', '?ngModel'], link: function (scope, element, attrs, ctrls) { var collectInput = ctrls[0] var ngModel = ctrls[1]; scope.inputCounter = scope.name_list.length; scope.$watch( function(){ return ngModel.$dirty }, function(dirty_val){ if (dirty_val){ collectInput.reportInput(); } } ); } }}]);
accepted answer of: http://stackoverflow.com/q/28839528
answers question: http://stackoverflow.com/q/28839528
type: AcceptedAnswer

http://stackoverflow.com/q/28854154
has body: I am trying to get data from a server and I am using the JSONP callback due to the cross domain request. I am able to display only some of the data from the server. The "Stats" information in the file I can display by using function(rtac) { for(i in rtac) { rtacs = rtac[i]; $("#rtac-list").append(rtacs.Stats.ItemCount + " "); } But the part named "Data" I am having issues with. I have tried ... $("#rtac-list").append(rtacs.Data.Number + " "); ... and it does not work. Here is what the server file returns: { "rtac_edin_0749542489": { "Data": { "1": { "Number": "1", "Location": "Non fiction (Sighthill)", "Status": "Available", "LoanType": "Standard loan", "DueDate": "", "Shelfmark": "", "CopyNo": "A19958", "ClassNo": "912.4144" } }, "Stats": { "DueDateCount": 0, "ItemCount": 1 } }, "rtac_edin_0715810782": { "Data": { "1": { "Number": "1", "Location": "Non fiction (Sighthill)", "Status": "Available", "LoanType": "Standard loan", "DueDate": "", "Shelfmark": "", "CopyNo": "A12675", "ClassNo": "941.143" }, "2": { "Number": "2", "Location": "Non fiction (Sighthill)", "Status": "On Loan", "LoanType": "Standard loan", "DueDate": "31 March 2015", "Shelfmark": "", "CopyNo": "A12675", "ClassNo": "941.143" }, "3": { "Number": "3", "Location": "Non fiction (Sighthill)", "Status": "Available", "LoanType": "Standard loan", "DueDate": "", "Shelfmark": "", "CopyNo": "A12675", "ClassNo": "941.143" } }, "Stats": { "DueDateCount": 1, "ItemCount": 2 } }, "rtac_edin_0862671906": { "Data": { "1": { "Number": "1", "Location": "Non Fiction (Granton)", "Status": "Available", "LoanType": "Standard loan", "DueDate": "", "Shelfmark": "", "CopyNo": "0017564", "ClassNo": "914.1443" } }, "Stats": { "DueDateCount": 0, "ItemCount": 1 } } } And here is my code for testing purposes: RTAC It seems that the structure of the "Data" item in the file is giving the issue as it has 3 items and I am unsure how to handle this. Please assist thank you.
type: UnansweredQuestion
has title: Displaying data from the Object returned by JSON Callback
upvote count: 1
score: 1
type: Question
tagged with: jsonp
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28854364
downvote count: 0
answer count: 1
favorite count: 0

http://stackoverflow.com/a/28878143
type: Answer
has comment: http://stackoverflow.com/comment/46027856
has body: You are mixing two things here. Your current item is available as 'user', yet you try to access the outer array by index. You either have to use Usuario: {{user.user}} Clave: {{user.pass}} or Usuario: {{users.login[$index].user}} Clave: {{users.login[$index].pass}} but the second way would rather be a misuse of the ng-repeat directive IMHO.
accepted answer of: http://stackoverflow.com/q/28878031
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28878031
score: 0

web
tags question: http://stackoverflow.com/q/28789058
tags question: http://stackoverflow.com/q/28818142
tags question: http://stackoverflow.com/q/28837326
tags question: http://stackoverflow.com/q/28793232
tags question: http://stackoverflow.com/q/28810759
tags question: http://stackoverflow.com/q/28894623
tags question: http://stackoverflow.com/q/28845190
tags question: http://stackoverflow.com/q/28784531
tags question: http://stackoverflow.com/q/28778189
type: Tag
tags question: http://stackoverflow.com/q/28773495
tags question: http://stackoverflow.com/q/28874173
tags question: http://stackoverflow.com/q/28852109
tags question: http://stackoverflow.com/q/28887801
tags question: http://stackoverflow.com/q/28799970
tags question: http://stackoverflow.com/q/28783718
tags question: http://stackoverflow.com/q/28840211
tags question: http://stackoverflow.com/q/28795575
tags question: http://stackoverflow.com/q/28837068
tags question: http://stackoverflow.com/q/28770405
tags question: http://stackoverflow.com/q/28805949
tag name: web
tags question: http://stackoverflow.com/q/28880515
tags question: http://stackoverflow.com/q/28875769
tags question: http://stackoverflow.com/q/28798045
tags question: http://stackoverflow.com/q/28836869
tags question: http://stackoverflow.com/q/28905156
tags question: http://stackoverflow.com/q/28813349

http://stackoverflow.com/comment/45834187
score: 0
type: Comment
type: QuestionComment
has text: You really should be looking for a ng-model rather than looking at things by DOM related elements.
comment on: http://stackoverflow.com/q/28775651

http://stackoverflow.com/q/28793074
has answer: http://stackoverflow.com/a/28793563
answer count: 1
has comment: http://stackoverflow.com/comment/45860934
favorite count: 0
has comment: http://stackoverflow.com/comment/45861228
has body: I have a JSON script which contain live matches. These changes every 5 minutes. The changes could for instance be the keys live_in or score. Beside this matches are also deleted and added to the JSON. I want to keep my html output updated at all time how can i do this the best possible way? So far i've set the updating speed to 5 seconds for testing purposes. I've tried so far to set the divs id to equal to the match_id and thereby update by $('div#match-date-id-' + match['match_id']).html('test'); However does not seem to update. How can i do this the best possible way? i've created a plnkr which enable you to download it with a json snippet, which can be edited in order to check. plnkr.co/edit/eQCShhW01OG5jU4VLx04?p=preview
upvote count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28793563
score: 1
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45861180
has title: update html according to json
type: Question
downvote count: 0
has comment: http://stackoverflow.com/comment/45861200
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45861233
tagged with: ajax
has comment: http://stackoverflow.com/comment/45861078

http://stackoverflow.com/comment/45909464
comment on: http://stackoverflow.com/a/28812721
type: Comment
score: 2
has text: Thanks. Nice to have a polite version of RTFM :)
type: AnswerComment

http://stackoverflow.com/q/28865868
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28865930
has comment: http://stackoverflow.com/comment/45996786
downvote count: 1
type: Question
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
score: -1
has title: jquery html() write function to include semantic HTML elements?
has body: This is my first post and I'm a student with basically very little knowledge, so please be patient with me. I am trying to use the jquery html() writing capabilities to insert semantic elements into my html page. basically I placed empty html elements: Then I wrote a jquery function: $("header").html( Home WoT Products About Contact us ); Not only does my jquery code not working, it also (for reasons unknown to me) stoped all my other codes from working, and they worked fine before that! If I delete the last function (in the following JS page), everything suddenly works again. Does anyone know what I'm doing wrong? Here is the full JS page content: $(document).ready(function() { //this block of code allows for an expendable menu in the left aside site map menu, taken from: http://jsfiddle.net/VNkM2/4/ and adjusted for my purposes. $('.header ul').hide(); $('.expandable').on('click', function() { $(this).next('ul.expandable2').slideToggle(); $('.ul.expandable2').not($(this).next('ul.ul.expandable2')).slideUp(); }); //this block of code displays the classes and weaves according to the order of clicking the checkboxes $("input[type=checkbox]").click(function(){ var algoType = $(this).attr("name"); var algoDiv = "div#" + algoType; var displayStatus = $(algoDiv).css('display'); if(displayStatus == "none") { $(algoDiv).show(1000) $(algoDiv).insertLast("span#anchor"); } else{ $(algoDiv).hide(1000) } }); //this block of code inserts the header, footer and left aside menu content into each page. This allows me to edit them once and automatically update all pages. $("header").html( Home WoT Products About Contact us ); });
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28865930
favorite count: 0

http://stackoverflow.com/a/28760640
has comment: http://stackoverflow.com/comment/111650287
upvote count: 9
downvote count: 4
has body: Use $('#myTextbox')[0].valueAsNumber = new Date().getTime(). HTMLInputElement interface also has valueAsDate property, but type=datetime-local doesn't support it unfortunately. https://html.spec.whatwg.org/multipage/input.html#input-type-attr-summary
has comment: http://stackoverflow.com/comment/45803331
score: 5
has comment: http://stackoverflow.com/comment/45803318
answers question: http://stackoverflow.com/q/28760254
type: Answer

http://stackoverflow.com/comment/85480320
comment on: http://stackoverflow.com/a/40235334
type: AnswerComment
type: Comment
has text: The only issue with this is that it focuses input on any re-render which might not be desired..
score: 21

http://stackoverflow.com/q/28831045
has answer: http://stackoverflow.com/a/28831381
has answer: http://stackoverflow.com/a/28831095
tagged with: javascript
score: -1
has body: I would like to toggle 2 different classes. (A b), but i am not getting the result. what is the issue with my code? $('button').on('click', function () { $('div').toggleClass("A B"); }); div{ height:20px; } .A{ border:1px solid red; } .B{ border:1px solid blue; } Color Change
answer count: 3
upvote count: 0
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/28831095
tagged with: css
possible better answer: http://stackoverflow.com/a/28831111
has title: 'toggleClass` - how to `toggle` between 2 different `class` names
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28831111
downvote count: 1
type: Question

http://stackoverflow.com/q/28771346
answer count: 2
has body: I'm trying to set up event, which should fire when iframe is loaded. It is important to acknowledge, that I want this event to fire INSIDE iframe, not in parent page. Actually, parent doesn't have to know that iframe was loaded. On the beggining I've tried $(function() {....} (document.ready) event, but it doesn't seem to work as expected. It seems that it fires when parent page was loaded (the same event on parent page works as expexted). Then, I've tried window.onLoad = function() {...} but it doesn't seem to work at all (event not fired). So, how to do that? Again, I'd like the page inside iframe to know that loading was complete. Basically, I'd like to have event, that will work in iframe page as $(function() {}) in parent page.
tagged with: javascript
tagged with: jquery
has title: Event firing when iframe loaded
score: 0
has comment: http://stackoverflow.com/comment/45821451
tagged with: events
linked to: http://stackoverflow.com/q/4057236
type: UnansweredQuestion
tagged with: iframe
type: Question
has answer: http://stackoverflow.com/a/28771475
has answer: http://stackoverflow.com/a/28771589

http://stackoverflow.com/q/28772830
has title: making a label element visible and setting its value in javascript
tagged with: google-maps
answer count: 1
tagged with: javascript
has body: I have some javascript driving Google Maps API on an aspx page. I'm performing some geocoding and I want to give the user feedback if we cannot find their search target but i seem unable to set a the message in the label &lt;label id="msgFeedback" runat="server" class="message"&gt;[message to user]&lt;/label&gt;&lt;br /&gt; on init document.getElementById('&lt;%=msgFeedback.ClientID %&gt;').style.display = 'none'; on unsuccessfuly geocoding document.getElementById('&lt;%=msgFeedback.ClientID %&gt;').style.display = 'block'; document.getElementById('&lt;%=msgFeedback.ClientID %&gt;').value = "Unable to locate the given resort"; I'm successfully displaying the label but it won't take the message. All I'm getting is :
tagged with: google-maps-api-3
score: 0
has answer: http://stackoverflow.com/a/28772880
accepted answer: http://stackoverflow.com/a/28772880
type: AnsweredQuestion
type: Question

http://stackoverflow.com/a/46725023
type: Answer
score: 1
upvote count: 1
downvote count: 0
has body: &lt;input name="upload" type="file"&gt; Solution: var absolutePath = path.join(__dirname,'..\\..\\dash-e2e-tests\\resources\\files-cabin\\test-files\\image.png); element(by.xpath("xpath")).sendKeys(absolutePath);
answers question: http://stackoverflow.com/q/28833844

http://stackoverflow.com/a/41242062
upvote count: 0
has body: Its work definitely. step by step Download zip file from this link:- https://www.dropbox.com/s/ng97xnupazki052/laravel-angular.zip?dl=0 Extract zip file inside html folder. Open terminal and run command – “php artisan serve –port=8080”. Create database in mysql. 5 Set infomation of database in .env file (.env file present in root folder). Like:- database name , username , password Run again command – “php artisan serve –port=8080”. (In new terminal) Run another command - “php artisan migrate:refresh –seed”.(For fetching database). Open browser and type “localhost:8080” (in url bar) Enter email and password : email:-admin@example.com password:-password ======================setup finish=====================
type: Answer
answers question: http://stackoverflow.com/q/28823001
downvote count: 1
score: -1

http://stackoverflow.com/comment/62369151
type: AnswerComment
has text: @s2t2 in gulpfile.js you can specify `var bundler = browserify({ entries: ['./scripts/jsx/app.jsx'], transform: [reactify], extensions: ['.jsx'], debug: true, cache: {}, packageCache: {}, fullPaths: true });` **extensions property is important** then you can remove .jsx extension
type: Comment
score: 0
comment on: http://stackoverflow.com/a/36030027

http://stackoverflow.com/a/28814164
type: Answer
score: 2
downvote count: 1
has comment: http://stackoverflow.com/comment/45900954
has comment: http://stackoverflow.com/comment/45900892
answers question: http://stackoverflow.com/q/28814057
has comment: http://stackoverflow.com/comment/45900613
upvote count: 3
has body: Try fiddling around with absolutely positioning the element. fiddle img { position: absolute; left: 112px; top: -22px; } https://jsfiddle.net/kmbxawdd/2/ Furthermore, you can set the containing elements position to relative, meaning you can style directly to these dimensions rather than the documents.

http://stackoverflow.com/comment/57482694
comment on: http://stackoverflow.com/a/28931528
has text: @TimWilliams Oops!! I have updated the fiddle to include `id` attribute. I'll ping after asking the question and when you're online.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28793315
has body: I'm trying to create an active menu that inserts the CSS class .active into each list item as the user scrolls and the corresponding id is passed. I tested this in JSFiddle so I know my code is solid, but it's having no affect on the site I'm developing: http://dev.celebrate-life.com/ Here's the jQuery: (function($) { // Selectors var lastId, topMenu = $("#menu-mainmenu"), topMenuHeight = topMenu.outerHeight()+15, // All list items menuItems = topMenu.find("a"), // Anchors corresponding to menu items scrollItems = menuItems.map(function(){ var item = $($(this).attr("href")); if (item.length) { return item; } }); // Bind click handler to list items menuItems.click(function(e){ var href = $(this).attr("href"), offsetTop = href === "#" ? 0 : $(href).offset().top-topMenuHeight+1; $('html, body').stop().animate({ scrollTop: offsetTop }, 300); e.preventDefault(); }); // Bind to scroll $(window).scroll(function(){ // Get container scroll position var fromTop = $(this).scrollTop()+topMenuHeight; // Get id of current scroll item var cur = scrollItems.map(function(){ if ($(this).offset().top < fromTop) return this; }); // Get the id of the current element cur = cur[cur.length-1]; var id = cur && cur.length ? cur[0].id : ""; if (lastId !== id) { lastId = id; // Set/remove active class menuItems .parent().removeClass("active") .end().filter("[href=#"+id+"]").parent().addClass("active"); } }); })(jQuery); And this is my menu structure: List Item I have CSS for when the "active" class is applied to a list item, but it's not really relevant until I resolve the issue of applying the class to an in the first place. Why won't this work?
has comment: http://stackoverflow.com/comment/45861583
score: 0
has comment: http://stackoverflow.com/comment/45862336
tagged with: javascript
tagged with: jquery
has title: Why isn't my jQuery for binding to scroll event working?
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45862077
has comment: http://stackoverflow.com/comment/45862451
answer count: 0
tagged with: wordpress
type: Question

http://stackoverflow.com/comment/45817515
has text: This isn't valid HTML markup
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28769472
score: 2

http://stackoverflow.com/comment/45850867
has text: @eqiz: Added some info on the pseudo class used. If you need to match text content to find your label though, it will not help. AFAIK that is currently not possible using CSS selectors alone.
type: AnswerComment
comment on: http://stackoverflow.com/a/28787513
score: 0
type: Comment

masonry
tags question: http://stackoverflow.com/q/28874932
type: Tag
tag name: masonry
tags question: http://stackoverflow.com/q/28768712

eclipse
tag name: eclipse
tags question: http://stackoverflow.com/q/28844907
tags question: http://stackoverflow.com/q/28787462
tags question: http://stackoverflow.com/q/28895046
tags question: http://stackoverflow.com/q/28905855
tags question: http://stackoverflow.com/q/28843358
tags question: http://stackoverflow.com/q/28804411
type: Tag

http://stackoverflow.com/q/28810124
has comment: http://stackoverflow.com/comment/45893045
has answer: http://stackoverflow.com/a/28810586
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28810421
score: 0
has answer: http://stackoverflow.com/a/28810542
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/28810542
answer count: 3
possible better answer: http://stackoverflow.com/a/28810421
type: Question
has body: I have written a directive in angular.js which basically draws boxes on the screen to represent the errors, each error has a popup which is a table, with each row containing some columns of information. For simplification I have kept only one href coulmn here. My requirement is when I hit the suppress href as shown below the corresponding javascipt function should get called, however in the code shown below the function suppressKey is never resolved. Can anybody give me some pointers as to why this is happening? DIRECTIVE (function () { var canvas; var directive = function () { return { restrict: 'EA', scope: { componentId: '=', componentName:'=', siteName:'=', popUpHtml:'=', popupErrorDetails:'=', onMouseEnter: '&', onMouseLeave:'&' }, templateUrl:'shared/directives/_square_draw.html', link : function( scope, element ) { var suppressKey = function() { console.log( "Clicked on the suppress link" ); } var generatePopupHtml = function( errors, exchangeName, onClickHandler ) { var html_content = new Object(); html_content = ' ' + exchangeName + ' '; html_content += ' '; for (var index in errors) { html_content += ' Suppress '; html_content += ' '; } html_content += ' '; return html_content; } scope.$watch('[componentId,componentName,popupErrorDetails,siteName]',function(newValue) { $('.myElement').smallipop(); var canvas = null; var canvas = document.getElementById("canvas"); if( canvas === null ) { canvas = document.getElementById( newValue[0] + newValue[3] ); } canvas.id = newValue[0] + newValue[3]; canvas = document.getElementById(canvas.id); var errors = newValue[2]; var innerHtml = generatePopupHtml( errors, newValue[1] ); canvas.innerHTML= '<div" id="' + canvas.id +'">' + newValue[1] + '' + ''+ innerHtml + ' '; }, true ) } }; }; app.directive('squareDraw', directive); }()); TEMPLATE: UPDATE Hi I have tried the stuff suggested here and yet not able to get the results, while using the scope and $compile were simple to test. I am not sure about the jquery change as …
type: AnsweredQuestion
has title: Not able to trigger the onlick function in the popup inside a directive

http://stackoverflow.com/comment/45886958
type: QuestionComment
has text: It's not working..even alert is not coming when I press 'a'
comment on: http://stackoverflow.com/q/28806949
score: 0
type: Comment

http://stackoverflow.com/comment/45957388
has text: Rob makes a good point. You could use `document.getElementsByClassName` instead.
type: Comment
comment on: http://stackoverflow.com/a/28844030
score: 0
type: AnswerComment

communication
tag name: communication
tags question: http://stackoverflow.com/q/28773900
type: Tag

http://stackoverflow.com/comment/45932370
score: 0
comment on: http://stackoverflow.com/q/28830932
type: Comment
type: QuestionComment
has text: Your concept make no sense, ajax is used for doing something without loading the entire page. but you need to load the page finally. Why don't you directly let the controller to redirect? Since you are doing nothing inside success (except alert and redirect).

http://stackoverflow.com/q/28770405
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: web
favorite count: 0
has comment: http://stackoverflow.com/comment/45819547
type: UnansweredQuestion
tagged with: parameter-passing
tagged with: php
has title: Javascript function in td element with passing parameter
has comment: http://stackoverflow.com/comment/45819398
linked to: http://stackoverflow.com/q/7708819
type: Question
has answer: http://stackoverflow.com/a/28781622
score: -2
tagged with: javascript
has body: I have the following &lt;td&gt; element that displays data retrieved from the database to display the followers an artist has. &lt;td&gt; &lt;span id="followers"&gt; &lt;? echo empty($artist['Artist']['followers']) ? 'N/A' : number_format($artist['Artist']['followers']);?&gt; &lt;/span&gt; &lt;/td&gt; There are some values that are very large and go upto 6 digits. I want to write a Javascript function that will take the substring and only display first 3 digits. How can I write a function and pass the parameter as the value of : $artist['Artist']['followers'] I can do this in PHP, but I need to do it in javascript.
downvote count: 3

http://stackoverflow.com/comment/46050147
comment on: http://stackoverflow.com/a/28894318
has text: This method is not working...I am getting null value on the other page
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46012008
type: QuestionComment
type: Comment
has text: @SureshRamesh [Is this](http://jsfiddle.net/lshettyl/zb14n86r/1/) what you wanted
score: 0
comment on: http://stackoverflow.com/q/28874811

http://stackoverflow.com/comment/45834711
type: Comment
comment on: http://stackoverflow.com/a/28763055
score: 0
type: AnswerComment
has text: @user4613659, I can't write much in the space of this comment box. But I would have javascript 'listening' for an update by having a setInterval() on my webpage that sends an AJAX request every few seconds to a PHP script on a web-server that any uploaded files would be uploaded to. That PHP script would then basically do a check for a new file to show up on the web-server. The server PHP script would respond to the web-page AJAX request by returning 'false' unless it found a new file, then it would return 'true' and have whatever pertinent info your web-page needed about the uploaded file.

http://stackoverflow.com/comment/45901114
score: 0
type: QuestionComment
type: Comment
has text: @Ranjith I meant that both codes proudce the same output array but v2 works and v1 doesn't
comment on: http://stackoverflow.com/q/28814535

http://stackoverflow.com/q/28839349
has title: Duplication form groups with jquery clone
score: 0
has body: I am working on a site that allows users to add multiple criteria to a specific subscription. Heres my form Create Subscription Subscription Nickname Vehicle Make Please Select <?php if($makes): ?> <?php foreach($makes as $make => $v): ?> <option value="<?= $make ?>"><?= $make ?> <?php endforeach; ?> <?php endif;?> What parts do you want to be notified for? Year All Model All Engine All Comp. Family All <?php foreach($families as $family): ?> <option value="<?= $family['comp_family'] ?>"><?= $family['comp_family'] ?> <?php endforeach; ?> Component All + - Save The years are populated when a user selects a make, the models are loaded when a user selects a year, engines are loaded when a users selects model and so forth. I need to be able to add more years/model/engine/comp fam/comp dynamically so I know I could just clone the closest component-tree $('.clone').click(function(e){ e.preventDefault(); $('.components-list').append($(this).closest('.component-tree').clone()); }); but I am stuck as to how to change the index from name="parts[0][year]" to name="parts[index][year]" dynamically when a user clones them as well as keep the previous value. Is there a way to do this with jquery?
tagged with: jquery
has comment: http://stackoverflow.com/comment/45949915
has comment: http://stackoverflow.com/comment/45950310
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45950102
has comment: http://stackoverflow.com/comment/45949325
answer count: 0
type: Question
has comment: http://stackoverflow.com/comment/45949377
has comment: http://stackoverflow.com/comment/45950008
tagged with: javascript
has comment: http://stackoverflow.com/comment/45949443

http://stackoverflow.com/comment/45918089
comment on: http://stackoverflow.com/a/28823301
has text: @crazyCoder here are a few references: http://theoryapp.com/javascript-inheritance-pseudoclassical-vs-prototypal/ and http://javascript.info/tutorial/pseudo-classical-pattern. Basically pseudo-classical JS makes JS behave like a classical language in some regards.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/28842742
type: Answer
has comment: http://stackoverflow.com/comment/45954793
answers question: http://stackoverflow.com/q/28842651
upvote count: 0
has body: Try to add version param to FetchData function. This is simplest way. function TestData(guid, version) { var data = ''; data = FetchData(guid, version, function (guid, msg) { alert(version); return getData(guid, msg); })); }
has comment: http://stackoverflow.com/comment/45997907
has comment: http://stackoverflow.com/comment/45956055
downvote count: 2
has comment: http://stackoverflow.com/comment/45955950
score: -2
has comment: http://stackoverflow.com/comment/45955536
has comment: http://stackoverflow.com/comment/45955735
has comment: http://stackoverflow.com/comment/45955828
has comment: http://stackoverflow.com/comment/45955246
has comment: http://stackoverflow.com/comment/45955442
has comment: http://stackoverflow.com/comment/45997541
has comment: http://stackoverflow.com/comment/45955560

http://stackoverflow.com/comment/45880278
score: 0
type: Comment
has text: Looks like the solution can be found here: http://stackoverflow.com/questions/13600109/how-to-get-hiddenfield-value-in-asp-net-code-behind
type: AnswerComment
comment on: http://stackoverflow.com/a/28802930

http://stackoverflow.com/q/28901039
upvote count: 1
tagged with: html5-canvas
tagged with: http://stackoverflow.com/tag/html
has body: I am attempting to convert a flash as3 file to canvas html5 doc with javascript. How would I convert this code below? nex.addEventListener(MouseEvent.CLICK, onClickHandler); function onClickHandler(myEvent:MouseEvent) { SoundMixer.stopAll(); MovieClip(parent).nextFrame(); } My javascript attempt that is now working. this.nex.onClick = function(){ exportRoot.play(); } Thanks for the help!
has answer: http://stackoverflow.com/a/29128193
accepted answer: http://stackoverflow.com/a/29128193
favorite count: 0
has comment: http://stackoverflow.com/comment/46061969
has answer: http://stackoverflow.com/a/28902630
tagged with: actionscript-3
has comment: http://stackoverflow.com/comment/46061697
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46062135
tagged with: flash-cc
has comment: http://stackoverflow.com/comment/46061359
downvote count: 0
score: 1
has title: Converting as3 btn code to Javascript
has comment: http://stackoverflow.com/comment/46062184
type: Question
linked to: http://stackoverflow.com/q/3743446
possible better answer: http://stackoverflow.com/a/28902630
tagged with: javascript
has comment: http://stackoverflow.com/comment/46062921
answer count: 2

http://stackoverflow.com/q/28863121
has comment: http://stackoverflow.com/comment/45992038
score: 1
tagged with: vbscript
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has title: How can I pass a VBScript string to be the default value in my HTML input box?
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45996366
tagged with: css
has body: I am making an HTA wizard using HTML and VB. This is some VB code that I was given. I need to take the value that SN2 is set to in this and make it appear as the default text in my html code as the computer name. I'm not sure how to call the VB code to display into my wizard's Computer Name textbox. Is this possible to do? VB Code strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colBIOS = objWMIService.ExecQuery _ ("Select * from Win32_BIOS") For each objBIOS in colBIOS MF=objBIOS.Manufacturer SN=objBIOS.SerialNumber Next intCharacters = 7 SN2 = RIGHT(SN, intCharacters) WScript.Echo SN2 WScript.Echo MF I tried the above, but I also tried taking all of that, and making a Sub out of it, like so: Sub SN2 strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colBIOS = objWMIService.ExecQuery _ ("Select * from Win32_BIOS") For each objBIOS in colBIOS MF=objBIOS.Manufacturer SN=objBIOS.SerialNumber Next intCharacters = 7 SN2 = RIGHT(SN, intCharacters) ‘WScript.Echo SN2 'WScript.Echo MF End Sub And then I tried to call it in my HTML code by setting value=SN2, using both the above methods. But obviously that just makes the HTML text box show "SN2" every time: New Computer Details Computer Name I was trying to research a way to set the value to a string set in the VB portion of the script, but wasn't coming up with anything. Is this possible to do? Please note that this HTA is for use in Windows PE so while I can utilize VB and, as it seems, some JS, there aren't all the packages for using other languages or updated versions like HTML5, etc... * Update! By putting the original VB code [first code sequence shown above] in a separate .vbs document, the code runs perfectly and returns the machine name. I was able to call the .vbs from the .hta, but I'm curious as to what it is that makes the code work in a .vb…
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45996328
upvote count: 1
has answer: http://stackoverflow.com/a/28863413

http://stackoverflow.com/q/28803811
has comment: http://stackoverflow.com/comment/45881122
has answer: http://stackoverflow.com/a/28804947
score: 1
upvote count: 1
type: Question
tagged with: javascript
answer count: 1
downvote count: 0
favorite count: 0
has body: I have created a bar chart in D3, on selection of radio-button bar chart is shown and I want to sort by ascending or descending order. When clicking the button it is not sorting, so I don't know what wen t wrong but any help would be appreciated: http://jsfiddle.net/m4s5m5je/2/ [Before adding sorting] After i put sort button, bar chart doesn't show up and sort button too: http://jsfiddle.net/m4s5m5je/3/ var sort_btn = document.getElementById('sort') sort_btn.on("click", function(){ var self = d3.select(this); var ascending = function(a,b){ return a.value - b.value; }; var descending = function(a,b){ return b.value - a.value; } var state = +self.attr("state"); var txt = "Sort data: "; if(state === 0){ data.sort(ascending); state = 1; txt += "descending"; } else if(state === 1){ data.sort(descending); state = 0; txt += "ascending"; } self.attr("state", state); self.html(txt);
tagged with: d3.js
has title: Sorting bar chart in D3 not working
type: UnansweredQuestion

papaparse
type: Tag
tags question: http://stackoverflow.com/q/28849782
tag name: papaparse

http://stackoverflow.com/comment/46270401
type: QuestionComment
has text: Did you get your answer? Can you tell us more about what should happen within the `each()` method?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/28868583

http://stackoverflow.com/comment/45925103
has text: @Jai I have update the code but not working at all..
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28827209
score: 0

http://stackoverflow.com/comment/45819348
has text: Browser Link -- uhhg.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28769823
type: Comment

http://stackoverflow.com/q/28772150
has answer: http://stackoverflow.com/a/28772385
downvote count: 0
answer count: 1
tagged with: javascript
score: 1
favorite count: 0
tagged with: ajax
has body: i have a form like this: <?php include '../db/baza.php'; ?> <?php include 'vrh.php' ?> Dodaj sliku <?php $upit = "SELECT kategorija_ID, kategorija_naziv FROM kategorije ORDER BY kategorija_ID ASC"; $ispis = mysql_query($upit) or die(mysql_error()); $blok_ispis = mysql_fetch_assoc($ispis); $ukupno = mysql_num_rows($ispis); ?> Obavezno odaberite kategoriju kojoj slika pripada <?php do { ?> <option value="<?php echo $blok_ispis['kategorija_ID']; ?>"> <?php echo $blok_ispis['kategorija_naziv']; ?> <?php } while ($blok_ispis = mysql_fetch_assoc($ispis)); ?> <?php mysql_free_result($ispis);?> Uploaded file links will apper here. <?php include 'dno.php' ?> The .js looks like this var app = app || {}; (function(o){ "use strict"; //Privatne metode var ajax, getFormData, setProgress; ajax = function(data){ var xmlhttp = new XMLHttpRequest(), uspjesno_Dodano; xmlhttp.addEventListener('readystatechange', function(){ if(this.readyState === 4){ if(this.status === 200){ uspjesno_Dodano = JSON.parse(this.response); if(typeof o.options.finished === 'function'){ o.options.finished(uspjesno_Dodano); } } else { if(typeof o.options.error === 'function'){ o.options.error(); } } } }); xmlhttp.upload.addEventListener('progress', function(event){ var percent; if(event.lengthComputable === true){ percent = Math.round((event.loaded / event.total) * 100); setProgress(percent); } }); xmlhttp.open('post', o.options.processor); xmlhttp.send(data); }; getFormData = function(source){ var data = new FormData(), i; for(i = 0; i < source.length; i = i + 1){ data.append('file[]', source[i]); } data.append('ajax', true); data.append('kategorija', o.options.kategorija); return data; }; setProgress = function(value){ if(o.options.progressBar !== undefined){ o.options.progressBar.style.width = value ? value + '%' : 0; } if(o.options.progressText !== undefined){ o.options.progressText.innerText = value ? value + '%' : ''; o.options.progressText.textContent = value ? value + '%' : ''; } }; o.uploader = funct…
type: UnansweredQuestion
upvote count: 1
tagged with: php
has title: POST Json to PHP get VAR
tagged with: http://stackoverflow.com/tag/json
tagged with: mysql
type: Question
has comment: http://stackoverflow.com/comment/45823258

calendar
tags question: http://stackoverflow.com/q/28834976
tags question: http://stackoverflow.com/q/28859949
tags question: http://stackoverflow.com/q/28756038
tags question: http://stackoverflow.com/q/28752851
tags question: http://stackoverflow.com/q/28820408
tags question: http://stackoverflow.com/q/28772554
tag name: calendar
tags question: http://stackoverflow.com/q/28851782
tags question: http://stackoverflow.com/q/28796425
tags question: http://stackoverflow.com/q/28783520
type: Tag

http://stackoverflow.com/q/28878031
has answer: http://stackoverflow.com/a/28878124
has body: I'm using Angular v1.4.0-beta.4 and need to iterate an array inside a scope like that: $scope.users = { name:'PC Admin', login:[ { proto:'https', user:'admin', pass:'foobar' }, { proto:'ssh', user:'root', pass:'strang3' } ], ip:'192.168.1.2' } I have looked at Angular ng-repeat docs but can't figure it out. I tried many things the last was like that (html): Usuario: {{user.login[$index].user}} Clave: {{user.login[$index].pass}} But can't show anything. If I show user.login[0].user or user.login[1].pass it shows ok, but how to iterate to show every data in the array? Thanks in advance!
has comment: http://stackoverflow.com/comment/46018230
type: Question
has title: Angular ng-repeat array
tagged with: arrays
tagged with: javascript
score: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/28878124
has answer: http://stackoverflow.com/a/28878985
tagged with: angularjs-ng-repeat
has answer: http://stackoverflow.com/a/28878143
accepted answer: http://stackoverflow.com/a/28878143
tagged with: angularjs
type: AnsweredQuestion

http://stackoverflow.com/comment/45982583
has text: @kamituel I mean like in jquery: $("#input").click()
type: QuestionComment
type: Comment
score: 1
comment on: http://stackoverflow.com/q/28858090

http://stackoverflow.com/a/28776238
upvote count: 1
has comment: http://stackoverflow.com/comment/45830629
has comment: http://stackoverflow.com/comment/45830819
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28775919
answers question: http://stackoverflow.com/q/28775919
type: Answer
has body: this is undefined in your showHidden function. You should pass it from the event handler to the function: $('.color').click(function() { showHidden(this); console.log('not working'); }); function showHidden(el) { // use el or something else here insted of this (this is a reserved word) var alreadyTrue = $(el).find('.hovershow').css('display'); // rest of the code });
score: 1

http://stackoverflow.com/comment/45899343
type: Comment
has text: Why putting expect(true).toBeTruthy(); before the last console.log does not force both wait and the then to be executed before the last log?
type: AnswerComment
comment on: http://stackoverflow.com/a/28813698
score: 0

http://stackoverflow.com/q/28886217
has comment: http://stackoverflow.com/comment/46033691
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46033694
has comment: http://stackoverflow.com/comment/46033948
has body: var slaying = true; var youHit = Math.floor(Math.random() * 2); var damageThisRound = Math.floor(Math.random() * 5 + 1); var totalDamage = 0; while(slaying){ if(youHit){ console.log("You slice the dragon!") totalDamage += damageThisRound; if(totalDamage&gt;=4){ console.log("Dragon is deafeated!"); slaying=false; } var youHit = Math.floor(Math.random() * 2); }else{ console.log("Dragon is too strong for you. Defeated.") slaying=false; } } This is a short program on a tutorial for Javascript. However, I don't see how damageThisRound would ever change value. It is initialised at the top with the Math methods. Then we start the game in the While loop, where the value of damageThisRound never changes. Obviously it should change each time we loop (for each 'round' or 'hit') but nothing changes it within the loop. Am I missing something here?
has comment: http://stackoverflow.com/comment/46033845
answer count: 0
has comment: http://stackoverflow.com/comment/46090697
has comment: http://stackoverflow.com/comment/46033810
upvote count: 1
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/46033938
tagged with: javascript
score: 0
tagged with: while-loop
has comment: http://stackoverflow.com/comment/46034213
has comment: http://stackoverflow.com/comment/46033884
has title: Javascript: Math.random() variable changes each time the variable is referenced?
has comment: http://stackoverflow.com/comment/46034368
favorite count: 0
has comment: http://stackoverflow.com/comment/46033706

http://stackoverflow.com/comment/46053607
has text: @Sphaso You mean I missed kind of this code inside the controller $scope.open = function (){alert('one of buttons was clicked!'); console.log($scope); } However, the button of what raw was clicked, how to now? I don't see anything in scope that would help me to get that info.
type: QuestionComment
comment on: http://stackoverflow.com/q/28896884
score: 0
type: Comment

http://stackoverflow.com/comment/46057211
type: Comment
comment on: http://stackoverflow.com/a/28898668
score: 1
has text: @TobiMcNAmobi How you did ? Please suggest me changes. I'm not much familiar with JavaScript.
type: AnswerComment

http://stackoverflow.com/comment/45939672
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28829356
has text: Seems strange, you can add some picture and some piece of code? maybe i can help better.
type: AnswerComment

http://stackoverflow.com/q/28884773
possible better answer: http://stackoverflow.com/a/28884911
tagged with: arrays
downvote count: 0
tagged with: javascript
favorite count: 0
answer count: 5
has answer: http://stackoverflow.com/a/28884910
has title: Javascript - functional approach to remove empty elements from end of array
has body: The input array is the following: var arr = ["some", "", "", "value", "", "", ""]; I need to remove the empty elements from the tail. So the expected output is: ["some", "", "", "value"] I know a boring reverse loop would work, or pop() until it comes to the first non-empty element. E.g.: while(arr.pop() === "") However, just for fun i would love to see an equally or more efficient (if possible) functional approach. My first functional idea was implementing it with reverse -> reduce -> reverse. However it seems to complex, so i wanted to see if somebody has a better approach. var arr = ["some", "", "", "value", "", "", ""]; var result = arr.reverse() .reduce(function (a, b) { if (b != "") a.addallnext = true; if (a.addallnext === true) a.result.push(b); return a; }, { addallnext: false, result: [] }).result.reverse(); Here is my fiddle: http://jsfiddle.net/fy4cuspq/1/ Preferably i would love the algorithm to use built-in array methods, but if you have some amazing custom method or similar to add to the prototype, that would be great. Note: My goal is not to substitute a more efficient iterative approach with a less efficient functional approach etc... it's just an exploration of functional beauty ;)
has comment: http://stackoverflow.com/comment/46031094
upvote count: 1
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28885280
has answer: http://stackoverflow.com/a/28885710
accepted answer: http://stackoverflow.com/a/28884910
tagged with: algorithm
score: 1
has comment: http://stackoverflow.com/comment/46031064
has comment: http://stackoverflow.com/comment/46031347
has answer: http://stackoverflow.com/a/28884911
has comment: http://stackoverflow.com/comment/46031054
has answer: http://stackoverflow.com/a/28885266

http://stackoverflow.com/q/28902672
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/29442767
has answer: http://stackoverflow.com/a/29442767
tagged with: node.js
type: AnsweredQuestion
type: Question
tagged with: sails.js
has title: AngularJS: Preventing user from accessing a certain state
score: 0
answer count: 2
has body: I'm building an app using sails.js backend and angular in frontend. I'm trying to prevent the user from accessing the admin control page if he's not authorized. I've run into couple of answers already, but none of them seem to fully work. At the moment in my app.js, I have $stateProvider .state('home', { url: "/home", templateUrl: "home/homeTemplate.html", controller: 'homeController' }) .state('adminPage', { url: "/adminPage", templateUrl: "adminPage/adminTemplate.html", controller: 'adminPageController', resolve: { validate: function($q, $sails, $location) { var defer = $q.defer(); $sails.get("/user/getCurrentUser") .success(function(response) { if (response.user.accessAdminPage) { defer.resolve(); } else { defer.reject("Access blocked"); $location.path('/'); } return defer.promise; }) } } }) The current code is partially working; The problem at the moment is, that when the unauthorized user first logs in and lands on the home page, and then accesses localhost:1337/#/adminPage, he actually reaches the page. The url in the address bar changes to localhost:1337/#/home but the user isn't redirected. Now the weird part is, when accessing the home page afterwards through the navbar and trying to access the admin page again, the user IS redirected to the home page as intended (although there's an annoying 'flash' while the page is reloaded). For other people asking, this kind of handling has worked, and I'm wondering what I may have missed and generally any reasons for why my current solution isn't working.
has answer: http://stackoverflow.com/a/28902749
accepted answer: http://stackoverflow.com/a/28902749
tagged with: javascript

http://stackoverflow.com/a/35401223
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/92348934
answers question: http://stackoverflow.com/q/28882468
downvote count: 0
has comment: http://stackoverflow.com/comment/122354768
has body: I was having this same ImagickException Unable to read image blob when converting SVG to PNG. Problem was that 'ghostscript' wasn't installed on my server. apt-get install ghostscript solved the problem for me.
type: Answer

http://stackoverflow.com/a/28823169
type: Answer
answers question: http://stackoverflow.com/q/28821804
score: 71
upvote count: 71
accepted answer of: http://stackoverflow.com/q/28821804
type: AcceptedAnswer
downvote count: 0
has body: US zipcode data is in fact stable enough that you can do this without hitting an API or a database if you only need the State (not the City or anything else). Here's a lightweight JS solution that takes a zipcode (as a string), determines the proper US state, and returns the state's two-letter postal abbreviation (as a string). You can have it return the state's full name by changing the return value on the last line. function getState(zipString) { /* Ensure param is a string to prevent unpredictable parsing results */ if (typeof zipString !== 'string') { console.error('Must pass the zipcode as a string.'); return; } /* Ensure we have exactly 5 characters to parse */ if (zipString.length !== 5) { console.error('Must pass a 5-digit zipcode.'); return; } /* Ensure we don't parse strings starting with 0 as octal values */ const zipcode = parseInt(zipString, 10); let st; let state; /* Code cases alphabetized by state */ if (zipcode &gt;= 35000 &amp;&amp; zipcode &lt;= 36999) { st = 'AL'; state = 'Alabama'; } else if (zipcode &gt;= 99500 &amp;&amp; zipcode &lt;= 99999) { st = 'AK'; state = 'Alaska'; } else if (zipcode &gt;= 85000 &amp;&amp; zipcode &lt;= 86999) { st = 'AZ'; state = 'Arizona'; } else if (zipcode &gt;= 71600 &amp;&amp; zipcode &lt;= 72999) { st = 'AR'; state = 'Arkansas'; } else if (zipcode &gt;= 90000 &amp;&amp; zipcode &lt;= 96699) { st = 'CA'; state = 'California'; } else if (zipcode &gt;= 80000 &amp;&amp; zipcode &lt;= 81999) { st = 'CO'; state = 'Colorado'; } else if ((zipcode &gt;= 6000 &amp;&amp; zipcode &lt;= 6389) || (zipcode &gt;= 6391 &amp;&amp; zipcode &lt;= 6999)) { st = 'CT'; state = 'Connecticut'; } else if (zipcode &gt;= 19700 &amp;&amp; zipcode &lt;= 19999) { st = 'DE'; state = 'Delaware'; } else if (zipcode &gt;= 32000 &amp;&amp; zipcode &lt;= 34999) { st = 'FL'; state = 'Florida'; } else if ( (zipcode &gt;= 30000 &amp;&amp; zipcode &lt;= 31999) || (zipcode &gt;= 39800 &amp;&amp; zipcode &lt;= 39999) ) { st = 'GA'; state = 'Georgia'; } el…

http://stackoverflow.com/comment/45985023
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28858558
type: Comment
has text: with the latest jquery, everything is fine, but my drupal site uses jquery 1.3.4 (which I cannot change), and instead of sending get, jquery sends an options request... any way to force a get?

http://stackoverflow.com/q/28767789
type: Question
tagged with: dynamics-crm-2011
score: 0
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28811782
has answer: http://stackoverflow.com/a/29606504
has comment: http://stackoverflow.com/comment/45816008
type: UnansweredQuestion
tagged with: dynamics-crm-2013
has title: Alert Error Mesage if user forcefully saving a record in dynamics crm 2013
has body: I know to trigger execution a function from a traditional save of the dynamics crm 2013 form but I want to alert the error message from this save button which appears on to the grid of the duplication detection pop up.

http://stackoverflow.com/a/28840716
score: 10
upvote count: 10
has body: You are setting your colors on the point level instead of the series level. This leaves the series colors as the Highcharts default colors despite your column being the color you wanted. The series color is what determines the legend icon color. So this: name: 'Dog', data: [{y: 1, color: '#FF0000'}, {y: 1.45, color: '#FF0000'}] Should be: name: 'Dog', color: '#f00', data: [1,1.45] Updated fiddle with colors set at the series level: http://jsfiddle.net/jlbriggs/8xo2jayg/
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28825135
has comment: http://stackoverflow.com/comment/45954617
answers question: http://stackoverflow.com/q/28825135
type: Answer
has comment: http://stackoverflow.com/comment/45952816

http://stackoverflow.com/a/28884767
has comment: http://stackoverflow.com/comment/46030933
has body: Do it the same way you are assigning object properties using [] notation var someVal = object[variable]; You can also combine notation types var someVal = object[variable][anotherVariable].someProperty;
has comment: http://stackoverflow.com/comment/46030985
answers question: http://stackoverflow.com/q/28884672
has comment: http://stackoverflow.com/comment/46030842
score: 0
type: Answer

http://stackoverflow.com/comment/45793990
comment on: http://stackoverflow.com/a/28756421
has text: SO is not a code writing service. You can ask another question here about doing that, however, it is not constructive to cary out a lengthy conversation in the comments.
type: Comment
score: 1
type: AnswerComment

http://stackoverflow.com/q/28875960
has title: coordinate symbol mangling
score: 0
answer count: 1
tagged with: uglifyjs
tagged with: javascript
type: UnansweredQuestion
tagged with: grunt-contrib-uglify
has body: Does anyone know how to get grunt-uglify-contrib to coordinate symbol mangling between output files? We have a rather large project and break up our uglified files into 2 or more files. An example Gruntfile uglify task of ours looks like: uglify: { app: { options: { compress: false, //mangle: true, mangle: { toplevel: true, except: ['dog', 'cat', 'fish'], eval: true }, preserveComments: false, sourceMap: false, beautify: true }, files: [ { src: [ 'src/dog.js', 'src/cat.js', ], dest: 'dist/base_app.js' }, { src: [ 'src/fish.js', ], dest: 'dist/main_app.js' } ] } } We want toplevel symbol mangling. But the problem is main_app.js cannot see base_app.js's symbols. This all works of course if we build it into a single JS file, but that doesn't work well for us. Any tips on how to get uglify to store the mangled symbol map created while uglifying base_app.js and reuse/reapply the same symbols for main_app.js? Thanks!
type: Question
tagged with: obfuscation
tagged with: uglifyjs2
has answer: http://stackoverflow.com/a/28896482

http://stackoverflow.com/comment/46031410
has text: I somehow forgot about reduceRight :) this is a good approach. Thanks!
comment on: http://stackoverflow.com/a/28884910
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/46011808
has text: Thank you very much @Grimbode !! when you said that the value was "0" from the div it's because the is loaded but not yet the HTML i guess.. so i placed the script under my html and it's kinda logic but very thanks you helped me a lot! :D
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28814352
type: AnswerComment

http://stackoverflow.com/comment/46072927
comment on: http://stackoverflow.com/q/28906527
has text: The title should relate to the specific problem you're having.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28771162
tagged with: javascript
has comment: http://stackoverflow.com/comment/45821016
tagged with: ajax
type: UnansweredQuestion
score: 0
has body: I have a form which has 3 select boxes, 8 check boxes and 1 text field. The second and third select boxes are populated by the prior selection: Select 1 fills select 2 select 2 fills select 3. When I change select 2, select 3 will clear... PERFECT! However, when I change select 1, only select 2 clears. Select 3 still has a value. ... My javascript is: function subject(str) { if (str == "") { return; } else { if (window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { document.getElementById("subject").innerHTML = xmlhttp.responseText; $("#subjects_select").chosen(); } } xmlhttp.open("GET","subject_get.php?subj="+str,true); xmlhttp.send(); } } I have tried using document.getElementById('standards_select').value = ""; and function clear(val) {} as welll asonfocus="this.form.reset()" all to no avail. Can someone make a suggestion as to where I am going wrong? Please do not answer the question outright.
has comment: http://stackoverflow.com/comment/46969635
has answer: http://stackoverflow.com/a/28771424
type: Question
has title: Clearing multiple selects and check-boxes using onChange
has comment: http://stackoverflow.com/comment/47011052
answer count: 1

http://stackoverflow.com/q/28846044
tagged with: javascript
has body: I have a directive : app.directive('toggleText', function () { return { restrict: 'A', link: function (scope, element,attr) { element.bind('click', function(evt) { alert('hello'); }); } }; }) it works when i add it to an element. it alerts "hello". However when i try to create an element inside my controller and add the directive in this fashion: var myElement = document.createElement('div'); var attr = document.createAttribute('toggle-text'); myElement.setAttributeNode(attr); I can see the directive is added to the element in my debugger but it doesn't work. Same problem when trying to add ng-click, ng-include, .. and other angular attributes or directives inside my controller using "setAttributeNode".
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45960666
has answer: http://stackoverflow.com/a/28846092
type: UnansweredQuestion
has title: Angular directive and attributes Don't work when created and set inside Controller
has comment: http://stackoverflow.com/comment/45960848
type: Question
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/45960690
has comment: http://stackoverflow.com/comment/45960885
has comment: http://stackoverflow.com/comment/45960801
has comment: http://stackoverflow.com/comment/45961278
has comment: http://stackoverflow.com/comment/45960946
tagged with: angularjs-scope
score: 0
linked to: http://stackoverflow.com/q/21645146
has comment: http://stackoverflow.com/comment/45960780
answer count: 1

http://stackoverflow.com/comment/45916286
score: 0
type: Comment
type: QuestionComment
has text: If I'm understanding you correctly, they do not finish immediately. The script seems like it wants to run the entire thing all at once.
comment on: http://stackoverflow.com/q/28822353

http://stackoverflow.com/q/28840211
answer count: 1
tagged with: web
has answer: http://stackoverflow.com/a/28841881
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45950414
accepted answer: http://stackoverflow.com/a/28841881
type: Question
has comment: http://stackoverflow.com/comment/45949706
has title: HTML required character set for form fields
tagged with: javascript
score: 0
has body: I have created an online forum with a username and password field. The problem is that I would like to add restrictions on the input to weed out invalid username formats. (Valid username will start with the first 3 characters as XYZ). Is there anyway I can set up a rule that if the first 3 letters of username STARTS with let's say ABC, the Submit button will grey out and display a message that that username is not valid before it checks with the server? But if the user types the required beginning format letters correctly then the Submit button will be enabled? I tried making the code using the same principals as the @ sign being required in an email address but have had strange results.

http://stackoverflow.com/comment/45852395
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28788149
type: AnswerComment
has text: ty very much for all this updates. If you have a free time to set this works i would be very thankful to you otherwise i just need to go from begin and work a lot on this. Please consider the fact there will be more accounts not only one :( Thank you

http://stackoverflow.com/comment/45999010
type: QuestionComment
has text: take a look at https://developer.mozilla.org/en-US/docs/Web/API/Node/nextSibling
type: Comment
score: 1
comment on: http://stackoverflow.com/q/28867110

http://stackoverflow.com/a/28792226
has body: According to W3C Textarea api value, it seems that when invoking the .value attribute of textarea, any carriage return or line feed is transformed into a LINE FEED (10) character (in fact W3C says CRFL but it seems the browsers prefer only LF) - so a script can be platform-independent on line feeds. In a form data, it seems that the fine feeds are transformed into CRLF (13+10). W3C speaks also about a raw value but it's probably internal to any javascript engine and it seems it's not available in Javascript.
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28790525
score: 1
upvote count: 1

http://stackoverflow.com/q/28800566
has comment: http://stackoverflow.com/comment/45876975
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
accepted answer: http://stackoverflow.com/a/28800664
favorite count: 0
tagged with: angularjs
type: Question
tagged with: datatable
has comment: http://stackoverflow.com/comment/45876810
upvote count: 1
has comment: http://stackoverflow.com/comment/45876801
answer count: 1
has body: I have a controller that stores the rankings of songs based on sales. When the controller is initialized it already sends an HTTP GET request to get all the songs that will ever be needed to be displayed (for now the top 20 songs let's say, I think if I ever need to change this i.e. when the user is scrolling, load more songs, shouldn't be too difficult as I just need to change the scope array that holds everything, unless my thinking is incorrect). I absolutely love datatables and they offer easy pagination, sorting, etc. I really only need the sorting part of it. I have my HTML table here: Song Ranking Name Album {{song.song_ranking}} {{song.song_name}} {{song.parent_album}} And this is my angularJS code: indexMod.controller('all_songs', ['$scope', '$http', 'getSongsRankingURL', function($scope, $http, getSongsRankingURL) { var getPara = 'dev=true&getID=2'; $http.get(getSongsRankingURL + getPara) //Fetch the song information for ruby voted songs that are currently airing .success(function(songs) { $scope.Songs = songs; }) .error(function(exception) { alert(exception); }); }]); My question is how do I initialize the table with AngularJS? Including what Datatables told me to do: Has no effect on table, but I did include it inside the ng-app of my DOM. Is this because I am including this jQuery code inside a AngularJS bootstrapped DOM or am I doing this call wrong? I really have no idea how to use jQuery. Is there a better alternative way? I checked the console and there are no errors appearing and I already included all the files datatables told me to include. I included the jQuery CDN as well.
has answer: http://stackoverflow.com/a/28800664
has title: Initializing Datatables with AngularJS
has comment: http://stackoverflow.com/comment/45875597

http://stackoverflow.com/comment/46015949
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28876955
has text: It won't prevent the form from submitting. You have to use `.on('click', function(e){ e.preventDefault(); /* rest of the code */ })`

http://stackoverflow.com/a/28785221
answers question: http://stackoverflow.com/q/28784931
score: 0
type: Answer
has body: function showforces(id) { if ($( '#combatforces'+id ).is( ":visible" )) { document.getElementById('details'+id).innerHTML = 'Show Forces'; } else { document.getElementById('details'+id).innerHTML = 'Hide Forces'; } $('#combatforces'+id).toggle("slow", "swing"); } its Working. ;) Thanks for the Help (id selector) :)

http://stackoverflow.com/q/28833832
has body: This seems like it should be quite easy, but I'm not sure why it isn't working. I have a button I create in Razor like so: @Html.ActionLink("Next", "Add-Remove", "Catalogue-Item-Authors", new { id = Model.CatalogueItemID }, new { @class = "btn btn-default", @id = "next-button", @disabled="disabled" }) I want it to be disabled as first, but when my submit button is clicked, it should be enabled. I have a form and in the OnSuccess parameter of the form I call EnableNext(). Here is the function: function EnableNext() { document.getElementByID('next-button').disabled = false; } It gets called at the right time, I verified that by placing alert("test") in the funciton, but the button is never enabled. Can anyone see why my button wouldn't be getting enabled?? Thanks.
tagged with: asp.net-mvc
type: Question
has answer: http://stackoverflow.com/a/28834048
has comment: http://stackoverflow.com/comment/45937279
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/45937686
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: Enabling Razor Button in Javascript
accepted answer: http://stackoverflow.com/a/28834048
tagged with: razor
has comment: http://stackoverflow.com/comment/45937650
has comment: http://stackoverflow.com/comment/45937468
has comment: http://stackoverflow.com/comment/45937623
type: AnsweredQuestion

http://stackoverflow.com/a/28887603
accepted answer of: http://stackoverflow.com/q/28886832
type: Answer
has body: First, you need to pass in the object you want to process, so your function's signature would be: function myfunction (obj, mod, name, replace) { // Code } The idea is simple: You iterate over the objects in the array, and if the module name is the same as the one you want, then, you check the keys of customUrl to find the specified key and replace it with your new value. Here is the complete function: function myfunction (obj, mod, name, replace) { _.each(obj, function(item) { if (item.module === mod) { _.each(item.customUrl, function(innerItem) { if (_.has(innerItem, name)) { innerItem[name] = replace; } }); } }); } And here is a jsbin with a simple test too. Click on Edit in JS Bin in top right corner and you should see the result in the console tab.
answers question: http://stackoverflow.com/q/28886832
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer

distinct
tag name: distinct
tags question: http://stackoverflow.com/q/28784524
type: Tag

http://stackoverflow.com/q/28822004
has answer: http://stackoverflow.com/a/28825818
answer count: 1
tagged with: query-string
tagged with: angularjs
type: UnansweredQuestion
has body: I've been dealing with this query string param issue for a long time, that if go to / everything works ok but if try something like /?anything it just won't work,these are my two states each one of them in it's own file. var access = accessConfig.accessLevels; $stateProvider.state('store', { abstract: true, templateUrl: 'store/main.html', data: { access: access.user } }); $stateProvider.state('store.home', { url: '/?cart', views: { '': { templateUrl: 'store/home/home.html', controller: 'store.home as vm' } }, data: { title: 'Home' } }); Whenever I go to / I get the expected results with no issues but if I try to go to /?cart or /?anything I get a blank page, I have a stateChangeStart event that is called anytime I go to / but when I go to /?anything the event is not even fired. I'm using html5mode(true) by the way, any clues on what's going on? it works if using ui-sref but not if copying/pasting urls directly in address bar.
type: Question
tagged with: angular-ui-router
tagged with: javascript
has title: angular ui router blank page with query string params
score: 0

http://stackoverflow.com/comment/45884880
type: Comment
type: QuestionComment
has text: What is your current js filename?
comment on: http://stackoverflow.com/q/28805312
score: 0

http://stackoverflow.com/comment/45946501
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28837292
has text: thanks for replying, I am talking a server-side application. can you please tell me how to do this?
type: AnswerComment

http://stackoverflow.com/comment/46079171
comment on: http://stackoverflow.com/q/28869101
has text: Your multidimensional array has invalid syntax. Did you intend for that to be a Ruby or Javascript array? can you fix it?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46175114
has text: Sure! Original: https://www.dropbox.com/s/8lr8tzsa4wbc3wf/Untitled.png?dl=0 ActiveX: https://www.dropbox.com/s/31z8befz0r3ix1j/activex.csv?dl=0 Blob: https://www.dropbox.com/s/kasabugxt0zbwl3/blob_example.csv?dl=0 I had to blank some things out, but you get the gist of it
comment on: http://stackoverflow.com/q/28881124
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28752488
type: AcceptedAnswer
score: 1
answers question: http://stackoverflow.com/q/28752235
type: Answer
accepted answer of: http://stackoverflow.com/q/28752235
has comment: http://stackoverflow.com/comment/45787125
upvote count: 1
has body: the promise-y way: function next() { return vbox1.animate({$backgroundColor: 'transparent'}, 100) .then(function() { return vbox1.animate({$backgroundColor: 'grey'}, 100) }) .then(next.total-- ? next : Boolean); } next.total=100; vbox1.animate({$backgroundColor: 'grey'}, 100).then(next); i use next.total instead of x, but the main idea is to self-call from the tail until you're done instead of looping/queing ahead of time. EDIT: as a re-usable (allows custom target, delay, and # of reps): function animateMyStuff(target, period, reps){ reps=+reps||100; //default and coerce to real number period=+period||100; //default and coerce to real number function next() { return target.animate({$backgroundColor: 'transparent'}, period) .then(function() { return target.animate({$backgroundColor: 'grey'}, period) }) .then(reps-- ? next : Boolean); } return target.animate({$backgroundColor: 'grey'}, period).then(next); } to use like before: animateMyStuff(vbox1, 100, 100); , or with defaults, animateMyStuff(vbox1);
downvote count: 0
has comment: http://stackoverflow.com/comment/45786924

http://stackoverflow.com/q/28833406
has title: enable or disable button based on comparing textboxes values of gridview in c#
accepted answer: http://stackoverflow.com/a/28839284
has comment: http://stackoverflow.com/comment/45937840
type: AnsweredQuestion
downvote count: 0
score: 1
has body: Hi I'm new to javascript and c#. Correct me if anywhere I'm wrong. Here is my gridview code. &lt;asp:GridView ID="GridView1" CssClass="table table-hover table-bordered" runat="server" AutoGenerateColumns="False" ShowFooter="True" CellPadding="4" ForeColor="#333333" GridLines="None" OnRowCommand="GridView1_RowCommand"&gt; &lt;AlternatingRowStyle BackColor="White" ForeColor="#284775" /&gt; &lt;Columns&gt; &lt;asp:BoundField DataField="AvlQty" HeaderText="Available" ItemStyle-Width="35" &gt; &lt;ItemStyle Width="35px"&gt;&lt;/ItemStyle&gt; &lt;/asp:BoundField&gt; &lt;asp:TemplateField HeaderText="Qty" ItemStyle-Width="70"&gt; &lt;ItemTemplate&gt; &lt;asp:TextBox ID="TextBoxQty" onkeyup="Calculation(this)" CssClass="txtQty" runat="server" Text='&lt;%# Eval("SelQty") %&gt;' MaxLength="5" Width="45"&gt;&lt;/asp:TextBox&gt; &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBoxQty" Display="Dynamic" ForeColor="Red" ErrorMessage="RequiredFieldValidator"&gt;*&lt;/asp:RequiredFieldValidator&gt; &lt;asp:regularexpressionvalidator ID="revAvailablePeriod" runat="server" ErrorMessage="Must &gt; 0" ForeColor="Red" controltovalidate="TextBoxQty" validationexpression="^[1-9][0-9]*(\.[0-9]+)?|0+\.[0-9]*[1-9][0-9]*$" setfocusonerror="true" validationgroup="AddAssests" xmlns:asp="#unknown"&gt;&lt;/asp:regularexpressionvalidator&gt; &lt;asp:CompareValidator ID="CompareValidator1" runat="server" ValueToCompare='&lt;%# Eval("AvlQty") %&gt;' ControlToValidate="TextBoxQty" ForeColor="Red" ErrorMessage="Must &lt; Available" Operator="LessThan" Type="Integer"&gt;&lt;/asp:CompareValidator&gt; &lt;/ItemTemplate&gt; &lt;ItemStyle Width="70px"&gt;&lt;/ItemStyle&gt; &lt;/asp:TemplateField&gt; &lt;/Columns&gt; &lt;/asp:GridView&gt; &lt;asp:Button ID="Button2" runat="server" Enabled="false" Text="Place Order &gt;&gt;" CssClass="btn btn-info" OnClick="Button2_Click" /&gt; Now if quantity is greater than available quantity for every row of gridview, than …
tagged with: asp.net
favorite count: 0
type: Question
tagged with: gridview
has answer: http://stackoverflow.com/a/28839284
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/45937549
tagged with: c#
tagged with: javascript

http://stackoverflow.com/q/28900497
type: AnsweredQuestion
tagged with: http
has comment: http://stackoverflow.com/comment/46060460
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28901960
tagged with: post
score: 0
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/28901960
has comment: http://stackoverflow.com/comment/46060242
has body: I have a html web page which I use to get some user input. This input is then posted using jquery to a php script which in turn sends a get request to a REST API to receive json data. My question really is: is it possible to change my php file into another webpage with embedded php and redirect to this while posting the variables to the same script, so I could display the json results in a table on a new page simultaneously. I already receive the json in the javascript file and I know I could use this to create a table, I was just interested if I could in fact do it all in one go on the php page as I already have script written to populate a table using the json data. I have included some basic fragments of my code to help explain what I am doing. HTML: What is the unique id of the beacon? Send Request JS: var uniqueId = document.getElementById('uniqueId'); $.post("send_Request.php", { uniqueId: uniqueId.value },function(result) { alert(result); PHP: $uniqueId = $_POST["uniqueId"]; (GET request using curl) echo ($uniqueId); I tried skipping the javascript step and submitting the form directly, but this always gave me forbidden error messages. as you may have guessed I am very new to this so any advice is welcome.
tagged with: http://stackoverflow.com/tag/html
has title: Can I redirect to a new php file while posting a form input?

http://stackoverflow.com/comment/45820753
type: Comment
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/28770894
has text: @ikegami I don't disagree with that. I'm just saying that the advice "use warnings" might be more helpful if you also tell the OP where to look for warnings, since they don't seem to know.

http://stackoverflow.com/comment/45819647
score: 1
type: AnswerComment
has text: What I find amazing is that if you pass that decimal string to a string to float conversion the result is correct (even if of course it's one of the test cases they use).
type: Comment
comment on: http://stackoverflow.com/a/28770401

http://stackoverflow.com/comment/45910450
comment on: http://stackoverflow.com/q/28819210
type: QuestionComment
has text: yes, compressing your content should be the first thing to try. Best of all, in most cases it can be enabled via server configuration, without modifying your code.
score: 0
type: Comment

http://stackoverflow.com/comment/45915670
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28821739
has text: @Mike'Pomax'Kamermans I don't quite understand, I'm using express in the example, maybe you can give a simple example on what you mean? This is my first day with javascript and node :(
score: 0

http://stackoverflow.com/q/28893927
tagged with: jquery
has title: Loading html page in jquery dialog
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: I am trying to load html page inside jquery dialog but it does not work. below is my jquery code. "openTerms" function is triggered when there is click in link. it opens up the dialog but give me resource not found error. however "terms.html" reside in the project and added as item. Terms and Conditions }
type: Question
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/28893945
answer count: 1

http://stackoverflow.com/comment/46025648
comment on: http://stackoverflow.com/a/28882097
has text: the best thing to do is to advise him about errors. Or remove the button of code in ckeditor. I think you can activate or deactivate buttons [link]http://docs.cksource.com/CKEditor_3.x/Developers_Guide
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28821458
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/45920522
answers question: http://stackoverflow.com/q/28803315
has body: The problem was if((y + curNeighbour[0] &lt; 0) || (y + curNeighbour[0] &gt; ROWS) || (x + curNeighbour[1] &lt; 0) || (x + curNeighbour[1] &gt; COLS)) { Needed to read if((y + curNeighbour[0] &lt; 0) || (y + curNeighbour[0] &gt; ROWS-1) || (x + curNeighbour[1] &lt; 0) || (x + curNeighbour[1] &gt; COLS-1)) { OOPS!

http://stackoverflow.com/comment/45957619
comment on: http://stackoverflow.com/a/28843180
type: Comment
has text: try $("#home_categorias")[0].style.height !== "243px" ? '243px' : '500px'; Or $("#home_categorias")[0].style.height !== "243px" ? '500px' : '243px';
score: 0
type: AnswerComment

http://stackoverflow.com/q/28852193
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45971145
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/45971164
tagged with: javascript
has answer: http://stackoverflow.com/a/28852363
has body: I am using action link in my application. I am having some requirement to call javascript on it's click event. I know that I can do that using following code. @Html.ActionLink("Home","Index","Main",new{@onclick="OnIndexCall"}); Now on the click event of action link I am computing two values in function and i also need to pass that values to the page in which I am redirecting. I don't know how can I do that. Please is there any way to pass the calculated value in from javascript function to redirection page? EDIT :- function OnIndexCall(){ var a=10; var b=a+20; } Now i need to pass these "a" and "b" values to the redirection page.
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45971400
favorite count: 0
has title: Action Link with Javascript and pass value to controller
linked to: http://stackoverflow.com/q/28739962
accepted answer: http://stackoverflow.com/a/28852363
possible better answer: http://stackoverflow.com/a/28852315
tagged with: razor
has answer: http://stackoverflow.com/a/28852315
has comment: http://stackoverflow.com/comment/45971370

http://stackoverflow.com/comment/103478451
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28789323
has text: https://stackoverflow.com/a/58581897/4816207
score: 0

http://stackoverflow.com/q/28790088
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/28790301
tagged with: javascript
tagged with: phonegap-plugins
favorite count: 0
upvote count: 3
linked to: http://stackoverflow.com/q/28542133
has comment: http://stackoverflow.com/comment/45855752
has comment: http://stackoverflow.com/comment/45855544
has comment: http://stackoverflow.com/comment/45855526
tagged with: cordova
type: AnsweredQuestion
score: 3
has title: how to check if your latitude and longitude are inside a circle?
accepted answer: http://stackoverflow.com/a/28790301
type: Question
has body: I am new to the Google Maps API and also mobile development through Phonegap(JavaScript). I am trying to use the current geoLocation obtained through phonegap and use it to determined if that location lies within a circle. Can anyone provide an example of how to perform this? A link to a thread that dealt with this would be useful as well. Thanks!
tagged with: google-maps

http://stackoverflow.com/q/28784852
answer count: 1
downvote count: 0
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: Unable to Pass Values from One PHP Page to Another
tagged with: php
has body: There is similar code in the application that works in this same fashion, but my addition is not working. I can get the search page to pop-up in a new window, but when I select the group to pass to the form page and display the pop-up window will not close or populate the form field on the add form page. Any help would be appreciated. ADD Form PHP Page Want to hide a readonly form field for a group name and display a button to search group listing from another page. Form Field Page HTML Code Group * <div class="col-sm-6" id="div_gr_name" style="<?php if ($gr_id < 1) {?> display:none <?php } else { ?> display:inline <?php } ?>">> <input type='text' name='gr_name' class='span2 form-control' placeholder="Search Group Name" value="<?php if ($gr_id != -1) {echo $gr_name;} else {echo '';} ?>" id='gr_name' readonly='true' required/> <div class="col-sm-2" style = "<?php if ($gr_id > 1) {?> display:none <?php } else { ?> display:inline <?php } ?>"> Search Javascript OpenPopup from footer page function OpenPopup() { try { window.open("searchgroup.php", "_blank", "width=850,height=500,scrollbars=yes,resizable=yes"); } catch (ex) { alert(ex); } finally { event.cancelBubble = true; event.returnValue = false; return false; } } Searchgroup Selection PHP Page Group Selection Page PHP & HTML Code //retrieve our table contents while($row=mysql_fetch_array($rs)){ extract($row); //creating new table row per record echo " {$gr_name} {$gr_leadername} {$gr_leadcontact} {$gr_leademail} ";?><a href='#' onclick="select_group('<?php echo $gr_id ?>', '<?php echo mysql_real_escape_string($gr_name); ?>') ">Select<?php echo " "; } //end table echo " "; } Select Group javascript function function select_group( id, name ){ var selvalue = id; var selvalue1 = name; window.opener.document.getElementById('gr_id').value = selvalue; window.opener.document.getElementById('gr_name').value = selvalue1; if (id!=0) { window.opener.document.getElementById('div_gr_name').style.display = "inline"; } else { windo…
score: 1
upvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28787426

http://stackoverflow.com/comment/45919696
comment on: http://stackoverflow.com/a/28824250
has text: That still has the same problem if async is set to true, none of the markers show up except the very last one which matches up to the southwest corner. Perhaps creating an array and storing each lat/long in the array, then building the markers using the array later? That would just require knowing when all the ajax calls ended...
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/28840846
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/28822353
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28822353
has comment: http://stackoverflow.com/comment/45975545
type: Answer
has body: You are having issues because for each function you are calling SpreadsheetApp.getActiveSpreadsheet . Each time you make this call you create a virtual "copy" of the spreadhseet, and the changes you make to this copy are only passed to the version in Google's servers once the whole script is finished. Hence, if you manually run each of the 3 function that the workflow: Run function 1 -> script finished -> update the spreadsheet in the server -> run function 2 (which now gets the updated spreadsheet) -> script finished -> update the spreadsheet in the server -> run function 3 (which now gets the re-updated spreadsheet) -> script finished -> update the spreadsheet in the server Now, if you run the three functions, the way the script is here is what happens: var ss = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('COST REPORT'); this creates a virtual copy of the spreadsheet -> your code removes the protection from this copy and the server spreadsheet is not modified -> you call again var costReport = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('COST REPORT'); which create a new copy of the server spreadsheet, which hadn't its protections removed yet -> your code tries to clear the data on this copy, which triggers the error. As @Cameron Roberts suggested in his answer Spreadsheet.flush() between the calls will solve the issue, because if forces the changes to be synced to the spreadsheet in the server. But you will have another "problem", which is the amount of copies you are calling, the .getActiveSpreadsheet() is very time consuming! It is better if you make only one call, store in a variable (you already do that, it is your variable ss) and make all the edits to that. Your code will end up looking like this: var ss = SpreadsheetApp.getActiveSpreadsheet(); var costReport = ss.getSheetByName('COST REPORT'); //First clear protection var protections = costReport.getProtections(SpreadsheetApp.ProtectionType.RANGE); for (var i = 0; i &lt; protections.lengt…

http://stackoverflow.com/comment/46028061
type: AnswerComment
has text: This is not the correct answer above. The author found the bug in his form which related to image upload field.
score: 1
comment on: http://stackoverflow.com/a/28865911
type: Comment

http://stackoverflow.com/q/28782783
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28782906
type: Question
has title: MongoDB MonkAPI setting a variable based on find result that is available outside the db request
tagged with: mongodb
answer count: 1
has comment: http://stackoverflow.com/comment/45842198
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/28782906
tagged with: node.js
tagged with: monk
has body: I'm trying to set a variable based on the result of a find through Monk API on MongoDB in a Node JS application (it's my first time of using MongoDB). This is an example of the code I have; var variableIWantToSet; var collection = req.db.get('myCollection'); collection.find( { foo: 'bar' },{ fields : { myTargetField: 1, _id: 0}, limit : 1, sort : {$natural : -1} } , function(err, doc) { if (err) { console.log(err); } variableIWantToSet = doc[0].myTargetField; }); console.log(variableIWantToSet); If I console.log(doc[0].myTargetField) within the function I get the right value, but the console.log(variableIWantToSet) returns undefined. Help appreciated. Thanks.

http://stackoverflow.com/q/28801414
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28801511
type: AnsweredQuestion
tagged with: object
has comment: http://stackoverflow.com/comment/45877511
has comment: http://stackoverflow.com/comment/45877568
type: Question
has title: Using a Form to Create an Object That's Pushed Into an Array
answer count: 2
accepted answer: http://stackoverflow.com/a/28801487
has body: I have an array: var array = [ {id: "X", numberA: 1, numberB: 2, dif: 1}, {id: "Y", numberA: 2, numberB: 3, dif: 1}, {id: "Z", numberA: 3, numberB: 5, dif: 2}, ] I also have a form: ID Start End I'm trying to use that form to create an object and push that object into my array. Dif I can calculate by subtracting numberB from number A. I've tried with jQuery and .val() but can't seem to figure it out. How would I do this? Thank you!
tagged with: arrays
has comment: http://stackoverflow.com/comment/45877435
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/28801511
has answer: http://stackoverflow.com/a/28801487

http://stackoverflow.com/q/28849560
has comment: http://stackoverflow.com/comment/45966653
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28849869
accepted answer: http://stackoverflow.com/a/28849869
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45966599
downvote count: 1
type: AnsweredQuestion
type: Question
upvote count: 1
has title: Clone html elements with jQuery
has body: I have the below elements Camere 1 2 3 4 CAMERA 1 ADULTS 1 2 3 4 Copii 0 1 2 3 > Copil 1 0 1 2 3 4 5 6 7 8 9 10 11 And i clone it with the below jQuery: $(document).ready(function() { //onchange of rooms-count $('#rooms').change(function() { var roomsSelected = $('#rooms option:selected').val(); var roomsDisplayed = $('[id^="room-"]:visible').length; var roomsRendered = $('[id^="room-"]').length; //if room count is greater than number displayed - add or show accordingly if (roomsSelected > roomsDisplayed) { for (var i = 1; i <= roomsSelected; i++) { var r = $('#room-' + i); if (r.length == 0) { var clone = $('#room-1').clone(); //clone clone.children(':first').text("CAMERA " + i); //change ids appropriately setNewID(clone, i); clone.children('div').children('select').each(function() { setNewID($(this), i); }); $(clone).insertAfter($('#room-' + roomsRendered)); } else { //if the room exists and is hidden $(r).show(); } } } else { //else if less than room count selected - hide for (var i = ++roomsSelected; i <= roomsRendered; i++) { $('#room-' + i).hide(); } } }); function setNewID(elem, i) { oldID = elem.attr('id'); newId = oldID.substring(0, oldID.indexOf('-')) + "-" + i; elem.attr('id', newId); } }); How can i change the jQuery so i can change/count the values from the name"rooms[0].." Example: 2 rooms selected The First Wrap to have on their name attribute : rooms[0] The second wrap duplicated to have on their name attribute: rooms[1] and etc The JsFiddle can be found here Thanks

http://stackoverflow.com/comment/45919966
score: 0
type: AnswerComment
has text: Seems like the problem is with key of the POST dict you are trying to access. You are looking for `request.POST.get('normalize_person_name_proper')` whereas it should `request.POST.get('id_normalize_person_name_proper')`
type: Comment
comment on: http://stackoverflow.com/a/28824084

http://stackoverflow.com/a/76622419
score: 1
upvote count: 1
has body: ES6 Arrow Function returns an Object the right ways normal function return an object const getUser = user => { // do something const {name, age} = user; return { name, age }; }; const user = { name: "xgqfrms", age: 21 }; console.log(getUser(user)); // {name: "xgqfrms", age: 21} (js expressions) const getUser = user => ({ name: user.name, age: user.age }); const user = { name: "xgqfrms", age: 21 }; console.log(getUser(user)); // {name: "xgqfrms", age: 21} explain If you were to rewrite this function expression as an arrow function, you might be tempted to simply translate it just like we did in the previous example, like this: let square = n => { square: n * n; }; When you call square, though, you'll notice the function doesn't work as intended. No matter which input value you pass, you'll get undefined as a return value. Why is that? The issue with the arrow function is that the parser doesn't interpret the two braces as an object literal, but as a block statement. Within that block statement, the parser sees a label called square which belongs to the expression statement n * n. Since there's no return statement at all, the returned value is always undefined. To be precise, the body of the function consists of a block statement whose statement list contains a single statement, a labeled statement. Its body is an expression statement holding the binary expression. There's no return statement. refs https://github.com/lydiahallie/javascript-questions/issues/220 https://mariusschulz.com/blog/returning-object-literals-from-arrow-functions-in-javascript
answers question: http://stackoverflow.com/q/28770415
downvote count: 0
type: Answer

http://stackoverflow.com/comment/117810355
has text: This is the only right answer here. The `this.b = new this.B;` part is important.
type: AnswerComment
comment on: http://stackoverflow.com/a/49658867
score: 0
type: Comment

http://stackoverflow.com/comment/45850077
score: 0
type: AnswerComment
has text: @KjellIvar, Yes, I tried id and setInitialSliderValues() is still called when the slides are 0 (it means that the view is not updated with the new data).
type: Comment
comment on: http://stackoverflow.com/a/28786910

http://stackoverflow.com/comment/46145964
comment on: http://stackoverflow.com/a/28906153
type: AnswerComment
has text: Minor syntax error on `getTenantRemindersForProperty` in not closing the `applyAllAndMerge` function call end paren. Otherwise example worked perfect to flatten and merge reminder objects into a single array per user. `applyAllAndMerge` function is a handy way to achieve this.
score: 0
type: Comment

http://stackoverflow.com/a/28894769
type: AcceptedAnswer
type: Answer
has body: Just so this question has a decent answer: My situation, described in the question, was solved by the comment of user Jack hardcastle. Stupid question probably: what happens if you state POST in your form tag? The type for AJAX request is POST, however the form still has no action/method defined so the form execution would still follow those. It should be noted, as was by Sparky, that the form attribute is not supported by all browsers incl. IE.
accepted answer of: http://stackoverflow.com/q/28815172
answers question: http://stackoverflow.com/q/28815172
downvote count: 1
score: -1
upvote count: 0

http://stackoverflow.com/q/28901955
has body: How can I apply toggleClass() to an input="checkbox" when it has been checked? I'm trying to add the class "calcButtonOn" when checked: jQuery(function() { var total = 0; jQuery("input").click(function() { total = 0; jQuery("input:checked").not('input[value="reset"]').each(function() { total += parseFloat(jQuery(this).val()); }); jQuery("#Totalcost").html("Save up to " + total + "%"); }); });
has answer: http://stackoverflow.com/a/28902080
downvote count: 0
tagged with: toggleclass
score: 1
tagged with: jquery
has title: Add toggleClass to a Checkbox with jQuery
favorite count: 0
has answer: http://stackoverflow.com/a/28902291
type: Question
has comment: http://stackoverflow.com/comment/46063810
tagged with: http://stackoverflow.com/tag/html
tagged with: checkbox
has comment: http://stackoverflow.com/comment/46063369
answer count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/28902092
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/comment/45995342
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/28760618
score: 0
has text: @gopinathshiva When I say 'destroy existing tokens' on logout, I mean remove any record of access/refresh tokens from storage on that particular device - yes the access token would still be valid if someone had access to it. In my solution I suggest using short-lived access tokens to limit this 'window' of opportunity (which always exists). I would suggest the solution you have provided is really losing the point of jwts altogether.

http://stackoverflow.com/q/28795684
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28796380
has answer: http://stackoverflow.com/a/28796380
has comment: http://stackoverflow.com/comment/45865906
has comment: http://stackoverflow.com/comment/45867359
type: Question
has answer: http://stackoverflow.com/a/28795720
upvote count: 9
has answer: http://stackoverflow.com/a/28795777
has answer: http://stackoverflow.com/a/28795727
tagged with: javascript
has body: im learning javascript, and i have been following some video tutorial on youtube this is the original code function add(first, second, callback){ console.log(first+second); callback(); } function logDone(){ console.log("done"); } add(2,3,logDone); and the result of code on above is 5 main.js (line 4) done main.js (line 9) and i make slight change to the code into this function add(first, second, callback){ console.log(first+second); callback; } function logDone(){ console.log("done"); } add(2,3,logDone()); and the result is this done main.js (line 9) 5 main.js (line 4) my question are: could you explain to me why i got the result pile up that way?, and what the difference if we call a function with the bracket () and without the bracket ()?
has answer: http://stackoverflow.com/a/28795723
has title: Need explanation about javascript function and callback
score: 7
favorite count: 0
accepted answer: http://stackoverflow.com/a/28795777
answer count: 5
downvote count: 2
has comment: http://stackoverflow.com/comment/45865932

http://stackoverflow.com/comment/46021653
has text: with : /(\d*[\.])?\d+/ ----> don't work, the input field let write character's for example ---> 145.5r and with option 1, doesn't let write characters but also ".", and i need let write "."
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28879865

http://stackoverflow.com/comment/45792703
type: Comment
comment on: http://stackoverflow.com/a/28755674
type: AnswerComment
has text: Thanks Mark. You made it more understandable!! So all the elements are 0-base index or it depends? At the moment I know that table in jquery is a 0-base index.
score: 0

http://stackoverflow.com/comment/45957785
type: Comment
has text: What about `$scope.X = angular.copy($scope.Y)`? Not sure why you were using arrays
type: QuestionComment
comment on: http://stackoverflow.com/q/28844446
score: 0

http://stackoverflow.com/a/28860143
has comment: http://stackoverflow.com/comment/45989835
answers question: http://stackoverflow.com/q/28859771
has body: You can use scope.$apply (see this updated Plunkr): app.directive('myDirective',function(){ return { restrict: 'A', scope: { myCallback: '&amp;' }, link: function(scope,element,attrs){ element.bind('keyup',function(){ scope.$apply(function() { scope.myCallback({item: 'test'}); }); }); } }}); Since you're using an isolate scope, the function happens outside the context of the controller, and the model isn't updated unless you force a new digest cycle.
score: 0
type: Answer

http://stackoverflow.com/q/28869531
type: Question
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
has title: Need help passing $(this) for an .on("click") callback
has answer: http://stackoverflow.com/a/28869624
accepted answer: http://stackoverflow.com/a/28869624
has body: Its my first time using a function callback instead of using an anonymous function for an on.("click") event. The console.log show the object key as undefined, and if I pass the $(this) ass the callback param it won't work Can anyone please help pass help me figure this out. Any help would be really appreciated function getFreelancersInfo(elem){ var id = elem.attr("id"); /*@div_wrapper stores arbitrary data about the freelancer and also acts as a wrapper for *each freelancer */ var div_wrapper = $("div#"+id); var freelancer_info_obj = { first_name : div_wrapper.attr("data-first-name"), last_name : div_wrapper.attr("data-last-name"), email : div_wrapper.attr("data-email") }; //TODO create and send welcome email console.log(freelancer_info_obj); return false; } $(".approve").on("click",getFreelancersInfo() );
type: AnsweredQuestion

http://stackoverflow.com/a/28892686
type: Answer
has body: In app.run listen for state change event and based on the state change set a flag in $rootScope. In your HTML: Based on the flag use ng-if and include different header templates.
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28892498
answers question: http://stackoverflow.com/q/28892498
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/45921850
type: AnswerComment
comment on: http://stackoverflow.com/a/28822624
type: Comment
has text: You should replace **_plugin_** with your enabled **DSpaceControlledVocabulary** plugin. The example there in `dspace.cfg` is srsc, I assume you have enabled your custom **controlled vocabulary**, so change the string `_plugin_` with the name of your vocabulary. Hope this is clear.
score: 0

http://stackoverflow.com/comment/46016984
score: 0
type: QuestionComment
type: Comment
has text: Not sure about what I'm saying here, but try `$(".filtres").each( function(){ $(this).ddslick(.....) })` I hope that, by doing so, it will wrap each one in its own function (that is, a closure) and may isolate the scopes...
comment on: http://stackoverflow.com/q/28876748

http://stackoverflow.com/comment/45916283
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28822298
has text: I just tried it in Firefox and it works fine. In the latest version of Chrome it requires 2 clicks to open
type: Comment

http://stackoverflow.com/a/28861168
type: Answer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28861006
answers question: http://stackoverflow.com/q/28861006
has body: HTML: &lt;input type="radio" name="myradio" id="1" class="myradio" value="1"&gt; 1 &lt;input type="radio" name="myradio" id="2" class="myradio" value="2"&gt; 2 &lt;input type="radio" name="myradio" id="3" class="myradio" value="3"&gt; 3 jQuery: $(function() { $('.myradio:not(:checked)').on('change', function() { window.location.href = "http://www.example.com?variable=" + this.value; }); }); Concept Verification $(function() { $('.myradio:not(:checked)').on('change', function() { alert( this.value ); }); }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;input type="radio" name="myradio" id="1" class="myradio" value="1"&gt; 1 &lt;input type="radio" name="myradio" id="2" class="myradio" value="2"&gt; 2 &lt;input type="radio" name="myradio" id="3" class="myradio" value="3"&gt; 3
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/45950489
type: Comment
has text: Just in case this helps, if you are reading input as a number use `parseInt($('#tickets').val(), 10)` this treats the input as a base-10 number
comment on: http://stackoverflow.com/a/28840549
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45881563
score: 2
comment on: http://stackoverflow.com/a/28803429
type: AnswerComment
has text: If you could please edit your answer and explain what the code you're showing does, and why/how that code answers the question, it would make your answer even more helpful.
type: Comment

http://stackoverflow.com/a/28842412
has comment: http://stackoverflow.com/comment/45953970
has comment: http://stackoverflow.com/comment/45954342
answers question: http://stackoverflow.com/q/28842270
has comment: http://stackoverflow.com/comment/45954078
score: 0
type: Answer
has body: The rule: /*media all*/ .main-navigation li &gt; a { display: block; padding: 0 35px; } looks to be causing your issue, adjust the right padding for that last element. A css reset would likely have helped to resolve this, but it can be a PITA to deal with adding one late in the game.

http://stackoverflow.com/a/28862039
type: Answer
answers question: http://stackoverflow.com/q/28858731
has body: If you really want the query string You can do this with hidden input that will include the id, I also modified the names to make it less complicated &lt;form&gt; &lt;input id="submit" name="Vote" type="submit" value="Yes" class="btn btn-success" /&gt; &lt;input id="submit" name="Vote" type="submit" value="No" class="btn btn-warning" /&gt; &lt;input name="id" type="hidden" value="&lt;?php echo $_GET['id']?&gt;" /&gt;&lt;/form&gt;
score: 0

http://stackoverflow.com/comment/45975046
comment on: http://stackoverflow.com/a/28854455
type: Comment
score: 0
has text: @somethinghere When it makes your work easy and more readable, why not?
type: AnswerComment

http://stackoverflow.com/a/58506388
has body: if you are using maxAge for session cookie duration: app.use(session({ secret: '&lt;session_secret&gt;', resave: true, saveUninitialized: true, maxAge: 3600000 // 1 hour (in milliseconds) }));
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/28839532
upvote count: 2
score: 2

http://stackoverflow.com/a/28760819
score: 2
has body: You can use jQuery deferred mechanism described here http://api.jquery.com/jquery.when/ var r1 = $.get('fasta'); var r2 = $.get('pattern'); function seqleng(seqfile,pattern){ alert(seqfile); alert(pattern); } $.when(r1, r2).done(function(seqResponse, patternResponse) { var filedata = seqResponse[0], seq = filedata.replace(/[\n\s]/g,""); var seqpass = new seqleng(seq, patternResponse[0]); });
has comment: http://stackoverflow.com/comment/45802341
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28760585
has comment: http://stackoverflow.com/comment/45802531
upvote count: 2
accepted answer of: http://stackoverflow.com/q/28760585
type: Answer

http://stackoverflow.com/a/28871715
upvote count: 1
answers question: http://stackoverflow.com/q/28871448
downvote count: 0
type: Answer
has body: function showData() { var data =[[0,23,'A'],[1,33,'B'],[2,44,'c'],[3,55,'D']]; var html = ""; var x = new Array(); x = document.querySelectorAll("#Ultra") for (var i=0; i&lt;data.length; i++) { if(data[i][0]== x[1].value) { html = data[i][1] ; } } document.getElementById("data").innerHTML = html; } Changes to be made: 1)querySelectorAll('#ultra') 2)x[1].value This works
score: 1

http://stackoverflow.com/q/28829474
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28829612
score: 0
has title: How to dynamically set padding and have it show without refreshing?
answer count: 1
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has body: I'm trying to make a design with a background at 100% height and then a padded area below it (outside view) with some other content on the same background. Having the padded area fixed in height is easy enough, but I'm using Bootstrap's col-sm-4 divs with text in them, so as you resize the window, their width is decreased and height increased (because of the text having to fit), and then after a point collapsing into a stack of three divs. Here's the jsfiddle, and the code: HTML: ... Some filler text ... ... Some filler text ... ... Some filler text ... CSS: .background { box-sizing: content-box; background: url('http://www.mixflavour.com/wp-content/uploads/2014/11/Nature-Wallpaper-03.jpg'); position: relative; height: 100%; } body, html { height: 100%; } .bottom-div { position: absolute; bottom: 0; background:rgba(0,0,0,0.5); width: 100%; } I want to set the padding-bottom of the background div to the same as the size of the bottom-div. Instead of manipulating the padding via css, I decided to try using jQuery to set the padding dynamically. It works well, except for one thing: it only works after refreshing the page after each resize! jQuery code: $(".background").css("padding-bottom", $(".bottom-div").height()); You can try this by squeezing the window together until the padded area is thrown into view erroneously, then refreshing again to see it go back where it should be. Why does it behave this way and is there a fix, using jQuery or not? Edit: Updated the fiddle because I forgot closing one of the divs.
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28829612

http://stackoverflow.com/q/28846952
has comment: http://stackoverflow.com/comment/46521377
tagged with: firefox
tagged with: javascript
has comment: http://stackoverflow.com/comment/45976652
has comment: http://stackoverflow.com/comment/45988278
score: 0
has comment: http://stackoverflow.com/comment/46011696
answer count: 0
has title: Crossrider Popup Cached in Firefox
type: UnansweredQuestion
tagged with: crossrider
type: Question
has body: I'm having problems with a very simple popup code in a Crossrider extension and Firefox (tested on 35.0.1 and 25.0.1 but I'm pretty sure it's the same thing on other versions as well). Here's extension.js appAPI.ready(function($) { randNumber = Math.floor((Math.random() * 1000) + 1); appAPI.message.toBackground({ msgRand: randNumber }); }); And this is background.js appAPI.ready(function($) { appAPI.message.addListener(function(msg) { randomNumber = msg.msgRand; appAPI.browserAction.setResourceIcon('icon.png'); appAPI.browserAction.setPopup({ html: '&lt;h1&gt;' + randomNumber + '&lt;/h1&gt;', height: 300, width: 300 }); }); }); The code above is supposed to display a random number between 1 and 1000 but it works only the first time the button is clicked and from then on it keeps showing the same number no matter whether I open a link in the same tab or in a new tab. The only time the number changes is when I open a new window (but if I open a new link in the same window or a new tab in that window the number is still the same as the one initially displayed for the window). For example if I open a site in window 1 and click the extension's button it could display 111. Every other link I open in this window will always display 111 when I click the button. If I open another window while window 1 is open it might show 555 when I click the button and that will be the number for every new tab in this window. I've tried the same code in Chrome (SRWare Iron to be precise) and IE 11 and everything seems to work as expected. I'm also pretty sure that the problem is coming from the setPopup portion of the code, because I've tried to display the value of randomNumber via alert and it was different every time (plus the code works in IE and Chrome (haven't tested it in Safari yet)). Here's the extension ID in case it might help - 72164 P.S. My English skills are a bit rusty, so let me know if I haven't explained something correctly.

http://stackoverflow.com/comment/46064113
comment on: http://stackoverflow.com/a/28901276
type: AnswerComment
score: 0
has text: thanks, doesnt seem to work for me, still getting the reference error, maple not defined. im wondering is the error in relation to the optValue variable, or is it saying that the actual value of the html select option is not defined?
type: Comment

http://stackoverflow.com/a/28853798
has comment: http://stackoverflow.com/comment/45979840
score: 1
has comment: http://stackoverflow.com/comment/45974765
answers question: http://stackoverflow.com/q/28853636
has comment: http://stackoverflow.com/comment/45974557
has comment: http://stackoverflow.com/comment/45974518
has body: As per your code: The validation errors are captured in : error(function(data, status, headers, config) { _showValidationErrors($scope, data.validationErrors); }); So instead of _showValidationErrors, use $scope.errors = data.validationErrors; Now in your HTML: &lt;input type="email" ng-model="user.emailId" name="emailId" id="userEmailID" placeholder="Enter your email ID" /&gt; //Here, I want to display inline error message &lt;ul ng-if="errors.length &gt; 0"&gt; &lt;li ng-repeat="error in errors"&gt;{{error.errorCode}} {{error.errorDescription}}&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; To reset errors : inside your $scope.loginSubmit = function(user) { $scope.errors = []; // reset errors to empty array EDIT: // as per comment To show specific error messages: $scope.getErrorMessage = function(errorCode) { var error; $scope.errors.forEach(function(error) { if(error.errorCode === errorCode) { error = error.errorDescription; } }); return error; } Now in your HTML: &lt;input type="email" ng-model="user.emailId" name="emailId" id="userEmailID" placeholder="Enter your email ID" /&gt; &lt;div ng-if="getErrorMessage('emailId')"&gt; {{getErrorMessage('emailId')}} &lt;/div&gt;
has comment: http://stackoverflow.com/comment/46003176
has comment: http://stackoverflow.com/comment/45974405
has comment: http://stackoverflow.com/comment/45974632
has comment: http://stackoverflow.com/comment/45976321
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45974241
type: Answer

http://stackoverflow.com/q/28790584
favorite count: 0
has body: I am in the process of trying to figure out how to increment the last element in an array using pop() and push(). I keep getting the original values after incrementing the pop array. What needs to happen is that newArray needs to equal _array with the last element incremented by 1. For example '0,0,7' will change to '0,0,8'. A slight shove in the right direction would be much appreciated. var someArray = [0,0,7]; var incrementLastArrayElement = function(_array) { var newArray = []; var popArray = someArray.pop(); newArray = someArray.push(popArray++); } console.log(incrementLastArrayElement(someArray));
answer count: 5
has title: JavaScript increment last array element
downvote count: 1
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28790600
has answer: http://stackoverflow.com/a/28791085
has answer: http://stackoverflow.com/a/28790600
has answer: http://stackoverflow.com/a/28790626
accepted answer: http://stackoverflow.com/a/28791007
score: -1
has comment: http://stackoverflow.com/comment/45857341
type: Question
upvote count: 0
has comment: http://stackoverflow.com/comment/45857216
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/28790688
has answer: http://stackoverflow.com/a/28791007

http://stackoverflow.com/q/28859828
downvote count: 0
tagged with: javascript
answer count: 1
has answer: http://stackoverflow.com/a/28860291
has body: Add Image What I want to do is enter a URL like: https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ50tL9UuaKby66enSL1s-5F6jVWmp5uzMQ1Rpx2yNV-was0pvR and show it in the PARAGRAPH tag when I click the button. How can I accomplish this? I am open to using JavaScript.
favorite count: 0
has title: How do I make the input read and display my image?
upvote count: 2
accepted answer: http://stackoverflow.com/a/28860291
has comment: http://stackoverflow.com/comment/45985296
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46025839
has comment: http://stackoverflow.com/comment/45985306
type: Question
has comment: http://stackoverflow.com/comment/45985914

http://stackoverflow.com/q/28817063
answer count: 1
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/28818451
type: AnsweredQuestion
has title: Odd Angular/Bootstrap Dropdown Behavior
type: Question
has body: I've got an application requiring a series of dropdowns. The functionality requires me to be able to switch between normal dropdown behavior and multi-select behavior. I have made slight modifications to the ui.boostrap.dropdown from the Angular Directives for Bootstrap (see Dropdown). Everything works well, except for a gray bar after clicking (looks like the :hover css stays active after clicking) when in Multiselect mode. When I toggle off then back on, the highlight goes away, as if the hover event has somehow completed. Process: Open the dropdown Click Multiselect Move the mouse and Multiselect stays highlighted, as if the ":focus" tag is not removed. Visually: The mouse is over 345 in this image, Multiselect should not be highlighted. Angular HTML for dropdown: {{ vm.selected }} {{ company.name }} Multiselect Close Here's the event where the click on an element is handled: vm.event = {}; vm.event.select = function(company) { if (!vm.multi.select) { clearCompanies(false); company.selected = true; vm.selected = company.name; vm.isopen = false; } else { if (company.name !== vm.defaultCompany) { company.selected = !company.selected; vm.selected = vm.multi.title + countCompanies(); } } }; Link to Plunker. I have had no luck tracking this down and my instinct is that the issue is in the CSS, but it's standard bootstrap CSS. Any assistance would be appreciated.
tagged with: javascript
tagged with: jquery
tagged with: angular-ui-bootstrap
has answer: http://stackoverflow.com/a/28818451
score: 0

http://stackoverflow.com/a/30137524
accepted answer of: http://stackoverflow.com/q/28808463
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28808463
upvote count: 81
type: Answer
has body: The simple answer is that it makes protractor not wait for Angular promises, such as those from $http or $timeout to resolve, which you might want to do if you're testing behaviour during $http or $timeout (e.g., a "loading" message), or testing non-Angular sites or pages, such as a separate login page. For example, to test a button that sets a loading message during a request you can set it to true when fetching an element + checking its contents element(by.css('button[type="submit"]')).click(); browser.ignoreSynchronization = true; expect(element(by.css('.message')).getText().toBe('Loading...'); browser.ignoreSynchronization = false; expect(element(by.css('.message')).getText().toBe('Loaded'); A more involved answer is that setting it to true means that subsequent additions/injections to the control flow don't also add browser.waitForAngular. There are cases when an understanding of the control flow, and when/how things are added/injected into it is important. For example if you're using browser.wait to test a multi-stage process, the function passed to wait is injected into to the control flow after the rest of the functions in the test have added to the control flow. element(by.css('button[type="submit"]')).click(); browser.ignoreSynchronization = true; expect(element(by.css('.message')).getText().toBe('Stage 1'); browser.wait(function () { // This function is added to the control flow after the final // browser.ignoreSynchronization = false in the test // so we need to set it again here browser.ignoreSynchronization = true; return element(by.cssContainingText('.message', 'Stage 2')).isPresent().then(function(isPresent) { // Cleanup so later tests have the default value of false browser.ignoreSynchronization = false; return !isPresent; }); }); expect(element(by.css('.message')).getText().toBe('Stage 2'); browser.ignoreSynchronization = false; expect(element(by.css('.message')).getText().toBe('Stage 3'); An alternative to using browser.ignoreSynchronization is to…
score: 81

http://stackoverflow.com/comment/46038118
has text: Then you are in trouble, there is not a standard way to do it. You should use some hacks like injecting some js code to your html etc.
comment on: http://stackoverflow.com/q/28887801
score: 0
type: Comment
type: QuestionComment

phpcrawl
tags question: http://stackoverflow.com/q/28791657
tag name: phpcrawl
type: Tag

http://stackoverflow.com/comment/45925014
type: Comment
type: QuestionComment
has text: @Aria.I need the viceverse of what you said. I need to call a method in codebehind from javascript.
score: 1
comment on: http://stackoverflow.com/q/28827196

http://stackoverflow.com/q/28904160
answer count: 2
has title: How to use 'chunky' (coarse-grained) zoom levels with Leaflet maps?
has answer: http://stackoverflow.com/a/28905684
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I am using Leaflet.js for desktop and mobile browser-based maps, and need to support a variety of map tile services. Some of these tile services are defined with coarse zoom levels (like 1, 5, 10, 15), and if I make a request for an unsupported zoom level, the service does not return a tile. (For example, if I request service/tiles/6/x/y when zoom level 6 is not supported). Leaflet tile layers support minZoom and maxZoom but I'm trying to figure out if there is a best practice for doing coarse zoom levels, and if other folks have encountered this. I found this post on GitHub that addresses tile scaling for unsupported zoom levels: https://github.com/Leaflet/Leaflet/pull/1802 But I am not sure if this applies. (I'm not sure I want to scale or 'tween' the zoom levels... but if this makes sense and is not too difficult I am willing to try.) I've started experimenting with this approach which gets messy because zooming can cause more zooming and I have to differentiate user-driven zooms from system-driven zooms: // layer metadata (assumption: Levels is in ascending order of zoom) var layerDef = { Title: 'Service lines', Levels: [10, 15, 19] }; // create Leaflet Tile Layer and show on map var layer = L.tileLayer('://host/service/{z}/{x}/{y}'); layer.minZoom = layerDef.Levels[0]; layer.maxZoom = layerDef.Levels[layerDef.Levels-1]; layer.addTo(map); // initialize lastZoom for coarse zoom management var lastZoom = map.getZoom(); var userZoom = true; // handle supported zoom levels when zoom changes map.on('zoomend', function (e) { // get new zoom level var z = e.target._zoom || map.getZoom(); if (userZoom) // assume user initiated this zoom { // is this zoom level supported? var zIdx = $.inArray(z, layerDef.Levels); if (zIdx === -1) { // zoom level is not supported; zoom out or in to supported level // delta: &lt; 0 for zoom out, &gt; 0 for zoom in var zDelta = z - lastZoom; var zLastIdx = $.inArray(lastZoom, layerDef.Levels); var newZoom = -1; if (zDelta &gt; 0) { // user …
favorite count: 0
score: 3
upvote count: 3
type: UnansweredQuestion
tagged with: gis
tagged with: leaflet
has answer: http://stackoverflow.com/a/28913210
has comment: http://stackoverflow.com/comment/46072783
type: Question

http://stackoverflow.com/q/28777211
tagged with: jasmine
favorite count: 0
answer count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: jestjs
has title: TypeError with jest.setMock()
has comment: http://stackoverflow.com/comment/45832620
has body: I'm wondering why there's a type error when I explicity set a mock for jest. I do this: /** @jsx React.DOM */ //tests/app/headernav-test.js jest.dontMock('../../../app/modules/HeaderNav.jsx'); jest.dontMock('../../TestContext'); jest.setMock('../../../app/modules/LoginStatus.jsx', './mocks/LoginStatus.jsx'); var React = require('react/addons'), MyComponent = require('../../../app/modules/HeaderNav.jsx'), TestUtils = React.addons.TestUtils, TestContext = require('./../../TestContext'), component = TestContext.getRouterComponent(MyComponent).component; describe('HeaderNav', function() { it('renders the header nav', function() { }); }); and I get this. TypeError: /home/4m1r/project/tests/app/modules/headernav-test.js: Cannot read property 'TestUtils' of undefined mocks/LoginStatus.jsx is simply this: var React = require.requireActual('react'); var LoginStatus = React.createClass({ displayName: 'LoginStatus', render: function() { return ( &lt;div id="" className="LoginStatus"&gt; &lt;div className="login-status-box"&gt; &lt;/div&gt; &lt;/div&gt; ); } }); module.exports = LoginStatus; Here's the Jest documentation: https://facebook.github.io/jest/docs/api.html#jest-setmock-modulename-moduleexports
score: 2
type: Question
tagged with: reactjs
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45904860

http://stackoverflow.com/comment/46023065
type: QuestionComment
has text: https://css-tricks.com/persistent-headers/ something llke this?
comment on: http://stackoverflow.com/q/28879501
score: 0
type: Comment

http://stackoverflow.com/q/28847045
score: 0
has comment: http://stackoverflow.com/comment/45975461
has comment: http://stackoverflow.com/comment/45968248
answer count: 0
tagged with: parse-platform
has body: I've usually been making queries to a class for a single, directed object using the objectId and it's all been working smoothly. However I am now trying to get all of the objects in a given class. var values; var Class = Parse.Object.extend(className); var query = new Parse.Query(Class); console.log(objectID); if (typeof objectID !== "undefined") { //if the user specified objectID query.get(objectID, { success: function(retrieveObject) { for (var i = 0; i &lt; keys.length; i++) { values[i] = query.get(keys[i]); } }, error: function(error) { console.log("Failed to retrieve " + className + ': ' + error.message); } }); } else { //if not return all query.limit(1000); query.exists("objectId"); query.find({ success: function(results) { console.log("the results are " + results); for (var i = 0; i &lt; results.length; i++) { for (var j = 0; j &lt; keys.length;j ++) console.log("key " + j + " is " + keys[j]); console.log("the result for " + j + " is " + results[i]); var object = results[i]; values[i][j] = object.get(keys[j]); console.log("the value for the key in result is " + values[i][j]); } }, error: function(error) { console.log("Failed to retrieve " + className + ': ' + error.message); } }); } For the life of me I cannot figure out why this does not work. "results" comes out as an array of the correct number of values, but each is "[object Object]" Any ideas?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45968286
has comment: http://stackoverflow.com/comment/45977314
type: Question
has comment: http://stackoverflow.com/comment/45968310
has comment: http://stackoverflow.com/comment/45975418
has comment: http://stackoverflow.com/comment/45975784
has comment: http://stackoverflow.com/comment/45978858
has comment: http://stackoverflow.com/comment/45975246
has title: Constraint-less Parse query returns blank objects
tagged with: javascript
has comment: http://stackoverflow.com/comment/45976066

http://stackoverflow.com/comment/46405509
score: 0
has text: The code snippets I provided above are syntactically correct. My problem though, was that it took me awhile to get my head wrapped around the concept of programming sequential asynchronous calls to Parse and other APIs from CloudCode. Ultimately I was able to accomplish what I wanted using one single function with a string of promises using the following pattern.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28825513

http://stackoverflow.com/a/28786734
answers question: http://stackoverflow.com/q/28786632
upvote count: 6
has body: You have a typo. It's getElementById, not getElementsById. Only one single element can be gotten with a certain ID. And you should be using createElement and insertBefore to insert the element between the two other elements, appendChild appends to the element. function addParagraphs() { var p2 = document.createElement('p'); p2.innerHTML = "paragraph 2"; var elem = document.getElementById("p1"); elem.parentNode.insertBefore(p2, elem.nextSibling); } paragraph 1 paragraph 3 paragraph 4
type: Answer
score: 6
downvote count: 0

http://stackoverflow.com/a/28871300
answers question: http://stackoverflow.com/q/28848152
downvote count: 0
score: 1
has body: I would start by visiting https://www.codecademy.com/learn/introduction-to-javascript. This course covers all the main javascript elements including some oop.
upvote count: 1
type: Answer

http://stackoverflow.com/a/28850107
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28835278
has body: With a help from a stackoverflow user who posted an answer in a similar thread found here, i've came up with a working solution (not sure if it's optimised well, but it works): $(function() { var currentURL = window.location.href; if(/folder-name/.test(currentURL)) { $.ajax({ url: "../include/demo-1.html", success: function (data) { $('body').append(data); }, dataType: 'html' }); }; if(/another-folder-name/.test(currentURL)) { $.ajax({ url: "../include/demo-2.html", success: function (data) { $('body').append(data); }, dataType: 'html' }); }; // etc... }); Hope this helps someone else with same question.
type: Answer
accepted answer of: http://stackoverflow.com/q/28835278
score: 0

http://stackoverflow.com/comment/46064537
has text: I wasn't .I just looked up what that was and not having static content serving was my problem. Thanks so much for your help
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28901323

http://stackoverflow.com/comment/45816850
comment on: http://stackoverflow.com/q/28769036
has text: _"will appear"_ ? inside of clicked `div` ?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46086689
comment on: http://stackoverflow.com/a/28880280
score: 1
has text: Yes, that's another way of making the browser fetch the file every time the page gets loaded. But I believe that this problem should be solved by setting proper cache related headers, not by some "versioning" tricks. Especially when you want to ensure that `*.nocache.js` never gets cached, while **also** ensuring that `*.cache.*` files will *always* get cached (they can easily weight over 1MB and you don't want the user to download that again and again).
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45937802
has text: This also didn't work. I got: Undefined index: search in signin.php on line 29 strpos(): Empty needle in signin.php on line 32
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28833356

http://stackoverflow.com/comment/46021689
type: AnswerComment
comment on: http://stackoverflow.com/a/28880055
type: Comment
has text: Unfortunately the code I'm working on depends on OrbitControls too heavily and I would really like to avoid rewriting the whole thing to use TrackballControls
score: 0

http://stackoverflow.com/q/28761218
answer count: 1
accepted answer: http://stackoverflow.com/a/28761560
tagged with: javascript
has title: Javascript - window.open() popup size issue
tagged with: window.open
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
tagged with: google-chrome
type: Question
has body: I am trying to display preloaded images in a newly created popup window. Here is the code: HTML &lt;div id="hiddenImages" style="display: none;"&gt;&lt;/div&gt; &lt;a href="BigImage1.png" onclick="OpenImage(this,event);" target="_blank"&gt; &lt;img src="SmallImage1.gif" width="196" height="130" border="0"&gt;&lt;/a&gt; &lt;a href="BigImage2.png" onclick="OpenImage(this,event);" target="_blank"&gt; &lt;img src="SmallImage2.gif" width="196" height="130" border="0"&gt;&lt;/a&gt; JS &lt;script type="text/javascript"&gt; preloadImages('BigImage1.png','BigImage2.png'); &lt;/script&gt; // PreLoadImages: function preloadImages() { var hiddenDiv = document.getElementById('hiddenImages'); var i; var img; for(i = 0; i &lt; arguments.length; i++) { img = document.createElement('img'); img.src = arguments[i]; img.id = arguments[i]; img.alt = ''; hiddenDiv.appendChild(img); } } // OpenImage: function OpenImage(element,e) { e.preventDefault(); var big_image = element.getAttribute("href"); var img = document.getElementById(big_image); var top = (screen.height/2)-(img.height/2); var left = (screen.width/2)-(img.width/2); var str = "\"" + "width=" + img.width + ",height=" + img.height + ",top=" + top + ",left=" + left + ",status=0, scrollbars=0, resizable=0" + "\""; alert(str); var myWindow = window.open(img.src , "win1", str); } When I output 'str' variable in OpenImage() function, this code gives perfect dimensions of the big image. However, the size of popup window is always different than size of the image. IE stretches the popup window horizontally while Google Chrome stretches it vertically. In spite of the fact that both browsers show exactly the same dimensions for the image. And these dimensions of the image are actually being set as size of the pop up window. Regards.
tagged with: internet-explorer
has answer: http://stackoverflow.com/a/28761560
score: 0

http://stackoverflow.com/q/28815150
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/45902174
has comment: http://stackoverflow.com/comment/45902061
has comment: http://stackoverflow.com/comment/45902209
upvote count: 2
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45902087
has comment: http://stackoverflow.com/comment/45927242
downvote count: 1
has title: What causes this odd behaviour with .length in JS?
has comment: http://stackoverflow.com/comment/45902064
type: Question
has comment: http://stackoverflow.com/comment/53218340
has answer: http://stackoverflow.com/a/32686858
score: 1
has comment: http://stackoverflow.com/comment/45902293
has body: I'm getting some odd behaviour with the .length property in JS, just wondering if someone could clarify as to why I am getting the results that I am doing. This doesn't work: var ticketsProductName = $.trim($('#ticketsProductName').val()); if (ticketsProductName.length &lt;= 5) { // Do error stuff } ticketsProductName.length returns undefined and thus the statement fails every time. But... This does work: if ($.trim($('#ticketsProductName').val()).length &lt;= 5) { // Do error stuff } And yields the desired result. Could someone please explain as to why I can place the trimmed value of #ticketsProductName into the ticketsProductName variable but not call .length on it later? or am I missing something really darn obvious? Thanks in advance.

http://stackoverflow.com/comment/46035900
score: 2
comment on: http://stackoverflow.com/a/28887153
type: AnswerComment
has text: Can you create a jsfiddle so I can see what you're doing? I'm not sure I understand you. So the function latLngSet works but not if you call it by the input button?
type: Comment

http://stackoverflow.com/q/28772460
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45823965
has answer: http://stackoverflow.com/a/28772755
has comment: http://stackoverflow.com/comment/45823696
tagged with: regex
has comment: http://stackoverflow.com/comment/45823707
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45823526
accepted answer: http://stackoverflow.com/a/28772755
type: Question
has title: HTML, javascript form check with regex
tagged with: javascript
has comment: http://stackoverflow.com/comment/45823811
has body: I am having an issue with the following code: If you run the following code you get a form with 3 fields: Student ID, Course ID and e-mail. Using javascript i have to check if the student field has 7 characters with two first beeing CS followed by 5 digits. I have to do the same check with the Course ID field but for 5 characters starting with CL followed by 3 digits. The Student ID check works fine but the Course ID does not. From what i see i dont have a mistake ? Thanks in advance. Student ID: Course ID: E-mail:
possible better answer: http://stackoverflow.com/a/28772672
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28772672

http://stackoverflow.com/comment/45847410
type: AnswerComment
score: 0
type: Comment
has text: @m56 Maybe it didn't work because he was still assigning the directiveData object to $scope, and not to the newly created scope.
comment on: http://stackoverflow.com/a/28774036

http://stackoverflow.com/comment/45829045
type: Comment
has text: Hey @Vipul, are you entering "dog" or "Dog" - the logic is checking for "Dog" (case matters). If you wanted to test any case, you could update the logic with a regex check like `/cow/i`. I did realize ONE issue you had - that is the check of `&& sound[n]` doesn't actually do anything (so in the previous fiddle, both answers of "Dog" and "Cow" will alert - although it may just be Dog... Here's an updated fiddle that addresses this: http://jsfiddle.net/akx19Loq/2/
comment on: http://stackoverflow.com/a/28750877
type: AnswerComment
score: 0

http://stackoverflow.com/comment/46025491
type: Comment
comment on: http://stackoverflow.com/a/28869793
has text: I'm not saying you can't be productive and work with it. When troubleshooting things, it's useful to know how the whole thing works. jQuery definitely makes it quicker to get things done, but sometimes it's also overkill. I am not saying learn how to do all the complexities like animations and popups. Just have an understanding of the core. People learn different ways, though, and that's why we have differing opinions. :)
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45962082
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28768370
has text: And is it possible to get the country ??
score: 0

http://stackoverflow.com/comment/45835233
type: QuestionComment
comment on: http://stackoverflow.com/q/28778796
has text: what is the format to store the url in text file `url100.txt`?
score: 0
type: Comment

http://stackoverflow.com/a/28828123
accepted answer of: http://stackoverflow.com/q/28826836
type: AcceptedAnswer
has body: Solved! The problem was that I was injecting my service in app.config and it mustn't be. Then, it would be this way: myApp.config(["$routeProvider", "$httpProvider", function($routeProvider, $httpProvider, AbastecsService) { ... }
answers question: http://stackoverflow.com/q/28826836
type: Answer
score: 0

http://stackoverflow.com/comment/45865492
score: 2
comment on: http://stackoverflow.com/q/28795476
type: Comment
has text: Why? It may be we can give you a better approach to your underlying goal.
type: QuestionComment

http://stackoverflow.com/q/28841791
tagged with: javascript
tagged with: express
answer count: 2
has answer: http://stackoverflow.com/a/28842071
upvote count: 1
favorite count: 0
possible better answer: http://stackoverflow.com/a/28842001
has answer: http://stackoverflow.com/a/28842001
tagged with: node.js
type: AnsweredQuestion
has title: A Simple Way To Edit And Delete files in a directory in Node.js?
downvote count: 0
score: 1
tagged with: http://stackoverflow.com/tag/json
has body: Hello I'm creating a simple blog using express.js, using a data.json file to create/update/delete, posts based on the id. And every time I do that, I use fs.writeFile to create and update markdown posts using the slug data in the json array. So when I create a post named First Post, I get a first-post.md file on my /path folder. The Problem: Every time I'm updating a file and use fs.writeFile I'm creating a new file path without deleting the old one? Example: Updating the name data on the json array: first post to first post update I get a markdown file first-post-update.md.But the old first-post.md file still exists. Is it possible to delete every markdown file on a directory path that doesn´t have a corresponding link to each slug data in the data.json file? Something like this: function deleteFiles(files, callback){ files.forEach(function(filepath){ //Filter every item.id on data.json and get the slug params. fs.unlink(filepath, function(err) { //If any markdown file don´t have a corresponding link to each slug data delete them. }); } data.json example: { "posts": [ { "name": "First Post", "desc": "Some description", "slug": "first-post", "id": "07cbc3854-7fa7-4451-883c-a9c8c87143ef" } ] } some example code to create and update posts: exports.save = function (req, res) { var slugTitle = slug(req.body.name).toLowerCase().split('.').join(""); var description = req.body.desc; db.add({name:req.body.name, desc:req.body.desc, slug: slugTitle}); fs.writeFile("path/"+slugTitle+".md", description, function(err) { if(err) { console.log(err); } else { console.log("The new post was created on path/"+slugTitle+".md"); } }); res.redirect('/post'); }; exports.update = function (req, res) { var slugTitle = slug(req.body.name).toLowerCase().split('.').join(""); var description = req.body.desc; db.update({id: req.body.id, name: req.body.name, desc: req.body.desc,slug: slugTitle}); fs.writeFile("path/"+slugTitle+".md", description, function(err) { if(err) { console.log(err); } else…
type: Question
accepted answer: http://stackoverflow.com/a/28842071

http://stackoverflow.com/comment/46030044
comment on: http://stackoverflow.com/a/28883337
type: AnswerComment
score: 0
type: Comment
has text: Ok if I post the IDs as an array, how would I then change the PHP file getCover to return an array of 'pageLocation's (the first one from each 'page')?

http://stackoverflow.com/a/28800266
answers question: http://stackoverflow.com/q/28800122
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/28800122
has comment: http://stackoverflow.com/comment/45875674
type: Answer
has body: Impossible render page.evaluate() is the sandboxed page context. It doesn't have access to page or any other variables defined outside of it. You need to move the page.render("e.png") outside and behind it to see anything. ID selectors Your selectors are wrong. login_user_login and user[password] are supposed to be ids, but you're writing the CSS selector as if there are login_user_login and user elements in the DOM which is not the case. Correct ID selectors would be #login_user_login and [id='user[password]']. Note that the second one must be written differently than the first one, because it contains [] which is reserved for attribute selectors. Page load waiting And finally, after you click to login, it takes a while, so you need to wait until the page has reloaded. You can use a static timeout using setTimeout or a more sophisticated method using waitFor from the examples. Final simple script: var page = require('webpage').create(); page.open('http://www.twitch.tv/login', function() { page.includeJs("http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js", function() { page.evaluate(function() { $("#login_user_login").val("username"); $("[id='user[password]']").val("password"); $(".button.primary:first").click(); // click login button }); setTimeout(function(){ page.render("e.png"); // see if anything happens phantom.exit(); }, 5000); // 5 seconds }); });
has comment: http://stackoverflow.com/comment/45874998
upvote count: 3
has comment: http://stackoverflow.com/comment/45875028
score: 3

http://stackoverflow.com/q/28768196
tagged with: javascript
has comment: http://stackoverflow.com/comment/45815018
has title: jQuery ajax call race condition?
tagged with: jquery
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/45815191
has comment: http://stackoverflow.com/comment/45815211
has body: I have the following javascript function: function deploy() { $.ajax({ url: '/Theme/Deploy', type: 'POST' }); location.reload(); } This function is called when a button is clicked. I want to kick off the server call then immediately refresh the page. When I use the code above, it never makes the server call, it only refreshes the page. When I remove the location.reload() call, it makes the call successfully. Is there a race condition or something happening where it reloads the page before the ajax call even though it's below it in code?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28768222
has answer: http://stackoverflow.com/a/28768806
type: Question
has comment: http://stackoverflow.com/comment/45815088

http://stackoverflow.com/comment/45902059
type: Comment
has text: Thanks for this hint, it actually opened a PDF file (another step accomplished) but this file is still completely empty. There seems to be an error during fhe file upload :-/
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28811408

http://stackoverflow.com/a/28824280
score: 0
answers question: http://stackoverflow.com/q/28824227
type: Answer
has body: Try this one. I'm using jquery to make this task done. HTML Face savoring delicious food JS $(function(){ $('.dontsplit').on('mouseover','.notranslate', function(){ console.log($(this).text()); //see result }) })

http://stackoverflow.com/q/28829283
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45934719
favorite count: 0
has comment: http://stackoverflow.com/comment/45930057
has body: Basically I'm trying to make a skull flicker over a persons face, I've achieved it flashing up once. But the effect I'm trying to achieve is that it looks more organic and random. Here's the basic structure: function flicker() { var maxFlick = 6, amount = Math.round(Math.random() * maxFlick), running = false; function showHide() { $flicker.show(); running = true; setTimeout(function() { $flicker.hide(); running = false; }, 100) } for (i = 0; i &lt; amount; i++) { if(!running) { showHide(); } } } setInterval(flicker, 4000); I had presumed that running a for loop with a random amount statement would produce the desired effect, but it's still only flashing up once every 4000milliseconds as previously. Any pointers?
tagged with: animation
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45929508
has comment: http://stackoverflow.com/comment/45929653
score: 1
has answer: http://stackoverflow.com/a/28833601
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45936366
has comment: http://stackoverflow.com/comment/45932322
has title: Creating random image flicker
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45928949
has comment: http://stackoverflow.com/comment/45930998
accepted answer: http://stackoverflow.com/a/28833601

http://stackoverflow.com/comment/45963106
has text: Even if we are not using `.val()`, it gives out the value. How come `.next().data('task-hours')` fetches value ?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28847087
type: AnswerComment

http://stackoverflow.com/a/43927590
answers question: http://stackoverflow.com/q/28861357
has body: I would recommend using the $window provider from angular // set $window.sessionStorage.setItem('Plants', angular.toJson($scope.userPlantList)); // get $scope.userPlantList = angular.fromJson($window.sessionStorage.getItem('Plants')) || [];
score: 1
has comment: http://stackoverflow.com/comment/112210607
upvote count: 2
has comment: http://stackoverflow.com/comment/126457202
has comment: http://stackoverflow.com/comment/112217885
downvote count: 1
type: Answer

http://stackoverflow.com/comment/46045137
has text: @zerkms please tell me if my added edits help you
comment on: http://stackoverflow.com/q/28892118
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/31287098
answers question: http://stackoverflow.com/q/28877848
downvote count: 0
has comment: http://stackoverflow.com/comment/63858799
has comment: http://stackoverflow.com/comment/93649878
has body: Try this var fluent_ffmpeg = require("fluent-ffmpeg"); var mergedVideo = fluent_ffmpeg(); var videoNames = ['./video1.mp4', './video2.mp4']; videoNames.forEach(function(videoName){ mergedVideo = mergedVideo.addInput(videoName); }); mergedVideo.mergeToFile('./mergedVideo.mp4', './tmp/') .on('error', function(err) { console.log('Error ' + err.message); }) .on('end', function() { console.log('Finished!'); });
type: Answer
has comment: http://stackoverflow.com/comment/93650164
score: 20
has comment: http://stackoverflow.com/comment/131586619
upvote count: 20

http://stackoverflow.com/comment/45906800
has text: @vks: and anubhava's answer for instance would accept `09` as well. Don't see problems with that...
score: 0
comment on: http://stackoverflow.com/a/28817322
type: AnswerComment
type: Comment

http://stackoverflow.com/a/28835561
has comment: http://stackoverflow.com/comment/45942194
answers question: http://stackoverflow.com/q/28835271
type: Answer
score: 0
has body: Try this, remove "dataType: html" and change this: (echo instead return): [HttpPost] public string storeProductInSession(int id, string naam, string afbeelding, string beschrijving, decimal prijs, int aantal) { echo "This method is going to do session stuff, but for now it just has to return this string"; }
has comment: http://stackoverflow.com/comment/45942427

http://stackoverflow.com/a/28899459
type: Answer
has body: You have to write a callback function to retrieve the data when your server side function runs successfully. function myFunction() { google.script.run.withSuccessHandler(onSuccess).getData(); } function onSuccess(data) { //the argument data contains the array } See this document for more information and examples. https://developers.google.com/apps-script/guides/html/reference/run
score: 0
answers question: http://stackoverflow.com/q/28898814

http://stackoverflow.com/q/28873555
upvote count: 1
tagged with: ruby-on-rails
has body: I don't know how to get special value in element like this: My HTML: <% @files = Dir["app/assets/images/*.*"] %> <% @files.each do |f| %> <img src="/assets/<%= f.split('/').last %>" width="50" height="55" id="abc" /> <% end %> My javascript: function openimage(element) { console.log(element) } And my element return like this: " " I want to get this line "/assets/line_icon.png", but I don't know how to do that. Please! help me. p/s: I must add "this" in onclick="openimage(this), because I'm using loop in ruby on rails
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28873753
score: 1
possible better answer: http://stackoverflow.com/a/28873849
has comment: http://stackoverflow.com/comment/46009776
has answer: http://stackoverflow.com/a/28873849
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
answer count: 3
has title: How to get values in function element
has answer: http://stackoverflow.com/a/28873708
tagged with: ruby
accepted answer: http://stackoverflow.com/a/28873708

http://stackoverflow.com/q/28867372
linked to: http://stackoverflow.com/q/503093
accepted answer: http://stackoverflow.com/a/28867503
tagged with: twitter-bootstrap
answer count: 2
downvote count: 1
has comment: http://stackoverflow.com/comment/45999478
has title: Open a new page instead of a "your message sent" popup
type: AnsweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/28867503
tagged with: javascript
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/28867467
type: Question
has answer: http://stackoverflow.com/a/28867467
has body: I am using "Agency" a one page Bootstrap template. When the form is successful, and the email is sent, a popup message appears. Instead of a popup, I would like to have a new page open. $(function() { $("input,textarea").jqBootstrapValidation({ preventSubmit: true, submitError: function($form, event, errors) { // additional error messages or events }, submitSuccess: function($form, event) { event.preventDefault(); // prevent default submit behaviour // get values from FORM var name = $("input#name").val(); var email = $("input#email").val(); var phone = $("input#phone").val(); var message = $("textarea#message").val(); var firstName = name; // For Success/Failure Message // Check for white space in name for Success/Fail message if (firstName.indexOf(' ') &gt;= 0) { firstName = name.split(' ').slice(0, -1).join(' '); } $.ajax({ url: "././mail/contact_me.php", type: "POST", data: { name: name, phone: phone, email: email, message: message }, cache: false, success: function() { // Success message $('#success').html("&lt;div class='alert alert-success'&gt;"); $('#success &gt; .alert-success').html("&lt;button type='button' class='close' data-dismiss='alert' aria-hidden='true'&gt;&amp;times;") .append("&lt;/button&gt;"); $('#success &gt; .alert-success') .append("&lt;strong&gt;Thank You. Your message has been sent. &lt;/strong&gt;"); $('#success &gt; .alert-success') .append('&lt;/div&gt;'); //clear all fields $('#contactForm').trigger("reset"); }, error: function() { // Fail message $('#success').html("&lt;div class='alert alert-danger'&gt;"); $('#success &gt; .alert-danger').html("&lt;button type='button' class='close' data-dismiss='alert' aria-hidden='true'&gt;&amp;times;") .append("&lt;/button&gt;"); $('#success &gt; .alert-danger').append("&lt;strong&gt;Sorry " + firstName + ", it seems that my mail server is not responding. Please try again later!"); $('#success &gt; .alert-danger').append('&lt;/div&gt;'); //clear all fields $('#contactForm').trigger("reset"); }, })…
score: -1

http://stackoverflow.com/q/28753785
has body: I'm trying to make a grid of divs depending upon user input. I.e - user puts in the number 10, I create a 10x10 grid of divs. The overall size of the grid, regardless of the number of squares inside of it, should be the same size. I'm initially starting off the page with a 4x4 grid table at 1000x1000 pixels. The problem I'm running into is that if I just set the divs = 25% of the height/width of the container div, they don't fit (even with messing with negative margins to remove the space). I'm assuming this is because the parent div container has a border, and each div has a border, which all eat into the available space. I can easily enough rig the sizes so that they fit. My problem is that I know once I start varying the amount of grids in the square, that fixed number will no longer work. How can I set the divs to fill the container, taking into account border sizes and whatnot? Here's what I have so far: https://jsfiddle.net/14Lnera5/1/ .wrapper { margin: auto 50 auto auto; width: 1000px; height: 1000px; border: black 4px solid; } .indivCell { display: inline-block; border: black 1px solid; background-color: #E0E0D1; width: 25%; height: 25%; margin: -1px; } I don't necessarily need the answer, but a hint or two would be great. I've been googling all over the place for this and everyone keeps saying just to set the size to a percentage, but I don't think that'll work as putting in more divs will increase the amount of borders inside of it and thus throw off the available space. Thanks
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45789591
has comment: http://stackoverflow.com/comment/45789405
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45789474
has answer: http://stackoverflow.com/a/28753906
possible better answer: http://stackoverflow.com/a/28753913
has answer: http://stackoverflow.com/a/28753913
accepted answer: http://stackoverflow.com/a/28753906
has title: How can I make variable amount of divs fill parent container 100%?
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/q/28891603
tagged with: jquery
favorite count: 0
has body: The code below is what I use now, just to set the cursor position to the tail of span var node = document.getElementById("span_first"); var range = document.createRange(); range.setStartAfter(node); var sel = window.getSelection(); range.collapse(true); sel.removeAllRanges(); sel.addRange(range); http://jsfiddle.net/vXnCM/3837/ But I want to set the cursor position at any place in the span, how can I do? Thanks you.
tagged with: http://stackoverflow.com/tag/html
tagged with: css
possible better answer: http://stackoverflow.com/a/54189544
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/54189544
downvote count: 0
has comment: http://stackoverflow.com/comment/46045123
has comment: http://stackoverflow.com/comment/46044707
has comment: http://stackoverflow.com/comment/46045030
type: Question
has title: How to set cursor position in span in contenteditable div
tagged with: javascript
upvote count: 2
has comment: http://stackoverflow.com/comment/46045051
answer count: 2
has answer: http://stackoverflow.com/a/28892840
accepted answer: http://stackoverflow.com/a/28892840

http://stackoverflow.com/comment/45998681
has text: That's what it sounds like. What are your intentions?
comment on: http://stackoverflow.com/q/28866321
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/28763466
score: 0
answer count: 2
tagged with: jquery
has body: it's possible using casper function inside casper.evaluate() with jquery code inside? I need to iterare elements in a way similar to how jquery does. I'm loading jquery.js lib This is my try script: casper.evaluate(function(){ $('#size-modal .size-panel-title a').each(function(){ $(this).click(); accordionTab = $(this).attr('href'); casper.capture(screenShotOutput + "PDP-" + accordionTab +".png"); }); }); in this page there are 2 accordion and i want a screenshot for each opened accordion. It seems to works but no feedback is given and it exit form evaluate() on the first capture() iteration. the test pass without making screenshot. If i add after evaluate() casper.capture(screenShotOutput + "PDP-accordion.png"); and comment the capture() inside the evaluate(), i can see that the code before works well, the screenshot is made and each accordion is open. The problem is that casper use javascript selector so if i specify only casper.click('#size-modal .size-panel-title a'); casper.capture(screenShotOutput + "PDP-" + accordionTab +".png"); without using casper.evaluate() only one accordion will be opened. Thanks
has answer: http://stackoverflow.com/a/29797183
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28763952
has title: Use casper function inside casper.evaluate()
tagged with: casperjs
type: Question
tagged with: phantomjs
tagged with: javascript

http://stackoverflow.com/comment/45996125
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28865060
has text: As I said I don't know the php syntax. In classic asp it would be var x='<%=Session("user")%>';. Since the session is set on server, javascript would just see the value as any other string value, not the actual asp call.
type: AnswerComment

http://stackoverflow.com/q/28883143
score: 0
tagged with: php
answer count: 1
accepted answer: http://stackoverflow.com/a/28884583
has body: Hi I am trying to add a feature to my store that when someone clicks on a product instead of being redirected to the product page, the product page loads with ajax in the home page like in this website (click on one of the products): http://www.itsjustyes.com. This is my jquery: jQuery(document).ready(function($){ $('.info_btn').on('click',function(){ var theId = $(this).attr('id'); var div = $('#product-container') $.post('wp-admin/admin-ajax.php',{ action:'my_get_posts',post_id: theId }, function(data){ console.log(data); div.html(data); }) return false; }); }); This is my code in functions.php: //Ajax call to product function my_get_posts_return() { global $post; $post_id = intval(isset($_POST['post_id']) ? $_POST['post_id'] : 0); if ($post_id &gt; 0) { $the_query = new WP_query(array('p' =&gt; $post_id)); if ($the_query-&gt;have_posts()) { while ($the_query-&gt;have_posts()) : $the_query-&gt;the_post(); wc_get_template_part( 'content', 'single-product' ); endwhile; } else { echo "There were no posts found"; } } wp_die(); } add_action('wp_ajax_my_get_posts', 'my_get_posts_return'); add_action('wp_ajax_nopriv_my_get_posts', 'my_get_posts_return'); I keep getting that there were no posts found in the loop which is weird cause I know I am sending the right post id. By the way, if I try to get the individual parts of the product page with get_the_title( $post_id ) I get it just fine. It's only when I try to load the template part with the loop that I get this problem. Any idea what I am doing wrong??
tagged with: wordpress
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery
tagged with: ajax
has answer: http://stackoverflow.com/a/28884583
type: Question
has title: Load Template-Part with Ajax in Wordpress

http://stackoverflow.com/comment/46059669
type: QuestionComment
has text: What exactly is a click on left or right supposed to do? 500px to left or right? Also imagine there could be many more (or less) thumbs.
comment on: http://stackoverflow.com/q/28897556
score: 0
type: Comment

http://stackoverflow.com/comment/45920697
comment on: http://stackoverflow.com/q/28823924
type: Comment
type: QuestionComment
has text: i try to change $(#form) also not working...
score: 0

http://stackoverflow.com/q/28879254
tagged with: canvas
upvote count: 1
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: geometry
downvote count: 0
has title: Why is my ball not round with arc?
accepted answer: http://stackoverflow.com/a/28879318
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/28879318
type: Question
has body: I am trying to make a little game in javascript. But now at the start my circle is not round... I don`t know what to do after searching for 20 min. on the internet. Hopefully you guys can help me. My question is: Why is my circle not perfect round? function Canvas() { var ctx = document.getElementById('game').getContext('2d'); var cw = ctx.canvas.width, ch = ctx.canvas.height; var snelheid = 1; function bal() { this.w = 20, this.h = 10, this.x = (cw * 0.5) - (this.w * 0.5), this.y = (ch * 0.5) - (this.h * 0.5), this.color = "black"; this.draw = function() { //animation this.x = this.x + 1; //draw ctx.beginPath(); ctx.arc(this.x, this.y, this.w, 0, (Math.PI / 180) * 360); ctx.fillStyle = "black"; ctx.closePath(); ctx.fill(); } } function background() { this.w = cw, this.h = ch, this.x = 0, this.y = 0, this.color = "#F4F4F5"; this.draw = function() { ctx.fillStyle = this.color; ctx.fillRect(this.x, this.y, this.w, this.h); } } var bal = new bal(); var background = new background(); function draw() { ctx.save(); ctx.clearRect(0, 0, cw, ch); //draw background.draw(); bal.draw(); ctx.restore(); } var animateInterval = setInterval(draw, snelheid); } window.addEventListener('load', function(event) { Canvas(); }); #game { width: 500px; height: 500px; background-color: ; border-style: solid; border-width: 4px; border-radius: 4px; border-color: #A2A2A9; } &lt;html&gt; &lt;head&gt; &lt;/head&gt; &lt;body&gt; &lt;canvas id="game"&gt; Please get a new browser! &lt;/canvas&gt; &lt;/body&gt; &lt;html&gt;

http://stackoverflow.com/a/28822544
accepted answer of: http://stackoverflow.com/q/28822320
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28822320
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45921525
upvote count: 2
has body: I assume you meant to say When I put the line “paginate”: false inside of the javascript box... That's because you missed a comma there, should look like this: $(document).ready(function() { var table = $('#example').DataTable( { "bSort": false, "paginate": false } );

http://stackoverflow.com/q/28891033
has answer: http://stackoverflow.com/a/28891063
favorite count: 0
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28891063
upvote count: 1
has comment: http://stackoverflow.com/comment/46043067
has comment: http://stackoverflow.com/comment/46043068
type: Question
score: 1
has title: How to call index number of function array in javascript
has body: I have the following list of functions: var functions = { blah: function () { alert("blah"); }, foo: function () { console.log("foo"); } }; I am now trying to access a specified index of the functions array, however I'm only getting undefined. So console.log(functions[0]); returns undefined. Can anyone explain why this is happening and instruct me on how to call a specified index of a function array in javascript? I need to cycle sequentially through the array, so need to call it by position number rather than name.
answer count: 1
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/45910100
type: QuestionComment
score: 0
has text: @SebastianBochan You, my friend, are perfectly correct! I was trying height and width options in the main chart settings. I didn't notice there was a separate "size" parameter in the plotOptions. Can you add this in as an answer so I can mark you correct?
type: Comment
comment on: http://stackoverflow.com/q/28799602

http://stackoverflow.com/comment/46150626
has text: Also, your code is hard to read because it isn't indented properly.
comment on: http://stackoverflow.com/q/28883494
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/46001714
has text: Please format your code... You may be able to assign the value of `x` to a JS variable (like `var jsX = ${x};` and then `alert( jsX );` - I am not sure about the freemarker syntax but it may be close to get you going
score: 2
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28868623

http://stackoverflow.com/q/28886240
has body: I am using HotTowel SPA template (with Durandal 2.0), and I am implementing the navigation based on user's credentials. For example, if user is a member of a particular domain group, he is allowed to see all the views, if not, only one view and so forth. To do that, I build routes to pass to router based on the result of an Ajax call to server. Here is my shell.js script: define(['durandal/system', 'plugins/router', 'services/logger', 'services/config'], function (system, router, logger, config) { var accessParameter; var URLPrefix = config.URLPrefix; var getMenuJsonURL = URLPrefix ; var shell = { activate: activate, router: router }; return shell; //#region Internal Methods function activate() { return boot(); } function boot() { function callMenuParameter() { var httpRequest = new XMLHttpRequest(); httpRequest.open('GET', getMenuJsonURL,false); //"false" states "async:false". Very important! httpRequest.send(); return httpRequest.responseText; } var result = callMenuParameter(); var parsedData = JSON.parse(result); var menuParameter = parsedData.menuNbr; //it is the parameter that I need. log('Entry form Loaded', null, true); router.on('router:route:not-found', function (fragment) { logError('No Route Found', fragment, true); }); var routesToPass; if (menuParameter == 1) routesToPass = [ { route: '', moduleId: 'bstrp', title: 'Statement', nav: 1 }, ]; else if(menuParameter == 2) routesToPass = [ { route: '', moduleId: 'home', title: menuParameter, nav: 1 }, { route: 'bstrp', moduleId: 'bstrp', title: 'Statement', nav: 4 }]; else routesToPass = [ { route: '', moduleId: 'home', title: 'SomethingEsle', nav: 1 }, { route: 'bstrp', moduleId: 'bstrp', title: 'Statement', nav: 4 }]; return router.makeRelative({ moduleId: 'viewmodels' }) // router will look here for viewmodels by convention .map(routesToPass) .buildNavigationModel() // Finds all nav routes and readies them .activate(); // Activate the router } function log(msg, data, showToast) { logger.log(msg, data, sys…
tagged with: durandal-2.0
has answer: http://stackoverflow.com/a/28893249
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
type: Question
tagged with: single-page-application
has title: Durandal: how to call CanActivate() method
tagged with: durandal-navigation
upvote count: 1
answer count: 1
type: UnansweredQuestion

http://stackoverflow.com/a/28892950
score: 4
has body: result is a variable name that only exists in that action method. It will not be included in the JSON. I'm pretty sure that your boolean value will be stored in data since you are only sending back a single value: $.ajax({ url: '/Account/IsVoucherValid?voucherCode=' + code, type: 'Get', contentType: 'application/json;', success: function (data) { if (data) { //if result=true, want to work this $("#person-data").css({ "display": "block" }); } } }); If in doubt, do console.log(data) to see what it contains. You should at least be doing minimal debugging before you bring the question to us. Also, as @Stephen Muecke points out below, if you are retrieving this data with GET, you need to use: return Json(result, JsonRequestBehavior.AllowGet);
type: Answer
has comment: http://stackoverflow.com/comment/46046359
accepted answer of: http://stackoverflow.com/q/28892911
has comment: http://stackoverflow.com/comment/46046395
answers question: http://stackoverflow.com/q/28892911
upvote count: 4
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/46046508
has comment: http://stackoverflow.com/comment/46046425

http://stackoverflow.com/a/28782601
has comment: http://stackoverflow.com/comment/45843968
score: 0
answers question: http://stackoverflow.com/q/28782043
type: Answer
has comment: http://stackoverflow.com/comment/45847496
has comment: http://stackoverflow.com/comment/45842146
has body: Is tab-dash.html being the template displayed by the DashCtrl? Because in header-dash.html, you're using ng-controller again, creating an child scope, effectively having DashCtrl in DashCtrl &lt;div class="buttons" ng-controller="DashCtrl"&gt;

http://stackoverflow.com/q/28841366
score: 1
has title: Javascript - Creating new div with form select onChange
has answer: http://stackoverflow.com/a/28841407
upvote count: 1
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
type: UnansweredQuestion
type: Question
has body: I am having difficulty trying to create a new div using javascript from a form. I have a select box in my html form; &lt;select name="seasonSelector" id="seasonSelector" onchange="jsSeason('seasonWrapper')"&gt; My seasonWrapper is a div which contains the whole content and onChange I am using a Javascript function to create a new div but having difficulty. function jsSeason(divname) { var x = document.getElementById('seasonSelector'); if(x = 2) { var newDiv = document.createElement('div'); document.getElementById(divname).appendChild(newDiv); } } Not really sure what it is i'm doing wrong or not including in my code. Thanks in advance.

http://stackoverflow.com/comment/45899372
score: 0
type: Comment
type: QuestionComment
has text: If you are getting 404 error, check you URL. Instead of this: var url = '~/VerifyAssets/NewCutoffDateInterval'... Try this: var url = '@Url.Action("NewCutoffDateInterval", "VerifyAssets")';
comment on: http://stackoverflow.com/q/28813563

http://stackoverflow.com/a/28823893
accepted answer of: http://stackoverflow.com/q/28823231
score: 2
downvote count: 0
has body: You do not need to add listener to "onresize", the window.innerWidth is dynamic so that it will varies on resize. $(window).scroll(function (e) { e.preventDefault(); if ($(this).scrollTop() &gt; 700 &amp;&amp; window.innerWidth &gt; 600) { $('.navbar').fadeIn(); } else { $('.navbar').fadeOut(); } }); or maybe you can separate into two in case you resize without scroll. function listener (e) { e.preventDefault(); if ($(window).scrollTop() &gt; 700 &amp;&amp; window.innerWidth &gt; 600) { $('.navbar').fadeIn(); } else { $('.navbar').fadeOut(); } } $(window).scroll(listener); $(window).resize(listener);
upvote count: 2
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28823231
type: Answer

http://stackoverflow.com/comment/46068215
type: Comment
score: 0
type: AnswerComment
has text: That is because of the CSS transform applied in the formScale div. You will probably have to invert that mathematically in your Javascript.
comment on: http://stackoverflow.com/a/28893883

http://stackoverflow.com/q/28796223
accepted answer: http://stackoverflow.com/a/28796460
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/28796292
answer count: 3
possible better answer: http://stackoverflow.com/a/28796350
favorite count: 0
tagged with: hex
has answer: http://stackoverflow.com/a/28796350
has answer: http://stackoverflow.com/a/28796460
upvote count: 2
has title: Escape string for javascript: hex in json
has body: This string {\x22Address\x22:\x22some address with quotes \x22} is parsed by JSON.parse correctly in browser. Why? What do hex numbers mean in json string? I can't find explanation.
downvote count: 1
type: AnsweredQuestion
score: 1
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/q/28875993
has comment: http://stackoverflow.com/comment/46014566
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/46014182
tagged with: css
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/46014109
has comment: http://stackoverflow.com/comment/46014154
accepted answer: http://stackoverflow.com/a/28876268
linked to: http://stackoverflow.com/q/16080961
type: Question
has title: Execute JavaScript when elements doesn't fit container anymore
has comment: http://stackoverflow.com/comment/46014693
has comment: http://stackoverflow.com/comment/46014556
has answer: http://stackoverflow.com/a/28876231
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/46014803
possible better answer: http://stackoverflow.com/a/28876231
has answer: http://stackoverflow.com/a/28876395
has comment: http://stackoverflow.com/comment/46014612
tagged with: jquery
has answer: http://stackoverflow.com/a/28876268
has answer: http://stackoverflow.com/a/28876415
has comment: http://stackoverflow.com/comment/46014440
has body: I'm creating a web application that should be responsive. In order to visualize it a bit more, I'm currently recreating the OfficeUI ribbon as Microsoft use in their products, but then for web applications. In the ribbon, when you have all the tabs on the screen, you see something like: Now, when you resize the window so that all the tabs aren't visible anymore, you see the following: You can clearly see the difference, it's a button on the right side for navigating over all the various tabs. Now, the button will be always placed on the website, but just hidden, and through some JavaScript function, I'll make it visible. But right now, how need to know at which point I need to make the button visible. Assume the following simple unordered list: Tab 1 Tab 2 Tab 3 Tab 1 Tab 2 Tab 3 All the LI elements are placed next to eachother, just as in the provided images, and if I resize the window to a width that all the LI elements doesn't fit the container, then the next element is pushed down. I know this can be solved with overflow and white-space but that isn't the question here. I need a JavaScript function to execute a function only and only when the 6 LI elements doesn't fit their container anymore. Here's a fiddle to give it a try. I hope that anyone can give me some guidance.
has comment: http://stackoverflow.com/comment/46014337

http://stackoverflow.com/q/28784720
has comment: http://stackoverflow.com/comment/45846151
has comment: http://stackoverflow.com/comment/45845715
has body: I need to process an array of input slowly, making asych calls for each element without hitting a rate limit on a server. I can do most of what I want with underscore _.delay(), but how do I (a) cancel the delayed execution if the user decides to bail, and (b) show status that includes the current index of the array. Here's what I have so far... function processArray(array) { var processElement = function(element) { return doAsynch(element); // asynch task returning a promise }; _.each(array, function(element, index) { _.delay(processElement, index * 1000, element); }); } function userDecidesToCancel() { // stuck here } If the user decides to cancel, say just before we get to element N, I'm happy to let doAsynch(N-1) complete, but I don't want to start work for anything further (for N >= 1). Is there a way? Also, regarding status, I can't figure out how to elegantly present that we finished item N of total, i.e. I'd like to say ... _.each(array, function(element, index) { _.delay(processElement, index * 1000, element).then(function(result) { // how can I get the result here? I'd like to log status console.log("just did " + index + " " + result); }); }); I can put part of that log message in the processElement function (the part that logs the result), but I also need the index relative to the array length so I can show percent progress. I think knowledge of that index properly belongs in the _.each loop, not passed to the processElement function. Thanks in advance.
type: AnsweredQuestion
tagged with: underscore.js
has comment: http://stackoverflow.com/comment/45849164
has answer: http://stackoverflow.com/a/28785636
type: Question
tagged with: arrays
has comment: http://stackoverflow.com/comment/45849321
tagged with: javascript
score: 0
has title: Using underscore _.delay, how do I stop future execution and provide user status
answer count: 1
accepted answer: http://stackoverflow.com/a/28785636
has comment: http://stackoverflow.com/comment/45849205

http://stackoverflow.com/a/28830632
answers question: http://stackoverflow.com/q/28830230
has comment: http://stackoverflow.com/comment/45931134
score: 0
has body: Try this.. Output: 0:1 1:2 2:4
type: Answer

http://stackoverflow.com/comment/45923980
has text: I put a new button but it doesn't work again
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28826757

sequelize.js
type: Tag
tags question: http://stackoverflow.com/q/28890219
tags question: http://stackoverflow.com/q/28897708
tags question: http://stackoverflow.com/q/28851776
tag name: sequelize.js
tags question: http://stackoverflow.com/q/28867584
tags question: http://stackoverflow.com/q/28770141
tags question: http://stackoverflow.com/q/28846335
tags question: http://stackoverflow.com/q/28821812
tags question: http://stackoverflow.com/q/28830373
tags question: http://stackoverflow.com/q/28825909
tags question: http://stackoverflow.com/q/28881614

http://stackoverflow.com/q/28890199
upvote count: 3
favorite count: 0
has title: How can I disable email verification for social authentication on parse.com?
tagged with: parse-platform
has comment: http://stackoverflow.com/comment/50966548
type: UnansweredQuestion
tagged with: php
score: 3
answer count: 0
downvote count: 0
has body: I have 2 different ways to sign up on a website, email and Facebook. While I need the email to be verified for the email signup, I don't want it for Facebook signup. Is there a way to disable it for Facebook logins and registrations? I've tried setting the emailVerified property to true manually, but that didn't work.
type: Question
tagged with: javascript

http://stackoverflow.com/comment/45973263
comment on: http://stackoverflow.com/q/28853388
score: 0
has text: But how do I add that, the dropdown list is generated on the fly with only class ".dropdown-menu" attached to it.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46059611
comment on: http://stackoverflow.com/q/28900134
type: Comment
type: QuestionComment
score: 3
has text: I'm not certain how accurate you want this thing, but this is not how real IAS indicators work. They use linear interpolation between the breakpoints. Source: I build avionics instruments for a living.

http://stackoverflow.com/comment/45885322
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28804966
has text: @Rakesh_Kumar You getting my question?
score: 0

http://stackoverflow.com/q/28831338
score: 1
has body: I'm working on a site, which has a lot of animation, slideUps, slideDowns, etc. There is one section which changes on('scroll') but therefore I always need the offset().top and the height() of this section … well, that's not easy because the sections above are changing their height() quite often. So instead of triggering my resize-function each time the sections above are changing – LIKE: { … $(window).trigger('resize.mysection') … } … I thought it's maybe easier to update changes every XX ms … like: function update_val() { if ($('#mysection').offset().top != old_top) { old_top = $('#mysection').offset().top; $(window).trigger('resize.mysection'); } //in order to save a small amount of power I would use animationframe instead of timeout requestAnimationFrame(update_val); } What do you guys think? Pros, Cons? Is it bad to run this small function that often? THX!
type: Question
tagged with: requestanimationframe
has answer: http://stackoverflow.com/a/28833773
tagged with: javascript
tagged with: onchange
upvote count: 1
has title: Good idea to check for changes in a value every XXms in JS?
answer count: 1
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
downvote count: 0

http://stackoverflow.com/a/28899585
has comment: http://stackoverflow.com/comment/110410127
has comment: http://stackoverflow.com/comment/135466718
has comment: http://stackoverflow.com/comment/110414105
has body: Create an element, store the HTML in it, and get its textContent: function extractContent(s) { var span = document.createElement('span'); span.innerHTML = s; return span.textContent || span.innerText; }; alert(extractContent(" Hello W3C")); Here's a version that allows you to have spaces between nodes, although you'd probably want that for block-level elements only: function extractContent(s, space) { var span= document.createElement('span'); span.innerHTML= s; if(space) { var children= span.querySelectorAll('*'); for(var i = 0 ; i < children.length ; i++) { if(children[i].textContent) children[i].textContent+= ' '; else children[i].innerText+= ' '; } } return [span.textContent || span.innerText].toString().replace(/ +/g,' '); }; console.log(extractContent(" Hello W3C. Nice to seeyou!")); console.log(extractContent(" Hello W3C. Nice to seeyou!",true));
has comment: http://stackoverflow.com/comment/135466556
has comment: http://stackoverflow.com/comment/131061627
has comment: http://stackoverflow.com/comment/46058788
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/46058875
accepted answer of: http://stackoverflow.com/q/28899298
type: Answer
has comment: http://stackoverflow.com/comment/46059249
answers question: http://stackoverflow.com/q/28899298
score: 131
downvote count: 0
upvote count: 131

http://stackoverflow.com/a/28892466
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: You just use $or. Also your use of $and is redundant here: User.find({ "$or": [ { "name": req.body.username1, "password": req.body.password1 }, { "name": req.body.username2, "password": req.body.password2 } ] },function(err,result) { // logic in here }) And then process whatever logic you need to validate the response, with the clearest case being that if the response is not at least two items long then one of the selections was not found. This is one of those cases where of course "username" should have a unique constraint.
accepted answer of: http://stackoverflow.com/q/28892379
score: 4
answers question: http://stackoverflow.com/q/28892379
upvote count: 4

http://stackoverflow.com/a/33525113
upvote count: 206
has comment: http://stackoverflow.com/comment/67405714
type: Answer
accepted answer of: http://stackoverflow.com/q/28876469
score: 206
has body: Take the spaces away return gulp.src('./images/*.{png,gif,jpg}')
answers question: http://stackoverflow.com/q/28876469
has comment: http://stackoverflow.com/comment/57794068
has comment: http://stackoverflow.com/comment/102276665
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/46071509
comment on: http://stackoverflow.com/a/28893883
type: AnswerComment
has text: From your Edit #2, I still can't get it to consistently show the correct results. Regardless if I take the scale into consideration.
score: 0
type: Comment

http://stackoverflow.com/a/28902354
answers question: http://stackoverflow.com/q/28898610
has comment: http://stackoverflow.com/comment/46128780
type: AcceptedAnswer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/28898610
type: Answer
upvote count: 1
has body: You can set the interval using k-interval attribute. And load the value from your controller. Check this JSBin angular.module("KendoDemos", [ "kendo.directives" ]) .controller("MyCtrl", function($scope){ $scope.getType = function(x) { return typeof x; }; $scope.isDate = function(x) { return x instanceof Date; }; //one setting for controller, or you can set this using angular constant to be used in multiple controllers. $scope.timeInterval = 15; }) And in your view &lt;input kendo-time-picker ng-model="str" k-ng-model="obj" k-interval="timeInterval" /&gt; EDIT: To update the interval of all the kendo time pickers, you can do the following. kApp.run(function($rootScope) { $rootScope.$on("kendoWidgetCreated", function(event, widget){ //get the element var elem = widget.element[0]; //get the kendoTimePicker. var tPicker = $(elem).data("kendoTimePicker"); if(tPicker) tPicker.timeView.options.interval = 15; }); Link to JSBin with edit

http://stackoverflow.com/comment/45832039
comment on: http://stackoverflow.com/q/28776079
has text: I think this is the relevant bug report for Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=589199
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28850367
type: Answer
score: 0
answers question: http://stackoverflow.com/q/28850286
has body: A regular expression is quite heavy machinery for this purpose. Just split the string containing the email address at the @ character, and take the second half. (An email address is guaranteed to contain only one @ character.) But if anyway you want to use it: @(.*)$ This will match with the @, then capture everything up until the end of input ($) Check here

http://stackoverflow.com/comment/45926080
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28827757
has text: What happens when you submit the form? The whole page may be getting refreshed, causing you to lose any DOM changes.
score: 0

http://stackoverflow.com/comment/107039896
score: 0
type: AnswerComment
has text: @user3448282 I need to observe captcha change in Ajax. On didLoad I'm using "var c = document.createElement('canvas'); var ctx = c.getContext('2d'); const list = document.getElementsByTagName(\"img\"); ctx.drawImage(list[1], 100, 40); var value = c.toDataURL(); value.split(',')[1];". Can I do this in script.js If then now to add it in script.js ?
type: Comment
comment on: http://stackoverflow.com/a/52438302

http://stackoverflow.com/a/28842001
has body: You may want to look into using a database system like MongoDB or SQL to do this instead. It's usually easier to use a database instead of writing all this stuff yourself. No need to reinvent the wheel, so to speak. It looks like you're already using one to store the meta-data, why not do so for the entire article? That being said, yes it would seem that your initial code snippet should work.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28841791

http://stackoverflow.com/a/28875741
accepted answer of: http://stackoverflow.com/q/28875414
answers question: http://stackoverflow.com/q/28875414
has body: A good practice would be to add a class like the following: $( ".draggable" ).draggable({ containment: "document });
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/46042269
comment on: http://stackoverflow.com/q/28890630
type: QuestionComment
has text: Is the code run from http://qlin.parseapp.com ? If not you need to enable CORS
type: Comment
score: 3

http://stackoverflow.com/comment/46080877
comment on: http://stackoverflow.com/a/28806490
type: Comment
has text: Thank for the help. http://jsfiddle.net/2emnt8m3/14/ Could you help me with this one, I want to get data for pie chart on mouse hovering to states map. http://stackoverflow.com/questions/28847482/need-help-on-pie-chart-transition-on-mouse-hover-of-a-state-of-the-map-according
type: AnswerComment
score: 0

selectors-api
tag name: selectors-api
type: Tag
tags question: http://stackoverflow.com/q/28832090

http://stackoverflow.com/comment/45905657
has text: @AndréPedroso surely the push in the else clause gets executed, so the length should be 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28816876
score: 0

http://stackoverflow.com/comment/45856632
score: 1
comment on: http://stackoverflow.com/a/28790672
has text: You said your getting this from another source, as in requesting it via ajax from another website?? If that is the case, your most likely getting a cross domain error.. press f12 to bring up your console and look for js errors?
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45960030
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28845691
score: 1
has text: You aren't including jQuery in your fiddle.. see [this updated example](http://fiddle.jshell.net/xnhh93p6/). You could also swap the `click` event listener out for a `change` event listener.

http://stackoverflow.com/a/28819086
has comment: http://stackoverflow.com/comment/45910278
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45910198
has body: jsFiddle Demo When you use the Object.create approach, it is typically paired with a constructor assignment as well. //... D.prototype = Object.create(B.prototype); D.prototype.constructor = D; //...
has comment: http://stackoverflow.com/comment/45910406
type: Answer
accepted answer of: http://stackoverflow.com/q/28819028
has comment: http://stackoverflow.com/comment/45910574
answers question: http://stackoverflow.com/q/28819028
downvote count: 0
score: 1

http://stackoverflow.com/comment/46048379
has text: Something on that linked page is animated. What did you expect?
comment on: http://stackoverflow.com/q/28834353
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28904685
tagged with: gruntjs
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/46069133
has answer: http://stackoverflow.com/a/28905439
type: UnansweredQuestion
tagged with: regex
has body: Any idea on how to replace a whole line if it has a specific word using regex ? I tried ^.*specificword.*$ did not work.. I have a sceanrio that i need a pattern to replace the entire line using grunt-string-replace task.. Trying "ServiceUrl: 'existing url'" line to be replaced with some other url The following did not work pattern: /ServiceUrl: (.*?) /mig,
type: Question
has title: how to replace the whole line which has a specfic word using regex javascript?
tagged with: javascript

http://stackoverflow.com/comment/45980139
score: 0
type: Comment
has text: Can you crate a plnkr/fiddle? Your code should work fine. http://plnkr.co/edit/2gdUSFoWXUTJAONqGLqn?p=preview
type: QuestionComment
comment on: http://stackoverflow.com/q/28856788

http://stackoverflow.com/q/28762291
has body: I'm facing a problem when trying to inject a string from PHP (using the Laravel framework) into javascript. The string is like [{"foo1": bar1}, {"foo2" : bar2}]. When I inject this string to javascript using something like var test = '{{ $var }}' the " are converted to &amp;quot;. The javascript string is used in a function later to parse the JSON. This now fails because of the quote-conversion. It seems that the string is passed into the browser as it should be. But Chrome converts it. How can I solve this? I've tried PHP's str_replace(), html_entity_decode(), json_encode() and Javascript's replace(). Both aren't solving the issue.
type: Question
has comment: http://stackoverflow.com/comment/45804194
tagged with: php
accepted answer: http://stackoverflow.com/a/28762464
score: 0
answer count: 1
tagged with: javascript
has title: Inject a string with quotes from PHP to javascript
has answer: http://stackoverflow.com/a/28762464
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45804086
has comment: http://stackoverflow.com/comment/45804243

http://stackoverflow.com/q/28844488
has comment: http://stackoverflow.com/comment/45958413
has title: Unable To Insert An Array Selection into a Database
tagged with: javascript
score: 0
tagged with: nullpointerexception
has comment: http://stackoverflow.com/comment/45958447
tagged with: android
has comment: http://stackoverflow.com/comment/45958078
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45958241
has body: First off, I would just like to mention that my problem isn't as easy as the title suggests. Here is my problem. Basically I am trying to set the value of a string to a randomly selected item in a string array. Shown here: String[] array = getResources().getStringArray(R.array.states); selected_state = array[new Random().nextInt(array.length)]; When a button is pushed, this string is insert into my database. Like this: long id = database_helper.insertData(selected_state); It seem like it should work, but unfortunately for me it does not. Apparently selected_state is null when I try to insert it. But another string in my app that is pulled from an editText and inserted the exact same way is totally fine. Here are the relevant parts of my code: public class my_class extends Fragment implements View.OnClickListener { View rootView; Button bing; EditText text; public String selected_state; public String TEXT; DatabaseAdapter database_helper; @Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { rootView = inflater.inflate(R.layout.my_fragment, container, false); bing = (Button) rootView.findViewById(R.id.my_btn); text = (EditText) rootView.findViewById(R.id.my_text_edit); String[] array = getResources().getStringArray(R.array.states); selected_state = array[new Random().nextInt(array.length)]; bing.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { send(); } private void send() { TEXT = text.getText().toString(); //VALUE HOLDS UP TO HERE long id = database_helper.insertData(TEXT, selected_state);//NULL!!!!!! if(id&lt;0){ Toast.makeText(getActivity(), "SHES STUCK", Toast.LENGTH_LONG).show(); }else{ Toast.makeText(getActivity(), "SHES IN", Toast.LENGTH_LONG).show(); text.setText(""); } } }); return rootView; } @Override public void onClick(View v) { } } Thanks everyone! EDIT The string (or what I believe to be a string) value has been carried down to the same place TEXT …
has comment: http://stackoverflow.com/comment/45958221
type: Question

http://stackoverflow.com/q/28851357
has answer: http://stackoverflow.com/a/28851606
tagged with: php
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28851420
has comment: http://stackoverflow.com/comment/45969878
has title: Parsing nested json array value in php
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/14425700
has answer: http://stackoverflow.com/a/28851420
has comment: http://stackoverflow.com/comment/45970458
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/28851606
has body: I am trying to parse the data from the following json { "id":"1", "rawId":"1", "displayName":"Distress Number", "name":{"familyName":"Number","formatted":"Distress Number","givenName":"Distress"}, "nickname":null, "phoneNumbers":[{"type":"other","value":"112","id":"2","pref":false}], "emails":[{"type":"other","value":"blessan004@gmail.com","id":"19","pref":false}], "addresses":null, "ims":null,"organizations":null, "birthday":null, "note":"","photos":null, "categories":null, "urls":null } I want to insert the displaName,phoneNumbers and emails to database table but its failed Here is my php $contact=json_decode($json,true){ foreach($contact as $con){ $num=$con['phoneNumbers']['value']; $name=$con['displayName']; $email=$con['emails']['value']; //function to dbinsert insertToDb($num,$name,$email); } But it returns illegal offset warning
tagged with: cordova

http://stackoverflow.com/q/28903739
tagged with: debugging
has answer: http://stackoverflow.com/a/29503628
has body: I do not want to include WEINRE script in head section and I would like to load it on demand (on button click). I tried: $.getScript('http://path-to-weinre-script.js#anonymous') After loading WEINRE script client starts to make calls to /ws/target/t-9X periodically but there is no active targets in WEINRE console. How can I force WEINRE initialization without adding it to head section?
has title: How to load WEINRE dynamically?
tagged with: javascript
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/29512530
tagged with: remote-debugging
tagged with: weinre
accepted answer: http://stackoverflow.com/a/29512530
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/29503628
type: Question

http://stackoverflow.com/q/28839161
has body: I'm trying to create two radio buttons using d3, however I seem to be having some issues. I can create and label both, however they don't recognize that the other one has been created. For example, if the OR button is selected and I select the AND button, the OR button won't unselect. I was able to recreate my problem in a fiddle and the code is below: var body = d3.select("body") var form = body.append('form'); form.append('input') .attr('type', 'radio') .attr('value', 'Or') .on('click', function () { //Do something }); form.append('label') .html('OR'); form.append('input') .attr('type', 'radio') .attr('value', 'And') .on('click', function () { //Do something }); form.append('label') .html('AND');
type: AnsweredQuestion
has title: d3js: Creating multiple radio buttons
type: Question
has answer: http://stackoverflow.com/a/29106558
accepted answer: http://stackoverflow.com/a/29106558
tagged with: javascript
has comment: http://stackoverflow.com/comment/45949655
score: 0
tagged with: radio-button
answer count: 1
has comment: http://stackoverflow.com/comment/45949714
tagged with: d3.js

http://stackoverflow.com/a/28780494
has comment: http://stackoverflow.com/comment/45838237
has body: You need to use an anchored regex with capturing group. ^.*?\[[^\]]*\].*?\[([^\]]*)\] Then get the string you want from group index 1. DEMO &gt; console.log(/^.*?\[[^\]]*\].*?\[([^\]]*)\]/.exec('She is [my] little [daughter].')[1]) daughter
score: 0
accepted answer of: http://stackoverflow.com/q/28780476
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28780476
type: Answer
has comment: http://stackoverflow.com/comment/45838259

http://stackoverflow.com/comment/45934411
comment on: http://stackoverflow.com/a/28831695
score: 0
type: Comment
has text: thats what i did, and it's able to get the data that was in that binding but when i publish new data it doesnt update.
type: AnswerComment

http://stackoverflow.com/a/28865202
upvote count: 1
answers question: http://stackoverflow.com/q/28856285
downvote count: 0
score: 1
has body: I found what I needed here: http://blog.buymeasoda.com/creating-a-jquery-like-chaining-api/ And just incase that site ever goes away... Implementing our own chaining API To simplify things, if we remove some of the layers, here's how would we can implement the skeleton of the jQuery constructor function to provide a simple chaining API. var myQuery, $; (function() { myQuery = $ = function(selector) { return new MyQuery(selector); }; var MyQuery = function(selector) { // Lets make a really simplistic selector implementation for demo purposes var nodes = document.getElementsByTagName(selector); for (var i = 0; i &amp;lt; nodes.length; i++) { this[i] = nodes[i]; } this.length = nodes.length; return this; }; // Expose the prototype object via myQuery.fn so methods can be added later myQuery.fn = MyQuery.prototype = { // API Methods hide: function() { for (var i = 0; i &amp;lt; this.length; i++) { this[i].style.display = 'none'; } return this; }, remove: function() { for (var i = 0; i &amp;lt; this.length; i++) { this[i].parentNode.removeChild(this[i]); } return this; } // More methods here, each using 'return this', to enable chaining }; }()); // Example usage $('p').hide().remove(); // Add a plugin $.fn.red = function() { for (var i = 0; i &amp;lt; this.length; i++) { this[i].style.color = 'red'; } return this; } $('li').red();
type: Answer

http://stackoverflow.com/q/28759531
has comment: http://stackoverflow.com/comment/46493118
upvote count: 1
has title: HtmlUnit - Executing a button with javascript
has comment: http://stackoverflow.com/comment/45807377
score: 1
type: Question
tagged with: htmlunit
downvote count: 0
tagged with: button
tagged with: javascript
favorite count: 0
tagged with: click
has comment: http://stackoverflow.com/comment/72671880
has comment: http://stackoverflow.com/comment/72663112
has body: I want to extract some information from a website. In order to do this I use HtmlUnit to simulate some clicks. The website is : http://www.sixt.com/car-rental/ I want to set a specific value into the textfield i.e "70629" and click the button below. The button on the site executes some javascript. I've tried everything out and read different posts (also on stackoverflow) but nothing seems to work :/ My code so far: WebClient webClient = new WebClient(BrowserVersion.FIREFOX_24); webClient.getCookieManager().setCookiesEnabled(true); webClient.getOptions().setJavaScriptEnabled(true); webClient.getOptions().setThrowExceptionOnScriptError(false); HtmlPage page; try { page = webClient.getPage(SIXT_ADDRESS); //checking a checkbox HtmlInput checkbox0 = (HtmlInput) page.getElementById("sx-branch-search-panel-option_F"); checkbox0.click(); //setting input for textfield HtmlTextInput textField1 = (HtmlTextInput) page.getElementById("i-mf__inputfield"); textField1.setValueAttribute("70629"); //load new page through button click HtmlElement theElement2 = (HtmlElement) page.getElementById("submit_button"); page = theElement2.click(); System.out.println(page.asText()); Why does the output still shows the content from the website above and not the new page? (textfield value and checkbox are set!). I've noticed that webClient.waitForBackgroundJavaScript(1000); will remove the textfield value ("70629") in the output. Any help is much appreciated!
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/28834896
accepted answer: http://stackoverflow.com/a/28835078
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
has body: I have a line of items in Excel, and when I copy them in a textarea, I have several tab characters. I use this on purpose. Is there a way to replace n-th tab characters with a new line (each) and insert a specific word for each tab? Here is what I have so far http://jsfiddle.net/kjuxk7m9/ &lt;textarea rows="10" cols="50" onblur="this.value=this.value.replace(/\t/g, '\n')"&gt; Basically, when I enter the following in a textarea: Item1 Item2 Item3 Item4 Item5 (between items are tab characters), my result would have to be: Name1: Item1 Name2: Item2 Name3: Item3 Name4: Item4 Name5: Item5 Also, I might have more than one tab characters one after another. I would need them removed, so that I just have no empty lines after replacing them with new line char. Also, I would rather not use inline javascript, even if I did so far in the example. Thanks! UPDATE: Input text: Item1 Item2 Item3 Item4 item6 Item7 The expected result is: LastName: Item1 FirstName: Item2 PhoneNumber: Item3 Nickname: Item4 AnotherRandomCategory: Blog: Item6 OtherDetail: Item7 Item5 practically is an example of empty cell in my spreadsheet, and copying that would add an extra tab character. After having the above result, I would be able to delete that line, with a code, since that category does not have an item. The Items are examples, they are actually names, numbers, and other data. Thanks!
has title: Replace n-th tab character with a string using Javascript/jQuery
tagged with: javascript
has answer: http://stackoverflow.com/a/28835078
answer count: 2
tagged with: textarea
downvote count: 0
possible better answer: http://stackoverflow.com/a/28835279
has answer: http://stackoverflow.com/a/28835279
favorite count: 0

http://stackoverflow.com/comment/45861398
score: 0
type: Comment
type: QuestionComment
has text: Well, JSON returns a Javascript object. So you can use `.` dot-notation to access the properties: `Object.property.property.property` etc.
comment on: http://stackoverflow.com/q/28793336

http://stackoverflow.com/comment/46304614
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28902642
type: Comment
has text: Thanks, this anwered the part that node/io.js side can send and recevie costom verbs. But my question is, how do you people do correct WebDAV PROPFIND client request in node/io.js? I have not being able to do it yet. The request should do, see the second comment of my original post.

http://stackoverflow.com/a/68768248
upvote count: 1
answers question: http://stackoverflow.com/q/28807948
type: Answer
downvote count: 1
has body: events: function (info, successCallback, failureCallback) { let start = moment(info.start.valueOf()).format('YYYY-MM-DD'); let end = moment(info.end.valueOf()).format('YYYY-MM-DD'); $.ajax({ url: 'feed.php', type: 'GET', data:{ 'start':start, 'end':end, 'id': '12' }, headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;', 'accept': 'application/json', 'X-Requested-With': 'XMLHttpRequest', 'X-CSRF-Token': $('meta[name=csrf-token]').attr("content"), //Here, I am using the CSRF token };, success: function (response) { successCallback(response); } }); },
score: 0

http://stackoverflow.com/a/28941898
type: Answer
accepted answer of: http://stackoverflow.com/q/28884897
answers question: http://stackoverflow.com/q/28884897
has body: The approach I used was different than my post above. I used timeout-dialog.js and altered that script to use with durandal's router and any other service I needed within my application. I also used idle js. Here is the code- main.js in app.start()- var timeout = 100; $(document).bind("idle.idleTimer", function () { controls.timeoutDialog.setupDialogTimer(); }); $(document).bind("active.idleTimer", function () { var sess = Security.GetKeepSessionAlive(); }); $.idleTimer(timeout); timeout-dialog.js code- String.prototype.format = function () { var s = this, i = arguments.length; while (i--) { s = s.replace(new RegExp('\\{' + i + '\\}', 'gm'), arguments[i]); } return s; }; define(['durandal/system', 'plugins/router', 'services/logger', 'services/SecurityDataService'], function (system, router, logger, Security){ timeoutDialog = { settings: { timeout: 50, countdown: 15, title: 'Your session is about to expire!', message: 'You will be logged out in {0} seconds.', question: 'Do you want to stay signed in?', keep_alive_button_text: 'Yes, Keep me signed in', sign_out_button_text: 'No, Sign me out', keep_alive_url: '', keep_alive_function: function () { }, logout_url: function () { router.map([ { route: 'ErrorPage', moduleId: 'ErrorPage', title: 'ErrorPage', title: 'ErrorPage', nav: false } ]).activate router.navigate('ErrorPage'); }, logout_redirect_url: function () { router.map([ { route: 'ErrorPage', moduleId: 'ErrorPage', title: 'ErrorPage', title: 'ErrorPage', nav: false } ]).activate router.navigate('ErrorPage'); }, logout_function: function () { amplify.store("ErrorDetails", "Session Timed Out!"); router.map([ { route: 'ErrorPage', moduleId: 'ErrorPage', title: 'ErrorPage', title: 'ErrorPage', nav: false } ]).activate router.navigate('ErrorPage'); }, restart_on_yes: true, dialog_width: 350 }, alertSetTimeoutHandle: 0, setupDialogTimer: function (options) { if (options !== undefined) { $.extend(this.settings, options); } var self = this; if (self.alertSetTimeoutHandle…
score: 0
type: AcceptedAnswer

http://stackoverflow.com/q/28824243
has body: So I have this plnkr. I'm trying to figure out how to allow the user to be able to submit the form despite having an empty "item group" i.e. user is able to submit despite having both item.foo and item.bar empty but not when one of the form controls isn't empty.
tagged with: javascript
accepted answer: http://stackoverflow.com/a/28824515
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28824515
tagged with: angularjs
type: AnsweredQuestion
type: Question
tagged with: angularjs-directive
has title: ng-repeat of a directive and $validators

http://stackoverflow.com/q/28874284
has title: Datatable with angularJs shows no data error?
tagged with: javascript
has comment: http://stackoverflow.com/comment/46011103
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28874524
has comment: http://stackoverflow.com/comment/46011041
tagged with: angularjs
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/46011168
tagged with: php
tagged with: datatable
tagged with: laravel
score: 0
has answer: http://stackoverflow.com/a/40069299
accepted answer: http://stackoverflow.com/a/28874524
has body: I want to use datatable in angularjs. I have written directives and data table initializing and displaying rows in table first time. When searching or filtering,it shows no data in table error message. Directive code is "use strict"; invoiceApp.directive('itemTable', function () { return { restrict: 'E', replace: true, templateUrl: 'app/components/item/item_table.html', link: function (scope, table) { table.dataTable(); } } }) Template is, Name Description Unit Rate {{item.name}} {{item.description}} {{item.unit}} AED {{item.rate}} Controller is, 'use strict'; invoiceApp.controller('itemController', ['$scope', 'ItemService', function ($scope, ItemService) { $scope.items = //datas }]); Why it happening ?
possible better answer: http://stackoverflow.com/a/40069299

http://stackoverflow.com/a/37831703
has comment: http://stackoverflow.com/comment/99659182
answers question: http://stackoverflow.com/q/28770415
upvote count: 79
downvote count: 0
score: 79
has comment: http://stackoverflow.com/comment/96596443
type: Answer
has comment: http://stackoverflow.com/comment/100105677
has body: You may wonder, why the syntax is valid (but not working as expected): var func = p =&gt; { foo: "bar" } It's because of JavaScript's label syntax: So if you transpile the above code to ES5, it should look like: var func = function (p) { foo: "bar"; //obviously no return here! }

http://stackoverflow.com/comment/45954662
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28841664
has text: @Mouser thank you for the inspiration of approach. I basically 100% cribbed your solution here: http://jsfiddle.net/ebbnormal/r9cf7qu4/17/ ,however I have two issues: 1) why do you add in addition to `refElement.top` and `refElement.height` the height of the wrapper as the upper bound? One would assume the sum of the refElement height and its top position would be a sufficient upper bound for windowPos as it bounds by the desired `refElement`. what additionally are you adding?2) When I implement it with or without that change I seem to be missing something as It doesnt work, currently

http://stackoverflow.com/comment/46066591
comment on: http://stackoverflow.com/q/28903013
score: 0
has text: Oh ok. I was not sure about that.Let me use it synchronously and see how it works. Thanks,
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45804663
has text: Please edit your question to match the title (or vice-versa). Are you asking about how to print something, or how to create an array?
type: QuestionComment
comment on: http://stackoverflow.com/q/28761760
type: Comment
score: 0

http://stackoverflow.com/comment/45863370
type: Comment
score: 2
comment on: http://stackoverflow.com/a/28794372
has text: `assert.deepEqual` is spot on. Oh to think of the gymnastics I went through before I learned that it was there.
type: AnswerComment

http://stackoverflow.com/q/28820919
has comment: http://stackoverflow.com/comment/45913704
tagged with: javascript
has comment: http://stackoverflow.com/comment/45914677
tagged with: function
answer count: 1
has answer: http://stackoverflow.com/a/28820976
downvote count: 0
tagged with: jquery
favorite count: 0
has body: I'm trying to avoid excessive code by simplifying my Slick Slider script. I'm trying to run a function that sets a boolean parameter but I'm obviously missing something here. The goal is to change the fade parameter from true to false if the .content-gallery has a .casestudy class, which is a different content type in my CMS. Thanks! $( window ).load(function() { var galleryStyle = true; var $gallerySlider = $("div.content-gallery-wrapper .content-gallery"),function(){ if ( $gallerySlider.hasClass("casestudy") ) { var galleryStyle = false; } else {} }; $gallerySlider.each(function(){ $(this).slick({ centerMode: true, centerPadding: '0', slidesToShow: 1, slidesToScroll: 1, // dots: true, prevArrow: '.arrow.left', nextArrow: '.arrow.right', fade: galleryStyle }); }); $('.loading').removeClass('loading'); }); Using one of the answers below, and moving the if statement into the initilization function seemed to take care of it. $( window ).load(function() { var galleryStyle = true; var $gallerySlider = $("div.content-gallery-wrapper .content-gallery"); $gallerySlider.each(function(){ if ( $(this).hasClass("casestudy") ) { galleryStyle = false; } $(this).slick({ centerMode: true, centerPadding: '0', slidesToShow: 1, slidesToScroll: 1, // dots: true, prevArrow: '.arrow.left', nextArrow: '.arrow.right', fade: galleryStyle }); }); $('.loading').removeClass('loading'); });
tagged with: slick.js
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28820976
score: 1
upvote count: 1
type: Question
has title: How do I run a jQuery if statement on a function paremeter?
tagged with: if-statement

http://stackoverflow.com/comment/46005805
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28870943
score: 0
has text: Thanks @Bergi toFixed returns us String. So 1 followed by 1 is greater than 1 followed by 0. That's why "11" is greater than "10000" :P

parse-platform
tags question: http://stackoverflow.com/q/28791228
tags question: http://stackoverflow.com/q/28861276
tags question: http://stackoverflow.com/q/28837424
type: Tag
tags question: http://stackoverflow.com/q/28884876
tags question: http://stackoverflow.com/q/28823808
tags question: http://stackoverflow.com/q/28850552
tags question: http://stackoverflow.com/q/28833125
tags question: http://stackoverflow.com/q/28810160
tags question: http://stackoverflow.com/q/28776976
tags question: http://stackoverflow.com/q/28796075
tags question: http://stackoverflow.com/q/28817497
tags question: http://stackoverflow.com/q/28779874
tags question: http://stackoverflow.com/q/28823188
tags question: http://stackoverflow.com/q/28890816
tags question: http://stackoverflow.com/q/28834498
tags question: http://stackoverflow.com/q/28822503
tags question: http://stackoverflow.com/q/28840841
tags question: http://stackoverflow.com/q/28843707
tags question: http://stackoverflow.com/q/28883295
tags question: http://stackoverflow.com/q/28843107
tags question: http://stackoverflow.com/q/28816710
tags question: http://stackoverflow.com/q/28797342
tags question: http://stackoverflow.com/q/28780638
tags question: http://stackoverflow.com/q/28877843
tags question: http://stackoverflow.com/q/28847045
tags question: http://stackoverflow.com/q/28795700
tags question: http://stackoverflow.com/q/28840506
tags question: http://stackoverflow.com/q/28825513
tag name: parse-platform
tags question: http://stackoverflow.com/q/28866144
tags question: http://stackoverflow.com/q/28885055
tags question: http://stackoverflow.com/q/28890199
tags question: http://stackoverflow.com/q/28845947

http://stackoverflow.com/q/28755393
has comment: http://stackoverflow.com/comment/45792356
has comment: http://stackoverflow.com/comment/45792185
type: Question
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28761612
type: UnansweredQuestion
tagged with: requirejs
has body: I've started using require.js for my website, but one thing that bugs me is this massive require statement at the top of my files. require(["hype", "jquery", "knockout", "environment","bootstrap", "datamodel", "datatable", "datatables", "dataTablesBootstrap", "utils", "notifications", "moment", "datatablesFilterDelay"], function(hype, $, ko, env, bootstrap, datamodel, datatable, datatables, dataTablesBootstrap, utils, not, moment, dfd) { I'm not sure if I'm misunderstanding how I'm supposed to use require.js. Each of my pages have their respective javascript files with a require statement like this at the top. I could probably shorten it by refactoring everything that I'm including into a single module and just require that since many pages rely on similar things (most need hype, jquery, knockout, bootstrap, etc), but I'm not sure if it's the best practice thing to do. Any ideas?
has comment: http://stackoverflow.com/comment/45792580
has title: Is there a way to shorten Require.js's require statement? Am I misunderstanding how to use it?

http://stackoverflow.com/q/28837247
has comment: http://stackoverflow.com/comment/45944036
answer count: 3
upvote count: 1
has comment: http://stackoverflow.com/comment/45944106
tagged with: setinterval
favorite count: 0
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/10182714
has title: JavaScript - setInterval only running once
linked to: http://stackoverflow.com/q/10182714
score: 1
has comment: http://stackoverflow.com/comment/45943974
has comment: http://stackoverflow.com/comment/45944072
type: Question
has answer: http://stackoverflow.com/a/28837690
has answer: http://stackoverflow.com/a/28837521
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28837280
has comment: http://stackoverflow.com/comment/45943995
has body: http://jsfiddle.net/689nauny/ setInterval() is only running once... WTF is going on? SO is asking for more details but providing a JSFiddle is about as descriptive as I can be? I've tried using an anonymous function and now a callback. I just don't get it? :-/ HTML &lt;script src="http://code.jquery.com/jquery-2.1.3.min.js"&gt;&lt;/script&gt; &lt;div id="qanda-timer-container"&gt; &lt;div class="qanda-timer"&gt; &lt;span id="qanda-time-remaining"&gt;&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; JS function intervalFunc(thinkingTime, answerTime) { jQuery('#qanda-time-remaining').text(''+(thinkingTime - 1)); } function enableTimer(time) { var intervalID; var hasThinkingTime = true; var thinkingTime = time; var hasAnswerTime = true; var answerTime = 10; if(hasThinkingTime &amp;&amp; hasAnswerTime) { setInterval( intervalFunc(thinkingTime, answerTime), 1000); } setTimeout(function(){ clearInterval(intervalID); }, time * 1000); } enableTimer(30);

http://stackoverflow.com/a/28812714
score: 0
upvote count: 1
downvote count: 1
answers question: http://stackoverflow.com/q/28812358
type: Answer
has comment: http://stackoverflow.com/comment/45946476
has comment: http://stackoverflow.com/comment/45903031
has body: According to your reference, I find the solution for you. Don't repetitive the id for more than one element. I modified your code - select one - Equals Not Equals <option value="<">Less Than ">Greater Than $('#rules, #conditinal_options, #inputValues, #options').on('keyup change', function() { $('#input').val($('#rules').val() + ' ' + $('#conditinal_options').val() + ' ' + $('#inputValues').val() + ' ' + $('#options').val() ); }); Here is your fiddle

http://stackoverflow.com/comment/71821448
comment on: http://stackoverflow.com/a/30495399
score: 0
has text: @hexalys `window.statusbar.visible` didn't work for me with our App (and I don't think it was due to using 10.3 beta). FYI: I noticed [this one wierd trick](https://github.com/eligrey/FileSaver.js/blob/master/FileSaver.js) used to detect Safari: `is_safari = /constructor/i.test(window.HTMLElement) || window.safari`
type: Comment
type: AnswerComment

http://stackoverflow.com/a/28795383
has comment: http://stackoverflow.com/comment/45866024
type: Answer
accepted answer of: http://stackoverflow.com/q/28795275
has comment: http://stackoverflow.com/comment/45866508
answers question: http://stackoverflow.com/q/28795275
has comment: http://stackoverflow.com/comment/45865386
score: 0
has comment: http://stackoverflow.com/comment/45865602
type: AcceptedAnswer
has body: Instead of: echo "DB: Ooops, didn't get through."; Why not output what the error is with: echo mysqli_error($conn); Its best to only do this while you are in development though.

http://stackoverflow.com/comment/46205741
has text: I added my package.json file that has the jest configuration options in them.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28868369
score: 0

http://stackoverflow.com/comment/46072580
type: QuestionComment
comment on: http://stackoverflow.com/q/28905855
has text: I had to add a function in his patch to make his patch work correctly. So I took in his patch, wrote the function in, saved it in the patch, and sent it back. So yes it already had his changes plus my own because we are editing the same file and it's easier to do like this. We are working in an SVN project.
score: 0
type: Comment

http://stackoverflow.com/comment/45921444
comment on: http://stackoverflow.com/q/28825060
has text: This is the event **handler** for a possible double click event. Have you attached this handler to an event? Please show where you have defined the jqGrid event **listener**
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28892315
type: Answer
has body: You could render the component using the new {{component}} helper (in the latest version of Ember) {{component 'my-component'}} {{component c.myPageTitleComponent}} For the text to be present, you could do two things: In your Template You could implement the text directly in your template {{c.myPageTitleText}} {{component c.myPageTitleComponent}} Using a Parent Component You could implement a parent component: {{my-parent-component text=c.myPageTitleText componentName=c.myPageTitleComponent}} Then in 'my-parent-component', it would look like this: {{text}} {{component componentName}} This doesn't really make sense though unless you needed some custom logic in my-parent-component.
score: 0
answers question: http://stackoverflow.com/q/28889064
has comment: http://stackoverflow.com/comment/46060573

http://stackoverflow.com/comment/45823843
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28760839
has text: I tried this. So practically, this should work however I am seeing that it messes up the format of the page completely. It reorders all the elements and makes them jumbled up.

http://stackoverflow.com/q/28882926
has comment: http://stackoverflow.com/comment/46027286
possible better answer: http://stackoverflow.com/a/28883371
has body: First of all: I do not want to use jQuery. I would like to find a way to parse this type of json and add it text into the special tag: { "datas": { "General": [ { "id": "hotel_name", "value": "My Hotel name" }, { "id": "hotel_description", "value": "Lorem ipsum dolor..." } ], "Photos": [ { "id": "photo1", "value": "house.png" }, { "id": "photo2", "value": "house.png" } ] } } On a HTML I have special tag: Must become: My Hotel name I tried this: function createElements(elements) { elements = JSON.parse(elements); elements.forEach(funciton (element) { var div = document.getElementById(element.id); div.innerHTML = element.text; }); } var request = new XMLHttpRequest(); request.onload = createElements; request.open("get", "datas.json", true); request.send(); But it do not work like I wanted. Do you have any cue ? Thanks.
has answer: http://stackoverflow.com/a/28883371
has title: Parse a json without jQuery and add the value in HTML code
answer count: 5
accepted answer: http://stackoverflow.com/a/28883904
has answer: http://stackoverflow.com/a/28883914
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28883848
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/28883788
type: Question
has comment: http://stackoverflow.com/comment/46027655
has answer: http://stackoverflow.com/a/28883904
tagged with: javascript
score: 0

http://stackoverflow.com/a/28841242
answers question: http://stackoverflow.com/q/28841117
has body: The line that actually changes your value is this one currentValue += valueToAdd; So, if you check the value thats going to be inserted to currentValue before changing it, you could stop the function execution and prevent it from being updated: function(valueToAdd){ var temp = currentValue + valueToAdd; // calculating the next value if (temp &lt; 0) return; // if its a negative value, exit from the function without updating currentValue currentValue = temp; // other code } Check this codepen
score: 0
type: Answer

http://stackoverflow.com/q/28764165
possible better answer: http://stackoverflow.com/a/28764340
tagged with: css
has answer: http://stackoverflow.com/a/28764340
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28764458
score: 3
upvote count: 3
has answer: http://stackoverflow.com/a/28764445
has answer: http://stackoverflow.com/a/28765298
type: Question
has answer: http://stackoverflow.com/a/28764712
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/28765298
favorite count: 0
has body: I have mixed well and bad formatted text from a legacy wordpress database. Well formated is inside p tags and bad formatted is outside. So at the end the HTML is like that: Good text Good text Problematic text like this one. Good text The p text has a max-width set and is centered: p { max-width: 300px; margin: 0 auto; padding: 10px; } The blockquote element or other divs are not width-limited. As you can see in this fiddle example, my problem is that the non-p text is left-aligned. I don't know if it's possible to center using just CSS. Using javascript my approach was to do this: jQuery("div").contents().filter(function() { return this.nodeType === 3; }).wrap(' '); This is ok in general, buy when you have strong or em tags in the middle it doesn't work (example). So, is CSS able to do this? If not, how to do in Javascript? Of course, I prefer the CSS option, but JS is a better option than reformat the whole database :) Clarification: The objective is to limit with max-width only the p-tags and the bad-fomatted text elements (which include text and some tags like strong or em). Other elements must have 100% width, it is, not limited by the 300px max-width (i.e. blockquote must use all the available screen size).
has title: How to set a max-width only to text nodes not in a tag?
answer count: 5

http://stackoverflow.com/comment/46052455
score: 1
has text: Your question is not clear enough, what are you trying to achieve?
type: QuestionComment
comment on: http://stackoverflow.com/q/28896369
type: Comment

http://stackoverflow.com/comment/46066448
score: 0
comment on: http://stackoverflow.com/a/28902235
has text: how would u know where server is located without serverUrl? my server is in remote computer
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/45883574
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28803493
has text: so put everything inside in that function?

http://stackoverflow.com/a/28808445
answers question: http://stackoverflow.com/q/28807653
score: 1
has body: You've got twice exactly this same route .when("/:pageName", {.. .when("/:pageName", { templateUrl: "views/wizard-humor.html", controller: "HumorCtrl" }) // Articles in controller NatureCtrl no appear .when("/:pageName", { templateUrl: "views/wizard-nature.html", controller: "NatureCtrl" }) .otherwise({ redirectTo: '/' }); change it to : .when("/humor/:pageName", { templateUrl: "wizard-humor.html", controller: "HumorCtrl" }) // Articles in controller NatureCtrl no appear .when("/nature/:pageName", { templateUrl: "wizard-nature.html", controller: "NatureCtrl" }) and after that you can have a link like /nature/something or /humor/something please see demo here http://plnkr.co/edit/fklkUO3YTiXaFYXuDrEz?p=preview
has comment: http://stackoverflow.com/comment/45926316
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45912913
accepted answer of: http://stackoverflow.com/q/28807653
type: Answer
upvote count: 1

http://stackoverflow.com/comment/45942874
type: AnswerComment
has text: Hello mate, I just tried with no joy, take a look at the livelink for me and see what I havedone wrong? the actual calender can be found at www.cambridgedesigncompany.com/clock2.php
type: Comment
comment on: http://stackoverflow.com/a/28836458
score: 0

http://stackoverflow.com/a/28833601
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/28829283
accepted answer of: http://stackoverflow.com/q/28829283
has body: With the help of Regent and this fiddle I came up with the answer: function flicker() { var maxFlick = 6, amount = Math.round(Math.random() * maxFlick), delta = 2, timer; var doneFlicks = 0; var flickInterval = setInterval(showHide, timer); function showHide() { timer = Math.round((Math.random() + delta) * 100) $flicker.show(); var hide = setTimeout(function() { $flicker.hide(); doneFlicks++ }, 20) if (doneFlicks == amount) { clearInterval(flickInterval); } } } setInterval(flicker, 3000); This produces a randomised flicker effect that's called every 3 seconds - perfect for a horror film effect! Thanks again to Regent for all the help!
type: AcceptedAnswer
score: 2
downvote count: 0

http://stackoverflow.com/a/58021177
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/28819635
upvote count: 1
has body: you can use "Mix text tags" option in jquery. Please refer https://yaireo.github.io/tagify/

http://stackoverflow.com/comment/45989392
score: 0
has text: Element IDs should be unique in your HTML not in your function :) Did you try with different names for divs ?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28861514

http://stackoverflow.com/comment/45822725
score: 0
has text: Oh, sorry. I assumed you were blocking the form-submit by returning false and/or calling preventDefault. I see someone else already pointed that out though, so good. :)
type: Comment
comment on: http://stackoverflow.com/a/28771865
type: AnswerComment

http://stackoverflow.com/a/28851420
has comment: http://stackoverflow.com/comment/45970095
score: 0
has comment: http://stackoverflow.com/comment/45969922
has body: You are calling json_decode in the wrong way. Try to do like this: $contact=json_decode($json,true); foreach($contact as $con) { $num=$con['phoneNumbers']['value']; $name=$con['displayName']; $email=$con['emails']['value']; insertToDb($num,$name,$email); }
answers question: http://stackoverflow.com/q/28851357
type: Answer

http://stackoverflow.com/comment/45849844
score: 0
comment on: http://stackoverflow.com/a/28783569
type: Comment
has text: @JosephVigdorovich, if you have an answer, please post it as an answer to this question so that everyone can share in your knowledge. That is the purpose of Stack Overlow. Thanks.
type: AnswerComment

http://stackoverflow.com/comment/45836877
has text: @ArunprasanthKV yup your code worked thank you !!
comment on: http://stackoverflow.com/q/28759467
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/45994383
score: 0
type: QuestionComment
type: Comment
has text: what is your problem? please elaborate more..
comment on: http://stackoverflow.com/q/28864478

http://stackoverflow.com/q/28771135
has comment: http://stackoverflow.com/comment/45821812
linked to: http://stackoverflow.com/q/14207318
has comment: http://stackoverflow.com/comment/45820939
type: Question
has comment: http://stackoverflow.com/comment/45822185
tagged with: javascript
tagged with: fullcalendar
tagged with: jquery
has title: Modal window wont display from Javascript call
score: 0
tagged with: typeerror
has comment: http://stackoverflow.com/comment/45823054
answer count: 1
has comment: http://stackoverflow.com/comment/45822469
has comment: http://stackoverflow.com/comment/45820886
tagged with: twitter-bootstrap
type: UnansweredQuestion
has body: Im trying to pop up a form from the fullcalender.js plugin. I have the form in a bootstrap modal div and am trying to pop it up, fill it out and commit details to database etc. The problem is that the modal will not display, i have read through SO links such as this one and have adapted code from this fiddle i have gone as far as copy/pasting that fiddle which works there but not for me, is there an issue because mine is a .jsp page or am i missing .js files. I have all the bootstrap and fullcallender .js files included, any advice ? $('#myModal').modal('show'); This should work right ? but it dosen't seem to EDIT $(document).ready(function () { var calendar = $('#calendar').fullCalendar({ header: { ...etc }, defaultView: 'agendaWeek', editable: true, selectable: true, selectHelper: true, height: 846, select: function (start, end, allDay) { endtime = $.fullCalendar.formatDate(end, 'h:mm tt'); starttime = $.fullCalendar.formatDate(start, 'ddd, MMM d, h:mm tt'); var mywhen = starttime + ' - ' + endtime; $('#createEventModal #apptStartTime').val(start); $('#createEventModal #apptEndTime').val(end); $('#createEventModal #apptAllDay').val(allDay); $('#createEventModal #when').text(mywhen); $('#createEventModal').modal('show'); } }); EDIT my error is an Uncaught TypeError: undefined is not a function on this line endtime = $.fullCalendar.formatDate(end, 'h:mm tt');
has answer: http://stackoverflow.com/a/28781388

cross-browser
tags question: http://stackoverflow.com/q/28889859
tags question: http://stackoverflow.com/q/28773062
tags question: http://stackoverflow.com/q/28779896
type: Tag
tags question: http://stackoverflow.com/q/28766482
tag name: cross-browser
tags question: http://stackoverflow.com/q/28847396

http://stackoverflow.com/comment/45956109
score: 0
type: Comment
type: QuestionComment
has text: @rmmoul take look at my answer. if it returns a json as string so it ll work
comment on: http://stackoverflow.com/q/28843505

http://stackoverflow.com/q/28881256
score: 1
has comment: http://stackoverflow.com/comment/46024349
has body: Trying to get my head around method ordering, setTimeout() and callbacks. I need to call the Isotope method layout() once a setTimeout() function is complete, otherwise the layout is off and elements overlap. // &lt;--- CODE this.timeout = 400; this.update = function() { window.setTimeout(function() { $(".item.is-loading").each(function(index) { var _time = 100 * index, $this = $(this); window.setTimeout(function() { $this.removeClass("is-loading").find("img").css({ width: "100%", height: "auto" }); }, _time); }) }, instance.timeout); instance.feed.isotope("layout"); }; // ---&gt; CODE I can see that layout() is being called before as setTimoute() is complete is it's asynchronous, but I can't figure out a nice way to solve the issue without using another setTimeout??
type: AnsweredQuestion
tagged with: javascript
has comment: http://stackoverflow.com/comment/46024613
has comment: http://stackoverflow.com/comment/46024210
type: Question
has comment: http://stackoverflow.com/comment/46024295
upvote count: 1
has title: Understanding setTimeout() and callbacks with jQuery Isotope
answer count: 1
tagged with: jquery-isotope
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/46024271
has comment: http://stackoverflow.com/comment/46024216
has comment: http://stackoverflow.com/comment/46024039
has comment: http://stackoverflow.com/comment/46023839
has answer: http://stackoverflow.com/a/28881626
downvote count: 0
accepted answer: http://stackoverflow.com/a/28881626

http://stackoverflow.com/comment/45807852
comment on: http://stackoverflow.com/a/28764349
score: 0
type: AnswerComment
has text: Something's a little puzzling (but I didn't do any research) : why does uglify.js change `a;if(b)` to `if(a,b)` ? There doesn't seem to be any gain.
type: Comment

http://stackoverflow.com/q/28810359
tagged with: javascript
answer count: 3
downvote count: 0
accepted answer: http://stackoverflow.com/a/28810425
tagged with: jquery
has title: Matching the URL path with attr('href') to dynamically update .active class
favorite count: 0
has body: Hey guys i have my navbar code in a navbar.php file and the HTML looks like as follows : Home About us Products product-1 product-2 product-3 product-4 product-5 product-6 Contact us onpage load i am running a very simple Jquery snippet to run through all the and check if thier href matches the url (actually end of the url eg. index.php ) in the browser . So i have the following Jquery snippet : $(document).ready(function(){ var _urlpath = $(location).attr('pathname'); console.log(_urlpath); // this does't print out the desired version , it prints `/lala-v1/about-us.php"` $('#menu > li').each(function(){ var _str = $(this).find('a').attr('href'); console.log(_str); // these print out the desired output eg. index.php if(_str == _urlpath){ console.log(_str + _urlpath); } }); }); checkout my comments and , my difficulty is getting the correct url path on the 2nd line of on Jquery . I went through this article and none of of the Jquery options i see are going to return the end part of the URL i see . so what do i do ? i am stuck , is there a way around this in JS/Jquery . I am new to both these feilds , so i would appreciate any help .
type: AnsweredQuestion
score: 1
upvote count: 1
possible better answer: http://stackoverflow.com/a/28810630
has answer: http://stackoverflow.com/a/28810425
type: Question
has answer: http://stackoverflow.com/a/28810630
has answer: http://stackoverflow.com/a/28810521

http://stackoverflow.com/q/28900024
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/28900457
score: 0
tagged with: http-proxy
has body: I encountered a problem using node.js with the node-http-proxy module. On some webpages resources are not loaded, because the server redirects the request to the original html file. So for every picture or css file, the index.html file is loaded again. The strange thing is that this does not happen on all websites but only on some. Here's my code: var express = require('express'), httpProxy = require('http-proxy'), var router = express.Router(); var proxy = new httpProxy.createProxyServer(); router.get('/:url', function(req, res) { var options = { target: { host: req.params.url, port: 80, path: 'http://' }, timeout: 5000, proxyTimeout: 5000, xfwd: true, prependPath: true }; proxy.web(req, res, options); }); An example for a webpage where this does not work ist http://www.kicker.de I already tried several options, like hostRewrite or changeOrigin but those do not seem to change this.
has title: Node-http-proxy: Requests on ressources get redirected to index.html
type: UnansweredQuestion
tagged with: node.js
type: Question

http://stackoverflow.com/q/28856090
has comment: http://stackoverflow.com/comment/45979214
has comment: http://stackoverflow.com/comment/73451725
has comment: http://stackoverflow.com/comment/46166328
answer count: 3
has title: How to sort bar in nvd3?
has body: I am using nvd3 multibar chart in my application. Its working fine. Here i need to sort the bars based on the values(I mean in ascending/descend manner). Is there any inbuilt function available for sorting in nvd3. Or how can I achieve the sorting thing. nv.addGraph(function() { var chart; chart = nv.models.multiBarChart() .margin({bottom: 100}) .transitionDuration(300); chart.options( {delay: 1200}); chart.multibar .hideable(false); chart.xAxis //.axisLabel("Modules") .rotateLabels(45); chart.yAxis .tickFormat(function(d) { return d + "%"; }); d3.select('#' + "barChart" + ' svg') .datum(data) .call(chart); nv.utils.windowResize(chart.update); chart.dispatch.on('stateChange', function(e) { nv.log('New State:', JSON.stringify(e)); }); return chart; });
has comment: http://stackoverflow.com/comment/46009060
has comment: http://stackoverflow.com/comment/45978454
has answer: http://stackoverflow.com/a/34946198
linked to: http://stackoverflow.com/q/21034973
tagged with: jquery
has answer: http://stackoverflow.com/a/38247527
favorite count: 0
linked to: http://stackoverflow.com/q/26114534
linked to: http://stackoverflow.com/q/24689157
tagged with: nvd3.js
type: UnansweredQuestion
upvote count: 4
has answer: http://stackoverflow.com/a/28876112
has comment: http://stackoverflow.com/comment/46010815
downvote count: 0
tagged with: d3.js
has comment: http://stackoverflow.com/comment/45979782
type: Question
tagged with: javascript
score: 4

http://stackoverflow.com/comment/45795768
type: Comment
comment on: http://stackoverflow.com/q/28757350
has text: If `new Object` would be the same as `Object.create`, why would we need the latter?
score: 1
type: QuestionComment

http://stackoverflow.com/comment/45788509
type: QuestionComment
has text: Ok, so after the return how do I refresh the View?
score: 0
comment on: http://stackoverflow.com/q/28753183
type: Comment

http://stackoverflow.com/comment/45950912
comment on: http://stackoverflow.com/q/28840490
score: 0
type: Comment
has text: @charlietfl It can't be. Thanks for pointing that out. However, I'm still left with my question of how to prevent the link from being clicked simultaneously with the click of the overlaying element.
type: QuestionComment

http://stackoverflow.com/a/28859424
type: Answer
accepted answer of: http://stackoverflow.com/q/28857540
answers question: http://stackoverflow.com/q/28857540
score: 5
type: AcceptedAnswer
has body: Follow this steps: plotObj.setData(newData); plotObj.setupGrid(); //if you also need to update axis. plotObj.draw(); //to redraw data Another usefull method is getData(). With this method you can get the current data. var data = plotObj.getData();
downvote count: 0
upvote count: 5

http://stackoverflow.com/a/28906268
upvote count: 1
answers question: http://stackoverflow.com/q/28906201
type: Answer
downvote count: 0
score: 1
has body: ng-click has access to the $event param: ng-click="deleteTask(task, $event)" $scope.deleteTask = function(task, e) { var index = $scope.tasks.indexOf(task); $scope.tasks.splice(index, 1); console.log(e.target); //caller }; As the other answer says, you shouldn't do this... instead, apply a CSS class to transition the element out (one way) (checkout ngAnimate for nice enter/exit animations on repeaters)

http://stackoverflow.com/q/28880027
has answer: http://stackoverflow.com/a/28880161
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28880161
possible better answer: http://stackoverflow.com/a/28880382
has body: This might be a stupid question and I am sceptics of this would even be a good practices, but I would like to know for sure, so here goes. If the HomeController have a list as a field, and one user add to it, would that user get the list back with something in it or would it be empty? And what about when there is more users how would that (not?) work? Whould they have their own list? I am asking because I know how to persist small things on client and bigger things in DB but I would like to know if I have a "Server" options, where I can store something in the Controller in MVC. public List&lt;int&gt; Ids { get; set; } public HomeController() { Ids = new List&lt;int&gt;(); } public ContentResult AddToIds(int id) { Ids.Add(id); return Content("Added"); } public ContentResult GetIds() { return Content(Ids.Count.ToString()); }
type: Question
tagged with: c#
tagged with: asp.net-mvc-5
tagged with: asp.net-mvc
tagged with: javascript
tagged with: ajax
has title: Is it possible to store things in a MVC Controller?
has answer: http://stackoverflow.com/a/28880382
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/46021662
has answer: http://stackoverflow.com/a/28880387

http://stackoverflow.com/a/28839261
has comment: http://stackoverflow.com/comment/45947718
has comment: http://stackoverflow.com/comment/45949694
has comment: http://stackoverflow.com/comment/45948522
answers question: http://stackoverflow.com/q/28839134
has comment: http://stackoverflow.com/comment/45948020
has comment: http://stackoverflow.com/comment/45949738
has comment: http://stackoverflow.com/comment/45948854
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45948388
has body: Use the classList API with the Element.querySelector() API function change(){ which.classList.toggle('visibility');// toggle a given class each time we click on the element woth the name nieu }; var which = document.querySelector('#nime'),// get element with ID=nime //which = document.querySelector('[id=nime]'), nieu = document.querySelector('[name=nieu]');// get element with name=nime // add the click event to nieu nieu.addEventListener("click", change, false) .visibility{ /*this is our class to hide the element*/ display: none } Newspaper? How? Email Post Both Same with the hidden state on load just add class .visibility function change(){ which.classList.toggle('visibility'); }; var which = document.querySelector('#nime'), nieu = document.querySelector('[name=nieu]'); nieu.addEventListener("click", change, false) .visibility{ display: none } Newspaper? How? Email Post Both Alternative to javascript you can use jquery to make your life easier but JS is recommended $('[name=nieu]').click(function(){ $('#nime').toggleClass("visibility") }) .visibility{ display: none } Newspaper? How? Email Post Both to hide the element on load just add the class to it $('[name=nieu]').click(function(){ $('#nime').toggleClass("visibility") }) .visibility{ display: none } Newspaper? How? Email Post Both or if you don't want to add css the Jquery methode $('[name=nieu]').click(function(){ $('#nime').is(":visible") ? $('#nime').hide(): $('#nime').show() }) Newspaper? How? Email Post Both The javascript methode function change(){ which.style.display == "none"? which.style.display = "block" : which.style.display = "none" }; var which = document.querySelector('[id=nime]'), nieu = document.querySelector('[name=nieu]'); nieu.addEventListener("click", change, false) Newspaper? How? Email Post Both
upvote count: 2
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/45947964
has comment: http://stackoverflow.com/comment/45949067
has comment: http://stackoverflow.com/comment/45947678
has comment: http://stackoverflow.com/comment/45949282
has comment: http://stackoverflow.com/comment/45950040
accepted answer of: http://stackoverflow.com/q/28839134

http://stackoverflow.com/comment/45857202
type: Comment
comment on: http://stackoverflow.com/q/28756928
has text: Alternatively, you can use an event-based structure - instead of passing callbacks, you have callbacks fire events on which you register an event handler. This would still improve the code structure, IMO. With plain promises, you miss the opportunity to use descriptive function names to document intention. With events, you get two possibilities for documentation: the event name and the handler name.
score: 0
type: QuestionComment

http://stackoverflow.com/a/28849678
type: Answer
has body: If you create a DOM element like below you wont have any problems with quotes. var input = document.createElement('input'); input.setAttribute('type','text'); input.setAttribute('value',MyString); htmlID.push(input.outerHTML);
score: 0
answers question: http://stackoverflow.com/q/28849603

http://stackoverflow.com/a/28834029
answers question: http://stackoverflow.com/q/28833559
has comment: http://stackoverflow.com/comment/45965331
score: 3
accepted answer of: http://stackoverflow.com/q/28833559
has body: change both the tasks as below gulp.task('minify-css', function () { return gulp.src(['src/test/test.css]) .pipe(concat('test1.css')) .pipe(minifyCSS()) .pipe(gulp.dest('src/source/')) .pipe(filesize()) }); gulp.task('copy-css',['minify-css'], function () { return gulp.src('src/source/*.css') .pipe(gulp.dest('src/dest/')); }); add return so that next task runs after first one runs, else your copy-csss is running even before minify-css is finished.. hence the error...
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45938406
downvote count: 0
has comment: http://stackoverflow.com/comment/45961194
type: Answer
has comment: http://stackoverflow.com/comment/45961261
upvote count: 3

http://stackoverflow.com/a/28806971
has body: I edited my answer try this one to check days. This will give you some idea on how to do this. function daysInMonth(month,year) { return new Date(year, month, 0).getDate(); } //July daysInMonth(7,2009); //31 //February daysInMonth(2,2009); //28 daysInMonth(2,2008); //29
downvote count: 0
has comment: http://stackoverflow.com/comment/45888620
answers question: http://stackoverflow.com/q/28806818
upvote count: 2
type: Answer
score: 2

http://stackoverflow.com/q/28814989
has title: pass a 2 dimensional array to a funtion in javascript
duplicate of: http://stackoverflow.com/q/8892465
has answer: http://stackoverflow.com/a/28815517
has comment: http://stackoverflow.com/comment/45901940
has body: I want to pass a 2 dimensional array: events = [ { title: 'All Day Event', start: '2014-09-01' }, { title: 'Long Event', start: '2014-09-07', end: '2014-09-10' } ]; to a display function: function display(events){ alert(display the matrix); }; but it doesn't work, it displays just "objects" and not the value of the objects
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45901978
has comment: http://stackoverflow.com/comment/45901874
has comment: http://stackoverflow.com/comment/45903750
possible better answer: http://stackoverflow.com/a/28815320
type: Question
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/28815320
accepted answer: http://stackoverflow.com/a/28815517
tagged with: javascript
has comment: http://stackoverflow.com/comment/45902104
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/8892465

http://stackoverflow.com/comment/45960692
comment on: http://stackoverflow.com/a/28844894
has text: @user3806955 sorry mate.. unless the hidden element you are created is not added to the dom... the jQuery selector will fail... in the above fiddle `$(x).appendTo('body');` adds the dom element referenced by `x` to the `body` element that is why the `input[name='EventName']` is working in the fiddle... if you could recreate the issue in the fiddle we could try to help... else there nothing more can be done
score: 0
type: AnswerComment
type: Comment

import
type: Tag
tag name: import
tags question: http://stackoverflow.com/q/28827217

http://stackoverflow.com/q/28839359
tagged with: google-maps
answer count: 1
has comment: http://stackoverflow.com/comment/45948319
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45948529
has title: Google Maps API Autocomplete search box
linked to: http://stackoverflow.com/q/9786272
has comment: http://stackoverflow.com/comment/45948382
downvote count: 2
has answer: http://stackoverflow.com/a/28839793
upvote count: 1
type: Question
duplicate of: http://stackoverflow.com/q/9786272
tagged with: autocomplete
has comment: http://stackoverflow.com/comment/45948221
tagged with: javascript
score: -1
has body: I have followed Google Dev's tutorial on how to add a location search box with auto complete: Here But i cant seem to get it working. The box is displayed and i can type, but the autocomplete function does not work as intended and nothing happens when i type and hit return. HTML: &lt;div class="col-md-9"&gt; &lt;input id="pac-input" class="controls" type="text" placeholder="Search Location..."&gt; &lt;!-- Location Search Box --&gt; &lt;div id="map-canvas"&gt;&lt;/div&gt; &lt;/div&gt; Javascript: tidy_maps.initialize = function() { // Declare the map and its options var myOptions = { center: ireland, zoom: 7, panControl: false, zoomControlOptions: { style: google.maps.ZoomControlStyle.SMALL, position: google.maps.ControlPosition.LEFT_TOP }, streetViewControl: false, }; map = new google.maps.Map(document.getElementById('map-canvas'), myOptions); // Set default bounds for search box - biased towards Ireland var defaultBounds = new google.maps.LatLngBounds( new google.maps.LatLng(55.51150, -10.22827), new google.maps.LatLng(51.43514, -5.43823)); // Add Search Box to Map space var input = document.getElementById('pac-input'); map.controls[google.maps.ControlPosition.TOP_LEFT].push(input); var options = { bounds: defaultBounds }; // Create Autocomplete for Search autocomplete = new google.maps.places.Autocomplete(input, options);
tagged with: google-maps-api-3
has comment: http://stackoverflow.com/comment/45947929

http://stackoverflow.com/comment/45914001
type: QuestionComment
has text: Query String structure should look more like: `http://google.com/search?q=hi&callback=somecallback`.
comment on: http://stackoverflow.com/q/28820989
score: 0
type: Comment

http://stackoverflow.com/comment/46549929
type: QuestionComment
comment on: http://stackoverflow.com/q/28872931
score: 0
has text: You can use the HTML5 sandbox attribute: http://stackoverflow.com/questions/369498/how-to-prevent-iframe-from-redirecting-top-level-window
type: Comment

http://stackoverflow.com/q/28891689
linked to: http://stackoverflow.com/q/6854296
has body: I'm trying to create a simple application, where the user enters some text in the a text field, clicks save, and then that prompts a save file dialog for them to save the text written in the text field to a .txt document. From all the googling and looking at SO questions, I keep getting answers like Use FileSaver.js. (Isn't supported for IE versions &lt;10). You can't save files for security reasons. Here's an HTML5 solution. (Not useful for me - I have to make this app for IE7 and FF11). The question is - why is this basic functionality not allowed/not native? I get that you don't want your browser covertly saving data, but an explicit save file dialog box seems harmless.
type: Question
has comment: http://stackoverflow.com/comment/46044356
tagged with: javascript
has comment: http://stackoverflow.com/comment/46044357
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28892009
linked to: http://stackoverflow.com/q/3358209
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46044348
has title: Why can't you natively save files with javascript?

http://stackoverflow.com/a/42489583
type: Answer
has body: You can use like this. &lt;img class="small" src="VTVFile1.jpg" alt="Image not found" onError="this.onerror=null;this.src='demo.jpg?'+new Date().getTime();" /&gt;
score: 0
answers question: http://stackoverflow.com/q/28894875

http://stackoverflow.com/a/28884911
has body: How about simply removing the last element as long as it's an empty string ? var arr = ["some", "", "", "value", "", "", ""]; while ( arr.getLast() == "" ) arr.pop(); (EDIT: OP just edited the question saying that he doesn't want this particular method.. )
type: Answer
answers question: http://stackoverflow.com/q/28884773
has comment: http://stackoverflow.com/comment/46031016
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/46031232
downvote count: 0
has comment: http://stackoverflow.com/comment/46031889

http://stackoverflow.com/a/28789039
type: Answer
upvote count: 1
score: 1
has body: Queue.js handles it such: if (typeof define === "function" &amp;&amp; define.amd) define(function() { return queue; }); else if (typeof module === "object" &amp;&amp; module.exports) module.exports = queue; else this.queue = queue; Underscore does something such : if (typeof exports !== 'undefined') { if (typeof module !== 'undefined' &amp;&amp; module.exports) { exports = module.exports = _; } exports._ = _; } else { root._ = _; } But this seems to assess node.modules. Secondly, if someone could confirm what each case is, that would help !
downvote count: 0
answers question: http://stackoverflow.com/q/28788911

http://stackoverflow.com/q/28849936
tagged with: mongodb
tagged with: mongoose
tagged with: javascript
score: 0
upvote count: 1
has comment: http://stackoverflow.com/comment/45967246
answer count: 1
has title: Find document, then find entry within array and remove it from the array
tagged with: mongodb-query
favorite count: 0
has body: In Node and Mongoose, I'd like to remove an object from an array in a document. The structure is like this. { _id: ObjectId, title: String, tags: [ { text: String }, { text: String } ] } I will look up an item by it's _id, but then I want to look within the tags for a certain String and remove that from the array.
has answer: http://stackoverflow.com/a/28850028
accepted answer: http://stackoverflow.com/a/28850028
downvote count: 1
tagged with: node.js
type: AnsweredQuestion
type: Question

http://stackoverflow.com/q/28778399
has comment: http://stackoverflow.com/comment/46007409
tagged with: jsp-tags
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45834503
tagged with: jsplumb
type: Question
has title: How can I include a drag and drop interactive UI in jsp page?
tagged with: jsp
tagged with: javascript
has answer: http://stackoverflow.com/a/28778989
score: 0
answer count: 1
has body: I created a JSP page consisting of two tables and the page refreshes automatically after 5 second interval.On retrieval ,it fetches some data from the database using Java back end class and displays the required fields in the tables(both of them) with up to time information.A blank row will be created automatically in the table 1 depending upon the "flag" column's value(is a column of fetched table) fetched from the database.I want the user to be given with a privilege ,to "drag and drop" certain row from the table no:2 to table no:1 into this created blank row.The updated table should be shown instantly.Any suggestions please of where to start or what should be done to achieve this.

http://stackoverflow.com/comment/45846907
comment on: http://stackoverflow.com/q/28785237
type: Comment
type: QuestionComment
score: 1
has text: @minitech well math.js ultimately just relies on `Number.prototype.toFixed()` to do the conversion, and it won't format a number bigger than `1e21` without scientific notation.

http://stackoverflow.com/q/28791508
score: 1
has body: I have asp:GridView with LinkButton: &lt;asp:TemplateField&gt; &lt;ItemTemplate&gt; &lt;asp:LinkButton ID="Cancel" runat="server" OnClick="Cancel_Click" OnClientClick="return confirmCancel(this);"&gt;cancel&lt;/asp:LinkButton&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; I want the server side event to occur only when the confirmCancel returns true. but I have a strange problem: if the function explicitly returns true - return true; the event occurs. if the function explicitly returns false - return false; the event does not occurs. but if the function returns variables with true or false - return x; the event does not occur anyway. I put debugger and saw that the value of x is true or false and not undefined or something. what is the problem? confirmCancel: function confirmCancel(sender) { var msg = "are you sure you want to cancel?" var x = myConfirm(msg, sender); return x; } myConfirm: function myConfirm(msg, sender) { if ($('#myConfirm').hasClass("hide")) { $('#myConfirm').removeClass("hide"); $('#myConfirm p').text(msg); $("#myConfirm input#btn-ok").unbind("click").click(function () { $(sender).click(); return false; }); return false; } else { $('#alertify').addClass("hide"); return true; } } how can I solve it?
has comment: http://stackoverflow.com/comment/45858284
type: Question
has comment: http://stackoverflow.com/comment/45858391
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45858158
has title: Why is asp:LinkButton server side event doesn't fire when clientClick returns true
has comment: http://stackoverflow.com/comment/45858336
upvote count: 1
answer count: 1
tagged with: events
tagged with: server-side
tagged with: asp.net
favorite count: 0
has comment: http://stackoverflow.com/comment/45858186
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45858122
has answer: http://stackoverflow.com/a/28791865
downvote count: 0

http://stackoverflow.com/comment/45968756
type: AnswerComment
comment on: http://stackoverflow.com/a/28843722
type: Comment
has text: Thanks, this did the trick! However, I had to modify your solution slightly, as what you posted did not work exactly the way it should. The CSS proved to be unnecessary, and I only used the first three lines of your code, using the calculated width and height to draw the rectangle (the working code is now in my original post).
score: 2

http://stackoverflow.com/a/28800060
has comment: http://stackoverflow.com/comment/45874158
has comment: http://stackoverflow.com/comment/45874248
score: 0
has comment: http://stackoverflow.com/comment/45874301
has body: if i got you right... JQuery: $(document).ready(function(){ var ParentWidth = $('.parent').width(); if (ParentWidth &gt; 400) { $('.parent').addClass('newstyle'); } }); CSS: .newstyle { background: red; /*** add more css ***/ } i Recommends you to use class because you can add more css to the class later.
answers question: http://stackoverflow.com/q/28799970
has comment: http://stackoverflow.com/comment/45874485
type: Answer

http://stackoverflow.com/a/45137420
upvote count: 2
type: Answer
has body: The full path comes through in the POST data: Dropzone.options.yourDropzoneID = { init: function() { this.on("sending", function(file, xhr, data) { if(file.fullPath){ data.append("fullPath", file.fullPath); } }); } };
score: 2
answers question: http://stackoverflow.com/q/28808146
downvote count: 0

http://stackoverflow.com/q/28873058
upvote count: 1
has comment: http://stackoverflow.com/comment/46008881
has answer: http://stackoverflow.com/a/28873379
score: 1
has comment: http://stackoverflow.com/comment/46008925
has title: How to use setTimeout() with slow function
has comment: http://stackoverflow.com/comment/46008796
has answer: http://stackoverflow.com/a/28873390
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/46009082
downvote count: 0
has comment: http://stackoverflow.com/comment/46008976
has comment: http://stackoverflow.com/comment/46009112
tagged with: javascript
has comment: http://stackoverflow.com/comment/46008853
has comment: http://stackoverflow.com/comment/46009154
favorite count: 0
has body: in w3school (try it) I have this code: &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;body&gt; &lt;img name="slide" class="slider" src="" width="400"/&gt; &lt;script&gt; var i = 0; var path = new Array(); path[0] = "http://vignette2.wikia.nocookie.net/batman/images/9/92/Batman-ArkhamKnight-BatsuitRender.png/revision/latest?cb=20140605151444"; path[1] = "http://vignette4.wikia.nocookie.net/injusticegodsamongus/images/c/c5/BATGIRL.png/revision/latest?cb=20130527034044"; path[2] = "http://vignette2.wikia.nocookie.net/injusticegodsamongus/images/b/bb/Raven_Render.png/revision/latest?cb=20130318184222"; path[3] = "http://vignette1.wikia.nocookie.net/injusticegodsamongus/images/7/7f/ARES.png/revision/latest?cb=20130411230035"; function swapImage() { document.slide.src = path[i]; if (i &lt; path.length - 1) i++; else i = 0; setTimeout("swapImage()", 2000); } window.onload = swapImage; &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; So I am trying to use setTimeout function and it works, but is it possible to change these images slow() ?
type: UnansweredQuestion

http://stackoverflow.com/comment/46040384
score: 0
type: Comment
has text: So this won't work by real async code, e.g. by db connection?
comment on: http://stackoverflow.com/a/28889643
type: AnswerComment

http://stackoverflow.com/q/28903485
possible better answer: http://stackoverflow.com/a/28904461
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28904461
has body: So, i'd like to have an header working similarly to the one here http://www.blackmesasource.com/ , the only problem being I know nothing about javascript and jquery, can anyone help me?
has answer: http://stackoverflow.com/a/28904300
type: Question
answer count: 2
tagged with: http://stackoverflow.com/tag/html
score: 0
has title: Scroll then fix to top header in html
accepted answer: http://stackoverflow.com/a/28904300
has comment: http://stackoverflow.com/comment/46067985
tagged with: javascript
has comment: http://stackoverflow.com/comment/46066740

http://stackoverflow.com/q/28792352
downvote count: 4
tagged with: jquery
has comment: http://stackoverflow.com/comment/45859610
has comment: http://stackoverflow.com/comment/45860620
favorite count: 0
type: Question
answer count: 1
has comment: http://stackoverflow.com/comment/45859558
has answer: http://stackoverflow.com/a/28811931
has comment: http://stackoverflow.com/comment/45860741
upvote count: 1
has title: Duplicate Fields within Duplicate Groups jQuery
has comment: http://stackoverflow.com/comment/45859832
tagged with: javascript
tagged with: duplicates
type: UnansweredQuestion
score: -3
has body: Does anyone know how to duplicate a field in a duplicated group? I tried it with recopy jQuery but it did not work as expected. This are my Clone Fields: If i klick on add Text1 it should clone the duplicable fields. But its duplicating only the removelink! Hope this info was enough for you. $(function(){ var removeLink = ' Delete'; $('a.add').relCopy({ append: removeLink}); }); /** * jQuery-Plugin "relCopy" * * @version: 1.1.0, 25.02.2010 * * @author: Andres Vidal * code@andresvidal.com * http://www.andresvidal.com * * Instructions: Call $(selector).relCopy(options) on an element with a jQuery type selector * defined in the attribute "rel" tag. This defines the DOM element to copy. * @example: $('a.copy').relCopy({limit: 5}); // Copy Phone * * @param: string excludeSelector - A jQuery selector used to exclude an element and its children * @param: integer limit - The number of allowed copies. Default: 0 is unlimited * @param: string append - HTML to attach at the end of each copy. Default: remove link * @param: string copyClass - A class to attach to each copy * @param: boolean clearInputs - Option to clear each copies text input fields or textarea * */ (function($) { $.fn.relCopy = function(options) { var settings = jQuery.extend({ excludeSelector: ".exclude", emptySelector: ".empty", copyClass: "copy", append: '', clearInputs: true, limit: 0 // 0 = unlimited }, options); settings.limit = parseInt(settings.limit); // loop each element this.each(function () { // set click action $(this).click(function (){ var rel = $(this).attr('rel'); // rel in jquery selector format var counter = $(rel).length; // stop limit if (settings.limit != 0 && counter >= settings.limit){ return false; }; var master = $(rel+":first"); var parent = $(master).parent(); var clone = $(master).clone(true).addClass(settings.copyClass+counter).append(settings.append); //Remove Elements with excludeSelector if (settings.excludeSelector){ $(clone).find(settings.excludeSelector).remove(); }; //Empty …
tagged with: jquery-plugins

cryptography
tag name: cryptography
type: Tag
tags question: http://stackoverflow.com/q/28753370

http://stackoverflow.com/q/28794086
has answer: http://stackoverflow.com/a/28794139
possible better answer: http://stackoverflow.com/a/28794134
score: 0
has answer: http://stackoverflow.com/a/28794134
accepted answer: http://stackoverflow.com/a/28794139
tagged with: javascript
type: AnsweredQuestion
has body: JavaScript prints out MySQL timestamp as: "2015-01-04T16:59:33.000Z" for me, How can I get difference in days between that date and today? It should return 56 Days Difference, is there any simple way?
type: Question
has title: JavaScript: Get days difference between MySQL Timestamp and Current date?
answer count: 2

http://stackoverflow.com/a/28805682
has body: Add a second % to the opening tag like this: responsive: true, datasetStrokeWidth : 3, multiTooltipTemplate: &lt;%%= datasetLabel %&gt;: &lt;%%= value %&gt;"
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28805312
type: Answer
accepted answer of: http://stackoverflow.com/q/28805312
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/74081467

http://stackoverflow.com/comment/45811119
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28763634
type: AnswerComment
has text: But wouldn't this require that I called grunt with --base some_path, and then manually called grunt.file.setBase(some_path)? I don't want to set the current path, I want to get it.

3d
tags question: http://stackoverflow.com/q/28866200
tags question: http://stackoverflow.com/q/28812796
type: Tag
tags question: http://stackoverflow.com/q/28886008
tag name: 3d
tags question: http://stackoverflow.com/q/28871871

http://stackoverflow.com/q/28811911
downvote count: 1
upvote count: 13
answer count: 6
has answer: http://stackoverflow.com/a/28812053
has comment: http://stackoverflow.com/comment/45895745
has answer: http://stackoverflow.com/a/28812215
has answer: http://stackoverflow.com/a/77790188
has answer: http://stackoverflow.com/a/77782159
possible better answer: http://stackoverflow.com/a/28812027
tagged with: arrays
has answer: http://stackoverflow.com/a/28812027
tagged with: javascript
has comment: http://stackoverflow.com/comment/45896719
accepted answer: http://stackoverflow.com/a/28812053
type: AnsweredQuestion
has title: Find Array length in Javascript
has comment: http://stackoverflow.com/comment/45895858
favorite count: 0
has answer: http://stackoverflow.com/a/28812158
has comment: http://stackoverflow.com/comment/45895881
type: Question
score: 12
has comment: http://stackoverflow.com/comment/45895737
has comment: http://stackoverflow.com/comment/45895972
has body: This will sound a very silly question. How can we find the exact length of array in JavaScript; more precisely i want to find the total positions occupied in the array. I have a simple scenario which i guess most of you might be aware of. var a = [1,2,3]; a.length; //This will output 3 Now if i give a[100] = 100; a.length; // The output is 101; I want to get the exact size of the array which in the above case should be 4.

http://stackoverflow.com/comment/46018466
comment on: http://stackoverflow.com/q/28877476
has text: @shridhar yes i could use PHP if i wanted to, what do you suggest?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28791810
has body: Can I add a drop down option on two of my forms like on the Gender (Male or Female Option) and on the VERID if (Yes or No) and then when I click on submit it will show the one that i inputted? Phone: Gender: INBOUND: Name: Status: Submit Result: Issue: Steps:
tagged with: forms
type: Question
answer count: 1
tagged with: javascript
has title: Add a Drop Down Option in an HTML form
score: 0
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28792003

http://stackoverflow.com/comment/46013979
type: Comment
has text: @Dimple It would be much easier if you would followed my advice and create an jsfiddle with your pure html code (what the browser received).
score: 0
comment on: http://stackoverflow.com/q/28874942
type: QuestionComment

http://stackoverflow.com/q/28873536
answer count: 0
upvote count: 1
type: Question
score: 1
downvote count: 0
tagged with: javascript
favorite count: 0
type: UnansweredQuestion
has body: we process the exact version of the game in 2048 DOGE2048, one with pictures, but after reaching the 2048 game stops unexpectedly. I've included a file that is called when you connect one 2x1024 2048 function HTMLActuator() { this.tileContainer = document.querySelector(".tile-container"); this.scoreContainer = document.querySelector(".score-container"); this.bestContainer = document.querySelector(".best-container"); this.messageContainer = document.querySelector(".game-message"); this.info = document.querySelector(".info"); this.dogeSays = document.querySelector(".doge-says"); this.adSpace = document.querySelector(".shout-out"); this.score = 0; } var ads = [ 'Like Pizza?', 'Check out everything hashtagged Doge!', ] HTMLActuator.prototype.actuate = function (grid, metadata) { var self = this; window.requestAnimationFrame(function () { self.clearContainer(self.tileContainer); grid.cells.forEach(function (column) { column.forEach(function (cell) { if (cell) { self.addTile(cell); } }); }); self.updateScore(metadata.score); self.updateBestScore(metadata.bestScore); if (metadata.terminated) { if (metadata.over) { self.message(false); // You lose } else if (metadata.won) { self.message(true); // You win! } } }); }; // Continues the game (both restart and keep playing) HTMLActuator.prototype.continue = function () { this.clearMessage(); }; HTMLActuator.prototype.clearContainer = function (container) { while (container.firstChild) { container.removeChild(container.firstChild); } }; HTMLActuator.prototype.addTile = function (tile) { var self = this; var wrapper = document.createElement("div"); var inner = document.createElement("div"); var position = tile.previousPosition || { x: tile.x, y: tile.y }; var positionClass = this.positionClass(position); // We can't use classlist because it somehow glitches when replacing classes var classes = ["tile", "tile-" + tile.value, positionClass]; this.applyClasses(wrapper, classes); inner.classList.add("tile-inner"); inner.textContent = …
has title: JavaScript 2048 game unexpected stop

http://stackoverflow.com/comment/46035650
comment on: http://stackoverflow.com/q/28886897
score: 0
type: Comment
type: QuestionComment
has text: yeah I removed quite a few methods before publishing, I 'll see what else I can trim. Thanks you

http://stackoverflow.com/comment/45832996
has text: Given the context I assume this is JavaScript, so the java or basic tag doesn't belong, and there isn't a `System.out.print` in JavaScript, and you're accidentally re-using the same loop counter variable
comment on: http://stackoverflow.com/q/28777440
type: Comment
score: 1
type: QuestionComment

http://stackoverflow.com/comment/46061407
has text: Yes, set the following option to the parser: `singleInfoWindow: false`. Then write code to either "click" on each marker after creation or open its infowindow.
comment on: http://stackoverflow.com/a/28837682
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/28902100
accepted answer: http://stackoverflow.com/a/28902239
has title: Make jQueryUI autocomplete height dependent upon parent
possible better answer: http://stackoverflow.com/a/28902594
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/28902594
has body: I have a jQueryUI autocomplete inside a jQueryUI dialog. The dialog has a given height (i.e. 200px), and thus the autocomple must have a height less than the dialog so that the scroll bar will be shown. I've implemented it by hardcoding a 100px height to the autocomplete. Instead of hardcoding this height, how can I make the height dependent upon the parent's height? http://jsbin.com/xunazowiqa/1/ Testing Open
has answer: http://stackoverflow.com/a/28902300
tagged with: jquery-ui
tagged with: javascript
type: AnsweredQuestion
tagged with: jquery
type: Question
has answer: http://stackoverflow.com/a/28902239

http://stackoverflow.com/q/28856544
tagged with: javascript
has comment: http://stackoverflow.com/comment/46023022
has comment: http://stackoverflow.com/comment/46023551
score: 0
has title: How to set the number of rings in a sunburst?
has comment: http://stackoverflow.com/comment/46021618
has comment: http://stackoverflow.com/comment/45979318
tagged with: sunburst-diagram
tagged with: http://stackoverflow.com/tag/svg
answer count: 0
tagged with: d3.js
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46022446
has body: I am trying to create a sunburst that has only 2-3 levels. I stumbled upon this question How to hide outer ring in zoomable sunburst , but in this example (http://protembla.com/wheel.html) if I hide "who is working on the tasks." and then I select Natasha it doesn't display the arc with the time label. How can I create a sunburst that has a fixed number of rings but is still able to display the data that initially is hidden when someone clicks on an arc?
linked to: http://stackoverflow.com/q/22190077
type: Question

http://stackoverflow.com/comment/46067338
comment on: http://stackoverflow.com/a/28888099
type: AnswerComment
has text: @user2584472 if you wanna get the content of this label use `innerHtml()` or `innerText()`. `document.getElementById("<%=lbSelectedSiteType.ClientID%>").innerHtml();`
score: 0
type: Comment

http://stackoverflow.com/comment/45852716
has text: yeah I tried that, did't work it keeps telling me that the class .panel-heading is not being used but it is in my user-info-card so I don't know why its not displaying the css.
type: AnswerComment
comment on: http://stackoverflow.com/a/28788467
score: 0
type: Comment

google-chrome
tags question: http://stackoverflow.com/q/28792925
tags question: http://stackoverflow.com/q/28818084
tags question: http://stackoverflow.com/q/28818606
tags question: http://stackoverflow.com/q/28866376
tags question: http://stackoverflow.com/q/28825414
tags question: http://stackoverflow.com/q/28790803
tags question: http://stackoverflow.com/q/28763559
tags question: http://stackoverflow.com/q/28892795
tags question: http://stackoverflow.com/q/28867086
tags question: http://stackoverflow.com/q/28873206
tags question: http://stackoverflow.com/q/28825492
tags question: http://stackoverflow.com/q/28862923
tags question: http://stackoverflow.com/q/28822715
tags question: http://stackoverflow.com/q/28756244
tags question: http://stackoverflow.com/q/28788720
tags question: http://stackoverflow.com/q/28872240
tags question: http://stackoverflow.com/q/28774487
tags question: http://stackoverflow.com/q/28895580
tags question: http://stackoverflow.com/q/28854906
tags question: http://stackoverflow.com/q/28906360
tags question: http://stackoverflow.com/q/28860446
tags question: http://stackoverflow.com/q/28786723
tags question: http://stackoverflow.com/q/28766338
tags question: http://stackoverflow.com/q/28903606
tags question: http://stackoverflow.com/q/28754842
tags question: http://stackoverflow.com/q/28805551
tags question: http://stackoverflow.com/q/28848580
tags question: http://stackoverflow.com/q/28812608
tags question: http://stackoverflow.com/q/28795665
tags question: http://stackoverflow.com/q/28884898
tags question: http://stackoverflow.com/q/28845409
tags question: http://stackoverflow.com/q/28889928
tags question: http://stackoverflow.com/q/28772977
tags question: http://stackoverflow.com/q/28760463
tags question: http://stackoverflow.com/q/28765053
tags question: http://stackoverflow.com/q/28829233
tags question: http://stackoverflow.com/q/28789989
tags question: http://stackoverflow.com/q/28809381
tags question: http://stackoverflow.com/q/28783584
tags question: http://stackoverflow.com/q/28798609
tags question: http://stackoverflow.com/q/28845489
type: Tag
tags question: http://stackoverflow.com/q/28755820
tags question: http://stackoverflow.com/q/28893051
tags question: http://stackoverflow.com/q/28841784
tags question: http://stackoverflow.com/q/28857557
tags question: http://stackoverflow.com/q/28803708
tags question: http://stackoverflow.com/q/28899074
tags question: http://stackoverflow.com/q/28817046
tag name: google-chrome
tags question: http://stackoverflow.com/q/28869887
tags question: http://stackoverflow.com/q/28809855
tags question: http://stackoverflow.com/q/28823002
tags question: http://stackoverflow.com/q/28867615
tags question: http://stackoverflow.com/q/28813001
tags question: http://stackoverflow.com/q/28790903
tags question: http://stackoverflow.com/q/28840728
tags question: http://stackoverflow.com/q/28868835
tags question: http://stackoverflow.com/q/28840467
tags question: http://stackoverflow.com/q/28848023
tags question: http://stackoverflow.com/q/28761218
tags question: http://stackoverflow.com/q/28755415
tags question: http://stackoverflow.com/q/28752524
tags question: http://stackoverflow.com/q/28861479
tags question: http://stackoverflow.com/q/28905598
tags question: http://stackoverflow.com/q/28853717
tags question: http://stackoverflow.com/q/28858027
tags question: http://stackoverflow.com/q/28844406
tags question: http://stackoverflow.com/q/28895193

http://stackoverflow.com/comment/45876998
has text: @ESH note: if you're only ever going to populate the array with `1`s, then you can just use `times.length` instead of `getTotal(times)`.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28800043

http://stackoverflow.com/comment/46023583
has text: @MethodMan No, I have some.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28880967
score: 0

http://stackoverflow.com/q/28790702
type: Question
possible better answer: http://stackoverflow.com/a/49671902
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/49671902
accepted answer: http://stackoverflow.com/a/32921280
answer count: 2
tagged with: zurb-foundation
downvote count: 0
favorite count: 0
has body: I'm very happy with orbit, the image slider of foundation, but it doesn't support lazy-loading out of the box. I know Interchange, but that's not what I'm looking for. I found this discussion with a fork as a solution. I'd like to avoid a fork and prefer to extend the code, to keep my files upgradeable. There's no event like on('before-init.fndtn.orbit'). Does anyone know, how to fix this issue? Thanks in advance!
has title: Zurb Foundation Orbit: lazy-loading?
tagged with: lazy-loading
type: AnsweredQuestion
tagged with: performance
has answer: http://stackoverflow.com/a/32921280
has comment: http://stackoverflow.com/comment/45857965
score: 1
upvote count: 1

http://stackoverflow.com/comment/46046982
comment on: http://stackoverflow.com/a/28883634
score: 0
type: Comment
has text: Thanks, Ben!!! Another thing is is there anyway to load in the data from .csv or .tsv directly?
type: AnswerComment

http://stackoverflow.com/q/28842651
favorite count: 0
has body: How do I access version argument from within FetchData method below ?. Note - Fetch data is an async Rest call which passes its data to callback function. function TestData(guid, version) { var data = ''; data = FetchData(guid, function (guid, msg) { alert(version); return getData(guid, msg); })); }
has title: Access function argument from anonymous function
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/45954485
has comment: http://stackoverflow.com/comment/45955793
has answer: http://stackoverflow.com/a/28842742
upvote count: 1
type: Question
tagged with: closures
tagged with: javascript
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/28842898
tagged with: jquery
has comment: http://stackoverflow.com/comment/45954777

http://stackoverflow.com/q/28863816
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28863918
tagged with: getattribute
answer count: 4
type: AnsweredQuestion
upvote count: 3
has body: I would like to set a span node's visited attribute to true or false based on if it has been visited. test(); function test () { var el = document.createElement("span"); el.setAttribute("visited", false); el.setAttribute("visited", true); alert(el.getAttribute("visited") === true); //False alert(el.getAttribute("visited") === "true"); //True } I initially set the attribute "visited" to boolean false, then set the boolean to true. I noticed that when I checked if the attribute was true, it returned false, but if I checked the string true, it returned true. The MSN Docs only talk about the attributeName as needing to be string, not the value. So why doesn't comparing against bools work? FIDDLE
has comment: http://stackoverflow.com/comment/45992740
accepted answer: http://stackoverflow.com/a/28863912
has answer: http://stackoverflow.com/a/28864034
type: Question
has comment: http://stackoverflow.com/comment/45993891
score: 3
tagged with: setattribute
tagged with: boolean
has answer: http://stackoverflow.com/a/79537922
has title: set/getAttribute comparisons only work with strings?
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28863912
has answer: http://stackoverflow.com/a/28863918
favorite count: 0

http://stackoverflow.com/comment/45956565
has text: Where is this code executing `Shippo = Npm.require("shippo")('<USERNAME>', '<PASSWORD>');` ? In the server code or in the package code ?
score: 0
comment on: http://stackoverflow.com/q/28843309
type: Comment
type: QuestionComment

http://stackoverflow.com/a/28760787
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/28760644
has comment: http://stackoverflow.com/comment/45802699
answers question: http://stackoverflow.com/q/28760644
downvote count: 0
has body: Replace $('#fcb_pt_gs').html(gs); by $('#fcb_pt_gs').append(gs);
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/45803336

c#-4.0
tags question: http://stackoverflow.com/q/28895946
tag name: c#-4.0
type: Tag
tags question: http://stackoverflow.com/q/28862282

http://stackoverflow.com/comment/45959614
comment on: http://stackoverflow.com/q/28845123
score: 0
has text: Can you post a link to the page so we can look in the debugger ourselves? Also, did you post the error message in your question exactly as it said because that shows `https://someurl.com:1081` for the page protocol/domain/port but `http://someurl.com` for the webWorker script protocol/domain/port which are not the same in protocol or port.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28812307
score: 2
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/28812721
favorite count: 0
tagged with: angularjs
upvote count: 2
tagged with: jestjs
possible better answer: http://stackoverflow.com/a/51027979
has answer: http://stackoverflow.com/a/51027979
has title: Using jsdom and Jest
has body: I'm experimenting with Jest to unit test an angular application. In order to test the angular bindings I'm trying to use jsdom (N.B. I'm using v3.1.2 as I'm using node not IO). When I need to load a script with the html the test seems to complete before the script is loaded. I've simplified my test case to use an example from jsdom: it('updates the view without error', function(){ var jsdom = require('../../../../node_modules/jsdom/lib/jsdom'); jsdom.env( ' jsdom! ', ["http://code.jquery.com/jquery.js"], function (errors, window) { //console.log("contents of a.the-link:", window.$("a.the-link").text()); console.log("Completed"); expect(errors).toBeNull(); } ); console.log('exiting...'); }); If I run this test, the test will pass but the "Completed" log message will not be printed, I can also replace the expect with something that should obviously fail, like expect(false).toBeTruthy() and the test will still "pass". If I remove the injection of jquery then all works as expected. How should I make sure that the script is loaded before I exit the test? And more generally, using jsdom explicitly with Jest feels a bit wrong. Is there a better way?
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28812721
tagged with: jsdom
type: Question
answer count: 2

http://stackoverflow.com/comment/46019226
comment on: http://stackoverflow.com/q/28878034
has text: I think the problem must be in the asset compilation. I'm using chrome and I didn't know about unminifying (I've been trying to do it manually) but I'll try that...
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45954033
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28839401
has text: @Eelke The class is pretty big (over 1,500 lines of code). Is there something specific you might want to see?
score: 0

http://stackoverflow.com/comment/45941207
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28835655
score: 1
has text: I get what you are doing, but what if the `Do stuff` is itself an asynchronous function ? My original idea was to perform an async `get` while server-side, in order to show the result on page when it's done. But perhaps it not the way you do it with meteor ?

http://stackoverflow.com/comment/45837029
comment on: http://stackoverflow.com/a/28779805
type: AnswerComment
score: 0
has text: But its like 6 more boxes i needed for like age, location etc.
type: Comment

http://stackoverflow.com/q/28771876
answer count: 1
type: UnansweredQuestion
tagged with: iframe
type: Question
has body: &lt;script type="text/javascript"&gt; if (self === top) { var antiClickjack = document.getElementById("antiClickjack"); antiClickjack.parentNode.removeChild(antiClickjack); } else { top.location = self.location; } &lt;/script&gt; I have this code that does not allow iframes but I want to allow iframes only from google.com how can i do this? I think the pseudo-code would be if (self === top) or google.com but dont know how to do this in javascript
has answer: http://stackoverflow.com/a/28771969
tagged with: javascript
has title: if self === top or google.com
score: 0
has comment: http://stackoverflow.com/comment/45822342

http://stackoverflow.com/comment/45974557
comment on: http://stackoverflow.com/a/28853798
type: AnswerComment
has text: {"validationErrors":[{"errorCode":"emailId","errorDescription":"Please enter email address.","errorCode":"Password","errorDescription":"Please enter password"}]} How can I do this with JSON like this
score: 0
type: Comment

http://stackoverflow.com/comment/45783856
type: Comment
has text: How do you know what the json looks like if you can't print it?
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28750969

http://stackoverflow.com/q/28879223
score: 0
has title: Detect red X event in Safari extension
tagged with: safari-extension
tagged with: safari
has comment: http://stackoverflow.com/comment/46074815
answer count: 0
tagged with: javascript
type: UnansweredQuestion
tagged with: macos
has comment: http://stackoverflow.com/comment/46137999
has body: Is it possible to use JavaScript in order to listen for the event when a user clicks the 'red x' in Safari rather than 'quit'. This script must run in the global page of an extension.
type: Question

http://stackoverflow.com/comment/45940299
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28835313
has text: I already have included jQuery via this CDN : https://code.jquery.com/jquery-2.1.3.min.js
type: AnswerComment

http://stackoverflow.com/q/28764020
score: 0
has comment: http://stackoverflow.com/comment/45807117
accepted answer: http://stackoverflow.com/a/28764110
has body: I have written javascript by using Alloy UI and jquery it is working fine in firefox, chrome and IE 10,11 but IE 9 its not work. when I open console for debug it working fine.
type: Question
type: AnsweredQuestion
tagged with: internet-explorer
has title: In IE9 javascript not working, but after open console it work
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/28764110
tagged with: alloy-ui

http://stackoverflow.com/comment/130646398
has text: Please don't post code-only answers. The main audience, future readers, will be grateful to see explained *why* this answers the question instead of having to infer it from the code. Also, since this is an old question, please explain how it complements the other answers.
comment on: http://stackoverflow.com/a/73970642
type: AnswerComment
score: 2
type: Comment

http://stackoverflow.com/q/28878412
has title: JSHint Function Is Not Defined
has comment: http://stackoverflow.com/comment/46018813
tagged with: javascript
upvote count: 1
tagged with: jquery
favorite count: 0
has body: I am trying to write better Javascript / JQuery code and I set up JSHint with my Grunt. Now I have gone though my code and its seems to be ok, without using 'strict'. I have split my code into many files, admin section, lib section (for my JQuery, Backbone) etc. So I am trying to add 'use strict' at the top of one of my files. Now JSHint is saying that a function within the success section of an AJAX call, is not defined? Now the function I have called in this section is in other file, but in my Grunt setting a build the javascript files up so the functions file is at the top, just below all my library files. So my AJAX function is as follows: $.ajax({ url: "/getusers/"+SelectedSort, type: "GET", dataType: "html", success: function(data) { EvenOddRows(".Row"); &lt;- function in question! }, error: function(fail) { console.log(fail); } }); So in my functions file I built the function like this, var EvenOddRows = function (RowToColour) { $(RowToColour + ":even").addClass("EvenNumber"); $(RowToColour + ":odd").addClass("OddNumber"); }; Its just a simple function the colour even / odd rows with an highlighter class. This all works, but 'using strict' it says that me EvenOddRow function is not defined. So I am guesting I am not getting something to do with the scope of functions, or is it just becuase the function is within the AJAX function? When I add window.EvenOddRows, then JSHint as now problems with it. So what is best way of doing this? If there is any code I have not posted, which someone needs to look at, then please let me know and I will post it. *Please not that I am dyslexic, so I may not have explain myself right, if so let me know and I will re-word my question, thank you for understanding. Thanks you,
has comment: http://stackoverflow.com/comment/46020385
tagged with: ajax
has comment: http://stackoverflow.com/comment/46018702
has comment: http://stackoverflow.com/comment/46018857
answer count: 0
downvote count: 0
type: UnansweredQuestion
score: 1
tagged with: use-strict
type: Question

http://stackoverflow.com/comment/45845737
score: 0
type: Comment
has text: Please don't use jQuery for that, `!$(this).is(`:checked')`? Why would you not just use the DOM: `!this.checked`, it's available in every browser, doesn't require use of a library and is faster/cheaper because it doesn't need a library and returns the same Boolean.
comment on: http://stackoverflow.com/a/28784433
type: AnswerComment

http://stackoverflow.com/a/28890145
has comment: http://stackoverflow.com/comment/46041548
answers question: http://stackoverflow.com/q/28890101
has comment: http://stackoverflow.com/comment/46041622
score: 0
has comment: http://stackoverflow.com/comment/46041700
has comment: http://stackoverflow.com/comment/46041451
type: Answer
has comment: http://stackoverflow.com/comment/46041369
has body: In your posted array, LastReportTime and ID are arrays. Try these lines: console.log(prop + ':' + json[obj][prop][id].ID[0]); console.log(prop + ':' + json[obj][prop][id].LastReportTime[0]);

http://stackoverflow.com/comment/45864391
comment on: http://stackoverflow.com/q/28794764
score: 0
type: QuestionComment
type: Comment
has text: possible duplicate of [How to use underscore's "intersection" on objects?](http://stackoverflow.com/questions/8672383/how-to-use-underscores-intersection-on-objects)

http://stackoverflow.com/a/28834697
has body: I've experimented recently with WebSockets, in combination Java on Server and JavaScript on client side. First wanted to go with simple Java SE, had a nightmare, didn't succeed to make it work and at end the found this tutorial: https://blog.idrsolutions.com/2013/12/websockets-an-introduction/ Works like charm. Just stick with environment mentioned there - Java EE, GlassFish, NetBeans... Not saying that NetBeans is best IDE or something... Of course, there is NodeJS option for back-end if you preffer JavaScript. But generally speaking WebSockets works...and works well. :)
type: Answer
score: 1
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/28834444

http://stackoverflow.com/a/28904184
answers question: http://stackoverflow.com/q/28892762
has comment: http://stackoverflow.com/comment/46085295
has comment: http://stackoverflow.com/comment/46084281
accepted answer of: http://stackoverflow.com/q/28892762
type: Answer
has body: Tricky because the element is position fixed. Try modifying your .affix class: #sidenav.affix { top: 50px; z-index: 1; width: 212.5px; bottom: 0; /* <-- add */ overflow: auto; /* <-- add */ } Example: /* Latest compiled and minified JavaScript included as External Resource */ // activate scrollspy and affix for sidenav $('body').scrollspy({ target: '#sidenav' }); $('#sidenav').affix({ offset: { top: 165 } }) // smooth scrolling $('a[href*=#]:not([href=#])').click(function() { if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); if (target.length) { $('html,body').animate({ scrollTop: target.offset().top }, 800); return false; } } }); /* Latest compiled and minified CSS included as External Resource*/ /* Optional theme */ html, body { height: 100%; } body { padding-top: 50px; } footer { margin: 50px 0; } h2 { margin-top: 60px; } /* side navigation */ /* media queries that make the side nav position static have been removed for easier editing in jsfiddle */ #sidenav.affix { top: 50px; z-index: 1; width: 212.5px; bottom: 0; overflow: auto; } #sidenav { margin-bottom: 20px; } .nav-stacked>li+li { margin-top: 0; } .nav-stacked>li>a { border-radius: 0 !important; margin-top: -1px; } .nav-stacked>li:first-child>a { border-top-left-radius: 4px !important; border-top-right-radius: 4px !important; } .nav-stacked>li:last-child>a { margin-bottom: 0 !important; border-bottom-right-radius: 4px !important; border-bottom-left-radius: 4px !important; } /* fix problem with anchors going behind top navbar */ #main-content h2 a { display: block; position: relative; top: -100px; } We have a nav bar also! Test Page Home Test Page Heading Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam egestas congue nibh, vel dictum ante posuere vitae. Cras gravida massa tempor metus eleifend sed elementum tortor scelerisque. Vi…
score: 0
type: AcceptedAnswer

http://stackoverflow.com/a/28896928
downvote count: 0
type: Answer
upvote count: 2
has comment: http://stackoverflow.com/comment/46054153
has comment: http://stackoverflow.com/comment/46054123
answers question: http://stackoverflow.com/q/28896885
score: 2
has body: Use \S+ to match one or more non-space characters. &gt; var s = 'This is a test sentence. Actually, it is a paragraph really. Lets see how this goes' undefined &gt; s.match(/\S+\s+\S+/g) [ 'This is', 'a test', 'sentence. Actually,', 'it is', 'a paragraph', 'really. Lets', 'see how', 'this goes' ]
has comment: http://stackoverflow.com/comment/46053980
has comment: http://stackoverflow.com/comment/46053473

http://stackoverflow.com/comment/45935069
score: 0
type: Comment
type: QuestionComment
has text: I have not used AJAX. @Devesh
comment on: http://stackoverflow.com/q/28832312

http://stackoverflow.com/q/28813501
type: Question
has comment: http://stackoverflow.com/comment/45931065
has answer: http://stackoverflow.com/a/28813863
tagged with: javascript
linked to: http://stackoverflow.com/q/2536379
upvote count: 1
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/45899796
has comment: http://stackoverflow.com/comment/45899340
favorite count: 0
type: UnansweredQuestion
has body: how to find the month difference between two dates counting last date of month using javascript or jQuery. ex: 01/03/2015 - 31/03/2015 - Month: 1 01/03/2015 - 30/03/2015 - Month: 0
downvote count: 0
score: 1
has title: month difference between two dates counting lastdate of month

http://stackoverflow.com/comment/46063926
has text: So this solves the lowest level, changing or creating new items inside the customURl, but what if there isn't and existing top level (the object), so what if i passed like myFunction("module5","mod8","false"), module5 does not exist, nor anything inside of it. Or what if i pass something like myFunction("module1","mod30","false"), where the module exists, but not the item inside customUrl?
type: Comment
comment on: http://stackoverflow.com/a/28902145
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46024833
type: Comment
comment on: http://stackoverflow.com/q/28881288
type: QuestionComment
has text: I think this has something to do with the browser, it works in google chrome but in firefox it still displays user already exists
score: 0

http://stackoverflow.com/q/28824014
has body: Does the first page that shows up when an app starts have to be index.html? or can i change it to something else(othername.html)? If it has to be index.html, can i lead the client to otherpage.html to make it look like it's the first page they see?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28824169
tagged with: cordova
has title: jquery-mobile phonegap first page of app must be index.html?
downvote count: 2
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/45919228
score: -1
accepted answer: http://stackoverflow.com/a/28824169
has comment: http://stackoverflow.com/comment/45950903
tagged with: jquery-mobile
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/45919200
favorite count: 0
tagged with: http://stackoverflow.com/tag/html

postmessage
tags question: http://stackoverflow.com/q/28801928
tag name: postmessage
tags question: http://stackoverflow.com/q/28887328
type: Tag
tags question: http://stackoverflow.com/q/28750739
tags question: http://stackoverflow.com/q/28882803

http://stackoverflow.com/a/73471976
has comment: http://stackoverflow.com/comment/131610365
type: Answer
upvote count: 15
score: 15
answers question: http://stackoverflow.com/q/28904875
downvote count: 0
has body: New method (24.08.2022) Form element now has a requestSubmit() method, which would trigger submit event by itself without workarounds, as stated in submit() MDN docs: The HTMLFormElement.submit() method submits a given &lt;form&gt;. This method is similar, but not identical to, activating a form's submit &lt;button&gt;. When invoking this method directly, however: No submit event is raised. In particular, the form's onsubmit event handler is not run. Constraint validation is not triggered. The HTMLFormElement.requestSubmit() method is identical to activating a form's submit &lt;button&gt; and does not have these differences. However, this method is not supported well enough on IE and Safari 15.6. As of 02.09.2022, this is about 76.49% global usage. If you need a more browser-compatible solution, keep reading until the end. No need to use refs Every answer I've yet seen uses refs when you actually don't need them. Most (if not all) of the form controls have a reference to a parent form in their form property: textarea.form.requestSubmit(); Just make sure to attach a handler on one of the form controls, for example: &lt;button&gt;, &lt;input&gt;, &lt;textarea&gt;, &lt;select&gt;, &lt;option&gt;. With all that said, you can write your handlers like that: &lt;form onSubmit={this.sendMessage}&gt; &lt;textarea onKeyPress={this.textareaKeypress}/&gt; &lt;/form&gt; sendMessage: function(event) { console.log(event); event.preventDefault(); }, textareaKeypress: function(event) { if (event.which == 13 &amp;&amp; !event.shiftKey) { event.target.form.requestSubmit(); } }, Or if you care about browser compatibility, dispatch an event manually (thanks to Karol Dabrowski answer): textareaKeypress: function(event) { if (event.which == 13 &amp;&amp; !event.shiftKey) { event.target.form.dispatchEvent(new Event('submit', { cancelable: true, bubbles: true })); } },

http://stackoverflow.com/a/37806632
has comment: http://stackoverflow.com/comment/68230589
answers question: http://stackoverflow.com/q/28846814
score: 18
upvote count: 18
downvote count: 0
has body: In my case, I have a CDN, and I am going to place all of my processed static files (JS, images, fonts...) into my CDN. Let's suppose the URL is http://my.cdn.com/. If there is a JS file whose URL is referenced in the HTML as './js/my.js', it should become http://my.cdn.com/js/my.js in the production environment. In that case, what I need to do is just set publicPath equals http://my.cdn.com/ and webpack will automatically add that prefix.
type: Answer

pug
tags question: http://stackoverflow.com/q/28812122
tags question: http://stackoverflow.com/q/28897839
tags question: http://stackoverflow.com/q/28895237
tags question: http://stackoverflow.com/q/28904952
tags question: http://stackoverflow.com/q/28844368
tag name: pug
type: Tag
tags question: http://stackoverflow.com/q/28765496
tags question: http://stackoverflow.com/q/28769967

http://stackoverflow.com/comment/45975084
comment on: http://stackoverflow.com/q/28854253
has text: Verify your tables layout. You have a ` ` in the middle of ` ` in the first table, and an unclosed ` ` in the second table.
score: 0
type: QuestionComment
type: Comment

recaptcha
tag name: recaptcha
tags question: http://stackoverflow.com/q/28769893
type: Tag

http://stackoverflow.com/a/28871159
score: 0
answers question: http://stackoverflow.com/q/28870973
has body: Just a small mistake! Instead of: calcTotal(price, minTip); tip = minTip; Do: tip = minTip; calcTotal(price, minTip); This way tip is calculated before displayAmounts is run. Abut your code: This is fine with just getting started. I recommend going through w3school's tutorials on javascript. The more you use javascript, the better you will get. If you want a learning path I would recommend taking, let me know.
type: Answer
has comment: http://stackoverflow.com/comment/46005838
has comment: http://stackoverflow.com/comment/46006792

http://stackoverflow.com/q/28819210
has comment: http://stackoverflow.com/comment/45910240
tagged with: jsp
tagged with: javascript
has comment: http://stackoverflow.com/comment/45910450
score: 0
has comment: http://stackoverflow.com/comment/45914443
has body: I'm using Struts 1.3, and using StringBuilder to form a html body in the tag to display some lists in the website. I'm trying to figure out the best way to optimize this, since this is using most of the bandwidth, because some lists are very long and I'm sending the whole HTML structure inside the tag. I didn't actually program this, but I'm in charge of reducing the consumed bandwith, so I'm trying to figure out the best way to do this, and I'm open to any suggestions. For a brief explanation, I have a .jsp with a tag in it and it just writes the whole html body. &lt;html&gt; &lt;prototype:myTag/&gt; &lt;/html&gt; And inside the myTag comes the whole HTML structure. JSON is the only thing that comes to my mind to reduce the bandwith consumption, but I'm sure there must be plenty of other things. Any suggestions?
tagged with: http://stackoverflow.com/tag/html
answer count: 0
type: UnansweredQuestion
tagged with: java
has title: Best way to reduce consumed bandwith when using struts tags to diplays html?
tagged with: struts-1
type: Question

http://stackoverflow.com/q/28856927
upvote count: 1
tagged with: javascript
favorite count: 0
possible better answer: http://stackoverflow.com/a/28857103
tagged with: angularjs
has answer: http://stackoverflow.com/a/28857103
has title: javascript (angularJS): add current time to date and format
downvote count: 0
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28856984
score: 1
has body: In my app user select date, but i need to send to the server current time too. Here is my init code: $scope.event = { 'Name': '', 'Date': $filter('date')(new Date(), 'yyyy-MM-dd'), }; but i need to change it to such format: 2015-01-20T20:00:00Z is it real? how could i append current time to my input's value in format as i posted here? i do it like this: var x = new Date(); var h = x.getHours(); var m = x.getMinutes(); var s = x.getSeconds(); var z = x.getTimezoneOffset(); $scope.event.Date = $scope.event.Date + 'T' + h + ':' + m + ':' + s + z; but seems that this code is to ugly, maybe i do something wrong?
type: Question
has answer: http://stackoverflow.com/a/28856984
answer count: 2

http://stackoverflow.com/comment/46024958
type: Comment
comment on: http://stackoverflow.com/q/28881288
type: QuestionComment
has text: What does firefox return for `console.log(data);`? To troubleshoot you could also add `error_log($quary);` inside `rtc_reg_id()` and see if that query is correct.
score: 0

http://stackoverflow.com/comment/45893624
comment on: http://stackoverflow.com/q/28810719
score: 0
type: Comment
type: QuestionComment
has text: Did you try `nohup`?

http://stackoverflow.com/q/28798882
tagged with: meteor
has body: In my Meteor app, I have a Mongo Collection on the back-end that has a large document that the client wants to subscribe to. This document contains an array of objects that can be upwards of 80,000 items in length. But the client is only interested in the 10 most-recent items from that array. Here's a sample of the document: { "_id" : "TfPCCaupse8cgwYeQ", "createdAt" : ISODate("2015-03-01T20:42:24.491Z"), "type" : "historicalTrades", "data" : [ { "date" : "1422161074", "price" : 1546.01, "amount" : 2.834, "tid" : "19009899", "type" : "sell" }, { "date" : "1422161074", "price" : 1546.01, "amount" : 1.822, "tid" : "19009900", "type" : "sell" }, { "date" : "1422161074", "price" : 1546.01, "amount" : 7.333, "tid" : "19009901", "type" : "sell" }, { "date" : "1422161074", "price" : 1546.01, "amount" : 16.98, "tid" : "19009902", "type" : "buy" }, ... ... ... ] } Is it possible to subscribe to just the first or last 10 items from that array, without ever loading the other 79,990 into memory (i.e. keep the query super fast)? Or is the better solution to maintain a separate document, in addition to the 80,000 length document, that just contains the most-recent 10 items at any given point in time? Thanks!
favorite count: 0
accepted answer: http://stackoverflow.com/a/28799206
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/45873591
upvote count: 1
type: Question
tagged with: mongodb
has title: MongoDB: How to Subscribe to a Small Subset of a Large Array?
tagged with: arrays
has answer: http://stackoverflow.com/a/28799206
tagged with: javascript
answer count: 1
downvote count: 0

http://stackoverflow.com/q/28843191
type: Question
has title: JavaScript Find Prime Numbers
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28843303
has answer: http://stackoverflow.com/a/28843303
score: 0
answer count: 3
has body: I have to set all the indexes in an array equal to 1. Then I have to find which indexes are not prime and set them equal to 0. Then print out all the indexes of the array that are equal to 1(prime). I can't get the part that sets the index to 0 if it is not prime. My output now is it just prints every number from 2-100. Can you help me figure out the condition that determines if the index is prime? &lt;script&gt; var primeArray = new Array(); for(var i = 0; i &lt; 101; i++){ primeArray[i] = 1; //document.writeln(" " + primeArray[i]); } primeArray[0] = 0; primeArray[1] = 0; //document.writeln("" +primeArray[0]); //document.writeln("" +primeArray[1]); for(var j = 2; j &lt; 101; j++){ if(primeArray[j] == 1){ for(var k=j+1; k&lt;101; k++){ //var test = j%k; //document.writeln("" + test); if(j%k == 0){ primeArray[j]=0; } } } //if(primeArray[j] == 1){ //document.writeln("" + primeArray); //} } document.writeln("" + primeArray) &lt;/script&gt;
has answer: http://stackoverflow.com/a/28843243
accepted answer: http://stackoverflow.com/a/28843243
has comment: http://stackoverflow.com/comment/45955409
tagged with: primes
has comment: http://stackoverflow.com/comment/45955481
has answer: http://stackoverflow.com/a/28843511
type: AnsweredQuestion

http://stackoverflow.com/comment/46033821
type: QuestionComment
type: Comment
has text: Try switching document.links to `document.getElementByTagName("a")`
comment on: http://stackoverflow.com/q/28886198
score: 0

required
tag name: required
tags question: http://stackoverflow.com/q/28842569
tags question: http://stackoverflow.com/q/28884925
type: Tag

http://stackoverflow.com/comment/45825553
score: 0
type: AnswerComment
type: Comment
has text: I have replaced the scripts in the snippet with dummy URLs for confidentiality, but I am using working URLs in my code.
comment on: http://stackoverflow.com/a/28773526

http://stackoverflow.com/q/28844222
downvote count: 2
upvote count: 1
answer count: 1
has title: GitHub.com heading links - JavaScript
tagged with: github
favorite count: 0
tagged with: encode
tagged with: utf-8
tagged with: regex
accepted answer: http://stackoverflow.com/a/28847829
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45980026
has answer: http://stackoverflow.com/a/28847829
type: Question
has comment: http://stackoverflow.com/comment/45963089
has comment: http://stackoverflow.com/comment/45957362
has body: Does anyone know what is proper and official algorithm that GitHub.com uses to encode fragment_id links for inner headers? (I hope that is not considered anymore as tooooo broad question). I reverse engineered way how GitHub flavoured Markdown formats links to content headers. It seems to be quite odd way, so I guess I did something wrong. Maybe you have clue how to improve it (except chaining, which is skipped here for readability of the steps). First of all I found that such a string 1.2.3-a Łukasz_testing? header `special characters`;.,links How+they%20 behave will be encoded there as 123-a-%C5%81ukasz_testing-header-special-characterslinks-howthey20-behave. I recreated same result with: function(string) { string = string.replace(/[A-Z]+/g,function(v) { return v.toLowerCase(); }); string = string.replace(/[^a-z0-9-\s\u00BF-\u1FFF\u2C00-\uD7FF\w]+/g,''); string = string.replace(/[\s\t ]+/g, '-'); string = encodeURIComponent(string); return string; } But it looks quite clunky. Any ideas how close is it to the original?
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/45959962

http://stackoverflow.com/a/28766363
score: 2
has body: Note that your function has the deferred anti pattern and can be simplified further: foo.value = null; function foo(){ if(foo.value) return foo.value; return (foo.value = doSomethingAsync()); } That is, memoization is so simple in this case you don't even have to call .memoize. Also your original function suppressed errors.
has comment: http://stackoverflow.com/comment/45812139
has comment: http://stackoverflow.com/comment/45812032
downvote count: 0
has comment: http://stackoverflow.com/comment/108241407
has comment: http://stackoverflow.com/comment/108210524
answers question: http://stackoverflow.com/q/28763057
has comment: http://stackoverflow.com/comment/45811994
upvote count: 2
type: Answer

http://stackoverflow.com/comment/45857188
has text: @dandavis yeah, I just wrote up an example and came across that. Is the design wrong? I guess you could avoid getters entirely and use get functions, which you can define as returning promises or passing callbacks, but which way would make most sense?
type: Comment
comment on: http://stackoverflow.com/q/28790744
score: 0
type: QuestionComment

http://stackoverflow.com/comment/46019603
has text: That's not what I was suggesting, but it's weird it doesn't work. Do you have any error in the console?. Ideally you shuold have a webServer (even locally) that serves your assets (js, css, html...). You'd have then a folder under the website root where you store images. This way you can access the images by, e.g. "/Content/blabla.jpg" (example of a relative URL).
comment on: http://stackoverflow.com/a/28878326
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/28773432
type: Question
has comment: http://stackoverflow.com/comment/45826346
tagged with: css-frameworks
has body: I am using the Kube framework (http://imperavi.com/kube/) which includes a modal function. Unfortunately the documentation is kind of sparse or I am too dumb (http://imperavi.com/kube/tools/js-modal/). They have sample code showing how to launch modals on button clicks, but I am trying to launch it on body load. Can anyone with either experience with Kube or a better understanding of JS/JQuery help me do that? I wan to make sure I can specify settings like width and blur. I know there are many many modal plugins out there, but I am trying to limit my project to just this one framework.
upvote count: 3
has comment: http://stackoverflow.com/comment/45825537
has answer: http://stackoverflow.com/a/28773876
answer count: 1
tagged with: javascript
type: UnansweredQuestion
has title: Creating a modal window on page load
score: 3
tagged with: modal-dialog
downvote count: 0
tagged with: jquery
favorite count: 0

http://stackoverflow.com/q/28796459
accepted answer: http://stackoverflow.com/a/28800633
type: AnsweredQuestion
tagged with: gruntjs
type: Question
has comment: http://stackoverflow.com/comment/45873346
has body: I'm messing around with Handlebars and I'm trying to precompile templates using Grunt. Its output, though, is different from the regular handlebars cli output. Grunt gives the following output: this["tpl"] = this["tpl"] || {}; this["tpl"]["templates"] = this["tpl"]["templates"] || {}; this["tpl"]["templates"]["assets/src/templates/test.hbs"] = Handlebars.template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; return " " + escapeExpression(((helper = (helper = helpers.title || (depth0 != null ? depth0.title : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"title","hash":{},"data":data}) : helper))) + " \n " + escapeExpression(((helper = (helper = helpers.body || (depth0 != null ? depth0.body : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"body","hash":{},"data":data}) : helper))) + " "; },"useData":true}); The regular output is this: (function() { var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {}; templates['test.hbs'] = template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { var helper, alias1=helpers.helperMissing, alias2="function", alias3=this.escapeExpression; return " " + alias3(((helper = (helper = helpers.title || (depth0 != null ? depth0.title : depth0)) != null ? helper : alias1),(typeof helper === alias2 ? helper.call(depth0,{"name":"title","hash":{},"data":data}) : helper))) + " \n " + alias3(((helper = (helper = helpers.body || (depth0 != null ? depth0.body : depth0)) != null ? helper : alias1),(typeof helper === alias2 ? helper.call(depth0,{"name":"body","hash":{},"data":data}) : helper))) + " "; },"useData":true}); })(); Loading my template from Grunt, like this, doesn't work: $.getJSON('assets/src/data/data.…
has comment: http://stackoverflow.com/comment/45874335
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/28800633
tagged with: templates
has title: Grunt compiles handlebars differently—and I can’t load the compiled template
score: 1
tagged with: handlebars.js
upvote count: 1

http://stackoverflow.com/comment/45966082
comment on: http://stackoverflow.com/a/28849305
score: 0
type: Comment
has text: *"So the JavaScript operator `in` refers to each element inside of an array."* Uhm what? Can you elaborate on that? *"[...] which are somewhat treated like array elements [...]"*: this is just confusing. *"That is an object like an array"* What's an example of an object that is *not* like an array? Objects are simply key-value stores. Arrays are a specialized version of key-value stores where keys are numeric. Saying that an object is "like an array" is confusing at best and simply wrong at worst.
type: AnswerComment

http://stackoverflow.com/comment/45799921
has text: _you cannot have a <child> directive into the <parent> one like this unless you use transclusion._ Of course, you can. Why shouldn't that be possible?
type: AnswerComment
comment on: http://stackoverflow.com/a/28753654
score: 0
type: Comment

http://stackoverflow.com/a/28803474
has body: Looks like a problem with MarkerWithLabel, not the API itself. If I use a google.maps.Marker object: jsfiddle marker = new google.maps.Marker({ position: new google.maps.LatLng(50.124462, -5.539994), icon: icon }); 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"; var 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) }; setInterval(function () { angle += 30; icon.rotation = angle; marker.setIcon(icon); marker.setPosition(google.maps.geometry.spherical.computeOffset(marker.getPosition(), 1000, 90)); map.setCenter(marker.getPosition()); }, 1000); It works. If I use the same code with MarkerWithLabel, it has javascript errors (Uncaught TypeError: Cannot read property 'x' of null, Uncaught TypeError: Cannot read property 'k' of undefined) and fails: jsfiddle 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"; var icon= { path: car, scale:.7, strokeColor: …
score: 0
has comment: http://stackoverflow.com/comment/45883979
type: Answer
has comment: http://stackoverflow.com/comment/45880516
answers question: http://stackoverflow.com/q/28803103

http://stackoverflow.com/comment/45853902
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28789098
has text: Yes, you can also access element as property of `event` but using `this` is the most common way
score: 0

http://stackoverflow.com/q/28892887
tagged with: handlebars.js
tagged with: css
answer count: 0
score: 0
has comment: http://stackoverflow.com/comment/46046415
has comment: http://stackoverflow.com/comment/46067640
type: Question
tagged with: google-sheets
tagged with: javascript
has body: Where I'm At I'm using Tabletop.js and Handlebars.js to pull all the data from a Google Spreadsheet related to politician statements and then display them onto the page. Problem a) I'm having trouble fetching the data for validity from the console from a specific object. When I console.log(data), I'm able to get each of the objects from the Google Spreadsheet, but I haven't been able to get just validity from the first or third object for instance. Console (single object) Object {Facts: Tabletop.Model} +-- Facts: Tabletop.Model ++-- column_names: Array[8] ++-- elements: Array[10] +++-- 0: Object +++-- citation1url: "Citation 1-1" +++-- citation2url: "Citation 2-1" +++-- citation3url: "Citation 3-1" +++-- datesaid: "2/20/2015" +++-- explanation: "Explanation 1" +++-- name: "Politician 1" +++-- rowNumber: 1 +++-- statement: "This is my first statement" +++-- validity: "TRUE" b) Having syntax issues, wondering if using conditionals in Handlebars would be most efficient way of changing the border color of an element if the validity of a statement (based off data from the spreadsheet) is true, false or unconfirmed vs. writing an if/statement and using jQuery's .css() or .addClass()? Trying to do something like this (both aren't working) if (validity == true) { $(".container").css("border", "1px solid #2ECC40"); } else if (validity == unconfirmed) { $(".container").css("border", "1px solid #FFDC00"); } else (validity == false) { $(".container").css("border", "1px solid #FFDC00"); } OR {#if Facts.validity.TRUE }} {{else if Facts.validity.FALSE}} {{else Facts.validity.UNCONFIRMED}} {{/if}} Links Google Spreadsheet: https://docs.google.com/spreadsheets/d/1glFIExkcuDvhyu5GPMaOesB2SlJNJrSPdBZQxxzMMc4/pubhtml JSBin: http://jsbin.com/zomopeqoza/1/edit?html,css,output Relevant Files scripts (Currently inline) var public_spreadsheet_url = "https://docs.google.com/spreadsheets/d/1glFIExkcuDvhyu5GPMaOesB2SlJNJrSPdBZQxxzMMc4/pubhtml"; $(document).ready( function() { Tabletop.init( { …
tagged with: jquery
has title: Conditionals in Handlebars.js when fetching data from Google Spreadsheet
has comment: http://stackoverflow.com/comment/46046503
type: UnansweredQuestion

http://stackoverflow.com/comment/45844766
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/28784274
has text: You should try a bit by yourself and look around before asking questions.
type: Comment

http://stackoverflow.com/comment/46053187
type: AnswerComment
type: Comment
has text: but the problem is how can i make it exactly right next to my biggest div with size and width which i want ? sorry a totall newbie here..
comment on: http://stackoverflow.com/a/28896722
score: 0

http://stackoverflow.com/comment/45918564
score: 0
comment on: http://stackoverflow.com/q/28823632
type: Comment
type: QuestionComment
has text: what is `implode()`?

http://stackoverflow.com/comment/68463553
comment on: http://stackoverflow.com/a/35002367
type: Comment
has text: in this case, how am I going to run my app in production? Do I need to compile my files down to es5? :/
type: AnswerComment
score: 0

http://stackoverflow.com/q/28805589
tagged with: angular-http
linked to: http://stackoverflow.com/q/41169385
has answer: http://stackoverflow.com/a/41200426
linked to: http://stackoverflow.com/q/48184107
accepted answer: http://stackoverflow.com/a/28805641
answer count: 7
upvote count: 33
tagged with: javascript
has answer: http://stackoverflow.com/a/58906310
has answer: http://stackoverflow.com/a/45073566
has title: How to read response headers in angularjs?
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/37092186
has body: My server returns this kind of header: Content-Range:0-10/0: I tried to read this header in angular with no luck: var promise = $http.get(url, { params: query }).then(function(response) { console.log(response.headers()); return response.data; }); which just prints Object {content-type: "application/json; charset=utf-8"} Any ideas how to access the content range header?
downvote count: 0
has answer: http://stackoverflow.com/a/37092186
has answer: http://stackoverflow.com/a/28805641
has answer: http://stackoverflow.com/a/35400760
favorite count: 0
score: 33
tagged with: angularjs
type: Question
has answer: http://stackoverflow.com/a/50471557

http://stackoverflow.com/comment/45905419
comment on: http://stackoverflow.com/a/28816720
type: AnswerComment
score: 0
type: Comment
has text: Data can't be send to php.

http://stackoverflow.com/comment/45843746
type: QuestionComment
comment on: http://stackoverflow.com/q/28783692
has text: I don't know how to implement it! But have made attempts.
score: 0
type: Comment

http://stackoverflow.com/q/28772195
has title: Recieving Leap frames simulatenously in javascript and java
has answer: http://stackoverflow.com/a/28905119
tagged with: leap-motion
type: AnsweredQuestion
tagged with: java
has body: I'm using java with Robot to move mouse on the machine, &amp; I wanted to receive gestures in javascript. Individually, both trackings are working fine, but as soon as I focus on my LeapSDK's javascript example page, Java tracking goes away &amp; mouse movement stops. One dirty solution would be to track gestures in java &amp; run a websocket server to transfer data to the javascript code. But I was wondering if this is achievable without using any server. Background policy is on and configured in Java's code. Also, on one random page reload attempt, both mouse was controllable through leap and frame data was visible in js code.
type: Question
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/28905119
tagged with: javascript
possible better answer: http://stackoverflow.com/a/33167029
has answer: http://stackoverflow.com/a/33167029

http://stackoverflow.com/q/28817759
tagged with: asp.net-mvc
tagged with: javascript
score: 0
has title: button using MvcSiteMapProvider isn't working in IE
tagged with: button
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45907667
answer count: 0
has body: I have a button in my html that uses the MvcSiteMapProvider to navigate back on the application, it works fine in all browsers except for Internet Explorer. The code in the html button: @if (MvcSiteMapProvider.SiteMaps.Current.CurrentNode != MvcSiteMapProvider.SiteMaps.Current.RootNode) { if (MvcSiteMapProvider.SiteMaps.Current.CurrentNode != null) { } } @ViewBag.Title @RenderSection("legend", required: false) note that I am already using the required scripts: <!--[if lt IE 9]> <![endif]--> The error happens eventually when I click the button to redirect to the ParentNode page and the button simply show the data-loading-text("...") and gets disabled. But visual studio doesn't especify any error, the application just continue to works normaly but with the button disabeld, any help?
has comment: http://stackoverflow.com/comment/45907593
type: Question
has comment: http://stackoverflow.com/comment/45907227

http://stackoverflow.com/q/28770570
type: UnansweredQuestion
has body: I'm struggling with a solution to get the length of an item in ng-repeat within a ng-repeat. I can only get the items.length if it is with the second ng-repeat. If I try to access it outside the child it renders nothing. So how to access the scope outside the parent ng-repeat? example code: &lt;ul&gt; &lt;li ng-repeat="item in items"&gt; {{item.some.model}} &lt;ul&gt; &lt;li ng-repeat="moreItem in moreItems"&gt; {{moreItem.someother.model}} &lt;/li&gt; {{moreItem.someother.model.length}} does work &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; {{moreItem.someother.model.length}} Doesnt work
has comment: http://stackoverflow.com/comment/45819986
has answer: http://stackoverflow.com/a/28772552
type: Question
has comment: http://stackoverflow.com/comment/45820111
has comment: http://stackoverflow.com/comment/45820288
has answer: http://stackoverflow.com/a/28770944
tagged with: javascript
score: 0
answer count: 2
has title: How to access ng-model length outside a ng-repeat within a ng-repeat
tagged with: angularjs

http://stackoverflow.com/comment/69298397
type: Comment
comment on: http://stackoverflow.com/a/28778736
score: 0
type: AnswerComment
has text: use ajax.responseText or view your response data in console.log(JSON.stringify(ajax)) inside of ajax.onload

http://stackoverflow.com/comment/49379047
score: 0
type: Comment
has text: But how do you initially serve the Angular app to the user?
type: AnswerComment
comment on: http://stackoverflow.com/a/28794820

http://stackoverflow.com/a/54344724
downvote count: 2
upvote count: 44
answers question: http://stackoverflow.com/q/28899298
has comment: http://stackoverflow.com/comment/115283250
has comment: http://stackoverflow.com/comment/105184281
type: Answer
has comment: http://stackoverflow.com/comment/109023184
has comment: http://stackoverflow.com/comment/101044857
has comment: http://stackoverflow.com/comment/140227757
has comment: http://stackoverflow.com/comment/105184426
has body: textContext is a very good technique for achieving desired results but sometimes we don't want to load DOM. So simple workaround will be following regular expression: let htmlString = " Hello W3C" let plainText = htmlString.replace(/<[^>]+>/g, '');
score: 42

http://stackoverflow.com/a/28826987
score: 0
has comment: http://stackoverflow.com/comment/45924575
answers question: http://stackoverflow.com/q/28826757
has comment: http://stackoverflow.com/comment/45926384
has comment: http://stackoverflow.com/comment/45928544
has body: If your eventClick invoke a postback and Fire the page_Load function without moving to your click event hundler, and you are sure that OnClick attribute has the right event hundler name the you have to check your web.config in this section &lt;appSettings&gt; &lt;add key="aspnet:MaxHttpCollectionKeys" value="xxx" /&gt; &lt;/appSettings&gt; change it to &lt;appSettings&gt; &lt;add key="aspnet:MaxHttpCollectionKeys" value="5000" /&gt; &lt;/appSettings&gt; And if the "MaxHttpCollectionKeys" does not exist add it. and change this config under the &lt;configuration&gt; &lt;system.web&gt; &lt;httpRuntime maxRequestLength="xxx" /&gt; to &lt;configuration&gt; &lt;system.web&gt; &lt;httpRuntime maxRequestLength="51200" /&gt;
has comment: http://stackoverflow.com/comment/45924855
type: Answer
has comment: http://stackoverflow.com/comment/45924496

http://stackoverflow.com/comment/45797975
type: AnswerComment
has text: Thank you, i didn't know the concept of clone, thanks to you learned new thing.
type: Comment
comment on: http://stackoverflow.com/a/28758795
score: 0

http://stackoverflow.com/a/28850237
has body: This is how I got it working. Somehow missed the jQuery API .keyup() and .keydown() functions. I hope this helps some other person The html code looks like this - &lt;input class="autocompleteEval ui-autocomplete-input" id=txtEvaluator/&gt; The resolved code looks like this. $('.autocompleteEval').autocomplete({ source: '@Url.Action("autocompleteEvalList")', minLength: 2, select: function (event, ui) { debugger; event.preventDefault(); $(this).val(ui.item.label); if (ui.item.value == "-1") { $('.autocompleteEval').val(''); $('#EvaluatorAjax').hide(); } else { $('.autocompleteEval').val(ui.item.label); $('#EvaluatorAjax').hide(); } event.preventDefault(); return false; } , change: function (event, ui) { if (!ui.item) { $('.autocompleteEval').val(''); } else { $('.autocompleteEval').val(ui.item.label); $(this).attr('actionId', ui.item.values); $('#EvaluatorAjax').hide(); } } , search: function (event, ui) { $('#EvaluatorAjax').css('visibility', ''); } , response: function (event, ui) { $('#EvaluatorAjax').css('visibility', 'hidden'); } }).keyup(function (event, ui) { if (ui.item.value == "-1") { $('.autocompleteEval').val(''); } else { $('.autocompleteEval').val(ui.item.label); } return false; }).keydown(function (event, ui) { if (ui.item.value == "-1") { $('.autocompleteEval').val(''); } else { $('.autocompleteEval').val(ui.item.label); } return false; }).focus(function (event, ui) { event.preventDefault(); $('.autocompleteEval').val(ui.item.label); return false; });
upvote count: 1
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/28848459
score: 1

http://stackoverflow.com/comment/45851720
has text: Which compiler? Which prototype and inheritance ? You just create an instance of `Animal` and assign it to the `penguin`. From your code, it is easy to see that `penguin.sayName();` would write to the console, "Hi my name is Penguin".
comment on: http://stackoverflow.com/q/28787945
type: Comment
type: QuestionComment
score: 0

leaflet
tags question: http://stackoverflow.com/q/28904160
type: Tag
tags question: http://stackoverflow.com/q/28888510
tags question: http://stackoverflow.com/q/28821651
tags question: http://stackoverflow.com/q/28816957
tags question: http://stackoverflow.com/q/28873713
tags question: http://stackoverflow.com/q/28815746
tags question: http://stackoverflow.com/q/28874635
tags question: http://stackoverflow.com/q/28867243
tags question: http://stackoverflow.com/q/28753009
tags question: http://stackoverflow.com/q/28886382
tags question: http://stackoverflow.com/q/28899176
tags question: http://stackoverflow.com/q/28858332
tag name: leaflet

http://stackoverflow.com/comment/45954015
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28842366
has text: It still doesn't seem to be feeding it into the image tag.

http://stackoverflow.com/comment/46050249
type: QuestionComment
comment on: http://stackoverflow.com/q/28895147
score: 1
has text: I'd port the code to Delphi. That will result in far and away the cleanest code in the long run.
type: Comment

http://stackoverflow.com/a/28874855
upvote count: 3
answers question: http://stackoverflow.com/q/28874635
downvote count: 0
has body: You cannot create SVG elements using createElement, that's only for html elements. If you want to create an SVG element you must create an element in the SVG namespace using createElementNS i.e. var svgDef = doc.createElementNS('http://www.w3.org/2000/svg', 'defs'); // Create gradient and stops element var svgGradient = doc.createElementNS("http://www.w3.org/2000/svg", "radialGradient"); var svgStart = doc.createElementNS('http://www.w3.org/2000/svg', 'stop'); var svgStop = doc.createElementNS('http://www.w3.org/2000/svg', 'stop'); Using devtools reruns the html parser on the content which magically corrects the namespace.
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28874635
score: 3

http://stackoverflow.com/a/28808628
score: 0
has comment: http://stackoverflow.com/comment/45889803
type: Answer
answers question: http://stackoverflow.com/q/28808504
has body: I'm assuming you want the form to do more than what is indicated in your question, otherwise this is just a basic jump navigation. If you DO have more data to transmit then window.location won't post that data from the form. You need to do the following: $(function(){ // bind change event to select $('#selectbox').bind('change', function () { var url = $(this).val(); // get selected value if (url) { // set the 'action' attribute to the // value of the url var and submit the form. $('form').attr('action', url).submit(); } return false; }); });

http://stackoverflow.com/comment/46005938
type: Comment
comment on: http://stackoverflow.com/a/28871236
type: AnswerComment
has text: Updated answer. parseFloat and check
score: 0

ios
tags question: http://stackoverflow.com/q/28864150
tags question: http://stackoverflow.com/q/28841643
tags question: http://stackoverflow.com/q/28883295
type: Tag
tags question: http://stackoverflow.com/q/28760419
tags question: http://stackoverflow.com/q/28796247
tags question: http://stackoverflow.com/q/28765113
tags question: http://stackoverflow.com/q/28848488
tags question: http://stackoverflow.com/q/28869711
tags question: http://stackoverflow.com/q/28813115
tags question: http://stackoverflow.com/q/28827511
tag name: ios
tags question: http://stackoverflow.com/q/28821185
tags question: http://stackoverflow.com/q/28795476
tags question: http://stackoverflow.com/q/28900216
tags question: http://stackoverflow.com/q/28864012
tags question: http://stackoverflow.com/q/28756637
tags question: http://stackoverflow.com/q/28864156
tags question: http://stackoverflow.com/q/28766676
tags question: http://stackoverflow.com/q/28823188
tags question: http://stackoverflow.com/q/28807514
tags question: http://stackoverflow.com/q/28773679
tags question: http://stackoverflow.com/q/28887518
tags question: http://stackoverflow.com/q/28900116
tags question: http://stackoverflow.com/q/28810745
tags question: http://stackoverflow.com/q/28760897
tags question: http://stackoverflow.com/q/28860335
tags question: http://stackoverflow.com/q/28763970

http://stackoverflow.com/a/28754073
answers question: http://stackoverflow.com/q/28753787
type: Answer
score: 1
upvote count: 1
has body: JavaScript variables track objects by reference. Because DOM nodes are objects, any changes to a variable that references a DOM node object will make changes directly to the object that is referenced. A simple example: // create an object var x = {foo: "bar"}; // create a "reference" to that object var ref = x; // manipulate the reference variable ref.foo = "hello"; // check the original object console.log(x.foo); //=&gt; "hello" This is no different if this.div is a reference to a DOM node (created by jQuery) and you do this.div.css("color", "red"); The underlying (referenced) object will be changed.
accepted answer of: http://stackoverflow.com/q/28753787
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/46012201
type: Comment
comment on: http://stackoverflow.com/q/28874942
has text: Have you already tried to execute the pure generated html code? did any errors in the error console occure?
score: 1
type: QuestionComment

http://stackoverflow.com/comment/46062142
type: Comment
comment on: http://stackoverflow.com/a/28901340
has text: Just realized that I forgot to include the filtering method I was using in JS, edited my question to include this
type: AnswerComment
score: 0

http://stackoverflow.com/comment/45790965
has text: What does it sort then? It was my understanding that it sorted cells by columns
type: Comment
score: 0
comment on: http://stackoverflow.com/a/28752877
type: AnswerComment

http://stackoverflow.com/q/28805371
tagged with: javascript
tagged with: extjs
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28805394
accepted answer: http://stackoverflow.com/a/28805394
tagged with: php
type: AnsweredQuestion
has body: I have php array as bellow $php_arr = json_encode(array('1'=&gt;'"data1', '1'=&gt;'data2')); that json object i try to access inside Extjs as bellow var test = Ext.JSON.decode()(&lt;?php echo $php_arr; ?&gt;); but that gave to me error as Uncaught Ext.JSON.decode(): You're trying to decode an invalid JSON String: because of JSON object break "data1 How can I get this JSON object decoded in ExtJs without lose "?
tagged with: http://stackoverflow.com/tag/json
has title: PHP array JSON encode and that object decode inside ExtJs
type: Question

http://stackoverflow.com/q/28884729
score: 0
answer count: 2
favorite count: 0
accepted answer: http://stackoverflow.com/a/28884818
has title: Matching Regex till a character
has body: This is my string: tel+1234567890 This is my regex: ([\d].*<) which matches this: 1234567890< but I dont want to match the last <character.
has comment: http://stackoverflow.com/comment/46030690
tagged with: regex
type: AnsweredQuestion
upvote count: 2
possible better answer: http://stackoverflow.com/a/28884815
downvote count: 2
has answer: http://stackoverflow.com/a/28884815
type: Question
has answer: http://stackoverflow.com/a/28884818
has comment: http://stackoverflow.com/comment/46030727
tagged with: javascript
has comment: http://stackoverflow.com/comment/46030738
has comment: http://stackoverflow.com/comment/46030725

http://stackoverflow.com/comment/45957435
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28842591
has text: @Callum, 'the controller doesn't implement routing logic'? In the action shown, there are five different return statements that are quite clearly 'routing logic'. Compare the first and last return statements, which return the same view and 200 result but with different content and entirely different semantic meanings... We'll see what comes with vNext when it gets here. Right now, they are parallel and separate technologies and MVC is a very poor backend for angular app interaction.
score: 0

http://stackoverflow.com/q/28769742
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: angularjs
has title: Angular UI-Router Template Provider (Access to Locals?)
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/54105301
upvote count: 3
has body: I need access to resolves in my templateProvider. The documentation says this is possible does it doesn't look like it actually works. Does anyone know if I'm doing this wrong or if it simply doesn't work? http://plnkr.co/edit/yitkre1ttB8TehbhClR2?p=preview // Code goes here angular.module('app', ['ui.router']).config(function($stateProvider, $urlRouterProvider) { $stateProvider.state('root', { url: '/root', resolve: { test: function() { return 'world'; } }, templateProvider: function(test) { return 'hello ' + test; } }); $urlRouterProvider.otherwise('root'); });
type: Question
score: 3
tagged with: angular-ui-router
has answer: http://stackoverflow.com/a/29382501

http://stackoverflow.com/comment/45897456
comment on: http://stackoverflow.com/q/28812756
score: 1
has text: Make PHP script that will do database stuff and then call it with ajax call when your counter reaches zero. With ajax you can also pass some parameters if needed.
type: QuestionComment
type: Comment

http://stackoverflow.com/a/28865060
answers question: http://stackoverflow.com/q/28864896
has body: I don't know php, but classic asp works in similar fashion as far as I know. If you set the variable outside the scope of the function, and also include apostrophes, it should work. var user="&lt;?php echo $_SESSION['user'];?&gt;"; //possibly declared outside of scope Edited as per @developerwjk's comment about the php-syntax
has comment: http://stackoverflow.com/comment/45996125
has comment: http://stackoverflow.com/comment/45996558
downvote count: 0
score: 1
type: Answer
upvote count: 1

http://stackoverflow.com/q/28858707
type: Question
tagged with: pocket
tagged with: javascript
score: 0
has body: I am trying to get access token for Pocket. I am using MEAN stack. I am trying to run the following query in the browser: https://getpocket.com/auth/authorize? request_token=YOUR_REQUEST_TOKEN&amp;redirect_uri=YOUR_REDIRECT_URI But i am not sure how to obtain the access_token back. I tried running the same in POSTMAN app as well but it returns the authentication page. (PS: I was able to get access token for foursquare using POSTMAN). How do i get access token in here.
answer count: 1
tagged with: authorization
tagged with: angularjs
has answer: http://stackoverflow.com/a/33006985
type: UnansweredQuestion
has title: Get Pocket access token in angularjs or nodejs
tagged with: node.js
has comment: http://stackoverflow.com/comment/53831660

http://stackoverflow.com/comment/45907516
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28817904
has text: What errors are you getting?

http://stackoverflow.com/comment/46101374
type: Comment
comment on: http://stackoverflow.com/a/28911306
type: AnswerComment
score: 1
has text: Hey, thanks for this. I will test it monday if I have time. The main issue with this is I can't update the code for my_module. I should have named it `someone_elses_module` in my examples, but that was too wordy. Your solution seems right on track though.

http://stackoverflow.com/comment/46000324
type: AnswerComment
comment on: http://stackoverflow.com/a/28867857
type: Comment
has text: what do you mean `stuck`? I just noticed I left in `Location:` by mistake on the fail url and fixed it
score: 0

http://stackoverflow.com/comment/45925095
type: QuestionComment
type: Comment
score: 0
has text: when you have values you may find indices for it. Using filter function at the beginning you create new array, so the found indices wound not match the original ones.
comment on: http://stackoverflow.com/q/28827343

http://stackoverflow.com/q/28821765
has title: Function composition in JavaScript
possible better answer: http://stackoverflow.com/a/60407729
has comment: http://stackoverflow.com/comment/45915357
favorite count: 0
has comment: http://stackoverflow.com/comment/45915335
accepted answer: http://stackoverflow.com/a/28833174
type: AnsweredQuestion
score: 3
downvote count: 0
has body: What's the benefit of function composition implementation in libs like underscore, lo-dash and others, similar to this one: var compose = function() { var funcs = arguments; return function() { var args = arguments; for (var i = funcs.length; i --&gt; 0;) { args = [funcs[i].apply(this, args)]; } return args[0]; } }; var c = compose(trim, capitalize); in comparison to this: var c = function (x) { return capitalize(trim(x)); }; The latter is much more performant.
has comment: http://stackoverflow.com/comment/45915306
has answer: http://stackoverflow.com/a/60407729
has answer: http://stackoverflow.com/a/28833174
type: Question
answer count: 2
tagged with: javascript
upvote count: 3
tagged with: functional-programming

http://stackoverflow.com/comment/46028421
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28883097
has text: @somethinghere Alright, I'll add that and see how it works out, Sorry for the late reply was busy cleaning around the house a bit.

http://stackoverflow.com/comment/45863737
type: QuestionComment
comment on: http://stackoverflow.com/q/28794602
type: Comment
has text: What's `patates` ? Post script that has a beginning and ending. And relevant HTML
score: 0

http://stackoverflow.com/q/28895946
tagged with: javascript
has comment: http://stackoverflow.com/comment/46051952
accepted answer: http://stackoverflow.com/a/28896233
answer count: 1
downvote count: 0
tagged with: asp.net
favorite count: 0
has comment: http://stackoverflow.com/comment/46051838
has body: I am making a tr which runs at server side to invisible. But in some conditions,I want it to be visible.I am using the bellow script to make it visible: document.getElementById('trID').style.display = "block" and also i used: document.getElementById('hidebuttons').style.visibility = "visible"; But it is not working. Please help me on this.
has comment: http://stackoverflow.com/comment/46051864
tagged with: c#-4.0
has comment: http://stackoverflow.com/comment/46051689
has comment: http://stackoverflow.com/comment/46051848
type: AnsweredQuestion
has title: How to make table row at server side visible using javascript?
has answer: http://stackoverflow.com/a/28896233
score: 1
upvote count: 1
type: Question

http://stackoverflow.com/a/28762009
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28760655
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28760655
has body: Here's a clean solution: google.maps.event.addListener(marker, 'click', function() { var contentString = "' " + " {0} " + " {1} " // + " " + " " + "TAP ME TO OPEN THE DETAIL" + " " + " " contentString = contentString.format(punto.label, punto.descBreve); if (me.infowindow) { me.infowindow.close(); } me.infowindow = new google.maps.InfoWindow({ content : contentString }); me.infowindow.open(me.getMap(), marker); // short delay setTimeout(function() { var iw = Ext.get('detailLink'); iw.addListener({ tap : function() { // do what you need } }); }, 100); }); The function on fireEvent index.html is not required anymore.

http://stackoverflow.com/comment/45984400
type: Comment
comment on: http://stackoverflow.com/q/28836275
has text: I don't have anything further to suggest. Maybe there's something obvious that's not right, but at this point I would start throwing a lot of things into `console.log()`, and also take a close look at what's in the DOM after you restore. I wonder whether the JSON representation of the nodes is not preserving some important context. Maybe d3 is creating SVG objects outside of the `svg` object, for example.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/46070684
type: Comment
has text: I'm sorry i don't understand your last comment. How and where can i use DEBUG=query
type: QuestionComment
comment on: http://stackoverflow.com/q/28905263
score: 0

http://stackoverflow.com/q/28855790
downvote count: 0
favorite count: 0
tagged with: angularjs
answer count: 0
type: UnansweredQuestion
score: 1
upvote count: 1
has body: Is it possible to perform Angular operations such as ng-repeat within the EJS templating engine for the purpose of TWO WAY DATA BINDING? If so, can you provide an example of how to pass an array from express to EJS and perform ng-repeat. My User Schema: var mileSchema = mongoose.Schema({ miles: String }); var userSchema = mongoose.Schema({ local : { email : String, password : String, }, userInfo : { fullname : String, region : String, }, milesLog : [mileSchema] }); module.exports = mongoose.model('User', userSchema); My Express Route: var User = require('../app/models/user'); app.get('/profile', isLoggedIn, function(req, res) { res.render('profile.ejs', { user : req.user }); }); My EJS template: ( this is only a section of the whole template ) {{m}} <% if (user.local.email) { %> id: <%= user._id %> email: <%= user.local.email%> Region: <%= user.userInfo.region %> username: <%= user.userInfo.fullname %> <% } %>
type: Question
has title: Use ng-repeat ( AngularJS) with EJS and express
tagged with: javascript
tagged with: express
tagged with: mongodb
tagged with: ejs

http://stackoverflow.com/q/28822479
has title: Javascript window.location.href onClick not working
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/28822514
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/45916532
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has body: So I have a basic html page and basic Javascript in the head. I'm trying to redirect using Javascript once the function is activated through onClick but window.location.href wont work. window.alert works and everything else. HTML Testing Aff Links Link Link #1
favorite count: 0
upvote count: 2
accepted answer: http://stackoverflow.com/a/28822514
possible better answer: http://stackoverflow.com/a/28822513
has comment: http://stackoverflow.com/comment/45977479
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28822513

http://stackoverflow.com/q/28855443
tagged with: window.location
score: 1
tagged with: query-string
favorite count: 0
upvote count: 1
tagged with: hashtag
has title: Hash Tag stop window.location Javascript event
answer count: 0
downvote count: 0
has body: When # tag comes in end of URL in address bar such as "http://example.com/pagename#" and then on a click event I want to redirect on page by using window.location Javascript event ,Then its not work. var redirectURL = window.location.href.split('?')[0];//Remove all existing query string redirectURL = redirectURL + "?" + newqueryStringName + "=" + newqueryStringValue; window.location = redirectURL; How I can redirect to a new page when # exists in address bar.
tagged with: javascript
type: UnansweredQuestion
tagged with: click
type: Question

self-executing-function
tags question: http://stackoverflow.com/q/28756159
type: Tag
tag name: self-executing-function

http://stackoverflow.com/a/28800638
answers question: http://stackoverflow.com/q/28796249
type: AcceptedAnswer
has body: I figured it out. Basically I had to do away with the iframe.contentWindow.location.hash and instead just grab the bubble's y-coord then scrollTo that position minus half the height of the iframe. Here it is... http://jsfiddle.net/df09shon/8/ The key parts are this... var rect = elem.getBoundingClientRect(); //console.log(rect.top, rect.right, rect.bottom, rect.left); iframe.contentWindow.scrollTo(0,rect.top-iframe.clientHeight / 2);
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/28796249

http://stackoverflow.com/a/28889067
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/28888713
has body: How about just setting the attribute through jquery? $('input[name="testing'+work_count+'"]').attr('required', true); btw, there is no id attribute on your added inputs. so: $('input[id="testing'+work_count+'"]').rules("add" should be $('input[name="testing'+work_count+'"]').rules("ad
answers question: http://stackoverflow.com/q/28888713

http://stackoverflow.com/comment/45956487
type: Comment
has text: thnxs, makes sense to add to size after invoking the function
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/28842529

http://stackoverflow.com/q/28837090
has comment: http://stackoverflow.com/comment/45943986
has comment: http://stackoverflow.com/comment/45944649
tagged with: javascript
tagged with: jquery
has body: I have a slideshow that I need to initialize with jQuery. The initialization requires all slideshow images to be fully loaded, so that I can get their actual width and height. I can not change this part. Consider the following layout: &lt;div class="slideshow"&gt; &lt;img /&gt; &lt;img /&gt; &lt;img /&gt; &lt;/div&gt; &lt;img /&gt; &lt;img /&gt; &lt;img /&gt; I need to initialize the slideshow as soon as the three images inside the slideshow container have been loaded. I can NOT wait until the rest of the images on the page have been loaded, as there might be thousands of images. Any ideas how I could solve this?
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/28837993
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/28837641
has answer: http://stackoverflow.com/a/28837993
has comment: http://stackoverflow.com/comment/45943930
has answer: http://stackoverflow.com/a/28837641
has comment: http://stackoverflow.com/comment/45944057
has title: jQuery: Execute function as soon as a subset of images have loaded
has comment: http://stackoverflow.com/comment/45943835
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45943836
has comment: http://stackoverflow.com/comment/45944598
type: Question

http://stackoverflow.com/a/28871057
answers question: http://stackoverflow.com/q/28870999
type: Answer
upvote count: 0
has body: You need to have a return statement inside of your inner property: var Common = module.exports = { unit: { somejQueryFn: function() { return $('.selector') /* work with jQuery */ } } }
has comment: http://stackoverflow.com/comment/46005519
score: -1
has comment: http://stackoverflow.com/comment/46005968
downvote count: 1

http://stackoverflow.com/a/28859728
type: Answer
answers question: http://stackoverflow.com/q/28859142
has body: dataType: "script" has no sense here, I think you want json or leave it empty. Your PHP script should work if you try to get the variable with $_GET['selected_category'] I suggest you this modification to help yourself for debugging $.ajax({ type: "GET", url: "myurl.php", data: { "selected_category" : v}, success: function(data){ console.log(data); // you can also do redirection here (or in complete below) }, complete: function(data){ // when request is done, independent of success or error. }, error: function(data){ // display things to the user console.error(data); } })
score: 0

http://stackoverflow.com/comment/46012807
comment on: http://stackoverflow.com/a/28874901
has text: I'm getting the value from database and showing the MRP when I tried ur code its showing NaN
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/45997477
comment on: http://stackoverflow.com/q/28865410
score: 0
has text: Is that really the proper way to do it? So I only return an array if it's more than one object? Oof My poorly made mistake. I almost put the response in the first post but another post I read said you should always return an array to keep it uniform. I had an eerie feeling though. Mind posting an answer so I can check it?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/46072667
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28904412
has text: thank you for your suggestion. I did notice that the user was no longer login. If you bear with me, the last dilemna I have is the following: parse-1.3.0.min.js:2 Uncaught TypeError: Cannot read property 'then' of undefined

http://stackoverflow.com/a/28915458
upvote count: 0
answers question: http://stackoverflow.com/q/28902915
score: -1
downvote count: 1
type: Answer
has body: I got this to work. Thanks all for your feed back. I ended up placing the JQuery at the wrong area of my code. My code: <?php /* Template Name: Experience Page */ ?> <?php get_header(); ?> Proficient Above Average Average Basic Graphic Design HTML 5 CSS / SASS Javascript & JQuery Content Management Systems (CMS) PHP Videography Flash & ActionScript 3-D Animation & Pritning <?php dynamic_sidebar( 'projects_position' ); ?> <?php get_footer(); ?> SASS: .experience { height: 350px; } .graph { overflow: hidden; background: $darkgrey; #chart { width: 90%; height: 450px; margin: 30px auto; display: block; #skill { width: 10%; height: 100%; margin: 0; padding: 0; display: inline-block; float: right; li { text-align: center; list-style: none; height: 20px; border-bottom: 2px solid #c7c7c7; margin: 40px 0; span { color: #d2f9c2; font-size: 1.2em; font-weight: 600; } } } #bars { display: inline-block; width: auto; height: 300px; padding: 0; border-bottom: 2px solid $background; li { display: table-cell; width: 100px; height: 300px; margin: 0; text-align: center; position: relative; .bar { display: block; width: 60px; margin-left: 15px; background: linear-gradient(#d2f9c2, #379f53); position: absolute; bottom: 0; } span { color: #eee; width: 202px; position: absolute; bottom: -7em; left: 1.5em; text-align: left; transform: rotate(40deg); } } } } }

http://stackoverflow.com/comment/46020766
comment on: http://stackoverflow.com/a/28878226
type: AnswerComment
score: 0
type: Comment
has text: Can you post your entire code, not clear when you are trying to get new index.

http://stackoverflow.com/a/28805424
has comment: http://stackoverflow.com/comment/45887651
has comment: http://stackoverflow.com/comment/45886222
type: Answer
has comment: http://stackoverflow.com/comment/45886583
has comment: http://stackoverflow.com/comment/45887593
has comment: http://stackoverflow.com/comment/45886411
answers question: http://stackoverflow.com/q/28805215
has comment: http://stackoverflow.com/comment/45887789
has body: I would guess the problem is the $location.path('/main'); call in your $locationChangeStart handler. Given that this handler is executed before the location changes, it looks like it would execute infinitely.
has comment: http://stackoverflow.com/comment/45885487
has comment: http://stackoverflow.com/comment/45887283
has comment: http://stackoverflow.com/comment/45885909
has comment: http://stackoverflow.com/comment/45886267
has comment: http://stackoverflow.com/comment/45886433
has comment: http://stackoverflow.com/comment/45886968
has comment: http://stackoverflow.com/comment/45886164
has comment: http://stackoverflow.com/comment/45887306
has comment: http://stackoverflow.com/comment/45886102
score: 0

http://stackoverflow.com/q/28821185
score: 1
upvote count: 1
has body: I am trying to use the DailyMotion Embed API in order to play a video on iOS. I have disabled the chrome, because I have custom controls. This works perfectly fine on desktop and other mobile devices, but not on iOS. This has to do with iOS not allowing JS triggering of video playback. However, I need to be able to somehow start the DailyMotion video either through an event or through DailyMotion's embedded iframe (For example, Youtube has a large red play button). I am hoping not to have to disable my custom controls just to get the video to start playing on iOS. I have made a fiddle with the code: http://jsfiddle.net/recqfww6/ $(function() { DM.init(); embedPlayer = DM.player($('#embed-player')[0], { video: 'x2f5zar', width: '100%', height: '100%', params: { 'api': 1, 'autoplay': 0, 'chromeless': 1, 'background': '000000', 'html': 1, 'id': 'embed-player', 'info': 0, 'logo': 1, 'related': 0, 'webkit-playsinline': 1 } }); $('#play_btn').on('click', function() { embedPlayer.play(); }); }); You can try playing that on Desktop and then using this link to play on iOS: https://jsfiddle.net/recqfww6/embedded/result/ When clicking the button on iOS, DailyMotion shows a loading icon, but never loads. Thanks for any help!
type: Question
tagged with: dailymotion-api
tagged with: ios
has answer: http://stackoverflow.com/a/28830477
tagged with: javascript
has title: DailyMotion JS Embed API on iOS & Playing video
answer count: 1
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/28830477
type: AnsweredQuestion

http://stackoverflow.com/comment/45961795
score: 0
type: Comment
type: QuestionComment
has text: try this http://jsfiddle.net/u9hvp/
comment on: http://stackoverflow.com/q/28846447

http://stackoverflow.com/q/28837419
has comment: http://stackoverflow.com/comment/45944511
type: UnansweredQuestion
score: 0
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/45944500
type: Question
has answer: http://stackoverflow.com/a/28841116
tagged with: javascript
has comment: http://stackoverflow.com/comment/45944502
has comment: http://stackoverflow.com/comment/45944590
answer count: 2
has comment: http://stackoverflow.com/comment/45944546
tagged with: jquery
has body: I have the following code function f () { var jsonvar = get (...); console.log (jsonvar); $.ajax({ type: "POST", url: transactUrl, dataType: "xml", success: function (result) { console.log (jsonvar); } }); } function get (param) { return JSON.search (...).toString (); } and I will have result: "someValue" undefined But why is jsonvar "forgotten" inside of $.ajax() function? Variable which is not defined with JSON will have the same value. What is the difference between them? Javascript's typeof returns String for both of them.
has answer: http://stackoverflow.com/a/28849311
has title: Why is JavaScript variable "undefined" if it is returned from JSON.search()?
has comment: http://stackoverflow.com/comment/45945226

http://stackoverflow.com/a/28808477
score: 1
accepted answer of: http://stackoverflow.com/q/28805650
has body: You can try this code $(function () { $("[id*=btnModalPopup]").live("click", function () { $("#modal_dialog").dialog({ title: "Upload Sheet", buttons: { Close: function () { $(this).dialog('close'); }, }, open: function (type, data) { $(this).parent().appendTo("form"); }, modal: true }); return false; }); }) &lt;form id="form1" runat="server"&gt; &lt;div id="div1" style="display: none"&gt; &lt;asp:FileUpload ID="FileUpload1" runat="server" /&gt; &lt;asp:Button ID="Button1" runat="server" Text="Upload" CausesValidation="false" OnClick="btnUpload_Click" /&gt; &lt;/div&gt; &lt;asp:Button ID="Button2" runat="server" Text="Show Modal Popup" /&gt; &lt;/form&gt; protected void btnUpload_Click(object sender, EventArgs e) { if (FileUpload1.HasFile) { string fileName = FileUpload1.FileName; FileUpload1.SaveAs("~/Images/" + fileName); } }
has comment: http://stackoverflow.com/comment/45889903
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45889846
has comment: http://stackoverflow.com/comment/45889529
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/28805650

http://stackoverflow.com/q/28761693
type: AnsweredQuestion
type: Question
tagged with: asp.net-mvc
tagged with: javascript
has answer: http://stackoverflow.com/a/28762311
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: single-page-application
answer count: 1
has title: Unterminated string constant during @Html.Partial from javascript object
accepted answer: http://stackoverflow.com/a/28762311
has body: var html = '@Html.Partial("_mypartialview")'; $("#container").html(html); I am working in a single page application and I don't want to hide the container div element; instead I want to load the html content into my javascript object. But I get the error: Unterminated string constant. I have tried various methods without any success. Any help as to why I get this error would be really appreciated.
has comment: http://stackoverflow.com/comment/45803185

http://stackoverflow.com/comment/45850018
has text: Not sure what you are asking to be honest.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28784635

http://stackoverflow.com/a/28760169
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/28759148
has comment: http://stackoverflow.com/comment/62735699
type: Answer
score: 2
downvote count: 0
has body: There are a few things to do: Use the first element of array returned by jQuery selector $('#wrapper')[0] Define the name of the pdf file you want to save pdf.save('Test.pdf'); $('#downloadPdf').on('click', function() { var pdf = new jsPDF('p', 'pt', 'a4'); pdf.addHTML($('#wrapper')[0], function() { pdf.save('Test.pdf'); }); }); You can check Demo Fiddle here
upvote count: 2
has comment: http://stackoverflow.com/comment/45802030
accepted answer of: http://stackoverflow.com/q/28759148

http://stackoverflow.com/q/28891618
has comment: http://stackoverflow.com/comment/46044239
has body: I want to calculate dates that start from the 1st of January and contain only working days (Monday—Friday). How do I do that?
linked to: http://stackoverflow.com/q/28286293
has title: Calculate the number of working days between two dates
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/46044475
tagged with: datetime
answer count: 0
duplicate of: http://stackoverflow.com/q/28286293
type: UnansweredQuestion

http://stackoverflow.com/q/28785164
accepted answer: http://stackoverflow.com/a/28786017
answer count: 1
has comment: http://stackoverflow.com/comment/45847629
has body: I have contenteditable td elements in a table. I'm using bootstrap and table-hover (so the colour changes when you hover over a row. On blur of the td I do an ajax request that updates the value on the server and then I get a response that indicates success or the error. On success I want to indicate that the value has updated successfully. Right now I'm doing this: var trueColor; trueColor = $(element).css('backgroundColor'); $(element).animate({ backgroundColor: '#cce2ff' }, { duration: 100, complete: function() { $(element).delay(10).animate({ backgroundColor: trueColor }, { duration: 900 }); } }); So I'm using the complete callback of the first animate to put the colour back to what I want it to be. The code works but the problem is obviously if you're hovering over the element when it sets trueColor. I've thought of using css animations but the main thing was that I didn't know how to get a "flash" kind of effect (I think maybe keyframes would help but I don't know how to use them let alone how browser compatible they are). So the question is basically how do I achieve the effect? I don't mind whether it's css or javascript and I welcome superior suggestions if you think there's a better way to give this sort of visual feedback to a user. Update Thanks to @chiliNUT I am removing the class to get the colour but the problem was then that jquery's animate had styled the element and so hovering was broken on modified cells. So now I also removeAttr("style") to get rid of that once we're done var trueColor; $(el).closest('table').removeClass('table-hover'); trueColor = $(el).css('backgroundColor'); $(el).closest('table').addClass('table-hover'); $(el).animate({ backgroundColor: '#cce2ff' }, { duration: 100, complete: function() { $(el).delay(10).animate({ backgroundColor: trueColor }, { duration: 900, complete: function() { return $(el).removeAttr("style"); } }); } });
has answer: http://stackoverflow.com/a/28786017
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45847671
has title: Visual feedback for value update
type: Question
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/comment/46067493
type: Comment
comment on: http://stackoverflow.com/q/28822719
score: 0
type: QuestionComment
has text: Improved lines indent in your code snippet

http://stackoverflow.com/comment/46018310
comment on: http://stackoverflow.com/q/28876469
score: 49
has text: Take spaces away.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28897828
score: 1
tagged with: meteor
favorite count: 0
has title: Making functions specific to Meteor templates and accessible by its event handlers
type: Question
has body: Is there a way in which I can make functions that are specific to the template and accessible by the template's event handlers? I don't want to pollute the global namespace. I came upon this problem when I first noticed that I was repeating a lot of code between my event handlers in a manner similar to this: Template.options.events({ "click .btn-1": function(e) { // do something var div; div = $(e.target); if (div.hasClass("active")) { return div.removeClass("active"); } else { return div.addClass("active"); } }, "click .btn-2": function(e) { // do something else var div; div = $(e.target); if (div.hasClass("active")) { return div.removeClass("active"); } else { return div.addClass("active"); } } }); Note that I'm not trying to find a way to combine selectors, I already know how to do that. Notice that each button does something different, but have a few lines of repeated code. I want to keep this as DRY as possible without polluting the global namespace.
accepted answer: http://stackoverflow.com/a/28898734
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: meteor-helper
has answer: http://stackoverflow.com/a/28898734
type: AnsweredQuestion
downvote count: 0

http://stackoverflow.com/q/28871502
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46007582
has comment: http://stackoverflow.com/comment/46007535
has title: Run .exe file using AngularJs on IE
has comment: http://stackoverflow.com/comment/46006901
has comment: http://stackoverflow.com/comment/46006740
type: Question
score: 0
has body: I am using angularjs for web application we wount run exe file, which is present on client machine like (NotePad,calculator) we use context Menu on which this application needs to run. I found lot's for code like &lt;script&gt; function LaunchApp() { if (!document.all) { alert ("Available only with Internet Explorer."); return; } var ws = new ActiveXObject("WScript.Shell"); ws.Exec("C:\\Windows\\notepad.exe"); } &lt;/script&gt; but this code need to put in .hta file so how we can call this function from angular Controller we use 'use strict' for each .js file
tagged with: activexobject
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/46006643
has comment: http://stackoverflow.com/comment/46006345
tagged with: angularjs
answer count: 0

http://stackoverflow.com/q/28843107
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45960711
type: Question
has title: How to retrieve a specific object with Parse.Query
has body: I am using Parse to create a WebApp and I am trying to get an instance of an object Productwith this code: getProduct: function() { var productClass = Parse.Object.extend("Product"); var query = new Parse.Query(productClass); var result = query.get(productId, { success: function(object) { console.log(object.get("productName")); }, error: function(object, error) { ... } }); return result; } I get a: result.get is not a function Printing the object only, I realized that I do not get a Product, I get this in the console (Safari): [Log] Object (views.js, line 269) _rejected: false _rejectedCallbacks: Array[0] _resolved: true _resolvedCallbacks: Array[0] _result: Arguments[1] __proto__: Object I tried many ways, but I am not able to retrieve a Product object and its attributes. What am I doing wrong? EDIT I am adding my Products View: window.app.Products = Parse.View.extend({ template: _.template($('#products-template').html()), el: $('body'), content: $('#content'), ... initialize: function() { _.bindAll(this, 'render'); this.render(); }, render: function () { $(this.content).html(this.template); return this; }, ... getUser: function() { return Parse.User.current(); }, getUserProduct: function() { var promise = new Parse.Promise(); var productClass = Parse.Object.extend("Product"); var query = new Parse.Query(productClass); query.equalTo("objectId", this.getUser().get("product").id); query.first().then(function(result) { if(result){ // If result was defined, the object with this objectID was found promise.resolve(result); } else { console.log("Product was not found"); promise.resolve(null); } }, function(error){ console.error("Error searching for Product. Error: " + error); promise.error(error); }); return promise; }, setProduct: function() { this.getUserProduct().then(function(result) { if(result){ console.log(result.get("productName")); var productName = result.get("productName"); } else { console.log("Could not set Product"); } }, function(error){ console.log("Error:…
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/28854002
accepted answer: http://stackoverflow.com/a/28854002
has comment: http://stackoverflow.com/comment/45969891
tagged with: parse-platform
has comment: http://stackoverflow.com/comment/45970317
has comment: http://stackoverflow.com/comment/45970383

http://stackoverflow.com/comment/45839175
score: 0
comment on: http://stackoverflow.com/q/28781138
type: Comment
type: QuestionComment
has text: @RaeenHashemi i tried that way and at the end of classname number is there.so it will increment .so how to identify particuler class name.

http://stackoverflow.com/comment/45963004
comment on: http://stackoverflow.com/q/28836275
has text: Imran, I think the point is that in the code you posted, `storedNodes` contains a *reference* to the same array that `force.nodes()` returns. So when you "restore" the values, what you are "restoring" are the values that have been modified by dragging the nodes around with the mouse. @LarsKotthoff is suggesting that you convert the contents of `force.nodes()`, etc. to a string containing a JSON representation of that data, and then do the restore from those strings. You can test that method without a real back end, and doing that should preserve the previous state.
score: 1
type: Comment
type: QuestionComment

arrow-functions
tag name: arrow-functions
tags question: http://stackoverflow.com/q/28798330
tags question: http://stackoverflow.com/q/28889450
type: Tag
tags question: http://stackoverflow.com/q/28770415

selenium
tags question: http://stackoverflow.com/q/28808137
tags question: http://stackoverflow.com/q/28856332
tags question: http://stackoverflow.com/q/28775989
tags question: http://stackoverflow.com/q/28870017
tags question: http://stackoverflow.com/q/28845166
tags question: http://stackoverflow.com/q/28820651
tags question: http://stackoverflow.com/q/28855266
tags question: http://stackoverflow.com/q/28905945
tag name: selenium
tags question: http://stackoverflow.com/q/28862093
tags question: http://stackoverflow.com/q/28774117
tags question: http://stackoverflow.com/q/28773302
tags question: http://stackoverflow.com/q/28758993
tags question: http://stackoverflow.com/q/28791701
type: Tag
tags question: http://stackoverflow.com/q/28889401
tags question: http://stackoverflow.com/q/28772366
tags question: http://stackoverflow.com/q/28855004
tags question: http://stackoverflow.com/q/28788106

http://stackoverflow.com/comment/45887072
has text: @mikedidthis Duh, my bad sorry, so shall to explain a little bit what does the url contain?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28800839
type: AnswerComment

http://stackoverflow.com/comment/46313986
type: Comment
type: QuestionComment
has text: Are you looking to simply override the width/height, or something more-specific?
score: 0
comment on: http://stackoverflow.com/q/28874612

http://stackoverflow.com/comment/46031362
has text: @ShawnPatrickRice Yeah,I think it is a mistake.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28884699

http://stackoverflow.com/q/28790158
has answer: http://stackoverflow.com/a/28953084
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
score: 0
tagged with: zurb-foundation
accepted answer: http://stackoverflow.com/a/28953084
has title: Foundation navigation top-bar not working with thymeleaf
has body: I have an HTML template file which uses Spring MVC + thymeleaf and I'm trying to create a navigable menu at the top of the page using Foundation's "top-bar" component. So far, the menu bar is displayed but menus are not being shown when the cursor is placed on top. I can display the sub-menus related to my main menu options (the ones placed at the bar) but sub-menus are not working because when I click an option on the first sub-menu, the menu closes instead of displaying another sub-menu. My HTML file looks like this: Menu I'm sure my resources are being properly imported. Also, I had to use data-topbar="true" because if I use data-topbar only, my page fails while rendering saying it a expecting for a = after the property name. Am I doing something wrong? Thank you so much for any help guys!
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28819701
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/28819701

http://stackoverflow.com/a/28797503
answers question: http://stackoverflow.com/q/28797170
has body: I believe there is no formatting style for such a textbox, textarea. But you can fake it. I have two idea: Set background color of text input to transparent, then you create an colored background using span, div etc. Set position or margin so that text box is over the background. Write or using an formated text editor that render text using html $(document).ready(function() { $('input').keyup(function(){ var str= $(this).val(); var idx = str.indexOf(' ') != -1?str.indexOf(' '):str.length; $('span').text(str.substr(0, idx)); $(this).css('margin-left',-$('span').width()-6); }); }); hello
type: Answer
has comment: http://stackoverflow.com/comment/45869920
score: 4
has comment: http://stackoverflow.com/comment/45869769
upvote count: 4
has comment: http://stackoverflow.com/comment/45870019
has comment: http://stackoverflow.com/comment/45869393
downvote count: 0
has comment: http://stackoverflow.com/comment/45869382
has comment: http://stackoverflow.com/comment/45869702

http://stackoverflow.com/comment/45902446
type: Comment
type: QuestionComment
has text: Well I'll be damned.. Now it works. Just spend an hour on this. Thank you, kind sir!
comment on: http://stackoverflow.com/q/28815172
score: 0

http://stackoverflow.com/q/28775157
type: AnsweredQuestion
upvote count: 5
has comment: http://stackoverflow.com/comment/45828882
has comment: http://stackoverflow.com/comment/45828835
has comment: http://stackoverflow.com/comment/45829932
has comment: http://stackoverflow.com/comment/45828605
has comment: http://stackoverflow.com/comment/45829283
has answer: http://stackoverflow.com/a/28775456
has comment: http://stackoverflow.com/comment/45828999
has comment: http://stackoverflow.com/comment/45829186
has comment: http://stackoverflow.com/comment/45828751
answer count: 3
has title: Can you sort an array of opaque object instances in JavaScript? NOT by a property
score: 3
tagged with: arrays
has comment: http://stackoverflow.com/comment/45828718
tagged with: javascript
tagged with: sorting
favorite count: 0
has comment: http://stackoverflow.com/comment/45829859
has comment: http://stackoverflow.com/comment/45830753
has body: THIS IS NOT A QUESTION OF SORTING BY A PROPERTY!! Assume I have an array of object instances. Many instances are in the array more than once. var array = [ opaqueObjectA, opaqueObjectB, opaqueObjectA, opaqueObjectC, opaqueObjectB, opaqueObjectC, opaqueObjectA, ]; I don't care about the order, I care that the objects that are the same instance end up next to each other. In other words after sorting, one possible result would be var array = [ opaqueObjectB, opaqueObjectB, opaqueObjectC, opaqueObjectC, opaqueObjectA, opaqueObjectA, opaqueObjectA, ]; I don't care if the A's or the B's or the C's come first, I only care that objects of the same instance are next to each other after sorting. So the questions are is JavaScript sort guaranteed to handle this case? If not how can I do it? The sort function requires me to return -1 if a &lt; b, 1 of a > b and 0 if a === b but given the objects are opaque, and since I don't have access to pointer values or something else, I have nothing to compare them with to get a less than or greater than result, only an equal result. I can go add some sortId to each opaque object but that seems kind of bad to add properties to objects, I'd have no idea if I'm cobbering a property. I could make another set of objects, each with an id and a reference to one instance, sort those, then collect their instances into a new array. That also seems rather lame to have to go build an entire array of objects to sort. Actually I'd also like to be able to sort by multiple instances which is a property but still not comparable. Example: var array = [ { thing: opaqueThingA, stuff: opaqueStuffG, }, { thing: opaqueThingA, stuff: opaqueStuffH, }, { thing: opaqueThingB, stuff: opaqueStuffG, }, { thing: opaqueThingC, stuff: opaqueStuffG, }, { thing: opaqueThingB, stuff: opaqueStuffH, }, { thing: opaqueThingA, stuff: opaqueStuffG, }, { thing: opaqueThingA, stuff: opaqueStuffH, }, { thing: opaqueThingC, stuff: opaqueStuffG, }, ]; I'd like to be able to sort them…
accepted answer: http://stackoverflow.com/a/28775456
has comment: http://stackoverflow.com/comment/45828627
possible better answer: http://stackoverflow.com/a/28775641
has comment: http://stackoverflow.com/comment/45828717
linked to: http://stackoverflow.com/q/2020670
has comment: http://stackoverflow.com/comment/45829010
has answer: http://stackoverflow.com/a/28775641
has comment: http://stackoverflow.com/comment/45828771
has comment: http://stackoverflow.com/comment/45828806
has answer: http://stackoverflow.com/a/28815234
has comment: http://stackoverflow.com/comment/45828646
downvote count: 2
type: Question

http://stackoverflow.com/comment/45829010
score: 0
type: Comment
has text: I guess I call it sorting because if I was able to sort by address I'd get the results I want. But you're right I'm grouping and if there is a solution for grouping that doesn't involve sorting that would be great. On temp arrays, I guess I wanted to avoid a temp array to not use memory and GC issues since the C/C++ solution doesn't require memory but I could keep the array around. On adding properties I first have to guess at a name and hope it doesn't clash. Yea, I know the odds are small but still it seems yuck but it is pragmatic :)
type: QuestionComment
comment on: http://stackoverflow.com/q/28775157

http://stackoverflow.com/comment/45783796
score: 1
type: Comment
type: QuestionComment
has text: What error do you get?
comment on: http://stackoverflow.com/q/28750969

http://stackoverflow.com/q/28799911
score: 0
answer count: 2
has body: I've a problem with this simple prototyping: Game = function (moduleConfig, gameConfig) { this.moduleConfig = moduleConfig; this.gameConfig = gameConfig; // Game-Commands this.keyCommands = { moveLeft: false, moveRight: false }; this.catcher = null; this.stage = null; return this; } /** * Left arrow down */ Game.prototype.onKeyboardLeftDown = function () { this.keyCommands.moveLeft = true; } /** * Left arrow up */ Game.prototype.onKeyboardLeftUp = function () { this.keyCommands.moveLeft = false; } I always get the error message: Uncaught TypeError: Cannot set property 'moveRight' of undefined when calling onKeyboardLeftDown and onKeyboardLeftUp. But i have declared moveLeft in the constructor in the keyCommands object. The two methods were called on key down and key up events: Game.prototype.init = function () { // ... // ========================================================================= // Set keyboard KeyboardJS.on('left', this.onKeyboardLeftDown, this.onKeyboardLeftUp); KeyboardJS.on('right', this.onKeyboardRightDown, this.onKeyboardRightUp); // ========================================================================= }; My index.html looks like this: pixi.js example 1 Does some one see the failure? I have searched a lot, but i'm very confused (normally i develop only in c#...)
possible better answer: http://stackoverflow.com/a/28800096
tagged with: undefined
has comment: http://stackoverflow.com/comment/45874117
has answer: http://stackoverflow.com/a/28800096
tagged with: properties
has comment: http://stackoverflow.com/comment/45874104
accepted answer: http://stackoverflow.com/a/28800147
has title: JS prototyping Cannot set property 'moveRight' of undefined
type: Question
has answer: http://stackoverflow.com/a/28800147
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45874172
tagged with: javascript
tagged with: prototype
tagged with: class

http://stackoverflow.com/comment/45962809
has text: yes.. @KarthikN: and also have to correct some other mistakes.. let we know step by step..
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/28846908

http://stackoverflow.com/comment/45850153
comment on: http://stackoverflow.com/q/28787123
type: Comment
type: QuestionComment
has text: Your second code looks OK. Add evt to the function args, and do evt.preventdefault() in the function
score: 0

http://stackoverflow.com/q/28793037
tagged with: handlebars.js
tagged with: ember.js
type: AnsweredQuestion
has body: I want to iterate over object properties in the specific order. I've prepared jsbin example of my usecase (with Ember.js and Handlebars). I can't find a way to make handlebars analog of var months = ['2014-01-01', '2014-02-01', '2014-03-01']; var datesByMonth = { '2014-03-01' : [ // march { date: '2014-03-10' }, { date: '2014-03-20' }, { date: '2014-03-21' } ], '2014-01-01' : [ // january { date: '2014-01-10' }, { date: '2014-01-20' }, { date: '2014-01-21' } ], '2014-02-01' : [ // february { date: '2014-02-10' }, { date: '2014-02-20' }, { date: '2014-02-21' } ], }; var monthsCount = months.length; for(var i = 0; i &lt; monthsCount; ++i) { var month = months[i]; console.log(month); var dates = datesByMonth[month]; var datesCount = dates.length; for(var j = 0; j &lt; datesCount; ++j) { var obj = dates[j]; console.log(' ', obj.date); } } So, The question is How to get an access to a value of the object property within key stored in other variable? P.S. Versions: EmberJS v1.9.1, Handlebars v2.0.0 P.S.S Sorry for my English
has title: How to get an access in EmberJS template to a value of the object property within key stored in other variable?
type: Question
accepted answer: http://stackoverflow.com/a/28797695
has comment: http://stackoverflow.com/comment/45860822
tagged with: javascript
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/45860852
has answer: http://stackoverflow.com/a/28797695
possible better answer: http://stackoverflow.com/a/28794234
has answer: http://stackoverflow.com/a/28794234

http://stackoverflow.com/comment/46219936
type: QuestionComment
score: 0
has text: Also, the getfiltereddata function returns some value in column 1 which is not in the actual html table, think it is the row number - is it possible to get rid of it? I think it is "rowindex" in the getfiltereddata() function is in my post here: http://stackoverflow.com/questions/28856649/avoid-activex-to-save-a-file
comment on: http://stackoverflow.com/q/28881124
type: Comment

http://stackoverflow.com/q/28796707
has comment: http://stackoverflow.com/comment/45867815
upvote count: 4
type: AnsweredQuestion
downvote count: 0
type: Question
tagged with: angular-ui-router
has comment: http://stackoverflow.com/comment/45867849
tagged with: javascript
score: 4
has comment: http://stackoverflow.com/comment/45868042
possible better answer: http://stackoverflow.com/a/28803386
answer count: 2
has body: I have a walkthrough in my app which comprises 4 pages. I decided to make the Walkthrough a single state with multiple views to represent each of the 4 pages. In my html I define a div as a ui-view pointed to the current view, which my controller then changes around as necessary. The problem is, when I update $scope.currentView to 'general' it does not change what's actually seen on the screen! If I manually change it to 'general' in my _init function it does show the general page, but I cannot make it change based on a button click. HTML: &lt;div ui-view="{{currentView}}@walkthrough"&gt;&lt;/div&gt; Controller: var _init = function () { $scope.currentView = 'welcome'; }; _init(); $scope.setView = function (view) { $scope.currentView = view; }; My state definition: .state('walkthrough', { url: '/walkthrough', views: { '': { templateUrl: 'app/walkthrough/walkthrough.html', controller: 'walkthroughController' }, 'welcome@walkthrough': { templateUrl: 'app/walkthrough/welcome.html' }, 'general@walkthrough': { template: 'general' } } }) And the button to update the view: &lt;img class="start-button center-block" ng-click="setView('general')" /&gt; Update 1 I have tried the following to solve, none of which worked: Changing currentView to a getter function getCurrentView() which returns the currentView. Same behavior. Wrapping the currentView setter in a $scope.$apply. Get the $apply already in progress error Wrapping the currentView setter in a $timeout. Same behavior Update 2 I added a &lt;pre&gt; section which calls the identical code as in the ui-view, {{currentView}}@walkthrough. It shows the correct view, even though the page itself doesn't update the show the new view. Update 3 I have tried every combination of how to programmatically set the view but nothing I've tried has worked. Whether I use a server to grab the view, function, straight up $scope variable, nothing. The variable itself is correct, but the view just won't change when I change the variable. The st…
has answer: http://stackoverflow.com/a/28803386
accepted answer: http://stackoverflow.com/a/28807281
favorite count: 0
has title: Dynamically changing View in AngularJS UI-Router
tagged with: angularjs
has answer: http://stackoverflow.com/a/28807281

http://stackoverflow.com/comment/45917230
has text: works pretty well here http://jsfiddle.net/onx6epgL/ Suggest changing ID's to classes for style though. ID's can't be repeated and using class is more scaleable
comment on: http://stackoverflow.com/q/28822852
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45908217
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28818316
score: 0
has text: Use promises. http://blog.slaks.net/2015-01-04/async-method-patterns/

http://stackoverflow.com/q/28794251
type: Question
tagged with: mongodb
accepted answer: http://stackoverflow.com/a/28794342
tagged with: javascript
has comment: http://stackoverflow.com/comment/45863386
has title: How to reuse a mongo connection with promises
has comment: http://stackoverflow.com/comment/45863123
answer count: 1
downvote count: 0
score: 1
favorite count: 0
tagged with: promise
has comment: http://stackoverflow.com/comment/45863191
type: AnsweredQuestion
tagged with: bluebird
has answer: http://stackoverflow.com/a/28794342
upvote count: 1
has body: How can I change things around in my db connection call so that I can do db.collection(): // Create a Mongo connection Job.prototype.getDb = function() { if (!this.db) this.db = Mongo.connectAsync(this.options.connection); return this.db; }; // I want to be able to do this Job.prototype.test = function() { return this.db.collection('abc').findAsync()... }; // Instead of this Job.prototype.test = function() { return this.getDb().then(function(db) { return db.collection('abc').findAsync()... }); }; My code always calls getDb so the connection does get created so that is not an issue. ex: this.getDb().then(test.bind(this)); But I actually string many of these calls around so looking for a cleaner approach. This works - just wondering if there an overall better approach to dealing with this. Job.prototype.getDb = function(id) { var self = this; return new P(function(resolve, reject) { if (!self.db) { return Mongo.connectAsync(self.options.connection) .then(function(c) { self.db = c; debug('Got new connection'); resolve(c); }); } debug('Got existing connection'); resolve(self.db); }); }; I suppose this is really just a mongo connection issue, perhaps not just promises. All the Mongo examples I see either just make all their calls inside of the connect callback or use some framework like Express and assign it on start.

http://stackoverflow.com/a/28826512
score: 0
type: Answer
answers question: http://stackoverflow.com/q/28826437
has body: I guess you want to append the last character of the ID to the value of the clicked input field. Then Why don't you just do, $(function(){ $(".textboxclass").click(function(){ var num = this.id.charAt(3); $(this).val($(this).val() + e); }); });

http://stackoverflow.com/comment/45808625
type: Comment
comment on: http://stackoverflow.com/a/28764712
score: 0
type: AnswerComment
has text: Well, in this case the blockquote don't use all the space available, is fixed to a 300px +- 150px. It won't be a bad solution anyway, but @wishab gave the answer I was looking for.

http://stackoverflow.com/comment/45975950
comment on: http://stackoverflow.com/q/28839664
score: 0
has text: Hi @Niddro can you give any more hints as to what i would need to add in place of the setTimeout function?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45984723
comment on: http://stackoverflow.com/a/28859244
score: 0
type: Comment
has text: Yes I says success, but the php script is not being called anymore.
type: AnswerComment

http://stackoverflow.com/comment/46070596
score: 0
has text: Shouldn't `modelArray` be array of arrays?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28905484

http://stackoverflow.com/a/28771407
has body: As you loop through the original array, check whether the current element is the next one in the sequence. If not, use another loop to generate the missing elements: var dataParsed = []; var lastTime = data[0][0]; var timeStep = 60000; for (var i = 0; i &lt; data.length; i++) { var curTime = data[i][0]; if (curTime &gt; lastTime + timeStep) { for (var time = lastTime + timeStep; time &lt; curTime; time += timeStep) { dataParse.push([time, 0]); } } dataParse.push(data[i]); lastTime = curTime; }
accepted answer of: http://stackoverflow.com/q/28771218
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28771218
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/comment/45945203
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28837885
has text: the thing is i spent a lot of time on my current pages html/css3..so i know i CAN do it all on React but i don't want to (if I can) :) i want to know if i'd get the advantage of speed/real time of react even IF i only use react/jsx/addons on the block D (and leave alone my header, my intercom.io chat window,and so on...)

http://stackoverflow.com/a/28756642
type: Answer
has comment: http://stackoverflow.com/comment/45794406
has body: Ok, so there're few things to have a look at: take the &lt;script&gt; out of the loop - one script can take care of all the buttons you can't give same ID to all your inputs - id="..." has to be unique throughout your script the JS script (assuming you have jQuery included prior to your ) should be: &lt;script type="text/javascript"&gt; $(function(){ $('input[type="submit"]').click(function(){ alert($(this).attr('value')); }); }); &lt;/script&gt; this should do the trick, let me know if this is what you wanted.
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45794379
upvote count: 1
answers question: http://stackoverflow.com/q/28756176

http://stackoverflow.com/q/28825060
has comment: http://stackoverflow.com/comment/45922220
score: 0
has comment: http://stackoverflow.com/comment/45922855
has comment: http://stackoverflow.com/comment/45921062
has comment: http://stackoverflow.com/comment/45920987
tagged with: javascript
has comment: http://stackoverflow.com/comment/45922182
has comment: http://stackoverflow.com/comment/45922792
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45922281
has body: I have Html 5 builder XE5 and installed the jqGrid from YouTUbe how to Moreover I found an answer to my problem at Answer but when I add this to my H5B I get no reaction at the document.write line on a new page. WHat do I wrong? I my jqGrid not the same for what that answer is? My code looks like this: function jqgrid1JSDblClickRow($sender, $params) { ?&gt; //begin js var grid = $("#jqGrid"); var rowKey = grid.getGridParam("selrow"); if (rowKey) alert("Selected row primary key is: " + rowKey); else alert("No rows are selected"); //end &lt;?php } the fabove function is a JS event function at OnDblClickRow at my jqgrid. I am a little bit confused. COuld any help me please? Thanks Edit: Now always comes "No rows are selected", even when I select a row.
type: Question
has comment: http://stackoverflow.com/comment/45920881
has comment: http://stackoverflow.com/comment/45921444
has title: Are there different products of jqGrid?
tagged with: html5builder
has comment: http://stackoverflow.com/comment/45922260
tagged with: jqgrid
linked to: http://stackoverflow.com/q/6995129

capitalize
tags question: http://stackoverflow.com/q/28871409
type: Tag
tag name: capitalize

http://stackoverflow.com/q/28841797
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45953007
linked to: http://stackoverflow.com/q/10654595
has title: jQuery .val() not setting value
upvote count: 1
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/28842021
tagged with: javascript
has comment: http://stackoverflow.com/comment/45952857
has comment: http://stackoverflow.com/comment/45952850
has comment: http://stackoverflow.com/comment/45952954
score: 0
answer count: 1
tagged with: jquery
favorite count: 0
has body: $('.remove-member').click(function () { var toRemove = $(this).parent().text().slice(0, -1); var members = $(this).parent().siblings('input[name=group-members]').val().split(' '); $(this).parent().remove(); removeElement(members, toRemove); members = members.join(' '); $(this).parent().siblings('input[name=group-members]').val(members); }); In the above, everything works until the last line (setting the value to the string contained in members). Displaying the variable members in the console displays the expected string, signifying that $(this).parent().siblings('input[name=group-members]') is traversing the DOM correctly. My HTML is below: name01x name02x name03x name04x Directly referencing $('input[name=group-members]') is not an option due to the nature of the page. removeElement function: function removeElement(arr) { var what, a = arguments, L = a.length, ax; while (L > 1 && arr.length) { what = a[--L]; while ((ax = arr.indexOf(what)) !== -1) { arr.splice(ax, 1); } } return arr; }
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45952980
has answer: http://stackoverflow.com/a/28842021
has comment: http://stackoverflow.com/comment/45952783

http://stackoverflow.com/q/28880585
has comment: http://stackoverflow.com/comment/46023077
linked to: http://stackoverflow.com/q/5342917
tagged with: internet-explorer-11
score: 0
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/46022711
has title: what is equivalent of document.createEventObject() in jquery?
answer count: 0
has comment: http://stackoverflow.com/comment/46023650
tagged with: jquery
tagged with: asp.net
has comment: http://stackoverflow.com/comment/46022595
type: Question
tagged with: http://stackoverflow.com/tag/html
has body: I am trying to replace document.createEventObject() with a jquery to or in IE 11 var ev = document.createEventObject(); ev.item = currSelectedItem; document.event = ev; Could you please suggest.

http://stackoverflow.com/a/28861602
score: 1
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45989734
has body: I think the best solution here its create a new local package. Take a look into ehe meteor-accounts-stripe its the best example over here, with that you get an idea of how to create a new OAuth package and maybe upload it into atmosphere maybe other people like you will need it on the future.
answers question: http://stackoverflow.com/q/28861461
accepted answer of: http://stackoverflow.com/q/28861461
type: Answer
downvote count: 0

http://stackoverflow.com/a/28856172
has comment: http://stackoverflow.com/comment/45980065
has comment: http://stackoverflow.com/comment/45979855
has body: You have two choices, you can either try to reuse the Uploader widget, or you can destroy the old one before you create the new one. There are many ways to find the old widget, but the simplest is probably to give it an id, and use that with (dijit/registry) registry.byId("upId") to get the old Uploader widget to either reuse or to call up.destroy() before creating the new one. I see you are referencing dijit.byId, my answer was assuming AMD where you would be you would use registry.byId. But is you want to try to reuse the uploader (sorry about not cleaning up the formatting): showAttach (parser, Uploader, dom, on, has, templateID) { parser.parse(document.getElementById("container")); var uploaderDIV = document.getElementById("uploader"); var templateID = document.getElementById('templateID').value; var uploadFormWithParams = "/wps//UploaderServlet?templateID=" + templateID; if ( document.getElementById('uploaderDIV') !=null &amp;&amp; document.getElementById('uploaderDIV').style.display == 'block' ) { // alert("select - " + document.getElementById('uploaderDIV').style.display); dijit.byId("uploaderDIV").remove(); } var up = dijit.byId('myUploader'); if(!up) { up = new dojox.form.Uploader({ id: 'myUploader', label: 'Select files', style: 'background-color: #ddddff; border: solid 0px;', //Externalize ... multiple: true, /* data: { product: "product", productFamily : "productFamily", productFamily : "operation"} ,*/ url: uploadFormWithParams }).placeAt(uploaderDIV); on(dom.byId("uploadBtn"), "click", function (evt) { //You can put some validations here ... up.submit(); }); on(dom.byId("clearBtn"), "click", function (evt) { dom.byId("uploaderStatus").innerHTML = ""; up.reset(); }); dojo.connect(up, "onComplete", function (dataArray) { var i = 0; dom.byId("uploaderStatus").innerHTML = ""; if (!dataArray.error) { for (i = 0; i &lt; dataArray.length; ++i) { //dom.byId("uploaderStatus").innerHTML += "File : '" + dataArray[i].name + "' is is saved for selected Email templa…
has comment: http://stackoverflow.com/comment/45985679
accepted answer of: http://stackoverflow.com/q/28854191
has comment: http://stackoverflow.com/comment/45985466
has comment: http://stackoverflow.com/comment/45985291
score: 0
answers question: http://stackoverflow.com/q/28854191
has comment: http://stackoverflow.com/comment/45983904
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45984301
type: Answer
has comment: http://stackoverflow.com/comment/45986035
has comment: http://stackoverflow.com/comment/45983924
has comment: http://stackoverflow.com/comment/45982333
has comment: http://stackoverflow.com/comment/45985622

http://stackoverflow.com/a/28791807
score: 0
has comment: http://stackoverflow.com/comment/45858867
has body: Web crawler programmer is in here. :) Your python execute the phantom serially. You should do it in parallel. To do it, execute the phantom then leave it, don't wait it. In PHP, would be like this: exec("/your_executable_path &gt; /dev/null &amp;"); Don't use phantom if you don't need to. It render everything. > 50MB memory will be needed.
has comment: http://stackoverflow.com/comment/45859430
type: Answer
has comment: http://stackoverflow.com/comment/45858959
has comment: http://stackoverflow.com/comment/45858905
has comment: http://stackoverflow.com/comment/45859027
answers question: http://stackoverflow.com/q/28791657
has comment: http://stackoverflow.com/comment/45859209
has comment: http://stackoverflow.com/comment/45858705
has comment: http://stackoverflow.com/comment/45858935

http://stackoverflow.com/a/28791718
upvote count: 2
score: 2
downvote count: 0
has body: You need to define transition for background-color not the font color. So just change your CSS to .LinkN1{ text-decoration:none; color:silver; transition: background-color .25s ease-in-out; -moz-transition: background-color .25s ease-in-out; -webkit-transition: background-color .25s ease-in-out; width:70px; text-align:center; padding:5px; height:20px; background-color:#06C; margin-left:103px; margin-top:-30px; float:left; border-left:solid 3px silver; }
type: Answer
answers question: http://stackoverflow.com/q/28791660

http://stackoverflow.com/a/28786450
answers question: http://stackoverflow.com/q/28786394
has comment: http://stackoverflow.com/comment/45852224
score: 0
has comment: http://stackoverflow.com/comment/45852269
has comment: http://stackoverflow.com/comment/45849051
has body: You could just measure it. But the added value of more spaces it unlikely. If you have ever written even a simple parser, you know that it doesn't make much sense that extra white space would make it faster. But moreover, larger files take longer to download, and networking speed is a bottleneck sooner than CPU power.
type: Answer
has comment: http://stackoverflow.com/comment/45849170

http://stackoverflow.com/q/28841045
upvote count: 2
score: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28841108
possible better answer: http://stackoverflow.com/a/28841276
has answer: http://stackoverflow.com/a/28841276
type: Question
has comment: http://stackoverflow.com/comment/45951304
tagged with: javascript
has comment: http://stackoverflow.com/comment/45951348
has comment: http://stackoverflow.com/comment/45951279
has body: I use the following code that when user type some value in upper and lower case I mark the value as bold,this following code is working. var typedVal = oAcF._sTypedChars.toLowerCase(); element.innerHTML = element.innerHTML.replace(typedVal, "&lt;b&gt;" + typedVal + "&lt;/b&gt;"); here I got the value and put it to lower case since I want to handle cases when user type with upper case var typedVal = oAcF._sTypedChars.toLowerCase(); here I take the value can be e.g aa and find it in the inner html and add to it bold. element.innerHTML = element.innerHTML.replace(typedVal, "&lt;b&gt;" + typedVal + "&lt;/b&gt;") the problem is that if I have in the innerHTML e.g. AA it will not work since the value is in upper case,how can I overcome it? I cannot use the following since I want to keep the value with the original case so in this example upper case... element.innerHTML = element.innerHTML.toLowerCase().replace(typedVal, "&lt;b&gt;" + typedVal + "&lt;/b&gt;")
answer count: 2
has title: Replace string char but keep the case type
has comment: http://stackoverflow.com/comment/45951261
downvote count: 0
has answer: http://stackoverflow.com/a/28841108
tagged with: jquery
favorite count: 0

http://stackoverflow.com/q/28901166
has answer: http://stackoverflow.com/a/28907499
score: 27
accepted answer: http://stackoverflow.com/a/28907499
tagged with: jsonp
upvote count: 27
tagged with: cors
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: ajax
has body: Context: To quote the Mozilla documentation: Normal script tags will pass minimal information to the window.onerror for scripts which do not pass the standard CORS checks. To allow error logging for sites which use a separate domain for static media, several browsers have enabled the crossorigin attribute for scripts using the same definition as the standard img crossorigin attribute. We realized our scripts were suffering from this issue ever since we moved our javascript to a CDN. We added the crossorigin attribute to our script tags, which works fine for the "hardcoded" script tags, but we load some scripts dynamically, and I can't figure out how to add the crossorigin tag to these scripts. In Chrome 40: If I add a script tag dynamically using Javascript, like so: var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.type = 'text/javascript'; script.charset = 'utf-8'; script.crossorigin = 'anonymous'; script.src = some_url_on_another_domain; head.appendChild(script); I would expect for the crossorigin tag to get added to the script tag that gets inserted into my document. However, when I examine the script tag in Developer tools, it is clearly not there. (And I can verify that the origin header is not being set in the request headers when requesting the script.) For now, I am falling back to using ajax requests for these cross domain scripts instead, so there are workarounds, but now I am curious if it's possible to add the crossorigin tag on dynamic script tags.
type: AnsweredQuestion
has title: How do I add the "crossorigin" tag to a dynamically loaded script?
type: Question

http://stackoverflow.com/q/28812042
favorite count: 0
has answer: http://stackoverflow.com/a/70772343
type: Question
has comment: http://stackoverflow.com/comment/109020556
score: 5
tagged with: php
answer count: 1
has body: I'd like to link the current visitor's IP to a specified user ID (via PHP) which Piwik should track across several (sub)domains. There are several (sub)domains and I want to give a visitor (IP), who is logging in at secure.example.com, a unique UserID to track him on all other domains. The link "IP -> UserID" at login should be made in PHP (Piwik Tracking PHP Client -> setUserId). The "normal" page tracking on all domains (including secure.example.com after login) should be based on JavaScript (Piwik JS tracking snippet). Example domains: www.example.com (siteId 1) support.example.com (siteId 2) secure.example.com (siteId 3) www.anotherexample.com (siteId 4) My current PHP login tracking code (called on secure.example.com/login): &lt;?php require_once 'PiwikTracker.php'; $siteId = 3; $apiUrl = 'http://piwik.example.com/'; $userId = '[TESTUSER]'; $piwik = new PiwikTracker($siteId, $apiUrl); $piwik-&gt;enableCookies('*.example.com'); $piwik-&gt;setIp($_SERVER['REMOTE_ADDR']); $piwik-&gt;setUserId($userId); $piwik-&gt;doTrackEvent('Login', 'Login', $userId); ?&gt; The JS tracking code for all other pages and domains (siteId changes): &lt;script type="text/javascript"&gt; var _paq = _paq || []; (function(){ var u="//piwik.example.com/"; _paq.push(['setSiteId', 1]); _paq.push(['setCookieDomain', '*.example.com']); _paq.push(['setDomains', '*.example.com']); _paq.push(['setTrackerUrl', u+'piwik.php']); _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.defer=true; g.async=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s); } )(); &lt;/script&gt; In Piwik config.ini.php I set the following values: [Tracker] enable_fingerprinting_across_websites=1 use_third_party_id_cookie = 1 visit_standard_length = 1800 window_look_back_for_visitor = 86400 My problem is: When I log into secure.example.com and then visit support.example.com (or www.example.com…
tagged with: matomo
upvote count: 5
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
tagged with: cross-domain
has title: Piwik: How do I track a visitor (User ID) across domains (PHP/JS)?

http://stackoverflow.com/q/28874191
linked to: http://stackoverflow.com/q/3191922
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28874288
has title: Need to active action on hover and back to original in 7 seconds
downvote count: 2
type: Question
possible better answer: http://stackoverflow.com/a/28874308
tagged with: http://stackoverflow.com/tag/gif
score: -2
has answer: http://stackoverflow.com/a/28874308
has comment: http://stackoverflow.com/comment/46010871
accepted answer: http://stackoverflow.com/a/28874288
answer count: 2
upvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: Im developing a site that contains few animation effects. I need to active gif(animation) on hover then once the courser is off it will be static again. On hover I need Image1 to disappear and show image2 then once the mouse is gone, image1 will appear again after 7 seconds. ex. Image1 is a tv with curtains, once the mouse is on it, image1 will disappear and show image2 then after 7 seconds image one will appear again. What is the best way to pull this off?
tagged with: animation
tagged with: css

http://stackoverflow.com/comment/45939310
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28833756
has text: Is here anyone whow can give me a simple example using his.field_manager.set_values with javascript in openerp.
score: 0

http://stackoverflow.com/q/28774368
score: 0
has body: Take a look at the code below, with the console open. There are a handful of nodes logged to the console. function recurseChildren(element) { var children = element.childNodes, length = children.length; if (length) { for (var i = 0; i &lt; length; i++) { console.dir(children[i]); recurseChildren(children[i]); } } } recurseChildren(document.body); Then run this in the console: document.body.childNodes.length; There's 23 logged at that point. Shouldn't the recurseChildren() function do a console.dir of a whole lot of items?
answer count: 1
has answer: http://stackoverflow.com/a/28774541
accepted answer: http://stackoverflow.com/a/28774541
has comment: http://stackoverflow.com/comment/45827362
has title: Recurse over childNodes
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45827290
type: Question
tagged with: nodelist
tagged with: child-nodes
tagged with: javascript

http://stackoverflow.com/a/30495399
has comment: http://stackoverflow.com/comment/71821592
score: 37
has comment: http://stackoverflow.com/comment/71821448
type: Answer
has comment: http://stackoverflow.com/comment/98329402
has comment: http://stackoverflow.com/comment/71601107
has comment: http://stackoverflow.com/comment/66642420
has comment: http://stackoverflow.com/comment/66648113
has comment: http://stackoverflow.com/comment/80130256
has body: The accepted answer doesn't work as tested using the WKWebView vs UIWebView app As the article mentions, the only HTML5 feature difference is IndexedDB support. So I'd go for a more reliable pattern with: if (navigator.platform.substr(0,2) === 'iP'){ //iOS (iPhone, iPod or iPad) var lte9 = /constructor/i.test(window.HTMLElement); var nav = window.navigator, ua = nav.userAgent, idb = !!window.indexedDB; if (ua.indexOf('Safari') !== -1 &amp;&amp; ua.indexOf('Version') !== -1 &amp;&amp; !nav.standalone){ //Safari (WKWebView/Nitro since 6+) } else if ((!idb &amp;&amp; lte9) || !window.statusbar.visible) { //UIWebView } else if ((window.webkit &amp;&amp; window.webkit.messageHandlers) || !lte9 || idb){ //WKWebView } } You may ask: Why not using the UserAgent? That's because Android browsers use it as settings! So, we should never trust any UAs. Only browser features and property checks as such. Also I noticed that the QuickTime plugin was always loaded as part of Older Safari and other Browsers in UIWebView. But the plugin is no longer present in WKWebView. So you can use the QuickTime plugin presence as an extra check. 9/23/16 Edit: I adjusted the code for Safari 10 which no longer allowed the sole idb check to be reliable, as mentioned by @xmnboy. To discard Safari 10, it checks for the old webkit engine bug, which only applied until Safari 9.2; and i use a window.statusbar.visible fallback which appears to be a reliable indicator signal after a few comparison tests between iOS 9 and 10. (please check though)
has comment: http://stackoverflow.com/comment/66642814
has comment: http://stackoverflow.com/comment/80153788
upvote count: 37
has comment: http://stackoverflow.com/comment/100595795
has comment: http://stackoverflow.com/comment/71599336
has comment: http://stackoverflow.com/comment/112368987
has comment: http://stackoverflow.com/comment/80152135
answers question: http://stackoverflow.com/q/28795476
downvote count: 0
has comment: http://stackoverflow.com/comment/66713268

http://stackoverflow.com/comment/45931309
comment on: http://stackoverflow.com/a/28830315
type: Comment
score: 1
has text: what is the problem? Make sure $button is referencing the button correctly and this should definitely disable the button after click and enable it if its complete.
type: AnswerComment

http://stackoverflow.com/comment/45885408
has text: You need to submit form to get value in another page.
comment on: http://stackoverflow.com/q/28806155
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45856722
type: Comment
comment on: http://stackoverflow.com/a/28790510
has text: Oh, I just saw you update. sorry, I wasnt refreshing the page. Let me ask you this, in your second example, How can I make the form more dynamic, some time I need combobox / checkbox / radios / textarea and so, your example stricked me to a single type of field. thanks
type: AnswerComment
score: 0

http://stackoverflow.com/a/28821587
upvote count: 2
has body: To do this the idea is to intercept anything being sent to the console. Here is a cross browser solution. function takeOverConsole(){ var console = window.console if (!console) return function intercept(method){ var original = console[method] console[method] = function(){ var message = Array.prototype.slice.apply(arguments).join(' ') // do sneaky stuff if (original.call){ // Do this for normal browsers original.call(console, message) }else{ // Do this for IE original(message) } } } var methods = ['log', 'warn', 'error'] for (var i = 0; i &lt; methods.length; i++) intercept(methods[i]) } Found this from taking-over-console-log/ Here I call the the function, and do a simple log "hey". It will interecept it and I will alert the intercepted message. http://jsfiddle.net/Grimbode/zetcpm1a/ To explain how this function works: We declare a variable console with the actual console. If the console is undefined we just stop right away and leave the function. We declare var methods = ['log', 'warn', 'error'] for the different console message types We loop through the methods and call the intercept function and send the console type (string: 'log', 'warn', etc). Intercept function simply applies a listener~ to that type of console message. In our case we are applying a listener to log, warn and error. We retrieve the message and put it in the message variable. Since we intercepted the message, it won't be shown in the console, so we go ahead and original.call() or original() to add it to the console.
has comment: http://stackoverflow.com/comment/45915176
answers question: http://stackoverflow.com/q/28821484
has comment: http://stackoverflow.com/comment/45914980
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45915159
accepted answer of: http://stackoverflow.com/q/28821484
type: Answer
has comment: http://stackoverflow.com/comment/45915190
score: 2

http://stackoverflow.com/q/28876076
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28876677
has answer: http://stackoverflow.com/a/28876677
answer count: 3
upvote count: 1
has comment: http://stackoverflow.com/comment/46014470
has body: I have a requirement in my project whereby we have some input boxes and we are supposed to enter timings. Timings can be entered in any format i.e 12:30a or 1230 or 1430 or 14:30. The problem with timings entered in 1230 or 1430 format is that I cannot properly parse them via Data.parse('1230'). I have to parse the timings to convert them into date objects so that i can perform more operations on them. So for this requirement I have to enter a colon between these timings.I.E convert 1230 to 12:30 and 1430 to 14:30. Timings I have to Support : 12 Hour : 1230a,1230am,12:30a,12:30am 24 Hour : 1430,14:30
favorite count: 0
has answer: http://stackoverflow.com/a/28876166
has comment: http://stackoverflow.com/comment/46014396
tagged with: regex
accepted answer: http://stackoverflow.com/a/28876536
type: AnsweredQuestion
downvote count: 0
score: 1
has title: Insert colon separator into timings ( i.e convert 1230a to 12:30a and 1430 to 14:30 )
has answer: http://stackoverflow.com/a/28876536
type: Question
has comment: http://stackoverflow.com/comment/46014212

http://stackoverflow.com/a/28862072
has comment: http://stackoverflow.com/comment/45989412
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/28861733
has body: The directive ng-repeat creates a scope for every item that it iterates through. Part of the data assigned to this scope is the attribute $index which will be equal to the index in the array of the item/object. Source: https://docs.angularjs.org/api/ng/directive/ngRepeat
answers question: http://stackoverflow.com/q/28861733
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/45990623

http://stackoverflow.com/a/28766431
has body: This is because you are binding the events to elements that do not yet exist. Use jQuery delegation to enable handlers on not yet existing elements: $("body").on("click", ".removeButton", function() { alert(this.id); });
type: Answer
answers question: http://stackoverflow.com/q/28766342
score: 0

http://stackoverflow.com/q/28857942
type: Question
has comment: http://stackoverflow.com/comment/45981874
tagged with: javascript
has comment: http://stackoverflow.com/comment/45983583
has answer: http://stackoverflow.com/a/28859667
score: 0
has comment: http://stackoverflow.com/comment/45981976
answer count: 1
has title: Ng-model not working for attribute directive
tagged with: angularjs
has comment: http://stackoverflow.com/comment/45983709
has body: I have a simple controller: .controller("TestController",['$scope', function($scope) { this.p = {}; this.p.name = "Foo"; this.p.surname = "Bar"; }]); And I have a directive calling this controller: app.directive('cronosDataset',[function() { return { restrict: 'A', controller:'TestController', controllerAs: "ctrl", scope: { cronosDataset : "@" } }; }]) If I call the controller using ng-controller the ng-model works fine. But if I call it through the directive it doesn't update the view: Works Name: Surname: Doesn't work Name2: Surname2: Edit: I can put it to work if I don't use isolated scope (scope : {...} in directive definition). I'm only using isolated scope to have access to this attribute scope: { cronosDataset : "@" } inside my controller. If there's a different way to do it without use isolated scope then problem solved! What I'm trying to archive is to reuse the logic I have done to get data from database Example: In my controller I go to database (ajax using cronos-dataset as query parameter) and put the result back in p variable. So i need two things: 1 - Have access to attribute inside the controller 2 - Update the ng-model with a scope variable Does it make sense? Here is a PLUNKER
accepted answer: http://stackoverflow.com/a/28859667
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45983373
has comment: http://stackoverflow.com/comment/45981915
has comment: http://stackoverflow.com/comment/45982182

http://stackoverflow.com/a/28826489
answers question: http://stackoverflow.com/q/28823002
score: 1
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/45948039
has body: I would inject the content of your popup.html in the pages matching specified URL. This simplify your actions to fill your forms (you do no have to click on the extension icon) It does not glut your browser with an additional icon For doing this, first modify your manifest: { "name": "FillForm", "version": "1.0", "manifest_version": 2, "description": "FillForm", "content_scripts": [ { "matches": ["http://*.xxx.com/*"], // put your URL pattern here "js": ["popup_inject.js"] } ], "web_accessible_resources": ["popup.html"] "permissions": ["activeTab"] } and in popup_inject.js var iframe = document.createElement ("iframe"); iframe.src = chrome.extension.getURL ("popup.html"); iframe.style.position="absolute"; iframe.style.top="10px"; iframe.style.right="10px"; iframe.style.border="solid 1px #aaa"; document.querySelector("body").appendChild(iframe);
type: Answer

http://stackoverflow.com/a/46053407
score: 1
has body: Yes, you can set class or id of button using theme property. buttons: { 'myButton': { symbol: 'circle', symbolFill: '#B5C9DF', hoverSymbolFill: '#779ABF', theme: { class: "myButton highcharts-button highcharts-button-normal", id: "myDiamondButton" } } }
upvote count: 1
answers question: http://stackoverflow.com/q/28841162
type: Answer
downvote count: 0

http://stackoverflow.com/comment/45916575
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28822242
has text: @molliminous [**Here is a version**](http://jsfiddle.net/3p998gxk/1/) with full `if` statements.
type: AnswerComment

http://stackoverflow.com/q/28779987
has title: How do I halt this setInterval function?
linked to: http://stackoverflow.com/q/5978519
tagged with: javascript
tagged with: jquery
duplicate of: http://stackoverflow.com/q/5978519
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28780002
type: Question
answer count: 1
score: 0
accepted answer: http://stackoverflow.com/a/28780002
has body: This loops forever, how do I stop it at the marked location? $.fn.writeText = function(content) { var contentArray = content.split(""), current = 0, elem = this; setInterval(function() { if(current &lt; contentArray.length) { elem.text(elem.text() + contentArray[current++]); } else{ //stop here. } }, 100); }; $("#ID").writeText("Texty text text"); Thanks. I think it's supposed to be clearTimeout(), but I'm not sure how.
has comment: http://stackoverflow.com/comment/45837084

http://stackoverflow.com/comment/46000701
has text: To be honest I dont think any of us understand what you want.
type: Comment
comment on: http://stackoverflow.com/a/28868141
score: 0
type: AnswerComment

http://stackoverflow.com/comment/45995833
type: Comment
comment on: http://stackoverflow.com/q/28865395
has text: pass all those sorting flags through your jquery function to the page doing the searching?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45797020
comment on: http://stackoverflow.com/q/28758127
score: 0
type: Comment
type: QuestionComment
has text: You do realize that `and` isn't Javascript right? It would likely be `&&`.

http://stackoverflow.com/q/28827757
upvote count: 1
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/28828325
tagged with: javascript
has comment: http://stackoverflow.com/comment/45927127
has comment: http://stackoverflow.com/comment/45927513
has comment: http://stackoverflow.com/comment/45928721
possible better answer: http://stackoverflow.com/a/28833289
score: 0
has answer: http://stackoverflow.com/a/28828325
has comment: http://stackoverflow.com/comment/45926972
answer count: 2
has comment: http://stackoverflow.com/comment/45926080
has comment: http://stackoverflow.com/comment/45926818
has comment: http://stackoverflow.com/comment/45926462
has title: Retaining the radio button even after the submit button is clicked
favorite count: 0
has comment: http://stackoverflow.com/comment/45934439
has body: I have 2 radio buttons 1.)Visit log and 2.)Case history. And a submit button "GET Report". When I click on Case history I get 2 other sub radio buttons saying "incident" and "sources", My problem is after making selection among these sub radio buttons and clicking on submit, the sub radio buttons vanish. I need the radio sub radio buttons to stay even after clicking on submit. This is my code: Visit Log Case History Incident Sources How can I Retain my 2 sub radio buttons with selected radio option even after the submit button? plz help
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/45927707
has answer: http://stackoverflow.com/a/28833289
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45926319

http://stackoverflow.com/comment/45963963
has text: First..Instead of doing `$("empName")`.. do `$("#empName")`
score: 0
comment on: http://stackoverflow.com/q/28847999
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/45863492
has text: Thanks, Is there anyway to keep these functions outside the controller or angular? Keeping them inside couples the code and I am trying to keep the code separate..
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/28775495

http://stackoverflow.com/q/28870647
type: Question
has comment: http://stackoverflow.com/comment/46005155
linked to: http://stackoverflow.com/q/12419619
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/46005205
score: 0
accepted answer: http://stackoverflow.com/a/28870989
has comment: http://stackoverflow.com/comment/46005375
tagged with: angularjs
has comment: http://stackoverflow.com/comment/46004969
has comment: http://stackoverflow.com/comment/46005059
has comment: http://stackoverflow.com/comment/46006423
has title: In angular, can I combine ng-repeat with ng-model?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/28870989
has body: I want ng-model for that button to be in relation with the ng-repeat: &lt;a ng-repeat="x in [1,2,3,4]" ng-model="myButton[x]"&gt;{{myButton[x]}}&lt;/a&gt; Controller: var id = 4; $scope.myButton[id] = ' :( '; I would like to create a variable whose name is a combination of external values. Also, it would be very much appreciated if you have any tips how such a thing is generally approached, for I think that I am reinventing the wheel in a silly way.
has comment: http://stackoverflow.com/comment/46004841

http://stackoverflow.com/comment/45847855
type: QuestionComment
has text: Could button 4 not just be styled to be greyed out originally?
comment on: http://stackoverflow.com/q/28785781
score: 0
type: Comment

web-inspector
tags question: http://stackoverflow.com/q/28790209
type: Tag
tag name: web-inspector

http://stackoverflow.com/comment/45974926
type: Comment
comment on: http://stackoverflow.com/q/28849782
has text: That's up to the package author. If I were you, I would create an issue about it on the package's GitHub page. You can also create your own package that adds `Papa` on the server. Just copy his package and change the line of code I linked to earlier to `api.addFiles('papa-parse.js', ['client', 'server']);` or `api.addFiles('papa-parse.js', 'server');`, depending on desired functionality.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/45944363
type: Comment
comment on: http://stackoverflow.com/a/28837348
type: AnswerComment
score: 0
has text: I'm not familiar with the `\9 hack`. Maybe it only works when it's reading the CSS file, not in style attributes.

http://stackoverflow.com/comment/45809603
type: Comment
comment on: http://stackoverflow.com/a/28764836
has text: Wow, it works! But I do not understand how "next()" works... app.get() looks like app.get('/city', callback(req, res, next) [,callback(req, res, next)...]) when "next" call new callback?
score: 0
type: AnswerComment

http://stackoverflow.com/comment/46738622
has text: The first line states "Using Ember debug Chrome extension" - is that different to the Ember Inspector?
type: Comment
comment on: http://stackoverflow.com/a/29231399
type: AnswerComment
score: 0

http://stackoverflow.com/a/28791561
has comment: http://stackoverflow.com/comment/45859725
has comment: http://stackoverflow.com/comment/45859971
has comment: http://stackoverflow.com/comment/45859854
has comment: http://stackoverflow.com/comment/45858233
downvote count: 0
answers question: http://stackoverflow.com/q/28791490
has comment: http://stackoverflow.com/comment/45860049
has comment: http://stackoverflow.com/comment/45860165
has comment: http://stackoverflow.com/comment/45859826
type: Answer
has comment: http://stackoverflow.com/comment/45859753
score: 1
has comment: http://stackoverflow.com/comment/45859912
upvote count: 1
has body: Just put \d and . inside a character class , so that it would match an digit or a dot. [\d.]

plc
tags question: http://stackoverflow.com/q/28902185
tag name: plc
type: Tag

http://stackoverflow.com/comment/46002783
type: Comment
has text: What fields do I need to add events too?
comment on: http://stackoverflow.com/a/28823651
type: AnswerComment
score: 0

http://stackoverflow.com/comment/73089249
type: AnswerComment
comment on: http://stackoverflow.com/a/28823864
has text: i tried this way, but array was not sorted properly. May be because my unique situation. i don't know
score: 0
type: Comment

http://stackoverflow.com/q/28766342
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/28766439
has body: I am adding extra selects and text fields to a form using jQuery. However I want to be able to remove added text fields using the remove button. Once a field has been added jQuery can not seem to detect it. jQuery var counter = 2; $("#addButton").click(function () { var newTextBoxDiv = $(document.createElement('div')) .attr("id", 'contact-list-div-' + counter).attr("class", 'contact-list-div'); newTextBoxDiv.after().html(' ' + ' ' + ' Remove Button '); newTextBoxDiv.appendTo("#contact-list"); counter++; }); $(".removeButton").click(function() { alert(this.id); //this never shows, only on the element that was //added directly added using html, in this case removeButton-1 }); HTML Remove Button
favorite count: 0
has answer: http://stackoverflow.com/a/28766411
answer count: 5
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28766507
has answer: http://stackoverflow.com/a/28766503
type: Question
downvote count: 1
tagged with: javascript
tagged with: jquery
has title: Remove buttons added by jQuery
has answer: http://stackoverflow.com/a/28766431
score: 0

http://stackoverflow.com/a/28853014
answers question: http://stackoverflow.com/q/28852975
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45973423
has comment: http://stackoverflow.com/comment/45973994
has comment: http://stackoverflow.com/comment/45973953
has body: Assuming you are replacing all these a1 with foo, you can use: var input = 'a1 +a1 +a1:a10 + b1 + c1:d10 + a1:a1 +a1+ a1 + a1 pa1'; var re = /(^|[^:]\b)a1\b(?!:)/g; var arr=[]; while (m = re.exec(input)) { arr.push(m[1]); } console.log ( arr ); ["a1", "a1", "a1", "a1", "a1"] RegEx Demo
has comment: http://stackoverflow.com/comment/45973282
score: 0
has comment: http://stackoverflow.com/comment/45973156
type: Answer
has comment: http://stackoverflow.com/comment/45973675
has comment: http://stackoverflow.com/comment/45973917
has comment: http://stackoverflow.com/comment/45972911
has comment: http://stackoverflow.com/comment/45975432
has comment: http://stackoverflow.com/comment/46067540
has comment: http://stackoverflow.com/comment/45973731
has comment: http://stackoverflow.com/comment/45973538
has comment: http://stackoverflow.com/comment/45975259
has comment: http://stackoverflow.com/comment/45974571
has comment: http://stackoverflow.com/comment/45973810
accepted answer of: http://stackoverflow.com/q/28852975

http://stackoverflow.com/comment/45978275
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28851893
has text: @OrGuz the autocomplete directive is a little complex
score: 0

http://stackoverflow.com/a/28783157
score: 0
accepted answer of: http://stackoverflow.com/q/28756472
type: Answer
answers question: http://stackoverflow.com/q/28756472
has body: This error occurs since in success callback you've already getting results object: success(data.d) //&lt;-- data.d returns results object So, the solution would be to replace the line function success(data) { console.log(data.d.results); } with this one: function success(results) { console.log(results); } You could also consider to utilize some library when working with SharePoint 2010 RESTful API. The following example demonstrates how get list items using datajs JavaScript library: OData.read({ requestUri: _spPageContextInfo.webAbsoluteUrl + "/_vti_bin/listdata.svc/IceCreamTrucks?$select=State", enableJsonpCallback: true }, function (data) { for(var i =0; i &lt; data.results.length; i++) { console.log(data.results[i].State); } }, function (err) { // error function. });
type: AcceptedAnswer

http://stackoverflow.com/q/28852240
has body: I search a solution for solve this problem in JS. I've got an array with some objects, with a propery "name". I would like to order this array by a user search value. For example if user search "th", i would like an array order name begin by "th"etc... var arrayName = []; var emp1 = {nom: "Thomas"}; var emp2 = {nom: "Anastasia"}; var emp3 = {nom: "Arnaud"}; var emp4 = {nom: "Thierry"}; arrayName.push(emp1); arrayName.push(emp2); arrayName.push(emp3); arrayName.push(emp4); arrayName.orderBy("th"); In this code, orderBy method will be good if return the array sort by "th" and so return first "Thierry" object and second "Thomas". Thanks helping me !
tagged with: javascript
tagged with: sorting
linked to: http://stackoverflow.com/q/1129216
duplicate of: http://stackoverflow.com/q/1129216
favorite count: 0
has comment: http://stackoverflow.com/comment/45971230
answer count: 0
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/45971256
has comment: http://stackoverflow.com/comment/45971335
score: 1
type: Question
has title: Order in array of object JS
tagged with: arrays
downvote count: 0

http://stackoverflow.com/a/28842061
score: 3
upvote count: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/45953637
answers question: http://stackoverflow.com/q/28841973
type: Answer
has body: When you define a variable arrayname = 'linje_'+data[i]; then its type is String. Strings are not arrays, you can't treat them like array, they don't have array methods. If you want to dynamically construct the name of the variable, the best thing you can do is to use object and its keys: var lines = { linje_1: [], linje_2: [] }; for (var i = 0; i &lt; data.length; i++) { var arrayname = 'linje_' + data[i]; lines[arrayname].push({ label: data[i].x_ + sid[a], y: data[i].y_ + sid[a]}); } Also note, that I cleaned up the code a little (things like data[i].x_ + '' + sid[a] + '').

http://stackoverflow.com/a/28875971
answers question: http://stackoverflow.com/q/28875575
score: 0
type: Answer
has body: V31, You definitely need to bootstrap your module since you are using 1.3 because using controller as a global function like you've done has been deprecated in 1.3. See a complete working example below. Try it out and see if it helps you. Name: {{ cust.name}} ---- {{cust.city}} SO1

http://stackoverflow.com/comment/45891973
score: 1
has text: $('.class').css('-webkit-transform', 'rotate(' + anVar + 'deg)')
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28809759

http://stackoverflow.com/comment/83660017
type: Comment
comment on: http://stackoverflow.com/a/33993210
type: AnswerComment
has text: actually BEST ANSWER
score: 4

http://stackoverflow.com/comment/45818032
has text: Thanks Felix, I see. @JLRishe the set of all existing references (variables) reachable from within the function but defined outside the function
score: 0
type: Comment
comment on: http://stackoverflow.com/a/28769416
type: AnswerComment

http://stackoverflow.com/comment/46137917
has text: Your fiddle isn't working for me.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28901098

http://stackoverflow.com/comment/45901274
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/28814368
has text: @charlietfl, can you provide a bit more detail by chance. I was under the impression that dzsap_init was internal to this code I got for the player and not a shared library. A quick search indicates this is true as it only yields results related to ZoomSounds player (which I was I am using).
score: 0

http://stackoverflow.com/a/28784344
accepted answer of: http://stackoverflow.com/q/28784274
has body: New date object from miliseconds: var dateFromMs = new Date(1425133515000); And comparsion based on How to know date is today?: var today = new Date(); if (today.toDateString() === dateFromMs.toDateString()) { alert('today'); }
answers question: http://stackoverflow.com/q/28784274
score: 3
upvote count: 3
type: AcceptedAnswer
type: Answer
downvote count: 0

expression
tags question: http://stackoverflow.com/q/28830489
tag name: expression
tags question: http://stackoverflow.com/q/28761732
type: Tag

cors
type: Tag
tag name: cors
tags question: http://stackoverflow.com/q/28811269
tags question: http://stackoverflow.com/q/28867269
tags question: http://stackoverflow.com/q/28858411
tags question: http://stackoverflow.com/q/28901166
tags question: http://stackoverflow.com/q/28862327
tags question: http://stackoverflow.com/q/28855198
tags question: http://stackoverflow.com/q/28868869

http://stackoverflow.com/a/28845042
score: 1
upvote count: 1
has body: A simple typo: furniId instead of furniID on the last line JavaScript is case-sensitive so if you capitalize a variable name differently it's a completely different variable, and so it does not know what you mean.
accepted answer of: http://stackoverflow.com/q/28844924
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/28844924
type: Answer

http://stackoverflow.com/a/28840688
answers question: http://stackoverflow.com/q/28839134
has body: This is just an alternative using only css General sibling selectors #nime{display: none} [name=nieu]:checked ~ #nime{display: block} Newspaper? How? Email Post Both css adjacent selector remove #nime{display: none;clear: both} [name=nieu]:checked + #nime{display: block} Newspaper? How? Email Post Both
score: 0
type: Answer

http://stackoverflow.com/q/28813197
tagged with: javascript
score: 4
has answer: http://stackoverflow.com/a/38835405
upvote count: 4
answer count: 3
downvote count: 0
favorite count: 0
possible better answer: http://stackoverflow.com/a/28813580
has title: ChartJS - remove axis?
has body: Using ChartJS, Can I disable both the horizontal and vertical axes? I can use these options, but they specifically don't affect the axes: //Boolean - Whether to show horizontal lines (except X axis) scaleShowHorizontalLines: true, //Boolean - Whether to show vertical lines (except Y axis) scaleShowVerticalLines: true, https://github.com/nnnick/Chart.js
has answer: http://stackoverflow.com/a/28813580
accepted answer: http://stackoverflow.com/a/38835405
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/68687762
type: Question
tagged with: chart.js

http://stackoverflow.com/comment/45894683
comment on: http://stackoverflow.com/q/28811129
has text: You need to define the url of the backend resource on the bb model or collection and call the corresponding methods on an instance of the model / collection (fetch, save, destroy);
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28821896
tagged with: jquery-deferred
tagged with: javascript
possible better answer: http://stackoverflow.com/a/28824087
tagged with: jquery
has comment: http://stackoverflow.com/comment/45916412
tagged with: ajax
score: 0
has title: Multiple Promise Chains in Single Function
answer count: 4
has answer: http://stackoverflow.com/a/28833228
has body: I have some code that will dynamically generate an AJAX request based off a scenario that I'm retrieving via an AJAX request to a server. The idea is that: A server provides a "Scenario" for me to generate an AJAX Request. I generate an AJAX Request based off the Scenario. I then repeat this process, over and over in a Loop. I'm doing this with promises here: http://jsfiddle.net/3Lddzp9j/11/ However, I'm trying to edit the code above so I can handle an array of scenarios from the initial AJAX request. IE: { "base": { "frequency": "5000" }, "endpoints": [ { "method": "GET", "type": "JSON", "endPoint": "https://api.github.com/users/alvarengarichard", "queryParams": { "objectives": "objective1, objective2, objective3" } }, { "method": "GET", "type": "JSON", "endPoint": "https://api.github.com/users/dkang", "queryParams": { "objectives": "objective1, objective2, objective3" } } ] This seems like it would be straight forward, but the issue seems to be in the "waitForTimeout" function. I'm unable to figure out how to run multiple promise chains. I have an array of promises in the "deferred" variable, but the chain only continues on the first one--despite being in a for loop. Could anyone provide insight as to why this is? You can see where this is occuring here: http://jsfiddle.net/3Lddzp9j/10/
has comment: http://stackoverflow.com/comment/45915628
linked to: http://stackoverflow.com/q/750486
has answer: http://stackoverflow.com/a/28824591
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/28833228
has answer: http://stackoverflow.com/a/28824087
has comment: http://stackoverflow.com/comment/45916470
type: Question
has answer: http://stackoverflow.com/a/28828082

http://stackoverflow.com/comment/45843169
score: 1
type: AnswerComment
has text: Unfortunately , i tried the fiddle and it does nothing after i upload the excel sheet.
type: Comment
comment on: http://stackoverflow.com/a/28782782

http://stackoverflow.com/comment/46569404
comment on: http://stackoverflow.com/a/29174715
type: AnswerComment
score: 4
type: Comment
has text: @thorn Yes, my answer has theory. But it has also practice! When I point out a few *third-party* experiences such as Bobince's and Terry's (even those weren't mine) they're about reality. Well, anyway, I thought it would be someway a good contribution.

http://stackoverflow.com/a/28806013
type: Answer
downvote count: 0
score: 1
has body: One way is to set up a default global transition You can set up the default global transition like this: $(document).bind("mobileinit", function(){ //these are the jqm default values for these transition types by the way. $.mobile.defaultDialogTransition = "pop"; $.mobile.defaultPageTransition = "fade"; }); if you're looking for custom transitions for a specific event, you could use this : $.mobile.changePage("yourpage.html", {transition:"slide"}); rather than a plain HTML link, or a window.location=something;
accepted answer of: http://stackoverflow.com/q/28805935
upvote count: 1
answers question: http://stackoverflow.com/q/28805935
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45885135

http://stackoverflow.com/comment/45961021
score: 0
comment on: http://stackoverflow.com/q/28846053
has text: Pull the text from the file with php and convert to html
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28789727
score: 0
has title: How to show single value of array using for loop in mail function?
tagged with: email
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45855549
tagged with: php
has comment: http://stackoverflow.com/comment/45871543
has body: I am using the mail function to send the form details directly in mail. There is a option in which user can attach 20 images which i can send in mail . Attachments are going , but i have to show image name in front of specific measurement. http://netraserve.com/copycat/ above is the site , in which when we click Get a quote a form appears ,then in the end of form there is how many parts ? option . When some one will select values in that a form appears . I have to send the image name also with measurements. Below is the code i am using , but doesnt know how to send the particular image name under particular measurement. for($x=1;$x<=count($filteredarray);$x++) { $message .= " Measurements-" .$x." ".$_REQUEST['width'.$x]."X".$_REQUEST['length'.$x]."X".$_REQUEST['height'.$x]." Covered:".$_REQUEST['covered'.$x].",Zippers:".$_REQUEST['zip'.$x].",Velcro:".$_REQUEST['vel'.$x].",Image:"; } as in the end there is image written. but i have to send image name also. Images are stored in filtered array.
type: Question
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/45855221

http://stackoverflow.com/a/28773909
has comment: http://stackoverflow.com/comment/45826660
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/45827011
answers question: http://stackoverflow.com/q/28773281
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/45826595
score: 2
has comment: http://stackoverflow.com/comment/45826457
accepted answer of: http://stackoverflow.com/q/28773281
has comment: http://stackoverflow.com/comment/45826531
has body: A more elegant way to do this would be to append the text &lt;td&gt;s and then append the button &lt;td&gt;s. Then you could append the buttons directly in the second column. // Append the first column, using the data already stored in the rows rows.append("td").html(function(d){ return d; }); // Append the second column, which has no text but contains a button // with an onclick function var buttonColumn = rows.append("td"); buttonColumn.append("button") .text("Click me!") .on("click", function(d){ return clickaction(d); }); If however you want to use your current approach, you could append a &lt;button&gt; using D3 within the &lt;td&gt;, which will allow you to use button.on("click", function(){ ... }): .html(function (d) { if (d.column === columns[0]) return d.text; else if (d.column === columns[1]) { // Append a button as a side-effect var button = d3.select(this).append("button") .text("Click me!") .on("click", function(){ clickaction(d); }) // Return nothing return ""; } });

http://stackoverflow.com/a/32294026
has comment: http://stackoverflow.com/comment/52950247
upvote count: 63
has comment: http://stackoverflow.com/comment/53084677
score: 60
has body: the publicPath is just used for dev purpose , I was confused at first time I saw this config property, but it makes sense now that I've used webpack for a while suppose you put all your js source file under src folder, and you config your webpack to build the source file to dist folder with output.path. But you want to serve your static assets under a more meaningful location like webroot/public/assets, this time you can use out.publicPath='/webroot/public/assets', so that in your html, you can reference your js with &lt;script src="/webroot/public/assets/bundle.js"&gt;&lt;/script&gt;. when you request webroot/public/assets/bundle.js the webpack-dev-server will find the js under the dist folder Update: thanks for Charlie Martin to correct my answer original: the publicPath is just used for dev purpose, this is not just for dev purpose No, this option is useful in the dev server, but its intention is for asynchronously loading script bundles in production. Say you have a very large single page application (for example Facebook). Facebook wouldn't want to serve all of its javascript every time you load the homepage, so it serves only whats needed on the homepage. Then, when you go to your profile, it loads some more javascript for that page with ajax. This option tells it where on your server to load that bundle from
has comment: http://stackoverflow.com/comment/52951376
has comment: http://stackoverflow.com/comment/52936395
type: Answer
has comment: http://stackoverflow.com/comment/52950522
has comment: http://stackoverflow.com/comment/53096220
has comment: http://stackoverflow.com/comment/53084699
downvote count: 3
answers question: http://stackoverflow.com/q/28846814

http://stackoverflow.com/comment/46007769
comment on: http://stackoverflow.com/q/28872240
has text: If this is soo simple, then please provide the solution, if the question isn't clear, please ask for more info like @MartinJ. did(+1 for your comment). How the hell can you guys give a negative for someone who just entered SO. just give a detailing first like provide more code or brief your question etc...
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/28757063
has answer: http://stackoverflow.com/a/28769747
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/28757102
answer count: 4
has answer: http://stackoverflow.com/a/28757085
type: Question
has answer: http://stackoverflow.com/a/28757282
upvote count: 2
has title: Executing list of functions jquery
score: 0
downvote count: 2
has comment: http://stackoverflow.com/comment/45795172
has comment: http://stackoverflow.com/comment/45795399
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/4908378
has body: I would like execute a list of functions, something like this: window.onkeypress = [f1(), f2(), f3(), fn() ...] ... Its possible ??? UPDATE Well, the point is that for event.keycode I have to execute a lis of functions, but I want set the list of functions of generical type, example: JQueryExtension.eventKeyCode[33] = [f1(), f2(), fn() ...]; JQueryExtension.KeyBoardControl = function (event) { if (event.shiftKey &amp;&amp; event.keyCode == 33) { JQueryExtension.eventKeyCode[event.keyCode]; return; } };` And at the end make this: window.onkeypress = JQueryExtension.KeyBoardControl; :D !! UPDATE Ok, some thing like this, might Works ?? JQueryExtension.eventKeyCode = new Array(); JQueryExtension.KeyBoardControl = function (event) { if (event.shiftKey &amp;&amp; event.keyCode == 33) { for (var i = 0; i &lt; JQueryExtension.eventKeyCode.length; i++) { if (JQueryExtension.eventKeyCode[i] == event.keyCode) { var listOfFunctions = JQueryExtension.eventKeyCode[i]; for (var j = 0; j &lt; listOfFunctions.length; j++) { listOfFunctions[j](); } } } return; } }; window.onkeypress = JQueryExtension.KeyBoardControl; UPDATE Holly God,something like this: var functionsForKeyCodeOne = [ { keyCode: 33, theFunction: Billing.TheKnockOutDataTableViewModelCustomerSearcher.mainData([]) }, { keyCode: 33, theFunction: Billing.SetModalVisibility("searcherCustomerModal", "show") }, { keyCode: 33, theFunction: $('#searcherCustomerModal').on('shown.bs.modal', function() { $("#txtNameCustomer").focus(); }) } ]; JQueryExtension.eventKeyCode.push(functionsForKeyCodeOne); window.onkeypress = JQueryExtension.KeyBoardControl; JQueryExtension.KeyBoardControl = function (event) { if (event.shiftKey &amp;&amp; event.keyCode == 33) { for (var i = 0; i &lt; JQueryExtension.eventKeyCode.length; i++) { if (JQueryExtension.eventKeyCode[i].keyCode == event.keyCode) { var listOfFunctions = JQueryExtension.eventKeyCode[i]; for (var j = 0; j &lt; listOfFunctions.length; j++) { listOfFunctions[j].theFunction(); } }…
favorite count: 0
has comment: http://stackoverflow.com/comment/45794959

http://stackoverflow.com/q/28886835
score: 2
type: AnsweredQuestion
has body: My page makes an Ajax call which returns some HTML to embed in the page and a script to run, attaching JQuery tooltips to various elements of the embedded HTML. The HTML and script are returned as JSON objects by my Django backend, and appear OK in the page, but the Javascript doesn't seem to work when I evaluate it: $.ajax({ type: "GET", url: "/url/to/ajax", data: { "foo": bar }, success: function (data) { $("#my-table").html(data['html']); // alert(data['script']); // this works: I can see the script eval(data['script']); }, error: function () { $("#my-table").html(''); } }); The script itself looks like a series of expressions such as: $(".foobar1").tooltip({ content: "The foo to the bar.", tooltipClass: "tt-ref", show: null, close: function (event, ui) { ui.tooltip.hover( function () { $(this).stop(true).fadeTo(400, 1); }, function () { $(this).fadeOut("400", function () { $(this).remove(); }) }); } }); where foobar1 is a class in the HTML just added to the #my-table HTML. Can anyone see where I'm going wrong here? Both jquery and jquery-ui are loaded on my page.
possible better answer: http://stackoverflow.com/a/28887170
downvote count: 0
has answer: http://stackoverflow.com/a/28887170
tagged with: jquery
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/28887017
type: Question
has comment: http://stackoverflow.com/comment/46035223
answer count: 2
has comment: http://stackoverflow.com/comment/46035953
upvote count: 2
has comment: http://stackoverflow.com/comment/46035299
has title: Executing Javascript on return from Ajax
accepted answer: http://stackoverflow.com/a/28887017
has comment: http://stackoverflow.com/comment/46035113
has comment: http://stackoverflow.com/comment/46035144
has comment: http://stackoverflow.com/comment/46037009
has comment: http://stackoverflow.com/comment/46036638
tagged with: javascript

http://stackoverflow.com/a/28779063
has comment: http://stackoverflow.com/comment/45836055
accepted answer of: http://stackoverflow.com/q/28778546
type: Answer
has comment: http://stackoverflow.com/comment/45835706
has body: On jquery first check with an alert alert(xmlhttp.toSource()); alert(response.toSource()); alert(response.card_response); These alerts will tell you what values you are getting exactly.for eg. xmlhttp.status is 200 or not. Also, check in Firebug, is jquery malfunctioning?
has comment: http://stackoverflow.com/comment/45835970
score: 0
has comment: http://stackoverflow.com/comment/45835584
answers question: http://stackoverflow.com/q/28778546
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/45835717

http://stackoverflow.com/comment/45950340
comment on: http://stackoverflow.com/q/28840557
has text: Open your javascript console (F12 on windows). Any errors?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/28837018
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/45943950
tagged with: jquery-plugins
type: Question
has body: I have a JavaScript module that I would like to create a jQuery plugin interface to. The module itself is like this: var Foo = (function () { "use strict"; var self = {}; self.add = function (selector, otherParam) { // Does things unto selector. // Precisely what it does doesn't matter. }; return self; }()); and is used, with success, like this: Foo.add(a); Now, I would like to create a plugin that interfaces to this module, so I can use it somewhat like this: $.fn.foo = Foo; $.fn.foo.add = function (param) { var selector = this; Foo.add(selector, param); } $(elem).foo.add(a); The problem I'm facing is that I can't get "this" working in .add(). The best way I managed to do it was to not have Foo be self-initializing, and use a syntax like: $.fn.foo = Foo; $(elem).foo().add(a); It works, but I find it less aesthatically pleasing and less "clean". Is there a way to do this? Am I on the wrong approach altogether? Thankful for any input, and I apologize in advance if this has already been answered or is unfit in any other way. I did search for answers, but I'm not well-versed in plugin authoring nor an expert on jQuery itself. TL;DR: I have a module like Foo above, and would like to access it's members like a jQuery plugin.
upvote count: 1
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/28851450
has title: Properly get "this" in jQuery plugin member
accepted answer: http://stackoverflow.com/a/28851450
linked to: http://stackoverflow.com/q/15884096
linked to: http://stackoverflow.com/q/1117086
linked to: http://stackoverflow.com/q/16502467
has comment: http://stackoverflow.com/comment/45944250
has comment: http://stackoverflow.com/comment/45943727
has comment: http://stackoverflow.com/comment/45944565
type: AnsweredQuestion

http://stackoverflow.com/q/28805491
has comment: http://stackoverflow.com/comment/45973911
tagged with: javascript
tagged with: extjs
has comment: http://stackoverflow.com/comment/54541263
upvote count: 1
tagged with: extjs5
answer count: 1
accepted answer: http://stackoverflow.com/a/28900358
favorite count: 0
has body: Since I don't seem to be getting any answers on the Sencha Forum, I just repeat my question here: I'm currently migrating from 4.2.1 to 5.1.0.107 and am having problems understanding some stuff: Sencha dev evant states here that initConfig only needs to be called manually from the constructor in classes which don't use the Observable mixin. The first example of the Observable mixin in the docs says otherwise by manually calling it. Running the code as is from the docs results in an exception (hasListeners is undefined) which can be resolved by placing this.mixins.observable.constructor.call(this, config); into the constructor. Also it seems to me that initConfig can be removed from the example code from the docs without any drawbacks (at least none that I was able to reproduce)... The only difference in the 2 codes below is in the Employee constructor... Erroneous fiddle (Code copied from docs) Ext.define('Employee', { mixins: ['Ext.mixin.Observable'], config: { fullName: '' }, constructor: function(config) { this.initConfig(config); // We need to initialize the config options when the class is instantiated }, quitJob: function() { this.fireEvent('quit'); } }); var newEmployee = Ext.create('Employee', { fullName: 'Ed Spencer', listeners: { quit: function() { alert(this.getFullName() + " has quit!"); } } }); try { newEmployee.quitJob(); // Throws exception since hasListener is undefined } catch (exc) { alert('Error occurred: ' + exc.message); } Working fiddle (removed initConfig &amp; initialize mixin correctly) Ext.define('Employee', { mixins: ['Ext.mixin.Observable'], config: { fullName: '' }, constructor: function(config) { // Make code work by removing call to initConfig and initializing the observable mixin //this.initConfig(config); // We need to initialize the config options when the class is instantiated this.mixins.observable.constructor.call(this, config); }, quitJob: function() { this.fireEvent('quit'); } }); var newEmployee = Ext.create('Employee', { full…
has answer: http://stackoverflow.com/a/28900358
has comment: http://stackoverflow.com/comment/45990375
has comment: http://stackoverflow.com/comment/45990558
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45964281
downvote count: 0
score: 1
type: Question
has title: ExtJS 5: initConfig method & Observable mixin

http://stackoverflow.com/a/28777360
has body: createElement was introduced in 0.12, so there's no chance of getting it to work in 0.11 without backporting it. To do so, it'd look like this: React.createElement = function(tag){ var rest = Array.prototype.slice.call(arguments, 1); if (typeof tag === 'function') { return tag.apply(undefined, rest); } else if (typeof tag === 'string' &amp;&amp; React.DOM[tag]) { return React.DOM[tag].apply(undefined, rest); } else { console.error('React.createElement() expects a HTML tag name or ' + 'component as the first argument, but got (%s) %s', String(tag), typeof tag ); return null; } }; // partially applies createElement React.createFactory = function(tag){ return React.createElement.bind(null, tag); } The final case will also error on e.g. 'my-custom-element', which isn't supported at all in 0.11 and there's no way to fake it.
score: 1
accepted answer of: http://stackoverflow.com/q/28771446
answers question: http://stackoverflow.com/q/28771446
type: AcceptedAnswer
upvote count: 1
type: Answer
downvote count: 0

http://stackoverflow.com/comment/45800761
has text: Sharing your research helps everyone. Tell us what you've tried and why it didn't meet your needs. This demonstrates that you've taken the time to try to help yourself, it saves us from reiterating obvious answers, and most of all it helps you get a more specific and relevant answer! Also see [how to ask](http://stackoverflow.com/questions/how-to-ask)
type: Comment
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/28760333

http://stackoverflow.com/comment/45960849
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/28846146
has text: Do you mean if the page at the URL contains a keyword? Or the URL itself contains the keyword?
score: 0

http://stackoverflow.com/comment/46066646
type: QuestionComment
has text: it is jQuery code, but you should also add a jQuery library to your page. [**How to start with jQuery?**](http://www.w3schools.com/jquery/jquery_get_started.asp)
comment on: http://stackoverflow.com/q/28903277
type: Comment
score: 0

http://stackoverflow.com/q/28843522
has body: Hi I am new to AngularJS so forgive me if this is a simple problem. I have a simple directive that looks something like this: app.directive('myDirective', function() { return { restrict: 'E', transclude: true, replace: true, template: '&lt;div ng-transclude&gt;&lt;/div&gt;' }; }); I would ideally like the content that gets inserted into my div with ng-transclude to be generated using ng-repeat. So I have an HTML block like this: &lt;my-directive&gt; &lt;div ng-repeat="item in data"&gt;{{item.name}}&lt;/div&gt; &lt;/my-directive&gt; I know that my data array is populated in my controller properly as I can see the requests in my dev tool and i have logged my data object. However, my page isn't generated correctly, all I end up with is something like the following when I inspect my page content: &lt;my-directive&gt; &lt;!-- ngRepeat: item in data --&gt; &lt;/my-directive&gt; Is there something wrong with using ng-repeat inside of ng-transclude? I have searched but can't seem to find the answer. Thanks! EDIT: Here is the controller: app.controller('MyController', ['$scope', function($scope) { $scope.data = [{'name': 'Foobar'}]; }]);
tagged with: angularjs-directive
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/45956358
type: Question
accepted answer: http://stackoverflow.com/a/28843885
score: 0
tagged with: transclusion
answer count: 1
has comment: http://stackoverflow.com/comment/45956976
tagged with: javascript
has comment: http://stackoverflow.com/comment/45956997
tagged with: angularjs-ng-repeat
tagged with: angularjs
has title: AngularJS : ng-repeat in Directive ng-transclude
has answer: http://stackoverflow.com/a/28843885

http://stackoverflow.com/comment/46030476
comment on: http://stackoverflow.com/q/28884621
score: 0
type: QuestionComment
type: Comment
has text: go through some basic javascript tutorials.

http://stackoverflow.com/q/28848600
has title: Dynamically add different HTML tags to page using AngularJS
score: 1
type: Question
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/45965094
tagged with: http://stackoverflow.com/tag/html
has body: basically Im getting some information from the API and a loop will run and in that loop I need to add a h4 tag and button tag. But when I run the loop the h4 tag is added but not the button. Here is my code: $http.get('/api/get_form_fields.php?id=' + $rootScope.user.id) .then(function(data) { if (data.data != null) { $.each(data.data, function(i, v) { if (v.required == "Yes" &amp;&amp; v.type == "Upload") { var text = "&lt;h4&gt;" + v.caption + "&lt;/h4&gt;" + "&lt;input type='file' value='test'&gt;"; text = $sce.trustAsHtml(text); $scope.htmlstring += text; } }) } else { //no times available } }) .catch(function(error) { $scope.divisions = error; }); But if I take out the '+' in the this line $scope.htmlstring += text; the button shows but only the last elements in the loop gets added to the page. Thank you in advanced :)
favorite count: 0
tagged with: angularjs
answer count: 0
type: UnansweredQuestion
upvote count: 1

http://stackoverflow.com/q/28789184
tagged with: javascript
tagged with: jquery
tagged with: ajax
favorite count: 0
has comment: http://stackoverflow.com/comment/45859816
has comment: http://stackoverflow.com/comment/45854457
has comment: http://stackoverflow.com/comment/45856534
type: UnansweredQuestion
upvote count: 1
has title: Function seems to break when passed callback value, even though callback returns ok
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/45853985
has body: I'm writing a (non-commercial) book cataloging web application for a school, and the data about the books comes from two different sources: Google Books and Openlibrary.org. Google is more reliable, so I only rely on Openlibrary for library-style subject headings, which Google does not supply. I get the ISBN of the books from Google's api using $.getJSON, within which I callback to $.get, which calls a php script that uses curl to get around cross-domain rules and call the Openlibrary api using the Google-obtained ISBN as a parameter. This $.get passes the result from Openlibrary to a callback called printboxes(result) that uses the data from Google and OpenLibrary together to print some pre-populated HTML form fields, which can then be used to submit to a database. Sound more complicated than it needs to be? Maybe it is. The structure of this page is a search form where multiple books can be searched in a row (usually by scanning in their isbns) in one go, making a kind of super-form with a nested-array name structure, and then they can all be submitted at once. Originally, I had the individual book boxes .appending to a single main &lt;div&gt; within the &lt;form&gt;. Then I decided I wanted to have the searches .prepend, such that whatever the last book scanned was, it would appear at the top of the form so you could see it right away and make sure everything was kosher. This worked okay, but if the person selected that they wanted more than one result per search, then the results would stack up 54321 per search, rather than 12345. What I wanted was for the searches to stack 54321 on the page, but within each search, the results should appear 12345. So I caused another &lt;div id=\"searchcount\""+scount+"&gt; to be .prepended to the main form with each search, and then I .appended each individual result to $('#searchcount'+scount). This proved a step too far, and the printboxes(result) callback breaks. Examining the network activity showed that all the $.gets wer…
type: Question
downvote count: 0

http://stackoverflow.com/comment/45986894
score: 0
type: Comment
type: QuestionComment
has text: So, did you want radio buttons to behave like checkboxes?
comment on: http://stackoverflow.com/q/28860446